@metaphor-cloud/ui 0.7.0 → 0.9.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/components/DataTable.d.ts +5 -1
- package/dist/components/DataTable.d.ts.map +1 -1
- package/dist/components/Sidebar.d.ts +11 -1
- package/dist/components/Sidebar.d.ts.map +1 -1
- package/dist/components/Table.d.ts +2 -1
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/hooks/use-column-resize.d.ts +23 -0
- package/dist/hooks/use-column-resize.d.ts.map +1 -0
- package/dist/metaphor-ui.css +1 -1
- package/dist/metaphor-ui.js +271 -129
- package/dist/themes/adapter-all.css +1 -1
- package/dist/themes/metaphor-all.css +1 -1
- package/dist/themes/um-all.css +1 -1
- package/package.json +1 -1
package/dist/metaphor-ui.js
CHANGED
|
@@ -8999,13 +8999,14 @@ function ky({ className: e, ref: t, ...n }) {
|
|
|
8999
8999
|
}
|
|
9000
9000
|
//#endregion
|
|
9001
9001
|
//#region src/components/Table.tsx
|
|
9002
|
-
function Ay({ className: e, ref: t,
|
|
9002
|
+
function Ay({ className: e, ref: t, tableLayout: n, ...r }) {
|
|
9003
9003
|
return /* @__PURE__ */ l("div", {
|
|
9004
9004
|
className: "relative w-full overflow-auto",
|
|
9005
9005
|
children: /* @__PURE__ */ l("table", {
|
|
9006
9006
|
ref: t,
|
|
9007
9007
|
className: W("w-full caption-bottom text-sm", e),
|
|
9008
|
-
|
|
9008
|
+
style: n ? { tableLayout: n } : void 0,
|
|
9009
|
+
...r
|
|
9009
9010
|
})
|
|
9010
9011
|
});
|
|
9011
9012
|
}
|
|
@@ -10143,14 +10144,47 @@ var hx = e.createContext({ renderLink: mx });
|
|
|
10143
10144
|
function gx() {
|
|
10144
10145
|
return e.useContext(hx);
|
|
10145
10146
|
}
|
|
10146
|
-
function _x({ className:
|
|
10147
|
+
function _x({ className: t, children: n, renderLink: r = mx, width: i, resizable: a = !1, minWidth: o = 200, maxWidth: s = 480, onWidthChange: c, style: d, ref: f, ...p }) {
|
|
10148
|
+
let m = e.useRef(null), h = f ?? m, [g, _] = e.useState(null), [v, y] = e.useState(!1);
|
|
10149
|
+
e.useEffect(() => {
|
|
10150
|
+
if (!v) return;
|
|
10151
|
+
function e(e) {
|
|
10152
|
+
let t = Math.min(s, Math.max(o, e.clientX));
|
|
10153
|
+
_(t), c?.(t);
|
|
10154
|
+
}
|
|
10155
|
+
function t() {
|
|
10156
|
+
y(!1);
|
|
10157
|
+
}
|
|
10158
|
+
return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), document.body.style.userSelect = "none", document.body.style.cursor = "col-resize", () => {
|
|
10159
|
+
document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t), document.body.style.userSelect = "", document.body.style.cursor = "";
|
|
10160
|
+
};
|
|
10161
|
+
}, [
|
|
10162
|
+
v,
|
|
10163
|
+
o,
|
|
10164
|
+
s,
|
|
10165
|
+
c
|
|
10166
|
+
]), e.useEffect(() => {
|
|
10167
|
+
i != null && _(null);
|
|
10168
|
+
}, [i]);
|
|
10169
|
+
let b = g == null ? i ?? "18rem" : `${g}px`;
|
|
10147
10170
|
return /* @__PURE__ */ l(hx.Provider, {
|
|
10148
|
-
value: { renderLink:
|
|
10149
|
-
children: /* @__PURE__ */
|
|
10150
|
-
ref:
|
|
10151
|
-
className: W("max-lg:hidden fixed inset-y-0 left-0 z-50 flex
|
|
10152
|
-
|
|
10153
|
-
|
|
10171
|
+
value: { renderLink: r },
|
|
10172
|
+
children: /* @__PURE__ */ u("aside", {
|
|
10173
|
+
ref: h,
|
|
10174
|
+
className: W("max-lg:hidden fixed inset-y-0 left-0 z-50 flex flex-col border-r border-border bg-bg", v && "transition-none select-none", t),
|
|
10175
|
+
style: {
|
|
10176
|
+
width: b,
|
|
10177
|
+
...d
|
|
10178
|
+
},
|
|
10179
|
+
...p,
|
|
10180
|
+
children: [n, a && /* @__PURE__ */ l("div", {
|
|
10181
|
+
role: "separator",
|
|
10182
|
+
"aria-orientation": "vertical",
|
|
10183
|
+
onMouseDown: (e) => {
|
|
10184
|
+
e.preventDefault(), y(!0);
|
|
10185
|
+
},
|
|
10186
|
+
className: W("absolute inset-y-0 -right-1 w-2 cursor-col-resize z-50", "after:absolute after:inset-y-0 after:left-1/2 after:-translate-x-1/2 after:w-0.5", v ? "after:bg-accent" : "after:bg-transparent hover:after:bg-border", "after:transition-colors")
|
|
10187
|
+
})]
|
|
10154
10188
|
})
|
|
10155
10189
|
});
|
|
10156
10190
|
}
|
|
@@ -10463,39 +10497,125 @@ function Px({ className: e, children: t, ref: n, ...r }) {
|
|
|
10463
10497
|
});
|
|
10464
10498
|
}
|
|
10465
10499
|
//#endregion
|
|
10500
|
+
//#region src/hooks/use-column-resize.ts
|
|
10501
|
+
var Fx = 60;
|
|
10502
|
+
function Ix(e) {
|
|
10503
|
+
if (e == null) return null;
|
|
10504
|
+
let t = e.match(/^(\d+(?:\.\d+)?)px$/);
|
|
10505
|
+
return t?.[1] == null ? null : parseFloat(t[1]);
|
|
10506
|
+
}
|
|
10507
|
+
function Lx({ columns: t, hasSelectionColumn: n, onColumnResize: r, tableRef: i }) {
|
|
10508
|
+
let [a, o] = e.useState(() => {
|
|
10509
|
+
let e = /* @__PURE__ */ new Map();
|
|
10510
|
+
for (let n of t) {
|
|
10511
|
+
let t = Ix(n.width);
|
|
10512
|
+
t != null && e.set(n.id, t);
|
|
10513
|
+
}
|
|
10514
|
+
return e;
|
|
10515
|
+
}), [s, c] = e.useState(!1), [l, u] = e.useState(null), d = e.useRef(null), f = e.useRef(!1);
|
|
10516
|
+
e.useLayoutEffect(() => {
|
|
10517
|
+
if (f.current) return;
|
|
10518
|
+
let e = i.current;
|
|
10519
|
+
if (!e) return;
|
|
10520
|
+
let r = e.querySelectorAll("thead th");
|
|
10521
|
+
if (r.length === 0) return;
|
|
10522
|
+
f.current = !0;
|
|
10523
|
+
let a = +!!n;
|
|
10524
|
+
o((e) => {
|
|
10525
|
+
let n = new Map(e);
|
|
10526
|
+
return t.forEach((e, t) => {
|
|
10527
|
+
if (!e.resizable || n.has(e.id)) return;
|
|
10528
|
+
let i = r[t + a];
|
|
10529
|
+
i && n.set(e.id, i.getBoundingClientRect().width);
|
|
10530
|
+
}), n;
|
|
10531
|
+
});
|
|
10532
|
+
}), e.useEffect(() => {
|
|
10533
|
+
f.current = !1;
|
|
10534
|
+
}, [t]);
|
|
10535
|
+
let p = e.useCallback((e, n) => {
|
|
10536
|
+
let r = t.find((t) => t.id === e);
|
|
10537
|
+
if (!r) return;
|
|
10538
|
+
let i = a.get(e);
|
|
10539
|
+
i != null && (d.current = {
|
|
10540
|
+
columnId: e,
|
|
10541
|
+
startX: n.clientX,
|
|
10542
|
+
startWidth: i,
|
|
10543
|
+
minWidth: r.minWidth ?? Fx,
|
|
10544
|
+
maxWidth: r.maxWidth ?? Infinity
|
|
10545
|
+
}, u(e), c(!0));
|
|
10546
|
+
}, [t, a]);
|
|
10547
|
+
return e.useEffect(() => {
|
|
10548
|
+
if (!s) return;
|
|
10549
|
+
function e(e) {
|
|
10550
|
+
let t = d.current;
|
|
10551
|
+
if (!t) return;
|
|
10552
|
+
let n = e.clientX - t.startX, r = Math.min(t.maxWidth, Math.max(t.minWidth, t.startWidth + n));
|
|
10553
|
+
o((e) => {
|
|
10554
|
+
let n = new Map(e);
|
|
10555
|
+
return n.set(t.columnId, r), n;
|
|
10556
|
+
});
|
|
10557
|
+
}
|
|
10558
|
+
function t() {
|
|
10559
|
+
let e = d.current;
|
|
10560
|
+
if (e) {
|
|
10561
|
+
let t = a.get(e.columnId) ?? e.startWidth;
|
|
10562
|
+
r?.(e.columnId, t);
|
|
10563
|
+
}
|
|
10564
|
+
d.current = null, u(null), c(!1);
|
|
10565
|
+
}
|
|
10566
|
+
return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), document.body.style.userSelect = "none", document.body.style.cursor = "col-resize", () => {
|
|
10567
|
+
document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t), document.body.style.userSelect = "", document.body.style.cursor = "";
|
|
10568
|
+
};
|
|
10569
|
+
}, [
|
|
10570
|
+
s,
|
|
10571
|
+
r,
|
|
10572
|
+
a
|
|
10573
|
+
]), {
|
|
10574
|
+
columnWidths: a,
|
|
10575
|
+
isResizing: s,
|
|
10576
|
+
resizingColumnId: l,
|
|
10577
|
+
startResize: p
|
|
10578
|
+
};
|
|
10579
|
+
}
|
|
10580
|
+
//#endregion
|
|
10466
10581
|
//#region src/components/DataTable.tsx
|
|
10467
|
-
function
|
|
10582
|
+
function Rx({ children: e, className: t, ...n }) {
|
|
10468
10583
|
return /* @__PURE__ */ l("div", {
|
|
10469
10584
|
className: W("flex items-center gap-2", t),
|
|
10470
10585
|
...n,
|
|
10471
10586
|
children: e
|
|
10472
10587
|
});
|
|
10473
10588
|
}
|
|
10474
|
-
|
|
10475
|
-
function
|
|
10589
|
+
Rx.displayName = "DataTableToolbar";
|
|
10590
|
+
function zx({ children: e, className: t, ...n }) {
|
|
10476
10591
|
return /* @__PURE__ */ l("div", {
|
|
10477
10592
|
className: t,
|
|
10478
10593
|
...n,
|
|
10479
10594
|
children: e
|
|
10480
10595
|
});
|
|
10481
10596
|
}
|
|
10482
|
-
|
|
10483
|
-
function
|
|
10484
|
-
let [
|
|
10485
|
-
|
|
10486
|
-
|
|
10597
|
+
zx.displayName = "DataTableEmpty";
|
|
10598
|
+
function Bx({ columns: t, data: n, children: r, loading: i, totalRows: a, onStateChange: o, defaultSort: s, manualSorting: c = !1, globalFilter: d = !1, manualFiltering: f = !1, pageSize: p = 20, manualPagination: m = !1, onRowClick: h, renderRowLink: g, rowClassName: _, getRowId: v, selectable: y = !1, onSelectionChange: b, onColumnResize: x, className: S, ref: C }) {
|
|
10599
|
+
let [w, T] = e.useState(s ?? null), [E, D] = e.useState(""), [O, k] = e.useState(1), [A, j] = e.useState(/* @__PURE__ */ new Set()), M = e.useMemo(() => t.filter((e) => !e.hidden), [t]), N = e.useRef(null), P = M.some((e) => e.resizable), { columnWidths: F, resizingColumnId: I, startResize: ee } = Lx({
|
|
10600
|
+
columns: M,
|
|
10601
|
+
hasSelectionColumn: y,
|
|
10602
|
+
onColumnResize: x,
|
|
10603
|
+
tableRef: N
|
|
10604
|
+
}), te = e.useMemo(() => ({
|
|
10605
|
+
sort: w,
|
|
10606
|
+
globalFilter: E,
|
|
10487
10607
|
columnFilters: {},
|
|
10488
|
-
page:
|
|
10608
|
+
page: O,
|
|
10489
10609
|
pageSize: p
|
|
10490
10610
|
}), [
|
|
10491
|
-
|
|
10492
|
-
|
|
10493
|
-
|
|
10611
|
+
w,
|
|
10612
|
+
E,
|
|
10613
|
+
O,
|
|
10494
10614
|
p
|
|
10495
|
-
]),
|
|
10615
|
+
]), ne = e.useCallback((e) => {
|
|
10496
10616
|
o?.(e);
|
|
10497
|
-
}, [o]),
|
|
10498
|
-
|
|
10617
|
+
}, [o]), re = e.useCallback((e) => {
|
|
10618
|
+
T((t) => {
|
|
10499
10619
|
let n;
|
|
10500
10620
|
return n = !t || t.id !== e ? {
|
|
10501
10621
|
id: e,
|
|
@@ -10503,161 +10623,183 @@ function Lx({ columns: t, data: n, children: r, loading: i, totalRows: a, onStat
|
|
|
10503
10623
|
} : t.desc ? null : {
|
|
10504
10624
|
id: e,
|
|
10505
10625
|
desc: !0
|
|
10506
|
-
},
|
|
10507
|
-
...
|
|
10626
|
+
}, ne({
|
|
10627
|
+
...te,
|
|
10508
10628
|
sort: n,
|
|
10509
10629
|
page: 1
|
|
10510
10630
|
}), n;
|
|
10511
|
-
}), c ||
|
|
10631
|
+
}), c || k(1);
|
|
10512
10632
|
}, [
|
|
10513
|
-
|
|
10514
|
-
|
|
10633
|
+
te,
|
|
10634
|
+
ne,
|
|
10515
10635
|
c
|
|
10516
|
-
]),
|
|
10517
|
-
|
|
10518
|
-
...
|
|
10636
|
+
]), L = e.useCallback((e) => {
|
|
10637
|
+
D(e), k(1), ne({
|
|
10638
|
+
...te,
|
|
10519
10639
|
globalFilter: e,
|
|
10520
10640
|
page: 1
|
|
10521
10641
|
});
|
|
10522
|
-
}, [
|
|
10642
|
+
}, [te, ne]), R = e.useMemo(() => {
|
|
10523
10643
|
let e = [...n];
|
|
10524
|
-
if (!f &&
|
|
10525
|
-
let n =
|
|
10644
|
+
if (!f && E) {
|
|
10645
|
+
let n = E.toLowerCase();
|
|
10526
10646
|
e = e.filter((e) => t.some((t) => {
|
|
10527
10647
|
if (!t.accessorKey) return !1;
|
|
10528
10648
|
let r = e[t.accessorKey];
|
|
10529
10649
|
return r != null && String(r).toLowerCase().includes(n);
|
|
10530
10650
|
}));
|
|
10531
10651
|
}
|
|
10532
|
-
if (!c &&
|
|
10533
|
-
let n = t.find((e) => e.id ===
|
|
10652
|
+
if (!c && w) {
|
|
10653
|
+
let n = t.find((e) => e.id === w.id);
|
|
10534
10654
|
n && e.sort((e, t) => {
|
|
10535
10655
|
let r;
|
|
10536
|
-
return r = n.sortFn ? n.sortFn(e, t) : n.accessorKey ? String(e[n.accessorKey] ?? "").localeCompare(String(t[n.accessorKey] ?? "")) : 0,
|
|
10656
|
+
return r = n.sortFn ? n.sortFn(e, t) : n.accessorKey ? String(e[n.accessorKey] ?? "").localeCompare(String(t[n.accessorKey] ?? "")) : 0, w.desc ? -r : r;
|
|
10537
10657
|
});
|
|
10538
10658
|
}
|
|
10539
10659
|
return e;
|
|
10540
10660
|
}, [
|
|
10541
10661
|
n,
|
|
10542
10662
|
t,
|
|
10543
|
-
|
|
10544
|
-
|
|
10663
|
+
w,
|
|
10664
|
+
E,
|
|
10545
10665
|
c,
|
|
10546
10666
|
f
|
|
10547
|
-
]),
|
|
10548
|
-
if (p <= 0 || m) return
|
|
10549
|
-
let e = (
|
|
10550
|
-
return
|
|
10667
|
+
]), ie = m ? a ?? n.length : R.length, ae = p > 0 ? Math.max(1, Math.ceil(ie / p)) : 1, z = e.useMemo(() => {
|
|
10668
|
+
if (p <= 0 || m) return R;
|
|
10669
|
+
let e = (O - 1) * p;
|
|
10670
|
+
return R.slice(e, e + p);
|
|
10551
10671
|
}, [
|
|
10552
|
-
|
|
10553
|
-
|
|
10672
|
+
R,
|
|
10673
|
+
O,
|
|
10554
10674
|
p,
|
|
10555
10675
|
m
|
|
10556
|
-
]),
|
|
10557
|
-
|
|
10558
|
-
...
|
|
10676
|
+
]), oe = e.useCallback((e) => {
|
|
10677
|
+
k(e), ne({
|
|
10678
|
+
...te,
|
|
10559
10679
|
page: e
|
|
10560
10680
|
});
|
|
10561
|
-
}, [
|
|
10562
|
-
let t =
|
|
10563
|
-
|
|
10681
|
+
}, [te, ne]), B = e.useCallback((e) => v ? v(e) : String(e.id ?? ""), [v]), se = e.useCallback((e) => {
|
|
10682
|
+
let t = B(e);
|
|
10683
|
+
j((e) => {
|
|
10564
10684
|
let r = new Set(e);
|
|
10565
10685
|
r.has(t) ? r.delete(t) : r.add(t);
|
|
10566
|
-
let i = n.filter((e) => r.has(
|
|
10686
|
+
let i = n.filter((e) => r.has(B(e)));
|
|
10567
10687
|
return b?.(i), r;
|
|
10568
10688
|
});
|
|
10569
10689
|
}, [
|
|
10570
10690
|
n,
|
|
10571
|
-
|
|
10691
|
+
B,
|
|
10572
10692
|
b
|
|
10573
|
-
]),
|
|
10574
|
-
|
|
10575
|
-
if (e.size ===
|
|
10576
|
-
let t = new Set(
|
|
10577
|
-
return b?.(
|
|
10693
|
+
]), ce = e.useCallback(() => {
|
|
10694
|
+
j((e) => {
|
|
10695
|
+
if (e.size === z.length) return b?.([]), /* @__PURE__ */ new Set();
|
|
10696
|
+
let t = new Set(z.map((e) => B(e)));
|
|
10697
|
+
return b?.(z), t;
|
|
10578
10698
|
});
|
|
10579
10699
|
}, [
|
|
10580
|
-
|
|
10581
|
-
|
|
10700
|
+
z,
|
|
10701
|
+
B,
|
|
10582
10702
|
b
|
|
10583
|
-
]),
|
|
10703
|
+
]), le = e.useCallback((e) => A.has(B(e)), [A, B]), ue = null, de = null;
|
|
10584
10704
|
e.Children.forEach(r, (t) => {
|
|
10585
|
-
e.isValidElement(t) && (t.type?.displayName === "DataTableToolbar" ?
|
|
10705
|
+
e.isValidElement(t) && (t.type?.displayName === "DataTableToolbar" ? ue = t : t.type?.displayName === "DataTableEmpty" && (de = t));
|
|
10586
10706
|
});
|
|
10587
|
-
let
|
|
10707
|
+
let fe = (e) => !w || w.id !== e ? "↕" : w.desc ? "↓" : "↑", pe = z.length === 0 && !i;
|
|
10588
10708
|
return /* @__PURE__ */ u("div", {
|
|
10589
|
-
ref:
|
|
10590
|
-
className: W("space-y-4",
|
|
10709
|
+
ref: C,
|
|
10710
|
+
className: W("space-y-4", S),
|
|
10591
10711
|
children: [
|
|
10592
|
-
(d ||
|
|
10712
|
+
(d || ue) && /* @__PURE__ */ u("div", {
|
|
10593
10713
|
className: "flex items-center gap-4",
|
|
10594
10714
|
children: [d && /* @__PURE__ */ l(Zt, {
|
|
10595
10715
|
placeholder: "Search...",
|
|
10596
|
-
value:
|
|
10597
|
-
onChange: (e) =>
|
|
10716
|
+
value: E,
|
|
10717
|
+
onChange: (e) => L(e.target.value),
|
|
10598
10718
|
className: "max-w-sm"
|
|
10599
10719
|
}), /* @__PURE__ */ l("div", {
|
|
10600
10720
|
className: "ml-auto flex items-center gap-2",
|
|
10601
|
-
children:
|
|
10721
|
+
children: ue
|
|
10602
10722
|
})]
|
|
10603
10723
|
}),
|
|
10604
|
-
/* @__PURE__ */ u(Ay, {
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
})
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10724
|
+
/* @__PURE__ */ u(Ay, {
|
|
10725
|
+
tableLayout: P ? "fixed" : void 0,
|
|
10726
|
+
ref: N,
|
|
10727
|
+
children: [
|
|
10728
|
+
P && /* @__PURE__ */ u("colgroup", { children: [y && /* @__PURE__ */ l("col", { style: { width: 40 } }), M.map((e) => {
|
|
10729
|
+
let t = F.get(e.id);
|
|
10730
|
+
return /* @__PURE__ */ l("col", { style: t == null ? void 0 : { width: t } }, e.id);
|
|
10731
|
+
})] }),
|
|
10732
|
+
/* @__PURE__ */ l(jy, { children: /* @__PURE__ */ u(Py, { children: [y && /* @__PURE__ */ l(Fy, {
|
|
10733
|
+
className: "w-10",
|
|
10734
|
+
children: /* @__PURE__ */ l(Op, {
|
|
10735
|
+
checked: z.length > 0 && A.size === z.length,
|
|
10736
|
+
onCheckedChange: ce,
|
|
10737
|
+
"aria-label": "Select all"
|
|
10738
|
+
})
|
|
10739
|
+
}), M.map((e) => /* @__PURE__ */ u(Fy, {
|
|
10740
|
+
className: W(e.sortable && "cursor-pointer select-none", P && "relative", e.className),
|
|
10741
|
+
style: !P && e.width ? { width: e.width } : void 0,
|
|
10742
|
+
onClick: e.sortable ? () => re(e.id) : void 0,
|
|
10743
|
+
children: [
|
|
10744
|
+
typeof e.header == "function" ? e.header(w?.id === e.id ? w : null) : /* @__PURE__ */ l("span", { children: e.header }),
|
|
10745
|
+
e.sortable && typeof e.header != "function" && /* @__PURE__ */ l("span", {
|
|
10746
|
+
"aria-hidden": !0,
|
|
10747
|
+
className: "ml-1",
|
|
10748
|
+
children: fe(e.id)
|
|
10749
|
+
}),
|
|
10750
|
+
e.resizable && /* @__PURE__ */ l("div", {
|
|
10751
|
+
role: "separator",
|
|
10752
|
+
"aria-orientation": "vertical",
|
|
10753
|
+
onMouseDown: (t) => {
|
|
10754
|
+
t.preventDefault(), t.stopPropagation(), ee(e.id, t);
|
|
10755
|
+
},
|
|
10756
|
+
className: W("absolute top-0 -right-px z-10 h-full w-2 cursor-col-resize", "after:absolute after:inset-y-0 after:left-1/2 after:-translate-x-1/2 after:w-0.5", I === e.id ? "after:bg-accent" : "after:bg-transparent hover:after:bg-accent/20", "after:transition-colors")
|
|
10757
|
+
})
|
|
10758
|
+
]
|
|
10759
|
+
}, e.id))] }) }),
|
|
10760
|
+
/* @__PURE__ */ l(My, { children: pe ? /* @__PURE__ */ l(Py, { children: /* @__PURE__ */ l(Iy, {
|
|
10761
|
+
colSpan: M.length + +!!y,
|
|
10762
|
+
className: "h-24",
|
|
10763
|
+
children: de ?? /* @__PURE__ */ l(wx, { title: "No results" })
|
|
10764
|
+
}) }) : z.map((e, t) => {
|
|
10765
|
+
let n = m ? t : (O - 1) * p + t, r = g?.(e), i = y && /* @__PURE__ */ l(Iy, {
|
|
10766
|
+
className: "w-10",
|
|
10767
|
+
onClick: (e) => e.stopPropagation(),
|
|
10768
|
+
children: /* @__PURE__ */ l(Op, {
|
|
10769
|
+
checked: le(e),
|
|
10770
|
+
onCheckedChange: () => se(e),
|
|
10771
|
+
"aria-label": "Select row"
|
|
10772
|
+
})
|
|
10773
|
+
}), a = M.map((t) => /* @__PURE__ */ l(Iy, {
|
|
10774
|
+
className: W(t.className, P && "overflow-hidden text-ellipsis"),
|
|
10775
|
+
children: r ? /* @__PURE__ */ l("a", {
|
|
10776
|
+
href: r.href,
|
|
10777
|
+
className: "contents",
|
|
10778
|
+
children: t.cell(e, n)
|
|
10779
|
+
}) : t.cell(e, n)
|
|
10780
|
+
}, t.id));
|
|
10781
|
+
return /* @__PURE__ */ u(Py, {
|
|
10782
|
+
className: W((h || r) && "cursor-pointer", _?.(e, n)),
|
|
10783
|
+
onClick: h ? () => h(e, n) : void 0,
|
|
10784
|
+
"data-state": le(e) ? "selected" : void 0,
|
|
10785
|
+
children: [i, a]
|
|
10786
|
+
}, v ? v(e) : t);
|
|
10787
|
+
}) })
|
|
10788
|
+
]
|
|
10789
|
+
}),
|
|
10790
|
+
p > 0 && ae > 1 && /* @__PURE__ */ l(Tx, {
|
|
10791
|
+
page: O,
|
|
10650
10792
|
pageSize: p,
|
|
10651
|
-
totalItems:
|
|
10652
|
-
totalPages:
|
|
10653
|
-
onPageChange:
|
|
10793
|
+
totalItems: ie,
|
|
10794
|
+
totalPages: ae,
|
|
10795
|
+
onPageChange: oe
|
|
10654
10796
|
})
|
|
10655
10797
|
]
|
|
10656
10798
|
});
|
|
10657
10799
|
}
|
|
10658
10800
|
//#endregion
|
|
10659
10801
|
//#region src/components/Timeline.tsx
|
|
10660
|
-
function
|
|
10802
|
+
function Vx({ className: e, children: t, ref: n, ...r }) {
|
|
10661
10803
|
return /* @__PURE__ */ l("div", {
|
|
10662
10804
|
ref: n,
|
|
10663
10805
|
className: W("relative space-y-0", e),
|
|
@@ -10665,20 +10807,20 @@ function Rx({ className: e, children: t, ref: n, ...r }) {
|
|
|
10665
10807
|
children: t
|
|
10666
10808
|
});
|
|
10667
10809
|
}
|
|
10668
|
-
var
|
|
10810
|
+
var Hx = e.createContext({
|
|
10669
10811
|
expanded: !1,
|
|
10670
10812
|
setExpanded: () => {},
|
|
10671
10813
|
expandable: !1
|
|
10672
|
-
}),
|
|
10814
|
+
}), Ux = {
|
|
10673
10815
|
default: "border-border bg-bg-elevated",
|
|
10674
10816
|
success: "border-green bg-green text-white",
|
|
10675
10817
|
danger: "border-red bg-red text-white",
|
|
10676
10818
|
warning: "border-orange bg-orange text-white",
|
|
10677
10819
|
info: "border-accent bg-accent text-white"
|
|
10678
10820
|
};
|
|
10679
|
-
function
|
|
10821
|
+
function Wx({ className: t, children: n, icon: r, variant: i = "default", timestamp: a, expandable: o = !1, defaultExpanded: s = !1, ref: c, ...d }) {
|
|
10680
10822
|
let [f, p] = e.useState(s);
|
|
10681
|
-
return /* @__PURE__ */ l(
|
|
10823
|
+
return /* @__PURE__ */ l(Hx.Provider, {
|
|
10682
10824
|
value: {
|
|
10683
10825
|
expanded: f,
|
|
10684
10826
|
setExpanded: p,
|
|
@@ -10692,7 +10834,7 @@ function Vx({ className: t, children: n, icon: r, variant: i = "default", timest
|
|
|
10692
10834
|
/* @__PURE__ */ l("div", { className: "absolute left-[0.6875rem] top-6 bottom-0 w-px bg-border last-of-type:hidden" }),
|
|
10693
10835
|
/* @__PURE__ */ l("div", {
|
|
10694
10836
|
"data-timeline-marker": "",
|
|
10695
|
-
className: W("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full border-2",
|
|
10837
|
+
className: W("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full border-2", Ux[i]),
|
|
10696
10838
|
children: r && /* @__PURE__ */ l("span", {
|
|
10697
10839
|
className: "h-3.5 w-3.5 [&>svg]:h-3.5 [&>svg]:w-3.5",
|
|
10698
10840
|
children: r
|
|
@@ -10709,8 +10851,8 @@ function Vx({ className: t, children: n, icon: r, variant: i = "default", timest
|
|
|
10709
10851
|
})
|
|
10710
10852
|
});
|
|
10711
10853
|
}
|
|
10712
|
-
function
|
|
10713
|
-
let { expanded: p, setExpanded: m, expandable: h } = e.useContext(
|
|
10854
|
+
function Gx({ className: t, title: n, description: r, detail: i, actions: a, onClick: o, renderLink: s, ref: d, ...f }) {
|
|
10855
|
+
let { expanded: p, setExpanded: m, expandable: h } = e.useContext(Hx), g = /* @__PURE__ */ l("span", {
|
|
10714
10856
|
className: W("text-sm font-medium text-text-primary", o && "cursor-pointer hover:underline"),
|
|
10715
10857
|
onClick: o,
|
|
10716
10858
|
children: n
|
|
@@ -10743,7 +10885,7 @@ function Hx({ className: t, title: n, description: r, detail: i, actions: a, onC
|
|
|
10743
10885
|
})] })]
|
|
10744
10886
|
});
|
|
10745
10887
|
}
|
|
10746
|
-
function
|
|
10888
|
+
function Kx({ className: e, filters: t, value: n, onChange: r, ref: i, ...a }) {
|
|
10747
10889
|
let o = (e) => {
|
|
10748
10890
|
n.includes(e) ? r(n.filter((t) => t !== e)) : r([...n, e]);
|
|
10749
10891
|
};
|
|
@@ -10760,4 +10902,4 @@ function Ux({ className: e, filters: t, value: n, onChange: r, ref: i, ...a }) {
|
|
|
10760
10902
|
});
|
|
10761
10903
|
}
|
|
10762
10904
|
//#endregion
|
|
10763
|
-
export { Vr as Accordion, Wr as AccordionContent, Hr as AccordionItem, Ur as AccordionTrigger, cn as Alert, un as AlertDescription, Ps as AlertDialog, Us as AlertDialogAction, Ws as AlertDialogCancel, Rs as AlertDialogContent, Hs as AlertDialogDescription, Bs as AlertDialogFooter, zs as AlertDialogHeader, Ls as AlertDialogOverlay, Is as AlertDialogPortal, Vs as AlertDialogTitle, Fs as AlertDialogTrigger, ln as AlertTitle, Zb as AnimatedCounter, Ax as AppShell, Px as AppShellFooter, Nx as AppShellMain, Mx as AppShellNav, jx as AppShellSidebar, on as Badge, px as Breadcrumb, Wt as Button, Gt as Card, Yt as CardContent, Jt as CardDescription, Xt as CardFooter, Kt as CardHeader, qt as CardTitle, Op as Checkbox, Hb as CodeBlock, Gb as Combobox, Jb as ComboboxContent, Xb as ComboboxEmpty, qb as ComboboxInput, Yb as ComboboxItem, Kb as ComboboxTrigger,
|
|
10905
|
+
export { Vr as Accordion, Wr as AccordionContent, Hr as AccordionItem, Ur as AccordionTrigger, cn as Alert, un as AlertDescription, Ps as AlertDialog, Us as AlertDialogAction, Ws as AlertDialogCancel, Rs as AlertDialogContent, Hs as AlertDialogDescription, Bs as AlertDialogFooter, zs as AlertDialogHeader, Ls as AlertDialogOverlay, Is as AlertDialogPortal, Vs as AlertDialogTitle, Fs as AlertDialogTrigger, ln as AlertTitle, Zb as AnimatedCounter, Ax as AppShell, Px as AppShellFooter, Nx as AppShellMain, Mx as AppShellNav, jx as AppShellSidebar, on as Badge, px as Breadcrumb, Wt as Button, Gt as Card, Yt as CardContent, Jt as CardDescription, Xt as CardFooter, Kt as CardHeader, qt as CardTitle, Op as Checkbox, Hb as CodeBlock, Gb as Combobox, Jb as ComboboxContent, Xb as ComboboxEmpty, qb as ComboboxInput, Yb as ComboboxItem, Kb as ComboboxTrigger, Bx as DataTable, zx as DataTableEmpty, Rx as DataTableToolbar, Ho as Dialog, Wo as DialogClose, qo as DialogContent, Zo as DialogDescription, Yo as DialogFooter, Jo as DialogHeader, Ko as DialogOverlay, Go as DialogPortal, Xo as DialogTitle, Uo as DialogTrigger, Jv as DropdownMenu, iy as DropdownMenuCheckboxItem, Qv as DropdownMenuContent, Xv as DropdownMenuGroup, $v as DropdownMenuItem, ey as DropdownMenuLabel, ry as DropdownMenuRadioGroup, ay as DropdownMenuRadioItem, ty as DropdownMenuSeparator, Zv as DropdownMenuSub, oy as DropdownMenuSubContent, ny as DropdownMenuSubTrigger, Yv as DropdownMenuTrigger, wx as EmptyState, Zt as Input, rn as Label, cx as MetaHead, ax as Nav, Cx as PageHeader, Tx as Pagination, og as Popover, cg as PopoverContent, sg as PopoverTrigger, Oy as Progress, nm as RadioGroup, rm as RadioGroupItem, ip as Select, cp as SelectContent, ap as SelectGroup, up as SelectItem, lp as SelectLabel, dp as SelectSeparator, sp as SelectTrigger, op as SelectValue, vn as Separator, Cm as Sheet, Tm as SheetClose, km as SheetContent, Nm as SheetDescription, jm as SheetFooter, Am as SheetHeader, Dm as SheetOverlay, Em as SheetPortal, Mm as SheetTitle, wm as SheetTrigger, _x as Sidebar, yx as SidebarContent, bx as SidebarFooter, xx as SidebarGroup, vx as SidebarHeader, Sx as SidebarItem, ky as Skeleton, Dx as StatCard, ux as StructuredData, _m as Switch, Ay as Table, My as TableBody, Ly as TableCaption, Iy as TableCell, Ny as TableFooter, Fy as TableHead, jy as TableHeader, Py as TableRow, jc as Tabs, Pc as TabsContent, Mc as TabsList, Nc as TabsTrigger, Qt as Textarea, Tt as ThemeProvider, Vx as Timeline, Gx as TimelineContent, Kx as TimelineFilter, Wx as TimelineItem, Ib as Toast, Lb as ToastAction, Rb as ToastClose, Bb as ToastDescription, Nb as ToastProvider, zb as ToastTitle, Pb as ToastViewport, Vb as Toaster, Sm as Toggle, xh as Tooltip, Ch as TooltipContent, bh as TooltipProvider, Sh as TooltipTrigger, sn as alertVariants, an as badgeVariants, Ut as buttonVariants, W as cn, Ze as createOgImageUrl, vt as dismissAll, _t as toast, xm as toggleVariants, Ct as useAlternateLinks, kx as useAppShell, xt as useCanonical, Wb as useComboboxContext, ot as useMobile, st as useScrollNav, it as useTheme, Et as useThemeContext, yt as useToast };
|