@lincyaw/aegis-ui 0.7.0 → 0.8.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/ui/ChartLegend.cjs +2 -0
- package/dist/components/ui/ChartLegend.cjs.map +1 -0
- package/dist/components/ui/ChartLegend.d.ts +15 -0
- package/dist/components/ui/ChartLegend.js +36 -0
- package/dist/components/ui/ChartLegend.js.map +1 -0
- package/dist/components/ui/DataTable.cjs +1 -1
- package/dist/components/ui/DataTable.cjs.map +1 -1
- package/dist/components/ui/DataTable.d.ts +25 -1
- package/dist/components/ui/DataTable.js +305 -231
- package/dist/components/ui/DataTable.js.map +1 -1
- package/dist/components/ui/ParetoChart.cjs +1 -1
- package/dist/components/ui/ParetoChart.cjs.map +1 -1
- package/dist/components/ui/ParetoChart.d.ts +11 -4
- package/dist/components/ui/ParetoChart.js +150 -136
- package/dist/components/ui/ParetoChart.js.map +1 -1
- package/dist/components/ui/RankBar.cjs +1 -1
- package/dist/components/ui/RankBar.cjs.map +1 -1
- package/dist/components/ui/RankBar.d.ts +17 -2
- package/dist/components/ui/RankBar.js +46 -31
- package/dist/components/ui/RankBar.js.map +1 -1
- package/dist/components/ui/ReplayScrubber.cjs +2 -0
- package/dist/components/ui/ReplayScrubber.cjs.map +1 -0
- package/dist/components/ui/ReplayScrubber.d.ts +35 -0
- package/dist/components/ui/ReplayScrubber.js +119 -0
- package/dist/components/ui/ReplayScrubber.js.map +1 -0
- package/dist/components/ui/ReplayStepStrip.cjs +2 -0
- package/dist/components/ui/ReplayStepStrip.cjs.map +1 -0
- package/dist/components/ui/ReplayStepStrip.d.ts +33 -0
- package/dist/components/ui/ReplayStepStrip.js +119 -0
- package/dist/components/ui/ReplayStepStrip.js.map +1 -0
- package/dist/components/ui/ReplayTransport.cjs +2 -0
- package/dist/components/ui/ReplayTransport.cjs.map +1 -0
- package/dist/components/ui/ReplayTransport.d.ts +25 -0
- package/dist/components/ui/ReplayTransport.js +103 -0
- package/dist/components/ui/ReplayTransport.js.map +1 -0
- package/dist/components/ui/StackedBar.cjs +1 -1
- package/dist/components/ui/StackedBar.cjs.map +1 -1
- package/dist/components/ui/StackedBar.d.ts +9 -8
- package/dist/components/ui/StackedBar.js +69 -54
- package/dist/components/ui/StackedBar.js.map +1 -1
- package/dist/components/ui/TimelineChart.cjs +1 -1
- package/dist/components/ui/TimelineChart.cjs.map +1 -1
- package/dist/components/ui/TimelineChart.d.ts +12 -15
- package/dist/components/ui/TimelineChart.js +160 -150
- package/dist/components/ui/TimelineChart.js.map +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs.map +1 -1
- package/dist/components/ui/TraceSpanInspector.js +25 -25
- package/dist/components/ui/TraceSpanInspector.js.map +1 -1
- package/dist/components/ui/TraceTree.cjs +1 -1
- package/dist/components/ui/TraceTree.cjs.map +1 -1
- package/dist/components/ui/TraceTree.d.ts +13 -2
- package/dist/components/ui/TraceTree.js +22 -22
- package/dist/components/ui/TraceTree.js.map +1 -1
- package/dist/components/ui/index.d.ts +11 -5
- package/dist/components/ui/traceFormat.cjs +1 -1
- package/dist/components/ui/traceFormat.cjs.map +1 -1
- package/dist/components/ui/traceFormat.d.ts +0 -2
- package/dist/components/ui/traceFormat.js +2 -6
- package/dist/components/ui/traceFormat.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useReplayPlayback.cjs +2 -0
- package/dist/hooks/useReplayPlayback.cjs.map +1 -0
- package/dist/hooks/useReplayPlayback.d.ts +44 -0
- package/dist/hooks/useReplayPlayback.js +73 -0
- package/dist/hooks/useReplayPlayback.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +312 -300
- package/dist/index.js.map +1 -1
- package/dist/layouts/SkipLink.cjs +2 -0
- package/dist/layouts/SkipLink.cjs.map +1 -0
- package/dist/layouts/SkipLink.d.ts +13 -0
- package/dist/layouts/SkipLink.js +21 -0
- package/dist/layouts/SkipLink.js.map +1 -0
- package/dist/layouts/shell/AegisShell.cjs +1 -1
- package/dist/layouts/shell/AegisShell.cjs.map +1 -1
- package/dist/layouts/shell/AegisShell.js +174 -193
- package/dist/layouts/shell/AegisShell.js.map +1 -1
- package/dist/layouts/site/SiteLayout.cjs +1 -1
- package/dist/layouts/site/SiteLayout.cjs.map +1 -1
- package/dist/layouts/site/SiteLayout.js +18 -28
- package/dist/layouts/site/SiteLayout.js.map +1 -1
- package/dist/layouts/site/SiteNav.cjs +1 -1
- package/dist/layouts/site/SiteNav.cjs.map +1 -1
- package/dist/layouts/site/SiteNav.js +50 -48
- package/dist/layouts/site/SiteNav.js.map +1 -1
- package/dist/lib/chart.cjs +2 -0
- package/dist/lib/chart.cjs.map +1 -0
- package/dist/lib/chart.d.ts +33 -0
- package/dist/lib/chart.js +47 -0
- package/dist/lib/chart.js.map +1 -0
- package/dist/locale/strings.cjs +1 -1
- package/dist/locale/strings.cjs.map +1 -1
- package/dist/locale/strings.d.ts +9 -8
- package/dist/locale/strings.js +36 -34
- package/dist/locale/strings.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/components/ui/SessionRunView.cjs +0 -4
- package/dist/components/ui/SessionRunView.cjs.map +0 -1
- package/dist/components/ui/SessionRunView.d.ts +0 -50
- package/dist/components/ui/SessionRunView.js +0 -379
- package/dist/components/ui/SessionRunView.js.map +0 -1
|
@@ -1,194 +1,249 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { RightOutlined as
|
|
4
|
-
import { usePrimitiveSurface as
|
|
5
|
-
import { useIsomorphicLayoutEffect as
|
|
6
|
-
import { useMediaQuery as
|
|
7
|
-
import { readStorage as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { Checkbox as
|
|
1
|
+
import { jsxs as c, jsx as a, Fragment as at } from "react/jsx-runtime";
|
|
2
|
+
import { useId as nt, useState as $, useMemo as M, useRef as _e, useEffect as st, useCallback as it, Fragment as lt } from "react";
|
|
3
|
+
import { RightOutlined as X, LeftOutlined as ot } from "@ant-design/icons";
|
|
4
|
+
import { usePrimitiveSurface as rt } from "../../agent/core/usePrimitiveSurface.js";
|
|
5
|
+
import { useIsomorphicLayoutEffect as dt } from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
6
|
+
import { useMediaQuery as ct } from "../../hooks/useMediaQuery.js";
|
|
7
|
+
import { readStorage as gt, writeStorage as _t } from "../../lib/storage.js";
|
|
8
|
+
import { Button as ue } from "./Button.js";
|
|
9
|
+
import { Checkbox as he } from "./Checkbox.js";
|
|
10
10
|
/* empty css */
|
|
11
|
-
import { EmptyState as
|
|
12
|
-
import { PageSizeSelect as
|
|
13
|
-
import { SkeletonText as
|
|
14
|
-
import { useStrings as
|
|
15
|
-
const
|
|
16
|
-
function
|
|
11
|
+
import { EmptyState as ut } from "./EmptyState.js";
|
|
12
|
+
import { PageSizeSelect as ht } from "./PageSizeSelect.js";
|
|
13
|
+
import { SkeletonText as mt, Skeleton as bt } from "./Skeleton.js";
|
|
14
|
+
import { useStrings as fe } from "../../locale/useStrings.js";
|
|
15
|
+
const ft = 60, pt = 120, O = 44, V = 32, me = 40, vt = "(max-width: 768px)", yt = 'a, button, input, select, textarea, label, [role="button"], [role="link"], [role="checkbox"]';
|
|
16
|
+
function Nt(s) {
|
|
17
17
|
if (window.getSelection()?.type === "Range")
|
|
18
18
|
return !0;
|
|
19
|
-
const
|
|
20
|
-
if (!(
|
|
19
|
+
const o = s.target;
|
|
20
|
+
if (!(o instanceof Element))
|
|
21
21
|
return !1;
|
|
22
|
-
const
|
|
23
|
-
return
|
|
22
|
+
const g = o.closest(yt);
|
|
23
|
+
return g !== null && s.currentTarget.contains(g);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function wt(s, o, g) {
|
|
26
|
+
const f = o?.sortValue;
|
|
27
|
+
if (!f)
|
|
28
|
+
return s;
|
|
29
|
+
const v = g === "asc" ? 1 : -1;
|
|
30
|
+
return s.map((i, l) => {
|
|
31
|
+
const u = f(i);
|
|
32
|
+
return { row: i, index: l, v: typeof u == "number" && isNaN(u) ? null : u };
|
|
33
|
+
}).sort((i, l) => {
|
|
34
|
+
if (i.v === null || l.v === null)
|
|
35
|
+
return i.v === l.v ? i.index - l.index : i.v === null ? 1 : -1;
|
|
36
|
+
const u = typeof i.v == "number" && typeof l.v == "number" ? i.v - l.v : String(i.v).localeCompare(String(l.v));
|
|
37
|
+
return u === 0 ? i.index - l.index : u * v;
|
|
38
|
+
}).map((i) => i.row);
|
|
39
|
+
}
|
|
40
|
+
function kt({
|
|
41
|
+
direction: s
|
|
42
|
+
}) {
|
|
43
|
+
return /* @__PURE__ */ c(
|
|
44
|
+
"svg",
|
|
45
|
+
{
|
|
46
|
+
className: "aegis-data-table__sort-icon",
|
|
47
|
+
viewBox: "0 0 12 12",
|
|
48
|
+
"aria-hidden": "true",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ a(
|
|
51
|
+
"path",
|
|
52
|
+
{
|
|
53
|
+
className: s === "asc" ? "aegis-data-table__sort-mark--on" : void 0,
|
|
54
|
+
d: "M3.5 5L6 2.5 8.5 5"
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ a(
|
|
58
|
+
"path",
|
|
59
|
+
{
|
|
60
|
+
className: s === "desc" ? "aegis-data-table__sort-mark--on" : void 0,
|
|
61
|
+
d: "M3.5 7L6 9.5 8.5 7"
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function St(s) {
|
|
26
69
|
if (s !== void 0)
|
|
27
70
|
return typeof s == "number" ? `${s}px` : s;
|
|
28
71
|
}
|
|
29
|
-
function
|
|
72
|
+
function q(s) {
|
|
30
73
|
return `aegis-data-table:${s}`;
|
|
31
74
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
75
|
+
function be(s) {
|
|
76
|
+
const o = gt(q(s));
|
|
77
|
+
if (!o)
|
|
35
78
|
return {};
|
|
36
79
|
try {
|
|
37
|
-
const
|
|
38
|
-
return
|
|
80
|
+
const g = JSON.parse(o);
|
|
81
|
+
return g && typeof g == "object" ? g : {};
|
|
39
82
|
} catch {
|
|
40
83
|
return {};
|
|
41
84
|
}
|
|
42
85
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
86
|
+
function Ct(s, o) {
|
|
87
|
+
_t(q(s), JSON.stringify(o));
|
|
45
88
|
}
|
|
46
|
-
function
|
|
89
|
+
function Bt({
|
|
47
90
|
columns: s,
|
|
48
|
-
data:
|
|
49
|
-
rowKey:
|
|
50
|
-
loading:
|
|
51
|
-
emptyTitle:
|
|
52
|
-
emptyDescription:
|
|
53
|
-
emptyAction:
|
|
54
|
-
className:
|
|
55
|
-
framed:
|
|
56
|
-
persistKey:
|
|
57
|
-
pagination:
|
|
58
|
-
selectable:
|
|
59
|
-
selectedKeys:
|
|
60
|
-
onSelectedKeysChange:
|
|
61
|
-
renderExpanded:
|
|
62
|
-
expandedKeys:
|
|
63
|
-
defaultExpandedKeys:
|
|
64
|
-
onExpandedKeysChange:
|
|
65
|
-
renderMobileCard:
|
|
66
|
-
onRowClick:
|
|
67
|
-
stickyFirstColumn:
|
|
68
|
-
stale:
|
|
69
|
-
|
|
91
|
+
data: o,
|
|
92
|
+
rowKey: g,
|
|
93
|
+
loading: f = !1,
|
|
94
|
+
emptyTitle: v = "No data",
|
|
95
|
+
emptyDescription: i,
|
|
96
|
+
emptyAction: l,
|
|
97
|
+
className: u,
|
|
98
|
+
framed: L = !0,
|
|
99
|
+
persistKey: _,
|
|
100
|
+
pagination: C,
|
|
101
|
+
selectable: h = !1,
|
|
102
|
+
selectedKeys: W,
|
|
103
|
+
onSelectedKeysChange: G,
|
|
104
|
+
renderExpanded: J,
|
|
105
|
+
expandedKeys: Q,
|
|
106
|
+
defaultExpandedKeys: pe,
|
|
107
|
+
onExpandedKeysChange: ve,
|
|
108
|
+
renderMobileCard: Y,
|
|
109
|
+
onRowClick: D,
|
|
110
|
+
stickyFirstColumn: ye = !1,
|
|
111
|
+
stale: Z = !1,
|
|
112
|
+
sort: I,
|
|
113
|
+
defaultSort: Ne,
|
|
114
|
+
onSortChange: we,
|
|
115
|
+
surface: ke
|
|
70
116
|
}) {
|
|
71
|
-
const E =
|
|
72
|
-
|
|
73
|
-
|
|
117
|
+
const E = fe(), Se = ct(vt), Ce = nt(), y = Y !== void 0 && Se, [xe, Le] = $(Ne ?? null), p = I === void 0 ? xe : I, K = s.find((e) => e.key === p?.key), P = M(
|
|
118
|
+
() => wt(o, K, p?.direction ?? "asc"),
|
|
119
|
+
[o, K, p?.direction]
|
|
120
|
+
), Ee = (e) => {
|
|
121
|
+
const t = e.firstSortDirection ?? (e.numeric ? "desc" : "asc"), n = {
|
|
122
|
+
key: e.key,
|
|
123
|
+
direction: p?.key === e.key ? p.direction === "asc" ? "desc" : "asc" : t
|
|
124
|
+
};
|
|
125
|
+
I === void 0 && Le(n), we?.(n);
|
|
126
|
+
}, x = W ?? [], k = P.map((e, t) => g(e, t)), j = k.filter((e) => x.includes(e)).length, Re = (e, t) => {
|
|
127
|
+
G?.(
|
|
128
|
+
t ? [...x, e] : x.filter((n) => n !== e)
|
|
74
129
|
);
|
|
75
|
-
},
|
|
76
|
-
const t =
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
130
|
+
}, Te = (e) => {
|
|
131
|
+
const t = x.filter((n) => !k.includes(n));
|
|
132
|
+
G?.(e ? [...t, ...k] : t);
|
|
133
|
+
}, $e = (e, t) => /* @__PURE__ */ a(
|
|
134
|
+
he,
|
|
80
135
|
{
|
|
81
136
|
checked: e,
|
|
82
137
|
onChange: t,
|
|
83
138
|
ariaLabel: E.selectRow
|
|
84
139
|
}
|
|
85
|
-
), [
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
const t =
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
() =>
|
|
140
|
+
), [Me, Oe] = $(pe ?? []), w = Q ?? Me, [z, We] = $(w), ee = w.filter((e) => !z.includes(e));
|
|
141
|
+
ee.length > 0 && We([...z, ...ee]);
|
|
142
|
+
const De = (e) => {
|
|
143
|
+
const t = w.includes(e) ? w.filter((n) => n !== e) : [...w, e];
|
|
144
|
+
Q === void 0 && Oe(t), ve?.(t);
|
|
145
|
+
}, te = _e(null), ae = _e(null), Ie = rt(ke, o, "table", ae), [m, ne] = $(
|
|
146
|
+
() => _ ? be(_) : {}
|
|
92
147
|
);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, [
|
|
96
|
-
const
|
|
148
|
+
st(() => {
|
|
149
|
+
_ && Ct(_, m);
|
|
150
|
+
}, [_, m]);
|
|
151
|
+
const A = M(
|
|
97
152
|
() => s.some(
|
|
98
|
-
(e) => e.width !== void 0 || e.resizable === !0 || e.key in
|
|
153
|
+
(e) => e.width !== void 0 || e.resizable === !0 || e.key in m
|
|
99
154
|
),
|
|
100
|
-
[s,
|
|
101
|
-
),
|
|
102
|
-
() => s.map((e) => e.key in
|
|
103
|
-
[s,
|
|
104
|
-
),
|
|
105
|
-
const
|
|
106
|
-
return t + (
|
|
107
|
-
},
|
|
155
|
+
[s, m]
|
|
156
|
+
), se = M(
|
|
157
|
+
() => s.map((e) => e.key in m ? `${m[e.key]}px` : St(e.width)),
|
|
158
|
+
[s, m]
|
|
159
|
+
), N = J !== void 0, b = D !== void 0, B = (h ? O : 0) + (N ? V : 0), ie = b ? me : 0, le = M(() => A ? `${s.reduce((t, n) => {
|
|
160
|
+
const r = n.key in m ? m[n.key] : typeof n.width == "number" ? n.width : void 0;
|
|
161
|
+
return t + (r ?? n.minWidth ?? pt);
|
|
162
|
+
}, B + ie).toString()}px` : void 0, [s, m, A, B, ie]), Pe = it(
|
|
108
163
|
(e, t) => (n) => {
|
|
109
164
|
if (n.button !== 0)
|
|
110
165
|
return;
|
|
111
166
|
n.preventDefault(), n.stopPropagation();
|
|
112
|
-
const
|
|
113
|
-
if (!
|
|
167
|
+
const r = te.current;
|
|
168
|
+
if (!r)
|
|
114
169
|
return;
|
|
115
|
-
const
|
|
116
|
-
if (!(
|
|
170
|
+
const d = r.querySelectorAll("thead th")[t];
|
|
171
|
+
if (!(d instanceof HTMLElement))
|
|
117
172
|
return;
|
|
118
|
-
const
|
|
173
|
+
const T = n.clientX, Qe = d.getBoundingClientRect().width, Ye = e.minWidth ?? ft, Ze = e.maxWidth ?? 1 / 0;
|
|
119
174
|
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
120
|
-
const
|
|
121
|
-
const
|
|
122
|
-
Math.max(
|
|
123
|
-
|
|
175
|
+
const ce = (Ke) => {
|
|
176
|
+
const et = Math.min(
|
|
177
|
+
Math.max(Qe + (Ke.clientX - T), Ye),
|
|
178
|
+
Ze
|
|
124
179
|
);
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
document.body.style.cursor = "", document.body.style.userSelect = "", window.removeEventListener("pointermove",
|
|
180
|
+
ne((tt) => ({ ...tt, [e.key]: Math.round(et) }));
|
|
181
|
+
}, ge = () => {
|
|
182
|
+
document.body.style.cursor = "", document.body.style.userSelect = "", window.removeEventListener("pointermove", ce), window.removeEventListener("pointerup", ge);
|
|
128
183
|
};
|
|
129
|
-
window.addEventListener("pointermove",
|
|
184
|
+
window.addEventListener("pointermove", ce), window.addEventListener("pointerup", ge);
|
|
130
185
|
},
|
|
131
186
|
[]
|
|
132
187
|
);
|
|
133
|
-
|
|
134
|
-
if (!
|
|
188
|
+
dt(() => {
|
|
189
|
+
if (!_ || typeof window > "u")
|
|
135
190
|
return;
|
|
136
191
|
const e = (t) => {
|
|
137
|
-
t.key ===
|
|
192
|
+
t.key === q(_) && ne(be(_));
|
|
138
193
|
};
|
|
139
194
|
return window.addEventListener("storage", e), () => window.removeEventListener("storage", e);
|
|
140
|
-
}, [
|
|
141
|
-
const
|
|
195
|
+
}, [_]);
|
|
196
|
+
const je = [
|
|
142
197
|
"aegis-data-table",
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
].filter(Boolean).join(" "),
|
|
198
|
+
L ? "aegis-data-table--framed" : "",
|
|
199
|
+
Z ? "aegis-data-table--stale" : "",
|
|
200
|
+
u ?? ""
|
|
201
|
+
].filter(Boolean).join(" "), H = A && !y, R = ye && !y, oe = (y ? 1 : s.length) + (b ? 1 : 0), ze = oe + (h ? 1 : 0) + (N ? 1 : 0), Ae = h ? O : 0, S = (e, t) => ({
|
|
147
202
|
className: [
|
|
148
203
|
`aegis-data-table__${t}`,
|
|
149
204
|
`aegis-data-table__${e}-cell`,
|
|
150
|
-
|
|
205
|
+
R ? `aegis-data-table__${t}--sticky` : ""
|
|
151
206
|
].filter(Boolean).join(" "),
|
|
152
207
|
style: {
|
|
153
|
-
width: e === "select" ?
|
|
154
|
-
left:
|
|
208
|
+
width: e === "select" ? O : V,
|
|
209
|
+
left: R ? e === "select" ? 0 : Ae : void 0
|
|
155
210
|
}
|
|
156
|
-
}),
|
|
157
|
-
const
|
|
158
|
-
return
|
|
211
|
+
}), U = (e, t, n) => {
|
|
212
|
+
const r = `aegis-data-table__${e}`, d = [r];
|
|
213
|
+
return R && t === 0 && d.push(`${r}--sticky`), n !== void 0 && (d.push(
|
|
159
214
|
"aegis-data-table__td--tone",
|
|
160
215
|
`aegis-data-table__td--tone-${n.tone}`
|
|
161
|
-
), n.step !== void 0 && n.step > 1 &&
|
|
162
|
-
},
|
|
163
|
-
textAlign:
|
|
164
|
-
left:
|
|
165
|
-
}),
|
|
216
|
+
), n.step !== void 0 && n.step > 1 && d.push(`aegis-data-table__td--step-${String(n.step)}`)), d.join(" ");
|
|
217
|
+
}, re = (e) => e.kind === "actions" || e.numeric === !0 ? "right" : e.align ?? "left", F = (e, t) => ({
|
|
218
|
+
textAlign: re(e),
|
|
219
|
+
left: R && t === 0 ? B : void 0
|
|
220
|
+
}), de = (e, t) => {
|
|
166
221
|
const n = [
|
|
167
222
|
"aegis-data-table__cell",
|
|
168
|
-
`aegis-data-table__cell--${
|
|
223
|
+
`aegis-data-table__cell--${re(e)}`
|
|
169
224
|
];
|
|
170
225
|
return e.numeric && n.push("aegis-data-table__cell--numeric"), e.kind === "actions" ? n.push("aegis-data-table__cell--actions") : (e.truncate ?? !0) && n.push("aegis-data-table__cell--truncate"), /* @__PURE__ */ a("div", { className: n.join(" "), children: t });
|
|
171
|
-
},
|
|
226
|
+
}, Be = (e, t) => y ? /* @__PURE__ */ a("td", { className: "aegis-data-table__td aegis-data-table__card-cell", children: Y(e, t) }) : s.map((n, r) => /* @__PURE__ */ a(
|
|
172
227
|
"td",
|
|
173
228
|
{
|
|
174
|
-
className:
|
|
175
|
-
style:
|
|
176
|
-
children:
|
|
229
|
+
className: U("td", r, n.cellTone?.(e, t)),
|
|
230
|
+
style: F(n, r),
|
|
231
|
+
children: de(n, n.render(e, t))
|
|
177
232
|
},
|
|
178
233
|
n.key
|
|
179
|
-
)),
|
|
234
|
+
)), He = () => y ? /* @__PURE__ */ a("td", { className: "aegis-data-table__td aegis-data-table__card-cell", children: /* @__PURE__ */ a(mt, { lines: 2 }) }) : s.map((e, t) => /* @__PURE__ */ a(
|
|
180
235
|
"td",
|
|
181
236
|
{
|
|
182
|
-
className:
|
|
183
|
-
style:
|
|
184
|
-
children:
|
|
237
|
+
className: U("td", t),
|
|
238
|
+
style: F(e, t),
|
|
239
|
+
children: de(
|
|
185
240
|
e,
|
|
186
|
-
/* @__PURE__ */ a(
|
|
241
|
+
/* @__PURE__ */ a(bt, { width: "80%", height: "var(--space-3)" })
|
|
187
242
|
)
|
|
188
243
|
},
|
|
189
244
|
e.key
|
|
190
|
-
)),
|
|
191
|
-
const n =
|
|
245
|
+
)), Ue = b && /* @__PURE__ */ a("td", { className: "aegis-data-table__td aegis-data-table__chevron-cell", children: /* @__PURE__ */ a(X, { className: "aegis-data-table__chevron", "aria-hidden": !0 }) }), Fe = (e, t) => {
|
|
246
|
+
const n = w.includes(e);
|
|
192
247
|
return /* @__PURE__ */ a(
|
|
193
248
|
"button",
|
|
194
249
|
{
|
|
@@ -198,90 +253,109 @@ function Tt({
|
|
|
198
253
|
"aria-controls": t,
|
|
199
254
|
"aria-label": n ? E.collapseRow : E.expandRow,
|
|
200
255
|
onClick: () => {
|
|
201
|
-
|
|
256
|
+
De(e);
|
|
202
257
|
},
|
|
203
|
-
children: /* @__PURE__ */ a(
|
|
258
|
+
children: /* @__PURE__ */ a(X, { className: "aegis-data-table__toggle-icon", "aria-hidden": !0 })
|
|
204
259
|
}
|
|
205
260
|
);
|
|
206
|
-
},
|
|
207
|
-
const
|
|
208
|
-
return /* @__PURE__ */
|
|
261
|
+
}, Ve = (e, t, n, r, d) => {
|
|
262
|
+
const T = w.includes(n);
|
|
263
|
+
return /* @__PURE__ */ c(
|
|
209
264
|
"tr",
|
|
210
265
|
{
|
|
211
|
-
className:
|
|
266
|
+
className: T ? "aegis-data-table__detail-row aegis-data-table__detail-row--open" : "aegis-data-table__detail-row",
|
|
212
267
|
children: [
|
|
213
|
-
|
|
268
|
+
h && /* @__PURE__ */ a("td", { className: "aegis-data-table__detail-cell" }),
|
|
214
269
|
/* @__PURE__ */ a("td", { className: "aegis-data-table__detail-cell" }),
|
|
215
270
|
/* @__PURE__ */ a(
|
|
216
271
|
"td",
|
|
217
272
|
{
|
|
218
|
-
id:
|
|
219
|
-
colSpan:
|
|
273
|
+
id: r,
|
|
274
|
+
colSpan: oe,
|
|
220
275
|
className: "aegis-data-table__detail-cell",
|
|
221
|
-
children: /* @__PURE__ */ a("div", { className: "aegis-data-table__detail", children: /* @__PURE__ */ a("div", { className: "aegis-data-table__detail-clip", children: /* @__PURE__ */ a("div", { className: "aegis-data-table__detail-body", children: (
|
|
276
|
+
children: /* @__PURE__ */ a("div", { className: "aegis-data-table__detail", children: /* @__PURE__ */ a("div", { className: "aegis-data-table__detail-clip", children: /* @__PURE__ */ a("div", { className: "aegis-data-table__detail-body", children: (T || z.includes(n)) && d(e, t) }) }) })
|
|
222
277
|
}
|
|
223
278
|
)
|
|
224
279
|
]
|
|
225
280
|
}
|
|
226
281
|
);
|
|
227
|
-
},
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
e.key === "Enter" && e.target === e.currentTarget && (e.preventDefault(),
|
|
231
|
-
},
|
|
282
|
+
}, Xe = (e, t, n) => {
|
|
283
|
+
Nt(e) || D?.(t, n);
|
|
284
|
+
}, qe = (e, t, n) => {
|
|
285
|
+
e.key === "Enter" && e.target === e.currentTarget && (e.preventDefault(), D?.(t, n));
|
|
286
|
+
}, Ge = [
|
|
232
287
|
"aegis-data-table__row",
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
].filter(Boolean).join(" "),
|
|
288
|
+
b ? "aegis-data-table__row--clickable" : "",
|
|
289
|
+
N ? "aegis-data-table__row--expandable" : ""
|
|
290
|
+
].filter(Boolean).join(" "), Je = [
|
|
236
291
|
"aegis-data-table__table",
|
|
237
|
-
|
|
238
|
-
|
|
292
|
+
H ? "aegis-data-table__table--fixed" : "",
|
|
293
|
+
y ? "aegis-data-table__table--cards" : ""
|
|
239
294
|
].filter(Boolean).join(" ");
|
|
240
|
-
return /* @__PURE__ */
|
|
295
|
+
return /* @__PURE__ */ c(
|
|
241
296
|
"div",
|
|
242
297
|
{
|
|
243
|
-
ref:
|
|
244
|
-
className:
|
|
245
|
-
"aria-busy":
|
|
246
|
-
...
|
|
298
|
+
ref: ae,
|
|
299
|
+
className: je,
|
|
300
|
+
"aria-busy": Z ? !0 : void 0,
|
|
301
|
+
...Ie,
|
|
247
302
|
children: [
|
|
248
|
-
/* @__PURE__ */ a("div", { className: "aegis-data-table__scroll", children: /* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ a("div", { className: "aegis-data-table__scroll", children: /* @__PURE__ */ c(
|
|
249
304
|
"table",
|
|
250
305
|
{
|
|
251
|
-
ref:
|
|
252
|
-
className:
|
|
253
|
-
style:
|
|
306
|
+
ref: te,
|
|
307
|
+
className: Je,
|
|
308
|
+
style: le && H ? { minWidth: le } : void 0,
|
|
254
309
|
children: [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
310
|
+
H && /* @__PURE__ */ c("colgroup", { children: [
|
|
311
|
+
h && /* @__PURE__ */ a("col", { style: { width: O } }, "__select"),
|
|
312
|
+
N && /* @__PURE__ */ a("col", { style: { width: V } }, "__toggle"),
|
|
258
313
|
s.map((e, t) => /* @__PURE__ */ a(
|
|
259
314
|
"col",
|
|
260
315
|
{
|
|
261
|
-
style:
|
|
316
|
+
style: se[t] ? { width: se[t] } : void 0
|
|
262
317
|
},
|
|
263
318
|
e.key
|
|
264
319
|
)),
|
|
265
|
-
|
|
320
|
+
b && /* @__PURE__ */ a("col", { style: { width: me } }, "__chevron")
|
|
266
321
|
] }),
|
|
267
|
-
(!
|
|
268
|
-
|
|
269
|
-
|
|
322
|
+
(!y || h) && /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
323
|
+
h && /* @__PURE__ */ a("th", { ...S("select", "th"), children: /* @__PURE__ */ a("span", { className: "aegis-data-table__th-label", children: /* @__PURE__ */ a(
|
|
324
|
+
he,
|
|
270
325
|
{
|
|
271
|
-
checked:
|
|
272
|
-
indeterminate:
|
|
273
|
-
onChange:
|
|
326
|
+
checked: k.length > 0 && j === k.length,
|
|
327
|
+
indeterminate: j > 0 && j < k.length,
|
|
328
|
+
onChange: Te,
|
|
274
329
|
ariaLabel: E.selectAllRows
|
|
275
330
|
}
|
|
276
331
|
) }) }, "__select"),
|
|
277
|
-
|
|
278
|
-
|
|
332
|
+
N && /* @__PURE__ */ a("th", { ...S("toggle", "th") }, "__toggle"),
|
|
333
|
+
y ? /* @__PURE__ */ a("th", { className: "aegis-data-table__th" }) : s.map((e, t) => /* @__PURE__ */ c(
|
|
279
334
|
"th",
|
|
280
335
|
{
|
|
281
|
-
className:
|
|
282
|
-
style:
|
|
336
|
+
className: U("th", t),
|
|
337
|
+
style: F(e, t),
|
|
338
|
+
"aria-sort": e.sortable ? p?.key === e.key ? p.direction === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
283
339
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
340
|
+
e.sortable ? /* @__PURE__ */ c(
|
|
341
|
+
"button",
|
|
342
|
+
{
|
|
343
|
+
type: "button",
|
|
344
|
+
className: "aegis-data-table__sort",
|
|
345
|
+
onClick: () => {
|
|
346
|
+
Ee(e);
|
|
347
|
+
},
|
|
348
|
+
children: [
|
|
349
|
+
/* @__PURE__ */ a("span", { className: "aegis-data-table__th-label", children: e.header }),
|
|
350
|
+
/* @__PURE__ */ a(
|
|
351
|
+
kt,
|
|
352
|
+
{
|
|
353
|
+
direction: p?.key === e.key ? p.direction : null
|
|
354
|
+
}
|
|
355
|
+
)
|
|
356
|
+
]
|
|
357
|
+
}
|
|
358
|
+
) : /* @__PURE__ */ a("span", { className: "aegis-data-table__th-label", children: e.header }),
|
|
285
359
|
e.resizable && /* @__PURE__ */ a(
|
|
286
360
|
"span",
|
|
287
361
|
{
|
|
@@ -289,131 +363,131 @@ function Tt({
|
|
|
289
363
|
"aria-orientation": "vertical",
|
|
290
364
|
"aria-label": "Resize column",
|
|
291
365
|
className: "aegis-data-table__resizer",
|
|
292
|
-
onPointerDown:
|
|
366
|
+
onPointerDown: Pe(e, t)
|
|
293
367
|
}
|
|
294
368
|
)
|
|
295
369
|
]
|
|
296
370
|
},
|
|
297
371
|
e.key
|
|
298
372
|
)),
|
|
299
|
-
|
|
373
|
+
b && /* @__PURE__ */ a("th", { className: "aegis-data-table__th aegis-data-table__chevron-cell" })
|
|
300
374
|
] }) }),
|
|
301
|
-
/* @__PURE__ */ a("tbody", { children:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
] }, `sk-${t}`)) :
|
|
375
|
+
/* @__PURE__ */ a("tbody", { children: f ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ c("tr", { className: "aegis-data-table__row", children: [
|
|
376
|
+
h && /* @__PURE__ */ a("td", { ...S("select", "td") }, "__select"),
|
|
377
|
+
N && /* @__PURE__ */ a("td", { ...S("toggle", "td") }, "__toggle"),
|
|
378
|
+
He(),
|
|
379
|
+
b && /* @__PURE__ */ a("td", { className: "aegis-data-table__td" })
|
|
380
|
+
] }, `sk-${t}`)) : P.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
|
|
307
381
|
"td",
|
|
308
382
|
{
|
|
309
|
-
colSpan:
|
|
383
|
+
colSpan: ze,
|
|
310
384
|
className: "aegis-data-table__empty-cell",
|
|
311
385
|
children: /* @__PURE__ */ a("div", { className: "aegis-data-table__empty", children: /* @__PURE__ */ a(
|
|
312
|
-
|
|
386
|
+
ut,
|
|
313
387
|
{
|
|
314
|
-
title:
|
|
315
|
-
description:
|
|
316
|
-
action:
|
|
388
|
+
title: v,
|
|
389
|
+
description: i,
|
|
390
|
+
action: l
|
|
317
391
|
}
|
|
318
392
|
) })
|
|
319
393
|
}
|
|
320
|
-
) }) :
|
|
321
|
-
const n =
|
|
322
|
-
return /* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
394
|
+
) }) : P.map((e, t) => {
|
|
395
|
+
const n = g(e, t), r = `${Ce}-detail-${String(t)}`;
|
|
396
|
+
return /* @__PURE__ */ c(lt, { children: [
|
|
397
|
+
/* @__PURE__ */ c(
|
|
324
398
|
"tr",
|
|
325
399
|
{
|
|
326
|
-
className:
|
|
327
|
-
tabIndex:
|
|
328
|
-
onClick:
|
|
329
|
-
|
|
400
|
+
className: Ge,
|
|
401
|
+
tabIndex: b ? 0 : void 0,
|
|
402
|
+
onClick: b ? (d) => {
|
|
403
|
+
Xe(d, e, t);
|
|
330
404
|
} : void 0,
|
|
331
|
-
onKeyDown:
|
|
332
|
-
|
|
405
|
+
onKeyDown: b ? (d) => {
|
|
406
|
+
qe(d, e, t);
|
|
333
407
|
} : void 0,
|
|
334
408
|
children: [
|
|
335
|
-
|
|
336
|
-
|
|
409
|
+
h && /* @__PURE__ */ a("td", { ...S("select", "td"), children: $e(x.includes(n), (d) => {
|
|
410
|
+
Re(n, d);
|
|
337
411
|
}) }),
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
412
|
+
N && /* @__PURE__ */ a("td", { ...S("toggle", "td"), children: Fe(n, r) }),
|
|
413
|
+
Be(e, t),
|
|
414
|
+
Ue
|
|
341
415
|
]
|
|
342
416
|
}
|
|
343
417
|
),
|
|
344
|
-
|
|
418
|
+
N && Ve(e, t, n, r, J)
|
|
345
419
|
] }, n);
|
|
346
420
|
}) })
|
|
347
421
|
]
|
|
348
422
|
}
|
|
349
423
|
) }),
|
|
350
|
-
|
|
351
|
-
|
|
424
|
+
C && /* @__PURE__ */ a(
|
|
425
|
+
xt,
|
|
352
426
|
{
|
|
353
|
-
pagination:
|
|
354
|
-
rowCount:
|
|
355
|
-
loading:
|
|
427
|
+
pagination: C,
|
|
428
|
+
rowCount: o.length,
|
|
429
|
+
loading: f
|
|
356
430
|
}
|
|
357
431
|
)
|
|
358
432
|
]
|
|
359
433
|
}
|
|
360
434
|
);
|
|
361
435
|
}
|
|
362
|
-
function
|
|
436
|
+
function xt({
|
|
363
437
|
pagination: s,
|
|
364
|
-
rowCount:
|
|
365
|
-
loading:
|
|
438
|
+
rowCount: o,
|
|
439
|
+
loading: g
|
|
366
440
|
}) {
|
|
367
|
-
const
|
|
368
|
-
return /* @__PURE__ */
|
|
369
|
-
|
|
370
|
-
|
|
441
|
+
const f = fe(), { page: v, pageSize: i, total: l, onChange: u, pageSizeOptions: L } = s, _ = (v - 1) * i, C = l === void 0 ? o : Math.max(0, Math.min(i, l - _)), h = l === void 0 ? o >= i : _ + i < l;
|
|
442
|
+
return /* @__PURE__ */ c("div", { className: "aegis-data-table__footer", children: [
|
|
443
|
+
L && /* @__PURE__ */ a(
|
|
444
|
+
ht,
|
|
371
445
|
{
|
|
372
|
-
value:
|
|
373
|
-
options:
|
|
374
|
-
onChange: (
|
|
375
|
-
|
|
446
|
+
value: i,
|
|
447
|
+
options: L,
|
|
448
|
+
onChange: (W) => {
|
|
449
|
+
u(1, W);
|
|
376
450
|
}
|
|
377
451
|
}
|
|
378
452
|
),
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */ a("span", { className: "aegis-data-table__range-num", children:
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
/* @__PURE__ */ a("span", { className: "aegis-data-table__range-num", children:
|
|
453
|
+
/* @__PURE__ */ c("div", { className: "aegis-data-table__pager", children: [
|
|
454
|
+
/* @__PURE__ */ c("span", { className: "aegis-data-table__range", children: [
|
|
455
|
+
/* @__PURE__ */ a("span", { className: "aegis-data-table__range-num", children: C > 0 ? `${(_ + 1).toLocaleString()}–${(_ + C).toLocaleString()}` : "0" }),
|
|
456
|
+
l !== void 0 && /* @__PURE__ */ c(at, { children: [
|
|
457
|
+
f.rangeOf,
|
|
458
|
+
/* @__PURE__ */ a("span", { className: "aegis-data-table__range-num", children: l.toLocaleString() })
|
|
385
459
|
] })
|
|
386
460
|
] }),
|
|
387
461
|
/* @__PURE__ */ a(
|
|
388
|
-
|
|
462
|
+
ue,
|
|
389
463
|
{
|
|
390
464
|
tone: "secondary",
|
|
391
465
|
className: "aegis-data-table__page-btn",
|
|
392
|
-
"aria-label":
|
|
393
|
-
disabled:
|
|
466
|
+
"aria-label": f.previousPage,
|
|
467
|
+
disabled: g || v <= 1,
|
|
394
468
|
onClick: () => {
|
|
395
|
-
|
|
469
|
+
u(v - 1, i);
|
|
396
470
|
},
|
|
397
|
-
children: /* @__PURE__ */ a(
|
|
471
|
+
children: /* @__PURE__ */ a(ot, {})
|
|
398
472
|
}
|
|
399
473
|
),
|
|
400
474
|
/* @__PURE__ */ a(
|
|
401
|
-
|
|
475
|
+
ue,
|
|
402
476
|
{
|
|
403
477
|
tone: "secondary",
|
|
404
478
|
className: "aegis-data-table__page-btn",
|
|
405
|
-
"aria-label":
|
|
406
|
-
disabled:
|
|
479
|
+
"aria-label": f.nextPage,
|
|
480
|
+
disabled: g || !h,
|
|
407
481
|
onClick: () => {
|
|
408
|
-
|
|
482
|
+
u(v + 1, i);
|
|
409
483
|
},
|
|
410
|
-
children: /* @__PURE__ */ a(
|
|
484
|
+
children: /* @__PURE__ */ a(X, {})
|
|
411
485
|
}
|
|
412
486
|
)
|
|
413
487
|
] })
|
|
414
488
|
] });
|
|
415
489
|
}
|
|
416
490
|
export {
|
|
417
|
-
|
|
491
|
+
Bt as DataTable
|
|
418
492
|
};
|
|
419
493
|
//# sourceMappingURL=DataTable.js.map
|