@opencxh/ui-kit 3.111.0 → 3.111.2
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 +136 -147
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx as qe } from "clsx";
|
|
2
2
|
import { jsxs as i, jsx as e, Fragment as fe } from "react/jsx-runtime";
|
|
3
3
|
import { VideoOff as We, User as Ke, MicOff as _e, Mic as Ge, X as ve, ChevronDown as be, ExternalLink as Je, Calendar as Ye, ChevronLeft as Pe, ChevronRight as ye, ChevronDownIcon as Xe, Loader2 as Ze, Search as Ne, Check as Me, ChevronUp as Qe, ChevronsLeft as et, ChevronsRight as tt, FileText as we, HardDrive as $e, ArrowLeft as ze, FolderPlus as rt, Upload as nt, Folder as De, Trash2 as st, Plus as at, Sparkles as lt, ImageOff as ot, Pencil as ct, ArrowUpRight as it } from "lucide-react";
|
|
4
|
-
import le, { useRef as se, useEffect as
|
|
4
|
+
import le, { useRef as se, useEffect as Y, forwardRef as de, useState as R, useLayoutEffect as dt, useMemo as me, useCallback as ce, createContext as ut, Component as mt } from "react";
|
|
5
5
|
function d(...t) {
|
|
6
6
|
return qe(t);
|
|
7
7
|
}
|
|
@@ -51,7 +51,7 @@ function Kr({
|
|
|
51
51
|
}
|
|
52
52
|
function _r({ attach: t, active: r = !0, mirrored: n = !1, className: s }) {
|
|
53
53
|
const a = se(null);
|
|
54
|
-
return
|
|
54
|
+
return Y(() => {
|
|
55
55
|
if (!r || !a.current) return;
|
|
56
56
|
const l = t(a.current);
|
|
57
57
|
return () => {
|
|
@@ -96,7 +96,7 @@ const ft = {
|
|
|
96
96
|
xl: "h-control-xl w-10",
|
|
97
97
|
"2xl": "h-control-2xl w-12",
|
|
98
98
|
full: "h-control-md w-8"
|
|
99
|
-
},
|
|
99
|
+
}, ee = de(
|
|
100
100
|
({
|
|
101
101
|
variant: t = "primary",
|
|
102
102
|
size: r = "md",
|
|
@@ -118,7 +118,7 @@ const ft = {
|
|
|
118
118
|
ref: x,
|
|
119
119
|
type: "button",
|
|
120
120
|
className: d(
|
|
121
|
-
"inline-flex shrink-0 items-center justify-center gap-2 font-semibold",
|
|
121
|
+
"inline-flex shrink-0 items-center justify-center gap-2 cursor-pointer font-semibold",
|
|
122
122
|
f === "circle" ? "rounded-full" : "rounded-md",
|
|
123
123
|
"transition-colors duration-fast ease-out",
|
|
124
124
|
"focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -150,7 +150,7 @@ const ft = {
|
|
|
150
150
|
);
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
|
-
|
|
153
|
+
ee.displayName = "Button";
|
|
154
154
|
const Gr = ({
|
|
155
155
|
children: t,
|
|
156
156
|
size: r = "md",
|
|
@@ -191,7 +191,7 @@ const Gr = ({
|
|
|
191
191
|
info: "text-info-fg",
|
|
192
192
|
neutral: "text-text-subtle",
|
|
193
193
|
current: "text-current"
|
|
194
|
-
},
|
|
194
|
+
}, J = ({
|
|
195
195
|
icon: t,
|
|
196
196
|
size: r = "md",
|
|
197
197
|
color: n = "current",
|
|
@@ -266,7 +266,7 @@ function Jr({
|
|
|
266
266
|
), y = /* @__PURE__ */ i(fe, { children: [
|
|
267
267
|
r,
|
|
268
268
|
t,
|
|
269
|
-
c && /* @__PURE__ */ e(
|
|
269
|
+
c && /* @__PURE__ */ e(J, { icon: be, size: "xs" })
|
|
270
270
|
] }), g = d(
|
|
271
271
|
"inline-flex items-center gap-1.5 pl-3",
|
|
272
272
|
v,
|
|
@@ -282,7 +282,7 @@ function Jr({
|
|
|
282
282
|
"aria-label": p,
|
|
283
283
|
onClick: f,
|
|
284
284
|
className: d("inline-flex h-full items-center pr-3 focus-visible:outline-none focus-visible:focus-ring", v),
|
|
285
|
-
children: /* @__PURE__ */ e(
|
|
285
|
+
children: /* @__PURE__ */ e(J, { icon: ve, size: "xs" })
|
|
286
286
|
}
|
|
287
287
|
)
|
|
288
288
|
] }) : /* @__PURE__ */ e("button", { type: "button", title: h, onClick: N, className: d(C, g), children: y });
|
|
@@ -400,7 +400,7 @@ const kt = ({
|
|
|
400
400
|
triggerLabel: l
|
|
401
401
|
}) => {
|
|
402
402
|
const [c, f] = R(!1), [p, N] = R({}), h = se(null), m = se(null);
|
|
403
|
-
|
|
403
|
+
Y(() => {
|
|
404
404
|
if (!c) return;
|
|
405
405
|
const C = (g) => {
|
|
406
406
|
h.current && !h.current.contains(g.target) && f(!1);
|
|
@@ -472,7 +472,7 @@ function je({
|
|
|
472
472
|
const h = c || f, m = l.length > 0;
|
|
473
473
|
return /* @__PURE__ */ i("div", { className: "inline-flex items-center gap-px", children: [
|
|
474
474
|
/* @__PURE__ */ e(
|
|
475
|
-
|
|
475
|
+
ee,
|
|
476
476
|
{
|
|
477
477
|
variant: n,
|
|
478
478
|
size: s,
|
|
@@ -623,7 +623,7 @@ function Ee(t, r, { gap: n = 6, matchWidth: s = !1, placement: a = "bottom-start
|
|
|
623
623
|
};
|
|
624
624
|
}, [t, r, n, s, a]), l;
|
|
625
625
|
}
|
|
626
|
-
const $t = () => /* @__PURE__ */ e(
|
|
626
|
+
const $t = () => /* @__PURE__ */ e(J, { icon: Ye, size: "md", color: "current" }), Dt = () => /* @__PURE__ */ e(J, { icon: Pe, size: "md", color: "current" }), Tt = () => /* @__PURE__ */ e(J, { icon: ye, size: "md", color: "current" }), Ce = de(({
|
|
627
627
|
value: t,
|
|
628
628
|
onChange: r,
|
|
629
629
|
placeholder: n = "Select date",
|
|
@@ -637,7 +637,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
637
637
|
withTime: h = !1
|
|
638
638
|
}, m) => {
|
|
639
639
|
const [x, v] = R(!1), [C, y] = R(() => t || /* @__PURE__ */ new Date()), g = se(null), A = Ee(x, g);
|
|
640
|
-
|
|
640
|
+
Y(() => {
|
|
641
641
|
const b = (u) => {
|
|
642
642
|
g.current && !g.current.contains(u.target) && v(!1);
|
|
643
643
|
};
|
|
@@ -676,7 +676,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
676
676
|
y(new Date(C.getFullYear(), C.getMonth() + 1, 1));
|
|
677
677
|
}, H = () => {
|
|
678
678
|
r?.(null), v(!1);
|
|
679
|
-
},
|
|
679
|
+
}, X = d(
|
|
680
680
|
"w-full border border-border rounded-md transition-colors duration-fast",
|
|
681
681
|
"bg-surface text-text",
|
|
682
682
|
"placeholder:text-text-muted",
|
|
@@ -716,7 +716,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
716
716
|
required: a,
|
|
717
717
|
readOnly: !0,
|
|
718
718
|
onClick: () => !s && v(!x),
|
|
719
|
-
className: d(
|
|
719
|
+
className: d(X, "pr-10 cursor-pointer")
|
|
720
720
|
}
|
|
721
721
|
),
|
|
722
722
|
/* @__PURE__ */ e(
|
|
@@ -835,7 +835,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
835
835
|
onCreateOption: g,
|
|
836
836
|
...A
|
|
837
837
|
}, $) => {
|
|
838
|
-
const _ = h || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [U, V] = le.useState(!1), [I, W] = le.useState(""), H = le.useRef(null),
|
|
838
|
+
const _ = h || `select-${Math.random().toString(36).substr(2, 9)}`, M = !!n, [U, V] = le.useState(!1), [I, W] = le.useState(""), H = le.useRef(null), X = le.useRef(null), Z = Ee(U, X, { matchWidth: !0 }), [Q, b] = le.useState(l);
|
|
839
839
|
le.useImperativeHandle($, () => H.current), le.useEffect(() => {
|
|
840
840
|
const S = (T) => {
|
|
841
841
|
H.current && !H.current.contains(T.target) && V(!1);
|
|
@@ -875,7 +875,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
875
875
|
(S) => Array.isArray(v) && v.includes(S.value)
|
|
876
876
|
) : [], ae = m && I ? Q.filter(
|
|
877
877
|
(S) => S.label.toLowerCase().includes(I.toLowerCase())
|
|
878
|
-
) : Q, ne = !!y && !!m && !!I.trim() && !u(Q, I),
|
|
878
|
+
) : Q, ne = !!y && !!m && !!I.trim() && !u(Q, I), te = (S) => {
|
|
879
879
|
const T = S.trim();
|
|
880
880
|
if (!T) return;
|
|
881
881
|
const L = g?.(T) ?? {
|
|
@@ -916,7 +916,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
916
916
|
/* @__PURE__ */ i(
|
|
917
917
|
"button",
|
|
918
918
|
{
|
|
919
|
-
ref:
|
|
919
|
+
ref: X,
|
|
920
920
|
type: "button",
|
|
921
921
|
id: _,
|
|
922
922
|
onClick: () => V(!U),
|
|
@@ -953,7 +953,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
953
953
|
value: I,
|
|
954
954
|
onChange: (S) => W(S.target.value),
|
|
955
955
|
onKeyDown: (S) => {
|
|
956
|
-
S.key === "Enter" && ne && (S.preventDefault(),
|
|
956
|
+
S.key === "Enter" && ne && (S.preventDefault(), te(I));
|
|
957
957
|
},
|
|
958
958
|
className: d(
|
|
959
959
|
"w-full px-3 py-2 text-sm rounded-md border",
|
|
@@ -968,7 +968,7 @@ const $t = () => /* @__PURE__ */ e(X, { icon: Ye, size: "md", color: "current" }
|
|
|
968
968
|
"cursor-pointer px-3 py-1.5 text-sm",
|
|
969
969
|
"text-info-fg hover:bg-surface-hover"
|
|
970
970
|
),
|
|
971
|
-
onClick: () =>
|
|
971
|
+
onClick: () => te(I),
|
|
972
972
|
children: [
|
|
973
973
|
"+: “",
|
|
974
974
|
I.trim(),
|
|
@@ -1124,7 +1124,7 @@ function It({
|
|
|
1124
1124
|
showTemplate: f = !0
|
|
1125
1125
|
}) {
|
|
1126
1126
|
const [p, N] = R([]);
|
|
1127
|
-
|
|
1127
|
+
Y(() => {
|
|
1128
1128
|
let m = !0;
|
|
1129
1129
|
return Promise.resolve(n?.()).then((x) => {
|
|
1130
1130
|
m && x && N(x.data ?? []);
|
|
@@ -1190,8 +1190,8 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1190
1190
|
onChange: A,
|
|
1191
1191
|
...$
|
|
1192
1192
|
}, _) => {
|
|
1193
|
-
const M = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, U = !!n, V = se(null), I = se(null), [W, H] = R(g || ""), [
|
|
1194
|
-
|
|
1193
|
+
const M = h || `searchfield-${Math.random().toString(36).substr(2, 9)}`, U = !!n, V = se(null), I = se(null), [W, H] = R(g || ""), [X, Z] = R(!1), [Q, b] = R(!1), [u, E] = R(!1);
|
|
1194
|
+
Y(() => {
|
|
1195
1195
|
g !== void 0 && H(g);
|
|
1196
1196
|
}, [g]);
|
|
1197
1197
|
const w = me(() => {
|
|
@@ -1201,7 +1201,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1201
1201
|
(T) => String(T.label).toLowerCase().includes(S)
|
|
1202
1202
|
);
|
|
1203
1203
|
}, [W, m, y, u]);
|
|
1204
|
-
|
|
1204
|
+
Y(() => {
|
|
1205
1205
|
if (!x || !W) {
|
|
1206
1206
|
b(!1);
|
|
1207
1207
|
return;
|
|
@@ -1219,7 +1219,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1219
1219
|
return () => {
|
|
1220
1220
|
clearTimeout(S), b(!1);
|
|
1221
1221
|
};
|
|
1222
|
-
}, [W, C, x]),
|
|
1222
|
+
}, [W, C, x]), Y(() => {
|
|
1223
1223
|
const S = (T) => {
|
|
1224
1224
|
V.current && !V.current.contains(T.target) && Z(!1);
|
|
1225
1225
|
};
|
|
@@ -1232,7 +1232,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1232
1232
|
H(S.label), Z(!1), E(!1), v && v(S.value);
|
|
1233
1233
|
}, ae = () => {
|
|
1234
1234
|
(m.length > 0 || x) && (Z(!0), E(!1));
|
|
1235
|
-
}, ne = c || Q,
|
|
1235
|
+
}, ne = c || Q, te = X && (w.length > 0 || ne), G = me(() => _ || I, [_]);
|
|
1236
1236
|
return /* @__PURE__ */ i(
|
|
1237
1237
|
"div",
|
|
1238
1238
|
{
|
|
@@ -1301,7 +1301,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1301
1301
|
className: ue(
|
|
1302
1302
|
"text-text-muted cursor-pointer transition-transform",
|
|
1303
1303
|
ke[s],
|
|
1304
|
-
|
|
1304
|
+
X ? "rotate-180" : "rotate-0"
|
|
1305
1305
|
),
|
|
1306
1306
|
onClick: () => {
|
|
1307
1307
|
Z((S) => (S || E(!1), !S));
|
|
@@ -1310,7 +1310,7 @@ const ue = (...t) => t.filter(Boolean).join(" "), Pt = (t) => /* @__PURE__ */ e(
|
|
|
1310
1310
|
)
|
|
1311
1311
|
) })
|
|
1312
1312
|
] }),
|
|
1313
|
-
|
|
1313
|
+
te && /* @__PURE__ */ e(
|
|
1314
1314
|
"ul",
|
|
1315
1315
|
{
|
|
1316
1316
|
className: "absolute z-10 mt-1 w-full bg-surface border border-border rounded-lg shadow-lg max-h-60 overflow-auto top-full",
|
|
@@ -1465,7 +1465,7 @@ const Vt = ({
|
|
|
1465
1465
|
const [N, h] = R(!1), [m, x] = R(null), [v, C] = R({ top: 0, left: 0 }), y = se(null), g = se(null), A = se(null), $ = se(null), _ = Ee(N, g, { placement: a }), M = se(null), U = () => Array.from(
|
|
1466
1466
|
$.current?.querySelectorAll("button[data-option-value]:not(:disabled)") ?? []
|
|
1467
1467
|
);
|
|
1468
|
-
|
|
1468
|
+
Y(() => {
|
|
1469
1469
|
N && U()[0]?.focus();
|
|
1470
1470
|
}, [N]);
|
|
1471
1471
|
const V = (u) => {
|
|
@@ -1476,21 +1476,21 @@ const Vt = ({
|
|
|
1476
1476
|
const P = w.indexOf(document.activeElement), k = u.key === "Home" ? 0 : u.key === "End" ? w.length - 1 : u.key === "ArrowDown" ? (P + 1) % w.length : (P - 1 + w.length) % w.length;
|
|
1477
1477
|
w[k]?.focus();
|
|
1478
1478
|
};
|
|
1479
|
-
|
|
1479
|
+
Y(() => {
|
|
1480
1480
|
const u = (E) => {
|
|
1481
1481
|
y.current && (!y.current.contains(E.target) || A.current && !A.current.contains(E.target)) && (h(!1), x(null), M.current && (clearTimeout(M.current), M.current = null));
|
|
1482
1482
|
};
|
|
1483
1483
|
return N && document.addEventListener("mousedown", u), () => {
|
|
1484
1484
|
document.removeEventListener("mousedown", u);
|
|
1485
1485
|
};
|
|
1486
|
-
}, [N]),
|
|
1486
|
+
}, [N]), Y(() => {
|
|
1487
1487
|
const u = (E) => {
|
|
1488
1488
|
E.key === "Escape" && (h(!1), x(null), g.current?.focus(), M.current && (clearTimeout(M.current), M.current = null));
|
|
1489
1489
|
};
|
|
1490
1490
|
return N && document.addEventListener("keydown", u), () => {
|
|
1491
1491
|
document.removeEventListener("keydown", u);
|
|
1492
1492
|
};
|
|
1493
|
-
}, [N]),
|
|
1493
|
+
}, [N]), Y(() => {
|
|
1494
1494
|
if (m && y.current) {
|
|
1495
1495
|
const u = y.current.querySelector(
|
|
1496
1496
|
`[data-option-value="${m}"]`
|
|
@@ -1503,7 +1503,7 @@ const Vt = ({
|
|
|
1503
1503
|
});
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
|
-
}, [m]),
|
|
1506
|
+
}, [m]), Y(() => () => {
|
|
1507
1507
|
M.current && clearTimeout(M.current);
|
|
1508
1508
|
}, []);
|
|
1509
1509
|
const I = (u) => {
|
|
@@ -1512,7 +1512,7 @@ const Vt = ({
|
|
|
1512
1512
|
u.stopPropagation(), !E.disabled && !E.divider && (!E.children || E.children.length === 0) && (s?.(E.value, w), h(!1), x(null));
|
|
1513
1513
|
}, H = (u) => {
|
|
1514
1514
|
M.current && (clearTimeout(M.current), M.current = null), u.children && u.children.length > 0 ? x(u.value) : x(null);
|
|
1515
|
-
},
|
|
1515
|
+
}, X = (u) => {
|
|
1516
1516
|
u.children && u.children.length > 0 ? M.current = setTimeout(() => {
|
|
1517
1517
|
x(null);
|
|
1518
1518
|
}, 150) : x(null);
|
|
@@ -1569,7 +1569,7 @@ const Vt = ({
|
|
|
1569
1569
|
"aria-haspopup": w ? "menu" : void 0,
|
|
1570
1570
|
onClick: (k) => W(k, u),
|
|
1571
1571
|
onMouseEnter: () => H(u),
|
|
1572
|
-
onMouseLeave: () =>
|
|
1572
|
+
onMouseLeave: () => X(u),
|
|
1573
1573
|
disabled: u.disabled,
|
|
1574
1574
|
className: d(
|
|
1575
1575
|
"flex w-full items-center justify-between rounded-md px-3 py-1.5 text-sm text-text transition-colors duration-fast ease-out hover:bg-surface-hover focus-visible:outline-none focus-visible:focus-ring",
|
|
@@ -1625,8 +1625,8 @@ const Vt = ({
|
|
|
1625
1625
|
return /* @__PURE__ */ i(
|
|
1626
1626
|
"button",
|
|
1627
1627
|
{
|
|
1628
|
-
onClick: (
|
|
1629
|
-
|
|
1628
|
+
onClick: (te) => Z(
|
|
1629
|
+
te,
|
|
1630
1630
|
k,
|
|
1631
1631
|
u.value
|
|
1632
1632
|
),
|
|
@@ -1670,7 +1670,7 @@ const Vt = ({
|
|
|
1670
1670
|
]
|
|
1671
1671
|
}
|
|
1672
1672
|
);
|
|
1673
|
-
}, Ht = () => /* @__PURE__ */ e(
|
|
1673
|
+
}, Ht = () => /* @__PURE__ */ e(J, { icon: Ne, size: "md", color: "current" }), Ut = ({ active: t }) => /* @__PURE__ */ e(J, { icon: Qe, size: "sm", className: t ? "text-text" : "text-text-subtle" }), qt = ({ active: t }) => /* @__PURE__ */ e(J, { icon: be, size: "sm", className: t ? "text-text" : "text-text-subtle" }), Wt = () => /* @__PURE__ */ e(J, { icon: Pe, size: "md", color: "current" }), Kt = () => /* @__PURE__ */ e(J, { icon: ye, size: "md", color: "current" }), _t = () => /* @__PURE__ */ e(J, { icon: et, size: "md", color: "current" }), Gt = () => /* @__PURE__ */ e(J, { icon: tt, size: "md", color: "current" }), Be = () => /* @__PURE__ */ e(J, { icon: be, size: "md", color: "current" }), Jt = (t) => {
|
|
1674
1674
|
const r = (s) => t.multiSelect && Array.isArray(t.value) ? t.value?.includes(s) : t.value === s, n = (s) => {
|
|
1675
1675
|
t.multiSelect && Array.isArray(t.value) ? t.onChange(t.value.filter((a) => a !== s)) : t.onChange(s);
|
|
1676
1676
|
};
|
|
@@ -1743,7 +1743,7 @@ const Vt = ({
|
|
|
1743
1743
|
const [U, V] = R(""), [I, W] = R({
|
|
1744
1744
|
column: null,
|
|
1745
1745
|
direction: null
|
|
1746
|
-
}), [H,
|
|
1746
|
+
}), [H, X] = R({
|
|
1747
1747
|
page: 0,
|
|
1748
1748
|
pageSize: p
|
|
1749
1749
|
}), Z = se(null), Q = me(() => {
|
|
@@ -1753,13 +1753,13 @@ const Vt = ({
|
|
|
1753
1753
|
(F) => F.searchable !== !1
|
|
1754
1754
|
), B = U.toLowerCase();
|
|
1755
1755
|
o = o.filter((F) => z.some((O) => {
|
|
1756
|
-
const
|
|
1757
|
-
return String(
|
|
1756
|
+
const re = typeof O.accessor == "function" ? O.accessor(F) : F[O.accessor];
|
|
1757
|
+
return String(re || "").toLowerCase().includes(B);
|
|
1758
1758
|
}));
|
|
1759
1759
|
}
|
|
1760
1760
|
return l.forEach((z) => {
|
|
1761
1761
|
z.value && z.value !== "all" && (o = o.filter((B) => {
|
|
1762
|
-
const F = r.find((
|
|
1762
|
+
const F = r.find((re) => re.id === z.id);
|
|
1763
1763
|
if (!F) return !0;
|
|
1764
1764
|
const O = typeof F.accessor == "function" ? F.accessor(B) : B[F.accessor];
|
|
1765
1765
|
return String(O || "") === z.value;
|
|
@@ -1770,8 +1770,8 @@ const Vt = ({
|
|
|
1770
1770
|
const o = r.find((z) => z.id === I.column);
|
|
1771
1771
|
return o ? [...Q].sort((z, B) => {
|
|
1772
1772
|
const F = typeof o.accessor == "function" ? o.accessor(z) : z[o.accessor], O = typeof o.accessor == "function" ? o.accessor(B) : B[o.accessor];
|
|
1773
|
-
let
|
|
1774
|
-
return F < O ?
|
|
1773
|
+
let re = 0;
|
|
1774
|
+
return F < O ? re = -1 : F > O && (re = 1), I.direction === "desc" ? -re : re;
|
|
1775
1775
|
}) : Q;
|
|
1776
1776
|
}, [Q, I, r]), u = me(() => {
|
|
1777
1777
|
if (!c) return b;
|
|
@@ -1783,9 +1783,9 @@ const Vt = ({
|
|
|
1783
1783
|
},
|
|
1784
1784
|
[r]
|
|
1785
1785
|
), w = ce((o) => {
|
|
1786
|
-
|
|
1786
|
+
X((z) => ({ ...z, page: o }));
|
|
1787
1787
|
}, []), P = ce((o) => {
|
|
1788
|
-
|
|
1788
|
+
X({ page: 0, pageSize: o });
|
|
1789
1789
|
}, []), k = ce(
|
|
1790
1790
|
(o, z) => {
|
|
1791
1791
|
if (!v) return;
|
|
@@ -1801,12 +1801,12 @@ const Vt = ({
|
|
|
1801
1801
|
},
|
|
1802
1802
|
[u, v]
|
|
1803
1803
|
);
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
}, [U, I]),
|
|
1807
|
-
|
|
1804
|
+
Y(() => {
|
|
1805
|
+
X((o) => ({ ...o, page: 0 }));
|
|
1806
|
+
}, [U, I]), Y(() => {
|
|
1807
|
+
X((o) => ({ ...o, page: 0 }));
|
|
1808
1808
|
}, [l.map((o) => o.value).join(",")]);
|
|
1809
|
-
const ne = b.length,
|
|
1809
|
+
const ne = b.length, te = Math.ceil(ne / H.pageSize), G = H.page * H.pageSize + 1, S = Math.min(G + H.pageSize - 1, ne), T = u.length > 0 && u.every((o) => {
|
|
1810
1810
|
const z = C(o, 0);
|
|
1811
1811
|
return x.some(
|
|
1812
1812
|
(B, F) => C(B, F) === z
|
|
@@ -1923,7 +1923,7 @@ const Vt = ({
|
|
|
1923
1923
|
}
|
|
1924
1924
|
) }) : u.map((o, z) => {
|
|
1925
1925
|
const B = C(o, z), F = x.some(
|
|
1926
|
-
(O,
|
|
1926
|
+
(O, re) => C(O, re) === B
|
|
1927
1927
|
);
|
|
1928
1928
|
return /* @__PURE__ */ i(
|
|
1929
1929
|
"tr",
|
|
@@ -1949,7 +1949,7 @@ const Vt = ({
|
|
|
1949
1949
|
}
|
|
1950
1950
|
) }),
|
|
1951
1951
|
r.map((O) => {
|
|
1952
|
-
const
|
|
1952
|
+
const re = typeof O.accessor == "function" ? O.accessor(o) : o[O.accessor];
|
|
1953
1953
|
return /* @__PURE__ */ e(
|
|
1954
1954
|
"td",
|
|
1955
1955
|
{
|
|
@@ -1960,7 +1960,7 @@ const Vt = ({
|
|
|
1960
1960
|
"sticky left-0 bg-surface": O.sticky === "left",
|
|
1961
1961
|
"sticky right-0 bg-surface": O.sticky === "right"
|
|
1962
1962
|
}),
|
|
1963
|
-
children: O.cell ? O.cell(
|
|
1963
|
+
children: O.cell ? O.cell(re, o, z) : String(re || "")
|
|
1964
1964
|
},
|
|
1965
1965
|
O.id
|
|
1966
1966
|
);
|
|
@@ -1979,10 +1979,10 @@ const Vt = ({
|
|
|
1979
1979
|
disabled: O.disabled?.(o)
|
|
1980
1980
|
})),
|
|
1981
1981
|
onSelect: (O) => {
|
|
1982
|
-
const
|
|
1982
|
+
const re = N.find(
|
|
1983
1983
|
(ie) => ie.id === O
|
|
1984
1984
|
);
|
|
1985
|
-
|
|
1985
|
+
re && re.onClick(o, z);
|
|
1986
1986
|
},
|
|
1987
1987
|
placement: "bottom-end"
|
|
1988
1988
|
}
|
|
@@ -2020,7 +2020,7 @@ const Vt = ({
|
|
|
2020
2020
|
] }),
|
|
2021
2021
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
2022
2022
|
/* @__PURE__ */ e(
|
|
2023
|
-
|
|
2023
|
+
ee,
|
|
2024
2024
|
{
|
|
2025
2025
|
size: "sm",
|
|
2026
2026
|
variant: "ghost",
|
|
@@ -2031,7 +2031,7 @@ const Vt = ({
|
|
|
2031
2031
|
}
|
|
2032
2032
|
),
|
|
2033
2033
|
/* @__PURE__ */ e(
|
|
2034
|
-
|
|
2034
|
+
ee,
|
|
2035
2035
|
{
|
|
2036
2036
|
size: "sm",
|
|
2037
2037
|
variant: "ghost",
|
|
@@ -2045,26 +2045,26 @@ const Vt = ({
|
|
|
2045
2045
|
"Page ",
|
|
2046
2046
|
H.page + 1,
|
|
2047
2047
|
" of ",
|
|
2048
|
-
|
|
2048
|
+
te
|
|
2049
2049
|
] }),
|
|
2050
2050
|
/* @__PURE__ */ e(
|
|
2051
|
-
|
|
2051
|
+
ee,
|
|
2052
2052
|
{
|
|
2053
2053
|
size: "sm",
|
|
2054
2054
|
variant: "ghost",
|
|
2055
2055
|
onClick: () => w(H.page + 1),
|
|
2056
|
-
disabled: H.page >=
|
|
2056
|
+
disabled: H.page >= te - 1,
|
|
2057
2057
|
iconOnly: !0,
|
|
2058
2058
|
children: /* @__PURE__ */ e(Kt, {})
|
|
2059
2059
|
}
|
|
2060
2060
|
),
|
|
2061
2061
|
/* @__PURE__ */ e(
|
|
2062
|
-
|
|
2062
|
+
ee,
|
|
2063
2063
|
{
|
|
2064
2064
|
size: "sm",
|
|
2065
2065
|
variant: "ghost",
|
|
2066
|
-
onClick: () => w(
|
|
2067
|
-
disabled: H.page >=
|
|
2066
|
+
onClick: () => w(te - 1),
|
|
2067
|
+
disabled: H.page >= te - 1,
|
|
2068
2068
|
iconOnly: !0,
|
|
2069
2069
|
children: /* @__PURE__ */ e(Gt, {})
|
|
2070
2070
|
}
|
|
@@ -2204,13 +2204,13 @@ function Fe({
|
|
|
2204
2204
|
showCloseButton: h = !0
|
|
2205
2205
|
}) {
|
|
2206
2206
|
const m = se(null), x = se(null);
|
|
2207
|
-
|
|
2207
|
+
Y(() => {
|
|
2208
2208
|
if (!t || !l) return;
|
|
2209
2209
|
const C = (y) => {
|
|
2210
2210
|
y.key === "Escape" && r();
|
|
2211
2211
|
};
|
|
2212
2212
|
return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
|
|
2213
|
-
}, [t, l, r]),
|
|
2213
|
+
}, [t, l, r]), Y(() => (t ? (x.current = document.activeElement, m.current && m.current.focus(), document.body.style.overflow = "hidden") : (x.current && x.current.focus(), document.body.style.overflow = ""), () => {
|
|
2214
2214
|
document.body.style.overflow = "";
|
|
2215
2215
|
}), [t]);
|
|
2216
2216
|
const v = (C) => {
|
|
@@ -2257,7 +2257,7 @@ function Fe({
|
|
|
2257
2257
|
onClick: r,
|
|
2258
2258
|
className: "p-1 text-text-muted hover:text-text transition-colors",
|
|
2259
2259
|
"aria-label": "Close modal",
|
|
2260
|
-
children: /* @__PURE__ */ e(
|
|
2260
|
+
children: /* @__PURE__ */ e(J, { icon: ve, size: "lg", color: "current" })
|
|
2261
2261
|
}
|
|
2262
2262
|
)
|
|
2263
2263
|
] }),
|
|
@@ -2359,12 +2359,12 @@ const ar = ({
|
|
|
2359
2359
|
onDownloadFile: h,
|
|
2360
2360
|
onRegisterFile: m
|
|
2361
2361
|
}) => {
|
|
2362
|
-
const [x, v] = R(!1), [C, y] = R([]), [g, A] = R(null), [$, _] = R("/"), [M, U] = R([]), [V, I] = R(!1), [W, H] = R(""), [
|
|
2362
|
+
const [x, v] = R(!1), [C, y] = R([]), [g, A] = R(null), [$, _] = R("/"), [M, U] = R([]), [V, I] = R(!1), [W, H] = R(""), [X, Z] = R(
|
|
2363
2363
|
typeof t == "object" ? t : null
|
|
2364
2364
|
), [Q, b] = R(!1), [u, E] = R(""), w = se(null);
|
|
2365
|
-
|
|
2365
|
+
Y(() => {
|
|
2366
2366
|
x && P();
|
|
2367
|
-
}, [x]),
|
|
2367
|
+
}, [x]), Y(() => {
|
|
2368
2368
|
x && g && k();
|
|
2369
2369
|
}, [x, g, $, W]);
|
|
2370
2370
|
const P = async () => {
|
|
@@ -2434,7 +2434,7 @@ const ar = ({
|
|
|
2434
2434
|
I(!1);
|
|
2435
2435
|
}
|
|
2436
2436
|
}
|
|
2437
|
-
},
|
|
2437
|
+
}, te = async () => {
|
|
2438
2438
|
if (!(!u || !g)) {
|
|
2439
2439
|
I(!0);
|
|
2440
2440
|
try {
|
|
@@ -2474,8 +2474,8 @@ const ar = ({
|
|
|
2474
2474
|
B.path === $ && o.add(B.name);
|
|
2475
2475
|
return;
|
|
2476
2476
|
}
|
|
2477
|
-
const F = B.providerKey || B.name,
|
|
2478
|
-
|
|
2477
|
+
const F = B.providerKey || B.name, re = ($ ? F.substring($.length) : F).split("/").filter((ie) => ie !== "");
|
|
2478
|
+
re.length > 1 ? o.add(re[0]) : re.length === 1 && z.push(B);
|
|
2479
2479
|
}), {
|
|
2480
2480
|
folders: Array.from(o).sort(),
|
|
2481
2481
|
files: z.sort((B, F) => B.name.localeCompare(F.name))
|
|
@@ -2504,7 +2504,7 @@ const ar = ({
|
|
|
2504
2504
|
accessor: "name",
|
|
2505
2505
|
cell: (o, z) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
2506
2506
|
/* @__PURE__ */ e(
|
|
2507
|
-
|
|
2507
|
+
J,
|
|
2508
2508
|
{
|
|
2509
2509
|
icon: z.type === "folder" ? De : we,
|
|
2510
2510
|
size: "sm",
|
|
@@ -2530,14 +2530,14 @@ const ar = ({
|
|
|
2530
2530
|
accessor: "id",
|
|
2531
2531
|
align: "right",
|
|
2532
2532
|
cell: (o, z) => /* @__PURE__ */ e(
|
|
2533
|
-
|
|
2533
|
+
ee,
|
|
2534
2534
|
{
|
|
2535
2535
|
size: "sm",
|
|
2536
2536
|
variant: "outline",
|
|
2537
2537
|
onClick: (B) => {
|
|
2538
2538
|
B.stopPropagation(), z.type === "folder" ? L(z.name) : G(z);
|
|
2539
2539
|
},
|
|
2540
|
-
loading: V && z.type === "file" &&
|
|
2540
|
+
loading: V && z.type === "file" && X?.id === z.id,
|
|
2541
2541
|
children: z.type === "folder" ? "Open" : "Select"
|
|
2542
2542
|
}
|
|
2543
2543
|
)
|
|
@@ -2548,7 +2548,7 @@ const ar = ({
|
|
|
2548
2548
|
header: "Mount Name",
|
|
2549
2549
|
accessor: "name",
|
|
2550
2550
|
cell: (o) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2 font-medium", children: [
|
|
2551
|
-
/* @__PURE__ */ e(
|
|
2551
|
+
/* @__PURE__ */ e(J, { icon: $e, size: "sm", color: "primary" }),
|
|
2552
2552
|
/* @__PURE__ */ e("span", { children: o })
|
|
2553
2553
|
] })
|
|
2554
2554
|
},
|
|
@@ -2557,7 +2557,7 @@ const ar = ({
|
|
|
2557
2557
|
header: "",
|
|
2558
2558
|
accessor: "id",
|
|
2559
2559
|
align: "right",
|
|
2560
|
-
cell: (o, z) => /* @__PURE__ */ e(
|
|
2560
|
+
cell: (o, z) => /* @__PURE__ */ e(ee, { size: "sm", variant: "outline", onClick: () => A(z), children: "Open" })
|
|
2561
2561
|
}
|
|
2562
2562
|
];
|
|
2563
2563
|
return /* @__PURE__ */ i("div", { className: "space-y-1", children: [
|
|
@@ -2573,14 +2573,14 @@ const ar = ({
|
|
|
2573
2573
|
l && "opacity-50 cursor-not-allowed bg-surface-sunk"
|
|
2574
2574
|
),
|
|
2575
2575
|
children: [
|
|
2576
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(
|
|
2577
|
-
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children:
|
|
2578
|
-
|
|
2576
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(J, { icon: X ? we : $e, color: X ? "primary" : "secondary" }) }),
|
|
2577
|
+
/* @__PURE__ */ e("div", { className: "flex-grow truncate", children: X ? /* @__PURE__ */ e("span", { className: "text-sm text-text font-medium", children: X.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-text-muted", children: s }) }),
|
|
2578
|
+
X && !l && /* @__PURE__ */ e(
|
|
2579
2579
|
"button",
|
|
2580
2580
|
{
|
|
2581
2581
|
onClick: S,
|
|
2582
2582
|
className: "p-1 hover:bg-surface-hover rounded",
|
|
2583
|
-
children: /* @__PURE__ */ e(
|
|
2583
|
+
children: /* @__PURE__ */ e(J, { icon: ve, size: "xs" })
|
|
2584
2584
|
}
|
|
2585
2585
|
)
|
|
2586
2586
|
]
|
|
@@ -2607,14 +2607,14 @@ const ar = ({
|
|
|
2607
2607
|
content: /* @__PURE__ */ e("div", { className: "space-y-4", children: g ? /* @__PURE__ */ i(fe, { children: [
|
|
2608
2608
|
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2609
2609
|
/* @__PURE__ */ e(
|
|
2610
|
-
|
|
2610
|
+
ee,
|
|
2611
2611
|
{
|
|
2612
2612
|
variant: "ghost",
|
|
2613
2613
|
size: "sm",
|
|
2614
2614
|
onClick: () => {
|
|
2615
2615
|
$ && $ !== "/" ? D() : A(null);
|
|
2616
2616
|
},
|
|
2617
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2617
|
+
leftIcon: /* @__PURE__ */ e(J, { icon: ze, size: "xs" }),
|
|
2618
2618
|
children: $ ? "Back" : "Back to Mounts"
|
|
2619
2619
|
}
|
|
2620
2620
|
),
|
|
@@ -2632,22 +2632,22 @@ const ar = ({
|
|
|
2632
2632
|
) }),
|
|
2633
2633
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
2634
2634
|
/* @__PURE__ */ e(
|
|
2635
|
-
|
|
2635
|
+
ee,
|
|
2636
2636
|
{
|
|
2637
2637
|
variant: "outline",
|
|
2638
2638
|
size: "sm",
|
|
2639
2639
|
onClick: () => b(!0),
|
|
2640
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2640
|
+
leftIcon: /* @__PURE__ */ e(J, { icon: rt, size: "xs" }),
|
|
2641
2641
|
children: "New Folder"
|
|
2642
2642
|
}
|
|
2643
2643
|
),
|
|
2644
2644
|
/* @__PURE__ */ e(
|
|
2645
|
-
|
|
2645
|
+
ee,
|
|
2646
2646
|
{
|
|
2647
2647
|
variant: "primary",
|
|
2648
2648
|
size: "sm",
|
|
2649
2649
|
onClick: () => w.current?.click(),
|
|
2650
|
-
leftIcon: /* @__PURE__ */ e(
|
|
2650
|
+
leftIcon: /* @__PURE__ */ e(J, { icon: nt, size: "xs" }),
|
|
2651
2651
|
loading: V,
|
|
2652
2652
|
children: "Upload"
|
|
2653
2653
|
}
|
|
@@ -2665,7 +2665,7 @@ const ar = ({
|
|
|
2665
2665
|
] })
|
|
2666
2666
|
] }),
|
|
2667
2667
|
Q && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 p-3 bg-surface-sunk rounded-lg border border-border", children: [
|
|
2668
|
-
/* @__PURE__ */ e(
|
|
2668
|
+
/* @__PURE__ */ e(J, { icon: De, size: "sm", color: "warning" }),
|
|
2669
2669
|
/* @__PURE__ */ e(
|
|
2670
2670
|
he,
|
|
2671
2671
|
{
|
|
@@ -2676,8 +2676,8 @@ const ar = ({
|
|
|
2676
2676
|
autoFocus: !0
|
|
2677
2677
|
}
|
|
2678
2678
|
),
|
|
2679
|
-
/* @__PURE__ */ e(
|
|
2680
|
-
/* @__PURE__ */ e(
|
|
2679
|
+
/* @__PURE__ */ e(ee, { size: "sm", onClick: te, loading: V, children: "Create" }),
|
|
2680
|
+
/* @__PURE__ */ e(ee, { size: "sm", variant: "ghost", onClick: () => b(!1), children: "Cancel" })
|
|
2681
2681
|
] }),
|
|
2682
2682
|
/* @__PURE__ */ e("div", { className: "max-h-100 overflow-auto rounded-lg border border-border", children: /* @__PURE__ */ e(
|
|
2683
2683
|
Te,
|
|
@@ -2704,7 +2704,7 @@ const ar = ({
|
|
|
2704
2704
|
id: "local",
|
|
2705
2705
|
label: "Local File",
|
|
2706
2706
|
content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-border rounded-xl bg-surface-sunk/50", children: [
|
|
2707
|
-
/* @__PURE__ */ e("div", { className: "p-4 bg-accent-soft rounded-full mb-4", children: /* @__PURE__ */ e(
|
|
2707
|
+
/* @__PURE__ */ e("div", { className: "p-4 bg-accent-soft rounded-full mb-4", children: /* @__PURE__ */ e(J, { icon: we, size: "xl", color: "primary" }) }),
|
|
2708
2708
|
/* @__PURE__ */ e(oe, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
|
|
2709
2709
|
/* @__PURE__ */ i(oe, { variant: "body", size: "sm", className: "text-text-muted mt-1 mb-6 text-center max-w-xs", children: [
|
|
2710
2710
|
"This file will be used directly in the form and will ",
|
|
@@ -2712,7 +2712,7 @@ const ar = ({
|
|
|
2712
2712
|
" be uploaded to platform storage."
|
|
2713
2713
|
] }),
|
|
2714
2714
|
/* @__PURE__ */ i("label", { className: "cursor-pointer", children: [
|
|
2715
|
-
/* @__PURE__ */ e(
|
|
2715
|
+
/* @__PURE__ */ e(ee, { variant: "primary", size: "lg", loading: V, className: "pointer-events-none", children: "Browse Local File" }),
|
|
2716
2716
|
/* @__PURE__ */ e(
|
|
2717
2717
|
"input",
|
|
2718
2718
|
{
|
|
@@ -2852,7 +2852,7 @@ const Qr = ({
|
|
|
2852
2852
|
sdk: y
|
|
2853
2853
|
}) => {
|
|
2854
2854
|
const [g, A] = R(r || {}), [$, _] = R({}), [M, U] = R({});
|
|
2855
|
-
|
|
2855
|
+
Y(() => {
|
|
2856
2856
|
r && A({ ...r });
|
|
2857
2857
|
}, [r]);
|
|
2858
2858
|
const V = ce(
|
|
@@ -2870,17 +2870,17 @@ const Qr = ({
|
|
|
2870
2870
|
const P = [];
|
|
2871
2871
|
let k = !1;
|
|
2872
2872
|
if (u.forEach((ae, ne) => {
|
|
2873
|
-
const
|
|
2873
|
+
const te = {};
|
|
2874
2874
|
for (const G of w.arrayFields) {
|
|
2875
2875
|
const S = ae?.[G.name];
|
|
2876
2876
|
if (G.required && (S == null || S === ""))
|
|
2877
|
-
|
|
2877
|
+
te[G.name] = `${G.label} is required`, k = !0;
|
|
2878
2878
|
else if (G.validator) {
|
|
2879
2879
|
const T = G.validator(S, ae);
|
|
2880
|
-
T && (
|
|
2880
|
+
T && (te[G.name] = T, k = !0);
|
|
2881
2881
|
}
|
|
2882
2882
|
}
|
|
2883
|
-
P[ne] =
|
|
2883
|
+
P[ne] = te;
|
|
2884
2884
|
}), k)
|
|
2885
2885
|
return JSON.stringify(P);
|
|
2886
2886
|
}
|
|
@@ -3090,7 +3090,7 @@ const Qr = ({
|
|
|
3090
3090
|
}
|
|
3091
3091
|
const ne = () => {
|
|
3092
3092
|
I(b.name, [...k, {}]);
|
|
3093
|
-
},
|
|
3093
|
+
}, te = (S) => {
|
|
3094
3094
|
I(
|
|
3095
3095
|
b.name,
|
|
3096
3096
|
k.filter((T, L) => L !== S)
|
|
@@ -3267,14 +3267,14 @@ const Qr = ({
|
|
|
3267
3267
|
);
|
|
3268
3268
|
}) }),
|
|
3269
3269
|
/* @__PURE__ */ e(
|
|
3270
|
-
|
|
3270
|
+
ee,
|
|
3271
3271
|
{
|
|
3272
3272
|
type: "button",
|
|
3273
3273
|
iconOnly: !0,
|
|
3274
3274
|
variant: "ghost",
|
|
3275
3275
|
size: "md",
|
|
3276
3276
|
"aria-label": `${b.label} verwijderen`,
|
|
3277
|
-
onClick: () =>
|
|
3277
|
+
onClick: () => te(T),
|
|
3278
3278
|
disabled: w,
|
|
3279
3279
|
className: d("shrink-0", T === 0 && "mt-5"),
|
|
3280
3280
|
children: /* @__PURE__ */ e(st, { className: "size-icon-md" })
|
|
@@ -3282,7 +3282,7 @@ const Qr = ({
|
|
|
3282
3282
|
)
|
|
3283
3283
|
] }, T)),
|
|
3284
3284
|
/* @__PURE__ */ i(
|
|
3285
|
-
|
|
3285
|
+
ee,
|
|
3286
3286
|
{
|
|
3287
3287
|
type: "button",
|
|
3288
3288
|
variant: "secondary",
|
|
@@ -3303,7 +3303,7 @@ const Qr = ({
|
|
|
3303
3303
|
}
|
|
3304
3304
|
},
|
|
3305
3305
|
[g, M, $, x, m, I]
|
|
3306
|
-
),
|
|
3306
|
+
), X = ce(
|
|
3307
3307
|
(b) => {
|
|
3308
3308
|
if (b.conditional && !b.conditional(g))
|
|
3309
3309
|
return null;
|
|
@@ -3366,11 +3366,11 @@ const Qr = ({
|
|
|
3366
3366
|
v
|
|
3367
3367
|
), Q = m === "full" ? "md" : m;
|
|
3368
3368
|
return /* @__PURE__ */ i("form", { ref: C, onSubmit: W, className: Z, children: [
|
|
3369
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(
|
|
3369
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col", children: t.map(X) }),
|
|
3370
3370
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 border-t border-border-subtle bg-surface-sunk px-5 py-3", children: N && /* @__PURE__ */ i(fe, { children: [
|
|
3371
3371
|
/* @__PURE__ */ e("div", { className: "ml-auto" }),
|
|
3372
3372
|
s && /* @__PURE__ */ e(
|
|
3373
|
-
|
|
3373
|
+
ee,
|
|
3374
3374
|
{
|
|
3375
3375
|
type: "button",
|
|
3376
3376
|
variant: p.variant ?? "ghost",
|
|
@@ -3382,7 +3382,7 @@ const Qr = ({
|
|
|
3382
3382
|
}
|
|
3383
3383
|
),
|
|
3384
3384
|
/* @__PURE__ */ e(
|
|
3385
|
-
|
|
3385
|
+
ee,
|
|
3386
3386
|
{
|
|
3387
3387
|
type: "submit",
|
|
3388
3388
|
variant: f.variant,
|
|
@@ -3415,9 +3415,9 @@ function en({
|
|
|
3415
3415
|
title: r,
|
|
3416
3416
|
size: "sm",
|
|
3417
3417
|
footer: /* @__PURE__ */ i("div", { className: "flex w-full items-center justify-end gap-2", children: [
|
|
3418
|
-
/* @__PURE__ */ e(
|
|
3418
|
+
/* @__PURE__ */ e(ee, { variant: "ghost", onClick: p, disabled: c, children: a }),
|
|
3419
3419
|
/* @__PURE__ */ e(
|
|
3420
|
-
|
|
3420
|
+
ee,
|
|
3421
3421
|
{
|
|
3422
3422
|
variant: l === "danger" ? "destructive" : "primary",
|
|
3423
3423
|
onClick: f,
|
|
@@ -3493,7 +3493,7 @@ function tn({
|
|
|
3493
3493
|
onClick: l,
|
|
3494
3494
|
className: "ml-1.5 flex-shrink-0 hover:opacity-70 transition-opacity",
|
|
3495
3495
|
"aria-label": "Remove badge",
|
|
3496
|
-
children: /* @__PURE__ */ e(
|
|
3496
|
+
children: /* @__PURE__ */ e(J, { icon: ve, size: "xs", color: "current" })
|
|
3497
3497
|
}
|
|
3498
3498
|
)
|
|
3499
3499
|
]
|
|
@@ -3903,8 +3903,8 @@ const mn = ({
|
|
|
3903
3903
|
), W = d(
|
|
3904
3904
|
"absolute inset-0 flex items-center justify-center",
|
|
3905
3905
|
"text-text-muted"
|
|
3906
|
-
), H = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }),
|
|
3907
|
-
/* @__PURE__ */ e(
|
|
3906
|
+
), H = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-surface-hover rounded" }) }), X = /* @__PURE__ */ i("div", { className: "text-center", children: [
|
|
3907
|
+
/* @__PURE__ */ e(J, { icon: ot, size: "lg", className: "mx-auto mb-1" }),
|
|
3908
3908
|
/* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
|
|
3909
3909
|
] });
|
|
3910
3910
|
return /* @__PURE__ */ i("div", { className: V, children: [
|
|
@@ -3920,7 +3920,7 @@ const mn = ({
|
|
|
3920
3920
|
}
|
|
3921
3921
|
),
|
|
3922
3922
|
C && l && /* @__PURE__ */ e("div", { className: W, children: p || H }),
|
|
3923
|
-
g && c && /* @__PURE__ */ e("div", { className: W, children: N ||
|
|
3923
|
+
g && c && /* @__PURE__ */ e("div", { className: W, children: N || X })
|
|
3924
3924
|
] });
|
|
3925
3925
|
};
|
|
3926
3926
|
function fn({
|
|
@@ -3950,7 +3950,7 @@ function fn({
|
|
|
3950
3950
|
bordered: I = !1,
|
|
3951
3951
|
emptyContent: W,
|
|
3952
3952
|
loading: H = !1,
|
|
3953
|
-
loadingRows:
|
|
3953
|
+
loadingRows: X = 4,
|
|
3954
3954
|
className: Z,
|
|
3955
3955
|
"aria-label": Q
|
|
3956
3956
|
}) {
|
|
@@ -3971,13 +3971,13 @@ function fn({
|
|
|
3971
3971
|
_ && _(
|
|
3972
3972
|
q ? [...$, D] : $.filter((j) => j !== D)
|
|
3973
3973
|
);
|
|
3974
|
-
}, ne = (D) => _?.(D ? [...t] : []),
|
|
3974
|
+
}, ne = (D) => _?.(D ? [...t] : []), te = d(
|
|
3975
3975
|
"flex flex-col",
|
|
3976
3976
|
I && "overflow-hidden rounded-lg border border-border-subtle",
|
|
3977
3977
|
Z
|
|
3978
3978
|
);
|
|
3979
3979
|
if (H)
|
|
3980
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3980
|
+
return /* @__PURE__ */ e("div", { className: te, children: Array.from({ length: X }).map((D, q) => /* @__PURE__ */ i(
|
|
3981
3981
|
"div",
|
|
3982
3982
|
{
|
|
3983
3983
|
className: d(
|
|
@@ -3994,7 +3994,7 @@ function fn({
|
|
|
3994
3994
|
`skeleton-${q}`
|
|
3995
3995
|
)) });
|
|
3996
3996
|
if (t.length === 0 && W)
|
|
3997
|
-
return /* @__PURE__ */ e("div", { className:
|
|
3997
|
+
return /* @__PURE__ */ e("div", { className: te, children: W });
|
|
3998
3998
|
const G = t.length > 0 && $.length === t.length, S = $.length > 0 && !G, T = (D, q, j) => {
|
|
3999
3999
|
const K = p?.(D, q) ?? !1, o = N?.(D, q) ?? !1, z = h?.(D, q) ?? !1, B = A && k(D);
|
|
4000
4000
|
return /* @__PURE__ */ i(
|
|
@@ -4056,7 +4056,7 @@ function fn({
|
|
|
4056
4056
|
...q.filter((K) => D.has(K.id)),
|
|
4057
4057
|
...[...D.keys()].filter((K) => !q.some((o) => o.id === K)).map((K) => ({ id: K }))
|
|
4058
4058
|
].flatMap((K, o) => {
|
|
4059
|
-
const z = D.get(K.id) ?? [], B = y && b[K.id], F = K.title ?? K.id, O = K.count ?? z.length,
|
|
4059
|
+
const z = D.get(K.id) ?? [], B = y && b[K.id], F = K.title ?? K.id, O = K.count ?? z.length, re = /* @__PURE__ */ e(
|
|
4060
4060
|
"li",
|
|
4061
4061
|
{
|
|
4062
4062
|
onClick: y ? () => u((ie) => ({ ...ie, [K.id]: !ie[K.id] })) : void 0,
|
|
@@ -4088,15 +4088,15 @@ function fn({
|
|
|
4088
4088
|
},
|
|
4089
4089
|
`group-${K.id}`
|
|
4090
4090
|
);
|
|
4091
|
-
return B ? [
|
|
4092
|
-
|
|
4091
|
+
return B ? [re] : [
|
|
4092
|
+
re,
|
|
4093
4093
|
...z.map(
|
|
4094
4094
|
({ item: ie, index: He }, Ue) => T(ie, He, Ue === 0)
|
|
4095
4095
|
)
|
|
4096
4096
|
];
|
|
4097
4097
|
});
|
|
4098
4098
|
})();
|
|
4099
|
-
return /* @__PURE__ */ i("div", { ref: E, className:
|
|
4099
|
+
return /* @__PURE__ */ i("div", { ref: E, className: te, onKeyDown: c ? w : void 0, children: [
|
|
4100
4100
|
A && $.length > 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-3 border-b border-border-subtle bg-surface-sunk px-4 py-2", children: [
|
|
4101
4101
|
/* @__PURE__ */ e(
|
|
4102
4102
|
xe,
|
|
@@ -4179,9 +4179,9 @@ const bn = ({
|
|
|
4179
4179
|
onTitleChange: m
|
|
4180
4180
|
}) => {
|
|
4181
4181
|
const [x, v] = R(!1), [C, y] = R(r), g = se(null);
|
|
4182
|
-
|
|
4182
|
+
Y(() => {
|
|
4183
4183
|
y(r);
|
|
4184
|
-
}, [r]),
|
|
4184
|
+
}, [r]), Y(() => {
|
|
4185
4185
|
x && g.current && (g.current.focus(), g.current.select());
|
|
4186
4186
|
}, [x]);
|
|
4187
4187
|
const A = () => {
|
|
@@ -4204,18 +4204,7 @@ const bn = ({
|
|
|
4204
4204
|
/* @__PURE__ */ i("div", { className: "flex flex-row sm:items-start sm:justify-between items-center gap-4", children: [
|
|
4205
4205
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
4206
4206
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 text-text", children: [
|
|
4207
|
-
N && /* @__PURE__ */ e(
|
|
4208
|
-
"button",
|
|
4209
|
-
{
|
|
4210
|
-
type: "button",
|
|
4211
|
-
onClick: N,
|
|
4212
|
-
className: d(
|
|
4213
|
-
"flex items-center text-sm cursor-pointer transition",
|
|
4214
|
-
p
|
|
4215
|
-
),
|
|
4216
|
-
children: /* @__PURE__ */ e(ze, { size: 16, color: "currentColor" })
|
|
4217
|
-
}
|
|
4218
|
-
),
|
|
4207
|
+
N && /* @__PURE__ */ e(ee, { variant: "secondary", onClick: N, leftIcon: /* @__PURE__ */ e(J, { icon: ze, size: "md" }) }),
|
|
4219
4208
|
x ? /* @__PURE__ */ e(
|
|
4220
4209
|
"input",
|
|
4221
4210
|
{
|
|
@@ -4266,7 +4255,7 @@ const bn = ({
|
|
|
4266
4255
|
},
|
|
4267
4256
|
M.id
|
|
4268
4257
|
) : /* @__PURE__ */ e(
|
|
4269
|
-
|
|
4258
|
+
ee,
|
|
4270
4259
|
{
|
|
4271
4260
|
variant: M.variant ?? "secondary",
|
|
4272
4261
|
onClick: (U) => {
|
|
@@ -4291,7 +4280,7 @@ const bn = ({
|
|
|
4291
4280
|
className: s,
|
|
4292
4281
|
children: a
|
|
4293
4282
|
}) => /* @__PURE__ */ i("div", { className: d("flex items-center gap-2 mb-3", s), children: [
|
|
4294
|
-
r && /* @__PURE__ */ e(
|
|
4283
|
+
r && /* @__PURE__ */ e(ee, { variant: "ghost", size: "sm", onClick: r, leftIcon: /* @__PURE__ */ e(ze, { size: 14 }), children: n }),
|
|
4295
4284
|
a && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: a }),
|
|
4296
4285
|
t.length > 0 && /* @__PURE__ */ e("div", { className: d("flex flex-wrap gap-2", !a && "ml-auto"), children: t.map(
|
|
4297
4286
|
(l) => l.splitOptions && l.splitOptions.length > 0 ? /* @__PURE__ */ e(
|
|
@@ -4306,7 +4295,7 @@ const bn = ({
|
|
|
4306
4295
|
},
|
|
4307
4296
|
l.id
|
|
4308
4297
|
) : /* @__PURE__ */ e(
|
|
4309
|
-
|
|
4298
|
+
ee,
|
|
4310
4299
|
{
|
|
4311
4300
|
variant: l.variant ?? "secondary",
|
|
4312
4301
|
size: "sm",
|
|
@@ -4367,7 +4356,7 @@ function yn({
|
|
|
4367
4356
|
}) {
|
|
4368
4357
|
return /* @__PURE__ */ i("section", { className: d("flex flex-col gap-2", l), children: [
|
|
4369
4358
|
/* @__PURE__ */ i("div", { className: "flex items-start gap-2", children: [
|
|
4370
|
-
t && /* @__PURE__ */ e(
|
|
4359
|
+
t && /* @__PURE__ */ e(J, { icon: t, size: "md", color: "secondary", className: "mt-0.5" }),
|
|
4371
4360
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
4372
4361
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-text", children: r }),
|
|
4373
4362
|
n && /* @__PURE__ */ e("p", { className: "text-xs text-text-muted", children: n })
|
|
@@ -4390,7 +4379,7 @@ function Nn({ label: t, dotColor: r, onClick: n, className: s }) {
|
|
|
4390
4379
|
children: [
|
|
4391
4380
|
r && /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full", style: { backgroundColor: r }, "aria-hidden": !0 }),
|
|
4392
4381
|
/* @__PURE__ */ e("span", { className: "min-w-0 truncate", children: t }),
|
|
4393
|
-
/* @__PURE__ */ e(
|
|
4382
|
+
/* @__PURE__ */ e(J, { icon: it, size: "xs", className: "opacity-70" })
|
|
4394
4383
|
]
|
|
4395
4384
|
}
|
|
4396
4385
|
);
|
|
@@ -4813,9 +4802,9 @@ const Sn = ({
|
|
|
4813
4802
|
const [c, f] = R(""), [p, N] = R(a || []), [h, m] = R(l || 0), x = se(null), v = se(null), y = (p.length ? t.find((g) => g.id === p[0])?.subCommands || [] : t).filter(
|
|
4814
4803
|
(g) => g.label.toLowerCase().includes(c.toLowerCase())
|
|
4815
4804
|
);
|
|
4816
|
-
return
|
|
4805
|
+
return Y(() => {
|
|
4817
4806
|
r || (f(""), N(a || []), m(l || 0));
|
|
4818
|
-
}, [r]),
|
|
4807
|
+
}, [r]), Y(() => {
|
|
4819
4808
|
const g = (A) => {
|
|
4820
4809
|
if (r) {
|
|
4821
4810
|
if (A.key === "Escape")
|
|
@@ -4835,12 +4824,12 @@ const Sn = ({
|
|
|
4835
4824
|
}
|
|
4836
4825
|
};
|
|
4837
4826
|
return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
|
|
4838
|
-
}, [r, n, y, h, p]),
|
|
4827
|
+
}, [r, n, y, h, p]), Y(() => {
|
|
4839
4828
|
const g = (A) => {
|
|
4840
4829
|
x.current && !x.current.contains(A.target) && n();
|
|
4841
4830
|
};
|
|
4842
4831
|
return r && document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
4843
|
-
}, [r, n]),
|
|
4832
|
+
}, [r, n]), Y(() => {
|
|
4844
4833
|
if (!r) return;
|
|
4845
4834
|
v.current?.querySelector(`[data-index="${h}"]`)?.scrollIntoView({ block: "nearest" });
|
|
4846
4835
|
}, [h, r]), r ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-modal flex items-center justify-center bg-scrim", children: /* @__PURE__ */ i(
|
|
@@ -5024,7 +5013,7 @@ function En({
|
|
|
5024
5013
|
className: l
|
|
5025
5014
|
}) {
|
|
5026
5015
|
const c = se(null), [f, p] = R(!0), [N, h] = R(null), m = se(null);
|
|
5027
|
-
return se(null),
|
|
5016
|
+
return se(null), Y(() => {
|
|
5028
5017
|
let x = !0;
|
|
5029
5018
|
return (async () => {
|
|
5030
5019
|
p(!0);
|
|
@@ -5041,7 +5030,7 @@ function En({
|
|
|
5041
5030
|
})(), () => {
|
|
5042
5031
|
x = !1;
|
|
5043
5032
|
};
|
|
5044
|
-
}, [t, r]),
|
|
5033
|
+
}, [t, r]), Y(() => {
|
|
5045
5034
|
if (f || !N || n === "react") return;
|
|
5046
5035
|
const x = c.current;
|
|
5047
5036
|
if (x) {
|
|
@@ -5056,7 +5045,7 @@ function En({
|
|
|
5056
5045
|
};
|
|
5057
5046
|
}
|
|
5058
5047
|
}
|
|
5059
|
-
}, [N, n, f]),
|
|
5048
|
+
}, [N, n, f]), Y(() => {
|
|
5060
5049
|
n === "svelte" && m.current && m.current.$set?.(a);
|
|
5061
5050
|
}, [a, n]), /* @__PURE__ */ i("div", { ref: c, className: l, style: { display: "contents" }, children: [
|
|
5062
5051
|
f && s,
|
|
@@ -5097,7 +5086,7 @@ export {
|
|
|
5097
5086
|
dn as AvatarStack,
|
|
5098
5087
|
tn as Badge,
|
|
5099
5088
|
Ve as Box,
|
|
5100
|
-
|
|
5089
|
+
ee as Button,
|
|
5101
5090
|
Gr as ButtonGroup,
|
|
5102
5091
|
zn as Card,
|
|
5103
5092
|
un as ChannelBadge,
|
|
@@ -5114,7 +5103,7 @@ export {
|
|
|
5114
5103
|
It as FolderSelect,
|
|
5115
5104
|
Qr as Form,
|
|
5116
5105
|
Cn as Heading,
|
|
5117
|
-
|
|
5106
|
+
J as Icon,
|
|
5118
5107
|
mn as Image,
|
|
5119
5108
|
nn as Kbd,
|
|
5120
5109
|
xn as KpiCard,
|