@opencxh/ui-kit 3.96.0 → 3.98.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 +96 -84
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { clsx as
|
|
1
|
+
import { clsx as je } from "clsx";
|
|
2
2
|
import { jsxs as d, jsx as e, Fragment as we } from "react/jsx-runtime";
|
|
3
|
-
import { VideoOff as
|
|
4
|
-
import se, { useRef as Z, useEffect as
|
|
3
|
+
import { VideoOff as _e, User as Pe, MicOff as Be, Mic as Oe, ChevronDown as We, ChevronDownIcon as $e, FileText as xe, HardDrive as Ce, X as Fe, ArrowLeft as ke, Search as Te, FolderPlus as Ve, Upload as Re, Folder as Se, Pencil as He, ChevronRight as qe } from "lucide-react";
|
|
4
|
+
import se, { useRef as Z, useEffect as G, forwardRef as ce, useState as B, useMemo as de, useCallback as ae, createContext as Ue, Component as Ge } from "react";
|
|
5
5
|
function p(...t) {
|
|
6
|
-
return
|
|
6
|
+
return je(t);
|
|
7
7
|
}
|
|
8
8
|
function er(t) {
|
|
9
9
|
return (a, r) => t[a]?.[r] || "";
|
|
@@ -40,9 +40,9 @@ function nr({
|
|
|
40
40
|
u
|
|
41
41
|
),
|
|
42
42
|
children: [
|
|
43
|
-
s && o ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: o }) : /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: a ? /* @__PURE__ */ e("img", { src: a, alt: t, className: "w-16 h-16 rounded-full object-cover" }) : /* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-gray-700 flex items-center justify-center", children: s ? /* @__PURE__ */ e(
|
|
43
|
+
s && o ? /* @__PURE__ */ e("div", { className: "absolute inset-0", children: o }) : /* @__PURE__ */ e("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: a ? /* @__PURE__ */ e("img", { src: a, alt: t, className: "w-16 h-16 rounded-full object-cover" }) : /* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-gray-700 flex items-center justify-center", children: s ? /* @__PURE__ */ e(_e, { className: "w-8 h-8" }) : /* @__PURE__ */ e(Pe, { className: "w-8 h-8" }) }) }),
|
|
44
44
|
/* @__PURE__ */ d("div", { className: "absolute bottom-2 left-2 flex items-center gap-1.5 px-2 py-1 rounded bg-black/50 text-white text-xs", children: [
|
|
45
|
-
r ? /* @__PURE__ */ e(
|
|
45
|
+
r ? /* @__PURE__ */ e(Be, { className: "w-3 h-3" }) : /* @__PURE__ */ e(Oe, { className: "w-3 h-3" }),
|
|
46
46
|
/* @__PURE__ */ e("span", { className: "truncate max-w-[140px]", children: t })
|
|
47
47
|
] })
|
|
48
48
|
]
|
|
@@ -51,7 +51,7 @@ function nr({
|
|
|
51
51
|
}
|
|
52
52
|
function ar({ attach: t, active: a = !0, mirrored: r = !1, className: n }) {
|
|
53
53
|
const s = Z(null);
|
|
54
|
-
return
|
|
54
|
+
return G(() => {
|
|
55
55
|
if (!a || !s.current) return;
|
|
56
56
|
const o = t(s.current);
|
|
57
57
|
return () => {
|
|
@@ -302,7 +302,7 @@ const lr = ({
|
|
|
302
302
|
triggerLabel: o
|
|
303
303
|
}) => {
|
|
304
304
|
const [u, x] = B(!1), [b, g] = B({}), f = Z(null), l = Z(null);
|
|
305
|
-
|
|
305
|
+
G(() => {
|
|
306
306
|
if (!u) return;
|
|
307
307
|
const k = (y) => {
|
|
308
308
|
f.current && !f.current.contains(y.target) && x(!1);
|
|
@@ -356,7 +356,7 @@ const lr = ({
|
|
|
356
356
|
secondary: "btn o__secondary",
|
|
357
357
|
outline: "btn o__secondary"
|
|
358
358
|
};
|
|
359
|
-
function
|
|
359
|
+
function De({
|
|
360
360
|
label: t,
|
|
361
361
|
onClick: a,
|
|
362
362
|
variant: r = "primary",
|
|
@@ -400,7 +400,7 @@ function Te({
|
|
|
400
400
|
n === "sm" ? "px-1.5 py-1.5" : "px-2 py-2",
|
|
401
401
|
"!rounded-l-none"
|
|
402
402
|
),
|
|
403
|
-
children: /* @__PURE__ */ e(
|
|
403
|
+
children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
|
|
404
404
|
}
|
|
405
405
|
),
|
|
406
406
|
children: (m) => /* @__PURE__ */ e(we, { children: o.map((h) => /* @__PURE__ */ d(
|
|
@@ -511,7 +511,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
511
511
|
format: g = "MM/dd/yyyy"
|
|
512
512
|
}, f) => {
|
|
513
513
|
const [l, m] = B(!1), [h, k] = B(() => t || /* @__PURE__ */ new Date()), w = Z(null);
|
|
514
|
-
|
|
514
|
+
G(() => {
|
|
515
515
|
const D = (W) => {
|
|
516
516
|
w.current && !w.current.contains(W.target) && m(!1);
|
|
517
517
|
};
|
|
@@ -544,7 +544,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
544
544
|
k(new Date(h.getFullYear(), h.getMonth() - 1, 1));
|
|
545
545
|
}, P = () => {
|
|
546
546
|
k(new Date(h.getFullYear(), h.getMonth() + 1, 1));
|
|
547
|
-
},
|
|
547
|
+
}, U = () => {
|
|
548
548
|
a?.(null), m(!1);
|
|
549
549
|
}, F = p(
|
|
550
550
|
"w-full border border-neutral rounded-md transition-colors duration-200",
|
|
@@ -650,7 +650,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
650
650
|
/* @__PURE__ */ e(
|
|
651
651
|
"button",
|
|
652
652
|
{
|
|
653
|
-
onClick:
|
|
653
|
+
onClick: U,
|
|
654
654
|
className: "text-sm text-muted hover:text-default",
|
|
655
655
|
children: "Clear"
|
|
656
656
|
}
|
|
@@ -734,8 +734,8 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
734
734
|
onChange: A,
|
|
735
735
|
...N
|
|
736
736
|
}, q) => {
|
|
737
|
-
const P = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`,
|
|
738
|
-
|
|
737
|
+
const P = f || `searchfield-${Math.random().toString(36).substr(2, 9)}`, U = !!r, F = Z(null), z = Z(null), [H, D] = B(y || ""), [W, V] = B(!1), [i, v] = B(!1), [E, S] = B(!1);
|
|
738
|
+
G(() => {
|
|
739
739
|
y !== void 0 && D(y);
|
|
740
740
|
}, [y]);
|
|
741
741
|
const M = de(() => {
|
|
@@ -745,7 +745,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
745
745
|
(I) => String(I.label).toLowerCase().includes(T)
|
|
746
746
|
);
|
|
747
747
|
}, [H, l, w, E]);
|
|
748
|
-
|
|
748
|
+
G(() => {
|
|
749
749
|
if (!m || !H) {
|
|
750
750
|
v(!1);
|
|
751
751
|
return;
|
|
@@ -763,7 +763,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
763
763
|
return () => {
|
|
764
764
|
clearTimeout(T), v(!1);
|
|
765
765
|
};
|
|
766
|
-
}, [H, k, m]),
|
|
766
|
+
}, [H, k, m]), G(() => {
|
|
767
767
|
const T = (I) => {
|
|
768
768
|
F.current && !F.current.contains(I.target) && V(!1);
|
|
769
769
|
};
|
|
@@ -794,7 +794,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
794
794
|
htmlFor: P,
|
|
795
795
|
className: ie(
|
|
796
796
|
"block text-sm font-medium mb-1",
|
|
797
|
-
|
|
797
|
+
U ? "text-error" : "text-default",
|
|
798
798
|
b || ""
|
|
799
799
|
),
|
|
800
800
|
children: t
|
|
@@ -822,7 +822,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
822
822
|
"pr-10",
|
|
823
823
|
// Altijd padding rechts voor de dropdown/loading icon
|
|
824
824
|
// State styles
|
|
825
|
-
|
|
825
|
+
U ? "border-red-500 text-error focus:border-red-500 focus:ring-red-500" : "border-neutral text-default",
|
|
826
826
|
g || ""
|
|
827
827
|
),
|
|
828
828
|
...N
|
|
@@ -900,7 +900,7 @@ const tt = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
|
|
|
900
900
|
{
|
|
901
901
|
className: ie(
|
|
902
902
|
"mt-1 text-xs",
|
|
903
|
-
|
|
903
|
+
U ? "text-error" : "text-muted"
|
|
904
904
|
),
|
|
905
905
|
children: r || a
|
|
906
906
|
}
|
|
@@ -941,7 +941,7 @@ const ct = {
|
|
|
941
941
|
onCreateOption: y,
|
|
942
942
|
...A
|
|
943
943
|
}, N) => {
|
|
944
|
-
const q = f || `select-${Math.random().toString(36).substr(2, 9)}`, P = !!r, [
|
|
944
|
+
const q = f || `select-${Math.random().toString(36).substr(2, 9)}`, P = !!r, [U, F] = se.useState(!1), [z, H] = se.useState(""), D = se.useRef(null), [W, V] = se.useState(o);
|
|
945
945
|
se.useImperativeHandle(N, () => D.current), se.useEffect(() => {
|
|
946
946
|
const $ = (j) => {
|
|
947
947
|
D.current && !D.current.contains(j.target) && F(!1);
|
|
@@ -1009,7 +1009,7 @@ const ct = {
|
|
|
1009
1009
|
"label",
|
|
1010
1010
|
{
|
|
1011
1011
|
htmlFor: q,
|
|
1012
|
-
onClick: () => F(!
|
|
1012
|
+
onClick: () => F(!U),
|
|
1013
1013
|
className: p(
|
|
1014
1014
|
"block text-sm font-medium mb-1",
|
|
1015
1015
|
P ? "text-error" : "text-default",
|
|
@@ -1019,14 +1019,14 @@ const ct = {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
),
|
|
1021
1021
|
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
1022
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ d(
|
|
1023
1023
|
"button",
|
|
1024
1024
|
{
|
|
1025
1025
|
type: "button",
|
|
1026
1026
|
id: q,
|
|
1027
|
-
onClick: () => F(!
|
|
1027
|
+
onClick: () => F(!U),
|
|
1028
1028
|
className: p(
|
|
1029
|
-
"
|
|
1029
|
+
"flex w-full items-center justify-between gap-2 rounded-lg border transition-colors duration-200 text-left",
|
|
1030
1030
|
"focus:outline-none focus:ring-0 focus:ring-offset-0",
|
|
1031
1031
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1032
1032
|
"bg-module",
|
|
@@ -1034,10 +1034,22 @@ const ct = {
|
|
|
1034
1034
|
P ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-default",
|
|
1035
1035
|
g
|
|
1036
1036
|
),
|
|
1037
|
-
children:
|
|
1037
|
+
children: [
|
|
1038
|
+
/* @__PURE__ */ e("span", { className: "truncate flex-1 min-w-0", children: X() }),
|
|
1039
|
+
/* @__PURE__ */ e(
|
|
1040
|
+
$e,
|
|
1041
|
+
{
|
|
1042
|
+
size: 16,
|
|
1043
|
+
className: p(
|
|
1044
|
+
"shrink-0 opacity-60 transition-transform duration-200",
|
|
1045
|
+
U && "rotate-180"
|
|
1046
|
+
)
|
|
1047
|
+
}
|
|
1048
|
+
)
|
|
1049
|
+
]
|
|
1038
1050
|
}
|
|
1039
1051
|
),
|
|
1040
|
-
|
|
1052
|
+
U && /* @__PURE__ */ d("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-module shadow-lg border border-neutral", children: [
|
|
1041
1053
|
l && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
|
|
1042
1054
|
"input",
|
|
1043
1055
|
{
|
|
@@ -1439,21 +1451,21 @@ const ft = ({
|
|
|
1439
1451
|
header: b
|
|
1440
1452
|
}) => {
|
|
1441
1453
|
const [g, f] = B(!1), [l, m] = B(null), [h, k] = B({ top: 0, left: 0 }), [w, y] = B({}), A = Z(null), N = Z(null), q = Z(null), P = Z(null);
|
|
1442
|
-
|
|
1454
|
+
G(() => {
|
|
1443
1455
|
const i = (v) => {
|
|
1444
1456
|
A.current && (!A.current.contains(v.target) || q.current && !q.current.contains(v.target)) && (f(!1), m(null), P.current && (clearTimeout(P.current), P.current = null));
|
|
1445
1457
|
};
|
|
1446
1458
|
return g && document.addEventListener("mousedown", i), () => {
|
|
1447
1459
|
document.removeEventListener("mousedown", i);
|
|
1448
1460
|
};
|
|
1449
|
-
}, [g]),
|
|
1461
|
+
}, [g]), G(() => {
|
|
1450
1462
|
const i = (v) => {
|
|
1451
1463
|
v.key === "Escape" && (f(!1), m(null), P.current && (clearTimeout(P.current), P.current = null));
|
|
1452
1464
|
};
|
|
1453
1465
|
return g && document.addEventListener("keydown", i), () => {
|
|
1454
1466
|
document.removeEventListener("keydown", i);
|
|
1455
1467
|
};
|
|
1456
|
-
}, [g]),
|
|
1468
|
+
}, [g]), G(() => {
|
|
1457
1469
|
if (l && A.current) {
|
|
1458
1470
|
const i = A.current.querySelector(
|
|
1459
1471
|
`[data-option-value="${l}"]`
|
|
@@ -1466,10 +1478,10 @@ const ft = ({
|
|
|
1466
1478
|
});
|
|
1467
1479
|
}
|
|
1468
1480
|
}
|
|
1469
|
-
}, [l]),
|
|
1481
|
+
}, [l]), G(() => () => {
|
|
1470
1482
|
P.current && clearTimeout(P.current);
|
|
1471
1483
|
}, []);
|
|
1472
|
-
const
|
|
1484
|
+
const U = (i) => {
|
|
1473
1485
|
if (i.stopPropagation(), !o) {
|
|
1474
1486
|
if (!g) {
|
|
1475
1487
|
const v = N.current?.getBoundingClientRect();
|
|
@@ -1510,7 +1522,7 @@ const ft = ({
|
|
|
1510
1522
|
"button",
|
|
1511
1523
|
{
|
|
1512
1524
|
ref: N,
|
|
1513
|
-
onClick:
|
|
1525
|
+
onClick: U,
|
|
1514
1526
|
disabled: o,
|
|
1515
1527
|
className: p("inline-flex items-center justify-center", {
|
|
1516
1528
|
"opacity-50 cursor-not-allowed": o
|
|
@@ -1763,7 +1775,7 @@ const ft = ({
|
|
|
1763
1775
|
}
|
|
1764
1776
|
)
|
|
1765
1777
|
}
|
|
1766
|
-
),
|
|
1778
|
+
), Ie = () => /* @__PURE__ */ e(
|
|
1767
1779
|
"svg",
|
|
1768
1780
|
{
|
|
1769
1781
|
className: "h-4 w-4",
|
|
@@ -1799,7 +1811,7 @@ const ft = ({
|
|
|
1799
1811
|
/* @__PURE__ */ e("span", { className: "text-default", children: t.multiSelect && Array.isArray(t.value) ? t.value?.map(
|
|
1800
1812
|
(n) => t.options?.find((s) => s.value === n)?.label
|
|
1801
1813
|
).join(", ") : t.options?.find((n) => n.value === t.value)?.label }),
|
|
1802
|
-
/* @__PURE__ */ e("span", { className: "text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(
|
|
1814
|
+
/* @__PURE__ */ e("span", { className: "text-muted text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(Ie, {}) })
|
|
1803
1815
|
] }),
|
|
1804
1816
|
/* @__PURE__ */ d("div", { className: "absolute z-10 left-0 mt-1 bg-module border border-neutral rounded-lg shadow-lvl-0 p-2 w-48", children: [
|
|
1805
1817
|
t.options?.map((n) => /* @__PURE__ */ e(
|
|
@@ -1842,7 +1854,7 @@ const ft = ({
|
|
|
1842
1854
|
selectable: l = !1,
|
|
1843
1855
|
selectedRows: m = [],
|
|
1844
1856
|
onSelectionChange: h,
|
|
1845
|
-
getRowKey: k = (
|
|
1857
|
+
getRowKey: k = (U, F) => F,
|
|
1846
1858
|
emptyContent: w,
|
|
1847
1859
|
hoverable: y = !0,
|
|
1848
1860
|
bordered: A = !1,
|
|
@@ -1850,7 +1862,7 @@ const ft = ({
|
|
|
1850
1862
|
className: q,
|
|
1851
1863
|
rowClassName: P
|
|
1852
1864
|
}) => {
|
|
1853
|
-
const [
|
|
1865
|
+
const [U, F] = B(""), [z, H] = B({
|
|
1854
1866
|
column: null,
|
|
1855
1867
|
direction: null
|
|
1856
1868
|
}), [D, W] = B({
|
|
@@ -1858,10 +1870,10 @@ const ft = ({
|
|
|
1858
1870
|
pageSize: b
|
|
1859
1871
|
}), V = Z(null), i = de(() => {
|
|
1860
1872
|
let c = t;
|
|
1861
|
-
if (n &&
|
|
1873
|
+
if (n && U.trim()) {
|
|
1862
1874
|
const C = a.filter(
|
|
1863
1875
|
(R) => R.searchable !== !1
|
|
1864
|
-
), O =
|
|
1876
|
+
), O = U.toLowerCase();
|
|
1865
1877
|
c = c.filter((R) => C.some((_) => {
|
|
1866
1878
|
const J = typeof _.accessor == "function" ? _.accessor(R) : R[_.accessor];
|
|
1867
1879
|
return String(J || "").toLowerCase().includes(O);
|
|
@@ -1875,7 +1887,7 @@ const ft = ({
|
|
|
1875
1887
|
return String(_ || "") === C.value;
|
|
1876
1888
|
}));
|
|
1877
1889
|
}), c;
|
|
1878
|
-
}, [t,
|
|
1890
|
+
}, [t, U, a, n, o]), v = de(() => {
|
|
1879
1891
|
if (!z.column || !z.direction) return i;
|
|
1880
1892
|
const c = a.find((C) => C.id === z.column);
|
|
1881
1893
|
return c ? [...i].sort((C, O) => {
|
|
@@ -1911,9 +1923,9 @@ const ft = ({
|
|
|
1911
1923
|
},
|
|
1912
1924
|
[E, h]
|
|
1913
1925
|
);
|
|
1914
|
-
|
|
1926
|
+
G(() => {
|
|
1915
1927
|
W((c) => ({ ...c, page: 0 }));
|
|
1916
|
-
}, [
|
|
1928
|
+
}, [U, z]), G(() => {
|
|
1917
1929
|
W((c) => ({ ...c, page: 0 }));
|
|
1918
1930
|
}, [o.map((c) => c.value).join(",")]);
|
|
1919
1931
|
const X = v.length, $ = Math.ceil(X / D.pageSize), j = D.page * D.pageSize + 1, T = Math.min(j + D.pageSize - 1, X), I = E.length > 0 && E.every((c) => {
|
|
@@ -1942,7 +1954,7 @@ const ft = ({
|
|
|
1942
1954
|
ue,
|
|
1943
1955
|
{
|
|
1944
1956
|
placeholder: s,
|
|
1945
|
-
value:
|
|
1957
|
+
value: U,
|
|
1946
1958
|
onChange: (c) => F(c.target.value),
|
|
1947
1959
|
startIcon: /* @__PURE__ */ e(ht, {}),
|
|
1948
1960
|
className: "max-w-sm"
|
|
@@ -2080,7 +2092,7 @@ const ft = ({
|
|
|
2080
2092
|
{
|
|
2081
2093
|
trigger: /* @__PURE__ */ d("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-muted hover:text-default", children: [
|
|
2082
2094
|
/* @__PURE__ */ e("span", { children: "Options" }),
|
|
2083
|
-
/* @__PURE__ */ e(
|
|
2095
|
+
/* @__PURE__ */ e(Ie, {})
|
|
2084
2096
|
] }),
|
|
2085
2097
|
options: g.map((_) => ({
|
|
2086
2098
|
value: _.id,
|
|
@@ -2254,7 +2266,7 @@ const ft = ({
|
|
|
2254
2266
|
}, P = {
|
|
2255
2267
|
"opacity-50 cursor-not-allowed": w.disabled,
|
|
2256
2268
|
"cursor-pointer": !w.disabled
|
|
2257
|
-
},
|
|
2269
|
+
}, U = y ? {
|
|
2258
2270
|
"border-primary text-primary": s === "default" || s === "underline",
|
|
2259
2271
|
"bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": s === "pills"
|
|
2260
2272
|
} : {}, F = !y && !w.disabled ? {
|
|
@@ -2262,7 +2274,7 @@ const ft = ({
|
|
|
2262
2274
|
"text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": s === "pills",
|
|
2263
2275
|
"border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": s === "underline"
|
|
2264
2276
|
} : {};
|
|
2265
|
-
return p(A, N, q, P,
|
|
2277
|
+
return p(A, N, q, P, U, F);
|
|
2266
2278
|
};
|
|
2267
2279
|
return /* @__PURE__ */ e(wt.Provider, { value: l, children: /* @__PURE__ */ d("div", { children: [
|
|
2268
2280
|
/* @__PURE__ */ e("div", { className: h, role: "tablist", children: t.map((w) => /* @__PURE__ */ e(
|
|
@@ -2314,13 +2326,13 @@ function St({
|
|
|
2314
2326
|
showCloseButton: f = !0
|
|
2315
2327
|
}) {
|
|
2316
2328
|
const l = Z(null), m = Z(null);
|
|
2317
|
-
|
|
2329
|
+
G(() => {
|
|
2318
2330
|
if (!t || !o) return;
|
|
2319
2331
|
const k = (w) => {
|
|
2320
2332
|
w.key === "Escape" && a();
|
|
2321
2333
|
};
|
|
2322
2334
|
return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
|
|
2323
|
-
}, [t, o, a]),
|
|
2335
|
+
}, [t, o, a]), G(() => (t ? (m.current = document.activeElement, l.current && l.current.focus(), document.body.style.overflow = "hidden") : (m.current && m.current.focus(), document.body.style.overflow = ""), () => {
|
|
2324
2336
|
document.body.style.overflow = "";
|
|
2325
2337
|
}), [t]);
|
|
2326
2338
|
const h = (k) => {
|
|
@@ -2481,12 +2493,12 @@ const Et = ({
|
|
|
2481
2493
|
onDownloadFile: f,
|
|
2482
2494
|
onRegisterFile: l
|
|
2483
2495
|
}) => {
|
|
2484
|
-
const [m, h] = B(!1), [k, w] = B([]), [y, A] = B(null), [N, q] = B("/"), [P,
|
|
2496
|
+
const [m, h] = B(!1), [k, w] = B([]), [y, A] = B(null), [N, q] = B("/"), [P, U] = B([]), [F, z] = B(!1), [H, D] = B(""), [W, V] = B(
|
|
2485
2497
|
typeof t == "object" ? t : null
|
|
2486
2498
|
), [i, v] = B(!1), [E, S] = B(""), M = Z(null);
|
|
2487
|
-
|
|
2499
|
+
G(() => {
|
|
2488
2500
|
m && L();
|
|
2489
|
-
}, [m]),
|
|
2501
|
+
}, [m]), G(() => {
|
|
2490
2502
|
m && y && Q();
|
|
2491
2503
|
}, [m, y, N, H]);
|
|
2492
2504
|
const L = async () => {
|
|
@@ -2504,7 +2516,7 @@ const Et = ({
|
|
|
2504
2516
|
z(!0);
|
|
2505
2517
|
try {
|
|
2506
2518
|
const c = await x?.({ mountId: y.id, name: H, path: N });
|
|
2507
|
-
c?.data &&
|
|
2519
|
+
c?.data && U(c.data);
|
|
2508
2520
|
} catch (c) {
|
|
2509
2521
|
console.error("Failed to load files", c);
|
|
2510
2522
|
} finally {
|
|
@@ -2702,7 +2714,7 @@ const Et = ({
|
|
|
2702
2714
|
{
|
|
2703
2715
|
onClick: T,
|
|
2704
2716
|
className: "p-1 hover:bg-neutral-container rounded",
|
|
2705
|
-
children: /* @__PURE__ */ e(oe, { icon:
|
|
2717
|
+
children: /* @__PURE__ */ e(oe, { icon: Fe, size: "xs" })
|
|
2706
2718
|
}
|
|
2707
2719
|
)
|
|
2708
2720
|
]
|
|
@@ -2747,7 +2759,7 @@ const Et = ({
|
|
|
2747
2759
|
placeholder: "Search...",
|
|
2748
2760
|
value: H,
|
|
2749
2761
|
onChange: (c) => D(c.target.value),
|
|
2750
|
-
startIcon: /* @__PURE__ */ e(
|
|
2762
|
+
startIcon: /* @__PURE__ */ e(Te, { size: 14 }),
|
|
2751
2763
|
fullWidth: !0,
|
|
2752
2764
|
size: "sm"
|
|
2753
2765
|
}
|
|
@@ -2759,7 +2771,7 @@ const Et = ({
|
|
|
2759
2771
|
variant: "outline",
|
|
2760
2772
|
size: "sm",
|
|
2761
2773
|
onClick: () => v(!0),
|
|
2762
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2774
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: Ve, size: "xs" }),
|
|
2763
2775
|
children: "New Folder"
|
|
2764
2776
|
}
|
|
2765
2777
|
),
|
|
@@ -2769,7 +2781,7 @@ const Et = ({
|
|
|
2769
2781
|
variant: "primary",
|
|
2770
2782
|
size: "sm",
|
|
2771
2783
|
onClick: () => M.current?.click(),
|
|
2772
|
-
leftIcon: /* @__PURE__ */ e(oe, { icon:
|
|
2784
|
+
leftIcon: /* @__PURE__ */ e(oe, { icon: Re, size: "xs" }),
|
|
2773
2785
|
loading: F,
|
|
2774
2786
|
children: "Upload"
|
|
2775
2787
|
}
|
|
@@ -2875,7 +2887,7 @@ function Mt({
|
|
|
2875
2887
|
showTemplate: x = !0
|
|
2876
2888
|
}) {
|
|
2877
2889
|
const [b, g] = B([]);
|
|
2878
|
-
|
|
2890
|
+
G(() => {
|
|
2879
2891
|
let l = !0;
|
|
2880
2892
|
return Promise.resolve(r?.()).then((m) => {
|
|
2881
2893
|
l && m && g(m.data ?? []);
|
|
@@ -2952,8 +2964,8 @@ const cr = ({
|
|
|
2952
2964
|
ref: k,
|
|
2953
2965
|
sdk: w
|
|
2954
2966
|
}) => {
|
|
2955
|
-
const [y, A] = B(a || {}), [N, q] = B({}), [P,
|
|
2956
|
-
|
|
2967
|
+
const [y, A] = B(a || {}), [N, q] = B({}), [P, U] = B({});
|
|
2968
|
+
G(() => {
|
|
2957
2969
|
a && A({ ...a });
|
|
2958
2970
|
}, [a]);
|
|
2959
2971
|
const F = ae(
|
|
@@ -2996,7 +3008,7 @@ const cr = ({
|
|
|
2996
3008
|
i,
|
|
2997
3009
|
v
|
|
2998
3010
|
);
|
|
2999
|
-
t.flatMap((L) => L.items).find((L) => L.name === i)?.removeIfEmpty && (v == null || v === "") && (E = Tt(E, i)), A(E),
|
|
3011
|
+
t.flatMap((L) => L.items).find((L) => L.name === i)?.removeIfEmpty && (v == null || v === "") && (E = Tt(E, i)), A(E), U((L) => ({ ...L, [i]: !0 }));
|
|
3000
3012
|
const M = F(i, v, E);
|
|
3001
3013
|
q((L) => ({
|
|
3002
3014
|
...L,
|
|
@@ -3775,7 +3787,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3775
3787
|
}) => {
|
|
3776
3788
|
const [k, w] = B(!0), [y, A] = B(!1), [N, q] = B(t), P = (V) => {
|
|
3777
3789
|
w(!1), A(!1), l?.(V);
|
|
3778
|
-
},
|
|
3790
|
+
}, U = (V) => {
|
|
3779
3791
|
if (w(!1), A(!0), x && N !== x) {
|
|
3780
3792
|
q(x), A(!1), w(!0);
|
|
3781
3793
|
return;
|
|
@@ -3848,7 +3860,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3848
3860
|
alt: a,
|
|
3849
3861
|
className: z,
|
|
3850
3862
|
onLoad: P,
|
|
3851
|
-
onError:
|
|
3863
|
+
onError: U
|
|
3852
3864
|
}
|
|
3853
3865
|
),
|
|
3854
3866
|
k && o && /* @__PURE__ */ e("div", { className: H, children: b || D }),
|
|
@@ -3867,9 +3879,9 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3867
3879
|
onTitleChange: g
|
|
3868
3880
|
}) => {
|
|
3869
3881
|
const [f, l] = B(!1), [m, h] = B(t), k = Z(null);
|
|
3870
|
-
|
|
3882
|
+
G(() => {
|
|
3871
3883
|
h(t);
|
|
3872
|
-
}, [t]),
|
|
3884
|
+
}, [t]), G(() => {
|
|
3873
3885
|
f && k.current && (k.current.focus(), k.current.select());
|
|
3874
3886
|
}, [f]);
|
|
3875
3887
|
const w = () => {
|
|
@@ -3926,7 +3938,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3926
3938
|
}
|
|
3927
3939
|
),
|
|
3928
3940
|
b && /* @__PURE__ */ e(
|
|
3929
|
-
|
|
3941
|
+
He,
|
|
3930
3942
|
{
|
|
3931
3943
|
size: 15,
|
|
3932
3944
|
onClick: w,
|
|
@@ -3937,7 +3949,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3937
3949
|
] }) }),
|
|
3938
3950
|
r.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: r.map(
|
|
3939
3951
|
(N) => N.splitOptions && N.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
3940
|
-
|
|
3952
|
+
De,
|
|
3941
3953
|
{
|
|
3942
3954
|
label: N.label,
|
|
3943
3955
|
onClick: N.onClick,
|
|
@@ -3996,7 +4008,7 @@ const Ot = ({ name: t, src: a, size: r = "sm", className: n, title: s }) => {
|
|
|
3996
4008
|
s && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: s }),
|
|
3997
4009
|
t.length > 0 && /* @__PURE__ */ e("div", { className: p("flex flex-wrap gap-2", !s && "ml-auto"), children: t.map(
|
|
3998
4010
|
(o) => o.splitOptions && o.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
3999
|
-
|
|
4011
|
+
De,
|
|
4000
4012
|
{
|
|
4001
4013
|
label: o.label,
|
|
4002
4014
|
onClick: o.onClick,
|
|
@@ -4284,7 +4296,7 @@ const pr = ({
|
|
|
4284
4296
|
n
|
|
4285
4297
|
);
|
|
4286
4298
|
return /* @__PURE__ */ e("div", { className: g, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: t.map(b) }) });
|
|
4287
|
-
},
|
|
4299
|
+
}, ze = ({ item: t, isSelectedHandler: a, onClick: r, depth: n = 0 }) => {
|
|
4288
4300
|
const [s, o] = B(t.defaultCollapsed ?? !1), u = t.children && t.children.length > 0, x = u && n === 0, b = () => {
|
|
4289
4301
|
u && o(!s);
|
|
4290
4302
|
}, g = a ? a(t.path) : !1;
|
|
@@ -4307,12 +4319,12 @@ const pr = ({
|
|
|
4307
4319
|
t.icon && /* @__PURE__ */ e("span", { className: "mr-2 shrink-0", children: t.icon }),
|
|
4308
4320
|
/* @__PURE__ */ e("span", { className: "flex-1 min-w-0 truncate", children: t.label }),
|
|
4309
4321
|
t.count !== void 0 && t.count > 0 && /* @__PURE__ */ e("span", { className: "ml-2 mr-1.5", children: t.count }),
|
|
4310
|
-
u && /* @__PURE__ */ e("span", { className: `${s ? "collapsed" : ""}`, children: /* @__PURE__ */ e(
|
|
4322
|
+
u && /* @__PURE__ */ e("span", { className: `${s ? "collapsed" : ""}`, children: /* @__PURE__ */ e($e, { className: "w-4 h-4 text-muted" }) })
|
|
4311
4323
|
]
|
|
4312
4324
|
}
|
|
4313
4325
|
),
|
|
4314
4326
|
u && !s && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: t.children?.map((f, l) => /* @__PURE__ */ e(
|
|
4315
|
-
|
|
4327
|
+
ze,
|
|
4316
4328
|
{
|
|
4317
4329
|
item: f,
|
|
4318
4330
|
isSelectedHandler: a,
|
|
@@ -4337,7 +4349,7 @@ const pr = ({
|
|
|
4337
4349
|
o && /* @__PURE__ */ e("div", { className: "sidebar-menu-pre-items mb-4", children: o }),
|
|
4338
4350
|
/* @__PURE__ */ e("ul", { children: r.map(
|
|
4339
4351
|
(u, x) => !u.path && !u.label && !u.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, x) : /* @__PURE__ */ e(
|
|
4340
|
-
|
|
4352
|
+
ze,
|
|
4341
4353
|
{
|
|
4342
4354
|
item: u,
|
|
4343
4355
|
isSelectedHandler: n,
|
|
@@ -4513,9 +4525,9 @@ const gr = ({
|
|
|
4513
4525
|
const [u, x] = B(""), [b, g] = B(s || []), [f, l] = B(o || 0), m = Z(null), h = Z(null), w = (b.length ? t.find((y) => y.id === b[0])?.subCommands || [] : t).filter(
|
|
4514
4526
|
(y) => y.label.toLowerCase().includes(u.toLowerCase())
|
|
4515
4527
|
);
|
|
4516
|
-
return
|
|
4528
|
+
return G(() => {
|
|
4517
4529
|
a || (x(""), g(s || []), l(o || 0));
|
|
4518
|
-
}, [a]),
|
|
4530
|
+
}, [a]), G(() => {
|
|
4519
4531
|
const y = (A) => {
|
|
4520
4532
|
if (a) {
|
|
4521
4533
|
if (A.key === "Escape")
|
|
@@ -4535,12 +4547,12 @@ const gr = ({
|
|
|
4535
4547
|
}
|
|
4536
4548
|
};
|
|
4537
4549
|
return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
|
|
4538
|
-
}, [a, r, w, f, b]),
|
|
4550
|
+
}, [a, r, w, f, b]), G(() => {
|
|
4539
4551
|
const y = (A) => {
|
|
4540
4552
|
m.current && !m.current.contains(A.target) && r();
|
|
4541
4553
|
};
|
|
4542
4554
|
return a && document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
4543
|
-
}, [a, r]),
|
|
4555
|
+
}, [a, r]), G(() => {
|
|
4544
4556
|
if (!a) return;
|
|
4545
4557
|
h.current?.querySelector(`[data-index="${f}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4546
4558
|
}, [f, a]), a ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 flex items-center justify-center shadow-lvl-0", children: /* @__PURE__ */ d(
|
|
@@ -4550,7 +4562,7 @@ const gr = ({
|
|
|
4550
4562
|
ref: m,
|
|
4551
4563
|
children: [
|
|
4552
4564
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 px-3 flex-shrink-0", children: [
|
|
4553
|
-
/* @__PURE__ */ e(
|
|
4565
|
+
/* @__PURE__ */ e(Te, { className: "w-4 h-4 text-muted shrink-0" }),
|
|
4554
4566
|
/* @__PURE__ */ e(
|
|
4555
4567
|
"input",
|
|
4556
4568
|
{
|
|
@@ -4668,7 +4680,7 @@ const gr = ({
|
|
|
4668
4680
|
info: "border-info",
|
|
4669
4681
|
neutral: "border-neutral",
|
|
4670
4682
|
white: "border-white"
|
|
4671
|
-
},
|
|
4683
|
+
}, Ae = ce(
|
|
4672
4684
|
({
|
|
4673
4685
|
padding: t,
|
|
4674
4686
|
margin: a,
|
|
@@ -4699,8 +4711,8 @@ const gr = ({
|
|
|
4699
4711
|
}
|
|
4700
4712
|
)
|
|
4701
4713
|
);
|
|
4702
|
-
|
|
4703
|
-
const yr = ({ children: t, title: a, ...r }) => /* @__PURE__ */ d(
|
|
4714
|
+
Ae.displayName = "Box";
|
|
4715
|
+
const yr = ({ children: t, title: a, ...r }) => /* @__PURE__ */ d(Ae, { background: "module", radius: "xl", shadow: "sm", ...r, children: [
|
|
4704
4716
|
a && /* @__PURE__ */ e("span", { className: "text-base font-medium text-default mb-2", children: a }),
|
|
4705
4717
|
t
|
|
4706
4718
|
] });
|
|
@@ -4713,7 +4725,7 @@ function Nr({
|
|
|
4713
4725
|
className: o
|
|
4714
4726
|
}) {
|
|
4715
4727
|
const u = Z(null), [x, b] = B(!0), [g, f] = B(null), l = Z(null);
|
|
4716
|
-
return Z(null),
|
|
4728
|
+
return Z(null), G(() => {
|
|
4717
4729
|
let m = !0;
|
|
4718
4730
|
return (async () => {
|
|
4719
4731
|
b(!0);
|
|
@@ -4730,7 +4742,7 @@ function Nr({
|
|
|
4730
4742
|
})(), () => {
|
|
4731
4743
|
m = !1;
|
|
4732
4744
|
};
|
|
4733
|
-
}, [t, a]),
|
|
4745
|
+
}, [t, a]), G(() => {
|
|
4734
4746
|
if (x || !g || r === "react") return;
|
|
4735
4747
|
const m = u.current;
|
|
4736
4748
|
if (m) {
|
|
@@ -4745,7 +4757,7 @@ function Nr({
|
|
|
4745
4757
|
};
|
|
4746
4758
|
}
|
|
4747
4759
|
}
|
|
4748
|
-
}, [g, r, x]),
|
|
4760
|
+
}, [g, r, x]), G(() => {
|
|
4749
4761
|
r === "svelte" && l.current && l.current.$set?.(s);
|
|
4750
4762
|
}, [s, r]), /* @__PURE__ */ d("div", { ref: u, className: o, style: { display: "contents" }, children: [
|
|
4751
4763
|
x && n,
|
|
@@ -4784,7 +4796,7 @@ export {
|
|
|
4784
4796
|
Ot as Avatar,
|
|
4785
4797
|
ur as AvatarStack,
|
|
4786
4798
|
ir as Badge,
|
|
4787
|
-
|
|
4799
|
+
Ae as Box,
|
|
4788
4800
|
te as Button,
|
|
4789
4801
|
lr as ButtonGroup,
|
|
4790
4802
|
yr as Card,
|
|
@@ -4812,7 +4824,7 @@ export {
|
|
|
4812
4824
|
fe as Select,
|
|
4813
4825
|
xr as SidebarMenu,
|
|
4814
4826
|
dr as Spinner,
|
|
4815
|
-
|
|
4827
|
+
De as SplitButton,
|
|
4816
4828
|
Et as StorageInput,
|
|
4817
4829
|
or as TabBar,
|
|
4818
4830
|
Le as Table,
|