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