@stackone/malachite 2.83.1 → 2.84.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/COMPONENTS.md +3 -3
- package/dist/assets/icons/forbidden.svg.js +173 -3
- package/dist/assets/icons/forbidden.svg.js.map +1 -1
- package/dist/assets/icons/navbar_collapse.svg.js +3 -1
- package/dist/assets/icons/navbar_collapse.svg.js.map +1 -1
- package/dist/assets/icons/navbar_expand.svg.js +3 -1
- package/dist/assets/icons/navbar_expand.svg.js.map +1 -1
- package/dist/assets/icons/not_found.svg.js +143 -3
- package/dist/assets/icons/not_found.svg.js.map +1 -1
- package/dist/assets/icons/required_field_indicator.svg.js +7 -1
- package/dist/assets/icons/required_field_indicator.svg.js.map +1 -1
- package/dist/assets/icons/source.svg.js +4 -2
- package/dist/assets/icons/source.svg.js.map +1 -1
- package/dist/assets/icons/webhook_signing_secret.svg.js +3 -1
- package/dist/assets/icons/webhook_signing_secret.svg.js.map +1 -1
- package/dist/components/Accordion.js +124 -101
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/ActionMenu.js +174 -169
- package/dist/components/ActionMenu.js.map +1 -1
- package/dist/components/Alert.js +31 -31
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/PinnedCornerCap.js +23 -0
- package/dist/components/PinnedCornerCap.js.map +1 -0
- package/dist/components/ShadowEscape.js +49 -78
- package/dist/components/ShadowEscape.js.map +1 -1
- package/dist/components/Table/Table.js +291 -310
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/actionMenuStyles.js +86 -68
- package/dist/components/actionMenuStyles.js.map +1 -1
- package/dist/components/buttonStyles.js +2 -0
- package/dist/components/buttonStyles.js.map +1 -1
- package/dist/components/optionRowStyles.js +10 -9
- package/dist/components/optionRowStyles.js.map +1 -1
- package/dist/components/usePinned.js +38 -0
- package/dist/components/usePinned.js.map +1 -0
- package/dist/index.d.ts +23 -1
- package/dist/tailwind.css.js +1 -1
- package/dist/theme.js +21 -16
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { useVirtualizer as
|
|
3
|
-
import me, { useState as V, useRef as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
1
|
+
import { jsx as n, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { useVirtualizer as Ot } from "@tanstack/react-virtual";
|
|
3
|
+
import me, { useState as V, useRef as B, useCallback as We, useId as zt, useEffect as ee, useMemo as rt, useLayoutEffect as ft } from "react";
|
|
4
|
+
import ht from "../CustomIcons/CaretDownIcon.js";
|
|
5
|
+
import Lt from "../CustomIcons/CaretUpIcon.js";
|
|
6
|
+
import Mt from "../CustomIcons/InfoIcon.js";
|
|
7
|
+
import Wt from "../CustomIcons/WarningTriangleIcon.js";
|
|
8
|
+
import Ft from "../PinnedCornerCap.js";
|
|
9
|
+
import At from "../Tooltip.js";
|
|
10
|
+
import Bt from "../TruncatedTooltip.js";
|
|
11
|
+
import { FOCUS_RING_INSET as it, FOCUS_RING_INSET_OVERLAY as Ut } from "../focusRing.js";
|
|
12
|
+
import { isFromInteractiveDescendant as lt, activateOnEnterOrSpace as jt } from "../keyboardActivation.js";
|
|
13
|
+
import { FOREGROUND_RESET as Fe, SELECTED_ROW_ACCENT as ut, SELECTED_TEXT_CONTEXT as pt, SELECTED_ROW_FOREGROUND as gt, SELECTED_ROW_BACKGROUND as Be } from "../selectedRow.js";
|
|
14
|
+
import at from "./TablePagination.js";
|
|
15
|
+
const vt = 160, Pt = (e, r) => e.length === r.length && e.every((a, c) => a === r[c]), st = "\0", Ht = (e, r, a) => {
|
|
15
16
|
if (typeof e != "object" || e === null)
|
|
16
|
-
return `${
|
|
17
|
+
return `${st}i${a}`;
|
|
17
18
|
const c = r.ids.get(e);
|
|
18
19
|
if (c !== void 0)
|
|
19
20
|
return c;
|
|
20
|
-
const R = `${
|
|
21
|
+
const R = `${st}${r.next++}`;
|
|
21
22
|
return r.ids.set(e, R), R;
|
|
22
|
-
},
|
|
23
|
+
}, Gt = (e, r, a) => typeof r == "function" ? e.map((c) => r(c)) : e.map((c, R) => {
|
|
23
24
|
const h = c[r];
|
|
24
|
-
return h == null ?
|
|
25
|
-
}),
|
|
25
|
+
return h == null ? Ht(c, a, R) : String(h);
|
|
26
|
+
}), Se = (e) => {
|
|
26
27
|
if (typeof e == "number")
|
|
27
28
|
return e;
|
|
28
29
|
if (typeof e == "string") {
|
|
@@ -30,91 +31,77 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
30
31
|
if (r)
|
|
31
32
|
return Number(r[1]);
|
|
32
33
|
}
|
|
33
|
-
},
|
|
34
|
-
const r =
|
|
34
|
+
}, Pe = (e) => {
|
|
35
|
+
const r = Se(e.width);
|
|
35
36
|
return !(e.title === "" || e.title == null) && r !== void 0 && typeof e.minWidth == "number" && e.minWidth < r ? e.minWidth : void 0;
|
|
36
|
-
},
|
|
37
|
-
const c =
|
|
38
|
-
return c !== void 0 ? r + c : typeof a.minWidth == "number" ? r + a.minWidth : r +
|
|
39
|
-
}, 0),
|
|
40
|
-
const r = [...e].reverse().findIndex((h) => !
|
|
41
|
-
(h,
|
|
42
|
-
const u =
|
|
43
|
-
return !(
|
|
37
|
+
}, Jt = (e) => e.reduce((r, a) => {
|
|
38
|
+
const c = Pe(a) ?? Se(a.width);
|
|
39
|
+
return c !== void 0 ? r + c : typeof a.minWidth == "number" ? r + a.minWidth : r + vt;
|
|
40
|
+
}, 0), Yt = (e) => (e.title === "" || e.title == null) && Se(e.width) !== void 0, qt = (e) => {
|
|
41
|
+
const r = [...e].reverse().findIndex((h) => !Yt(h)), a = r === -1 ? 0 : e.length - r, c = /* @__PURE__ */ new Map(), R = e.reduceRight(
|
|
42
|
+
(h, w, b) => {
|
|
43
|
+
const u = Pe(w) ?? Se(w.width);
|
|
44
|
+
return !(w.fixed === "right" || b >= a) || u === void 0 ? h : (c.set(w.key, h.right), { right: h.right + u, edge: w.key });
|
|
44
45
|
},
|
|
45
46
|
{ right: 0, edge: void 0 }
|
|
46
47
|
);
|
|
47
48
|
return { offsets: c, edgeKey: R.edge, extent: R.right };
|
|
48
|
-
},
|
|
49
|
+
}, Qt = { overflowX: "auto", scrollbarWidth: "none" }, Vt = {
|
|
49
50
|
position: "sticky",
|
|
50
51
|
left: 0,
|
|
51
52
|
width: "100%"
|
|
52
|
-
},
|
|
53
|
+
}, Zt = { offsets: /* @__PURE__ */ new Map(), edgeKey: void 0, extent: 0 }, Ae = (e) => `color-mix(in srgb, var(--malachite-card-shadow, rgba(0, 0, 0, 0.1)) ${e}%, transparent)`, Xt = {
|
|
53
54
|
position: "absolute",
|
|
54
55
|
top: 0,
|
|
55
56
|
bottom: 0,
|
|
56
57
|
right: 0,
|
|
57
58
|
width: 24,
|
|
58
59
|
pointerEvents: "none",
|
|
59
|
-
backgroundImage: `linear-gradient(to left, ${
|
|
60
|
-
},
|
|
60
|
+
backgroundImage: `linear-gradient(to left, ${Ae(45)}, ${Ae(18)} 30%, ${Ae(5)} 65%, transparent)`
|
|
61
|
+
}, Kt = (e, r) => e === void 0 ? {} : {
|
|
61
62
|
position: "sticky",
|
|
62
63
|
right: e,
|
|
63
64
|
zIndex: 1,
|
|
64
65
|
height: "auto",
|
|
65
66
|
...r === "row" ? { backgroundColor: "inherit", backgroundImage: "inherit" } : { backgroundColor: r }
|
|
66
|
-
},
|
|
67
|
+
}, ot = (e) => `linear-gradient(${e}, ${e})`, en = (e, r) => {
|
|
67
68
|
if (!e && !r)
|
|
68
69
|
return {};
|
|
69
70
|
const a = [
|
|
70
|
-
r ?
|
|
71
|
-
e ?
|
|
72
|
-
].filter(
|
|
71
|
+
r ? ot(Be) : void 0,
|
|
72
|
+
e ? ot(`var(--malachite-table-row-variant-${e}-background)`) : void 0
|
|
73
|
+
].filter(He);
|
|
73
74
|
return {
|
|
74
75
|
backgroundColor: e ? "var(--malachite-table-background, #f7f7f7)" : "var(--malachite-table-row-background, #fff)",
|
|
75
76
|
backgroundImage: a.join(", ")
|
|
76
77
|
};
|
|
77
|
-
},
|
|
78
|
+
}, He = (e) => typeof e == "string", Ue = "text-[var(--malachite-text-primary,#0a0a0a)]", je = "text-[var(--malachite-text-dimmed,#a1a1a1)]", se = (e) => ({
|
|
78
79
|
small: "text-[length:var(--malachite-font-size-small)]",
|
|
79
80
|
medium: "text-[length:var(--malachite-font-size-medium)]",
|
|
80
81
|
large: "text-[length:var(--malachite-font-size-large)]"
|
|
81
|
-
})[e],
|
|
82
|
+
})[e], dt = {
|
|
82
83
|
borderBottom: "1px solid var(--malachite-card-border, #e8e8e8)"
|
|
83
|
-
},
|
|
84
|
+
}, ct = (e, r) => {
|
|
84
85
|
e && r && r.scrollLeft !== e.scrollLeft && (r.scrollLeft = e.scrollLeft);
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
position: "absolute",
|
|
93
|
-
top: 0,
|
|
94
|
-
left: 0,
|
|
95
|
-
right: 0,
|
|
96
|
-
height: e,
|
|
97
|
-
pointerEvents: "none",
|
|
98
|
-
background: [
|
|
99
|
-
`radial-gradient(circle ${e} at ${e} ${e}, transparent calc(${e} - 0.5px), ${r} ${e}) top left / ${e} ${e} no-repeat`,
|
|
100
|
-
`radial-gradient(circle ${e} at 0 ${e}, transparent calc(${e} - 0.5px), ${r} ${e}) top right / ${e} ${e} no-repeat`
|
|
101
|
-
].join(", ")
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
}, an = ({
|
|
86
|
+
}, tn = 56, nn = 44, rn = 8, ln = 10, le = 8, an = "var(--malachite-radius-xl, 12px)", ae = 4, sn = "--malachite-ctx-table-surround", on = () => /* @__PURE__ */ n(
|
|
87
|
+
Ft,
|
|
88
|
+
{
|
|
89
|
+
radius: an,
|
|
90
|
+
surround: `var(${sn}, var(--malachite-card-background, #ffffff))`
|
|
91
|
+
}
|
|
92
|
+
), dn = ({
|
|
106
93
|
records: e,
|
|
107
94
|
startIndex: r,
|
|
108
95
|
scrollElement: a,
|
|
109
96
|
estimateRowHeight: c,
|
|
110
97
|
style: R,
|
|
111
98
|
renderRow: h,
|
|
112
|
-
registerHandle:
|
|
113
|
-
cardKey:
|
|
99
|
+
registerHandle: w,
|
|
100
|
+
cardKey: b,
|
|
114
101
|
rovingIndex: u
|
|
115
102
|
}) => {
|
|
116
|
-
const D =
|
|
117
|
-
|
|
103
|
+
const D = B(null), [T, M] = V(0);
|
|
104
|
+
ft(() => {
|
|
118
105
|
const E = D.current;
|
|
119
106
|
if (!E || !a)
|
|
120
107
|
return;
|
|
@@ -140,82 +127,76 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
140
127
|
}
|
|
141
128
|
return () => ne.disconnect();
|
|
142
129
|
}, [a, e.length, r]);
|
|
143
|
-
const
|
|
130
|
+
const _ = Ot({
|
|
144
131
|
count: e.length,
|
|
145
132
|
// State, not a ref: an ancestor's ref is not attached when this child's layout effects
|
|
146
133
|
// run, so a ref would leave the virtualizer without a scroll element.
|
|
147
134
|
getScrollElement: () => a,
|
|
148
135
|
estimateSize: () => c,
|
|
149
|
-
overscan:
|
|
136
|
+
overscan: rn,
|
|
150
137
|
scrollMargin: T
|
|
151
138
|
});
|
|
152
139
|
ee(() => {
|
|
153
|
-
if (
|
|
154
|
-
return
|
|
140
|
+
if (w)
|
|
141
|
+
return w(b, {
|
|
155
142
|
startIndex: r,
|
|
156
143
|
count: e.length,
|
|
157
|
-
scrollToIndex: (E) =>
|
|
158
|
-
}), () =>
|
|
159
|
-
}, [
|
|
160
|
-
const C =
|
|
144
|
+
scrollToIndex: (E) => _.scrollToIndex(E, { align: "center" })
|
|
145
|
+
}), () => w(b, null);
|
|
146
|
+
}, [w, b, r, e.length, _]);
|
|
147
|
+
const C = _.getVirtualItems(), te = _.getTotalSize(), G = u >= r && u < r + e.length && C.length > 0 ? Math.min(
|
|
161
148
|
Math.max(u, r + C[0].index),
|
|
162
149
|
r + C[C.length - 1].index
|
|
163
|
-
) : u,
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
|
|
150
|
+
) : u, U = C.length > 0 ? C[0].start - T : 0, j = C.length > 0 ? te - (C[C.length - 1].end - T) : 0;
|
|
151
|
+
return /* @__PURE__ */ k("div", { ref: D, className: "flex flex-col w-full", style: R, children: [
|
|
152
|
+
U > 0 && /* @__PURE__ */ n("div", { "aria-hidden": "true", style: { height: U, flexShrink: 0 } }),
|
|
166
153
|
C.map(
|
|
167
154
|
(E) => h(
|
|
168
155
|
e[E.index],
|
|
169
156
|
r + E.index,
|
|
170
157
|
E.index === e.length - 1,
|
|
171
158
|
E.index === 0,
|
|
172
|
-
{ measureRef:
|
|
159
|
+
{ measureRef: _.measureElement, index: E.index },
|
|
173
160
|
G
|
|
174
161
|
)
|
|
175
162
|
),
|
|
176
|
-
|
|
163
|
+
j > 0 && /* @__PURE__ */ n("div", { "aria-hidden": "true", style: { height: j, flexShrink: 0 } })
|
|
177
164
|
] });
|
|
178
|
-
},
|
|
179
|
-
const a = r ?
|
|
165
|
+
}, cn = (e, r) => {
|
|
166
|
+
const a = r ? tn : 0;
|
|
180
167
|
return typeof e == "number" ? `${Math.max(0, e - a)}px` : `calc(${e} - ${a}px)`;
|
|
181
168
|
}, oe = (e) => {
|
|
182
169
|
const r = e.width;
|
|
183
170
|
if (r == null)
|
|
184
171
|
return {};
|
|
185
|
-
const a = typeof r == "number" ? `${r}px` : r, c =
|
|
172
|
+
const a = typeof r == "number" ? `${r}px` : r, c = Pe(e);
|
|
186
173
|
return c === void 0 ? { flexBasis: a, maxWidth: a } : { flexBasis: a, maxWidth: a, minWidth: c, flexShrink: 1 };
|
|
187
|
-
},
|
|
174
|
+
}, Ge = (e) => {
|
|
188
175
|
const r = e.width;
|
|
189
176
|
if (r == null)
|
|
190
177
|
return {};
|
|
191
178
|
const a = typeof r == "number" ? `${r}px` : r;
|
|
192
179
|
return { width: a, flexBasis: a };
|
|
193
|
-
},
|
|
194
|
-
zt,
|
|
195
|
-
{
|
|
196
|
-
size: 13,
|
|
197
|
-
className: "shrink-0 text-[var(--malachite-text-secondary,#bbb)]"
|
|
198
|
-
}
|
|
199
|
-
) }), bt = (e, r) => ({
|
|
180
|
+
}, fn = (e) => e === "asc" ? "ascending" : e === "desc" ? "descending" : "none", Z = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-start", hn = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-between", de = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", bt = (e) => e ? Z(e) : "justify-end", ye = ({ info: e }) => /* @__PURE__ */ n(At, { text: e, placement: "top", children: /* @__PURE__ */ n(Mt, { size: 13, className: "shrink-0 text-[var(--malachite-text-secondary,#bbb)]" }) }), xt = (e, r) => ({
|
|
200
181
|
type: "button",
|
|
201
182
|
onClick: r,
|
|
202
183
|
"aria-label": typeof e == "string" ? `Sort by ${e}` : "Sort column"
|
|
203
|
-
}),
|
|
184
|
+
}), un = ({
|
|
204
185
|
column: e,
|
|
205
186
|
record: r,
|
|
206
187
|
index: a,
|
|
207
188
|
size: c,
|
|
208
189
|
paddingYClass: R,
|
|
209
190
|
bordered: h,
|
|
210
|
-
isFirstRow:
|
|
211
|
-
isLastRow:
|
|
191
|
+
isFirstRow: w,
|
|
192
|
+
isLastRow: b,
|
|
212
193
|
isFirstColumn: u,
|
|
213
194
|
isLastColumn: D,
|
|
214
195
|
variantBackground: T,
|
|
215
196
|
showSelectedAccent: M,
|
|
216
|
-
isSelected:
|
|
197
|
+
isSelected: _
|
|
217
198
|
}) => {
|
|
218
|
-
const C = r[e.dataIndex], te = e.render ? e.render(C, r, a) : C == null ? "" : String(C), q = e.ellipsis &&
|
|
199
|
+
const C = r[e.dataIndex], te = e.render ? e.render(C, r, a) : C == null ? "" : String(C), q = e.ellipsis && He(C) ? C : void 0;
|
|
219
200
|
return /* @__PURE__ */ n(
|
|
220
201
|
"td",
|
|
221
202
|
{
|
|
@@ -223,34 +204,34 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
223
204
|
table-cell px-4 ${R} ${se(c)}
|
|
224
205
|
${e.ellipsis ? "truncate overflow-hidden whitespace-nowrap" : ""}
|
|
225
206
|
${h ? "table-cell-bordered" : ""}
|
|
226
|
-
${h &&
|
|
207
|
+
${h && w ? "table-cell-bordered-top" : ""}
|
|
227
208
|
${h && u ? "table-cell-bordered-left" : ""}
|
|
228
209
|
${h && D ? "table-cell-bordered-right" : ""}
|
|
229
|
-
${h && u &&
|
|
230
|
-
${h && D &&
|
|
231
|
-
${h && u &&
|
|
232
|
-
${h && D &&
|
|
210
|
+
${h && u && w ? "rounded-tl-lg" : ""}
|
|
211
|
+
${h && D && w ? "rounded-tr-lg" : ""}
|
|
212
|
+
${h && u && b ? "rounded-bl-lg" : ""}
|
|
213
|
+
${h && D && b ? "rounded-br-lg" : ""}
|
|
233
214
|
${de(e.align)}
|
|
234
215
|
`,
|
|
235
216
|
style: {
|
|
236
217
|
width: e.width,
|
|
237
218
|
backgroundColor: T ?? // Mirror the row's background, or the tint composites over the wrong opaque
|
|
238
219
|
// base — they differ in dark mode.
|
|
239
|
-
(
|
|
220
|
+
(_ ? h ? "var(--malachite-table-borderedRow-background, #fff)" : "var(--malachite-table-row-background, #fff)" : void 0),
|
|
240
221
|
// Its own layer, so the tint composites over the cell instead of replacing it.
|
|
241
|
-
backgroundImage:
|
|
222
|
+
backgroundImage: _ ? `linear-gradient(${Be}, ${Be})` : void 0,
|
|
242
223
|
// Content pinning its own colour follows via the channel below.
|
|
243
|
-
color:
|
|
244
|
-
...
|
|
224
|
+
color: _ ? gt : "var(--malachite-table-row-foreground)",
|
|
225
|
+
..._ ? pt : {},
|
|
245
226
|
// Inset box-shadow, not `ring-*`: --tw-ring-* silently doesn't paint in a shadow root.
|
|
246
|
-
boxShadow: M ? `inset 2px 0 0 ${
|
|
247
|
-
borderBottom: h ? void 0 :
|
|
227
|
+
boxShadow: M ? `inset 2px 0 0 ${ut}` : void 0,
|
|
228
|
+
borderBottom: h ? void 0 : b ? "none" : "1px solid var(--malachite-table-row-border)"
|
|
248
229
|
},
|
|
249
230
|
title: q,
|
|
250
231
|
children: te
|
|
251
232
|
}
|
|
252
233
|
);
|
|
253
|
-
},
|
|
234
|
+
}, pn = ({
|
|
254
235
|
column: e,
|
|
255
236
|
sortDirection: r,
|
|
256
237
|
onSort: a,
|
|
@@ -263,7 +244,7 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
263
244
|
{
|
|
264
245
|
className: "h-full shrink-0",
|
|
265
246
|
style: {
|
|
266
|
-
...
|
|
247
|
+
...Ge(e),
|
|
267
248
|
...c
|
|
268
249
|
}
|
|
269
250
|
}
|
|
@@ -279,11 +260,11 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
279
260
|
}
|
|
280
261
|
}
|
|
281
262
|
);
|
|
282
|
-
const
|
|
283
|
-
|
|
263
|
+
const b = typeof e.title == "string" ? /* @__PURE__ */ n("p", { className: "font-medium text-[13px] text-[var(--malachite-text-primary,#0a0a0a)] tracking-[0.13px] whitespace-nowrap truncate", children: e.title }) : e.title, u = /* @__PURE__ */ n(
|
|
264
|
+
ht,
|
|
284
265
|
{
|
|
285
266
|
size: 13,
|
|
286
|
-
className: `shrink-0 transition-transform ${r ?
|
|
267
|
+
className: `shrink-0 transition-transform ${r ? Ue : je} ${r === "asc" ? "rotate-180" : ""}`
|
|
287
268
|
}
|
|
288
269
|
);
|
|
289
270
|
return R ? /* @__PURE__ */ n(
|
|
@@ -291,14 +272,14 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
291
272
|
{
|
|
292
273
|
className: "flex flex-[1_0_0] min-w-0 overflow-hidden",
|
|
293
274
|
style: { ...oe(e), ...c },
|
|
294
|
-
children: /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ k(
|
|
295
276
|
"button",
|
|
296
277
|
{
|
|
297
|
-
...
|
|
298
|
-
className: `flex flex-1 items-center ${
|
|
278
|
+
...xt(e.title, a),
|
|
279
|
+
className: `flex flex-1 items-center ${hn(e.align)} gap-1 min-w-0 px-4 py-3 cursor-pointer appearance-none bg-transparent border-0 ${de(e.align)}`,
|
|
299
280
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
|
|
281
|
+
/* @__PURE__ */ k("div", { className: "flex items-center gap-1 min-w-0", children: [
|
|
282
|
+
b,
|
|
302
283
|
e.info && /* @__PURE__ */ n(ye, { info: e.info })
|
|
303
284
|
] }),
|
|
304
285
|
u
|
|
@@ -314,71 +295,71 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
314
295
|
...oe(e),
|
|
315
296
|
...c
|
|
316
297
|
},
|
|
317
|
-
children: /* @__PURE__ */
|
|
318
|
-
|
|
298
|
+
children: /* @__PURE__ */ k("div", { className: "flex items-center gap-1 min-w-0", children: [
|
|
299
|
+
b,
|
|
319
300
|
e.info && /* @__PURE__ */ n(ye, { info: e.info })
|
|
320
301
|
] })
|
|
321
302
|
}
|
|
322
303
|
);
|
|
323
|
-
},
|
|
304
|
+
}, gn = ({
|
|
324
305
|
column: e,
|
|
325
306
|
record: r,
|
|
326
307
|
index: a,
|
|
327
308
|
size: c,
|
|
328
309
|
paddingYClass: R,
|
|
329
310
|
isSelected: h = !1,
|
|
330
|
-
cellStyle:
|
|
311
|
+
cellStyle: w
|
|
331
312
|
}) => {
|
|
332
|
-
const
|
|
333
|
-
color:
|
|
334
|
-
...
|
|
313
|
+
const b = r[e.dataIndex], u = e.render ? e.render(b, r, a) : b == null ? "" : String(b), T = (e.title === "" || e.title == null) && e.width !== void 0, M = He(b) && b.length > 0, _ = h ? {
|
|
314
|
+
color: gt,
|
|
315
|
+
...pt
|
|
335
316
|
} : {};
|
|
336
317
|
if (T)
|
|
337
318
|
return /* @__PURE__ */ n(
|
|
338
319
|
"div",
|
|
339
320
|
{
|
|
340
|
-
className: `flex items-center ${
|
|
321
|
+
className: `flex items-center ${bt(e.align)} shrink-0 overflow-hidden px-4 ${R}`,
|
|
341
322
|
style: {
|
|
342
|
-
...
|
|
343
|
-
...
|
|
344
|
-
...
|
|
323
|
+
...Ge(e),
|
|
324
|
+
..._,
|
|
325
|
+
...w
|
|
345
326
|
},
|
|
346
327
|
children: u
|
|
347
328
|
}
|
|
348
329
|
);
|
|
349
|
-
const C = !e.render && M ? /* @__PURE__ */ n(
|
|
330
|
+
const C = !e.render && M ? /* @__PURE__ */ n(Bt, { text: b, children: u }) : u;
|
|
350
331
|
return /* @__PURE__ */ n(
|
|
351
332
|
"div",
|
|
352
333
|
{
|
|
353
334
|
className: `flex flex-[1_0_0] items-center min-w-0 overflow-hidden px-4 ${R} ${se(c)} ${Z(e.align)}`,
|
|
354
335
|
style: {
|
|
355
336
|
...oe(e),
|
|
356
|
-
...
|
|
357
|
-
...
|
|
337
|
+
..._,
|
|
338
|
+
...w
|
|
358
339
|
},
|
|
359
340
|
children: C
|
|
360
341
|
}
|
|
361
342
|
);
|
|
362
|
-
},
|
|
343
|
+
}, In = ({
|
|
363
344
|
columns: e,
|
|
364
345
|
data: r,
|
|
365
346
|
loading: a = !1,
|
|
366
347
|
error: c = !1,
|
|
367
348
|
errorTitle: R = "Data unavailable",
|
|
368
349
|
errorSubTitle: h = "There was an issue retrieving the data. Please try again.",
|
|
369
|
-
emptyTitle:
|
|
370
|
-
emptySubTitle:
|
|
350
|
+
emptyTitle: w = "No data",
|
|
351
|
+
emptySubTitle: b = "",
|
|
371
352
|
bordered: u = !1,
|
|
372
353
|
showHeader: D = !0,
|
|
373
354
|
rowKey: T = "key",
|
|
374
355
|
scrollHeight: M,
|
|
375
|
-
size:
|
|
356
|
+
size: _ = "small",
|
|
376
357
|
rowDensity: C = "default",
|
|
377
358
|
layout: te = "auto",
|
|
378
359
|
headerVariant: q = "inline",
|
|
379
360
|
rowClassName: G,
|
|
380
|
-
rowVariant:
|
|
381
|
-
onRow:
|
|
361
|
+
rowVariant: U,
|
|
362
|
+
onRow: j,
|
|
382
363
|
onClickRow: E,
|
|
383
364
|
selectedRowKey: O,
|
|
384
365
|
scrollSelectedIntoView: ne = !0,
|
|
@@ -386,79 +367,79 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
386
367
|
pagination: f,
|
|
387
368
|
className: J = "",
|
|
388
369
|
style: X,
|
|
389
|
-
stickyHeaderTop:
|
|
370
|
+
stickyHeaderTop: ke,
|
|
390
371
|
scrollX: P = !1,
|
|
391
|
-
rowSection:
|
|
392
|
-
renderSectionDivider:
|
|
372
|
+
rowSection: we,
|
|
373
|
+
renderSectionDivider: $e,
|
|
393
374
|
onVisibleOrderChange: Ne,
|
|
394
|
-
virtual:
|
|
395
|
-
virtualRowHeightEstimate:
|
|
375
|
+
virtual: mt = !1,
|
|
376
|
+
virtualRowHeightEstimate: yt,
|
|
396
377
|
virtualScrollElement: ce = null
|
|
397
378
|
}) => {
|
|
398
|
-
const re = C === "compact" ? "py-1.5" : "py-3", [
|
|
379
|
+
const re = C === "compact" ? "py-1.5" : "py-3", [I, St] = V(null), Je = B(null), Ce = B(null), ie = B(null), Ee = B(null), Re = B(/* @__PURE__ */ new Map()), kt = We(
|
|
399
380
|
(t, i) => {
|
|
400
381
|
i ? Re.current.set(t, i) : Re.current.delete(t);
|
|
401
382
|
},
|
|
402
383
|
[]
|
|
403
|
-
), Q =
|
|
404
|
-
ie.current = t, t &&
|
|
405
|
-
}, []),
|
|
384
|
+
), Q = zt(), [wt, _e] = V(0), Y = mt && q === "detached", $t = yt ?? nn, [fe, Nt] = V(null), Ct = We((t) => {
|
|
385
|
+
ie.current = t, t && Nt((i) => i === t ? i : t);
|
|
386
|
+
}, []), Ie = Y ? ce ?? fe : null, Ye = P ? Jt(e) : 0, he = P && q === "detached" ? qt(e) : Zt, ue = he.edgeKey !== void 0, [Et, qe] = V(!1), [Rt, Qe] = V(0), pe = We(() => {
|
|
406
387
|
const t = ie.current;
|
|
407
|
-
|
|
388
|
+
qe(
|
|
408
389
|
t !== null && t.scrollLeft + t.clientWidth < t.scrollWidth - 1
|
|
409
|
-
),
|
|
390
|
+
), Qe(t === null ? 0 : t.offsetWidth - t.clientWidth);
|
|
410
391
|
}, []);
|
|
411
392
|
ee(() => {
|
|
412
393
|
if (!ue || !fe) {
|
|
413
|
-
|
|
394
|
+
qe(!1), Qe(0);
|
|
414
395
|
return;
|
|
415
396
|
}
|
|
416
397
|
if (pe(), typeof ResizeObserver > "u")
|
|
417
398
|
return;
|
|
418
399
|
const t = new ResizeObserver(pe);
|
|
419
400
|
return t.observe(fe), () => t.disconnect();
|
|
420
|
-
}, [ue, fe,
|
|
421
|
-
const De = !(Y && ce), H = q === "detached" &&
|
|
401
|
+
}, [ue, fe, Ye, pe]);
|
|
402
|
+
const De = !(Y && ce), H = q === "detached" && ke !== void 0 && D && !M && (!Y || !De), Ve = O != null, [Te, Ze] = V(0);
|
|
422
403
|
ee(() => {
|
|
423
|
-
const t =
|
|
424
|
-
if (!t || !H || !
|
|
425
|
-
|
|
404
|
+
const t = Je.current;
|
|
405
|
+
if (!t || !H || !Ve || typeof ResizeObserver > "u") {
|
|
406
|
+
Ze(0);
|
|
426
407
|
return;
|
|
427
408
|
}
|
|
428
409
|
const i = new ResizeObserver((p) => {
|
|
429
410
|
var g, m;
|
|
430
411
|
const s = p[0], x = ((m = (g = s == null ? void 0 : s.borderBoxSize) == null ? void 0 : g[0]) == null ? void 0 : m.blockSize) ?? (s == null ? void 0 : s.contentRect.height) ?? 0;
|
|
431
|
-
|
|
432
|
-
(
|
|
412
|
+
Ze(
|
|
413
|
+
($) => Math.abs($ - x) < 1 ? $ : x
|
|
433
414
|
);
|
|
434
415
|
});
|
|
435
416
|
return i.observe(t), () => i.disconnect();
|
|
436
|
-
}, [H,
|
|
437
|
-
const
|
|
417
|
+
}, [H, Ve]);
|
|
418
|
+
const _t = H ? (ke ?? 0) + Te : void 0, { sortedData: z, sectionDividers: Oe } = rt(() => {
|
|
438
419
|
const t = (g) => {
|
|
439
|
-
if (!
|
|
440
|
-
const m = e.find((o) => o.key ===
|
|
420
|
+
if (!I) return g;
|
|
421
|
+
const m = e.find((o) => o.key === I.key);
|
|
441
422
|
if (!m) return g;
|
|
442
423
|
if (typeof m.sorter == "function") {
|
|
443
424
|
const o = [...g].sort(m.sorter);
|
|
444
|
-
return
|
|
425
|
+
return I.direction === "asc" ? o : o.reverse();
|
|
445
426
|
}
|
|
446
|
-
const
|
|
427
|
+
const $ = m.dataIndex ?? I.key;
|
|
447
428
|
return [...g].sort((o, d) => {
|
|
448
|
-
const l = o[
|
|
449
|
-
return l <
|
|
429
|
+
const l = o[$], S = d[$];
|
|
430
|
+
return l < S ? I.direction === "asc" ? -1 : 1 : l > S ? I.direction === "asc" ? 1 : -1 : 0;
|
|
450
431
|
});
|
|
451
432
|
};
|
|
452
|
-
if (!
|
|
433
|
+
if (!we)
|
|
453
434
|
return {
|
|
454
435
|
sortedData: t(r),
|
|
455
436
|
sectionDividers: /* @__PURE__ */ new Map()
|
|
456
437
|
};
|
|
457
438
|
const i = [], p = /* @__PURE__ */ new Map();
|
|
458
439
|
for (const g of r) {
|
|
459
|
-
const m =
|
|
460
|
-
let
|
|
461
|
-
|
|
440
|
+
const m = we(g);
|
|
441
|
+
let $ = p.get(m);
|
|
442
|
+
$ === void 0 && ($ = i.length, p.set(m, $), i.push({ key: m, records: [] })), i[$].records.push(g);
|
|
462
443
|
}
|
|
463
444
|
const s = [], x = /* @__PURE__ */ new Map();
|
|
464
445
|
for (const g of i) {
|
|
@@ -466,26 +447,26 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
466
447
|
x.set(s.length, { key: g.key, records: m }), s.push(...m);
|
|
467
448
|
}
|
|
468
449
|
return { sortedData: s, sectionDividers: x };
|
|
469
|
-
}, [r,
|
|
470
|
-
|
|
471
|
-
}, ze = (t, i) => typeof T == "function" ? T(t) : String(t[T] ?? i),
|
|
450
|
+
}, [r, I, e, we]), Xe = (t) => {
|
|
451
|
+
St((i) => (i == null ? void 0 : i.key) === t ? i.direction === "asc" ? { key: t, direction: "desc" } : null : { key: t, direction: "asc" });
|
|
452
|
+
}, ze = (t, i) => typeof T == "function" ? T(t) : String(t[T] ?? i), Ke = typeof T == "function" ? null : T, et = B(void 0), ge = B(void 0);
|
|
472
453
|
ee(() => {
|
|
473
454
|
if (!Ne)
|
|
474
455
|
return;
|
|
475
456
|
ge.current ?? (ge.current = { ids: /* @__PURE__ */ new WeakMap(), next: 0 });
|
|
476
|
-
const t =
|
|
477
|
-
i &&
|
|
478
|
-
}, [z,
|
|
479
|
-
const K = Math.min(
|
|
457
|
+
const t = Gt(z, T, ge.current), i = et.current;
|
|
458
|
+
i && Pt(i, t) || (et.current = t, Ne(z));
|
|
459
|
+
}, [z, Ke, Ne]);
|
|
460
|
+
const K = Math.min(wt, Math.max(0, z.length - 1)), L = rt(() => {
|
|
480
461
|
if (O == null)
|
|
481
462
|
return -1;
|
|
482
463
|
const t = String(O);
|
|
483
464
|
return z.findIndex((i, p) => ze(i, p) === t);
|
|
484
|
-
}, [O, z,
|
|
465
|
+
}, [O, z, Ke]);
|
|
485
466
|
ee(() => {
|
|
486
|
-
L >= 0 &&
|
|
467
|
+
L >= 0 && _e(L);
|
|
487
468
|
}, [L]);
|
|
488
|
-
const Le =
|
|
469
|
+
const Le = B(void 0);
|
|
489
470
|
ee(() => {
|
|
490
471
|
if (O == null) {
|
|
491
472
|
Le.current = void 0;
|
|
@@ -494,7 +475,7 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
494
475
|
if (!ne || L < 0)
|
|
495
476
|
return;
|
|
496
477
|
const t = Le.current;
|
|
497
|
-
if (t && t.key === O && t.index === L || a || c || Y && !
|
|
478
|
+
if (t && t.key === O && t.index === L || a || c || Y && !Ie)
|
|
498
479
|
return;
|
|
499
480
|
const i = Ee.current;
|
|
500
481
|
if (!i)
|
|
@@ -502,8 +483,8 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
502
483
|
const p = H && Te === 0, s = (l) => i.querySelector(
|
|
503
484
|
`[data-table-id="${Q}"][data-row-index="${l}"]`
|
|
504
485
|
), x = (l) => {
|
|
505
|
-
const
|
|
506
|
-
l.scrollIntoView({ block: "nearest", inline: "nearest" }),
|
|
486
|
+
const S = ie.current, v = ce, F = S == null ? void 0 : S.scrollLeft, A = v == null ? void 0 : v.scrollLeft;
|
|
487
|
+
l.scrollIntoView({ block: "nearest", inline: "nearest" }), S && F !== void 0 && (S.scrollLeft = F), v && A !== void 0 && (v.scrollLeft = A), p || (Le.current = { key: O, index: L });
|
|
507
488
|
}, g = s(L);
|
|
508
489
|
if (g) {
|
|
509
490
|
x(g);
|
|
@@ -517,21 +498,21 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
517
498
|
if (!m)
|
|
518
499
|
return;
|
|
519
500
|
m.scrollToIndex(L - m.startIndex);
|
|
520
|
-
let
|
|
501
|
+
let $ = 0, o = 0;
|
|
521
502
|
const d = () => {
|
|
522
503
|
const l = s(L);
|
|
523
504
|
if (l) {
|
|
524
505
|
x(l);
|
|
525
506
|
return;
|
|
526
507
|
}
|
|
527
|
-
++o <
|
|
508
|
+
++o < ln && ($ = requestAnimationFrame(d));
|
|
528
509
|
};
|
|
529
|
-
return
|
|
510
|
+
return $ = requestAnimationFrame(d), () => cancelAnimationFrame($);
|
|
530
511
|
}, [
|
|
531
512
|
O,
|
|
532
513
|
L,
|
|
533
514
|
Y,
|
|
534
|
-
|
|
515
|
+
Ie,
|
|
535
516
|
ce,
|
|
536
517
|
H,
|
|
537
518
|
Te,
|
|
@@ -540,10 +521,10 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
540
521
|
Q,
|
|
541
522
|
ne
|
|
542
523
|
]);
|
|
543
|
-
const Me =
|
|
544
|
-
Me.current = t,
|
|
524
|
+
const Me = B(null), tt = (t, i) => {
|
|
525
|
+
Me.current = t, _e(Math.min(Math.max(0, i), z.length - 1));
|
|
545
526
|
};
|
|
546
|
-
|
|
527
|
+
ft(() => {
|
|
547
528
|
const t = Me.current;
|
|
548
529
|
if (!t)
|
|
549
530
|
return;
|
|
@@ -558,25 +539,25 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
558
539
|
const x = i.querySelectorAll(
|
|
559
540
|
`[data-table-id="${Q}"][data-row-index]`
|
|
560
541
|
), g = K > 0 ? x[x.length - 1] : x[0];
|
|
561
|
-
g && (
|
|
542
|
+
g && (_e(Number(g.dataset.rowIndex)), g.focus());
|
|
562
543
|
}, [K, Q]);
|
|
563
|
-
const
|
|
544
|
+
const nt = (t, i) => (p) => {
|
|
564
545
|
const s = { ArrowDown: 1, ArrowUp: -1 }[p.key];
|
|
565
546
|
if (s !== void 0) {
|
|
566
|
-
p.preventDefault(),
|
|
547
|
+
p.preventDefault(), tt(p.currentTarget, t + s);
|
|
567
548
|
return;
|
|
568
549
|
}
|
|
569
550
|
if (!Y && (p.key === "Home" || p.key === "End")) {
|
|
570
|
-
p.preventDefault(),
|
|
551
|
+
p.preventDefault(), tt(p.currentTarget, p.key === "Home" ? 0 : z.length - 1);
|
|
571
552
|
return;
|
|
572
553
|
}
|
|
573
|
-
i &&
|
|
554
|
+
i && jt(p, i, "enter");
|
|
574
555
|
};
|
|
575
556
|
if (q === "detached") {
|
|
576
|
-
const t = P ? { minWidth:
|
|
577
|
-
...P && o.width === void 0 ? { minWidth: o.minWidth ??
|
|
578
|
-
...
|
|
579
|
-
}), p = (o) => o.key === he.edgeKey &&
|
|
557
|
+
const t = P ? { minWidth: Ye } : {}, i = (o, d) => ({
|
|
558
|
+
...P && o.width === void 0 ? { minWidth: o.minWidth ?? vt } : {},
|
|
559
|
+
...Kt(he.offsets.get(o.key), d)
|
|
560
|
+
}), p = (o) => o.key === he.edgeKey && Et ? /* @__PURE__ */ n(
|
|
580
561
|
"span",
|
|
581
562
|
{
|
|
582
563
|
"aria-hidden": "true",
|
|
@@ -586,7 +567,7 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
586
567
|
right: he.extent,
|
|
587
568
|
zIndex: 1
|
|
588
569
|
},
|
|
589
|
-
children: /* @__PURE__ */ n("span", { style:
|
|
570
|
+
children: /* @__PURE__ */ n("span", { style: Xt })
|
|
590
571
|
}
|
|
591
572
|
) : null, s = H ? "var(--malachite-table-header-background, #f7f7f7)" : "var(--malachite-table-background, #f7f7f7)", x = {
|
|
592
573
|
border: "1px solid var(--malachite-card-border, #e8e8e8)",
|
|
@@ -594,32 +575,32 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
594
575
|
overflow: "clip",
|
|
595
576
|
flexShrink: 0,
|
|
596
577
|
...t
|
|
597
|
-
}, g = (o, d, l = !1,
|
|
598
|
-
const
|
|
578
|
+
}, g = (o, d, l = !1, S = !1, v, F = K) => {
|
|
579
|
+
const A = ze(o, d), y = (j == null ? void 0 : j(o, d)) || {}, Dt = U == null ? void 0 : U(o, d), ve = d === L, be = E || y.onClick ? () => {
|
|
599
580
|
var N;
|
|
600
581
|
E == null || E(o, d), (N = y.onClick) == null || N.call(y, o, d);
|
|
601
|
-
} : void 0, xe = !!
|
|
602
|
-
return /* @__PURE__ */
|
|
582
|
+
} : void 0, xe = !!be, Tt = l ? {} : dt;
|
|
583
|
+
return /* @__PURE__ */ k(
|
|
603
584
|
"div",
|
|
604
585
|
{
|
|
605
|
-
ref:
|
|
606
|
-
"data-index":
|
|
586
|
+
ref: v == null ? void 0 : v.measureRef,
|
|
587
|
+
"data-index": v == null ? void 0 : v.index,
|
|
607
588
|
"data-table-id": Q,
|
|
608
589
|
"data-row-index": d,
|
|
609
|
-
"aria-current":
|
|
590
|
+
"aria-current": ve ? "true" : void 0,
|
|
610
591
|
tabIndex: xe ? d === F ? 0 : -1 : void 0,
|
|
611
|
-
onKeyDown: xe ?
|
|
592
|
+
onKeyDown: xe ? nt(d, be) : void 0,
|
|
612
593
|
className: `
|
|
613
594
|
group bg-[var(--malachite-table-row-background,#fff)] flex min-h-10 items-stretch relative w-full
|
|
614
|
-
${xe ? `cursor-pointer hover:bg-[var(--malachite-table-row-hover-background,#fafafa)] ${
|
|
595
|
+
${xe ? `cursor-pointer hover:bg-[var(--malachite-table-row-hover-background,#fafafa)] ${it}` : ""}
|
|
615
596
|
${(G == null ? void 0 : G(o, d)) || ""}
|
|
616
597
|
`,
|
|
617
598
|
style: {
|
|
618
|
-
...
|
|
599
|
+
...Tt,
|
|
619
600
|
...t,
|
|
620
|
-
scrollMarginTop:
|
|
601
|
+
scrollMarginTop: _t,
|
|
621
602
|
// Echo the card's clip, or it cuts the accent bar's end into a stub.
|
|
622
|
-
|
|
603
|
+
...S ? {
|
|
623
604
|
borderTopLeftRadius: le,
|
|
624
605
|
borderTopRightRadius: le
|
|
625
606
|
} : {},
|
|
@@ -628,14 +609,14 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
628
609
|
borderBottomRightRadius: le
|
|
629
610
|
} : {},
|
|
630
611
|
// Set unconditionally it would beat `hover:bg-*` on every row.
|
|
631
|
-
...
|
|
632
|
-
...
|
|
612
|
+
...en(Dt, ve),
|
|
613
|
+
...ve ? {
|
|
633
614
|
// Inset box-shadow, not `ring-*` — see the classic cell.
|
|
634
|
-
boxShadow: `inset 2px 0 0 ${
|
|
615
|
+
boxShadow: `inset 2px 0 0 ${ut}`
|
|
635
616
|
} : {}
|
|
636
617
|
},
|
|
637
|
-
onClick:
|
|
638
|
-
|
|
618
|
+
onClick: be ? (N) => {
|
|
619
|
+
lt(N) || be();
|
|
639
620
|
} : void 0,
|
|
640
621
|
onDoubleClick: y.onDoubleClick ? () => {
|
|
641
622
|
var N;
|
|
@@ -654,41 +635,41 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
654
635
|
return (N = y.onMouseLeave) == null ? void 0 : N.call(y, o, d);
|
|
655
636
|
} : void 0,
|
|
656
637
|
children: [
|
|
657
|
-
e.map((N) => /* @__PURE__ */
|
|
638
|
+
e.map((N) => /* @__PURE__ */ k(me.Fragment, { children: [
|
|
658
639
|
p(N),
|
|
659
640
|
/* @__PURE__ */ n(
|
|
660
|
-
|
|
641
|
+
gn,
|
|
661
642
|
{
|
|
662
643
|
column: N,
|
|
663
644
|
record: o,
|
|
664
645
|
paddingYClass: re,
|
|
665
646
|
index: d,
|
|
666
|
-
size:
|
|
667
|
-
isSelected:
|
|
647
|
+
size: _,
|
|
648
|
+
isSelected: ve,
|
|
668
649
|
cellStyle: i(N, "row")
|
|
669
650
|
}
|
|
670
651
|
)
|
|
671
652
|
] }, N.key)),
|
|
672
|
-
xe && ue ? /* @__PURE__ */ n("span", { "aria-hidden": "true", className:
|
|
653
|
+
xe && ue ? /* @__PURE__ */ n("span", { "aria-hidden": "true", className: Ut }) : null
|
|
673
654
|
]
|
|
674
655
|
},
|
|
675
|
-
|
|
656
|
+
A
|
|
676
657
|
);
|
|
677
658
|
}, m = (o, d = !1) => /* @__PURE__ */ n(
|
|
678
659
|
"div",
|
|
679
660
|
{
|
|
680
|
-
className: "bg-
|
|
681
|
-
style: { ...d ? {} :
|
|
661
|
+
className: "bg-[var(--malachite-table-row-background,#fff)] flex min-h-10 items-stretch w-full",
|
|
662
|
+
style: { ...d ? {} : dt, ...t },
|
|
682
663
|
children: e.map((l) => {
|
|
683
664
|
const F = (l.title === "" || l.title == null) && l.width !== void 0 ? /* @__PURE__ */ n(
|
|
684
665
|
"div",
|
|
685
666
|
{
|
|
686
|
-
className: `flex items-center ${
|
|
667
|
+
className: `flex items-center ${bt(l.align)} shrink-0 overflow-clip px-4 ${re}`,
|
|
687
668
|
style: {
|
|
688
|
-
...
|
|
669
|
+
...Ge(l),
|
|
689
670
|
...i(l, "row")
|
|
690
671
|
},
|
|
691
|
-
children: /* @__PURE__ */ n("div", { className: "h-3
|
|
672
|
+
children: /* @__PURE__ */ n("div", { className: "table-skeleton-bar h-3 rounded animate-pulse w-2/5" })
|
|
692
673
|
}
|
|
693
674
|
) : /* @__PURE__ */ n(
|
|
694
675
|
"div",
|
|
@@ -698,48 +679,48 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
698
679
|
...oe(l),
|
|
699
680
|
...i(l, "row")
|
|
700
681
|
},
|
|
701
|
-
children: /* @__PURE__ */ n("div", { className: "h-3
|
|
682
|
+
children: /* @__PURE__ */ n("div", { className: "table-skeleton-bar h-3 rounded animate-pulse w-3/5" })
|
|
702
683
|
}
|
|
703
684
|
);
|
|
704
|
-
return /* @__PURE__ */
|
|
685
|
+
return /* @__PURE__ */ k(me.Fragment, { children: [
|
|
705
686
|
p(l),
|
|
706
687
|
F
|
|
707
688
|
] }, l.key);
|
|
708
689
|
})
|
|
709
690
|
},
|
|
710
691
|
`skeleton-${o}`
|
|
711
|
-
),
|
|
692
|
+
), $ = D ? /* @__PURE__ */ n("div", { className: "flex min-h-10 items-stretch w-full", style: t, children: e.map((o) => /* @__PURE__ */ k(me.Fragment, { children: [
|
|
712
693
|
p(o),
|
|
713
694
|
/* @__PURE__ */ n(
|
|
714
|
-
|
|
695
|
+
pn,
|
|
715
696
|
{
|
|
716
697
|
column: o,
|
|
717
|
-
sortDirection: (
|
|
718
|
-
onSort: o.sorter ? () =>
|
|
698
|
+
sortDirection: (I == null ? void 0 : I.key) === o.key ? I.direction : null,
|
|
699
|
+
onSort: o.sorter ? () => Xe(o.key) : void 0,
|
|
719
700
|
cellStyle: i(o, s)
|
|
720
701
|
}
|
|
721
702
|
)
|
|
722
703
|
] }, o.key)) }) : null;
|
|
723
|
-
return /* @__PURE__ */
|
|
704
|
+
return /* @__PURE__ */ k(
|
|
724
705
|
"div",
|
|
725
706
|
{
|
|
726
707
|
ref: Ee,
|
|
727
708
|
className: `w-full ${J}`,
|
|
728
709
|
style: { ...Fe, ...X },
|
|
729
710
|
children: [
|
|
730
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ k(
|
|
731
712
|
"div",
|
|
732
713
|
{
|
|
733
714
|
className: `bg-[var(--malachite-table-background,#f7f7f7)] flex flex-col items-start ${H ? "" : "overflow-clip"} p-[4px] relative rounded-xl w-full`,
|
|
734
715
|
children: [
|
|
735
|
-
D && /* @__PURE__ */
|
|
716
|
+
D && /* @__PURE__ */ k(
|
|
736
717
|
"div",
|
|
737
718
|
{
|
|
738
|
-
ref:
|
|
719
|
+
ref: Je,
|
|
739
720
|
style: {
|
|
740
721
|
...H ? {
|
|
741
722
|
position: "sticky",
|
|
742
|
-
top:
|
|
723
|
+
top: ke,
|
|
743
724
|
zIndex: 8,
|
|
744
725
|
backgroundColor: "var(--malachite-table-header-background, #f7f7f7)",
|
|
745
726
|
marginInline: -ae,
|
|
@@ -752,20 +733,20 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
752
733
|
} : { width: "100%" }
|
|
753
734
|
},
|
|
754
735
|
children: [
|
|
755
|
-
H && /* @__PURE__ */ n(
|
|
736
|
+
H && /* @__PURE__ */ n(on, {}),
|
|
756
737
|
/* @__PURE__ */ n(
|
|
757
738
|
"div",
|
|
758
739
|
{
|
|
759
740
|
ref: Ce,
|
|
760
|
-
onScroll: P ? () =>
|
|
741
|
+
onScroll: P ? () => ct(
|
|
761
742
|
Ce.current,
|
|
762
743
|
ie.current
|
|
763
744
|
) : void 0,
|
|
764
745
|
style: P ? {
|
|
765
|
-
...
|
|
766
|
-
paddingRight:
|
|
746
|
+
...Qt,
|
|
747
|
+
paddingRight: Rt
|
|
767
748
|
} : void 0,
|
|
768
|
-
children:
|
|
749
|
+
children: $
|
|
769
750
|
}
|
|
770
751
|
)
|
|
771
752
|
]
|
|
@@ -774,9 +755,9 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
774
755
|
/* @__PURE__ */ n(
|
|
775
756
|
"div",
|
|
776
757
|
{
|
|
777
|
-
ref:
|
|
758
|
+
ref: Ct,
|
|
778
759
|
onScroll: P ? () => {
|
|
779
|
-
|
|
760
|
+
ct(ie.current, Ce.current), ue && pe();
|
|
780
761
|
} : void 0,
|
|
781
762
|
className: `flex flex-col items-start ${P ? "overflow-x-auto" : "overflow-x-clip"} ${De ? "overflow-y-auto" : "overflow-y-visible"} w-full`,
|
|
782
763
|
style: {
|
|
@@ -786,13 +767,13 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
786
767
|
// With an external virtual scroller the body is overflow-visible and
|
|
787
768
|
// a bounded box would overlap content below it.
|
|
788
769
|
...M && De ? {
|
|
789
|
-
maxHeight:
|
|
770
|
+
maxHeight: cn(
|
|
790
771
|
M,
|
|
791
772
|
!!f
|
|
792
773
|
)
|
|
793
774
|
} : {}
|
|
794
775
|
},
|
|
795
|
-
children: c ? /* @__PURE__ */ n("div", { className: "flex flex-col w-full", style: x, children: /* @__PURE__ */
|
|
776
|
+
children: c ? /* @__PURE__ */ n("div", { className: "flex flex-col w-full", style: x, children: /* @__PURE__ */ k("div", { className: "flex flex-col items-center justify-center bg-[var(--malachite-table-row-background,#fff)] w-full py-12", children: [
|
|
796
777
|
/* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium mb-1", children: R }),
|
|
797
778
|
/* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[13px]", children: h })
|
|
798
779
|
] }) }) : a ? /* @__PURE__ */ n("div", { className: "flex flex-col w-full", style: x, children: (() => {
|
|
@@ -800,62 +781,62 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
800
781
|
return Array.from({ length: o }).map(
|
|
801
782
|
(d, l) => m(l, l === o - 1)
|
|
802
783
|
);
|
|
803
|
-
})() }) : z.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col w-full", style: x, children: /* @__PURE__ */
|
|
804
|
-
/* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium", children:
|
|
805
|
-
|
|
784
|
+
})() }) : z.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col w-full", style: x, children: /* @__PURE__ */ k("div", { className: "flex flex-col items-center justify-center bg-[var(--malachite-table-row-background,#fff)] w-full py-12", children: [
|
|
785
|
+
/* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium", children: w }),
|
|
786
|
+
b && /* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[13px] mt-1", children: b })
|
|
806
787
|
] }) }) : (() => {
|
|
807
|
-
const o = (l,
|
|
808
|
-
|
|
788
|
+
const o = (l, S, v) => Y ? /* @__PURE__ */ n(
|
|
789
|
+
dn,
|
|
809
790
|
{
|
|
810
|
-
cardKey:
|
|
791
|
+
cardKey: v,
|
|
811
792
|
records: l,
|
|
812
|
-
startIndex:
|
|
813
|
-
scrollElement:
|
|
814
|
-
estimateRowHeight:
|
|
793
|
+
startIndex: S,
|
|
794
|
+
scrollElement: Ie,
|
|
795
|
+
estimateRowHeight: $t,
|
|
815
796
|
style: x,
|
|
816
797
|
renderRow: g,
|
|
817
|
-
registerHandle:
|
|
798
|
+
registerHandle: kt,
|
|
818
799
|
rovingIndex: K
|
|
819
800
|
},
|
|
820
|
-
`section-card-${
|
|
801
|
+
`section-card-${v}`
|
|
821
802
|
) : /* @__PURE__ */ n(
|
|
822
803
|
"div",
|
|
823
804
|
{
|
|
824
805
|
className: "flex flex-col w-full",
|
|
825
806
|
style: x,
|
|
826
807
|
children: l.map(
|
|
827
|
-
(F,
|
|
808
|
+
(F, A) => g(
|
|
828
809
|
F,
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
810
|
+
S + A,
|
|
811
|
+
A === l.length - 1,
|
|
812
|
+
A === 0
|
|
832
813
|
)
|
|
833
814
|
)
|
|
834
815
|
},
|
|
835
|
-
`section-card-${
|
|
816
|
+
`section-card-${v}`
|
|
836
817
|
);
|
|
837
818
|
if (Oe.size === 0)
|
|
838
819
|
return o(z, 0, "all");
|
|
839
|
-
const d = [...Oe.keys()].sort((l,
|
|
840
|
-
return d.map((l,
|
|
841
|
-
const
|
|
842
|
-
if (!
|
|
820
|
+
const d = [...Oe.keys()].sort((l, S) => l - S);
|
|
821
|
+
return d.map((l, S) => {
|
|
822
|
+
const v = Oe.get(l);
|
|
823
|
+
if (!v)
|
|
843
824
|
return null;
|
|
844
|
-
const F =
|
|
845
|
-
|
|
846
|
-
|
|
825
|
+
const F = S + 1 < d.length ? d[S + 1] : z.length, A = z.slice(l, F), y = $e == null ? void 0 : $e(
|
|
826
|
+
v.key,
|
|
827
|
+
v.records
|
|
847
828
|
);
|
|
848
|
-
return /* @__PURE__ */
|
|
829
|
+
return /* @__PURE__ */ k(me.Fragment, { children: [
|
|
849
830
|
y != null ? /* @__PURE__ */ n(
|
|
850
831
|
"div",
|
|
851
832
|
{
|
|
852
833
|
className: "table-section-divider",
|
|
853
|
-
style: P ?
|
|
834
|
+
style: P ? Vt : void 0,
|
|
854
835
|
children: y
|
|
855
836
|
}
|
|
856
837
|
) : null,
|
|
857
|
-
o(
|
|
858
|
-
] }, `section-${
|
|
838
|
+
o(A, l, v.key)
|
|
839
|
+
] }, `section-${v.key}`);
|
|
859
840
|
});
|
|
860
841
|
})()
|
|
861
842
|
}
|
|
@@ -864,7 +845,7 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
864
845
|
}
|
|
865
846
|
),
|
|
866
847
|
f && !a && /* @__PURE__ */ n(
|
|
867
|
-
|
|
848
|
+
at,
|
|
868
849
|
{
|
|
869
850
|
current: f.current ?? 1,
|
|
870
851
|
pageSize: f.pageSize ?? 10,
|
|
@@ -881,23 +862,23 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
881
862
|
}
|
|
882
863
|
);
|
|
883
864
|
}
|
|
884
|
-
const
|
|
885
|
-
const i = t.sorter, s = (
|
|
865
|
+
const It = (t) => {
|
|
866
|
+
const i = t.sorter, s = (I == null ? void 0 : I.key) === t.key ? I == null ? void 0 : I.direction : null, x = /* @__PURE__ */ k("div", { className: `flex items-center gap-2 ${Z(t.align)}`, children: [
|
|
886
867
|
/* @__PURE__ */ n("span", { children: t.title }),
|
|
887
868
|
t.info && /* @__PURE__ */ n(ye, { info: t.info }),
|
|
888
|
-
i && /* @__PURE__ */
|
|
869
|
+
i && /* @__PURE__ */ k("div", { className: "flex flex-col", children: [
|
|
889
870
|
/* @__PURE__ */ n(
|
|
890
|
-
|
|
871
|
+
Lt,
|
|
891
872
|
{
|
|
892
873
|
size: 12,
|
|
893
|
-
className: s === "asc" ?
|
|
874
|
+
className: s === "asc" ? Ue : je
|
|
894
875
|
}
|
|
895
876
|
),
|
|
896
877
|
/* @__PURE__ */ n(
|
|
897
|
-
|
|
878
|
+
ht,
|
|
898
879
|
{
|
|
899
880
|
size: 12,
|
|
900
|
-
className: `-mt-1 ${s === "desc" ?
|
|
881
|
+
className: `-mt-1 ${s === "desc" ? Ue : je}`
|
|
901
882
|
}
|
|
902
883
|
)
|
|
903
884
|
] })
|
|
@@ -907,15 +888,15 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
907
888
|
{
|
|
908
889
|
className: `
|
|
909
890
|
table-header table-cell px-4 py-3 font-semibold border-0 first:rounded-tl-lg last:rounded-tr-lg
|
|
910
|
-
${se(
|
|
891
|
+
${se(_)}
|
|
911
892
|
${de(t.align)}
|
|
912
893
|
`,
|
|
913
894
|
style: { width: t.width },
|
|
914
|
-
"aria-sort": i ?
|
|
895
|
+
"aria-sort": i ? fn(s) : void 0,
|
|
915
896
|
children: i ? /* @__PURE__ */ n(
|
|
916
897
|
"button",
|
|
917
898
|
{
|
|
918
|
-
...
|
|
899
|
+
...xt(t.title, () => Xe(t.key)),
|
|
919
900
|
className: `flex w-full items-center ${Z(t.align)} cursor-pointer hover:opacity-80 appearance-none bg-transparent border-0 p-0 font-semibold text-inherit ${de(t.align)}`,
|
|
920
901
|
children: x
|
|
921
902
|
}
|
|
@@ -931,7 +912,7 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
931
912
|
style: {
|
|
932
913
|
...M ? { maxHeight: M } : {}
|
|
933
914
|
},
|
|
934
|
-
children: /* @__PURE__ */
|
|
915
|
+
children: /* @__PURE__ */ k("table", { className: "w-full border-collapse rounded-lg overflow-hidden", children: [
|
|
935
916
|
D && /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ n("tr", { children: e.map((t) => /* @__PURE__ */ n(
|
|
936
917
|
"th",
|
|
937
918
|
{
|
|
@@ -940,11 +921,11 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
940
921
|
${u ? "table-cell-bordered table-cell-bordered-top" : ""}
|
|
941
922
|
${u && t === e[0] ? "table-cell-bordered-left" : ""}
|
|
942
923
|
${u && t === e[e.length - 1] ? "table-cell-bordered-right" : ""}
|
|
943
|
-
${se(
|
|
924
|
+
${se(_)}
|
|
944
925
|
${de(t.align)}
|
|
945
926
|
`,
|
|
946
927
|
style: { width: t.width },
|
|
947
|
-
children: /* @__PURE__ */
|
|
928
|
+
children: /* @__PURE__ */ k(
|
|
948
929
|
"div",
|
|
949
930
|
{
|
|
950
931
|
className: `flex items-center gap-2 ${Z(t.align)}`,
|
|
@@ -962,8 +943,8 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
962
943
|
{
|
|
963
944
|
colSpan: e.length + (W ? 1 : 0),
|
|
964
945
|
className: "px-4 py-12 text-center",
|
|
965
|
-
children: /* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */ n("div", { className: "table-error-icon w-12 h-12 rounded-full flex items-center justify-center mb-4", children: /* @__PURE__ */ n(
|
|
946
|
+
children: /* @__PURE__ */ k("div", { className: "flex flex-col items-center justify-center", children: [
|
|
947
|
+
/* @__PURE__ */ n("div", { className: "table-error-icon w-12 h-12 rounded-full flex items-center justify-center mb-4", children: /* @__PURE__ */ n(Wt, { size: 24 }) }),
|
|
967
948
|
/* @__PURE__ */ n("div", { className: "table-error-title text-lg font-semibold mb-2", children: R }),
|
|
968
949
|
/* @__PURE__ */ n("div", { className: "table-error-subtitle text-sm", children: h })
|
|
969
950
|
] })
|
|
@@ -971,7 +952,7 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
971
952
|
) }) })
|
|
972
953
|
] })
|
|
973
954
|
}
|
|
974
|
-
) }) : /* @__PURE__ */
|
|
955
|
+
) }) : /* @__PURE__ */ k(
|
|
975
956
|
"div",
|
|
976
957
|
{
|
|
977
958
|
ref: Ee,
|
|
@@ -990,13 +971,13 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
990
971
|
style: {
|
|
991
972
|
...M ? { maxHeight: M } : {}
|
|
992
973
|
},
|
|
993
|
-
children: /* @__PURE__ */
|
|
974
|
+
children: /* @__PURE__ */ k(
|
|
994
975
|
"table",
|
|
995
976
|
{
|
|
996
977
|
className: `w-full ${te === "fixed" || e.some((t) => t.width) ? "table-fixed" : "table-auto"} ${u ? "border-separate table-bordered" : "border-collapse"} rounded-lg overflow-hidden`,
|
|
997
978
|
style: { borderSpacing: "0" },
|
|
998
979
|
children: [
|
|
999
|
-
D && /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ n("tr", { children: e.map((t) =>
|
|
980
|
+
D && /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ n("tr", { children: e.map((t) => It(t)) }) }),
|
|
1000
981
|
/* @__PURE__ */ n("tbody", { children: a ? Array.from({ length: 5 }).map((t, i) => /* @__PURE__ */ n(
|
|
1001
982
|
"tr",
|
|
1002
983
|
{
|
|
@@ -1004,9 +985,9 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
1004
985
|
children: e.map((p) => /* @__PURE__ */ n(
|
|
1005
986
|
"td",
|
|
1006
987
|
{
|
|
1007
|
-
className: `table-cell px-4 ${re} text-left ${se(
|
|
988
|
+
className: `table-cell px-4 ${re} text-left ${se(_)}`,
|
|
1008
989
|
style: { width: p.width },
|
|
1009
|
-
children: /* @__PURE__ */ n("div", { className: "h-4
|
|
990
|
+
children: /* @__PURE__ */ n("div", { className: "table-skeleton-bar h-4 rounded animate-pulse" })
|
|
1010
991
|
},
|
|
1011
992
|
p.key
|
|
1012
993
|
))
|
|
@@ -1017,13 +998,13 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
1017
998
|
{
|
|
1018
999
|
colSpan: e.length + (W ? 1 : 0),
|
|
1019
1000
|
className: "px-4 py-12 text-center",
|
|
1020
|
-
children: /* @__PURE__ */
|
|
1021
|
-
/* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium", children:
|
|
1022
|
-
|
|
1001
|
+
children: /* @__PURE__ */ k("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1002
|
+
/* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium", children: w }),
|
|
1003
|
+
b && /* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[13px] mt-1", children: b })
|
|
1023
1004
|
] })
|
|
1024
1005
|
}
|
|
1025
1006
|
) }) : z.map((t, i) => {
|
|
1026
|
-
const p = ze(t, i), s = (
|
|
1007
|
+
const p = ze(t, i), s = (j == null ? void 0 : j(t, i)) || {}, x = U == null ? void 0 : U(t, i), g = i === 0, m = i === r.length - 1, $ = i === L, o = x ? `var(--malachite-table-row-variant-${x}-background)` : void 0, d = E || s.onClick ? () => {
|
|
1027
1008
|
var l;
|
|
1028
1009
|
E == null || E(t, i), (l = s.onClick) == null || l.call(s, t, i);
|
|
1029
1010
|
} : void 0;
|
|
@@ -1035,16 +1016,16 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
1035
1016
|
{
|
|
1036
1017
|
"data-table-id": Q,
|
|
1037
1018
|
"data-row-index": i,
|
|
1038
|
-
"aria-current":
|
|
1019
|
+
"aria-current": $ ? "true" : void 0,
|
|
1039
1020
|
tabIndex: d ? i === K ? 0 : -1 : void 0,
|
|
1040
|
-
onKeyDown: d ?
|
|
1021
|
+
onKeyDown: d ? nt(i, d) : void 0,
|
|
1041
1022
|
className: `
|
|
1042
|
-
${u ? "table-row-bordered" : `table-row ${
|
|
1023
|
+
${u ? "table-row-bordered" : `table-row ${$ ? "" : "hover:opacity-80"}`}
|
|
1043
1024
|
${(G == null ? void 0 : G(t, i)) || ""}
|
|
1044
|
-
${d ? `cursor-pointer ${
|
|
1025
|
+
${d ? `cursor-pointer ${it}` : ""}
|
|
1045
1026
|
`,
|
|
1046
1027
|
onClick: d ? (l) => {
|
|
1047
|
-
|
|
1028
|
+
lt(l) || d();
|
|
1048
1029
|
} : void 0,
|
|
1049
1030
|
onDoubleClick: s.onDoubleClick ? () => {
|
|
1050
1031
|
var l;
|
|
@@ -1063,23 +1044,23 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
1063
1044
|
return (l = s.onMouseLeave) == null ? void 0 : l.call(s, t, i);
|
|
1064
1045
|
} : void 0,
|
|
1065
1046
|
children: e.map((l) => {
|
|
1066
|
-
const
|
|
1047
|
+
const S = l === e[0], v = l === e[e.length - 1];
|
|
1067
1048
|
return /* @__PURE__ */ n(
|
|
1068
|
-
|
|
1049
|
+
un,
|
|
1069
1050
|
{
|
|
1070
1051
|
column: l,
|
|
1071
1052
|
record: t,
|
|
1072
1053
|
index: i,
|
|
1073
|
-
size:
|
|
1054
|
+
size: _,
|
|
1074
1055
|
paddingYClass: re,
|
|
1075
1056
|
bordered: u,
|
|
1076
1057
|
isFirstRow: g,
|
|
1077
1058
|
isLastRow: m,
|
|
1078
|
-
isFirstColumn:
|
|
1079
|
-
isLastColumn:
|
|
1059
|
+
isFirstColumn: S,
|
|
1060
|
+
isLastColumn: v,
|
|
1080
1061
|
variantBackground: o,
|
|
1081
|
-
isSelected:
|
|
1082
|
-
showSelectedAccent:
|
|
1062
|
+
isSelected: $,
|
|
1063
|
+
showSelectedAccent: $ && S
|
|
1083
1064
|
},
|
|
1084
1065
|
l.key
|
|
1085
1066
|
);
|
|
@@ -1097,7 +1078,7 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
1097
1078
|
}
|
|
1098
1079
|
),
|
|
1099
1080
|
f && !a && /* @__PURE__ */ n(
|
|
1100
|
-
|
|
1081
|
+
at,
|
|
1101
1082
|
{
|
|
1102
1083
|
current: f.current ?? 1,
|
|
1103
1084
|
pageSize: f.pageSize ?? 10,
|
|
@@ -1115,6 +1096,6 @@ const pt = 160, At = (e, r) => e.length === r.length && e.every((a, c) => a ===
|
|
|
1115
1096
|
);
|
|
1116
1097
|
};
|
|
1117
1098
|
export {
|
|
1118
|
-
|
|
1099
|
+
In as default
|
|
1119
1100
|
};
|
|
1120
1101
|
//# sourceMappingURL=Table.js.map
|