@opencxh/ui-kit 3.172.0 → 3.175.1
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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1171 -1156
- package/dist/index.js.map +1 -1
- package/dist/src/forms/Form.d.ts +20 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/test/setup.d.ts +0 -0
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { clsx as gt } from "clsx";
|
|
2
|
-
import
|
|
2
|
+
import ae, { useState as R, useLayoutEffect as pt, useRef as ne, useEffect as X, forwardRef as ve, useMemo as pe, useCallback as xe, createContext as et, useId as vt, useContext as yt, Component as Nt } from "react";
|
|
3
3
|
import { jsxs as c, jsx as e, Fragment as Ee } from "react/jsx-runtime";
|
|
4
4
|
import * as wt from "lucide-react";
|
|
5
|
-
import { VideoOff as kt, User as Ct, MicOff as St, Mic as Et, X as Se, ChevronDown as
|
|
5
|
+
import { VideoOff as kt, User as Ct, MicOff as St, Mic as Et, X as Se, ChevronDown as Ae, ExternalLink as zt, Calendar as Mt, ChevronLeft as ze, ChevronRight as Le, ChevronDownIcon as Tt, Loader2 as $t, Search as Ie, Check as Ue, ChevronUp as _t, Ellipsis as Dt, FileText as je, HardDrive as We, ArrowLeft as At, FolderPlus as Lt, Upload as It, Folder as Ke, Trash2 as Pt, Plus as Ot, Sparkles as jt, ImageOff as Ft, Pencil as Rt, ArrowUpRight as Bt } from "lucide-react";
|
|
6
6
|
import Ht from "dompurify";
|
|
7
7
|
import qt from "react-markdown";
|
|
8
8
|
import Vt from "remark-gfm";
|
|
@@ -16,14 +16,14 @@ function ts(t) {
|
|
|
16
16
|
return (r) => t[r] || "";
|
|
17
17
|
}
|
|
18
18
|
function Pe(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start" } = {}) {
|
|
19
|
-
const [l, o] =
|
|
19
|
+
const [l, o] = R({});
|
|
20
20
|
return pt(() => {
|
|
21
21
|
if (!t) return;
|
|
22
22
|
const u = () => {
|
|
23
23
|
const d = r.current;
|
|
24
24
|
if (!d) return;
|
|
25
|
-
const v = d.getBoundingClientRect(), m = window.innerHeight - v.bottom, f = v.top, b = a.startsWith("top"), g = b ? f < 200 && m > f : m < 200 && f > m,
|
|
26
|
-
|
|
25
|
+
const v = d.getBoundingClientRect(), m = window.innerHeight - v.bottom, f = v.top, b = a.startsWith("top"), g = b ? f < 200 && m > f : m < 200 && f > m, w = b !== g, p = { position: "fixed" };
|
|
26
|
+
w ? (p.bottom = window.innerHeight - v.top + n, p.maxHeight = Math.max(120, f - n * 2)) : (p.top = v.bottom + n, p.maxHeight = Math.max(120, m - n * 2)), a.endsWith("end") ? p.right = window.innerWidth - v.right : p.left = v.left, s && (p.width = v.width), o(p);
|
|
27
27
|
};
|
|
28
28
|
return u(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
29
29
|
window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
@@ -66,7 +66,7 @@ function ns(t) {
|
|
|
66
66
|
for (let n = 0; n < t.length; n++) r = r * 31 + t.charCodeAt(n) >>> 0;
|
|
67
67
|
return Ge[r % Ge.length];
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const _e = (t) => t == null ? "" : String(t), Jt = (t) => _e(t).trim().toLowerCase(), Yt = [
|
|
70
70
|
{ upTo: 1, cols: "grid-cols-1" },
|
|
71
71
|
{ upTo: 2, cols: "grid-cols-1 @[22rem]:grid-cols-2" },
|
|
72
72
|
{ upTo: 4, cols: "grid-cols-1 @[18rem]:grid-cols-2" },
|
|
@@ -136,8 +136,8 @@ function as({
|
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
138
|
function ls({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
|
|
139
|
-
const a =
|
|
140
|
-
return
|
|
139
|
+
const a = ne(null);
|
|
140
|
+
return X(() => {
|
|
141
141
|
if (!r || !a.current) return;
|
|
142
142
|
const l = t(a.current);
|
|
143
143
|
return () => {
|
|
@@ -288,7 +288,7 @@ const nr = {
|
|
|
288
288
|
info: "text-info-fg",
|
|
289
289
|
neutral: "text-text-subtle",
|
|
290
290
|
current: "text-current"
|
|
291
|
-
},
|
|
291
|
+
}, ee = ({
|
|
292
292
|
icon: t,
|
|
293
293
|
size: r = "md",
|
|
294
294
|
color: n = "current",
|
|
@@ -341,21 +341,21 @@ const nt = ({
|
|
|
341
341
|
disabled: o = !1,
|
|
342
342
|
triggerLabel: u
|
|
343
343
|
}) => {
|
|
344
|
-
const [d, v] =
|
|
345
|
-
|
|
344
|
+
const [d, v] = R(!1), m = ne(null), f = ne(null), b = Pe(d, f, { placement: n });
|
|
345
|
+
X(() => {
|
|
346
346
|
if (!d) return;
|
|
347
347
|
const p = (C) => {
|
|
348
348
|
m.current && !m.current.contains(C.target) && v(!1);
|
|
349
|
-
},
|
|
349
|
+
}, h = (C) => {
|
|
350
350
|
C.key === "Escape" && v(!1);
|
|
351
351
|
};
|
|
352
|
-
return document.addEventListener("mousedown", p), document.addEventListener("keydown",
|
|
353
|
-
document.removeEventListener("mousedown", p), document.removeEventListener("keydown",
|
|
352
|
+
return document.addEventListener("mousedown", p), document.addEventListener("keydown", h), () => {
|
|
353
|
+
document.removeEventListener("mousedown", p), document.removeEventListener("keydown", h);
|
|
354
354
|
};
|
|
355
355
|
}, [d]);
|
|
356
356
|
const g = (p) => {
|
|
357
|
-
p.stopPropagation(), !o && v((
|
|
358
|
-
},
|
|
357
|
+
p.stopPropagation(), !o && v((h) => !h);
|
|
358
|
+
}, w = () => v(!1);
|
|
359
359
|
return /* @__PURE__ */ c("div", { ref: m, className: i("relative inline-flex", a), children: [
|
|
360
360
|
/* @__PURE__ */ e(
|
|
361
361
|
"button",
|
|
@@ -384,7 +384,7 @@ const nt = ({
|
|
|
384
384
|
s
|
|
385
385
|
),
|
|
386
386
|
style: b,
|
|
387
|
-
children: typeof r == "function" ? r(
|
|
387
|
+
children: typeof r == "function" ? r(w) : r
|
|
388
388
|
}
|
|
389
389
|
)
|
|
390
390
|
] });
|
|
@@ -426,36 +426,36 @@ function cr({
|
|
|
426
426
|
title: b,
|
|
427
427
|
className: g
|
|
428
428
|
}) {
|
|
429
|
-
const
|
|
429
|
+
const w = l && !!v, p = s === "pill" ? "rounded-full" : "rounded-md", h = lr({ active: l, tone: n, shape: s, size: a, className: g }), C = /* @__PURE__ */ c(Ee, { children: [
|
|
430
430
|
r,
|
|
431
431
|
t,
|
|
432
|
-
o && /* @__PURE__ */ e(
|
|
433
|
-
] }),
|
|
432
|
+
o && /* @__PURE__ */ e(ee, { icon: Ae, size: "xs" })
|
|
433
|
+
] }), z = or({ shape: s, withClear: w }), P = w && /* @__PURE__ */ e(
|
|
434
434
|
"button",
|
|
435
435
|
{
|
|
436
436
|
type: "button",
|
|
437
437
|
"aria-label": m,
|
|
438
438
|
onClick: v,
|
|
439
439
|
className: i("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", p),
|
|
440
|
-
children: /* @__PURE__ */ e(
|
|
440
|
+
children: /* @__PURE__ */ e(ee, { icon: Se, size: "xs" })
|
|
441
441
|
}
|
|
442
442
|
);
|
|
443
|
-
return u ? /* @__PURE__ */ c("span", { className:
|
|
443
|
+
return u ? /* @__PURE__ */ c("span", { className: h, title: b, children: [
|
|
444
444
|
/* @__PURE__ */ e(
|
|
445
445
|
nt,
|
|
446
446
|
{
|
|
447
447
|
trigger: C,
|
|
448
448
|
rootClassName: "h-full",
|
|
449
|
-
triggerClassName: i(
|
|
449
|
+
triggerClassName: i(z, "h-full"),
|
|
450
450
|
className: i("min-w-menu p-1.5", d),
|
|
451
451
|
children: u
|
|
452
452
|
}
|
|
453
453
|
),
|
|
454
|
-
|
|
455
|
-
] }) :
|
|
456
|
-
/* @__PURE__ */ e("button", { type: "button", onClick: f, className:
|
|
457
|
-
|
|
458
|
-
] }) : /* @__PURE__ */ e("button", { type: "button", title: b, onClick: f, className: i(
|
|
454
|
+
P
|
|
455
|
+
] }) : w ? /* @__PURE__ */ c("span", { className: h, title: b, children: [
|
|
456
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: f, className: z, children: C }),
|
|
457
|
+
P
|
|
458
|
+
] }) : /* @__PURE__ */ e("button", { type: "button", title: b, onClick: f, className: i(h, z), children: C });
|
|
459
459
|
}
|
|
460
460
|
const ir = {
|
|
461
461
|
xs: "text-xs",
|
|
@@ -629,7 +629,7 @@ function st({
|
|
|
629
629
|
xr[s],
|
|
630
630
|
m && "cursor-not-allowed opacity-50"
|
|
631
631
|
),
|
|
632
|
-
children: /* @__PURE__ */ e(
|
|
632
|
+
children: /* @__PURE__ */ e(Ae, { className: "size-icon-md" })
|
|
633
633
|
}
|
|
634
634
|
),
|
|
635
635
|
children: (b) => /* @__PURE__ */ e(Ee, { children: l.map((g) => /* @__PURE__ */ c(
|
|
@@ -685,14 +685,14 @@ const br = {
|
|
|
685
685
|
id: d,
|
|
686
686
|
...v
|
|
687
687
|
}, m) => {
|
|
688
|
-
const f =
|
|
689
|
-
(
|
|
690
|
-
|
|
688
|
+
const f = ae.useId(), b = d || `checkbox-${f}`, g = !!n, w = ae.useRef(null), p = ae.useCallback(
|
|
689
|
+
(h) => {
|
|
690
|
+
w.current = h, typeof m == "function" ? m(h) : m && typeof m == "object" && (m.current = h);
|
|
691
691
|
},
|
|
692
692
|
[m]
|
|
693
693
|
);
|
|
694
|
-
return
|
|
695
|
-
|
|
694
|
+
return ae.useEffect(() => {
|
|
695
|
+
w.current && (w.current.indeterminate = a);
|
|
696
696
|
}, [a]), /* @__PURE__ */ c("div", { className: i("flex flex-col", l), children: [
|
|
697
697
|
/* @__PURE__ */ c("div", { className: i("flex items-center gap-3", gr[s]), children: [
|
|
698
698
|
/* @__PURE__ */ e(
|
|
@@ -787,14 +787,14 @@ const vr = {
|
|
|
787
787
|
children: f,
|
|
788
788
|
...b
|
|
789
789
|
}) => {
|
|
790
|
-
const g = v || Cr(t),
|
|
790
|
+
const g = v || Cr(t), w = t === "caption", p = t === "label", h = t === "code", C = i(
|
|
791
791
|
"font-sans",
|
|
792
792
|
// Variant — caption and label pin their own size/weight
|
|
793
|
-
|
|
793
|
+
w && "text-xs text-text-subtle",
|
|
794
794
|
p && "text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
795
|
-
|
|
795
|
+
h && "font-mono text-sm rounded-sm bg-surface-hover px-1 py-0.5",
|
|
796
796
|
// Size — only where the variant does not pin it
|
|
797
|
-
!
|
|
797
|
+
!w && !p && !h && vr[r],
|
|
798
798
|
// Weight — label owns its weight
|
|
799
799
|
!p && yr[n],
|
|
800
800
|
Nr[s],
|
|
@@ -830,12 +830,12 @@ function ds({
|
|
|
830
830
|
removeLabel: m = "Remove",
|
|
831
831
|
tooLargeLabel: f = "That image is too large."
|
|
832
832
|
}) {
|
|
833
|
-
const b =
|
|
834
|
-
if (!
|
|
835
|
-
|
|
836
|
-
const C = await Er(
|
|
833
|
+
const b = ne(null), [g, w] = R(null), p = async (h) => {
|
|
834
|
+
if (!h) return;
|
|
835
|
+
w(null);
|
|
836
|
+
const C = await Er(h, s);
|
|
837
837
|
if (a && Sr(C) > a) {
|
|
838
|
-
|
|
838
|
+
w(f);
|
|
839
839
|
return;
|
|
840
840
|
}
|
|
841
841
|
n(C);
|
|
@@ -872,7 +872,7 @@ function ds({
|
|
|
872
872
|
variant: "ghost",
|
|
873
873
|
disabled: u,
|
|
874
874
|
onClick: () => {
|
|
875
|
-
|
|
875
|
+
w(null), n(void 0);
|
|
876
876
|
},
|
|
877
877
|
children: m
|
|
878
878
|
}
|
|
@@ -888,7 +888,7 @@ function ds({
|
|
|
888
888
|
type: "file",
|
|
889
889
|
accept: "image/png,image/jpeg,image/webp",
|
|
890
890
|
className: "hidden",
|
|
891
|
-
onChange: (
|
|
891
|
+
onChange: (h) => void p(h.target.files?.[0])
|
|
892
892
|
}
|
|
893
893
|
)
|
|
894
894
|
] });
|
|
@@ -915,7 +915,7 @@ function Er(t, r) {
|
|
|
915
915
|
}, a.onerror = s, a.readAsDataURL(t);
|
|
916
916
|
});
|
|
917
917
|
}
|
|
918
|
-
const zr = () => /* @__PURE__ */ e(
|
|
918
|
+
const zr = () => /* @__PURE__ */ e(ee, { icon: Mt, size: "md", color: "current" }), Mr = () => /* @__PURE__ */ e(ee, { icon: ze, size: "md", color: "current" }), Tr = () => /* @__PURE__ */ e(ee, { icon: Le, size: "md", color: "current" }), Be = ve(({
|
|
919
919
|
value: t,
|
|
920
920
|
onChange: r,
|
|
921
921
|
placeholder: n = "Select date",
|
|
@@ -928,47 +928,47 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
928
928
|
format: v = "MM/dd/yyyy",
|
|
929
929
|
withTime: m = !1
|
|
930
930
|
}, f) => {
|
|
931
|
-
const [b, g] =
|
|
932
|
-
|
|
933
|
-
const
|
|
934
|
-
|
|
931
|
+
const [b, g] = R(!1), [w, p] = R(() => t || /* @__PURE__ */ new Date()), h = ne(null), C = ne(null), z = Pe(b, C);
|
|
932
|
+
X(() => {
|
|
933
|
+
const y = (x) => {
|
|
934
|
+
h.current && !h.current.contains(x.target) && g(!1);
|
|
935
935
|
};
|
|
936
|
-
return b && document.addEventListener("mousedown",
|
|
937
|
-
document.removeEventListener("mousedown",
|
|
936
|
+
return b && document.addEventListener("mousedown", y), () => {
|
|
937
|
+
document.removeEventListener("mousedown", y);
|
|
938
938
|
};
|
|
939
939
|
}, [b]);
|
|
940
|
-
const
|
|
941
|
-
if (!
|
|
942
|
-
const
|
|
943
|
-
return m ? `${
|
|
944
|
-
},
|
|
945
|
-
const [
|
|
946
|
-
if (Number.isNaN(
|
|
947
|
-
const
|
|
948
|
-
|
|
949
|
-
},
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
const
|
|
953
|
-
for (let
|
|
954
|
-
|
|
955
|
-
return
|
|
956
|
-
},
|
|
957
|
-
if (
|
|
940
|
+
const P = (y) => {
|
|
941
|
+
if (!y) return "";
|
|
942
|
+
const x = y.getDate().toString().padStart(2, "0"), S = (y.getMonth() + 1).toString().padStart(2, "0"), D = y.getFullYear(), E = v === "dd/MM/yyyy" ? `${x}/${S}/${D}` : v === "yyyy-MM-dd" ? `${D}-${S}-${x}` : `${S}/${x}/${D}`;
|
|
943
|
+
return m ? `${E} ${_(y)}` : E;
|
|
944
|
+
}, _ = (y) => `${y.getHours().toString().padStart(2, "0")}:${y.getMinutes().toString().padStart(2, "0")}`, K = (y) => {
|
|
945
|
+
const [x, S] = y.split(":").map(Number);
|
|
946
|
+
if (Number.isNaN(x) || Number.isNaN(S)) return;
|
|
947
|
+
const D = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
948
|
+
D.setHours(x, S, 0, 0), r?.(D);
|
|
949
|
+
}, U = () => {
|
|
950
|
+
const y = w.getFullYear(), x = w.getMonth(), S = new Date(y, x, 1), D = new Date(S);
|
|
951
|
+
D.setDate(D.getDate() - S.getDay());
|
|
952
|
+
const E = [], A = new Date(D);
|
|
953
|
+
for (let $ = 0; $ < 42; $++)
|
|
954
|
+
E.push(new Date(A)), A.setDate(A.getDate() + 1);
|
|
955
|
+
return E;
|
|
956
|
+
}, j = (y) => {
|
|
957
|
+
if (y.getMonth() === w.getMonth() && !(u && y < u) && !(d && y > d)) {
|
|
958
958
|
if (m) {
|
|
959
|
-
const
|
|
960
|
-
|
|
959
|
+
const S = new Date(y);
|
|
960
|
+
S.setHours(t?.getHours() ?? 0, t?.getMinutes() ?? 0, 0, 0), r?.(S);
|
|
961
961
|
return;
|
|
962
962
|
}
|
|
963
|
-
r?.(
|
|
963
|
+
r?.(y), g(!1);
|
|
964
964
|
}
|
|
965
|
-
},
|
|
966
|
-
p(new Date(
|
|
967
|
-
},
|
|
968
|
-
p(new Date(
|
|
969
|
-
},
|
|
965
|
+
}, B = () => {
|
|
966
|
+
p(new Date(w.getFullYear(), w.getMonth() - 1, 1));
|
|
967
|
+
}, W = () => {
|
|
968
|
+
p(new Date(w.getFullYear(), w.getMonth() + 1, 1));
|
|
969
|
+
}, Z = () => {
|
|
970
970
|
r?.(null), g(!1);
|
|
971
|
-
},
|
|
971
|
+
}, J = i(
|
|
972
972
|
"w-full border border-border-strong rounded-tile transition-colors duration-fast",
|
|
973
973
|
"bg-surface text-text",
|
|
974
974
|
"placeholder:text-text-muted",
|
|
@@ -981,7 +981,7 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
981
981
|
"h-control-md w-full px-3 text-base": l === "full"
|
|
982
982
|
},
|
|
983
983
|
o
|
|
984
|
-
), de =
|
|
984
|
+
), de = U(), Y = [
|
|
985
985
|
"January",
|
|
986
986
|
"February",
|
|
987
987
|
"March",
|
|
@@ -995,20 +995,20 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
995
995
|
"November",
|
|
996
996
|
"December"
|
|
997
997
|
];
|
|
998
|
-
return /* @__PURE__ */ c("div", { ref:
|
|
998
|
+
return /* @__PURE__ */ c("div", { ref: h, className: "relative", children: [
|
|
999
999
|
/* @__PURE__ */ c("div", { ref: C, className: "relative", children: [
|
|
1000
1000
|
/* @__PURE__ */ e(
|
|
1001
1001
|
"input",
|
|
1002
1002
|
{
|
|
1003
1003
|
ref: f,
|
|
1004
1004
|
type: "text",
|
|
1005
|
-
value:
|
|
1005
|
+
value: P(t ?? null),
|
|
1006
1006
|
placeholder: n,
|
|
1007
1007
|
disabled: s,
|
|
1008
1008
|
required: a,
|
|
1009
1009
|
readOnly: !0,
|
|
1010
1010
|
onClick: () => !s && g(!b),
|
|
1011
|
-
className: i(
|
|
1011
|
+
className: i(J, "pr-10 cursor-pointer")
|
|
1012
1012
|
}
|
|
1013
1013
|
),
|
|
1014
1014
|
/* @__PURE__ */ e(
|
|
@@ -1022,50 +1022,50 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
1022
1022
|
}
|
|
1023
1023
|
)
|
|
1024
1024
|
] }),
|
|
1025
|
-
b && /* @__PURE__ */ c("div", { style:
|
|
1025
|
+
b && /* @__PURE__ */ c("div", { style: z, className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
1026
1026
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
|
|
1027
1027
|
/* @__PURE__ */ e(
|
|
1028
1028
|
"button",
|
|
1029
1029
|
{
|
|
1030
|
-
onClick:
|
|
1030
|
+
onClick: B,
|
|
1031
1031
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
1032
1032
|
children: /* @__PURE__ */ e(Mr, {})
|
|
1033
1033
|
}
|
|
1034
1034
|
),
|
|
1035
1035
|
/* @__PURE__ */ c("h3", { className: "text-sm font-medium text-text", children: [
|
|
1036
|
-
w
|
|
1036
|
+
Y[w.getMonth()],
|
|
1037
1037
|
" ",
|
|
1038
|
-
|
|
1038
|
+
w.getFullYear()
|
|
1039
1039
|
] }),
|
|
1040
1040
|
/* @__PURE__ */ e(
|
|
1041
1041
|
"button",
|
|
1042
1042
|
{
|
|
1043
|
-
onClick:
|
|
1043
|
+
onClick: W,
|
|
1044
1044
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
1045
1045
|
children: /* @__PURE__ */ e(Tr, {})
|
|
1046
1046
|
}
|
|
1047
1047
|
)
|
|
1048
1048
|
] }),
|
|
1049
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((
|
|
1050
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: de.map((
|
|
1051
|
-
const
|
|
1049
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((y) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: y }, y)) }),
|
|
1050
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: de.map((y, x) => {
|
|
1051
|
+
const S = y.getMonth() === w.getMonth(), D = t && y.toDateString() === t.toDateString(), E = y.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), A = !S || u && y < u || d && y > d;
|
|
1052
1052
|
return /* @__PURE__ */ e(
|
|
1053
1053
|
"button",
|
|
1054
1054
|
{
|
|
1055
|
-
onClick: () => !
|
|
1056
|
-
disabled:
|
|
1055
|
+
onClick: () => !A && j(y),
|
|
1056
|
+
disabled: A,
|
|
1057
1057
|
className: i(
|
|
1058
1058
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
1059
1059
|
{
|
|
1060
|
-
"text-text hover:bg-surface-hover":
|
|
1061
|
-
"bg-accent text-accent-fg":
|
|
1062
|
-
"bg-surface-hover text-text":
|
|
1063
|
-
"text-text-muted cursor-not-allowed":
|
|
1060
|
+
"text-text hover:bg-surface-hover": S && !D && !A,
|
|
1061
|
+
"bg-accent text-accent-fg": D,
|
|
1062
|
+
"bg-surface-hover text-text": E && !D,
|
|
1063
|
+
"text-text-muted cursor-not-allowed": A
|
|
1064
1064
|
}
|
|
1065
1065
|
),
|
|
1066
|
-
children:
|
|
1066
|
+
children: y.getDate()
|
|
1067
1067
|
},
|
|
1068
|
-
|
|
1068
|
+
x
|
|
1069
1069
|
);
|
|
1070
1070
|
}) }),
|
|
1071
1071
|
m && /* @__PURE__ */ c("div", { className: "mt-3 flex items-center gap-2 border-t border-border pt-3", children: [
|
|
@@ -1075,8 +1075,8 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
1075
1075
|
{
|
|
1076
1076
|
id: "datepicker-time",
|
|
1077
1077
|
type: "time",
|
|
1078
|
-
value: t ?
|
|
1079
|
-
onChange: (
|
|
1078
|
+
value: t ? _(t) : "",
|
|
1079
|
+
onChange: (y) => K(y.target.value),
|
|
1080
1080
|
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"
|
|
1081
1081
|
}
|
|
1082
1082
|
)
|
|
@@ -1085,7 +1085,7 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
1085
1085
|
/* @__PURE__ */ e(
|
|
1086
1086
|
"button",
|
|
1087
1087
|
{
|
|
1088
|
-
onClick:
|
|
1088
|
+
onClick: Z,
|
|
1089
1089
|
className: "text-sm text-text-muted hover:text-text",
|
|
1090
1090
|
children: "Clear"
|
|
1091
1091
|
}
|
|
@@ -1101,12 +1101,12 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
1101
1101
|
] })
|
|
1102
1102
|
] })
|
|
1103
1103
|
] });
|
|
1104
|
-
}),
|
|
1104
|
+
}), $r = {
|
|
1105
1105
|
sm: "h-control-sm px-3 text-sm",
|
|
1106
1106
|
md: "h-control-md px-3 text-sm",
|
|
1107
1107
|
lg: "h-control-lg px-3 text-base",
|
|
1108
1108
|
full: "h-control-md w-full px-3 text-sm"
|
|
1109
|
-
}, Me = Jt,
|
|
1109
|
+
}, Me = Jt, De = ve(
|
|
1110
1110
|
({
|
|
1111
1111
|
label: t,
|
|
1112
1112
|
helperText: r,
|
|
@@ -1122,84 +1122,84 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
1122
1122
|
id: f,
|
|
1123
1123
|
searchable: b,
|
|
1124
1124
|
multiple: g,
|
|
1125
|
-
value:
|
|
1125
|
+
value: w,
|
|
1126
1126
|
onChange: p,
|
|
1127
|
-
allowCreate:
|
|
1127
|
+
allowCreate: h,
|
|
1128
1128
|
onCreateOption: C,
|
|
1129
|
-
...
|
|
1130
|
-
},
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1129
|
+
...z
|
|
1130
|
+
}, P) => {
|
|
1131
|
+
const _ = f || `select-${Math.random().toString(36).substr(2, 9)}`, K = !!n, [U, j] = ae.useState(!1), [B, W] = ae.useState(""), Z = ae.useRef(null), J = ae.useRef(null), de = Pe(U, J, { matchWidth: !0 }), [Y, y] = ae.useState(o);
|
|
1132
|
+
ae.useImperativeHandle(P, () => Z.current), ae.useEffect(() => {
|
|
1133
|
+
const L = (k) => {
|
|
1134
|
+
Z.current && !Z.current.contains(k.target) && j(!1);
|
|
1135
1135
|
};
|
|
1136
|
-
return document.addEventListener("mousedown",
|
|
1136
|
+
return document.addEventListener("mousedown", L), () => document.removeEventListener("mousedown", L);
|
|
1137
1137
|
}, []);
|
|
1138
|
-
const
|
|
1139
|
-
(
|
|
1140
|
-
(
|
|
1138
|
+
const x = ae.useCallback(
|
|
1139
|
+
(L, k) => L.some(
|
|
1140
|
+
(M) => Me(M.value) === Me(k) || Me(M.label) === Me(k)
|
|
1141
1141
|
),
|
|
1142
1142
|
[]
|
|
1143
|
-
),
|
|
1144
|
-
(
|
|
1145
|
-
const
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1143
|
+
), S = ae.useCallback(
|
|
1144
|
+
(L, k) => {
|
|
1145
|
+
const M = [...L], G = (O) => {
|
|
1146
|
+
const N = _e(O).trim();
|
|
1147
|
+
N && (x(M, N) || M.push({ value: N, label: N }));
|
|
1148
1148
|
};
|
|
1149
|
-
return Array.isArray(
|
|
1149
|
+
return Array.isArray(k) ? k.forEach(G) : G(k), M;
|
|
1150
1150
|
},
|
|
1151
|
-
[
|
|
1151
|
+
[x]
|
|
1152
1152
|
);
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
const
|
|
1156
|
-
return
|
|
1157
|
-
!
|
|
1158
|
-
}), k
|
|
1153
|
+
ae.useEffect(() => {
|
|
1154
|
+
y((L) => {
|
|
1155
|
+
const k = [...o];
|
|
1156
|
+
return L.forEach((M) => {
|
|
1157
|
+
!x(k, M.value) && !x(k, M.label) && k.push(M);
|
|
1158
|
+
}), S(k, w);
|
|
1159
1159
|
});
|
|
1160
|
-
}, [o,
|
|
1161
|
-
const
|
|
1162
|
-
() => Array.isArray(
|
|
1163
|
-
[
|
|
1164
|
-
),
|
|
1160
|
+
}, [o, w, S, x]);
|
|
1161
|
+
const D = ae.useMemo(
|
|
1162
|
+
() => Array.isArray(w) ? w.map(_e) : w == null ? void 0 : _e(w),
|
|
1163
|
+
[w]
|
|
1164
|
+
), E = (L) => {
|
|
1165
1165
|
if (g) {
|
|
1166
|
-
const
|
|
1167
|
-
p?.(
|
|
1166
|
+
const k = Array.isArray(D) ? D : [], M = k.includes(L) ? k.filter((G) => G !== L) : [...k, L];
|
|
1167
|
+
p?.(M);
|
|
1168
1168
|
} else
|
|
1169
|
-
p?.(
|
|
1170
|
-
},
|
|
1171
|
-
(
|
|
1172
|
-
) : [],
|
|
1173
|
-
(
|
|
1174
|
-
) :
|
|
1175
|
-
const
|
|
1176
|
-
if (!
|
|
1177
|
-
const
|
|
1178
|
-
value:
|
|
1179
|
-
label:
|
|
1169
|
+
p?.(L), j(!1), W("");
|
|
1170
|
+
}, A = g ? null : Y.find((L) => L.value === D), $ = g ? Y.filter(
|
|
1171
|
+
(L) => Array.isArray(D) && D.includes(L.value)
|
|
1172
|
+
) : [], oe = b && B ? Y.filter(
|
|
1173
|
+
(L) => L.label.toLowerCase().includes(B.toLowerCase())
|
|
1174
|
+
) : Y, ce = !!h && !!b && !!B.trim() && !x(Y, B), q = (L) => {
|
|
1175
|
+
const k = L.trim();
|
|
1176
|
+
if (!k) return;
|
|
1177
|
+
const M = C?.(k) ?? {
|
|
1178
|
+
value: k,
|
|
1179
|
+
label: k
|
|
1180
1180
|
};
|
|
1181
|
-
if (
|
|
1182
|
-
|
|
1181
|
+
if (x(Y, M.value) || x(Y, M.label)) {
|
|
1182
|
+
E(M.value), W(""), g || j(!1);
|
|
1183
1183
|
return;
|
|
1184
1184
|
}
|
|
1185
|
-
|
|
1186
|
-
},
|
|
1185
|
+
y((G) => [...G, M]), E(M.value), W(""), g || j(!1);
|
|
1186
|
+
}, H = () => g ? $.length > 0 ? $.map((L) => L.label).join(", ") : u || "Select options" : A?.label || u || "Select an option";
|
|
1187
1187
|
return /* @__PURE__ */ c(
|
|
1188
1188
|
"div",
|
|
1189
1189
|
{
|
|
1190
|
-
ref:
|
|
1190
|
+
ref: Z,
|
|
1191
1191
|
className: i(
|
|
1192
1192
|
"relative flex flex-col",
|
|
1193
1193
|
a && "w-full",
|
|
1194
1194
|
d
|
|
1195
1195
|
),
|
|
1196
|
-
...
|
|
1196
|
+
...z,
|
|
1197
1197
|
children: [
|
|
1198
1198
|
t && /* @__PURE__ */ e(
|
|
1199
1199
|
"label",
|
|
1200
1200
|
{
|
|
1201
|
-
htmlFor:
|
|
1202
|
-
onClick: () =>
|
|
1201
|
+
htmlFor: _,
|
|
1202
|
+
onClick: () => j(!U),
|
|
1203
1203
|
className: i(
|
|
1204
1204
|
"block text-xs font-semibold uppercase tracking-label mb-1.5",
|
|
1205
1205
|
K ? "text-danger-fg" : "text-text-muted",
|
|
@@ -1212,45 +1212,45 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
1212
1212
|
/* @__PURE__ */ c(
|
|
1213
1213
|
"button",
|
|
1214
1214
|
{
|
|
1215
|
-
ref:
|
|
1215
|
+
ref: J,
|
|
1216
1216
|
type: "button",
|
|
1217
|
-
id:
|
|
1217
|
+
id: _,
|
|
1218
1218
|
disabled: l,
|
|
1219
|
-
onClick: () =>
|
|
1219
|
+
onClick: () => j(!U),
|
|
1220
1220
|
className: i(
|
|
1221
1221
|
"flex w-full items-center justify-between gap-2 rounded-tile border transition-colors duration-fast text-left",
|
|
1222
1222
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
1223
1223
|
"disabled:cursor-not-allowed disabled:bg-surface-hover disabled:text-text-disabled",
|
|
1224
1224
|
"bg-surface",
|
|
1225
|
-
|
|
1225
|
+
$r[s],
|
|
1226
1226
|
K ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border-strong text-text",
|
|
1227
1227
|
m
|
|
1228
1228
|
),
|
|
1229
1229
|
children: [
|
|
1230
|
-
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children:
|
|
1230
|
+
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children: H() }),
|
|
1231
1231
|
/* @__PURE__ */ e(
|
|
1232
1232
|
Tt,
|
|
1233
1233
|
{
|
|
1234
1234
|
size: 16,
|
|
1235
1235
|
className: i(
|
|
1236
1236
|
"shrink-0 opacity-60 transition-transform duration-fast",
|
|
1237
|
-
|
|
1237
|
+
U && "rotate-180"
|
|
1238
1238
|
)
|
|
1239
1239
|
}
|
|
1240
1240
|
)
|
|
1241
1241
|
]
|
|
1242
1242
|
}
|
|
1243
1243
|
),
|
|
1244
|
-
|
|
1244
|
+
U && /* @__PURE__ */ c("div", { style: de, className: "fixed z-overlay flex flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-overlay", children: [
|
|
1245
1245
|
b && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
1246
1246
|
"input",
|
|
1247
1247
|
{
|
|
1248
1248
|
type: "text",
|
|
1249
1249
|
placeholder: "Search...",
|
|
1250
|
-
value:
|
|
1251
|
-
onChange: (
|
|
1252
|
-
onKeyDown: (
|
|
1253
|
-
|
|
1250
|
+
value: B,
|
|
1251
|
+
onChange: (L) => W(L.target.value),
|
|
1252
|
+
onKeyDown: (L) => {
|
|
1253
|
+
L.key === "Enter" && ce && (L.preventDefault(), q(B));
|
|
1254
1254
|
},
|
|
1255
1255
|
className: i(
|
|
1256
1256
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
@@ -1258,17 +1258,17 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
1258
1258
|
)
|
|
1259
1259
|
}
|
|
1260
1260
|
) }),
|
|
1261
|
-
|
|
1261
|
+
ce && /* @__PURE__ */ c(
|
|
1262
1262
|
"div",
|
|
1263
1263
|
{
|
|
1264
1264
|
className: i(
|
|
1265
1265
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
1266
1266
|
"text-info-fg hover:bg-surface-hover"
|
|
1267
1267
|
),
|
|
1268
|
-
onClick: () =>
|
|
1268
|
+
onClick: () => q(B),
|
|
1269
1269
|
children: [
|
|
1270
1270
|
"+: “",
|
|
1271
|
-
|
|
1271
|
+
B.trim(),
|
|
1272
1272
|
"”"
|
|
1273
1273
|
]
|
|
1274
1274
|
}
|
|
@@ -1279,37 +1279,37 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
1279
1279
|
{
|
|
1280
1280
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
1281
1281
|
onClick: () => {
|
|
1282
|
-
p?.(""),
|
|
1282
|
+
p?.(""), j(!1);
|
|
1283
1283
|
},
|
|
1284
1284
|
children: u
|
|
1285
1285
|
}
|
|
1286
1286
|
),
|
|
1287
|
-
|
|
1288
|
-
const
|
|
1287
|
+
oe.map((L) => {
|
|
1288
|
+
const k = g ? Array.isArray(D) && D.includes(L.value) : D === L.value;
|
|
1289
1289
|
return /* @__PURE__ */ e(
|
|
1290
1290
|
"li",
|
|
1291
1291
|
{
|
|
1292
|
-
onClick: () => !
|
|
1292
|
+
onClick: () => !L.disabled && E(L.value),
|
|
1293
1293
|
className: i(
|
|
1294
1294
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
1295
1295
|
"text-text",
|
|
1296
|
-
|
|
1297
|
-
|
|
1296
|
+
L.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-surface-hover",
|
|
1297
|
+
k && "bg-accent-soft text-accent font-semibold"
|
|
1298
1298
|
),
|
|
1299
1299
|
children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
1300
1300
|
g && /* @__PURE__ */ e(
|
|
1301
1301
|
"input",
|
|
1302
1302
|
{
|
|
1303
1303
|
type: "checkbox",
|
|
1304
|
-
checked:
|
|
1304
|
+
checked: k,
|
|
1305
1305
|
readOnly: !0,
|
|
1306
1306
|
className: "mr-3 h-4 w-4 rounded border-border [&:not(:checked)]:bg-surface-input text-accent "
|
|
1307
1307
|
}
|
|
1308
1308
|
),
|
|
1309
|
-
/* @__PURE__ */ e("span", { children:
|
|
1309
|
+
/* @__PURE__ */ e("span", { children: L.label })
|
|
1310
1310
|
] })
|
|
1311
1311
|
},
|
|
1312
|
-
|
|
1312
|
+
L.value
|
|
1313
1313
|
);
|
|
1314
1314
|
})
|
|
1315
1315
|
] })
|
|
@@ -1330,8 +1330,8 @@ const zr = () => /* @__PURE__ */ e(Q, { icon: Mt, size: "md", color: "current" }
|
|
|
1330
1330
|
);
|
|
1331
1331
|
}
|
|
1332
1332
|
);
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1333
|
+
De.displayName = "Select";
|
|
1334
|
+
const _r = {
|
|
1335
1335
|
sm: "h-control-sm px-3 text-sm",
|
|
1336
1336
|
md: "h-control-md px-3 text-base",
|
|
1337
1337
|
lg: "h-control-lg px-3 text-base",
|
|
@@ -1352,7 +1352,7 @@ const $r = {
|
|
|
1352
1352
|
id: f,
|
|
1353
1353
|
...b
|
|
1354
1354
|
}, g) => {
|
|
1355
|
-
const
|
|
1355
|
+
const w = ae.useId(), p = f || `textfield-${w}`, h = !!n, C = n || r ? `${p}-description` : void 0;
|
|
1356
1356
|
return /* @__PURE__ */ c("div", { className: i("flex flex-col", a && "w-full", d), children: [
|
|
1357
1357
|
t && /* @__PURE__ */ e(
|
|
1358
1358
|
"label",
|
|
@@ -1360,7 +1360,7 @@ const $r = {
|
|
|
1360
1360
|
htmlFor: p,
|
|
1361
1361
|
className: i(
|
|
1362
1362
|
at,
|
|
1363
|
-
|
|
1363
|
+
h ? "text-danger-fg" : "text-text-muted",
|
|
1364
1364
|
v
|
|
1365
1365
|
),
|
|
1366
1366
|
children: t
|
|
@@ -1373,14 +1373,14 @@ const $r = {
|
|
|
1373
1373
|
{
|
|
1374
1374
|
ref: g,
|
|
1375
1375
|
id: p,
|
|
1376
|
-
"aria-invalid":
|
|
1376
|
+
"aria-invalid": h || void 0,
|
|
1377
1377
|
"aria-describedby": C,
|
|
1378
1378
|
className: i(
|
|
1379
1379
|
lt,
|
|
1380
|
-
|
|
1380
|
+
_r[s],
|
|
1381
1381
|
l && "pl-9",
|
|
1382
1382
|
(o || u) && "pr-9",
|
|
1383
|
-
ot(
|
|
1383
|
+
ot(h),
|
|
1384
1384
|
m
|
|
1385
1385
|
),
|
|
1386
1386
|
...b
|
|
@@ -1398,7 +1398,7 @@ const $r = {
|
|
|
1398
1398
|
"p",
|
|
1399
1399
|
{
|
|
1400
1400
|
id: C,
|
|
1401
|
-
className: i("mt-1 text-xs",
|
|
1401
|
+
className: i("mt-1 text-xs", h ? "text-danger-fg" : "text-text-subtle"),
|
|
1402
1402
|
children: n || r
|
|
1403
1403
|
}
|
|
1404
1404
|
)
|
|
@@ -1406,7 +1406,7 @@ const $r = {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
);
|
|
1408
1408
|
Ce.displayName = "TextField";
|
|
1409
|
-
function
|
|
1409
|
+
function Dr({
|
|
1410
1410
|
value: t,
|
|
1411
1411
|
onChange: r,
|
|
1412
1412
|
onListFolders: n,
|
|
@@ -1416,8 +1416,8 @@ function Ar({
|
|
|
1416
1416
|
templatePlaceholder: o,
|
|
1417
1417
|
showTemplate: u = !0
|
|
1418
1418
|
}) {
|
|
1419
|
-
const [d, v] =
|
|
1420
|
-
|
|
1419
|
+
const [d, v] = R([]);
|
|
1420
|
+
X(() => {
|
|
1421
1421
|
let f = !0;
|
|
1422
1422
|
return Promise.resolve(n?.()).then((b) => {
|
|
1423
1423
|
f && b && v(b.data ?? []);
|
|
@@ -1429,7 +1429,7 @@ function Ar({
|
|
|
1429
1429
|
const m = t ?? {};
|
|
1430
1430
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
1431
1431
|
/* @__PURE__ */ e(
|
|
1432
|
-
|
|
1432
|
+
De,
|
|
1433
1433
|
{
|
|
1434
1434
|
size: a,
|
|
1435
1435
|
fullWidth: !0,
|
|
@@ -1451,7 +1451,7 @@ function Ar({
|
|
|
1451
1451
|
)
|
|
1452
1452
|
] });
|
|
1453
1453
|
}
|
|
1454
|
-
const Ne = (...t) => t.filter(Boolean).join(" "),
|
|
1454
|
+
const Ne = (...t) => t.filter(Boolean).join(" "), Ar = (t) => /* @__PURE__ */ e(Ie, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Lr = (t) => /* @__PURE__ */ e(Ae, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Ir = {
|
|
1455
1455
|
sm: "h-control-sm px-3 text-sm",
|
|
1456
1456
|
md: "h-control-md px-3 text-base",
|
|
1457
1457
|
lg: "h-control-lg px-3 text-base",
|
|
@@ -1468,7 +1468,7 @@ const Ne = (...t) => t.filter(Boolean).join(" "), Dr = (t) => /* @__PURE__ */ e(
|
|
|
1468
1468
|
error: n,
|
|
1469
1469
|
size: s = "md",
|
|
1470
1470
|
fullWidth: a = !1,
|
|
1471
|
-
startIcon: l = /* @__PURE__ */ e(
|
|
1471
|
+
startIcon: l = /* @__PURE__ */ e(Ar, {}),
|
|
1472
1472
|
loading: o = !1,
|
|
1473
1473
|
containerClassName: u,
|
|
1474
1474
|
labelClassName: d,
|
|
@@ -1477,55 +1477,55 @@ const Ne = (...t) => t.filter(Boolean).join(" "), Dr = (t) => /* @__PURE__ */ e(
|
|
|
1477
1477
|
options: f,
|
|
1478
1478
|
onRemoteSearch: b,
|
|
1479
1479
|
onSelect: g,
|
|
1480
|
-
debounceTime:
|
|
1480
|
+
debounceTime: w = 500,
|
|
1481
1481
|
showAllOnOpen: p = !1,
|
|
1482
|
-
value:
|
|
1482
|
+
value: h,
|
|
1483
1483
|
onChange: C,
|
|
1484
|
-
...
|
|
1485
|
-
},
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
}, [
|
|
1490
|
-
const
|
|
1491
|
-
if (p && !
|
|
1492
|
-
const
|
|
1484
|
+
...z
|
|
1485
|
+
}, P) => {
|
|
1486
|
+
const _ = m || `searchfield-${Math.random().toString(36).substr(2, 9)}`, K = !!n, U = ne(null), j = ne(null), [B, W] = R(h || ""), [Z, J] = R(!1), [de, Y] = R(!1), [y, x] = R(!1);
|
|
1487
|
+
X(() => {
|
|
1488
|
+
h !== void 0 && W(h);
|
|
1489
|
+
}, [h]);
|
|
1490
|
+
const S = pe(() => {
|
|
1491
|
+
if (p && !y || !B) return f;
|
|
1492
|
+
const q = String(B).toLowerCase();
|
|
1493
1493
|
return f.filter(
|
|
1494
|
-
(
|
|
1494
|
+
(H) => String(H.label).toLowerCase().includes(q)
|
|
1495
1495
|
);
|
|
1496
|
-
}, [
|
|
1497
|
-
|
|
1498
|
-
if (!b || !
|
|
1499
|
-
|
|
1496
|
+
}, [B, f, p, y]);
|
|
1497
|
+
X(() => {
|
|
1498
|
+
if (!b || !B) {
|
|
1499
|
+
Y(!1);
|
|
1500
1500
|
return;
|
|
1501
1501
|
}
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1502
|
+
const q = setTimeout(async () => {
|
|
1503
|
+
Y(!0);
|
|
1504
1504
|
try {
|
|
1505
|
-
await b(String(
|
|
1506
|
-
} catch (
|
|
1507
|
-
console.error("Remote search failed:",
|
|
1505
|
+
await b(String(B));
|
|
1506
|
+
} catch (H) {
|
|
1507
|
+
console.error("Remote search failed:", H);
|
|
1508
1508
|
} finally {
|
|
1509
|
-
|
|
1509
|
+
Y(!1);
|
|
1510
1510
|
}
|
|
1511
|
-
},
|
|
1511
|
+
}, w);
|
|
1512
1512
|
return () => {
|
|
1513
|
-
clearTimeout(
|
|
1513
|
+
clearTimeout(q), Y(!1);
|
|
1514
1514
|
};
|
|
1515
|
-
}, [
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1515
|
+
}, [B, w, b]), X(() => {
|
|
1516
|
+
const q = (H) => {
|
|
1517
|
+
U.current && !U.current.contains(H.target) && J(!1);
|
|
1518
1518
|
};
|
|
1519
|
-
return document.addEventListener("mousedown",
|
|
1519
|
+
return document.addEventListener("mousedown", q), () => document.removeEventListener("mousedown", q);
|
|
1520
1520
|
}, []);
|
|
1521
|
-
const
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1524
|
-
},
|
|
1525
|
-
|
|
1526
|
-
},
|
|
1527
|
-
(f.length > 0 || b) && (
|
|
1528
|
-
},
|
|
1521
|
+
const D = (q) => {
|
|
1522
|
+
const H = q.target.value;
|
|
1523
|
+
W(H), J(!0), x(!0), C && C(q);
|
|
1524
|
+
}, E = (q) => {
|
|
1525
|
+
W(q.label), J(!1), x(!1), g && g(q.value);
|
|
1526
|
+
}, A = () => {
|
|
1527
|
+
(f.length > 0 || b) && (J(!0), x(!1));
|
|
1528
|
+
}, $ = o || de, oe = Z && (S.length > 0 || $), ce = pe(() => P || j, [P]);
|
|
1529
1529
|
return /* @__PURE__ */ c(
|
|
1530
1530
|
"div",
|
|
1531
1531
|
{
|
|
@@ -1535,12 +1535,12 @@ const Ne = (...t) => t.filter(Boolean).join(" "), Dr = (t) => /* @__PURE__ */ e(
|
|
|
1535
1535
|
u || "",
|
|
1536
1536
|
"relative"
|
|
1537
1537
|
),
|
|
1538
|
-
ref:
|
|
1538
|
+
ref: U,
|
|
1539
1539
|
children: [
|
|
1540
1540
|
t && /* @__PURE__ */ e(
|
|
1541
1541
|
"label",
|
|
1542
1542
|
{
|
|
1543
|
-
htmlFor:
|
|
1543
|
+
htmlFor: _,
|
|
1544
1544
|
className: Ne(
|
|
1545
1545
|
"block text-sm font-medium mb-1",
|
|
1546
1546
|
K ? "text-danger-fg" : "text-text",
|
|
@@ -1554,11 +1554,11 @@ const Ne = (...t) => t.filter(Boolean).join(" "), Dr = (t) => /* @__PURE__ */ e(
|
|
|
1554
1554
|
/* @__PURE__ */ e(
|
|
1555
1555
|
"input",
|
|
1556
1556
|
{
|
|
1557
|
-
ref:
|
|
1558
|
-
id:
|
|
1559
|
-
value:
|
|
1560
|
-
onChange:
|
|
1561
|
-
onFocus:
|
|
1557
|
+
ref: ce,
|
|
1558
|
+
id: _,
|
|
1559
|
+
value: B,
|
|
1560
|
+
onChange: D,
|
|
1561
|
+
onFocus: A,
|
|
1562
1562
|
className: Ne(
|
|
1563
1563
|
// Base styles
|
|
1564
1564
|
"block w-full rounded-tile border bg-surface-input transition-colors duration-fast ease-out",
|
|
@@ -1574,13 +1574,13 @@ const Ne = (...t) => t.filter(Boolean).join(" "), Dr = (t) => /* @__PURE__ */ e(
|
|
|
1574
1574
|
K ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border-strong text-text",
|
|
1575
1575
|
v || ""
|
|
1576
1576
|
),
|
|
1577
|
-
...
|
|
1577
|
+
...z
|
|
1578
1578
|
}
|
|
1579
1579
|
),
|
|
1580
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children:
|
|
1580
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: $ || o ? (
|
|
1581
1581
|
// Loading Spinner
|
|
1582
1582
|
/* @__PURE__ */ e(
|
|
1583
|
-
|
|
1583
|
+
$t,
|
|
1584
1584
|
{
|
|
1585
1585
|
className: Ne("animate-spin text-info-fg", Fe[s]),
|
|
1586
1586
|
"aria-hidden": !0
|
|
@@ -1594,31 +1594,31 @@ const Ne = (...t) => t.filter(Boolean).join(" "), Dr = (t) => /* @__PURE__ */ e(
|
|
|
1594
1594
|
className: Ne(
|
|
1595
1595
|
"text-text-muted cursor-pointer transition-transform",
|
|
1596
1596
|
Fe[s],
|
|
1597
|
-
|
|
1597
|
+
Z ? "rotate-180" : "rotate-0"
|
|
1598
1598
|
),
|
|
1599
1599
|
onClick: () => {
|
|
1600
|
-
|
|
1600
|
+
J((q) => (q || x(!1), !q));
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
1603
1603
|
)
|
|
1604
1604
|
) })
|
|
1605
1605
|
] }),
|
|
1606
|
-
|
|
1606
|
+
oe && /* @__PURE__ */ e(
|
|
1607
1607
|
"ul",
|
|
1608
1608
|
{
|
|
1609
1609
|
className: "absolute z-10 mt-1 w-full bg-surface border border-border rounded-lg shadow-lg max-h-60 overflow-auto top-full",
|
|
1610
1610
|
role: "listbox",
|
|
1611
|
-
children:
|
|
1611
|
+
children: S.length > 0 ? S.map((q) => /* @__PURE__ */ e(
|
|
1612
1612
|
"li",
|
|
1613
1613
|
{
|
|
1614
1614
|
className: "px-4 py-2 cursor-pointer text-text hover:bg-accent-soft hover:text-accent transition-colors",
|
|
1615
|
-
onClick: () =>
|
|
1615
|
+
onClick: () => E(q),
|
|
1616
1616
|
role: "option",
|
|
1617
|
-
"aria-selected":
|
|
1618
|
-
children:
|
|
1617
|
+
"aria-selected": B === q.label,
|
|
1618
|
+
children: q.label
|
|
1619
1619
|
},
|
|
1620
|
-
|
|
1621
|
-
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-text-muted", children:
|
|
1620
|
+
q.value
|
|
1621
|
+
)) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-text-muted", children: $ || o ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
|
|
1622
1622
|
}
|
|
1623
1623
|
),
|
|
1624
1624
|
(n || r) && /* @__PURE__ */ e(
|
|
@@ -1633,7 +1633,7 @@ const Ne = (...t) => t.filter(Boolean).join(" "), Dr = (t) => /* @__PURE__ */ e(
|
|
|
1633
1633
|
),
|
|
1634
1634
|
b && /* @__PURE__ */ c("p", { className: "mt-2 text-xs text-success-fg", children: [
|
|
1635
1635
|
"Huidige zoekterm (niet-gedebounced): ",
|
|
1636
|
-
String(
|
|
1636
|
+
String(B)
|
|
1637
1637
|
] })
|
|
1638
1638
|
]
|
|
1639
1639
|
}
|
|
@@ -1666,7 +1666,7 @@ const ct = ve(
|
|
|
1666
1666
|
l
|
|
1667
1667
|
),
|
|
1668
1668
|
children: [
|
|
1669
|
-
/* @__PURE__ */ e(
|
|
1669
|
+
/* @__PURE__ */ e(ee, { icon: Ie, size: "md", color: "current", className: "shrink-0" }),
|
|
1670
1670
|
/* @__PURE__ */ e(
|
|
1671
1671
|
"input",
|
|
1672
1672
|
{
|
|
@@ -1698,7 +1698,7 @@ const ct = ve(
|
|
|
1698
1698
|
"aria-label": a,
|
|
1699
1699
|
onClick: () => r(""),
|
|
1700
1700
|
className: "grid size-4 shrink-0 cursor-pointer place-items-center rounded-xs text-text-subtle transition-colors duration-fast ease-out hover:text-text focus-visible:outline-none focus-visible:focus-ring",
|
|
1701
|
-
children: /* @__PURE__ */ e(
|
|
1701
|
+
children: /* @__PURE__ */ e(ee, { icon: Se, size: "sm", color: "current" })
|
|
1702
1702
|
}
|
|
1703
1703
|
) : n && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: n })
|
|
1704
1704
|
]
|
|
@@ -1771,66 +1771,66 @@ const jr = ({
|
|
|
1771
1771
|
showCheck: u = !0,
|
|
1772
1772
|
header: d
|
|
1773
1773
|
}) => {
|
|
1774
|
-
const [v, m] =
|
|
1775
|
-
|
|
1774
|
+
const [v, m] = R(!1), [f, b] = R(null), [g, w] = R({ top: 0, left: 0 }), p = ne(null), h = ne(null), C = ne(null), z = ne(null), P = Pe(v, h, { placement: a }), _ = ne(null), K = () => Array.from(
|
|
1775
|
+
z.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1776
1776
|
);
|
|
1777
|
-
|
|
1777
|
+
X(() => {
|
|
1778
1778
|
v && K()[0]?.focus();
|
|
1779
1779
|
}, [v]);
|
|
1780
|
-
const
|
|
1781
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(
|
|
1782
|
-
const
|
|
1783
|
-
if (
|
|
1784
|
-
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1780
|
+
const U = (y) => {
|
|
1781
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(y.key)) return;
|
|
1782
|
+
const S = K();
|
|
1783
|
+
if (S.length === 0) return;
|
|
1784
|
+
y.preventDefault();
|
|
1785
|
+
const D = S.indexOf(document.activeElement), E = y.key === "Home" ? 0 : y.key === "End" ? S.length - 1 : y.key === "ArrowDown" ? (D + 1) % S.length : (D - 1 + S.length) % S.length;
|
|
1786
|
+
S[E]?.focus();
|
|
1787
1787
|
};
|
|
1788
|
-
|
|
1789
|
-
const
|
|
1790
|
-
p.current && (!p.current.contains(
|
|
1788
|
+
X(() => {
|
|
1789
|
+
const y = (x) => {
|
|
1790
|
+
p.current && (!p.current.contains(x.target) || C.current && !C.current.contains(x.target)) && (m(!1), b(null), _.current && (clearTimeout(_.current), _.current = null));
|
|
1791
1791
|
};
|
|
1792
|
-
return v && document.addEventListener("mousedown",
|
|
1793
|
-
document.removeEventListener("mousedown",
|
|
1792
|
+
return v && document.addEventListener("mousedown", y), () => {
|
|
1793
|
+
document.removeEventListener("mousedown", y);
|
|
1794
1794
|
};
|
|
1795
|
-
}, [v]),
|
|
1796
|
-
const
|
|
1797
|
-
|
|
1795
|
+
}, [v]), X(() => {
|
|
1796
|
+
const y = (x) => {
|
|
1797
|
+
x.key === "Escape" && (m(!1), b(null), h.current?.focus(), _.current && (clearTimeout(_.current), _.current = null));
|
|
1798
1798
|
};
|
|
1799
|
-
return v && document.addEventListener("keydown",
|
|
1800
|
-
document.removeEventListener("keydown",
|
|
1799
|
+
return v && document.addEventListener("keydown", y), () => {
|
|
1800
|
+
document.removeEventListener("keydown", y);
|
|
1801
1801
|
};
|
|
1802
|
-
}, [v]),
|
|
1802
|
+
}, [v]), X(() => {
|
|
1803
1803
|
if (f && p.current) {
|
|
1804
|
-
const
|
|
1804
|
+
const y = p.current.querySelector(
|
|
1805
1805
|
`[data-option-value="${f}"]`
|
|
1806
1806
|
);
|
|
1807
|
-
if (
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1810
|
-
top:
|
|
1811
|
-
left:
|
|
1807
|
+
if (y) {
|
|
1808
|
+
const x = y.getBoundingClientRect();
|
|
1809
|
+
w({
|
|
1810
|
+
top: x.top,
|
|
1811
|
+
left: x.right + 8
|
|
1812
1812
|
});
|
|
1813
1813
|
}
|
|
1814
1814
|
}
|
|
1815
|
-
}, [f]),
|
|
1816
|
-
|
|
1815
|
+
}, [f]), X(() => () => {
|
|
1816
|
+
_.current && clearTimeout(_.current);
|
|
1817
1817
|
}, []);
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1820
|
-
},
|
|
1821
|
-
|
|
1822
|
-
},
|
|
1823
|
-
|
|
1824
|
-
},
|
|
1825
|
-
|
|
1818
|
+
const j = (y) => {
|
|
1819
|
+
y.stopPropagation(), !l && (m(!v), b(null), _.current && (clearTimeout(_.current), _.current = null));
|
|
1820
|
+
}, B = (y, x, S) => {
|
|
1821
|
+
y.stopPropagation(), !x.disabled && !x.divider && (!x.children || x.children.length === 0) && (s?.(x.value, S), m(!1), b(null));
|
|
1822
|
+
}, W = (y) => {
|
|
1823
|
+
_.current && (clearTimeout(_.current), _.current = null), y.children && y.children.length > 0 ? b(y.value) : b(null);
|
|
1824
|
+
}, Z = (y) => {
|
|
1825
|
+
y.children && y.children.length > 0 ? _.current = setTimeout(() => {
|
|
1826
1826
|
b(null);
|
|
1827
1827
|
}, 150) : b(null);
|
|
1828
|
-
},
|
|
1829
|
-
|
|
1828
|
+
}, J = (y, x, S) => {
|
|
1829
|
+
y.stopPropagation(), !x.disabled && !x.divider && (s?.(x.value, S), m(!1), b(null));
|
|
1830
1830
|
}, de = i(
|
|
1831
1831
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1832
1832
|
"max-h-60 overflow-auto"
|
|
1833
|
-
),
|
|
1833
|
+
), Y = i(
|
|
1834
1834
|
"fixed z-overlay min-w-menu bg-surface rounded-lg shadow-overlay border border-border",
|
|
1835
1835
|
"max-h-60 overflow-auto"
|
|
1836
1836
|
);
|
|
@@ -1846,8 +1846,8 @@ const jr = ({
|
|
|
1846
1846
|
/* @__PURE__ */ e(
|
|
1847
1847
|
"button",
|
|
1848
1848
|
{
|
|
1849
|
-
ref:
|
|
1850
|
-
onClick:
|
|
1849
|
+
ref: h,
|
|
1850
|
+
onClick: j,
|
|
1851
1851
|
disabled: l,
|
|
1852
1852
|
"aria-haspopup": "menu",
|
|
1853
1853
|
"aria-expanded": v,
|
|
@@ -1857,121 +1857,121 @@ const jr = ({
|
|
|
1857
1857
|
children: t
|
|
1858
1858
|
}
|
|
1859
1859
|
),
|
|
1860
|
-
v && /* @__PURE__ */ e("div", { ref:
|
|
1860
|
+
v && /* @__PURE__ */ e("div", { ref: z, className: de, style: P, onKeyDown: U, children: /* @__PURE__ */ c("div", { className: "p-2", role: "menu", children: [
|
|
1861
1861
|
d && (typeof d == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: d }) : d),
|
|
1862
|
-
r.map((
|
|
1863
|
-
if (
|
|
1862
|
+
r.map((y, x) => {
|
|
1863
|
+
if (y.divider)
|
|
1864
1864
|
return /* @__PURE__ */ e(
|
|
1865
1865
|
"div",
|
|
1866
1866
|
{
|
|
1867
1867
|
className: "border-t border-border my-2"
|
|
1868
1868
|
},
|
|
1869
|
-
`divider-${
|
|
1869
|
+
`divider-${x}`
|
|
1870
1870
|
);
|
|
1871
|
-
const
|
|
1871
|
+
const S = y.children && y.children.length > 0, D = f === y.value;
|
|
1872
1872
|
return /* @__PURE__ */ c("div", { className: "relative group", children: [
|
|
1873
1873
|
/* @__PURE__ */ c(
|
|
1874
1874
|
"button",
|
|
1875
1875
|
{
|
|
1876
|
-
"data-option-value":
|
|
1876
|
+
"data-option-value": y.value,
|
|
1877
1877
|
role: "menuitem",
|
|
1878
|
-
"aria-haspopup":
|
|
1879
|
-
onClick: (
|
|
1880
|
-
onMouseEnter: () =>
|
|
1881
|
-
onMouseLeave: () =>
|
|
1882
|
-
disabled:
|
|
1878
|
+
"aria-haspopup": S ? "menu" : void 0,
|
|
1879
|
+
onClick: (E) => B(E, y),
|
|
1880
|
+
onMouseEnter: () => W(y),
|
|
1881
|
+
onMouseLeave: () => Z(y),
|
|
1882
|
+
disabled: y.disabled,
|
|
1883
1883
|
className: i(
|
|
1884
1884
|
"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",
|
|
1885
1885
|
{
|
|
1886
|
-
"opacity-50 cursor-not-allowed":
|
|
1887
|
-
"bg-surface-hover":
|
|
1886
|
+
"opacity-50 cursor-not-allowed": y.disabled,
|
|
1887
|
+
"bg-surface-hover": D && S
|
|
1888
1888
|
}
|
|
1889
1889
|
),
|
|
1890
1890
|
children: [
|
|
1891
1891
|
/* @__PURE__ */ c("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1892
|
-
|
|
1892
|
+
y.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: y.icon }),
|
|
1893
1893
|
/* @__PURE__ */ c("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1894
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
1895
|
-
|
|
1894
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: y.label }),
|
|
1895
|
+
y.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: y.description })
|
|
1896
1896
|
] })
|
|
1897
1897
|
] }),
|
|
1898
1898
|
/* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
|
|
1899
|
-
u && n ===
|
|
1900
|
-
|
|
1899
|
+
u && n === y.value && /* @__PURE__ */ e(Ue, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 }),
|
|
1900
|
+
S && /* @__PURE__ */ e("span", { className: "text-text-muted text-xs", children: "▶" })
|
|
1901
1901
|
] })
|
|
1902
1902
|
]
|
|
1903
1903
|
}
|
|
1904
1904
|
),
|
|
1905
|
-
|
|
1905
|
+
S && D && /* @__PURE__ */ e(
|
|
1906
1906
|
"div",
|
|
1907
1907
|
{
|
|
1908
1908
|
ref: C,
|
|
1909
|
-
className:
|
|
1909
|
+
className: Y,
|
|
1910
1910
|
style: {
|
|
1911
1911
|
top: `${g.top}px`,
|
|
1912
1912
|
left: `${g.left}px`
|
|
1913
1913
|
},
|
|
1914
1914
|
onMouseEnter: () => {
|
|
1915
|
-
|
|
1915
|
+
_.current && (clearTimeout(_.current), _.current = null), b(y.value);
|
|
1916
1916
|
},
|
|
1917
1917
|
onMouseLeave: () => {
|
|
1918
|
-
|
|
1918
|
+
_.current = setTimeout(() => {
|
|
1919
1919
|
b(null);
|
|
1920
1920
|
}, 150);
|
|
1921
1921
|
},
|
|
1922
|
-
children: /* @__PURE__ */ e("div", { className: "p-2", children:
|
|
1923
|
-
if (
|
|
1922
|
+
children: /* @__PURE__ */ e("div", { className: "p-2", children: y.children.map((E, A) => {
|
|
1923
|
+
if (E.divider)
|
|
1924
1924
|
return /* @__PURE__ */ e(
|
|
1925
1925
|
"div",
|
|
1926
1926
|
{
|
|
1927
1927
|
className: "border-t border-border my-2"
|
|
1928
1928
|
},
|
|
1929
|
-
`divider-${
|
|
1929
|
+
`divider-${A}`
|
|
1930
1930
|
);
|
|
1931
|
-
const
|
|
1932
|
-
|
|
1933
|
-
) || n ===
|
|
1931
|
+
const $ = typeof n == "object" && n[y.value] && n[y.value].includes(
|
|
1932
|
+
E.value
|
|
1933
|
+
) || n === E.value;
|
|
1934
1934
|
return /* @__PURE__ */ c(
|
|
1935
1935
|
"button",
|
|
1936
1936
|
{
|
|
1937
|
-
onClick: (
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1937
|
+
onClick: (oe) => J(
|
|
1938
|
+
oe,
|
|
1939
|
+
E,
|
|
1940
|
+
y.value
|
|
1941
1941
|
),
|
|
1942
|
-
disabled:
|
|
1942
|
+
disabled: E.disabled,
|
|
1943
1943
|
className: i(
|
|
1944
1944
|
"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",
|
|
1945
1945
|
{
|
|
1946
|
-
"opacity-50 cursor-not-allowed":
|
|
1946
|
+
"opacity-50 cursor-not-allowed": E.disabled
|
|
1947
1947
|
}
|
|
1948
1948
|
),
|
|
1949
1949
|
children: [
|
|
1950
1950
|
/* @__PURE__ */ c("div", { className: "flex items-center space-x-2 min-w-0", children: [
|
|
1951
|
-
|
|
1951
|
+
E.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: E.icon }),
|
|
1952
1952
|
/* @__PURE__ */ c("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
1953
|
-
/* @__PURE__ */ e("span", { className: "font-base truncate", children:
|
|
1954
|
-
|
|
1953
|
+
/* @__PURE__ */ e("span", { className: "font-base truncate", children: E.label }),
|
|
1954
|
+
E.description && /* @__PURE__ */ e("span", { className: "text-xs text-text-muted", children: E.description })
|
|
1955
1955
|
] })
|
|
1956
1956
|
] }),
|
|
1957
|
-
u &&
|
|
1957
|
+
u && $ && /* @__PURE__ */ e(Ue, { className: "size-icon-md shrink-0 text-success-fg", "aria-hidden": !0 })
|
|
1958
1958
|
]
|
|
1959
1959
|
},
|
|
1960
|
-
|
|
1960
|
+
E.value
|
|
1961
1961
|
);
|
|
1962
1962
|
}) })
|
|
1963
1963
|
}
|
|
1964
1964
|
)
|
|
1965
|
-
] },
|
|
1965
|
+
] }, y.value);
|
|
1966
1966
|
}),
|
|
1967
1967
|
(() => {
|
|
1968
|
-
const
|
|
1969
|
-
if (
|
|
1970
|
-
const
|
|
1971
|
-
return
|
|
1968
|
+
const y = r.reduce((x, S) => {
|
|
1969
|
+
if (S.divider) return x;
|
|
1970
|
+
const D = S.children ? S.children.filter((E) => !E.divider).length : 0;
|
|
1971
|
+
return x + 1 + D;
|
|
1972
1972
|
}, 0);
|
|
1973
|
-
return
|
|
1974
|
-
|
|
1973
|
+
return y > 1 && /* @__PURE__ */ e("div", { className: "border-t border-border mt-2 pt-2", children: /* @__PURE__ */ c("div", { className: "text-xs text-text-muted px-3 py-1", children: [
|
|
1974
|
+
y,
|
|
1975
1975
|
" options available"
|
|
1976
1976
|
] }) });
|
|
1977
1977
|
})()
|
|
@@ -1984,7 +1984,7 @@ const jr = ({
|
|
|
1984
1984
|
defaultVariant: r = "secondary",
|
|
1985
1985
|
className: n
|
|
1986
1986
|
}) => t.length === 0 ? null : /* @__PURE__ */ e("div", { className: i("flex flex-wrap items-center gap-2", n), children: t.map(
|
|
1987
|
-
(s) => s.render ? /* @__PURE__ */ e(
|
|
1987
|
+
(s) => s.render ? /* @__PURE__ */ e(ae.Fragment, { children: s.render() }, s.id) : s.splitOptions && s.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
1988
1988
|
st,
|
|
1989
1989
|
{
|
|
1990
1990
|
label: s.label,
|
|
@@ -2027,7 +2027,7 @@ const jr = ({
|
|
|
2027
2027
|
variant: "secondary",
|
|
2028
2028
|
onClick: r,
|
|
2029
2029
|
"aria-label": n,
|
|
2030
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2030
|
+
leftIcon: /* @__PURE__ */ e(ee, { icon: ze, size: "sm" }),
|
|
2031
2031
|
iconOnly: !0
|
|
2032
2032
|
}
|
|
2033
2033
|
),
|
|
@@ -2117,130 +2117,130 @@ const Vr = (t) => {
|
|
|
2117
2117
|
groups: f,
|
|
2118
2118
|
paginated: b = !1,
|
|
2119
2119
|
defaultPageSize: g = 10,
|
|
2120
|
-
actions:
|
|
2120
|
+
actions: w = [],
|
|
2121
2121
|
onRowClick: p,
|
|
2122
|
-
selectable:
|
|
2122
|
+
selectable: h = !1,
|
|
2123
2123
|
selectedRows: C = [],
|
|
2124
|
-
onSelectionChange:
|
|
2125
|
-
getRowKey:
|
|
2126
|
-
emptyContent:
|
|
2124
|
+
onSelectionChange: z,
|
|
2125
|
+
getRowKey: P = (de, Y) => Y,
|
|
2126
|
+
emptyContent: _,
|
|
2127
2127
|
footerSummary: K,
|
|
2128
|
-
size:
|
|
2129
|
-
hoverable:
|
|
2130
|
-
padding:
|
|
2131
|
-
className:
|
|
2132
|
-
rowClassName:
|
|
2133
|
-
headerBackground:
|
|
2128
|
+
size: U = "md",
|
|
2129
|
+
hoverable: j = !0,
|
|
2130
|
+
padding: B = "md",
|
|
2131
|
+
className: W,
|
|
2132
|
+
rowClassName: Z,
|
|
2133
|
+
headerBackground: J = !0
|
|
2134
2134
|
}) => {
|
|
2135
|
-
const [de,
|
|
2135
|
+
const [de, Y] = R(""), y = l !== void 0, x = y ? l : de, S = o ?? Y, [D, E] = R({
|
|
2136
2136
|
column: null,
|
|
2137
2137
|
direction: null
|
|
2138
|
-
}), [
|
|
2138
|
+
}), [A, $] = R({
|
|
2139
2139
|
page: 0,
|
|
2140
2140
|
pageSize: g
|
|
2141
|
-
}),
|
|
2142
|
-
let
|
|
2143
|
-
if (s && !
|
|
2144
|
-
const
|
|
2141
|
+
}), oe = ne(null), ce = pe(() => {
|
|
2142
|
+
let T = t;
|
|
2143
|
+
if (s && !y && x.trim()) {
|
|
2144
|
+
const V = r.filter(
|
|
2145
2145
|
(ie) => ie.searchable !== !1
|
|
2146
|
-
),
|
|
2147
|
-
|
|
2148
|
-
const
|
|
2149
|
-
return String(
|
|
2146
|
+
), re = x.toLowerCase();
|
|
2147
|
+
T = T.filter((ie) => V.some((Q) => {
|
|
2148
|
+
const F = typeof Q.accessor == "function" ? Q.accessor(ie) : ie[Q.accessor];
|
|
2149
|
+
return String(F || "").toLowerCase().includes(re);
|
|
2150
2150
|
}));
|
|
2151
2151
|
}
|
|
2152
|
-
return
|
|
2153
|
-
}, [t,
|
|
2154
|
-
if (
|
|
2155
|
-
const
|
|
2156
|
-
return
|
|
2157
|
-
const ie = typeof
|
|
2158
|
-
let
|
|
2159
|
-
return ie <
|
|
2160
|
-
}) :
|
|
2161
|
-
}, [
|
|
2162
|
-
if (!b || m) return
|
|
2163
|
-
const
|
|
2164
|
-
return
|
|
2165
|
-
}, [
|
|
2166
|
-
(
|
|
2167
|
-
r.find((
|
|
2152
|
+
return T;
|
|
2153
|
+
}, [t, x, y, r, s]), q = pe(() => {
|
|
2154
|
+
if (!D.column || !D.direction) return ce;
|
|
2155
|
+
const T = r.find((V) => V.id === D.column);
|
|
2156
|
+
return T ? [...ce].sort((V, re) => {
|
|
2157
|
+
const ie = typeof T.accessor == "function" ? T.accessor(V) : V[T.accessor], Q = typeof T.accessor == "function" ? T.accessor(re) : re[T.accessor];
|
|
2158
|
+
let F = 0;
|
|
2159
|
+
return ie < Q ? F = -1 : ie > Q && (F = 1), D.direction === "desc" ? -F : F;
|
|
2160
|
+
}) : ce;
|
|
2161
|
+
}, [ce, D, r]), H = pe(() => {
|
|
2162
|
+
if (!b || m) return q;
|
|
2163
|
+
const T = A.page * A.pageSize, V = T + A.pageSize;
|
|
2164
|
+
return q.slice(T, V);
|
|
2165
|
+
}, [q, A, b, m]), L = xe(
|
|
2166
|
+
(T) => {
|
|
2167
|
+
r.find((re) => re.id === T)?.sortable && E((re) => re.column !== T ? { column: T, direction: "asc" } : re.direction === "asc" ? { column: T, direction: "desc" } : { column: null, direction: null });
|
|
2168
2168
|
},
|
|
2169
2169
|
[r]
|
|
2170
|
-
),
|
|
2171
|
-
|
|
2172
|
-
}, []),
|
|
2173
|
-
(
|
|
2174
|
-
if (!
|
|
2175
|
-
const
|
|
2176
|
-
|
|
2177
|
-
(ie,
|
|
2170
|
+
), k = xe((T) => {
|
|
2171
|
+
$((V) => ({ ...V, page: T }));
|
|
2172
|
+
}, []), M = xe(
|
|
2173
|
+
(T, V) => {
|
|
2174
|
+
if (!z) return;
|
|
2175
|
+
const re = P(T, 0);
|
|
2176
|
+
z(V ? [...C, T] : C.filter(
|
|
2177
|
+
(ie, Q) => P(C[Q], Q) !== re
|
|
2178
2178
|
));
|
|
2179
2179
|
},
|
|
2180
|
-
[C,
|
|
2181
|
-
),
|
|
2182
|
-
(
|
|
2183
|
-
|
|
2180
|
+
[C, z, P]
|
|
2181
|
+
), G = xe(
|
|
2182
|
+
(T) => {
|
|
2183
|
+
z && z(T ? [...H] : []);
|
|
2184
2184
|
},
|
|
2185
|
-
[
|
|
2185
|
+
[H, z]
|
|
2186
2186
|
);
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
}, [
|
|
2190
|
-
|
|
2191
|
-
}, [u.map((
|
|
2192
|
-
const
|
|
2193
|
-
const
|
|
2187
|
+
X(() => {
|
|
2188
|
+
$((T) => ({ ...T, page: 0 }));
|
|
2189
|
+
}, [x, D]), X(() => {
|
|
2190
|
+
$((T) => ({ ...T, page: 0 }));
|
|
2191
|
+
}, [u.map((T) => T.value).join(",")]);
|
|
2192
|
+
const O = q.length, N = Math.ceil(O / A.pageSize), I = A.page * A.pageSize + 1, te = Math.min(I + A.pageSize - 1, O), le = H.length > 0 && H.every((T) => {
|
|
2193
|
+
const V = P(T, 0);
|
|
2194
2194
|
return C.some(
|
|
2195
|
-
(
|
|
2195
|
+
(re, ie) => P(re, ie) === V
|
|
2196
2196
|
);
|
|
2197
|
-
}), be =
|
|
2198
|
-
const
|
|
2197
|
+
}), be = H.some((T) => {
|
|
2198
|
+
const V = P(T, 0);
|
|
2199
2199
|
return C.some(
|
|
2200
|
-
(
|
|
2200
|
+
(re, ie) => P(re, ie) === V
|
|
2201
2201
|
);
|
|
2202
|
-
}), ye = Rr[
|
|
2203
|
-
const
|
|
2204
|
-
if (!m) return [{ group: null, rows:
|
|
2205
|
-
const
|
|
2206
|
-
for (const
|
|
2207
|
-
const
|
|
2208
|
-
ge ? ge.push(
|
|
2202
|
+
}), ye = Rr[B], fe = J ? "bg-surface-sunk" : "bg-surface", he = i("text-text", ye), Oe = s || u.length > 0 || d.length > 0 || !!v, ft = pe(() => {
|
|
2203
|
+
const T = H.map((Q, F) => ({ row: Q, index: F }));
|
|
2204
|
+
if (!m) return [{ group: null, rows: T }];
|
|
2205
|
+
const V = /* @__PURE__ */ new Map();
|
|
2206
|
+
for (const Q of T) {
|
|
2207
|
+
const F = m(Q.row, Q.index), ge = V.get(F);
|
|
2208
|
+
ge ? ge.push(Q) : V.set(F, [Q]);
|
|
2209
2209
|
}
|
|
2210
|
-
const
|
|
2210
|
+
const re = f ?? [];
|
|
2211
2211
|
return [
|
|
2212
|
-
...
|
|
2213
|
-
...[...
|
|
2214
|
-
].map((
|
|
2215
|
-
}, [
|
|
2216
|
-
return /* @__PURE__ */ c("div", { className: i("flex min-w-0 flex-col",
|
|
2212
|
+
...re.filter((Q) => V.has(Q.id)),
|
|
2213
|
+
...[...V.keys()].filter((Q) => !re.some((F) => F.id === Q)).map((Q) => ({ id: Q }))
|
|
2214
|
+
].map((Q) => ({ group: Q, rows: V.get(Q.id) ?? [] }));
|
|
2215
|
+
}, [H, m, f]), ht = r.length + (h ? 1 : 0) + (w.length > 0 ? 1 : 0), Ve = b && O > 0, xt = Ve || K !== void 0;
|
|
2216
|
+
return /* @__PURE__ */ c("div", { className: i("flex min-w-0 flex-col", W), children: [
|
|
2217
2217
|
Oe && /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2 pb-3", children: [
|
|
2218
2218
|
s && /* @__PURE__ */ e(
|
|
2219
2219
|
ct,
|
|
2220
2220
|
{
|
|
2221
|
-
value:
|
|
2222
|
-
onValueChange:
|
|
2221
|
+
value: x,
|
|
2222
|
+
onValueChange: S,
|
|
2223
2223
|
placeholder: a,
|
|
2224
2224
|
containerClassName: "w-full sm:w-66"
|
|
2225
2225
|
}
|
|
2226
2226
|
),
|
|
2227
|
-
u.map((
|
|
2227
|
+
u.map((T) => /* @__PURE__ */ e(Vr, { ...T }, T.id)),
|
|
2228
2228
|
v,
|
|
2229
2229
|
d.length > 0 && /* @__PURE__ */ e(ke, { actions: d, className: "ml-auto" })
|
|
2230
2230
|
] }),
|
|
2231
|
-
/* @__PURE__ */ e("div", { className: "relative w-full overflow-x-auto rounded-lg ring-1 ring-border", children: /* @__PURE__ */ c("table", { ref:
|
|
2231
|
+
/* @__PURE__ */ e("div", { className: "relative w-full overflow-x-auto rounded-lg ring-1 ring-border", children: /* @__PURE__ */ c("table", { ref: oe, className: "min-w-full border-collapse text-base text-text", children: [
|
|
2232
2232
|
/* @__PURE__ */ e("thead", { className: i(fe, "h-control-lg"), children: /* @__PURE__ */ c("tr", { children: [
|
|
2233
|
-
|
|
2233
|
+
h && /* @__PURE__ */ e("th", { className: i(he, "w-10"), children: /* @__PURE__ */ e(
|
|
2234
2234
|
we,
|
|
2235
2235
|
{
|
|
2236
2236
|
size: "sm",
|
|
2237
2237
|
checked: le,
|
|
2238
2238
|
indeterminate: be && !le,
|
|
2239
|
-
onChange: (
|
|
2239
|
+
onChange: (T) => G(T.target.checked),
|
|
2240
2240
|
"aria-label": "Select all rows"
|
|
2241
2241
|
}
|
|
2242
2242
|
) }),
|
|
2243
|
-
r.map((
|
|
2243
|
+
r.map((T) => /* @__PURE__ */ e(
|
|
2244
2244
|
"th",
|
|
2245
2245
|
{
|
|
2246
2246
|
className: i(
|
|
@@ -2248,57 +2248,57 @@ const Vr = (t) => {
|
|
|
2248
2248
|
"text-xs font-semibold uppercase tracking-label text-text-muted",
|
|
2249
2249
|
"group",
|
|
2250
2250
|
{
|
|
2251
|
-
"text-left":
|
|
2252
|
-
"text-center":
|
|
2253
|
-
"text-right":
|
|
2254
|
-
"cursor-pointer select-none":
|
|
2255
|
-
[`sticky left-0 ${fe}`]:
|
|
2256
|
-
[`sticky right-0 ${fe}`]:
|
|
2251
|
+
"text-left": T.align === "left" || !T.align,
|
|
2252
|
+
"text-center": T.align === "center",
|
|
2253
|
+
"text-right": T.align === "right",
|
|
2254
|
+
"cursor-pointer select-none": T.sortable,
|
|
2255
|
+
[`sticky left-0 ${fe}`]: T.sticky === "left",
|
|
2256
|
+
[`sticky right-0 ${fe}`]: T.sticky === "right"
|
|
2257
2257
|
}
|
|
2258
2258
|
),
|
|
2259
|
-
style: { width:
|
|
2260
|
-
onClick: () =>
|
|
2259
|
+
style: { width: T.width },
|
|
2260
|
+
onClick: () => T.sortable && L(T.id),
|
|
2261
2261
|
children: /* @__PURE__ */ c("div", { className: "flex items-center gap-1.5", children: [
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2262
|
+
T.headerCell ? T.headerCell() : T.header,
|
|
2263
|
+
T.sortable && /* @__PURE__ */ e(
|
|
2264
|
+
ee,
|
|
2265
2265
|
{
|
|
2266
|
-
icon:
|
|
2266
|
+
icon: D.column === T.id && D.direction === "desc" ? Ae : _t,
|
|
2267
2267
|
size: "xs",
|
|
2268
2268
|
className: i(
|
|
2269
2269
|
"transition-opacity duration-fast ease-out",
|
|
2270
|
-
|
|
2270
|
+
D.column === T.id ? "text-text opacity-100" : "text-text-subtle opacity-0 group-hover:opacity-100"
|
|
2271
2271
|
)
|
|
2272
2272
|
}
|
|
2273
2273
|
)
|
|
2274
2274
|
] })
|
|
2275
2275
|
},
|
|
2276
|
-
|
|
2276
|
+
T.id
|
|
2277
2277
|
)),
|
|
2278
|
-
|
|
2278
|
+
w.length > 0 && /* @__PURE__ */ e("th", { className: i(he, "w-10"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
|
|
2279
2279
|
] }) }),
|
|
2280
|
-
/* @__PURE__ */ e("tbody", { children: n ? Array.from({ length: Hr }).map((
|
|
2281
|
-
|
|
2282
|
-
r.map((
|
|
2280
|
+
/* @__PURE__ */ e("tbody", { children: n ? Array.from({ length: Hr }).map((T, V) => /* @__PURE__ */ c("tr", { className: "animate-pulse border-t border-border-subtle", "aria-hidden": !0, children: [
|
|
2281
|
+
h && /* @__PURE__ */ e("td", { className: i(he, "h-row-lg"), children: /* @__PURE__ */ e("span", { className: "block size-4 rounded-xs bg-surface-hover" }) }),
|
|
2282
|
+
r.map((re, ie) => /* @__PURE__ */ e("td", { className: i(he, "h-row-lg"), style: { width: re.width }, children: /* @__PURE__ */ e(
|
|
2283
2283
|
"span",
|
|
2284
2284
|
{
|
|
2285
2285
|
className: "block h-3 rounded-xs bg-surface-hover",
|
|
2286
|
-
style: { width: Je[(
|
|
2286
|
+
style: { width: Je[(V + ie) % Je.length] }
|
|
2287
2287
|
}
|
|
2288
|
-
) },
|
|
2289
|
-
|
|
2290
|
-
] }, `skeleton-${
|
|
2288
|
+
) }, re.id)),
|
|
2289
|
+
w.length > 0 && /* @__PURE__ */ e("td", { className: i(he, "h-row-lg") })
|
|
2290
|
+
] }, `skeleton-${V}`)) : H.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
2291
2291
|
"td",
|
|
2292
2292
|
{
|
|
2293
|
-
colSpan: r.length + (
|
|
2293
|
+
colSpan: r.length + (h ? 1 : 0) + (w.length > 0 ? 1 : 0),
|
|
2294
2294
|
className: i(
|
|
2295
2295
|
he,
|
|
2296
2296
|
"border-t border-border-subtle py-10 text-center text-text-muted"
|
|
2297
2297
|
),
|
|
2298
|
-
children:
|
|
2298
|
+
children: _ || "No data available"
|
|
2299
2299
|
}
|
|
2300
|
-
) }) : ft.flatMap((
|
|
2301
|
-
...
|
|
2300
|
+
) }) : ft.flatMap((T) => [
|
|
2301
|
+
...T.group ? [
|
|
2302
2302
|
/* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
2303
2303
|
"td",
|
|
2304
2304
|
{
|
|
@@ -2307,81 +2307,81 @@ const Vr = (t) => {
|
|
|
2307
2307
|
// A caption over its rows, not a second column strip:
|
|
2308
2308
|
// same surface as the rows, no rules, count on the right.
|
|
2309
2309
|
"border-t border-border-subtle bg-surface px-4 pb-1.5 pt-4 text-sm font-semibold",
|
|
2310
|
-
|
|
2310
|
+
T.group.tone === "danger" ? "text-danger-fg" : T.group.tone === "muted" ? "text-text-subtle" : "text-text"
|
|
2311
2311
|
),
|
|
2312
2312
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2.5", children: [
|
|
2313
|
-
|
|
2314
|
-
/* @__PURE__ */ e("span", { className: "rounded-full bg-surface-sunk px-1.5 py-0.5 text-xs font-medium text-text-muted tabular-nums", children:
|
|
2313
|
+
T.group.title ?? T.group.id,
|
|
2314
|
+
/* @__PURE__ */ e("span", { className: "rounded-full bg-surface-sunk px-1.5 py-0.5 text-xs font-medium text-text-muted tabular-nums", children: T.group.count ?? T.rows.length })
|
|
2315
2315
|
] })
|
|
2316
2316
|
}
|
|
2317
|
-
) }, `group-${
|
|
2317
|
+
) }, `group-${T.group.id}`)
|
|
2318
2318
|
] : [],
|
|
2319
|
-
...
|
|
2320
|
-
const ie =
|
|
2321
|
-
(
|
|
2319
|
+
...T.rows.map(({ row: V, index: re }) => {
|
|
2320
|
+
const ie = P(V, re), Q = C.some(
|
|
2321
|
+
(F, ge) => P(F, ge) === ie
|
|
2322
2322
|
);
|
|
2323
2323
|
return /* @__PURE__ */ c(
|
|
2324
2324
|
"tr",
|
|
2325
2325
|
{
|
|
2326
2326
|
className: i(
|
|
2327
|
-
Br[
|
|
2327
|
+
Br[U],
|
|
2328
2328
|
// Hairline above every row, including the first: it is
|
|
2329
2329
|
// what separates the body from the column strip.
|
|
2330
2330
|
"border-t border-border-subtle",
|
|
2331
|
-
|
|
2331
|
+
j && "transition-colors duration-fast ease-out hover:bg-surface-hover",
|
|
2332
2332
|
p && "cursor-pointer",
|
|
2333
|
-
|
|
2334
|
-
|
|
2333
|
+
Q && "bg-accent-soft",
|
|
2334
|
+
Z?.(V, re)
|
|
2335
2335
|
),
|
|
2336
|
-
onClick: (
|
|
2337
|
-
|
|
2336
|
+
onClick: (F) => {
|
|
2337
|
+
F.stopPropagation(), p?.(V, re);
|
|
2338
2338
|
},
|
|
2339
2339
|
children: [
|
|
2340
|
-
|
|
2340
|
+
h && /* @__PURE__ */ e("td", { className: he, children: /* @__PURE__ */ e(
|
|
2341
2341
|
we,
|
|
2342
2342
|
{
|
|
2343
2343
|
size: "sm",
|
|
2344
|
-
checked:
|
|
2345
|
-
onClick: (
|
|
2346
|
-
onChange: (
|
|
2347
|
-
|
|
2344
|
+
checked: Q,
|
|
2345
|
+
onClick: (F) => F.stopPropagation(),
|
|
2346
|
+
onChange: (F) => {
|
|
2347
|
+
F.stopPropagation(), M(V, F.target.checked);
|
|
2348
2348
|
},
|
|
2349
2349
|
"aria-label": "Select row"
|
|
2350
2350
|
}
|
|
2351
2351
|
) }),
|
|
2352
|
-
r.map((
|
|
2353
|
-
const ge = typeof
|
|
2352
|
+
r.map((F) => {
|
|
2353
|
+
const ge = typeof F.accessor == "function" ? F.accessor(V) : V[F.accessor];
|
|
2354
2354
|
return /* @__PURE__ */ e(
|
|
2355
2355
|
"td",
|
|
2356
2356
|
{
|
|
2357
2357
|
className: i(he, {
|
|
2358
|
-
"text-left":
|
|
2359
|
-
"text-center":
|
|
2360
|
-
"text-right":
|
|
2361
|
-
"sticky left-0 bg-surface":
|
|
2362
|
-
"sticky right-0 bg-surface":
|
|
2358
|
+
"text-left": F.align === "left" || !F.align,
|
|
2359
|
+
"text-center": F.align === "center",
|
|
2360
|
+
"text-right": F.align === "right",
|
|
2361
|
+
"sticky left-0 bg-surface": F.sticky === "left",
|
|
2362
|
+
"sticky right-0 bg-surface": F.sticky === "right"
|
|
2363
2363
|
}),
|
|
2364
|
-
children:
|
|
2364
|
+
children: F.cell ? F.cell(ge, V, re) : String(ge || "")
|
|
2365
2365
|
},
|
|
2366
|
-
|
|
2366
|
+
F.id
|
|
2367
2367
|
);
|
|
2368
2368
|
}),
|
|
2369
|
-
|
|
2369
|
+
w.length > 0 && /* @__PURE__ */ e("td", { className: he, children: /* @__PURE__ */ e(
|
|
2370
2370
|
jr,
|
|
2371
2371
|
{
|
|
2372
2372
|
className: "rounded-md",
|
|
2373
|
-
trigger: /* @__PURE__ */ e("span", { className: "grid size-7 place-items-center text-text-subtle", children: /* @__PURE__ */ e(
|
|
2374
|
-
options:
|
|
2375
|
-
value:
|
|
2376
|
-
label:
|
|
2377
|
-
icon:
|
|
2378
|
-
disabled:
|
|
2373
|
+
trigger: /* @__PURE__ */ e("span", { className: "grid size-7 place-items-center text-text-subtle", children: /* @__PURE__ */ e(ee, { icon: Dt, size: "md", color: "current" }) }),
|
|
2374
|
+
options: w.map((F) => ({
|
|
2375
|
+
value: F.id,
|
|
2376
|
+
label: F.label,
|
|
2377
|
+
icon: F.icon,
|
|
2378
|
+
disabled: F.disabled?.(V)
|
|
2379
2379
|
})),
|
|
2380
|
-
onSelect: (
|
|
2381
|
-
const ge =
|
|
2382
|
-
(bt) => bt.id ===
|
|
2380
|
+
onSelect: (F) => {
|
|
2381
|
+
const ge = w.find(
|
|
2382
|
+
(bt) => bt.id === F
|
|
2383
2383
|
);
|
|
2384
|
-
ge && ge.onClick(
|
|
2384
|
+
ge && ge.onClick(V, re);
|
|
2385
2385
|
},
|
|
2386
2386
|
placement: "bottom-end"
|
|
2387
2387
|
}
|
|
@@ -2394,7 +2394,7 @@ const Vr = (t) => {
|
|
|
2394
2394
|
]) })
|
|
2395
2395
|
] }) }),
|
|
2396
2396
|
xt && /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-3 px-1 pt-3 text-xs text-text-muted", children: [
|
|
2397
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: K ?? `Showing ${
|
|
2397
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: K ?? `Showing ${I}–${te} of ${O}` }),
|
|
2398
2398
|
Ve && /* @__PURE__ */ c("div", { className: "flex items-center gap-0.5", children: [
|
|
2399
2399
|
/* @__PURE__ */ e(
|
|
2400
2400
|
se,
|
|
@@ -2403,27 +2403,27 @@ const Vr = (t) => {
|
|
|
2403
2403
|
variant: "ghost",
|
|
2404
2404
|
iconOnly: !0,
|
|
2405
2405
|
"aria-label": "Previous page",
|
|
2406
|
-
onClick: () =>
|
|
2407
|
-
disabled:
|
|
2408
|
-
children: /* @__PURE__ */ e(
|
|
2406
|
+
onClick: () => k(A.page - 1),
|
|
2407
|
+
disabled: A.page === 0,
|
|
2408
|
+
children: /* @__PURE__ */ e(ee, { icon: ze, size: "md", color: "current" })
|
|
2409
2409
|
}
|
|
2410
2410
|
),
|
|
2411
|
-
qr(
|
|
2412
|
-
(
|
|
2411
|
+
qr(A.page, N).map(
|
|
2412
|
+
(T, V) => T === "gap" ? /* @__PURE__ */ e("span", { className: "px-1 text-text-subtle", children: "…" }, `gap-${V}`) : /* @__PURE__ */ e(
|
|
2413
2413
|
"button",
|
|
2414
2414
|
{
|
|
2415
2415
|
type: "button",
|
|
2416
|
-
"aria-current":
|
|
2417
|
-
onClick: () =>
|
|
2416
|
+
"aria-current": T === A.page ? "page" : void 0,
|
|
2417
|
+
onClick: () => k(T),
|
|
2418
2418
|
className: i(
|
|
2419
2419
|
"h-control-xs min-w-6 cursor-pointer rounded-sm px-1.5 tabular-nums",
|
|
2420
2420
|
"transition-colors duration-fast ease-out",
|
|
2421
2421
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
2422
|
-
|
|
2422
|
+
T === A.page ? "bg-surface-sunk font-semibold text-text" : "text-text-muted hover:bg-surface-hover hover:text-text"
|
|
2423
2423
|
),
|
|
2424
|
-
children:
|
|
2424
|
+
children: T + 1
|
|
2425
2425
|
},
|
|
2426
|
-
|
|
2426
|
+
T
|
|
2427
2427
|
)
|
|
2428
2428
|
),
|
|
2429
2429
|
/* @__PURE__ */ e(
|
|
@@ -2433,9 +2433,9 @@ const Vr = (t) => {
|
|
|
2433
2433
|
variant: "ghost",
|
|
2434
2434
|
iconOnly: !0,
|
|
2435
2435
|
"aria-label": "Next page",
|
|
2436
|
-
onClick: () =>
|
|
2437
|
-
disabled:
|
|
2438
|
-
children: /* @__PURE__ */ e(
|
|
2436
|
+
onClick: () => k(A.page + 1),
|
|
2437
|
+
disabled: A.page >= N - 1,
|
|
2438
|
+
children: /* @__PURE__ */ e(ee, { icon: Le, size: "md", color: "current" })
|
|
2439
2439
|
}
|
|
2440
2440
|
)
|
|
2441
2441
|
] })
|
|
@@ -2447,7 +2447,7 @@ const Vr = (t) => {
|
|
|
2447
2447
|
onTabChange: n,
|
|
2448
2448
|
className: s
|
|
2449
2449
|
}) => {
|
|
2450
|
-
const [a, l] =
|
|
2450
|
+
const [a, l] = R(t[0]?.id || ""), o = r || a, u = (d) => {
|
|
2451
2451
|
n ? n(d) : l(d);
|
|
2452
2452
|
};
|
|
2453
2453
|
return /* @__PURE__ */ e("div", { className: i("border-b border-border", s), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: t.map((d) => /* @__PURE__ */ e(
|
|
@@ -2482,7 +2482,7 @@ const Vr = (t) => {
|
|
|
2482
2482
|
size: l = "md",
|
|
2483
2483
|
className: o
|
|
2484
2484
|
}) => {
|
|
2485
|
-
const [u, d] =
|
|
2485
|
+
const [u, d] = R(
|
|
2486
2486
|
r || n || t[0]?.id || ""
|
|
2487
2487
|
), v = n || u, m = (p) => {
|
|
2488
2488
|
s ? s(p) : d(p);
|
|
@@ -2498,30 +2498,30 @@ const Vr = (t) => {
|
|
|
2498
2498
|
"space-x-8": a === "default" || a === "underline"
|
|
2499
2499
|
},
|
|
2500
2500
|
o
|
|
2501
|
-
),
|
|
2502
|
-
const C = "transition-colors duration-fast font-medium",
|
|
2501
|
+
), w = (p, h) => {
|
|
2502
|
+
const C = "transition-colors duration-fast font-medium", z = {
|
|
2503
2503
|
"text-xs px-2 py-1": l === "sm",
|
|
2504
2504
|
"text-sm px-3 py-2": l === "md",
|
|
2505
2505
|
"text-base px-4 py-3": l === "lg"
|
|
2506
|
-
},
|
|
2506
|
+
}, P = {
|
|
2507
2507
|
// Default variant
|
|
2508
2508
|
"border-b-2 -mb-px": a === "default",
|
|
2509
2509
|
// Pills variant
|
|
2510
2510
|
"rounded-md": a === "pills",
|
|
2511
2511
|
// Underline variant
|
|
2512
2512
|
"border-b-2 pb-2": a === "underline"
|
|
2513
|
-
},
|
|
2513
|
+
}, _ = {
|
|
2514
2514
|
"opacity-50 cursor-not-allowed": p.disabled,
|
|
2515
2515
|
"cursor-pointer": !p.disabled
|
|
2516
|
-
}, K =
|
|
2516
|
+
}, K = h ? {
|
|
2517
2517
|
"border-accent-border text-text": a === "default" || a === "underline",
|
|
2518
2518
|
"bg-surface text-text shadow-none": a === "pills"
|
|
2519
|
-
} : {},
|
|
2519
|
+
} : {}, U = !h && !p.disabled ? {
|
|
2520
2520
|
"border-transparent text-text-muted hover:text-text": a === "default",
|
|
2521
2521
|
"text-text-muted hover:text-text": a === "pills",
|
|
2522
2522
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
2523
2523
|
} : {};
|
|
2524
|
-
return i(C,
|
|
2524
|
+
return i(C, z, P, _, K, U);
|
|
2525
2525
|
};
|
|
2526
2526
|
return /* @__PURE__ */ e(Ur.Provider, { value: f, children: /* @__PURE__ */ c("div", { children: [
|
|
2527
2527
|
/* @__PURE__ */ e("div", { className: g, role: "tablist", children: t.map((p) => /* @__PURE__ */ e(
|
|
@@ -2533,7 +2533,7 @@ const Vr = (t) => {
|
|
|
2533
2533
|
"aria-controls": `tabpanel-${p.id}`,
|
|
2534
2534
|
disabled: p.disabled,
|
|
2535
2535
|
onClick: () => !p.disabled && m(p.id),
|
|
2536
|
-
className:
|
|
2536
|
+
className: w(p, v === p.id),
|
|
2537
2537
|
children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
2538
2538
|
p.label,
|
|
2539
2539
|
p.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: p.badge })
|
|
@@ -2572,18 +2572,18 @@ function it({
|
|
|
2572
2572
|
footer: v,
|
|
2573
2573
|
showCloseButton: m = !0
|
|
2574
2574
|
}) {
|
|
2575
|
-
const f =
|
|
2576
|
-
|
|
2575
|
+
const f = ne(null), b = ne(null);
|
|
2576
|
+
X(() => {
|
|
2577
2577
|
if (!t || !l) return;
|
|
2578
|
-
const
|
|
2578
|
+
const w = (p) => {
|
|
2579
2579
|
p.key === "Escape" && r();
|
|
2580
2580
|
};
|
|
2581
|
-
return document.addEventListener("keydown",
|
|
2582
|
-
}, [t, l, r]),
|
|
2581
|
+
return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
|
|
2582
|
+
}, [t, l, r]), X(() => (t ? (b.current = document.activeElement, f.current && f.current.focus(), document.body.style.overflow = "hidden") : (b.current && b.current.focus(), document.body.style.overflow = ""), () => {
|
|
2583
2583
|
document.body.style.overflow = "";
|
|
2584
2584
|
}), [t]);
|
|
2585
|
-
const g = (
|
|
2586
|
-
a &&
|
|
2585
|
+
const g = (w) => {
|
|
2586
|
+
a && w.target === w.currentTarget && r();
|
|
2587
2587
|
};
|
|
2588
2588
|
return t ? /* @__PURE__ */ e(
|
|
2589
2589
|
"div",
|
|
@@ -2626,7 +2626,7 @@ function it({
|
|
|
2626
2626
|
onClick: r,
|
|
2627
2627
|
className: "p-1 text-text-muted hover:text-text transition-colors",
|
|
2628
2628
|
"aria-label": "Close modal",
|
|
2629
|
-
children: /* @__PURE__ */ e(
|
|
2629
|
+
children: /* @__PURE__ */ e(ee, { icon: Se, size: "lg", color: "current" })
|
|
2630
2630
|
}
|
|
2631
2631
|
)
|
|
2632
2632
|
] }),
|
|
@@ -2652,196 +2652,196 @@ const Gr = ({
|
|
|
2652
2652
|
onDownloadFile: m,
|
|
2653
2653
|
onRegisterFile: f
|
|
2654
2654
|
}) => {
|
|
2655
|
-
const [b, g] =
|
|
2655
|
+
const [b, g] = R(!1), [w, p] = R([]), [h, C] = R(null), [z, P] = R("/"), [_, K] = R([]), [U, j] = R(!1), [B, W] = R(""), [Z, J] = R(
|
|
2656
2656
|
typeof t == "object" ? t : null
|
|
2657
|
-
), [de,
|
|
2658
|
-
|
|
2659
|
-
b &&
|
|
2660
|
-
}, [b]),
|
|
2661
|
-
b &&
|
|
2662
|
-
}, [b,
|
|
2663
|
-
const
|
|
2664
|
-
|
|
2657
|
+
), [de, Y] = R(!1), [y, x] = R(""), S = ne(null);
|
|
2658
|
+
X(() => {
|
|
2659
|
+
b && D();
|
|
2660
|
+
}, [b]), X(() => {
|
|
2661
|
+
b && h && E();
|
|
2662
|
+
}, [b, h, z, B]);
|
|
2663
|
+
const D = async () => {
|
|
2664
|
+
j(!0);
|
|
2665
2665
|
try {
|
|
2666
|
-
const
|
|
2667
|
-
|
|
2668
|
-
} catch (
|
|
2669
|
-
console.error("Failed to load mounts",
|
|
2666
|
+
const N = await d?.();
|
|
2667
|
+
N?.data && p(N.data);
|
|
2668
|
+
} catch (N) {
|
|
2669
|
+
console.error("Failed to load mounts", N);
|
|
2670
2670
|
} finally {
|
|
2671
|
-
|
|
2671
|
+
j(!1);
|
|
2672
2672
|
}
|
|
2673
|
-
},
|
|
2674
|
-
if (
|
|
2675
|
-
|
|
2673
|
+
}, E = async () => {
|
|
2674
|
+
if (h) {
|
|
2675
|
+
j(!0);
|
|
2676
2676
|
try {
|
|
2677
|
-
const
|
|
2678
|
-
|
|
2679
|
-
} catch (
|
|
2680
|
-
console.error("Failed to load files",
|
|
2677
|
+
const N = await u?.({ mountId: h.id, name: B, path: z });
|
|
2678
|
+
N?.data && K(N.data);
|
|
2679
|
+
} catch (N) {
|
|
2680
|
+
console.error("Failed to load files", N);
|
|
2681
2681
|
} finally {
|
|
2682
|
-
|
|
2682
|
+
j(!1);
|
|
2683
2683
|
}
|
|
2684
2684
|
}
|
|
2685
|
-
},
|
|
2686
|
-
const
|
|
2687
|
-
if (
|
|
2688
|
-
|
|
2685
|
+
}, A = async (N) => {
|
|
2686
|
+
const I = N.target.files?.[0];
|
|
2687
|
+
if (I) {
|
|
2688
|
+
j(!0);
|
|
2689
2689
|
try {
|
|
2690
|
-
const
|
|
2690
|
+
const te = await I.arrayBuffer(), le = new Uint8Array(te), be = {
|
|
2691
2691
|
id: `local-${Date.now()}`,
|
|
2692
|
-
name:
|
|
2692
|
+
name: I.name,
|
|
2693
2693
|
type: "file",
|
|
2694
2694
|
path: "/",
|
|
2695
|
-
mimeType:
|
|
2696
|
-
size:
|
|
2695
|
+
mimeType: I.type || "application/octet-stream",
|
|
2696
|
+
size: I.size,
|
|
2697
2697
|
mountId: "local",
|
|
2698
|
-
providerKey:
|
|
2698
|
+
providerKey: I.name,
|
|
2699
2699
|
ownerId: "me"
|
|
2700
2700
|
};
|
|
2701
|
-
|
|
2702
|
-
} catch (
|
|
2703
|
-
console.error("Local file selection failed",
|
|
2701
|
+
J(be), r(be, le), g(!1);
|
|
2702
|
+
} catch (te) {
|
|
2703
|
+
console.error("Local file selection failed", te);
|
|
2704
2704
|
} finally {
|
|
2705
|
-
|
|
2705
|
+
j(!1);
|
|
2706
2706
|
}
|
|
2707
2707
|
}
|
|
2708
|
-
},
|
|
2709
|
-
const
|
|
2710
|
-
if (!(!
|
|
2711
|
-
|
|
2708
|
+
}, $ = async (N) => {
|
|
2709
|
+
const I = N.target.files?.[0];
|
|
2710
|
+
if (!(!I || !h)) {
|
|
2711
|
+
j(!0);
|
|
2712
2712
|
try {
|
|
2713
|
-
const
|
|
2714
|
-
file: new Uint8Array(
|
|
2715
|
-
filename:
|
|
2716
|
-
mimeType:
|
|
2717
|
-
mountId:
|
|
2718
|
-
path:
|
|
2713
|
+
const te = await I.arrayBuffer(), le = await v?.({
|
|
2714
|
+
file: new Uint8Array(te),
|
|
2715
|
+
filename: I.name,
|
|
2716
|
+
mimeType: I.type || "application/octet-stream",
|
|
2717
|
+
mountId: h.id,
|
|
2718
|
+
path: z
|
|
2719
2719
|
});
|
|
2720
2720
|
if (le?.data) {
|
|
2721
2721
|
const be = le.data;
|
|
2722
|
-
|
|
2722
|
+
J(be), r(be, new Uint8Array(te)), g(!1);
|
|
2723
2723
|
}
|
|
2724
|
-
} catch (
|
|
2725
|
-
console.error("Upload failed",
|
|
2724
|
+
} catch (te) {
|
|
2725
|
+
console.error("Upload failed", te);
|
|
2726
2726
|
} finally {
|
|
2727
|
-
|
|
2727
|
+
j(!1);
|
|
2728
2728
|
}
|
|
2729
2729
|
}
|
|
2730
|
-
},
|
|
2731
|
-
if (!(!
|
|
2732
|
-
|
|
2730
|
+
}, oe = async () => {
|
|
2731
|
+
if (!(!y || !h)) {
|
|
2732
|
+
j(!0);
|
|
2733
2733
|
try {
|
|
2734
|
-
const
|
|
2734
|
+
const N = `${z}${y}/`;
|
|
2735
2735
|
f && (await f({
|
|
2736
|
-
name:
|
|
2736
|
+
name: y,
|
|
2737
2737
|
type: "folder",
|
|
2738
|
-
path:
|
|
2738
|
+
path: z,
|
|
2739
2739
|
mimeType: "application/x-directory",
|
|
2740
2740
|
size: 0,
|
|
2741
|
-
mountId:
|
|
2742
|
-
providerKey:
|
|
2741
|
+
mountId: h.id,
|
|
2742
|
+
providerKey: N,
|
|
2743
2743
|
ownerId: "me"
|
|
2744
|
-
}), await
|
|
2745
|
-
} catch (
|
|
2746
|
-
console.error("Failed to create folder",
|
|
2744
|
+
}), await E()), Y(!1), x("");
|
|
2745
|
+
} catch (N) {
|
|
2746
|
+
console.error("Failed to create folder", N);
|
|
2747
2747
|
} finally {
|
|
2748
|
-
|
|
2748
|
+
j(!1);
|
|
2749
2749
|
}
|
|
2750
2750
|
}
|
|
2751
|
-
},
|
|
2752
|
-
|
|
2751
|
+
}, ce = async (N) => {
|
|
2752
|
+
j(!0);
|
|
2753
2753
|
try {
|
|
2754
|
-
const
|
|
2755
|
-
|
|
2756
|
-
} catch (
|
|
2757
|
-
console.error("Failed to download file",
|
|
2754
|
+
const I = await m?.(N.id);
|
|
2755
|
+
J(N), r(N, I), g(!1);
|
|
2756
|
+
} catch (I) {
|
|
2757
|
+
console.error("Failed to download file", I);
|
|
2758
2758
|
} finally {
|
|
2759
|
-
|
|
2759
|
+
j(!1);
|
|
2760
2760
|
}
|
|
2761
|
-
},
|
|
2762
|
-
|
|
2763
|
-
},
|
|
2764
|
-
const
|
|
2765
|
-
return
|
|
2766
|
-
if (
|
|
2767
|
-
|
|
2761
|
+
}, q = (N) => {
|
|
2762
|
+
N.stopPropagation(), J(null), r(null);
|
|
2763
|
+
}, H = pe(() => {
|
|
2764
|
+
const N = /* @__PURE__ */ new Set(), I = [];
|
|
2765
|
+
return _.forEach((te) => {
|
|
2766
|
+
if (te.type === "folder") {
|
|
2767
|
+
te.path === z && N.add(te.name);
|
|
2768
2768
|
return;
|
|
2769
2769
|
}
|
|
2770
|
-
const le =
|
|
2771
|
-
ye.length > 1 ?
|
|
2770
|
+
const le = te.providerKey || te.name, ye = (z ? le.substring(z.length) : le).split("/").filter((fe) => fe !== "");
|
|
2771
|
+
ye.length > 1 ? N.add(ye[0]) : ye.length === 1 && I.push(te);
|
|
2772
2772
|
}), {
|
|
2773
|
-
folders: Array.from(
|
|
2774
|
-
files:
|
|
2773
|
+
folders: Array.from(N).sort(),
|
|
2774
|
+
files: I.sort((te, le) => te.name.localeCompare(le.name))
|
|
2775
2775
|
};
|
|
2776
|
-
}, [
|
|
2777
|
-
|
|
2778
|
-
},
|
|
2779
|
-
const
|
|
2780
|
-
|
|
2781
|
-
},
|
|
2782
|
-
const
|
|
2783
|
-
id: `folder-${
|
|
2784
|
-
name:
|
|
2776
|
+
}, [_, z]), L = (N) => {
|
|
2777
|
+
P((I) => `${I}${N}/`);
|
|
2778
|
+
}, k = () => {
|
|
2779
|
+
const N = z.split("/").filter((I) => I !== "");
|
|
2780
|
+
N.pop(), N.length === 0 ? P("/") : P(`${N.join("/")}/`);
|
|
2781
|
+
}, M = pe(() => {
|
|
2782
|
+
const N = H.folders.map((I) => ({
|
|
2783
|
+
id: `folder-${I}`,
|
|
2784
|
+
name: I,
|
|
2785
2785
|
type: "folder"
|
|
2786
2786
|
}));
|
|
2787
|
-
return
|
|
2788
|
-
|
|
2789
|
-
...
|
|
2787
|
+
return H.files.forEach((I) => {
|
|
2788
|
+
N.push({
|
|
2789
|
+
...I,
|
|
2790
2790
|
type: "file"
|
|
2791
2791
|
});
|
|
2792
|
-
}),
|
|
2793
|
-
}, [
|
|
2792
|
+
}), N;
|
|
2793
|
+
}, [H]), G = [
|
|
2794
2794
|
{
|
|
2795
2795
|
id: "name",
|
|
2796
2796
|
header: "Name",
|
|
2797
2797
|
accessor: "name",
|
|
2798
|
-
cell: (
|
|
2798
|
+
cell: (N, I) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
2799
2799
|
/* @__PURE__ */ e(
|
|
2800
|
-
|
|
2800
|
+
ee,
|
|
2801
2801
|
{
|
|
2802
|
-
icon:
|
|
2802
|
+
icon: I.type === "folder" ? Ke : je,
|
|
2803
2803
|
size: "sm",
|
|
2804
|
-
color:
|
|
2804
|
+
color: I.type === "folder" ? "warning" : "secondary"
|
|
2805
2805
|
}
|
|
2806
2806
|
),
|
|
2807
|
-
/* @__PURE__ */ e("span", { className: i(
|
|
2807
|
+
/* @__PURE__ */ e("span", { className: i(I.type === "folder" && "font-medium"), children: N })
|
|
2808
2808
|
] })
|
|
2809
2809
|
},
|
|
2810
2810
|
{
|
|
2811
2811
|
id: "type",
|
|
2812
2812
|
header: "Type",
|
|
2813
|
-
accessor: (
|
|
2813
|
+
accessor: (N) => N.type === "folder" ? "Folder" : N.mimeType
|
|
2814
2814
|
},
|
|
2815
2815
|
{
|
|
2816
2816
|
id: "size",
|
|
2817
2817
|
header: "Size",
|
|
2818
|
-
accessor: (
|
|
2818
|
+
accessor: (N) => N.type === "file" ? `${(N.size / 1024).toFixed(1)} KB` : "-"
|
|
2819
2819
|
},
|
|
2820
2820
|
{
|
|
2821
2821
|
id: "actions",
|
|
2822
2822
|
header: "",
|
|
2823
2823
|
accessor: "id",
|
|
2824
2824
|
align: "right",
|
|
2825
|
-
cell: (
|
|
2825
|
+
cell: (N, I) => /* @__PURE__ */ e(
|
|
2826
2826
|
se,
|
|
2827
2827
|
{
|
|
2828
2828
|
variant: "outline",
|
|
2829
|
-
onClick: (
|
|
2830
|
-
|
|
2829
|
+
onClick: (te) => {
|
|
2830
|
+
te.stopPropagation(), I.type === "folder" ? L(I.name) : ce(I);
|
|
2831
2831
|
},
|
|
2832
|
-
loading:
|
|
2833
|
-
children:
|
|
2832
|
+
loading: U && I.type === "file" && Z?.id === I.id,
|
|
2833
|
+
children: I.type === "folder" ? "Open" : "Select"
|
|
2834
2834
|
}
|
|
2835
2835
|
)
|
|
2836
2836
|
}
|
|
2837
|
-
],
|
|
2837
|
+
], O = [
|
|
2838
2838
|
{
|
|
2839
2839
|
id: "name",
|
|
2840
2840
|
header: "Mount Name",
|
|
2841
2841
|
accessor: "name",
|
|
2842
|
-
cell: (
|
|
2843
|
-
/* @__PURE__ */ e(
|
|
2844
|
-
/* @__PURE__ */ e("span", { children:
|
|
2842
|
+
cell: (N) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
|
|
2843
|
+
/* @__PURE__ */ e(ee, { icon: We, size: "sm", color: "primary" }),
|
|
2844
|
+
/* @__PURE__ */ e("span", { children: N })
|
|
2845
2845
|
] })
|
|
2846
2846
|
},
|
|
2847
2847
|
{
|
|
@@ -2849,7 +2849,7 @@ const Gr = ({
|
|
|
2849
2849
|
header: "",
|
|
2850
2850
|
accessor: "id",
|
|
2851
2851
|
align: "right",
|
|
2852
|
-
cell: (
|
|
2852
|
+
cell: (N, I) => /* @__PURE__ */ e(se, { variant: "outline", onClick: () => C(I), children: "Open" })
|
|
2853
2853
|
}
|
|
2854
2854
|
];
|
|
2855
2855
|
return /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
@@ -2865,14 +2865,14 @@ const Gr = ({
|
|
|
2865
2865
|
l && "opacity-50 cursor-not-allowed bg-surface-sunk"
|
|
2866
2866
|
),
|
|
2867
2867
|
children: [
|
|
2868
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(
|
|
2869
|
-
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children:
|
|
2870
|
-
|
|
2868
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(ee, { icon: Z ? je : We, color: Z ? "primary" : "secondary" }) }),
|
|
2869
|
+
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: Z ? /* @__PURE__ */ e("span", { className: "text-sm text-text font-medium", children: Z.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-text-muted", children: s }) }),
|
|
2870
|
+
Z && !l && /* @__PURE__ */ e(
|
|
2871
2871
|
"button",
|
|
2872
2872
|
{
|
|
2873
|
-
onClick:
|
|
2873
|
+
onClick: q,
|
|
2874
2874
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
2875
|
-
children: /* @__PURE__ */ e(
|
|
2875
|
+
children: /* @__PURE__ */ e(ee, { icon: Se, size: "xs" })
|
|
2876
2876
|
}
|
|
2877
2877
|
)
|
|
2878
2878
|
]
|
|
@@ -2884,9 +2884,9 @@ const Gr = ({
|
|
|
2884
2884
|
{
|
|
2885
2885
|
open: b,
|
|
2886
2886
|
onClose: () => {
|
|
2887
|
-
g(!1), C(null),
|
|
2887
|
+
g(!1), C(null), P("/"), Y(!1);
|
|
2888
2888
|
},
|
|
2889
|
-
title:
|
|
2889
|
+
title: h ? `Explorer: ${h.name}` : "Select Storage Mount",
|
|
2890
2890
|
size: "lg",
|
|
2891
2891
|
children: /* @__PURE__ */ e(
|
|
2892
2892
|
Wr,
|
|
@@ -2896,26 +2896,26 @@ const Gr = ({
|
|
|
2896
2896
|
{
|
|
2897
2897
|
id: "remote",
|
|
2898
2898
|
label: "Platform Storage",
|
|
2899
|
-
content: /* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
2899
|
+
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: h ? /* @__PURE__ */ c(Ee, { children: [
|
|
2900
2900
|
/* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2901
2901
|
/* @__PURE__ */ e(
|
|
2902
2902
|
se,
|
|
2903
2903
|
{
|
|
2904
2904
|
variant: "ghost",
|
|
2905
2905
|
onClick: () => {
|
|
2906
|
-
|
|
2906
|
+
z && z !== "/" ? k() : C(null);
|
|
2907
2907
|
},
|
|
2908
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2909
|
-
children:
|
|
2908
|
+
leftIcon: /* @__PURE__ */ e(ee, { icon: At, size: "xs" }),
|
|
2909
|
+
children: z ? "Back" : "Back to Mounts"
|
|
2910
2910
|
}
|
|
2911
2911
|
),
|
|
2912
|
-
/* @__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:
|
|
2912
|
+
/* @__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: z }) }),
|
|
2913
2913
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
2914
2914
|
Ce,
|
|
2915
2915
|
{
|
|
2916
2916
|
placeholder: "Search...",
|
|
2917
|
-
value:
|
|
2918
|
-
onChange: (
|
|
2917
|
+
value: B,
|
|
2918
|
+
onChange: (N) => W(N.target.value),
|
|
2919
2919
|
startIcon: /* @__PURE__ */ e(Ie, { size: 14 }),
|
|
2920
2920
|
fullWidth: !0
|
|
2921
2921
|
}
|
|
@@ -2925,8 +2925,8 @@ const Gr = ({
|
|
|
2925
2925
|
se,
|
|
2926
2926
|
{
|
|
2927
2927
|
variant: "outline",
|
|
2928
|
-
onClick: () =>
|
|
2929
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2928
|
+
onClick: () => Y(!0),
|
|
2929
|
+
leftIcon: /* @__PURE__ */ e(ee, { icon: Lt, size: "xs" }),
|
|
2930
2930
|
children: "New Folder"
|
|
2931
2931
|
}
|
|
2932
2932
|
),
|
|
@@ -2934,9 +2934,9 @@ const Gr = ({
|
|
|
2934
2934
|
se,
|
|
2935
2935
|
{
|
|
2936
2936
|
variant: "primary",
|
|
2937
|
-
onClick: () =>
|
|
2938
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2939
|
-
loading:
|
|
2937
|
+
onClick: () => S.current?.click(),
|
|
2938
|
+
leftIcon: /* @__PURE__ */ e(ee, { icon: It, size: "xs" }),
|
|
2939
|
+
loading: U,
|
|
2940
2940
|
children: "Upload"
|
|
2941
2941
|
}
|
|
2942
2942
|
),
|
|
@@ -2945,45 +2945,45 @@ const Gr = ({
|
|
|
2945
2945
|
{
|
|
2946
2946
|
type: "file",
|
|
2947
2947
|
className: "hidden",
|
|
2948
|
-
ref:
|
|
2949
|
-
onChange:
|
|
2948
|
+
ref: S,
|
|
2949
|
+
onChange: $,
|
|
2950
2950
|
accept: o
|
|
2951
2951
|
}
|
|
2952
2952
|
)
|
|
2953
2953
|
] })
|
|
2954
2954
|
] }),
|
|
2955
2955
|
de && /* @__PURE__ */ c("div", { className: "flex items-center gap-2 p-3 bg-surface-sunk rounded-lg border border-border", children: [
|
|
2956
|
-
/* @__PURE__ */ e(
|
|
2956
|
+
/* @__PURE__ */ e(ee, { icon: Ke, size: "sm", color: "warning" }),
|
|
2957
2957
|
/* @__PURE__ */ e(
|
|
2958
2958
|
Ce,
|
|
2959
2959
|
{
|
|
2960
2960
|
placeholder: "Folder name",
|
|
2961
|
-
value:
|
|
2962
|
-
onChange: (
|
|
2961
|
+
value: y,
|
|
2962
|
+
onChange: (N) => x(N.target.value),
|
|
2963
2963
|
autoFocus: !0
|
|
2964
2964
|
}
|
|
2965
2965
|
),
|
|
2966
|
-
/* @__PURE__ */ e(se, { onClick:
|
|
2967
|
-
/* @__PURE__ */ e(se, { variant: "ghost", onClick: () =>
|
|
2966
|
+
/* @__PURE__ */ e(se, { onClick: oe, loading: U, children: "Create" }),
|
|
2967
|
+
/* @__PURE__ */ e(se, { variant: "ghost", onClick: () => Y(!1), children: "Cancel" })
|
|
2968
2968
|
] }),
|
|
2969
2969
|
/* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2970
2970
|
Ye,
|
|
2971
2971
|
{
|
|
2972
|
-
data:
|
|
2973
|
-
columns:
|
|
2974
|
-
loading:
|
|
2972
|
+
data: M,
|
|
2973
|
+
columns: G,
|
|
2974
|
+
loading: U,
|
|
2975
2975
|
emptyContent: "This folder is empty",
|
|
2976
|
-
onRowClick: (
|
|
2976
|
+
onRowClick: (N) => N.type === "folder" ? L(N.name) : ce(N)
|
|
2977
2977
|
}
|
|
2978
2978
|
) })
|
|
2979
2979
|
] }) : /* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2980
2980
|
Ye,
|
|
2981
2981
|
{
|
|
2982
|
-
data:
|
|
2983
|
-
columns:
|
|
2984
|
-
loading:
|
|
2982
|
+
data: w,
|
|
2983
|
+
columns: O,
|
|
2984
|
+
loading: U,
|
|
2985
2985
|
emptyContent: "No storage mounts configured",
|
|
2986
|
-
onRowClick: (
|
|
2986
|
+
onRowClick: (N) => C(N)
|
|
2987
2987
|
}
|
|
2988
2988
|
) }) })
|
|
2989
2989
|
},
|
|
@@ -2991,7 +2991,7 @@ const Gr = ({
|
|
|
2991
2991
|
id: "local",
|
|
2992
2992
|
label: "Local File",
|
|
2993
2993
|
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-border rounded-xl bg-surface-sunk/50", children: [
|
|
2994
|
-
/* @__PURE__ */ e("div", { className: "p-4 bg-accent-soft rounded-full mb-4", children: /* @__PURE__ */ e(
|
|
2994
|
+
/* @__PURE__ */ e("div", { className: "p-4 bg-accent-soft rounded-full mb-4", children: /* @__PURE__ */ e(ee, { icon: je, size: "xl", color: "primary" }) }),
|
|
2995
2995
|
/* @__PURE__ */ e(ue, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
|
|
2996
2996
|
/* @__PURE__ */ c(ue, { variant: "body", size: "sm", className: "text-text-muted mt-1 mb-6 text-center max-w-xs", children: [
|
|
2997
2997
|
"This file will be used directly in the form and will ",
|
|
@@ -2999,15 +2999,15 @@ const Gr = ({
|
|
|
2999
2999
|
" be uploaded to platform storage."
|
|
3000
3000
|
] }),
|
|
3001
3001
|
/* @__PURE__ */ c("label", { className: "cursor-pointer", children: [
|
|
3002
|
-
/* @__PURE__ */ e(se, { variant: "primary", size: "lg", loading:
|
|
3002
|
+
/* @__PURE__ */ e(se, { variant: "primary", size: "lg", loading: U, className: "pointer-events-none", children: "Browse Local File" }),
|
|
3003
3003
|
/* @__PURE__ */ e(
|
|
3004
3004
|
"input",
|
|
3005
3005
|
{
|
|
3006
3006
|
type: "file",
|
|
3007
3007
|
className: "hidden",
|
|
3008
|
-
onChange:
|
|
3008
|
+
onChange: A,
|
|
3009
3009
|
accept: o,
|
|
3010
|
-
disabled:
|
|
3010
|
+
disabled: U
|
|
3011
3011
|
}
|
|
3012
3012
|
)
|
|
3013
3013
|
] })
|
|
@@ -3039,12 +3039,12 @@ const Gr = ({
|
|
|
3039
3039
|
rows: m = 4,
|
|
3040
3040
|
...f
|
|
3041
3041
|
}, b) => {
|
|
3042
|
-
const g =
|
|
3042
|
+
const g = ae.useId(), w = v || `textarea-${g}`, p = !!n, h = n || r ? `${w}-description` : void 0;
|
|
3043
3043
|
return /* @__PURE__ */ c("div", { className: i("flex flex-col", a && "w-full", o), children: [
|
|
3044
3044
|
t && /* @__PURE__ */ e(
|
|
3045
3045
|
"label",
|
|
3046
3046
|
{
|
|
3047
|
-
htmlFor:
|
|
3047
|
+
htmlFor: w,
|
|
3048
3048
|
className: i(
|
|
3049
3049
|
at,
|
|
3050
3050
|
p ? "text-danger-fg" : "text-text-muted",
|
|
@@ -3058,10 +3058,10 @@ const Gr = ({
|
|
|
3058
3058
|
"textarea",
|
|
3059
3059
|
{
|
|
3060
3060
|
ref: b,
|
|
3061
|
-
id:
|
|
3061
|
+
id: w,
|
|
3062
3062
|
rows: m,
|
|
3063
3063
|
"aria-invalid": p || void 0,
|
|
3064
|
-
"aria-describedby":
|
|
3064
|
+
"aria-describedby": h,
|
|
3065
3065
|
className: i(
|
|
3066
3066
|
lt,
|
|
3067
3067
|
"resize-y leading-relaxed",
|
|
@@ -3083,7 +3083,7 @@ const Gr = ({
|
|
|
3083
3083
|
(n || r) && /* @__PURE__ */ e(
|
|
3084
3084
|
"p",
|
|
3085
3085
|
{
|
|
3086
|
-
id:
|
|
3086
|
+
id: h,
|
|
3087
3087
|
className: i("mt-1 text-xs", p ? "text-danger-fg" : "text-text-subtle"),
|
|
3088
3088
|
children: n || r
|
|
3089
3089
|
}
|
|
@@ -3193,95 +3193,103 @@ const bs = ({
|
|
|
3193
3193
|
size: f = "md",
|
|
3194
3194
|
loading: b = !1,
|
|
3195
3195
|
className: g,
|
|
3196
|
-
ref:
|
|
3196
|
+
ref: w,
|
|
3197
3197
|
sdk: p
|
|
3198
3198
|
}) => {
|
|
3199
|
-
const [
|
|
3200
|
-
|
|
3199
|
+
const [h, C] = R(r || {}), z = ae.useId(), P = xe(
|
|
3200
|
+
(x) => `${z}-${String(x).replace(/\./g, "-")}`,
|
|
3201
|
+
[z]
|
|
3202
|
+
), [_, K] = R({}), [U, j] = R({});
|
|
3203
|
+
X(() => {
|
|
3201
3204
|
r && C({ ...r });
|
|
3202
3205
|
}, [r]);
|
|
3203
|
-
const
|
|
3204
|
-
(
|
|
3205
|
-
const
|
|
3206
|
-
if (!
|
|
3207
|
-
if (
|
|
3208
|
-
return `${
|
|
3209
|
-
if (
|
|
3210
|
-
if (
|
|
3211
|
-
return `${
|
|
3212
|
-
if (
|
|
3213
|
-
return `${
|
|
3214
|
-
if (Array.isArray(
|
|
3215
|
-
const
|
|
3216
|
-
let
|
|
3217
|
-
if (
|
|
3218
|
-
const
|
|
3219
|
-
for (const
|
|
3220
|
-
const
|
|
3221
|
-
if (
|
|
3222
|
-
|
|
3223
|
-
else if (
|
|
3224
|
-
const
|
|
3225
|
-
|
|
3206
|
+
const B = xe(
|
|
3207
|
+
(x, S, D) => {
|
|
3208
|
+
const E = t.flatMap((A) => A.items).find((A) => A.name === x);
|
|
3209
|
+
if (!E) return null;
|
|
3210
|
+
if (E.required && (S == null || S === ""))
|
|
3211
|
+
return `${E.label} is required`;
|
|
3212
|
+
if (E.type === "array") {
|
|
3213
|
+
if (E.required && (!S || S.length === 0))
|
|
3214
|
+
return `${E.label} cannot be empty.`;
|
|
3215
|
+
if (S && !Array.isArray(S))
|
|
3216
|
+
return `${E.label} must be an array.`;
|
|
3217
|
+
if (Array.isArray(S) && E.arrayFields) {
|
|
3218
|
+
const A = [];
|
|
3219
|
+
let $ = !1;
|
|
3220
|
+
if (S.forEach((oe, ce) => {
|
|
3221
|
+
const q = {};
|
|
3222
|
+
for (const H of E.arrayFields) {
|
|
3223
|
+
const L = oe?.[H.name];
|
|
3224
|
+
if (H.required && (L == null || L === ""))
|
|
3225
|
+
q[H.name] = `${H.label} is required`, $ = !0;
|
|
3226
|
+
else if (H.validator) {
|
|
3227
|
+
const k = H.validator(L, oe);
|
|
3228
|
+
k && (q[H.name] = k, $ = !0);
|
|
3226
3229
|
}
|
|
3227
3230
|
}
|
|
3228
|
-
|
|
3229
|
-
}),
|
|
3230
|
-
return JSON.stringify(
|
|
3231
|
+
A[ce] = q;
|
|
3232
|
+
}), $)
|
|
3233
|
+
return JSON.stringify(A);
|
|
3231
3234
|
}
|
|
3232
3235
|
}
|
|
3233
|
-
return
|
|
3236
|
+
return E.validator ? E.validator(S, D) : null;
|
|
3234
3237
|
},
|
|
3235
3238
|
[t]
|
|
3236
|
-
),
|
|
3237
|
-
(
|
|
3238
|
-
let
|
|
3239
|
+
), W = xe(
|
|
3240
|
+
(x, S) => {
|
|
3241
|
+
let D = Xr(
|
|
3242
|
+
h,
|
|
3239
3243
|
x,
|
|
3240
|
-
|
|
3241
|
-
h
|
|
3244
|
+
S
|
|
3242
3245
|
);
|
|
3243
|
-
t.flatMap((
|
|
3244
|
-
const
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
[
|
|
3248
|
-
})), a?.(
|
|
3246
|
+
t.flatMap(($) => $.items).find(($) => $.name === x)?.removeIfEmpty && (S == null || S === "") && (D = Zr(D, x)), C(D), j(($) => ({ ...$, [x]: !0 }));
|
|
3247
|
+
const A = B(x, S, D);
|
|
3248
|
+
K(($) => ({
|
|
3249
|
+
...$,
|
|
3250
|
+
[x]: A || ""
|
|
3251
|
+
})), a?.(D, x);
|
|
3249
3252
|
},
|
|
3250
|
-
[
|
|
3251
|
-
),
|
|
3252
|
-
async (
|
|
3253
|
-
if (
|
|
3254
|
-
const
|
|
3255
|
-
for (const
|
|
3256
|
-
if (
|
|
3253
|
+
[h, t, B, a]
|
|
3254
|
+
), Z = xe(
|
|
3255
|
+
async (x) => {
|
|
3256
|
+
if (x.preventDefault(), b) return;
|
|
3257
|
+
const S = {}, D = t.flatMap((A) => A.items);
|
|
3258
|
+
for (const A of D) {
|
|
3259
|
+
if (A.hidden || A.conditional && !A.conditional(h))
|
|
3257
3260
|
continue;
|
|
3258
|
-
const
|
|
3259
|
-
|
|
3260
|
-
Ze(
|
|
3261
|
-
|
|
3261
|
+
const $ = B(
|
|
3262
|
+
A.name,
|
|
3263
|
+
Ze(h, A.name),
|
|
3264
|
+
h
|
|
3262
3265
|
);
|
|
3263
|
-
|
|
3266
|
+
$ && (S[A.name] = $);
|
|
3264
3267
|
}
|
|
3265
3268
|
if (o) {
|
|
3266
|
-
const
|
|
3267
|
-
|
|
3269
|
+
const A = o(h);
|
|
3270
|
+
A && Object.assign(S, A);
|
|
3268
3271
|
}
|
|
3269
|
-
if (
|
|
3272
|
+
if (K(S), Object.keys(S).some((A) => S[A]))
|
|
3270
3273
|
return;
|
|
3271
|
-
const
|
|
3272
|
-
await n?.(
|
|
3274
|
+
const E = l ? l(h) : h;
|
|
3275
|
+
await n?.(h, E);
|
|
3273
3276
|
},
|
|
3274
|
-
[
|
|
3275
|
-
),
|
|
3276
|
-
(
|
|
3277
|
-
const
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3277
|
+
[h, t, B, o, l, n, b]
|
|
3278
|
+
), J = xe(
|
|
3279
|
+
(x) => {
|
|
3280
|
+
const S = Ze(h, x.name), D = U[x.name] ? _[x.name] : void 0, E = x.disabled || b, A = {
|
|
3281
|
+
// Ties the field to the `<label>` the group wrapper renders. The primitives all
|
|
3282
|
+
// support `htmlFor`/`id` — `Form` just never wired them, so every label was
|
|
3283
|
+
// unassociated: a screen reader announced nothing, clicking a label focused
|
|
3284
|
+
// nothing, and a test could not find a field by its label either.
|
|
3285
|
+
id: P(x.name),
|
|
3286
|
+
value: S || "",
|
|
3287
|
+
disabled: E,
|
|
3288
|
+
required: x.required,
|
|
3289
|
+
placeholder: x.placeholder,
|
|
3290
|
+
...x.fieldProps
|
|
3283
3291
|
};
|
|
3284
|
-
switch (
|
|
3292
|
+
switch (x.type) {
|
|
3285
3293
|
case "text":
|
|
3286
3294
|
case "email":
|
|
3287
3295
|
case "password":
|
|
@@ -3292,11 +3300,11 @@ const bs = ({
|
|
|
3292
3300
|
return /* @__PURE__ */ e(
|
|
3293
3301
|
Ce,
|
|
3294
3302
|
{
|
|
3295
|
-
|
|
3296
|
-
onChange: (
|
|
3297
|
-
type:
|
|
3298
|
-
...Xe(
|
|
3299
|
-
error:
|
|
3303
|
+
...A,
|
|
3304
|
+
onChange: ($) => W(x.name, $.target.value),
|
|
3305
|
+
type: x.textType || x.type,
|
|
3306
|
+
...Xe(x.autocomplete),
|
|
3307
|
+
error: D,
|
|
3300
3308
|
size: f
|
|
3301
3309
|
}
|
|
3302
3310
|
);
|
|
@@ -3304,27 +3312,27 @@ const bs = ({
|
|
|
3304
3312
|
return /* @__PURE__ */ e(
|
|
3305
3313
|
He,
|
|
3306
3314
|
{
|
|
3307
|
-
|
|
3308
|
-
onChange: (
|
|
3309
|
-
rows:
|
|
3310
|
-
error:
|
|
3315
|
+
...A,
|
|
3316
|
+
onChange: ($) => W(x.name, $.target.value),
|
|
3317
|
+
rows: x.rows ?? 4,
|
|
3318
|
+
error: D,
|
|
3311
3319
|
size: f
|
|
3312
3320
|
}
|
|
3313
3321
|
);
|
|
3314
3322
|
case "select":
|
|
3315
3323
|
return /* @__PURE__ */ e(
|
|
3316
|
-
|
|
3324
|
+
De,
|
|
3317
3325
|
{
|
|
3318
|
-
|
|
3319
|
-
onChange: (
|
|
3320
|
-
options: (
|
|
3321
|
-
|
|
3322
|
-
value: String(
|
|
3326
|
+
...A,
|
|
3327
|
+
onChange: ($) => W(x.name, $),
|
|
3328
|
+
options: (x.options || []).map(($) => ({
|
|
3329
|
+
...$,
|
|
3330
|
+
value: String($.value)
|
|
3323
3331
|
})),
|
|
3324
|
-
searchable:
|
|
3325
|
-
multiple:
|
|
3326
|
-
allowCreate:
|
|
3327
|
-
error:
|
|
3332
|
+
searchable: x.searchable,
|
|
3333
|
+
multiple: x.multiple,
|
|
3334
|
+
allowCreate: x.allowCreate,
|
|
3335
|
+
error: D,
|
|
3328
3336
|
size: f
|
|
3329
3337
|
}
|
|
3330
3338
|
);
|
|
@@ -3335,30 +3343,30 @@ const bs = ({
|
|
|
3335
3343
|
return /* @__PURE__ */ e(
|
|
3336
3344
|
fr,
|
|
3337
3345
|
{
|
|
3338
|
-
"aria-label":
|
|
3339
|
-
value:
|
|
3340
|
-
onChange: (
|
|
3341
|
-
options: (
|
|
3342
|
-
value: String(
|
|
3343
|
-
label:
|
|
3346
|
+
"aria-label": x.label,
|
|
3347
|
+
value: S == null ? "" : String(S),
|
|
3348
|
+
onChange: ($) => W(x.name, $),
|
|
3349
|
+
options: (x.options || []).map(($) => ({
|
|
3350
|
+
value: String($.value),
|
|
3351
|
+
label: $.label
|
|
3344
3352
|
})),
|
|
3345
3353
|
size: f === "sm" ? "sm" : "md",
|
|
3346
|
-
className:
|
|
3354
|
+
className: x.disabled ? "pointer-events-none opacity-50" : void 0
|
|
3347
3355
|
}
|
|
3348
3356
|
);
|
|
3349
3357
|
case "checkbox":
|
|
3350
3358
|
return /* @__PURE__ */ e(
|
|
3351
3359
|
we,
|
|
3352
3360
|
{
|
|
3353
|
-
|
|
3354
|
-
label:
|
|
3355
|
-
checked: !!
|
|
3356
|
-
onChange: (
|
|
3361
|
+
...A,
|
|
3362
|
+
label: x.label,
|
|
3363
|
+
checked: !!S,
|
|
3364
|
+
onChange: ($) => W(x.name, $.target.checked),
|
|
3357
3365
|
size: f
|
|
3358
3366
|
}
|
|
3359
3367
|
);
|
|
3360
3368
|
case "radio":
|
|
3361
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children:
|
|
3369
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: x.options?.map(($) => /* @__PURE__ */ c(
|
|
3362
3370
|
"label",
|
|
3363
3371
|
{
|
|
3364
3372
|
className: "flex cursor-pointer items-center gap-3 text-base text-text",
|
|
@@ -3367,26 +3375,26 @@ const bs = ({
|
|
|
3367
3375
|
"input",
|
|
3368
3376
|
{
|
|
3369
3377
|
type: "radio",
|
|
3370
|
-
name:
|
|
3371
|
-
value:
|
|
3372
|
-
checked:
|
|
3373
|
-
onChange: () =>
|
|
3374
|
-
disabled:
|
|
3378
|
+
name: x.name,
|
|
3379
|
+
value: $.value,
|
|
3380
|
+
checked: S === $.value,
|
|
3381
|
+
onChange: () => W(x.name, $.value),
|
|
3382
|
+
disabled: E || $.disabled,
|
|
3375
3383
|
className: "size-checkbox shrink-0 rounded-xs border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3376
3384
|
}
|
|
3377
3385
|
),
|
|
3378
|
-
|
|
3386
|
+
$.label
|
|
3379
3387
|
]
|
|
3380
3388
|
},
|
|
3381
|
-
|
|
3389
|
+
$.value
|
|
3382
3390
|
)) });
|
|
3383
3391
|
case "date":
|
|
3384
3392
|
return /* @__PURE__ */ e(
|
|
3385
3393
|
Be,
|
|
3386
3394
|
{
|
|
3387
|
-
|
|
3388
|
-
value:
|
|
3389
|
-
onChange: (
|
|
3395
|
+
...A,
|
|
3396
|
+
value: S ? new Date(S) : null,
|
|
3397
|
+
onChange: ($) => W(x.name, $),
|
|
3390
3398
|
size: f
|
|
3391
3399
|
}
|
|
3392
3400
|
);
|
|
@@ -3394,96 +3402,96 @@ const bs = ({
|
|
|
3394
3402
|
return /* @__PURE__ */ e(
|
|
3395
3403
|
Gr,
|
|
3396
3404
|
{
|
|
3397
|
-
|
|
3398
|
-
value:
|
|
3399
|
-
onChange: (
|
|
3400
|
-
error:
|
|
3401
|
-
onListFiles: (
|
|
3405
|
+
...A,
|
|
3406
|
+
value: S,
|
|
3407
|
+
onChange: ($) => W(x.name, $),
|
|
3408
|
+
error: D,
|
|
3409
|
+
onListFiles: ($) => p?.http.invoke({
|
|
3402
3410
|
method: "POST",
|
|
3403
3411
|
action: "storage.file.list",
|
|
3404
|
-
body:
|
|
3412
|
+
body: $
|
|
3405
3413
|
}),
|
|
3406
3414
|
onListMounts: () => p?.http.invoke({
|
|
3407
3415
|
method: "GET",
|
|
3408
3416
|
action: "storage.mount"
|
|
3409
3417
|
}),
|
|
3410
|
-
onUploadFile: (
|
|
3418
|
+
onUploadFile: ($) => p?.http.invoke({
|
|
3411
3419
|
method: "POST",
|
|
3412
3420
|
action: "storage.file.upload",
|
|
3413
|
-
body:
|
|
3421
|
+
body: $
|
|
3414
3422
|
}),
|
|
3415
|
-
onDownloadFile: (
|
|
3423
|
+
onDownloadFile: ($) => p?.http.invoke({
|
|
3416
3424
|
method: "GET",
|
|
3417
|
-
action: `storage.file.${
|
|
3425
|
+
action: `storage.file.${$}.download`
|
|
3418
3426
|
}),
|
|
3419
|
-
onRegisterFile: (
|
|
3427
|
+
onRegisterFile: ($) => p?.http.invoke({
|
|
3420
3428
|
method: "POST",
|
|
3421
3429
|
action: "storage.file.folder",
|
|
3422
|
-
body:
|
|
3430
|
+
body: $
|
|
3423
3431
|
})
|
|
3424
3432
|
}
|
|
3425
3433
|
);
|
|
3426
3434
|
case "folder":
|
|
3427
3435
|
return /* @__PURE__ */ e(
|
|
3428
|
-
|
|
3436
|
+
Dr,
|
|
3429
3437
|
{
|
|
3430
|
-
value:
|
|
3431
|
-
onChange: (
|
|
3438
|
+
value: S || {},
|
|
3439
|
+
onChange: ($) => W(x.name, $),
|
|
3432
3440
|
onListFolders: () => p?.http.invoke({
|
|
3433
3441
|
method: "GET",
|
|
3434
3442
|
action: "storage.mount"
|
|
3435
3443
|
}),
|
|
3436
|
-
disabled:
|
|
3444
|
+
disabled: E,
|
|
3437
3445
|
size: f,
|
|
3438
|
-
placeholder:
|
|
3446
|
+
placeholder: x.placeholder
|
|
3439
3447
|
}
|
|
3440
3448
|
);
|
|
3441
3449
|
case "custom":
|
|
3442
|
-
return
|
|
3443
|
-
value:
|
|
3444
|
-
onChange: (
|
|
3445
|
-
error:
|
|
3446
|
-
disabled:
|
|
3450
|
+
return x.customComponent?.({
|
|
3451
|
+
value: S,
|
|
3452
|
+
onChange: ($) => W(x.name, $),
|
|
3453
|
+
error: D,
|
|
3454
|
+
disabled: E
|
|
3447
3455
|
});
|
|
3448
3456
|
case "array": {
|
|
3449
|
-
const
|
|
3450
|
-
let
|
|
3451
|
-
if (typeof
|
|
3457
|
+
const $ = S || [];
|
|
3458
|
+
let oe = [];
|
|
3459
|
+
if (typeof D == "string" && D.startsWith("["))
|
|
3452
3460
|
try {
|
|
3453
|
-
|
|
3461
|
+
oe = JSON.parse(D);
|
|
3454
3462
|
} catch {
|
|
3455
3463
|
}
|
|
3456
|
-
const
|
|
3457
|
-
|
|
3458
|
-
},
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3464
|
+
const ce = () => {
|
|
3465
|
+
W(x.name, [...$, {}]);
|
|
3466
|
+
}, q = (L) => {
|
|
3467
|
+
W(
|
|
3468
|
+
x.name,
|
|
3469
|
+
$.filter((k, M) => M !== L)
|
|
3462
3470
|
);
|
|
3463
|
-
},
|
|
3464
|
-
const
|
|
3465
|
-
|
|
3466
|
-
...
|
|
3467
|
-
[
|
|
3468
|
-
},
|
|
3471
|
+
}, H = (L, k, M) => {
|
|
3472
|
+
const G = [...$];
|
|
3473
|
+
G[L] = {
|
|
3474
|
+
...G[L],
|
|
3475
|
+
[k]: M
|
|
3476
|
+
}, W(x.name, G);
|
|
3469
3477
|
};
|
|
3470
3478
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
3471
|
-
|
|
3472
|
-
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children:
|
|
3473
|
-
const
|
|
3479
|
+
$.map((L, k) => /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
|
|
3480
|
+
/* @__PURE__ */ e("div", { className: "grid flex-1 gap-2 sm:grid-cols-2", children: x.arrayFields?.map((M) => {
|
|
3481
|
+
const G = oe?.[k]?.[M.name];
|
|
3474
3482
|
return /* @__PURE__ */ c(
|
|
3475
3483
|
"div",
|
|
3476
3484
|
{
|
|
3477
3485
|
className: "flex flex-col gap-1",
|
|
3478
3486
|
children: [
|
|
3479
|
-
|
|
3487
|
+
k === 0 && /* @__PURE__ */ c("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
|
|
3480
3488
|
M.label,
|
|
3481
3489
|
M.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3482
3490
|
] }),
|
|
3483
3491
|
(() => {
|
|
3484
|
-
const
|
|
3485
|
-
value:
|
|
3486
|
-
disabled:
|
|
3492
|
+
const O = {
|
|
3493
|
+
value: L?.[M.name] || "",
|
|
3494
|
+
disabled: E,
|
|
3487
3495
|
required: M.required,
|
|
3488
3496
|
placeholder: M.placeholder,
|
|
3489
3497
|
...M.fieldProps
|
|
@@ -3498,15 +3506,15 @@ const bs = ({
|
|
|
3498
3506
|
return /* @__PURE__ */ e(
|
|
3499
3507
|
Ce,
|
|
3500
3508
|
{
|
|
3501
|
-
...
|
|
3502
|
-
onChange: (
|
|
3503
|
-
|
|
3509
|
+
...O,
|
|
3510
|
+
onChange: (N) => H(
|
|
3511
|
+
k,
|
|
3504
3512
|
M.name,
|
|
3505
|
-
|
|
3513
|
+
N.target.value
|
|
3506
3514
|
),
|
|
3507
3515
|
type: M.textType || M.type,
|
|
3508
3516
|
...Xe(M.autocomplete),
|
|
3509
|
-
error:
|
|
3517
|
+
error: G,
|
|
3510
3518
|
size: f
|
|
3511
3519
|
}
|
|
3512
3520
|
);
|
|
@@ -3514,37 +3522,37 @@ const bs = ({
|
|
|
3514
3522
|
return /* @__PURE__ */ e(
|
|
3515
3523
|
He,
|
|
3516
3524
|
{
|
|
3517
|
-
...
|
|
3518
|
-
onChange: (
|
|
3519
|
-
|
|
3525
|
+
...O,
|
|
3526
|
+
onChange: (N) => H(
|
|
3527
|
+
k,
|
|
3520
3528
|
M.name,
|
|
3521
|
-
|
|
3529
|
+
N.target.value
|
|
3522
3530
|
),
|
|
3523
3531
|
rows: M.rows ?? 4,
|
|
3524
|
-
error:
|
|
3532
|
+
error: G,
|
|
3525
3533
|
size: f
|
|
3526
3534
|
}
|
|
3527
3535
|
);
|
|
3528
3536
|
case "select":
|
|
3529
3537
|
return /* @__PURE__ */ e(
|
|
3530
|
-
|
|
3538
|
+
De,
|
|
3531
3539
|
{
|
|
3532
|
-
...
|
|
3533
|
-
onChange: (
|
|
3534
|
-
|
|
3540
|
+
...O,
|
|
3541
|
+
onChange: (N) => H(
|
|
3542
|
+
k,
|
|
3535
3543
|
M.name,
|
|
3536
|
-
|
|
3544
|
+
N
|
|
3537
3545
|
),
|
|
3538
3546
|
options: (M.options || []).map(
|
|
3539
|
-
(
|
|
3540
|
-
...
|
|
3541
|
-
value: String(
|
|
3547
|
+
(N) => ({
|
|
3548
|
+
...N,
|
|
3549
|
+
value: String(N.value)
|
|
3542
3550
|
})
|
|
3543
3551
|
),
|
|
3544
3552
|
searchable: M.searchable,
|
|
3545
3553
|
multiple: M.multiple,
|
|
3546
3554
|
allowCreate: M.allowCreate,
|
|
3547
|
-
error:
|
|
3555
|
+
error: G,
|
|
3548
3556
|
size: f
|
|
3549
3557
|
}
|
|
3550
3558
|
);
|
|
@@ -3552,18 +3560,18 @@ const bs = ({
|
|
|
3552
3560
|
return /* @__PURE__ */ e(
|
|
3553
3561
|
we,
|
|
3554
3562
|
{
|
|
3555
|
-
...
|
|
3556
|
-
checked: !!
|
|
3557
|
-
onChange: (
|
|
3558
|
-
|
|
3563
|
+
...O,
|
|
3564
|
+
checked: !!L?.[M.name],
|
|
3565
|
+
onChange: (N) => H(
|
|
3566
|
+
k,
|
|
3559
3567
|
M.name,
|
|
3560
|
-
|
|
3568
|
+
N.target.checked
|
|
3561
3569
|
),
|
|
3562
3570
|
size: f
|
|
3563
3571
|
}
|
|
3564
3572
|
);
|
|
3565
3573
|
case "radio":
|
|
3566
|
-
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: M.options?.map((
|
|
3574
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: M.options?.map((N) => /* @__PURE__ */ c(
|
|
3567
3575
|
"label",
|
|
3568
3576
|
{
|
|
3569
3577
|
className: "flex cursor-pointer items-center gap-2 text-base text-text",
|
|
@@ -3572,34 +3580,34 @@ const bs = ({
|
|
|
3572
3580
|
"input",
|
|
3573
3581
|
{
|
|
3574
3582
|
type: "radio",
|
|
3575
|
-
name: `${
|
|
3576
|
-
value:
|
|
3577
|
-
checked:
|
|
3578
|
-
onChange: () =>
|
|
3579
|
-
|
|
3583
|
+
name: `${x.name}.${k}.${M.name}`,
|
|
3584
|
+
value: N.value,
|
|
3585
|
+
checked: L?.[M.name] === N.value,
|
|
3586
|
+
onChange: () => H(
|
|
3587
|
+
k,
|
|
3580
3588
|
M.name,
|
|
3581
|
-
|
|
3589
|
+
N.value
|
|
3582
3590
|
),
|
|
3583
|
-
disabled:
|
|
3591
|
+
disabled: E || N.disabled,
|
|
3584
3592
|
className: "size-checkbox shrink-0 rounded-xs border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3585
3593
|
}
|
|
3586
3594
|
),
|
|
3587
|
-
|
|
3595
|
+
N.label
|
|
3588
3596
|
]
|
|
3589
3597
|
},
|
|
3590
|
-
|
|
3598
|
+
N.value
|
|
3591
3599
|
)) });
|
|
3592
3600
|
case "date": {
|
|
3593
|
-
const
|
|
3601
|
+
const N = L?.[M.name];
|
|
3594
3602
|
return /* @__PURE__ */ e(
|
|
3595
3603
|
Be,
|
|
3596
3604
|
{
|
|
3597
|
-
...
|
|
3598
|
-
value:
|
|
3599
|
-
onChange: (
|
|
3600
|
-
|
|
3605
|
+
...O,
|
|
3606
|
+
value: N ? new Date(N) : null,
|
|
3607
|
+
onChange: (I) => H(
|
|
3608
|
+
k,
|
|
3601
3609
|
M.name,
|
|
3602
|
-
|
|
3610
|
+
I
|
|
3603
3611
|
),
|
|
3604
3612
|
size: f
|
|
3605
3613
|
}
|
|
@@ -3607,14 +3615,14 @@ const bs = ({
|
|
|
3607
3615
|
}
|
|
3608
3616
|
case "custom":
|
|
3609
3617
|
return M.customComponent?.({
|
|
3610
|
-
value:
|
|
3611
|
-
onChange: (
|
|
3612
|
-
|
|
3618
|
+
value: L?.[M.name],
|
|
3619
|
+
onChange: (N) => H(
|
|
3620
|
+
k,
|
|
3613
3621
|
M.name,
|
|
3614
|
-
|
|
3622
|
+
N
|
|
3615
3623
|
),
|
|
3616
|
-
error:
|
|
3617
|
-
disabled:
|
|
3624
|
+
error: G,
|
|
3625
|
+
disabled: E
|
|
3618
3626
|
});
|
|
3619
3627
|
// Add other field types here as needed
|
|
3620
3628
|
default:
|
|
@@ -3625,7 +3633,7 @@ const bs = ({
|
|
|
3625
3633
|
] });
|
|
3626
3634
|
}
|
|
3627
3635
|
})(),
|
|
3628
|
-
|
|
3636
|
+
G && /* @__PURE__ */ e("p", { className: "text-xs text-danger-fg", children: G })
|
|
3629
3637
|
]
|
|
3630
3638
|
},
|
|
3631
3639
|
M.name
|
|
@@ -3638,24 +3646,24 @@ const bs = ({
|
|
|
3638
3646
|
iconOnly: !0,
|
|
3639
3647
|
variant: "ghost",
|
|
3640
3648
|
size: "md",
|
|
3641
|
-
"aria-label": `${
|
|
3642
|
-
onClick: () =>
|
|
3643
|
-
disabled:
|
|
3644
|
-
className: i("shrink-0",
|
|
3649
|
+
"aria-label": `${x.label} verwijderen`,
|
|
3650
|
+
onClick: () => q(k),
|
|
3651
|
+
disabled: E,
|
|
3652
|
+
className: i("shrink-0", k === 0 && "mt-5"),
|
|
3645
3653
|
children: /* @__PURE__ */ e(Pt, { className: "size-icon-md" })
|
|
3646
3654
|
}
|
|
3647
3655
|
)
|
|
3648
|
-
] },
|
|
3656
|
+
] }, k)),
|
|
3649
3657
|
/* @__PURE__ */ c(
|
|
3650
3658
|
se,
|
|
3651
3659
|
{
|
|
3652
3660
|
type: "button",
|
|
3653
3661
|
variant: "secondary",
|
|
3654
3662
|
leftIcon: /* @__PURE__ */ e(Ot, { className: "size-icon-sm" }),
|
|
3655
|
-
onClick:
|
|
3656
|
-
disabled:
|
|
3663
|
+
onClick: ce,
|
|
3664
|
+
disabled: E,
|
|
3657
3665
|
children: [
|
|
3658
|
-
|
|
3666
|
+
x.label,
|
|
3659
3667
|
" toevoegen"
|
|
3660
3668
|
]
|
|
3661
3669
|
}
|
|
@@ -3666,22 +3674,22 @@ const bs = ({
|
|
|
3666
3674
|
return null;
|
|
3667
3675
|
}
|
|
3668
3676
|
},
|
|
3669
|
-
[
|
|
3670
|
-
),
|
|
3671
|
-
(
|
|
3672
|
-
if (
|
|
3677
|
+
[h, U, _, b, f, W]
|
|
3678
|
+
), de = xe(
|
|
3679
|
+
(x) => {
|
|
3680
|
+
if (x.conditional && !x.conditional(h))
|
|
3673
3681
|
return null;
|
|
3674
|
-
const
|
|
3675
|
-
if (
|
|
3676
|
-
const
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
"grid-cols-1": !
|
|
3680
|
-
"grid-cols-2":
|
|
3681
|
-
"grid-cols-3":
|
|
3682
|
-
"grid-cols-4":
|
|
3682
|
+
const S = x.items.filter((E) => !(E.hidden || E.conditional && !E.conditional(h)));
|
|
3683
|
+
if (S.length === 0) return null;
|
|
3684
|
+
const D = i(
|
|
3685
|
+
x.layout === "flex" ? "flex flex-wrap gap-3.5" : "grid gap-3.5",
|
|
3686
|
+
x.layout !== "flex" && {
|
|
3687
|
+
"grid-cols-1": !x.columns || x.columns === 1,
|
|
3688
|
+
"grid-cols-2": x.columns === 2,
|
|
3689
|
+
"grid-cols-3": x.columns === 3,
|
|
3690
|
+
"grid-cols-4": x.columns === 4
|
|
3683
3691
|
},
|
|
3684
|
-
|
|
3692
|
+
x.className
|
|
3685
3693
|
);
|
|
3686
3694
|
return (
|
|
3687
3695
|
// A band across the page, closed off with a hairline — no card. The
|
|
@@ -3690,41 +3698,48 @@ const bs = ({
|
|
|
3690
3698
|
/* @__PURE__ */ e(
|
|
3691
3699
|
Qr,
|
|
3692
3700
|
{
|
|
3693
|
-
title:
|
|
3694
|
-
description:
|
|
3701
|
+
title: x.title,
|
|
3702
|
+
description: x.description,
|
|
3695
3703
|
className: "not-last:border-b not-last:border-border-subtle",
|
|
3696
|
-
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className:
|
|
3697
|
-
const
|
|
3704
|
+
children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className: D, children: S.map((E) => {
|
|
3705
|
+
const A = U[E.name] ? _[E.name] : void 0;
|
|
3698
3706
|
return /* @__PURE__ */ c(
|
|
3699
3707
|
"div",
|
|
3700
3708
|
{
|
|
3701
3709
|
className: i(
|
|
3702
3710
|
"flex min-w-0 flex-col gap-1.5",
|
|
3703
|
-
|
|
3711
|
+
E.type === "checkbox" && "justify-center"
|
|
3704
3712
|
),
|
|
3705
3713
|
style: {
|
|
3706
|
-
width: typeof
|
|
3707
|
-
gridColumn: typeof
|
|
3714
|
+
width: typeof E.width == "string" ? E.width : void 0,
|
|
3715
|
+
gridColumn: typeof E.width == "number" ? `span ${E.width} / span ${E.width}` : void 0
|
|
3708
3716
|
},
|
|
3709
3717
|
children: [
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3718
|
+
E.type !== "custom" && E.type !== "checkbox" && /* @__PURE__ */ c(
|
|
3719
|
+
"label",
|
|
3720
|
+
{
|
|
3721
|
+
htmlFor: P(E.name),
|
|
3722
|
+
className: "block text-sm font-medium text-text-muted",
|
|
3723
|
+
children: [
|
|
3724
|
+
E.label,
|
|
3725
|
+
E.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3726
|
+
]
|
|
3727
|
+
}
|
|
3728
|
+
),
|
|
3729
|
+
J(E),
|
|
3730
|
+
E.help && !A && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-text-subtle", children: E.help })
|
|
3716
3731
|
]
|
|
3717
3732
|
},
|
|
3718
|
-
|
|
3733
|
+
E.name
|
|
3719
3734
|
);
|
|
3720
3735
|
}) }) })
|
|
3721
3736
|
},
|
|
3722
|
-
|
|
3737
|
+
x.id
|
|
3723
3738
|
)
|
|
3724
3739
|
);
|
|
3725
3740
|
},
|
|
3726
|
-
[
|
|
3727
|
-
),
|
|
3741
|
+
[h, U, _, J]
|
|
3742
|
+
), Y = i(
|
|
3728
3743
|
{
|
|
3729
3744
|
"max-w-settings": f === "sm",
|
|
3730
3745
|
"max-w-form": f === "md",
|
|
@@ -3732,10 +3747,10 @@ const bs = ({
|
|
|
3732
3747
|
"max-w-full": f === "full"
|
|
3733
3748
|
},
|
|
3734
3749
|
g
|
|
3735
|
-
),
|
|
3736
|
-
return /* @__PURE__ */ c("form", { ref:
|
|
3750
|
+
), y = f === "full" ? "md" : f;
|
|
3751
|
+
return /* @__PURE__ */ c("form", { ref: w, onSubmit: Z, className: Y, children: [
|
|
3737
3752
|
!v && /* @__PURE__ */ e("button", { type: "submit", className: "hidden", tabIndex: -1, "aria-hidden": !0 }),
|
|
3738
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(
|
|
3753
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(de) }),
|
|
3739
3754
|
v && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle py-4", children: /* @__PURE__ */ c(Ee, { children: [
|
|
3740
3755
|
/* @__PURE__ */ e("div", { className: "ml-auto" }),
|
|
3741
3756
|
s && /* @__PURE__ */ e(
|
|
@@ -3743,7 +3758,7 @@ const bs = ({
|
|
|
3743
3758
|
{
|
|
3744
3759
|
type: "button",
|
|
3745
3760
|
variant: d.variant ?? "ghost",
|
|
3746
|
-
size: d.size ||
|
|
3761
|
+
size: d.size || y,
|
|
3747
3762
|
disabled: d.disabled || b,
|
|
3748
3763
|
onClick: s,
|
|
3749
3764
|
className: d.className,
|
|
@@ -3755,7 +3770,7 @@ const bs = ({
|
|
|
3755
3770
|
{
|
|
3756
3771
|
type: "submit",
|
|
3757
3772
|
variant: u.variant,
|
|
3758
|
-
size: u.size ||
|
|
3773
|
+
size: u.size || y,
|
|
3759
3774
|
disabled: u.disabled || b,
|
|
3760
3775
|
loading: b,
|
|
3761
3776
|
className: u.className,
|
|
@@ -3865,7 +3880,7 @@ function nn({
|
|
|
3865
3880
|
onClick: l,
|
|
3866
3881
|
className: "ml-1.5 flex-shrink-0 hover:opacity-70 transition-opacity",
|
|
3867
3882
|
"aria-label": "Remove badge",
|
|
3868
|
-
children: /* @__PURE__ */ e(
|
|
3883
|
+
children: /* @__PURE__ */ e(ee, { icon: Se, size: "xs", color: "current" })
|
|
3869
3884
|
}
|
|
3870
3885
|
)
|
|
3871
3886
|
]
|
|
@@ -4385,7 +4400,7 @@ function kn(t) {
|
|
|
4385
4400
|
return r.length >= 2 ? (r[0][0] + r[1][0]).toUpperCase() : r.length === 1 ? r[0].slice(0, 2).toUpperCase() : "?";
|
|
4386
4401
|
}
|
|
4387
4402
|
const Cn = ({ name: t, src: r, tone: n = "default", size: s = "sm", className: a, title: l }) => {
|
|
4388
|
-
const [o, u] =
|
|
4403
|
+
const [o, u] = ae.useState(!1), d = i(
|
|
4389
4404
|
// Its own token and not `surface-hover`: at 0.972 the plate was within a few
|
|
4390
4405
|
// percent of every surface it sits on, so the monogram floated instead of
|
|
4391
4406
|
// sitting in a disc.
|
|
@@ -4442,7 +4457,7 @@ const Cn = ({ name: t, src: r, tone: n = "default", size: s = "sm", className: a
|
|
|
4442
4457
|
}
|
|
4443
4458
|
)
|
|
4444
4459
|
] });
|
|
4445
|
-
},
|
|
4460
|
+
}, $e = {
|
|
4446
4461
|
mail: { fg: "text-channel-mail-fg", bg: "bg-channel-mail-soft" },
|
|
4447
4462
|
wa: { fg: "text-channel-whatsapp-fg", bg: "bg-channel-whatsapp-soft" },
|
|
4448
4463
|
chat: { fg: "text-channel-chat-fg", bg: "bg-channel-chat-soft" },
|
|
@@ -4454,7 +4469,7 @@ const Cn = ({ name: t, src: r, tone: n = "default", size: s = "sm", className: a
|
|
|
4454
4469
|
lg: "size-avatar-lg rounded-md text-base"
|
|
4455
4470
|
};
|
|
4456
4471
|
function zs({ channel: t, children: r, size: n = "md", className: s, title: a }) {
|
|
4457
|
-
const l = t in
|
|
4472
|
+
const l = t in $e ? $e[t] : void 0;
|
|
4458
4473
|
return /* @__PURE__ */ e(
|
|
4459
4474
|
"span",
|
|
4460
4475
|
{
|
|
@@ -4465,7 +4480,7 @@ function zs({ channel: t, children: r, size: n = "md", className: s, title: a })
|
|
|
4465
4480
|
// An undeclared channel used to collapse onto the neutral "note" tone,
|
|
4466
4481
|
// which is also what a real internal note looks like. Deriving from the
|
|
4467
4482
|
// key keeps it distinguishable and keeps `note` meaning `note`.
|
|
4468
|
-
l ? i(l.fg, l.bg) : t ? rt(t) : i(
|
|
4483
|
+
l ? i(l.fg, l.bg) : t ? rt(t) : i($e.note.fg, $e.note.bg),
|
|
4469
4484
|
s
|
|
4470
4485
|
),
|
|
4471
4486
|
children: r
|
|
@@ -4488,15 +4503,15 @@ const Ms = ({
|
|
|
4488
4503
|
onError: b,
|
|
4489
4504
|
...g
|
|
4490
4505
|
}) => {
|
|
4491
|
-
const [
|
|
4492
|
-
p(!1), C(!1), f?.(
|
|
4493
|
-
}, K = (
|
|
4494
|
-
if (p(!1), C(!0), u &&
|
|
4495
|
-
|
|
4506
|
+
const [w, p] = R(!0), [h, C] = R(!1), [z, P] = R(t), _ = (J) => {
|
|
4507
|
+
p(!1), C(!1), f?.(J);
|
|
4508
|
+
}, K = (J) => {
|
|
4509
|
+
if (p(!1), C(!0), u && z !== u) {
|
|
4510
|
+
P(u), C(!1), p(!0);
|
|
4496
4511
|
return;
|
|
4497
4512
|
}
|
|
4498
|
-
b?.(
|
|
4499
|
-
},
|
|
4513
|
+
b?.(J);
|
|
4514
|
+
}, U = i(
|
|
4500
4515
|
"relative overflow-hidden bg-surface-hover",
|
|
4501
4516
|
// Size variants
|
|
4502
4517
|
{
|
|
@@ -4524,33 +4539,33 @@ const Ms = ({
|
|
|
4524
4539
|
"rounded-full": a === "full"
|
|
4525
4540
|
},
|
|
4526
4541
|
m
|
|
4527
|
-
),
|
|
4542
|
+
), j = i(
|
|
4528
4543
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
4529
4544
|
{
|
|
4530
|
-
"opacity-0":
|
|
4531
|
-
"opacity-100": !
|
|
4545
|
+
"opacity-0": w || h,
|
|
4546
|
+
"opacity-100": !w && !h
|
|
4532
4547
|
}
|
|
4533
|
-
),
|
|
4548
|
+
), B = i(
|
|
4534
4549
|
"absolute inset-0 flex items-center justify-center",
|
|
4535
4550
|
"text-text-muted"
|
|
4536
|
-
),
|
|
4537
|
-
/* @__PURE__ */ e(
|
|
4551
|
+
), W = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), Z = /* @__PURE__ */ c("div", { className: "text-center", children: [
|
|
4552
|
+
/* @__PURE__ */ e(ee, { icon: Ft, size: "lg", className: "mx-auto mb-1" }),
|
|
4538
4553
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
4539
4554
|
] });
|
|
4540
|
-
return /* @__PURE__ */ c("div", { className:
|
|
4555
|
+
return /* @__PURE__ */ c("div", { className: U, children: [
|
|
4541
4556
|
/* @__PURE__ */ e(
|
|
4542
4557
|
"img",
|
|
4543
4558
|
{
|
|
4544
4559
|
...g,
|
|
4545
|
-
src:
|
|
4560
|
+
src: z,
|
|
4546
4561
|
alt: r,
|
|
4547
|
-
className:
|
|
4548
|
-
onLoad:
|
|
4562
|
+
className: j,
|
|
4563
|
+
onLoad: _,
|
|
4549
4564
|
onError: K
|
|
4550
4565
|
}
|
|
4551
4566
|
),
|
|
4552
|
-
|
|
4553
|
-
|
|
4567
|
+
w && l && /* @__PURE__ */ e("div", { className: B, children: d || W }),
|
|
4568
|
+
h && o && /* @__PURE__ */ e("div", { className: B, children: v || Z })
|
|
4554
4569
|
] });
|
|
4555
4570
|
};
|
|
4556
4571
|
function Ts({
|
|
@@ -4576,7 +4591,7 @@ function Ts({
|
|
|
4576
4591
|
}
|
|
4577
4592
|
);
|
|
4578
4593
|
}
|
|
4579
|
-
function
|
|
4594
|
+
function $s({
|
|
4580
4595
|
items: t,
|
|
4581
4596
|
getRowKey: r,
|
|
4582
4597
|
variant: n = "divided",
|
|
@@ -4591,40 +4606,40 @@ function _s({
|
|
|
4591
4606
|
groupBy: f,
|
|
4592
4607
|
groups: b,
|
|
4593
4608
|
renderGroupHeader: g,
|
|
4594
|
-
stickyGroupHeaders:
|
|
4609
|
+
stickyGroupHeaders: w = !1,
|
|
4595
4610
|
collapsibleGroups: p = !1,
|
|
4596
|
-
hideGroupCount:
|
|
4611
|
+
hideGroupCount: h = !1,
|
|
4597
4612
|
selectable: C = !1,
|
|
4598
|
-
selectedItems:
|
|
4599
|
-
onSelectionChange:
|
|
4600
|
-
bulkActions:
|
|
4613
|
+
selectedItems: z = [],
|
|
4614
|
+
onSelectionChange: P,
|
|
4615
|
+
bulkActions: _,
|
|
4601
4616
|
header: K,
|
|
4602
|
-
stickyHeader:
|
|
4603
|
-
bordered:
|
|
4604
|
-
emptyContent:
|
|
4605
|
-
loading:
|
|
4606
|
-
loadingRows:
|
|
4607
|
-
className:
|
|
4617
|
+
stickyHeader: U = !1,
|
|
4618
|
+
bordered: j = !1,
|
|
4619
|
+
emptyContent: B,
|
|
4620
|
+
loading: W = !1,
|
|
4621
|
+
loadingRows: Z = 4,
|
|
4622
|
+
className: J,
|
|
4608
4623
|
"aria-label": de
|
|
4609
4624
|
}) {
|
|
4610
|
-
const [
|
|
4625
|
+
const [Y, y] = ae.useState(
|
|
4611
4626
|
() => Object.fromEntries(
|
|
4612
|
-
(b ?? []).filter((
|
|
4627
|
+
(b ?? []).filter((k) => k.defaultCollapsed).map((k) => [k.id, !0])
|
|
4613
4628
|
)
|
|
4614
|
-
),
|
|
4615
|
-
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(
|
|
4616
|
-
const
|
|
4617
|
-
|
|
4629
|
+
), x = ae.useRef(null), S = (k) => {
|
|
4630
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(k.key)) return;
|
|
4631
|
+
const G = Array.from(
|
|
4632
|
+
x.current?.querySelectorAll("li[data-list-row]") ?? []
|
|
4618
4633
|
);
|
|
4619
|
-
if (
|
|
4620
|
-
|
|
4621
|
-
const
|
|
4622
|
-
|
|
4623
|
-
},
|
|
4624
|
-
|
|
4625
|
-
|
|
4634
|
+
if (G.length === 0) return;
|
|
4635
|
+
k.preventDefault();
|
|
4636
|
+
const O = G.indexOf(document.activeElement), N = k.key === "Home" ? 0 : k.key === "End" ? G.length - 1 : k.key === "ArrowDown" ? (O + 1) % G.length : (O - 1 + G.length) % G.length;
|
|
4637
|
+
G[N]?.focus();
|
|
4638
|
+
}, D = (k, M) => r ? r(k, M) : M, E = (k) => z.includes(k), A = (k, M) => {
|
|
4639
|
+
P && P(
|
|
4640
|
+
M ? [...z, k] : z.filter((G) => G !== k)
|
|
4626
4641
|
);
|
|
4627
|
-
},
|
|
4642
|
+
}, $ = (k) => P?.(k ? [...t] : []), oe = i(
|
|
4628
4643
|
"flex flex-col",
|
|
4629
4644
|
// With a selection open the list has a dock at its foot. Sticky can only
|
|
4630
4645
|
// park at the bottom of its own box, so on a list shorter than the window
|
|
@@ -4632,17 +4647,17 @@ function _s({
|
|
|
4632
4647
|
// screen. Growing the box to the height of its parent puts it where it
|
|
4633
4648
|
// belongs — and only while a selection exists, so an ordinary short list
|
|
4634
4649
|
// keeps its natural height.
|
|
4635
|
-
C &&
|
|
4636
|
-
|
|
4637
|
-
|
|
4650
|
+
C && z.length > 0 && "min-h-full",
|
|
4651
|
+
j && "overflow-hidden rounded-lg border border-border-subtle",
|
|
4652
|
+
J
|
|
4638
4653
|
);
|
|
4639
|
-
if (
|
|
4640
|
-
return /* @__PURE__ */ e("div", { className:
|
|
4654
|
+
if (W)
|
|
4655
|
+
return /* @__PURE__ */ e("div", { className: oe, children: Array.from({ length: Z }).map((k, M) => /* @__PURE__ */ c(
|
|
4641
4656
|
"div",
|
|
4642
4657
|
{
|
|
4643
4658
|
className: i(
|
|
4644
4659
|
"flex animate-pulse items-center gap-3 px-4 py-2",
|
|
4645
|
-
n === "divided" &&
|
|
4660
|
+
n === "divided" && M > 0 && "border-t border-border-subtle"
|
|
4646
4661
|
),
|
|
4647
4662
|
children: [
|
|
4648
4663
|
/* @__PURE__ */ e("span", { className: "size-tile-sm shrink-0 rounded-md bg-surface-hover" }),
|
|
@@ -4651,12 +4666,12 @@ function _s({
|
|
|
4651
4666
|
/* @__PURE__ */ e("span", { className: "h-3 w-8 shrink-0 rounded-sm bg-surface-hover" })
|
|
4652
4667
|
]
|
|
4653
4668
|
},
|
|
4654
|
-
`skeleton-${
|
|
4669
|
+
`skeleton-${M}`
|
|
4655
4670
|
)) });
|
|
4656
|
-
if (t.length === 0 &&
|
|
4657
|
-
return /* @__PURE__ */ e("div", { className:
|
|
4658
|
-
const
|
|
4659
|
-
const
|
|
4671
|
+
if (t.length === 0 && B)
|
|
4672
|
+
return /* @__PURE__ */ e("div", { className: oe, children: B });
|
|
4673
|
+
const ce = t.length > 0 && z.length === t.length, q = z.length > 0 && !ce, H = (k, M, G) => {
|
|
4674
|
+
const O = d?.(k, M) ?? !1, N = v?.(k, M) ?? !1, I = m?.(k, M) ?? !1, te = C && E(k);
|
|
4660
4675
|
return /* @__PURE__ */ c(
|
|
4661
4676
|
"li",
|
|
4662
4677
|
{
|
|
@@ -4664,34 +4679,34 @@ function _s({
|
|
|
4664
4679
|
role: "button",
|
|
4665
4680
|
tabIndex: 0,
|
|
4666
4681
|
"data-list-row": "",
|
|
4667
|
-
"aria-current":
|
|
4668
|
-
onClick: () => o(
|
|
4669
|
-
onFocus: () => u?.(
|
|
4682
|
+
"aria-current": O || void 0,
|
|
4683
|
+
onClick: () => o(k, M),
|
|
4684
|
+
onFocus: () => u?.(M),
|
|
4670
4685
|
onKeyDown: (le) => {
|
|
4671
|
-
le.key !== "Enter" && le.key !== " " || (le.preventDefault(), o(
|
|
4686
|
+
le.key !== "Enter" && le.key !== " " || (le.preventDefault(), o(k, M));
|
|
4672
4687
|
}
|
|
4673
4688
|
} : {},
|
|
4674
4689
|
className: i(
|
|
4675
4690
|
"flex items-center gap-3 text-base",
|
|
4676
4691
|
"transition-colors duration-fast ease-out",
|
|
4677
4692
|
n === "inset" ? "mx-2 rounded-lg px-3 py-2.5" : "px-5 py-2.5",
|
|
4678
|
-
n === "divided" && !
|
|
4693
|
+
n === "divided" && !G && "border-t border-border-subtle",
|
|
4679
4694
|
o && "cursor-pointer focus-visible:outline-none focus-visible:focus-ring",
|
|
4680
4695
|
// An unread row is tinted, not bolded: at five columns a bold row
|
|
4681
4696
|
// shouts across all of them, while the tint marks the row and leaves
|
|
4682
4697
|
// the consumer free to weight only the sender and the subject.
|
|
4683
|
-
|
|
4698
|
+
O || te ? "bg-accent-soft text-text" : N ? i("bg-surface-unread", o && "hover:bg-surface-unread-hover") : o && "hover:bg-surface-hover",
|
|
4684
4699
|
// Read rows stay at full opacity — fading them also fades the avatars
|
|
4685
4700
|
// and team dots, which is exactly the identity you scan by. They read
|
|
4686
4701
|
// as secondary through weight and text colour instead.
|
|
4687
|
-
|
|
4702
|
+
I && "text-text-muted"
|
|
4688
4703
|
),
|
|
4689
4704
|
children: [
|
|
4690
4705
|
C && /* @__PURE__ */ e("span", { onClick: (le) => le.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4691
4706
|
we,
|
|
4692
4707
|
{
|
|
4693
|
-
checked:
|
|
4694
|
-
onChange: (le) =>
|
|
4708
|
+
checked: E(k),
|
|
4709
|
+
onChange: (le) => A(k, le.target.checked),
|
|
4695
4710
|
"aria-label": "Rij selecteren"
|
|
4696
4711
|
}
|
|
4697
4712
|
) }),
|
|
@@ -4702,77 +4717,77 @@ function _s({
|
|
|
4702
4717
|
className: "mt-2 size-1.5 shrink-0 self-start rounded-full bg-border-strong"
|
|
4703
4718
|
}
|
|
4704
4719
|
),
|
|
4705
|
-
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(
|
|
4706
|
-
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(
|
|
4707
|
-
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(
|
|
4720
|
+
s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s(k, M) }),
|
|
4721
|
+
/* @__PURE__ */ e("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: a ? a(k, M) : String(k) }),
|
|
4722
|
+
l && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: l(k, M) })
|
|
4708
4723
|
]
|
|
4709
4724
|
},
|
|
4710
|
-
|
|
4725
|
+
D(k, M)
|
|
4711
4726
|
);
|
|
4712
|
-
},
|
|
4727
|
+
}, L = (() => {
|
|
4713
4728
|
if (!f)
|
|
4714
|
-
return t.map((
|
|
4715
|
-
const
|
|
4716
|
-
t.forEach((
|
|
4717
|
-
const
|
|
4718
|
-
|
|
4729
|
+
return t.map((O, N) => H(O, N, N === 0));
|
|
4730
|
+
const k = /* @__PURE__ */ new Map();
|
|
4731
|
+
t.forEach((O, N) => {
|
|
4732
|
+
const I = f(O, N);
|
|
4733
|
+
k.has(I) || k.set(I, []), k.get(I).push({ item: O, index: N });
|
|
4719
4734
|
});
|
|
4720
|
-
const
|
|
4735
|
+
const M = b ?? [];
|
|
4721
4736
|
return [
|
|
4722
|
-
...
|
|
4723
|
-
...[...
|
|
4724
|
-
].flatMap((
|
|
4725
|
-
const
|
|
4737
|
+
...M.filter((O) => k.has(O.id)),
|
|
4738
|
+
...[...k.keys()].filter((O) => !M.some((N) => N.id === O)).map((O) => ({ id: O }))
|
|
4739
|
+
].flatMap((O, N) => {
|
|
4740
|
+
const I = k.get(O.id) ?? [], te = p && Y[O.id], le = O.title ?? O.id, be = O.count ?? I.length, ye = /* @__PURE__ */ e(
|
|
4726
4741
|
"li",
|
|
4727
4742
|
{
|
|
4728
|
-
onClick: p ? () =>
|
|
4743
|
+
onClick: p ? () => y((fe) => ({ ...fe, [O.id]: !fe[O.id] })) : void 0,
|
|
4729
4744
|
className: i(
|
|
4730
4745
|
// A caption over its rows, not a band across the table: same
|
|
4731
4746
|
// surface as the rows, no rules, and the count as a quiet pill.
|
|
4732
4747
|
// The old grey uppercase strip read as a second column header.
|
|
4733
4748
|
"flex items-center gap-2.5 bg-surface px-5 pb-1.5 text-base font-semibold",
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4749
|
+
N > 0 ? "pt-5" : "pt-3",
|
|
4750
|
+
O.tone === "danger" ? "text-danger-fg" : O.tone === "muted" ? "text-text-subtle" : "text-text",
|
|
4751
|
+
w && "sticky z-10",
|
|
4737
4752
|
p && "cursor-pointer select-none"
|
|
4738
4753
|
),
|
|
4739
|
-
"aria-expanded": p ? !
|
|
4740
|
-
style:
|
|
4741
|
-
children: g ? g(
|
|
4754
|
+
"aria-expanded": p ? !te : void 0,
|
|
4755
|
+
style: w ? { top: U ? 28 : 0 } : void 0,
|
|
4756
|
+
children: g ? g(O, I.map((fe) => fe.item)) : /* @__PURE__ */ c(Ee, { children: [
|
|
4742
4757
|
p && /* @__PURE__ */ e(
|
|
4743
4758
|
Le,
|
|
4744
4759
|
{
|
|
4745
4760
|
"aria-hidden": !0,
|
|
4746
4761
|
className: i(
|
|
4747
4762
|
"size-icon-md shrink-0 text-text-subtle transition-transform duration-fast ease-out",
|
|
4748
|
-
!
|
|
4763
|
+
!te && "rotate-90"
|
|
4749
4764
|
)
|
|
4750
4765
|
}
|
|
4751
4766
|
),
|
|
4752
4767
|
/* @__PURE__ */ e("span", { children: le }),
|
|
4753
|
-
!
|
|
4768
|
+
!h && /* @__PURE__ */ e(
|
|
4754
4769
|
"span",
|
|
4755
4770
|
{
|
|
4756
4771
|
className: i(
|
|
4757
4772
|
"rounded-full px-2 text-xs font-normal tabular-nums",
|
|
4758
|
-
|
|
4773
|
+
O.tone === "danger" ? "bg-danger-soft text-danger-fg" : "bg-surface-sunk text-text-subtle"
|
|
4759
4774
|
),
|
|
4760
4775
|
children: be
|
|
4761
4776
|
}
|
|
4762
4777
|
)
|
|
4763
4778
|
] })
|
|
4764
4779
|
},
|
|
4765
|
-
`group-${
|
|
4780
|
+
`group-${O.id}`
|
|
4766
4781
|
);
|
|
4767
|
-
return
|
|
4782
|
+
return te ? [ye] : [
|
|
4768
4783
|
ye,
|
|
4769
|
-
...
|
|
4770
|
-
({ item: fe, index: he }, Oe) =>
|
|
4784
|
+
...I.map(
|
|
4785
|
+
({ item: fe, index: he }, Oe) => H(fe, he, Oe === 0)
|
|
4771
4786
|
)
|
|
4772
4787
|
];
|
|
4773
4788
|
});
|
|
4774
4789
|
})();
|
|
4775
|
-
return /* @__PURE__ */ c("div", { ref:
|
|
4790
|
+
return /* @__PURE__ */ c("div", { ref: x, className: oe, onKeyDown: o ? S : void 0, children: [
|
|
4776
4791
|
K && /* @__PURE__ */ c(
|
|
4777
4792
|
"div",
|
|
4778
4793
|
{
|
|
@@ -4781,15 +4796,15 @@ function _s({
|
|
|
4781
4796
|
// sticky group headers park against.
|
|
4782
4797
|
"flex h-row-sm items-end gap-3 border-b border-border bg-surface px-5 pb-2",
|
|
4783
4798
|
"text-xs font-semibold uppercase tracking-wider text-text-disabled",
|
|
4784
|
-
|
|
4799
|
+
U && "sticky top-0 z-20"
|
|
4785
4800
|
),
|
|
4786
4801
|
children: [
|
|
4787
4802
|
C && /* @__PURE__ */ e("span", { className: "flex items-center", children: /* @__PURE__ */ e(
|
|
4788
4803
|
we,
|
|
4789
4804
|
{
|
|
4790
|
-
checked:
|
|
4791
|
-
indeterminate:
|
|
4792
|
-
onChange: (
|
|
4805
|
+
checked: ce,
|
|
4806
|
+
indeterminate: q,
|
|
4807
|
+
onChange: (k) => $(k.target.checked),
|
|
4793
4808
|
"aria-label": "Alles selecteren"
|
|
4794
4809
|
}
|
|
4795
4810
|
) }),
|
|
@@ -4797,20 +4812,20 @@ function _s({
|
|
|
4797
4812
|
]
|
|
4798
4813
|
}
|
|
4799
4814
|
),
|
|
4800
|
-
/* @__PURE__ */ e("ul", { "aria-label": de, className: "flex flex-col", children:
|
|
4801
|
-
C &&
|
|
4815
|
+
/* @__PURE__ */ e("ul", { "aria-label": de, className: "flex flex-col", children: L }),
|
|
4816
|
+
C && z.length > 0 && /* @__PURE__ */ e("div", { className: "pointer-events-none sticky bottom-0 z-10 flex justify-center px-5 pb-4", children: /* @__PURE__ */ c("div", { className: "pointer-events-auto flex items-center gap-1.5 rounded-lg bg-accent py-1.5 pl-3.5 pr-1.5 text-accent-fg shadow-overlay", children: [
|
|
4802
4817
|
/* @__PURE__ */ c("span", { className: "text-sm font-medium", children: [
|
|
4803
|
-
|
|
4818
|
+
z.length,
|
|
4804
4819
|
" geselecteerd"
|
|
4805
4820
|
] }),
|
|
4806
4821
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "mx-1.5 h-4 w-px bg-current opacity-25" }),
|
|
4807
|
-
|
|
4822
|
+
_,
|
|
4808
4823
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "mx-1.5 h-4 w-px bg-current opacity-25" }),
|
|
4809
4824
|
/* @__PURE__ */ e(
|
|
4810
4825
|
"button",
|
|
4811
4826
|
{
|
|
4812
4827
|
type: "button",
|
|
4813
|
-
onClick: () =>
|
|
4828
|
+
onClick: () => P?.([]),
|
|
4814
4829
|
"aria-label": "Selectie wissen",
|
|
4815
4830
|
className: "grid size-tile-md shrink-0 cursor-pointer place-items-center rounded-md transition-colors duration-fast ease-out hover:bg-white/15 focus-visible:outline-none focus-visible:focus-ring",
|
|
4816
4831
|
children: /* @__PURE__ */ e(Se, { className: "size-icon-lg" })
|
|
@@ -4819,7 +4834,7 @@ function _s({
|
|
|
4819
4834
|
] }) })
|
|
4820
4835
|
] });
|
|
4821
4836
|
}
|
|
4822
|
-
function
|
|
4837
|
+
function _s({
|
|
4823
4838
|
side: t,
|
|
4824
4839
|
continued: r = !1,
|
|
4825
4840
|
tone: n = "default",
|
|
@@ -4861,13 +4876,13 @@ const zn = {
|
|
|
4861
4876
|
urgent: "text-danger-fg",
|
|
4862
4877
|
success: "text-success-fg"
|
|
4863
4878
|
};
|
|
4864
|
-
function
|
|
4879
|
+
function Ds({ value: t, label: r, tone: n = "default", className: s, ...a }) {
|
|
4865
4880
|
return /* @__PURE__ */ c("div", { className: i("rounded-xl bg-editor px-4 py-3.5", s), ...a, children: [
|
|
4866
4881
|
/* @__PURE__ */ e("div", { className: i("text-2xl font-semibold", zn[n]), children: t }),
|
|
4867
4882
|
/* @__PURE__ */ e("div", { className: "pt-0.5 text-xs text-text-muted", children: r })
|
|
4868
4883
|
] });
|
|
4869
4884
|
}
|
|
4870
|
-
function
|
|
4885
|
+
function As({ icon: t, label: r, unset: n, className: s }) {
|
|
4871
4886
|
return /* @__PURE__ */ c(
|
|
4872
4887
|
"span",
|
|
4873
4888
|
{
|
|
@@ -4900,18 +4915,18 @@ const Mn = ({
|
|
|
4900
4915
|
editable: m = !1,
|
|
4901
4916
|
onTitleChange: f
|
|
4902
4917
|
}) => {
|
|
4903
|
-
const [b, g] =
|
|
4904
|
-
|
|
4918
|
+
const [b, g] = R(!1), [w, p] = R(r), h = ne(null);
|
|
4919
|
+
X(() => {
|
|
4905
4920
|
p(r);
|
|
4906
|
-
}, [r]),
|
|
4907
|
-
b &&
|
|
4921
|
+
}, [r]), X(() => {
|
|
4922
|
+
b && h.current && (h.current.focus(), h.current.select());
|
|
4908
4923
|
}, [b]);
|
|
4909
4924
|
const C = () => {
|
|
4910
4925
|
m && g(!0);
|
|
4911
|
-
},
|
|
4912
|
-
g(!1),
|
|
4913
|
-
},
|
|
4914
|
-
|
|
4926
|
+
}, z = () => {
|
|
4927
|
+
g(!1), w.trim() !== "" && w !== r && f ? f(w.trim()) : p(r);
|
|
4928
|
+
}, P = (_) => {
|
|
4929
|
+
_.key === "Enter" ? h.current?.blur() : _.key === "Escape" && (p(r), g(!1));
|
|
4915
4930
|
};
|
|
4916
4931
|
return /* @__PURE__ */ c(
|
|
4917
4932
|
"div",
|
|
@@ -4930,17 +4945,17 @@ const Mn = ({
|
|
|
4930
4945
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-4 text-text", children: [
|
|
4931
4946
|
v && // Ghost: a framed box around a back chevron makes the way out of a
|
|
4932
4947
|
// page look like the page's primary control.
|
|
4933
|
-
/* @__PURE__ */ e(se, { variant: "ghost", onClick: v, leftIcon: /* @__PURE__ */ e(
|
|
4948
|
+
/* @__PURE__ */ e(se, { variant: "ghost", onClick: v, leftIcon: /* @__PURE__ */ e(ee, { icon: ze, size: "md" }), iconOnly: !0 }),
|
|
4934
4949
|
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
4935
4950
|
b ? /* @__PURE__ */ e(
|
|
4936
4951
|
"input",
|
|
4937
4952
|
{
|
|
4938
|
-
ref:
|
|
4953
|
+
ref: h,
|
|
4939
4954
|
type: "text",
|
|
4940
|
-
value:
|
|
4941
|
-
onChange: (
|
|
4942
|
-
onBlur:
|
|
4943
|
-
onKeyDown:
|
|
4955
|
+
value: w,
|
|
4956
|
+
onChange: (_) => p(_.target.value),
|
|
4957
|
+
onBlur: z,
|
|
4958
|
+
onKeyDown: P,
|
|
4944
4959
|
className: "text-1xl font-semibold bg-transparent border-b-1 border-border rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 w-full"
|
|
4945
4960
|
}
|
|
4946
4961
|
) : /* @__PURE__ */ c("div", { className: "group flex items-baseline gap-2.5 min-w-0", children: [
|
|
@@ -4983,29 +4998,29 @@ const Mn = ({
|
|
|
4983
4998
|
] })
|
|
4984
4999
|
] }) }),
|
|
4985
5000
|
a.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: a.map(
|
|
4986
|
-
(
|
|
5001
|
+
(_) => _.render ? /* @__PURE__ */ e(ae.Fragment, { children: _.render() }, _.id) : _.splitOptions && _.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
4987
5002
|
st,
|
|
4988
5003
|
{
|
|
4989
|
-
label:
|
|
4990
|
-
onClick:
|
|
4991
|
-
icon:
|
|
4992
|
-
variant:
|
|
4993
|
-
options:
|
|
4994
|
-
disabled:
|
|
5004
|
+
label: _.label,
|
|
5005
|
+
onClick: _.onClick,
|
|
5006
|
+
icon: _.icon,
|
|
5007
|
+
variant: _.variant === "primary" ? "primary" : "outline",
|
|
5008
|
+
options: _.splitOptions,
|
|
5009
|
+
disabled: _.disabled
|
|
4995
5010
|
},
|
|
4996
|
-
|
|
5011
|
+
_.id
|
|
4997
5012
|
) : /* @__PURE__ */ e(
|
|
4998
5013
|
se,
|
|
4999
5014
|
{
|
|
5000
|
-
variant:
|
|
5015
|
+
variant: _.variant ?? "secondary",
|
|
5001
5016
|
onClick: (K) => {
|
|
5002
|
-
K.stopPropagation(), K.target.blur(),
|
|
5017
|
+
K.stopPropagation(), K.target.blur(), _.onClick();
|
|
5003
5018
|
},
|
|
5004
|
-
disabled:
|
|
5005
|
-
leftIcon:
|
|
5006
|
-
children:
|
|
5019
|
+
disabled: _.disabled,
|
|
5020
|
+
leftIcon: _.icon,
|
|
5021
|
+
children: _.label
|
|
5007
5022
|
},
|
|
5008
|
-
|
|
5023
|
+
_.id
|
|
5009
5024
|
)
|
|
5010
5025
|
) })
|
|
5011
5026
|
] }),
|
|
@@ -5032,11 +5047,11 @@ const Mn = ({
|
|
|
5032
5047
|
empty: f,
|
|
5033
5048
|
padding: b = "md",
|
|
5034
5049
|
scroll: g = !0,
|
|
5035
|
-
className:
|
|
5050
|
+
className: w,
|
|
5036
5051
|
contentClassName: p,
|
|
5037
|
-
children:
|
|
5052
|
+
children: h
|
|
5038
5053
|
}) => {
|
|
5039
|
-
const C = v ? /* @__PURE__ */ e(qe, { variant: "inline", shape: m }) : f ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-12", children: f }) :
|
|
5054
|
+
const C = v ? /* @__PURE__ */ e(qe, { variant: "inline", shape: m }) : f ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-12", children: f }) : h;
|
|
5040
5055
|
return /* @__PURE__ */ c(
|
|
5041
5056
|
"div",
|
|
5042
5057
|
{
|
|
@@ -5046,7 +5061,7 @@ const Mn = ({
|
|
|
5046
5061
|
// the header; without `min-h-0` the body would grow past the card
|
|
5047
5062
|
// instead of scrolling inside it.
|
|
5048
5063
|
g ? "flex h-full min-h-0 flex-col" : "flex flex-col",
|
|
5049
|
-
|
|
5064
|
+
w
|
|
5050
5065
|
),
|
|
5051
5066
|
children: [
|
|
5052
5067
|
/* @__PURE__ */ e(
|
|
@@ -5093,11 +5108,11 @@ function Os({ label: t, trailing: r, align: n = "center", className: s }) {
|
|
|
5093
5108
|
] });
|
|
5094
5109
|
}
|
|
5095
5110
|
const dt = et(null), js = dt.Provider;
|
|
5096
|
-
function
|
|
5111
|
+
function $n() {
|
|
5097
5112
|
return yt(dt);
|
|
5098
5113
|
}
|
|
5099
5114
|
function Fs() {
|
|
5100
|
-
const [t, r] =
|
|
5115
|
+
const [t, r] = R(null), n = pe(
|
|
5101
5116
|
() => ({
|
|
5102
5117
|
setTrail: (s, a) => r((l) => a ? { ownerId: s, entry: a } : l && l.ownerId !== s ? l : null)
|
|
5103
5118
|
}),
|
|
@@ -5105,7 +5120,7 @@ function Fs() {
|
|
|
5105
5120
|
);
|
|
5106
5121
|
return { trail: t?.entry ?? null, api: n };
|
|
5107
5122
|
}
|
|
5108
|
-
const
|
|
5123
|
+
const _n = {
|
|
5109
5124
|
none: "",
|
|
5110
5125
|
sm: "px-3 py-3",
|
|
5111
5126
|
// Matches the frame header's own horizontal padding, so content lines up
|
|
@@ -5125,37 +5140,37 @@ const $n = {
|
|
|
5125
5140
|
className: m,
|
|
5126
5141
|
contentClassName: f
|
|
5127
5142
|
}) => {
|
|
5128
|
-
const b =
|
|
5129
|
-
|
|
5130
|
-
const p = !!a,
|
|
5131
|
-
|
|
5132
|
-
const C =
|
|
5143
|
+
const b = $n(), g = vt(), w = ne(a);
|
|
5144
|
+
w.current = a;
|
|
5145
|
+
const p = !!a, h = ne(r);
|
|
5146
|
+
h.current = r;
|
|
5147
|
+
const C = ne(n);
|
|
5133
5148
|
C.current = n;
|
|
5134
|
-
const
|
|
5135
|
-
[...n, ...r].map((
|
|
5149
|
+
const z = s === "header", P = z && (r.length > 0 || n.length > 0), _ = P ? JSON.stringify(
|
|
5150
|
+
[...n, ...r].map((j) => [j.id, j.label, j.variant, j.disabled])
|
|
5136
5151
|
) : "", K = pe(() => {
|
|
5137
|
-
if (!
|
|
5138
|
-
const
|
|
5139
|
-
...
|
|
5152
|
+
if (!P) return;
|
|
5153
|
+
const j = (B) => (W, Z) => ({
|
|
5154
|
+
...W,
|
|
5140
5155
|
onClick: () => {
|
|
5141
|
-
(
|
|
5156
|
+
(B === "primary" ? h.current : C.current)[Z]?.onClick();
|
|
5142
5157
|
}
|
|
5143
5158
|
});
|
|
5144
5159
|
return {
|
|
5145
|
-
actions:
|
|
5146
|
-
secondaryActions: C.current.map(
|
|
5160
|
+
actions: h.current.map(j("primary")),
|
|
5161
|
+
secondaryActions: C.current.map(j("secondary"))
|
|
5147
5162
|
};
|
|
5148
|
-
}, [
|
|
5149
|
-
|
|
5163
|
+
}, [P, _]);
|
|
5164
|
+
X(() => {
|
|
5150
5165
|
if (b && !(!p && !o && !K))
|
|
5151
5166
|
return b.setTrail(g, {
|
|
5152
5167
|
title: o,
|
|
5153
|
-
onBack: p ? () =>
|
|
5168
|
+
onBack: p ? () => w.current?.() : void 0,
|
|
5154
5169
|
actions: K?.actions,
|
|
5155
5170
|
secondaryActions: K?.secondaryActions
|
|
5156
5171
|
}), () => b.setTrail(g, null);
|
|
5157
5172
|
}, [b, g, o, p, K]);
|
|
5158
|
-
const
|
|
5173
|
+
const U = !z && (r.length > 0 || n.length > 0);
|
|
5159
5174
|
return (
|
|
5160
5175
|
/**
|
|
5161
5176
|
* `min-h-full` + a sticky footer, rather than a nested scroll container.
|
|
@@ -5164,25 +5179,25 @@ const $n = {
|
|
|
5164
5179
|
* its footer to the bottom, and a long one keeps it pinned while scrolling.
|
|
5165
5180
|
*/
|
|
5166
5181
|
/* @__PURE__ */ c("div", { className: i("flex min-h-full flex-col", m), children: [
|
|
5167
|
-
!b && (p || o ||
|
|
5182
|
+
!b && (p || o || P) && /* @__PURE__ */ c("div", { className: "flex shrink-0 items-center gap-2 px-5 pt-4", children: [
|
|
5168
5183
|
p && /* @__PURE__ */ e(
|
|
5169
5184
|
se,
|
|
5170
5185
|
{
|
|
5171
5186
|
variant: "ghost",
|
|
5172
|
-
onClick: () =>
|
|
5187
|
+
onClick: () => w.current?.(),
|
|
5173
5188
|
"aria-label": l,
|
|
5174
|
-
leftIcon: /* @__PURE__ */ e(
|
|
5189
|
+
leftIcon: /* @__PURE__ */ e(ee, { icon: ze, size: "sm" }),
|
|
5175
5190
|
iconOnly: !0
|
|
5176
5191
|
}
|
|
5177
5192
|
),
|
|
5178
5193
|
o && /* @__PURE__ */ e("h2", { className: "min-w-0 truncate text-md font-semibold tracking-title text-text", children: o }),
|
|
5179
|
-
|
|
5194
|
+
z && /* @__PURE__ */ c("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
5180
5195
|
n.length > 0 && /* @__PURE__ */ e(ke, { actions: n, defaultVariant: "ghost" }),
|
|
5181
5196
|
r.length > 0 && /* @__PURE__ */ e(ke, { actions: r })
|
|
5182
5197
|
] })
|
|
5183
5198
|
] }),
|
|
5184
|
-
/* @__PURE__ */ e("div", { className: i("flex-1",
|
|
5185
|
-
|
|
5199
|
+
/* @__PURE__ */ e("div", { className: i("flex-1", _n[v], f), children: u ? /* @__PURE__ */ e(qe, { variant: "inline", shape: d }) : t }),
|
|
5200
|
+
U && /* @__PURE__ */ c("div", { className: "sticky bottom-0 z-10 flex shrink-0 items-center gap-2 border-t border-border bg-surface px-5 py-3", children: [
|
|
5186
5201
|
n.length > 0 && /* @__PURE__ */ e(ke, { actions: n, defaultVariant: "ghost" }),
|
|
5187
5202
|
r.length > 0 && /* @__PURE__ */ e(ke, { actions: r, className: "ml-auto" })
|
|
5188
5203
|
] })
|
|
@@ -5226,7 +5241,7 @@ function Hs({
|
|
|
5226
5241
|
}) {
|
|
5227
5242
|
return /* @__PURE__ */ c("section", { className: i("flex flex-col gap-2", l), children: [
|
|
5228
5243
|
/* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
|
|
5229
|
-
t && /* @__PURE__ */ e(
|
|
5244
|
+
t && /* @__PURE__ */ e(ee, { icon: t, size: "md", color: "secondary", className: "mt-0.5" }),
|
|
5230
5245
|
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
5231
5246
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-text", children: r }),
|
|
5232
5247
|
n && /* @__PURE__ */ e("p", { className: "text-xs text-text-muted", children: n })
|
|
@@ -5249,12 +5264,12 @@ function qs({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
|
5249
5264
|
children: [
|
|
5250
5265
|
r && /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full", style: { backgroundColor: r }, "aria-hidden": !0 }),
|
|
5251
5266
|
/* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: t }),
|
|
5252
|
-
/* @__PURE__ */ e(
|
|
5267
|
+
/* @__PURE__ */ e(ee, { icon: Bt, size: "xs", className: "opacity-70" })
|
|
5253
5268
|
]
|
|
5254
5269
|
}
|
|
5255
5270
|
);
|
|
5256
5271
|
}
|
|
5257
|
-
function
|
|
5272
|
+
function Dn(t) {
|
|
5258
5273
|
const { id: r, header: n, accessor: s, label: a, tone: l, visible: o, width: u, sortable: d, align: v } = t;
|
|
5259
5274
|
return {
|
|
5260
5275
|
id: r,
|
|
@@ -5281,7 +5296,7 @@ function Vs(t) {
|
|
|
5281
5296
|
width: d,
|
|
5282
5297
|
sortable: v
|
|
5283
5298
|
} = t;
|
|
5284
|
-
return
|
|
5299
|
+
return Dn({
|
|
5285
5300
|
id: r,
|
|
5286
5301
|
header: n,
|
|
5287
5302
|
accessor: (m) => !!s(m),
|
|
@@ -5307,7 +5322,7 @@ function Us(t) {
|
|
|
5307
5322
|
id: r,
|
|
5308
5323
|
header: n,
|
|
5309
5324
|
accessor: (m) => {
|
|
5310
|
-
const f = s(m), g = (f == null ? [] : Array.isArray(f) ? f : [f]).filter(Boolean).map((
|
|
5325
|
+
const f = s(m), g = (f == null ? [] : Array.isArray(f) ? f : [f]).filter(Boolean).map((w) => a(w) ?? w);
|
|
5311
5326
|
return g.length ? g.join(o) : l;
|
|
5312
5327
|
},
|
|
5313
5328
|
width: u,
|
|
@@ -5315,7 +5330,7 @@ function Us(t) {
|
|
|
5315
5330
|
sortable: v
|
|
5316
5331
|
};
|
|
5317
5332
|
}
|
|
5318
|
-
function
|
|
5333
|
+
function An(t, r) {
|
|
5319
5334
|
return r.split(".").reduce(
|
|
5320
5335
|
(n, s) => n && typeof n == "object" && s in n ? n[s] : void 0,
|
|
5321
5336
|
t
|
|
@@ -5344,7 +5359,7 @@ const Ws = ({
|
|
|
5344
5359
|
return b ? b.label : String(m || "-");
|
|
5345
5360
|
}, u = xe(
|
|
5346
5361
|
(m) => {
|
|
5347
|
-
const f =
|
|
5362
|
+
const f = An(r, m.name);
|
|
5348
5363
|
if (m.type === "array") {
|
|
5349
5364
|
const g = f;
|
|
5350
5365
|
return !g || g.length === 0 ? /* @__PURE__ */ e(
|
|
@@ -5355,7 +5370,7 @@ const Ws = ({
|
|
|
5355
5370
|
className: "text-text-muted",
|
|
5356
5371
|
children: "Geen items"
|
|
5357
5372
|
}
|
|
5358
|
-
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: g.map((
|
|
5373
|
+
) : /* @__PURE__ */ e("div", { className: "space-y-3", children: g.map((w, p) => /* @__PURE__ */ c(
|
|
5359
5374
|
"div",
|
|
5360
5375
|
{
|
|
5361
5376
|
className: "p-4 border border-border rounded-xl space-y-3",
|
|
@@ -5374,47 +5389,47 @@ const Ws = ({
|
|
|
5374
5389
|
]
|
|
5375
5390
|
}
|
|
5376
5391
|
) }),
|
|
5377
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: m.arrayFields?.map((
|
|
5378
|
-
const C =
|
|
5379
|
-
let
|
|
5380
|
-
switch (
|
|
5392
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: m.arrayFields?.map((h) => {
|
|
5393
|
+
const C = w?.[h.name];
|
|
5394
|
+
let z = "-";
|
|
5395
|
+
switch (h.type) {
|
|
5381
5396
|
case "text":
|
|
5382
5397
|
case "email":
|
|
5383
5398
|
case "number":
|
|
5384
5399
|
case "tel":
|
|
5385
5400
|
case "url":
|
|
5386
5401
|
case "textarea":
|
|
5387
|
-
|
|
5402
|
+
z = C || "-";
|
|
5388
5403
|
break;
|
|
5389
5404
|
case "select":
|
|
5390
5405
|
case "radio":
|
|
5391
|
-
|
|
5406
|
+
z = o(
|
|
5392
5407
|
C,
|
|
5393
|
-
|
|
5408
|
+
h.options
|
|
5394
5409
|
);
|
|
5395
5410
|
break;
|
|
5396
5411
|
case "checkbox":
|
|
5397
|
-
|
|
5412
|
+
z = l(C);
|
|
5398
5413
|
break;
|
|
5399
5414
|
case "date":
|
|
5400
|
-
|
|
5415
|
+
z = a(C);
|
|
5401
5416
|
break;
|
|
5402
5417
|
case "custom":
|
|
5403
|
-
|
|
5418
|
+
z = h.customComponent?.({
|
|
5404
5419
|
value: C
|
|
5405
5420
|
});
|
|
5406
5421
|
break;
|
|
5407
5422
|
default:
|
|
5408
|
-
|
|
5423
|
+
z = String(C || "-");
|
|
5409
5424
|
}
|
|
5410
|
-
return
|
|
5425
|
+
return h.format && (z = h.format(C, w)), /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
5411
5426
|
/* @__PURE__ */ e(
|
|
5412
5427
|
ue,
|
|
5413
5428
|
{
|
|
5414
5429
|
variant: "label",
|
|
5415
5430
|
size: "xs",
|
|
5416
5431
|
className: "text-text-muted",
|
|
5417
|
-
children:
|
|
5432
|
+
children: h.label
|
|
5418
5433
|
}
|
|
5419
5434
|
),
|
|
5420
5435
|
/* @__PURE__ */ e(
|
|
@@ -5423,10 +5438,10 @@ const Ws = ({
|
|
|
5423
5438
|
variant: "body",
|
|
5424
5439
|
size: "sm",
|
|
5425
5440
|
className: "text-text",
|
|
5426
|
-
children:
|
|
5441
|
+
children: z
|
|
5427
5442
|
}
|
|
5428
5443
|
)
|
|
5429
|
-
] },
|
|
5444
|
+
] }, h.name);
|
|
5430
5445
|
}) })
|
|
5431
5446
|
]
|
|
5432
5447
|
},
|
|
@@ -5763,37 +5778,37 @@ const Js = ({
|
|
|
5763
5778
|
initialCommandPath: a,
|
|
5764
5779
|
initialActiveIndex: l
|
|
5765
5780
|
}) => {
|
|
5766
|
-
const [o, u] =
|
|
5767
|
-
(
|
|
5781
|
+
const [o, u] = R(""), [d, v] = R(a || []), [m, f] = R(l || 0), b = ne(null), g = ne(null), p = (d.length ? t.find((h) => h.id === d[0])?.subCommands || [] : t).filter(
|
|
5782
|
+
(h) => h.label.toLowerCase().includes(o.toLowerCase())
|
|
5768
5783
|
);
|
|
5769
|
-
return
|
|
5784
|
+
return X(() => {
|
|
5770
5785
|
r || (u(""), v(a || []), f(l || 0));
|
|
5771
|
-
}, [r]),
|
|
5772
|
-
const
|
|
5786
|
+
}, [r]), X(() => {
|
|
5787
|
+
const h = (C) => {
|
|
5773
5788
|
if (r) {
|
|
5774
5789
|
if (C.key === "Escape")
|
|
5775
5790
|
n();
|
|
5776
5791
|
else if (C.key === "ArrowUp")
|
|
5777
5792
|
f(
|
|
5778
|
-
(
|
|
5793
|
+
(z) => z > 0 ? z - 1 : p.length - 1
|
|
5779
5794
|
);
|
|
5780
5795
|
else if (C.key === "ArrowDown")
|
|
5781
5796
|
f(
|
|
5782
|
-
(
|
|
5797
|
+
(z) => z < p.length - 1 ? z + 1 : 0
|
|
5783
5798
|
);
|
|
5784
5799
|
else if (C.key === "Enter") {
|
|
5785
|
-
const
|
|
5786
|
-
|
|
5800
|
+
const z = p[m];
|
|
5801
|
+
z && (z.subCommands ? (v([...d, z.id]), f(0)) : z.action && (z.action(), n()));
|
|
5787
5802
|
}
|
|
5788
5803
|
}
|
|
5789
5804
|
};
|
|
5790
|
-
return document.addEventListener("keydown",
|
|
5791
|
-
}, [r, n, p, m, d]),
|
|
5792
|
-
const
|
|
5805
|
+
return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
|
|
5806
|
+
}, [r, n, p, m, d]), X(() => {
|
|
5807
|
+
const h = (C) => {
|
|
5793
5808
|
b.current && !b.current.contains(C.target) && n();
|
|
5794
5809
|
};
|
|
5795
|
-
return r && document.addEventListener("mousedown",
|
|
5796
|
-
}, [r, n]),
|
|
5810
|
+
return r && document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
|
|
5811
|
+
}, [r, n]), X(() => {
|
|
5797
5812
|
if (!r) return;
|
|
5798
5813
|
g.current?.querySelector(`[data-index="${m}"]`)?.scrollIntoView({ block: "nearest" });
|
|
5799
5814
|
}, [m, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ c(
|
|
@@ -5811,7 +5826,7 @@ const Js = ({
|
|
|
5811
5826
|
autoFocus: !0,
|
|
5812
5827
|
placeholder: s?.searchPlaceholder || "Search commands...",
|
|
5813
5828
|
value: o,
|
|
5814
|
-
onChange: (
|
|
5829
|
+
onChange: (h) => u(h.target.value),
|
|
5815
5830
|
className: "w-full border-0 bg-transparent py-2 text-text focus:outline-none"
|
|
5816
5831
|
}
|
|
5817
5832
|
)
|
|
@@ -5823,22 +5838,22 @@ const Js = ({
|
|
|
5823
5838
|
className: "mt-2 pt-2 text-sm border-t border-border max-h-dialog-list overflow-y-auto",
|
|
5824
5839
|
children: [
|
|
5825
5840
|
p.length === 0 && /* @__PURE__ */ e("div", { className: "text-text-muted text-center text-sm", children: s?.noCommandsFound || "No commands found" }),
|
|
5826
|
-
p.map((
|
|
5841
|
+
p.map((h, C) => /* @__PURE__ */ c(
|
|
5827
5842
|
"div",
|
|
5828
5843
|
{
|
|
5829
5844
|
"data-index": C,
|
|
5830
5845
|
className: `flex items-center p-2 cursor-pointer rounded-md ${C === m ? "bg-accent-soft text-accent" : "text-text"}`,
|
|
5831
5846
|
onClick: () => {
|
|
5832
|
-
|
|
5847
|
+
h.subCommands ? (v([...d, h.id]), f(0)) : h.action && (h.action(), n());
|
|
5833
5848
|
},
|
|
5834
5849
|
onMouseEnter: () => f(C),
|
|
5835
5850
|
children: [
|
|
5836
|
-
|
|
5837
|
-
/* @__PURE__ */ e("span", { className: "flex-grow", children:
|
|
5838
|
-
|
|
5851
|
+
h.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: h.icon }),
|
|
5852
|
+
/* @__PURE__ */ e("span", { className: "flex-grow", children: h.label }),
|
|
5853
|
+
h.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(Le, { className: "w-4 h-4" }) })
|
|
5839
5854
|
]
|
|
5840
5855
|
},
|
|
5841
|
-
|
|
5856
|
+
h.id
|
|
5842
5857
|
))
|
|
5843
5858
|
]
|
|
5844
5859
|
}
|
|
@@ -5977,44 +5992,44 @@ function Xs({
|
|
|
5977
5992
|
componentProps: l,
|
|
5978
5993
|
className: o
|
|
5979
5994
|
}) {
|
|
5980
|
-
const u =
|
|
5981
|
-
b.current = r,
|
|
5995
|
+
const u = ne(null), [d, v] = R(null), [, m] = R(0), f = ne(null), b = ne(r);
|
|
5996
|
+
b.current = r, X(() => {
|
|
5982
5997
|
if (Re.has(t)) return;
|
|
5983
5998
|
let C = !0;
|
|
5984
5999
|
return (async () => {
|
|
5985
6000
|
try {
|
|
5986
|
-
const
|
|
6001
|
+
const P = await b.current();
|
|
5987
6002
|
if (!C) return;
|
|
5988
|
-
Re.set(t,
|
|
5989
|
-
} catch (
|
|
5990
|
-
console.error(`[FederatedResource] Load failed: ${t}`,
|
|
6003
|
+
Re.set(t, P), m((_) => _ + 1);
|
|
6004
|
+
} catch (P) {
|
|
6005
|
+
console.error(`[FederatedResource] Load failed: ${t}`, P), C && v(t);
|
|
5991
6006
|
}
|
|
5992
6007
|
})(), () => {
|
|
5993
6008
|
C = !1;
|
|
5994
6009
|
};
|
|
5995
6010
|
}, [t]);
|
|
5996
|
-
const g = Re.get(t) ?? null,
|
|
5997
|
-
return
|
|
5998
|
-
if (!
|
|
6011
|
+
const g = Re.get(t) ?? null, w = !g && d === t, p = !g && !w, h = g ? n === "react" && (g.component || g.default) || g : null;
|
|
6012
|
+
return X(() => {
|
|
6013
|
+
if (!h || n === "react") return;
|
|
5999
6014
|
const C = u.current;
|
|
6000
6015
|
if (C) {
|
|
6001
6016
|
if (n === "svelte") {
|
|
6002
|
-
const
|
|
6003
|
-
return f.current =
|
|
6017
|
+
const z = h.default || h, P = new z({ target: C, props: l || {} });
|
|
6018
|
+
return f.current = P, () => P.$destroy();
|
|
6004
6019
|
}
|
|
6005
|
-
if (
|
|
6006
|
-
const
|
|
6020
|
+
if (h.mount) {
|
|
6021
|
+
const z = h.mount({ container: C, props: l || {} });
|
|
6007
6022
|
return () => {
|
|
6008
|
-
typeof
|
|
6023
|
+
typeof z == "function" ? z() : h.unmount?.(C);
|
|
6009
6024
|
};
|
|
6010
6025
|
}
|
|
6011
6026
|
}
|
|
6012
|
-
}, [
|
|
6027
|
+
}, [h, n]), X(() => {
|
|
6013
6028
|
n === "svelte" && f.current && f.current.$set?.(l);
|
|
6014
6029
|
}, [l, n]), /* @__PURE__ */ c("div", { ref: u, className: o, style: { display: "contents" }, children: [
|
|
6015
6030
|
p && s,
|
|
6016
|
-
|
|
6017
|
-
n === "react" &&
|
|
6031
|
+
w && a,
|
|
6032
|
+
n === "react" && h && /* @__PURE__ */ e(h, { ...l })
|
|
6018
6033
|
] });
|
|
6019
6034
|
}
|
|
6020
6035
|
class Zs extends Nt {
|
|
@@ -6066,23 +6081,23 @@ export {
|
|
|
6066
6081
|
Zs as ErrorBoundary,
|
|
6067
6082
|
Xs as FederatedResource,
|
|
6068
6083
|
cr as FilterChip,
|
|
6069
|
-
|
|
6084
|
+
Dr as FolderSelect,
|
|
6070
6085
|
bs as Form,
|
|
6071
6086
|
Qr as FormSection,
|
|
6072
6087
|
Gs as Heading,
|
|
6073
6088
|
Ut as IDENTITY_TONE_COUNT,
|
|
6074
|
-
|
|
6089
|
+
ee as Icon,
|
|
6075
6090
|
Ms as Image,
|
|
6076
6091
|
ds as ImageField,
|
|
6077
6092
|
vs as Kbd,
|
|
6078
|
-
|
|
6093
|
+
Ds as KpiCard,
|
|
6079
6094
|
is as Link,
|
|
6080
|
-
|
|
6095
|
+
$s as List,
|
|
6081
6096
|
Ts as ListBulkAction,
|
|
6082
6097
|
ss as MeetingGrid,
|
|
6083
|
-
|
|
6098
|
+
_s as MessageBubble,
|
|
6084
6099
|
Ls as MetaSeparator,
|
|
6085
|
-
|
|
6100
|
+
As as MetaValue,
|
|
6086
6101
|
it as Modal,
|
|
6087
6102
|
Is as Page,
|
|
6088
6103
|
Mn as PageHeader,
|
|
@@ -6097,7 +6112,7 @@ export {
|
|
|
6097
6112
|
Ps as SectionCaption,
|
|
6098
6113
|
Os as SectionDivider,
|
|
6099
6114
|
fr as SegmentedToggle,
|
|
6100
|
-
|
|
6115
|
+
De as Select,
|
|
6101
6116
|
js as SettingsFrameProvider,
|
|
6102
6117
|
Rs as SettingsPage,
|
|
6103
6118
|
Bs as SettingsRow,
|
|
@@ -6119,7 +6134,7 @@ export {
|
|
|
6119
6134
|
ls as VideoSurface,
|
|
6120
6135
|
Ws as View,
|
|
6121
6136
|
Xe as autofillProps,
|
|
6122
|
-
|
|
6137
|
+
Dn as badgeColumn,
|
|
6123
6138
|
Vs as booleanBadgeColumn,
|
|
6124
6139
|
ns as catTone,
|
|
6125
6140
|
i as cn,
|
|
@@ -6134,9 +6149,9 @@ export {
|
|
|
6134
6149
|
Jt as normalizeText,
|
|
6135
6150
|
cs as resolveLucideIcon,
|
|
6136
6151
|
fs as selectFilterHandler,
|
|
6137
|
-
|
|
6152
|
+
_e as text,
|
|
6138
6153
|
Pe as useAnchoredPosition,
|
|
6139
|
-
|
|
6154
|
+
$n as useSettingsFrame,
|
|
6140
6155
|
Fs as useSettingsFrameHost
|
|
6141
6156
|
};
|
|
6142
6157
|
//# sourceMappingURL=index.js.map
|