@bigcapitalhq/blueprintjs-react-table 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,71 +1,73 @@
1
- var be = Object.defineProperty;
2
- var Fe = (t, e, n) => e in t ? be(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var ut = (t, e, n) => Fe(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { jsx as d, jsxs as F, Fragment as vt } from "react/jsx-runtime";
5
- import { useLayoutEffect as st, useState as tt, useRef as X, useCallback as b, useMemo as dt, useEffect as at, createContext as se, useContext as re, Fragment as kt } from "react";
6
- import { tableFeatures as Pt, sortFns as Ge, rowSortingFeature as We, cellSelectionFeature as ke, rowSelectionFeature as Ve, rowPinningFeature as Ye, columnPinningFeature as Xe, columnVisibilityFeature as Qe, columnOrderingFeature as Ke, columnResizingFeature as Ze, columnSizingFeature as je, createSortedRowModel as qe, useTable as Je, functionalUpdate as ce, rowPaginationFeature as ie, createPaginatedRowModel as ue } from "@tanstack/react-table";
7
- import { useVirtualizer as tn } from "@tanstack/react-virtual";
8
- import { Classes as nt, ContextMenu as en, Checkbox as ae, PopoverNext as nn, Icon as on, Menu as ln, MenuItem as Dt, HTMLSelect as sn, ButtonGroup as rn, Button as Rt } from "@blueprintjs/core";
9
- import { DragHandleVerticalIcon as cn } from "@blueprintjs/icons";
10
- var Mt = /* @__PURE__ */ ((t) => (t.CELLS = "cells", t.COLUMN_HEADERS = "column-header", t.ROW_HEADERS = "row-header", t))(Mt || {});
11
- function yt(t, e) {
1
+ var Ye = Object.defineProperty;
2
+ var Xe = (t, e, n) => e in t ? Ye(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var Et = (t, e, n) => Xe(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { jsx as a, jsxs as W, Fragment as Nt } from "react/jsx-runtime";
5
+ import { useLayoutEffect as dt, useState as lt, useRef as Z, createContext as Gt, useCallback as P, useMemo as gt, useEffect as Lt, useContext as Wt, Fragment as zt } from "react";
6
+ import { tableFeatures as Pt, sortFns as Ke, rowSortingFeature as Qe, cellSelectionFeature as Ze, rowSelectionFeature as je, rowPinningFeature as qe, rowExpandingFeature as Je, columnPinningFeature as tn, columnVisibilityFeature as en, columnOrderingFeature as nn, columnResizingFeature as on, columnSizingFeature as ln, createSortedRowModel as sn, createExpandedRowModel as rn, useTable as cn, functionalUpdate as de, rowPaginationFeature as fe, createPaginatedRowModel as he } from "@tanstack/react-table";
7
+ import { useVirtualizer as an } from "@tanstack/react-virtual";
8
+ import { Classes as ft, Icon as me, ContextMenu as un, Checkbox as we, PopoverNext as dn, Menu as fn, MenuItem as Dt, HTMLSelect as hn, ButtonGroup as mn, Button as It } from "@blueprintjs/core";
9
+ import { DragHandleVerticalIcon as wn } from "@blueprintjs/icons";
10
+ var Ot = /* @__PURE__ */ ((t) => (t.CELLS = "cells", t.COLUMN_HEADERS = "column-header", t.ROW_HEADERS = "row-header", t))(Ot || {});
11
+ function $t(t, e) {
12
12
  return t.indexOf(e) !== -1;
13
13
  }
14
- const Ut = Pt({
15
- columnSizingFeature: je,
16
- columnResizingFeature: Ze,
17
- columnOrderingFeature: Ke,
18
- columnVisibilityFeature: Qe,
19
- columnPinningFeature: Xe,
20
- rowPinningFeature: Ye,
21
- rowSelectionFeature: Ve,
22
- cellSelectionFeature: ke,
23
- rowSortingFeature: We,
24
- sortedRowModel: qe(),
25
- sortFns: Ge
26
- }), un = (t) => Je({
14
+ const Vt = Pt({
15
+ columnSizingFeature: ln,
16
+ columnResizingFeature: on,
17
+ columnOrderingFeature: nn,
18
+ columnVisibilityFeature: en,
19
+ columnPinningFeature: tn,
20
+ rowExpandingFeature: Je,
21
+ rowPinningFeature: qe,
22
+ rowSelectionFeature: je,
23
+ cellSelectionFeature: Ze,
24
+ rowSortingFeature: Qe,
25
+ expandedRowModel: rn(),
26
+ sortedRowModel: sn(),
27
+ sortFns: Ke
28
+ }), En = (t) => cn({
27
29
  ...t,
28
30
  initialState: t.initialState ?? {},
29
- features: t.features ?? Ut,
31
+ features: t.features ?? Vt,
30
32
  columnResizeMode: t.columnResizeMode ?? "onEnd"
31
33
  });
32
- function an({
34
+ function gn({
33
35
  table: t,
34
36
  numFrozenColumns: e,
35
37
  numFrozenRows: n
36
38
  }) {
37
- const o = t.getVisibleLeafColumns(), s = t.getRowModel().rows;
38
- st(() => {
39
+ const l = t.getVisibleLeafColumns(), s = t.getRowModel().rows;
40
+ dt(() => {
39
41
  var c;
40
42
  if (t.setColumnPinning == null)
41
43
  return;
42
- const l = o.slice(0, Math.max(0, e)).map((i) => i.id), r = ((c = t.state.columnPinning) == null ? void 0 : c.start) ?? [];
43
- Vt(r, l) || t.setColumnPinning((i) => ({ ...i, start: l }));
44
- }, [e, t, o]), st(() => {
44
+ const o = l.slice(0, Math.max(0, e)).map((i) => i.id), r = ((c = t.state.columnPinning) == null ? void 0 : c.start) ?? [];
45
+ Zt(r, o) || t.setColumnPinning((i) => ({ ...i, start: o }));
46
+ }, [e, t, l]), dt(() => {
45
47
  var c;
46
48
  if (t.setRowPinning == null)
47
49
  return;
48
- const l = s.slice(0, Math.max(0, n)).map((i) => i.id), r = ((c = t.state.rowPinning) == null ? void 0 : c.top) ?? [];
49
- Vt(r, l) || t.setRowPinning((i) => ({ ...i, top: l }));
50
+ const o = s.slice(0, Math.max(0, n)).map((i) => i.id), r = ((c = t.state.rowPinning) == null ? void 0 : c.top) ?? [];
51
+ Zt(r, o) || t.setRowPinning((i) => ({ ...i, top: o }));
50
52
  }, [n, s, t]);
51
53
  }
52
- function Vt(t, e) {
53
- return t.length === e.length && t.every((n, o) => n === e[o]);
54
+ function Zt(t, e) {
55
+ return t.length === e.length && t.every((n, l) => n === e[l]);
54
56
  }
55
- const de = 5;
56
- function dn({
57
+ const Ee = 5;
58
+ function Ln({
57
59
  table: t,
58
60
  columnHeaderHeight: e,
59
61
  frozenRowCount: n,
60
- frozenRowsHeight: o,
62
+ frozenRowsHeight: l,
61
63
  getRowHeight: s,
62
- scrollContainerRef: l,
64
+ scrollContainerRef: o,
63
65
  enableRowVirtualization: r,
64
66
  overscanRowCount: c
65
67
  }) {
66
- const i = Math.max(0, t.getRowModel().rows.length - n), u = tn({
68
+ const i = Math.max(0, t.getRowModel().rows.length - n), u = an({
67
69
  count: i,
68
- getScrollElement: () => l.current,
70
+ getScrollElement: () => o.current,
69
71
  estimateSize: (f) => s(n + f),
70
72
  overscan: c,
71
73
  /**
@@ -73,32 +75,32 @@ function dn({
73
75
  * rows inside the shared scroll container; this offset aligns virtual item
74
76
  * offsets with the absolute positioning used by body cells.
75
77
  */
76
- scrollMargin: e + o,
78
+ scrollMargin: e + l,
77
79
  enabled: r
78
80
  });
79
- return st(() => {
81
+ return dt(() => {
80
82
  u.measure();
81
83
  }, [n, s, u]), r ? u : void 0;
82
84
  }
83
- function fn({
85
+ function jt({
84
86
  value: t,
85
87
  initialValue: e,
86
88
  finalValue: n,
87
- onChange: o = () => {
88
- }
89
+ onChange: l
89
90
  }) {
90
- const [s, l] = tt(
91
+ const [s, o] = lt(
91
92
  e !== void 0 ? e : n
92
- ), r = (c) => {
93
- l(c), o == null || o(c);
94
- };
95
- return t !== void 0 ? [t, o, !0] : [s, r, !1];
96
- }
97
- const hn = 20, mn = 30, fe = 30, wn = 30, Yt = 150, En = 50, Ln = 200;
98
- function gn(t) {
93
+ ), r = Z(s);
94
+ return [t !== void 0 ? t : s, (i) => {
95
+ const u = t !== void 0 ? t : r.current, f = typeof i == "function" ? i(u) : i;
96
+ t === void 0 && (r.current = f, o(() => f)), l == null || l(f);
97
+ }, t !== void 0];
98
+ }
99
+ const Tn = 20, Cn = 30, ge = 30, vn = 30, qt = 150, pn = 50, An = 200, Ft = Gt(void 0);
100
+ function Nn(t) {
99
101
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
100
102
  }
101
- var he = { exports: {} };
103
+ var Le = { exports: {} };
102
104
  /*!
103
105
  Copyright (c) 2018 Jed Watson.
104
106
  Licensed under the MIT License (MIT), see
@@ -108,52 +110,52 @@ var he = { exports: {} };
108
110
  (function() {
109
111
  var e = {}.hasOwnProperty;
110
112
  function n() {
111
- for (var l = "", r = 0; r < arguments.length; r++) {
113
+ for (var o = "", r = 0; r < arguments.length; r++) {
112
114
  var c = arguments[r];
113
- c && (l = s(l, o(c)));
115
+ c && (o = s(o, l(c)));
114
116
  }
115
- return l;
117
+ return o;
116
118
  }
117
- function o(l) {
118
- if (typeof l == "string" || typeof l == "number")
119
- return l;
120
- if (typeof l != "object")
119
+ function l(o) {
120
+ if (typeof o == "string" || typeof o == "number")
121
+ return o;
122
+ if (typeof o != "object")
121
123
  return "";
122
- if (Array.isArray(l))
123
- return n.apply(null, l);
124
- if (l.toString !== Object.prototype.toString && !l.toString.toString().includes("[native code]"))
125
- return l.toString();
124
+ if (Array.isArray(o))
125
+ return n.apply(null, o);
126
+ if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
127
+ return o.toString();
126
128
  var r = "";
127
- for (var c in l)
128
- e.call(l, c) && l[c] && (r = s(r, c));
129
+ for (var c in o)
130
+ e.call(o, c) && o[c] && (r = s(r, c));
129
131
  return r;
130
132
  }
131
- function s(l, r) {
132
- return r ? l ? l + " " + r : l + r : l;
133
+ function s(o, r) {
134
+ return r ? o ? o + " " + r : o + r : o;
133
135
  }
134
136
  t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
135
137
  })();
136
- })(he);
137
- var Tn = he.exports;
138
- const P = /* @__PURE__ */ gn(Tn), h = nt.getClassNamespace(), Cn = `${h}-table-body-cells`, pn = `${h}-table-body-virtual-client`, Xt = `${h}-table-bottom-container`, me = `${h}-table-cell`, vn = `${h}-table-cell-client`, An = `${h}-table-cell-ghost`, we = `${h}-table-cell-ledger-even`, Ee = `${h}-table-cell-ledger-odd`, Nn = `${h}-table-column-header-tr`, _n = `${h}-table-column-headers`, Ht = `${h}-table-column-header-cell`, Le = `${h}-table-column-name`, ge = `${h}-table-column-name-text`, Sn = `${h}-table-container`, At = `${h}-table-dragging`, Te = `${h}-table-focus-region`, Rn = `${h}-table-has-reorder-handle`, ft = `${h}-table-header`, In = `${h}-table-header-active`, Ce = `${h}-table-header-content`, Mn = `${h}-table-horizontal-guide`, zt = `${h}-table-last-in-column`, pe = `${h}-table-last-in-row`, On = `${h}-table-menu`, Bn = `${h}-table-no-horizontal-scroll`, Dn = `${h}-table-no-vertical-scroll`, ve = `${h}-table-no-wrap-text`, Ot = `${h}-table-overlay`, bt = `${h}-table-overlay-layer`, yn = `${h}-table-pagination-bar`, Qt = `${h}-table-pagination-bar-controls`, $t = `${h}-table-pagination-bar-text`, $n = `${h}-table-pagination-layout`, xn = `${h}-table-quadrant`, Pn = `${h}-table-quadrant-body-container`, Un = `${h}-table-quadrant-left`, Hn = `${h}-table-quadrant-main`, zn = `${h}-table-quadrant-scroll-container`, bn = `${h}-table-quadrant-stack`, Fn = `${h}-table-quadrant-top`, Gn = `${h}-table-quadrant-top-left`, Wn = `${h}-table-region`, kn = `${h}-table-reorder-handle`, Vn = `${h}-table-reorder-handle-target`, Ae = `${h}-table-resize-guides`, Ne = `${h}-table-resize-handle`, _e = `${h}-table-resize-handle-target`, Yn = `${h}-table-resize-horizontal`, Xn = `${h}-table-resize-vertical`, Qn = `${h}-table-row-headers`, Kt = `${h}-table-row-headers-cells-container`, Se = `${h}-table-row-name`, Re = `${h}-table-row-name-text`, Ft = `${h}-table-row-selected`, Ie = `${h}-table-row-selection-cell`, Me = `${h}-table-row-selection-checkbox`, Kn = `${h}-table-row-selection-header-cell`, Zn = `${h}-table-selection-enabled`, Oe = `${h}-table-selection-region`, jn = `${h}-table-th-menu`, qn = `${h}-table-th-menu-container`, Jn = `${h}-table-th-menu-container-background`, to = `${h}-table-th-menu-open`, eo = `${h}-table-thead`, no = `${h}-table-top-container`, Be = `${h}-table-truncated-cell`, De = `${h}-table-truncated-text`, ye = `${h}-table-vertical-guide`;
139
- function $e(t, e) {
138
+ })(Le);
139
+ var _n = Le.exports;
140
+ const G = /* @__PURE__ */ Nn(_n), h = ft.getClassNamespace(), Sn = `${h}-table-body-cells`, Rn = `${h}-table-body-virtual-client`, Jt = `${h}-table-bottom-container`, Te = `${h}-table-cell`, In = `${h}-table-cell-client`, Mn = `${h}-table-cell-ghost`, Ce = `${h}-table-cell-ledger-even`, ve = `${h}-table-cell-ledger-odd`, On = `${h}-table-column-header-tr`, yn = `${h}-table-column-headers`, bt = `${h}-table-column-header-cell`, pe = `${h}-table-column-name`, Ae = `${h}-table-column-name-text`, xn = `${h}-table-container`, _t = `${h}-table-dragging`, Ne = `${h}-table-focus-region`, Bn = `${h}-table-has-reorder-handle`, Tt = `${h}-table-header`, Dn = `${h}-table-header-active`, _e = `${h}-table-header-content`, $n = `${h}-table-horizontal-guide`, kt = `${h}-table-last-in-column`, Se = `${h}-table-last-in-row`, Hn = `${h}-table-menu`, Un = `${h}-table-no-horizontal-scroll`, zn = `${h}-table-no-vertical-scroll`, Re = `${h}-table-no-wrap-text`, yt = `${h}-table-overlay`, Yt = `${h}-table-overlay-layer`, Fn = `${h}-table-pagination-bar`, te = `${h}-table-pagination-bar-controls`, Ht = `${h}-table-pagination-bar-text`, Gn = `${h}-table-pagination-layout`, Wn = `${h}-table-quadrant`, Pn = `${h}-table-quadrant-body-container`, Vn = `${h}-table-quadrant-left`, bn = `${h}-table-quadrant-main`, kn = `${h}-table-quadrant-scroll-container`, Yn = `${h}-table-quadrant-stack`, Xn = `${h}-table-quadrant-top`, Kn = `${h}-table-quadrant-top-left`, Qn = `${h}-table-region`, Zn = `${h}-table-reorder-handle`, jn = `${h}-table-reorder-handle-target`, Ie = `${h}-table-resize-guides`, Me = `${h}-table-resize-handle`, Oe = `${h}-table-resize-handle-target`, qn = `${h}-table-resize-horizontal`, Jn = `${h}-table-resize-vertical`, to = `${h}-table-row-headers`, ee = `${h}-table-row-headers-cells-container`, ye = `${h}-table-row-name`, xe = `${h}-table-row-name-text`, eo = `${h}-table-cell-with-expander`, no = `${h}-table-row-expander`, oo = `${h}-table-row-detail`, Xt = `${h}-table-row-selected`, Be = `${h}-table-row-selection-cell`, De = `${h}-table-row-selection-checkbox`, lo = `${h}-table-row-selection-header-cell`, so = `${h}-table-selection-enabled`, $e = `${h}-table-selection-region`, ro = `${h}-table-th-menu`, co = `${h}-table-th-menu-container`, io = `${h}-table-th-menu-container-background`, ao = `${h}-table-th-menu-open`, uo = `${h}-table-thead`, fo = `${h}-table-top-container`, He = `${h}-table-truncated-cell`, Ue = `${h}-table-truncated-text`, ze = `${h}-table-vertical-guide`;
141
+ function Fe(t, e) {
140
142
  return typeof e == "number" ? `${t}${e}` : e.indexOf(t) === 0 ? e : `${t}${e}`;
141
143
  }
142
- function Gt(t) {
143
- return $e(`${h}-table-cell-col-`, t);
144
+ function Kt(t) {
145
+ return Fe(`${h}-table-cell-col-`, t);
144
146
  }
145
- function Et(t) {
146
- return $e(`${h}-table-cell-row-`, t);
147
+ function vt(t) {
148
+ return Fe(`${h}-table-cell-row-`, t);
147
149
  }
148
- var J = /* @__PURE__ */ ((t) => (t.CELLS = "cells", t.FULL_ROWS = "full-rows", t.FULL_COLUMNS = "full-columns", t.FULL_TABLE = "full-table", t))(J || {}), xe = /* @__PURE__ */ ((t) => (t.CELL = "cell", t))(xe || {}), oo = /* @__PURE__ */ ((t) => (t.UP = "up", t.DOWN = "down", t.LEFT = "left", t.RIGHT = "right", t))(oo || {});
150
+ var ct = /* @__PURE__ */ ((t) => (t.CELLS = "cells", t.FULL_ROWS = "full-rows", t.FULL_COLUMNS = "full-columns", t.FULL_TABLE = "full-table", t))(ct || {}), Ge = /* @__PURE__ */ ((t) => (t.CELL = "cell", t))(Ge || {}), ho = /* @__PURE__ */ ((t) => (t.UP = "up", t.DOWN = "down", t.LEFT = "left", t.RIGHT = "right", t))(ho || {});
149
151
  class A {
150
152
  static getRegionCardinality(e) {
151
153
  return e.cols != null && e.rows != null ? "cells" : e.cols != null ? "full-columns" : e.rows != null ? "full-rows" : "full-table";
152
154
  }
153
- static cell(e, n, o, s) {
155
+ static cell(e, n, l, s) {
154
156
  return {
155
157
  cols: A.normalizeInterval(n, s),
156
- rows: A.normalizeInterval(e, o)
158
+ rows: A.normalizeInterval(e, l)
157
159
  };
158
160
  }
159
161
  static row(e, n) {
@@ -169,17 +171,17 @@ class A {
169
171
  const n = A.getRegionCardinality(e);
170
172
  return n === "cells" ? A.cell(e.rows[0], e.cols[0], e.rows[1], e.cols[1]) : n === "full-columns" ? A.column(e.cols[0], e.cols[1]) : n === "full-rows" ? A.row(e.rows[0], e.rows[1]) : A.table();
171
173
  }
172
- static update(e, n, o) {
174
+ static update(e, n, l) {
173
175
  const s = e.slice();
174
- return o != null ? s.splice(o, 1, n) : (s.pop(), s.push(n)), s;
176
+ return l != null ? s.splice(l, 1, n) : (s.pop(), s.push(n)), s;
175
177
  }
176
- static clampRegion(e, n, o) {
178
+ static clampRegion(e, n, l) {
177
179
  const s = A.copy(e);
178
- return e.rows != null && (s.rows[0] = A.clamp(e.rows[0], 0, n), s.rows[1] = A.clamp(e.rows[1], 0, n)), e.cols != null && (s.cols[0] = A.clamp(e.cols[0], 0, o), s.cols[1] = A.clamp(e.cols[1], 0, o)), s;
180
+ return e.rows != null && (s.rows[0] = A.clamp(e.rows[0], 0, n), s.rows[1] = A.clamp(e.rows[1], 0, n)), e.cols != null && (s.cols[0] = A.clamp(e.cols[0], 0, l), s.cols[1] = A.clamp(e.cols[1], 0, l)), s;
179
181
  }
180
182
  static expandRegion(e, n) {
181
- const o = A.getRegionCardinality(e), s = A.getRegionCardinality(n);
182
- if (s !== o)
183
+ const l = A.getRegionCardinality(e), s = A.getRegionCardinality(n);
184
+ if (s !== l)
183
185
  return n;
184
186
  switch (s) {
185
187
  case "full-rows":
@@ -206,14 +208,14 @@ class A {
206
208
  static getRegionFromFocusedRegion(e) {
207
209
  return A.cell(e.row, e.col);
208
210
  }
209
- static getCellRegionFromRegion(e, n, o) {
211
+ static getCellRegionFromRegion(e, n, l) {
210
212
  switch (A.getRegionCardinality(e)) {
211
213
  case "full-table":
212
- return A.cell(0, 0, n - 1, o - 1);
214
+ return A.cell(0, 0, n - 1, l - 1);
213
215
  case "full-columns":
214
216
  return A.cell(0, e.cols[0], n - 1, e.cols[1]);
215
217
  case "full-rows":
216
- return A.cell(e.rows[0], 0, e.rows[1], o - 1);
218
+ return A.cell(e.rows[0], 0, e.rows[1], l - 1);
217
219
  default:
218
220
  return A.cell(e.rows[0], e.cols[0], e.rows[1], e.cols[1]);
219
221
  }
@@ -240,9 +242,9 @@ class A {
240
242
  static findContainingRegion(e, n) {
241
243
  if (e == null)
242
244
  return -1;
243
- for (let o = 0; o < e.length; o++)
244
- if (A.regionContains(e[o], n))
245
- return o;
245
+ for (let l = 0; l < e.length; l++)
246
+ if (A.regionContains(e[l], n))
247
+ return l;
246
248
  return -1;
247
249
  }
248
250
  /**
@@ -257,24 +259,24 @@ class A {
257
259
  * query region must be fully contained in the corresponding interval of a
258
260
  * region.
259
261
  */
260
- static overlapsRegion(e, n, o = !1) {
261
- const s = o ? A.intervalOverlaps : A.intervalContains;
262
+ static overlapsRegion(e, n, l = !1) {
263
+ const s = l ? A.intervalOverlaps : A.intervalContains;
262
264
  if (e == null || n == null)
263
265
  return !1;
264
- for (const l of e)
265
- switch (A.getRegionCardinality(l)) {
266
+ for (const o of e)
267
+ switch (A.getRegionCardinality(o)) {
266
268
  case "full-table":
267
269
  return !0;
268
270
  case "full-columns":
269
- if (s(l.cols, n.cols))
271
+ if (s(o.cols, n.cols))
270
272
  return !0;
271
273
  continue;
272
274
  case "full-rows":
273
- if (s(l.rows, n.rows))
275
+ if (s(o.rows, n.rows))
274
276
  return !0;
275
277
  continue;
276
278
  case "cells":
277
- if (s(l.cols, n.cols) && s(l.rows, n.rows))
279
+ if (s(o.cols, n.cols) && s(o.rows, n.rows))
278
280
  return !0;
279
281
  continue;
280
282
  }
@@ -285,23 +287,23 @@ class A {
285
287
  * an ordered array of every unique cell that exists in those regions. The
286
288
  * cell coordinates are sorted by row and then column.
287
289
  */
288
- static enumerateUniqueCells(e, n, o) {
290
+ static enumerateUniqueCells(e, n, l) {
289
291
  if (e == null || e.length === 0)
290
292
  return [];
291
- const s = /* @__PURE__ */ new Set(), l = [];
293
+ const s = /* @__PURE__ */ new Set(), o = [];
292
294
  for (const r of e)
293
- A.eachCellInRegion(r, n, o, (c, i) => {
295
+ A.eachCellInRegion(r, n, l, (c, i) => {
294
296
  const u = `${c}-${i}`;
295
- s.has(u) || (s.add(u), l.push({ col: i, row: c }));
297
+ s.has(u) || (s.add(u), o.push({ col: i, row: c }));
296
298
  });
297
- return l.sort((r, c) => r.row - c.row || r.col - c.col), l;
299
+ return o.sort((r, c) => r.row - c.row || r.col - c.col), o;
298
300
  }
299
301
  static joinStyledRegionGroups(e, n) {
300
- const o = [];
301
- return e != null && e.length > 0 && o.push({ className: Oe, regions: e }), n != null && o.push({
302
- className: Te,
302
+ const l = [];
303
+ return e != null && e.length > 0 && l.push({ className: $e, regions: e }), n != null && l.push({
304
+ className: Ne,
303
305
  regions: [A.getRegionFromFocusedRegion(n)]
304
- }), o;
306
+ }), l;
305
307
  }
306
308
  static regionContains(e, n) {
307
309
  return A.overlapsRegion([e], n, !1);
@@ -312,41 +314,41 @@ class A {
312
314
  static intervalOverlaps(e, n) {
313
315
  return e == null || n == null ? !1 : e[0] <= n[1] && n[0] <= e[1];
314
316
  }
315
- static eachCellInRegion(e, n, o, s) {
317
+ static eachCellInRegion(e, n, l, s) {
316
318
  switch (A.getRegionCardinality(e)) {
317
319
  case "full-table":
318
- for (let l = 0; l < n; l++)
319
- for (let r = 0; r < o; r++)
320
- s(l, r);
320
+ for (let o = 0; o < n; o++)
321
+ for (let r = 0; r < l; r++)
322
+ s(o, r);
321
323
  break;
322
324
  case "full-columns":
323
- for (let l = 0; l < n; l++)
325
+ for (let o = 0; o < n; o++)
324
326
  for (let r = e.cols[0]; r <= e.cols[1]; r++)
325
- s(l, r);
327
+ s(o, r);
326
328
  break;
327
329
  case "full-rows":
328
- for (let l = e.rows[0]; l <= e.rows[1]; l++)
329
- for (let r = 0; r < o; r++)
330
- s(l, r);
330
+ for (let o = e.rows[0]; o <= e.rows[1]; o++)
331
+ for (let r = 0; r < l; r++)
332
+ s(o, r);
331
333
  break;
332
334
  case "cells":
333
- for (let l = e.rows[0]; l <= e.rows[1]; l++)
335
+ for (let o = e.rows[0]; o <= e.rows[1]; o++)
334
336
  for (let r = e.cols[0]; r <= e.cols[1]; r++)
335
- s(l, r);
337
+ s(o, r);
336
338
  break;
337
339
  }
338
340
  }
339
- static clamp(e, n, o) {
340
- return Math.max(n, Math.min(o, e));
341
+ static clamp(e, n, l) {
342
+ return Math.max(n, Math.min(l, e));
341
343
  }
342
344
  static intervalsEqual(e, n) {
343
345
  return e == null ? n == null : n == null ? !1 : e[0] === n[0] && e[1] === n[1];
344
346
  }
345
347
  static normalizeInterval(e, n) {
346
- return (n == null ? [e, e] : [e, n]).sort((s, l) => s - l);
348
+ return (n == null ? [e, e] : [e, n]).sort((s, o) => s - o);
347
349
  }
348
350
  }
349
- function lo(t) {
351
+ function mo(t) {
350
352
  switch (t) {
351
353
  case "up":
352
354
  return { rows: -1, cols: 0 };
@@ -358,7 +360,7 @@ function lo(t) {
358
360
  return { rows: 0, cols: 1 };
359
361
  }
360
362
  }
361
- function el(t, e) {
363
+ function dl(t, e) {
362
364
  switch (e) {
363
365
  case "up":
364
366
  return { ...t, focusSelectionIndex: 0, row: t.row - 1 };
@@ -370,110 +372,104 @@ function el(t, e) {
370
372
  return { ...t, col: t.col + 1, focusSelectionIndex: 0 };
371
373
  }
372
374
  }
373
- function nl(t, e, n) {
375
+ function fl(t, e, n) {
374
376
  if (A.getRegionCardinality(t) === "full-table")
375
377
  return t;
376
- const o = A.copy(t);
377
- let s = 0, l = 0;
378
+ const l = A.copy(t);
379
+ let s = 0, o = 0;
378
380
  if (n != null) {
379
- const c = o.rows != null && n.row === o.rows[0], i = o.rows != null && n.row === o.rows[1], u = o.cols != null && n.col === o.cols[0], f = o.cols != null && n.col === o.cols[1];
380
- e === "up" ? s = c && !i ? 1 : 0 : e === "down" ? s = i && !c ? 0 : 1 : e === "left" ? l = u && !f ? 1 : 0 : l = f && !u ? 0 : 1;
381
+ const c = l.rows != null && n.row === l.rows[0], i = l.rows != null && n.row === l.rows[1], u = l.cols != null && n.col === l.cols[0], f = l.cols != null && n.col === l.cols[1];
382
+ e === "up" ? s = c && !i ? 1 : 0 : e === "down" ? s = i && !c ? 0 : 1 : e === "left" ? o = u && !f ? 1 : 0 : o = f && !u ? 0 : 1;
381
383
  } else
382
- s = e === "down" ? 1 : 0, l = e === "right" ? 1 : 0;
383
- const r = lo(e);
384
- return o.rows != null && (o.rows[s] += r.rows), o.cols != null && (o.cols[l] += r.cols), o;
384
+ s = e === "down" ? 1 : 0, o = e === "right" ? 1 : 0;
385
+ const r = mo(e);
386
+ return l.rows != null && (l.rows[s] += r.rows), l.cols != null && (l.cols[o] += r.cols), l;
385
387
  }
386
- function Pe(t) {
388
+ function We(t) {
387
389
  return t.getStartVisibleLeafColumns().length;
388
390
  }
389
- function rt(t) {
391
+ function mt(t) {
390
392
  return t.getTopRows().length;
391
393
  }
392
- function ht(t) {
394
+ function Ct(t) {
393
395
  return t.getStartTotalSize();
394
396
  }
395
- function Nt(t, e) {
397
+ function St(t, e) {
396
398
  return e === "start" ? t.getStartVisibleLeafColumns() : t.getCenterVisibleLeafColumns();
397
399
  }
398
- function Lt(t, e) {
400
+ function pt(t, e) {
399
401
  return e === "start" ? t.getStartTotalSize() : t.getCenterTotalSize();
400
402
  }
401
- function so(t, e, n) {
402
- return e.getIsPinned() === "start" ? e.getStart("start") : ht(t) + e.getStart("center") - n;
403
- }
404
- function Bt(t, e) {
405
- return ro(0, rt(t), e);
403
+ function wo(t, e, n) {
404
+ return e.getIsPinned() === "start" ? e.getStart("start") : Ct(t) + e.getStart("center") - n;
406
405
  }
407
- function ro(t, e, n) {
408
- let o = 0;
409
- for (let s = t; s < e; s++)
410
- o += n(s);
411
- return o;
406
+ function xt(t, e) {
407
+ return e(mt(t));
412
408
  }
413
- function Zt(t, e, n) {
409
+ function ne(t, e, n) {
414
410
  if (n < 0)
415
411
  return;
416
- let o = 0;
417
- const s = Nt(t, e);
418
- let l = s.length - 1;
419
- for (; o <= l; ) {
420
- const r = o + l >> 1, c = s[r], i = c.getStart(e);
412
+ let l = 0;
413
+ const s = St(t, e);
414
+ let o = s.length - 1;
415
+ for (; l <= o; ) {
416
+ const r = l + o >> 1, c = s[r], i = c.getStart(e);
421
417
  if (n < i) {
422
- l = r - 1;
418
+ o = r - 1;
423
419
  continue;
424
420
  }
425
421
  if (n >= i + c.getSize()) {
426
- o = r + 1;
422
+ l = r + 1;
427
423
  continue;
428
424
  }
429
425
  return c.getIndex();
430
426
  }
431
427
  }
432
- function jt(t, e, n, o, s) {
433
- const l = rt(t), r = t.getRowModel().rows.length, c = e === "top" ? 0 : l, i = e === "top" ? l : r;
428
+ function oe(t, e, n, l, s) {
429
+ const o = mt(t), r = t.getRowModel().rows.length, c = e === "top" ? 0 : o, i = e === "top" ? o : r;
434
430
  if (n < 0 || c >= i)
435
431
  return;
436
- const u = o(c);
437
- let f = c, a = i - 1;
438
- for (; f <= a; ) {
439
- const m = f + a >> 1, g = o(m) - u;
440
- if (n < g) {
441
- a = m - 1;
432
+ const u = l(c);
433
+ let f = c, d = i - 1;
434
+ for (; f <= d; ) {
435
+ const E = f + d >> 1, v = l(E) - u;
436
+ if (n < v) {
437
+ d = E - 1;
442
438
  continue;
443
439
  }
444
- if (n >= g + s(m)) {
445
- f = m + 1;
440
+ if (n >= v + s(E)) {
441
+ f = E + 1;
446
442
  continue;
447
443
  }
448
- return m;
444
+ return E;
449
445
  }
450
446
  }
451
- function co({
447
+ function Eo({
452
448
  table: t,
453
449
  scrollContainerRef: e,
454
450
  rowHeaderWidth: n,
455
- columnHeaderHeight: o,
451
+ columnHeaderHeight: l,
456
452
  getRowTop: s,
457
- getRowHeight: l
453
+ getRowHeight: o
458
454
  }, r, c) {
459
455
  const i = e.current;
460
456
  if (i == null)
461
457
  return;
462
- const u = i.getBoundingClientRect(), f = r - u.left, a = c - u.top, m = ht(t), g = Bt(t, l), T = f - n, E = T - m + i.scrollLeft, v = a - o, L = v - g + i.scrollTop, R = T >= 0 && T < m ? Zt(t, "start", T) : Zt(t, "center", E), C = v >= 0 && v < g ? jt(t, "top", v, s, l) : jt(t, "center", L, s, l);
463
- if (!(R == null || C == null))
464
- return { col: R, row: C };
465
- }
466
- class io {
467
- constructor({ table: e, target: n, selectedRegions: o, numRows: s, numCols: l }) {
468
- ut(this, "target");
469
- ut(this, "regions");
470
- ut(this, "selectedRegions");
471
- ut(this, "numRows");
472
- ut(this, "numCols");
473
- ut(this, "targetRow");
474
- ut(this, "targetCell");
458
+ const u = i.getBoundingClientRect(), f = r - u.left, d = c - u.top, E = Ct(t), v = xt(t, s), N = f - n, g = N - E + i.scrollLeft, L = d - l, T = L - v + i.scrollTop, C = N >= 0 && N < E ? ne(t, "start", N) : ne(t, "center", g), m = L >= 0 && L < v ? oe(t, "top", L, s, o) : oe(t, "center", T, s, o);
459
+ if (!(C == null || m == null))
460
+ return { col: C, row: m };
461
+ }
462
+ class go {
463
+ constructor({ table: e, target: n, selectedRegions: l, numRows: s, numCols: o }) {
464
+ Et(this, "target");
465
+ Et(this, "regions");
466
+ Et(this, "selectedRegions");
467
+ Et(this, "numRows");
468
+ Et(this, "numCols");
469
+ Et(this, "targetRow");
470
+ Et(this, "targetCell");
475
471
  var r;
476
- this.target = n, this.selectedRegions = o, this.numRows = s, this.numCols = l, this.regions = A.overlapsRegion(o, n) ? o : [n], this.targetRow = e.getRowModel().rows[n.rows[0]], this.targetCell = (r = this.targetRow) == null ? void 0 : r.getVisibleCells()[n.cols[0]];
472
+ this.target = n, this.selectedRegions = l, this.numRows = s, this.numCols = o, this.regions = A.overlapsRegion(l, n) ? l : [n], this.targetRow = e.getRowModel().rows[n.rows[0]], this.targetCell = (r = this.targetRow) == null ? void 0 : r.getVisibleCells()[n.cols[0]];
477
473
  }
478
474
  getTarget() {
479
475
  return this.target;
@@ -494,60 +490,60 @@ class io {
494
490
  return this.targetCell;
495
491
  }
496
492
  }
497
- function uo(t) {
493
+ function Lo(t) {
498
494
  var u, f;
499
495
  const e = t.getVisibleLeafColumns(), n = t.state.columnPinning;
500
496
  if (n == null || (((u = n.start) == null ? void 0 : u.length) ?? 0) + (((f = n.end) == null ? void 0 : f.length) ?? 0) === 0)
501
497
  return e;
502
- const o = new Map(e.map((a) => [a.id, a])), s = (n.start ?? []).map((a) => o.get(a)).filter((a) => a != null), l = (n.end ?? []).map((a) => o.get(a)).filter((a) => a != null), r = new Set(s.map((a) => a.id)), c = new Set(l.map((a) => a.id)), i = e.filter((a) => !r.has(a.id) && !c.has(a.id));
503
- return [...s, ...i, ...l];
498
+ const l = new Map(e.map((d) => [d.id, d])), s = (n.start ?? []).map((d) => l.get(d)).filter((d) => d != null), o = (n.end ?? []).map((d) => l.get(d)).filter((d) => d != null), r = new Set(s.map((d) => d.id)), c = new Set(o.map((d) => d.id)), i = e.filter((d) => !r.has(d.id) && !c.has(d.id));
499
+ return [...s, ...i, ...o];
504
500
  }
505
- function ao(t, e, n) {
501
+ function To(t, e, n) {
506
502
  if (t.length === 0)
507
503
  return null;
508
- const o = Math.max(0, Math.min(e, t.length - 1)), s = Math.max(0, Math.min(n, t.length - 1));
509
- let l = Number.POSITIVE_INFINITY, r = Number.NEGATIVE_INFINITY;
510
- for (let c = o; c <= s; c++) {
504
+ const l = Math.max(0, Math.min(e, t.length - 1)), s = Math.max(0, Math.min(n, t.length - 1));
505
+ let o = Number.POSITIVE_INFINITY, r = Number.NEGATIVE_INFINITY;
506
+ for (let c = l; c <= s; c++) {
511
507
  const i = t[c];
512
- i < l && (l = i), i > r && (r = i);
508
+ i < o && (o = i), i > r && (r = i);
513
509
  }
514
- return [l, r];
510
+ return [o, r];
515
511
  }
516
- function fo(t, e, n) {
512
+ function Co(t, e, n) {
517
513
  if (t.length === 0)
518
514
  return null;
519
- let o = 0, s = t.length - 1, l = -1;
520
- for (; o <= s; ) {
521
- const c = o + s >> 1;
522
- t[c].getDisplayIndex() >= e ? (l = c, s = c - 1) : o = c + 1;
515
+ let l = 0, s = t.length - 1, o = -1;
516
+ for (; l <= s; ) {
517
+ const c = l + s >> 1;
518
+ t[c].getDisplayIndex() >= e ? (o = c, s = c - 1) : l = c + 1;
523
519
  }
524
- if (l < 0 || t[l].getDisplayIndex() > n)
520
+ if (o < 0 || t[o].getDisplayIndex() > n)
525
521
  return null;
526
- o = l, s = t.length - 1;
527
- let r = l;
528
- for (; o <= s; ) {
529
- const c = o + s >> 1;
530
- t[c].getDisplayIndex() <= n ? (r = c, o = c + 1) : s = c - 1;
522
+ l = o, s = t.length - 1;
523
+ let r = o;
524
+ for (; l <= s; ) {
525
+ const c = l + s >> 1;
526
+ t[c].getDisplayIndex() <= n ? (r = c, l = c + 1) : s = c - 1;
531
527
  }
532
- return [l, r];
528
+ return [o, r];
533
529
  }
534
- function ho(t, e, n, o) {
535
- const s = t[0] === 0 && t[1] === n - 1, l = e[0] === 0 && e[1] === o - 1;
536
- return s && l ? A.table() : l ? A.row(t[0], t[1]) : s ? A.column(e[0], e[1]) : A.cell(t[0], e[0], t[1], e[1]);
530
+ function vo(t, e, n, l) {
531
+ const s = t[0] === 0 && t[1] === n - 1, o = e[0] === 0 && e[1] === l - 1;
532
+ return s && o ? A.table() : o ? A.row(t[0], t[1]) : s ? A.column(e[0], e[1]) : A.cell(t[0], e[0], t[1], e[1]);
537
533
  }
538
- function qt(t) {
534
+ function le(t) {
539
535
  const e = t.getCellSelectionBounds();
540
536
  if (e.length === 0)
541
537
  return [];
542
- const n = t.getRowModel().rows, s = uo(t).map((r) => r.getIndex()), l = [];
538
+ const n = t.getRowModel().rows, s = Lo(t).map((r) => r.getIndex()), o = [];
543
539
  for (const r of e) {
544
- const c = fo(n, r.minRowIndex, r.maxRowIndex), i = ao(
540
+ const c = Co(n, r.minRowIndex, r.maxRowIndex), i = To(
545
541
  s,
546
542
  r.minColumnIndex,
547
543
  r.maxColumnIndex
548
544
  );
549
- c == null || i == null || l.push(
550
- ho(
545
+ c == null || i == null || o.push(
546
+ vo(
551
547
  c,
552
548
  i,
553
549
  n.length,
@@ -555,41 +551,41 @@ function qt(t) {
555
551
  )
556
552
  );
557
553
  }
558
- return l;
554
+ return o;
559
555
  }
560
- function mo(t, e) {
556
+ function po(t, e) {
561
557
  if (e == null || e.length === 0)
562
558
  return [];
563
- const n = t.getRowModel().rows, o = t.getVisibleLeafColumns();
564
- if (n.length === 0 || o.length === 0)
559
+ const n = t.getRowModel().rows, l = t.getVisibleLeafColumns();
560
+ if (n.length === 0 || l.length === 0)
565
561
  return [];
566
562
  const s = [];
567
- for (const l of e) {
563
+ for (const o of e) {
568
564
  let r, c;
569
- switch (A.getRegionCardinality(l)) {
570
- case J.FULL_TABLE:
571
- r = [0, n.length - 1], c = [0, o.length - 1];
565
+ switch (A.getRegionCardinality(o)) {
566
+ case ct.FULL_TABLE:
567
+ r = [0, n.length - 1], c = [0, l.length - 1];
572
568
  break;
573
- case J.FULL_COLUMNS:
574
- r = [0, n.length - 1], c = l.cols;
569
+ case ct.FULL_COLUMNS:
570
+ r = [0, n.length - 1], c = o.cols;
575
571
  break;
576
- case J.FULL_ROWS:
577
- r = l.rows, c = [0, o.length - 1];
572
+ case ct.FULL_ROWS:
573
+ r = o.rows, c = [0, l.length - 1];
578
574
  break;
579
575
  default:
580
- r = l.rows, c = l.cols;
576
+ r = o.rows, c = o.cols;
581
577
  break;
582
578
  }
583
- r[0] < 0 || r[1] >= n.length || c[0] < 0 || c[1] >= o.length || s.push({
579
+ r[0] < 0 || r[1] >= n.length || c[0] < 0 || c[1] >= l.length || s.push({
584
580
  anchorRowId: n[r[0]].id,
585
- anchorColumnId: o[c[0]].id,
581
+ anchorColumnId: l[c[0]].id,
586
582
  focusRowId: n[r[1]].id,
587
- focusColumnId: o[c[1]].id
583
+ focusColumnId: l[c[1]].id
588
584
  });
589
585
  }
590
586
  return s;
591
587
  }
592
- function Jt(t) {
588
+ function se(t) {
593
589
  const e = t.getFocusedCell();
594
590
  if (e == null)
595
591
  return;
@@ -597,12 +593,12 @@ function Jt(t) {
597
593
  if (!(n < 0))
598
594
  return { row: n, col: e.column.getIndex() };
599
595
  }
600
- function wo(t, e) {
601
- const n = t.getRowModel().rows[e.row], o = t.getVisibleLeafColumns()[e.col];
602
- if (!(n == null || o == null))
603
- return n.getAllCellsByColumnId()[o.id];
596
+ function Ao(t, e) {
597
+ const n = t.getRowModel().rows[e.row], l = t.getVisibleLeafColumns()[e.col];
598
+ if (!(n == null || l == null))
599
+ return n.getAllCellsByColumnId()[l.id];
604
600
  }
605
- function te(t) {
601
+ function re(t) {
606
602
  return JSON.stringify(
607
603
  t.map((e) => ({
608
604
  rows: e.rows ?? null,
@@ -610,259 +606,259 @@ function te(t) {
610
606
  }))
611
607
  );
612
608
  }
613
- function Eo({
609
+ function No({
614
610
  table: t,
615
611
  getRowTop: e,
616
612
  getRowHeight: n,
617
- scrollContainerRef: o,
613
+ scrollContainerRef: l,
618
614
  rowHeaderWidth: s,
619
- columnHeaderHeight: l,
615
+ columnHeaderHeight: o,
620
616
  bodyContextMenuRenderer: r,
621
617
  enableBodyContextMenu: c,
622
618
  enableFocusedCell: i = !1,
623
619
  onFocusedCell: u,
624
620
  onFocusedRegion: f,
625
- selectedRegions: a,
626
- onSelection: m,
627
- selectionModes: g
621
+ selectedRegions: d,
622
+ onSelection: E,
623
+ selectionModes: v
628
624
  }) {
629
- const T = a != null, E = c ?? r != null, v = X(!1), L = X(void 0), R = b(
630
- (w) => g == null ? !0 : g.includes(w),
631
- [g]
632
- ), C = t.state.cellSelection, y = t.state.columnPinning, D = t.getRowModel().rows, z = t.getVisibleLeafColumns(), M = dt(
633
- () => qt(t),
625
+ const N = d != null, g = c ?? r != null, L = Z(!1), T = Z(void 0), C = P(
626
+ (w) => v == null ? !0 : v.includes(w),
627
+ [v]
628
+ ), m = t.state.cellSelection, U = t.state.columnPinning, y = t.getRowModel().rows, z = t.getVisibleLeafColumns(), S = gt(
629
+ () => le(t),
634
630
  // The translation helper reads reactive table state (selection, rows,
635
631
  // columns, pinning) that the linter cannot see through the `table` prop.
636
632
  // eslint-disable-next-line react-hooks/exhaustive-deps
637
- [C, y, D, t, z]
638
- ), p = dt(
639
- () => i ? Jt(t) : void 0,
633
+ [m, U, y, t, z]
634
+ ), R = gt(
635
+ () => i ? se(t) : void 0,
640
636
  // Same as above: the helper reads the selection and row model from the table.
641
637
  // eslint-disable-next-line react-hooks/exhaustive-deps
642
- [C, i, D, t]
643
- ), U = dt(() => {
638
+ [m, i, y, t]
639
+ ), V = gt(() => {
644
640
  const w = [];
645
- return M.length > 0 && w.push({ className: Oe, regions: M }), p != null && w.push({
646
- className: Te,
647
- regions: [A.cell(p.row, p.col)]
641
+ return S.length > 0 && w.push({ className: $e, regions: S }), R != null && w.push({
642
+ className: Ne,
643
+ regions: [A.cell(R.row, R.col)]
648
644
  }), w;
649
- }, [p, M]);
650
- at(() => {
651
- if (!T)
645
+ }, [R, S]);
646
+ Lt(() => {
647
+ if (!N)
652
648
  return;
653
- const w = te(a ?? []);
654
- L.current !== w && (L.current = w, t.setCellSelection(mo(t, a)));
655
- }, [a, T, t]);
656
- const H = X(null), N = X(!1);
657
- at(() => {
658
- const w = te(M);
659
- if (H.current !== w) {
660
- if (H.current = w, !N.current) {
661
- N.current = !0;
649
+ const w = re(d ?? []);
650
+ T.current !== w && (T.current = w, t.setCellSelection(po(t, d)));
651
+ }, [d, N, t]);
652
+ const j = Z(null), _ = Z(!1);
653
+ Lt(() => {
654
+ const w = re(S);
655
+ if (j.current !== w) {
656
+ if (j.current = w, !_.current) {
657
+ _.current = !0;
662
658
  return;
663
659
  }
664
- T && L.current === w || m == null || m(M);
660
+ N && T.current === w || E == null || E(S);
665
661
  }
666
- }, [T, m, M]);
667
- const I = X(null);
668
- at(() => {
662
+ }, [N, E, S]);
663
+ const x = Z(null);
664
+ Lt(() => {
669
665
  if (!i)
670
666
  return;
671
- const w = p != null ? `${p.row}-${p.col}` : null;
672
- I.current !== w && (I.current = w, p != null && (u == null || u(p), f == null || f({
673
- type: xe.CELL,
674
- row: p.row,
675
- col: p.col,
667
+ const w = R != null ? `${R.row}-${R.col}` : null;
668
+ x.current !== w && (x.current = w, R != null && (u == null || u(R), f == null || f({
669
+ type: Ge.CELL,
670
+ row: R.row,
671
+ col: R.col,
676
672
  focusSelectionIndex: 0
677
673
  })));
678
- }, [i, p, u, f]);
679
- const O = b(() => {
674
+ }, [i, R, u, f]);
675
+ const H = P(() => {
680
676
  var w;
681
- i && ((w = o.current) == null || w.focus());
682
- }, [i, o]), S = b(() => {
683
- const w = Jt(t);
677
+ i && ((w = l.current) == null || w.focus());
678
+ }, [i, l]), I = P(() => {
679
+ const w = se(t);
684
680
  if (w == null)
685
681
  return;
686
- const B = o.current;
687
- if (B == null)
682
+ const p = l.current;
683
+ if (p == null)
688
684
  return;
689
- const x = t.getVisibleLeafColumns()[w.col];
690
- if (x == null)
685
+ const $ = t.getVisibleLeafColumns()[w.col];
686
+ if ($ == null)
691
687
  return;
692
- const j = Pe(t), q = ht(t), ot = rt(t), W = Bt(t, n), k = x.getStart(), lt = k + x.getSize(), it = e(w.row), St = it + n(w.row), Tt = B.clientWidth - s - q, Wt = B.clientHeight - l - W;
693
- let mt = B.scrollLeft, wt = B.scrollTop;
694
- if (w.col >= j) {
695
- const Ct = k - q, pt = lt - q;
696
- Ct < mt ? mt = Math.max(0, Ct) : pt > mt + Tt && (mt = pt - Tt);
688
+ const K = We(t), q = Ct(t), it = mt(t), nt = xt(t, e), tt = $.getStart(), at = tt + $.getSize(), ht = e(w.row), k = ht + n(w.row), Y = p.clientWidth - s - q, ot = p.clientHeight - o - nt;
689
+ let et = p.scrollLeft, rt = p.scrollTop;
690
+ if (w.col >= K) {
691
+ const ut = tt - q, wt = at - q;
692
+ ut < et ? et = Math.max(0, ut) : wt > et + Y && (et = wt - Y);
697
693
  }
698
- if (w.row >= ot) {
699
- const Ct = it - W, pt = St - W;
700
- Ct < wt ? wt = Math.max(0, Ct) : pt > wt + Wt && (wt = pt - Wt);
694
+ if (w.row >= it) {
695
+ const ut = ht - nt, wt = k - nt;
696
+ ut < rt ? rt = Math.max(0, ut) : wt > rt + ot && (rt = wt - ot);
701
697
  }
702
- mt !== B.scrollLeft && (B.scrollLeft = mt), wt !== B.scrollTop && (B.scrollTop = wt);
698
+ et !== p.scrollLeft && (p.scrollLeft = et), rt !== p.scrollTop && (p.scrollTop = rt);
703
699
  }, [
704
- l,
700
+ o,
705
701
  n,
706
702
  e,
707
703
  s,
708
- o,
704
+ l,
709
705
  t
710
706
  ]);
711
- at(() => {
712
- v.current && (v.current = !1, S());
713
- }, [C, S, t]);
714
- const _ = b(
707
+ Lt(() => {
708
+ L.current && (L.current = !1, I());
709
+ }, [m, I, t]);
710
+ const X = P(
715
711
  (w) => {
716
- const B = w.metaKey || w.ctrlKey, $ = w.key;
717
- let x;
718
- if ($ === "ArrowUp" ? x = "up" : $ === "ArrowDown" ? x = "down" : $ === "ArrowLeft" ? x = "left" : $ === "ArrowRight" && (x = "right"), x != null) {
719
- w.preventDefault(), w.stopPropagation(), w.shiftKey ? t.extendCellSelection(x) : i && (v.current = !0, t.moveCellSelection(x));
712
+ const p = w.metaKey || w.ctrlKey, F = w.key;
713
+ let $;
714
+ if (F === "ArrowUp" ? $ = "up" : F === "ArrowDown" ? $ = "down" : F === "ArrowLeft" ? $ = "left" : F === "ArrowRight" && ($ = "right"), $ != null) {
715
+ w.preventDefault(), w.stopPropagation(), w.shiftKey ? t.extendCellSelection($) : i && (L.current = !0, t.moveCellSelection($));
720
716
  return;
721
717
  }
722
- if ($ === "Tab" && i) {
723
- w.preventDefault(), w.stopPropagation(), v.current = !0, t.moveCellSelection(w.shiftKey ? "left" : "right");
718
+ if (F === "Tab" && i) {
719
+ w.preventDefault(), w.stopPropagation(), L.current = !0, t.moveCellSelection(w.shiftKey ? "left" : "right");
724
720
  return;
725
721
  }
726
- if ($ === "Escape") {
722
+ if (F === "Escape") {
727
723
  w.preventDefault(), w.stopPropagation(), t.resetCellSelection(!0);
728
724
  return;
729
725
  }
730
- B && $.toLowerCase() === "a" && (w.preventDefault(), w.stopPropagation(), t.selectAllCells());
726
+ p && F.toLowerCase() === "a" && (w.preventDefault(), w.stopPropagation(), t.selectAllCells());
731
727
  },
732
728
  [i, t]
733
- ), G = b(
734
- (w, B) => co(
735
- { table: t, scrollContainerRef: o, rowHeaderWidth: s, columnHeaderHeight: l, getRowTop: e, getRowHeight: n },
729
+ ), M = P(
730
+ (w, p) => Eo(
731
+ { table: t, scrollContainerRef: l, rowHeaderWidth: s, columnHeaderHeight: o, getRowTop: e, getRowHeight: n },
736
732
  w,
737
- B
733
+ p
738
734
  ),
739
- [l, n, e, s, o, t]
740
- ), Y = b(
735
+ [o, n, e, s, l, t]
736
+ ), O = P(
741
737
  (w) => {
742
- w.button === 0 && O();
738
+ w.button === 0 && H();
743
739
  },
744
- [O]
745
- ), Q = b(
740
+ [H]
741
+ ), B = P(
746
742
  (w) => {
747
- if (!E)
743
+ if (!g)
748
744
  return;
749
- const B = G(w.clientX, w.clientY);
750
- if (B == null)
745
+ const p = M(w.clientX, w.clientY);
746
+ if (p == null)
751
747
  return;
752
- const $ = wo(t, B);
753
- $ != null && ($.getIsSelected() || R(J.CELLS) && t.setCellSelection([
748
+ const F = Ao(t, p);
749
+ F != null && (F.getIsSelected() || C(ct.CELLS) && t.setCellSelection([
754
750
  {
755
- anchorRowId: $.row.id,
756
- anchorColumnId: $.column.id,
757
- focusRowId: $.row.id,
758
- focusColumnId: $.column.id
751
+ anchorRowId: F.row.id,
752
+ anchorColumnId: F.column.id,
753
+ focusRowId: F.row.id,
754
+ focusColumnId: F.column.id
759
755
  }
760
756
  ]));
761
757
  },
762
- [G, E, R, t]
763
- ), K = b(
758
+ [M, g, C, t]
759
+ ), D = P(
764
760
  (w) => {
765
- if (!E || r == null)
761
+ if (!g || r == null)
766
762
  return;
767
- const B = G(w.clientX, w.clientY);
768
- if (B == null)
763
+ const p = M(w.clientX, w.clientY);
764
+ if (p == null)
769
765
  return;
770
- const $ = new io({
766
+ const F = new go({
771
767
  table: t,
772
- target: A.cell(B.row, B.col),
768
+ target: A.cell(p.row, p.col),
773
769
  // Read the selection freshly: the right-click may have just moved it.
774
- selectedRegions: qt(t),
770
+ selectedRegions: le(t),
775
771
  numRows: t.getRowModel().rows.length,
776
772
  numCols: t.getVisibleLeafColumns().length
777
773
  });
778
- return r($) ?? void 0;
774
+ return r(F) ?? void 0;
779
775
  },
780
- [r, G, E, t]
781
- ), Z = b(
782
- (w, B) => {
783
- if (!R(J.FULL_COLUMNS)) {
784
- t.resetCellSelection(!0), O();
776
+ [r, M, g, t]
777
+ ), b = P(
778
+ (w, p) => {
779
+ if (!C(ct.FULL_COLUMNS)) {
780
+ t.resetCellSelection(!0), H();
785
781
  return;
786
782
  }
787
- B.preventDefault(), B.stopPropagation();
788
- const $ = t.getRowModel().rows, x = t.getVisibleLeafColumns()[w];
789
- x == null || $.length === 0 || (B.shiftKey ? t.setCellSelection((j) => {
790
- const q = j[j.length - 1];
783
+ p.preventDefault(), p.stopPropagation();
784
+ const F = t.getRowModel().rows, $ = t.getVisibleLeafColumns()[w];
785
+ $ == null || F.length === 0 || (p.shiftKey ? t.setCellSelection((K) => {
786
+ const q = K[K.length - 1];
791
787
  return q == null ? [
792
788
  {
793
- anchorRowId: $[0].id,
794
- anchorColumnId: x.id,
795
- focusRowId: $[$.length - 1].id,
796
- focusColumnId: x.id
789
+ anchorRowId: F[0].id,
790
+ anchorColumnId: $.id,
791
+ focusRowId: F[F.length - 1].id,
792
+ focusColumnId: $.id
797
793
  }
798
- ] : [...j.slice(0, -1), { ...q, focusColumnId: x.id }];
794
+ ] : [...K.slice(0, -1), { ...q, focusColumnId: $.id }];
799
795
  }) : t.setCellSelection([
800
796
  {
801
- anchorRowId: $[0].id,
802
- anchorColumnId: x.id,
803
- focusRowId: $[$.length - 1].id,
804
- focusColumnId: x.id
797
+ anchorRowId: F[0].id,
798
+ anchorColumnId: $.id,
799
+ focusRowId: F[F.length - 1].id,
800
+ focusColumnId: $.id
805
801
  }
806
- ]), O());
802
+ ]), H());
807
803
  },
808
- [O, R, t]
809
- ), et = b(
810
- (w, B) => {
811
- if (!R(J.FULL_ROWS)) {
812
- t.resetCellSelection(!0), O();
804
+ [H, C, t]
805
+ ), J = P(
806
+ (w, p) => {
807
+ if (!C(ct.FULL_ROWS)) {
808
+ t.resetCellSelection(!0), H();
813
809
  return;
814
810
  }
815
- B.preventDefault(), B.stopPropagation();
816
- const $ = t.getRowModel().rows, x = t.getVisibleLeafColumns(), j = $[w];
817
- j == null || x.length === 0 || (B.shiftKey ? t.setCellSelection((q) => {
818
- const ot = q[q.length - 1];
819
- return ot == null ? [
811
+ p.preventDefault(), p.stopPropagation();
812
+ const F = t.getRowModel().rows, $ = t.getVisibleLeafColumns(), K = F[w];
813
+ K == null || $.length === 0 || (p.shiftKey ? t.setCellSelection((q) => {
814
+ const it = q[q.length - 1];
815
+ return it == null ? [
820
816
  {
821
- anchorRowId: j.id,
822
- anchorColumnId: x[0].id,
823
- focusRowId: j.id,
824
- focusColumnId: x[x.length - 1].id
817
+ anchorRowId: K.id,
818
+ anchorColumnId: $[0].id,
819
+ focusRowId: K.id,
820
+ focusColumnId: $[$.length - 1].id
825
821
  }
826
- ] : [...q.slice(0, -1), { ...ot, focusRowId: j.id }];
822
+ ] : [...q.slice(0, -1), { ...it, focusRowId: K.id }];
827
823
  }) : t.setCellSelection([
828
824
  {
829
- anchorRowId: j.id,
830
- anchorColumnId: x[0].id,
831
- focusRowId: j.id,
832
- focusColumnId: x[x.length - 1].id
825
+ anchorRowId: K.id,
826
+ anchorColumnId: $[0].id,
827
+ focusRowId: K.id,
828
+ focusColumnId: $[$.length - 1].id
833
829
  }
834
- ]), O());
830
+ ]), H());
835
831
  },
836
- [O, R, t]
837
- ), ct = b(
832
+ [H, C, t]
833
+ ), st = P(
838
834
  (w) => {
839
- if (!R(J.FULL_TABLE)) {
840
- t.resetCellSelection(!0), O();
835
+ if (!C(ct.FULL_TABLE)) {
836
+ t.resetCellSelection(!0), H();
841
837
  return;
842
838
  }
843
- w.preventDefault(), w.stopPropagation(), t.selectAllCells(), O();
839
+ w.preventDefault(), w.stopPropagation(), t.selectAllCells(), H();
844
840
  },
845
- [O, R, t]
841
+ [H, C, t]
846
842
  );
847
843
  return {
848
- regionGroups: U,
849
- handleBodyContextMenu: Q,
850
- handleBodyPointerDown: Y,
851
- handleColumnHeaderMouseDown: Z,
852
- handleKeyDown: _,
853
- handleMenuMouseDown: ct,
854
- handleRowHeaderMouseDown: et,
855
- isBodyContextMenuEnabled: E,
856
- isSelectionModeEnabled: R,
857
- renderBodyContextMenu: K
844
+ regionGroups: V,
845
+ handleBodyContextMenu: B,
846
+ handleBodyPointerDown: O,
847
+ handleColumnHeaderMouseDown: b,
848
+ handleKeyDown: X,
849
+ handleMenuMouseDown: st,
850
+ handleRowHeaderMouseDown: J,
851
+ isBodyContextMenuEnabled: g,
852
+ isSelectionModeEnabled: C,
853
+ renderBodyContextMenu: D
858
854
  };
859
855
  }
860
- function Lo({
856
+ function _o({
861
857
  minHeight: t,
862
858
  headerRowCount: e
863
859
  }) {
864
- const n = X(null), [o, s] = tt(null);
865
- st(() => {
860
+ const n = Z(null), [l, s] = lt(null);
861
+ dt(() => {
866
862
  const r = n.current;
867
863
  if (r == null)
868
864
  return;
@@ -874,462 +870,528 @@ function Lo({
874
870
  const i = new ResizeObserver(c);
875
871
  return i.observe(r), () => i.disconnect();
876
872
  }, []);
877
- const l = Math.max(0, e) * fe;
873
+ const o = Math.max(0, e) * ge;
878
874
  return {
879
875
  ref: n,
880
- height: Math.max(t, l, o ?? 0)
876
+ height: Math.max(t, o, l ?? 0)
881
877
  };
882
878
  }
883
- function go({
879
+ function So({
884
880
  enableGhostCells: t,
885
881
  rowHeight: e,
886
882
  rowHeaderWidth: n,
887
- columnHeaderHeight: o,
883
+ columnHeaderHeight: l,
888
884
  totalWidth: s,
889
- totalHeight: l,
885
+ totalHeight: o,
890
886
  scrollContainerRef: r
891
887
  }) {
892
- const [c, i] = tt(null);
893
- if (st(() => {
894
- const g = r.current;
895
- if (g == null)
888
+ const [c, i] = lt(null);
889
+ if (dt(() => {
890
+ const v = r.current;
891
+ if (v == null)
896
892
  return;
897
- const T = () => {
898
- i({ width: g.clientWidth, height: g.clientHeight });
893
+ const N = () => {
894
+ i({ width: v.clientWidth, height: v.clientHeight });
899
895
  };
900
- T();
901
- const E = new ResizeObserver(T);
902
- return E.observe(g), () => E.disconnect();
896
+ N();
897
+ const g = new ResizeObserver(N);
898
+ return g.observe(v), () => g.disconnect();
903
899
  }, [r]), !t || c == null)
904
900
  return;
905
- const u = c.width - n - s, f = c.height - o - l, a = u > 0 ? Math.min(Math.ceil(u / Yt), En) : 0, m = f > 0 ? Math.min(Math.ceil(f / e), Ln) : 0;
906
- if (!(a === 0 && m === 0))
901
+ const u = c.width - n - s, f = c.height - l - o, d = u > 0 ? Math.min(Math.ceil(u / qt), pn) : 0, E = f > 0 ? Math.min(Math.ceil(f / e), An) : 0;
902
+ if (!(d === 0 && E === 0))
907
903
  return {
908
- columnCount: a,
909
- rowCount: m,
910
- columnWidth: Yt,
904
+ columnCount: d,
905
+ rowCount: E,
906
+ columnWidth: qt,
911
907
  rowHeight: e
912
908
  };
913
909
  }
914
- function Ue(t, e) {
910
+ function Pe(t, e) {
915
911
  return e == null ? t : t + e.columnCount * e.columnWidth;
916
912
  }
917
- const To = 6, Co = 100;
918
- function po({
913
+ const Ro = 6, Io = 100;
914
+ function Mo({
919
915
  rowHeight: t,
920
916
  rowCount: e,
921
- rowHeights: n,
922
- defaultRowHeights: o,
923
- enableRowResizing: s = !1,
924
- minRowHeight: l = To,
925
- maxRowHeight: r = Co,
926
- onRowHeightChanged: c
917
+ getDetailHeight: n,
918
+ rowHeights: l,
919
+ defaultRowHeights: s,
920
+ enableRowResizing: o = !1,
921
+ minRowHeight: r = Ro,
922
+ maxRowHeight: c = Io,
923
+ onRowHeightChanged: i
927
924
  }) {
928
- const i = n != null, [u, f] = tt(
929
- o ?? []
930
- ), [a, m] = tt(null), [g, T] = tt(null), E = X(null), v = b(
931
- (S) => i ? n[S] ?? t : u[S] ?? (o == null ? void 0 : o[S]) ?? t,
932
- [o, u, i, t, n]
933
- ), { rowTops: L, totalHeight: R } = dt(() => {
934
- const S = new Array(e);
935
- let _ = 0;
936
- for (let G = 0; G < e; G++)
937
- S[G] = _, _ += v(G);
938
- return { rowTops: S, totalHeight: _ };
939
- }, [v, e]), C = b((S) => L[S] ?? 0, [L]), y = X(v);
940
- y.current = v;
941
- const D = X(L);
942
- D.current = L;
943
- const z = X(s);
944
- z.current = s;
945
- const M = X(i);
946
- M.current = i;
947
- const p = X(l);
948
- p.current = l;
949
- const U = X(r);
950
- U.current = r;
951
- const H = X(c);
952
- H.current = c;
953
- const N = b((S) => {
954
- var Q, K;
955
- const _ = E.current;
956
- if (_ == null)
925
+ const u = l != null, [f, d] = lt(
926
+ s ?? []
927
+ ), [E, v] = lt(null), [N, g] = lt(null), L = Z(null), T = P(
928
+ (M) => u ? l[M] ?? t : f[M] ?? (s == null ? void 0 : s[M]) ?? t,
929
+ [s, f, u, t, l]
930
+ ), { rowTops: C, totalHeight: m } = gt(() => {
931
+ const M = new Array(e + 1);
932
+ let O = 0;
933
+ for (let B = 0; B < e; B++)
934
+ M[B] = O, O += T(B) + ((n == null ? void 0 : n(B)) ?? 0);
935
+ return M[e] = O, { rowTops: M, totalHeight: O };
936
+ }, [n, T, e]), U = P((M) => C[M] ?? 0, [C]), y = P((M) => C[M + 1] - C[M], [C]), z = Z(T);
937
+ z.current = T;
938
+ const S = Z(C);
939
+ S.current = C;
940
+ const R = Z(o);
941
+ R.current = o;
942
+ const V = Z(u);
943
+ V.current = u;
944
+ const j = Z(r);
945
+ j.current = r;
946
+ const _ = Z(c);
947
+ _.current = c;
948
+ const x = Z(i);
949
+ x.current = i;
950
+ const H = P((M) => {
951
+ var b, J;
952
+ const O = L.current;
953
+ if (O == null)
957
954
  return;
958
- const G = "touches" in S ? (Q = S.touches[0]) == null ? void 0 : Q.clientY : S.clientY;
959
- if (G == null)
955
+ const B = "touches" in M ? (b = M.touches[0]) == null ? void 0 : b.clientY : M.clientY;
956
+ if (B == null)
960
957
  return;
961
- const Y = Math.min(
962
- _.max,
963
- Math.max(_.min, _.startHeight + (G - _.startY))
958
+ const D = Math.min(
959
+ O.max,
960
+ Math.max(O.min, O.startHeight + (B - O.startY))
964
961
  );
965
- M.current || f((Z) => {
966
- const et = Z.slice();
967
- return et[_.index] = Y, et;
968
- }), (K = H.current) == null || K.call(H, _.index, Y), T(_.rowTop + Y);
969
- }, []), I = b(() => {
970
- E.current = null, m(null), T(null), window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", I), window.removeEventListener("touchmove", N), window.removeEventListener("touchend", I), window.removeEventListener("touchcancel", I);
971
- }, [N]), O = b((S, _) => {
972
- var K;
973
- if (!z.current)
962
+ V.current || d((st) => {
963
+ const w = st.slice();
964
+ return w[O.index] = D, w;
965
+ }), (J = x.current) == null || J.call(x, O.index, D), g(O.rowTop + D);
966
+ }, []), I = P(() => {
967
+ L.current = null, v(null), g(null), window.removeEventListener("mousemove", H), window.removeEventListener("mouseup", I), window.removeEventListener("touchmove", H), window.removeEventListener("touchend", I), window.removeEventListener("touchcancel", I);
968
+ }, [H]), X = P((M, O) => {
969
+ var J;
970
+ if (!R.current)
974
971
  return;
975
- _.preventDefault(), _.stopPropagation();
976
- const G = "touches" in _ ? (K = _.touches[0]) == null ? void 0 : K.clientY : _.clientY;
977
- if (G == null)
972
+ O.preventDefault(), O.stopPropagation();
973
+ const B = "touches" in O ? (J = O.touches[0]) == null ? void 0 : J.clientY : O.clientY;
974
+ if (B == null)
978
975
  return;
979
- const Y = D.current[S] ?? 0, Q = y.current(S);
980
- E.current = {
981
- index: S,
982
- startY: G,
983
- startHeight: Q,
984
- rowTop: Y,
985
- min: p.current,
986
- max: U.current
987
- }, m(S), T(Y + Q), window.addEventListener("mousemove", N), window.addEventListener("mouseup", I), window.addEventListener("touchmove", N), window.addEventListener("touchend", I), window.addEventListener("touchcancel", I);
988
- }, [N, I]);
989
- return at(() => () => {
990
- window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", I), window.removeEventListener("touchmove", N), window.removeEventListener("touchend", I), window.removeEventListener("touchcancel", I);
991
- }, [N, I]), {
992
- enabled: s,
993
- getRowHeight: v,
994
- getRowTop: C,
995
- totalHeight: R,
996
- resizingRowIndex: a,
997
- resizingGuideTop: g,
998
- startRowResize: O
976
+ const D = S.current[M] ?? 0, b = z.current(M);
977
+ L.current = {
978
+ index: M,
979
+ startY: B,
980
+ startHeight: b,
981
+ rowTop: D,
982
+ min: j.current,
983
+ max: _.current
984
+ }, v(M), g(D + b), window.addEventListener("mousemove", H), window.addEventListener("mouseup", I), window.addEventListener("touchmove", H), window.addEventListener("touchend", I), window.addEventListener("touchcancel", I);
985
+ }, [H, I]);
986
+ return Lt(() => () => {
987
+ window.removeEventListener("mousemove", H), window.removeEventListener("mouseup", I), window.removeEventListener("touchmove", H), window.removeEventListener("touchend", I), window.removeEventListener("touchcancel", I);
988
+ }, [H, I]), {
989
+ enabled: o,
990
+ getRowHeight: T,
991
+ getRowSpanHeight: y,
992
+ getRowTop: U,
993
+ totalHeight: m,
994
+ resizingRowIndex: E,
995
+ resizingGuideTop: N,
996
+ startRowResize: X
999
997
  };
1000
998
  }
1001
- const He = se(null);
1002
- function _t() {
1003
- return re(He);
999
+ const Ve = Gt(null);
1000
+ function Rt() {
1001
+ return Wt(Ve);
1004
1002
  }
1005
- const ze = se(null);
1006
- function vo() {
1007
- return re(ze);
1003
+ const be = Gt(null);
1004
+ function Oo() {
1005
+ return Wt(be);
1008
1006
  }
1009
- function Ao(t, e) {
1007
+ function yo(t, e) {
1010
1008
  return e < t ? e : t <= e && e < t + 1 ? t : Math.max(0, e - 1);
1011
1009
  }
1012
- function No(t, e, n, o, s) {
1013
- const [l, r] = tt(null), [c, i] = tt(null), u = X(null), f = b(
1014
- (v) => {
1015
- var z, M;
1016
- const L = ((z = n.current) == null ? void 0 : z.getBoundingClientRect().left) ?? 0, R = ((M = o.current) == null ? void 0 : M.scrollLeft) ?? 0, C = ht(t), y = v - L - s;
1017
- if (y < C) {
1018
- let p = 0;
1019
- for (const U of Nt(t, "start"))
1020
- if (U.getStart("start") + U.getSize() / 2 < y)
1021
- p++;
1010
+ function xo(t, e, n, l, s) {
1011
+ const [o, r] = lt(null), [c, i] = lt(null), u = Z(null), f = P(
1012
+ (L) => {
1013
+ var z, S;
1014
+ const T = ((z = n.current) == null ? void 0 : z.getBoundingClientRect().left) ?? 0, C = ((S = l.current) == null ? void 0 : S.scrollLeft) ?? 0, m = Ct(t), U = L - T - s;
1015
+ if (U < m) {
1016
+ let R = 0;
1017
+ for (const V of St(t, "start"))
1018
+ if (V.getStart("start") + V.getSize() / 2 < U)
1019
+ R++;
1022
1020
  else
1023
1021
  break;
1024
- return p;
1022
+ return R;
1025
1023
  }
1026
- let D = Pe(t);
1027
- for (const p of Nt(t, "center"))
1028
- if (C + p.getStart("center") - R + p.getSize() / 2 < y)
1029
- D++;
1024
+ let y = We(t);
1025
+ for (const R of St(t, "center"))
1026
+ if (m + R.getStart("center") - C + R.getSize() / 2 < U)
1027
+ y++;
1030
1028
  else
1031
1029
  break;
1032
- return D;
1030
+ return y;
1033
1031
  },
1034
- [n, s, o, t]
1035
- ), a = b(
1036
- (v) => {
1032
+ [n, s, l, t]
1033
+ ), d = P(
1034
+ (L) => {
1037
1035
  var z;
1038
- const L = u.current;
1039
- if (u.current = null, r(null), i(null), L == null)
1036
+ const T = u.current;
1037
+ if (u.current = null, r(null), i(null), T == null)
1040
1038
  return;
1041
- const R = t.getVisibleLeafColumns(), C = (z = R[L.oldIndex]) == null ? void 0 : z.id;
1042
- if (C == null)
1039
+ const C = t.getVisibleLeafColumns(), m = (z = C[T.oldIndex]) == null ? void 0 : z.id;
1040
+ if (m == null)
1043
1041
  return;
1044
- const y = Ao(L.oldIndex, f(v)), D = R.map((M) => M.id).filter((M) => M !== C);
1045
- D.splice(y, 0, C), t.setColumnOrder(D);
1042
+ const U = yo(T.oldIndex, f(L)), y = C.map((S) => S.id).filter((S) => S !== m);
1043
+ y.splice(U, 0, m), t.setColumnOrder(y);
1046
1044
  },
1047
1045
  [f, t]
1048
- ), m = b(
1049
- (v) => {
1050
- u.current != null && i(f(v.clientX));
1046
+ ), E = P(
1047
+ (L) => {
1048
+ u.current != null && i(f(L.clientX));
1051
1049
  },
1052
1050
  [f]
1053
- ), g = b(
1054
- (v) => {
1055
- a(v.clientX);
1051
+ ), v = P(
1052
+ (L) => {
1053
+ d(L.clientX);
1056
1054
  },
1057
- [a]
1058
- ), T = b(
1059
- (v, L) => {
1060
- e && (L.preventDefault(), u.current = { oldIndex: v.getIndex() }, r(v.id), i(f(L.clientX)), window.addEventListener("pointermove", m), window.addEventListener("pointerup", g), window.addEventListener("pointercancel", g));
1055
+ [d]
1056
+ ), N = P(
1057
+ (L, T) => {
1058
+ e && (T.preventDefault(), u.current = { oldIndex: L.getIndex() }, r(L.id), i(f(T.clientX)), window.addEventListener("pointermove", E), window.addEventListener("pointerup", v), window.addEventListener("pointercancel", v));
1061
1059
  },
1062
- [e, f, m, g]
1060
+ [e, f, E, v]
1063
1061
  );
1064
- return at(() => () => {
1065
- window.removeEventListener("pointermove", m), window.removeEventListener("pointerup", g), window.removeEventListener("pointercancel", g);
1066
- }, [m, g]), { contextValue: dt(
1067
- () => ({ enableColumnReordering: e, reorderingColumnId: l, startReorder: T }),
1068
- [e, l, T]
1069
- ), guideIndex: c, reorderingColumnId: l };
1062
+ return Lt(() => () => {
1063
+ window.removeEventListener("pointermove", E), window.removeEventListener("pointerup", v), window.removeEventListener("pointercancel", v);
1064
+ }, [E, v]), { contextValue: gt(
1065
+ () => ({ enableColumnReordering: e, reorderingColumnId: o, startReorder: N }),
1066
+ [e, o, N]
1067
+ ), guideIndex: c, reorderingColumnId: o };
1070
1068
  }
1071
- function _o({
1069
+ function Bo({
1072
1070
  table: t,
1073
1071
  reorderingColumnId: e,
1074
1072
  guideIndex: n,
1075
- rowHeaderWidth: o,
1073
+ rowHeaderWidth: l,
1076
1074
  scrollLeft: s
1077
1075
  }) {
1078
1076
  if (e == null || n == null)
1079
1077
  return null;
1080
- const l = t.getVisibleLeafColumns(), r = t.getStartVisibleLeafColumns().length, c = l[n], i = ht(t);
1078
+ const o = t.getVisibleLeafColumns(), r = t.getStartVisibleLeafColumns().length, c = o[n], i = Ct(t);
1081
1079
  let u;
1082
- return n <= r ? u = n < r && c != null ? c.getStart("start") : i : c != null ? u = i + c.getStart("center") - s : u = i + Lt(t, "center") - s, /* @__PURE__ */ d("div", { className: P(Ae, bt), children: /* @__PURE__ */ d(
1080
+ return n <= r ? u = n < r && c != null ? c.getStart("start") : i : c != null ? u = i + c.getStart("center") - s : u = i + pt(t, "center") - s, /* @__PURE__ */ a("div", { className: G(Ie, Yt), children: /* @__PURE__ */ a(
1083
1081
  "div",
1084
1082
  {
1085
- className: P(Ot, ye),
1086
- style: { left: o + u }
1083
+ className: G(yt, ze),
1084
+ style: { left: l + u }
1087
1085
  }
1088
1086
  ) });
1089
1087
  }
1090
- function So({
1088
+ function Do({
1091
1089
  table: t,
1092
1090
  rowHeaderWidth: e,
1093
1091
  columnHeaderHeight: n,
1094
- scrollLeft: o,
1092
+ scrollLeft: l,
1095
1093
  scrollTop: s,
1096
- frozenRowCount: l,
1094
+ frozenRowCount: o,
1097
1095
  resizingGuideTop: r = null,
1098
1096
  resizingRowIndex: c = null
1099
1097
  }) {
1100
- const i = t.state.columnResizing, u = i == null ? void 0 : i.isResizingColumn, f = u != null && u !== !1 ? t.getColumn(u) : void 0, a = f != null ? e + so(t, f, o) + f.getSize() + ((i == null ? void 0 : i.deltaOffset) ?? 0) : null, m = r != null && c != null ? n + r - (c < l ? 0 : s) : null;
1101
- return a == null && m == null ? null : /* @__PURE__ */ F("div", { className: P(Ae, bt), children: [
1102
- a != null && /* @__PURE__ */ d(
1098
+ const i = t.state.columnResizing, u = i == null ? void 0 : i.isResizingColumn, f = u != null && u !== !1 ? t.getColumn(u) : void 0, d = f != null ? e + wo(t, f, l) + f.getSize() + ((i == null ? void 0 : i.deltaOffset) ?? 0) : null, E = r != null && c != null ? n + r - (c < o ? 0 : s) : null;
1099
+ return d == null && E == null ? null : /* @__PURE__ */ W("div", { className: G(Ie, Yt), children: [
1100
+ d != null && /* @__PURE__ */ a(
1103
1101
  "div",
1104
1102
  {
1105
- className: P(Ot, ye),
1106
- style: { left: a }
1103
+ className: G(yt, ze),
1104
+ style: { left: d }
1107
1105
  }
1108
1106
  ),
1109
- m != null && /* @__PURE__ */ d(
1107
+ E != null && /* @__PURE__ */ a(
1110
1108
  "div",
1111
1109
  {
1112
- className: P(Ot, Mn),
1113
- style: { top: m }
1110
+ className: G(yt, $n),
1111
+ style: { top: E }
1114
1112
  }
1115
1113
  )
1116
1114
  ] });
1117
1115
  }
1118
- function gt({
1116
+ function $o({
1117
+ row: t,
1118
+ rowIndex: e,
1119
+ rowExpanderButtonProps: n,
1120
+ rowExpanderIconProps: l
1121
+ }) {
1122
+ const s = t.getIsExpanded(), o = typeof n == "function" ? n(t) : n, r = typeof l == "function" ? l(t) : l;
1123
+ return /* @__PURE__ */ a(
1124
+ "button",
1125
+ {
1126
+ type: "button",
1127
+ "aria-expanded": s,
1128
+ "aria-label": `${s ? "Collapse" : "Expand"} row ${e + 1}`,
1129
+ ...o,
1130
+ className: G(no, o == null ? void 0 : o.className),
1131
+ onMouseDown: (c) => {
1132
+ var i;
1133
+ c.stopPropagation(), (i = o == null ? void 0 : o.onMouseDown) == null || i.call(o, c);
1134
+ },
1135
+ onPointerDown: (c) => {
1136
+ var i;
1137
+ c.stopPropagation(), (i = o == null ? void 0 : o.onPointerDown) == null || i.call(o, c);
1138
+ },
1139
+ onKeyDown: (c) => {
1140
+ var i;
1141
+ c.stopPropagation(), (i = o == null ? void 0 : o.onKeyDown) == null || i.call(o, c);
1142
+ },
1143
+ onClick: (c) => {
1144
+ var i;
1145
+ (i = o == null ? void 0 : o.onClick) == null || i.call(o, c), c.defaultPrevented || t.toggleExpanded();
1146
+ },
1147
+ children: /* @__PURE__ */ a(me, { icon: s ? "caret-down" : "caret-right", size: 14, ...r })
1148
+ }
1149
+ );
1150
+ }
1151
+ function At({
1119
1152
  loading: t,
1120
1153
  variableLength: e = !1,
1121
1154
  children: n
1122
1155
  }) {
1123
1156
  if (t) {
1124
- const o = e ? 75 - Math.floor(Math.random() * 11) * 5 : 100;
1125
- return /* @__PURE__ */ d("div", { className: nt.SKELETON, style: { width: `${o}%` } });
1157
+ const l = e ? 75 - Math.floor(Math.random() * 11) * 5 : 100;
1158
+ return /* @__PURE__ */ a("div", { className: ft.SKELETON, style: { width: `${l}%` } });
1126
1159
  }
1127
- return /* @__PURE__ */ d(vt, { children: n });
1160
+ return /* @__PURE__ */ a(Nt, { children: n });
1128
1161
  }
1129
- function Ro({
1162
+ function Ho({
1130
1163
  table: t,
1131
1164
  cell: e,
1132
- rowIndex: n,
1133
- rowTop: o,
1134
- columnRegion: s,
1135
- rowHeight: l,
1136
- loading: r,
1137
- isLastInRow: c,
1138
- isLastInColumn: i
1165
+ cellProps: n,
1166
+ rowIndex: l,
1167
+ rowTop: s,
1168
+ columnRegion: o,
1169
+ rowHeight: r,
1170
+ loading: c,
1171
+ isExpansionCell: i,
1172
+ rowExpanderButtonProps: u,
1173
+ rowExpanderIconProps: f,
1174
+ isLastInRow: d,
1175
+ isLastInColumn: E
1139
1176
  }) {
1140
- var m;
1141
- const u = e.column.getSize(), f = e.column.getStart(s), a = (m = e.column.columnDef.meta) == null ? void 0 : m.bodyCellClassName;
1142
- return /* @__PURE__ */ d(
1177
+ var U, y, z;
1178
+ const v = e.column.getSize(), N = e.column.getStart(o), g = i && ((y = (U = e.row).getCanExpand) == null ? void 0 : y.call(U)), L = (z = e.column.columnDef.meta) == null ? void 0 : z.bodyCellClassName, T = g && !c, C = i && e.row.depth > 0 ? { paddingInlineStart: e.row.depth * 16 } : void 0, m = /* @__PURE__ */ a(
1143
1179
  "div",
1144
1180
  {
1145
- className: P(
1146
- me,
1147
- Be,
1148
- Et(n),
1149
- Gt(e.column.getIndex()),
1150
- n % 2 === 0 ? we : Ee,
1181
+ className: G(Ue, Re),
1182
+ style: T ? void 0 : C,
1183
+ children: /* @__PURE__ */ a(At, { loading: c, variableLength: !0, children: /* @__PURE__ */ a(t.FlexRender, { cell: e }) })
1184
+ }
1185
+ );
1186
+ return /* @__PURE__ */ a(
1187
+ "div",
1188
+ {
1189
+ ...n,
1190
+ className: G(
1191
+ Te,
1192
+ He,
1193
+ vt(l),
1194
+ Kt(e.column.getIndex()),
1195
+ l % 2 === 0 ? Ce : ve,
1151
1196
  {
1152
- [pe]: c,
1153
- [zt]: i,
1154
- [nt.LOADING]: r,
1155
- [Ft]: e.row.getIsSelected()
1197
+ [Se]: d,
1198
+ [kt]: E,
1199
+ [ft.LOADING]: c,
1200
+ [Xt]: e.row.getIsSelected()
1156
1201
  },
1157
- a
1202
+ L,
1203
+ n == null ? void 0 : n.className
1158
1204
  ),
1159
1205
  style: {
1160
- height: l,
1161
- left: f,
1206
+ ...n == null ? void 0 : n.style,
1207
+ height: r,
1208
+ left: N,
1162
1209
  position: "absolute",
1163
- top: o,
1164
- width: u
1210
+ top: s,
1211
+ width: v
1165
1212
  },
1166
- onMouseDown: (g) => {
1167
- g.button === 0 && e.getSelectionStartHandler()(g);
1213
+ onMouseDown: (S) => {
1214
+ var R;
1215
+ (R = n == null ? void 0 : n.onMouseDown) == null || R.call(n, S), !S.defaultPrevented && S.button === 0 && e.getSelectionStartHandler()(S);
1168
1216
  },
1169
- onMouseEnter: e.getSelectionExtendHandler(),
1170
- children: /* @__PURE__ */ d("div", { className: P(De, ve), children: /* @__PURE__ */ d(gt, { loading: r, variableLength: !0, children: /* @__PURE__ */ d(t.FlexRender, { cell: e }) }) })
1217
+ onMouseEnter: (S) => {
1218
+ var R;
1219
+ (R = n == null ? void 0 : n.onMouseEnter) == null || R.call(n, S), S.defaultPrevented || e.getSelectionExtendHandler()(S);
1220
+ },
1221
+ children: T ? /* @__PURE__ */ W("div", { className: eo, style: C, children: [
1222
+ /* @__PURE__ */ a(
1223
+ $o,
1224
+ {
1225
+ row: e.row,
1226
+ rowIndex: l,
1227
+ rowExpanderButtonProps: u,
1228
+ rowExpanderIconProps: f
1229
+ }
1230
+ ),
1231
+ m
1232
+ ] }) : m
1171
1233
  }
1172
1234
  );
1173
1235
  }
1174
- function xt({
1236
+ function Ut({
1175
1237
  columnIndex: t,
1176
1238
  rowIndex: e,
1177
1239
  left: n,
1178
- top: o,
1240
+ top: l,
1179
1241
  width: s,
1180
- height: l,
1242
+ height: o,
1181
1243
  loading: r
1182
1244
  }) {
1183
- return /* @__PURE__ */ d(
1245
+ return /* @__PURE__ */ a(
1184
1246
  "div",
1185
1247
  {
1186
- className: P(
1187
- me,
1188
- An,
1189
- Be,
1190
- Et(e),
1191
- Gt(t),
1192
- e % 2 === 0 ? we : Ee,
1193
- { [nt.LOADING]: r }
1248
+ className: G(
1249
+ Te,
1250
+ Mn,
1251
+ He,
1252
+ vt(e),
1253
+ Kt(t),
1254
+ e % 2 === 0 ? Ce : ve,
1255
+ { [ft.LOADING]: r }
1194
1256
  ),
1195
- style: { height: l, left: n, position: "absolute", top: o, width: s },
1196
- children: /* @__PURE__ */ d("div", { className: P(De, ve), children: /* @__PURE__ */ d(gt, { loading: r, variableLength: !0 }) })
1257
+ style: { height: o, left: n, position: "absolute", top: l, width: s },
1258
+ children: /* @__PURE__ */ a("div", { className: G(Ue, Re), children: /* @__PURE__ */ a(At, { loading: r, variableLength: !0 }) })
1197
1259
  }
1198
1260
  );
1199
1261
  }
1200
- function Io({
1262
+ function Uo({
1201
1263
  table: t,
1202
1264
  ghosts: e,
1203
1265
  loading: n,
1204
- columnRegion: o,
1266
+ columnRegion: l,
1205
1267
  rowRegion: s,
1206
- rowIndices: l,
1268
+ rowIndices: o,
1207
1269
  regionTop: r,
1208
1270
  regionHeight: c,
1209
1271
  getRowTop: i,
1210
1272
  getRowHeight: u
1211
1273
  }) {
1212
- const f = t.getRowModel().rows, a = t.getVisibleLeafColumns().length, m = Lt(t, o), g = Nt(t, o), T = o === "center", E = s === "center";
1213
- return /* @__PURE__ */ F(vt, { children: [
1214
- T && l.map((v) => {
1215
- var L;
1216
- return /* @__PURE__ */ d(kt, { children: Array.from({ length: e.columnCount }).map((R, C) => /* @__PURE__ */ d(
1217
- xt,
1274
+ const f = t.getRowModel().rows, d = t.getVisibleLeafColumns().length, E = pt(t, l), v = St(t, l), N = l === "center", g = s === "center";
1275
+ return /* @__PURE__ */ W(Nt, { children: [
1276
+ N && o.map((L) => {
1277
+ var T;
1278
+ return /* @__PURE__ */ a(zt, { children: Array.from({ length: e.columnCount }).map((C, m) => /* @__PURE__ */ a(
1279
+ Ut,
1218
1280
  {
1219
- columnIndex: a + C,
1220
- rowIndex: v,
1221
- left: m + C * e.columnWidth,
1222
- top: i(v) - r,
1281
+ columnIndex: d + m,
1282
+ rowIndex: L,
1283
+ left: E + m * e.columnWidth,
1284
+ top: i(L) - r,
1223
1285
  width: e.columnWidth,
1224
- height: u(v),
1286
+ height: u(L),
1225
1287
  loading: n
1226
1288
  },
1227
- `ghost-column-cell-${v}-${C}`
1228
- )) }, `ghost-column-cells-${((L = f[v]) == null ? void 0 : L.id) ?? v}`);
1289
+ `ghost-column-cell-${L}-${m}`
1290
+ )) }, `ghost-column-cells-${((T = f[L]) == null ? void 0 : T.id) ?? L}`);
1229
1291
  }),
1230
- E && Array.from({ length: e.rowCount }).map((v, L) => {
1231
- const R = f.length + L, C = c + L * e.rowHeight;
1232
- return /* @__PURE__ */ F(kt, { children: [
1233
- g.map((y) => /* @__PURE__ */ d(
1234
- xt,
1292
+ g && Array.from({ length: e.rowCount }).map((L, T) => {
1293
+ const C = f.length + T, m = c + T * e.rowHeight;
1294
+ return /* @__PURE__ */ W(zt, { children: [
1295
+ v.map((U) => /* @__PURE__ */ a(
1296
+ Ut,
1235
1297
  {
1236
- columnIndex: y.getIndex(),
1237
- rowIndex: R,
1238
- left: y.getStart(o),
1239
- top: C,
1240
- width: y.getSize(),
1298
+ columnIndex: U.getIndex(),
1299
+ rowIndex: C,
1300
+ left: U.getStart(l),
1301
+ top: m,
1302
+ width: U.getSize(),
1241
1303
  height: e.rowHeight,
1242
1304
  loading: n
1243
1305
  },
1244
- `ghost-row-cell-${L}-${y.id}`
1306
+ `ghost-row-cell-${T}-${U.id}`
1245
1307
  )),
1246
- T && Array.from({ length: e.columnCount }).map((y, D) => /* @__PURE__ */ d(
1247
- xt,
1308
+ N && Array.from({ length: e.columnCount }).map((U, y) => /* @__PURE__ */ a(
1309
+ Ut,
1248
1310
  {
1249
- columnIndex: a + D,
1250
- rowIndex: R,
1251
- left: m + D * e.columnWidth,
1252
- top: C,
1311
+ columnIndex: d + y,
1312
+ rowIndex: C,
1313
+ left: E + y * e.columnWidth,
1314
+ top: m,
1253
1315
  width: e.columnWidth,
1254
1316
  height: e.rowHeight,
1255
1317
  loading: n
1256
1318
  },
1257
- `ghost-corner-cell-${L}-${D}`
1319
+ `ghost-corner-cell-${T}-${y}`
1258
1320
  ))
1259
- ] }, `ghost-row-cells-${L}`);
1321
+ ] }, `ghost-row-cells-${T}`);
1260
1322
  })
1261
1323
  ] });
1262
1324
  }
1263
- function ee(t, e, n) {
1264
- let o = null, s = 0;
1265
- for (const l of Nt(t, e)) {
1266
- const r = l.getIndex();
1267
- r < n[0] || r > n[1] || (o == null && (o = l.getStart(e)), s += l.getSize());
1325
+ function ce(t, e, n) {
1326
+ let l = null, s = 0;
1327
+ for (const o of St(t, e)) {
1328
+ const r = o.getIndex();
1329
+ r < n[0] || r > n[1] || (l == null && (l = o.getStart(e)), s += o.getSize());
1268
1330
  }
1269
- return o == null ? null : { offset: o, size: s };
1331
+ return l == null ? null : { offset: l, size: s };
1270
1332
  }
1271
- function ne(t, e, n, o, s) {
1272
- const l = rt(t), r = t.getRowModel().rows.length, c = Math.max(n[0], e === "top" ? 0 : l), i = Math.min(n[1], e === "top" ? l - 1 : r - 1);
1333
+ function ie(t, e, n, l, s) {
1334
+ const o = mt(t), r = t.getRowModel().rows.length, c = Math.max(n[0], e === "top" ? 0 : o), i = Math.min(n[1], e === "top" ? o - 1 : r - 1);
1273
1335
  if (c > i)
1274
1336
  return null;
1275
- const u = e === "center" ? Mo(t, e, o) : 0;
1337
+ const u = e === "center" ? zo(t, e, l) : 0;
1276
1338
  return {
1277
- offset: o(c) - u,
1278
- size: o(i) + s(i) - o(c)
1339
+ offset: l(c) - u,
1340
+ size: l(i) + s(i) - l(c)
1279
1341
  };
1280
1342
  }
1281
- function Mo(t, e, n) {
1282
- return e === "center" ? n(rt(t)) : 0;
1343
+ function zo(t, e, n) {
1344
+ return e === "center" ? n(mt(t)) : 0;
1283
1345
  }
1284
- function Oo(t, e, n, o, s, l) {
1285
- const r = A.getRegionCardinality(e), c = { offset: 0, size: Lt(t, n) }, i = rt(t), u = t.getRowModel().rows.length, f = {
1346
+ function Fo(t, e, n, l, s, o) {
1347
+ const r = A.getRegionCardinality(e), c = { offset: 0, size: pt(t, n) }, i = mt(t), u = t.getRowModel().rows.length, f = {
1286
1348
  offset: 0,
1287
- size: (o === "top" ? i : u - i) === 0 ? 0 : s(o === "top" ? i - 1 : u - 1) + l(o === "top" ? i - 1 : u - 1) - s(o === "top" ? 0 : i)
1349
+ size: (l === "top" ? i : u - i) === 0 ? 0 : s(l === "top" ? i - 1 : u - 1) + o(l === "top" ? i - 1 : u - 1) - s(l === "top" ? 0 : i)
1288
1350
  };
1289
- let a, m;
1351
+ let d, E;
1290
1352
  switch (r) {
1291
- case J.CELLS:
1292
- a = ee(t, n, e.cols), m = ne(t, o, e.rows, s, l);
1353
+ case ct.CELLS:
1354
+ d = ce(t, n, e.cols), E = ie(t, l, e.rows, s, o);
1293
1355
  break;
1294
- case J.FULL_COLUMNS:
1295
- a = ee(t, n, e.cols), m = f;
1356
+ case ct.FULL_COLUMNS:
1357
+ d = ce(t, n, e.cols), E = f;
1296
1358
  break;
1297
- case J.FULL_ROWS:
1298
- a = c, m = ne(t, o, e.rows, s, l);
1359
+ case ct.FULL_ROWS:
1360
+ d = c, E = ie(t, l, e.rows, s, o);
1299
1361
  break;
1300
1362
  default:
1301
- a = c, m = f;
1363
+ d = c, E = f;
1302
1364
  break;
1303
1365
  }
1304
- return a == null || m == null || a.size <= 0 || m.size <= 0 ? null : {
1305
- height: m.size,
1306
- left: a.offset,
1307
- top: m.offset,
1308
- width: a.size
1366
+ return d == null || E == null || d.size <= 0 || E.size <= 0 ? null : {
1367
+ height: E.size,
1368
+ left: d.offset,
1369
+ top: E.offset,
1370
+ width: d.size
1309
1371
  };
1310
1372
  }
1311
- function Bo({
1373
+ function Go({
1312
1374
  table: t,
1313
1375
  regionGroups: e,
1314
1376
  columnRegion: n,
1315
- rowRegion: o,
1377
+ rowRegion: l,
1316
1378
  getRowTop: s,
1317
- getRowHeight: l
1379
+ getRowHeight: o
1318
1380
  }) {
1319
- return /* @__PURE__ */ d("div", { className: bt, "aria-hidden": !0, children: e.map(
1381
+ return /* @__PURE__ */ a("div", { className: Yt, "aria-hidden": !0, children: e.map(
1320
1382
  (r, c) => r.regions.map((i, u) => {
1321
- const f = Oo(
1383
+ const f = Fo(
1322
1384
  t,
1323
1385
  i,
1324
1386
  n,
1325
- o,
1387
+ l,
1326
1388
  s,
1327
- l
1389
+ o
1328
1390
  );
1329
- return f == null ? null : /* @__PURE__ */ d(
1391
+ return f == null ? null : /* @__PURE__ */ a(
1330
1392
  "div",
1331
1393
  {
1332
- className: P(Ot, Wn, r.className),
1394
+ className: G(yt, Qn, r.className),
1333
1395
  style: f
1334
1396
  },
1335
1397
  `${c}-${u}`
@@ -1337,86 +1399,107 @@ function Bo({
1337
1399
  })
1338
1400
  ) });
1339
1401
  }
1340
- function Do({
1402
+ function Wo({
1341
1403
  table: t,
1342
- columnRegion: e,
1343
- rowRegion: n,
1344
- offsetTop: o = 0,
1345
- offsetLeft: s = 0,
1346
- areCellsLoading: l,
1347
- rowVirtualizer: r,
1348
- rowResizing: c,
1349
- ghosts: i,
1350
- className: u,
1351
- ...f
1404
+ renderRowDetail: e,
1405
+ getCellProps: n,
1406
+ rowExpanderButtonProps: l,
1407
+ rowExpanderIconProps: s,
1408
+ columnRegion: o,
1409
+ rowRegion: r,
1410
+ offsetTop: c = 0,
1411
+ offsetLeft: i = 0,
1412
+ areCellsLoading: u,
1413
+ rowVirtualizer: f,
1414
+ rowResizing: d,
1415
+ ghosts: E,
1416
+ className: v,
1417
+ ...N
1352
1418
  }) {
1353
- const a = _t(), m = a != null && a.isBodyContextMenuEnabled, g = t.getRowModel().rows, T = rt(t), E = n === "top", v = E ? T : g.length - T, L = E ? 0 : c.getRowTop(T), R = E ? c.getRowTop(T) : c.totalHeight - c.getRowTop(T), C = Lt(t, e), D = !E && r != null ? r.getVirtualItems() : void 0, z = D != null ? D.map((p) => T + p.index) : Array.from(
1354
- { length: v },
1355
- (p, U) => E ? U : T + U
1356
- ), M = E ? T - 1 : g.length - 1;
1357
- return /* @__PURE__ */ d(
1419
+ const g = Rt(), L = g != null && g.isBodyContextMenuEnabled, T = t.getRowModel().rows, C = mt(t), m = r === "top", U = m ? C : T.length - C, y = m ? 0 : d.getRowTop(C), z = m ? d.getRowTop(C) : d.totalHeight - d.getRowTop(C), S = pt(t, o), R = t.getStartVisibleLeafColumns().length > 0 ? "start" : "center", V = t.getCenterVisibleLeafColumns().length > 0 ? "center" : "start", _ = !m && f != null ? f.getVirtualItems() : void 0, x = _ != null ? _.map((I) => C + I.index) : Array.from(
1420
+ { length: U },
1421
+ (I, X) => m ? X : C + X
1422
+ ), H = m ? C - 1 : T.length - 1;
1423
+ return /* @__PURE__ */ a(
1358
1424
  "div",
1359
1425
  {
1360
- ...f,
1361
- className: P(Pn, u),
1362
- style: { paddingLeft: s, paddingTop: o },
1363
- children: /* @__PURE__ */ d("div", { children: /* @__PURE__ */ F(
1364
- en,
1426
+ ...N,
1427
+ className: G(Pn, v),
1428
+ style: { paddingLeft: i, paddingTop: c },
1429
+ children: /* @__PURE__ */ a("div", { children: /* @__PURE__ */ W(
1430
+ un,
1365
1431
  {
1366
- className: P(pn, vn),
1367
- style: { height: R, width: C },
1368
- onPointerDown: a == null ? void 0 : a.handleBodyPointerDown,
1369
- disabled: !m,
1370
- onContextMenu: m ? a == null ? void 0 : a.handleBodyContextMenu : void 0,
1371
- content: ({ mouseEvent: p }) => p == null || a == null ? void 0 : a.renderBodyContextMenu(p),
1432
+ className: G(Rn, In),
1433
+ style: { height: z, width: S },
1434
+ onPointerDown: g == null ? void 0 : g.handleBodyPointerDown,
1435
+ disabled: !L,
1436
+ onContextMenu: L ? g == null ? void 0 : g.handleBodyContextMenu : void 0,
1437
+ content: ({ mouseEvent: I }) => I == null || g == null ? void 0 : g.renderBodyContextMenu(I),
1372
1438
  children: [
1373
- /* @__PURE__ */ F("div", { className: Cn, children: [
1374
- z.map((p) => {
1375
- const U = g[p];
1376
- if (U == null)
1439
+ /* @__PURE__ */ W("div", { className: Sn, children: [
1440
+ x.map((I) => {
1441
+ const X = T[I];
1442
+ if (X == null)
1377
1443
  return null;
1378
- const H = e === "start" ? U.getStartVisibleCells() : U.getCenterVisibleCells(), N = c.getRowTop(p) - L, I = c.getRowHeight(p);
1379
- return H.map((O, S) => /* @__PURE__ */ d(
1380
- Ro,
1381
- {
1382
- table: t,
1383
- cell: O,
1384
- rowIndex: p,
1385
- rowTop: N,
1386
- columnRegion: e,
1387
- rowHeight: I,
1388
- loading: l,
1389
- isLastInRow: S === H.length - 1,
1390
- isLastInColumn: p === M
1391
- },
1392
- O.id
1393
- ));
1444
+ const M = o === "start" ? X.getStartVisibleCells() : X.getCenterVisibleCells(), O = d.getRowTop(I) - y, B = d.getRowHeight(I), D = d.getRowSpanHeight(I) - B;
1445
+ return /* @__PURE__ */ W(zt, { children: [
1446
+ M.map((b, J) => /* @__PURE__ */ a(
1447
+ Ho,
1448
+ {
1449
+ table: t,
1450
+ cell: b,
1451
+ cellProps: n == null ? void 0 : n(b),
1452
+ rowExpanderButtonProps: l,
1453
+ rowExpanderIconProps: s,
1454
+ isExpansionCell: o === R && J === 0,
1455
+ rowIndex: I,
1456
+ rowTop: O,
1457
+ columnRegion: o,
1458
+ rowHeight: B,
1459
+ loading: u,
1460
+ isLastInRow: J === M.length - 1,
1461
+ isLastInColumn: I === H
1462
+ },
1463
+ b.id
1464
+ )),
1465
+ D > 0 && o === V && /* @__PURE__ */ a(
1466
+ "div",
1467
+ {
1468
+ className: oo,
1469
+ style: { top: O + B, height: D, width: S },
1470
+ onPointerDown: (b) => b.stopPropagation(),
1471
+ onKeyDown: (b) => b.stopPropagation(),
1472
+ onContextMenu: (b) => b.stopPropagation(),
1473
+ children: e == null ? void 0 : e(X)
1474
+ }
1475
+ )
1476
+ ] }, X.id);
1394
1477
  }),
1395
- i != null && /* @__PURE__ */ d(
1396
- Io,
1478
+ E != null && /* @__PURE__ */ a(
1479
+ Uo,
1397
1480
  {
1398
1481
  table: t,
1399
- ghosts: i,
1400
- loading: l,
1401
- columnRegion: e,
1402
- rowRegion: n,
1403
- rowIndices: z,
1404
- regionTop: L,
1405
- regionHeight: R,
1406
- getRowTop: c.getRowTop,
1407
- getRowHeight: c.getRowHeight
1482
+ ghosts: E,
1483
+ loading: u,
1484
+ columnRegion: o,
1485
+ rowRegion: r,
1486
+ rowIndices: x,
1487
+ regionTop: y,
1488
+ regionHeight: z,
1489
+ getRowTop: d.getRowTop,
1490
+ getRowHeight: d.getRowHeight
1408
1491
  }
1409
1492
  )
1410
1493
  ] }),
1411
- a != null && a.regionGroups.length > 0 && /* @__PURE__ */ d(
1412
- Bo,
1494
+ g != null && g.regionGroups.length > 0 && /* @__PURE__ */ a(
1495
+ Go,
1413
1496
  {
1414
1497
  table: t,
1415
- regionGroups: a.regionGroups,
1416
- columnRegion: e,
1417
- rowRegion: n,
1418
- getRowTop: c.getRowTop,
1419
- getRowHeight: c.getRowHeight
1498
+ regionGroups: g.regionGroups,
1499
+ columnRegion: o,
1500
+ rowRegion: r,
1501
+ getRowTop: d.getRowTop,
1502
+ getRowHeight: d.getRowHeight
1420
1503
  }
1421
1504
  )
1422
1505
  ]
@@ -1425,290 +1508,294 @@ function Do({
1425
1508
  }
1426
1509
  );
1427
1510
  }
1428
- function yo({
1511
+ function Po({
1429
1512
  row: t,
1430
1513
  rowIndex: e,
1431
1514
  rowHeight: n,
1432
- loading: o,
1433
- isLastInColumn: s,
1434
- isResizing: l = !1,
1435
- onResizeStart: r,
1436
- className: c,
1437
- ...i
1515
+ detailHeight: l,
1516
+ loading: s,
1517
+ isLastInColumn: o,
1518
+ isResizing: r = !1,
1519
+ onResizeStart: c,
1520
+ className: i,
1521
+ ...u
1438
1522
  }) {
1439
- const u = _t();
1440
- return /* @__PURE__ */ F(
1523
+ const f = Rt();
1524
+ return /* @__PURE__ */ W(
1441
1525
  "div",
1442
1526
  {
1443
- ...i,
1444
- className: P(ft, Et(e), {
1445
- [zt]: s,
1446
- [nt.LOADING]: o,
1447
- [Ft]: (t == null ? void 0 : t.getIsSelected()) ?? !1
1448
- }, c),
1449
- style: { flexBasis: n, height: n, minHeight: 0 },
1450
- onMouseDown: (f) => u == null ? void 0 : u.handleRowHeaderMouseDown(e, f),
1527
+ ...u,
1528
+ className: G(Tt, vt(e), {
1529
+ [kt]: o,
1530
+ [ft.LOADING]: s,
1531
+ [Xt]: (t == null ? void 0 : t.getIsSelected()) ?? !1
1532
+ }, i),
1533
+ style: { marginBottom: l, flexBasis: n, height: n, minHeight: 0 },
1534
+ onMouseDown: (d) => f == null ? void 0 : f.handleRowHeaderMouseDown(e, d),
1451
1535
  children: [
1452
- /* @__PURE__ */ d("div", { className: Se, children: /* @__PURE__ */ d("div", { className: Re, children: /* @__PURE__ */ d(gt, { loading: o, children: /* @__PURE__ */ d("span", { children: e + 1 }) }) }) }),
1453
- !o && r != null && /* @__PURE__ */ d(
1536
+ /* @__PURE__ */ a("div", { className: ye, children: /* @__PURE__ */ a("div", { className: xe, children: /* @__PURE__ */ a(At, { loading: s, children: /* @__PURE__ */ a("span", { children: e + 1 }) }) }) }),
1537
+ !s && c != null && /* @__PURE__ */ a(
1454
1538
  "div",
1455
1539
  {
1456
- className: P(_e, Yn, {
1457
- [At]: l
1540
+ className: G(Oe, qn, {
1541
+ [_t]: r
1458
1542
  }),
1459
- onMouseDown: r,
1460
- onTouchStart: r,
1461
- children: /* @__PURE__ */ d("div", { className: P(Ne, { [At]: l }) })
1543
+ onMouseDown: c,
1544
+ onTouchStart: c,
1545
+ children: /* @__PURE__ */ a("div", { className: G(Me, { [_t]: r }) })
1462
1546
  }
1463
1547
  )
1464
1548
  ]
1465
1549
  }
1466
1550
  );
1467
1551
  }
1468
- function $o({
1552
+ function Vo({
1469
1553
  row: t,
1470
1554
  rowIndex: e,
1471
1555
  rowHeight: n,
1472
- loading: o,
1473
- isLastInColumn: s
1556
+ detailHeight: l,
1557
+ loading: s,
1558
+ isLastInColumn: o
1474
1559
  }) {
1475
- const l = (t == null ? void 0 : t.getIsSelected()) ?? !1;
1476
- return /* @__PURE__ */ d(
1560
+ const r = (t == null ? void 0 : t.getIsSelected()) ?? !1;
1561
+ return /* @__PURE__ */ a(
1477
1562
  "div",
1478
1563
  {
1479
- className: P(ft, Ie, Et(e), {
1480
- [zt]: s,
1481
- [nt.LOADING]: o,
1482
- [Ft]: l
1564
+ className: G(Tt, Be, vt(e), {
1565
+ [kt]: o,
1566
+ [ft.LOADING]: s,
1567
+ [Xt]: r
1483
1568
  }),
1484
- style: { height: n },
1485
- children: !o && t != null && /* @__PURE__ */ d("div", { className: Me, children: /* @__PURE__ */ d(
1486
- ae,
1569
+ style: { marginBottom: l, height: n },
1570
+ children: !s && t != null && /* @__PURE__ */ a("div", { className: De, children: /* @__PURE__ */ a(
1571
+ we,
1487
1572
  {
1488
1573
  "aria-label": `Select row ${e + 1}`,
1489
- checked: l,
1574
+ checked: r,
1490
1575
  disabled: !t.getCanSelect(),
1491
- onChange: (r) => t.getToggleSelectedHandler()(r)
1576
+ onChange: (c) => t.getToggleSelectedHandler()(c)
1492
1577
  }
1493
1578
  ) })
1494
1579
  }
1495
1580
  );
1496
1581
  }
1497
- function oe({
1582
+ function ae({
1498
1583
  table: t,
1499
1584
  rowRegion: e,
1500
1585
  rowHeaderWidth: n,
1501
- enableRowHeader: o = !0,
1586
+ enableRowHeader: l = !0,
1502
1587
  selectionColumnWidth: s = 0,
1503
- areRowHeadersLoading: l,
1588
+ areRowHeadersLoading: o,
1504
1589
  rowVirtualizer: r,
1505
1590
  rowResizing: c,
1506
1591
  ghosts: i,
1507
1592
  className: u,
1508
1593
  ...f
1509
1594
  }) {
1510
- if (!o && s === 0)
1595
+ if (!l && s === 0)
1511
1596
  return null;
1512
- const a = t.getRowModel().rows, m = o ? n : 0, g = rt(t), T = e === "top", E = T ? 0 : g, v = T ? g : a.length - g, L = T ? c.getRowTop(g) : c.totalHeight - c.getRowTop(g), C = !T && r != null ? r.getVirtualItems() : void 0, y = (r == null ? void 0 : r.options.scrollMargin) ?? 0, D = C != null && C.length > 0 ? C[0].start - y : 0, z = C != null && C.length > 0 ? L - (C[C.length - 1].end - y) : 0, M = C != null ? C.map((N) => g + N.index) : Array.from({ length: v }, (N, I) => E + I), p = T ? g - 1 : a.length - 1, U = {
1513
- height: L,
1597
+ const d = t.getRowModel().rows, E = l ? n : 0, v = mt(t), N = e === "top", g = N ? 0 : v, L = N ? v : d.length - v, T = N ? c.getRowTop(v) : c.totalHeight - c.getRowTop(v), m = !N && r != null ? r.getVirtualItems() : void 0, U = (r == null ? void 0 : r.options.scrollMargin) ?? 0, y = m != null && m.length > 0 ? m[0].start - U : 0, z = m != null && m.length > 0 ? T - (m[m.length - 1].end - U) : 0, S = m != null ? m.map((_) => v + _.index) : Array.from({ length: L }, (_, x) => g + x), R = N ? v - 1 : d.length - 1, V = {
1598
+ height: T,
1514
1599
  transform: "translateY(0px)",
1515
- paddingTop: D,
1600
+ paddingTop: y,
1516
1601
  paddingBottom: z
1517
- }, H = i != null && !T ? Array.from({ length: i.rowCount }, (N, I) => a.length + I) : [];
1518
- return /* @__PURE__ */ d(
1602
+ }, j = i != null && !N ? Array.from({ length: i.rowCount }, (_, x) => d.length + x) : [];
1603
+ return /* @__PURE__ */ a(
1519
1604
  "div",
1520
1605
  {
1521
1606
  ...f,
1522
- className: P(Qn, u),
1523
- style: { width: m + s },
1524
- children: /* @__PURE__ */ F("div", { style: { display: "flex", height: L }, children: [
1525
- o && /* @__PURE__ */ d("div", { style: { flex: "0 0 auto", width: n }, children: /* @__PURE__ */ F("div", { className: Kt, style: U, children: [
1526
- M.map((N) => {
1527
- var I;
1528
- return /* @__PURE__ */ d(
1529
- yo,
1607
+ className: G(to, u),
1608
+ style: { width: E + s },
1609
+ children: /* @__PURE__ */ W("div", { style: { display: "flex", height: T }, children: [
1610
+ l && /* @__PURE__ */ a("div", { style: { flex: "0 0 auto", width: n }, children: /* @__PURE__ */ W("div", { className: ee, style: V, children: [
1611
+ S.map((_) => {
1612
+ var x;
1613
+ return /* @__PURE__ */ a(
1614
+ Po,
1530
1615
  {
1531
- row: a[N],
1532
- rowIndex: N,
1533
- rowHeight: c.getRowHeight(N),
1534
- loading: l,
1535
- isLastInColumn: N === p,
1536
- isResizing: c.resizingRowIndex === N,
1537
- onResizeStart: c.enabled ? (O) => c.startRowResize(N, O) : void 0
1616
+ row: d[_],
1617
+ rowIndex: _,
1618
+ rowHeight: c.getRowHeight(_),
1619
+ detailHeight: c.getRowSpanHeight(_) - c.getRowHeight(_),
1620
+ loading: o,
1621
+ isLastInColumn: _ === R,
1622
+ isResizing: c.resizingRowIndex === _,
1623
+ onResizeStart: c.enabled ? (H) => c.startRowResize(_, H) : void 0
1538
1624
  },
1539
- ((I = a[N]) == null ? void 0 : I.id) ?? N
1625
+ ((x = d[_]) == null ? void 0 : x.id) ?? _
1540
1626
  );
1541
1627
  }),
1542
- H.map((N, I) => /* @__PURE__ */ d(
1628
+ j.map((_, x) => /* @__PURE__ */ a(
1543
1629
  "div",
1544
1630
  {
1545
- className: P(ft, Et(N), {
1546
- [nt.LOADING]: l
1631
+ className: G(Tt, vt(_), {
1632
+ [ft.LOADING]: o
1547
1633
  }),
1548
1634
  style: { flexBasis: i == null ? void 0 : i.rowHeight, height: i == null ? void 0 : i.rowHeight, minHeight: 0 },
1549
- children: /* @__PURE__ */ d("div", { className: Se, children: /* @__PURE__ */ d("div", { className: Re, children: /* @__PURE__ */ d(gt, { loading: l }) }) })
1635
+ children: /* @__PURE__ */ a("div", { className: ye, children: /* @__PURE__ */ a("div", { className: xe, children: /* @__PURE__ */ a(At, { loading: o }) }) })
1550
1636
  },
1551
- `ghost-row-header-${I}`
1637
+ `ghost-row-header-${x}`
1552
1638
  ))
1553
1639
  ] }) }),
1554
- s > 0 && /* @__PURE__ */ d("div", { style: { flex: "0 0 auto", width: s }, children: /* @__PURE__ */ F("div", { className: Kt, style: U, children: [
1555
- M.map((N) => {
1556
- var I;
1557
- return /* @__PURE__ */ d(
1558
- $o,
1640
+ s > 0 && /* @__PURE__ */ a("div", { style: { flex: "0 0 auto", width: s }, children: /* @__PURE__ */ W("div", { className: ee, style: V, children: [
1641
+ S.map((_) => {
1642
+ var x;
1643
+ return /* @__PURE__ */ a(
1644
+ Vo,
1559
1645
  {
1560
- row: a[N],
1561
- rowIndex: N,
1562
- rowHeight: c.getRowHeight(N),
1563
- loading: l,
1564
- isLastInColumn: N === p
1646
+ row: d[_],
1647
+ rowIndex: _,
1648
+ rowHeight: c.getRowHeight(_),
1649
+ detailHeight: c.getRowSpanHeight(_) - c.getRowHeight(_),
1650
+ loading: o,
1651
+ isLastInColumn: _ === R
1565
1652
  },
1566
- ((I = a[N]) == null ? void 0 : I.id) ?? N
1653
+ ((x = d[_]) == null ? void 0 : x.id) ?? _
1567
1654
  );
1568
1655
  }),
1569
- H.map((N, I) => /* @__PURE__ */ d(
1656
+ j.map((_, x) => /* @__PURE__ */ a(
1570
1657
  "div",
1571
1658
  {
1572
- className: P(ft, Ie, Et(N), {
1573
- [nt.LOADING]: l
1659
+ className: G(Tt, Be, vt(_), {
1660
+ [ft.LOADING]: o
1574
1661
  }),
1575
1662
  style: { height: i == null ? void 0 : i.rowHeight }
1576
1663
  },
1577
- `ghost-row-selection-${I}`
1664
+ `ghost-row-selection-${x}`
1578
1665
  ))
1579
1666
  ] }) })
1580
1667
  ] })
1581
1668
  }
1582
1669
  );
1583
1670
  }
1584
- function xo({
1671
+ function bo({
1585
1672
  header: t,
1586
1673
  isOpen: e,
1587
1674
  onOpenChange: n
1588
1675
  }) {
1589
- const o = t.column.getIsSorted(), s = (r) => {
1676
+ const l = t.column.getIsSorted(), s = (r) => {
1590
1677
  t.column.toggleSorting(r), n(!1);
1591
- }, l = () => {
1678
+ }, o = () => {
1592
1679
  t.column.clearSorting(), n(!1);
1593
1680
  };
1594
- return /* @__PURE__ */ F("div", { className: P(qn, { [to]: e }), children: [
1595
- /* @__PURE__ */ d("div", { className: Jn }),
1596
- /* @__PURE__ */ d(
1597
- nn,
1681
+ return /* @__PURE__ */ W("div", { className: G(co, { [ao]: e }), children: [
1682
+ /* @__PURE__ */ a("div", { className: io }),
1683
+ /* @__PURE__ */ a(
1684
+ dn,
1598
1685
  {
1599
- className: jn,
1600
- content: /* @__PURE__ */ F(ln, { children: [
1601
- /* @__PURE__ */ d(Dt, { icon: "sort-asc", text: "Sort Asc", onClick: () => s(!1) }),
1602
- /* @__PURE__ */ d(Dt, { icon: "sort-desc", text: "Sort Desc", onClick: () => s(!0) }),
1603
- o && /* @__PURE__ */ d(Dt, { icon: "sort", text: "Clear Sort", onClick: l })
1686
+ className: ro,
1687
+ content: /* @__PURE__ */ W(fn, { children: [
1688
+ /* @__PURE__ */ a(Dt, { icon: "sort-asc", text: "Sort Asc", onClick: () => s(!1) }),
1689
+ /* @__PURE__ */ a(Dt, { icon: "sort-desc", text: "Sort Desc", onClick: () => s(!0) }),
1690
+ l && /* @__PURE__ */ a(Dt, { icon: "sort", text: "Clear Sort", onClick: o })
1604
1691
  ] }),
1605
1692
  isOpen: e,
1606
1693
  onInteraction: n,
1607
1694
  placement: "bottom",
1608
1695
  rootBoundary: "viewport",
1609
- children: /* @__PURE__ */ d(on, { icon: "chevron-down" })
1696
+ children: /* @__PURE__ */ a(me, { icon: "chevron-down" })
1610
1697
  }
1611
1698
  )
1612
1699
  ] });
1613
1700
  }
1614
- function Po({
1701
+ function ko({
1615
1702
  table: t,
1616
1703
  header: e,
1617
1704
  isLastInRow: n,
1618
- enableSorting: o = !1,
1705
+ enableSorting: l = !1,
1619
1706
  loading: s
1620
1707
  }) {
1621
- var R;
1622
- const l = e.getSize(), r = e.column.getIsResizing(), c = e.getResizeHandler(), i = typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : void 0, u = vo(), f = _t(), a = (u == null ? void 0 : u.enableColumnReordering) ?? !1, m = (u == null ? void 0 : u.reorderingColumnId) === e.column.id, g = o && e.column.getCanSort(), T = (R = e.column.columnDef.meta) == null ? void 0 : R.headCellClassName, [E, v] = tt(!1), L = e.column.getIndex();
1623
- return /* @__PURE__ */ F(
1708
+ var C;
1709
+ const o = e.getSize(), r = e.column.getIsResizing(), c = e.getResizeHandler(), i = typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : void 0, u = Oo(), f = Rt(), d = (u == null ? void 0 : u.enableColumnReordering) ?? !1, E = (u == null ? void 0 : u.reorderingColumnId) === e.column.id, v = l && e.column.getCanSort(), N = (C = e.column.columnDef.meta) == null ? void 0 : C.headCellClassName, [g, L] = lt(!1), T = e.column.getIndex();
1710
+ return /* @__PURE__ */ W(
1624
1711
  "div",
1625
1712
  {
1626
- className: P(
1627
- ft,
1628
- Gt(L),
1629
- Ht,
1630
- { [pe]: n },
1631
- { [Rn]: a },
1632
- { [In]: E },
1633
- { [nt.LOADING]: s },
1634
- T
1713
+ className: G(
1714
+ Tt,
1715
+ Kt(T),
1716
+ bt,
1717
+ { [Se]: n },
1718
+ { [Bn]: d },
1719
+ { [Dn]: g },
1720
+ { [ft.LOADING]: s },
1721
+ N
1635
1722
  ),
1636
- style: { flexBasis: l, minWidth: 0, width: l },
1637
- onMouseDown: (C) => f == null ? void 0 : f.handleColumnHeaderMouseDown(L, C),
1723
+ style: { flexBasis: o, minWidth: 0, width: o },
1724
+ onMouseDown: (m) => f == null ? void 0 : f.handleColumnHeaderMouseDown(T, m),
1638
1725
  children: [
1639
- /* @__PURE__ */ F("div", { className: Le, title: i, children: [
1640
- a && /* @__PURE__ */ d(
1726
+ /* @__PURE__ */ W("div", { className: pe, title: i, children: [
1727
+ d && /* @__PURE__ */ a(
1641
1728
  "div",
1642
1729
  {
1643
- className: P(Vn, { [At]: m }),
1644
- onPointerDown: (C) => u == null ? void 0 : u.startReorder(e.column, C),
1645
- children: /* @__PURE__ */ d("div", { className: kn, children: /* @__PURE__ */ d(cn, { title: "Press down to drag" }) })
1730
+ className: G(jn, { [_t]: E }),
1731
+ onPointerDown: (m) => u == null ? void 0 : u.startReorder(e.column, m),
1732
+ children: /* @__PURE__ */ a("div", { className: Zn, children: /* @__PURE__ */ a(wn, { title: "Press down to drag" }) })
1646
1733
  }
1647
1734
  ),
1648
- g && !s && /* @__PURE__ */ d(
1649
- xo,
1735
+ v && !s && /* @__PURE__ */ a(
1736
+ bo,
1650
1737
  {
1651
1738
  table: t,
1652
1739
  header: e,
1653
- isOpen: E,
1654
- onOpenChange: v
1740
+ isOpen: g,
1741
+ onOpenChange: L
1655
1742
  }
1656
1743
  ),
1657
- /* @__PURE__ */ d("div", { className: ge, children: /* @__PURE__ */ d(gt, { loading: s, variableLength: !0, children: /* @__PURE__ */ d(t.FlexRender, { header: e }) }) })
1744
+ /* @__PURE__ */ a("div", { className: Ae, children: /* @__PURE__ */ a(At, { loading: s, variableLength: !0, children: /* @__PURE__ */ a(t.FlexRender, { header: e }) }) })
1658
1745
  ] }),
1659
- /* @__PURE__ */ d("div", { className: Ce }),
1660
- !s && /* @__PURE__ */ d(
1746
+ /* @__PURE__ */ a("div", { className: _e }),
1747
+ !s && /* @__PURE__ */ a(
1661
1748
  "div",
1662
1749
  {
1663
- className: P(_e, Xn, {
1664
- [At]: r
1750
+ className: G(Oe, Jn, {
1751
+ [_t]: r
1665
1752
  }),
1666
1753
  onMouseDown: c,
1667
1754
  onTouchStart: c,
1668
- children: /* @__PURE__ */ d("div", { className: P(Ne, { [At]: r }) })
1755
+ children: /* @__PURE__ */ a("div", { className: G(Me, { [_t]: r }) })
1669
1756
  }
1670
1757
  )
1671
1758
  ]
1672
1759
  }
1673
1760
  );
1674
1761
  }
1675
- function Uo({
1762
+ function Yo({
1676
1763
  table: t,
1677
1764
  headerGroup: e,
1678
1765
  columnRegion: n,
1679
- enableSorting: o = !1,
1766
+ enableSorting: l = !1,
1680
1767
  areColumnHeadersLoading: s,
1681
- ghosts: l
1768
+ ghosts: o
1682
1769
  }) {
1683
1770
  var i;
1684
- const r = (i = e.headers[e.headers.length - 1]) == null ? void 0 : i.id, c = Ue(Lt(t, n), l);
1685
- return /* @__PURE__ */ F(
1771
+ const r = (i = e.headers[e.headers.length - 1]) == null ? void 0 : i.id, c = Pe(pt(t, n), o);
1772
+ return /* @__PURE__ */ W(
1686
1773
  "div",
1687
1774
  {
1688
- className: P(eo, Nn),
1775
+ className: G(uo, On),
1689
1776
  style: { transform: "translateX(0px)", width: c },
1690
1777
  children: [
1691
- e.headers.map((u) => /* @__PURE__ */ d(
1692
- Po,
1778
+ e.headers.map((u) => /* @__PURE__ */ a(
1779
+ ko,
1693
1780
  {
1694
1781
  table: t,
1695
1782
  header: u,
1696
1783
  isLastInRow: u.id === r,
1697
- enableSorting: o,
1784
+ enableSorting: l,
1698
1785
  loading: s
1699
1786
  },
1700
1787
  u.id
1701
1788
  )),
1702
- l != null && Array.from({ length: l.columnCount }).map((u, f) => /* @__PURE__ */ F(
1789
+ o != null && Array.from({ length: o.columnCount }).map((u, f) => /* @__PURE__ */ W(
1703
1790
  "div",
1704
1791
  {
1705
- className: P(ft, Ht, {
1706
- [nt.LOADING]: s
1792
+ className: G(Tt, bt, {
1793
+ [ft.LOADING]: s
1707
1794
  }),
1708
- style: { flexBasis: l.columnWidth, minWidth: 0, width: l.columnWidth },
1795
+ style: { flexBasis: o.columnWidth, minWidth: 0, width: o.columnWidth },
1709
1796
  children: [
1710
- /* @__PURE__ */ d("div", { className: Le, children: /* @__PURE__ */ d("div", { className: ge, children: /* @__PURE__ */ d(gt, { loading: s, variableLength: !0 }) }) }),
1711
- /* @__PURE__ */ d("div", { className: Ce })
1797
+ /* @__PURE__ */ a("div", { className: pe, children: /* @__PURE__ */ a("div", { className: Ae, children: /* @__PURE__ */ a(At, { loading: s, variableLength: !0 }) }) }),
1798
+ /* @__PURE__ */ a("div", { className: _e })
1712
1799
  ]
1713
1800
  },
1714
1801
  `ghost-column-header-${f}`
@@ -1717,188 +1804,196 @@ function Uo({
1717
1804
  }
1718
1805
  );
1719
1806
  }
1720
- function Ho({
1807
+ function Xo({
1721
1808
  table: t,
1722
1809
  columnRegion: e,
1723
1810
  enableSorting: n = !1,
1724
- areColumnHeadersLoading: o,
1811
+ areColumnHeadersLoading: l,
1725
1812
  ghosts: s,
1726
- className: l,
1813
+ className: o,
1727
1814
  ...r
1728
1815
  }) {
1729
- const c = e === "start" ? t.getStartHeaderGroups() : t.getCenterHeaderGroups(), i = e === "center" ? s : void 0, u = Ue(Lt(t, e), i);
1730
- return /* @__PURE__ */ d("div", { ...r, className: P(_n, l), children: /* @__PURE__ */ d("div", { style: { width: u }, children: c.map((f) => /* @__PURE__ */ d(
1731
- Uo,
1816
+ const c = e === "start" ? t.getStartHeaderGroups() : t.getCenterHeaderGroups(), i = e === "center" ? s : void 0, u = Pe(pt(t, e), i);
1817
+ return /* @__PURE__ */ a("div", { ...r, className: G(yn, o), children: /* @__PURE__ */ a("div", { style: { width: u }, children: c.map((f) => /* @__PURE__ */ a(
1818
+ Yo,
1732
1819
  {
1733
1820
  table: t,
1734
1821
  headerGroup: f,
1735
1822
  columnRegion: e,
1736
1823
  enableSorting: n,
1737
- areColumnHeadersLoading: o,
1824
+ areColumnHeadersLoading: l,
1738
1825
  ghosts: i
1739
1826
  },
1740
1827
  f.id
1741
1828
  )) }) });
1742
1829
  }
1743
- function zo({
1830
+ function Ko({
1744
1831
  width: t,
1745
1832
  height: e,
1746
1833
  className: n,
1747
- ...o
1834
+ ...l
1748
1835
  }) {
1749
- const s = _t();
1750
- return /* @__PURE__ */ d(
1836
+ const s = Rt();
1837
+ return /* @__PURE__ */ a(
1751
1838
  "div",
1752
1839
  {
1753
- ...o,
1754
- className: P(On, n),
1840
+ ...l,
1841
+ className: G(Hn, n),
1755
1842
  style: { width: t, height: e },
1756
1843
  onMouseDown: s == null ? void 0 : s.handleMenuMouseDown
1757
1844
  }
1758
1845
  );
1759
1846
  }
1760
- function bo({
1847
+ function Qo({
1761
1848
  table: t,
1762
1849
  width: e,
1763
1850
  height: n,
1764
- loading: o = !1
1851
+ loading: l = !1
1765
1852
  }) {
1766
- const s = t.getIsAllRowsSelected(), l = t.getIsSomeRowsSelected();
1767
- return /* @__PURE__ */ d(
1853
+ const s = t.getIsAllRowsSelected(), o = t.getIsSomeRowsSelected();
1854
+ return /* @__PURE__ */ a(
1768
1855
  "div",
1769
1856
  {
1770
- className: P(
1771
- ft,
1772
- Ht,
1773
- Kn
1857
+ className: G(
1858
+ Tt,
1859
+ bt,
1860
+ lo
1774
1861
  ),
1775
1862
  style: { flex: "0 0 auto", height: n, width: e },
1776
- children: !o && /* @__PURE__ */ d("div", { className: Me, children: /* @__PURE__ */ d(
1777
- ae,
1863
+ children: !l && /* @__PURE__ */ a("div", { className: De, children: /* @__PURE__ */ a(
1864
+ we,
1778
1865
  {
1779
1866
  "aria-label": "Select all rows",
1780
1867
  checked: s,
1781
- indeterminate: !s && l,
1868
+ indeterminate: !s && o,
1782
1869
  onChange: (r) => t.getToggleAllRowsSelectedHandler()(r)
1783
1870
  }
1784
1871
  ) })
1785
1872
  }
1786
1873
  );
1787
1874
  }
1788
- var V = /* @__PURE__ */ ((t) => (t.MAIN = "main", t.TOP = "top", t.LEFT = "left", t.TOP_LEFT = "top-left", t))(V || {});
1789
- function Fo(t) {
1875
+ var Q = /* @__PURE__ */ ((t) => (t.MAIN = "main", t.TOP = "top", t.LEFT = "left", t.TOP_LEFT = "top-left", t))(Q || {});
1876
+ function Zo(t) {
1790
1877
  switch (t) {
1791
- case V.MAIN:
1792
- return Hn;
1793
- case V.TOP:
1794
- return Fn;
1795
- case V.LEFT:
1796
- return Un;
1797
- case V.TOP_LEFT:
1798
- return Gn;
1878
+ case Q.MAIN:
1879
+ return bn;
1880
+ case Q.TOP:
1881
+ return Xn;
1882
+ case Q.LEFT:
1883
+ return Vn;
1884
+ case Q.TOP_LEFT:
1885
+ return Kn;
1799
1886
  default:
1800
1887
  return;
1801
1888
  }
1802
1889
  }
1803
- function It({
1890
+ function Mt({
1804
1891
  quadrantType: t,
1805
1892
  table: e,
1806
- rowHeaderWidth: n,
1807
- enableRowHeader: o = !0,
1808
- columnHeaderHeight: s,
1809
- columnHeaderMeasureRef: l,
1810
- enableSorting: r = !1,
1811
- areCellsLoading: c,
1812
- areColumnHeadersLoading: i,
1813
- areRowHeadersLoading: u,
1814
- rowResizing: f,
1815
- rowVirtualizer: a,
1816
- ghosts: m,
1817
- scrollContainerRef: g,
1818
- onScroll: T,
1819
- onWheel: E,
1820
- style: v,
1821
- selectionColumnWidth: L = 0
1893
+ renderRowDetail: n,
1894
+ getCellProps: l,
1895
+ rowExpanderButtonProps: s,
1896
+ rowExpanderIconProps: o,
1897
+ rowHeaderWidth: r,
1898
+ enableRowHeader: c = !0,
1899
+ columnHeaderHeight: i,
1900
+ columnHeaderMeasureRef: u,
1901
+ enableSorting: f = !1,
1902
+ areCellsLoading: d,
1903
+ areColumnHeadersLoading: E,
1904
+ areRowHeadersLoading: v,
1905
+ rowResizing: N,
1906
+ rowVirtualizer: g,
1907
+ ghosts: L,
1908
+ scrollContainerRef: T,
1909
+ onScroll: C,
1910
+ onWheel: m,
1911
+ style: U,
1912
+ selectionColumnWidth: y = 0
1822
1913
  }) {
1823
- const R = t === V.MAIN, C = t === V.TOP || t === V.TOP_LEFT, D = t === V.LEFT || t === V.TOP_LEFT ? "start" : "center", z = C ? "top" : "center", M = t === V.TOP || t === V.TOP_LEFT, p = t === V.TOP_LEFT, U = _t(), H = ht(e), N = Bt(e, f.getRowHeight), I = o ? n : 0, O = (G, Y) => /* @__PURE__ */ d(
1824
- Do,
1914
+ const z = t === Q.MAIN, S = t === Q.TOP || t === Q.TOP_LEFT, V = t === Q.LEFT || t === Q.TOP_LEFT ? "start" : "center", j = S ? "top" : "center", _ = t === Q.TOP || t === Q.TOP_LEFT, x = t === Q.TOP_LEFT, H = Rt(), I = Ct(e), X = xt(e, N.getRowTop), M = c ? r : 0, O = (b, J) => /* @__PURE__ */ a(
1915
+ Wo,
1825
1916
  {
1826
1917
  table: e,
1827
- columnRegion: D,
1828
- rowRegion: z,
1829
- offsetTop: G,
1830
- offsetLeft: Y,
1831
- areCellsLoading: c,
1832
- rowVirtualizer: a,
1833
- rowResizing: f,
1834
- ghosts: m
1918
+ renderRowDetail: n,
1919
+ getCellProps: l,
1920
+ rowExpanderButtonProps: s,
1921
+ rowExpanderIconProps: o,
1922
+ columnRegion: V,
1923
+ rowRegion: j,
1924
+ offsetTop: b,
1925
+ offsetLeft: J,
1926
+ areCellsLoading: d,
1927
+ rowVirtualizer: g,
1928
+ rowResizing: N,
1929
+ ghosts: L
1835
1930
  }
1836
- ), S = M ? /* @__PURE__ */ F(
1931
+ ), B = _ ? /* @__PURE__ */ W(
1837
1932
  "div",
1838
1933
  {
1839
- ref: t === V.TOP ? l : void 0,
1840
- className: no,
1841
- style: D === "center" ? { paddingLeft: H } : void 0,
1934
+ ref: t === Q.TOP ? u : void 0,
1935
+ className: fo,
1936
+ style: V === "center" ? { paddingLeft: I } : void 0,
1842
1937
  children: [
1843
- p && /* @__PURE__ */ F(vt, { children: [
1844
- o && /* @__PURE__ */ d(zo, { width: n, height: s }),
1845
- L > 0 && /* @__PURE__ */ d(
1846
- bo,
1938
+ x && /* @__PURE__ */ W(Nt, { children: [
1939
+ c && /* @__PURE__ */ a(Ko, { width: r, height: i }),
1940
+ y > 0 && /* @__PURE__ */ a(
1941
+ Qo,
1847
1942
  {
1848
1943
  table: e,
1849
- width: L,
1850
- height: s,
1851
- loading: u
1944
+ width: y,
1945
+ height: i,
1946
+ loading: v
1852
1947
  }
1853
1948
  )
1854
1949
  ] }),
1855
- /* @__PURE__ */ d(
1856
- Ho,
1950
+ /* @__PURE__ */ a(
1951
+ Xo,
1857
1952
  {
1858
1953
  table: e,
1859
- columnRegion: D,
1860
- enableSorting: r,
1861
- areColumnHeadersLoading: i,
1862
- ghosts: m
1954
+ columnRegion: V,
1955
+ enableSorting: f,
1956
+ areColumnHeadersLoading: E,
1957
+ ghosts: L
1863
1958
  }
1864
1959
  )
1865
1960
  ]
1866
1961
  }
1867
1962
  ) : void 0;
1868
- let _;
1963
+ let D;
1869
1964
  switch (t) {
1870
- case V.MAIN:
1871
- _ = O(
1872
- s + N,
1873
- I + L + H
1965
+ case Q.MAIN:
1966
+ D = O(
1967
+ i + X,
1968
+ M + y + I
1874
1969
  );
1875
1970
  break;
1876
- case V.TOP:
1877
- _ = /* @__PURE__ */ F(vt, { children: [
1878
- S,
1879
- O(0, H)
1971
+ case Q.TOP:
1972
+ D = /* @__PURE__ */ W(Nt, { children: [
1973
+ B,
1974
+ O(0, I)
1880
1975
  ] });
1881
1976
  break;
1882
- case V.LEFT:
1883
- _ = // The frozen rows' band at the top is covered by the TOP_LEFT quadrant.
1884
- /* @__PURE__ */ d("div", { style: { paddingTop: N }, children: /* @__PURE__ */ F(
1977
+ case Q.LEFT:
1978
+ D = // The frozen rows' band at the top is covered by the TOP_LEFT quadrant.
1979
+ /* @__PURE__ */ a("div", { style: { paddingTop: X }, children: /* @__PURE__ */ W(
1885
1980
  "div",
1886
1981
  {
1887
- className: Xt,
1888
- style: { width: I + L + H },
1982
+ className: Jt,
1983
+ style: { width: M + y + I },
1889
1984
  children: [
1890
- /* @__PURE__ */ d(
1891
- oe,
1985
+ /* @__PURE__ */ a(
1986
+ ae,
1892
1987
  {
1893
1988
  table: e,
1894
1989
  rowRegion: "center",
1895
- rowHeaderWidth: n,
1896
- enableRowHeader: o,
1897
- selectionColumnWidth: L,
1898
- areRowHeadersLoading: u,
1899
- rowVirtualizer: a,
1900
- rowResizing: f,
1901
- ghosts: m
1990
+ rowHeaderWidth: r,
1991
+ enableRowHeader: c,
1992
+ selectionColumnWidth: y,
1993
+ areRowHeadersLoading: v,
1994
+ rowVirtualizer: g,
1995
+ rowResizing: N,
1996
+ ghosts: L
1902
1997
  }
1903
1998
  ),
1904
1999
  O(0, 0)
@@ -1906,27 +2001,27 @@ function It({
1906
2001
  }
1907
2002
  ) });
1908
2003
  break;
1909
- case V.TOP_LEFT:
1910
- _ = /* @__PURE__ */ F(vt, { children: [
1911
- S,
1912
- /* @__PURE__ */ F(
2004
+ case Q.TOP_LEFT:
2005
+ D = /* @__PURE__ */ W(Nt, { children: [
2006
+ B,
2007
+ /* @__PURE__ */ W(
1913
2008
  "div",
1914
2009
  {
1915
- className: Xt,
1916
- style: { width: I + L + H },
2010
+ className: Jt,
2011
+ style: { width: M + y + I },
1917
2012
  children: [
1918
- /* @__PURE__ */ d(
1919
- oe,
2013
+ /* @__PURE__ */ a(
2014
+ ae,
1920
2015
  {
1921
2016
  table: e,
1922
2017
  rowRegion: "top",
1923
- rowHeaderWidth: n,
1924
- enableRowHeader: o,
1925
- selectionColumnWidth: L,
1926
- areRowHeadersLoading: u,
1927
- rowVirtualizer: a,
1928
- rowResizing: f,
1929
- ghosts: m
2018
+ rowHeaderWidth: r,
2019
+ enableRowHeader: c,
2020
+ selectionColumnWidth: y,
2021
+ areRowHeadersLoading: v,
2022
+ rowVirtualizer: g,
2023
+ rowResizing: N,
2024
+ ghosts: L
1930
2025
  }
1931
2026
  ),
1932
2027
  O(0, 0)
@@ -1936,477 +2031,530 @@ function It({
1936
2031
  ] });
1937
2032
  break;
1938
2033
  default:
1939
- _ = void 0;
2034
+ D = void 0;
1940
2035
  }
1941
- return /* @__PURE__ */ d("div", { className: P(xn, Fo(t)), style: v, children: /* @__PURE__ */ d(
2036
+ return /* @__PURE__ */ a("div", { className: G(Wn, Zo(t)), style: U, children: /* @__PURE__ */ a(
1942
2037
  "div",
1943
2038
  {
1944
- ref: g,
1945
- className: zn,
1946
- tabIndex: R && U != null ? 0 : void 0,
1947
- onKeyDown: R ? U == null ? void 0 : U.handleKeyDown : void 0,
1948
- onScroll: T,
1949
- onWheel: E,
1950
- children: _
2039
+ ref: T,
2040
+ className: kn,
2041
+ tabIndex: z && H != null ? 0 : void 0,
2042
+ onKeyDown: z ? H == null ? void 0 : H.handleKeyDown : void 0,
2043
+ onScroll: C,
2044
+ onWheel: m,
2045
+ children: D
1951
2046
  }
1952
2047
  ) });
1953
2048
  }
1954
- function Go({
2049
+ function jo({
1955
2050
  table: t,
1956
- rowHeaderWidth: e,
1957
- enableRowHeader: n = !0,
1958
- columnHeaderHeight: o,
1959
- columnHeaderMeasureRef: s,
1960
- enableColumnReordering: l = !1,
1961
- enableSorting: r = !1,
1962
- areCellsLoading: c,
1963
- areColumnHeadersLoading: i,
1964
- areRowHeadersLoading: u,
1965
- selection: f,
1966
- rowResizing: a,
1967
- ghosts: m,
1968
- enableRowVirtualization: g,
1969
- overscanRowCount: T,
1970
- scrollContainerRef: E,
1971
- selectionColumnWidth: v = 0
2051
+ renderRowDetail: e,
2052
+ getCellProps: n,
2053
+ rowExpanderButtonProps: l,
2054
+ rowExpanderIconProps: s,
2055
+ rowHeaderWidth: o,
2056
+ enableRowHeader: r = !0,
2057
+ columnHeaderHeight: c,
2058
+ columnHeaderMeasureRef: i,
2059
+ enableColumnReordering: u = !1,
2060
+ enableSorting: f = !1,
2061
+ areCellsLoading: d,
2062
+ areColumnHeadersLoading: E,
2063
+ areRowHeadersLoading: v,
2064
+ selection: N,
2065
+ rowResizing: g,
2066
+ ghosts: L,
2067
+ enableRowVirtualization: T,
2068
+ overscanRowCount: C,
2069
+ scrollContainerRef: m,
2070
+ selectionColumnWidth: U = 0
1972
2071
  }) {
1973
- const L = X(null), R = X(null), C = X(null), y = X(null), D = ht(t), z = rt(t), M = Bt(t, a.getRowHeight), p = (n ? e : 0) + v, U = dn({
2072
+ const y = Z(null), z = Z(null), S = Z(null), R = Z(null), V = Ct(t), j = mt(t), _ = xt(t, g.getRowTop), x = (r ? o : 0) + U, H = Ln({
1974
2073
  table: t,
1975
- columnHeaderHeight: o,
1976
- frozenRowCount: z,
1977
- frozenRowsHeight: M,
1978
- getRowHeight: a.getRowHeight,
1979
- scrollContainerRef: E,
1980
- enableRowVirtualization: g ?? !1,
1981
- overscanRowCount: T ?? de
1982
- }), { contextValue: H, guideIndex: N, reorderingColumnId: I } = No(
2074
+ columnHeaderHeight: c,
2075
+ frozenRowCount: j,
2076
+ frozenRowsHeight: _,
2077
+ getRowHeight: g.getRowSpanHeight,
2078
+ scrollContainerRef: m,
2079
+ enableRowVirtualization: T ?? !1,
2080
+ overscanRowCount: C ?? Ee
2081
+ }), { contextValue: I, guideIndex: X, reorderingColumnId: M } = xo(
1983
2082
  t,
1984
- l,
1985
- L,
1986
- E,
1987
- p
1988
- ), [O, S] = tt({ left: 0, top: 0 }), _ = t.state.columnResizing, G = (_ == null ? void 0 : _.isResizingColumn) != null && _.isResizingColumn !== !1, Y = a.resizingGuideTop != null, Q = I != null, K = X(!1);
1989
- K.current = G || Y || Q;
1990
- const [Z, et] = tt({ vertical: 0, horizontal: 0 }), ct = b(() => {
1991
- const W = E.current;
1992
- W != null && (R.current != null && (R.current.scrollLeft = W.scrollLeft), C.current != null && (C.current.scrollTop = W.scrollTop), y.current != null && (y.current.scrollLeft = 0, y.current.scrollTop = 0));
1993
- }, [E]), w = b(() => {
1994
- if (ct(), K.current) {
1995
- const W = E.current;
1996
- W != null && S({ left: W.scrollLeft, top: W.scrollTop });
2083
+ u,
2084
+ y,
2085
+ m,
2086
+ x
2087
+ ), [O, B] = lt({ left: 0, top: 0 }), D = t.state.columnResizing, b = (D == null ? void 0 : D.isResizingColumn) != null && D.isResizingColumn !== !1, J = g.resizingGuideTop != null, st = M != null, w = Z(!1);
2088
+ w.current = b || J || st;
2089
+ const [p, F] = lt({ vertical: 0, horizontal: 0 }), $ = P(() => {
2090
+ const k = m.current;
2091
+ k != null && (z.current != null && (z.current.scrollLeft = k.scrollLeft), S.current != null && (S.current.scrollTop = k.scrollTop), R.current != null && (R.current.scrollLeft = 0, R.current.scrollTop = 0));
2092
+ }, [m]), K = P(() => {
2093
+ if ($(), w.current) {
2094
+ const k = m.current;
2095
+ k != null && B({ left: k.scrollLeft, top: k.scrollTop });
1997
2096
  }
1998
- }, [E, ct]), B = b(() => {
1999
- const W = E.current;
2000
- if (W == null)
2097
+ }, [m, $]), q = P(() => {
2098
+ const k = m.current;
2099
+ if (k == null)
2001
2100
  return;
2002
- const k = Math.max(0, W.offsetWidth - W.clientWidth), lt = Math.max(0, W.offsetHeight - W.clientHeight);
2003
- et(
2004
- (it) => it.vertical === k && it.horizontal === lt ? it : { vertical: k, horizontal: lt }
2101
+ const Y = Math.max(0, k.offsetWidth - k.clientWidth), ot = Math.max(0, k.offsetHeight - k.clientHeight);
2102
+ F(
2103
+ (et) => et.vertical === Y && et.horizontal === ot ? et : { vertical: Y, horizontal: ot }
2005
2104
  );
2006
- }, [E]), $ = t.getTotalSize();
2007
- st(() => {
2008
- const W = E.current;
2009
- if (W == null)
2105
+ }, [m]), it = t.getTotalSize();
2106
+ dt(() => {
2107
+ const k = m.current;
2108
+ if (k == null)
2010
2109
  return;
2011
- B();
2012
- const k = new ResizeObserver(B);
2013
- return k.observe(W), () => k.disconnect();
2014
- }, [B, E]), st(() => {
2015
- B();
2110
+ q();
2111
+ const Y = new ResizeObserver(q);
2112
+ return Y.observe(k), () => Y.disconnect();
2113
+ }, [q, m]), dt(() => {
2114
+ q();
2016
2115
  }, [
2017
- o,
2018
- D,
2019
- M,
2020
- B,
2021
- a.totalHeight,
2022
- $
2023
- ]), st(() => {
2024
- ct();
2025
- }, [o, D, M, ct]), st(() => {
2026
- if (!K.current)
2116
+ c,
2117
+ V,
2118
+ _,
2119
+ q,
2120
+ g.totalHeight,
2121
+ it
2122
+ ]), dt(() => {
2123
+ $();
2124
+ }, [c, V, _, $]), dt(() => {
2125
+ if (!w.current)
2027
2126
  return;
2028
- const W = E.current;
2029
- if (W == null)
2127
+ const k = m.current;
2128
+ if (k == null)
2030
2129
  return;
2031
- const k = W.scrollLeft, lt = W.scrollTop;
2032
- (k !== O.left || lt !== O.top) && S({ left: k, top: lt });
2130
+ const Y = k.scrollLeft, ot = k.scrollTop;
2131
+ (Y !== O.left || ot !== O.top) && B({ left: Y, top: ot });
2033
2132
  }, [
2034
- G,
2035
- Q,
2036
- Y,
2037
- E,
2133
+ b,
2134
+ st,
2135
+ J,
2136
+ m,
2038
2137
  O.left,
2039
2138
  O.top
2040
2139
  ]);
2041
- const x = b(
2042
- (W) => {
2043
- const k = E.current;
2044
- if (k == null)
2140
+ const nt = P(
2141
+ (k) => {
2142
+ const Y = m.current;
2143
+ if (Y == null)
2045
2144
  return;
2046
- const lt = Math.max(0, k.scrollWidth - k.clientWidth), it = Math.max(0, k.scrollHeight - k.clientHeight), St = le(k.scrollLeft + W.deltaX, 0, lt), Tt = le(k.scrollTop + W.deltaY, 0, it);
2047
- St !== k.scrollLeft && (k.scrollLeft = St), Tt !== k.scrollTop && (k.scrollTop = Tt);
2145
+ const ot = Math.max(0, Y.scrollWidth - Y.clientWidth), et = Math.max(0, Y.scrollHeight - Y.clientHeight), rt = ue(Y.scrollLeft + k.deltaX, 0, ot), ut = ue(Y.scrollTop + k.deltaY, 0, et);
2146
+ rt !== Y.scrollLeft && (Y.scrollLeft = rt), ut !== Y.scrollTop && (Y.scrollTop = ut);
2048
2147
  },
2049
- [E]
2050
- ), j = o + M, q = p + D, ot = {
2148
+ [m]
2149
+ ), tt = c + _, at = x + V, ht = {
2051
2150
  table: t,
2052
- rowHeaderWidth: e,
2053
- enableRowHeader: n,
2054
- selectionColumnWidth: v,
2055
- columnHeaderHeight: o,
2056
- enableSorting: r,
2057
- areCellsLoading: c,
2058
- areColumnHeadersLoading: i,
2059
- areRowHeadersLoading: u,
2060
- rowResizing: a,
2061
- rowVirtualizer: U,
2062
- ghosts: m
2151
+ renderRowDetail: e,
2152
+ getCellProps: n,
2153
+ rowExpanderButtonProps: l,
2154
+ rowExpanderIconProps: s,
2155
+ rowHeaderWidth: o,
2156
+ enableRowHeader: r,
2157
+ selectionColumnWidth: U,
2158
+ columnHeaderHeight: c,
2159
+ enableSorting: f,
2160
+ areCellsLoading: d,
2161
+ areColumnHeadersLoading: E,
2162
+ areRowHeadersLoading: v,
2163
+ rowResizing: g,
2164
+ rowVirtualizer: H,
2165
+ ghosts: L
2063
2166
  };
2064
- return /* @__PURE__ */ d("div", { ref: L, className: bn, children: /* @__PURE__ */ d(ze.Provider, { value: H, children: /* @__PURE__ */ F(He.Provider, { value: f, children: [
2065
- /* @__PURE__ */ d(
2066
- It,
2167
+ return /* @__PURE__ */ a("div", { ref: y, className: Yn, children: /* @__PURE__ */ a(be.Provider, { value: I, children: /* @__PURE__ */ W(Ve.Provider, { value: N, children: [
2168
+ /* @__PURE__ */ a(
2169
+ Mt,
2067
2170
  {
2068
- ...ot,
2069
- quadrantType: V.MAIN,
2070
- scrollContainerRef: E,
2071
- onScroll: w
2171
+ ...ht,
2172
+ quadrantType: Q.MAIN,
2173
+ scrollContainerRef: m,
2174
+ onScroll: K
2072
2175
  }
2073
2176
  ),
2074
- /* @__PURE__ */ d(
2075
- It,
2177
+ /* @__PURE__ */ a(
2178
+ Mt,
2076
2179
  {
2077
- ...ot,
2078
- quadrantType: V.TOP,
2079
- columnHeaderMeasureRef: s,
2080
- scrollContainerRef: R,
2081
- onWheel: x,
2180
+ ...ht,
2181
+ quadrantType: Q.TOP,
2182
+ columnHeaderMeasureRef: i,
2183
+ scrollContainerRef: z,
2184
+ onWheel: nt,
2082
2185
  style: {
2083
- height: j,
2084
- left: p,
2085
- right: Z.vertical
2186
+ height: tt,
2187
+ left: x,
2188
+ right: p.vertical
2086
2189
  }
2087
2190
  }
2088
2191
  ),
2089
- /* @__PURE__ */ d(
2090
- It,
2192
+ /* @__PURE__ */ a(
2193
+ Mt,
2091
2194
  {
2092
- ...ot,
2093
- quadrantType: V.LEFT,
2094
- scrollContainerRef: C,
2095
- onWheel: x,
2195
+ ...ht,
2196
+ quadrantType: Q.LEFT,
2197
+ scrollContainerRef: S,
2198
+ onWheel: nt,
2096
2199
  style: {
2097
- bottom: Z.horizontal,
2098
- top: o,
2099
- width: q
2200
+ bottom: p.horizontal,
2201
+ top: c,
2202
+ width: at
2100
2203
  }
2101
2204
  }
2102
2205
  ),
2103
- /* @__PURE__ */ d(
2104
- It,
2206
+ /* @__PURE__ */ a(
2207
+ Mt,
2105
2208
  {
2106
- ...ot,
2107
- quadrantType: V.TOP_LEFT,
2108
- scrollContainerRef: y,
2109
- onWheel: x,
2110
- style: { height: j, width: q }
2209
+ ...ht,
2210
+ quadrantType: Q.TOP_LEFT,
2211
+ scrollContainerRef: R,
2212
+ onWheel: nt,
2213
+ style: { height: tt, width: at }
2111
2214
  }
2112
2215
  ),
2113
- /* @__PURE__ */ d(
2114
- So,
2216
+ /* @__PURE__ */ a(
2217
+ Do,
2115
2218
  {
2116
2219
  table: t,
2117
- rowHeaderWidth: p,
2118
- columnHeaderHeight: o,
2220
+ rowHeaderWidth: x,
2221
+ columnHeaderHeight: c,
2119
2222
  scrollLeft: O.left,
2120
2223
  scrollTop: O.top,
2121
- frozenRowCount: z,
2122
- resizingGuideTop: a.resizingGuideTop,
2123
- resizingRowIndex: a.resizingRowIndex
2224
+ frozenRowCount: j,
2225
+ resizingGuideTop: g.resizingGuideTop,
2226
+ resizingRowIndex: g.resizingRowIndex
2124
2227
  }
2125
2228
  ),
2126
- /* @__PURE__ */ d(
2127
- _o,
2229
+ /* @__PURE__ */ a(
2230
+ Bo,
2128
2231
  {
2129
2232
  table: t,
2130
- reorderingColumnId: I,
2131
- guideIndex: N,
2132
- rowHeaderWidth: p,
2233
+ reorderingColumnId: M,
2234
+ guideIndex: X,
2235
+ rowHeaderWidth: x,
2133
2236
  scrollLeft: O.left
2134
2237
  }
2135
2238
  )
2136
2239
  ] }) }) });
2137
2240
  }
2138
- function le(t, e, n) {
2241
+ function ue(t, e, n) {
2139
2242
  return Math.max(e, Math.min(n, t));
2140
2243
  }
2141
- function Wo({
2244
+ function qo({
2142
2245
  table: t,
2143
- rowHeight: e,
2144
- rowHeaderWidth: n,
2145
- enableRowHeader: o = !0,
2146
- columnHeaderHeight: s,
2147
- enableColumnReordering: l = !1,
2148
- enableSorting: r = !1,
2149
- areCellsLoading: c,
2150
- areColumnHeadersLoading: i,
2151
- areRowHeadersLoading: u,
2152
- enableFocusedCell: f = !1,
2153
- enableGhostCells: a = !1,
2154
- bodyContextMenuRenderer: m,
2155
- enableBodyContextMenu: g,
2156
- onFocusedCell: T,
2157
- onFocusedRegion: E,
2158
- selectedRegions: v,
2159
- onSelection: L,
2160
- selectionModes: R,
2161
- enableRowVirtualization: C,
2162
- overscanRowCount: y,
2163
- enableRowResizing: D = !1,
2164
- rowHeights: z,
2165
- defaultRowHeights: M,
2166
- onRowHeightChanged: p,
2167
- minRowHeight: U,
2168
- maxRowHeight: H,
2169
- selectionColumnWidth: N = 0,
2170
- className: I,
2171
- ...O
2246
+ renderRowDetail: e,
2247
+ getCellProps: n,
2248
+ rowExpanderButtonProps: l,
2249
+ rowExpanderIconProps: s,
2250
+ rowDetailHeight: o,
2251
+ rowHeight: r,
2252
+ rowHeaderWidth: c,
2253
+ enableRowHeader: i = !0,
2254
+ columnHeaderHeight: u,
2255
+ enableColumnReordering: f = !1,
2256
+ enableSorting: d = !1,
2257
+ areCellsLoading: E,
2258
+ areColumnHeadersLoading: v,
2259
+ areRowHeadersLoading: N,
2260
+ enableFocusedCell: g = !1,
2261
+ enableGhostCells: L = !1,
2262
+ bodyContextMenuRenderer: T,
2263
+ enableBodyContextMenu: C,
2264
+ onFocusedCell: m,
2265
+ onFocusedRegion: U,
2266
+ selectedRegions: y,
2267
+ onSelection: z,
2268
+ selectionModes: S,
2269
+ enableRowVirtualization: R,
2270
+ overscanRowCount: V,
2271
+ enableRowResizing: j = !1,
2272
+ rowHeights: _,
2273
+ defaultRowHeights: x,
2274
+ onRowHeightChanged: H,
2275
+ minRowHeight: I,
2276
+ maxRowHeight: X,
2277
+ selectionColumnWidth: M = 0,
2278
+ className: O,
2279
+ ...B
2172
2280
  }) {
2173
- const S = X(null), _ = (o ? n : 0) + N, { ref: G, height: Y } = Lo({
2174
- minHeight: s,
2281
+ const D = Z(null), b = (i ? c : 0) + M, { ref: J, height: st } = _o({
2282
+ minHeight: u,
2175
2283
  headerRowCount: t.getHeaderGroups().length
2176
- }), Q = po({
2177
- rowHeight: e,
2284
+ }), w = gt(() => {
2285
+ var it;
2286
+ if (!e || !t.options.getIsRowExpanded && !((it = t.getIsSomeRowsExpanded) != null && it.call(t)))
2287
+ return;
2288
+ const q = t.getRowModel().rows;
2289
+ return (nt) => {
2290
+ var at;
2291
+ const tt = q[nt];
2292
+ return (at = tt.getIsExpanded) != null && at.call(tt) && tt.getCanExpand() ? Math.max(0, o) : 0;
2293
+ };
2294
+ }, [e, o, t]), p = Mo({
2295
+ rowHeight: r,
2178
2296
  rowCount: t.getRowModel().rows.length,
2179
- rowHeights: z,
2180
- defaultRowHeights: M,
2181
- enableRowResizing: D,
2182
- minRowHeight: U,
2183
- maxRowHeight: H,
2184
- onRowHeightChanged: p
2185
- }), K = Eo({
2297
+ getDetailHeight: w,
2298
+ rowHeights: _,
2299
+ defaultRowHeights: x,
2300
+ enableRowResizing: j,
2301
+ minRowHeight: I,
2302
+ maxRowHeight: X,
2303
+ onRowHeightChanged: H
2304
+ }), F = No({
2186
2305
  table: t,
2187
- getRowTop: Q.getRowTop,
2188
- getRowHeight: Q.getRowHeight,
2189
- scrollContainerRef: S,
2190
- rowHeaderWidth: _,
2191
- columnHeaderHeight: Y,
2192
- bodyContextMenuRenderer: m,
2193
- enableBodyContextMenu: g,
2194
- enableFocusedCell: f,
2195
- onFocusedCell: T,
2196
- onFocusedRegion: E,
2197
- selectedRegions: v,
2198
- onSelection: L,
2199
- selectionModes: R
2200
- }), Z = go({
2201
- enableGhostCells: a,
2202
- rowHeight: e,
2203
- rowHeaderWidth: _,
2204
- columnHeaderHeight: Y,
2306
+ getRowTop: p.getRowTop,
2307
+ getRowHeight: p.getRowHeight,
2308
+ scrollContainerRef: D,
2309
+ rowHeaderWidth: b,
2310
+ columnHeaderHeight: st,
2311
+ bodyContextMenuRenderer: T,
2312
+ enableBodyContextMenu: C,
2313
+ enableFocusedCell: g,
2314
+ onFocusedCell: m,
2315
+ onFocusedRegion: U,
2316
+ selectedRegions: y,
2317
+ onSelection: z,
2318
+ selectionModes: S
2319
+ }), $ = So({
2320
+ enableGhostCells: L,
2321
+ rowHeight: r,
2322
+ rowHeaderWidth: b,
2323
+ columnHeaderHeight: st,
2205
2324
  totalWidth: t.getTotalSize(),
2206
- totalHeight: Q.totalHeight,
2207
- scrollContainerRef: S
2208
- }), et = K.isSelectionModeEnabled(J.CELLS) ? Zn : void 0;
2209
- return /* @__PURE__ */ d(
2325
+ totalHeight: p.totalHeight,
2326
+ scrollContainerRef: D
2327
+ }), K = F.isSelectionModeEnabled(ct.CELLS) ? so : void 0;
2328
+ return /* @__PURE__ */ a(
2210
2329
  "div",
2211
2330
  {
2212
- ...O,
2213
- className: P(Sn, et, {
2214
- [Bn]: Z != null && Z.columnCount > 0,
2215
- [Dn]: Z != null && Z.rowCount > 0
2216
- }, I),
2217
- children: /* @__PURE__ */ d(
2218
- Go,
2331
+ ...B,
2332
+ className: G(xn, K, {
2333
+ [Un]: $ != null && $.columnCount > 0,
2334
+ [zn]: $ != null && $.rowCount > 0
2335
+ }, O),
2336
+ children: /* @__PURE__ */ a(
2337
+ jo,
2219
2338
  {
2220
2339
  table: t,
2221
- rowHeaderWidth: n,
2222
- enableRowHeader: o,
2223
- columnHeaderHeight: Y,
2224
- columnHeaderMeasureRef: G,
2225
- enableColumnReordering: l,
2226
- enableSorting: r,
2227
- areCellsLoading: c,
2228
- areColumnHeadersLoading: i,
2229
- areRowHeadersLoading: u,
2230
- selection: K,
2231
- rowResizing: Q,
2232
- ghosts: Z,
2233
- enableRowVirtualization: C,
2234
- overscanRowCount: y,
2235
- scrollContainerRef: S,
2236
- selectionColumnWidth: N
2340
+ renderRowDetail: e,
2341
+ getCellProps: n,
2342
+ rowExpanderButtonProps: l,
2343
+ rowExpanderIconProps: s,
2344
+ rowHeaderWidth: c,
2345
+ enableRowHeader: i,
2346
+ columnHeaderHeight: st,
2347
+ columnHeaderMeasureRef: J,
2348
+ enableColumnReordering: f,
2349
+ enableSorting: d,
2350
+ areCellsLoading: E,
2351
+ areColumnHeadersLoading: v,
2352
+ areRowHeadersLoading: N,
2353
+ selection: F,
2354
+ rowResizing: p,
2355
+ ghosts: $,
2356
+ enableRowVirtualization: R,
2357
+ overscanRowCount: V,
2358
+ scrollContainerRef: D,
2359
+ selectionColumnWidth: M
2237
2360
  }
2238
2361
  )
2239
2362
  }
2240
2363
  );
2241
2364
  }
2242
- function ol({
2365
+ const Jo = () => !0;
2366
+ function hl({
2243
2367
  htmlProps: t,
2244
- rowHeight: e = hn,
2245
- showRowSelectionCheckboxes: n = !1,
2246
- rowSelectionColumnWidth: o = wn,
2247
- rowHeaderWidth: s = mn,
2248
- enableRowHeader: l = !0,
2249
- columnHeaderHeight: r = fe,
2250
- enableColumnReordering: c = !1,
2251
- enableSorting: i = !1,
2252
- loadingOptions: u = [],
2253
- enableFocusedCell: f = !1,
2254
- enableGhostCells: a = !1,
2255
- bodyContextMenuRenderer: m,
2256
- enableBodyContextMenu: g,
2257
- onFocusedCell: T,
2258
- onFocusedRegion: E,
2259
- selectedRegions: v,
2260
- onSelection: L,
2261
- selectionModes: R,
2262
- enableRowVirtualization: C = !1,
2263
- numFrozenColumns: y = 0,
2264
- numFrozenRows: D = 0,
2265
- overscanRowCount: z = de,
2266
- columnVisibility: M,
2267
- enableRowResizing: p = !1,
2268
- rowHeights: U,
2269
- defaultRowHeights: H,
2270
- onRowHeightChanged: N,
2271
- minRowHeight: I,
2272
- maxRowHeight: O,
2273
- rowSelection: S,
2274
- defaultRowSelection: _,
2275
- ...G
2368
+ rowHeight: e = Tn,
2369
+ expandedRows: n,
2370
+ initialExpandedRows: l,
2371
+ onExpandedRowsChange: s,
2372
+ renderRowDetail: o,
2373
+ getCellProps: r,
2374
+ rowExpanderButtonProps: c,
2375
+ rowExpanderIconProps: i,
2376
+ rowDetailHeight: u = 100,
2377
+ showRowSelectionCheckboxes: f = !1,
2378
+ rowSelectionColumnWidth: d = vn,
2379
+ rowHeaderWidth: E = Cn,
2380
+ enableRowHeader: v = !0,
2381
+ columnHeaderHeight: N = ge,
2382
+ enableColumnReordering: g = !1,
2383
+ enableSorting: L = !1,
2384
+ loadingOptions: T = [],
2385
+ enableFocusedCell: C = !1,
2386
+ enableGhostCells: m = !1,
2387
+ bodyContextMenuRenderer: U,
2388
+ enableBodyContextMenu: y,
2389
+ onFocusedCell: z,
2390
+ onFocusedRegion: S,
2391
+ selectedRegions: R,
2392
+ onSelection: V,
2393
+ selectionModes: j,
2394
+ enableRowVirtualization: _ = !1,
2395
+ numFrozenColumns: x = 0,
2396
+ numFrozenRows: H = 0,
2397
+ overscanRowCount: I = Ee,
2398
+ columnVisibility: X,
2399
+ enableRowResizing: M = !1,
2400
+ rowHeights: O,
2401
+ defaultRowHeights: B,
2402
+ onRowHeightChanged: D,
2403
+ minRowHeight: b,
2404
+ maxRowHeight: J,
2405
+ rowSelection: st,
2406
+ defaultRowSelection: w,
2407
+ ...p
2276
2408
  }) {
2277
- var B, $;
2278
- const [Y, Q] = fn({
2279
- value: S ?? ((B = G.state) == null ? void 0 : B.rowSelection),
2280
- initialValue: _ ?? (($ = G.initialState) == null ? void 0 : $.rowSelection),
2409
+ var et, rt, ut, wt, Qt;
2410
+ const [F, $] = jt({
2411
+ value: st ?? ((et = p.state) == null ? void 0 : et.rowSelection),
2412
+ initialValue: w ?? ((rt = p.initialState) == null ? void 0 : rt.rowSelection),
2413
+ finalValue: {},
2414
+ onChange: p.onRowSelectionChange
2415
+ }), K = (ut = p.atoms) == null ? void 0 : ut.expanded, [q, it] = jt({
2416
+ value: (K == null ? void 0 : K.get()) ?? n ?? ((wt = p.state) == null ? void 0 : wt.expanded),
2417
+ initialValue: l ?? ((Qt = p.initialState) == null ? void 0 : Qt.expanded),
2281
2418
  finalValue: {},
2282
- onChange: G.onRowSelectionChange
2283
- }), K = b(
2284
- (x) => {
2285
- Q(ce(x, Y));
2419
+ onChange: s
2420
+ }), nt = En({
2421
+ ...p,
2422
+ initialState: l === void 0 ? p.initialState : {
2423
+ ...p.initialState,
2424
+ expanded: l
2286
2425
  },
2287
- [Y, Q]
2288
- ), Z = un({
2289
- ...G,
2290
- enableSorting: i,
2426
+ getRowCanExpand: p.getRowCanExpand ?? (o != null && p.enableExpanding !== !1 ? Jo : void 0),
2427
+ enableSorting: L,
2291
2428
  state: {
2292
- ...G.state,
2293
- ...M !== void 0 ? { columnVisibility: M } : {},
2294
- rowSelection: Y
2429
+ ...p.state,
2430
+ ...X !== void 0 ? { columnVisibility: X } : {},
2431
+ rowSelection: F,
2432
+ expanded: q
2295
2433
  },
2296
- onRowSelectionChange: K
2297
- });
2298
- an({ table: Z, numFrozenColumns: y, numFrozenRows: D });
2299
- const et = yt(u, Mt.CELLS), ct = yt(
2300
- u,
2301
- Mt.COLUMN_HEADERS
2302
- ), w = yt(u, Mt.ROW_HEADERS);
2303
- return /* @__PURE__ */ d(
2304
- Wo,
2434
+ onRowSelectionChange: $,
2435
+ onExpandedChange: (Bt) => {
2436
+ it(Bt), p.onExpandedChange ? p.onExpandedChange(Bt) : K == null || K.set((ke) => de(Bt, ke));
2437
+ }
2438
+ }), tt = Wt(Ft), at = tt ? nt.getPrePaginatedRowModel().rows.length : void 0;
2439
+ dt(() => {
2440
+ at !== void 0 && (tt == null || tt(at));
2441
+ }, [at, tt]), gn({ table: nt, numFrozenColumns: x, numFrozenRows: H });
2442
+ const ht = $t(T, Ot.CELLS), k = $t(
2443
+ T,
2444
+ Ot.COLUMN_HEADERS
2445
+ ), Y = $t(T, Ot.ROW_HEADERS), ot = /* @__PURE__ */ a(
2446
+ qo,
2305
2447
  {
2306
- table: Z,
2448
+ table: nt,
2307
2449
  rowHeight: e,
2308
- rowHeaderWidth: s,
2309
- enableRowHeader: l,
2310
- columnHeaderHeight: r,
2311
- enableColumnReordering: c,
2312
- enableSorting: i,
2313
- areCellsLoading: et,
2314
- areColumnHeadersLoading: ct,
2315
- areRowHeadersLoading: w,
2316
- enableFocusedCell: f,
2317
- enableGhostCells: a,
2318
- bodyContextMenuRenderer: m,
2319
- enableBodyContextMenu: g,
2320
- onFocusedCell: T,
2321
- onFocusedRegion: E,
2322
- selectedRegions: v,
2323
- onSelection: L,
2324
- selectionModes: R,
2325
- enableRowVirtualization: C,
2326
- overscanRowCount: z,
2327
- enableRowResizing: p,
2328
- rowHeights: U,
2329
- defaultRowHeights: H,
2330
- onRowHeightChanged: N,
2331
- minRowHeight: I,
2332
- maxRowHeight: O,
2333
- selectionColumnWidth: n ? o : 0,
2450
+ renderRowDetail: o,
2451
+ getCellProps: r,
2452
+ rowExpanderButtonProps: c,
2453
+ rowExpanderIconProps: i,
2454
+ rowDetailHeight: u,
2455
+ rowHeaderWidth: E,
2456
+ enableRowHeader: v,
2457
+ columnHeaderHeight: N,
2458
+ enableColumnReordering: g,
2459
+ enableSorting: L,
2460
+ areCellsLoading: ht,
2461
+ areColumnHeadersLoading: k,
2462
+ areRowHeadersLoading: Y,
2463
+ enableFocusedCell: C,
2464
+ enableGhostCells: m,
2465
+ bodyContextMenuRenderer: U,
2466
+ enableBodyContextMenu: y,
2467
+ onFocusedCell: z,
2468
+ onFocusedRegion: S,
2469
+ selectedRegions: R,
2470
+ onSelection: V,
2471
+ selectionModes: j,
2472
+ enableRowVirtualization: _,
2473
+ overscanRowCount: I,
2474
+ enableRowResizing: M,
2475
+ rowHeights: O,
2476
+ defaultRowHeights: B,
2477
+ onRowHeightChanged: D,
2478
+ minRowHeight: b,
2479
+ maxRowHeight: J,
2480
+ selectionColumnWidth: f ? d : 0,
2334
2481
  ...t
2335
2482
  }
2336
2483
  );
2484
+ return tt ? /* @__PURE__ */ a(Ft.Provider, { value: void 0, children: ot }) : ot;
2337
2485
  }
2338
- const ko = 10, Vo = [10, 20, 50, 100];
2339
- function Yo({
2486
+ const tl = 10, el = [10, 20, 50, 100];
2487
+ function nl({
2340
2488
  pageIndex: t,
2341
2489
  pageSize: e,
2342
2490
  pageCount: n,
2343
- rowCount: o,
2344
- pageSizeOptions: s = Vo,
2345
- onPageIndexChange: l,
2491
+ rowCount: l,
2492
+ pageSizeOptions: s = el,
2493
+ onPageIndexChange: o,
2346
2494
  onPageSizeChange: r,
2347
2495
  className: c
2348
2496
  }) {
2349
- const i = n != null && n >= 0 ? n : void 0, u = t > 0, f = i === void 0 ? !0 : t < i - 1, a = o === void 0 || o === 0 ? 0 : t * e + 1, m = o === void 0 ? void 0 : Math.min((t + 1) * e, o), g = s.includes(e) ? s : [...s, e].sort((T, E) => T - E);
2350
- return /* @__PURE__ */ F("div", { className: P(yn, c), children: [
2351
- /* @__PURE__ */ F("div", { className: Qt, children: [
2352
- /* @__PURE__ */ d("span", { className: $t, children: "Rows per page:" }),
2353
- /* @__PURE__ */ d(
2354
- sn,
2497
+ const i = n != null && n >= 0 ? n : void 0, u = t > 0, f = i === void 0 ? !0 : t < i - 1, d = l === void 0 || l === 0 ? 0 : t * e + 1, E = l === void 0 ? void 0 : Math.min((t + 1) * e, l), v = s.includes(e) ? s : [...s, e].sort((N, g) => N - g);
2498
+ return /* @__PURE__ */ W("div", { className: G(Fn, c), children: [
2499
+ /* @__PURE__ */ W("div", { className: te, children: [
2500
+ /* @__PURE__ */ a("span", { className: Ht, children: "Rows per page:" }),
2501
+ /* @__PURE__ */ a(
2502
+ hn,
2355
2503
  {
2356
2504
  "aria-label": "Rows per page",
2357
- onChange: (T) => r(Number(T.currentTarget.value)),
2358
- options: g,
2505
+ onChange: (N) => r(Number(N.currentTarget.value)),
2506
+ options: v,
2359
2507
  value: e
2360
2508
  }
2361
2509
  ),
2362
- o !== void 0 && /* @__PURE__ */ F("span", { className: $t, children: [
2363
- a === 0 ? 0 : `${a}–${m}`,
2510
+ l !== void 0 && /* @__PURE__ */ W("span", { className: Ht, children: [
2511
+ d === 0 ? 0 : `${d}–${E}`,
2364
2512
  " of ",
2365
- o
2513
+ l
2366
2514
  ] })
2367
2515
  ] }),
2368
- /* @__PURE__ */ F("div", { className: Qt, children: [
2369
- /* @__PURE__ */ F("span", { className: $t, children: [
2516
+ /* @__PURE__ */ W("div", { className: te, children: [
2517
+ /* @__PURE__ */ W("span", { className: Ht, children: [
2370
2518
  "Page ",
2371
2519
  t + 1,
2372
2520
  i !== void 0 ? ` of ${i}` : ""
2373
2521
  ] }),
2374
- /* @__PURE__ */ F(rn, { children: [
2375
- /* @__PURE__ */ d(
2376
- Rt,
2522
+ /* @__PURE__ */ W(mn, { children: [
2523
+ /* @__PURE__ */ a(
2524
+ It,
2377
2525
  {
2378
2526
  "aria-label": "First page",
2379
2527
  disabled: !u,
2380
2528
  icon: "double-chevron-left",
2381
- onClick: () => l(0)
2529
+ onClick: () => o(0)
2382
2530
  }
2383
2531
  ),
2384
- /* @__PURE__ */ d(
2385
- Rt,
2532
+ /* @__PURE__ */ a(
2533
+ It,
2386
2534
  {
2387
2535
  "aria-label": "Previous page",
2388
2536
  disabled: !u,
2389
2537
  icon: "chevron-left",
2390
- onClick: () => l(t - 1)
2538
+ onClick: () => o(t - 1)
2391
2539
  }
2392
2540
  ),
2393
- /* @__PURE__ */ d(
2394
- Rt,
2541
+ /* @__PURE__ */ a(
2542
+ It,
2395
2543
  {
2396
2544
  "aria-label": "Next page",
2397
2545
  disabled: !f,
2398
2546
  icon: "chevron-right",
2399
- onClick: () => l(t + 1)
2547
+ onClick: () => o(t + 1)
2400
2548
  }
2401
2549
  ),
2402
- /* @__PURE__ */ d(
2403
- Rt,
2550
+ /* @__PURE__ */ a(
2551
+ It,
2404
2552
  {
2405
2553
  "aria-label": "Last page",
2406
2554
  disabled: i === void 0 || !f,
2407
2555
  icon: "double-chevron-right",
2408
2556
  onClick: () => {
2409
- i !== void 0 && l(i - 1);
2557
+ i !== void 0 && o(i - 1);
2410
2558
  }
2411
2559
  }
2412
2560
  )
@@ -2414,98 +2562,98 @@ function Yo({
2414
2562
  ] })
2415
2563
  ] });
2416
2564
  }
2417
- const Xo = Pt({
2418
- ...Ut,
2419
- rowPaginationFeature: ie,
2420
- paginatedRowModel: ue()
2565
+ const ol = Pt({
2566
+ ...Vt,
2567
+ rowPaginationFeature: fe,
2568
+ paginatedRowModel: he()
2421
2569
  });
2422
- function ll(t) {
2570
+ function ml(t) {
2423
2571
  function e({
2424
- data: o,
2572
+ data: l,
2425
2573
  initialState: s,
2426
- state: l,
2574
+ state: o,
2427
2575
  features: r,
2428
2576
  onPaginationChange: c,
2429
2577
  manualPagination: i,
2430
2578
  pageCount: u,
2431
2579
  rowCount: f,
2432
- initialPageIndex: a = 0,
2433
- initialPageSize: m = ko,
2434
- pageSizeOptions: g,
2435
- showPaginationBar: T = !0,
2436
- paginationBarClassName: E,
2437
- ...v
2580
+ initialPageIndex: d = 0,
2581
+ initialPageSize: E = tl,
2582
+ pageSizeOptions: v,
2583
+ showPaginationBar: N = !0,
2584
+ paginationBarClassName: g,
2585
+ ...L
2438
2586
  }) {
2439
- const [L, R] = tt(() => {
2440
- var S, _;
2587
+ const [T, C] = lt(() => {
2588
+ var B, D;
2441
2589
  return {
2442
- pageIndex: ((S = s == null ? void 0 : s.pagination) == null ? void 0 : S.pageIndex) ?? a,
2443
- pageSize: ((_ = s == null ? void 0 : s.pagination) == null ? void 0 : _.pageSize) ?? m
2590
+ pageIndex: ((B = s == null ? void 0 : s.pagination) == null ? void 0 : B.pageIndex) ?? d,
2591
+ pageSize: ((D = s == null ? void 0 : s.pagination) == null ? void 0 : D.pageSize) ?? E
2444
2592
  };
2445
- }), C = l == null ? void 0 : l.pagination, y = C ?? L, { pageIndex: D, pageSize: z } = y, M = b(
2446
- (S) => {
2447
- c == null || c(S), C === void 0 && R((_) => ce(S, _));
2593
+ }), m = o == null ? void 0 : o.pagination, U = m ?? T, { pageIndex: y, pageSize: z } = U, S = P(
2594
+ (B) => {
2595
+ c == null || c(B), m === void 0 && C((D) => de(B, D));
2448
2596
  },
2449
- [C, c]
2450
- ), p = i === !0, U = p ? f : o.length, H = dt(() => p ? u != null && u >= 0 ? u : f != null ? Math.ceil(f / z) : void 0 : Math.max(1, Math.ceil(o.length / z)), [o.length, p, u, z, f]);
2451
- at(() => {
2452
- if (H === void 0)
2597
+ [m, c]
2598
+ ), R = i === !0, [V, j] = lt(), _ = !R && L.getSubRows != null && L.paginateExpandedRows !== !1, x = _ ? V : l.length, H = R ? f : x, I = gt(() => R ? u != null && u >= 0 ? u : f != null ? Math.ceil(f / z) : void 0 : x === void 0 ? void 0 : Math.max(1, Math.ceil(x / z)), [x, R, u, z, f]);
2599
+ Lt(() => {
2600
+ if (I === void 0)
2453
2601
  return;
2454
- const S = Math.max(0, H - 1);
2455
- D > S && M((_) => ({ ..._, pageIndex: S }));
2456
- }, [M, H, D]);
2457
- const N = dt(
2458
- () => r == null ? Xo : Pt({
2459
- ...Ut,
2602
+ const B = Math.max(0, I - 1);
2603
+ y > B && S((D) => ({ ...D, pageIndex: B }));
2604
+ }, [S, I, y]);
2605
+ const X = gt(
2606
+ () => r == null ? ol : Pt({
2607
+ ...Vt,
2460
2608
  ...r,
2461
- rowPaginationFeature: ie,
2462
- paginatedRowModel: ue()
2609
+ rowPaginationFeature: fe,
2610
+ paginatedRowModel: he()
2463
2611
  }),
2464
2612
  [r]
2465
- ), I = b(
2466
- (S) => {
2467
- M((_) => ({
2468
- ..._,
2469
- pageIndex: Math.max(0, S)
2613
+ ), M = P(
2614
+ (B) => {
2615
+ S((D) => ({
2616
+ ...D,
2617
+ pageIndex: Math.max(0, B)
2470
2618
  }));
2471
2619
  },
2472
- [M]
2473
- ), O = b(
2474
- (S) => {
2475
- M((_) => ({
2476
- ..._,
2620
+ [S]
2621
+ ), O = P(
2622
+ (B) => {
2623
+ S((D) => ({
2624
+ ...D,
2477
2625
  pageIndex: 0,
2478
- pageSize: S
2626
+ pageSize: B
2479
2627
  }));
2480
2628
  },
2481
- [M]
2629
+ [S]
2482
2630
  );
2483
- return /* @__PURE__ */ F("div", { className: $n, children: [
2484
- /* @__PURE__ */ d(
2631
+ return /* @__PURE__ */ W("div", { className: Gn, children: [
2632
+ /* @__PURE__ */ a(Ft.Provider, { value: _ ? j : void 0, children: /* @__PURE__ */ a(
2485
2633
  t,
2486
2634
  {
2487
- ...v,
2488
- data: o,
2635
+ ...L,
2636
+ data: l,
2489
2637
  initialState: s,
2490
- state: { ...l, pagination: y },
2491
- features: N,
2492
- onPaginationChange: M,
2638
+ state: { ...o, pagination: U },
2639
+ features: X,
2640
+ onPaginationChange: S,
2493
2641
  manualPagination: i,
2494
2642
  pageCount: u,
2495
2643
  rowCount: f
2496
2644
  }
2497
- ),
2498
- T && /* @__PURE__ */ d(
2499
- Yo,
2645
+ ) }),
2646
+ N && /* @__PURE__ */ a(
2647
+ nl,
2500
2648
  {
2501
- className: E,
2502
- onPageIndexChange: I,
2649
+ className: g,
2650
+ onPageIndexChange: M,
2503
2651
  onPageSizeChange: O,
2504
- pageCount: H,
2505
- pageIndex: D,
2652
+ pageCount: I,
2653
+ pageIndex: y,
2506
2654
  pageSize: z,
2507
- pageSizeOptions: g,
2508
- rowCount: U
2655
+ pageSizeOptions: v,
2656
+ rowCount: H
2509
2657
  }
2510
2658
  )
2511
2659
  ] });
@@ -2514,20 +2662,20 @@ function ll(t) {
2514
2662
  return e.displayName = `withPagination(${n})`, e;
2515
2663
  }
2516
2664
  export {
2517
- ol as BP_Table,
2518
- Ut as DEFAULT_BP_TABLE_FEATURES,
2519
- ko as DEFAULT_PAGE_SIZE,
2520
- Vo as DEFAULT_PAGE_SIZE_OPTIONS,
2521
- oo as Direction,
2522
- xe as FocusMode,
2523
- J as RegionCardinality,
2665
+ hl as BP_Table,
2666
+ Vt as DEFAULT_BP_TABLE_FEATURES,
2667
+ tl as DEFAULT_PAGE_SIZE,
2668
+ el as DEFAULT_PAGE_SIZE_OPTIONS,
2669
+ ho as Direction,
2670
+ Ge as FocusMode,
2671
+ ct as RegionCardinality,
2524
2672
  A as Regions,
2525
- Mt as TableLoadingOption,
2526
- Yo as TablePaginationBar,
2527
- lo as directionToDelta,
2528
- yt as hasLoadingOption,
2529
- el as moveFocusedCell,
2530
- nl as resizeRegion,
2531
- ll as withPagination
2673
+ Ot as TableLoadingOption,
2674
+ nl as TablePaginationBar,
2675
+ mo as directionToDelta,
2676
+ $t as hasLoadingOption,
2677
+ dl as moveFocusedCell,
2678
+ fl as resizeRegion,
2679
+ ml as withPagination
2532
2680
  };
2533
2681
  //# sourceMappingURL=blueprintjs-react-table.js.map