@opencxh/ui-kit 3.125.0 → 3.128.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +125 -121
- package/dist/index.js.map +1 -1
- package/dist/src/forms/Form.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -640,7 +640,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
640
640
|
format: y = "MM/dd/yyyy",
|
|
641
641
|
withTime: h = !1
|
|
642
642
|
}, f) => {
|
|
643
|
-
const [x, p] = R(!1), [w, g] = R(() => t || /* @__PURE__ */ new Date()), b = se(null), L = se(null),
|
|
643
|
+
const [x, p] = R(!1), [w, g] = R(() => t || /* @__PURE__ */ new Date()), b = se(null), L = se(null), A = ze(x, L);
|
|
644
644
|
Q(() => {
|
|
645
645
|
const i = (S) => {
|
|
646
646
|
b.current && !b.current.contains(S.target) && p(!1);
|
|
@@ -651,17 +651,17 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
651
651
|
}, [x]);
|
|
652
652
|
const _ = (i) => {
|
|
653
653
|
if (!i) return "";
|
|
654
|
-
const S = i.getDate().toString().padStart(2, "0"), N = (i.getMonth() + 1).toString().padStart(2, "0"),
|
|
654
|
+
const S = i.getDate().toString().padStart(2, "0"), N = (i.getMonth() + 1).toString().padStart(2, "0"), T = i.getFullYear(), k = y === "dd/MM/yyyy" ? `${S}/${N}/${T}` : y === "yyyy-MM-dd" ? `${T}-${N}-${S}` : `${N}/${S}/${T}`;
|
|
655
655
|
return h ? `${k} ${$(i)}` : k;
|
|
656
656
|
}, $ = (i) => `${i.getHours().toString().padStart(2, "0")}:${i.getMinutes().toString().padStart(2, "0")}`, X = (i) => {
|
|
657
657
|
const [S, N] = i.split(":").map(Number);
|
|
658
658
|
if (Number.isNaN(S) || Number.isNaN(N)) return;
|
|
659
|
-
const
|
|
660
|
-
|
|
659
|
+
const T = t ? new Date(t) : /* @__PURE__ */ new Date();
|
|
660
|
+
T.setHours(S, N, 0, 0), r?.(T);
|
|
661
661
|
}, W = () => {
|
|
662
|
-
const i = w.getFullYear(), S = w.getMonth(), N = new Date(i, S, 1),
|
|
663
|
-
|
|
664
|
-
const k = [], ee = new Date(
|
|
662
|
+
const i = w.getFullYear(), S = w.getMonth(), N = new Date(i, S, 1), T = new Date(N);
|
|
663
|
+
T.setDate(T.getDate() - N.getDay());
|
|
664
|
+
const k = [], ee = new Date(T);
|
|
665
665
|
for (let ae = 0; ae < 42; ae++)
|
|
666
666
|
k.push(new Date(ee)), ee.setDate(ee.getDate() + 1);
|
|
667
667
|
return k;
|
|
@@ -734,7 +734,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
734
734
|
}
|
|
735
735
|
)
|
|
736
736
|
] }),
|
|
737
|
-
x && /* @__PURE__ */ c("div", { style:
|
|
737
|
+
x && /* @__PURE__ */ c("div", { style: A, className: "fixed z-overlay overflow-auto rounded-lg border border-border bg-surface p-4 shadow-overlay min-w-panel", children: [
|
|
738
738
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
|
|
739
739
|
/* @__PURE__ */ e(
|
|
740
740
|
"button",
|
|
@@ -760,7 +760,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
760
760
|
] }),
|
|
761
761
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((i) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted text-center py-1", children: i }, i)) }),
|
|
762
762
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: ce.map((i, S) => {
|
|
763
|
-
const N = i.getMonth() === w.getMonth(),
|
|
763
|
+
const N = i.getMonth() === w.getMonth(), T = t && i.toDateString() === t.toDateString(), k = i.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), ee = !N || u && i < u || m && i > m;
|
|
764
764
|
return /* @__PURE__ */ e(
|
|
765
765
|
"button",
|
|
766
766
|
{
|
|
@@ -769,9 +769,9 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
769
769
|
className: d(
|
|
770
770
|
"w-8 h-8 text-sm rounded transition-colors duration-fast",
|
|
771
771
|
{
|
|
772
|
-
"text-text hover:bg-surface-hover": N && !
|
|
773
|
-
"bg-accent text-accent-fg":
|
|
774
|
-
"bg-surface-hover text-text": k && !
|
|
772
|
+
"text-text hover:bg-surface-hover": N && !T && !ee,
|
|
773
|
+
"bg-accent text-accent-fg": T,
|
|
774
|
+
"bg-surface-hover text-text": k && !T,
|
|
775
775
|
"text-text-muted cursor-not-allowed": ee
|
|
776
776
|
}
|
|
777
777
|
),
|
|
@@ -838,7 +838,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
838
838
|
onChange: g,
|
|
839
839
|
allowCreate: b,
|
|
840
840
|
onCreateOption: L,
|
|
841
|
-
...
|
|
841
|
+
...A
|
|
842
842
|
}, _) => {
|
|
843
843
|
const $ = f || `select-${Math.random().toString(36).substr(2, 9)}`, X = !!n, [W, j] = oe.useState(!1), [q, K] = oe.useState(""), re = oe.useRef(null), O = oe.useRef(null), ce = ze(W, O, { matchWidth: !0 }), [C, i] = oe.useState(l);
|
|
844
844
|
oe.useImperativeHandle(_, () => re.current), oe.useEffect(() => {
|
|
@@ -870,7 +870,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
870
870
|
}), N(D, w);
|
|
871
871
|
});
|
|
872
872
|
}, [l, w, N, S]);
|
|
873
|
-
const
|
|
873
|
+
const T = (E) => {
|
|
874
874
|
if (p) {
|
|
875
875
|
const D = Array.isArray(w) ? w : [], z = D.includes(E) ? D.filter((V) => V !== E) : [...D, E];
|
|
876
876
|
g?.(z);
|
|
@@ -888,10 +888,10 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
888
888
|
label: D
|
|
889
889
|
};
|
|
890
890
|
if (S(C, z.value) || S(C, z.label)) {
|
|
891
|
-
|
|
891
|
+
T(z.value), K(""), p || j(!1);
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
|
-
i((V) => [...V, z]),
|
|
894
|
+
i((V) => [...V, z]), T(z.value), K(""), p || j(!1);
|
|
895
895
|
}, P = () => p ? ee.length > 0 ? ee.map((E) => E.label).join(", ") : u || "Select options" : k?.label || u || "Select an option";
|
|
896
896
|
return /* @__PURE__ */ c(
|
|
897
897
|
"div",
|
|
@@ -902,7 +902,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
902
902
|
a && "w-full",
|
|
903
903
|
m
|
|
904
904
|
),
|
|
905
|
-
...
|
|
905
|
+
...A,
|
|
906
906
|
children: [
|
|
907
907
|
t && /* @__PURE__ */ e(
|
|
908
908
|
"label",
|
|
@@ -998,7 +998,7 @@ const At = () => /* @__PURE__ */ e(Y, { icon: Ze, size: "md", color: "current" }
|
|
|
998
998
|
return /* @__PURE__ */ e(
|
|
999
999
|
"li",
|
|
1000
1000
|
{
|
|
1001
|
-
onClick: () => !E.disabled &&
|
|
1001
|
+
onClick: () => !E.disabled && T(E.value),
|
|
1002
1002
|
className: d(
|
|
1003
1003
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
1004
1004
|
"text-text",
|
|
@@ -1194,7 +1194,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1194
1194
|
showAllOnOpen: g = !1,
|
|
1195
1195
|
value: b,
|
|
1196
1196
|
onChange: L,
|
|
1197
|
-
...
|
|
1197
|
+
...A
|
|
1198
1198
|
}, _) => {
|
|
1199
1199
|
const $ = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, X = !!n, W = se(null), j = se(null), [q, K] = R(b || ""), [re, O] = R(!1), [ce, C] = R(!1), [i, S] = R(!1);
|
|
1200
1200
|
Q(() => {
|
|
@@ -1231,7 +1231,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1231
1231
|
};
|
|
1232
1232
|
return document.addEventListener("mousedown", P), () => document.removeEventListener("mousedown", P);
|
|
1233
1233
|
}, []);
|
|
1234
|
-
const
|
|
1234
|
+
const T = (P) => {
|
|
1235
1235
|
const E = P.target.value;
|
|
1236
1236
|
K(E), O(!0), S(!0), L && L(P);
|
|
1237
1237
|
}, k = (P) => {
|
|
@@ -1270,7 +1270,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1270
1270
|
ref: G,
|
|
1271
1271
|
id: $,
|
|
1272
1272
|
value: q,
|
|
1273
|
-
onChange:
|
|
1273
|
+
onChange: T,
|
|
1274
1274
|
onFocus: ee,
|
|
1275
1275
|
className: fe(
|
|
1276
1276
|
// Base styles
|
|
@@ -1287,7 +1287,7 @@ const fe = (...t) => t.filter(Boolean).join(" "), Ft = (t) => /* @__PURE__ */ e(
|
|
|
1287
1287
|
X ? "border-danger-border text-danger-fg focus-visible:focus-ring" : "border-border text-text",
|
|
1288
1288
|
y || ""
|
|
1289
1289
|
),
|
|
1290
|
-
...
|
|
1290
|
+
...A
|
|
1291
1291
|
}
|
|
1292
1292
|
),
|
|
1293
1293
|
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: ae || l ? (
|
|
@@ -1468,8 +1468,8 @@ const qt = ({
|
|
|
1468
1468
|
showCheck: u = !0,
|
|
1469
1469
|
header: m
|
|
1470
1470
|
}) => {
|
|
1471
|
-
const [y, h] = R(!1), [f, x] = R(null), [p, w] = R({ top: 0, left: 0 }), g = se(null), b = se(null), L = se(null),
|
|
1472
|
-
|
|
1471
|
+
const [y, h] = R(!1), [f, x] = R(null), [p, w] = R({ top: 0, left: 0 }), g = se(null), b = se(null), L = se(null), A = se(null), _ = ze(y, b, { placement: a }), $ = se(null), X = () => Array.from(
|
|
1472
|
+
A.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1473
1473
|
);
|
|
1474
1474
|
Q(() => {
|
|
1475
1475
|
y && X()[0]?.focus();
|
|
@@ -1479,7 +1479,7 @@ const qt = ({
|
|
|
1479
1479
|
const N = X();
|
|
1480
1480
|
if (N.length === 0) return;
|
|
1481
1481
|
i.preventDefault();
|
|
1482
|
-
const
|
|
1482
|
+
const T = N.indexOf(document.activeElement), k = i.key === "Home" ? 0 : i.key === "End" ? N.length - 1 : i.key === "ArrowDown" ? (T + 1) % N.length : (T - 1 + N.length) % N.length;
|
|
1483
1483
|
N[k]?.focus();
|
|
1484
1484
|
};
|
|
1485
1485
|
Q(() => {
|
|
@@ -1554,7 +1554,7 @@ const qt = ({
|
|
|
1554
1554
|
children: t
|
|
1555
1555
|
}
|
|
1556
1556
|
),
|
|
1557
|
-
y && /* @__PURE__ */ e("div", { ref:
|
|
1557
|
+
y && /* @__PURE__ */ e("div", { ref: A, className: ce, style: _, onKeyDown: W, children: /* @__PURE__ */ c("div", { className: "p-2", role: "menu", children: [
|
|
1558
1558
|
m && (typeof m == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-text-muted uppercase tracking-label px-3 py-2", children: m }) : m),
|
|
1559
1559
|
r.map((i, S) => {
|
|
1560
1560
|
if (i.divider)
|
|
@@ -1565,7 +1565,7 @@ const qt = ({
|
|
|
1565
1565
|
},
|
|
1566
1566
|
`divider-${S}`
|
|
1567
1567
|
);
|
|
1568
|
-
const N = i.children && i.children.length > 0,
|
|
1568
|
+
const N = i.children && i.children.length > 0, T = f === i.value;
|
|
1569
1569
|
return /* @__PURE__ */ c("div", { className: "relative group", children: [
|
|
1570
1570
|
/* @__PURE__ */ c(
|
|
1571
1571
|
"button",
|
|
@@ -1581,7 +1581,7 @@ const qt = ({
|
|
|
1581
1581
|
"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",
|
|
1582
1582
|
{
|
|
1583
1583
|
"opacity-50 cursor-not-allowed": i.disabled,
|
|
1584
|
-
"bg-surface-hover":
|
|
1584
|
+
"bg-surface-hover": T && N
|
|
1585
1585
|
}
|
|
1586
1586
|
),
|
|
1587
1587
|
children: [
|
|
@@ -1599,7 +1599,7 @@ const qt = ({
|
|
|
1599
1599
|
]
|
|
1600
1600
|
}
|
|
1601
1601
|
),
|
|
1602
|
-
N &&
|
|
1602
|
+
N && T && /* @__PURE__ */ e(
|
|
1603
1603
|
"div",
|
|
1604
1604
|
{
|
|
1605
1605
|
ref: L,
|
|
@@ -1664,8 +1664,8 @@ const qt = ({
|
|
|
1664
1664
|
(() => {
|
|
1665
1665
|
const i = r.reduce((S, N) => {
|
|
1666
1666
|
if (N.divider) return S;
|
|
1667
|
-
const
|
|
1668
|
-
return S + 1 +
|
|
1667
|
+
const T = N.children ? N.children.filter((k) => !k.divider).length : 0;
|
|
1668
|
+
return S + 1 + T;
|
|
1669
1669
|
}, 0);
|
|
1670
1670
|
return i > 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: [
|
|
1671
1671
|
i,
|
|
@@ -1752,7 +1752,7 @@ const qt = ({
|
|
|
1752
1752
|
emptyContent: g,
|
|
1753
1753
|
hoverable: b = !0,
|
|
1754
1754
|
bordered: L = !1,
|
|
1755
|
-
striped:
|
|
1755
|
+
striped: A = !1,
|
|
1756
1756
|
padding: _ = "md",
|
|
1757
1757
|
className: $,
|
|
1758
1758
|
rowClassName: X,
|
|
@@ -1795,7 +1795,7 @@ const qt = ({
|
|
|
1795
1795
|
if (!l) return S;
|
|
1796
1796
|
const v = O.page * O.pageSize, U = v + O.pageSize;
|
|
1797
1797
|
return S.slice(v, U);
|
|
1798
|
-
}, [S, O, l]),
|
|
1798
|
+
}, [S, O, l]), T = ue(
|
|
1799
1799
|
(v) => {
|
|
1800
1800
|
r.find((Z) => Z.id === v)?.sortable && re((Z) => Z.column !== v ? { column: v, direction: "asc" } : Z.direction === "asc" ? { column: v, direction: "desc" } : { column: null, direction: null });
|
|
1801
1801
|
},
|
|
@@ -1899,7 +1899,7 @@ const qt = ({
|
|
|
1899
1899
|
U === r.length - 1 && je[_]
|
|
1900
1900
|
),
|
|
1901
1901
|
style: { width: v.width },
|
|
1902
|
-
onClick: () => v.sortable &&
|
|
1902
|
+
onClick: () => v.sortable && T(v.id),
|
|
1903
1903
|
children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1904
1904
|
v.headerCell ? v.headerCell() : v.header,
|
|
1905
1905
|
v.sortable && /* @__PURE__ */ c(
|
|
@@ -2155,7 +2155,7 @@ const qt = ({
|
|
|
2155
2155
|
},
|
|
2156
2156
|
l
|
|
2157
2157
|
), w = (g, b) => {
|
|
2158
|
-
const L = "transition-colors duration-fast font-medium",
|
|
2158
|
+
const L = "transition-colors duration-fast font-medium", A = {
|
|
2159
2159
|
"text-xs px-2 py-1": o === "sm",
|
|
2160
2160
|
"text-sm px-3 py-2": o === "md",
|
|
2161
2161
|
"text-base px-4 py-3": o === "lg"
|
|
@@ -2177,7 +2177,7 @@ const qt = ({
|
|
|
2177
2177
|
"text-text-muted hover:text-text": a === "pills",
|
|
2178
2178
|
"border-transparent text-text-muted hover:text-text hover:border-border": a === "underline"
|
|
2179
2179
|
} : {};
|
|
2180
|
-
return d(L,
|
|
2180
|
+
return d(L, A, _, $, X, W);
|
|
2181
2181
|
};
|
|
2182
2182
|
return /* @__PURE__ */ e(Qt.Provider, { value: f, children: /* @__PURE__ */ c("div", { children: [
|
|
2183
2183
|
/* @__PURE__ */ e("div", { className: p, role: "tablist", children: t.map((g) => /* @__PURE__ */ e(
|
|
@@ -2384,15 +2384,15 @@ const cr = ({
|
|
|
2384
2384
|
onDownloadFile: h,
|
|
2385
2385
|
onRegisterFile: f
|
|
2386
2386
|
}) => {
|
|
2387
|
-
const [x, p] = R(!1), [w, g] = R([]), [b, L] = R(null), [
|
|
2387
|
+
const [x, p] = R(!1), [w, g] = R([]), [b, L] = R(null), [A, _] = R("/"), [$, X] = R([]), [W, j] = R(!1), [q, K] = R(""), [re, O] = R(
|
|
2388
2388
|
typeof t == "object" ? t : null
|
|
2389
2389
|
), [ce, C] = R(!1), [i, S] = R(""), N = se(null);
|
|
2390
2390
|
Q(() => {
|
|
2391
|
-
x &&
|
|
2391
|
+
x && T();
|
|
2392
2392
|
}, [x]), Q(() => {
|
|
2393
2393
|
x && b && k();
|
|
2394
|
-
}, [x, b,
|
|
2395
|
-
const
|
|
2394
|
+
}, [x, b, A, q]);
|
|
2395
|
+
const T = async () => {
|
|
2396
2396
|
j(!0);
|
|
2397
2397
|
try {
|
|
2398
2398
|
const M = await m?.();
|
|
@@ -2406,7 +2406,7 @@ const cr = ({
|
|
|
2406
2406
|
if (b) {
|
|
2407
2407
|
j(!0);
|
|
2408
2408
|
try {
|
|
2409
|
-
const M = await u?.({ mountId: b.id, name: q, path:
|
|
2409
|
+
const M = await u?.({ mountId: b.id, name: q, path: A });
|
|
2410
2410
|
M?.data && X(M.data);
|
|
2411
2411
|
} catch (M) {
|
|
2412
2412
|
console.error("Failed to load files", M);
|
|
@@ -2447,7 +2447,7 @@ const cr = ({
|
|
|
2447
2447
|
filename: I.name,
|
|
2448
2448
|
mimeType: I.type || "application/octet-stream",
|
|
2449
2449
|
mountId: b.id,
|
|
2450
|
-
path:
|
|
2450
|
+
path: A
|
|
2451
2451
|
});
|
|
2452
2452
|
if (v?.data) {
|
|
2453
2453
|
const U = v.data;
|
|
@@ -2463,11 +2463,11 @@ const cr = ({
|
|
|
2463
2463
|
if (!(!i || !b)) {
|
|
2464
2464
|
j(!0);
|
|
2465
2465
|
try {
|
|
2466
|
-
const M = `${
|
|
2466
|
+
const M = `${A}${i}/`;
|
|
2467
2467
|
f && (await f({
|
|
2468
2468
|
name: i,
|
|
2469
2469
|
type: "folder",
|
|
2470
|
-
path:
|
|
2470
|
+
path: A,
|
|
2471
2471
|
mimeType: "application/x-directory",
|
|
2472
2472
|
size: 0,
|
|
2473
2473
|
mountId: b.id,
|
|
@@ -2496,19 +2496,19 @@ const cr = ({
|
|
|
2496
2496
|
const M = /* @__PURE__ */ new Set(), I = [];
|
|
2497
2497
|
return $.forEach((te) => {
|
|
2498
2498
|
if (te.type === "folder") {
|
|
2499
|
-
te.path ===
|
|
2499
|
+
te.path === A && M.add(te.name);
|
|
2500
2500
|
return;
|
|
2501
2501
|
}
|
|
2502
|
-
const v = te.providerKey || te.name, Z = (
|
|
2502
|
+
const v = te.providerKey || te.name, Z = (A ? v.substring(A.length) : v).split("/").filter((J) => J !== "");
|
|
2503
2503
|
Z.length > 1 ? M.add(Z[0]) : Z.length === 1 && I.push(te);
|
|
2504
2504
|
}), {
|
|
2505
2505
|
folders: Array.from(M).sort(),
|
|
2506
2506
|
files: I.sort((te, v) => te.name.localeCompare(v.name))
|
|
2507
2507
|
};
|
|
2508
|
-
}, [$,
|
|
2508
|
+
}, [$, A]), D = (M) => {
|
|
2509
2509
|
_((I) => `${I}${M}/`);
|
|
2510
2510
|
}, z = () => {
|
|
2511
|
-
const M =
|
|
2511
|
+
const M = A.split("/").filter((I) => I !== "");
|
|
2512
2512
|
M.pop(), M.length === 0 ? _("/") : _(`${M.join("/")}/`);
|
|
2513
2513
|
}, V = he(() => {
|
|
2514
2514
|
const M = E.folders.map((I) => ({
|
|
@@ -2637,13 +2637,13 @@ const cr = ({
|
|
|
2637
2637
|
variant: "ghost",
|
|
2638
2638
|
size: "sm",
|
|
2639
2639
|
onClick: () => {
|
|
2640
|
-
|
|
2640
|
+
A && A !== "/" ? z() : L(null);
|
|
2641
2641
|
},
|
|
2642
2642
|
leftIcon: /* @__PURE__ */ e(Y, { icon: st, size: "xs" }),
|
|
2643
|
-
children:
|
|
2643
|
+
children: A ? "Back" : "Back to Mounts"
|
|
2644
2644
|
}
|
|
2645
2645
|
),
|
|
2646
|
-
/* @__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:
|
|
2646
|
+
/* @__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: A }) }),
|
|
2647
2647
|
/* @__PURE__ */ e("div", { className: "flex-grow min-w-40", children: /* @__PURE__ */ e(
|
|
2648
2648
|
be,
|
|
2649
2649
|
{
|
|
@@ -2876,13 +2876,13 @@ const rn = ({
|
|
|
2876
2876
|
ref: w,
|
|
2877
2877
|
sdk: g
|
|
2878
2878
|
}) => {
|
|
2879
|
-
const [b, L] = R(r || {}), [
|
|
2879
|
+
const [b, L] = R(r || {}), [A, _] = R({}), [$, X] = R({});
|
|
2880
2880
|
Q(() => {
|
|
2881
2881
|
r && L({ ...r });
|
|
2882
2882
|
}, [r]);
|
|
2883
2883
|
const W = ue(
|
|
2884
2884
|
(C, i, S) => {
|
|
2885
|
-
const N = t.flatMap((
|
|
2885
|
+
const N = t.flatMap((T) => T.items).find((T) => T.name === C);
|
|
2886
2886
|
if (!N) return null;
|
|
2887
2887
|
if (N.required && (i == null || i === ""))
|
|
2888
2888
|
return `${N.label} is required`;
|
|
@@ -2892,7 +2892,7 @@ const rn = ({
|
|
|
2892
2892
|
if (i && !Array.isArray(i))
|
|
2893
2893
|
return `${N.label} must be an array.`;
|
|
2894
2894
|
if (Array.isArray(i) && N.arrayFields) {
|
|
2895
|
-
const
|
|
2895
|
+
const T = [];
|
|
2896
2896
|
let k = !1;
|
|
2897
2897
|
if (i.forEach((ee, ae) => {
|
|
2898
2898
|
const le = {};
|
|
@@ -2905,9 +2905,9 @@ const rn = ({
|
|
|
2905
2905
|
E && (le[G.name] = E, k = !0);
|
|
2906
2906
|
}
|
|
2907
2907
|
}
|
|
2908
|
-
|
|
2908
|
+
T[ae] = le;
|
|
2909
2909
|
}), k)
|
|
2910
|
-
return JSON.stringify(
|
|
2910
|
+
return JSON.stringify(T);
|
|
2911
2911
|
}
|
|
2912
2912
|
}
|
|
2913
2913
|
return N.validator ? N.validator(i, S) : null;
|
|
@@ -2921,32 +2921,32 @@ const rn = ({
|
|
|
2921
2921
|
i
|
|
2922
2922
|
);
|
|
2923
2923
|
t.flatMap((k) => k.items).find((k) => k.name === C)?.removeIfEmpty && (i == null || i === "") && (S = ur(S, C)), L(S), X((k) => ({ ...k, [C]: !0 }));
|
|
2924
|
-
const
|
|
2924
|
+
const T = W(C, i, S);
|
|
2925
2925
|
_((k) => ({
|
|
2926
2926
|
...k,
|
|
2927
|
-
[C]:
|
|
2927
|
+
[C]: T || ""
|
|
2928
2928
|
})), a?.(S, C);
|
|
2929
2929
|
},
|
|
2930
2930
|
[b, t, W, a]
|
|
2931
2931
|
), q = ue(
|
|
2932
2932
|
async (C) => {
|
|
2933
2933
|
if (C.preventDefault(), x) return;
|
|
2934
|
-
const i = {}, S = t.flatMap((
|
|
2935
|
-
for (const
|
|
2936
|
-
if (
|
|
2934
|
+
const i = {}, S = t.flatMap((T) => T.items);
|
|
2935
|
+
for (const T of S) {
|
|
2936
|
+
if (T.hidden || T.conditional && !T.conditional(b))
|
|
2937
2937
|
continue;
|
|
2938
2938
|
const k = W(
|
|
2939
|
-
|
|
2940
|
-
Oe(b,
|
|
2939
|
+
T.name,
|
|
2940
|
+
Oe(b, T.name),
|
|
2941
2941
|
b
|
|
2942
2942
|
);
|
|
2943
|
-
k && (i[
|
|
2943
|
+
k && (i[T.name] = k);
|
|
2944
2944
|
}
|
|
2945
2945
|
if (l) {
|
|
2946
|
-
const
|
|
2947
|
-
|
|
2946
|
+
const T = l(b);
|
|
2947
|
+
T && Object.assign(i, T);
|
|
2948
2948
|
}
|
|
2949
|
-
if (_(i), Object.keys(i).some((
|
|
2949
|
+
if (_(i), Object.keys(i).some((T) => i[T]))
|
|
2950
2950
|
return;
|
|
2951
2951
|
const N = o ? o(b) : b;
|
|
2952
2952
|
await n?.(b, N);
|
|
@@ -2954,7 +2954,7 @@ const rn = ({
|
|
|
2954
2954
|
[b, t, W, l, o, n, x]
|
|
2955
2955
|
), K = ue(
|
|
2956
2956
|
(C) => {
|
|
2957
|
-
const i = Oe(b, C.name), S = $[C.name] ?
|
|
2957
|
+
const i = Oe(b, C.name), S = $[C.name] ? A[C.name] : void 0, N = C.disabled || x, T = {
|
|
2958
2958
|
value: i || "",
|
|
2959
2959
|
disabled: N,
|
|
2960
2960
|
required: C.required,
|
|
@@ -2971,7 +2971,7 @@ const rn = ({
|
|
|
2971
2971
|
return /* @__PURE__ */ e(
|
|
2972
2972
|
be,
|
|
2973
2973
|
{
|
|
2974
|
-
...
|
|
2974
|
+
...T,
|
|
2975
2975
|
onChange: (k) => j(C.name, k.target.value),
|
|
2976
2976
|
type: C.textType || C.type,
|
|
2977
2977
|
autoComplete: C.autocomplete,
|
|
@@ -2983,7 +2983,7 @@ const rn = ({
|
|
|
2983
2983
|
return /* @__PURE__ */ e(
|
|
2984
2984
|
De,
|
|
2985
2985
|
{
|
|
2986
|
-
...
|
|
2986
|
+
...T,
|
|
2987
2987
|
onChange: (k) => j(C.name, k.target.value),
|
|
2988
2988
|
rows: 4,
|
|
2989
2989
|
error: S,
|
|
@@ -2994,7 +2994,7 @@ const rn = ({
|
|
|
2994
2994
|
return /* @__PURE__ */ e(
|
|
2995
2995
|
Ne,
|
|
2996
2996
|
{
|
|
2997
|
-
...
|
|
2997
|
+
...T,
|
|
2998
2998
|
onChange: (k) => j(C.name, k),
|
|
2999
2999
|
options: (C.options || []).map((k) => ({
|
|
3000
3000
|
...k,
|
|
@@ -3011,7 +3011,7 @@ const rn = ({
|
|
|
3011
3011
|
return /* @__PURE__ */ e(
|
|
3012
3012
|
pe,
|
|
3013
3013
|
{
|
|
3014
|
-
...
|
|
3014
|
+
...T,
|
|
3015
3015
|
label: C.label,
|
|
3016
3016
|
checked: !!i,
|
|
3017
3017
|
onChange: (k) => j(C.name, k.target.checked),
|
|
@@ -3045,7 +3045,7 @@ const rn = ({
|
|
|
3045
3045
|
return /* @__PURE__ */ e(
|
|
3046
3046
|
$e,
|
|
3047
3047
|
{
|
|
3048
|
-
...
|
|
3048
|
+
...T,
|
|
3049
3049
|
value: i ? new Date(i) : null,
|
|
3050
3050
|
onChange: (k) => j(C.name, k),
|
|
3051
3051
|
size: f
|
|
@@ -3055,7 +3055,7 @@ const rn = ({
|
|
|
3055
3055
|
return /* @__PURE__ */ e(
|
|
3056
3056
|
cr,
|
|
3057
3057
|
{
|
|
3058
|
-
...
|
|
3058
|
+
...T,
|
|
3059
3059
|
value: i,
|
|
3060
3060
|
onChange: (k) => j(C.name, k),
|
|
3061
3061
|
error: S,
|
|
@@ -3328,7 +3328,7 @@ const rn = ({
|
|
|
3328
3328
|
return null;
|
|
3329
3329
|
}
|
|
3330
3330
|
},
|
|
3331
|
-
[b, $,
|
|
3331
|
+
[b, $, A, x, f, j]
|
|
3332
3332
|
), re = ue(
|
|
3333
3333
|
(C) => {
|
|
3334
3334
|
if (C.conditional && !C.conditional(b))
|
|
@@ -3354,33 +3354,37 @@ const rn = ({
|
|
|
3354
3354
|
/* @__PURE__ */ e("span", { className: "text-sm font-semibold text-text", children: C.title }),
|
|
3355
3355
|
C.description && /* @__PURE__ */ e("p", { className: "mt-1 text-xs leading-4 text-text-subtle", children: C.description })
|
|
3356
3356
|
] }),
|
|
3357
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: S, children: i.map((N) =>
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3357
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("div", { className: S, children: i.map((N) => {
|
|
3358
|
+
const T = $[N.name] ? A[N.name] : void 0;
|
|
3359
|
+
return /* @__PURE__ */ c(
|
|
3360
|
+
"div",
|
|
3361
|
+
{
|
|
3362
|
+
className: d(
|
|
3363
|
+
"flex min-w-0 flex-col gap-1.5",
|
|
3364
|
+
N.type === "checkbox" && "justify-center"
|
|
3365
|
+
),
|
|
3366
|
+
style: {
|
|
3367
|
+
width: typeof N.width == "string" ? N.width : void 0,
|
|
3368
|
+
gridColumn: typeof N.width == "number" ? `span ${N.width} / span ${N.width}` : void 0
|
|
3369
|
+
},
|
|
3370
|
+
children: [
|
|
3371
|
+
N.type !== "custom" && N.type !== "checkbox" && /* @__PURE__ */ c("label", { className: "block text-xs font-semibold uppercase tracking-label text-text-subtle", children: [
|
|
3372
|
+
N.label,
|
|
3373
|
+
N.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3374
|
+
] }),
|
|
3375
|
+
K(N),
|
|
3376
|
+
N.help && !T && /* @__PURE__ */ e("p", { className: "text-xs leading-4 text-text-subtle", children: N.help })
|
|
3377
|
+
]
|
|
3367
3378
|
},
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
N.required && /* @__PURE__ */ e("span", { className: "ml-1 text-danger-fg", children: "*" })
|
|
3372
|
-
] }),
|
|
3373
|
-
K(N)
|
|
3374
|
-
]
|
|
3375
|
-
},
|
|
3376
|
-
N.name
|
|
3377
|
-
))) }) })
|
|
3379
|
+
N.name
|
|
3380
|
+
);
|
|
3381
|
+
}) }) })
|
|
3378
3382
|
]
|
|
3379
3383
|
},
|
|
3380
3384
|
C.id
|
|
3381
3385
|
);
|
|
3382
3386
|
},
|
|
3383
|
-
[b, $,
|
|
3387
|
+
[b, $, A, K]
|
|
3384
3388
|
), O = d(
|
|
3385
3389
|
"overflow-hidden rounded-lg border border-border bg-surface",
|
|
3386
3390
|
{
|
|
@@ -3888,10 +3892,10 @@ const xn = ({
|
|
|
3888
3892
|
onError: x,
|
|
3889
3893
|
...p
|
|
3890
3894
|
}) => {
|
|
3891
|
-
const [w, g] = R(!0), [b, L] = R(!1), [
|
|
3895
|
+
const [w, g] = R(!0), [b, L] = R(!1), [A, _] = R(t), $ = (O) => {
|
|
3892
3896
|
g(!1), L(!1), f?.(O);
|
|
3893
3897
|
}, X = (O) => {
|
|
3894
|
-
if (g(!1), L(!0), u &&
|
|
3898
|
+
if (g(!1), L(!0), u && A !== u) {
|
|
3895
3899
|
_(u), L(!1), g(!0);
|
|
3896
3900
|
return;
|
|
3897
3901
|
}
|
|
@@ -3942,7 +3946,7 @@ const xn = ({
|
|
|
3942
3946
|
"img",
|
|
3943
3947
|
{
|
|
3944
3948
|
...p,
|
|
3945
|
-
src:
|
|
3949
|
+
src: A,
|
|
3946
3950
|
alt: r,
|
|
3947
3951
|
className: j,
|
|
3948
3952
|
onLoad: $,
|
|
@@ -3972,7 +3976,7 @@ function bn({
|
|
|
3972
3976
|
collapsibleGroups: g = !1,
|
|
3973
3977
|
hideGroupCount: b = !1,
|
|
3974
3978
|
selectable: L = !1,
|
|
3975
|
-
selectedItems:
|
|
3979
|
+
selectedItems: A = [],
|
|
3976
3980
|
onSelectionChange: _,
|
|
3977
3981
|
bulkActions: $,
|
|
3978
3982
|
header: X,
|
|
@@ -3997,9 +4001,9 @@ function bn({
|
|
|
3997
4001
|
z.preventDefault();
|
|
3998
4002
|
const H = B.indexOf(document.activeElement), M = z.key === "Home" ? 0 : z.key === "End" ? B.length - 1 : z.key === "ArrowDown" ? (H + 1) % B.length : (H - 1 + B.length) % B.length;
|
|
3999
4003
|
B[M]?.focus();
|
|
4000
|
-
},
|
|
4004
|
+
}, T = (z, V) => r ? r(z, V) : V, k = (z) => A.includes(z), ee = (z, V) => {
|
|
4001
4005
|
_ && _(
|
|
4002
|
-
V ? [...
|
|
4006
|
+
V ? [...A, z] : A.filter((B) => B !== z)
|
|
4003
4007
|
);
|
|
4004
4008
|
}, ae = (z) => _?.(z ? [...t] : []), le = d(
|
|
4005
4009
|
"flex flex-col",
|
|
@@ -4025,7 +4029,7 @@ function bn({
|
|
|
4025
4029
|
)) });
|
|
4026
4030
|
if (t.length === 0 && q)
|
|
4027
4031
|
return /* @__PURE__ */ e("div", { className: le, children: q });
|
|
4028
|
-
const G = t.length > 0 &&
|
|
4032
|
+
const G = t.length > 0 && A.length === t.length, P = A.length > 0 && !G, E = (z, V, B) => {
|
|
4029
4033
|
const H = m?.(z, V) ?? !1, M = y?.(z, V) ?? !1, I = h?.(z, V) ?? !1, te = L && k(z);
|
|
4030
4034
|
return /* @__PURE__ */ c(
|
|
4031
4035
|
"li",
|
|
@@ -4071,7 +4075,7 @@ function bn({
|
|
|
4071
4075
|
o && /* @__PURE__ */ e("span", { className: "shrink-0 text-xs text-text-subtle", children: o(z, V) })
|
|
4072
4076
|
]
|
|
4073
4077
|
},
|
|
4074
|
-
|
|
4078
|
+
T(z, V)
|
|
4075
4079
|
);
|
|
4076
4080
|
}, D = (() => {
|
|
4077
4081
|
if (!f)
|
|
@@ -4127,7 +4131,7 @@ function bn({
|
|
|
4127
4131
|
});
|
|
4128
4132
|
})();
|
|
4129
4133
|
return /* @__PURE__ */ c("div", { ref: S, className: le, onKeyDown: l ? N : void 0, children: [
|
|
4130
|
-
L &&
|
|
4134
|
+
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: [
|
|
4131
4135
|
/* @__PURE__ */ e(
|
|
4132
4136
|
pe,
|
|
4133
4137
|
{
|
|
@@ -4138,7 +4142,7 @@ function bn({
|
|
|
4138
4142
|
}
|
|
4139
4143
|
),
|
|
4140
4144
|
/* @__PURE__ */ c("span", { className: "text-xs text-text-subtle", children: [
|
|
4141
|
-
|
|
4145
|
+
A.length,
|
|
4142
4146
|
" geselecteerd"
|
|
4143
4147
|
] }),
|
|
4144
4148
|
$ && /* @__PURE__ */ e("div", { className: "ml-auto flex gap-2", children: $ })
|
|
@@ -4220,7 +4224,7 @@ const vn = ({
|
|
|
4220
4224
|
}, [x]);
|
|
4221
4225
|
const L = () => {
|
|
4222
4226
|
h && p(!0);
|
|
4223
|
-
},
|
|
4227
|
+
}, A = () => {
|
|
4224
4228
|
p(!1), w.trim() !== "" && w !== r && f ? f(w.trim()) : g(r);
|
|
4225
4229
|
}, _ = ($) => {
|
|
4226
4230
|
$.key === "Enter" ? b.current?.blur() : $.key === "Escape" && (g(r), p(!1));
|
|
@@ -4246,7 +4250,7 @@ const vn = ({
|
|
|
4246
4250
|
type: "text",
|
|
4247
4251
|
value: w,
|
|
4248
4252
|
onChange: ($) => g($.target.value),
|
|
4249
|
-
onBlur:
|
|
4253
|
+
onBlur: A,
|
|
4250
4254
|
onKeyDown: _,
|
|
4251
4255
|
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"
|
|
4252
4256
|
}
|
|
@@ -4485,7 +4489,7 @@ const Sn = ({
|
|
|
4485
4489
|
) }),
|
|
4486
4490
|
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: h.arrayFields?.map((b) => {
|
|
4487
4491
|
const L = w?.[b.name];
|
|
4488
|
-
let
|
|
4492
|
+
let A = "-";
|
|
4489
4493
|
switch (b.type) {
|
|
4490
4494
|
case "text":
|
|
4491
4495
|
case "email":
|
|
@@ -4493,30 +4497,30 @@ const Sn = ({
|
|
|
4493
4497
|
case "tel":
|
|
4494
4498
|
case "url":
|
|
4495
4499
|
case "textarea":
|
|
4496
|
-
|
|
4500
|
+
A = L || "-";
|
|
4497
4501
|
break;
|
|
4498
4502
|
case "select":
|
|
4499
4503
|
case "radio":
|
|
4500
|
-
|
|
4504
|
+
A = l(
|
|
4501
4505
|
L,
|
|
4502
4506
|
b.options
|
|
4503
4507
|
);
|
|
4504
4508
|
break;
|
|
4505
4509
|
case "checkbox":
|
|
4506
|
-
|
|
4510
|
+
A = o(L);
|
|
4507
4511
|
break;
|
|
4508
4512
|
case "date":
|
|
4509
|
-
|
|
4513
|
+
A = a(L);
|
|
4510
4514
|
break;
|
|
4511
4515
|
case "custom":
|
|
4512
|
-
|
|
4516
|
+
A = b.customComponent?.({
|
|
4513
4517
|
value: L
|
|
4514
4518
|
});
|
|
4515
4519
|
break;
|
|
4516
4520
|
default:
|
|
4517
|
-
|
|
4521
|
+
A = String(L || "-");
|
|
4518
4522
|
}
|
|
4519
|
-
return b.format && (
|
|
4523
|
+
return b.format && (A = b.format(L, w)), /* @__PURE__ */ c("div", { className: "space-y-1", children: [
|
|
4520
4524
|
/* @__PURE__ */ e(
|
|
4521
4525
|
de,
|
|
4522
4526
|
{
|
|
@@ -4532,7 +4536,7 @@ const Sn = ({
|
|
|
4532
4536
|
variant: "body",
|
|
4533
4537
|
size: "sm",
|
|
4534
4538
|
className: "text-text",
|
|
4535
|
-
children:
|
|
4539
|
+
children: A
|
|
4536
4540
|
}
|
|
4537
4541
|
)
|
|
4538
4542
|
] }, b.name);
|
|
@@ -4875,15 +4879,15 @@ const Mn = ({
|
|
|
4875
4879
|
n();
|
|
4876
4880
|
else if (L.key === "ArrowUp")
|
|
4877
4881
|
f(
|
|
4878
|
-
(
|
|
4882
|
+
(A) => A > 0 ? A - 1 : g.length - 1
|
|
4879
4883
|
);
|
|
4880
4884
|
else if (L.key === "ArrowDown")
|
|
4881
4885
|
f(
|
|
4882
|
-
(
|
|
4886
|
+
(A) => A < g.length - 1 ? A + 1 : 0
|
|
4883
4887
|
);
|
|
4884
4888
|
else if (L.key === "Enter") {
|
|
4885
|
-
const
|
|
4886
|
-
|
|
4889
|
+
const A = g[h];
|
|
4890
|
+
A && (A.subCommands ? (y([...m, A.id]), f(0)) : A.action && (A.action(), n()));
|
|
4887
4891
|
}
|
|
4888
4892
|
}
|
|
4889
4893
|
};
|