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