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