@lablup/ui-common 0.1.0-alpha.2 → 0.1.0-alpha.21
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/README.md +1 -1
- package/dist/assets/components/BaseCard/BaseCard.css +1 -1
- package/dist/assets/components/Button/Button.css +1 -1
- package/dist/assets/components/DataTable/DataTable.css +1 -1
- package/dist/assets/components/Drawer/Drawer.css +1 -1
- package/dist/assets/components/EmptyState/EmptyState.css +1 -1
- package/dist/assets/components/ErrorState/ErrorState.css +1 -1
- package/dist/assets/components/PageHeader/PageHeader.css +1 -1
- package/dist/assets/components/Select/Select.css +1 -0
- package/dist/assets/components/StatCard/StatCard.css +1 -1
- package/dist/assets/components/Tabs/Tabs.css +1 -1
- package/dist/assets/components/Tooltip/Tooltip.css +1 -1
- package/dist/components/DataTable/DataTable.d.ts +50 -6
- package/dist/components/DataTable/DataTable2.js +205 -133
- package/dist/components/DataTable/DataTable2.js.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +12 -1
- package/dist/components/Drawer/Drawer2.js +69 -51
- package/dist/components/Drawer/Drawer2.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +10 -3
- package/dist/components/EmptyState/EmptyState2.js +31 -48
- package/dist/components/EmptyState/EmptyState2.js.map +1 -1
- package/dist/components/EmptyState/index.d.ts +6 -1
- package/dist/components/ErrorState/ErrorState.d.ts +17 -4
- package/dist/components/ErrorState/ErrorState2.js +20 -23
- package/dist/components/ErrorState/ErrorState2.js.map +1 -1
- package/dist/components/ErrorState/index.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +14 -1
- package/dist/components/PageHeader/PageHeader2.js +40 -24
- package/dist/components/PageHeader/PageHeader2.js.map +1 -1
- package/dist/components/Select/Select.d.ts +38 -0
- package/dist/components/Select/Select2.js +313 -0
- package/dist/components/Select/Select2.js.map +1 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.js +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +11 -1
- package/dist/components/Skeleton/Skeleton2.js +8 -6
- package/dist/components/Skeleton/Skeleton2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonCard.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonCard2.js +13 -3
- package/dist/components/Skeleton/SkeletonCard2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonChart2.js +5 -0
- package/dist/components/Skeleton/SkeletonChart2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonRow.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonRow2.js +9 -3
- package/dist/components/Skeleton/SkeletonRow2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonText.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonText2.js +7 -5
- package/dist/components/Skeleton/SkeletonText2.js.map +1 -1
- package/dist/components/StatCard/StatCard.d.ts +10 -1
- package/dist/components/StatCard/StatCard2.js +30 -30
- package/dist/components/StatCard/StatCard2.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +10 -23
- package/dist/components/Tabs/Tabs2.js +127 -146
- package/dist/components/Tabs/Tabs2.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/Tabs/index.js +2 -3
- package/dist/components/Tooltip/Tooltip.d.ts +15 -1
- package/dist/components/Tooltip/Tooltip2.js +77 -47
- package/dist/components/Tooltip/Tooltip2.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -6
- package/dist/styles/base.css +101 -10
- package/dist/styles/themes/orange-dark.css +3 -0
- package/dist/styles/themes/orange-light.css +6 -1
- package/package.json +1 -1
- package/dist/components/EmptyState/illustrations.d.ts +0 -51
- package/dist/components/EmptyState/illustrations.js +0 -571
- package/dist/components/EmptyState/illustrations.js.map +0 -1
- package/dist/components/Tabs/tabTags.d.ts +0 -9
- package/dist/components/Tabs/tabTags.js +0 -11
- package/dist/components/Tabs/tabTags.js.map +0 -1
|
@@ -1,45 +1,41 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { memo as e, useCallback as t, useEffect as n,
|
|
3
|
-
import { jsx as
|
|
2
|
+
import { memo as e, useCallback as t, useEffect as n, useLayoutEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
3
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/DataTable/DataTable.tsx
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
var l = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"input",
|
|
9
|
+
"select",
|
|
10
|
+
"textarea",
|
|
11
|
+
"summary",
|
|
12
|
+
"label",
|
|
13
|
+
"[contenteditable='true']",
|
|
14
|
+
"[role='button']",
|
|
15
|
+
"[role='link']",
|
|
16
|
+
"[tabindex]:not([tabindex='-1'])"
|
|
17
|
+
].join(",");
|
|
18
|
+
function u(e, t) {
|
|
19
|
+
if (!(e instanceof Element) || !(t instanceof Element)) return !1;
|
|
20
|
+
let n = e.closest(l);
|
|
21
|
+
return n !== null && n !== t && t.contains(n);
|
|
8
22
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
var ee = {
|
|
24
|
+
widths: {},
|
|
25
|
+
visibility: {}
|
|
26
|
+
}, te = 16, d = 1200;
|
|
27
|
+
function f(e) {
|
|
28
|
+
let t = Math.max(0, e.minWidth ?? 80), n = e.maxWidth ?? d;
|
|
29
|
+
return {
|
|
30
|
+
min: t,
|
|
31
|
+
max: Math.max(t, Number.isFinite(n) ? Math.max(t, n) : d)
|
|
13
32
|
};
|
|
14
|
-
try {
|
|
15
|
-
let t = window.localStorage.getItem(l(e));
|
|
16
|
-
if (!t) return {
|
|
17
|
-
widths: {},
|
|
18
|
-
visibility: {}
|
|
19
|
-
};
|
|
20
|
-
let n = JSON.parse(t);
|
|
21
|
-
if (typeof n != "object" || !n) return {
|
|
22
|
-
widths: {},
|
|
23
|
-
visibility: {}
|
|
24
|
-
};
|
|
25
|
-
let r = n;
|
|
26
|
-
return {
|
|
27
|
-
widths: typeof r.widths == "object" && r.widths !== null ? r.widths : {},
|
|
28
|
-
visibility: typeof r.visibility == "object" && r.visibility !== null ? r.visibility : {}
|
|
29
|
-
};
|
|
30
|
-
} catch {
|
|
31
|
-
return {
|
|
32
|
-
widths: {},
|
|
33
|
-
visibility: {}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
33
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} catch {}
|
|
34
|
+
function p(e, t) {
|
|
35
|
+
let { min: n, max: r } = f(e);
|
|
36
|
+
return Math.min(r, Math.max(n, Math.round(t)));
|
|
41
37
|
}
|
|
42
|
-
function
|
|
38
|
+
function ne(e, t) {
|
|
43
39
|
let n = e.map((e, t) => ({
|
|
44
40
|
row: e,
|
|
45
41
|
i: t
|
|
@@ -49,7 +45,7 @@ function f(e, t) {
|
|
|
49
45
|
return r === 0 ? e.i - n.i : r;
|
|
50
46
|
}), n.map(({ row: e }) => e);
|
|
51
47
|
}
|
|
52
|
-
function
|
|
48
|
+
function re(e, t) {
|
|
53
49
|
let { sortComparator: n } = e;
|
|
54
50
|
if (n) return (e, r) => n(e, r, t);
|
|
55
51
|
let r = e.sortValueAccessor;
|
|
@@ -66,201 +62,277 @@ function m(e, t, n) {
|
|
|
66
62
|
if (e.sortable) return e.id === t ? n === "asc" ? "ascending" : "descending" : "none";
|
|
67
63
|
}
|
|
68
64
|
function h({ direction: e }) {
|
|
69
|
-
return e === "none" ? /* @__PURE__ */
|
|
65
|
+
return e === "none" ? /* @__PURE__ */ s("span", {
|
|
70
66
|
className: "data-table__sort-icon data-table__sort-icon--none",
|
|
71
67
|
"aria-hidden": "true",
|
|
72
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ c("svg", {
|
|
73
69
|
width: "10",
|
|
74
70
|
height: "14",
|
|
75
71
|
viewBox: "0 0 10 14",
|
|
76
72
|
fill: "none",
|
|
77
73
|
xmlns: "http://www.w3.org/2000/svg",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ s("path", {
|
|
79
75
|
d: "M5 1L1 5H9L5 1Z",
|
|
80
76
|
fill: "currentColor",
|
|
81
77
|
opacity: "0.35"
|
|
82
|
-
}), /* @__PURE__ */
|
|
78
|
+
}), /* @__PURE__ */ s("path", {
|
|
83
79
|
d: "M5 13L9 9H1L5 13Z",
|
|
84
80
|
fill: "currentColor",
|
|
85
81
|
opacity: "0.35"
|
|
86
82
|
})]
|
|
87
83
|
})
|
|
88
|
-
}) : e === "asc" ? /* @__PURE__ */
|
|
84
|
+
}) : e === "asc" ? /* @__PURE__ */ s("span", {
|
|
89
85
|
className: "data-table__sort-icon data-table__sort-icon--asc",
|
|
90
86
|
"aria-hidden": "true",
|
|
91
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ c("svg", {
|
|
92
88
|
width: "10",
|
|
93
89
|
height: "14",
|
|
94
90
|
viewBox: "0 0 10 14",
|
|
95
91
|
fill: "none",
|
|
96
92
|
xmlns: "http://www.w3.org/2000/svg",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ s("path", {
|
|
98
94
|
d: "M5 1L1 5H9L5 1Z",
|
|
99
95
|
fill: "currentColor"
|
|
100
|
-
}), /* @__PURE__ */
|
|
96
|
+
}), /* @__PURE__ */ s("path", {
|
|
101
97
|
d: "M5 13L9 9H1L5 13Z",
|
|
102
98
|
fill: "currentColor",
|
|
103
99
|
opacity: "0.25"
|
|
104
100
|
})]
|
|
105
101
|
})
|
|
106
|
-
}) : /* @__PURE__ */
|
|
102
|
+
}) : /* @__PURE__ */ s("span", {
|
|
107
103
|
className: "data-table__sort-icon data-table__sort-icon--desc",
|
|
108
104
|
"aria-hidden": "true",
|
|
109
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ c("svg", {
|
|
110
106
|
width: "10",
|
|
111
107
|
height: "14",
|
|
112
108
|
viewBox: "0 0 10 14",
|
|
113
109
|
fill: "none",
|
|
114
110
|
xmlns: "http://www.w3.org/2000/svg",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ s("path", {
|
|
116
112
|
d: "M5 1L1 5H9L5 1Z",
|
|
117
113
|
fill: "currentColor",
|
|
118
114
|
opacity: "0.25"
|
|
119
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ s("path", {
|
|
120
116
|
d: "M5 13L9 9H1L5 13Z",
|
|
121
117
|
fill: "currentColor"
|
|
122
118
|
})]
|
|
123
119
|
})
|
|
124
120
|
});
|
|
125
121
|
}
|
|
126
|
-
function g({ columns: e, rows:
|
|
127
|
-
let [
|
|
122
|
+
function g({ columns: e, rows: l, getRowKey: d, emptyState: g, loadingState: _, loading: ie = !1, columnState: v, onColumnStateChange: y, className: b = "", ariaLabel: x = "Data table", resizeHandleLabel: S = (e) => `Resize ${e.id} column`, resizeValueText: C = (e) => `${String(e)} pixels`, testId: w, onRowClick: T, isRowClickable: E, rowClassName: D, sortColumnId: O, sortDirection: k, onSortChange: A }) {
|
|
123
|
+
let [j, M] = o(() => v ?? ee);
|
|
128
124
|
n(() => {
|
|
129
|
-
|
|
130
|
-
}, [
|
|
131
|
-
let
|
|
125
|
+
v && M(v);
|
|
126
|
+
}, [v]);
|
|
127
|
+
let N = O !== void 0 || k !== void 0, [ae, oe] = o(void 0), [P, F] = o(void 0), I = N ? O : ae, L = N ? k : P, R = t((e) => {
|
|
132
128
|
if (!e.sortable) return;
|
|
133
129
|
let t, n;
|
|
134
|
-
|
|
130
|
+
I === e.id ? L === (e.defaultSortDirection ?? "asc") ? (t = e.id, n = L === "asc" ? "desc" : "asc") : (t = void 0, n = void 0) : (t = e.id, n = e.defaultSortDirection ?? "asc"), N || (oe(t), F(n)), A?.(t, n);
|
|
135
131
|
}, [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
]),
|
|
141
|
-
let t =
|
|
142
|
-
|
|
143
|
-
}, [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
let n =
|
|
155
|
-
|
|
156
|
-
...e,
|
|
157
|
-
widths: {
|
|
158
|
-
...e.widths,
|
|
159
|
-
[t.columnId]: r
|
|
160
|
-
}
|
|
161
|
-
}));
|
|
162
|
-
}, i = () => {
|
|
163
|
-
z.current = null, window.removeEventListener("mousemove", r), window.removeEventListener("mouseup", i);
|
|
132
|
+
I,
|
|
133
|
+
L,
|
|
134
|
+
N,
|
|
135
|
+
A
|
|
136
|
+
]), z = i(() => e.filter((e) => e.alwaysVisible ? !0 : j.visibility[e.id] !== !1), [e, j.visibility]), B = t((e) => {
|
|
137
|
+
let t = j.widths[e.id], n = typeof t == "number" && t > 0 ? t : e.initialWidth;
|
|
138
|
+
if (n !== void 0) return e.noResize && e.maxWidth === void 0 ? Math.max(n, e.minWidth ?? 0) : p(e, n);
|
|
139
|
+
}, [j.widths]), V = a(/* @__PURE__ */ new Map()), [H, U] = o({}), W = t((e, t) => {
|
|
140
|
+
let n = p(e, t);
|
|
141
|
+
U((t) => t[e.id] === n ? t : {
|
|
142
|
+
...t,
|
|
143
|
+
[e.id]: n
|
|
144
|
+
});
|
|
145
|
+
}, []), G = t((e, t) => {
|
|
146
|
+
t ? V.current.set(e, t) : V.current.delete(e);
|
|
147
|
+
}, []);
|
|
148
|
+
r(() => {
|
|
149
|
+
let e = (e, t) => {
|
|
150
|
+
let n = t.getBoundingClientRect().width;
|
|
151
|
+
n > 0 && W(e, n);
|
|
164
152
|
};
|
|
165
|
-
|
|
153
|
+
for (let t of z) {
|
|
154
|
+
let n = V.current.get(t.id);
|
|
155
|
+
n && e(t, n);
|
|
156
|
+
}
|
|
157
|
+
if (typeof ResizeObserver > "u") return;
|
|
158
|
+
let t = new ResizeObserver((t) => {
|
|
159
|
+
for (let n of t) {
|
|
160
|
+
let t = n.target.dataset.columnId, r = z.find((e) => e.id === t);
|
|
161
|
+
r && e(r, n.target);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
for (let e of z) {
|
|
165
|
+
let n = V.current.get(e.id);
|
|
166
|
+
n && t.observe(n);
|
|
167
|
+
}
|
|
168
|
+
return () => t.disconnect();
|
|
169
|
+
}, [W, z]);
|
|
170
|
+
let K = a(null), q = t((e, t) => {
|
|
171
|
+
let n = p(e, t);
|
|
172
|
+
M((t) => ({
|
|
173
|
+
...t,
|
|
174
|
+
widths: {
|
|
175
|
+
...t.widths,
|
|
176
|
+
[e.id]: n
|
|
177
|
+
}
|
|
178
|
+
})), W(e, n);
|
|
179
|
+
}, [W]), J = t((e) => {
|
|
180
|
+
let t = K.current;
|
|
181
|
+
!t || e !== void 0 && t.pointerId !== e || (K.current = null, t.handle.hasPointerCapture?.(t.pointerId) && t.handle.releasePointerCapture?.(t.pointerId));
|
|
166
182
|
}, []);
|
|
183
|
+
n(() => J, [J]);
|
|
184
|
+
let Y = t((e, t) => {
|
|
185
|
+
let n = e.parentElement?.getBoundingClientRect().width ?? 0, r = H[t.id] ?? B(t) ?? f(t).min;
|
|
186
|
+
return p(t, Math.round(n) || r);
|
|
187
|
+
}, [H, B]), se = t((e, t) => {
|
|
188
|
+
if (t.noResize || !e.isPrimary || e.button !== 0 || K.current) return;
|
|
189
|
+
e.preventDefault(), e.stopPropagation();
|
|
190
|
+
let n = e.currentTarget;
|
|
191
|
+
K.current = {
|
|
192
|
+
columnId: t.id,
|
|
193
|
+
startX: e.clientX,
|
|
194
|
+
startWidth: Y(n, t),
|
|
195
|
+
minWidth: f(t).min,
|
|
196
|
+
maxWidth: f(t).max,
|
|
197
|
+
pointerId: e.pointerId,
|
|
198
|
+
handle: n
|
|
199
|
+
}, n.setPointerCapture?.(e.pointerId);
|
|
200
|
+
}, [Y]), ce = t((t) => {
|
|
201
|
+
let n = K.current;
|
|
202
|
+
if (!n || n.pointerId !== t.pointerId) return;
|
|
203
|
+
t.preventDefault(), t.stopPropagation();
|
|
204
|
+
let r = Math.max(n.minWidth, Math.min(n.maxWidth, n.startWidth + t.clientX - n.startX)), i = e.find((e) => e.id === n.columnId);
|
|
205
|
+
i && q(i, r);
|
|
206
|
+
}, [e, q]), X = t((e) => {
|
|
207
|
+
K.current?.pointerId === e.pointerId && (e.preventDefault(), e.stopPropagation(), J(e.pointerId));
|
|
208
|
+
}, [J]), le = t((e, t) => {
|
|
209
|
+
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home") return;
|
|
210
|
+
e.preventDefault(), e.stopPropagation();
|
|
211
|
+
let { min: n, max: r } = f(t), i = Y(e.currentTarget, t), a = e.key === "Home" ? n : Math.min(r, Math.max(n, i + (e.key === "ArrowRight" ? te : -16)));
|
|
212
|
+
q(t, a);
|
|
213
|
+
}, [Y, q]), Z = a(j);
|
|
167
214
|
n(() => {
|
|
168
|
-
|
|
169
|
-
}, [
|
|
170
|
-
let
|
|
171
|
-
if (!
|
|
172
|
-
let t = e.find((e) => e.id ===
|
|
173
|
-
return t?.sortable ?
|
|
215
|
+
Z.current !== j && (Z.current = j, y?.(j));
|
|
216
|
+
}, [j, y]);
|
|
217
|
+
let Q = i(() => {
|
|
218
|
+
if (!I || !L) return l;
|
|
219
|
+
let t = e.find((e) => e.id === I);
|
|
220
|
+
return t?.sortable ? ne(l, re(t, L)) : l;
|
|
174
221
|
}, [
|
|
175
|
-
|
|
222
|
+
l,
|
|
176
223
|
e,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
]),
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
className:
|
|
182
|
-
"data-testid":
|
|
183
|
-
children: /* @__PURE__ */
|
|
224
|
+
I,
|
|
225
|
+
L
|
|
226
|
+
]), $ = ["data-table", b].filter(Boolean).join(" ");
|
|
227
|
+
return /* @__PURE__ */ s("div", {
|
|
228
|
+
className: $,
|
|
229
|
+
"data-testid": w,
|
|
230
|
+
children: /* @__PURE__ */ c("table", {
|
|
184
231
|
className: "data-table__table",
|
|
185
232
|
"aria-label": x,
|
|
186
233
|
role: "table",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ s("thead", {
|
|
188
235
|
className: "data-table__head",
|
|
189
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ s("tr", {
|
|
190
237
|
className: "data-table__row data-table__row--head",
|
|
191
|
-
children:
|
|
192
|
-
let t =
|
|
193
|
-
return /* @__PURE__ */
|
|
238
|
+
children: z.map((e) => {
|
|
239
|
+
let t = B(e), n = p(e, H[e.id] ?? t ?? f(e).min), r = f(e), i = e.sortable && e.id === I;
|
|
240
|
+
return /* @__PURE__ */ c("th", {
|
|
241
|
+
ref: (t) => G(e.id, t),
|
|
242
|
+
"data-column-id": e.id,
|
|
194
243
|
scope: "col",
|
|
195
244
|
className: [
|
|
196
245
|
"data-table__cell",
|
|
197
246
|
"data-table__cell--head",
|
|
247
|
+
!e.noResize && "data-table__cell--resizable",
|
|
198
248
|
e.sortable && "data-table__cell--sortable",
|
|
199
|
-
|
|
249
|
+
i && "data-table__cell--sort-active",
|
|
200
250
|
e.className,
|
|
201
251
|
e.align && `data-table__cell--align-${e.align}`
|
|
202
252
|
].filter(Boolean).join(" "),
|
|
203
|
-
style:
|
|
204
|
-
|
|
253
|
+
style: {
|
|
254
|
+
width: t === void 0 ? void 0 : `${String(t)}px`,
|
|
255
|
+
minWidth: e.minWidth,
|
|
256
|
+
maxWidth: e.noResize ? e.maxWidth : r.max
|
|
257
|
+
},
|
|
258
|
+
"aria-sort": m(e, I, L),
|
|
205
259
|
onClick: e.sortable ? () => {
|
|
206
|
-
|
|
260
|
+
R(e);
|
|
207
261
|
} : void 0,
|
|
208
262
|
onKeyDown: e.sortable ? (t) => {
|
|
209
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
263
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), R(e));
|
|
210
264
|
} : void 0,
|
|
211
265
|
tabIndex: e.sortable ? 0 : void 0,
|
|
212
266
|
children: [
|
|
213
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ s("span", {
|
|
214
268
|
className: "data-table__head-label",
|
|
215
269
|
children: e.header
|
|
216
270
|
}),
|
|
217
|
-
e.sortable && /* @__PURE__ */
|
|
218
|
-
!e.noResize && /* @__PURE__ */
|
|
271
|
+
e.sortable && /* @__PURE__ */ s(h, { direction: i && L ? L : "none" }),
|
|
272
|
+
!e.noResize && /* @__PURE__ */ s("div", {
|
|
219
273
|
role: "separator",
|
|
220
274
|
"aria-orientation": "vertical",
|
|
275
|
+
"aria-label": S(e),
|
|
276
|
+
"aria-valuemin": r.min,
|
|
277
|
+
"aria-valuemax": r.max,
|
|
278
|
+
"aria-valuenow": n,
|
|
279
|
+
"aria-valuetext": C(n, e),
|
|
280
|
+
tabIndex: 0,
|
|
221
281
|
className: "data-table__resize-handle",
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
282
|
+
onClick: (e) => e.stopPropagation(),
|
|
283
|
+
onPointerDown: (t) => se(t, e),
|
|
284
|
+
onPointerMove: ce,
|
|
285
|
+
onPointerUp: X,
|
|
286
|
+
onPointerCancel: X,
|
|
287
|
+
onLostPointerCapture: (e) => J(e.pointerId),
|
|
288
|
+
onKeyDown: (t) => le(t, e)
|
|
225
289
|
})
|
|
226
290
|
]
|
|
227
291
|
}, e.id);
|
|
228
292
|
})
|
|
229
293
|
})
|
|
230
|
-
}), /* @__PURE__ */
|
|
294
|
+
}), /* @__PURE__ */ s("tbody", {
|
|
231
295
|
className: "data-table__body",
|
|
232
|
-
children:
|
|
296
|
+
children: ie ? /* @__PURE__ */ s("tr", {
|
|
233
297
|
className: "data-table__row data-table__row--state",
|
|
234
|
-
children: /* @__PURE__ */
|
|
235
|
-
colSpan:
|
|
298
|
+
children: /* @__PURE__ */ s("td", {
|
|
299
|
+
colSpan: z.length || 1,
|
|
236
300
|
className: "data-table__state-cell",
|
|
237
|
-
children: _ ?? /* @__PURE__ */
|
|
301
|
+
children: _ ?? /* @__PURE__ */ s("div", { className: "data-table__loading" })
|
|
238
302
|
})
|
|
239
|
-
}) :
|
|
303
|
+
}) : Q.length === 0 ? /* @__PURE__ */ s("tr", {
|
|
240
304
|
className: "data-table__row data-table__row--state",
|
|
241
|
-
children: /* @__PURE__ */
|
|
242
|
-
colSpan:
|
|
305
|
+
children: /* @__PURE__ */ s("td", {
|
|
306
|
+
colSpan: z.length || 1,
|
|
243
307
|
className: "data-table__state-cell",
|
|
244
308
|
children: g
|
|
245
309
|
})
|
|
246
|
-
}) :
|
|
247
|
-
let n =
|
|
248
|
-
return /* @__PURE__ */
|
|
249
|
-
className: [
|
|
250
|
-
|
|
251
|
-
|
|
310
|
+
}) : Q.map((e, t) => {
|
|
311
|
+
let n = d(e, t), r = !!(T && (E?.(e, t) ?? !0)), i = D?.(e, t);
|
|
312
|
+
return /* @__PURE__ */ s("tr", {
|
|
313
|
+
className: [
|
|
314
|
+
"data-table__row",
|
|
315
|
+
r && "data-table__row--clickable",
|
|
316
|
+
i
|
|
317
|
+
].filter(Boolean).join(" "),
|
|
318
|
+
onClick: r ? (t) => {
|
|
319
|
+
u(t.target, t.currentTarget) || T?.(e);
|
|
252
320
|
} : void 0,
|
|
253
|
-
onKeyDown:
|
|
254
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
321
|
+
onKeyDown: r ? (t) => {
|
|
322
|
+
(t.key === "Enter" || t.key === " ") && (u(t.target, t.currentTarget) || (t.preventDefault(), T?.(e)));
|
|
255
323
|
} : void 0,
|
|
256
|
-
tabIndex:
|
|
257
|
-
role:
|
|
258
|
-
children:
|
|
324
|
+
tabIndex: r ? 0 : void 0,
|
|
325
|
+
role: r ? "button" : void 0,
|
|
326
|
+
children: z.map((n) => /* @__PURE__ */ s("td", {
|
|
259
327
|
className: [
|
|
260
328
|
"data-table__cell",
|
|
261
329
|
n.className,
|
|
262
330
|
n.align && `data-table__cell--align-${n.align}`
|
|
263
331
|
].filter(Boolean).join(" "),
|
|
332
|
+
style: {
|
|
333
|
+
minWidth: n.minWidth,
|
|
334
|
+
maxWidth: n.noResize ? n.maxWidth : f(n).max
|
|
335
|
+
},
|
|
264
336
|
children: n.render(e, t)
|
|
265
337
|
}, n.id))
|
|
266
338
|
}, n);
|