@metaphor-cloud/ui 0.18.0 → 0.20.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 +15 -1
- package/dist/components/DataTable.d.ts.map +1 -1
- package/dist/components/Table.d.ts +2 -1
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/hooks/use-responsive-columns.d.ts +30 -0
- package/dist/hooks/use-responsive-columns.d.ts.map +1 -0
- package/dist/metaphor-ui.css +1 -1
- package/dist/metaphor-ui.js +195 -132
- 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 +2 -2
package/dist/metaphor-ui.js
CHANGED
|
@@ -9002,14 +9002,14 @@ function ky({ className: e, ref: t, ...n }) {
|
|
|
9002
9002
|
}
|
|
9003
9003
|
//#endregion
|
|
9004
9004
|
//#region src/components/Table.tsx
|
|
9005
|
-
function Ay({ className: e,
|
|
9005
|
+
function Ay({ className: e, containerClassName: t, ref: n, tableLayout: r, ...i }) {
|
|
9006
9006
|
return /* @__PURE__ */ l("div", {
|
|
9007
|
-
className: "relative w-full overflow-auto",
|
|
9007
|
+
className: W("relative w-full overflow-auto", t),
|
|
9008
9008
|
children: /* @__PURE__ */ l("table", {
|
|
9009
|
-
ref:
|
|
9009
|
+
ref: n,
|
|
9010
9010
|
className: W("w-full caption-bottom text-sm", e),
|
|
9011
|
-
style:
|
|
9012
|
-
...
|
|
9011
|
+
style: r ? { tableLayout: r } : void 0,
|
|
9012
|
+
...i
|
|
9013
9013
|
})
|
|
9014
9014
|
});
|
|
9015
9015
|
}
|
|
@@ -9438,9 +9438,9 @@ function Pb({ className: e, ref: t, ...n }) {
|
|
|
9438
9438
|
var Fb = Ht("group pointer-events-auto relative flex w-full items-center justify-between gap-4 overflow-hidden rounded-lg border p-4 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-slide-in-right data-[state=closed]:animate-fade-out", {
|
|
9439
9439
|
variants: { variant: {
|
|
9440
9440
|
default: "border-border bg-bg-elevated text-text-primary",
|
|
9441
|
-
success: "border-success-border bg-
|
|
9442
|
-
danger: "border-danger-border bg-
|
|
9443
|
-
warning: "border-warning-border bg-
|
|
9441
|
+
success: "border-success-border bg-bg-elevated bg-[linear-gradient(var(--green-glow),var(--green-glow))] text-success",
|
|
9442
|
+
danger: "border-danger-border bg-bg-elevated bg-[linear-gradient(var(--red-glow),var(--red-glow))] text-danger",
|
|
9443
|
+
warning: "border-warning-border bg-bg-elevated bg-[linear-gradient(var(--orange-glow),var(--orange-glow))] text-warning"
|
|
9444
9444
|
} },
|
|
9445
9445
|
defaultVariants: { variant: "default" }
|
|
9446
9446
|
});
|
|
@@ -10638,8 +10638,61 @@ function Ux({ columns: t, hasSelectionColumn: n, onColumnResize: r, tableRef: i
|
|
|
10638
10638
|
};
|
|
10639
10639
|
}
|
|
10640
10640
|
//#endregion
|
|
10641
|
+
//#region src/hooks/use-responsive-columns.ts
|
|
10642
|
+
var Wx = 80;
|
|
10643
|
+
function Gx(e) {
|
|
10644
|
+
if (e == null) return null;
|
|
10645
|
+
let t = e.match(/^(\d+(?:\.\d+)?)px$/);
|
|
10646
|
+
return t?.[1] == null ? null : parseFloat(t[1]);
|
|
10647
|
+
}
|
|
10648
|
+
function Kx(e) {
|
|
10649
|
+
return e.minWidth == null ? Gx(e.width) ?? Wx : e.minWidth;
|
|
10650
|
+
}
|
|
10651
|
+
function qx({ columns: t, containerRef: n, hasSelectionColumn: r = !1, selectionColumnWidth: i = 40 }) {
|
|
10652
|
+
let [a, o] = e.useState(null), s = e.useMemo(() => t.some((e) => e.priority != null && !e.hidden), [t]);
|
|
10653
|
+
return e.useLayoutEffect(() => {
|
|
10654
|
+
if (!s) {
|
|
10655
|
+
o(null);
|
|
10656
|
+
return;
|
|
10657
|
+
}
|
|
10658
|
+
let e = n.current;
|
|
10659
|
+
if (!e) return;
|
|
10660
|
+
if (typeof ResizeObserver > "u") {
|
|
10661
|
+
o(e.getBoundingClientRect().width);
|
|
10662
|
+
return;
|
|
10663
|
+
}
|
|
10664
|
+
let t = new ResizeObserver((e) => {
|
|
10665
|
+
let t = e[0];
|
|
10666
|
+
if (!t) return;
|
|
10667
|
+
let n = t.contentRect.width;
|
|
10668
|
+
o((e) => e === n ? e : n);
|
|
10669
|
+
});
|
|
10670
|
+
return t.observe(e), o(e.getBoundingClientRect().width), () => t.disconnect();
|
|
10671
|
+
}, [n, s]), {
|
|
10672
|
+
hiddenColumnIds: e.useMemo(() => {
|
|
10673
|
+
if (!s || a == null) return Jx;
|
|
10674
|
+
let e = t.filter((e) => !e.hidden), n = (r ? i : 0) + e.reduce((e, t) => e + Kx(t), 0);
|
|
10675
|
+
if (n <= a) return Jx;
|
|
10676
|
+
let o = e.filter((e) => e.priority != null).sort((e, t) => e.priority - t.priority), c = /* @__PURE__ */ new Set();
|
|
10677
|
+
for (let e of o) {
|
|
10678
|
+
if (n <= a) break;
|
|
10679
|
+
c.add(e.id), n -= Kx(e);
|
|
10680
|
+
}
|
|
10681
|
+
return c;
|
|
10682
|
+
}, [
|
|
10683
|
+
t,
|
|
10684
|
+
a,
|
|
10685
|
+
r,
|
|
10686
|
+
i,
|
|
10687
|
+
s
|
|
10688
|
+
]),
|
|
10689
|
+
containerWidth: a
|
|
10690
|
+
};
|
|
10691
|
+
}
|
|
10692
|
+
var Jx = /* @__PURE__ */ new Set();
|
|
10693
|
+
//#endregion
|
|
10641
10694
|
//#region src/components/DataTable.tsx
|
|
10642
|
-
function
|
|
10695
|
+
function Yx({ filled: e, className: t }) {
|
|
10643
10696
|
return /* @__PURE__ */ l("svg", {
|
|
10644
10697
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10645
10698
|
viewBox: "0 0 16 16",
|
|
@@ -10660,7 +10713,7 @@ function Wx({ filled: e, className: t }) {
|
|
|
10660
10713
|
})
|
|
10661
10714
|
});
|
|
10662
10715
|
}
|
|
10663
|
-
function
|
|
10716
|
+
function Xx({ column: t, data: n, value: r, onChange: i, onClear: a, onToggle: o }) {
|
|
10664
10717
|
let [s, c] = e.useState(!1), d = e.useMemo(() => {
|
|
10665
10718
|
if (t.filterOptions) return t.filterOptions;
|
|
10666
10719
|
if (!t.accessorKey) return null;
|
|
@@ -10689,7 +10742,7 @@ function Gx({ column: t, data: n, value: r, onChange: i, onClear: a, onToggle: o
|
|
|
10689
10742
|
},
|
|
10690
10743
|
className: W("ml-1 inline-flex items-center justify-center rounded p-0.5", "hover:bg-accent/20 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent", p ? "text-accent" : "text-text-secondary"),
|
|
10691
10744
|
"aria-label": `Filter ${typeof t.header == "string" ? t.header : t.id}`,
|
|
10692
|
-
children: /* @__PURE__ */ l(
|
|
10745
|
+
children: /* @__PURE__ */ l(Yx, { filled: p })
|
|
10693
10746
|
})
|
|
10694
10747
|
}), /* @__PURE__ */ u(cg, {
|
|
10695
10748
|
align: "start",
|
|
@@ -10726,74 +10779,80 @@ function Gx({ column: t, data: n, value: r, onChange: i, onClear: a, onToggle: o
|
|
|
10726
10779
|
})]
|
|
10727
10780
|
});
|
|
10728
10781
|
}
|
|
10729
|
-
function
|
|
10782
|
+
function Zx({ children: e, className: t, ...n }) {
|
|
10730
10783
|
return /* @__PURE__ */ l("div", {
|
|
10731
10784
|
className: W("flex items-center gap-2", t),
|
|
10732
10785
|
...n,
|
|
10733
10786
|
children: e
|
|
10734
10787
|
});
|
|
10735
10788
|
}
|
|
10736
|
-
|
|
10737
|
-
function
|
|
10789
|
+
Zx.displayName = "DataTableToolbar";
|
|
10790
|
+
function Qx({ children: e, className: t, ...n }) {
|
|
10738
10791
|
return /* @__PURE__ */ l("div", {
|
|
10739
10792
|
className: t,
|
|
10740
10793
|
...n,
|
|
10741
10794
|
children: e
|
|
10742
10795
|
});
|
|
10743
10796
|
}
|
|
10744
|
-
|
|
10745
|
-
function
|
|
10746
|
-
let [
|
|
10747
|
-
|
|
10797
|
+
Qx.displayName = "DataTableEmpty";
|
|
10798
|
+
function $x({ 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, fullHeight: S = !1, className: C, ref: w }) {
|
|
10799
|
+
let [T, E] = e.useState(s ?? null), [D, O] = e.useState(""), [k, A] = e.useState({}), [j, M] = e.useState(1), [N, P] = e.useState(/* @__PURE__ */ new Set()), F = e.useMemo(() => t.filter((e) => !e.hidden), [t]), I = e.useRef(null), ee = e.useCallback((e) => {
|
|
10800
|
+
I.current = e, typeof w == "function" ? w(e) : w && typeof w == "object" && (w.current = e);
|
|
10801
|
+
}, [w]), { hiddenColumnIds: te } = qx({
|
|
10802
|
+
columns: F,
|
|
10803
|
+
containerRef: I,
|
|
10804
|
+
hasSelectionColumn: y
|
|
10805
|
+
}), ne = e.useMemo(() => te.size === 0 ? F : F.filter((e) => !te.has(e.id)), [F, te]), re = e.useRef(null), L = ne.some((e) => e.resizable), { columnWidths: R, resizingColumnId: ie, startResize: ae } = Ux({
|
|
10806
|
+
columns: ne,
|
|
10748
10807
|
hasSelectionColumn: y,
|
|
10749
10808
|
onColumnResize: x,
|
|
10750
|
-
tableRef:
|
|
10751
|
-
}),
|
|
10809
|
+
tableRef: re
|
|
10810
|
+
}), z = e.useRef(o);
|
|
10752
10811
|
e.useLayoutEffect(() => {
|
|
10753
|
-
|
|
10812
|
+
z.current = o;
|
|
10754
10813
|
});
|
|
10755
|
-
let
|
|
10814
|
+
let oe = e.useRef(!1);
|
|
10756
10815
|
e.useEffect(() => {
|
|
10757
|
-
if (!
|
|
10758
|
-
|
|
10816
|
+
if (!oe.current) {
|
|
10817
|
+
oe.current = !0;
|
|
10759
10818
|
return;
|
|
10760
10819
|
}
|
|
10761
|
-
|
|
10762
|
-
sort:
|
|
10763
|
-
globalFilter:
|
|
10764
|
-
columnFilters:
|
|
10765
|
-
page:
|
|
10820
|
+
z.current?.({
|
|
10821
|
+
sort: T,
|
|
10822
|
+
globalFilter: D,
|
|
10823
|
+
columnFilters: k,
|
|
10824
|
+
page: j,
|
|
10766
10825
|
pageSize: p
|
|
10767
10826
|
});
|
|
10768
10827
|
}, [
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10828
|
+
T,
|
|
10829
|
+
D,
|
|
10830
|
+
k,
|
|
10831
|
+
j,
|
|
10773
10832
|
p
|
|
10774
10833
|
]);
|
|
10775
|
-
let
|
|
10776
|
-
|
|
10834
|
+
let B = e.useCallback((e) => {
|
|
10835
|
+
E((t) => !t || t.id !== e ? {
|
|
10777
10836
|
id: e,
|
|
10778
10837
|
desc: !1
|
|
10779
10838
|
} : {
|
|
10780
10839
|
id: e,
|
|
10781
10840
|
desc: !t.desc
|
|
10782
|
-
}),
|
|
10783
|
-
}, []),
|
|
10784
|
-
|
|
10785
|
-
}, []),
|
|
10786
|
-
|
|
10841
|
+
}), M(1);
|
|
10842
|
+
}, []), se = e.useCallback((e) => {
|
|
10843
|
+
O(e), M(1);
|
|
10844
|
+
}, []), ce = e.useCallback((e, t) => {
|
|
10845
|
+
A((n) => ({
|
|
10787
10846
|
...n,
|
|
10788
10847
|
[e]: t
|
|
10789
|
-
})),
|
|
10790
|
-
}, []),
|
|
10791
|
-
|
|
10848
|
+
})), M(1);
|
|
10849
|
+
}, []), le = e.useCallback((e) => {
|
|
10850
|
+
A((t) => {
|
|
10792
10851
|
let n = { ...t };
|
|
10793
10852
|
return delete n[e], n;
|
|
10794
|
-
}),
|
|
10795
|
-
}, []),
|
|
10796
|
-
|
|
10853
|
+
}), M(1);
|
|
10854
|
+
}, []), ue = e.useCallback((e, t) => {
|
|
10855
|
+
A((n) => {
|
|
10797
10856
|
let r = Array.isArray(n[e]) ? n[e] : [], i = r.includes(t) ? r.filter((e) => e !== t) : [...r, t];
|
|
10798
10857
|
if (i.length === 0) {
|
|
10799
10858
|
let { [e]: t, ...r } = n;
|
|
@@ -10803,11 +10862,11 @@ function Jx({ columns: t, data: n, children: r, loading: i, totalRows: a, onStat
|
|
|
10803
10862
|
...n,
|
|
10804
10863
|
[e]: i
|
|
10805
10864
|
};
|
|
10806
|
-
}),
|
|
10807
|
-
}, []),
|
|
10865
|
+
}), M(1);
|
|
10866
|
+
}, []), de = e.useMemo(() => {
|
|
10808
10867
|
let e = [...n];
|
|
10809
|
-
if (!f &&
|
|
10810
|
-
let n =
|
|
10868
|
+
if (!f && D) {
|
|
10869
|
+
let n = D.toLowerCase();
|
|
10811
10870
|
e = e.filter((e) => t.some((t) => {
|
|
10812
10871
|
if (!t.accessorKey) return !1;
|
|
10813
10872
|
let r = e[t.accessorKey];
|
|
@@ -10815,7 +10874,7 @@ function Jx({ columns: t, data: n, children: r, loading: i, totalRows: a, onStat
|
|
|
10815
10874
|
}));
|
|
10816
10875
|
}
|
|
10817
10876
|
if (!f) {
|
|
10818
|
-
let n = Object.entries(
|
|
10877
|
+
let n = Object.entries(k);
|
|
10819
10878
|
for (let [r, i] of n) {
|
|
10820
10879
|
let n = t.find((e) => e.id === r);
|
|
10821
10880
|
n && (e = e.filter((e) => {
|
|
@@ -10826,137 +10885,138 @@ function Jx({ columns: t, data: n, children: r, loading: i, totalRows: a, onStat
|
|
|
10826
10885
|
}));
|
|
10827
10886
|
}
|
|
10828
10887
|
}
|
|
10829
|
-
if (!c &&
|
|
10830
|
-
let n = t.find((e) => e.id ===
|
|
10888
|
+
if (!c && T) {
|
|
10889
|
+
let n = t.find((e) => e.id === T.id);
|
|
10831
10890
|
n && e.sort((e, t) => {
|
|
10832
10891
|
let r;
|
|
10833
|
-
return r = n.sortFn ? n.sortFn(e, t) : n.accessorKey ? String(e[n.accessorKey] ?? "").localeCompare(String(t[n.accessorKey] ?? "")) : 0,
|
|
10892
|
+
return r = n.sortFn ? n.sortFn(e, t) : n.accessorKey ? String(e[n.accessorKey] ?? "").localeCompare(String(t[n.accessorKey] ?? "")) : 0, T.desc ? -r : r;
|
|
10834
10893
|
});
|
|
10835
10894
|
}
|
|
10836
10895
|
return e;
|
|
10837
10896
|
}, [
|
|
10838
10897
|
n,
|
|
10839
10898
|
t,
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10899
|
+
T,
|
|
10900
|
+
D,
|
|
10901
|
+
k,
|
|
10843
10902
|
c,
|
|
10844
10903
|
f
|
|
10845
|
-
]),
|
|
10846
|
-
if (p <= 0 || m) return
|
|
10847
|
-
let e = (
|
|
10848
|
-
return
|
|
10904
|
+
]), fe = m ? a ?? n.length : de.length, pe = p > 0 ? Math.max(1, Math.ceil(fe / p)) : 1, me = e.useMemo(() => {
|
|
10905
|
+
if (p <= 0 || m) return de;
|
|
10906
|
+
let e = (j - 1) * p;
|
|
10907
|
+
return de.slice(e, e + p);
|
|
10849
10908
|
}, [
|
|
10850
|
-
|
|
10851
|
-
|
|
10909
|
+
de,
|
|
10910
|
+
j,
|
|
10852
10911
|
p,
|
|
10853
10912
|
m
|
|
10854
|
-
]),
|
|
10855
|
-
|
|
10856
|
-
}, []),
|
|
10857
|
-
let t =
|
|
10858
|
-
|
|
10913
|
+
]), he = e.useCallback((e) => {
|
|
10914
|
+
M(e);
|
|
10915
|
+
}, []), V = e.useCallback((e) => v ? v(e) : String(e.id ?? ""), [v]), ge = e.useCallback((e) => {
|
|
10916
|
+
let t = V(e);
|
|
10917
|
+
P((e) => {
|
|
10859
10918
|
let r = new Set(e);
|
|
10860
10919
|
r.has(t) ? r.delete(t) : r.add(t);
|
|
10861
|
-
let i = n.filter((e) => r.has(
|
|
10920
|
+
let i = n.filter((e) => r.has(V(e)));
|
|
10862
10921
|
return b?.(i), r;
|
|
10863
10922
|
});
|
|
10864
10923
|
}, [
|
|
10865
10924
|
n,
|
|
10866
|
-
|
|
10925
|
+
V,
|
|
10867
10926
|
b
|
|
10868
|
-
]),
|
|
10869
|
-
|
|
10870
|
-
if (e.size ===
|
|
10871
|
-
let t = new Set(
|
|
10872
|
-
return b?.(
|
|
10927
|
+
]), _e = e.useCallback(() => {
|
|
10928
|
+
P((e) => {
|
|
10929
|
+
if (e.size === me.length) return b?.([]), /* @__PURE__ */ new Set();
|
|
10930
|
+
let t = new Set(me.map((e) => V(e)));
|
|
10931
|
+
return b?.(me), t;
|
|
10873
10932
|
});
|
|
10874
10933
|
}, [
|
|
10875
|
-
|
|
10876
|
-
|
|
10934
|
+
me,
|
|
10935
|
+
V,
|
|
10877
10936
|
b
|
|
10878
|
-
]),
|
|
10937
|
+
]), ve = e.useCallback((e) => N.has(V(e)), [N, V]), ye = null, be = null;
|
|
10879
10938
|
e.Children.forEach(r, (t) => {
|
|
10880
|
-
e.isValidElement(t) && (t.type?.displayName === "DataTableToolbar" ?
|
|
10939
|
+
e.isValidElement(t) && (t.type?.displayName === "DataTableToolbar" ? ye = t : t.type?.displayName === "DataTableEmpty" && (be = t));
|
|
10881
10940
|
});
|
|
10882
|
-
let
|
|
10941
|
+
let xe = (e) => !T || T.id !== e ? "↕" : T.desc ? "↓" : "↑", Se = me.length === 0 && !i;
|
|
10883
10942
|
return /* @__PURE__ */ u("div", {
|
|
10884
|
-
ref:
|
|
10885
|
-
className: W("space-y-4",
|
|
10943
|
+
ref: ee,
|
|
10944
|
+
className: W(S ? "flex h-full min-h-0 flex-col gap-4" : "space-y-4", C),
|
|
10886
10945
|
children: [
|
|
10887
|
-
(d ||
|
|
10888
|
-
className: "flex items-center gap-4",
|
|
10946
|
+
(d || ye) && /* @__PURE__ */ u("div", {
|
|
10947
|
+
className: "flex shrink-0 items-center gap-4",
|
|
10889
10948
|
children: [d && /* @__PURE__ */ l(Zt, {
|
|
10890
10949
|
placeholder: "Search...",
|
|
10891
|
-
value:
|
|
10892
|
-
onChange: (e) =>
|
|
10950
|
+
value: D,
|
|
10951
|
+
onChange: (e) => se(e.target.value),
|
|
10893
10952
|
className: "max-w-sm"
|
|
10894
10953
|
}), /* @__PURE__ */ l("div", {
|
|
10895
10954
|
className: "ml-auto flex items-center gap-2",
|
|
10896
|
-
children:
|
|
10955
|
+
children: ye
|
|
10897
10956
|
})]
|
|
10898
10957
|
}),
|
|
10899
10958
|
/* @__PURE__ */ u(Ay, {
|
|
10900
|
-
tableLayout:
|
|
10901
|
-
ref:
|
|
10959
|
+
tableLayout: L ? "fixed" : void 0,
|
|
10960
|
+
ref: re,
|
|
10961
|
+
containerClassName: S ? "flex-1 min-h-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10 [&_thead_th]:bg-bg-card" : void 0,
|
|
10902
10962
|
children: [
|
|
10903
|
-
|
|
10904
|
-
let t =
|
|
10963
|
+
L && /* @__PURE__ */ u("colgroup", { children: [y && /* @__PURE__ */ l("col", { style: { width: 40 } }), ne.map((e) => {
|
|
10964
|
+
let t = R.get(e.id);
|
|
10905
10965
|
return /* @__PURE__ */ l("col", { style: t == null ? void 0 : { width: t } }, e.id);
|
|
10906
10966
|
})] }),
|
|
10907
10967
|
/* @__PURE__ */ l(jy, { children: /* @__PURE__ */ u(Py, { children: [y && /* @__PURE__ */ l(Fy, {
|
|
10908
10968
|
className: "w-10",
|
|
10909
10969
|
children: /* @__PURE__ */ l(Op, {
|
|
10910
|
-
checked:
|
|
10911
|
-
onCheckedChange:
|
|
10970
|
+
checked: me.length > 0 && N.size === me.length,
|
|
10971
|
+
onCheckedChange: _e,
|
|
10912
10972
|
"aria-label": "Select all"
|
|
10913
10973
|
})
|
|
10914
|
-
}),
|
|
10915
|
-
className: W(e.sortable && "cursor-pointer select-none",
|
|
10916
|
-
style: !
|
|
10917
|
-
onClick: e.sortable ? () =>
|
|
10974
|
+
}), ne.map((e) => /* @__PURE__ */ u(Fy, {
|
|
10975
|
+
className: W(e.sortable && "cursor-pointer select-none", L && "relative", e.className),
|
|
10976
|
+
style: !L && e.width ? { width: e.width } : void 0,
|
|
10977
|
+
onClick: e.sortable ? () => B(e.id) : void 0,
|
|
10918
10978
|
children: [/* @__PURE__ */ u("span", {
|
|
10919
10979
|
className: "inline-flex items-center",
|
|
10920
10980
|
children: [
|
|
10921
|
-
typeof e.header == "function" ? e.header(
|
|
10981
|
+
typeof e.header == "function" ? e.header(T?.id === e.id ? T : null) : /* @__PURE__ */ l("span", { children: e.header }),
|
|
10922
10982
|
e.sortable && typeof e.header != "function" && /* @__PURE__ */ l("span", {
|
|
10923
10983
|
"aria-hidden": !0,
|
|
10924
10984
|
className: "ml-1",
|
|
10925
|
-
children:
|
|
10985
|
+
children: xe(e.id)
|
|
10926
10986
|
}),
|
|
10927
|
-
e.filterable && /* @__PURE__ */ l(
|
|
10987
|
+
e.filterable && /* @__PURE__ */ l(Xx, {
|
|
10928
10988
|
column: e,
|
|
10929
10989
|
data: n,
|
|
10930
|
-
value:
|
|
10931
|
-
onChange:
|
|
10932
|
-
onClear:
|
|
10933
|
-
onToggle:
|
|
10990
|
+
value: k[e.id],
|
|
10991
|
+
onChange: ce,
|
|
10992
|
+
onClear: le,
|
|
10993
|
+
onToggle: ue
|
|
10934
10994
|
})
|
|
10935
10995
|
]
|
|
10936
10996
|
}), e.resizable && /* @__PURE__ */ l("div", {
|
|
10937
10997
|
role: "separator",
|
|
10938
10998
|
"aria-orientation": "vertical",
|
|
10939
10999
|
onMouseDown: (t) => {
|
|
10940
|
-
t.preventDefault(), t.stopPropagation(),
|
|
11000
|
+
t.preventDefault(), t.stopPropagation(), ae(e.id, t);
|
|
10941
11001
|
},
|
|
10942
|
-
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",
|
|
11002
|
+
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", ie === e.id ? "after:bg-accent" : "after:bg-transparent hover:after:bg-accent/20", "after:transition-colors")
|
|
10943
11003
|
})]
|
|
10944
11004
|
}, e.id))] }) }),
|
|
10945
|
-
/* @__PURE__ */ l(My, { children:
|
|
10946
|
-
colSpan:
|
|
11005
|
+
/* @__PURE__ */ l(My, { children: Se ? /* @__PURE__ */ l(Py, { children: /* @__PURE__ */ l(Iy, {
|
|
11006
|
+
colSpan: ne.length + +!!y,
|
|
10947
11007
|
className: "h-24",
|
|
10948
|
-
children:
|
|
10949
|
-
}) }) :
|
|
10950
|
-
let n = m ? t : (
|
|
11008
|
+
children: be ?? /* @__PURE__ */ l(Ax, { title: "No results" })
|
|
11009
|
+
}) }) : me.map((e, t) => {
|
|
11010
|
+
let n = m ? t : (j - 1) * p + t, r = g?.(e), i = y && /* @__PURE__ */ l(Iy, {
|
|
10951
11011
|
className: "w-10",
|
|
10952
11012
|
onClick: (e) => e.stopPropagation(),
|
|
10953
11013
|
children: /* @__PURE__ */ l(Op, {
|
|
10954
|
-
checked:
|
|
10955
|
-
onCheckedChange: () =>
|
|
11014
|
+
checked: ve(e),
|
|
11015
|
+
onCheckedChange: () => ge(e),
|
|
10956
11016
|
"aria-label": "Select row"
|
|
10957
11017
|
})
|
|
10958
|
-
}), a =
|
|
10959
|
-
className: W(t.className,
|
|
11018
|
+
}), a = ne.map((t) => /* @__PURE__ */ l(Iy, {
|
|
11019
|
+
className: W(t.className, L && "overflow-hidden text-ellipsis"),
|
|
10960
11020
|
children: r ? /* @__PURE__ */ l("a", {
|
|
10961
11021
|
href: r.href,
|
|
10962
11022
|
className: "contents",
|
|
@@ -10966,25 +11026,28 @@ function Jx({ columns: t, data: n, children: r, loading: i, totalRows: a, onStat
|
|
|
10966
11026
|
return /* @__PURE__ */ u(Py, {
|
|
10967
11027
|
className: W((h || r) && "cursor-pointer", _?.(e, n)),
|
|
10968
11028
|
onClick: h ? () => h(e, n) : void 0,
|
|
10969
|
-
"data-state":
|
|
11029
|
+
"data-state": ve(e) ? "selected" : void 0,
|
|
10970
11030
|
children: [i, a]
|
|
10971
11031
|
}, v ? v(e) : t);
|
|
10972
11032
|
}) })
|
|
10973
11033
|
]
|
|
10974
11034
|
}),
|
|
10975
|
-
p > 0 &&
|
|
10976
|
-
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
11035
|
+
p > 0 && pe > 1 && /* @__PURE__ */ l("div", {
|
|
11036
|
+
className: S ? "shrink-0" : void 0,
|
|
11037
|
+
children: /* @__PURE__ */ l(jx, {
|
|
11038
|
+
page: j,
|
|
11039
|
+
pageSize: p,
|
|
11040
|
+
totalItems: fe,
|
|
11041
|
+
totalPages: pe,
|
|
11042
|
+
onPageChange: he
|
|
11043
|
+
})
|
|
10981
11044
|
})
|
|
10982
11045
|
]
|
|
10983
11046
|
});
|
|
10984
11047
|
}
|
|
10985
11048
|
//#endregion
|
|
10986
11049
|
//#region src/components/Timeline.tsx
|
|
10987
|
-
function
|
|
11050
|
+
function eS({ className: e, children: t, ref: n, ...r }) {
|
|
10988
11051
|
return /* @__PURE__ */ l("div", {
|
|
10989
11052
|
ref: n,
|
|
10990
11053
|
className: W("relative space-y-0", e),
|
|
@@ -10992,20 +11055,20 @@ function Yx({ className: e, children: t, ref: n, ...r }) {
|
|
|
10992
11055
|
children: t
|
|
10993
11056
|
});
|
|
10994
11057
|
}
|
|
10995
|
-
var
|
|
11058
|
+
var tS = e.createContext({
|
|
10996
11059
|
expanded: !1,
|
|
10997
11060
|
setExpanded: () => {},
|
|
10998
11061
|
expandable: !1
|
|
10999
|
-
}),
|
|
11062
|
+
}), nS = {
|
|
11000
11063
|
default: "border-border bg-bg-elevated",
|
|
11001
11064
|
success: "border-green bg-green text-white",
|
|
11002
11065
|
danger: "border-red bg-red text-white",
|
|
11003
11066
|
warning: "border-orange bg-orange text-white",
|
|
11004
11067
|
info: "border-accent bg-accent text-white"
|
|
11005
11068
|
};
|
|
11006
|
-
function
|
|
11069
|
+
function rS({ className: t, children: n, icon: r, variant: i = "default", timestamp: a, expandable: o = !1, defaultExpanded: s = !1, ref: c, ...d }) {
|
|
11007
11070
|
let [f, p] = e.useState(s);
|
|
11008
|
-
return /* @__PURE__ */ l(
|
|
11071
|
+
return /* @__PURE__ */ l(tS.Provider, {
|
|
11009
11072
|
value: {
|
|
11010
11073
|
expanded: f,
|
|
11011
11074
|
setExpanded: p,
|
|
@@ -11019,7 +11082,7 @@ function Qx({ className: t, children: n, icon: r, variant: i = "default", timest
|
|
|
11019
11082
|
/* @__PURE__ */ l("div", { className: "absolute left-[0.6875rem] top-6 bottom-0 w-px bg-border last-of-type:hidden" }),
|
|
11020
11083
|
/* @__PURE__ */ l("div", {
|
|
11021
11084
|
"data-timeline-marker": "",
|
|
11022
|
-
className: W("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full border-2",
|
|
11085
|
+
className: W("relative z-10 flex h-6 w-6 shrink-0 items-center justify-center rounded-full border-2", nS[i]),
|
|
11023
11086
|
children: r && /* @__PURE__ */ l("span", {
|
|
11024
11087
|
className: "h-3.5 w-3.5 [&>svg]:h-3.5 [&>svg]:w-3.5",
|
|
11025
11088
|
children: r
|
|
@@ -11036,8 +11099,8 @@ function Qx({ className: t, children: n, icon: r, variant: i = "default", timest
|
|
|
11036
11099
|
})
|
|
11037
11100
|
});
|
|
11038
11101
|
}
|
|
11039
|
-
function
|
|
11040
|
-
let { expanded: p, setExpanded: m, expandable: h } = e.useContext(
|
|
11102
|
+
function iS({ className: t, title: n, description: r, detail: i, actions: a, onClick: o, renderLink: s, ref: d, ...f }) {
|
|
11103
|
+
let { expanded: p, setExpanded: m, expandable: h } = e.useContext(tS), g = /* @__PURE__ */ l("span", {
|
|
11041
11104
|
className: W("text-sm font-medium text-text-primary", o && "cursor-pointer hover:underline"),
|
|
11042
11105
|
onClick: o,
|
|
11043
11106
|
children: n
|
|
@@ -11070,7 +11133,7 @@ function $x({ className: t, title: n, description: r, detail: i, actions: a, onC
|
|
|
11070
11133
|
})] })]
|
|
11071
11134
|
});
|
|
11072
11135
|
}
|
|
11073
|
-
function
|
|
11136
|
+
function aS({ className: e, filters: t, value: n, onChange: r, ref: i, ...a }) {
|
|
11074
11137
|
let o = (e) => {
|
|
11075
11138
|
n.includes(e) ? r(n.filter((t) => t !== e)) : r([...n, e]);
|
|
11076
11139
|
};
|
|
@@ -11087,4 +11150,4 @@ function eS({ className: e, filters: t, value: n, onChange: r, ref: i, ...a }) {
|
|
|
11087
11150
|
});
|
|
11088
11151
|
}
|
|
11089
11152
|
//#endregion
|
|
11090
|
-
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, rx as AnimatedCounter, Ix as AppShell, Bx as AppShellFooter, zx as AppShellMain, Rx as AppShellNav, Lx as AppShellSidebar, on as Badge, yx 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, Zb as Combobox, ex as ComboboxContent, nx as ComboboxEmpty, $b as ComboboxInput, tx as ComboboxItem, Qb as ComboboxTrigger,
|
|
11153
|
+
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, rx as AnimatedCounter, Ix as AppShell, Bx as AppShellFooter, zx as AppShellMain, Rx as AppShellNav, Lx as AppShellSidebar, on as Badge, yx 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, Zb as Combobox, ex as ComboboxContent, nx as ComboboxEmpty, $b as ComboboxInput, tx as ComboboxItem, Qb as ComboboxTrigger, $x as DataTable, Qx as DataTableEmpty, Zx 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, Ax as EmptyState, Zt as Input, rn as Label, mx as MetaHead, dx as Nav, kx as PageHeader, jx 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, Cx as Sidebar, Tx as SidebarContent, Ex as SidebarFooter, Dx as SidebarGroup, wx as SidebarHeader, Ox as SidebarItem, ky as Skeleton, Nx as StatCard, gx 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, eS as Timeline, iS as TimelineContent, aS as TimelineFilter, rS 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, Kb as Video, sn as alertVariants, an as badgeVariants, Ut as buttonVariants, qb as cloudflareStreamHls, Jb as cloudflareStreamMp4, W as cn, Ze as createOgImageUrl, vt as dismissAll, _t as toast, xm as toggleVariants, Ct as useAlternateLinks, Fx as useAppShell, xt as useCanonical, Xb as useComboboxContext, ot as useMobile, st as useScrollNav, it as useTheme, Et as useThemeContext, yt as useToast };
|