@opencxh/ui-kit 3.120.3 → 3.120.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +158 -151
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clsx as Ue } from "clsx";
|
|
2
2
|
import { jsxs as c, jsx as e, Fragment as he } from "react/jsx-runtime";
|
|
3
|
-
import { VideoOff as qe, User as We, MicOff as Ke, Mic as _e, X as
|
|
3
|
+
import { VideoOff as qe, User as We, MicOff as Ke, Mic as _e, X as Ne, ChevronDown as pe, ExternalLink as Ge, Calendar as Je, ChevronLeft as we, ChevronRight as ke, ChevronDownIcon as Ye, Loader2 as Xe, Search as Ce, Check as De, ChevronUp as Ze, ChevronsLeft as Qe, ChevronsRight as et, FileText as ze, HardDrive as Te, ArrowLeft as tt, FolderPlus as rt, Upload as nt, Folder as Ae, Trash2 as st, Plus as at, Sparkles as lt, ImageOff as ot, Pencil as ct, ArrowUpRight as it } from "lucide-react";
|
|
4
4
|
import le, { useRef as se, useEffect as Q, forwardRef as ue, useState as U, useLayoutEffect as dt, useMemo as fe, useCallback as de, createContext as ut, Component as mt } from "react";
|
|
5
5
|
function d(...t) {
|
|
6
6
|
return Ue(t);
|
|
@@ -268,7 +268,7 @@ function Yr({
|
|
|
268
268
|
), v = /* @__PURE__ */ c(he, { children: [
|
|
269
269
|
r,
|
|
270
270
|
t,
|
|
271
|
-
l && /* @__PURE__ */ e(Y, { icon:
|
|
271
|
+
l && /* @__PURE__ */ e(Y, { icon: pe, size: "xs" })
|
|
272
272
|
] }), b = d(
|
|
273
273
|
"inline-flex items-center gap-1.5 pl-3",
|
|
274
274
|
g,
|
|
@@ -284,7 +284,7 @@ function Yr({
|
|
|
284
284
|
"aria-label": x,
|
|
285
285
|
onClick: u,
|
|
286
286
|
className: d("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", g),
|
|
287
|
-
children: /* @__PURE__ */ e(Y, { icon:
|
|
287
|
+
children: /* @__PURE__ */ e(Y, { icon: Ne, size: "xs" })
|
|
288
288
|
}
|
|
289
289
|
)
|
|
290
290
|
] }) : /* @__PURE__ */ e("button", { type: "button", title: f, onClick: y, className: d(N, b), children: v });
|
|
@@ -393,7 +393,7 @@ function Zr({
|
|
|
393
393
|
}
|
|
394
394
|
);
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function Se(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start" } = {}) {
|
|
397
397
|
const [o, l] = U({});
|
|
398
398
|
return dt(() => {
|
|
399
399
|
if (!t) return;
|
|
@@ -418,7 +418,7 @@ const kt = ({
|
|
|
418
418
|
disabled: l = !1,
|
|
419
419
|
triggerLabel: u
|
|
420
420
|
}) => {
|
|
421
|
-
const [x, y] = U(!1), f = se(null), m = se(null), h =
|
|
421
|
+
const [x, y] = U(!1), f = se(null), m = se(null), h = Se(x, m, { placement: n });
|
|
422
422
|
Q(() => {
|
|
423
423
|
if (!x) return;
|
|
424
424
|
const v = (L) => {
|
|
@@ -518,7 +518,7 @@ function Oe({
|
|
|
518
518
|
St[s],
|
|
519
519
|
f && "cursor-not-allowed opacity-50"
|
|
520
520
|
),
|
|
521
|
-
children: /* @__PURE__ */ e(
|
|
521
|
+
children: /* @__PURE__ */ e(pe, { className: "size-icon-md" })
|
|
522
522
|
}
|
|
523
523
|
),
|
|
524
524
|
children: (h) => /* @__PURE__ */ e(he, { children: o.map((g) => /* @__PURE__ */ c(
|
|
@@ -560,7 +560,7 @@ const zt = {
|
|
|
560
560
|
md: "text-base",
|
|
561
561
|
lg: "text-md",
|
|
562
562
|
full: "text-md"
|
|
563
|
-
},
|
|
563
|
+
}, ge = ue(
|
|
564
564
|
({
|
|
565
565
|
label: t,
|
|
566
566
|
helperText: r,
|
|
@@ -625,8 +625,8 @@ const zt = {
|
|
|
625
625
|
] });
|
|
626
626
|
}
|
|
627
627
|
);
|
|
628
|
-
|
|
629
|
-
const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }), Dt = () => /* @__PURE__ */ e(Y, { icon:
|
|
628
|
+
ge.displayName = "Checkbox";
|
|
629
|
+
const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }), Dt = () => /* @__PURE__ */ e(Y, { icon: we, size: "md", color: "current" }), Tt = () => /* @__PURE__ */ e(Y, { icon: ke, size: "md", color: "current" }), Me = ue(({
|
|
630
630
|
value: t,
|
|
631
631
|
onChange: r,
|
|
632
632
|
placeholder: n = "Select date",
|
|
@@ -639,7 +639,7 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
639
639
|
format: y = "MM/dd/yyyy",
|
|
640
640
|
withTime: f = !1
|
|
641
641
|
}, m) => {
|
|
642
|
-
const [h, g] = U(!1), [N, v] = U(() => t || /* @__PURE__ */ new Date()), b = se(null), L = se(null), A =
|
|
642
|
+
const [h, g] = U(!1), [N, v] = U(() => t || /* @__PURE__ */ new Date()), b = se(null), L = se(null), A = Se(h, L);
|
|
643
643
|
Q(() => {
|
|
644
644
|
const i = (S) => {
|
|
645
645
|
b.current && !b.current.contains(S.target) && g(!1);
|
|
@@ -664,7 +664,7 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
664
664
|
for (let ae = 0; ae < 42; ae++)
|
|
665
665
|
C.push(new Date(ee)), ee.setDate(ee.getDate() + 1);
|
|
666
666
|
return C;
|
|
667
|
-
},
|
|
667
|
+
}, O = (i) => {
|
|
668
668
|
if (i.getMonth() === N.getMonth() && !(u && i < u) && !(x && i > x)) {
|
|
669
669
|
if (f) {
|
|
670
670
|
const w = new Date(i);
|
|
@@ -763,7 +763,7 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
763
763
|
return /* @__PURE__ */ e(
|
|
764
764
|
"button",
|
|
765
765
|
{
|
|
766
|
-
onClick: () => !ee &&
|
|
766
|
+
onClick: () => !ee && O(i),
|
|
767
767
|
disabled: ee,
|
|
768
768
|
className: d(
|
|
769
769
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
@@ -817,7 +817,7 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
817
817
|
md: "h-control-md px-3 text-sm",
|
|
818
818
|
lg: "h-control-lg px-3 text-base",
|
|
819
819
|
full: "h-control-md w-full px-3 text-sm"
|
|
820
|
-
},
|
|
820
|
+
}, ve = (t) => t.trim().toLowerCase(), ye = ue(
|
|
821
821
|
({
|
|
822
822
|
label: t,
|
|
823
823
|
helperText: r,
|
|
@@ -839,16 +839,16 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
839
839
|
onCreateOption: L,
|
|
840
840
|
...A
|
|
841
841
|
}, X) => {
|
|
842
|
-
const $ = m || `select-${Math.random().toString(36).substr(2, 9)}`, Z = !!n, [H,
|
|
842
|
+
const $ = m || `select-${Math.random().toString(36).substr(2, 9)}`, Z = !!n, [H, O] = le.useState(!1), [F, re] = le.useState(""), V = le.useRef(null), _ = le.useRef(null), ce = Se(H, _, { matchWidth: !0 }), [k, i] = le.useState(l);
|
|
843
843
|
le.useImperativeHandle(X, () => V.current), le.useEffect(() => {
|
|
844
844
|
const M = (D) => {
|
|
845
|
-
V.current && !V.current.contains(D.target) &&
|
|
845
|
+
V.current && !V.current.contains(D.target) && O(!1);
|
|
846
846
|
};
|
|
847
847
|
return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
|
|
848
848
|
}, []);
|
|
849
849
|
const S = le.useCallback(
|
|
850
850
|
(M, D) => M.some(
|
|
851
|
-
(E) =>
|
|
851
|
+
(E) => ve(E.value) === ve(D) || ve(E.label) === ve(D)
|
|
852
852
|
),
|
|
853
853
|
[]
|
|
854
854
|
), w = le.useCallback(
|
|
@@ -874,7 +874,7 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
874
874
|
const D = Array.isArray(N) ? N : [], E = D.includes(M) ? D.filter((q) => q !== M) : [...D, M];
|
|
875
875
|
v?.(E);
|
|
876
876
|
} else
|
|
877
|
-
v?.(M),
|
|
877
|
+
v?.(M), O(!1), re("");
|
|
878
878
|
}, C = g ? null : k.find((M) => M.value === N), ee = g ? k.filter(
|
|
879
879
|
(M) => Array.isArray(N) && N.includes(M.value)
|
|
880
880
|
) : [], ae = h && F ? k.filter(
|
|
@@ -887,10 +887,10 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
887
887
|
label: D
|
|
888
888
|
};
|
|
889
889
|
if (S(k, E.value) || S(k, E.label)) {
|
|
890
|
-
T(E.value), re(""), g ||
|
|
890
|
+
T(E.value), re(""), g || O(!1);
|
|
891
891
|
return;
|
|
892
892
|
}
|
|
893
|
-
i((q) => [...q, E]), T(E.value), re(""), g ||
|
|
893
|
+
i((q) => [...q, E]), T(E.value), re(""), g || O(!1);
|
|
894
894
|
}, B = () => g ? ee.length > 0 ? ee.map((M) => M.label).join(", ") : u || "Select options" : C?.label || u || "Select an option";
|
|
895
895
|
return /* @__PURE__ */ c(
|
|
896
896
|
"div",
|
|
@@ -907,7 +907,7 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
907
907
|
"label",
|
|
908
908
|
{
|
|
909
909
|
htmlFor: $,
|
|
910
|
-
onClick: () =>
|
|
910
|
+
onClick: () => O(!H),
|
|
911
911
|
className: d(
|
|
912
912
|
"block text-xs font-semibold uppercase tracking-label mb-1.5",
|
|
913
913
|
Z ? "text-danger-fg" : "text-text-muted",
|
|
@@ -924,7 +924,7 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
924
924
|
type: "button",
|
|
925
925
|
id: $,
|
|
926
926
|
disabled: o,
|
|
927
|
-
onClick: () =>
|
|
927
|
+
onClick: () => O(!H),
|
|
928
928
|
className: d(
|
|
929
929
|
"flex w-full items-center justify-between gap-2 rounded-md border transition-colors duration-fast text-left",
|
|
930
930
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -987,7 +987,7 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
987
987
|
{
|
|
988
988
|
className: "cursor-pointer px-3 py-1.5 text-sm text-text-muted hover:bg-surface-hover",
|
|
989
989
|
onClick: () => {
|
|
990
|
-
v?.(""),
|
|
990
|
+
v?.(""), O(!1);
|
|
991
991
|
},
|
|
992
992
|
children: u
|
|
993
993
|
}
|
|
@@ -1038,7 +1038,7 @@ const $t = () => /* @__PURE__ */ e(Y, { icon: Je, size: "md", color: "current" }
|
|
|
1038
1038
|
);
|
|
1039
1039
|
}
|
|
1040
1040
|
);
|
|
1041
|
-
|
|
1041
|
+
ye.displayName = "Select";
|
|
1042
1042
|
const Lt = {
|
|
1043
1043
|
sm: "h-control-sm px-3 text-sm",
|
|
1044
1044
|
md: "h-control-md px-3 text-base",
|
|
@@ -1141,7 +1141,7 @@ function It({
|
|
|
1141
1141
|
const f = t ?? {};
|
|
1142
1142
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
1143
1143
|
/* @__PURE__ */ e(
|
|
1144
|
-
|
|
1144
|
+
ye,
|
|
1145
1145
|
{
|
|
1146
1146
|
size: a,
|
|
1147
1147
|
fullWidth: !0,
|
|
@@ -1163,7 +1163,7 @@ function It({
|
|
|
1163
1163
|
)
|
|
1164
1164
|
] });
|
|
1165
1165
|
}
|
|
1166
|
-
const me = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
1166
|
+
const me = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(Ce, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Pt = (t) => /* @__PURE__ */ e(pe, { ...t, strokeWidth: 1.5, "aria-hidden": !0 }), Ot = {
|
|
1167
1167
|
sm: "h-control-sm px-3 text-sm",
|
|
1168
1168
|
md: "h-control-md px-3 text-base",
|
|
1169
1169
|
lg: "h-control-lg px-3 text-base",
|
|
@@ -1195,7 +1195,7 @@ const me = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1195
1195
|
onChange: L,
|
|
1196
1196
|
...A
|
|
1197
1197
|
}, X) => {
|
|
1198
|
-
const $ = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, Z = !!n, H = se(null),
|
|
1198
|
+
const $ = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, Z = !!n, H = se(null), O = se(null), [F, re] = U(b || ""), [V, _] = U(!1), [ce, k] = U(!1), [i, S] = U(!1);
|
|
1199
1199
|
Q(() => {
|
|
1200
1200
|
b !== void 0 && re(b);
|
|
1201
1201
|
}, [b]);
|
|
@@ -1237,7 +1237,7 @@ const me = (...t) => t.filter(Boolean).join(" "), jt = (t) => /* @__PURE__ */ e(
|
|
|
1237
1237
|
re(B.label), _(!1), S(!1), g && g(B.value);
|
|
1238
1238
|
}, ee = () => {
|
|
1239
1239
|
(m.length > 0 || h) && (_(!0), S(!1));
|
|
1240
|
-
}, ae = l || ce, ne = V && (w.length > 0 || ae), K = fe(() => X ||
|
|
1240
|
+
}, ae = l || ce, ne = V && (w.length > 0 || ae), K = fe(() => X || O, [X]);
|
|
1241
1241
|
return /* @__PURE__ */ c(
|
|
1242
1242
|
"div",
|
|
1243
1243
|
{
|
|
@@ -1467,7 +1467,7 @@ const Vt = ({
|
|
|
1467
1467
|
showCheck: u = !0,
|
|
1468
1468
|
header: x
|
|
1469
1469
|
}) => {
|
|
1470
|
-
const [y, f] = U(!1), [m, h] = U(null), [g, N] = U({ top: 0, left: 0 }), v = se(null), b = se(null), L = se(null), A = se(null), X =
|
|
1470
|
+
const [y, f] = U(!1), [m, h] = U(null), [g, N] = U({ top: 0, left: 0 }), v = se(null), b = se(null), L = se(null), A = se(null), X = Se(y, b, { placement: a }), $ = se(null), Z = () => Array.from(
|
|
1471
1471
|
A.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1472
1472
|
);
|
|
1473
1473
|
Q(() => {
|
|
@@ -1511,7 +1511,7 @@ const Vt = ({
|
|
|
1511
1511
|
}, [m]), Q(() => () => {
|
|
1512
1512
|
$.current && clearTimeout($.current);
|
|
1513
1513
|
}, []);
|
|
1514
|
-
const
|
|
1514
|
+
const O = (i) => {
|
|
1515
1515
|
i.stopPropagation(), !o && (f(!y), h(null), $.current && (clearTimeout($.current), $.current = null));
|
|
1516
1516
|
}, F = (i, S, w) => {
|
|
1517
1517
|
i.stopPropagation(), !S.disabled && !S.divider && (!S.children || S.children.length === 0) && (s?.(S.value, w), f(!1), h(null));
|
|
@@ -1543,7 +1543,7 @@ const Vt = ({
|
|
|
1543
1543
|
"button",
|
|
1544
1544
|
{
|
|
1545
1545
|
ref: b,
|
|
1546
|
-
onClick:
|
|
1546
|
+
onClick: O,
|
|
1547
1547
|
disabled: o,
|
|
1548
1548
|
"aria-haspopup": "menu",
|
|
1549
1549
|
"aria-expanded": y,
|
|
@@ -1675,7 +1675,7 @@ const Vt = ({
|
|
|
1675
1675
|
]
|
|
1676
1676
|
}
|
|
1677
1677
|
);
|
|
1678
|
-
}, Ht = () => /* @__PURE__ */ e(Y, { icon:
|
|
1678
|
+
}, Ht = () => /* @__PURE__ */ e(Y, { icon: Ce, size: "md", color: "current" }), Ut = ({ active: t }) => /* @__PURE__ */ e(Y, { icon: Ze, size: "sm", className: t ? "text-text" : "text-text-subtle" }), qt = ({ active: t }) => /* @__PURE__ */ e(Y, { icon: pe, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Wt = () => /* @__PURE__ */ e(Y, { icon: we, size: "md", color: "current" }), Kt = () => /* @__PURE__ */ e(Y, { icon: ke, size: "md", color: "current" }), _t = () => /* @__PURE__ */ e(Y, { icon: Qe, size: "md", color: "current" }), Gt = () => /* @__PURE__ */ e(Y, { icon: et, size: "md", color: "current" }), Be = () => /* @__PURE__ */ e(Y, { icon: pe, size: "md", color: "current" }), Jt = (t) => {
|
|
1679
1679
|
const r = (s) => t.multiSelect && Array.isArray(t.value) ? t.value?.includes(s) : t.value === s, n = (s) => {
|
|
1680
1680
|
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((a) => a !== s)) : t.onChange(s);
|
|
1681
1681
|
};
|
|
@@ -1737,7 +1737,7 @@ const Vt = ({
|
|
|
1737
1737
|
selectable: m = !1,
|
|
1738
1738
|
selectedRows: h = [],
|
|
1739
1739
|
onSelectionChange: g,
|
|
1740
|
-
getRowKey: N = (H,
|
|
1740
|
+
getRowKey: N = (H, O) => O,
|
|
1741
1741
|
emptyContent: v,
|
|
1742
1742
|
hoverable: b = !0,
|
|
1743
1743
|
bordered: L = !1,
|
|
@@ -1746,7 +1746,7 @@ const Vt = ({
|
|
|
1746
1746
|
rowClassName: $,
|
|
1747
1747
|
headerBackground: Z = !0
|
|
1748
1748
|
}) => {
|
|
1749
|
-
const [H,
|
|
1749
|
+
const [H, O] = U(""), [F, re] = U({
|
|
1750
1750
|
column: null,
|
|
1751
1751
|
direction: null
|
|
1752
1752
|
}), [V, _] = U({
|
|
@@ -1755,49 +1755,49 @@ const Vt = ({
|
|
|
1755
1755
|
}), ce = se(null), k = fe(() => {
|
|
1756
1756
|
let p = t;
|
|
1757
1757
|
if (s && H.trim()) {
|
|
1758
|
-
const
|
|
1758
|
+
const j = r.filter(
|
|
1759
1759
|
(J) => J.searchable !== !1
|
|
1760
1760
|
), G = H.toLowerCase();
|
|
1761
|
-
p = p.filter((J) =>
|
|
1762
|
-
const oe = typeof
|
|
1761
|
+
p = p.filter((J) => j.some((P) => {
|
|
1762
|
+
const oe = typeof P.accessor == "function" ? P.accessor(J) : J[P.accessor];
|
|
1763
1763
|
return String(oe || "").toLowerCase().includes(G);
|
|
1764
1764
|
}));
|
|
1765
1765
|
}
|
|
1766
|
-
return o.forEach((
|
|
1767
|
-
|
|
1768
|
-
const J = r.find((oe) => oe.id ===
|
|
1766
|
+
return o.forEach((j) => {
|
|
1767
|
+
j.value && j.value !== "all" && (p = p.filter((G) => {
|
|
1768
|
+
const J = r.find((oe) => oe.id === j.id);
|
|
1769
1769
|
if (!J) return !0;
|
|
1770
|
-
const
|
|
1771
|
-
return String(
|
|
1770
|
+
const P = typeof J.accessor == "function" ? J.accessor(G) : G[J.accessor];
|
|
1771
|
+
return String(P || "") === j.value;
|
|
1772
1772
|
}));
|
|
1773
1773
|
}), p;
|
|
1774
1774
|
}, [t, H, r, s, o]), i = fe(() => {
|
|
1775
1775
|
if (!F.column || !F.direction) return k;
|
|
1776
|
-
const p = r.find((
|
|
1777
|
-
return p ? [...k].sort((
|
|
1778
|
-
const J = typeof p.accessor == "function" ? p.accessor(
|
|
1776
|
+
const p = r.find((j) => j.id === F.column);
|
|
1777
|
+
return p ? [...k].sort((j, G) => {
|
|
1778
|
+
const J = typeof p.accessor == "function" ? p.accessor(j) : j[p.accessor], P = typeof p.accessor == "function" ? p.accessor(G) : G[p.accessor];
|
|
1779
1779
|
let oe = 0;
|
|
1780
|
-
return J <
|
|
1780
|
+
return J < P ? oe = -1 : J > P && (oe = 1), F.direction === "desc" ? -oe : oe;
|
|
1781
1781
|
}) : k;
|
|
1782
1782
|
}, [k, F, r]), S = fe(() => {
|
|
1783
1783
|
if (!l) return i;
|
|
1784
|
-
const p = V.page * V.pageSize,
|
|
1785
|
-
return i.slice(p,
|
|
1784
|
+
const p = V.page * V.pageSize, j = p + V.pageSize;
|
|
1785
|
+
return i.slice(p, j);
|
|
1786
1786
|
}, [i, V, l]), w = de(
|
|
1787
1787
|
(p) => {
|
|
1788
1788
|
r.find((G) => G.id === p)?.sortable && re((G) => G.column !== p ? { column: p, direction: "asc" } : G.direction === "asc" ? { column: p, direction: "desc" } : { column: null, direction: null });
|
|
1789
1789
|
},
|
|
1790
1790
|
[r]
|
|
1791
1791
|
), T = de((p) => {
|
|
1792
|
-
_((
|
|
1792
|
+
_((j) => ({ ...j, page: p }));
|
|
1793
1793
|
}, []), C = de((p) => {
|
|
1794
1794
|
_({ page: 0, pageSize: p });
|
|
1795
1795
|
}, []), ee = de(
|
|
1796
|
-
(p,
|
|
1796
|
+
(p, j) => {
|
|
1797
1797
|
if (!g) return;
|
|
1798
1798
|
const G = N(p, 0);
|
|
1799
|
-
h.map((J,
|
|
1800
|
-
(J,
|
|
1799
|
+
h.map((J, P) => N(J, P)), g(j ? [...h, p] : h.filter(
|
|
1800
|
+
(J, P) => N(h[P], P) !== G
|
|
1801
1801
|
));
|
|
1802
1802
|
},
|
|
1803
1803
|
[h, g, N]
|
|
@@ -1813,20 +1813,20 @@ const Vt = ({
|
|
|
1813
1813
|
_((p) => ({ ...p, page: 0 }));
|
|
1814
1814
|
}, [o.map((p) => p.value).join(",")]);
|
|
1815
1815
|
const ne = i.length, K = Math.ceil(ne / V.pageSize), B = V.page * V.pageSize + 1, M = Math.min(B + V.pageSize - 1, ne), D = S.length > 0 && S.every((p) => {
|
|
1816
|
-
const
|
|
1816
|
+
const j = N(p, 0);
|
|
1817
1817
|
return h.some(
|
|
1818
|
-
(G, J) => N(G, J) ===
|
|
1818
|
+
(G, J) => N(G, J) === j
|
|
1819
1819
|
);
|
|
1820
1820
|
}), E = S.some((p) => {
|
|
1821
|
-
const
|
|
1821
|
+
const j = N(p, 0);
|
|
1822
1822
|
return h.some(
|
|
1823
|
-
(G, J) => N(G, J) ===
|
|
1823
|
+
(G, J) => N(G, J) === j
|
|
1824
1824
|
);
|
|
1825
1825
|
}), q = d(
|
|
1826
1826
|
"w-full text-sm leading-5 text-text border-collapse",
|
|
1827
1827
|
X
|
|
1828
|
-
), R = Z ? "bg-surface-sunk border-border border-t" : "bg-surface", W = d(R), z = d(
|
|
1829
|
-
"text-text
|
|
1828
|
+
), R = Z ? "bg-surface-sunk border-border border-t" : "bg-surface", W = d(R, "h-control-lg"), z = d(
|
|
1829
|
+
"text-text border-b border-border"
|
|
1830
1830
|
), I = d("h-row-lg", {
|
|
1831
1831
|
"hover:bg-surface-sunk": b,
|
|
1832
1832
|
"cursor-pointer": f
|
|
@@ -1839,7 +1839,7 @@ const Vt = ({
|
|
|
1839
1839
|
{
|
|
1840
1840
|
placeholder: a,
|
|
1841
1841
|
value: H,
|
|
1842
|
-
onChange: (p) =>
|
|
1842
|
+
onChange: (p) => O(p.target.value),
|
|
1843
1843
|
startIcon: /* @__PURE__ */ e(Ht, {}),
|
|
1844
1844
|
className: "max-w-sm"
|
|
1845
1845
|
}
|
|
@@ -1868,7 +1868,7 @@ const Vt = ({
|
|
|
1868
1868
|
className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
|
|
1869
1869
|
}
|
|
1870
1870
|
) }),
|
|
1871
|
-
!n && r.map((p) => /* @__PURE__ */ e(
|
|
1871
|
+
!n && r.map((p, j) => /* @__PURE__ */ e(
|
|
1872
1872
|
"th",
|
|
1873
1873
|
{
|
|
1874
1874
|
className: d(
|
|
@@ -1882,7 +1882,9 @@ const Vt = ({
|
|
|
1882
1882
|
"cursor-pointer select-none": p.sortable,
|
|
1883
1883
|
[`sticky left-0 ${R}`]: p.sticky === "left",
|
|
1884
1884
|
[`sticky right-0 ${R}`]: p.sticky === "right"
|
|
1885
|
-
}
|
|
1885
|
+
},
|
|
1886
|
+
j === 0 && "pl-2",
|
|
1887
|
+
j === r.length - 1 && "pr-2"
|
|
1886
1888
|
),
|
|
1887
1889
|
style: { width: p.width },
|
|
1888
1890
|
onClick: () => p.sortable && w(p.id),
|
|
@@ -1927,9 +1929,9 @@ const Vt = ({
|
|
|
1927
1929
|
),
|
|
1928
1930
|
children: v || "No data available"
|
|
1929
1931
|
}
|
|
1930
|
-
) }) : S.map((p,
|
|
1931
|
-
const G = N(p,
|
|
1932
|
-
(
|
|
1932
|
+
) }) : S.map((p, j) => {
|
|
1933
|
+
const G = N(p, j), J = h.some(
|
|
1934
|
+
(P, oe) => N(P, oe) === G
|
|
1933
1935
|
);
|
|
1934
1936
|
return /* @__PURE__ */ c(
|
|
1935
1937
|
"tr",
|
|
@@ -1937,10 +1939,10 @@ const Vt = ({
|
|
|
1937
1939
|
className: d(
|
|
1938
1940
|
I,
|
|
1939
1941
|
{ "bg-accent-soft": J },
|
|
1940
|
-
$?.(p,
|
|
1942
|
+
$?.(p, j)
|
|
1941
1943
|
),
|
|
1942
|
-
onClick: (
|
|
1943
|
-
|
|
1944
|
+
onClick: (P) => {
|
|
1945
|
+
P.stopPropagation(), f?.(p, j);
|
|
1944
1946
|
},
|
|
1945
1947
|
children: [
|
|
1946
1948
|
m && /* @__PURE__ */ e("td", { className: z, children: /* @__PURE__ */ e(
|
|
@@ -1948,27 +1950,32 @@ const Vt = ({
|
|
|
1948
1950
|
{
|
|
1949
1951
|
type: "checkbox",
|
|
1950
1952
|
checked: J,
|
|
1951
|
-
onChange: (
|
|
1952
|
-
|
|
1953
|
+
onChange: (P) => {
|
|
1954
|
+
P.stopPropagation(), ee(p, P.target.checked);
|
|
1953
1955
|
},
|
|
1954
1956
|
className: "rounded border-border [&:not(:checked)]:bg-surface-input text-accent"
|
|
1955
1957
|
}
|
|
1956
1958
|
) }),
|
|
1957
|
-
r.map((
|
|
1958
|
-
const
|
|
1959
|
+
r.map((P, oe) => {
|
|
1960
|
+
const be = typeof P.accessor == "function" ? P.accessor(p) : p[P.accessor];
|
|
1959
1961
|
return /* @__PURE__ */ e(
|
|
1960
1962
|
"td",
|
|
1961
1963
|
{
|
|
1962
|
-
className: d(
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1964
|
+
className: d(
|
|
1965
|
+
z,
|
|
1966
|
+
{
|
|
1967
|
+
"text-left": P.align === "left" || !P.align,
|
|
1968
|
+
"text-center": P.align === "center",
|
|
1969
|
+
"text-right": P.align === "right",
|
|
1970
|
+
"sticky left-0 bg-surface": P.sticky === "left",
|
|
1971
|
+
"sticky right-0 bg-surface": P.sticky === "right"
|
|
1972
|
+
},
|
|
1973
|
+
oe === 0 && "pl-2",
|
|
1974
|
+
oe === r.length - 1 && "pr-2"
|
|
1975
|
+
),
|
|
1976
|
+
children: P.cell ? P.cell(be, p, oe) : String(be || "")
|
|
1970
1977
|
},
|
|
1971
|
-
|
|
1978
|
+
P.id
|
|
1972
1979
|
);
|
|
1973
1980
|
}),
|
|
1974
1981
|
y.length > 0 && /* @__PURE__ */ e("td", { className: z, children: /* @__PURE__ */ e(
|
|
@@ -1978,17 +1985,17 @@ const Vt = ({
|
|
|
1978
1985
|
/* @__PURE__ */ e("span", { children: "Options" }),
|
|
1979
1986
|
/* @__PURE__ */ e(Be, {})
|
|
1980
1987
|
] }),
|
|
1981
|
-
options: y.map((
|
|
1982
|
-
value:
|
|
1983
|
-
label:
|
|
1984
|
-
icon:
|
|
1985
|
-
disabled:
|
|
1988
|
+
options: y.map((P) => ({
|
|
1989
|
+
value: P.id,
|
|
1990
|
+
label: P.label,
|
|
1991
|
+
icon: P.icon,
|
|
1992
|
+
disabled: P.disabled?.(p)
|
|
1986
1993
|
})),
|
|
1987
|
-
onSelect: (
|
|
1994
|
+
onSelect: (P) => {
|
|
1988
1995
|
const oe = y.find(
|
|
1989
|
-
(
|
|
1996
|
+
(be) => be.id === P
|
|
1990
1997
|
);
|
|
1991
|
-
oe && oe.onClick(p,
|
|
1998
|
+
oe && oe.onClick(p, j);
|
|
1992
1999
|
},
|
|
1993
2000
|
placement: "bottom-end"
|
|
1994
2001
|
}
|
|
@@ -2263,7 +2270,7 @@ function Re({
|
|
|
2263
2270
|
onClick: r,
|
|
2264
2271
|
className: "p-1 text-text-muted hover:text-text transition-colors",
|
|
2265
2272
|
"aria-label": "Close modal",
|
|
2266
|
-
children: /* @__PURE__ */ e(Y, { icon:
|
|
2273
|
+
children: /* @__PURE__ */ e(Y, { icon: Ne, size: "lg", color: "current" })
|
|
2267
2274
|
}
|
|
2268
2275
|
)
|
|
2269
2276
|
] }),
|
|
@@ -2365,7 +2372,7 @@ const ar = ({
|
|
|
2365
2372
|
onDownloadFile: f,
|
|
2366
2373
|
onRegisterFile: m
|
|
2367
2374
|
}) => {
|
|
2368
|
-
const [h, g] = U(!1), [N, v] = U([]), [b, L] = U(null), [A, X] = U("/"), [$, Z] = U([]), [H,
|
|
2375
|
+
const [h, g] = U(!1), [N, v] = U([]), [b, L] = U(null), [A, X] = U("/"), [$, Z] = U([]), [H, O] = U(!1), [F, re] = U(""), [V, _] = U(
|
|
2369
2376
|
typeof t == "object" ? t : null
|
|
2370
2377
|
), [ce, k] = U(!1), [i, S] = U(""), w = se(null);
|
|
2371
2378
|
Q(() => {
|
|
@@ -2374,33 +2381,33 @@ const ar = ({
|
|
|
2374
2381
|
h && b && C();
|
|
2375
2382
|
}, [h, b, A, F]);
|
|
2376
2383
|
const T = async () => {
|
|
2377
|
-
|
|
2384
|
+
O(!0);
|
|
2378
2385
|
try {
|
|
2379
2386
|
const z = await x?.();
|
|
2380
2387
|
z?.data && v(z.data);
|
|
2381
2388
|
} catch (z) {
|
|
2382
2389
|
console.error("Failed to load mounts", z);
|
|
2383
2390
|
} finally {
|
|
2384
|
-
|
|
2391
|
+
O(!1);
|
|
2385
2392
|
}
|
|
2386
2393
|
}, C = async () => {
|
|
2387
2394
|
if (b) {
|
|
2388
|
-
|
|
2395
|
+
O(!0);
|
|
2389
2396
|
try {
|
|
2390
2397
|
const z = await u?.({ mountId: b.id, name: F, path: A });
|
|
2391
2398
|
z?.data && Z(z.data);
|
|
2392
2399
|
} catch (z) {
|
|
2393
2400
|
console.error("Failed to load files", z);
|
|
2394
2401
|
} finally {
|
|
2395
|
-
|
|
2402
|
+
O(!1);
|
|
2396
2403
|
}
|
|
2397
2404
|
}
|
|
2398
2405
|
}, ee = async (z) => {
|
|
2399
2406
|
const I = z.target.files?.[0];
|
|
2400
2407
|
if (I) {
|
|
2401
|
-
|
|
2408
|
+
O(!0);
|
|
2402
2409
|
try {
|
|
2403
|
-
const p = await I.arrayBuffer(),
|
|
2410
|
+
const p = await I.arrayBuffer(), j = new Uint8Array(p), G = {
|
|
2404
2411
|
id: `local-${Date.now()}`,
|
|
2405
2412
|
name: I.name,
|
|
2406
2413
|
type: "file",
|
|
@@ -2411,38 +2418,38 @@ const ar = ({
|
|
|
2411
2418
|
providerKey: I.name,
|
|
2412
2419
|
ownerId: "me"
|
|
2413
2420
|
};
|
|
2414
|
-
_(G), r(G,
|
|
2421
|
+
_(G), r(G, j), g(!1);
|
|
2415
2422
|
} catch (p) {
|
|
2416
2423
|
console.error("Local file selection failed", p);
|
|
2417
2424
|
} finally {
|
|
2418
|
-
|
|
2425
|
+
O(!1);
|
|
2419
2426
|
}
|
|
2420
2427
|
}
|
|
2421
2428
|
}, ae = async (z) => {
|
|
2422
2429
|
const I = z.target.files?.[0];
|
|
2423
2430
|
if (!(!I || !b)) {
|
|
2424
|
-
|
|
2431
|
+
O(!0);
|
|
2425
2432
|
try {
|
|
2426
|
-
const p = await I.arrayBuffer(),
|
|
2433
|
+
const p = await I.arrayBuffer(), j = await y?.({
|
|
2427
2434
|
file: new Uint8Array(p),
|
|
2428
2435
|
filename: I.name,
|
|
2429
2436
|
mimeType: I.type || "application/octet-stream",
|
|
2430
2437
|
mountId: b.id,
|
|
2431
2438
|
path: A
|
|
2432
2439
|
});
|
|
2433
|
-
if (
|
|
2434
|
-
const G =
|
|
2440
|
+
if (j?.data) {
|
|
2441
|
+
const G = j.data;
|
|
2435
2442
|
_(G), r(G, new Uint8Array(p)), g(!1);
|
|
2436
2443
|
}
|
|
2437
2444
|
} catch (p) {
|
|
2438
2445
|
console.error("Upload failed", p);
|
|
2439
2446
|
} finally {
|
|
2440
|
-
|
|
2447
|
+
O(!1);
|
|
2441
2448
|
}
|
|
2442
2449
|
}
|
|
2443
2450
|
}, ne = async () => {
|
|
2444
2451
|
if (!(!i || !b)) {
|
|
2445
|
-
|
|
2452
|
+
O(!0);
|
|
2446
2453
|
try {
|
|
2447
2454
|
const z = `${A}${i}/`;
|
|
2448
2455
|
m && (await m({
|
|
@@ -2458,18 +2465,18 @@ const ar = ({
|
|
|
2458
2465
|
} catch (z) {
|
|
2459
2466
|
console.error("Failed to create folder", z);
|
|
2460
2467
|
} finally {
|
|
2461
|
-
|
|
2468
|
+
O(!1);
|
|
2462
2469
|
}
|
|
2463
2470
|
}
|
|
2464
2471
|
}, K = async (z) => {
|
|
2465
|
-
|
|
2472
|
+
O(!0);
|
|
2466
2473
|
try {
|
|
2467
2474
|
const I = await f?.(z.id);
|
|
2468
2475
|
_(z), r(z, I), g(!1);
|
|
2469
2476
|
} catch (I) {
|
|
2470
2477
|
console.error("Failed to download file", I);
|
|
2471
2478
|
} finally {
|
|
2472
|
-
|
|
2479
|
+
O(!1);
|
|
2473
2480
|
}
|
|
2474
2481
|
}, B = (z) => {
|
|
2475
2482
|
z.stopPropagation(), _(null), r(null);
|
|
@@ -2480,11 +2487,11 @@ const ar = ({
|
|
|
2480
2487
|
p.path === A && z.add(p.name);
|
|
2481
2488
|
return;
|
|
2482
2489
|
}
|
|
2483
|
-
const
|
|
2490
|
+
const j = p.providerKey || p.name, J = (A ? j.substring(A.length) : j).split("/").filter((P) => P !== "");
|
|
2484
2491
|
J.length > 1 ? z.add(J[0]) : J.length === 1 && I.push(p);
|
|
2485
2492
|
}), {
|
|
2486
2493
|
folders: Array.from(z).sort(),
|
|
2487
|
-
files: I.sort((p,
|
|
2494
|
+
files: I.sort((p, j) => p.name.localeCompare(j.name))
|
|
2488
2495
|
};
|
|
2489
2496
|
}, [$, A]), D = (z) => {
|
|
2490
2497
|
X((I) => `${I}${z}/`);
|
|
@@ -2586,7 +2593,7 @@ const ar = ({
|
|
|
2586
2593
|
{
|
|
2587
2594
|
onClick: B,
|
|
2588
2595
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
2589
|
-
children: /* @__PURE__ */ e(Y, { icon:
|
|
2596
|
+
children: /* @__PURE__ */ e(Y, { icon: Ne, size: "xs" })
|
|
2590
2597
|
}
|
|
2591
2598
|
)
|
|
2592
2599
|
]
|
|
@@ -2631,7 +2638,7 @@ const ar = ({
|
|
|
2631
2638
|
placeholder: "Search...",
|
|
2632
2639
|
value: F,
|
|
2633
2640
|
onChange: (z) => re(z.target.value),
|
|
2634
|
-
startIcon: /* @__PURE__ */ e(
|
|
2641
|
+
startIcon: /* @__PURE__ */ e(Ce, { size: 14 }),
|
|
2635
2642
|
fullWidth: !0,
|
|
2636
2643
|
size: "sm"
|
|
2637
2644
|
}
|
|
@@ -2894,7 +2901,7 @@ const en = ({
|
|
|
2894
2901
|
return w.validator ? w.validator(i, S) : null;
|
|
2895
2902
|
},
|
|
2896
2903
|
[t]
|
|
2897
|
-
),
|
|
2904
|
+
), O = de(
|
|
2898
2905
|
(k, i) => {
|
|
2899
2906
|
let S = or(
|
|
2900
2907
|
b,
|
|
@@ -2953,7 +2960,7 @@ const en = ({
|
|
|
2953
2960
|
xe,
|
|
2954
2961
|
{
|
|
2955
2962
|
...T,
|
|
2956
|
-
onChange: (C) =>
|
|
2963
|
+
onChange: (C) => O(k.name, C.target.value),
|
|
2957
2964
|
type: k.textType || k.type,
|
|
2958
2965
|
autoComplete: k.autocomplete,
|
|
2959
2966
|
error: S,
|
|
@@ -2965,7 +2972,7 @@ const en = ({
|
|
|
2965
2972
|
$e,
|
|
2966
2973
|
{
|
|
2967
2974
|
...T,
|
|
2968
|
-
onChange: (C) =>
|
|
2975
|
+
onChange: (C) => O(k.name, C.target.value),
|
|
2969
2976
|
rows: 4,
|
|
2970
2977
|
error: S,
|
|
2971
2978
|
size: m
|
|
@@ -2973,10 +2980,10 @@ const en = ({
|
|
|
2973
2980
|
);
|
|
2974
2981
|
case "select":
|
|
2975
2982
|
return /* @__PURE__ */ e(
|
|
2976
|
-
|
|
2983
|
+
ye,
|
|
2977
2984
|
{
|
|
2978
2985
|
...T,
|
|
2979
|
-
onChange: (C) =>
|
|
2986
|
+
onChange: (C) => O(k.name, C),
|
|
2980
2987
|
options: (k.options || []).map((C) => ({
|
|
2981
2988
|
...C,
|
|
2982
2989
|
value: String(C.value)
|
|
@@ -2990,11 +2997,11 @@ const en = ({
|
|
|
2990
2997
|
);
|
|
2991
2998
|
case "checkbox":
|
|
2992
2999
|
return /* @__PURE__ */ e(
|
|
2993
|
-
|
|
3000
|
+
ge,
|
|
2994
3001
|
{
|
|
2995
3002
|
...T,
|
|
2996
3003
|
checked: !!i,
|
|
2997
|
-
onChange: (C) =>
|
|
3004
|
+
onChange: (C) => O(k.name, C.target.checked),
|
|
2998
3005
|
size: m
|
|
2999
3006
|
}
|
|
3000
3007
|
);
|
|
@@ -3011,7 +3018,7 @@ const en = ({
|
|
|
3011
3018
|
name: k.name,
|
|
3012
3019
|
value: C.value,
|
|
3013
3020
|
checked: i === C.value,
|
|
3014
|
-
onChange: () =>
|
|
3021
|
+
onChange: () => O(k.name, C.value),
|
|
3015
3022
|
disabled: w || C.disabled,
|
|
3016
3023
|
className: "size-checkbox shrink-0 border border-border-strong bg-surface-input accent-accent focus-visible:outline-none focus-visible:focus-ring"
|
|
3017
3024
|
}
|
|
@@ -3027,7 +3034,7 @@ const en = ({
|
|
|
3027
3034
|
{
|
|
3028
3035
|
...T,
|
|
3029
3036
|
value: i ? new Date(i) : null,
|
|
3030
|
-
onChange: (C) =>
|
|
3037
|
+
onChange: (C) => O(k.name, C),
|
|
3031
3038
|
size: m
|
|
3032
3039
|
}
|
|
3033
3040
|
);
|
|
@@ -3037,7 +3044,7 @@ const en = ({
|
|
|
3037
3044
|
{
|
|
3038
3045
|
...T,
|
|
3039
3046
|
value: i,
|
|
3040
|
-
onChange: (C) =>
|
|
3047
|
+
onChange: (C) => O(k.name, C),
|
|
3041
3048
|
error: S,
|
|
3042
3049
|
onListFiles: (C) => v?.http.invoke({
|
|
3043
3050
|
method: "POST",
|
|
@@ -3069,7 +3076,7 @@ const en = ({
|
|
|
3069
3076
|
It,
|
|
3070
3077
|
{
|
|
3071
3078
|
value: i || {},
|
|
3072
|
-
onChange: (C) =>
|
|
3079
|
+
onChange: (C) => O(k.name, C),
|
|
3073
3080
|
onListFolders: () => v?.http.invoke({
|
|
3074
3081
|
method: "GET",
|
|
3075
3082
|
action: "storage.mount"
|
|
@@ -3082,7 +3089,7 @@ const en = ({
|
|
|
3082
3089
|
case "custom":
|
|
3083
3090
|
return k.customComponent?.({
|
|
3084
3091
|
value: i,
|
|
3085
|
-
onChange: (C) =>
|
|
3092
|
+
onChange: (C) => O(k.name, C),
|
|
3086
3093
|
error: S,
|
|
3087
3094
|
disabled: w
|
|
3088
3095
|
});
|
|
@@ -3095,9 +3102,9 @@ const en = ({
|
|
|
3095
3102
|
} catch {
|
|
3096
3103
|
}
|
|
3097
3104
|
const ae = () => {
|
|
3098
|
-
|
|
3105
|
+
O(k.name, [...C, {}]);
|
|
3099
3106
|
}, ne = (B) => {
|
|
3100
|
-
|
|
3107
|
+
O(
|
|
3101
3108
|
k.name,
|
|
3102
3109
|
C.filter((M, D) => D !== B)
|
|
3103
3110
|
);
|
|
@@ -3106,7 +3113,7 @@ const en = ({
|
|
|
3106
3113
|
E[B] = {
|
|
3107
3114
|
...E[B],
|
|
3108
3115
|
[M]: D
|
|
3109
|
-
},
|
|
3116
|
+
}, O(k.name, E);
|
|
3110
3117
|
};
|
|
3111
3118
|
return /* @__PURE__ */ c("div", { className: "flex flex-col gap-2", children: [
|
|
3112
3119
|
C.map((B, M) => /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
|
|
@@ -3168,7 +3175,7 @@ const en = ({
|
|
|
3168
3175
|
);
|
|
3169
3176
|
case "select":
|
|
3170
3177
|
return /* @__PURE__ */ e(
|
|
3171
|
-
|
|
3178
|
+
ye,
|
|
3172
3179
|
{
|
|
3173
3180
|
...q,
|
|
3174
3181
|
onChange: (R) => K(
|
|
@@ -3191,7 +3198,7 @@ const en = ({
|
|
|
3191
3198
|
);
|
|
3192
3199
|
case "checkbox":
|
|
3193
3200
|
return /* @__PURE__ */ e(
|
|
3194
|
-
|
|
3201
|
+
ge,
|
|
3195
3202
|
{
|
|
3196
3203
|
...q,
|
|
3197
3204
|
checked: !!B?.[D.name],
|
|
@@ -3308,7 +3315,7 @@ const en = ({
|
|
|
3308
3315
|
return null;
|
|
3309
3316
|
}
|
|
3310
3317
|
},
|
|
3311
|
-
[b, $, A, h, m,
|
|
3318
|
+
[b, $, A, h, m, O]
|
|
3312
3319
|
), V = de(
|
|
3313
3320
|
(k) => {
|
|
3314
3321
|
if (k.conditional && !k.conditional(b))
|
|
@@ -3503,7 +3510,7 @@ function rn({
|
|
|
3503
3510
|
onClick: o,
|
|
3504
3511
|
className: "ml-1.5 flex-shrink-0 hover:opacity-70 transition-opacity",
|
|
3505
3512
|
"aria-label": "Remove badge",
|
|
3506
|
-
children: /* @__PURE__ */ e(Y, { icon:
|
|
3513
|
+
children: /* @__PURE__ */ e(Y, { icon: Ne, size: "xs", color: "current" })
|
|
3507
3514
|
}
|
|
3508
3515
|
)
|
|
3509
3516
|
]
|
|
@@ -3904,7 +3911,7 @@ const fn = ({
|
|
|
3904
3911
|
"rounded-full": a === "full"
|
|
3905
3912
|
},
|
|
3906
3913
|
f
|
|
3907
|
-
),
|
|
3914
|
+
), O = d(
|
|
3908
3915
|
"w-full h-full object-cover transition-opacity duration-fast",
|
|
3909
3916
|
{
|
|
3910
3917
|
"opacity-0": N || b,
|
|
@@ -3924,7 +3931,7 @@ const fn = ({
|
|
|
3924
3931
|
...g,
|
|
3925
3932
|
src: A,
|
|
3926
3933
|
alt: r,
|
|
3927
|
-
className:
|
|
3934
|
+
className: O,
|
|
3928
3935
|
onLoad: $,
|
|
3929
3936
|
onError: Z
|
|
3930
3937
|
}
|
|
@@ -3957,7 +3964,7 @@ function hn({
|
|
|
3957
3964
|
bulkActions: $,
|
|
3958
3965
|
header: Z,
|
|
3959
3966
|
stickyHeader: H = !1,
|
|
3960
|
-
bordered:
|
|
3967
|
+
bordered: O = !1,
|
|
3961
3968
|
emptyContent: F,
|
|
3962
3969
|
loading: re = !1,
|
|
3963
3970
|
loadingRows: V = 4,
|
|
@@ -3983,7 +3990,7 @@ function hn({
|
|
|
3983
3990
|
);
|
|
3984
3991
|
}, ae = (E) => X?.(E ? [...t] : []), ne = d(
|
|
3985
3992
|
"flex flex-col",
|
|
3986
|
-
|
|
3993
|
+
O && "overflow-hidden rounded-lg border border-border-subtle",
|
|
3987
3994
|
_
|
|
3988
3995
|
);
|
|
3989
3996
|
if (re)
|
|
@@ -4017,8 +4024,8 @@ function hn({
|
|
|
4017
4024
|
"aria-current": W || void 0,
|
|
4018
4025
|
onClick: () => l(E, q),
|
|
4019
4026
|
onFocus: () => u?.(q),
|
|
4020
|
-
onKeyDown: (
|
|
4021
|
-
|
|
4027
|
+
onKeyDown: (j) => {
|
|
4028
|
+
j.key !== "Enter" && j.key !== " " || (j.preventDefault(), l(E, q));
|
|
4022
4029
|
}
|
|
4023
4030
|
} : {},
|
|
4024
4031
|
className: d(
|
|
@@ -4031,11 +4038,11 @@ function hn({
|
|
|
4031
4038
|
I && "opacity-55"
|
|
4032
4039
|
),
|
|
4033
4040
|
children: [
|
|
4034
|
-
L && /* @__PURE__ */ e("span", { onClick: (
|
|
4035
|
-
|
|
4041
|
+
L && /* @__PURE__ */ e("span", { onClick: (j) => j.stopPropagation(), children: /* @__PURE__ */ e(
|
|
4042
|
+
ge,
|
|
4036
4043
|
{
|
|
4037
4044
|
checked: C(E),
|
|
4038
|
-
onChange: (
|
|
4045
|
+
onChange: (j) => ee(E, j.target.checked),
|
|
4039
4046
|
"aria-label": "Rij selecteren"
|
|
4040
4047
|
}
|
|
4041
4048
|
) }),
|
|
@@ -4066,10 +4073,10 @@ function hn({
|
|
|
4066
4073
|
...q.filter((W) => E.has(W.id)),
|
|
4067
4074
|
...[...E.keys()].filter((W) => !q.some((z) => z.id === W)).map((W) => ({ id: W }))
|
|
4068
4075
|
].flatMap((W, z) => {
|
|
4069
|
-
const I = E.get(W.id) ?? [], p = v && k[W.id],
|
|
4076
|
+
const I = E.get(W.id) ?? [], p = v && k[W.id], j = W.title ?? W.id, G = W.count ?? I.length, J = /* @__PURE__ */ e(
|
|
4070
4077
|
"li",
|
|
4071
4078
|
{
|
|
4072
|
-
onClick: v ? () => i((
|
|
4079
|
+
onClick: v ? () => i((P) => ({ ...P, [W.id]: !P[W.id] })) : void 0,
|
|
4073
4080
|
className: d(
|
|
4074
4081
|
"flex items-center gap-2 bg-surface-sunk px-4 py-1.5",
|
|
4075
4082
|
"text-xs font-semibold uppercase tracking-label text-text-subtle",
|
|
@@ -4081,9 +4088,9 @@ function hn({
|
|
|
4081
4088
|
),
|
|
4082
4089
|
"aria-expanded": v ? !p : void 0,
|
|
4083
4090
|
style: N ? { top: H ? 28 : 0 } : void 0,
|
|
4084
|
-
children: g ? g(W, I.map((
|
|
4091
|
+
children: g ? g(W, I.map((P) => P.item)) : /* @__PURE__ */ c(he, { children: [
|
|
4085
4092
|
v && /* @__PURE__ */ e(
|
|
4086
|
-
|
|
4093
|
+
ke,
|
|
4087
4094
|
{
|
|
4088
4095
|
"aria-hidden": !0,
|
|
4089
4096
|
className: d(
|
|
@@ -4092,7 +4099,7 @@ function hn({
|
|
|
4092
4099
|
)
|
|
4093
4100
|
}
|
|
4094
4101
|
),
|
|
4095
|
-
/* @__PURE__ */ e("span", { children:
|
|
4102
|
+
/* @__PURE__ */ e("span", { children: j }),
|
|
4096
4103
|
!b && /* @__PURE__ */ e("span", { className: "ml-auto font-normal tabular-nums", children: G })
|
|
4097
4104
|
] })
|
|
4098
4105
|
},
|
|
@@ -4101,7 +4108,7 @@ function hn({
|
|
|
4101
4108
|
return p ? [J] : [
|
|
4102
4109
|
J,
|
|
4103
4110
|
...I.map(
|
|
4104
|
-
({ item:
|
|
4111
|
+
({ item: P, index: oe }, be) => M(P, oe, be === 0)
|
|
4105
4112
|
)
|
|
4106
4113
|
];
|
|
4107
4114
|
});
|
|
@@ -4109,7 +4116,7 @@ function hn({
|
|
|
4109
4116
|
return /* @__PURE__ */ c("div", { ref: S, className: ne, onKeyDown: l ? w : void 0, children: [
|
|
4110
4117
|
L && A.length > 0 && /* @__PURE__ */ c("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
|
|
4111
4118
|
/* @__PURE__ */ e(
|
|
4112
|
-
|
|
4119
|
+
ge,
|
|
4113
4120
|
{
|
|
4114
4121
|
checked: K,
|
|
4115
4122
|
indeterminate: B,
|
|
@@ -4218,7 +4225,7 @@ const gn = ({
|
|
|
4218
4225
|
children: [
|
|
4219
4226
|
/* @__PURE__ */ c("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
4220
4227
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-4 text-text", children: [
|
|
4221
|
-
y && /* @__PURE__ */ e(te, { variant: "secondary", onClick: y, leftIcon: /* @__PURE__ */ e(Y, { icon:
|
|
4228
|
+
y && /* @__PURE__ */ e(te, { variant: "secondary", onClick: y, leftIcon: /* @__PURE__ */ e(Y, { icon: we, size: "sm" }), iconOnly: !0 }),
|
|
4222
4229
|
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
4223
4230
|
h ? /* @__PURE__ */ e(
|
|
4224
4231
|
"input",
|
|
@@ -4301,7 +4308,7 @@ const gn = ({
|
|
|
4301
4308
|
padding: a = "md",
|
|
4302
4309
|
children: o
|
|
4303
4310
|
}) => /* @__PURE__ */ c("div", { className: d("flex items-center gap-2 mb-3", zr[a], s), children: [
|
|
4304
|
-
r && /* @__PURE__ */ e(te, { variant: "secondary", onClick: r, leftIcon: /* @__PURE__ */ e(Y, { icon:
|
|
4311
|
+
r && /* @__PURE__ */ e(te, { variant: "secondary", onClick: r, leftIcon: /* @__PURE__ */ e(Y, { icon: we, size: "sm" }), iconOnly: !0 }),
|
|
4305
4312
|
o && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: o }),
|
|
4306
4313
|
t.length > 0 && /* @__PURE__ */ e("div", { className: d("flex flex-wrap gap-2", !o && "ml-auto"), children: t.map(
|
|
4307
4314
|
(l) => l.splitOptions && l.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
@@ -4860,7 +4867,7 @@ const zn = ({
|
|
|
4860
4867
|
ref: h,
|
|
4861
4868
|
children: [
|
|
4862
4869
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4863
|
-
/* @__PURE__ */ e(
|
|
4870
|
+
/* @__PURE__ */ e(Ce, { className: "w-4 h-4 text-text-muted shrink-0" }),
|
|
4864
4871
|
/* @__PURE__ */ e(
|
|
4865
4872
|
"input",
|
|
4866
4873
|
{
|
|
@@ -4892,7 +4899,7 @@ const zn = ({
|
|
|
4892
4899
|
children: [
|
|
4893
4900
|
b.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: b.icon }),
|
|
4894
4901
|
/* @__PURE__ */ e("span", { className: "flex-grow", children: b.label }),
|
|
4895
|
-
b.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(
|
|
4902
|
+
b.subCommands && /* @__PURE__ */ e("span", { className: "text-text-muted", children: /* @__PURE__ */ e(ke, { className: "w-4 h-4" }) })
|
|
4896
4903
|
]
|
|
4897
4904
|
},
|
|
4898
4905
|
b.id
|
|
@@ -5111,7 +5118,7 @@ export {
|
|
|
5111
5118
|
Jr as ButtonGroup,
|
|
5112
5119
|
En as Card,
|
|
5113
5120
|
mn as ChannelBadge,
|
|
5114
|
-
|
|
5121
|
+
ge as Checkbox,
|
|
5115
5122
|
zn as CommandPalette,
|
|
5116
5123
|
tn as ConfirmDialog,
|
|
5117
5124
|
Rt as ContentLoading,
|
|
@@ -5141,7 +5148,7 @@ export {
|
|
|
5141
5148
|
Ft as SearchableTextField,
|
|
5142
5149
|
vn as SectionDivider,
|
|
5143
5150
|
Zr as SegmentedToggle,
|
|
5144
|
-
|
|
5151
|
+
ye as Select,
|
|
5145
5152
|
yn as SettingsRow,
|
|
5146
5153
|
Nn as SettingsSection,
|
|
5147
5154
|
Cn as SidebarMenu,
|