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