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