@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.
Files changed (46) 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 +44 -2
  9. package/dist/components/ui/DataTable.js +264 -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/TextArea.cjs +2 -0
  37. package/dist/components/ui/TextArea.cjs.map +1 -0
  38. package/dist/components/ui/TextArea.d.ts +11 -0
  39. package/dist/components/ui/TextArea.js +53 -0
  40. package/dist/components/ui/TextArea.js.map +1 -0
  41. package/dist/components/ui/index.d.ts +3 -0
  42. package/dist/index.cjs +1 -1
  43. package/dist/index.js +163 -159
  44. package/dist/index.js.map +1 -1
  45. package/dist/style.css +1 -1
  46. 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 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 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 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 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(gt);
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 ut(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 bt({
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,144 @@ function _t({
65
65
  }
66
66
  );
67
67
  }
68
- function xt({
68
+ function Dt({
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
+ 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 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) => {
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: _?.key === e.key ? _.direction === "asc" ? "desc" : "asc" : t
108
+ direction: h?.key === e.key ? h.direction === "asc" ? "desc" : "asc" : t
106
109
  };
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)
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
- }, 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,
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: N.selectRow
123
+ ariaLabel: w.selectRow
121
124
  }
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({
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: ue,
132
+ persistKey: pe,
130
133
  leadWidth: E,
131
- trailWidth: Oe,
132
- firstColumnMax: S ? nt : void 0,
133
- tableRef: Z
134
- }), je = [
134
+ trailWidth: Be,
135
+ firstColumnMax: R ? ct : void 0,
136
+ tableRef: ee
137
+ }), Pe = [
135
138
  "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) => ({
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
- S ? `aegis-data-table__${t}--sticky` : ""
151
+ R ? `aegis-data-table__${t}--sticky` : ""
146
152
  ].filter(Boolean).join(" "),
147
153
  style: {
148
- width: e === "select" ? $ : z,
149
- left: S ? e === "select" ? 0 : Ae : void 0
154
+ width: e === "select" ? T : z,
155
+ left: R ? e === "select" ? 0 : He : void 0
150
156
  }
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(
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 && 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) => {
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--${te(e)}`
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
- }, 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(
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
- className: B("td", u, l.cellTone?.(e, t)),
170
- style: P(l, u),
171
- children: ae(l, l.render(e, t))
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
- )), 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(
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: B("td", t),
178
- style: P(e, t),
179
- children: ae(
189
+ className: P("td", t),
190
+ style: W(e, t),
191
+ children: se(
180
192
  e,
181
- /* @__PURE__ */ a(at, { width: "80%", height: "var(--space-3)" })
193
+ /* @__PURE__ */ a(nt, { width: "80%", height: "var(--space-3)" })
182
194
  )
183
195
  },
184
196
  e.key
185
- )), le = T && /* @__PURE__ */ a("td", { className: "aegis-data-table__td aegis-data-table__filler", "aria-hidden": !0 }), We = r && /* @__PURE__ */ a(
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(ne, { className: "aegis-data-table__chevron", "aria-hidden": !0 })
202
+ children: /* @__PURE__ */ a(oe, { className: "aegis-data-table__chevron", "aria-hidden": !0 })
191
203
  }
192
- ), ze = (e, t) => {
193
- const l = b.includes(e);
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 ? N.collapseRow : N.expandRow,
213
+ "aria-label": l ? w.collapseRow : w.expandRow,
202
214
  onClick: () => {
203
- Le(e);
215
+ Me(e);
204
216
  },
205
- children: /* @__PURE__ */ a(ne, { className: "aegis-data-table__toggle-icon", "aria-hidden": !0 })
217
+ children: /* @__PURE__ */ a(oe, { className: "aegis-data-table__toggle-icon", "aria-hidden": !0 })
206
218
  }
207
219
  );
208
- }, se = (e, t, l) => /* @__PURE__ */ o(
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
- d && /* @__PURE__ */ a("td", { className: "aegis-data-table__detail-cell" }),
214
- g && /* @__PURE__ */ a("td", { className: "aegis-data-table__detail-cell" }),
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: ee,
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
- ), 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) => [
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
- r ? "aegis-data-table__row--clickable" : "",
243
- g ? "aegis-data-table__row--expandable" : "",
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(" "), qe = [
258
+ ].filter(Boolean).join(" "), Xe = [
246
259
  "aegis-data-table__table",
247
260
  D ? "aegis-data-table__table--fixed" : "",
248
- m ? "aegis-data-table__table--cards" : ""
261
+ f ? "aegis-data-table__table--cards" : ""
249
262
  ].filter(Boolean).join(" ");
250
- return /* @__PURE__ */ o(
263
+ return /* @__PURE__ */ d(
251
264
  "div",
252
265
  {
253
- ref: K,
254
- className: je,
255
- "aria-busy": F || y ? !0 : void 0,
256
- ...Ie,
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__ */ o(
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: Z,
262
- "aria-label": R,
263
- className: qe,
264
- style: D ? C.tableStyle : void 0,
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__ */ o("colgroup", { children: [
267
- d && /* @__PURE__ */ a("col", { style: { width: $ } }, "__select"),
268
- g && /* @__PURE__ */ a("col", { style: { width: z } }, "__toggle"),
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 = C.widths[t];
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
- T && /* @__PURE__ */ a(
294
+ L && /* @__PURE__ */ a(
281
295
  "col",
282
296
  {
283
297
  "data-column-filler": !0,
284
- style: C.fillerStyle
298
+ style: S.fillerStyle
285
299
  },
286
300
  "__filler"
287
301
  ),
288
- r && /* @__PURE__ */ a("col", { style: { width: de } }, "__chevron")
302
+ c && /* @__PURE__ */ a("col", { style: { width: ce } }, "__chevron")
289
303
  ] }),
290
- (!m || d) && /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [
291
- d && /* @__PURE__ */ a(
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
- ...w("select", "th"),
309
+ ...x("select", "th"),
296
310
  children: /* @__PURE__ */ a("span", { className: "aegis-data-table__th-label", children: /* @__PURE__ */ a(
297
- oe,
311
+ re,
298
312
  {
299
- checked: v.length > 0 && M === v.length,
300
- indeterminate: M > 0 && M < v.length,
301
- onChange: Re,
302
- ariaLabel: N.selectAllRows
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
- g && /* @__PURE__ */ a(
322
+ u && /* @__PURE__ */ a(
309
323
  "th",
310
324
  {
311
325
  scope: "col",
312
- ...w("toggle", "th")
326
+ ...x("toggle", "th")
313
327
  },
314
328
  "__toggle"
315
329
  ),
316
- m ? /* @__PURE__ */ a("th", { scope: "col", className: "aegis-data-table__th" }) : s.map((e, t) => /* @__PURE__ */ o(
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: B("th", t),
322
- style: P(e, t),
323
- "aria-sort": e.sortable ? _?.key === e.key ? _.direction === "asc" ? "ascending" : "descending" : "none" : void 0,
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__ */ o(
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
- Se(e);
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
- _t,
351
+ bt,
337
352
  {
338
- direction: _?.key === e.key ? _.direction : null
353
+ direction: h?.key === e.key ? h.direction : null
339
354
  }
340
355
  )
341
356
  ]
342
357
  }
343
- ) : /* @__PURE__ */ a("span", { className: "aegis-data-table__th-label", children: e.header }),
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": N.resizeColumn,
368
+ "aria-label": w.resizeColumn,
348
369
  className: "aegis-data-table__resizer",
349
- ...C.handleProps(e)
370
+ ...S.handleProps(e)
350
371
  }
351
372
  )
352
373
  ]
353
374
  },
354
375
  e.key
355
376
  )),
356
- T && /* @__PURE__ */ a(
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
- r && /* @__PURE__ */ a(
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("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,
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
- title: i ?? N.noData,
390
- description: n,
391
- action: h
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
- ) : 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
- }) })
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
- H && /* @__PURE__ */ a(
435
- et,
463
+ V && /* @__PURE__ */ a(
464
+ st,
436
465
  {
437
- ...H,
438
- pageRowCount: c.length,
439
- disabled: y,
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
- xt as DataTable
477
+ Dt as DataTable
449
478
  };
450
479
  //# sourceMappingURL=DataTable.js.map