@opencxh/ui-kit 3.110.2 → 3.111.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 +1067 -1062
- package/dist/index.js.map +1 -1
- package/dist/src/action/FilterChip.d.ts +3 -1
- package/dist/src/content/PageHeader.d.ts +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx as qe } from "clsx";
|
|
2
2
|
import { jsxs as i, jsx as e, Fragment as fe } from "react/jsx-runtime";
|
|
3
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 Pe, 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 we, HardDrive as $e, ArrowLeft as ze, 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
|
-
import le, { useRef as se, useEffect as J, forwardRef as de, useState as
|
|
4
|
+
import le, { useRef as se, useEffect as J, 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 d(...t) {
|
|
6
6
|
return qe(t);
|
|
7
7
|
}
|
|
@@ -106,16 +106,16 @@ const ft = {
|
|
|
106
106
|
rightIcon: l,
|
|
107
107
|
iconOnly: c = !1,
|
|
108
108
|
shape: f = "default",
|
|
109
|
-
className:
|
|
109
|
+
className: p,
|
|
110
110
|
children: N,
|
|
111
|
-
disabled:
|
|
112
|
-
...
|
|
113
|
-
},
|
|
114
|
-
const v =
|
|
111
|
+
disabled: h,
|
|
112
|
+
...m
|
|
113
|
+
}, x) => {
|
|
114
|
+
const v = h || s;
|
|
115
115
|
return /* @__PURE__ */ i(
|
|
116
116
|
"button",
|
|
117
117
|
{
|
|
118
|
-
ref:
|
|
118
|
+
ref: x,
|
|
119
119
|
type: "button",
|
|
120
120
|
className: d(
|
|
121
121
|
"inline-flex shrink-0 items-center justify-center gap-2 font-semibold",
|
|
@@ -128,11 +128,11 @@ const ft = {
|
|
|
128
128
|
c ? xt[r] : ht[r],
|
|
129
129
|
(n || r === "full") && "w-full",
|
|
130
130
|
s && "cursor-wait",
|
|
131
|
-
|
|
131
|
+
p
|
|
132
132
|
),
|
|
133
133
|
disabled: v,
|
|
134
134
|
"aria-busy": s || void 0,
|
|
135
|
-
...
|
|
135
|
+
...m,
|
|
136
136
|
children: [
|
|
137
137
|
s && /* @__PURE__ */ e(
|
|
138
138
|
"span",
|
|
@@ -201,7 +201,7 @@ const Gr = ({
|
|
|
201
201
|
"aria-label": c,
|
|
202
202
|
...f
|
|
203
203
|
}) => {
|
|
204
|
-
const
|
|
204
|
+
const p = typeof r == "number" ? r : gt(r), N = d(
|
|
205
205
|
"inline-block shrink-0",
|
|
206
206
|
bt[n],
|
|
207
207
|
s && [
|
|
@@ -209,8 +209,8 @@ const Gr = ({
|
|
|
209
209
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
210
210
|
],
|
|
211
211
|
l
|
|
212
|
-
),
|
|
213
|
-
size:
|
|
212
|
+
), h = {
|
|
213
|
+
size: p,
|
|
214
214
|
strokeWidth: 2,
|
|
215
215
|
className: N,
|
|
216
216
|
onClick: s ? a : void 0,
|
|
@@ -218,12 +218,12 @@ const Gr = ({
|
|
|
218
218
|
"aria-hidden": c ? void 0 : !0,
|
|
219
219
|
role: s ? "button" : void 0,
|
|
220
220
|
tabIndex: s ? 0 : void 0,
|
|
221
|
-
onKeyDown: s ? (
|
|
222
|
-
(
|
|
221
|
+
onKeyDown: s ? (m) => {
|
|
222
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), a?.());
|
|
223
223
|
} : void 0,
|
|
224
224
|
...f
|
|
225
225
|
};
|
|
226
|
-
return /* @__PURE__ */ e(t, { ...
|
|
226
|
+
return /* @__PURE__ */ e(t, { ...h });
|
|
227
227
|
};
|
|
228
228
|
function gt(t) {
|
|
229
229
|
return {
|
|
@@ -249,42 +249,43 @@ function Jr({
|
|
|
249
249
|
active: l = !1,
|
|
250
250
|
caret: c = !1,
|
|
251
251
|
onClear: f,
|
|
252
|
-
clearLabel:
|
|
252
|
+
clearLabel: p = "Filter wissen",
|
|
253
253
|
onClick: N,
|
|
254
|
-
|
|
254
|
+
title: h,
|
|
255
|
+
className: m
|
|
255
256
|
}) {
|
|
256
|
-
const
|
|
257
|
+
const x = l && !!f, v = s === "pill" ? "rounded-full" : "rounded-md", C = d(
|
|
257
258
|
// A button's default cursor is an arrow, so it has to be asked for.
|
|
258
259
|
"inline-flex cursor-pointer select-none items-center text-sm font-semibold",
|
|
259
260
|
a === "sm" ? "h-control-sm" : "h-control-md",
|
|
260
261
|
"transition-colors duration-fast ease-out",
|
|
261
|
-
|
|
262
|
+
v,
|
|
262
263
|
// Picking a value outranks whatever the value happens to mean.
|
|
263
264
|
l ? "bg-accent text-accent-fg" : d("border", pt[n]),
|
|
264
|
-
|
|
265
|
-
),
|
|
265
|
+
m
|
|
266
|
+
), y = /* @__PURE__ */ i(fe, { children: [
|
|
266
267
|
r,
|
|
267
268
|
t,
|
|
268
269
|
c && /* @__PURE__ */ e(X, { icon: be, size: "xs" })
|
|
269
|
-
] }),
|
|
270
|
+
] }), g = d(
|
|
270
271
|
"inline-flex items-center gap-1.5 pl-3",
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
v,
|
|
273
|
+
x ? "pr-1.5" : "pr-3",
|
|
273
274
|
"focus-visible:outline-none focus-visible:focus-ring"
|
|
274
275
|
);
|
|
275
|
-
return
|
|
276
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: N, className:
|
|
276
|
+
return x ? /* @__PURE__ */ i("span", { className: C, title: h, children: [
|
|
277
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: N, className: g, children: y }),
|
|
277
278
|
/* @__PURE__ */ e(
|
|
278
279
|
"button",
|
|
279
280
|
{
|
|
280
281
|
type: "button",
|
|
281
|
-
"aria-label":
|
|
282
|
+
"aria-label": p,
|
|
282
283
|
onClick: f,
|
|
283
|
-
className: d("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring",
|
|
284
|
+
className: d("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", v),
|
|
284
285
|
children: /* @__PURE__ */ e(X, { icon: ve, size: "xs" })
|
|
285
286
|
}
|
|
286
287
|
)
|
|
287
|
-
] }) : /* @__PURE__ */ e("button", { type: "button", onClick: N, className: d(
|
|
288
|
+
] }) : /* @__PURE__ */ e("button", { type: "button", title: h, onClick: N, className: d(C, g), children: y });
|
|
288
289
|
}
|
|
289
290
|
const vt = {
|
|
290
291
|
xs: "text-xs",
|
|
@@ -319,11 +320,11 @@ const vt = {
|
|
|
319
320
|
className: l,
|
|
320
321
|
children: c,
|
|
321
322
|
href: f,
|
|
322
|
-
target:
|
|
323
|
+
target: p,
|
|
323
324
|
rel: N,
|
|
324
|
-
...
|
|
325
|
+
...h
|
|
325
326
|
}) => {
|
|
326
|
-
const
|
|
327
|
+
const m = a || f && (f.startsWith("http") || f.startsWith("mailto:")), x = d(
|
|
327
328
|
"inline-flex items-center gap-1 underline-offset-2",
|
|
328
329
|
"transition-colors duration-fast ease-out",
|
|
329
330
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -338,15 +339,15 @@ const vt = {
|
|
|
338
339
|
s && "pointer-events-none cursor-not-allowed text-text-disabled opacity-50",
|
|
339
340
|
l
|
|
340
341
|
), v = {
|
|
341
|
-
...
|
|
342
|
+
...h,
|
|
342
343
|
href: s ? void 0 : f,
|
|
343
|
-
target:
|
|
344
|
-
rel:
|
|
344
|
+
target: m ? "_blank" : p,
|
|
345
|
+
rel: m ? "noopener noreferrer" : N,
|
|
345
346
|
"aria-disabled": s || void 0
|
|
346
347
|
};
|
|
347
|
-
return /* @__PURE__ */ i("a", { className:
|
|
348
|
+
return /* @__PURE__ */ i("a", { className: x, ...v, children: [
|
|
348
349
|
c,
|
|
349
|
-
|
|
350
|
+
m && /* @__PURE__ */ e(Je, { className: "size-icon-sm shrink-0", "aria-hidden": !0 })
|
|
350
351
|
] });
|
|
351
352
|
}, wt = {
|
|
352
353
|
sm: "h-control-sm px-3 text-sm",
|
|
@@ -398,37 +399,37 @@ const kt = ({
|
|
|
398
399
|
disabled: a = !1,
|
|
399
400
|
triggerLabel: l
|
|
400
401
|
}) => {
|
|
401
|
-
const [c, f] =
|
|
402
|
+
const [c, f] = R(!1), [p, N] = R({}), h = se(null), m = se(null);
|
|
402
403
|
J(() => {
|
|
403
404
|
if (!c) return;
|
|
404
|
-
const C = (
|
|
405
|
-
|
|
406
|
-
},
|
|
407
|
-
|
|
405
|
+
const C = (g) => {
|
|
406
|
+
h.current && !h.current.contains(g.target) && f(!1);
|
|
407
|
+
}, y = (g) => {
|
|
408
|
+
g.key === "Escape" && f(!1);
|
|
408
409
|
};
|
|
409
|
-
return document.addEventListener("mousedown", C), document.addEventListener("keydown",
|
|
410
|
-
document.removeEventListener("mousedown", C), document.removeEventListener("keydown",
|
|
410
|
+
return document.addEventListener("mousedown", C), document.addEventListener("keydown", y), () => {
|
|
411
|
+
document.removeEventListener("mousedown", C), document.removeEventListener("keydown", y);
|
|
411
412
|
};
|
|
412
413
|
}, [c]);
|
|
413
|
-
const
|
|
414
|
+
const x = (C) => {
|
|
414
415
|
if (C.stopPropagation(), !a) {
|
|
415
416
|
if (!c) {
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
418
|
-
const
|
|
419
|
-
n.startsWith("bottom") ?
|
|
417
|
+
const y = m.current?.getBoundingClientRect();
|
|
418
|
+
if (y) {
|
|
419
|
+
const A = {};
|
|
420
|
+
n.startsWith("bottom") ? A.top = y.bottom + 6 : A.bottom = window.innerHeight - y.top + 6, n.endsWith("start") ? A.left = y.left : A.right = window.innerWidth - y.right, N(A);
|
|
420
421
|
}
|
|
421
422
|
}
|
|
422
|
-
f((
|
|
423
|
+
f((y) => !y);
|
|
423
424
|
}
|
|
424
425
|
}, v = () => f(!1);
|
|
425
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
426
|
+
return /* @__PURE__ */ i("div", { ref: h, className: "relative inline-flex", children: [
|
|
426
427
|
/* @__PURE__ */ e(
|
|
427
428
|
"button",
|
|
428
429
|
{
|
|
429
|
-
ref:
|
|
430
|
+
ref: m,
|
|
430
431
|
type: "button",
|
|
431
|
-
onClick:
|
|
432
|
+
onClick: x,
|
|
432
433
|
disabled: a,
|
|
433
434
|
"aria-label": l,
|
|
434
435
|
"aria-expanded": c,
|
|
@@ -443,7 +444,7 @@ const kt = ({
|
|
|
443
444
|
"fixed z-overlay bg-surface rounded-lg shadow-overlay border border-border",
|
|
444
445
|
s
|
|
445
446
|
),
|
|
446
|
-
style:
|
|
447
|
+
style: p,
|
|
447
448
|
children: typeof r == "function" ? r(v) : r
|
|
448
449
|
}
|
|
449
450
|
)
|
|
@@ -465,10 +466,10 @@ function je({
|
|
|
465
466
|
options: l,
|
|
466
467
|
disabled: c = !1,
|
|
467
468
|
loading: f = !1,
|
|
468
|
-
menuPlacement:
|
|
469
|
+
menuPlacement: p = "bottom-end",
|
|
469
470
|
menuLabel: N = "More options"
|
|
470
471
|
}) {
|
|
471
|
-
const
|
|
472
|
+
const h = c || f, m = l.length > 0;
|
|
472
473
|
return /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-px", children: [
|
|
473
474
|
/* @__PURE__ */ e(
|
|
474
475
|
re,
|
|
@@ -479,15 +480,15 @@ function je({
|
|
|
479
480
|
disabled: c,
|
|
480
481
|
loading: f,
|
|
481
482
|
leftIcon: a,
|
|
482
|
-
className: d(
|
|
483
|
+
className: d(m && "rounded-r-none"),
|
|
483
484
|
children: t
|
|
484
485
|
}
|
|
485
486
|
),
|
|
486
|
-
|
|
487
|
+
m && /* @__PURE__ */ e(
|
|
487
488
|
kt,
|
|
488
489
|
{
|
|
489
|
-
placement:
|
|
490
|
-
disabled:
|
|
490
|
+
placement: p,
|
|
491
|
+
disabled: h,
|
|
491
492
|
triggerLabel: N,
|
|
492
493
|
className: "min-w-menu py-1",
|
|
493
494
|
trigger: /* @__PURE__ */ e(
|
|
@@ -499,17 +500,17 @@ function je({
|
|
|
499
500
|
"transition-colors duration-fast ease-out",
|
|
500
501
|
Ct[n],
|
|
501
502
|
St[s],
|
|
502
|
-
|
|
503
|
+
h && "cursor-not-allowed opacity-50"
|
|
503
504
|
),
|
|
504
505
|
children: /* @__PURE__ */ e(be, { className: "size-icon-md" })
|
|
505
506
|
}
|
|
506
507
|
),
|
|
507
|
-
children: (
|
|
508
|
+
children: (x) => /* @__PURE__ */ e(fe, { children: l.map((v) => /* @__PURE__ */ i(
|
|
508
509
|
"button",
|
|
509
510
|
{
|
|
510
511
|
type: "button",
|
|
511
512
|
onClick: () => {
|
|
512
|
-
v.onClick(),
|
|
513
|
+
v.onClick(), x();
|
|
513
514
|
},
|
|
514
515
|
className: d(
|
|
515
516
|
"flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm",
|
|
@@ -553,14 +554,14 @@ const zt = {
|
|
|
553
554
|
containerClassName: l,
|
|
554
555
|
labelClassName: c,
|
|
555
556
|
className: f,
|
|
556
|
-
id:
|
|
557
|
+
id: p,
|
|
557
558
|
...N
|
|
558
|
-
},
|
|
559
|
-
const
|
|
560
|
-
(
|
|
561
|
-
C.current =
|
|
559
|
+
}, h) => {
|
|
560
|
+
const m = le.useId(), x = p || `checkbox-${m}`, v = !!n, C = le.useRef(null), y = le.useCallback(
|
|
561
|
+
(g) => {
|
|
562
|
+
C.current = g, typeof h == "function" ? h(g) : h && typeof h == "object" && (h.current = g);
|
|
562
563
|
},
|
|
563
|
-
[
|
|
564
|
+
[h]
|
|
564
565
|
);
|
|
565
566
|
return le.useEffect(() => {
|
|
566
567
|
C.current && (C.current.indeterminate = a);
|
|
@@ -569,8 +570,8 @@ const zt = {
|
|
|
569
570
|
/* @__PURE__ */ e(
|
|
570
571
|
"input",
|
|
571
572
|
{
|
|
572
|
-
ref:
|
|
573
|
-
id:
|
|
573
|
+
ref: y,
|
|
574
|
+
id: x,
|
|
574
575
|
type: "checkbox",
|
|
575
576
|
"aria-invalid": v || void 0,
|
|
576
577
|
className: d(
|
|
@@ -589,7 +590,7 @@ const zt = {
|
|
|
589
590
|
/* @__PURE__ */ e(
|
|
590
591
|
"label",
|
|
591
592
|
{
|
|
592
|
-
htmlFor:
|
|
593
|
+
htmlFor: x,
|
|
593
594
|
className: d(
|
|
594
595
|
"cursor-pointer",
|
|
595
596
|
v ? "text-danger-fg" : "text-text",
|
|
@@ -608,14 +609,14 @@ const zt = {
|
|
|
608
609
|
);
|
|
609
610
|
xe.displayName = "Checkbox";
|
|
610
611
|
function Ee(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start" } = {}) {
|
|
611
|
-
const [l, c] =
|
|
612
|
+
const [l, c] = R({});
|
|
612
613
|
return dt(() => {
|
|
613
614
|
if (!t) return;
|
|
614
615
|
const f = () => {
|
|
615
|
-
const
|
|
616
|
-
if (!
|
|
617
|
-
const N =
|
|
618
|
-
C ? (
|
|
616
|
+
const p = r.current;
|
|
617
|
+
if (!p) return;
|
|
618
|
+
const N = p.getBoundingClientRect(), h = window.innerHeight - N.bottom, m = N.top, x = a.startsWith("top"), v = x ? m < 200 && h > m : h < 200 && m > h, C = x !== v, y = { position: "fixed" };
|
|
619
|
+
C ? (y.bottom = window.innerHeight - N.top + n, y.maxHeight = Math.max(120, m - n * 2)) : (y.top = N.bottom + n, y.maxHeight = Math.max(120, h - n * 2)), a.endsWith("end") ? y.right = window.innerWidth - N.right : y.left = N.left, s && (y.width = N.width), c(y);
|
|
619
620
|
};
|
|
620
621
|
return f(), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
|
|
621
622
|
window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
|
|
@@ -631,49 +632,49 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
631
632
|
size: l = "md",
|
|
632
633
|
className: c,
|
|
633
634
|
minDate: f,
|
|
634
|
-
maxDate:
|
|
635
|
+
maxDate: p,
|
|
635
636
|
format: N = "MM/dd/yyyy",
|
|
636
|
-
withTime:
|
|
637
|
-
},
|
|
638
|
-
const [
|
|
637
|
+
withTime: h = !1
|
|
638
|
+
}, m) => {
|
|
639
|
+
const [x, v] = R(!1), [C, y] = R(() => t || /* @__PURE__ */ new Date()), g = se(null), A = Ee(x, g);
|
|
639
640
|
J(() => {
|
|
640
|
-
const b = (
|
|
641
|
-
|
|
641
|
+
const b = (u) => {
|
|
642
|
+
g.current && !g.current.contains(u.target) && v(!1);
|
|
642
643
|
};
|
|
643
|
-
return
|
|
644
|
+
return x && document.addEventListener("mousedown", b), () => {
|
|
644
645
|
document.removeEventListener("mousedown", b);
|
|
645
646
|
};
|
|
646
|
-
}, [
|
|
647
|
-
const
|
|
647
|
+
}, [x]);
|
|
648
|
+
const $ = (b) => {
|
|
648
649
|
if (!b) return "";
|
|
649
|
-
const
|
|
650
|
-
return
|
|
651
|
-
},
|
|
652
|
-
const [
|
|
653
|
-
if (Number.isNaN(
|
|
650
|
+
const u = b.getDate().toString().padStart(2, "0"), E = (b.getMonth() + 1).toString().padStart(2, "0"), w = b.getFullYear(), P = N === "dd/MM/yyyy" ? `${u}/${E}/${w}` : N === "yyyy-MM-dd" ? `${w}-${E}-${u}` : `${E}/${u}/${w}`;
|
|
651
|
+
return h ? `${P} ${_(b)}` : P;
|
|
652
|
+
}, _ = (b) => `${b.getHours().toString().padStart(2, "0")}:${b.getMinutes().toString().padStart(2, "0")}`, M = (b) => {
|
|
653
|
+
const [u, E] = b.split(":").map(Number);
|
|
654
|
+
if (Number.isNaN(u) || Number.isNaN(E)) return;
|
|
654
655
|
const w = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
655
|
-
w.setHours(
|
|
656
|
-
},
|
|
657
|
-
const b = C.getFullYear(),
|
|
656
|
+
w.setHours(u, E, 0, 0), r?.(w);
|
|
657
|
+
}, U = () => {
|
|
658
|
+
const b = C.getFullYear(), u = C.getMonth(), E = new Date(b, u, 1), w = new Date(E);
|
|
658
659
|
w.setDate(w.getDate() - E.getDay());
|
|
659
|
-
const
|
|
660
|
+
const P = [], k = new Date(w);
|
|
660
661
|
for (let ae = 0; ae < 42; ae++)
|
|
661
|
-
|
|
662
|
-
return
|
|
663
|
-
},
|
|
664
|
-
if (b.getMonth() === C.getMonth() && !(f && b < f) && !(
|
|
665
|
-
if (
|
|
662
|
+
P.push(new Date(k)), k.setDate(k.getDate() + 1);
|
|
663
|
+
return P;
|
|
664
|
+
}, V = (b) => {
|
|
665
|
+
if (b.getMonth() === C.getMonth() && !(f && b < f) && !(p && b > p)) {
|
|
666
|
+
if (h) {
|
|
666
667
|
const E = new Date(b);
|
|
667
668
|
E.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(E);
|
|
668
669
|
return;
|
|
669
670
|
}
|
|
670
671
|
r?.(b), v(!1);
|
|
671
672
|
}
|
|
672
|
-
},
|
|
673
|
-
|
|
674
|
-
},
|
|
675
|
-
|
|
676
|
-
},
|
|
673
|
+
}, I = () => {
|
|
674
|
+
y(new Date(C.getFullYear(), C.getMonth() - 1, 1));
|
|
675
|
+
}, W = () => {
|
|
676
|
+
y(new Date(C.getFullYear(), C.getMonth() + 1, 1));
|
|
677
|
+
}, H = () => {
|
|
677
678
|
r?.(null), v(!1);
|
|
678
679
|
}, Y = d(
|
|
679
680
|
"w-full border border-border rounded-md transition-colors duration-fast",
|
|
@@ -688,7 +689,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
688
689
|
"h-control-md w-full px-3 text-base": l === "full"
|
|
689
690
|
},
|
|
690
691
|
c
|
|
691
|
-
), Z =
|
|
692
|
+
), Z = U(), Q = [
|
|
692
693
|
"January",
|
|
693
694
|
"February",
|
|
694
695
|
"March",
|
|
@@ -702,19 +703,19 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
702
703
|
"November",
|
|
703
704
|
"December"
|
|
704
705
|
];
|
|
705
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
706
|
+
return /* @__PURE__ */ i("div", { ref: g, className: "relative", children: [
|
|
706
707
|
/* @__PURE__ */ i("div", { className: "relative", children: [
|
|
707
708
|
/* @__PURE__ */ e(
|
|
708
709
|
"input",
|
|
709
710
|
{
|
|
710
|
-
ref:
|
|
711
|
+
ref: m,
|
|
711
712
|
type: "text",
|
|
712
|
-
value:
|
|
713
|
+
value: $(t ?? null),
|
|
713
714
|
placeholder: n,
|
|
714
715
|
disabled: s,
|
|
715
716
|
required: a,
|
|
716
717
|
readOnly: !0,
|
|
717
|
-
onClick: () => !s && v(!
|
|
718
|
+
onClick: () => !s && v(!x),
|
|
718
719
|
className: d(Y, "pr-10 cursor-pointer")
|
|
719
720
|
}
|
|
720
721
|
),
|
|
@@ -722,19 +723,19 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
722
723
|
"button",
|
|
723
724
|
{
|
|
724
725
|
type: "button",
|
|
725
|
-
onClick: () => !s && v(!
|
|
726
|
+
onClick: () => !s && v(!x),
|
|
726
727
|
disabled: s,
|
|
727
728
|
className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted hover:text-text-muted",
|
|
728
729
|
children: /* @__PURE__ */ e($t, {})
|
|
729
730
|
}
|
|
730
731
|
)
|
|
731
732
|
] }),
|
|
732
|
-
|
|
733
|
+
x && /* @__PURE__ */ i("div", { style: A, className: "z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
733
734
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
734
735
|
/* @__PURE__ */ e(
|
|
735
736
|
"button",
|
|
736
737
|
{
|
|
737
|
-
onClick:
|
|
738
|
+
onClick: I,
|
|
738
739
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
739
740
|
children: /* @__PURE__ */ e(Dt, {})
|
|
740
741
|
}
|
|
@@ -747,43 +748,43 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
747
748
|
/* @__PURE__ */ e(
|
|
748
749
|
"button",
|
|
749
750
|
{
|
|
750
|
-
onClick:
|
|
751
|
+
onClick: W,
|
|
751
752
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
752
753
|
children: /* @__PURE__ */ e(Tt, {})
|
|
753
754
|
}
|
|
754
755
|
)
|
|
755
756
|
] }),
|
|
756
757
|
/* @__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)) }),
|
|
757
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: Z.map((b,
|
|
758
|
-
const E = b.getMonth() === C.getMonth(), w = t && b.toDateString() === t.toDateString(),
|
|
758
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: Z.map((b, u) => {
|
|
759
|
+
const E = b.getMonth() === C.getMonth(), w = t && b.toDateString() === t.toDateString(), P = b.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), k = !E || f && b < f || p && b > p;
|
|
759
760
|
return /* @__PURE__ */ e(
|
|
760
761
|
"button",
|
|
761
762
|
{
|
|
762
|
-
onClick: () => !k &&
|
|
763
|
+
onClick: () => !k && V(b),
|
|
763
764
|
disabled: k,
|
|
764
765
|
className: d(
|
|
765
766
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
766
767
|
{
|
|
767
768
|
"text-text hover:bg-surface-hover": E && !w && !k,
|
|
768
769
|
"bg-accent text-accent-fg": w,
|
|
769
|
-
"bg-surface-hover text-text":
|
|
770
|
+
"bg-surface-hover text-text": P && !w,
|
|
770
771
|
"text-text-muted cursor-not-allowed": k
|
|
771
772
|
}
|
|
772
773
|
),
|
|
773
774
|
children: b.getDate()
|
|
774
775
|
},
|
|
775
|
-
|
|
776
|
+
u
|
|
776
777
|
);
|
|
777
778
|
}) }),
|
|
778
|
-
|
|
779
|
+
h && /* @__PURE__ */ i("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
|
|
779
780
|
/* @__PURE__ */ e("label", { htmlFor: "datepicker-time", className: "text-sm text-text-muted", children: "Tijd" }),
|
|
780
781
|
/* @__PURE__ */ e(
|
|
781
782
|
"input",
|
|
782
783
|
{
|
|
783
784
|
id: "datepicker-time",
|
|
784
785
|
type: "time",
|
|
785
|
-
value: t ?
|
|
786
|
-
onChange: (b) =>
|
|
786
|
+
value: t ? _(t) : "",
|
|
787
|
+
onChange: (b) => M(b.target.value),
|
|
787
788
|
className: "h-control-sm rounded-md border border-border bg-surface-input px-2 text-sm text-text focus-visible:outline-none focus-visible:focus-ring"
|
|
788
789
|
}
|
|
789
790
|
)
|
|
@@ -792,7 +793,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
792
793
|
/* @__PURE__ */ e(
|
|
793
794
|
"button",
|
|
794
795
|
{
|
|
795
|
-
onClick:
|
|
796
|
+
onClick: H,
|
|
796
797
|
className: "text-sm text-text-muted hover:text-text",
|
|
797
798
|
children: "Clear"
|
|
798
799
|
}
|
|
@@ -823,90 +824,90 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
823
824
|
options: l,
|
|
824
825
|
placeholder: c,
|
|
825
826
|
containerClassName: f,
|
|
826
|
-
labelClassName:
|
|
827
|
+
labelClassName: p,
|
|
827
828
|
className: N,
|
|
828
|
-
id:
|
|
829
|
-
searchable:
|
|
830
|
-
multiple:
|
|
829
|
+
id: h,
|
|
830
|
+
searchable: m,
|
|
831
|
+
multiple: x,
|
|
831
832
|
value: v,
|
|
832
833
|
onChange: C,
|
|
833
|
-
allowCreate:
|
|
834
|
-
onCreateOption:
|
|
835
|
-
...
|
|
836
|
-
},
|
|
837
|
-
const
|
|
838
|
-
le.useImperativeHandle(
|
|
839
|
-
const S = (
|
|
840
|
-
|
|
834
|
+
allowCreate: y,
|
|
835
|
+
onCreateOption: g,
|
|
836
|
+
...A
|
|
837
|
+
}, $) => {
|
|
838
|
+
const _ = h || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [U, V] = le.useState(!1), [I, W] = le.useState(""), H = le.useRef(null), Y = le.useRef(null), Z = Ee(U, Y, { matchWidth: !0 }), [Q, b] = le.useState(l);
|
|
839
|
+
le.useImperativeHandle($, () => H.current), le.useEffect(() => {
|
|
840
|
+
const S = (T) => {
|
|
841
|
+
H.current && !H.current.contains(T.target) && V(!1);
|
|
841
842
|
};
|
|
842
843
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
843
844
|
}, []);
|
|
844
|
-
const
|
|
845
|
-
(S,
|
|
846
|
-
(
|
|
845
|
+
const u = le.useCallback(
|
|
846
|
+
(S, T) => S.some(
|
|
847
|
+
(L) => ge(L.value) === ge(T) || ge(L.label) === ge(T)
|
|
847
848
|
),
|
|
848
849
|
[]
|
|
849
850
|
), E = le.useCallback(
|
|
850
|
-
(S,
|
|
851
|
-
const
|
|
851
|
+
(S, T) => {
|
|
852
|
+
const L = [...S], D = (q) => {
|
|
852
853
|
const j = (q ?? "").trim();
|
|
853
|
-
j && (
|
|
854
|
+
j && (u(L, j) || L.push({ value: j, label: j }));
|
|
854
855
|
};
|
|
855
|
-
return Array.isArray(
|
|
856
|
+
return Array.isArray(T) ? T.forEach(D) : D(T), L;
|
|
856
857
|
},
|
|
857
|
-
[
|
|
858
|
+
[u]
|
|
858
859
|
);
|
|
859
860
|
le.useEffect(() => {
|
|
860
861
|
b((S) => {
|
|
861
|
-
const
|
|
862
|
-
return S.forEach((
|
|
863
|
-
!
|
|
864
|
-
}), E(
|
|
862
|
+
const T = [...l];
|
|
863
|
+
return S.forEach((L) => {
|
|
864
|
+
!u(T, L.value) && !u(T, L.label) && T.push(L);
|
|
865
|
+
}), E(T, v);
|
|
865
866
|
});
|
|
866
|
-
}, [l, v, E,
|
|
867
|
+
}, [l, v, E, u]);
|
|
867
868
|
const w = (S) => {
|
|
868
|
-
if (
|
|
869
|
-
const
|
|
870
|
-
C?.(
|
|
869
|
+
if (x) {
|
|
870
|
+
const T = Array.isArray(v) ? v : [], L = T.includes(S) ? T.filter((D) => D !== S) : [...T, S];
|
|
871
|
+
C?.(L);
|
|
871
872
|
} else
|
|
872
|
-
C?.(S),
|
|
873
|
-
},
|
|
873
|
+
C?.(S), V(!1), W("");
|
|
874
|
+
}, P = x ? null : Q.find((S) => S.value === v), k = x ? Q.filter(
|
|
874
875
|
(S) => Array.isArray(v) && v.includes(S.value)
|
|
875
|
-
) : [], ae =
|
|
876
|
-
(S) => S.label.toLowerCase().includes(
|
|
877
|
-
) : Q, ne = !!
|
|
878
|
-
const
|
|
879
|
-
if (!
|
|
880
|
-
const
|
|
881
|
-
value:
|
|
882
|
-
label:
|
|
876
|
+
) : [], ae = m && I ? Q.filter(
|
|
877
|
+
(S) => S.label.toLowerCase().includes(I.toLowerCase())
|
|
878
|
+
) : Q, ne = !!y && !!m && !!I.trim() && !u(Q, I), ee = (S) => {
|
|
879
|
+
const T = S.trim();
|
|
880
|
+
if (!T) return;
|
|
881
|
+
const L = g?.(T) ?? {
|
|
882
|
+
value: T,
|
|
883
|
+
label: T
|
|
883
884
|
};
|
|
884
|
-
if (
|
|
885
|
-
w(
|
|
885
|
+
if (u(Q, L.value) || u(Q, L.label)) {
|
|
886
|
+
w(L.value), W(""), x || V(!1);
|
|
886
887
|
return;
|
|
887
888
|
}
|
|
888
|
-
b((
|
|
889
|
-
}, G = () =>
|
|
889
|
+
b((D) => [...D, L]), w(L.value), W(""), x || V(!1);
|
|
890
|
+
}, G = () => x ? k.length > 0 ? k.map((S) => S.label).join(", ") : c || "Select options" : P?.label || c || "Select an option";
|
|
890
891
|
return /* @__PURE__ */ i(
|
|
891
892
|
"div",
|
|
892
893
|
{
|
|
893
|
-
ref:
|
|
894
|
+
ref: H,
|
|
894
895
|
className: d(
|
|
895
896
|
"relative flex flex-col",
|
|
896
897
|
a && "w-full",
|
|
897
898
|
f
|
|
898
899
|
),
|
|
899
|
-
...
|
|
900
|
+
...A,
|
|
900
901
|
children: [
|
|
901
902
|
t && /* @__PURE__ */ e(
|
|
902
903
|
"label",
|
|
903
904
|
{
|
|
904
|
-
htmlFor:
|
|
905
|
-
onClick: () =>
|
|
905
|
+
htmlFor: _,
|
|
906
|
+
onClick: () => V(!U),
|
|
906
907
|
className: d(
|
|
907
908
|
"block text-xs font-semibold uppercase tracking-label mb-1.5",
|
|
908
|
-
|
|
909
|
-
|
|
909
|
+
M ? "text-danger-fg" : "text-text-muted",
|
|
910
|
+
p
|
|
910
911
|
),
|
|
911
912
|
children: t
|
|
912
913
|
}
|
|
@@ -917,15 +918,15 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
917
918
|
{
|
|
918
919
|
ref: Y,
|
|
919
920
|
type: "button",
|
|
920
|
-
id:
|
|
921
|
-
onClick: () =>
|
|
921
|
+
id: _,
|
|
922
|
+
onClick: () => V(!U),
|
|
922
923
|
className: d(
|
|
923
924
|
"flex w-full items-center justify-between gap-2 rounded-md border transition-colors duration-fast text-left",
|
|
924
925
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
925
926
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
926
927
|
"bg-surface",
|
|
927
928
|
At[s],
|
|
928
|
-
|
|
929
|
+
M ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
929
930
|
N
|
|
930
931
|
),
|
|
931
932
|
children: [
|
|
@@ -936,23 +937,23 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
936
937
|
size: 16,
|
|
937
938
|
className: d(
|
|
938
939
|
"shrink-0 opacity-60 transition-transform duration-fast",
|
|
939
|
-
|
|
940
|
+
U && "rotate-180"
|
|
940
941
|
)
|
|
941
942
|
}
|
|
942
943
|
)
|
|
943
944
|
]
|
|
944
945
|
}
|
|
945
946
|
),
|
|
946
|
-
|
|
947
|
-
|
|
947
|
+
U && /* @__PURE__ */ i("div", { style: Z, className: "z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
|
|
948
|
+
m && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
948
949
|
"input",
|
|
949
950
|
{
|
|
950
951
|
type: "text",
|
|
951
952
|
placeholder: "Search...",
|
|
952
|
-
value:
|
|
953
|
-
onChange: (S) =>
|
|
953
|
+
value: I,
|
|
954
|
+
onChange: (S) => W(S.target.value),
|
|
954
955
|
onKeyDown: (S) => {
|
|
955
|
-
S.key === "Enter" && ne && (S.preventDefault(), ee(
|
|
956
|
+
S.key === "Enter" && ne && (S.preventDefault(), ee(I));
|
|
956
957
|
},
|
|
957
958
|
className: d(
|
|
958
959
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
@@ -967,27 +968,27 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
967
968
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
968
969
|
"text-info-fg hover:bg-surface-hover"
|
|
969
970
|
),
|
|
970
|
-
onClick: () => ee(
|
|
971
|
+
onClick: () => ee(I),
|
|
971
972
|
children: [
|
|
972
973
|
"+: “",
|
|
973
|
-
|
|
974
|
+
I.trim(),
|
|
974
975
|
"”"
|
|
975
976
|
]
|
|
976
977
|
}
|
|
977
978
|
),
|
|
978
979
|
/* @__PURE__ */ i("ul", { className: "min-h-0 flex-1 overflow-auto py-1", children: [
|
|
979
|
-
c && !
|
|
980
|
+
c && !x && /* @__PURE__ */ e(
|
|
980
981
|
"li",
|
|
981
982
|
{
|
|
982
983
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
983
984
|
onClick: () => {
|
|
984
|
-
C?.(""),
|
|
985
|
+
C?.(""), V(!1);
|
|
985
986
|
},
|
|
986
987
|
children: c
|
|
987
988
|
}
|
|
988
989
|
),
|
|
989
990
|
ae.map((S) => {
|
|
990
|
-
const
|
|
991
|
+
const T = x ? Array.isArray(v) && v.includes(S.value) : v === S.value;
|
|
991
992
|
return /* @__PURE__ */ e(
|
|
992
993
|
"li",
|
|
993
994
|
{
|
|
@@ -996,14 +997,14 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
996
997
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
997
998
|
"text-text",
|
|
998
999
|
S.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-surface-hover",
|
|
999
|
-
|
|
1000
|
+
T && "bg-accent-soft text-accent font-semibold"
|
|
1000
1001
|
),
|
|
1001
1002
|
children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1002
|
-
|
|
1003
|
+
x && /* @__PURE__ */ e(
|
|
1003
1004
|
"input",
|
|
1004
1005
|
{
|
|
1005
1006
|
type: "checkbox",
|
|
1006
|
-
checked:
|
|
1007
|
+
checked: T,
|
|
1007
1008
|
readOnly: !0,
|
|
1008
1009
|
className: "mr-3 h-4 w-4 rounded border-border [&:not(:checked)]:bg-surface-input text-accent "
|
|
1009
1010
|
}
|
|
@@ -1022,7 +1023,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
1022
1023
|
{
|
|
1023
1024
|
className: d(
|
|
1024
1025
|
"mt-1 text-xs",
|
|
1025
|
-
|
|
1026
|
+
M ? "text-danger-fg" : "text-text-muted"
|
|
1026
1027
|
),
|
|
1027
1028
|
children: n || r
|
|
1028
1029
|
}
|
|
@@ -1048,21 +1049,21 @@ const Lt = {
|
|
|
1048
1049
|
startIcon: l,
|
|
1049
1050
|
endIcon: c,
|
|
1050
1051
|
loading: f = !1,
|
|
1051
|
-
containerClassName:
|
|
1052
|
+
containerClassName: p,
|
|
1052
1053
|
labelClassName: N,
|
|
1053
|
-
className:
|
|
1054
|
-
id:
|
|
1055
|
-
...
|
|
1054
|
+
className: h,
|
|
1055
|
+
id: m,
|
|
1056
|
+
...x
|
|
1056
1057
|
}, v) => {
|
|
1057
|
-
const C = le.useId(),
|
|
1058
|
-
return /* @__PURE__ */ i("div", { className: d("flex flex-col", a && "w-full",
|
|
1058
|
+
const C = le.useId(), y = m || `textfield-${C}`, g = !!n, A = n || r ? `${y}-description` : void 0;
|
|
1059
|
+
return /* @__PURE__ */ i("div", { className: d("flex flex-col", a && "w-full", p), children: [
|
|
1059
1060
|
t && /* @__PURE__ */ e(
|
|
1060
1061
|
"label",
|
|
1061
1062
|
{
|
|
1062
|
-
htmlFor:
|
|
1063
|
+
htmlFor: y,
|
|
1063
1064
|
className: d(
|
|
1064
1065
|
Oe,
|
|
1065
|
-
|
|
1066
|
+
g ? "text-danger-fg" : "text-text-subtle",
|
|
1066
1067
|
N
|
|
1067
1068
|
),
|
|
1068
1069
|
children: t
|
|
@@ -1074,9 +1075,9 @@ const Lt = {
|
|
|
1074
1075
|
"input",
|
|
1075
1076
|
{
|
|
1076
1077
|
ref: v,
|
|
1077
|
-
id:
|
|
1078
|
-
"aria-invalid":
|
|
1079
|
-
"aria-describedby":
|
|
1078
|
+
id: y,
|
|
1079
|
+
"aria-invalid": g || void 0,
|
|
1080
|
+
"aria-describedby": A,
|
|
1080
1081
|
className: d(
|
|
1081
1082
|
"block w-full rounded-md border bg-surface-input text-text",
|
|
1082
1083
|
"transition-colors duration-fast ease-out",
|
|
@@ -1086,10 +1087,10 @@ const Lt = {
|
|
|
1086
1087
|
Lt[s],
|
|
1087
1088
|
l && "pl-9",
|
|
1088
1089
|
(c || f) && "pr-9",
|
|
1089
|
-
|
|
1090
|
-
|
|
1090
|
+
g ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
1091
|
+
h
|
|
1091
1092
|
),
|
|
1092
|
-
...
|
|
1093
|
+
...x
|
|
1093
1094
|
}
|
|
1094
1095
|
),
|
|
1095
1096
|
(c || f) && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-3 text-text-muted", children: f ? /* @__PURE__ */ e(
|
|
@@ -1103,8 +1104,8 @@ const Lt = {
|
|
|
1103
1104
|
(n || r) && /* @__PURE__ */ e(
|
|
1104
1105
|
"p",
|
|
1105
1106
|
{
|
|
1106
|
-
id:
|
|
1107
|
-
className: d("mt-1 text-xs",
|
|
1107
|
+
id: A,
|
|
1108
|
+
className: d("mt-1 text-xs", g ? "text-danger-fg" : "text-text-subtle"),
|
|
1108
1109
|
children: n || r
|
|
1109
1110
|
}
|
|
1110
1111
|
)
|
|
@@ -1122,27 +1123,27 @@ function It({
|
|
|
1122
1123
|
templatePlaceholder: c,
|
|
1123
1124
|
showTemplate: f = !0
|
|
1124
1125
|
}) {
|
|
1125
|
-
const [
|
|
1126
|
+
const [p, N] = R([]);
|
|
1126
1127
|
J(() => {
|
|
1127
|
-
let
|
|
1128
|
-
return Promise.resolve(n?.()).then((
|
|
1129
|
-
|
|
1128
|
+
let m = !0;
|
|
1129
|
+
return Promise.resolve(n?.()).then((x) => {
|
|
1130
|
+
m && x && N(x.data ?? []);
|
|
1130
1131
|
}).catch(() => {
|
|
1131
1132
|
}), () => {
|
|
1132
|
-
|
|
1133
|
+
m = !1;
|
|
1133
1134
|
};
|
|
1134
1135
|
}, []);
|
|
1135
|
-
const
|
|
1136
|
+
const h = t ?? {};
|
|
1136
1137
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
|
|
1137
1138
|
/* @__PURE__ */ e(
|
|
1138
1139
|
pe,
|
|
1139
1140
|
{
|
|
1140
1141
|
size: a,
|
|
1141
1142
|
fullWidth: !0,
|
|
1142
|
-
value:
|
|
1143
|
-
options:
|
|
1143
|
+
value: h.folderId ?? "",
|
|
1144
|
+
options: p.map((m) => ({ value: m.id, label: m.name })),
|
|
1144
1145
|
placeholder: l ?? "Select a folder",
|
|
1145
|
-
onChange: (
|
|
1146
|
+
onChange: (m) => r?.({ ...h, folderId: m })
|
|
1146
1147
|
}
|
|
1147
1148
|
),
|
|
1148
1149
|
f && /* @__PURE__ */ e(
|
|
@@ -1150,9 +1151,9 @@ function It({
|
|
|
1150
1151
|
{
|
|
1151
1152
|
size: a,
|
|
1152
1153
|
disabled: s ?? !1,
|
|
1153
|
-
value:
|
|
1154
|
+
value: h.pathTemplate ?? "",
|
|
1154
1155
|
placeholder: c ?? "Sub-path e.g. {yyyy}/{mm}/{dd} (optional)",
|
|
1155
|
-
onChange: (
|
|
1156
|
+
onChange: (m) => r?.({ ...h, pathTemplate: m.target.value })
|
|
1156
1157
|
}
|
|
1157
1158
|
)
|
|
1158
1159
|
] });
|
|
@@ -1177,40 +1178,40 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1177
1178
|
startIcon: l = /* @__PURE__ */ e(Pt, {}),
|
|
1178
1179
|
loading: c = !1,
|
|
1179
1180
|
containerClassName: f,
|
|
1180
|
-
labelClassName:
|
|
1181
|
+
labelClassName: p,
|
|
1181
1182
|
className: N,
|
|
1182
|
-
id:
|
|
1183
|
-
options:
|
|
1184
|
-
onRemoteSearch:
|
|
1183
|
+
id: h,
|
|
1184
|
+
options: m,
|
|
1185
|
+
onRemoteSearch: x,
|
|
1185
1186
|
onSelect: v,
|
|
1186
1187
|
debounceTime: C = 500,
|
|
1187
|
-
showAllOnOpen:
|
|
1188
|
-
value:
|
|
1189
|
-
onChange:
|
|
1190
|
-
|
|
1191
|
-
},
|
|
1192
|
-
const
|
|
1188
|
+
showAllOnOpen: y = !1,
|
|
1189
|
+
value: g,
|
|
1190
|
+
onChange: A,
|
|
1191
|
+
...$
|
|
1192
|
+
}, _) => {
|
|
1193
|
+
const M = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, U = !!n, V = se(null), I = se(null), [W, H] = R(g || ""), [Y, Z] = R(!1), [Q, b] = R(!1), [u, E] = R(!1);
|
|
1193
1194
|
J(() => {
|
|
1194
|
-
|
|
1195
|
-
}, [
|
|
1195
|
+
g !== void 0 && H(g);
|
|
1196
|
+
}, [g]);
|
|
1196
1197
|
const w = me(() => {
|
|
1197
|
-
if (
|
|
1198
|
-
const S = String(
|
|
1199
|
-
return
|
|
1200
|
-
(
|
|
1198
|
+
if (y && !u || !W) return m;
|
|
1199
|
+
const S = String(W).toLowerCase();
|
|
1200
|
+
return m.filter(
|
|
1201
|
+
(T) => String(T.label).toLowerCase().includes(S)
|
|
1201
1202
|
);
|
|
1202
|
-
}, [
|
|
1203
|
+
}, [W, m, y, u]);
|
|
1203
1204
|
J(() => {
|
|
1204
|
-
if (!
|
|
1205
|
+
if (!x || !W) {
|
|
1205
1206
|
b(!1);
|
|
1206
1207
|
return;
|
|
1207
1208
|
}
|
|
1208
1209
|
const S = setTimeout(async () => {
|
|
1209
1210
|
b(!0);
|
|
1210
1211
|
try {
|
|
1211
|
-
await
|
|
1212
|
-
} catch (
|
|
1213
|
-
console.error("Remote search failed:",
|
|
1212
|
+
await x(String(W));
|
|
1213
|
+
} catch (T) {
|
|
1214
|
+
console.error("Remote search failed:", T);
|
|
1214
1215
|
} finally {
|
|
1215
1216
|
b(!1);
|
|
1216
1217
|
}
|
|
@@ -1218,20 +1219,20 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1218
1219
|
return () => {
|
|
1219
1220
|
clearTimeout(S), b(!1);
|
|
1220
1221
|
};
|
|
1221
|
-
}, [
|
|
1222
|
-
const S = (
|
|
1223
|
-
|
|
1222
|
+
}, [W, C, x]), J(() => {
|
|
1223
|
+
const S = (T) => {
|
|
1224
|
+
V.current && !V.current.contains(T.target) && Z(!1);
|
|
1224
1225
|
};
|
|
1225
1226
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
1226
1227
|
}, []);
|
|
1227
|
-
const
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1228
|
+
const P = (S) => {
|
|
1229
|
+
const T = S.target.value;
|
|
1230
|
+
H(T), Z(!0), E(!0), A && A(S);
|
|
1230
1231
|
}, k = (S) => {
|
|
1231
|
-
|
|
1232
|
+
H(S.label), Z(!1), E(!1), v && v(S.value);
|
|
1232
1233
|
}, ae = () => {
|
|
1233
|
-
(
|
|
1234
|
-
}, ne = c || Q, ee = Y && (w.length > 0 || ne), G = me(() =>
|
|
1234
|
+
(m.length > 0 || x) && (Z(!0), E(!1));
|
|
1235
|
+
}, ne = c || Q, ee = Y && (w.length > 0 || ne), G = me(() => _ || I, [_]);
|
|
1235
1236
|
return /* @__PURE__ */ i(
|
|
1236
1237
|
"div",
|
|
1237
1238
|
{
|
|
@@ -1241,16 +1242,16 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1241
1242
|
f || "",
|
|
1242
1243
|
"relative"
|
|
1243
1244
|
),
|
|
1244
|
-
ref:
|
|
1245
|
+
ref: V,
|
|
1245
1246
|
children: [
|
|
1246
1247
|
t && /* @__PURE__ */ e(
|
|
1247
1248
|
"label",
|
|
1248
1249
|
{
|
|
1249
|
-
htmlFor:
|
|
1250
|
+
htmlFor: M,
|
|
1250
1251
|
className: ue(
|
|
1251
1252
|
"block text-sm font-medium mb-1",
|
|
1252
|
-
|
|
1253
|
-
|
|
1253
|
+
U ? "text-danger-fg" : "text-text",
|
|
1254
|
+
p || ""
|
|
1254
1255
|
),
|
|
1255
1256
|
children: t
|
|
1256
1257
|
}
|
|
@@ -1261,9 +1262,9 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1261
1262
|
"input",
|
|
1262
1263
|
{
|
|
1263
1264
|
ref: G,
|
|
1264
|
-
id:
|
|
1265
|
-
value:
|
|
1266
|
-
onChange:
|
|
1265
|
+
id: M,
|
|
1266
|
+
value: W,
|
|
1267
|
+
onChange: P,
|
|
1267
1268
|
onFocus: ae,
|
|
1268
1269
|
className: ue(
|
|
1269
1270
|
// Base styles
|
|
@@ -1277,10 +1278,10 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1277
1278
|
"pr-10",
|
|
1278
1279
|
// Altijd padding rechts voor de dropdown/loading icon
|
|
1279
1280
|
// State styles
|
|
1280
|
-
|
|
1281
|
+
U ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
1281
1282
|
N || ""
|
|
1282
1283
|
),
|
|
1283
|
-
|
|
1284
|
+
...$
|
|
1284
1285
|
}
|
|
1285
1286
|
),
|
|
1286
1287
|
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: ne || c ? (
|
|
@@ -1320,7 +1321,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1320
1321
|
className: "px-4 py-2 cursor-pointer text-text hover:bg-accent-soft hover:text-accent transition-colors",
|
|
1321
1322
|
onClick: () => k(S),
|
|
1322
1323
|
role: "option",
|
|
1323
|
-
"aria-selected":
|
|
1324
|
+
"aria-selected": W === S.label,
|
|
1324
1325
|
children: S.label
|
|
1325
1326
|
},
|
|
1326
1327
|
S.value
|
|
@@ -1332,14 +1333,14 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1332
1333
|
{
|
|
1333
1334
|
className: ue(
|
|
1334
1335
|
"mt-1 text-xs",
|
|
1335
|
-
|
|
1336
|
+
U ? "text-danger-fg" : "text-text-muted"
|
|
1336
1337
|
),
|
|
1337
1338
|
children: n || r
|
|
1338
1339
|
}
|
|
1339
1340
|
),
|
|
1340
|
-
|
|
1341
|
+
x && /* @__PURE__ */ i("p", { className: "mt-2 text-xs text-success-fg", children: [
|
|
1341
1342
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
1342
|
-
String(
|
|
1343
|
+
String(W)
|
|
1343
1344
|
] })
|
|
1344
1345
|
]
|
|
1345
1346
|
}
|
|
@@ -1388,7 +1389,7 @@ const Ft = de(
|
|
|
1388
1389
|
role: "switch",
|
|
1389
1390
|
checked: t,
|
|
1390
1391
|
disabled: s,
|
|
1391
|
-
onChange: (
|
|
1392
|
+
onChange: (p) => r(p.target.checked),
|
|
1392
1393
|
className: "peer sr-only",
|
|
1393
1394
|
...l
|
|
1394
1395
|
}
|
|
@@ -1437,7 +1438,7 @@ function Rt({
|
|
|
1437
1438
|
{
|
|
1438
1439
|
className: "grid gap-2 border-t border-border-subtle p-3",
|
|
1439
1440
|
style: { gridTemplateColumns: `repeat(${s}, minmax(0, 1fr))` },
|
|
1440
|
-
children: Array.from({ length: s }).map((
|
|
1441
|
+
children: Array.from({ length: s }).map((p, N) => /* @__PURE__ */ e(
|
|
1441
1442
|
"div",
|
|
1442
1443
|
{
|
|
1443
1444
|
className: "h-4 w-full rounded-sm bg-surface-hover"
|
|
@@ -1459,64 +1460,64 @@ const Vt = ({
|
|
|
1459
1460
|
disabled: l = !1,
|
|
1460
1461
|
className: c,
|
|
1461
1462
|
showCheck: f = !0,
|
|
1462
|
-
header:
|
|
1463
|
+
header: p
|
|
1463
1464
|
}) => {
|
|
1464
|
-
const [N,
|
|
1465
|
-
|
|
1465
|
+
const [N, h] = R(!1), [m, x] = R(null), [v, C] = R({ top: 0, left: 0 }), y = se(null), g = se(null), A = se(null), $ = se(null), _ = Ee(N, g, { placement: a }), M = se(null), U = () => Array.from(
|
|
1466
|
+
$.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1466
1467
|
);
|
|
1467
1468
|
J(() => {
|
|
1468
|
-
N &&
|
|
1469
|
+
N && U()[0]?.focus();
|
|
1469
1470
|
}, [N]);
|
|
1470
|
-
const
|
|
1471
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(
|
|
1472
|
-
const w =
|
|
1471
|
+
const V = (u) => {
|
|
1472
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(u.key)) return;
|
|
1473
|
+
const w = U();
|
|
1473
1474
|
if (w.length === 0) return;
|
|
1474
|
-
|
|
1475
|
-
const
|
|
1475
|
+
u.preventDefault();
|
|
1476
|
+
const P = w.indexOf(document.activeElement), k = u.key === "Home" ? 0 : u.key === "End" ? w.length - 1 : u.key === "ArrowDown" ? (P + 1) % w.length : (P - 1 + w.length) % w.length;
|
|
1476
1477
|
w[k]?.focus();
|
|
1477
1478
|
};
|
|
1478
1479
|
J(() => {
|
|
1479
|
-
const
|
|
1480
|
-
|
|
1480
|
+
const u = (E) => {
|
|
1481
|
+
y.current && (!y.current.contains(E.target) || A.current && !A.current.contains(E.target)) && (h(!1), x(null), M.current && (clearTimeout(M.current), M.current = null));
|
|
1481
1482
|
};
|
|
1482
|
-
return N && document.addEventListener("mousedown",
|
|
1483
|
-
document.removeEventListener("mousedown",
|
|
1483
|
+
return N && document.addEventListener("mousedown", u), () => {
|
|
1484
|
+
document.removeEventListener("mousedown", u);
|
|
1484
1485
|
};
|
|
1485
1486
|
}, [N]), J(() => {
|
|
1486
|
-
const
|
|
1487
|
-
E.key === "Escape" && (
|
|
1487
|
+
const u = (E) => {
|
|
1488
|
+
E.key === "Escape" && (h(!1), x(null), g.current?.focus(), M.current && (clearTimeout(M.current), M.current = null));
|
|
1488
1489
|
};
|
|
1489
|
-
return N && document.addEventListener("keydown",
|
|
1490
|
-
document.removeEventListener("keydown",
|
|
1490
|
+
return N && document.addEventListener("keydown", u), () => {
|
|
1491
|
+
document.removeEventListener("keydown", u);
|
|
1491
1492
|
};
|
|
1492
1493
|
}, [N]), J(() => {
|
|
1493
|
-
if (
|
|
1494
|
-
const
|
|
1495
|
-
`[data-option-value="${
|
|
1494
|
+
if (m && y.current) {
|
|
1495
|
+
const u = y.current.querySelector(
|
|
1496
|
+
`[data-option-value="${m}"]`
|
|
1496
1497
|
);
|
|
1497
|
-
if (
|
|
1498
|
-
const E =
|
|
1498
|
+
if (u) {
|
|
1499
|
+
const E = u.getBoundingClientRect();
|
|
1499
1500
|
C({
|
|
1500
1501
|
top: E.top,
|
|
1501
1502
|
left: E.right + 8
|
|
1502
1503
|
});
|
|
1503
1504
|
}
|
|
1504
1505
|
}
|
|
1505
|
-
}, [
|
|
1506
|
-
|
|
1506
|
+
}, [m]), J(() => () => {
|
|
1507
|
+
M.current && clearTimeout(M.current);
|
|
1507
1508
|
}, []);
|
|
1508
|
-
const
|
|
1509
|
-
|
|
1510
|
-
},
|
|
1511
|
-
|
|
1512
|
-
},
|
|
1513
|
-
|
|
1514
|
-
}, Y = (
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
}, 150) :
|
|
1518
|
-
}, Z = (
|
|
1519
|
-
|
|
1509
|
+
const I = (u) => {
|
|
1510
|
+
u.stopPropagation(), !l && (h(!N), x(null), M.current && (clearTimeout(M.current), M.current = null));
|
|
1511
|
+
}, W = (u, E, w) => {
|
|
1512
|
+
u.stopPropagation(), !E.disabled && !E.divider && (!E.children || E.children.length === 0) && (s?.(E.value, w), h(!1), x(null));
|
|
1513
|
+
}, H = (u) => {
|
|
1514
|
+
M.current && (clearTimeout(M.current), M.current = null), u.children && u.children.length > 0 ? x(u.value) : x(null);
|
|
1515
|
+
}, Y = (u) => {
|
|
1516
|
+
u.children && u.children.length > 0 ? M.current = setTimeout(() => {
|
|
1517
|
+
x(null);
|
|
1518
|
+
}, 150) : x(null);
|
|
1519
|
+
}, Z = (u, E, w) => {
|
|
1520
|
+
u.stopPropagation(), !E.disabled && !E.divider && (s?.(E.value, w), h(!1), x(null));
|
|
1520
1521
|
}, Q = d(
|
|
1521
1522
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1522
1523
|
"max-h-60 overflow-auto"
|
|
@@ -1527,7 +1528,7 @@ const Vt = ({
|
|
|
1527
1528
|
return /* @__PURE__ */ i(
|
|
1528
1529
|
"div",
|
|
1529
1530
|
{
|
|
1530
|
-
ref:
|
|
1531
|
+
ref: y,
|
|
1531
1532
|
className: d(
|
|
1532
1533
|
"relative flex flex-row items-center justify-center rounded-lg hover:bg-surface-hover",
|
|
1533
1534
|
c
|
|
@@ -1536,8 +1537,8 @@ const Vt = ({
|
|
|
1536
1537
|
/* @__PURE__ */ e(
|
|
1537
1538
|
"button",
|
|
1538
1539
|
{
|
|
1539
|
-
ref:
|
|
1540
|
-
onClick:
|
|
1540
|
+
ref: g,
|
|
1541
|
+
onClick: I,
|
|
1541
1542
|
disabled: l,
|
|
1542
1543
|
"aria-haspopup": "menu",
|
|
1543
1544
|
"aria-expanded": N,
|
|
@@ -1547,10 +1548,10 @@ const Vt = ({
|
|
|
1547
1548
|
children: t
|
|
1548
1549
|
}
|
|
1549
1550
|
),
|
|
1550
|
-
N && /* @__PURE__ */ e("div", { ref:
|
|
1551
|
-
|
|
1552
|
-
r.map((
|
|
1553
|
-
if (
|
|
1551
|
+
N && /* @__PURE__ */ e("div", { ref: $, className: Q, style: _, onKeyDown: V, children: /* @__PURE__ */ i("div", { className: "p-2", role: "menu", children: [
|
|
1552
|
+
p && (typeof p == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: p }) : p),
|
|
1553
|
+
r.map((u, E) => {
|
|
1554
|
+
if (u.divider)
|
|
1554
1555
|
return /* @__PURE__ */ e(
|
|
1555
1556
|
"div",
|
|
1556
1557
|
{
|
|
@@ -1558,58 +1559,58 @@ const Vt = ({
|
|
|
1558
1559
|
},
|
|
1559
1560
|
`divider-${E}`
|
|
1560
1561
|
);
|
|
1561
|
-
const w =
|
|
1562
|
+
const w = u.children && u.children.length > 0, P = m === u.value;
|
|
1562
1563
|
return /* @__PURE__ */ i("div", { className: "relative group", children: [
|
|
1563
1564
|
/* @__PURE__ */ i(
|
|
1564
1565
|
"button",
|
|
1565
1566
|
{
|
|
1566
|
-
"data-option-value":
|
|
1567
|
+
"data-option-value": u.value,
|
|
1567
1568
|
role: "menuitem",
|
|
1568
1569
|
"aria-haspopup": w ? "menu" : void 0,
|
|
1569
|
-
onClick: (k) =>
|
|
1570
|
-
onMouseEnter: () =>
|
|
1571
|
-
onMouseLeave: () => Y(
|
|
1572
|
-
disabled:
|
|
1570
|
+
onClick: (k) => W(k, u),
|
|
1571
|
+
onMouseEnter: () => H(u),
|
|
1572
|
+
onMouseLeave: () => Y(u),
|
|
1573
|
+
disabled: u.disabled,
|
|
1573
1574
|
className: d(
|
|
1574
1575
|
"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",
|
|
1575
1576
|
{
|
|
1576
|
-
"opacity-50 cursor-not-allowed":
|
|
1577
|
-
"bg-surface-hover":
|
|
1577
|
+
"opacity-50 cursor-not-allowed": u.disabled,
|
|
1578
|
+
"bg-surface-hover": P && w
|
|
1578
1579
|
}
|
|
1579
1580
|
),
|
|
1580
1581
|
children: [
|
|
1581
1582
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1582
|
-
|
|
1583
|
+
u.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: u.icon }),
|
|
1583
1584
|
/* @__PURE__ */ i("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1584
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
1585
|
-
|
|
1585
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: u.label }),
|
|
1586
|
+
u.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: u.description })
|
|
1586
1587
|
] })
|
|
1587
1588
|
] }),
|
|
1588
1589
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1589
|
-
f && n ===
|
|
1590
|
+
f && n === u.value && /* @__PURE__ */ e(Me, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
|
|
1590
1591
|
w && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
|
|
1591
1592
|
] })
|
|
1592
1593
|
]
|
|
1593
1594
|
}
|
|
1594
1595
|
),
|
|
1595
|
-
w &&
|
|
1596
|
+
w && P && /* @__PURE__ */ e(
|
|
1596
1597
|
"div",
|
|
1597
1598
|
{
|
|
1598
|
-
ref:
|
|
1599
|
+
ref: A,
|
|
1599
1600
|
className: b,
|
|
1600
1601
|
style: {
|
|
1601
1602
|
top: `${v.top}px`,
|
|
1602
1603
|
left: `${v.left}px`
|
|
1603
1604
|
},
|
|
1604
1605
|
onMouseEnter: () => {
|
|
1605
|
-
|
|
1606
|
+
M.current && (clearTimeout(M.current), M.current = null), x(u.value);
|
|
1606
1607
|
},
|
|
1607
1608
|
onMouseLeave: () => {
|
|
1608
|
-
|
|
1609
|
-
|
|
1609
|
+
M.current = setTimeout(() => {
|
|
1610
|
+
x(null);
|
|
1610
1611
|
}, 150);
|
|
1611
1612
|
},
|
|
1612
|
-
children: /* @__PURE__ */ e("div", { className: "p-2", children:
|
|
1613
|
+
children: /* @__PURE__ */ e("div", { className: "p-2", children: u.children.map((k, ae) => {
|
|
1613
1614
|
if (k.divider)
|
|
1614
1615
|
return /* @__PURE__ */ e(
|
|
1615
1616
|
"div",
|
|
@@ -1618,7 +1619,7 @@ const Vt = ({
|
|
|
1618
1619
|
},
|
|
1619
1620
|
`divider-${ae}`
|
|
1620
1621
|
);
|
|
1621
|
-
const ne = typeof n == "object" && n[
|
|
1622
|
+
const ne = typeof n == "object" && n[u.value] && n[u.value].includes(
|
|
1622
1623
|
k.value
|
|
1623
1624
|
) || n === k.value;
|
|
1624
1625
|
return /* @__PURE__ */ i(
|
|
@@ -1627,7 +1628,7 @@ const Vt = ({
|
|
|
1627
1628
|
onClick: (ee) => Z(
|
|
1628
1629
|
ee,
|
|
1629
1630
|
k,
|
|
1630
|
-
|
|
1631
|
+
u.value
|
|
1631
1632
|
),
|
|
1632
1633
|
disabled: k.disabled,
|
|
1633
1634
|
className: d(
|
|
@@ -1652,16 +1653,16 @@ const Vt = ({
|
|
|
1652
1653
|
}) })
|
|
1653
1654
|
}
|
|
1654
1655
|
)
|
|
1655
|
-
] },
|
|
1656
|
+
] }, u.value);
|
|
1656
1657
|
}),
|
|
1657
1658
|
(() => {
|
|
1658
|
-
const
|
|
1659
|
+
const u = r.reduce((E, w) => {
|
|
1659
1660
|
if (w.divider) return E;
|
|
1660
|
-
const
|
|
1661
|
-
return E + 1 +
|
|
1661
|
+
const P = w.children ? w.children.filter((k) => !k.divider).length : 0;
|
|
1662
|
+
return E + 1 + P;
|
|
1662
1663
|
}, 0);
|
|
1663
|
-
return
|
|
1664
|
-
|
|
1664
|
+
return u > 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: [
|
|
1665
|
+
u,
|
|
1665
1666
|
" options available"
|
|
1666
1667
|
] }) });
|
|
1667
1668
|
})()
|
|
@@ -1725,104 +1726,104 @@ const Vt = ({
|
|
|
1725
1726
|
filters: l = [],
|
|
1726
1727
|
paginated: c = !1,
|
|
1727
1728
|
pageSizeOptions: f = [10, 25, 50, 100],
|
|
1728
|
-
defaultPageSize:
|
|
1729
|
+
defaultPageSize: p = 10,
|
|
1729
1730
|
actions: N = [],
|
|
1730
|
-
onRowClick:
|
|
1731
|
-
selectable:
|
|
1732
|
-
selectedRows:
|
|
1731
|
+
onRowClick: h,
|
|
1732
|
+
selectable: m = !1,
|
|
1733
|
+
selectedRows: x = [],
|
|
1733
1734
|
onSelectionChange: v,
|
|
1734
|
-
getRowKey: C = (
|
|
1735
|
-
emptyContent:
|
|
1736
|
-
hoverable:
|
|
1737
|
-
bordered:
|
|
1738
|
-
striped:
|
|
1739
|
-
className:
|
|
1740
|
-
rowClassName:
|
|
1735
|
+
getRowKey: C = (U, V) => V,
|
|
1736
|
+
emptyContent: y,
|
|
1737
|
+
hoverable: g = !0,
|
|
1738
|
+
bordered: A = !1,
|
|
1739
|
+
striped: $ = !1,
|
|
1740
|
+
className: _,
|
|
1741
|
+
rowClassName: M
|
|
1741
1742
|
}) => {
|
|
1742
|
-
const [
|
|
1743
|
+
const [U, V] = R(""), [I, W] = R({
|
|
1743
1744
|
column: null,
|
|
1744
1745
|
direction: null
|
|
1745
|
-
}), [
|
|
1746
|
+
}), [H, Y] = R({
|
|
1746
1747
|
page: 0,
|
|
1747
|
-
pageSize:
|
|
1748
|
+
pageSize: p
|
|
1748
1749
|
}), Z = se(null), Q = me(() => {
|
|
1749
1750
|
let o = t;
|
|
1750
|
-
if (s &&
|
|
1751
|
+
if (s && U.trim()) {
|
|
1751
1752
|
const z = r.filter(
|
|
1752
|
-
(
|
|
1753
|
-
),
|
|
1754
|
-
o = o.filter((
|
|
1755
|
-
const te = typeof O.accessor == "function" ? O.accessor(
|
|
1756
|
-
return String(te || "").toLowerCase().includes(
|
|
1753
|
+
(F) => F.searchable !== !1
|
|
1754
|
+
), B = U.toLowerCase();
|
|
1755
|
+
o = o.filter((F) => z.some((O) => {
|
|
1756
|
+
const te = typeof O.accessor == "function" ? O.accessor(F) : F[O.accessor];
|
|
1757
|
+
return String(te || "").toLowerCase().includes(B);
|
|
1757
1758
|
}));
|
|
1758
1759
|
}
|
|
1759
1760
|
return l.forEach((z) => {
|
|
1760
|
-
z.value && z.value !== "all" && (o = o.filter((
|
|
1761
|
-
const
|
|
1762
|
-
if (!
|
|
1763
|
-
const O = typeof
|
|
1761
|
+
z.value && z.value !== "all" && (o = o.filter((B) => {
|
|
1762
|
+
const F = r.find((te) => te.id === z.id);
|
|
1763
|
+
if (!F) return !0;
|
|
1764
|
+
const O = typeof F.accessor == "function" ? F.accessor(B) : B[F.accessor];
|
|
1764
1765
|
return String(O || "") === z.value;
|
|
1765
1766
|
}));
|
|
1766
1767
|
}), o;
|
|
1767
|
-
}, [t,
|
|
1768
|
-
if (!
|
|
1769
|
-
const o = r.find((z) => z.id ===
|
|
1770
|
-
return o ? [...Q].sort((z,
|
|
1771
|
-
const
|
|
1768
|
+
}, [t, U, r, s, l]), b = me(() => {
|
|
1769
|
+
if (!I.column || !I.direction) return Q;
|
|
1770
|
+
const o = r.find((z) => z.id === I.column);
|
|
1771
|
+
return o ? [...Q].sort((z, B) => {
|
|
1772
|
+
const F = typeof o.accessor == "function" ? o.accessor(z) : z[o.accessor], O = typeof o.accessor == "function" ? o.accessor(B) : B[o.accessor];
|
|
1772
1773
|
let te = 0;
|
|
1773
|
-
return
|
|
1774
|
+
return F < O ? te = -1 : F > O && (te = 1), I.direction === "desc" ? -te : te;
|
|
1774
1775
|
}) : Q;
|
|
1775
|
-
}, [Q,
|
|
1776
|
+
}, [Q, I, r]), u = me(() => {
|
|
1776
1777
|
if (!c) return b;
|
|
1777
|
-
const o =
|
|
1778
|
+
const o = H.page * H.pageSize, z = o + H.pageSize;
|
|
1778
1779
|
return b.slice(o, z);
|
|
1779
|
-
}, [b,
|
|
1780
|
+
}, [b, H, c]), E = ce(
|
|
1780
1781
|
(o) => {
|
|
1781
|
-
r.find((
|
|
1782
|
+
r.find((B) => B.id === o)?.sortable && W((B) => B.column !== o ? { column: o, direction: "asc" } : B.direction === "asc" ? { column: o, direction: "desc" } : { column: null, direction: null });
|
|
1782
1783
|
},
|
|
1783
1784
|
[r]
|
|
1784
1785
|
), w = ce((o) => {
|
|
1785
1786
|
Y((z) => ({ ...z, page: o }));
|
|
1786
|
-
}, []),
|
|
1787
|
+
}, []), P = ce((o) => {
|
|
1787
1788
|
Y({ page: 0, pageSize: o });
|
|
1788
1789
|
}, []), k = ce(
|
|
1789
1790
|
(o, z) => {
|
|
1790
1791
|
if (!v) return;
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1793
|
-
(
|
|
1792
|
+
const B = C(o, 0);
|
|
1793
|
+
x.map((F, O) => C(F, O)), v(z ? [...x, o] : x.filter(
|
|
1794
|
+
(F, O) => C(x[O], O) !== B
|
|
1794
1795
|
));
|
|
1795
1796
|
},
|
|
1796
|
-
[
|
|
1797
|
+
[x, v, C]
|
|
1797
1798
|
), ae = ce(
|
|
1798
1799
|
(o) => {
|
|
1799
|
-
v && v(o ? [...
|
|
1800
|
+
v && v(o ? [...u] : []);
|
|
1800
1801
|
},
|
|
1801
|
-
[
|
|
1802
|
+
[u, v]
|
|
1802
1803
|
);
|
|
1803
1804
|
J(() => {
|
|
1804
1805
|
Y((o) => ({ ...o, page: 0 }));
|
|
1805
|
-
}, [
|
|
1806
|
+
}, [U, I]), J(() => {
|
|
1806
1807
|
Y((o) => ({ ...o, page: 0 }));
|
|
1807
1808
|
}, [l.map((o) => o.value).join(",")]);
|
|
1808
|
-
const ne = b.length, ee = Math.ceil(ne /
|
|
1809
|
+
const ne = b.length, ee = Math.ceil(ne / H.pageSize), G = H.page * H.pageSize + 1, S = Math.min(G + H.pageSize - 1, ne), T = u.length > 0 && u.every((o) => {
|
|
1809
1810
|
const z = C(o, 0);
|
|
1810
|
-
return
|
|
1811
|
-
(
|
|
1811
|
+
return x.some(
|
|
1812
|
+
(B, F) => C(B, F) === z
|
|
1812
1813
|
);
|
|
1813
|
-
}),
|
|
1814
|
+
}), L = u.some((o) => {
|
|
1814
1815
|
const z = C(o, 0);
|
|
1815
|
-
return
|
|
1816
|
-
(
|
|
1816
|
+
return x.some(
|
|
1817
|
+
(B, F) => C(B, F) === z
|
|
1817
1818
|
);
|
|
1818
|
-
}),
|
|
1819
|
+
}), D = d(
|
|
1819
1820
|
"w-full text-sm leading-5 text-text border-collapse",
|
|
1820
|
-
|
|
1821
|
+
_
|
|
1821
1822
|
), q = d("bg-surface"), j = d(
|
|
1822
1823
|
"text-text p-3 border-b border-border"
|
|
1823
|
-
),
|
|
1824
|
-
"hover:bg-surface-sunk":
|
|
1825
|
-
"cursor-pointer":
|
|
1824
|
+
), K = d("h-row-lg", {
|
|
1825
|
+
"hover:bg-surface-sunk": g,
|
|
1826
|
+
"cursor-pointer": h
|
|
1826
1827
|
});
|
|
1827
1828
|
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
1828
1829
|
(s || l.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */ i("div", { className: "flex flex-wrap gap-4 items-start", children: [
|
|
@@ -1831,8 +1832,8 @@ const Vt = ({
|
|
|
1831
1832
|
he,
|
|
1832
1833
|
{
|
|
1833
1834
|
placeholder: a,
|
|
1834
|
-
value:
|
|
1835
|
-
onChange: (o) =>
|
|
1835
|
+
value: U,
|
|
1836
|
+
onChange: (o) => V(o.target.value),
|
|
1836
1837
|
startIcon: /* @__PURE__ */ e(Ht, {}),
|
|
1837
1838
|
className: "max-w-sm"
|
|
1838
1839
|
}
|
|
@@ -1847,15 +1848,15 @@ const Vt = ({
|
|
|
1847
1848
|
tableColumns: r.length
|
|
1848
1849
|
}
|
|
1849
1850
|
) }),
|
|
1850
|
-
/* @__PURE__ */ i("table", { ref: Z, className: d(
|
|
1851
|
+
/* @__PURE__ */ i("table", { ref: Z, className: d(D, "min-w-full"), children: [
|
|
1851
1852
|
/* @__PURE__ */ e("thead", { className: q, children: /* @__PURE__ */ i("tr", { children: [
|
|
1852
|
-
|
|
1853
|
+
m && /* @__PURE__ */ e("th", { className: d(j, "w-12"), children: /* @__PURE__ */ e(
|
|
1853
1854
|
"input",
|
|
1854
1855
|
{
|
|
1855
1856
|
type: "checkbox",
|
|
1856
|
-
checked:
|
|
1857
|
+
checked: T,
|
|
1857
1858
|
ref: (o) => {
|
|
1858
|
-
o && (o.indeterminate =
|
|
1859
|
+
o && (o.indeterminate = L && !T);
|
|
1859
1860
|
},
|
|
1860
1861
|
onChange: (o) => ae(o.target.checked),
|
|
1861
1862
|
className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
|
|
@@ -1886,19 +1887,19 @@ const Vt = ({
|
|
|
1886
1887
|
{
|
|
1887
1888
|
className: d(
|
|
1888
1889
|
"flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
|
|
1889
|
-
|
|
1890
|
+
I.column === o.id && "opacity-100"
|
|
1890
1891
|
),
|
|
1891
1892
|
children: [
|
|
1892
1893
|
/* @__PURE__ */ e(
|
|
1893
1894
|
Ut,
|
|
1894
1895
|
{
|
|
1895
|
-
active:
|
|
1896
|
+
active: I.column === o.id && I.direction === "asc"
|
|
1896
1897
|
}
|
|
1897
1898
|
),
|
|
1898
1899
|
/* @__PURE__ */ e(
|
|
1899
1900
|
qt,
|
|
1900
1901
|
{
|
|
1901
|
-
active:
|
|
1902
|
+
active: I.column === o.id && I.direction === "desc"
|
|
1902
1903
|
}
|
|
1903
1904
|
)
|
|
1904
1905
|
]
|
|
@@ -1910,37 +1911,37 @@ const Vt = ({
|
|
|
1910
1911
|
)),
|
|
1911
1912
|
N.length > 0 && /* @__PURE__ */ e("th", { className: d(j, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
1912
1913
|
] }) }),
|
|
1913
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
1914
|
+
/* @__PURE__ */ e("tbody", { children: u.length === 0 || n ? !n && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1914
1915
|
"td",
|
|
1915
1916
|
{
|
|
1916
|
-
colSpan: r.length + (
|
|
1917
|
+
colSpan: r.length + (m ? 1 : 0) + (N.length > 0 ? 1 : 0),
|
|
1917
1918
|
className: d(
|
|
1918
1919
|
j,
|
|
1919
1920
|
"text-center py-8 text-text-muted"
|
|
1920
1921
|
),
|
|
1921
|
-
children:
|
|
1922
|
+
children: y || "No data available"
|
|
1922
1923
|
}
|
|
1923
|
-
) }) :
|
|
1924
|
-
const
|
|
1925
|
-
(O, te) => C(O, te) ===
|
|
1924
|
+
) }) : u.map((o, z) => {
|
|
1925
|
+
const B = C(o, z), F = x.some(
|
|
1926
|
+
(O, te) => C(O, te) === B
|
|
1926
1927
|
);
|
|
1927
1928
|
return /* @__PURE__ */ i(
|
|
1928
1929
|
"tr",
|
|
1929
1930
|
{
|
|
1930
1931
|
className: d(
|
|
1931
|
-
|
|
1932
|
-
{ "bg-accent-soft":
|
|
1933
|
-
|
|
1932
|
+
K,
|
|
1933
|
+
{ "bg-accent-soft": F },
|
|
1934
|
+
M?.(o, z)
|
|
1934
1935
|
),
|
|
1935
1936
|
onClick: (O) => {
|
|
1936
|
-
O.stopPropagation(),
|
|
1937
|
+
O.stopPropagation(), h?.(o, z);
|
|
1937
1938
|
},
|
|
1938
1939
|
children: [
|
|
1939
|
-
|
|
1940
|
+
m && /* @__PURE__ */ e("td", { className: j, children: /* @__PURE__ */ e(
|
|
1940
1941
|
"input",
|
|
1941
1942
|
{
|
|
1942
1943
|
type: "checkbox",
|
|
1943
|
-
checked:
|
|
1944
|
+
checked: F,
|
|
1944
1945
|
onChange: (O) => {
|
|
1945
1946
|
O.stopPropagation(), k(o, O.target.checked);
|
|
1946
1947
|
},
|
|
@@ -1988,7 +1989,7 @@ const Vt = ({
|
|
|
1988
1989
|
) })
|
|
1989
1990
|
]
|
|
1990
1991
|
},
|
|
1991
|
-
|
|
1992
|
+
B
|
|
1992
1993
|
);
|
|
1993
1994
|
}) })
|
|
1994
1995
|
] })
|
|
@@ -2009,8 +2010,8 @@ const Vt = ({
|
|
|
2009
2010
|
/* @__PURE__ */ e(
|
|
2010
2011
|
"select",
|
|
2011
2012
|
{
|
|
2012
|
-
value:
|
|
2013
|
-
onChange: (o) =>
|
|
2013
|
+
value: H.pageSize,
|
|
2014
|
+
onChange: (o) => P(Number(o.target.value)),
|
|
2014
2015
|
className: "h-control-sm w-16 rounded-md border border-border bg-surface-input px-2 text-sm text-text",
|
|
2015
2016
|
children: f.map((o) => /* @__PURE__ */ e("option", { value: o, children: o }, o))
|
|
2016
2017
|
}
|
|
@@ -2024,7 +2025,7 @@ const Vt = ({
|
|
|
2024
2025
|
size: "sm",
|
|
2025
2026
|
variant: "ghost",
|
|
2026
2027
|
onClick: () => w(0),
|
|
2027
|
-
disabled:
|
|
2028
|
+
disabled: H.page === 0,
|
|
2028
2029
|
iconOnly: !0,
|
|
2029
2030
|
children: /* @__PURE__ */ e(_t, {})
|
|
2030
2031
|
}
|
|
@@ -2034,15 +2035,15 @@ const Vt = ({
|
|
|
2034
2035
|
{
|
|
2035
2036
|
size: "sm",
|
|
2036
2037
|
variant: "ghost",
|
|
2037
|
-
onClick: () => w(
|
|
2038
|
-
disabled:
|
|
2038
|
+
onClick: () => w(H.page - 1),
|
|
2039
|
+
disabled: H.page === 0,
|
|
2039
2040
|
iconOnly: !0,
|
|
2040
2041
|
children: /* @__PURE__ */ e(Wt, {})
|
|
2041
2042
|
}
|
|
2042
2043
|
),
|
|
2043
2044
|
/* @__PURE__ */ i("span", { className: "px-3 py-1 text-sm text-text-muted", children: [
|
|
2044
2045
|
"Page ",
|
|
2045
|
-
|
|
2046
|
+
H.page + 1,
|
|
2046
2047
|
" of ",
|
|
2047
2048
|
ee
|
|
2048
2049
|
] }),
|
|
@@ -2051,8 +2052,8 @@ const Vt = ({
|
|
|
2051
2052
|
{
|
|
2052
2053
|
size: "sm",
|
|
2053
2054
|
variant: "ghost",
|
|
2054
|
-
onClick: () => w(
|
|
2055
|
-
disabled:
|
|
2055
|
+
onClick: () => w(H.page + 1),
|
|
2056
|
+
disabled: H.page >= ee - 1,
|
|
2056
2057
|
iconOnly: !0,
|
|
2057
2058
|
children: /* @__PURE__ */ e(Kt, {})
|
|
2058
2059
|
}
|
|
@@ -2063,7 +2064,7 @@ const Vt = ({
|
|
|
2063
2064
|
size: "sm",
|
|
2064
2065
|
variant: "ghost",
|
|
2065
2066
|
onClick: () => w(ee - 1),
|
|
2066
|
-
disabled:
|
|
2067
|
+
disabled: H.page >= ee - 1,
|
|
2067
2068
|
iconOnly: !0,
|
|
2068
2069
|
children: /* @__PURE__ */ e(Gt, {})
|
|
2069
2070
|
}
|
|
@@ -2077,31 +2078,31 @@ const Vt = ({
|
|
|
2077
2078
|
onTabChange: n,
|
|
2078
2079
|
className: s
|
|
2079
2080
|
}) => {
|
|
2080
|
-
const [a, l] =
|
|
2081
|
-
n ? n(
|
|
2081
|
+
const [a, l] = R(t[0]?.id || ""), c = r || a, f = (p) => {
|
|
2082
|
+
n ? n(p) : l(p);
|
|
2082
2083
|
};
|
|
2083
|
-
return /* @__PURE__ */ e("div", { className: d("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((
|
|
2084
|
+
return /* @__PURE__ */ e("div", { className: d("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((p) => /* @__PURE__ */ e(
|
|
2084
2085
|
"button",
|
|
2085
2086
|
{
|
|
2086
|
-
onClick: () => !
|
|
2087
|
-
disabled:
|
|
2087
|
+
onClick: () => !p.disabled && f(p.id),
|
|
2088
|
+
disabled: p.disabled,
|
|
2088
2089
|
className: d(
|
|
2089
2090
|
"border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-fast",
|
|
2090
2091
|
{
|
|
2091
|
-
"border-accent-border text-text": c ===
|
|
2092
|
-
"border-transparent text-text-muted hover:text-text": c !==
|
|
2093
|
-
"border-transparent text-disabled cursor-not-allowed":
|
|
2092
|
+
"border-accent-border text-text": c === p.id,
|
|
2093
|
+
"border-transparent text-text-muted hover:text-text": c !== p.id && !p.disabled,
|
|
2094
|
+
"border-transparent text-disabled cursor-not-allowed": p.disabled
|
|
2094
2095
|
}
|
|
2095
2096
|
),
|
|
2096
2097
|
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2097
|
-
|
|
2098
|
-
|
|
2098
|
+
p.label,
|
|
2099
|
+
p.badge && /* @__PURE__ */ e("span", { className: d(
|
|
2099
2100
|
"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
|
|
2100
|
-
c ===
|
|
2101
|
-
), children:
|
|
2101
|
+
c === p.id ? "bg-accent-soft text-accent" : "bg-surface-hover text-text-muted"
|
|
2102
|
+
), children: p.badge })
|
|
2102
2103
|
] })
|
|
2103
2104
|
},
|
|
2104
|
-
|
|
2105
|
+
p.id
|
|
2105
2106
|
)) }) });
|
|
2106
2107
|
}, Xt = ({
|
|
2107
2108
|
items: t,
|
|
@@ -2112,14 +2113,14 @@ const Vt = ({
|
|
|
2112
2113
|
size: l = "md",
|
|
2113
2114
|
className: c
|
|
2114
2115
|
}) => {
|
|
2115
|
-
const [f,
|
|
2116
|
+
const [f, p] = R(
|
|
2116
2117
|
r || n || t[0]?.id || ""
|
|
2117
|
-
), N = n || f,
|
|
2118
|
-
s ? s(
|
|
2119
|
-
},
|
|
2118
|
+
), N = n || f, h = (y) => {
|
|
2119
|
+
s ? s(y) : p(y);
|
|
2120
|
+
}, m = {
|
|
2120
2121
|
activeTab: N,
|
|
2121
|
-
setActiveTab:
|
|
2122
|
-
},
|
|
2122
|
+
setActiveTab: h
|
|
2123
|
+
}, x = t.find((y) => y.id === N), v = d(
|
|
2123
2124
|
"flex",
|
|
2124
2125
|
{
|
|
2125
2126
|
"border-b border-border px-2": a === "default" || a === "underline",
|
|
@@ -2128,57 +2129,57 @@ const Vt = ({
|
|
|
2128
2129
|
"space-x-8": a === "default" || a === "underline"
|
|
2129
2130
|
},
|
|
2130
2131
|
c
|
|
2131
|
-
), C = (
|
|
2132
|
-
const
|
|
2132
|
+
), C = (y, g) => {
|
|
2133
|
+
const A = "transition-colors duration-fast font-medium", $ = {
|
|
2133
2134
|
"text-xs px-2 py-1": l === "sm",
|
|
2134
2135
|
"text-sm px-3 py-2": l === "md",
|
|
2135
2136
|
"text-base px-4 py-3": l === "lg"
|
|
2136
|
-
},
|
|
2137
|
+
}, _ = {
|
|
2137
2138
|
// Default variant
|
|
2138
2139
|
"border-b-2 -mb-px": a === "default",
|
|
2139
2140
|
// Pills variant
|
|
2140
2141
|
"rounded-md": a === "pills",
|
|
2141
2142
|
// Underline variant
|
|
2142
2143
|
"border-b-2 pb-2": a === "underline"
|
|
2143
|
-
},
|
|
2144
|
-
"opacity-50 cursor-not-allowed":
|
|
2145
|
-
"cursor-pointer": !
|
|
2146
|
-
},
|
|
2144
|
+
}, M = {
|
|
2145
|
+
"opacity-50 cursor-not-allowed": y.disabled,
|
|
2146
|
+
"cursor-pointer": !y.disabled
|
|
2147
|
+
}, U = g ? {
|
|
2147
2148
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
2148
2149
|
"bg-surface text-text shadow-none": a === "pills"
|
|
2149
|
-
} : {},
|
|
2150
|
+
} : {}, V = !g && !y.disabled ? {
|
|
2150
2151
|
"border-transparent text-text-muted hover:text-text": a === "default",
|
|
2151
2152
|
"text-text-muted hover:text-text": a === "pills",
|
|
2152
2153
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
2153
2154
|
} : {};
|
|
2154
|
-
return d(
|
|
2155
|
+
return d(A, $, _, M, U, V);
|
|
2155
2156
|
};
|
|
2156
|
-
return /* @__PURE__ */ e(Yt.Provider, { value:
|
|
2157
|
-
/* @__PURE__ */ e("div", { className: v, role: "tablist", children: t.map((
|
|
2157
|
+
return /* @__PURE__ */ e(Yt.Provider, { value: m, children: /* @__PURE__ */ i("div", { children: [
|
|
2158
|
+
/* @__PURE__ */ e("div", { className: v, role: "tablist", children: t.map((y) => /* @__PURE__ */ e(
|
|
2158
2159
|
"button",
|
|
2159
2160
|
{
|
|
2160
2161
|
type: "button",
|
|
2161
2162
|
role: "tab",
|
|
2162
|
-
"aria-selected": N ===
|
|
2163
|
-
"aria-controls": `tabpanel-${
|
|
2164
|
-
disabled:
|
|
2165
|
-
onClick: () => !
|
|
2166
|
-
className: C(
|
|
2163
|
+
"aria-selected": N === y.id,
|
|
2164
|
+
"aria-controls": `tabpanel-${y.id}`,
|
|
2165
|
+
disabled: y.disabled,
|
|
2166
|
+
onClick: () => !y.disabled && h(y.id),
|
|
2167
|
+
className: C(y, N === y.id),
|
|
2167
2168
|
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2168
|
-
|
|
2169
|
-
|
|
2169
|
+
y.label,
|
|
2170
|
+
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 })
|
|
2170
2171
|
] })
|
|
2171
2172
|
},
|
|
2172
|
-
|
|
2173
|
+
y.id
|
|
2173
2174
|
)) }),
|
|
2174
|
-
|
|
2175
|
+
x?.content && /* @__PURE__ */ e(
|
|
2175
2176
|
"div",
|
|
2176
2177
|
{
|
|
2177
2178
|
role: "tabpanel",
|
|
2178
2179
|
id: `tabpanel-${N}`,
|
|
2179
2180
|
"aria-labelledby": `tab-${N}`,
|
|
2180
2181
|
className: "mt-4",
|
|
2181
|
-
children:
|
|
2182
|
+
children: x.content
|
|
2182
2183
|
}
|
|
2183
2184
|
)
|
|
2184
2185
|
] }) });
|
|
@@ -2198,18 +2199,18 @@ function Fe({
|
|
|
2198
2199
|
closeOnEscape: l = !0,
|
|
2199
2200
|
className: c,
|
|
2200
2201
|
backdropClassName: f,
|
|
2201
|
-
children:
|
|
2202
|
+
children: p,
|
|
2202
2203
|
footer: N,
|
|
2203
|
-
showCloseButton:
|
|
2204
|
+
showCloseButton: h = !0
|
|
2204
2205
|
}) {
|
|
2205
|
-
const
|
|
2206
|
+
const m = se(null), x = se(null);
|
|
2206
2207
|
J(() => {
|
|
2207
2208
|
if (!t || !l) return;
|
|
2208
|
-
const C = (
|
|
2209
|
-
|
|
2209
|
+
const C = (y) => {
|
|
2210
|
+
y.key === "Escape" && r();
|
|
2210
2211
|
};
|
|
2211
2212
|
return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
|
|
2212
|
-
}, [t, l, r]), J(() => (t ? (
|
|
2213
|
+
}, [t, l, r]), J(() => (t ? (x.current = document.activeElement, m.current && m.current.focus(), document.body.style.overflow = "hidden") : (x.current && x.current.focus(), document.body.style.overflow = ""), () => {
|
|
2213
2214
|
document.body.style.overflow = "";
|
|
2214
2215
|
}), [t]);
|
|
2215
2216
|
const v = (C) => {
|
|
@@ -2228,7 +2229,7 @@ function Fe({
|
|
|
2228
2229
|
children: /* @__PURE__ */ i(
|
|
2229
2230
|
"div",
|
|
2230
2231
|
{
|
|
2231
|
-
ref:
|
|
2232
|
+
ref: m,
|
|
2232
2233
|
className: d(
|
|
2233
2234
|
"relative w-full bg-surface rounded-lg shadow-modal",
|
|
2234
2235
|
// 'animate-scale-in',
|
|
@@ -2241,7 +2242,7 @@ function Fe({
|
|
|
2241
2242
|
"aria-labelledby": n ? "modal-title" : void 0,
|
|
2242
2243
|
tabIndex: -1,
|
|
2243
2244
|
children: [
|
|
2244
|
-
(n ||
|
|
2245
|
+
(n || h) && /* @__PURE__ */ i("div", { className: "flex items-center justify-between p-6 pb-0", children: [
|
|
2245
2246
|
n && /* @__PURE__ */ e(
|
|
2246
2247
|
"span",
|
|
2247
2248
|
{
|
|
@@ -2250,7 +2251,7 @@ function Fe({
|
|
|
2250
2251
|
children: n
|
|
2251
2252
|
}
|
|
2252
2253
|
),
|
|
2253
|
-
|
|
2254
|
+
h && /* @__PURE__ */ e(
|
|
2254
2255
|
"button",
|
|
2255
2256
|
{
|
|
2256
2257
|
onClick: r,
|
|
@@ -2260,7 +2261,7 @@ function Fe({
|
|
|
2260
2261
|
}
|
|
2261
2262
|
)
|
|
2262
2263
|
] }),
|
|
2263
|
-
/* @__PURE__ */ e("div", { className: "p-6", children:
|
|
2264
|
+
/* @__PURE__ */ e("div", { className: "p-6", children: p }),
|
|
2264
2265
|
N && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: N })
|
|
2265
2266
|
]
|
|
2266
2267
|
}
|
|
@@ -2309,32 +2310,32 @@ const Qt = {
|
|
|
2309
2310
|
truncate: l = !1,
|
|
2310
2311
|
italic: c = !1,
|
|
2311
2312
|
underline: f = !1,
|
|
2312
|
-
lineHeight:
|
|
2313
|
+
lineHeight: p = "normal",
|
|
2313
2314
|
as: N,
|
|
2314
|
-
className:
|
|
2315
|
-
children:
|
|
2316
|
-
...
|
|
2315
|
+
className: h,
|
|
2316
|
+
children: m,
|
|
2317
|
+
...x
|
|
2317
2318
|
}) => {
|
|
2318
|
-
const v = N || sr(t), C = t === "caption",
|
|
2319
|
+
const v = N || sr(t), C = t === "caption", y = t === "label", g = t === "code", A = d(
|
|
2319
2320
|
"font-sans",
|
|
2320
2321
|
// Variant — caption and label pin their own size/weight
|
|
2321
2322
|
C && "text-xs text-text-subtle",
|
|
2322
|
-
|
|
2323
|
-
|
|
2323
|
+
y && "text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
2324
|
+
g && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
|
|
2324
2325
|
// Size — only where the variant does not pin it
|
|
2325
|
-
!C && !
|
|
2326
|
+
!C && !y && !g && Qt[r],
|
|
2326
2327
|
// Weight — label owns its weight
|
|
2327
|
-
!
|
|
2328
|
+
!y && er[n],
|
|
2328
2329
|
tr[s],
|
|
2329
2330
|
rr[a],
|
|
2330
2331
|
// Line height only overrides the body variant
|
|
2331
|
-
t === "body" && nr[
|
|
2332
|
+
t === "body" && nr[p],
|
|
2332
2333
|
c && "italic",
|
|
2333
2334
|
f && "underline",
|
|
2334
2335
|
l && "truncate",
|
|
2335
|
-
|
|
2336
|
+
h
|
|
2336
2337
|
);
|
|
2337
|
-
return /* @__PURE__ */ e(v, { className:
|
|
2338
|
+
return /* @__PURE__ */ e(v, { className: A, ...x, children: m });
|
|
2338
2339
|
};
|
|
2339
2340
|
function sr(t) {
|
|
2340
2341
|
return {
|
|
@@ -2353,47 +2354,47 @@ const ar = ({
|
|
|
2353
2354
|
disabled: l,
|
|
2354
2355
|
accept: c,
|
|
2355
2356
|
onListFiles: f,
|
|
2356
|
-
onListMounts:
|
|
2357
|
+
onListMounts: p,
|
|
2357
2358
|
onUploadFile: N,
|
|
2358
|
-
onDownloadFile:
|
|
2359
|
-
onRegisterFile:
|
|
2359
|
+
onDownloadFile: h,
|
|
2360
|
+
onRegisterFile: m
|
|
2360
2361
|
}) => {
|
|
2361
|
-
const [
|
|
2362
|
+
const [x, v] = R(!1), [C, y] = R([]), [g, A] = R(null), [$, _] = R("/"), [M, U] = R([]), [V, I] = R(!1), [W, H] = R(""), [Y, Z] = R(
|
|
2362
2363
|
typeof t == "object" ? t : null
|
|
2363
|
-
), [Q, b] =
|
|
2364
|
+
), [Q, b] = R(!1), [u, E] = R(""), w = se(null);
|
|
2364
2365
|
J(() => {
|
|
2365
|
-
|
|
2366
|
-
}, [
|
|
2367
|
-
|
|
2368
|
-
}, [
|
|
2369
|
-
const
|
|
2370
|
-
|
|
2366
|
+
x && P();
|
|
2367
|
+
}, [x]), J(() => {
|
|
2368
|
+
x && g && k();
|
|
2369
|
+
}, [x, g, $, W]);
|
|
2370
|
+
const P = async () => {
|
|
2371
|
+
I(!0);
|
|
2371
2372
|
try {
|
|
2372
|
-
const o = await
|
|
2373
|
-
o?.data &&
|
|
2373
|
+
const o = await p?.();
|
|
2374
|
+
o?.data && y(o.data);
|
|
2374
2375
|
} catch (o) {
|
|
2375
2376
|
console.error("Failed to load mounts", o);
|
|
2376
2377
|
} finally {
|
|
2377
|
-
|
|
2378
|
+
I(!1);
|
|
2378
2379
|
}
|
|
2379
2380
|
}, k = async () => {
|
|
2380
|
-
if (
|
|
2381
|
-
|
|
2381
|
+
if (g) {
|
|
2382
|
+
I(!0);
|
|
2382
2383
|
try {
|
|
2383
|
-
const o = await f?.({ mountId:
|
|
2384
|
-
o?.data &&
|
|
2384
|
+
const o = await f?.({ mountId: g.id, name: W, path: $ });
|
|
2385
|
+
o?.data && U(o.data);
|
|
2385
2386
|
} catch (o) {
|
|
2386
2387
|
console.error("Failed to load files", o);
|
|
2387
2388
|
} finally {
|
|
2388
|
-
|
|
2389
|
+
I(!1);
|
|
2389
2390
|
}
|
|
2390
2391
|
}
|
|
2391
2392
|
}, ae = async (o) => {
|
|
2392
2393
|
const z = o.target.files?.[0];
|
|
2393
2394
|
if (z) {
|
|
2394
|
-
|
|
2395
|
+
I(!0);
|
|
2395
2396
|
try {
|
|
2396
|
-
const
|
|
2397
|
+
const B = await z.arrayBuffer(), F = new Uint8Array(B), O = {
|
|
2397
2398
|
id: `local-${Date.now()}`,
|
|
2398
2399
|
name: z.name,
|
|
2399
2400
|
type: "file",
|
|
@@ -2404,99 +2405,99 @@ const ar = ({
|
|
|
2404
2405
|
providerKey: z.name,
|
|
2405
2406
|
ownerId: "me"
|
|
2406
2407
|
};
|
|
2407
|
-
Z(O), r(O,
|
|
2408
|
-
} catch (
|
|
2409
|
-
console.error("Local file selection failed",
|
|
2408
|
+
Z(O), r(O, F), v(!1);
|
|
2409
|
+
} catch (B) {
|
|
2410
|
+
console.error("Local file selection failed", B);
|
|
2410
2411
|
} finally {
|
|
2411
|
-
|
|
2412
|
+
I(!1);
|
|
2412
2413
|
}
|
|
2413
2414
|
}
|
|
2414
2415
|
}, ne = async (o) => {
|
|
2415
2416
|
const z = o.target.files?.[0];
|
|
2416
|
-
if (!(!z || !
|
|
2417
|
-
|
|
2417
|
+
if (!(!z || !g)) {
|
|
2418
|
+
I(!0);
|
|
2418
2419
|
try {
|
|
2419
|
-
const
|
|
2420
|
-
file: new Uint8Array(
|
|
2420
|
+
const B = await z.arrayBuffer(), F = await N?.({
|
|
2421
|
+
file: new Uint8Array(B),
|
|
2421
2422
|
filename: z.name,
|
|
2422
2423
|
mimeType: z.type || "application/octet-stream",
|
|
2423
|
-
mountId:
|
|
2424
|
-
path:
|
|
2424
|
+
mountId: g.id,
|
|
2425
|
+
path: $
|
|
2425
2426
|
});
|
|
2426
|
-
if (
|
|
2427
|
-
const O =
|
|
2428
|
-
Z(O), r(O, new Uint8Array(
|
|
2427
|
+
if (F?.data) {
|
|
2428
|
+
const O = F.data;
|
|
2429
|
+
Z(O), r(O, new Uint8Array(B)), v(!1);
|
|
2429
2430
|
}
|
|
2430
|
-
} catch (
|
|
2431
|
-
console.error("Upload failed",
|
|
2431
|
+
} catch (B) {
|
|
2432
|
+
console.error("Upload failed", B);
|
|
2432
2433
|
} finally {
|
|
2433
|
-
|
|
2434
|
+
I(!1);
|
|
2434
2435
|
}
|
|
2435
2436
|
}
|
|
2436
2437
|
}, ee = async () => {
|
|
2437
|
-
if (!(!
|
|
2438
|
-
|
|
2438
|
+
if (!(!u || !g)) {
|
|
2439
|
+
I(!0);
|
|
2439
2440
|
try {
|
|
2440
|
-
const o = `${
|
|
2441
|
-
|
|
2442
|
-
name:
|
|
2441
|
+
const o = `${$}${u}/`;
|
|
2442
|
+
m && (await m({
|
|
2443
|
+
name: u,
|
|
2443
2444
|
type: "folder",
|
|
2444
|
-
path:
|
|
2445
|
+
path: $,
|
|
2445
2446
|
mimeType: "application/x-directory",
|
|
2446
2447
|
size: 0,
|
|
2447
|
-
mountId:
|
|
2448
|
+
mountId: g.id,
|
|
2448
2449
|
providerKey: o,
|
|
2449
2450
|
ownerId: "me"
|
|
2450
2451
|
}), await k()), b(!1), E("");
|
|
2451
2452
|
} catch (o) {
|
|
2452
2453
|
console.error("Failed to create folder", o);
|
|
2453
2454
|
} finally {
|
|
2454
|
-
|
|
2455
|
+
I(!1);
|
|
2455
2456
|
}
|
|
2456
2457
|
}
|
|
2457
2458
|
}, G = async (o) => {
|
|
2458
|
-
|
|
2459
|
+
I(!0);
|
|
2459
2460
|
try {
|
|
2460
|
-
const z = await
|
|
2461
|
+
const z = await h?.(o.id);
|
|
2461
2462
|
Z(o), r(o, z), v(!1);
|
|
2462
2463
|
} catch (z) {
|
|
2463
2464
|
console.error("Failed to download file", z);
|
|
2464
2465
|
} finally {
|
|
2465
|
-
|
|
2466
|
+
I(!1);
|
|
2466
2467
|
}
|
|
2467
2468
|
}, S = (o) => {
|
|
2468
2469
|
o.stopPropagation(), Z(null), r(null);
|
|
2469
|
-
},
|
|
2470
|
+
}, T = me(() => {
|
|
2470
2471
|
const o = /* @__PURE__ */ new Set(), z = [];
|
|
2471
|
-
return
|
|
2472
|
-
if (
|
|
2473
|
-
|
|
2472
|
+
return M.forEach((B) => {
|
|
2473
|
+
if (B.type === "folder") {
|
|
2474
|
+
B.path === $ && o.add(B.name);
|
|
2474
2475
|
return;
|
|
2475
2476
|
}
|
|
2476
|
-
const
|
|
2477
|
-
te.length > 1 ? o.add(te[0]) : te.length === 1 && z.push(
|
|
2477
|
+
const F = B.providerKey || B.name, te = ($ ? F.substring($.length) : F).split("/").filter((ie) => ie !== "");
|
|
2478
|
+
te.length > 1 ? o.add(te[0]) : te.length === 1 && z.push(B);
|
|
2478
2479
|
}), {
|
|
2479
2480
|
folders: Array.from(o).sort(),
|
|
2480
|
-
files: z.sort((
|
|
2481
|
+
files: z.sort((B, F) => B.name.localeCompare(F.name))
|
|
2481
2482
|
};
|
|
2482
|
-
}, [
|
|
2483
|
-
|
|
2484
|
-
},
|
|
2485
|
-
const o =
|
|
2486
|
-
o.pop(), o.length === 0 ?
|
|
2483
|
+
}, [M, $]), L = (o) => {
|
|
2484
|
+
_((z) => `${z}${o}/`);
|
|
2485
|
+
}, D = () => {
|
|
2486
|
+
const o = $.split("/").filter((z) => z !== "");
|
|
2487
|
+
o.pop(), o.length === 0 ? _("/") : _(`${o.join("/")}/`);
|
|
2487
2488
|
}, q = me(() => {
|
|
2488
|
-
const o =
|
|
2489
|
+
const o = T.folders.map((z) => ({
|
|
2489
2490
|
id: `folder-${z}`,
|
|
2490
2491
|
name: z,
|
|
2491
2492
|
type: "folder"
|
|
2492
2493
|
}));
|
|
2493
|
-
return
|
|
2494
|
+
return T.files.forEach((z) => {
|
|
2494
2495
|
o.push({
|
|
2495
2496
|
...z,
|
|
2496
2497
|
type: "file"
|
|
2497
2498
|
});
|
|
2498
2499
|
}), o;
|
|
2499
|
-
}, [
|
|
2500
|
+
}, [T]), j = [
|
|
2500
2501
|
{
|
|
2501
2502
|
id: "name",
|
|
2502
2503
|
header: "Name",
|
|
@@ -2533,15 +2534,15 @@ const ar = ({
|
|
|
2533
2534
|
{
|
|
2534
2535
|
size: "sm",
|
|
2535
2536
|
variant: "outline",
|
|
2536
|
-
onClick: (
|
|
2537
|
-
|
|
2537
|
+
onClick: (B) => {
|
|
2538
|
+
B.stopPropagation(), z.type === "folder" ? L(z.name) : G(z);
|
|
2538
2539
|
},
|
|
2539
|
-
loading:
|
|
2540
|
+
loading: V && z.type === "file" && Y?.id === z.id,
|
|
2540
2541
|
children: z.type === "folder" ? "Open" : "Select"
|
|
2541
2542
|
}
|
|
2542
2543
|
)
|
|
2543
2544
|
}
|
|
2544
|
-
],
|
|
2545
|
+
], K = [
|
|
2545
2546
|
{
|
|
2546
2547
|
id: "name",
|
|
2547
2548
|
header: "Mount Name",
|
|
@@ -2556,7 +2557,7 @@ const ar = ({
|
|
|
2556
2557
|
header: "",
|
|
2557
2558
|
accessor: "id",
|
|
2558
2559
|
align: "right",
|
|
2559
|
-
cell: (o, z) => /* @__PURE__ */ e(re, { size: "sm", variant: "outline", onClick: () =>
|
|
2560
|
+
cell: (o, z) => /* @__PURE__ */ e(re, { size: "sm", variant: "outline", onClick: () => A(z), children: "Open" })
|
|
2560
2561
|
}
|
|
2561
2562
|
];
|
|
2562
2563
|
return /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
@@ -2589,11 +2590,11 @@ const ar = ({
|
|
|
2589
2590
|
/* @__PURE__ */ e(
|
|
2590
2591
|
Fe,
|
|
2591
2592
|
{
|
|
2592
|
-
open:
|
|
2593
|
+
open: x,
|
|
2593
2594
|
onClose: () => {
|
|
2594
|
-
v(!1),
|
|
2595
|
+
v(!1), A(null), _("/"), b(!1);
|
|
2595
2596
|
},
|
|
2596
|
-
title:
|
|
2597
|
+
title: g ? `Explorer: ${g.name}` : "Select Storage Mount",
|
|
2597
2598
|
size: "lg",
|
|
2598
2599
|
children: /* @__PURE__ */ e(
|
|
2599
2600
|
Xt,
|
|
@@ -2603,7 +2604,7 @@ const ar = ({
|
|
|
2603
2604
|
{
|
|
2604
2605
|
id: "remote",
|
|
2605
2606
|
label: "Platform Storage",
|
|
2606
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
2607
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: g ? /* @__PURE__ */ i(fe, { children: [
|
|
2607
2608
|
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2608
2609
|
/* @__PURE__ */ e(
|
|
2609
2610
|
re,
|
|
@@ -2611,19 +2612,19 @@ const ar = ({
|
|
|
2611
2612
|
variant: "ghost",
|
|
2612
2613
|
size: "sm",
|
|
2613
2614
|
onClick: () => {
|
|
2614
|
-
|
|
2615
|
+
$ && $ !== "/" ? D() : A(null);
|
|
2615
2616
|
},
|
|
2616
2617
|
leftIcon: /* @__PURE__ */ e(X, { icon: ze, size: "xs" }),
|
|
2617
|
-
children:
|
|
2618
|
+
children: $ ? "Back" : "Back to Mounts"
|
|
2618
2619
|
}
|
|
2619
2620
|
),
|
|
2620
|
-
/* @__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:
|
|
2621
|
+
/* @__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: $ }) }),
|
|
2621
2622
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
2622
2623
|
he,
|
|
2623
2624
|
{
|
|
2624
2625
|
placeholder: "Search...",
|
|
2625
|
-
value:
|
|
2626
|
-
onChange: (o) =>
|
|
2626
|
+
value: W,
|
|
2627
|
+
onChange: (o) => H(o.target.value),
|
|
2627
2628
|
startIcon: /* @__PURE__ */ e(Ne, { size: 14 }),
|
|
2628
2629
|
fullWidth: !0,
|
|
2629
2630
|
size: "sm"
|
|
@@ -2647,7 +2648,7 @@ const ar = ({
|
|
|
2647
2648
|
size: "sm",
|
|
2648
2649
|
onClick: () => w.current?.click(),
|
|
2649
2650
|
leftIcon: /* @__PURE__ */ e(X, { icon: nt, size: "xs" }),
|
|
2650
|
-
loading:
|
|
2651
|
+
loading: V,
|
|
2651
2652
|
children: "Upload"
|
|
2652
2653
|
}
|
|
2653
2654
|
),
|
|
@@ -2670,12 +2671,12 @@ const ar = ({
|
|
|
2670
2671
|
{
|
|
2671
2672
|
size: "sm",
|
|
2672
2673
|
placeholder: "Folder name",
|
|
2673
|
-
value:
|
|
2674
|
+
value: u,
|
|
2674
2675
|
onChange: (o) => E(o.target.value),
|
|
2675
2676
|
autoFocus: !0
|
|
2676
2677
|
}
|
|
2677
2678
|
),
|
|
2678
|
-
/* @__PURE__ */ e(re, { size: "sm", onClick: ee, loading:
|
|
2679
|
+
/* @__PURE__ */ e(re, { size: "sm", onClick: ee, loading: V, children: "Create" }),
|
|
2679
2680
|
/* @__PURE__ */ e(re, { size: "sm", variant: "ghost", onClick: () => b(!1), children: "Cancel" })
|
|
2680
2681
|
] }),
|
|
2681
2682
|
/* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
@@ -2683,19 +2684,19 @@ const ar = ({
|
|
|
2683
2684
|
{
|
|
2684
2685
|
data: q,
|
|
2685
2686
|
columns: j,
|
|
2686
|
-
loading:
|
|
2687
|
+
loading: V,
|
|
2687
2688
|
emptyContent: "This folder is empty",
|
|
2688
|
-
onRowClick: (o) => o.type === "folder" ?
|
|
2689
|
+
onRowClick: (o) => o.type === "folder" ? L(o.name) : G(o)
|
|
2689
2690
|
}
|
|
2690
2691
|
) })
|
|
2691
2692
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2692
2693
|
Te,
|
|
2693
2694
|
{
|
|
2694
2695
|
data: C,
|
|
2695
|
-
columns:
|
|
2696
|
-
loading:
|
|
2696
|
+
columns: K,
|
|
2697
|
+
loading: V,
|
|
2697
2698
|
emptyContent: "No storage mounts configured",
|
|
2698
|
-
onRowClick: (o) =>
|
|
2699
|
+
onRowClick: (o) => A(o)
|
|
2699
2700
|
}
|
|
2700
2701
|
) }) })
|
|
2701
2702
|
},
|
|
@@ -2711,7 +2712,7 @@ const ar = ({
|
|
|
2711
2712
|
" be uploaded to platform storage."
|
|
2712
2713
|
] }),
|
|
2713
2714
|
/* @__PURE__ */ i("label", { className: "cursor-pointer", children: [
|
|
2714
|
-
/* @__PURE__ */ e(re, { variant: "primary", size: "lg", loading:
|
|
2715
|
+
/* @__PURE__ */ e(re, { variant: "primary", size: "lg", loading: V, className: "pointer-events-none", children: "Browse Local File" }),
|
|
2715
2716
|
/* @__PURE__ */ e(
|
|
2716
2717
|
"input",
|
|
2717
2718
|
{
|
|
@@ -2719,7 +2720,7 @@ const ar = ({
|
|
|
2719
2720
|
className: "hidden",
|
|
2720
2721
|
onChange: ae,
|
|
2721
2722
|
accept: c,
|
|
2722
|
-
disabled:
|
|
2723
|
+
disabled: V
|
|
2723
2724
|
}
|
|
2724
2725
|
)
|
|
2725
2726
|
] })
|
|
@@ -2746,12 +2747,12 @@ const ar = ({
|
|
|
2746
2747
|
loading: l = !1,
|
|
2747
2748
|
containerClassName: c,
|
|
2748
2749
|
labelClassName: f,
|
|
2749
|
-
className:
|
|
2750
|
+
className: p,
|
|
2750
2751
|
id: N,
|
|
2751
|
-
rows:
|
|
2752
|
-
...
|
|
2753
|
-
},
|
|
2754
|
-
const v = le.useId(), C = N || `textarea-${v}`,
|
|
2752
|
+
rows: h = 4,
|
|
2753
|
+
...m
|
|
2754
|
+
}, x) => {
|
|
2755
|
+
const v = le.useId(), C = N || `textarea-${v}`, y = !!n, g = n || r ? `${C}-description` : void 0;
|
|
2755
2756
|
return /* @__PURE__ */ i("div", { className: d("flex flex-col", a && "w-full", c), children: [
|
|
2756
2757
|
t && /* @__PURE__ */ e(
|
|
2757
2758
|
"label",
|
|
@@ -2759,7 +2760,7 @@ const ar = ({
|
|
|
2759
2760
|
htmlFor: C,
|
|
2760
2761
|
className: d(
|
|
2761
2762
|
Oe,
|
|
2762
|
-
|
|
2763
|
+
y ? "text-danger-fg" : "text-text-subtle",
|
|
2763
2764
|
f
|
|
2764
2765
|
),
|
|
2765
2766
|
children: t
|
|
@@ -2769,11 +2770,11 @@ const ar = ({
|
|
|
2769
2770
|
/* @__PURE__ */ e(
|
|
2770
2771
|
"textarea",
|
|
2771
2772
|
{
|
|
2772
|
-
ref:
|
|
2773
|
+
ref: x,
|
|
2773
2774
|
id: C,
|
|
2774
|
-
rows:
|
|
2775
|
-
"aria-invalid":
|
|
2776
|
-
"aria-describedby":
|
|
2775
|
+
rows: h,
|
|
2776
|
+
"aria-invalid": y || void 0,
|
|
2777
|
+
"aria-describedby": g,
|
|
2777
2778
|
className: d(
|
|
2778
2779
|
"block w-full resize-y rounded-md border bg-surface-input text-text",
|
|
2779
2780
|
"transition-colors duration-fast ease-out",
|
|
@@ -2781,10 +2782,10 @@ const ar = ({
|
|
|
2781
2782
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2782
2783
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
2783
2784
|
lr[s],
|
|
2784
|
-
|
|
2785
|
-
|
|
2785
|
+
y ? "border-danger-border bg-danger-soft" : "border-border hover:border-border-strong",
|
|
2786
|
+
p
|
|
2786
2787
|
),
|
|
2787
|
-
...
|
|
2788
|
+
...m
|
|
2788
2789
|
}
|
|
2789
2790
|
),
|
|
2790
2791
|
l && /* @__PURE__ */ e(
|
|
@@ -2798,8 +2799,8 @@ const ar = ({
|
|
|
2798
2799
|
(n || r) && /* @__PURE__ */ e(
|
|
2799
2800
|
"p",
|
|
2800
2801
|
{
|
|
2801
|
-
id:
|
|
2802
|
-
className: d("mt-1 text-xs",
|
|
2802
|
+
id: g,
|
|
2803
|
+
className: d("mt-1 text-xs", y ? "text-danger-fg" : "text-text-subtle"),
|
|
2803
2804
|
children: n || r
|
|
2804
2805
|
}
|
|
2805
2806
|
)
|
|
@@ -2817,8 +2818,8 @@ function or(t, r, n) {
|
|
|
2817
2818
|
const s = r.split("."), a = Array.isArray(t) ? [...t] : { ...t };
|
|
2818
2819
|
let l = a;
|
|
2819
2820
|
for (let c = 0; c < s.length - 1; c++) {
|
|
2820
|
-
const f = s[c],
|
|
2821
|
-
l[f] =
|
|
2821
|
+
const f = s[c], p = l[f];
|
|
2822
|
+
l[f] = p && typeof p == "object" ? Array.isArray(p) ? [...p] : { ...p } : {}, l = l[f];
|
|
2822
2823
|
}
|
|
2823
2824
|
return l[s[s.length - 1]] = n, a;
|
|
2824
2825
|
}
|
|
@@ -2841,95 +2842,95 @@ const Qr = ({
|
|
|
2841
2842
|
transform: l,
|
|
2842
2843
|
validate: c,
|
|
2843
2844
|
submitButton: f = { label: "Submit", variant: "primary" },
|
|
2844
|
-
cancelButton:
|
|
2845
|
+
cancelButton: p = { label: "Cancel", variant: "outline" },
|
|
2845
2846
|
showButtons: N = !0,
|
|
2846
|
-
layout:
|
|
2847
|
-
size:
|
|
2848
|
-
loading:
|
|
2847
|
+
layout: h = "vertical",
|
|
2848
|
+
size: m = "md",
|
|
2849
|
+
loading: x = !1,
|
|
2849
2850
|
className: v,
|
|
2850
2851
|
ref: C,
|
|
2851
|
-
sdk:
|
|
2852
|
+
sdk: y
|
|
2852
2853
|
}) => {
|
|
2853
|
-
const [
|
|
2854
|
+
const [g, A] = R(r || {}), [$, _] = R({}), [M, U] = R({});
|
|
2854
2855
|
J(() => {
|
|
2855
|
-
r &&
|
|
2856
|
+
r && A({ ...r });
|
|
2856
2857
|
}, [r]);
|
|
2857
|
-
const
|
|
2858
|
-
(b,
|
|
2859
|
-
const w = t.flatMap((
|
|
2858
|
+
const V = ce(
|
|
2859
|
+
(b, u, E) => {
|
|
2860
|
+
const w = t.flatMap((P) => P.items).find((P) => P.name === b);
|
|
2860
2861
|
if (!w) return null;
|
|
2861
|
-
if (w.required && (
|
|
2862
|
+
if (w.required && (u == null || u === ""))
|
|
2862
2863
|
return `${w.label} is required`;
|
|
2863
2864
|
if (w.type === "array") {
|
|
2864
|
-
if (w.required && (!
|
|
2865
|
+
if (w.required && (!u || u.length === 0))
|
|
2865
2866
|
return `${w.label} cannot be empty.`;
|
|
2866
|
-
if (
|
|
2867
|
+
if (u && !Array.isArray(u))
|
|
2867
2868
|
return `${w.label} must be an array.`;
|
|
2868
|
-
if (Array.isArray(
|
|
2869
|
-
const
|
|
2869
|
+
if (Array.isArray(u) && w.arrayFields) {
|
|
2870
|
+
const P = [];
|
|
2870
2871
|
let k = !1;
|
|
2871
|
-
if (
|
|
2872
|
+
if (u.forEach((ae, ne) => {
|
|
2872
2873
|
const ee = {};
|
|
2873
2874
|
for (const G of w.arrayFields) {
|
|
2874
2875
|
const S = ae?.[G.name];
|
|
2875
2876
|
if (G.required && (S == null || S === ""))
|
|
2876
2877
|
ee[G.name] = `${G.label} is required`, k = !0;
|
|
2877
2878
|
else if (G.validator) {
|
|
2878
|
-
const
|
|
2879
|
-
|
|
2879
|
+
const T = G.validator(S, ae);
|
|
2880
|
+
T && (ee[G.name] = T, k = !0);
|
|
2880
2881
|
}
|
|
2881
2882
|
}
|
|
2882
|
-
|
|
2883
|
+
P[ne] = ee;
|
|
2883
2884
|
}), k)
|
|
2884
|
-
return JSON.stringify(
|
|
2885
|
+
return JSON.stringify(P);
|
|
2885
2886
|
}
|
|
2886
2887
|
}
|
|
2887
|
-
return w.validator ? w.validator(
|
|
2888
|
+
return w.validator ? w.validator(u, E) : null;
|
|
2888
2889
|
},
|
|
2889
2890
|
[t]
|
|
2890
|
-
),
|
|
2891
|
-
(b,
|
|
2891
|
+
), I = ce(
|
|
2892
|
+
(b, u) => {
|
|
2892
2893
|
let E = or(
|
|
2893
|
-
|
|
2894
|
+
g,
|
|
2894
2895
|
b,
|
|
2895
|
-
|
|
2896
|
+
u
|
|
2896
2897
|
);
|
|
2897
|
-
t.flatMap((k) => k.items).find((k) => k.name === b)?.removeIfEmpty && (
|
|
2898
|
-
const
|
|
2899
|
-
|
|
2898
|
+
t.flatMap((k) => k.items).find((k) => k.name === b)?.removeIfEmpty && (u == null || u === "") && (E = cr(E, b)), A(E), U((k) => ({ ...k, [b]: !0 }));
|
|
2899
|
+
const P = V(b, u, E);
|
|
2900
|
+
_((k) => ({
|
|
2900
2901
|
...k,
|
|
2901
|
-
[b]:
|
|
2902
|
+
[b]: P || ""
|
|
2902
2903
|
})), a?.(E, b);
|
|
2903
2904
|
},
|
|
2904
|
-
[
|
|
2905
|
-
),
|
|
2905
|
+
[g, t, V, a]
|
|
2906
|
+
), W = ce(
|
|
2906
2907
|
async (b) => {
|
|
2907
|
-
if (b.preventDefault(),
|
|
2908
|
-
const
|
|
2909
|
-
for (const
|
|
2910
|
-
if (
|
|
2908
|
+
if (b.preventDefault(), x) return;
|
|
2909
|
+
const u = {}, E = t.flatMap((P) => P.items);
|
|
2910
|
+
for (const P of E) {
|
|
2911
|
+
if (P.hidden || P.conditional && !P.conditional(g))
|
|
2911
2912
|
continue;
|
|
2912
|
-
const k =
|
|
2913
|
-
|
|
2914
|
-
Ae(
|
|
2915
|
-
|
|
2913
|
+
const k = V(
|
|
2914
|
+
P.name,
|
|
2915
|
+
Ae(g, P.name),
|
|
2916
|
+
g
|
|
2916
2917
|
);
|
|
2917
|
-
k && (
|
|
2918
|
+
k && (u[P.name] = k);
|
|
2918
2919
|
}
|
|
2919
2920
|
if (c) {
|
|
2920
|
-
const
|
|
2921
|
-
|
|
2921
|
+
const P = c(g);
|
|
2922
|
+
P && Object.assign(u, P);
|
|
2922
2923
|
}
|
|
2923
|
-
if (
|
|
2924
|
+
if (_(u), Object.keys(u).some((P) => u[P]))
|
|
2924
2925
|
return;
|
|
2925
|
-
const w = l ? l(
|
|
2926
|
-
await n?.(
|
|
2926
|
+
const w = l ? l(g) : g;
|
|
2927
|
+
await n?.(g, w);
|
|
2927
2928
|
},
|
|
2928
|
-
[
|
|
2929
|
-
),
|
|
2929
|
+
[g, t, V, c, l, n, x]
|
|
2930
|
+
), H = ce(
|
|
2930
2931
|
(b) => {
|
|
2931
|
-
const
|
|
2932
|
-
value:
|
|
2932
|
+
const u = Ae(g, b.name), E = M[b.name] ? $[b.name] : void 0, w = b.disabled || x, P = {
|
|
2933
|
+
value: u || "",
|
|
2933
2934
|
disabled: w,
|
|
2934
2935
|
required: b.required,
|
|
2935
2936
|
placeholder: b.placeholder,
|
|
@@ -2945,31 +2946,31 @@ const Qr = ({
|
|
|
2945
2946
|
return /* @__PURE__ */ e(
|
|
2946
2947
|
he,
|
|
2947
2948
|
{
|
|
2948
|
-
...
|
|
2949
|
-
onChange: (k) =>
|
|
2949
|
+
...P,
|
|
2950
|
+
onChange: (k) => I(b.name, k.target.value),
|
|
2950
2951
|
type: b.textType || b.type,
|
|
2951
2952
|
autoComplete: b.autocomplete,
|
|
2952
2953
|
error: E,
|
|
2953
|
-
size:
|
|
2954
|
+
size: m
|
|
2954
2955
|
}
|
|
2955
2956
|
);
|
|
2956
2957
|
case "textarea":
|
|
2957
2958
|
return /* @__PURE__ */ e(
|
|
2958
2959
|
Se,
|
|
2959
2960
|
{
|
|
2960
|
-
...
|
|
2961
|
-
onChange: (k) =>
|
|
2961
|
+
...P,
|
|
2962
|
+
onChange: (k) => I(b.name, k.target.value),
|
|
2962
2963
|
rows: 4,
|
|
2963
2964
|
error: E,
|
|
2964
|
-
size:
|
|
2965
|
+
size: m
|
|
2965
2966
|
}
|
|
2966
2967
|
);
|
|
2967
2968
|
case "select":
|
|
2968
2969
|
return /* @__PURE__ */ e(
|
|
2969
2970
|
pe,
|
|
2970
2971
|
{
|
|
2971
|
-
...
|
|
2972
|
-
onChange: (k) =>
|
|
2972
|
+
...P,
|
|
2973
|
+
onChange: (k) => I(b.name, k),
|
|
2973
2974
|
options: (b.options || []).map((k) => ({
|
|
2974
2975
|
...k,
|
|
2975
2976
|
value: String(k.value)
|
|
@@ -2978,17 +2979,17 @@ const Qr = ({
|
|
|
2978
2979
|
multiple: b.multiple,
|
|
2979
2980
|
allowCreate: b.allowCreate,
|
|
2980
2981
|
error: E,
|
|
2981
|
-
size:
|
|
2982
|
+
size: m
|
|
2982
2983
|
}
|
|
2983
2984
|
);
|
|
2984
2985
|
case "checkbox":
|
|
2985
2986
|
return /* @__PURE__ */ e(
|
|
2986
2987
|
xe,
|
|
2987
2988
|
{
|
|
2988
|
-
...
|
|
2989
|
-
checked: !!
|
|
2990
|
-
onChange: (k) =>
|
|
2991
|
-
size:
|
|
2989
|
+
...P,
|
|
2990
|
+
checked: !!u,
|
|
2991
|
+
onChange: (k) => I(b.name, k.target.checked),
|
|
2992
|
+
size: m
|
|
2992
2993
|
}
|
|
2993
2994
|
);
|
|
2994
2995
|
case "radio":
|
|
@@ -3003,8 +3004,8 @@ const Qr = ({
|
|
|
3003
3004
|
type: "radio",
|
|
3004
3005
|
name: b.name,
|
|
3005
3006
|
value: k.value,
|
|
3006
|
-
checked:
|
|
3007
|
-
onChange: () =>
|
|
3007
|
+
checked: u === k.value,
|
|
3008
|
+
onChange: () => I(b.name, k.value),
|
|
3008
3009
|
disabled: w || k.disabled,
|
|
3009
3010
|
className: "size-checkbox shrink-0 border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3010
3011
|
}
|
|
@@ -3018,39 +3019,39 @@ const Qr = ({
|
|
|
3018
3019
|
return /* @__PURE__ */ e(
|
|
3019
3020
|
Ce,
|
|
3020
3021
|
{
|
|
3021
|
-
...
|
|
3022
|
-
value:
|
|
3023
|
-
onChange: (k) =>
|
|
3024
|
-
size:
|
|
3022
|
+
...P,
|
|
3023
|
+
value: u ? new Date(u) : null,
|
|
3024
|
+
onChange: (k) => I(b.name, k),
|
|
3025
|
+
size: m
|
|
3025
3026
|
}
|
|
3026
3027
|
);
|
|
3027
3028
|
case "file":
|
|
3028
3029
|
return /* @__PURE__ */ e(
|
|
3029
3030
|
ar,
|
|
3030
3031
|
{
|
|
3031
|
-
...
|
|
3032
|
-
value:
|
|
3033
|
-
onChange: (k) =>
|
|
3032
|
+
...P,
|
|
3033
|
+
value: u,
|
|
3034
|
+
onChange: (k) => I(b.name, k),
|
|
3034
3035
|
error: E,
|
|
3035
|
-
onListFiles: (k) =>
|
|
3036
|
+
onListFiles: (k) => y?.http.invoke({
|
|
3036
3037
|
method: "POST",
|
|
3037
3038
|
action: "storage.file.list",
|
|
3038
3039
|
body: k
|
|
3039
3040
|
}),
|
|
3040
|
-
onListMounts: () =>
|
|
3041
|
+
onListMounts: () => y?.http.invoke({
|
|
3041
3042
|
method: "GET",
|
|
3042
3043
|
action: "storage.mount"
|
|
3043
3044
|
}),
|
|
3044
|
-
onUploadFile: (k) =>
|
|
3045
|
+
onUploadFile: (k) => y?.http.invoke({
|
|
3045
3046
|
method: "POST",
|
|
3046
3047
|
action: "storage.file.upload",
|
|
3047
3048
|
body: k
|
|
3048
3049
|
}),
|
|
3049
|
-
onDownloadFile: (k) =>
|
|
3050
|
+
onDownloadFile: (k) => y?.http.invoke({
|
|
3050
3051
|
method: "GET",
|
|
3051
3052
|
action: `storage.file.${k}.download`
|
|
3052
3053
|
}),
|
|
3053
|
-
onRegisterFile: (k) =>
|
|
3054
|
+
onRegisterFile: (k) => y?.http.invoke({
|
|
3054
3055
|
method: "POST",
|
|
3055
3056
|
action: "storage.file.folder",
|
|
3056
3057
|
body: k
|
|
@@ -3061,26 +3062,26 @@ const Qr = ({
|
|
|
3061
3062
|
return /* @__PURE__ */ e(
|
|
3062
3063
|
It,
|
|
3063
3064
|
{
|
|
3064
|
-
value:
|
|
3065
|
-
onChange: (k) =>
|
|
3066
|
-
onListFolders: () =>
|
|
3065
|
+
value: u || {},
|
|
3066
|
+
onChange: (k) => I(b.name, k),
|
|
3067
|
+
onListFolders: () => y?.http.invoke({
|
|
3067
3068
|
method: "GET",
|
|
3068
3069
|
action: "storage.mount"
|
|
3069
3070
|
}),
|
|
3070
3071
|
disabled: w,
|
|
3071
|
-
size:
|
|
3072
|
+
size: m,
|
|
3072
3073
|
placeholder: b.placeholder
|
|
3073
3074
|
}
|
|
3074
3075
|
);
|
|
3075
3076
|
case "custom":
|
|
3076
3077
|
return b.customComponent?.({
|
|
3077
|
-
value:
|
|
3078
|
-
onChange: (k) =>
|
|
3078
|
+
value: u,
|
|
3079
|
+
onChange: (k) => I(b.name, k),
|
|
3079
3080
|
error: E,
|
|
3080
3081
|
disabled: w
|
|
3081
3082
|
});
|
|
3082
3083
|
case "array": {
|
|
3083
|
-
const k =
|
|
3084
|
+
const k = u || [];
|
|
3084
3085
|
let ae = [];
|
|
3085
3086
|
if (typeof E == "string" && E.startsWith("["))
|
|
3086
3087
|
try {
|
|
@@ -3088,41 +3089,41 @@ const Qr = ({
|
|
|
3088
3089
|
} catch {
|
|
3089
3090
|
}
|
|
3090
3091
|
const ne = () => {
|
|
3091
|
-
|
|
3092
|
+
I(b.name, [...k, {}]);
|
|
3092
3093
|
}, ee = (S) => {
|
|
3093
|
-
|
|
3094
|
+
I(
|
|
3094
3095
|
b.name,
|
|
3095
|
-
k.filter((
|
|
3096
|
+
k.filter((T, L) => L !== S)
|
|
3096
3097
|
);
|
|
3097
|
-
}, G = (S,
|
|
3098
|
-
const
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
[
|
|
3102
|
-
},
|
|
3098
|
+
}, G = (S, T, L) => {
|
|
3099
|
+
const D = [...k];
|
|
3100
|
+
D[S] = {
|
|
3101
|
+
...D[S],
|
|
3102
|
+
[T]: L
|
|
3103
|
+
}, I(b.name, D);
|
|
3103
3104
|
};
|
|
3104
3105
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-2", children: [
|
|
3105
|
-
k.map((S,
|
|
3106
|
-
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: b.arrayFields?.map((
|
|
3107
|
-
const
|
|
3106
|
+
k.map((S, T) => /* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
|
|
3107
|
+
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: b.arrayFields?.map((L) => {
|
|
3108
|
+
const D = ae?.[T]?.[L.name];
|
|
3108
3109
|
return /* @__PURE__ */ i(
|
|
3109
3110
|
"div",
|
|
3110
3111
|
{
|
|
3111
3112
|
className: "flex flex-col gap-1",
|
|
3112
3113
|
children: [
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3114
|
+
T === 0 && /* @__PURE__ */ i("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
|
|
3115
|
+
L.label,
|
|
3116
|
+
L.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3116
3117
|
] }),
|
|
3117
3118
|
(() => {
|
|
3118
3119
|
const q = {
|
|
3119
|
-
value: S?.[
|
|
3120
|
+
value: S?.[L.name] || "",
|
|
3120
3121
|
disabled: w,
|
|
3121
|
-
required:
|
|
3122
|
-
placeholder:
|
|
3123
|
-
...
|
|
3122
|
+
required: L.required,
|
|
3123
|
+
placeholder: L.placeholder,
|
|
3124
|
+
...L.fieldProps
|
|
3124
3125
|
};
|
|
3125
|
-
switch (
|
|
3126
|
+
switch (L.type) {
|
|
3126
3127
|
case "text":
|
|
3127
3128
|
case "email":
|
|
3128
3129
|
case "password":
|
|
@@ -3134,14 +3135,14 @@ const Qr = ({
|
|
|
3134
3135
|
{
|
|
3135
3136
|
...q,
|
|
3136
3137
|
onChange: (j) => G(
|
|
3137
|
-
|
|
3138
|
-
|
|
3138
|
+
T,
|
|
3139
|
+
L.name,
|
|
3139
3140
|
j.target.value
|
|
3140
3141
|
),
|
|
3141
|
-
type:
|
|
3142
|
-
autoComplete:
|
|
3143
|
-
error:
|
|
3144
|
-
size:
|
|
3142
|
+
type: L.textType || L.type,
|
|
3143
|
+
autoComplete: L.autocomplete,
|
|
3144
|
+
error: D,
|
|
3145
|
+
size: m
|
|
3145
3146
|
}
|
|
3146
3147
|
);
|
|
3147
3148
|
case "textarea":
|
|
@@ -3150,13 +3151,13 @@ const Qr = ({
|
|
|
3150
3151
|
{
|
|
3151
3152
|
...q,
|
|
3152
3153
|
onChange: (j) => G(
|
|
3153
|
-
|
|
3154
|
-
|
|
3154
|
+
T,
|
|
3155
|
+
L.name,
|
|
3155
3156
|
j.target.value
|
|
3156
3157
|
),
|
|
3157
3158
|
rows: 4,
|
|
3158
|
-
error:
|
|
3159
|
-
size:
|
|
3159
|
+
error: D,
|
|
3160
|
+
size: m
|
|
3160
3161
|
}
|
|
3161
3162
|
);
|
|
3162
3163
|
case "select":
|
|
@@ -3165,21 +3166,21 @@ const Qr = ({
|
|
|
3165
3166
|
{
|
|
3166
3167
|
...q,
|
|
3167
3168
|
onChange: (j) => G(
|
|
3168
|
-
|
|
3169
|
-
|
|
3169
|
+
T,
|
|
3170
|
+
L.name,
|
|
3170
3171
|
j
|
|
3171
3172
|
),
|
|
3172
|
-
options: (
|
|
3173
|
+
options: (L.options || []).map(
|
|
3173
3174
|
(j) => ({
|
|
3174
3175
|
...j,
|
|
3175
3176
|
value: String(j.value)
|
|
3176
3177
|
})
|
|
3177
3178
|
),
|
|
3178
|
-
searchable:
|
|
3179
|
-
multiple:
|
|
3180
|
-
allowCreate:
|
|
3181
|
-
error:
|
|
3182
|
-
size:
|
|
3179
|
+
searchable: L.searchable,
|
|
3180
|
+
multiple: L.multiple,
|
|
3181
|
+
allowCreate: L.allowCreate,
|
|
3182
|
+
error: D,
|
|
3183
|
+
size: m
|
|
3183
3184
|
}
|
|
3184
3185
|
);
|
|
3185
3186
|
case "checkbox":
|
|
@@ -3187,17 +3188,17 @@ const Qr = ({
|
|
|
3187
3188
|
xe,
|
|
3188
3189
|
{
|
|
3189
3190
|
...q,
|
|
3190
|
-
checked: !!S?.[
|
|
3191
|
+
checked: !!S?.[L.name],
|
|
3191
3192
|
onChange: (j) => G(
|
|
3192
|
-
|
|
3193
|
-
|
|
3193
|
+
T,
|
|
3194
|
+
L.name,
|
|
3194
3195
|
j.target.checked
|
|
3195
3196
|
),
|
|
3196
|
-
size:
|
|
3197
|
+
size: m
|
|
3197
3198
|
}
|
|
3198
3199
|
);
|
|
3199
3200
|
case "radio":
|
|
3200
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children:
|
|
3201
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: L.options?.map((j) => /* @__PURE__ */ i(
|
|
3201
3202
|
"label",
|
|
3202
3203
|
{
|
|
3203
3204
|
className: "flex cursor-pointer items-center gap-2 text-base text-text",
|
|
@@ -3206,12 +3207,12 @@ const Qr = ({
|
|
|
3206
3207
|
"input",
|
|
3207
3208
|
{
|
|
3208
3209
|
type: "radio",
|
|
3209
|
-
name: `${b.name}.${
|
|
3210
|
+
name: `${b.name}.${T}.${L.name}`,
|
|
3210
3211
|
value: j.value,
|
|
3211
|
-
checked: S?.[
|
|
3212
|
+
checked: S?.[L.name] === j.value,
|
|
3212
3213
|
onChange: () => G(
|
|
3213
|
-
|
|
3214
|
-
|
|
3214
|
+
T,
|
|
3215
|
+
L.name,
|
|
3215
3216
|
j.value
|
|
3216
3217
|
),
|
|
3217
3218
|
disabled: w || j.disabled,
|
|
@@ -3224,30 +3225,30 @@ const Qr = ({
|
|
|
3224
3225
|
j.value
|
|
3225
3226
|
)) });
|
|
3226
3227
|
case "date": {
|
|
3227
|
-
const j = S?.[
|
|
3228
|
+
const j = S?.[L.name];
|
|
3228
3229
|
return /* @__PURE__ */ e(
|
|
3229
3230
|
Ce,
|
|
3230
3231
|
{
|
|
3231
3232
|
...q,
|
|
3232
3233
|
value: j ? new Date(j) : null,
|
|
3233
|
-
onChange: (
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3234
|
+
onChange: (K) => G(
|
|
3235
|
+
T,
|
|
3236
|
+
L.name,
|
|
3237
|
+
K
|
|
3237
3238
|
),
|
|
3238
|
-
size:
|
|
3239
|
+
size: m
|
|
3239
3240
|
}
|
|
3240
3241
|
);
|
|
3241
3242
|
}
|
|
3242
3243
|
case "custom":
|
|
3243
|
-
return
|
|
3244
|
-
value: S?.[
|
|
3244
|
+
return L.customComponent?.({
|
|
3245
|
+
value: S?.[L.name],
|
|
3245
3246
|
onChange: (j) => G(
|
|
3246
|
-
|
|
3247
|
-
|
|
3247
|
+
T,
|
|
3248
|
+
L.name,
|
|
3248
3249
|
j
|
|
3249
3250
|
),
|
|
3250
|
-
error:
|
|
3251
|
+
error: D,
|
|
3251
3252
|
disabled: w
|
|
3252
3253
|
});
|
|
3253
3254
|
// Add other field types here as needed
|
|
@@ -3255,14 +3256,14 @@ const Qr = ({
|
|
|
3255
3256
|
return /* @__PURE__ */ i("p", { children: [
|
|
3256
3257
|
"Unsupported field type in array:",
|
|
3257
3258
|
" ",
|
|
3258
|
-
|
|
3259
|
+
L.type
|
|
3259
3260
|
] });
|
|
3260
3261
|
}
|
|
3261
3262
|
})(),
|
|
3262
|
-
|
|
3263
|
+
D && /* @__PURE__ */ e("p", { className: "text-xs text-danger-fg", children: D })
|
|
3263
3264
|
]
|
|
3264
3265
|
},
|
|
3265
|
-
|
|
3266
|
+
L.name
|
|
3266
3267
|
);
|
|
3267
3268
|
}) }),
|
|
3268
3269
|
/* @__PURE__ */ e(
|
|
@@ -3273,13 +3274,13 @@ const Qr = ({
|
|
|
3273
3274
|
variant: "ghost",
|
|
3274
3275
|
size: "md",
|
|
3275
3276
|
"aria-label": `${b.label} verwijderen`,
|
|
3276
|
-
onClick: () => ee(
|
|
3277
|
+
onClick: () => ee(T),
|
|
3277
3278
|
disabled: w,
|
|
3278
|
-
className: d("shrink-0",
|
|
3279
|
+
className: d("shrink-0", T === 0 && "mt-5"),
|
|
3279
3280
|
children: /* @__PURE__ */ e(st, { className: "size-icon-md" })
|
|
3280
3281
|
}
|
|
3281
3282
|
)
|
|
3282
|
-
] },
|
|
3283
|
+
] }, T)),
|
|
3283
3284
|
/* @__PURE__ */ i(
|
|
3284
3285
|
re,
|
|
3285
3286
|
{
|
|
@@ -3301,13 +3302,13 @@ const Qr = ({
|
|
|
3301
3302
|
return null;
|
|
3302
3303
|
}
|
|
3303
3304
|
},
|
|
3304
|
-
[
|
|
3305
|
+
[g, M, $, x, m, I]
|
|
3305
3306
|
), Y = ce(
|
|
3306
3307
|
(b) => {
|
|
3307
|
-
if (b.conditional && !b.conditional(
|
|
3308
|
+
if (b.conditional && !b.conditional(g))
|
|
3308
3309
|
return null;
|
|
3309
|
-
const
|
|
3310
|
-
if (
|
|
3310
|
+
const u = b.items.filter((w) => !(w.hidden || w.conditional && !w.conditional(g)));
|
|
3311
|
+
if (u.length === 0) return null;
|
|
3311
3312
|
const E = d(
|
|
3312
3313
|
b.layout === "flex" ? "flex flex-wrap gap-3" : "grid gap-3",
|
|
3313
3314
|
b.layout !== "flex" && {
|
|
@@ -3327,7 +3328,7 @@ const Qr = ({
|
|
|
3327
3328
|
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children: b.title }),
|
|
3328
3329
|
b.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: b.description })
|
|
3329
3330
|
] }),
|
|
3330
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children:
|
|
3331
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: E, children: u.map((w) => (M[w.name] && $[w.name], /* @__PURE__ */ i(
|
|
3331
3332
|
"div",
|
|
3332
3333
|
{
|
|
3333
3334
|
className: d(
|
|
@@ -3343,7 +3344,7 @@ const Qr = ({
|
|
|
3343
3344
|
w.label,
|
|
3344
3345
|
w.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3345
3346
|
] }),
|
|
3346
|
-
|
|
3347
|
+
H(w)
|
|
3347
3348
|
]
|
|
3348
3349
|
},
|
|
3349
3350
|
w.name
|
|
@@ -3353,18 +3354,18 @@ const Qr = ({
|
|
|
3353
3354
|
b.id
|
|
3354
3355
|
);
|
|
3355
3356
|
},
|
|
3356
|
-
[
|
|
3357
|
+
[g, M, $, H]
|
|
3357
3358
|
), Z = d(
|
|
3358
3359
|
"overflow-hidden rounded-lg border border-border bg-surface",
|
|
3359
3360
|
{
|
|
3360
|
-
"max-w-md":
|
|
3361
|
-
"max-w-2xl":
|
|
3362
|
-
"max-w-4xl":
|
|
3363
|
-
"max-w-full":
|
|
3361
|
+
"max-w-md": m === "sm",
|
|
3362
|
+
"max-w-2xl": m === "md",
|
|
3363
|
+
"max-w-4xl": m === "lg",
|
|
3364
|
+
"max-w-full": m === "full"
|
|
3364
3365
|
},
|
|
3365
3366
|
v
|
|
3366
|
-
), Q =
|
|
3367
|
-
return /* @__PURE__ */ i("form", { ref: C, onSubmit:
|
|
3367
|
+
), Q = m === "full" ? "md" : m;
|
|
3368
|
+
return /* @__PURE__ */ i("form", { ref: C, onSubmit: W, className: Z, children: [
|
|
3368
3369
|
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(Y) }),
|
|
3369
3370
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle bg-surface-sunk px-5 py-3", children: N && /* @__PURE__ */ i(fe, { children: [
|
|
3370
3371
|
/* @__PURE__ */ e("div", { className: "ml-auto" }),
|
|
@@ -3372,12 +3373,12 @@ const Qr = ({
|
|
|
3372
3373
|
re,
|
|
3373
3374
|
{
|
|
3374
3375
|
type: "button",
|
|
3375
|
-
variant:
|
|
3376
|
-
size:
|
|
3377
|
-
disabled:
|
|
3376
|
+
variant: p.variant ?? "ghost",
|
|
3377
|
+
size: p.size || Q,
|
|
3378
|
+
disabled: p.disabled || x,
|
|
3378
3379
|
onClick: s,
|
|
3379
|
-
className:
|
|
3380
|
-
children:
|
|
3380
|
+
className: p.className,
|
|
3381
|
+
children: p.label
|
|
3381
3382
|
}
|
|
3382
3383
|
),
|
|
3383
3384
|
/* @__PURE__ */ e(
|
|
@@ -3386,8 +3387,8 @@ const Qr = ({
|
|
|
3386
3387
|
type: "submit",
|
|
3387
3388
|
variant: f.variant,
|
|
3388
3389
|
size: f.size || Q,
|
|
3389
|
-
disabled: f.disabled ||
|
|
3390
|
-
loading:
|
|
3390
|
+
disabled: f.disabled || x,
|
|
3391
|
+
loading: x,
|
|
3391
3392
|
className: f.className,
|
|
3392
3393
|
children: f.label
|
|
3393
3394
|
}
|
|
@@ -3404,17 +3405,17 @@ function en({
|
|
|
3404
3405
|
tone: l = "default",
|
|
3405
3406
|
loading: c = !1,
|
|
3406
3407
|
onConfirm: f,
|
|
3407
|
-
onCancel:
|
|
3408
|
+
onCancel: p
|
|
3408
3409
|
}) {
|
|
3409
3410
|
return /* @__PURE__ */ e(
|
|
3410
3411
|
Fe,
|
|
3411
3412
|
{
|
|
3412
3413
|
open: t,
|
|
3413
|
-
onClose:
|
|
3414
|
+
onClose: p,
|
|
3414
3415
|
title: r,
|
|
3415
3416
|
size: "sm",
|
|
3416
3417
|
footer: /* @__PURE__ */ i("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
3417
|
-
/* @__PURE__ */ e(re, { variant: "ghost", onClick:
|
|
3418
|
+
/* @__PURE__ */ e(re, { variant: "ghost", onClick: p, disabled: c, children: a }),
|
|
3418
3419
|
/* @__PURE__ */ e(
|
|
3419
3420
|
re,
|
|
3420
3421
|
{
|
|
@@ -3459,7 +3460,7 @@ function tn({
|
|
|
3459
3460
|
onDismiss: l,
|
|
3460
3461
|
className: c,
|
|
3461
3462
|
children: f,
|
|
3462
|
-
...
|
|
3463
|
+
...p
|
|
3463
3464
|
}) {
|
|
3464
3465
|
return /* @__PURE__ */ i(
|
|
3465
3466
|
"span",
|
|
@@ -3473,7 +3474,7 @@ function tn({
|
|
|
3473
3474
|
dr[r],
|
|
3474
3475
|
c
|
|
3475
3476
|
),
|
|
3476
|
-
...
|
|
3477
|
+
...p,
|
|
3477
3478
|
children: [
|
|
3478
3479
|
n && /* @__PURE__ */ e(
|
|
3479
3480
|
"span",
|
|
@@ -3703,32 +3704,32 @@ function on({
|
|
|
3703
3704
|
className: a
|
|
3704
3705
|
}) {
|
|
3705
3706
|
const l = t.indexOf(r), c = { role: s ? "group" : void 0, "aria-label": s, "aria-hidden": s ? void 0 : !0 };
|
|
3706
|
-
return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className: d("flex items-center gap-1.5", a), children: t.map((f,
|
|
3707
|
+
return n === "dots" ? /* @__PURE__ */ e("div", { ...c, className: d("flex items-center gap-1.5", a), children: t.map((f, p) => /* @__PURE__ */ e(
|
|
3707
3708
|
"span",
|
|
3708
3709
|
{
|
|
3709
3710
|
className: d(
|
|
3710
3711
|
"h-step-bar rounded-full transition-all duration-fast ease-out",
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3712
|
+
p === l ? "w-5 bg-accent" : "w-3.5",
|
|
3713
|
+
p < l && "bg-border-strong",
|
|
3714
|
+
p > l && "bg-border"
|
|
3714
3715
|
)
|
|
3715
3716
|
},
|
|
3716
3717
|
f
|
|
3717
|
-
)) }) : /* @__PURE__ */ e("div", { ...c, className: d("flex items-center gap-2", a), children: t.map((f,
|
|
3718
|
+
)) }) : /* @__PURE__ */ e("div", { ...c, className: d("flex items-center gap-2", a), children: t.map((f, p) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
3718
3719
|
/* @__PURE__ */ e(
|
|
3719
3720
|
"span",
|
|
3720
3721
|
{
|
|
3721
|
-
"aria-current":
|
|
3722
|
+
"aria-current": p === l ? "step" : void 0,
|
|
3722
3723
|
className: d(
|
|
3723
3724
|
"flex size-tile-sm items-center justify-center rounded-full text-xs font-medium",
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3725
|
+
p === l && "bg-accent text-accent-fg",
|
|
3726
|
+
p < l && "bg-accent-soft text-accent",
|
|
3727
|
+
p > l && "bg-surface-hover text-text-muted"
|
|
3727
3728
|
),
|
|
3728
|
-
children:
|
|
3729
|
+
children: p + 1
|
|
3729
3730
|
}
|
|
3730
3731
|
),
|
|
3731
|
-
|
|
3732
|
+
p < t.length - 1 && /* @__PURE__ */ e("span", { className: "h-px w-8 bg-border-strong" })
|
|
3732
3733
|
] }, f)) });
|
|
3733
3734
|
}
|
|
3734
3735
|
function cn({ title: t, icon: r = /* @__PURE__ */ e(lt, { className: "size-icon-md", "aria-hidden": !0 }), action: n, children: s, className: a, ...l }) {
|
|
@@ -3850,22 +3851,22 @@ const mn = ({
|
|
|
3850
3851
|
showLoading: l = !0,
|
|
3851
3852
|
showError: c = !0,
|
|
3852
3853
|
fallback: f,
|
|
3853
|
-
loadingContent:
|
|
3854
|
+
loadingContent: p,
|
|
3854
3855
|
errorContent: N,
|
|
3855
|
-
className:
|
|
3856
|
-
onLoad:
|
|
3857
|
-
onError:
|
|
3856
|
+
className: h,
|
|
3857
|
+
onLoad: m,
|
|
3858
|
+
onError: x,
|
|
3858
3859
|
...v
|
|
3859
3860
|
}) => {
|
|
3860
|
-
const [C,
|
|
3861
|
-
|
|
3862
|
-
},
|
|
3863
|
-
if (
|
|
3864
|
-
|
|
3861
|
+
const [C, y] = R(!0), [g, A] = R(!1), [$, _] = R(t), M = (Z) => {
|
|
3862
|
+
y(!1), A(!1), m?.(Z);
|
|
3863
|
+
}, U = (Z) => {
|
|
3864
|
+
if (y(!1), A(!0), f && $ !== f) {
|
|
3865
|
+
_(f), A(!1), y(!0);
|
|
3865
3866
|
return;
|
|
3866
3867
|
}
|
|
3867
|
-
|
|
3868
|
-
},
|
|
3868
|
+
x?.(Z);
|
|
3869
|
+
}, V = d(
|
|
3869
3870
|
"relative overflow-hidden bg-surface-hover",
|
|
3870
3871
|
// Size variants
|
|
3871
3872
|
{
|
|
@@ -3892,34 +3893,34 @@ const mn = ({
|
|
|
3892
3893
|
"rounded-xl": a === "xl",
|
|
3893
3894
|
"rounded-full": a === "full"
|
|
3894
3895
|
},
|
|
3895
|
-
|
|
3896
|
-
),
|
|
3896
|
+
h
|
|
3897
|
+
), I = d(
|
|
3897
3898
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
3898
3899
|
{
|
|
3899
|
-
"opacity-0": C ||
|
|
3900
|
-
"opacity-100": !C && !
|
|
3900
|
+
"opacity-0": C || g,
|
|
3901
|
+
"opacity-100": !C && !g
|
|
3901
3902
|
}
|
|
3902
|
-
),
|
|
3903
|
+
), W = d(
|
|
3903
3904
|
"absolute inset-0 flex items-center justify-center",
|
|
3904
3905
|
"text-text-muted"
|
|
3905
|
-
),
|
|
3906
|
+
), H = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), Y = /* @__PURE__ */ i("div", { className: "text-center", children: [
|
|
3906
3907
|
/* @__PURE__ */ e(X, { icon: ot, size: "lg", className: "mx-auto mb-1" }),
|
|
3907
3908
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
3908
3909
|
] });
|
|
3909
|
-
return /* @__PURE__ */ i("div", { className:
|
|
3910
|
+
return /* @__PURE__ */ i("div", { className: V, children: [
|
|
3910
3911
|
/* @__PURE__ */ e(
|
|
3911
3912
|
"img",
|
|
3912
3913
|
{
|
|
3913
3914
|
...v,
|
|
3914
|
-
src:
|
|
3915
|
+
src: $,
|
|
3915
3916
|
alt: r,
|
|
3916
|
-
className:
|
|
3917
|
-
onLoad:
|
|
3918
|
-
onError:
|
|
3917
|
+
className: I,
|
|
3918
|
+
onLoad: M,
|
|
3919
|
+
onError: U
|
|
3919
3920
|
}
|
|
3920
3921
|
),
|
|
3921
|
-
C && l && /* @__PURE__ */ e("div", { className:
|
|
3922
|
-
|
|
3922
|
+
C && l && /* @__PURE__ */ e("div", { className: W, children: p || H }),
|
|
3923
|
+
g && c && /* @__PURE__ */ e("div", { className: W, children: N || Y })
|
|
3923
3924
|
] });
|
|
3924
3925
|
};
|
|
3925
3926
|
function fn({
|
|
@@ -3931,52 +3932,52 @@ function fn({
|
|
|
3931
3932
|
trailing: l,
|
|
3932
3933
|
onSelect: c,
|
|
3933
3934
|
onActiveIndexChange: f,
|
|
3934
|
-
isActive:
|
|
3935
|
+
isActive: p,
|
|
3935
3936
|
unread: N,
|
|
3936
|
-
dimmed:
|
|
3937
|
-
groupBy:
|
|
3938
|
-
groups:
|
|
3937
|
+
dimmed: h,
|
|
3938
|
+
groupBy: m,
|
|
3939
|
+
groups: x,
|
|
3939
3940
|
renderGroupHeader: v,
|
|
3940
3941
|
stickyGroupHeaders: C = !1,
|
|
3941
|
-
collapsibleGroups:
|
|
3942
|
-
hideGroupCount:
|
|
3943
|
-
selectable:
|
|
3944
|
-
selectedItems:
|
|
3945
|
-
onSelectionChange:
|
|
3946
|
-
bulkActions:
|
|
3947
|
-
header:
|
|
3948
|
-
stickyHeader:
|
|
3949
|
-
bordered:
|
|
3950
|
-
emptyContent:
|
|
3951
|
-
loading:
|
|
3942
|
+
collapsibleGroups: y = !1,
|
|
3943
|
+
hideGroupCount: g = !1,
|
|
3944
|
+
selectable: A = !1,
|
|
3945
|
+
selectedItems: $ = [],
|
|
3946
|
+
onSelectionChange: _,
|
|
3947
|
+
bulkActions: M,
|
|
3948
|
+
header: U,
|
|
3949
|
+
stickyHeader: V = !1,
|
|
3950
|
+
bordered: I = !1,
|
|
3951
|
+
emptyContent: W,
|
|
3952
|
+
loading: H = !1,
|
|
3952
3953
|
loadingRows: Y = 4,
|
|
3953
3954
|
className: Z,
|
|
3954
3955
|
"aria-label": Q
|
|
3955
3956
|
}) {
|
|
3956
|
-
const [b,
|
|
3957
|
+
const [b, u] = le.useState(
|
|
3957
3958
|
() => Object.fromEntries(
|
|
3958
|
-
(
|
|
3959
|
+
(x ?? []).filter((D) => D.defaultCollapsed).map((D) => [D.id, !0])
|
|
3959
3960
|
)
|
|
3960
|
-
), E = le.useRef(null), w = (
|
|
3961
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(
|
|
3961
|
+
), E = le.useRef(null), w = (D) => {
|
|
3962
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(D.key)) return;
|
|
3962
3963
|
const j = Array.from(
|
|
3963
3964
|
E.current?.querySelectorAll("li[data-list-row]") ?? []
|
|
3964
3965
|
);
|
|
3965
3966
|
if (j.length === 0) return;
|
|
3966
|
-
|
|
3967
|
-
const
|
|
3967
|
+
D.preventDefault();
|
|
3968
|
+
const K = j.indexOf(document.activeElement), o = D.key === "Home" ? 0 : D.key === "End" ? j.length - 1 : D.key === "ArrowDown" ? (K + 1) % j.length : (K - 1 + j.length) % j.length;
|
|
3968
3969
|
j[o]?.focus();
|
|
3969
|
-
},
|
|
3970
|
-
|
|
3971
|
-
q ? [
|
|
3970
|
+
}, P = (D, q) => r ? r(D, q) : q, k = (D) => $.includes(D), ae = (D, q) => {
|
|
3971
|
+
_ && _(
|
|
3972
|
+
q ? [...$, D] : $.filter((j) => j !== D)
|
|
3972
3973
|
);
|
|
3973
|
-
}, ne = (
|
|
3974
|
+
}, ne = (D) => _?.(D ? [...t] : []), ee = d(
|
|
3974
3975
|
"flex flex-col",
|
|
3975
|
-
|
|
3976
|
+
I && "overflow-hidden rounded-lg border border-border-subtle",
|
|
3976
3977
|
Z
|
|
3977
3978
|
);
|
|
3978
|
-
if (
|
|
3979
|
-
return /* @__PURE__ */ e("div", { className: ee, children: Array.from({ length: Y }).map((
|
|
3979
|
+
if (H)
|
|
3980
|
+
return /* @__PURE__ */ e("div", { className: ee, children: Array.from({ length: Y }).map((D, q) => /* @__PURE__ */ i(
|
|
3980
3981
|
"div",
|
|
3981
3982
|
{
|
|
3982
3983
|
className: d(
|
|
@@ -3992,10 +3993,10 @@ function fn({
|
|
|
3992
3993
|
},
|
|
3993
3994
|
`skeleton-${q}`
|
|
3994
3995
|
)) });
|
|
3995
|
-
if (t.length === 0 &&
|
|
3996
|
-
return /* @__PURE__ */ e("div", { className: ee, children:
|
|
3997
|
-
const G = t.length > 0 &&
|
|
3998
|
-
const
|
|
3996
|
+
if (t.length === 0 && W)
|
|
3997
|
+
return /* @__PURE__ */ e("div", { className: ee, children: W });
|
|
3998
|
+
const G = t.length > 0 && $.length === t.length, S = $.length > 0 && !G, T = (D, q, j) => {
|
|
3999
|
+
const K = p?.(D, q) ?? !1, o = N?.(D, q) ?? !1, z = h?.(D, q) ?? !1, B = A && k(D);
|
|
3999
4000
|
return /* @__PURE__ */ i(
|
|
4000
4001
|
"li",
|
|
4001
4002
|
{
|
|
@@ -4003,28 +4004,28 @@ function fn({
|
|
|
4003
4004
|
role: "button",
|
|
4004
4005
|
tabIndex: 0,
|
|
4005
4006
|
"data-list-row": "",
|
|
4006
|
-
"aria-current":
|
|
4007
|
-
onClick: () => c(
|
|
4007
|
+
"aria-current": K || void 0,
|
|
4008
|
+
onClick: () => c(D, q),
|
|
4008
4009
|
onFocus: () => f?.(q),
|
|
4009
|
-
onKeyDown: (
|
|
4010
|
-
|
|
4010
|
+
onKeyDown: (F) => {
|
|
4011
|
+
F.key !== "Enter" && F.key !== " " || (F.preventDefault(), c(D, q));
|
|
4011
4012
|
}
|
|
4012
4013
|
} : {},
|
|
4013
4014
|
className: d(
|
|
4014
|
-
"flex items-center gap-3 px-4 py-2
|
|
4015
|
+
"flex items-center gap-3 px-4 py-2 text-base",
|
|
4015
4016
|
"transition-colors duration-fast ease-out",
|
|
4016
4017
|
n === "divided" && !j && "border-t border-border-subtle",
|
|
4017
4018
|
c && "cursor-pointer focus-visible:outline-none focus-visible:focus-ring",
|
|
4018
|
-
|
|
4019
|
+
K || B ? "bg-accent-soft text-text" : c && "hover:bg-surface-hover",
|
|
4019
4020
|
o && "font-bold",
|
|
4020
4021
|
z && "opacity-55"
|
|
4021
4022
|
),
|
|
4022
4023
|
children: [
|
|
4023
|
-
|
|
4024
|
+
A && /* @__PURE__ */ e("span", { onClick: (F) => F.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4024
4025
|
xe,
|
|
4025
4026
|
{
|
|
4026
|
-
checked: k(
|
|
4027
|
-
onChange: (
|
|
4027
|
+
checked: k(D),
|
|
4028
|
+
onChange: (F) => ae(D, F.target.checked),
|
|
4028
4029
|
"aria-label": "Rij selecteren"
|
|
4029
4030
|
}
|
|
4030
4031
|
) }),
|
|
@@ -4035,30 +4036,30 @@ function fn({
|
|
|
4035
4036
|
className: "mt-2 size-1.5 shrink-0 self-start rounded-full bg-border-strong"
|
|
4036
4037
|
}
|
|
4037
4038
|
),
|
|
4038
|
-
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(
|
|
4039
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(
|
|
4040
|
-
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(
|
|
4039
|
+
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(D, q) }),
|
|
4040
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(D, q) : String(D) }),
|
|
4041
|
+
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(D, q) })
|
|
4041
4042
|
]
|
|
4042
4043
|
},
|
|
4043
|
-
|
|
4044
|
+
P(D, q)
|
|
4044
4045
|
);
|
|
4045
|
-
},
|
|
4046
|
-
if (!
|
|
4047
|
-
return t.map((
|
|
4048
|
-
const
|
|
4049
|
-
t.forEach((
|
|
4050
|
-
const z =
|
|
4051
|
-
|
|
4046
|
+
}, L = (() => {
|
|
4047
|
+
if (!m)
|
|
4048
|
+
return t.map((K, o) => T(K, o, o === 0));
|
|
4049
|
+
const D = /* @__PURE__ */ new Map();
|
|
4050
|
+
t.forEach((K, o) => {
|
|
4051
|
+
const z = m(K, o);
|
|
4052
|
+
D.has(z) || D.set(z, []), D.get(z).push({ item: K, index: o });
|
|
4052
4053
|
});
|
|
4053
|
-
const q =
|
|
4054
|
+
const q = x ?? [];
|
|
4054
4055
|
return [
|
|
4055
|
-
...q.filter((
|
|
4056
|
-
...[
|
|
4057
|
-
].flatMap((
|
|
4058
|
-
const z =
|
|
4056
|
+
...q.filter((K) => D.has(K.id)),
|
|
4057
|
+
...[...D.keys()].filter((K) => !q.some((o) => o.id === K)).map((K) => ({ id: K }))
|
|
4058
|
+
].flatMap((K, o) => {
|
|
4059
|
+
const z = D.get(K.id) ?? [], B = y && b[K.id], F = K.title ?? K.id, O = K.count ?? z.length, te = /* @__PURE__ */ e(
|
|
4059
4060
|
"li",
|
|
4060
4061
|
{
|
|
4061
|
-
onClick:
|
|
4062
|
+
onClick: y ? () => u((ie) => ({ ...ie, [K.id]: !ie[K.id] })) : void 0,
|
|
4062
4063
|
className: d(
|
|
4063
4064
|
"flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
|
|
4064
4065
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
@@ -4066,64 +4067,64 @@ function fn({
|
|
|
4066
4067
|
o > 0 && "border-t",
|
|
4067
4068
|
"border-b",
|
|
4068
4069
|
C && "sticky z-10",
|
|
4069
|
-
|
|
4070
|
+
y && "cursor-pointer select-none hover:text-text"
|
|
4070
4071
|
),
|
|
4071
|
-
"aria-expanded":
|
|
4072
|
-
style: C ? { top:
|
|
4073
|
-
children: v ? v(
|
|
4074
|
-
|
|
4072
|
+
"aria-expanded": y ? !B : void 0,
|
|
4073
|
+
style: C ? { top: V ? 28 : 0 } : void 0,
|
|
4074
|
+
children: v ? v(K, z.map((ie) => ie.item)) : /* @__PURE__ */ i(fe, { children: [
|
|
4075
|
+
y && /* @__PURE__ */ e(
|
|
4075
4076
|
ye,
|
|
4076
4077
|
{
|
|
4077
4078
|
"aria-hidden": !0,
|
|
4078
4079
|
className: d(
|
|
4079
4080
|
"size-icon-sm shrink-0 transition-transform duration-fast ease-out",
|
|
4080
|
-
!
|
|
4081
|
+
!B && "rotate-90"
|
|
4081
4082
|
)
|
|
4082
4083
|
}
|
|
4083
4084
|
),
|
|
4084
|
-
/* @__PURE__ */ e("span", { children:
|
|
4085
|
-
!
|
|
4085
|
+
/* @__PURE__ */ e("span", { children: F }),
|
|
4086
|
+
!g && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: O })
|
|
4086
4087
|
] })
|
|
4087
4088
|
},
|
|
4088
|
-
`group-${
|
|
4089
|
+
`group-${K.id}`
|
|
4089
4090
|
);
|
|
4090
|
-
return
|
|
4091
|
+
return B ? [te] : [
|
|
4091
4092
|
te,
|
|
4092
4093
|
...z.map(
|
|
4093
|
-
({ item: ie, index: He }, Ue) =>
|
|
4094
|
+
({ item: ie, index: He }, Ue) => T(ie, He, Ue === 0)
|
|
4094
4095
|
)
|
|
4095
4096
|
];
|
|
4096
4097
|
});
|
|
4097
4098
|
})();
|
|
4098
4099
|
return /* @__PURE__ */ i("div", { ref: E, className: ee, onKeyDown: c ? w : void 0, children: [
|
|
4099
|
-
|
|
4100
|
+
A && $.length > 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
|
|
4100
4101
|
/* @__PURE__ */ e(
|
|
4101
4102
|
xe,
|
|
4102
4103
|
{
|
|
4103
4104
|
checked: G,
|
|
4104
4105
|
indeterminate: S,
|
|
4105
|
-
onChange: (
|
|
4106
|
+
onChange: (D) => ne(D.target.checked),
|
|
4106
4107
|
"aria-label": "Alles selecteren"
|
|
4107
4108
|
}
|
|
4108
4109
|
),
|
|
4109
4110
|
/* @__PURE__ */ i("span", { className: "text-xs text-text-subtle", children: [
|
|
4110
|
-
|
|
4111
|
+
$.length,
|
|
4111
4112
|
" geselecteerd"
|
|
4112
4113
|
] }),
|
|
4113
|
-
|
|
4114
|
+
M && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: M })
|
|
4114
4115
|
] }),
|
|
4115
|
-
|
|
4116
|
+
U && /* @__PURE__ */ e(
|
|
4116
4117
|
"div",
|
|
4117
4118
|
{
|
|
4118
4119
|
className: d(
|
|
4119
4120
|
"flex items-center gap-3 border-b border-border-subtle px-4 py-1.5",
|
|
4120
4121
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
4121
|
-
|
|
4122
|
+
V && "sticky top-0 z-20"
|
|
4122
4123
|
),
|
|
4123
|
-
children:
|
|
4124
|
+
children: U
|
|
4124
4125
|
}
|
|
4125
4126
|
),
|
|
4126
|
-
/* @__PURE__ */ e("ul", { "aria-label": Q, className: "flex flex-col", children:
|
|
4127
|
+
/* @__PURE__ */ e("ul", { "aria-label": Q, className: "flex flex-col", children: L })
|
|
4127
4128
|
] });
|
|
4128
4129
|
}
|
|
4129
4130
|
function hn({
|
|
@@ -4167,27 +4168,28 @@ const bn = ({
|
|
|
4167
4168
|
surface: t = !1,
|
|
4168
4169
|
title: r,
|
|
4169
4170
|
subtitle: n,
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4171
|
+
meta: s,
|
|
4172
|
+
actions: a = [],
|
|
4173
|
+
children: l,
|
|
4174
|
+
className: c,
|
|
4175
|
+
backLabel: f = "Back",
|
|
4176
|
+
backClassName: p,
|
|
4177
|
+
onBack: N,
|
|
4178
|
+
editable: h = !1,
|
|
4179
|
+
onTitleChange: m
|
|
4178
4180
|
}) => {
|
|
4179
|
-
const [
|
|
4181
|
+
const [x, v] = R(!1), [C, y] = R(r), g = se(null);
|
|
4180
4182
|
J(() => {
|
|
4181
|
-
|
|
4183
|
+
y(r);
|
|
4182
4184
|
}, [r]), J(() => {
|
|
4183
|
-
|
|
4184
|
-
}, [
|
|
4185
|
-
const
|
|
4186
|
-
|
|
4187
|
-
},
|
|
4188
|
-
|
|
4189
|
-
},
|
|
4190
|
-
|
|
4185
|
+
x && g.current && (g.current.focus(), g.current.select());
|
|
4186
|
+
}, [x]);
|
|
4187
|
+
const A = () => {
|
|
4188
|
+
h && v(!0);
|
|
4189
|
+
}, $ = () => {
|
|
4190
|
+
v(!1), C.trim() !== "" && C !== r && m ? m(C.trim()) : y(r);
|
|
4191
|
+
}, _ = (M) => {
|
|
4192
|
+
M.key === "Enter" ? g.current?.blur() : M.key === "Escape" && (y(r), v(!1));
|
|
4191
4193
|
};
|
|
4192
4194
|
return /* @__PURE__ */ i(
|
|
4193
4195
|
"div",
|
|
@@ -4196,86 +4198,89 @@ const bn = ({
|
|
|
4196
4198
|
"p-5 pb-3",
|
|
4197
4199
|
// App-bar treatment: own background, full-bleed, closed with a rule.
|
|
4198
4200
|
t && "bg-surface border-b border-border",
|
|
4199
|
-
|
|
4201
|
+
c
|
|
4200
4202
|
),
|
|
4201
4203
|
children: [
|
|
4202
4204
|
/* @__PURE__ */ i("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
4203
|
-
/* @__PURE__ */
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
type: "button",
|
|
4208
|
-
onClick: g,
|
|
4209
|
-
className: d(
|
|
4210
|
-
"flex items-center text-sm cursor-pointer transition",
|
|
4211
|
-
f
|
|
4212
|
-
),
|
|
4213
|
-
children: /* @__PURE__ */ e(ze, { size: 16, color: "currentColor" })
|
|
4214
|
-
}
|
|
4215
|
-
),
|
|
4216
|
-
u ? /* @__PURE__ */ e(
|
|
4217
|
-
"input",
|
|
4218
|
-
{
|
|
4219
|
-
ref: p,
|
|
4220
|
-
type: "text",
|
|
4221
|
-
value: v,
|
|
4222
|
-
onChange: (P) => C(P.target.value),
|
|
4223
|
-
onBlur: T,
|
|
4224
|
-
onKeyDown: M,
|
|
4225
|
-
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 flex-1"
|
|
4226
|
-
}
|
|
4227
|
-
) : /* @__PURE__ */ i("div", { className: "group flex items-baseline gap-2.5 min-w-0", children: [
|
|
4228
|
-
/* @__PURE__ */ e(
|
|
4229
|
-
"h2",
|
|
4205
|
+
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
4206
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 text-text", children: [
|
|
4207
|
+
N && /* @__PURE__ */ e(
|
|
4208
|
+
"button",
|
|
4230
4209
|
{
|
|
4231
|
-
|
|
4210
|
+
type: "button",
|
|
4211
|
+
onClick: N,
|
|
4232
4212
|
className: d(
|
|
4233
|
-
"text-
|
|
4234
|
-
|
|
4213
|
+
"flex items-center text-sm cursor-pointer transition",
|
|
4214
|
+
p
|
|
4235
4215
|
),
|
|
4236
|
-
|
|
4237
|
-
children: r
|
|
4216
|
+
children: /* @__PURE__ */ e(ze, { size: 16, color: "currentColor" })
|
|
4238
4217
|
}
|
|
4239
4218
|
),
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
ct,
|
|
4219
|
+
x ? /* @__PURE__ */ e(
|
|
4220
|
+
"input",
|
|
4243
4221
|
{
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4222
|
+
ref: g,
|
|
4223
|
+
type: "text",
|
|
4224
|
+
value: C,
|
|
4225
|
+
onChange: (M) => y(M.target.value),
|
|
4226
|
+
onBlur: $,
|
|
4227
|
+
onKeyDown: _,
|
|
4228
|
+
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 flex-1"
|
|
4247
4229
|
}
|
|
4248
|
-
)
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4230
|
+
) : /* @__PURE__ */ i("div", { className: "group flex items-baseline gap-2.5 min-w-0", children: [
|
|
4231
|
+
/* @__PURE__ */ e(
|
|
4232
|
+
"h2",
|
|
4233
|
+
{
|
|
4234
|
+
onClick: A,
|
|
4235
|
+
className: d(
|
|
4236
|
+
"text-2xl font-semibold truncate",
|
|
4237
|
+
h && "cursor-pointer"
|
|
4238
|
+
),
|
|
4239
|
+
title: h ? "Klik om te bewerken" : void 0,
|
|
4240
|
+
children: r
|
|
4241
|
+
}
|
|
4242
|
+
),
|
|
4243
|
+
n && /* @__PURE__ */ e("span", { className: "shrink-0 text-base text-text-muted truncate", children: n }),
|
|
4244
|
+
h && /* @__PURE__ */ e(
|
|
4245
|
+
ct,
|
|
4246
|
+
{
|
|
4247
|
+
size: 15,
|
|
4248
|
+
onClick: A,
|
|
4249
|
+
className: "shrink-0 cursor-pointer text-text-muted opacity-0 group-hover:opacity-100 transition-opacity"
|
|
4250
|
+
}
|
|
4251
|
+
)
|
|
4252
|
+
] })
|
|
4253
|
+
] }),
|
|
4254
|
+
s && /* @__PURE__ */ e("div", { className: "mt-0.5 truncate text-xs text-text-muted", children: s })
|
|
4255
|
+
] }),
|
|
4256
|
+
a.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: a.map(
|
|
4257
|
+
(M) => M.render ? /* @__PURE__ */ e(le.Fragment, { children: M.render() }, M.id) : M.splitOptions && M.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
4253
4258
|
je,
|
|
4254
4259
|
{
|
|
4255
|
-
label:
|
|
4256
|
-
onClick:
|
|
4257
|
-
icon:
|
|
4258
|
-
variant:
|
|
4259
|
-
options:
|
|
4260
|
-
disabled:
|
|
4260
|
+
label: M.label,
|
|
4261
|
+
onClick: M.onClick,
|
|
4262
|
+
icon: M.icon,
|
|
4263
|
+
variant: M.variant === "primary" ? "primary" : "secondary",
|
|
4264
|
+
options: M.splitOptions,
|
|
4265
|
+
disabled: M.disabled
|
|
4261
4266
|
},
|
|
4262
|
-
|
|
4267
|
+
M.id
|
|
4263
4268
|
) : /* @__PURE__ */ e(
|
|
4264
4269
|
re,
|
|
4265
4270
|
{
|
|
4266
|
-
variant:
|
|
4267
|
-
onClick: (
|
|
4268
|
-
|
|
4271
|
+
variant: M.variant ?? "secondary",
|
|
4272
|
+
onClick: (U) => {
|
|
4273
|
+
U.stopPropagation(), U.target.blur(), M.onClick();
|
|
4269
4274
|
},
|
|
4270
|
-
disabled:
|
|
4271
|
-
leftIcon:
|
|
4272
|
-
children:
|
|
4275
|
+
disabled: M.disabled,
|
|
4276
|
+
leftIcon: M.icon,
|
|
4277
|
+
children: M.label
|
|
4273
4278
|
},
|
|
4274
|
-
|
|
4279
|
+
M.id
|
|
4275
4280
|
)
|
|
4276
4281
|
) })
|
|
4277
4282
|
] }),
|
|
4278
|
-
|
|
4283
|
+
l && /* @__PURE__ */ e("div", { className: "mt-4", children: l })
|
|
4279
4284
|
]
|
|
4280
4285
|
}
|
|
4281
4286
|
);
|
|
@@ -4402,26 +4407,26 @@ const wn = ({
|
|
|
4402
4407
|
size: n = "md",
|
|
4403
4408
|
className: s
|
|
4404
4409
|
}) => {
|
|
4405
|
-
const a = (
|
|
4406
|
-
if (!
|
|
4410
|
+
const a = (h) => {
|
|
4411
|
+
if (!h) return "-";
|
|
4407
4412
|
try {
|
|
4408
|
-
return new Date(
|
|
4413
|
+
return new Date(h).toLocaleDateString("nl-NL", {
|
|
4409
4414
|
year: "numeric",
|
|
4410
4415
|
month: "long",
|
|
4411
4416
|
day: "numeric"
|
|
4412
4417
|
});
|
|
4413
4418
|
} catch {
|
|
4414
|
-
return String(
|
|
4419
|
+
return String(h);
|
|
4415
4420
|
}
|
|
4416
|
-
}, l = (
|
|
4417
|
-
if (!
|
|
4418
|
-
const
|
|
4419
|
-
return
|
|
4421
|
+
}, l = (h) => h ? "Ja" : "Nee", c = (h, m) => {
|
|
4422
|
+
if (!m) return String(h || "-");
|
|
4423
|
+
const x = m.find((v) => v.value === h);
|
|
4424
|
+
return x ? x.label : String(h || "-");
|
|
4420
4425
|
}, f = ce(
|
|
4421
|
-
(
|
|
4422
|
-
const
|
|
4423
|
-
if (
|
|
4424
|
-
const v =
|
|
4426
|
+
(h) => {
|
|
4427
|
+
const m = zr(r, h.name);
|
|
4428
|
+
if (h.type === "array") {
|
|
4429
|
+
const v = m;
|
|
4425
4430
|
return !v || v.length === 0 ? /* @__PURE__ */ e(
|
|
4426
4431
|
oe,
|
|
4427
4432
|
{
|
|
@@ -4430,7 +4435,7 @@ const wn = ({
|
|
|
4430
4435
|
className: "text-text-muted",
|
|
4431
4436
|
children: "Geen items"
|
|
4432
4437
|
}
|
|
4433
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: v.map((C,
|
|
4438
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: v.map((C, y) => /* @__PURE__ */ i(
|
|
4434
4439
|
"div",
|
|
4435
4440
|
{
|
|
4436
4441
|
className: "p-4 border border-border rounded-xl space-y-3",
|
|
@@ -4443,53 +4448,53 @@ const wn = ({
|
|
|
4443
4448
|
weight: "medium",
|
|
4444
4449
|
className: "text-text-muted",
|
|
4445
4450
|
children: [
|
|
4446
|
-
|
|
4451
|
+
h.label,
|
|
4447
4452
|
" ",
|
|
4448
|
-
|
|
4453
|
+
y + 1
|
|
4449
4454
|
]
|
|
4450
4455
|
}
|
|
4451
4456
|
) }),
|
|
4452
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children:
|
|
4453
|
-
const
|
|
4454
|
-
let
|
|
4455
|
-
switch (
|
|
4457
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: h.arrayFields?.map((g) => {
|
|
4458
|
+
const A = C?.[g.name];
|
|
4459
|
+
let $ = "-";
|
|
4460
|
+
switch (g.type) {
|
|
4456
4461
|
case "text":
|
|
4457
4462
|
case "email":
|
|
4458
4463
|
case "number":
|
|
4459
4464
|
case "tel":
|
|
4460
4465
|
case "url":
|
|
4461
4466
|
case "textarea":
|
|
4462
|
-
|
|
4467
|
+
$ = A || "-";
|
|
4463
4468
|
break;
|
|
4464
4469
|
case "select":
|
|
4465
4470
|
case "radio":
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4471
|
+
$ = c(
|
|
4472
|
+
A,
|
|
4473
|
+
g.options
|
|
4469
4474
|
);
|
|
4470
4475
|
break;
|
|
4471
4476
|
case "checkbox":
|
|
4472
|
-
|
|
4477
|
+
$ = l(A);
|
|
4473
4478
|
break;
|
|
4474
4479
|
case "date":
|
|
4475
|
-
|
|
4480
|
+
$ = a(A);
|
|
4476
4481
|
break;
|
|
4477
4482
|
case "custom":
|
|
4478
|
-
|
|
4479
|
-
value:
|
|
4483
|
+
$ = g.customComponent?.({
|
|
4484
|
+
value: A
|
|
4480
4485
|
});
|
|
4481
4486
|
break;
|
|
4482
4487
|
default:
|
|
4483
|
-
|
|
4488
|
+
$ = String(A || "-");
|
|
4484
4489
|
}
|
|
4485
|
-
return
|
|
4490
|
+
return g.format && ($ = g.format(A, C)), /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
4486
4491
|
/* @__PURE__ */ e(
|
|
4487
4492
|
oe,
|
|
4488
4493
|
{
|
|
4489
4494
|
variant: "label",
|
|
4490
4495
|
size: "xs",
|
|
4491
4496
|
className: "text-text-muted",
|
|
4492
|
-
children:
|
|
4497
|
+
children: g.label
|
|
4493
4498
|
}
|
|
4494
4499
|
),
|
|
4495
4500
|
/* @__PURE__ */ e(
|
|
@@ -4498,20 +4503,20 @@ const wn = ({
|
|
|
4498
4503
|
variant: "body",
|
|
4499
4504
|
size: "sm",
|
|
4500
4505
|
className: "text-text",
|
|
4501
|
-
children:
|
|
4506
|
+
children: $
|
|
4502
4507
|
}
|
|
4503
4508
|
)
|
|
4504
|
-
] },
|
|
4509
|
+
] }, g.name);
|
|
4505
4510
|
}) })
|
|
4506
4511
|
]
|
|
4507
4512
|
},
|
|
4508
|
-
|
|
4513
|
+
y
|
|
4509
4514
|
)) });
|
|
4510
4515
|
}
|
|
4511
|
-
if (
|
|
4512
|
-
return
|
|
4513
|
-
if (
|
|
4514
|
-
const v =
|
|
4516
|
+
if (h.type === "custom" && h.customComponent)
|
|
4517
|
+
return h.customComponent({ value: m });
|
|
4518
|
+
if (h.format) {
|
|
4519
|
+
const v = h.format(m, r);
|
|
4515
4520
|
return /* @__PURE__ */ e(
|
|
4516
4521
|
oe,
|
|
4517
4522
|
{
|
|
@@ -4522,31 +4527,31 @@ const wn = ({
|
|
|
4522
4527
|
}
|
|
4523
4528
|
);
|
|
4524
4529
|
}
|
|
4525
|
-
let
|
|
4526
|
-
switch (
|
|
4530
|
+
let x = "-";
|
|
4531
|
+
switch (h.type) {
|
|
4527
4532
|
case "text":
|
|
4528
4533
|
case "email":
|
|
4529
4534
|
case "password":
|
|
4530
4535
|
case "number":
|
|
4531
4536
|
case "tel":
|
|
4532
4537
|
case "url":
|
|
4533
|
-
|
|
4538
|
+
x = m ? String(m) : "-";
|
|
4534
4539
|
break;
|
|
4535
4540
|
case "textarea":
|
|
4536
|
-
|
|
4541
|
+
x = m ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(m || "-") }) : "-";
|
|
4537
4542
|
break;
|
|
4538
4543
|
case "select":
|
|
4539
4544
|
case "radio":
|
|
4540
|
-
|
|
4545
|
+
x = c(m, h.options);
|
|
4541
4546
|
break;
|
|
4542
4547
|
case "checkbox":
|
|
4543
|
-
|
|
4548
|
+
x = l(m);
|
|
4544
4549
|
break;
|
|
4545
4550
|
case "date":
|
|
4546
|
-
|
|
4551
|
+
x = a(m);
|
|
4547
4552
|
break;
|
|
4548
4553
|
default:
|
|
4549
|
-
|
|
4554
|
+
x = m ? String(m) : "-";
|
|
4550
4555
|
}
|
|
4551
4556
|
return /* @__PURE__ */ e(
|
|
4552
4557
|
oe,
|
|
@@ -4554,30 +4559,30 @@ const wn = ({
|
|
|
4554
4559
|
variant: "body",
|
|
4555
4560
|
size: "sm",
|
|
4556
4561
|
className: "text-text",
|
|
4557
|
-
children:
|
|
4562
|
+
children: x
|
|
4558
4563
|
}
|
|
4559
4564
|
);
|
|
4560
4565
|
},
|
|
4561
4566
|
[r]
|
|
4562
|
-
),
|
|
4563
|
-
(
|
|
4564
|
-
if (
|
|
4567
|
+
), p = ce(
|
|
4568
|
+
(h) => {
|
|
4569
|
+
if (h.conditional && !h.conditional(r))
|
|
4565
4570
|
return null;
|
|
4566
|
-
const
|
|
4567
|
-
if (
|
|
4568
|
-
const
|
|
4571
|
+
const m = h.items.filter((v) => !(v.hidden || v.conditional && !v.conditional(r)));
|
|
4572
|
+
if (m.length === 0) return null;
|
|
4573
|
+
const x = d(
|
|
4569
4574
|
"space-y-4",
|
|
4570
4575
|
{
|
|
4571
|
-
"grid gap-4":
|
|
4572
|
-
"flex flex-wrap gap-4":
|
|
4576
|
+
"grid gap-4": h.layout === "grid",
|
|
4577
|
+
"flex flex-wrap gap-4": h.layout === "flex"
|
|
4573
4578
|
},
|
|
4574
|
-
|
|
4575
|
-
"grid-cols-1": !
|
|
4576
|
-
"grid-cols-2":
|
|
4577
|
-
"grid-cols-3":
|
|
4578
|
-
"grid-cols-4":
|
|
4579
|
+
h.layout === "grid" && {
|
|
4580
|
+
"grid-cols-1": !h.columns || h.columns === 1,
|
|
4581
|
+
"grid-cols-2": h.columns === 2,
|
|
4582
|
+
"grid-cols-3": h.columns === 3,
|
|
4583
|
+
"grid-cols-4": h.columns === 4
|
|
4579
4584
|
},
|
|
4580
|
-
|
|
4585
|
+
h.className
|
|
4581
4586
|
);
|
|
4582
4587
|
return /* @__PURE__ */ i(
|
|
4583
4588
|
"div",
|
|
@@ -4592,20 +4597,20 @@ const wn = ({
|
|
|
4592
4597
|
size: "lg",
|
|
4593
4598
|
weight: "semibold",
|
|
4594
4599
|
className: "text-text",
|
|
4595
|
-
children:
|
|
4600
|
+
children: h.title
|
|
4596
4601
|
}
|
|
4597
4602
|
),
|
|
4598
|
-
|
|
4603
|
+
h.description && /* @__PURE__ */ e(
|
|
4599
4604
|
oe,
|
|
4600
4605
|
{
|
|
4601
4606
|
variant: "body",
|
|
4602
4607
|
size: "sm",
|
|
4603
4608
|
className: "text-text-muted mt-1",
|
|
4604
|
-
children:
|
|
4609
|
+
children: h.description
|
|
4605
4610
|
}
|
|
4606
4611
|
)
|
|
4607
4612
|
] }),
|
|
4608
|
-
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className:
|
|
4613
|
+
/* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: x, children: m.map((v) => /* @__PURE__ */ i(
|
|
4609
4614
|
"div",
|
|
4610
4615
|
{
|
|
4611
4616
|
className: "space-y-1",
|
|
@@ -4630,7 +4635,7 @@ const wn = ({
|
|
|
4630
4635
|
)) }) })
|
|
4631
4636
|
]
|
|
4632
4637
|
},
|
|
4633
|
-
|
|
4638
|
+
h.id
|
|
4634
4639
|
);
|
|
4635
4640
|
},
|
|
4636
4641
|
[r, f]
|
|
@@ -4644,7 +4649,7 @@ const wn = ({
|
|
|
4644
4649
|
},
|
|
4645
4650
|
s
|
|
4646
4651
|
);
|
|
4647
|
-
return /* @__PURE__ */ e("div", { className: N, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(
|
|
4652
|
+
return /* @__PURE__ */ e("div", { className: N, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(p) }) });
|
|
4648
4653
|
}, Re = ({ item: t, isSelectedHandler: r, onClick: n, depth: s = 0 }) => {
|
|
4649
4654
|
const a = !!(t.children && t.children.length > 0), l = r ? r(t.path) : !1;
|
|
4650
4655
|
return a ? /* @__PURE__ */ i("li", { children: [
|
|
@@ -4774,9 +4779,9 @@ const wn = ({
|
|
|
4774
4779
|
truncate: l = !1,
|
|
4775
4780
|
className: c,
|
|
4776
4781
|
children: f,
|
|
4777
|
-
...
|
|
4782
|
+
...p
|
|
4778
4783
|
}) => {
|
|
4779
|
-
const N = `h${t}`,
|
|
4784
|
+
const N = `h${t}`, h = d(
|
|
4780
4785
|
"font-sans text-pretty",
|
|
4781
4786
|
Er[r || Tr(t)],
|
|
4782
4787
|
Mr[n],
|
|
@@ -4785,7 +4790,7 @@ const wn = ({
|
|
|
4785
4790
|
l && "truncate",
|
|
4786
4791
|
c
|
|
4787
4792
|
);
|
|
4788
|
-
return /* @__PURE__ */ e(N, { className:
|
|
4793
|
+
return /* @__PURE__ */ e(N, { className: h, ...p, children: f });
|
|
4789
4794
|
};
|
|
4790
4795
|
function Tr(t) {
|
|
4791
4796
|
return {
|
|
@@ -4805,44 +4810,44 @@ const Sn = ({
|
|
|
4805
4810
|
initialCommandPath: a,
|
|
4806
4811
|
initialActiveIndex: l
|
|
4807
4812
|
}) => {
|
|
4808
|
-
const [c, f] =
|
|
4809
|
-
(
|
|
4813
|
+
const [c, f] = R(""), [p, N] = R(a || []), [h, m] = R(l || 0), x = se(null), v = se(null), y = (p.length ? t.find((g) => g.id === p[0])?.subCommands || [] : t).filter(
|
|
4814
|
+
(g) => g.label.toLowerCase().includes(c.toLowerCase())
|
|
4810
4815
|
);
|
|
4811
4816
|
return J(() => {
|
|
4812
|
-
r || (f(""), N(a || []),
|
|
4817
|
+
r || (f(""), N(a || []), m(l || 0));
|
|
4813
4818
|
}, [r]), J(() => {
|
|
4814
|
-
const
|
|
4819
|
+
const g = (A) => {
|
|
4815
4820
|
if (r) {
|
|
4816
|
-
if (
|
|
4821
|
+
if (A.key === "Escape")
|
|
4817
4822
|
n();
|
|
4818
|
-
else if (
|
|
4819
|
-
|
|
4820
|
-
(
|
|
4823
|
+
else if (A.key === "ArrowUp")
|
|
4824
|
+
m(
|
|
4825
|
+
($) => $ > 0 ? $ - 1 : y.length - 1
|
|
4821
4826
|
);
|
|
4822
|
-
else if (
|
|
4823
|
-
|
|
4824
|
-
(
|
|
4827
|
+
else if (A.key === "ArrowDown")
|
|
4828
|
+
m(
|
|
4829
|
+
($) => $ < y.length - 1 ? $ + 1 : 0
|
|
4825
4830
|
);
|
|
4826
|
-
else if (
|
|
4827
|
-
const
|
|
4828
|
-
|
|
4831
|
+
else if (A.key === "Enter") {
|
|
4832
|
+
const $ = y[h];
|
|
4833
|
+
$ && ($.subCommands ? (N([...p, $.id]), m(0)) : $.action && ($.action(), n()));
|
|
4829
4834
|
}
|
|
4830
4835
|
}
|
|
4831
4836
|
};
|
|
4832
|
-
return document.addEventListener("keydown",
|
|
4833
|
-
}, [r, n,
|
|
4834
|
-
const
|
|
4835
|
-
|
|
4837
|
+
return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
|
|
4838
|
+
}, [r, n, y, h, p]), J(() => {
|
|
4839
|
+
const g = (A) => {
|
|
4840
|
+
x.current && !x.current.contains(A.target) && n();
|
|
4836
4841
|
};
|
|
4837
|
-
return r && document.addEventListener("mousedown",
|
|
4842
|
+
return r && document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
4838
4843
|
}, [r, n]), J(() => {
|
|
4839
4844
|
if (!r) return;
|
|
4840
|
-
v.current?.querySelector(`[data-index="${
|
|
4841
|
-
}, [
|
|
4845
|
+
v.current?.querySelector(`[data-index="${h}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4846
|
+
}, [h, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ i(
|
|
4842
4847
|
"div",
|
|
4843
4848
|
{
|
|
4844
4849
|
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",
|
|
4845
|
-
ref:
|
|
4850
|
+
ref: x,
|
|
4846
4851
|
children: [
|
|
4847
4852
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4848
4853
|
/* @__PURE__ */ e(Ne, { className: "w-4 h-4 text-text-muted shrink-0" }),
|
|
@@ -4853,7 +4858,7 @@ const Sn = ({
|
|
|
4853
4858
|
autoFocus: !0,
|
|
4854
4859
|
placeholder: s?.searchPlaceholder || "Search commands...",
|
|
4855
4860
|
value: c,
|
|
4856
|
-
onChange: (
|
|
4861
|
+
onChange: (g) => f(g.target.value),
|
|
4857
4862
|
className: "w-full border-0 bg-transparent py-2 text-text focus:outline-none"
|
|
4858
4863
|
}
|
|
4859
4864
|
)
|
|
@@ -4864,23 +4869,23 @@ const Sn = ({
|
|
|
4864
4869
|
ref: v,
|
|
4865
4870
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
4866
4871
|
children: [
|
|
4867
|
-
|
|
4868
|
-
|
|
4872
|
+
y.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
4873
|
+
y.map((g, A) => /* @__PURE__ */ i(
|
|
4869
4874
|
"div",
|
|
4870
4875
|
{
|
|
4871
|
-
"data-index":
|
|
4872
|
-
className: `flex items-center p-2 cursor-pointer rounded-md ${
|
|
4876
|
+
"data-index": A,
|
|
4877
|
+
className: `flex items-center p-2 cursor-pointer rounded-md ${A === h ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
4873
4878
|
onClick: () => {
|
|
4874
|
-
|
|
4879
|
+
g.subCommands ? (N([...p, g.id]), m(0)) : g.action && (g.action(), n());
|
|
4875
4880
|
},
|
|
4876
|
-
onMouseEnter: () =>
|
|
4881
|
+
onMouseEnter: () => m(A),
|
|
4877
4882
|
children: [
|
|
4878
|
-
|
|
4879
|
-
/* @__PURE__ */ e("span", { className: "flex-grow", children:
|
|
4880
|
-
|
|
4883
|
+
g.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: g.icon }),
|
|
4884
|
+
/* @__PURE__ */ e("span", { className: "flex-grow", children: g.label }),
|
|
4885
|
+
g.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(ye, { className: "w-4 h-4" }) })
|
|
4881
4886
|
]
|
|
4882
4887
|
},
|
|
4883
|
-
|
|
4888
|
+
g.id
|
|
4884
4889
|
))
|
|
4885
4890
|
]
|
|
4886
4891
|
}
|
|
@@ -4973,12 +4978,12 @@ const Sn = ({
|
|
|
4973
4978
|
border: l,
|
|
4974
4979
|
borderColor: c,
|
|
4975
4980
|
className: f,
|
|
4976
|
-
children:
|
|
4981
|
+
children: p,
|
|
4977
4982
|
...N
|
|
4978
|
-
},
|
|
4983
|
+
}, h) => /* @__PURE__ */ e(
|
|
4979
4984
|
"div",
|
|
4980
4985
|
{
|
|
4981
|
-
ref:
|
|
4986
|
+
ref: h,
|
|
4982
4987
|
className: d(
|
|
4983
4988
|
t && Ar[t],
|
|
4984
4989
|
r && Lr[r],
|
|
@@ -4990,7 +4995,7 @@ const Sn = ({
|
|
|
4990
4995
|
f
|
|
4991
4996
|
),
|
|
4992
4997
|
...N,
|
|
4993
|
-
children:
|
|
4998
|
+
children: p
|
|
4994
4999
|
}
|
|
4995
5000
|
)
|
|
4996
5001
|
);
|
|
@@ -5018,41 +5023,41 @@ function En({
|
|
|
5018
5023
|
componentProps: a,
|
|
5019
5024
|
className: l
|
|
5020
5025
|
}) {
|
|
5021
|
-
const c = se(null), [f,
|
|
5026
|
+
const c = se(null), [f, p] = R(!0), [N, h] = R(null), m = se(null);
|
|
5022
5027
|
return se(null), J(() => {
|
|
5023
|
-
let
|
|
5028
|
+
let x = !0;
|
|
5024
5029
|
return (async () => {
|
|
5025
|
-
|
|
5030
|
+
p(!0);
|
|
5026
5031
|
try {
|
|
5027
5032
|
const C = await r();
|
|
5028
|
-
if (!
|
|
5029
|
-
const
|
|
5030
|
-
|
|
5033
|
+
if (!x) return;
|
|
5034
|
+
const y = C.component || C.default || C;
|
|
5035
|
+
h(n === "react" ? () => y : () => C);
|
|
5031
5036
|
} catch (C) {
|
|
5032
5037
|
console.error(`[FederatedResource] Load failed: ${t}`, C);
|
|
5033
5038
|
} finally {
|
|
5034
|
-
|
|
5039
|
+
x && p(!1);
|
|
5035
5040
|
}
|
|
5036
5041
|
})(), () => {
|
|
5037
|
-
|
|
5042
|
+
x = !1;
|
|
5038
5043
|
};
|
|
5039
5044
|
}, [t, r]), J(() => {
|
|
5040
5045
|
if (f || !N || n === "react") return;
|
|
5041
|
-
const
|
|
5042
|
-
if (
|
|
5046
|
+
const x = c.current;
|
|
5047
|
+
if (x) {
|
|
5043
5048
|
if (n === "svelte") {
|
|
5044
|
-
const v = N.default || N, C = new v({ target:
|
|
5045
|
-
return
|
|
5049
|
+
const v = N.default || N, C = new v({ target: x, props: a || {} });
|
|
5050
|
+
return m.current = C, () => C.$destroy();
|
|
5046
5051
|
}
|
|
5047
5052
|
if (N.mount) {
|
|
5048
|
-
const v = N.mount({ container:
|
|
5053
|
+
const v = N.mount({ container: x, props: a || {} });
|
|
5049
5054
|
return () => {
|
|
5050
|
-
typeof v == "function" ? v() : N.unmount?.(
|
|
5055
|
+
typeof v == "function" ? v() : N.unmount?.(x);
|
|
5051
5056
|
};
|
|
5052
5057
|
}
|
|
5053
5058
|
}
|
|
5054
5059
|
}, [N, n, f]), J(() => {
|
|
5055
|
-
n === "svelte" &&
|
|
5060
|
+
n === "svelte" && m.current && m.current.$set?.(a);
|
|
5056
5061
|
}, [a, n]), /* @__PURE__ */ i("div", { ref: c, className: l, style: { display: "contents" }, children: [
|
|
5057
5062
|
f && s,
|
|
5058
5063
|
n === "react" && N && /* @__PURE__ */ e(N, { ...a })
|