react-gridix 0.2.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { jsxs as I, jsx as h, Fragment as tt } from "react/jsx-runtime";
2
- import { useState as z, useRef as j, useEffect as ne, useMemo as ke, useCallback as Fe, useLayoutEffect as li, createElement as Ke, useId as si } from "react";
3
- import { createPortal as ai } from "react-dom";
4
- const Ft = (...t) => t.filter(Boolean).join(" ");
5
- function ci() {
1
+ import { jsxs as I, jsx as h, Fragment as ht } from "react/jsx-runtime";
2
+ import { useState as j, useRef as W, useEffect as ne, useMemo as ve, useCallback as Te, useLayoutEffect as ki, createElement as Pe, useId as Si } from "react";
3
+ import { createPortal as Ni } from "react-dom";
4
+ const Et = (...t) => t.filter(Boolean).join(" ");
5
+ function Ci() {
6
6
  return /* @__PURE__ */ h("svg", { viewBox: "0 0 16 16", width: "100%", height: "100%", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ h(
7
7
  "path",
8
8
  {
@@ -15,15 +15,15 @@ function ci() {
15
15
  }
16
16
  ) });
17
17
  }
18
- function di() {
18
+ function Di() {
19
19
  return /* @__PURE__ */ h("svg", { viewBox: "0 0 16 16", width: "100%", height: "100%", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ h("path", { d: "M4 8h8", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round" }) });
20
20
  }
21
- function ht({
21
+ function ft({
22
22
  checked: t,
23
23
  onChange: n,
24
24
  indeterminate: i = !1,
25
25
  variant: o = "native",
26
- disabled: u = !1,
26
+ disabled: f = !1,
27
27
  label: d,
28
28
  "aria-label": a,
29
29
  id: g,
@@ -38,12 +38,12 @@ function ht({
38
38
  return /* @__PURE__ */ I(
39
39
  "label",
40
40
  {
41
- className: Ft(
41
+ className: Et(
42
42
  "rg-checkbox",
43
43
  `rg-checkbox--${o}`,
44
44
  k === "checked" && "rg-checkbox--checked",
45
45
  i && "rg-checkbox--indeterminate",
46
- u && "rg-checkbox--disabled",
46
+ f && "rg-checkbox--disabled",
47
47
  v.root,
48
48
  E
49
49
  ),
@@ -59,10 +59,10 @@ function ht({
59
59
  ref: (D) => {
60
60
  D && (D.indeterminate = i);
61
61
  },
62
- className: Ft("rg-checkbox__control", v.control),
62
+ className: Et("rg-checkbox__control", v.control),
63
63
  style: p.control,
64
64
  checked: t,
65
- disabled: u,
65
+ disabled: f,
66
66
  "aria-label": a,
67
67
  "data-state": k,
68
68
  onChange: (D) => n(D.target.checked)
@@ -73,17 +73,17 @@ function ht({
73
73
  type: "button",
74
74
  role: "checkbox",
75
75
  id: g,
76
- className: Ft("rg-checkbox__control", v.control),
76
+ className: Et("rg-checkbox__control", v.control),
77
77
  style: p.control,
78
78
  "aria-checked": i ? "mixed" : t,
79
79
  "aria-label": a,
80
- disabled: u,
80
+ disabled: f,
81
81
  "data-state": k,
82
82
  onClick: () => n(!t),
83
83
  children: /* @__PURE__ */ h(
84
84
  "span",
85
85
  {
86
- className: Ft(
86
+ className: Et(
87
87
  "rg-checkbox__indicator",
88
88
  x !== void 0 && !i && "rg-checkbox__indicator--custom",
89
89
  v.indicator
@@ -91,83 +91,83 @@ function ht({
91
91
  style: p.indicator,
92
92
  "data-state": k,
93
93
  "aria-hidden": "true",
94
- children: i ? o === "tick" ? /* @__PURE__ */ h(di, {}) : null : x !== void 0 ? x : o === "tick" ? /* @__PURE__ */ h(ci, {}) : null
94
+ children: i ? o === "tick" ? /* @__PURE__ */ h(Di, {}) : null : x !== void 0 ? x : o === "tick" ? /* @__PURE__ */ h(Ci, {}) : null
95
95
  }
96
96
  )
97
97
  }
98
98
  ),
99
- d != null && d !== !1 && d !== "" && /* @__PURE__ */ h("span", { className: Ft("rg-checkbox__label", v.label), style: p.label, children: d })
99
+ d != null && d !== !1 && d !== "" && /* @__PURE__ */ h("span", { className: Et("rg-checkbox__label", v.label), style: p.label, children: d })
100
100
  ]
101
101
  }
102
102
  );
103
103
  }
104
- const ui = /^(\d{4})-(\d{2})-(\d{2})$/, Br = (t) => String(t).padStart(2, "0");
105
- function se(t) {
106
- const n = ui.exec(t);
104
+ const Ti = /^(\d{4})-(\d{2})-(\d{2})$/, Hr = (t) => String(t).padStart(2, "0");
105
+ function le(t) {
106
+ const n = Ti.exec(t);
107
107
  if (!n) return null;
108
- const [i, o, u] = [Number(n[1]), Number(n[2]), Number(n[3])], d = new Date(i, o - 1, u);
109
- return d.getFullYear() === i && d.getMonth() === o - 1 && d.getDate() === u ? d : null;
108
+ const [i, o, f] = [Number(n[1]), Number(n[2]), Number(n[3])], d = new Date(i, o - 1, f);
109
+ return d.getFullYear() === i && d.getMonth() === o - 1 && d.getDate() === f ? d : null;
110
110
  }
111
- function he(t) {
111
+ function pe(t) {
112
112
  var n;
113
113
  if (t instanceof Date)
114
- return Number.isNaN(t.getTime()) ? null : `${t.getFullYear()}-${Br(t.getMonth() + 1)}-${Br(t.getDate())}`;
115
- if (typeof t == "number") return Number.isFinite(t) ? he(new Date(t)) : null;
114
+ return Number.isNaN(t.getTime()) ? null : `${t.getFullYear()}-${Hr(t.getMonth() + 1)}-${Hr(t.getDate())}`;
115
+ if (typeof t == "number") return Number.isFinite(t) ? pe(new Date(t)) : null;
116
116
  if (typeof t == "string") {
117
117
  const i = t.trim();
118
118
  if (i === "") return null;
119
119
  const o = (n = /^\d{4}-\d{2}-\d{2}/.exec(i)) == null ? void 0 : n[0];
120
- if (o) return se(o) ? o : null;
121
- const u = Date.parse(i);
122
- return Number.isNaN(u) ? null : he(new Date(u));
120
+ if (o) return le(o) ? o : null;
121
+ const f = Date.parse(i);
122
+ return Number.isNaN(f) ? null : pe(new Date(f));
123
123
  }
124
124
  return null;
125
125
  }
126
- function fi(t, n, i) {
127
- const o = he(t);
128
- return o ? se(o).toLocaleDateString(n, i ?? { year: "numeric", month: "short", day: "numeric" }) : t == null ? "" : String(t);
126
+ function Fi(t, n, i) {
127
+ const o = pe(t);
128
+ return o ? le(o).toLocaleDateString(n, i ?? { year: "numeric", month: "short", day: "numeric" }) : t == null ? "" : String(t);
129
129
  }
130
- function hi(t, n) {
130
+ function Ei(t, n) {
131
131
  var i;
132
- return t === "" ? null : n instanceof Date ? se(t) : typeof n == "number" ? ((i = se(t)) == null ? void 0 : i.getTime()) ?? null : t;
132
+ return t === "" ? null : n instanceof Date ? le(t) : typeof n == "number" ? ((i = le(t)) == null ? void 0 : i.getTime()) ?? null : t;
133
133
  }
134
- const U = (...t) => t.filter(Boolean).join(" "), Mt = (t) => t.headerName ?? (t.type === "boolean" ? "" : t.type === "sequence" ? "#" : t.field), et = (t) => Mt(t) || t.field, Wr = (t) => String(t).padStart(2, "0"), Un = (t, n, i) => `${t}-${Wr(n + 1)}-${Wr(i)}`;
135
- function jr(t, n, i, o) {
136
- const u = [t, n == null ? void 0 : n.from, n == null ? void 0 : n.to].map((m) => m ? se(m) : null).find(Boolean);
137
- if (u) return new Date(u.getFullYear(), u.getMonth(), 1);
134
+ const U = (...t) => t.filter(Boolean).join(" "), $t = (t) => t.headerName ?? (t.type === "boolean" ? "" : t.type === "sequence" ? "#" : t.field), nt = (t) => $t(t) || t.field, Xr = (t) => String(t).padStart(2, "0"), zn = (t, n, i) => `${t}-${Xr(n + 1)}-${Xr(i)}`;
135
+ function Gr(t, n, i, o) {
136
+ const f = [t, n == null ? void 0 : n.from, n == null ? void 0 : n.to].map((m) => m ? le(m) : null).find(Boolean);
137
+ if (f) return new Date(f.getFullYear(), f.getMonth(), 1);
138
138
  const d = /* @__PURE__ */ new Date();
139
- let a = he(d);
139
+ let a = pe(d);
140
140
  i && a < i && (a = i), o && a > o && (a = o);
141
- const g = se(a) ?? d;
141
+ const g = le(a) ?? d;
142
142
  return new Date(g.getFullYear(), g.getMonth(), 1);
143
143
  }
144
- function lo({ value: t, range: n, min: i, max: o, onPick: u, locale: d, weekStart: a = 0, hideFooter: g, keepFocus: m, className: x }) {
145
- var Ie;
146
- const [E, b] = z(() => jr(t, n, i, o)), [v, p] = z(null), k = j(null), D = j({ value: t, from: n == null ? void 0 : n.from, to: n == null ? void 0 : n.to });
144
+ function go({ value: t, range: n, min: i, max: o, onPick: f, locale: d, weekStart: a = 0, hideFooter: g, keepFocus: m, className: x }) {
145
+ var Ee;
146
+ const [E, b] = j(() => Gr(t, n, i, o)), [v, p] = j(null), k = W(null), D = W({ value: t, from: n == null ? void 0 : n.from, to: n == null ? void 0 : n.to });
147
147
  ne(() => {
148
148
  const _ = D.current;
149
149
  D.current = { value: t, from: n == null ? void 0 : n.from, to: n == null ? void 0 : n.to };
150
- const G = t !== _.value ? t : (n == null ? void 0 : n.from) !== _.from ? n == null ? void 0 : n.from : (n == null ? void 0 : n.to) !== _.to ? n == null ? void 0 : n.to : void 0, S = G ? se(G) : null;
150
+ const G = t !== _.value ? t : (n == null ? void 0 : n.from) !== _.from ? n == null ? void 0 : n.from : (n == null ? void 0 : n.to) !== _.to ? n == null ? void 0 : n.to : void 0, S = G ? le(G) : null;
151
151
  S && b((B) => B.getFullYear() === S.getFullYear() && B.getMonth() === S.getMonth() ? B : new Date(S.getFullYear(), S.getMonth(), 1));
152
152
  }, [t, n == null ? void 0 : n.from, n == null ? void 0 : n.to]);
153
- const C = he(/* @__PURE__ */ new Date()), T = E.getFullYear(), w = E.getMonth(), P = ke(() => {
153
+ const C = pe(/* @__PURE__ */ new Date()), F = E.getFullYear(), w = E.getMonth(), O = ve(() => {
154
154
  const _ = new Intl.DateTimeFormat(d, { weekday: "short" });
155
155
  return Array.from({ length: 7 }, (G, S) => _.format(new Date(2023, 0, 1 + (S + a) % 7)));
156
- }, [d, a]), X = new Intl.DateTimeFormat(d, { month: "long", year: "numeric" }).format(E), q = ke(() => {
157
- const _ = (new Date(T, w, 1).getDay() - a + 7) % 7;
156
+ }, [d, a]), H = new Intl.DateTimeFormat(d, { month: "long", year: "numeric" }).format(E), q = ve(() => {
157
+ const _ = (new Date(F, w, 1).getDay() - a + 7) % 7;
158
158
  return Array.from({ length: 42 }, (G, S) => {
159
- const B = new Date(T, w, 1 - _ + S);
160
- return { iso: Un(B.getFullYear(), B.getMonth(), B.getDate()), day: B.getDate(), outside: B.getMonth() !== w };
159
+ const B = new Date(F, w, 1 - _ + S);
160
+ return { iso: zn(B.getFullYear(), B.getMonth(), B.getDate()), day: B.getDate(), outside: B.getMonth() !== w };
161
161
  });
162
- }, [T, w, a]), R = (_) => !!i && _ < i || !!o && _ > o, H = (_) => b(new Date(T, w + _, 1)), Se = (_) => {
163
- const G = se(_);
164
- G && ((G.getFullYear() !== T || G.getMonth() !== w) && b(new Date(G.getFullYear(), G.getMonth(), 1)), p(_), requestAnimationFrame(() => {
162
+ }, [F, w, a]), A = (_) => !!i && _ < i || !!o && _ > o, V = (_) => b(new Date(F, w + _, 1)), ke = (_) => {
163
+ const G = le(_);
164
+ G && ((G.getFullYear() !== F || G.getMonth() !== w) && b(new Date(G.getFullYear(), G.getMonth(), 1)), p(_), requestAnimationFrame(() => {
165
165
  var S, B;
166
166
  return (B = (S = k.current) == null ? void 0 : S.querySelector(`[data-iso="${_}"]`)) == null ? void 0 : B.focus();
167
167
  }));
168
- }, Pe = (_, G) => {
169
- const S = se(G), B = (ce) => {
170
- _.preventDefault(), Se(Un(S.getFullYear(), S.getMonth(), S.getDate() + ce));
168
+ }, Le = (_, G) => {
169
+ const S = le(G), B = (ce) => {
170
+ _.preventDefault(), ke(zn(S.getFullYear(), S.getMonth(), S.getDate() + ce));
171
171
  };
172
172
  switch (_.key) {
173
173
  case "ArrowLeft":
@@ -185,51 +185,51 @@ function lo({ value: t, range: n, min: i, max: o, onPick: u, locale: d, weekStar
185
185
  case "PageUp":
186
186
  case "PageDown": {
187
187
  _.preventDefault();
188
- const ce = _.key === "PageUp" ? -1 : 1, pe = new Date(S.getFullYear(), S.getMonth() + ce + 1, 0).getDate();
189
- Se(Un(S.getFullYear(), S.getMonth() + ce, Math.min(S.getDate(), pe)));
188
+ const ce = _.key === "PageUp" ? -1 : 1, ge = new Date(S.getFullYear(), S.getMonth() + ce + 1, 0).getDate();
189
+ ke(zn(S.getFullYear(), S.getMonth() + ce, Math.min(S.getDate(), ge)));
190
190
  return;
191
191
  }
192
192
  }
193
- }, ze = (_) => !!_ && q.some((G) => G.iso === _ && !G.outside), Ee = [v, t, C].find((_) => ze(_) && !R(_)) ?? ((Ie = q.find((_) => !_.outside && !R(_.iso))) == null ? void 0 : Ie.iso), V = n == null ? void 0 : n.from, ae = n == null ? void 0 : n.to;
193
+ }, ze = (_) => !!_ && q.some((G) => G.iso === _ && !G.outside), Fe = [v, t, C].find((_) => ze(_) && !A(_)) ?? ((Ee = q.find((_) => !_.outside && !A(_.iso))) == null ? void 0 : Ee.iso), Y = n == null ? void 0 : n.from, se = n == null ? void 0 : n.to;
194
194
  return /* @__PURE__ */ I(
195
195
  "div",
196
196
  {
197
197
  className: U("rg-cal", x),
198
198
  onMouseDown: m ? (_) => _.preventDefault() : void 0,
199
199
  role: "group",
200
- "aria-label": `Calendar, ${X}`,
200
+ "aria-label": `Calendar, ${H}`,
201
201
  children: [
202
202
  /* @__PURE__ */ I("div", { className: "rg-cal__head", children: [
203
- /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__nav", "aria-label": "Previous year", onClick: () => H(-12), children: "«" }),
204
- /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__nav", "aria-label": "Previous month", onClick: () => H(-1), children: "‹" }),
205
- /* @__PURE__ */ h("span", { className: "rg-cal__title", "aria-live": "polite", children: X }),
206
- /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__nav", "aria-label": "Next month", onClick: () => H(1), children: "›" }),
207
- /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__nav", "aria-label": "Next year", onClick: () => H(12), children: "»" })
203
+ /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__nav", "aria-label": "Previous year", onClick: () => V(-12), children: "«" }),
204
+ /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__nav", "aria-label": "Previous month", onClick: () => V(-1), children: "‹" }),
205
+ /* @__PURE__ */ h("span", { className: "rg-cal__title", "aria-live": "polite", children: H }),
206
+ /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__nav", "aria-label": "Next month", onClick: () => V(1), children: "›" }),
207
+ /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__nav", "aria-label": "Next year", onClick: () => V(12), children: "»" })
208
208
  ] }),
209
209
  /* @__PURE__ */ I("div", { className: "rg-cal__grid", ref: k, children: [
210
- P.map((_) => /* @__PURE__ */ h("span", { className: "rg-cal__dow", "aria-hidden": "true", children: _.slice(0, 2) }, _)),
210
+ O.map((_) => /* @__PURE__ */ h("span", { className: "rg-cal__dow", "aria-hidden": "true", children: _.slice(0, 2) }, _)),
211
211
  q.map(({ iso: _, day: G, outside: S }) => {
212
- const B = _ === t, ce = _ === V, pe = _ === ae, qe = !!V && !!ae && _ > V && _ < ae;
212
+ const B = _ === t, ce = _ === Y, ge = _ === se, qe = !!Y && !!se && _ > Y && _ < se;
213
213
  return /* @__PURE__ */ h(
214
214
  "button",
215
215
  {
216
216
  type: "button",
217
217
  "data-iso": _,
218
- tabIndex: _ === Ee ? 0 : -1,
219
- disabled: R(_),
220
- "aria-pressed": B || ce || pe,
221
- "aria-label": new Intl.DateTimeFormat(d, { dateStyle: "full" }).format(se(_)),
218
+ tabIndex: _ === Fe ? 0 : -1,
219
+ disabled: A(_),
220
+ "aria-pressed": B || ce || ge,
221
+ "aria-label": new Intl.DateTimeFormat(d, { dateStyle: "full" }).format(le(_)),
222
222
  className: U(
223
223
  "rg-cal__day",
224
224
  S && "rg-cal__day--outside",
225
225
  _ === C && "rg-cal__day--today",
226
- (B || ce || pe) && "rg-cal__day--selected",
226
+ (B || ce || ge) && "rg-cal__day--selected",
227
227
  qe && "rg-cal__day--in-range",
228
- V && ae && ce && V !== ae && "rg-cal__day--range-start",
229
- V && ae && pe && V !== ae && "rg-cal__day--range-end"
228
+ Y && se && ce && Y !== se && "rg-cal__day--range-start",
229
+ Y && se && ge && Y !== se && "rg-cal__day--range-end"
230
230
  ),
231
- onClick: () => u(_),
232
- onKeyDown: (nt) => Pe(nt, _),
231
+ onClick: () => f(_),
232
+ onKeyDown: (rt) => Le(rt, _),
233
233
  onFocus: () => p(_),
234
234
  children: G
235
235
  },
@@ -243,66 +243,66 @@ function lo({ value: t, range: n, min: i, max: o, onPick: u, locale: d, weekStar
243
243
  {
244
244
  type: "button",
245
245
  className: "rg-cal__link",
246
- disabled: R(C),
246
+ disabled: A(C),
247
247
  onClick: () => {
248
- b(jr(C)), u(C);
248
+ b(Gr(C)), f(C);
249
249
  },
250
250
  children: "Today"
251
251
  }
252
252
  ),
253
- /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__link", onClick: () => u(""), children: "Clear" })
253
+ /* @__PURE__ */ h("button", { type: "button", className: "rg-cal__link", onClick: () => f(""), children: "Clear" })
254
254
  ] })
255
255
  ]
256
256
  }
257
257
  );
258
258
  }
259
- const pn = typeof window < "u" ? li : ne;
260
- function Et(t, n, i) {
261
- const [o, u] = z(n), d = t !== void 0, a = d ? t : o, g = Fe(
259
+ const Pt = typeof window < "u" ? ki : ne;
260
+ function It(t, n, i) {
261
+ const [o, f] = j(n), d = t !== void 0, a = d ? t : o, g = Te(
262
262
  (m) => {
263
- d || u(m), i == null || i(m);
263
+ d || f(m), i == null || i(m);
264
264
  },
265
265
  [d, i]
266
266
  );
267
267
  return [a, g];
268
268
  }
269
- function so(t, n) {
270
- const i = j(t);
269
+ function mo(t, n) {
270
+ const i = W(t);
271
271
  i.current = t;
272
- const o = j(void 0), u = j(null), d = Fe(() => {
273
- o.current !== void 0 && clearTimeout(o.current), o.current = void 0, u.current = null;
274
- }, []), a = Fe(() => {
272
+ const o = W(void 0), f = W(null), d = Te(() => {
273
+ o.current !== void 0 && clearTimeout(o.current), o.current = void 0, f.current = null;
274
+ }, []), a = Te(() => {
275
275
  o.current !== void 0 && clearTimeout(o.current), o.current = void 0;
276
- const m = u.current;
277
- u.current = null, m && i.current(...m);
278
- }, []), g = Fe(
276
+ const m = f.current;
277
+ f.current = null, m && i.current(...m);
278
+ }, []), g = Te(
279
279
  (...m) => {
280
280
  if (n <= 0) {
281
281
  d(), i.current(...m);
282
282
  return;
283
283
  }
284
- u.current = m, o.current !== void 0 && clearTimeout(o.current), o.current = setTimeout(a, n);
284
+ f.current = m, o.current !== void 0 && clearTimeout(o.current), o.current = setTimeout(a, n);
285
285
  },
286
286
  [n, d, a]
287
287
  );
288
288
  return ne(() => a, [a]), { call: g, flush: a, cancel: d };
289
289
  }
290
- function yn({ anchorRef: t, open: n, onClose: i, label: o, theme: u, className: d, style: a, keepFocus: g, children: m }) {
291
- const x = j(null), [E, b] = z({ top: 0, left: 0 }), v = Fe(() => {
292
- var T;
290
+ function kn({ anchorRef: t, open: n, onClose: i, label: o, theme: f, className: d, style: a, keepFocus: g, children: m }) {
291
+ const x = W(null), [E, b] = j({ top: 0, left: 0 }), v = Te(() => {
292
+ var F;
293
293
  const p = t.current;
294
294
  if (!p) return;
295
- const k = p.getBoundingClientRect(), D = ((T = x.current) == null ? void 0 : T.offsetWidth) ?? 260, C = Math.max(8, Math.min(k.left, window.innerWidth - D - 8));
295
+ const k = p.getBoundingClientRect(), D = ((F = x.current) == null ? void 0 : F.offsetWidth) ?? 260, C = Math.max(8, Math.min(k.left, window.innerWidth - D - 8));
296
296
  b({ top: k.bottom + 6, left: C });
297
297
  }, [t]);
298
- return pn(() => {
298
+ return Pt(() => {
299
299
  n && v();
300
300
  }, [n, v]), ne(() => {
301
301
  if (!n) return;
302
302
  const p = (D) => {
303
- var T, w;
303
+ var F, w;
304
304
  const C = D.target;
305
- (T = x.current) != null && T.contains(C) || (w = t.current) != null && w.contains(C) || i();
305
+ (F = x.current) != null && F.contains(C) || (w = t.current) != null && w.contains(C) || i();
306
306
  }, k = (D) => {
307
307
  var C;
308
308
  D.key === "Escape" && (i(), (C = t.current) == null || C.focus());
@@ -310,7 +310,7 @@ function yn({ anchorRef: t, open: n, onClose: i, label: o, theme: u, className:
310
310
  return document.addEventListener("mousedown", p), document.addEventListener("keydown", k), window.addEventListener("resize", v), window.addEventListener("scroll", v, !0), () => {
311
311
  document.removeEventListener("mousedown", p), document.removeEventListener("keydown", k), window.removeEventListener("resize", v), window.removeEventListener("scroll", v, !0);
312
312
  };
313
- }, [n, i, v, t]), !n || typeof document > "u" ? null : ai(
313
+ }, [n, i, v, t]), !n || typeof document > "u" ? null : Ni(
314
314
  /* @__PURE__ */ h(
315
315
  "div",
316
316
  {
@@ -318,7 +318,7 @@ function yn({ anchorRef: t, open: n, onClose: i, label: o, theme: u, className:
318
318
  role: "dialog",
319
319
  onMouseDown: g ? (p) => p.preventDefault() : void 0,
320
320
  "aria-label": o,
321
- "data-rg-theme": u || void 0,
321
+ "data-rg-theme": f || void 0,
322
322
  className: U("rg-grid-popup", d),
323
323
  style: { position: "fixed", top: E.top, left: E.left, ...a },
324
324
  children: m
@@ -327,9 +327,9 @@ function yn({ anchorRef: t, open: n, onClose: i, label: o, theme: u, className:
327
327
  document.body
328
328
  );
329
329
  }
330
- function pi({ value: t, onChange: n, onPick: i, onBlur: o, onKeyDown: u, min: d, max: a, locale: g, invalid: m, label: x, theme: E, className: b, style: v }) {
331
- const p = j(null);
332
- return /* @__PURE__ */ I(tt, { children: [
330
+ function Ii({ value: t, onChange: n, onPick: i, onBlur: o, onKeyDown: f, min: d, max: a, locale: g, invalid: m, label: x, theme: E, className: b, style: v }) {
331
+ const p = W(null);
332
+ return /* @__PURE__ */ I(ht, { children: [
333
333
  /* @__PURE__ */ h(
334
334
  "input",
335
335
  {
@@ -349,24 +349,24 @@ function pi({ value: t, onChange: n, onPick: i, onBlur: o, onKeyDown: u, min: d,
349
349
  onChange: (D) => n(D.target.value.trim()),
350
350
  onBlur: o,
351
351
  onKeyDown: (D) => {
352
- const C = D.ctrlKey || D.altKey || D.metaKey, T = D.key === "ArrowUp" ? { days: -7, months: 0 } : D.key === "ArrowDown" ? { days: 7, months: 0 } : C && D.key === "ArrowLeft" ? { days: -1, months: 0 } : C && D.key === "ArrowRight" ? { days: 1, months: 0 } : D.key === "PageUp" ? { days: 0, months: -1 } : D.key === "PageDown" ? { days: 0, months: 1 } : null;
353
- if (!T || D.shiftKey) return u(D);
352
+ const C = D.ctrlKey || D.altKey || D.metaKey, F = D.key === "ArrowUp" ? { days: -7, months: 0 } : D.key === "ArrowDown" ? { days: 7, months: 0 } : C && D.key === "ArrowLeft" ? { days: -1, months: 0 } : C && D.key === "ArrowRight" ? { days: 1, months: 0 } : D.key === "PageUp" ? { days: 0, months: -1 } : D.key === "PageDown" ? { days: 0, months: 1 } : null;
353
+ if (!F || D.shiftKey) return f(D);
354
354
  D.preventDefault();
355
- const w = se(t) ?? /* @__PURE__ */ new Date(), P = new Date(w.getFullYear(), w.getMonth() + T.months + 1, 0).getDate(), X = new Date(w.getFullYear(), w.getMonth() + T.months, Math.min(w.getDate(), P) + T.days);
356
- let q = he(X);
355
+ const w = le(t) ?? /* @__PURE__ */ new Date(), O = new Date(w.getFullYear(), w.getMonth() + F.months + 1, 0).getDate(), H = new Date(w.getFullYear(), w.getMonth() + F.months, Math.min(w.getDate(), O) + F.days);
356
+ let q = pe(H);
357
357
  d && q < d && (q = d), a && q > a && (q = a), n(q);
358
358
  },
359
359
  onFocus: (D) => D.currentTarget.setSelectionRange(D.currentTarget.value.length, D.currentTarget.value.length)
360
360
  }
361
361
  ),
362
- /* @__PURE__ */ h(yn, { anchorRef: p, open: !0, onClose: () => {
363
- }, label: x, theme: E, className: "rg-date-popup", keepFocus: !0, children: /* @__PURE__ */ h(lo, { value: t, min: d, max: a, locale: g, onPick: i, keepFocus: !0 }) })
362
+ /* @__PURE__ */ h(kn, { anchorRef: p, open: !0, onClose: () => {
363
+ }, label: x, theme: E, className: "rg-date-popup", keepFocus: !0, children: /* @__PURE__ */ h(go, { value: t, min: d, max: a, locale: g, onPick: i, keepFocus: !0 }) })
364
364
  ] });
365
365
  }
366
- function Kr(t) {
366
+ function Jr(t) {
367
367
  return t.filterType ? t.filterType : t.type === "number" ? "number" : t.type === "date" ? "date" : t.type === "boolean" ? "select" : "text";
368
368
  }
369
- const zr = [
369
+ const Zr = [
370
370
  "contains",
371
371
  "notContains",
372
372
  "equals",
@@ -375,7 +375,7 @@ const zr = [
375
375
  "notStartsWith",
376
376
  "endsWith",
377
377
  "notEndsWith"
378
- ], qr = {
378
+ ], Qr = {
379
379
  contains: "Contains",
380
380
  notContains: "Does not contain",
381
381
  equals: "Equals",
@@ -385,102 +385,102 @@ const zr = [
385
385
  endsWith: "Ends with",
386
386
  notEndsWith: "Does not end with"
387
387
  };
388
- function ao(t) {
388
+ function bo(t) {
389
389
  const n = t.filterOperators;
390
390
  if (!n) return null;
391
- if (n === !0) return zr;
392
- const i = zr.filter((o) => n.includes(o));
391
+ if (n === !0) return Zr;
392
+ const i = Zr.filter((o) => n.includes(o));
393
393
  return i.length > 0 ? i : null;
394
394
  }
395
- function gi(t, n) {
396
- const i = ao(t), o = t.filterOperator ?? (n === "exact" ? "equals" : "contains");
395
+ function Mi(t, n) {
396
+ const i = bo(t), o = t.filterOperator ?? (n === "exact" ? "equals" : "contains");
397
397
  return i && !i.includes(o) ? i[0] : o;
398
398
  }
399
- function Yr(t, n, i) {
400
- const o = n.toLowerCase(), u = i.trim().toLowerCase();
399
+ function eo(t, n, i) {
400
+ const o = n.toLowerCase(), f = i.trim().toLowerCase();
401
401
  switch (t) {
402
402
  case "contains":
403
- return o.includes(u);
403
+ return o.includes(f);
404
404
  case "notContains":
405
- return !o.includes(u);
405
+ return !o.includes(f);
406
406
  case "equals":
407
- return o === u;
407
+ return o === f;
408
408
  case "notEquals":
409
- return o !== u;
409
+ return o !== f;
410
410
  case "startsWith":
411
- return o.startsWith(u);
411
+ return o.startsWith(f);
412
412
  case "notStartsWith":
413
- return !o.startsWith(u);
413
+ return !o.startsWith(f);
414
414
  case "endsWith":
415
- return o.endsWith(u);
415
+ return o.endsWith(f);
416
416
  case "notEndsWith":
417
- return !o.endsWith(u);
417
+ return !o.endsWith(f);
418
418
  }
419
419
  }
420
- const co = (t) => typeof t == "object" && t !== null && !Array.isArray(t);
421
- function uo(t) {
420
+ const yo = (t) => typeof t == "object" && t !== null && !Array.isArray(t);
421
+ function xo(t) {
422
422
  if (t == null) return !1;
423
423
  if (typeof t == "string") return t.trim() !== "";
424
424
  if (Array.isArray(t)) return t.length > 0;
425
- if (co(t)) {
425
+ if (yo(t)) {
426
426
  const n = t;
427
427
  return typeof n.operator == "string" ? typeof n.value == "string" && n.value.trim() !== "" : typeof n.min == "number" || typeof n.max == "number" || !!n.from || !!n.to;
428
428
  }
429
429
  return !1;
430
430
  }
431
- function mi(t, n, i, o) {
431
+ function $i(t, n, i, o) {
432
432
  switch (t) {
433
433
  case "text":
434
434
  case "exact": {
435
- if (co(n)) {
436
- const u = n;
437
- return Yr(u.operator, i, String(u.value ?? ""));
435
+ if (yo(n)) {
436
+ const f = n;
437
+ return eo(f.operator, i, String(f.value ?? ""));
438
438
  }
439
- return Yr(t === "exact" ? "equals" : "contains", i, String(n));
439
+ return eo(t === "exact" ? "equals" : "contains", i, String(n));
440
440
  }
441
441
  case "number": {
442
- const { min: u, max: d } = n, a = typeof o == "number" ? o : o == null || o === "" ? NaN : Number(o);
443
- return Number.isNaN(a) ? !1 : (typeof u != "number" || a >= u) && (typeof d != "number" || a <= d);
442
+ const { min: f, max: d } = n, a = typeof o == "number" ? o : o == null || o === "" ? NaN : Number(o);
443
+ return Number.isNaN(a) ? !1 : (typeof f != "number" || a >= f) && (typeof d != "number" || a <= d);
444
444
  }
445
445
  case "date": {
446
- const { from: u, to: d } = n, a = he(o);
447
- return a ? (!u || a >= u) && (!d || a <= d) : !1;
446
+ const { from: f, to: d } = n, a = pe(o);
447
+ return a ? (!f || a >= f) && (!d || a <= d) : !1;
448
448
  }
449
449
  case "select":
450
450
  return n.includes(String(o ?? ""));
451
451
  }
452
452
  }
453
- function bi(t, n, i, o) {
453
+ function Pi(t, n, i, o) {
454
454
  if (t.filterOptions) return t.filterOptions.map((d) => typeof d == "string" ? { value: d, label: d } : d);
455
455
  if (t.type === "boolean")
456
456
  return [
457
457
  { value: "true", label: "Yes" },
458
458
  { value: "false", label: "No" }
459
459
  ];
460
- const u = /* @__PURE__ */ new Map();
460
+ const f = /* @__PURE__ */ new Map();
461
461
  for (const d of n) {
462
462
  const a = i(d);
463
463
  if (a == null || a === "") continue;
464
464
  const g = String(a);
465
- u.has(g) || u.set(g, o(d));
465
+ f.has(g) || f.set(g, o(d));
466
466
  }
467
- return [...u].map(([d, a]) => ({ value: d, label: a })).sort((d, a) => d.label.localeCompare(a.label, void 0, { numeric: !0 }));
467
+ return [...f].map(([d, a]) => ({ value: d, label: a })).sort((d, a) => d.label.localeCompare(a.label, void 0, { numeric: !0 }));
468
468
  }
469
- const Vr = (t) => {
469
+ const to = (t) => {
470
470
  if (t.trim() === "") return;
471
471
  const n = Number(t);
472
472
  return Number.isFinite(n) ? n : void 0;
473
- }, qn = (t) => typeof t == "object" && t !== null && !Array.isArray(t);
474
- function yi({
473
+ }, Jn = (t) => typeof t == "object" && t !== null && !Array.isArray(t);
474
+ function Li({
475
475
  value: t,
476
476
  onChange: n,
477
477
  label: i,
478
478
  debounce: o,
479
- inputClassName: u,
479
+ inputClassName: f,
480
480
  inputStyle: d
481
481
  }) {
482
- const a = qn(t) ? t : {}, [g, m] = z(a.min === void 0 ? "" : String(a.min)), [x, E] = z(a.max === void 0 ? "" : String(a.max)), b = j(a), v = so((p, k) => {
483
- const D = Vr(p), C = Vr(k);
482
+ const a = Jn(t) ? t : {}, [g, m] = j(a.min === void 0 ? "" : String(a.min)), [x, E] = j(a.max === void 0 ? "" : String(a.max)), b = W(a), v = mo((p, k) => {
483
+ const D = to(p), C = to(k);
484
484
  b.current = { min: D, max: C }, n(D === void 0 && C === void 0 ? void 0 : { min: D, max: C });
485
485
  }, o);
486
486
  return ne(() => {
@@ -493,7 +493,7 @@ function yi({
493
493
  {
494
494
  autoFocus: !0,
495
495
  type: "number",
496
- className: U("rg-grid__filter-input", u),
496
+ className: U("rg-grid__filter-input", f),
497
497
  style: d,
498
498
  value: g,
499
499
  "aria-label": `Minimum ${i}`,
@@ -510,7 +510,7 @@ function yi({
510
510
  "input",
511
511
  {
512
512
  type: "number",
513
- className: U("rg-grid__filter-input", u),
513
+ className: U("rg-grid__filter-input", f),
514
514
  style: d,
515
515
  value: x,
516
516
  "aria-label": `Maximum ${i}`,
@@ -523,18 +523,18 @@ function yi({
523
523
  ] })
524
524
  ] });
525
525
  }
526
- function xi({
526
+ function Oi({
527
527
  value: t,
528
528
  onChange: n,
529
529
  onEnter: i,
530
530
  label: o,
531
- kind: u,
531
+ kind: f,
532
532
  placeholder: d,
533
533
  debounce: a,
534
534
  inputClassName: g,
535
535
  inputStyle: m
536
536
  }) {
537
- const [x, E] = z(t), b = j(t), v = so((p) => {
537
+ const [x, E] = j(t), b = W(t), v = mo((p) => {
538
538
  b.current = p, n(p || void 0);
539
539
  }, a);
540
540
  return ne(() => {
@@ -547,7 +547,7 @@ function xi({
547
547
  className: U("rg-grid__filter-input", g),
548
548
  style: m,
549
549
  value: x,
550
- placeholder: d ?? (u === "exact" ? "Exactly…" : `Filter ${o}…`),
550
+ placeholder: d ?? (f === "exact" ? "Exactly…" : `Filter ${o}…`),
551
551
  "aria-label": `Filter text for ${o}`,
552
552
  onChange: (p) => {
553
553
  E(p.target.value), v.call(p.target.value);
@@ -558,41 +558,41 @@ function xi({
558
558
  }
559
559
  );
560
560
  }
561
- function _i({
561
+ function Ri({
562
562
  value: t,
563
563
  onChange: n,
564
564
  label: i,
565
565
  inputClassName: o,
566
- inputStyle: u,
566
+ inputStyle: f,
567
567
  min: d,
568
568
  max: a,
569
569
  locale: g
570
570
  }) {
571
- const m = qn(t) ? t : {}, x = (T, w) => n(!T && !w ? void 0 : { from: T || void 0, to: w || void 0 }), [E, b] = z(m.from ?? ""), [v, p] = z(m.to ?? "");
571
+ const m = Jn(t) ? t : {}, x = (F, w) => n(!F && !w ? void 0 : { from: F || void 0, to: w || void 0 }), [E, b] = j(m.from ?? ""), [v, p] = j(m.to ?? "");
572
572
  ne(() => {
573
- (se(E) ? E : "") !== (m.from ?? "") && b(m.from ?? ""), (se(v) ? v : "") !== (m.to ?? "") && p(m.to ?? "");
573
+ (le(E) ? E : "") !== (m.from ?? "") && b(m.from ?? ""), (le(v) ? v : "") !== (m.to ?? "") && p(m.to ?? "");
574
574
  }, [m.from, m.to]);
575
- const k = (T, w) => {
576
- if ((T === "from" ? b : p)(w), w !== "" && !se(w)) return;
577
- const P = w || void 0;
578
- T === "from" ? x(P, m.to) : x(m.from, P);
579
- }, D = (T) => {
580
- T && (!m.from || m.to ? x(T, void 0) : T < m.from ? x(T, m.from) : x(m.from, T));
581
- }, C = (T, w, P) => /* @__PURE__ */ I("label", { className: "rg-grid__filter-field", children: [
582
- /* @__PURE__ */ h("span", { children: T === "from" ? "From" : "To" }),
575
+ const k = (F, w) => {
576
+ if ((F === "from" ? b : p)(w), w !== "" && !le(w)) return;
577
+ const O = w || void 0;
578
+ F === "from" ? x(O, m.to) : x(m.from, O);
579
+ }, D = (F) => {
580
+ F && (!m.from || m.to ? x(F, void 0) : F < m.from ? x(F, m.from) : x(m.from, F));
581
+ }, C = (F, w, O) => /* @__PURE__ */ I("label", { className: "rg-grid__filter-field", children: [
582
+ /* @__PURE__ */ h("span", { children: F === "from" ? "From" : "To" }),
583
583
  /* @__PURE__ */ h(
584
584
  "input",
585
585
  {
586
- autoFocus: P,
586
+ autoFocus: O,
587
587
  type: "text",
588
588
  inputMode: "numeric",
589
589
  placeholder: "YYYY-MM-DD",
590
- className: U("rg-grid__filter-input", w !== "" && !se(w) && "rg-grid__filter-input--invalid", o),
591
- style: u,
590
+ className: U("rg-grid__filter-input", w !== "" && !le(w) && "rg-grid__filter-input--invalid", o),
591
+ style: f,
592
592
  value: w,
593
- "aria-label": `${i} ${T}`,
594
- "aria-invalid": w !== "" && !se(w) || void 0,
595
- onChange: (X) => k(T, X.target.value.trim())
593
+ "aria-label": `${i} ${F}`,
594
+ "aria-invalid": w !== "" && !le(w) || void 0,
595
+ onChange: (H) => k(F, H.target.value.trim())
596
596
  }
597
597
  )
598
598
  ] });
@@ -601,44 +601,44 @@ function _i({
601
601
  C("from", E, !0),
602
602
  C("to", v, !1)
603
603
  ] }),
604
- /* @__PURE__ */ h(lo, { range: m, min: d, max: a, locale: g, onPick: D, hideFooter: !0 })
604
+ /* @__PURE__ */ h(go, { range: m, min: d, max: a, locale: g, onPick: D, hideFooter: !0 })
605
605
  ] });
606
606
  }
607
- function wi({
607
+ function Ui({
608
608
  value: t,
609
609
  onChange: n,
610
610
  options: i
611
611
  }) {
612
- const o = Array.isArray(t) ? t : [], u = (d, a) => {
612
+ const o = Array.isArray(t) ? t : [], f = (d, a) => {
613
613
  const g = a ? [...o, d] : o.filter((m) => m !== d);
614
614
  n(g.length ? g : void 0);
615
615
  };
616
616
  return /* @__PURE__ */ I("div", { className: "rg-grid__filter-fields rg-grid__filter-options", role: "group", children: [
617
617
  i.length === 0 && /* @__PURE__ */ h("span", { className: "rg-grid__filter-empty", children: "No values" }),
618
618
  i.map((d) => /* @__PURE__ */ h(
619
- ht,
619
+ ft,
620
620
  {
621
621
  checked: o.includes(d.value),
622
- onChange: (a) => u(d.value, a),
622
+ onChange: (a) => f(d.value, a),
623
623
  label: d.label ?? d.value
624
624
  },
625
625
  d.value
626
626
  ))
627
627
  ] });
628
628
  }
629
- function vi({
629
+ function Ai({
630
630
  value: t,
631
631
  options: n,
632
632
  onChange: i,
633
633
  label: o
634
634
  }) {
635
- const [u, d] = z(!1), [a, g] = z(0), m = si(), x = j(null), E = () => {
635
+ const [f, d] = j(!1), [a, g] = j(0), m = Si(), x = W(null), E = () => {
636
636
  g(Math.max(0, n.indexOf(t))), d(!0);
637
637
  }, b = (p) => {
638
638
  var k;
639
639
  i(p), d(!1), (k = x.current) == null || k.focus();
640
640
  }, v = (p) => {
641
- if (!u) {
641
+ if (!f) {
642
642
  (p.key === "ArrowDown" || p.key === "ArrowUp") && (p.preventDefault(), E());
643
643
  return;
644
644
  }
@@ -677,19 +677,19 @@ function vi({
677
677
  role: "combobox",
678
678
  "aria-label": `Comparison for ${o}`,
679
679
  "aria-haspopup": "listbox",
680
- "aria-expanded": u,
681
- "aria-controls": u ? m : void 0,
682
- "aria-activedescendant": u ? `${m}-${a}` : void 0,
683
- onClick: () => u ? d(!1) : E(),
680
+ "aria-expanded": f,
681
+ "aria-controls": f ? m : void 0,
682
+ "aria-activedescendant": f ? `${m}-${a}` : void 0,
683
+ onClick: () => f ? d(!1) : E(),
684
684
  onBlur: () => d(!1),
685
685
  onKeyDown: v,
686
686
  children: [
687
- /* @__PURE__ */ h("span", { className: "rg-op__value", children: qr[t] }),
687
+ /* @__PURE__ */ h("span", { className: "rg-op__value", children: Qr[t] }),
688
688
  /* @__PURE__ */ h("svg", { className: "rg-op__chevron", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ h("path", { d: "M2.5 4.5 6 8l3.5-3.5" }) })
689
689
  ]
690
690
  }
691
691
  ),
692
- u && // mousedown must not move focus away from the button, or onBlur would close the list before the click lands
692
+ f && // mousedown must not move focus away from the button, or onBlur would close the list before the click lands
693
693
  /* @__PURE__ */ h("ul", { id: m, role: "listbox", className: "rg-op__list", "aria-label": `Comparisons for ${o}`, onMouseDown: (p) => p.preventDefault(), children: n.map((p, k) => /* @__PURE__ */ I(
694
694
  "li",
695
695
  {
@@ -701,7 +701,7 @@ function vi({
701
701
  onMouseEnter: () => g(k),
702
702
  onClick: () => b(p),
703
703
  children: [
704
- qr[p],
704
+ Qr[p],
705
705
  p === t && /* @__PURE__ */ h("svg", { className: "rg-op__check", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ h("path", { d: "M2.5 6.5 5 9l4.5-5.5" }) })
706
706
  ]
707
707
  },
@@ -709,12 +709,12 @@ function vi({
709
709
  )) })
710
710
  ] });
711
711
  }
712
- function ki({
712
+ function Wi({
713
713
  column: t,
714
714
  label: n,
715
715
  kind: i,
716
716
  value: o,
717
- onChange: u,
717
+ onChange: f,
718
718
  options: d,
719
719
  debounce: a = 300,
720
720
  theme: g,
@@ -725,32 +725,32 @@ function ki({
725
725
  inputClassName: v,
726
726
  inputStyle: p
727
727
  }) {
728
- const [k, D] = z(!1), C = j(null), T = uo(o), w = Fe(() => D(!1), []), P = qn(o) ? o : null, X = typeof o == "string" ? o : typeof (P == null ? void 0 : P.value) == "string" ? P.value : "", q = (i === "text" || i === "exact") && !t.filterRenderer ? ao(t) : null, [R, H] = z(() => gi(t, i)), Se = P && typeof P.operator == "string" ? P.operator : R, Pe = (V) => {
729
- if (V === void 0) return u(void 0);
730
- u(q ? { operator: Se, value: String(V) } : V);
731
- }, ze = (V) => {
732
- H(V), X.trim() !== "" && u({ operator: V, value: X });
733
- }, Ee = () => {
728
+ const [k, D] = j(!1), C = W(null), F = xo(o), w = Te(() => D(!1), []), O = Jn(o) ? o : null, H = typeof o == "string" ? o : typeof (O == null ? void 0 : O.value) == "string" ? O.value : "", q = (i === "text" || i === "exact") && !t.filterRenderer ? bo(t) : null, [A, V] = j(() => Mi(t, i)), ke = O && typeof O.operator == "string" ? O.operator : A, Le = (Y) => {
729
+ if (Y === void 0) return f(void 0);
730
+ f(q ? { operator: ke, value: String(Y) } : Y);
731
+ }, ze = (Y) => {
732
+ V(Y), H.trim() !== "" && f({ operator: Y, value: H });
733
+ }, Fe = () => {
734
734
  if (t.filterRenderer)
735
- return Ke(t.filterRenderer, { column: t, value: X, onChange: (V) => u(V || void 0) });
735
+ return Pe(t.filterRenderer, { column: t, value: H, onChange: (Y) => f(Y || void 0) });
736
736
  switch (i) {
737
737
  case "number":
738
- return /* @__PURE__ */ h(yi, { value: o, onChange: u, label: n, debounce: a, inputClassName: v, inputStyle: p });
738
+ return /* @__PURE__ */ h(Li, { value: o, onChange: f, label: n, debounce: a, inputClassName: v, inputStyle: p });
739
739
  case "date":
740
- return /* @__PURE__ */ h(_i, { value: o, onChange: u, label: n, min: t.dateMin, max: t.dateMax, locale: t.dateLocale, inputClassName: v, inputStyle: p });
740
+ return /* @__PURE__ */ h(Ri, { value: o, onChange: f, label: n, min: t.dateMin, max: t.dateMax, locale: t.dateLocale, inputClassName: v, inputStyle: p });
741
741
  case "select":
742
- return /* @__PURE__ */ h(wi, { value: o, onChange: u, options: d });
742
+ return /* @__PURE__ */ h(Ui, { value: o, onChange: f, options: d });
743
743
  default:
744
744
  return /* @__PURE__ */ I("div", { className: "rg-grid__filter-stack", children: [
745
- q && /* @__PURE__ */ h(vi, { value: Se, options: q, onChange: ze, label: n }),
745
+ q && /* @__PURE__ */ h(Ai, { value: ke, options: q, onChange: ze, label: n }),
746
746
  /* @__PURE__ */ h(
747
- xi,
747
+ Oi,
748
748
  {
749
- value: X,
750
- onChange: Pe,
749
+ value: H,
750
+ onChange: Le,
751
751
  onEnter: () => {
752
- var V;
753
- D(!1), (V = C.current) == null || V.focus();
752
+ var Y;
753
+ D(!1), (Y = C.current) == null || Y.focus();
754
754
  },
755
755
  label: n,
756
756
  kind: i,
@@ -763,7 +763,7 @@ function ki({
763
763
  ] });
764
764
  }
765
765
  };
766
- return /* @__PURE__ */ I(tt, { children: [
766
+ return /* @__PURE__ */ I(ht, { children: [
767
767
  /* @__PURE__ */ h(
768
768
  "button",
769
769
  {
@@ -771,7 +771,7 @@ function ki({
771
771
  type: "button",
772
772
  className: U(
773
773
  "rg-grid__filter-btn",
774
- T && "rg-grid__filter-btn--active",
774
+ F && "rg-grid__filter-btn--active",
775
775
  k && "rg-grid__filter-btn--open",
776
776
  m
777
777
  ),
@@ -779,16 +779,16 @@ function ki({
779
779
  "aria-label": `Filter ${n}`,
780
780
  "aria-haspopup": "dialog",
781
781
  "aria-expanded": k,
782
- "data-active": T || void 0,
783
- onClick: (V) => {
784
- V.stopPropagation(), D((ae) => !ae);
782
+ "data-active": F || void 0,
783
+ onClick: (Y) => {
784
+ Y.stopPropagation(), D((se) => !se);
785
785
  },
786
- onKeyDown: (V) => V.stopPropagation(),
787
- children: t.filterIndicator ? Ke(t.filterIndicator, { column: t, active: T, open: k }) : /* @__PURE__ */ h("span", { className: "rg-grid__filter-dot", "aria-hidden": "true" })
786
+ onKeyDown: (Y) => Y.stopPropagation(),
787
+ children: t.filterIndicator ? Pe(t.filterIndicator, { column: t, active: F, open: k }) : /* @__PURE__ */ h("span", { className: "rg-grid__filter-dot", "aria-hidden": "true" })
788
788
  }
789
789
  ),
790
790
  /* @__PURE__ */ I(
791
- yn,
791
+ kn,
792
792
  {
793
793
  anchorRef: C,
794
794
  open: k,
@@ -798,22 +798,22 @@ function ki({
798
798
  className: E,
799
799
  style: b,
800
800
  children: [
801
- Ee(),
802
- T && /* @__PURE__ */ h("button", { type: "button", className: "rg-grid__filter-clear", onClick: () => u(void 0), children: "Clear" })
801
+ Fe(),
802
+ F && /* @__PURE__ */ h("button", { type: "button", className: "rg-grid__filter-clear", onClick: () => f(void 0), children: "Clear" })
803
803
  ]
804
804
  }
805
805
  )
806
806
  ] });
807
807
  }
808
- function Si({ columns: t, hidden: n, onToggle: i, theme: o, className: u, style: d }) {
809
- const [a, g] = z(!1), m = j(null), x = Fe(() => g(!1), []), E = t.filter((b) => !n.has(b.field)).length;
810
- return /* @__PURE__ */ I(tt, { children: [
808
+ function Bi({ columns: t, hidden: n, onToggle: i, theme: o, className: f, style: d }) {
809
+ const [a, g] = j(!1), m = W(null), x = Te(() => g(!1), []), E = t.filter((b) => !n.has(b.field)).length;
810
+ return /* @__PURE__ */ I(ht, { children: [
811
811
  /* @__PURE__ */ h(
812
812
  "button",
813
813
  {
814
814
  ref: m,
815
815
  type: "button",
816
- className: U("rg-grid__tool-btn", u),
816
+ className: U("rg-grid__tool-btn", f),
817
817
  style: d,
818
818
  "aria-haspopup": "dialog",
819
819
  "aria-expanded": a,
@@ -821,57 +821,57 @@ function Si({ columns: t, hidden: n, onToggle: i, theme: o, className: u, style:
821
821
  children: "Columns"
822
822
  }
823
823
  ),
824
- /* @__PURE__ */ h(yn, { anchorRef: m, open: a, onClose: x, label: "Show or hide columns", theme: o, children: /* @__PURE__ */ h("div", { className: "rg-grid__filter-fields rg-grid__filter-options", role: "group", "aria-label": "Columns", children: t.filter((b) => b.hideable !== !1).map((b) => {
824
+ /* @__PURE__ */ h(kn, { anchorRef: m, open: a, onClose: x, label: "Show or hide columns", theme: o, children: /* @__PURE__ */ h("div", { className: "rg-grid__filter-fields rg-grid__filter-options", role: "group", "aria-label": "Columns", children: t.filter((b) => b.hideable !== !1).map((b) => {
825
825
  const v = !n.has(b.field);
826
826
  return /* @__PURE__ */ h(
827
- ht,
827
+ ft,
828
828
  {
829
829
  checked: v,
830
830
  disabled: v && E <= 1,
831
831
  onChange: (p) => i(b.field, !p),
832
- label: et(b)
832
+ label: nt(b)
833
833
  },
834
834
  b.field
835
835
  );
836
836
  }) }) })
837
837
  ] });
838
838
  }
839
- const Ni = /^[=+\-@\t\r]/;
840
- function Ci(t, n, i) {
839
+ const ji = /^[=+\-@\t\r]/;
840
+ function Ki(t, n, i) {
841
841
  if (t == null) return "";
842
842
  let o = String(t);
843
- return i && typeof t == "string" && Ni.test(o) && !Number.isFinite(Number(o)) && (o = `'${o}`), o.includes(n) || /["\r\n]/.test(o) ? `"${o.replace(/"/g, '""')}"` : o;
843
+ return i && typeof t == "string" && ji.test(o) && !Number.isFinite(Number(o)) && (o = `'${o}`), o.includes(n) || /["\r\n]/.test(o) ? `"${o.replace(/"/g, '""')}"` : o;
844
844
  }
845
- function Di(t, n, i = {}) {
846
- const { delimiter: o = ",", sanitize: u = !0 } = i, d = (a) => a.map((g) => Ci(g, o, u)).join(o);
845
+ function zi(t, n, i = {}) {
846
+ const { delimiter: o = ",", sanitize: f = !0 } = i, d = (a) => a.map((g) => Ki(g, o, f)).join(o);
847
847
  return [d(t), ...n.map(d)].join(`\r
848
848
  `);
849
849
  }
850
- function gn(t, n) {
850
+ function _n(t, n) {
851
851
  if (typeof document > "u") return;
852
852
  const i = URL.createObjectURL(t), o = document.createElement("a");
853
853
  o.href = i, o.download = n, o.style.display = "none", document.body.appendChild(o), o.click(), o.remove(), setTimeout(() => URL.revokeObjectURL(i), 1e3);
854
854
  }
855
- function Ti(t, n) {
856
- gn(new Blob(["\uFEFF", t], { type: "text/csv;charset=utf-8" }), n);
855
+ function qi(t, n) {
856
+ _n(new Blob(["\uFEFF", t], { type: "text/csv;charset=utf-8" }), n);
857
857
  }
858
- const fo = {
858
+ const _o = {
859
859
  csv: "CSV",
860
860
  xlsx: "Excel",
861
861
  json: "JSON",
862
862
  pdf: "PDF"
863
- }, Fi = { csv: ".csv", xlsx: ".xlsx", json: ".json", pdf: ".pdf" }, Ei = (t) => `Export ${fo[t]}`;
864
- function Ii({ formats: t, scopes: n, scope: i, onScopeChange: o, onExport: u, theme: d, className: a, style: g, popupClassName: m }) {
865
- const [x, E] = z(!1), [b, v] = z(null), p = j(null), k = Fe(() => E(!1), []), D = async (C) => {
866
- var T;
863
+ }, Yi = { csv: ".csv", xlsx: ".xlsx", json: ".json", pdf: ".pdf" }, Vi = (t) => `Export ${_o[t]}`;
864
+ function Hi({ formats: t, scopes: n, scope: i, onScopeChange: o, onExport: f, theme: d, className: a, style: g, popupClassName: m }) {
865
+ const [x, E] = j(!1), [b, v] = j(null), p = W(null), k = Te(() => E(!1), []), D = async (C) => {
866
+ var F;
867
867
  v(C);
868
868
  try {
869
- await u(C, i);
869
+ await f(C, i);
870
870
  } finally {
871
- v(null), E(!1), (T = p.current) == null || T.focus();
871
+ v(null), E(!1), (F = p.current) == null || F.focus();
872
872
  }
873
873
  };
874
- return /* @__PURE__ */ I(tt, { children: [
874
+ return /* @__PURE__ */ I(ht, { children: [
875
875
  /* @__PURE__ */ I(
876
876
  "button",
877
877
  {
@@ -888,12 +888,12 @@ function Ii({ formats: t, scopes: n, scope: i, onScopeChange: o, onExport: u, th
888
888
  ]
889
889
  }
890
890
  ),
891
- /* @__PURE__ */ h(yn, { anchorRef: p, open: x, onClose: k, label: "Export", theme: d, className: U("rg-export-popup", m), children: /* @__PURE__ */ I("div", { className: "rg-export", children: [
891
+ /* @__PURE__ */ h(kn, { anchorRef: p, open: x, onClose: k, label: "Export", theme: d, className: U("rg-export-popup", m), children: /* @__PURE__ */ I("div", { className: "rg-export", children: [
892
892
  n.length > 1 && /* @__PURE__ */ I("div", { className: "rg-export__group", role: "radiogroup", "aria-label": "Rows to export", children: [
893
893
  /* @__PURE__ */ h("div", { className: "rg-export__title", children: "Rows to export" }),
894
894
  n.map((C) => {
895
- const T = C.count === 0;
896
- return /* @__PURE__ */ I("label", { className: U("rg-export__scope", T && "rg-export__scope--disabled", C.value === i && "rg-export__scope--on"), children: [
895
+ const F = C.count === 0;
896
+ return /* @__PURE__ */ I("label", { className: U("rg-export__scope", F && "rg-export__scope--disabled", C.value === i && "rg-export__scope--on"), children: [
897
897
  /* @__PURE__ */ h(
898
898
  "input",
899
899
  {
@@ -901,7 +901,7 @@ function Ii({ formats: t, scopes: n, scope: i, onScopeChange: o, onExport: u, th
901
901
  name: "rg-export-scope",
902
902
  value: C.value,
903
903
  checked: C.value === i,
904
- disabled: T,
904
+ disabled: F,
905
905
  onChange: () => o(C.value)
906
906
  }
907
907
  ),
@@ -921,8 +921,8 @@ function Ii({ formats: t, scopes: n, scope: i, onScopeChange: o, onExport: u, th
921
921
  disabled: b !== null,
922
922
  onClick: () => D(C),
923
923
  children: [
924
- /* @__PURE__ */ h("span", { children: fo[C] }),
925
- /* @__PURE__ */ h("span", { className: "rg-export__ext", children: b === C ? "Preparing…" : Fi[C] })
924
+ /* @__PURE__ */ h("span", { children: _o[C] }),
925
+ /* @__PURE__ */ h("span", { className: "rg-export__ext", children: b === C ? "Preparing…" : Yi[C] })
926
926
  ]
927
927
  },
928
928
  C
@@ -931,8 +931,8 @@ function Ii({ formats: t, scopes: n, scope: i, onScopeChange: o, onExport: u, th
931
931
  ] }) })
932
932
  ] });
933
933
  }
934
- let we;
935
- function fe(t) {
934
+ let _e;
935
+ function he(t) {
936
936
  const n = (t ?? "").trim();
937
937
  if (!n || n === "transparent" || n === "none") return null;
938
938
  const i = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(n);
@@ -941,34 +941,34 @@ function fe(t) {
941
941
  return x.length === 3 && (x = x.split("").map((E) => E + E).join("")), [parseInt(x.slice(0, 2), 16), parseInt(x.slice(2, 4), 16), parseInt(x.slice(4, 6), 16)];
942
942
  }
943
943
  const o = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/i.exec(n);
944
- if (o) return Hr([Number(o[1]), Number(o[2]), Number(o[3])], Mi(o[4]));
945
- if (typeof document > "u" || (we === void 0 && (we = document.createElement("canvas").getContext("2d", { willReadFrequently: !0 })), !we)) return null;
946
- we.fillStyle = "#000000", we.fillStyle = n;
947
- const u = String(we.fillStyle);
948
- if (we.fillStyle = "#ffffff", we.fillStyle = n, u !== String(we.fillStyle)) return null;
949
- we.clearRect(0, 0, 1, 1), we.fillRect(0, 0, 1, 1);
950
- const [d, a, g, m] = we.getImageData(0, 0, 1, 1).data;
951
- return m === 0 ? null : Hr([d, a, g], m / 255);
944
+ if (o) return no([Number(o[1]), Number(o[2]), Number(o[3])], Xi(o[4]));
945
+ if (typeof document > "u" || (_e === void 0 && (_e = document.createElement("canvas").getContext("2d", { willReadFrequently: !0 })), !_e)) return null;
946
+ _e.fillStyle = "#000000", _e.fillStyle = n;
947
+ const f = String(_e.fillStyle);
948
+ if (_e.fillStyle = "#ffffff", _e.fillStyle = n, f !== String(_e.fillStyle)) return null;
949
+ _e.clearRect(0, 0, 1, 1), _e.fillRect(0, 0, 1, 1);
950
+ const [d, a, g, m] = _e.getImageData(0, 0, 1, 1).data;
951
+ return m === 0 ? null : no([d, a, g], m / 255);
952
952
  }
953
- const Mi = (t) => t === void 0 ? 1 : t.endsWith("%") ? parseFloat(t) / 100 : parseFloat(t);
954
- function Hr(t, n) {
953
+ const Xi = (t) => t === void 0 ? 1 : t.endsWith("%") ? parseFloat(t) / 100 : parseFloat(t);
954
+ function no(t, n) {
955
955
  if (!(n > 0)) return null;
956
956
  const i = Math.min(1, n);
957
957
  return t.map((o) => Math.round(Math.min(255, o) * i + 255 * (1 - i)));
958
958
  }
959
- const $i = ([t, n, i]) => (0.299 * t + 0.587 * n + 0.114 * i) / 255, An = (t) => $i(t) > 0.55 ? [31, 41, 55] : [243, 244, 246], Bn = 72 / 96, $t = "Install them with: npm install jspdf jspdf-autotable (and html2canvas for header / footer elements), then pass them in exportable.pdf.libraries.";
960
- async function Xr(t, n) {
959
+ const Gi = ([t, n, i]) => (0.299 * t + 0.587 * n + 0.114 * i) / 255, qn = (t) => Gi(t) > 0.55 ? [31, 41, 55] : [243, 244, 246], Yn = 72 / 96, Lt = "Install them with: npm install jspdf jspdf-autotable (and html2canvas for header / footer elements), then pass them in exportable.pdf.libraries.";
960
+ async function ro(t, n) {
961
961
  try {
962
962
  return await n();
963
963
  } catch (i) {
964
964
  const o = i instanceof Error ? i.message : String(i);
965
- throw new Error(`PDF export needs the package "${t}", which could not be loaded (${o}). ${$t}`);
965
+ throw new Error(`PDF export needs the package "${t}", which could not be loaded (${o}). ${Lt}`);
966
966
  }
967
967
  }
968
- function Gr(t, n, i) {
968
+ function oo(t, n, i) {
969
969
  return t.replace(/\{page\}/g, String(n)).replace(/\{pages\}/g, String(i)).replace(/\{date\}/g, (/* @__PURE__ */ new Date()).toLocaleDateString());
970
970
  }
971
- async function Pi(t) {
971
+ async function Ji(t) {
972
972
  const n = Array.from(t.querySelectorAll("img")).map(
973
973
  (i) => i.complete ? Promise.resolve() : new Promise((o) => {
974
974
  i.addEventListener("load", () => o(), { once: !0 }), i.addEventListener("error", () => o(), { once: !0 });
@@ -976,50 +976,50 @@ async function Pi(t) {
976
976
  );
977
977
  await Promise.race([Promise.all(n), new Promise((i) => setTimeout(i, 5e3))]);
978
978
  }
979
- async function Li(t, n, i, o, u) {
979
+ async function Zi(t, n, i, o, f) {
980
980
  const d = i.html2canvas;
981
981
  if (typeof d != "function")
982
- throw new Error(`A PDF header / footer element needs html2canvas. Add it to exportable.pdf.libraries. ${$t}`);
982
+ throw new Error(`A PDF header / footer element needs html2canvas. Add it to exportable.pdf.libraries. ${Lt}`);
983
983
  const [a, g] = await Promise.all([
984
- Xr("react-dom/client", () => import("./client-DUlru6F3.js").then((b) => b.c)),
985
- Xr("react-dom", () => import("react-dom"))
984
+ ro("react-dom/client", () => import("./client-DUlru6F3.js").then((b) => b.c)),
985
+ ro("react-dom", () => import("react-dom"))
986
986
  ]), m = 2, x = document.createElement("div");
987
- x.style.cssText = `position:fixed;left:-10000px;top:0;width:${Math.round(n / Bn)}px;background:${o};color:${u};font-family:system-ui,sans-serif;font-size:14px;`, document.body.appendChild(x);
987
+ x.style.cssText = `position:fixed;left:-10000px;top:0;width:${Math.round(n / Yn)}px;background:${o};color:${f};font-family:system-ui,sans-serif;font-size:14px;`, document.body.appendChild(x);
988
988
  const E = a.createRoot(x);
989
989
  try {
990
- g.flushSync(() => E.render(t)), await Pi(x), await new Promise((v) => requestAnimationFrame(() => v(void 0)));
990
+ g.flushSync(() => E.render(t)), await Ji(x), await new Promise((v) => requestAnimationFrame(() => v(void 0)));
991
991
  const b = await d(x, { scale: m, backgroundColor: o, useCORS: !0, logging: !1 });
992
- return { dataUrl: b.toDataURL("image/png"), width: b.width / m * Bn, height: b.height / m * Bn };
992
+ return { dataUrl: b.toDataURL("image/png"), width: b.width / m * Yn, height: b.height / m * Yn };
993
993
  } finally {
994
994
  E.unmount(), x.remove();
995
995
  }
996
996
  }
997
- async function Wn(t, n, i, o, u, d) {
997
+ async function Vn(t, n, i, o, f, d) {
998
998
  if (t == null || t === !1 || t === !0 || t === "") return null;
999
999
  if (typeof t == "string" || typeof t == "number") return { kind: "text", text: String(t) };
1000
- const a = await Li(t, n, o, u, d), g = Math.min(1, n / a.width, i / a.height);
1000
+ const a = await Zi(t, n, o, f, d), g = Math.min(1, n / a.width, i / a.height);
1001
1001
  return { kind: "image", dataUrl: a.dataUrl, width: a.width * g, height: a.height * g };
1002
1002
  }
1003
- const Jr = (t) => `rgb(${t[0]},${t[1]},${t[2]})`, Qr = ["normal", "bold", "italic", "bolditalic"];
1004
- function Zr(t, n) {
1003
+ const io = (t) => `rgb(${t[0]},${t[1]},${t[2]})`, lo = ["normal", "bold", "italic", "bolditalic"];
1004
+ function so(t, n) {
1005
1005
  return typeof t == "number" ? { top: t, right: t, bottom: t, left: t } : { top: (t == null ? void 0 : t.top) ?? n, right: (t == null ? void 0 : t.right) ?? n, bottom: (t == null ? void 0 : t.bottom) ?? n, left: (t == null ? void 0 : t.left) ?? n };
1006
1006
  }
1007
- function eo(t) {
1007
+ function ao(t) {
1008
1008
  return Object.fromEntries(Object.entries(t).filter(([, n]) => n !== void 0));
1009
1009
  }
1010
- async function Oi(t, n = {}, i = {}) {
1011
- var it, Me;
1010
+ async function Qi(t, n = {}, i = {}) {
1011
+ var it, lt;
1012
1012
  let o;
1013
1013
  try {
1014
1014
  o = typeof n.libraries == "function" ? await n.libraries() : n.libraries;
1015
- } catch (F) {
1016
- const Q = F instanceof Error ? F.message : String(F);
1017
- throw new Error(`PDF export could not load jspdf / jspdf-autotable (${Q}). ${$t}`);
1015
+ } catch (T) {
1016
+ const Z = T instanceof Error ? T.message : String(T);
1017
+ throw new Error(`PDF export could not load jspdf / jspdf-autotable (${Z}). ${Lt}`);
1018
1018
  }
1019
- if (!o) throw new Error(`PDF export needs the jspdf and jspdf-autotable libraries. ${$t}`);
1020
- const u = o.jsPDF, d = o.autoTable;
1021
- if (typeof u != "function" || typeof d != "function")
1022
- throw new Error(`exportable.pdf.libraries must contain jsPDF (a class) and autoTable (a function). ${$t}`);
1019
+ if (!o) throw new Error(`PDF export needs the jspdf and jspdf-autotable libraries. ${Lt}`);
1020
+ const f = o.jsPDF, d = o.autoTable;
1021
+ if (typeof f != "function" || typeof d != "function")
1022
+ throw new Error(`exportable.pdf.libraries must contain jsPDF (a class) and autoTable (a function). ${Lt}`);
1023
1023
  const {
1024
1024
  title: a,
1025
1025
  header: g,
@@ -1032,131 +1032,131 @@ async function Oi(t, n = {}, i = {}) {
1032
1032
  pageNumbers: k = !0,
1033
1033
  maxImageHeight: D = 90,
1034
1034
  beforeRender: C,
1035
- autoTableOptions: T
1035
+ autoTableOptions: F
1036
1036
  } = n, w = {
1037
1037
  ...i,
1038
- ...eo({
1038
+ ...ao({
1039
1039
  headColor: n.headColor,
1040
1040
  headTextColor: n.headTextColor,
1041
1041
  fontSize: n.fontSize,
1042
1042
  fontName: n.fontName,
1043
1043
  margin: n.margin
1044
1044
  }),
1045
- ...eo(n.style ?? {})
1046
- }, P = Zr(w.margin, 36), X = w.fontName ?? "helvetica", q = w.fontSize ?? 9, R = fe(w.pageBackground), H = R ? An(R) : [75, 85, 99], Se = fe(w.textColor) ?? H, Pe = fe(w.titleColor) ?? (R ? An(R) : [17, 24, 39]), ze = fe(w.headColor) ?? [79, 70, 229], Ee = fe(w.headTextColor) ?? [255, 255, 255], V = fe(w.bodyTextColor), ae = fe((it = w.stripeColors) == null ? void 0 : it[0]), Ie = fe((Me = w.stripeColors) == null ? void 0 : Me[1]), _ = fe(w.bodyColor) ?? ae ?? R ?? void 0, G = fe(w.borderColor), S = new u({
1045
+ ...ao(n.style ?? {})
1046
+ }, O = so(w.margin, 36), H = w.fontName ?? "helvetica", q = w.fontSize ?? 9, A = he(w.pageBackground), V = A ? qn(A) : [75, 85, 99], ke = he(w.textColor) ?? V, Le = he(w.titleColor) ?? (A ? qn(A) : [17, 24, 39]), ze = he(w.headColor) ?? [79, 70, 229], Fe = he(w.headTextColor) ?? [255, 255, 255], Y = he(w.bodyTextColor), se = he((it = w.stripeColors) == null ? void 0 : it[0]), Ee = he((lt = w.stripeColors) == null ? void 0 : lt[1]), _ = he(w.bodyColor) ?? se ?? A ?? void 0, G = he(w.borderColor), S = new f({
1047
1047
  orientation: b === "auto" ? t.headers.length > 6 ? "landscape" : "portrait" : b,
1048
1048
  unit: "pt",
1049
1049
  format: v
1050
1050
  });
1051
1051
  C && await C(S);
1052
- const B = S.internal.pageSize.getWidth(), ce = S.internal.pageSize.getHeight(), pe = B - P.left - P.right, qe = 10, nt = 12, Pt = /* @__PURE__ */ new Set(), pt = (F) => {
1053
- !R || Pt.has(F) || (Pt.add(F), S.setFillColor(...R), S.rect(0, 0, B, ce, "F"));
1052
+ const B = S.internal.pageSize.getWidth(), ce = S.internal.pageSize.getHeight(), ge = B - O.left - O.right, qe = 10, rt = 12, Ot = /* @__PURE__ */ new Set(), pt = (T) => {
1053
+ !A || Ot.has(T) || (Ot.add(T), S.setFillColor(...A), S.rect(0, 0, B, ce, "F"));
1054
1054
  };
1055
1055
  pt(1);
1056
- const Ye = R ? Jr(R) : "#ffffff", Ve = Jr(Se), de = await Wn(g, pe, D, o, Ye, Ve), ge = await Wn(m, pe, D, o, Ye, Ve);
1057
- S.setFont(X, "normal"), S.setFontSize(qe);
1058
- const gt = (F) => F ? F.kind === "image" ? F.height : S.splitTextToSize(Gr(F.text, 99, 99), pe).length * nt : 0, He = gt(de), mt = gt(ge), Le = Math.min(18, P.top), bt = ce - 14, yt = ce - (k ? 26 : 18), Lt = de ? Math.max(P.top, Le + He + 12) : P.top, xt = Math.max(P.bottom, ge ? ce - yt + mt + 10 : k ? 34 : 0);
1059
- let Xe = Lt;
1056
+ const Ye = A ? io(A) : "#ffffff", Ve = io(ke), de = await Vn(g, ge, D, o, Ye, Ve), me = await Vn(m, ge, D, o, Ye, Ve);
1057
+ S.setFont(H, "normal"), S.setFontSize(qe);
1058
+ const gt = (T) => T ? T.kind === "image" ? T.height : S.splitTextToSize(oo(T.text, 99, 99), ge).length * rt : 0, He = gt(de), mt = gt(me), Oe = Math.min(18, O.top), bt = ce - 14, yt = ce - (k ? 26 : 18), Rt = de ? Math.max(O.top, Oe + He + 12) : O.top, xt = Math.max(O.bottom, me ? ce - yt + mt + 10 : k ? 34 : 0);
1059
+ let Xe = Rt;
1060
1060
  if (a && typeof a != "string" && typeof a != "number" && typeof a != "boolean") {
1061
- const F = await Wn(a, pe, D, o, Ye, Ve);
1062
- F && F.kind === "image" && (S.addImage(F.dataUrl, "PNG", P.left, Xe, F.width, F.height), Xe += F.height + 12);
1063
- } else a && (S.setFont(X, "bold"), S.setFontSize(w.titleSize ?? 14), S.setTextColor(...Pe), S.text(String(a), P.left, Xe + (w.titleSize ?? 14)), Xe += (w.titleSize ?? 14) + 12);
1064
- const Ot = {};
1065
- t.fields.forEach((F, Q) => {
1066
- var st;
1067
- const L = (st = w.columns) == null ? void 0 : st[F], xe = {}, Y = (L == null ? void 0 : L.align) ?? t.aligns[Q];
1068
- Y && (xe.halign = Y), (L == null ? void 0 : L.width) !== void 0 && (xe.cellWidth = L.width);
1069
- const A = fe(L == null ? void 0 : L.textColor);
1070
- A && (xe.textColor = A);
1071
- const lt = fe(L == null ? void 0 : L.backgroundColor);
1072
- lt && (xe.fillColor = lt), L != null && L.fontStyle && Qr.includes(L.fontStyle) && (xe.fontStyle = L.fontStyle), L != null && L.fontSize && (xe.fontSize = L.fontSize), Object.keys(xe).length > 0 && (Ot[Q] = xe);
1061
+ const T = await Vn(a, ge, D, o, Ye, Ve);
1062
+ T && T.kind === "image" && (S.addImage(T.dataUrl, "PNG", O.left, Xe, T.width, T.height), Xe += T.height + 12);
1063
+ } else a && (S.setFont(H, "bold"), S.setFontSize(w.titleSize ?? 14), S.setTextColor(...Le), S.text(String(a), O.left, Xe + (w.titleSize ?? 14)), Xe += (w.titleSize ?? 14) + 12);
1064
+ const Ut = {};
1065
+ t.fields.forEach((T, Z) => {
1066
+ var Wt;
1067
+ const P = (Wt = w.columns) == null ? void 0 : Wt[T], ae = {}, Je = (P == null ? void 0 : P.align) ?? t.aligns[Z];
1068
+ Je && (ae.halign = Je), (P == null ? void 0 : P.width) !== void 0 && (ae.cellWidth = P.width);
1069
+ const Re = he(P == null ? void 0 : P.textColor);
1070
+ Re && (ae.textColor = Re);
1071
+ const At = he(P == null ? void 0 : P.backgroundColor);
1072
+ At && (ae.fillColor = At), P != null && P.fontStyle && lo.includes(P.fontStyle) && (ae.fontStyle = P.fontStyle), P != null && P.fontSize && (ae.fontSize = P.fontSize), Object.keys(ae).length > 0 && (Ut[Z] = ae);
1073
1073
  });
1074
- const ye = {
1075
- font: X,
1074
+ const Ie = {
1075
+ font: H,
1076
1076
  fontSize: q,
1077
- cellPadding: Zr(w.cellPadding, 4),
1077
+ cellPadding: so(w.cellPadding, 4),
1078
1078
  overflow: "linebreak",
1079
1079
  valign: "middle"
1080
1080
  };
1081
- V ? ye.textColor = V : R && (ye.textColor = An(R)), G && (ye.lineColor = G), w.borderWidth !== void 0 ? ye.lineWidth = w.borderWidth : G && (ye.lineWidth = 0.5), w.minRowHeight && (ye.minCellHeight = w.minRowHeight);
1082
- const Ce = {
1081
+ Y ? Ie.textColor = Y : A && (Ie.textColor = qn(A)), G && (Ie.lineColor = G), w.borderWidth !== void 0 ? Ie.lineWidth = w.borderWidth : G && (Ie.lineWidth = 0.5), w.minRowHeight && (Ie.minCellHeight = w.minRowHeight);
1082
+ const Se = {
1083
1083
  head: [t.headers],
1084
1084
  body: t.rows,
1085
1085
  startY: Xe,
1086
- margin: { top: Lt, right: P.right, bottom: xt, left: P.left },
1086
+ margin: { top: Rt, right: O.right, bottom: xt, left: O.left },
1087
1087
  theme: p,
1088
1088
  showHead: "everyPage",
1089
- styles: ye,
1089
+ styles: Ie,
1090
1090
  headStyles: {
1091
1091
  fillColor: ze,
1092
- textColor: Ee,
1093
- fontStyle: w.headFontStyle && Qr.includes(w.headFontStyle) ? w.headFontStyle : "bold",
1092
+ textColor: Fe,
1093
+ fontStyle: w.headFontStyle && lo.includes(w.headFontStyle) ? w.headFontStyle : "bold",
1094
1094
  ...w.headFontSize ? { fontSize: w.headFontSize } : null
1095
1095
  },
1096
- columnStyles: Ot,
1096
+ columnStyles: Ut,
1097
1097
  // A new page starts blank: paint its background before the table draws on it
1098
1098
  willDrawPage: () => {
1099
- var Q, L;
1100
- const F = typeof S.getCurrentPageInfo == "function" ? S.getCurrentPageInfo() : (L = (Q = S.internal).getCurrentPageInfo) == null ? void 0 : L.call(Q);
1101
- F != null && F.pageNumber && pt(F.pageNumber);
1099
+ var Z, P;
1100
+ const T = typeof S.getCurrentPageInfo == "function" ? S.getCurrentPageInfo() : (P = (Z = S.internal).getCurrentPageInfo) == null ? void 0 : P.call(Z);
1101
+ T != null && T.pageNumber && pt(T.pageNumber);
1102
1102
  }
1103
1103
  };
1104
- _ && (Ce.bodyStyles = { fillColor: _ }), ae && Ie ? (Ce.bodyStyles = { fillColor: ae }, Ce.alternateRowStyles = { fillColor: Ie }) : (ae || _) && (Ce.alternateRowStyles = { fillColor: _ });
1105
- const Rt = { ...Ce, ...T };
1106
- for (const F of ["styles", "headStyles", "bodyStyles", "alternateRowStyles", "margin"]) {
1107
- const Q = Ce[F], L = T == null ? void 0 : T[F];
1108
- Q && L && typeof L == "object" && (Rt[F] = { ...Q, ...L });
1104
+ _ && (Se.bodyStyles = { fillColor: _ }), se && Ee ? (Se.bodyStyles = { fillColor: se }, Se.alternateRowStyles = { fillColor: Ee }) : (se || _) && (Se.alternateRowStyles = { fillColor: _ });
1105
+ const ot = { ...Se, ...F };
1106
+ for (const T of ["styles", "headStyles", "bodyStyles", "alternateRowStyles", "margin"]) {
1107
+ const Z = Se[T], P = F == null ? void 0 : F[T];
1108
+ Z && P && typeof P == "object" && (ot[T] = { ...Z, ...P });
1109
1109
  }
1110
- d(S, Rt);
1111
- const re = typeof S.getNumberOfPages == "function" ? S.getNumberOfPages() : S.internal.getNumberOfPages(), rt = (F, Q) => F === "center" ? (B - Q) / 2 : F === "right" ? B - P.right - Q : P.left, ot = (F, Q, L, xe) => {
1112
- if (!F) return;
1113
- if (F.kind === "image") {
1114
- S.addImage(F.dataUrl, "PNG", rt(L, F.width), Q, F.width, F.height);
1110
+ d(S, ot);
1111
+ const _t = typeof S.getNumberOfPages == "function" ? S.getNumberOfPages() : S.internal.getNumberOfPages(), ue = (T, Z) => T === "center" ? (B - Z) / 2 : T === "right" ? B - O.right - Z : O.left, Ge = (T, Z, P, ae) => {
1112
+ if (!T) return;
1113
+ if (T.kind === "image") {
1114
+ S.addImage(T.dataUrl, "PNG", ue(P, T.width), Z, T.width, T.height);
1115
1115
  return;
1116
1116
  }
1117
- S.setFont(X, "normal"), S.setFontSize(qe), S.setTextColor(...Se);
1118
- const Y = S.splitTextToSize(Gr(F.text, xe, re), pe), A = L === "center" ? B / 2 : L === "right" ? B - P.right : P.left;
1119
- S.text(Y, A, Q + qe, { align: L });
1117
+ S.setFont(H, "normal"), S.setFontSize(qe), S.setTextColor(...ke);
1118
+ const Je = S.splitTextToSize(oo(T.text, ae, _t), ge), Re = P === "center" ? B / 2 : P === "right" ? B - O.right : O.left;
1119
+ S.text(Je, Re, Z + qe, { align: P });
1120
1120
  };
1121
- for (let F = 1; F <= re; F++)
1122
- S.setPage(F), ot(de, Le, x, F), ot(ge, yt - mt, E, F), k && (S.setFont(X, "normal"), S.setFontSize(8), S.setTextColor(...Se), S.text(`Page ${F} of ${re}`, B - P.right, bt, { align: "right" }));
1121
+ for (let T = 1; T <= _t; T++)
1122
+ S.setPage(T), Ge(de, Oe, x, T), Ge(me, yt - mt, E, T), k && (S.setFont(H, "normal"), S.setFontSize(8), S.setTextColor(...ke), S.text(`Page ${T} of ${_t}`, B - O.right, bt, { align: "right" }));
1123
1123
  return S.output("blob");
1124
1124
  }
1125
- function Ri(t) {
1125
+ function el(t) {
1126
1126
  var E;
1127
1127
  if (!t || typeof getComputedStyle > "u") return {};
1128
1128
  const n = {}, i = (b) => b ? getComputedStyle(b) : null, o = (b) => {
1129
1129
  var v;
1130
1130
  for (let p = b; p; p = p.parentElement) {
1131
1131
  const k = (v = i(p)) == null ? void 0 : v.backgroundColor;
1132
- if (k && fe(k)) return k;
1132
+ if (k && he(k)) return k;
1133
1133
  }
1134
- }, u = (b) => {
1135
- const v = fe(b);
1134
+ }, f = (b) => {
1135
+ const v = he(b);
1136
1136
  return v ? "#" + v.map((p) => p.toString(16).padStart(2, "0")).join("") : void 0;
1137
1137
  }, d = (b) => b ? Math.round(parseFloat(b) * 0.75 * 10) / 10 : void 0, a = t.querySelector("thead th");
1138
1138
  if (a) {
1139
1139
  const b = i(a);
1140
- n.headColor = u(o(a)), n.headTextColor = u(b.color), n.headFontStyle = parseInt(b.fontWeight, 10) >= 600 ? "bold" : "normal";
1140
+ n.headColor = f(o(a)), n.headTextColor = f(b.color), n.headFontStyle = parseInt(b.fontWeight, 10) >= 600 ? "bold" : "normal";
1141
1141
  }
1142
1142
  const g = Array.from(t.querySelectorAll("tbody tr.rg-grid__row:not(.rg-grid__row--exit)")).slice(0, 2), m = (E = g[0]) == null ? void 0 : E.querySelector("td");
1143
1143
  if (m) {
1144
1144
  const b = i(m);
1145
- n.bodyTextColor = u(b.color);
1145
+ n.bodyTextColor = f(b.color);
1146
1146
  const v = d(b.fontSize);
1147
1147
  v && !Number.isNaN(v) && (n.fontSize = Math.min(14, Math.max(6, v)));
1148
- const p = u(o(g[0].querySelector("td"))), k = u(g[1] ? o(g[1].querySelector("td")) : void 0);
1148
+ const p = f(o(g[0].querySelector("td"))), k = f(g[1] ? o(g[1].querySelector("td")) : void 0);
1149
1149
  n.bodyColor = p, p && k && p !== k && (n.stripeColors = [p, k]);
1150
1150
  const D = i(m);
1151
- parseFloat(D.borderBottomWidth) > 0 && D.borderBottomStyle !== "none" && (n.borderColor = u(D.borderBottomColor), n.borderWidth = 0.5);
1151
+ parseFloat(D.borderBottomWidth) > 0 && D.borderBottomStyle !== "none" && (n.borderColor = f(D.borderBottomColor), n.borderWidth = 0.5);
1152
1152
  }
1153
- const x = u(o(t));
1154
- return x && x !== "#ffffff" && (n.pageBackground = x), n.textColor = u(i(t).color), n.fontName = void 0, Object.keys(n).forEach((b) => n[b] === void 0 && delete n[b]), n;
1153
+ const x = f(o(t));
1154
+ return x && x !== "#ffffff" && (n.pageBackground = x), n.textColor = f(i(t).color), n.fontName = void 0, Object.keys(n).forEach((b) => n[b] === void 0 && delete n[b]), n;
1155
1155
  }
1156
- const Ui = { none: 0, asc: 0, desc: 180 };
1157
- function Ai({ direction: t, size: n = 14, priority: i, className: o, style: u }) {
1158
- const d = j(0), g = ((Ui[t ?? "none"] - d.current) % 360 + 360) % 360;
1159
- return d.current += g, /* @__PURE__ */ I("span", { className: U("rg-sort-arrow", t && "rg-sort-arrow--active", o), style: u, "data-direction": t ?? "none", children: [
1156
+ const wo = { none: 0, asc: 0, desc: 180 };
1157
+ function tl({ direction: t, size: n = 14, priority: i, className: o, style: f }) {
1158
+ const d = W(0), g = ((wo[t ?? "none"] - d.current) % 360 + 360) % 360;
1159
+ return d.current += g, /* @__PURE__ */ I("span", { className: U("rg-sort-arrow", t && "rg-sort-arrow--active", o), style: f, "data-direction": t ?? "none", children: [
1160
1160
  /* @__PURE__ */ I(
1161
1161
  "svg",
1162
1162
  {
@@ -1181,22 +1181,26 @@ function Ai({ direction: t, size: n = 14, priority: i, className: o, style: u })
1181
1181
  t && i !== void 0 && /* @__PURE__ */ h("sup", { className: "rg-sort-arrow__order", children: i })
1182
1182
  ] });
1183
1183
  }
1184
- const ho = new TextEncoder();
1185
- let hn = null;
1186
- function Bi(t) {
1187
- if (!hn) {
1188
- hn = new Uint32Array(256);
1184
+ function nl({ direction: t, children: n }) {
1185
+ const i = W(0), o = ((wo[t ?? "none"] - i.current) % 360 + 360) % 360;
1186
+ return i.current += o, /* @__PURE__ */ h("span", { className: "rg-sort-turn", style: { transform: `rotate(${i.current}deg)` }, children: n });
1187
+ }
1188
+ const vo = new TextEncoder();
1189
+ let xn = null;
1190
+ function rl(t) {
1191
+ if (!xn) {
1192
+ xn = new Uint32Array(256);
1189
1193
  for (let i = 0; i < 256; i++) {
1190
1194
  let o = i;
1191
- for (let u = 0; u < 8; u++) o = o & 1 ? 3988292384 ^ o >>> 1 : o >>> 1;
1192
- hn[i] = o >>> 0;
1195
+ for (let f = 0; f < 8; f++) o = o & 1 ? 3988292384 ^ o >>> 1 : o >>> 1;
1196
+ xn[i] = o >>> 0;
1193
1197
  }
1194
1198
  }
1195
1199
  let n = 4294967295;
1196
- for (let i = 0; i < t.length; i++) n = hn[(n ^ t[i]) & 255] ^ n >>> 8;
1200
+ for (let i = 0; i < t.length; i++) n = xn[(n ^ t[i]) & 255] ^ n >>> 8;
1197
1201
  return (n ^ 4294967295) >>> 0;
1198
1202
  }
1199
- async function Wi(t) {
1203
+ async function ol(t) {
1200
1204
  const n = globalThis.CompressionStream;
1201
1205
  if (typeof n > "u") return null;
1202
1206
  try {
@@ -1206,27 +1210,27 @@ async function Wi(t) {
1206
1210
  return null;
1207
1211
  }
1208
1212
  }
1209
- async function ji(t) {
1210
- const n = /* @__PURE__ */ new Date(), i = n.getHours() << 11 | n.getMinutes() << 5 | n.getSeconds() >> 1, o = n.getFullYear() - 1980 << 9 | n.getMonth() + 1 << 5 | n.getDate(), u = [], d = [];
1213
+ async function il(t) {
1214
+ const n = /* @__PURE__ */ new Date(), i = n.getHours() << 11 | n.getMinutes() << 5 | n.getSeconds() >> 1, o = n.getFullYear() - 1980 << 9 | n.getMonth() + 1 << 5 | n.getDate(), f = [], d = [];
1211
1215
  let a = 0;
1212
1216
  for (const p of t) {
1213
- const k = ho.encode(p.name), D = Bi(p.data), C = await Wi(p.data), T = C !== null && C.length < p.data.length, w = T ? C : p.data, P = T ? 8 : 0, X = new Uint8Array(30 + k.length), q = new DataView(X.buffer);
1214
- q.setUint32(0, 67324752, !0), q.setUint16(4, 20, !0), q.setUint16(6, 2048, !0), q.setUint16(8, P, !0), q.setUint16(10, i, !0), q.setUint16(12, o, !0), q.setUint32(14, D, !0), q.setUint32(18, w.length, !0), q.setUint32(22, p.data.length, !0), q.setUint16(26, k.length, !0), q.setUint16(28, 0, !0), X.set(k, 30);
1215
- const R = new Uint8Array(46 + k.length), H = new DataView(R.buffer);
1216
- H.setUint32(0, 33639248, !0), H.setUint16(4, 20, !0), H.setUint16(6, 20, !0), H.setUint16(8, 2048, !0), H.setUint16(10, P, !0), H.setUint16(12, i, !0), H.setUint16(14, o, !0), H.setUint32(16, D, !0), H.setUint32(20, w.length, !0), H.setUint32(24, p.data.length, !0), H.setUint16(28, k.length, !0), H.setUint32(42, a, !0), R.set(k, 46), u.push(X, w), d.push(R), a += X.length + w.length;
1217
+ const k = vo.encode(p.name), D = rl(p.data), C = await ol(p.data), F = C !== null && C.length < p.data.length, w = F ? C : p.data, O = F ? 8 : 0, H = new Uint8Array(30 + k.length), q = new DataView(H.buffer);
1218
+ q.setUint32(0, 67324752, !0), q.setUint16(4, 20, !0), q.setUint16(6, 2048, !0), q.setUint16(8, O, !0), q.setUint16(10, i, !0), q.setUint16(12, o, !0), q.setUint32(14, D, !0), q.setUint32(18, w.length, !0), q.setUint32(22, p.data.length, !0), q.setUint16(26, k.length, !0), q.setUint16(28, 0, !0), H.set(k, 30);
1219
+ const A = new Uint8Array(46 + k.length), V = new DataView(A.buffer);
1220
+ V.setUint32(0, 33639248, !0), V.setUint16(4, 20, !0), V.setUint16(6, 20, !0), V.setUint16(8, 2048, !0), V.setUint16(10, O, !0), V.setUint16(12, i, !0), V.setUint16(14, o, !0), V.setUint32(16, D, !0), V.setUint32(20, w.length, !0), V.setUint32(24, p.data.length, !0), V.setUint16(28, k.length, !0), V.setUint32(42, a, !0), A.set(k, 46), f.push(H, w), d.push(A), a += H.length + w.length;
1217
1221
  }
1218
1222
  const g = d.reduce((p, k) => p + k.length, 0), m = new Uint8Array(22), x = new DataView(m.buffer);
1219
1223
  x.setUint32(0, 101010256, !0), x.setUint16(8, t.length, !0), x.setUint16(10, t.length, !0), x.setUint32(12, g, !0), x.setUint32(16, a, !0);
1220
- const E = [...u, ...d, m], b = new Uint8Array(E.reduce((p, k) => p + k.length, 0));
1224
+ const E = [...f, ...d, m], b = new Uint8Array(E.reduce((p, k) => p + k.length, 0));
1221
1225
  let v = 0;
1222
1226
  for (const p of E)
1223
1227
  b.set(p, v), v += p.length;
1224
1228
  return b;
1225
1229
  }
1226
- function bn(t) {
1230
+ function vn(t) {
1227
1231
  return t.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F￾￿]/g, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1228
1232
  }
1229
- function mn(t) {
1233
+ function wn(t) {
1230
1234
  let n = t + 1, i = "";
1231
1235
  for (; n > 0; ) {
1232
1236
  const o = (n - 1) % 26;
@@ -1234,16 +1238,16 @@ function mn(t) {
1234
1238
  }
1235
1239
  return i;
1236
1240
  }
1237
- function Ki(t) {
1241
+ function ll(t) {
1238
1242
  const n = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t);
1239
1243
  if (!n) return null;
1240
- const [i, o, u] = [Number(n[1]), Number(n[2]), Number(n[3])], d = new Date(Date.UTC(i, o - 1, u));
1241
- return d.getUTCFullYear() !== i || d.getUTCMonth() !== o - 1 || d.getUTCDate() !== u ? null : Math.round((d.getTime() - Date.UTC(1899, 11, 30)) / 864e5);
1244
+ const [i, o, f] = [Number(n[1]), Number(n[2]), Number(n[3])], d = new Date(Date.UTC(i, o - 1, f));
1245
+ return d.getUTCFullYear() !== i || d.getUTCMonth() !== o - 1 || d.getUTCDate() !== f ? null : Math.round((d.getTime() - Date.UTC(1899, 11, 30)) / 864e5);
1242
1246
  }
1243
- function zi(t) {
1247
+ function sl(t) {
1244
1248
  return (t ?? "").replace(/[\[\]:*?/\\]/g, " ").trim().slice(0, 31) || "Sheet1";
1245
1249
  }
1246
- const qi = 1, Yi = 2, Vi = 3, Hi = 4, Xi = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1250
+ const al = 1, cl = 2, dl = 3, ul = 4, fl = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1247
1251
  <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
1248
1252
  <numFmts count="1"><numFmt numFmtId="164" formatCode="yyyy\\-mm\\-dd"/></numFmts>
1249
1253
  <fonts count="2"><font><sz val="11"/><name val="Calibri"/></font><font><b/><sz val="11"/><color rgb="FFFFFFFF"/><name val="Calibri"/></font></fonts>
@@ -1259,108 +1263,108 @@ const qi = 1, Yi = 2, Vi = 3, Hi = 4, Xi = `<?xml version="1.0" encoding="UTF-8"
1259
1263
  </cellXfs>
1260
1264
  <cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>
1261
1265
  </styleSheet>`;
1262
- function Gi(t, n, i) {
1266
+ function hl(t, n, i) {
1263
1267
  if (n == null || n === "") return "";
1264
- const o = i.align === "right" ? Vi : i.align === "center" ? Hi : 0;
1268
+ const o = i.align === "right" ? dl : i.align === "center" ? ul : 0;
1265
1269
  if (typeof n == "boolean") return `<c r="${t}" t="b"${o ? ` s="${o}"` : ""}><v>${n ? 1 : 0}</v></c>`;
1266
1270
  if (typeof n == "number")
1267
1271
  return Number.isFinite(n) ? `<c r="${t}"${o ? ` s="${o}"` : ""}><v>${n}</v></c>` : "";
1268
1272
  if (i.kind === "date") {
1269
- const d = Ki(n);
1270
- if (d !== null) return `<c r="${t}" s="${Yi}"><v>${d}</v></c>`;
1273
+ const d = ll(n);
1274
+ if (d !== null) return `<c r="${t}" s="${cl}"><v>${d}</v></c>`;
1271
1275
  }
1272
1276
  if (i.kind === "number" && n.trim() !== "" && Number.isFinite(Number(n)))
1273
1277
  return `<c r="${t}"${o ? ` s="${o}"` : ""}><v>${Number(n)}</v></c>`;
1274
- const u = bn(n.slice(0, 32767));
1275
- return `<c r="${t}" t="inlineStr"${o ? ` s="${o}"` : ""}><is><t xml:space="preserve">${u}</t></is></c>`;
1278
+ const f = vn(n.slice(0, 32767));
1279
+ return `<c r="${t}" t="inlineStr"${o ? ` s="${o}"` : ""}><is><t xml:space="preserve">${f}</t></is></c>`;
1276
1280
  }
1277
- const to = (t) => t == null ? 0 : typeof t == "boolean" ? 5 : String(t).length;
1278
- function Ji(t, n) {
1279
- const i = mn(Math.max(0, t.length - 1)), o = n.length + 1, u = t.map((a, g) => {
1280
- let m = to(a.header) + 3;
1281
- for (let x = 0; x < Math.min(n.length, 500); x++) m = Math.max(m, a.kind === "date" ? 11 : to(n[x][g]));
1281
+ const co = (t) => t == null ? 0 : typeof t == "boolean" ? 5 : String(t).length;
1282
+ function pl(t, n) {
1283
+ const i = wn(Math.max(0, t.length - 1)), o = n.length + 1, f = t.map((a, g) => {
1284
+ let m = co(a.header) + 3;
1285
+ for (let x = 0; x < Math.min(n.length, 500); x++) m = Math.max(m, a.kind === "date" ? 11 : co(n[x][g]));
1282
1286
  return Math.min(60, Math.max(8, m + 2));
1283
1287
  }), d = [];
1284
- return d.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'), d.push('<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">'), d.push(`<dimension ref="A1:${i}${o}"/>`), d.push('<sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft"/></sheetView></sheetViews>'), d.push('<sheetFormatPr defaultRowHeight="15"/>'), d.push("<cols>" + u.map((a, g) => `<col min="${g + 1}" max="${g + 1}" width="${a}" customWidth="1"/>`).join("") + "</cols>"), d.push("<sheetData>"), d.push(
1285
- '<row r="1" ht="22" customHeight="1">' + t.map((a, g) => `<c r="${mn(g)}1" s="${qi}" t="inlineStr"><is><t xml:space="preserve">${bn(a.header)}</t></is></c>`).join("") + "</row>"
1288
+ return d.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'), d.push('<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">'), d.push(`<dimension ref="A1:${i}${o}"/>`), d.push('<sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><selection pane="bottomLeft"/></sheetView></sheetViews>'), d.push('<sheetFormatPr defaultRowHeight="15"/>'), d.push("<cols>" + f.map((a, g) => `<col min="${g + 1}" max="${g + 1}" width="${a}" customWidth="1"/>`).join("") + "</cols>"), d.push("<sheetData>"), d.push(
1289
+ '<row r="1" ht="22" customHeight="1">' + t.map((a, g) => `<c r="${wn(g)}1" s="${al}" t="inlineStr"><is><t xml:space="preserve">${vn(a.header)}</t></is></c>`).join("") + "</row>"
1286
1290
  ), n.forEach((a, g) => {
1287
- const m = g + 2, x = t.map((E, b) => Gi(`${mn(b)}${m}`, a[b], E)).join("");
1291
+ const m = g + 2, x = t.map((E, b) => hl(`${wn(b)}${m}`, a[b], E)).join("");
1288
1292
  d.push(`<row r="${m}">${x}</row>`);
1289
1293
  }), d.push("</sheetData>"), d.push(`<autoFilter ref="A1:${i}${o}"/>`), d.push("</worksheet>"), d.join("");
1290
1294
  }
1291
- async function Qi(t, n, i = {}) {
1292
- const o = zi(i.sheetName), u = `'${o.replace(/'/g, "''")}'`, d = mn(Math.max(0, t.length - 1)), a = {
1295
+ async function gl(t, n, i = {}) {
1296
+ const o = sl(i.sheetName), f = `'${o.replace(/'/g, "''")}'`, d = wn(Math.max(0, t.length - 1)), a = {
1293
1297
  "[Content_Types].xml": `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1294
1298
  <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>`,
1295
1299
  "_rels/.rels": `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1296
1300
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>`,
1297
1301
  "xl/workbook.xml": `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1298
- <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${bn(o)}" sheetId="1" r:id="rId1"/></sheets><definedNames><definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">${bn(u)}!$A$1:$${d}$${n.length + 1}</definedName></definedNames></workbook>`,
1302
+ <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${vn(o)}" sheetId="1" r:id="rId1"/></sheets><definedNames><definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">${vn(f)}!$A$1:$${d}$${n.length + 1}</definedName></definedNames></workbook>`,
1299
1303
  "xl/_rels/workbook.xml.rels": `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1300
1304
  <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>`,
1301
- "xl/styles.xml": Xi,
1302
- "xl/worksheets/sheet1.xml": Ji(t, n)
1303
- }, g = await ji(Object.entries(a).map(([m, x]) => ({ name: m, data: ho.encode(x) })));
1305
+ "xl/styles.xml": fl,
1306
+ "xl/worksheets/sheet1.xml": pl(t, n)
1307
+ }, g = await il(Object.entries(a).map(([m, x]) => ({ name: m, data: vo.encode(x) })));
1304
1308
  return new Blob([g], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
1305
1309
  }
1306
- const Kn = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), po = (t, n) => Object.prototype.hasOwnProperty.call(t, n);
1307
- function ve(t, n) {
1310
+ const Xn = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), ko = (t, n) => Object.prototype.hasOwnProperty.call(t, n);
1311
+ function we(t, n) {
1308
1312
  if (t === null || typeof t != "object") return;
1309
- if (po(t, n)) return t[n];
1313
+ if (ko(t, n)) return t[n];
1310
1314
  let i = t;
1311
1315
  for (const o of n.split(".")) {
1312
- if (i == null || typeof i != "object" || Kn.has(o)) return;
1316
+ if (i == null || typeof i != "object" || Xn.has(o)) return;
1313
1317
  i = i[o];
1314
1318
  }
1315
1319
  return i;
1316
1320
  }
1317
- function no(t, n, i) {
1321
+ function uo(t, n, i) {
1318
1322
  if (Array.isArray(t)) {
1319
1323
  const o = [...t];
1320
1324
  return o[n] = i, o;
1321
1325
  }
1322
1326
  return { ...t, [n]: i };
1323
1327
  }
1324
- function zn(t, n, i) {
1328
+ function Gn(t, n, i) {
1325
1329
  const o = t ?? {};
1326
- if (po(o, n) || !n.includes("."))
1327
- return Kn.has(n) ? t : no(o, n, i);
1328
- const [u, ...d] = n.split(".");
1329
- if (Kn.has(u)) return t;
1330
- const a = o[u];
1331
- return no(o, u, zn(a !== null && typeof a == "object" ? a : {}, d.join("."), i));
1330
+ if (ko(o, n) || !n.includes("."))
1331
+ return Xn.has(n) ? t : uo(o, n, i);
1332
+ const [f, ...d] = n.split(".");
1333
+ if (Xn.has(f)) return t;
1334
+ const a = o[f];
1335
+ return uo(o, f, Gn(a !== null && typeof a == "object" ? a : {}, d.join("."), i));
1332
1336
  }
1333
- function ro(t, n) {
1337
+ function fo(t, n) {
1334
1338
  if (n.length === 0) return t.map((a, g) => ({ kind: "row", entry: a, i: g }));
1335
1339
  const i = /* @__PURE__ */ new Map();
1336
1340
  for (const a of n) i.set(a.afterId, [...i.get(a.afterId) ?? [], a]);
1337
- const o = [], u = /* @__PURE__ */ new Set(), d = (a) => {
1341
+ const o = [], f = /* @__PURE__ */ new Set(), d = (a) => {
1338
1342
  for (const g of i.get(a) ?? [])
1339
- u.has(g.id) || (u.add(g.id), o.push({ kind: "ghost", ghost: g }), d(g.id));
1343
+ f.has(g.id) || (f.add(g.id), o.push({ kind: "ghost", ghost: g }), d(g.id));
1340
1344
  };
1341
1345
  return d(null), t.forEach((a, g) => {
1342
1346
  o.push({ kind: "row", entry: a, i: g }), d(a.id);
1343
- }), n.forEach((a) => !u.has(a.id) && o.push({ kind: "ghost", ghost: a })), o;
1347
+ }), n.forEach((a) => !f.has(a.id) && o.push({ kind: "ghost", ghost: a })), o;
1344
1348
  }
1345
- const Zi = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, je = 38, el = 150, oo = 10, jn = (t, n) => `${typeof t}:${t}\0${n}`;
1346
- function It(t, n) {
1347
- const i = ve(n, t.field);
1348
- return t.valueFormatter ? t.valueFormatter(i, n) : t.type === "boolean" && typeof i == "boolean" ? i ? "Yes" : "No" : t.type === "date" ? fi(i, t.dateLocale, t.dateFormat) : i == null ? "" : i instanceof Date ? i.toLocaleDateString() : String(i);
1349
+ const ml = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, $e = 38, bl = 150, ho = 10, Hn = (t, n) => `${typeof t}:${t}\0${n}`;
1350
+ function Mt(t, n) {
1351
+ const i = we(n, t.field);
1352
+ return t.valueFormatter ? t.valueFormatter(i, n) : t.type === "boolean" && typeof i == "boolean" ? i ? "Yes" : "No" : t.type === "date" ? Fi(i, t.dateLocale, t.dateFormat) : i == null ? "" : i instanceof Date ? i.toLocaleDateString() : String(i);
1349
1353
  }
1350
- function tl(t, n, i) {
1354
+ function yl(t, n, i) {
1351
1355
  if (i.type === "date") {
1352
- const o = he(t) ?? "", u = he(n) ?? "";
1353
- return o < u ? -1 : o > u ? 1 : 0;
1356
+ const o = pe(t) ?? "", f = pe(n) ?? "";
1357
+ return o < f ? -1 : o > f ? 1 : 0;
1354
1358
  }
1355
1359
  return typeof t == "number" && typeof n == "number" ? t - n : t instanceof Date && n instanceof Date ? t.getTime() - n.getTime() : typeof t == "boolean" && typeof n == "boolean" ? Number(t) - Number(n) : String(t).localeCompare(String(n), void 0, { numeric: !0, sensitivity: "base" });
1356
1360
  }
1357
- const nl = (t) => t ? Array.isArray(t) ? t : [t] : [], io = (t) => t.type === "date" && t.validity.badInput;
1358
- function sl({
1361
+ const xl = (t) => t ? Array.isArray(t) ? t : [t] : [], po = (t) => t.type === "date" && t.validity.badInput;
1362
+ function Sl({
1359
1363
  columns: t,
1360
1364
  rows: n,
1361
1365
  getRowId: i,
1362
1366
  editable: o = !1,
1363
- enterMovesDown: u = !0,
1367
+ enterMovesDown: f = !0,
1364
1368
  onCellEdit: d,
1365
1369
  onRowsChange: a,
1366
1370
  rowSelection: g = !1,
@@ -1373,307 +1377,312 @@ function sl({
1373
1377
  onSortChange: k,
1374
1378
  multiSort: D = !1,
1375
1379
  searchable: C = !1,
1376
- searchPlaceholder: T = "Search…",
1380
+ searchPlaceholder: F = "Search…",
1377
1381
  search: w,
1378
- onSearchChange: P,
1379
- filters: X,
1382
+ onSearchChange: O,
1383
+ filters: H,
1380
1384
  onFiltersChange: q,
1381
- pagination: R = !1,
1382
- paginationPosition: H = "bottom",
1383
- showToolbar: Se = !0,
1384
- showFooter: Pe = !0,
1385
+ pagination: A = !1,
1386
+ paginationPosition: V = "bottom",
1387
+ showToolbar: ke = !0,
1388
+ showFooter: Le = !0,
1385
1389
  pageSize: ze = 10,
1386
- pageSizeOptions: Ee = [5, 10, 25, 50],
1387
- page: V,
1388
- onPageChange: ae,
1389
- onPageSizeChange: Ie,
1390
+ pageSizeOptions: Fe = [5, 10, 25, 50],
1391
+ page: Y,
1392
+ onPageChange: se,
1393
+ onPageSizeChange: Ee,
1390
1394
  serverSide: _ = !1,
1391
1395
  rowCount: G,
1392
1396
  onQueryChange: S,
1393
1397
  queryDebounce: B = 250,
1394
1398
  filterDebounce: ce = 300,
1395
- loading: pe,
1399
+ loading: ge,
1396
1400
  loadingRows: qe,
1397
- skeletonRow: nt,
1398
- errorMessage: Pt = "Could not load the data.",
1401
+ skeletonRow: rt,
1402
+ errorMessage: Ot = "Could not load the data.",
1399
1403
  columnMenu: pt = !1,
1400
1404
  onColumnVisibilityChange: Ye,
1401
1405
  keyboardNavigation: Ve = !1,
1402
1406
  virtualize: de = !1,
1403
- rowHeight: ge = 40,
1407
+ rowHeight: me = 40,
1404
1408
  overscan: gt = 6,
1405
1409
  exportable: He = !1,
1406
1410
  onExportError: mt,
1407
- apiRef: Le,
1411
+ apiRef: Oe,
1408
1412
  onRowClick: bt,
1409
1413
  toolbar: yt,
1410
- emptyMessage: Lt = "No rows to show",
1414
+ emptyMessage: Rt = "No rows to show",
1411
1415
  emptyComponent: xt,
1412
1416
  sortIndicator: Xe = "default",
1413
- striped: Ot = !1,
1414
- stripeColors: ye,
1415
- checkboxVariant: Ce = "native",
1416
- animateRows: Rt = !0,
1417
- rowAnimation: re,
1418
- rowAnimationDuration: rt,
1419
- rowAnimationStagger: ot,
1420
- rowAnimationClassName: it,
1421
- rowExitAnimationClassName: Me,
1422
- theme: F,
1423
- maxHeight: Q,
1424
- className: L,
1425
- style: xe,
1426
- classNames: Y = {},
1427
- styles: A = {},
1428
- rowClassName: lt,
1429
- rowStyle: st
1417
+ sortIndicatorRotate: Ut = !0,
1418
+ striped: Ie = !1,
1419
+ stripeColors: Se,
1420
+ checkboxVariant: ot = "native",
1421
+ animateRows: _t = !0,
1422
+ rowAnimation: ue,
1423
+ rowAnimationDuration: Ge,
1424
+ rowAnimationStagger: it,
1425
+ rowAnimationClassName: lt,
1426
+ rowExitAnimationClassName: T,
1427
+ theme: Z,
1428
+ maxHeight: P,
1429
+ stickyToolbar: ae = !1,
1430
+ stickyHeader: Je = !1,
1431
+ stickyOffset: Re = 0,
1432
+ scrollbar: At = "thin",
1433
+ className: Wt,
1434
+ style: So,
1435
+ classNames: X = {},
1436
+ styles: K = {},
1437
+ rowClassName: Sn,
1438
+ rowStyle: Nn
1430
1439
  }) {
1431
- const Z = (e, r) => ({
1432
- className: U(r, Y[e]),
1433
- style: A[e]
1434
- }), [Ut, Yn] = z(n), at = j(n);
1440
+ const Q = (e, r) => ({
1441
+ className: U(r, X[e]),
1442
+ style: K[e]
1443
+ }), [Bt, Zn] = j(n), st = W(n);
1435
1444
  ne(() => {
1436
- at.current = n, Yn(n);
1445
+ st.current = n, Zn(n);
1437
1446
  }, [n]);
1438
- const Vn = (e) => {
1439
- at.current = e, Yn(e);
1440
- }, [_t, Hn] = Et(w, "", P), [ct, Xn] = Et(X, {}, q), [me, go] = Et(v, nl(p), k), [xn, dt] = Et(V, 0, ae), [oe, mo] = z(ze), bo = (e) => {
1441
- mo(e), Ie == null || Ie(e);
1442
- }, [At, yo] = z(() => new Set(t.filter((e) => e.hidden).map((e) => e.field))), xo = (e, r) => {
1443
- const l = new Set(At);
1444
- r ? l.add(e) : l.delete(e), yo(l), Ye == null || Ye([...l]);
1445
- }, [_n, Gn] = z({}), [Bt, _o] = z({}), [rl, wo] = z(0), wt = j(/* @__PURE__ */ new Map()), [vt, Ge] = z(null), Oe = j(0), Wt = j(null), jt = j(/* @__PURE__ */ new Map()), [wn, Jn] = z(null), vn = j(null), Qn = j(null), kt = j(null), [kn, Zn] = z({ top: 0, height: 0 }), W = ke(() => {
1446
- const e = t.filter((r) => !At.has(r.field)).map((r) => r.type === "sequence" ? { ...r, sortable: !1, filterable: !1, editable: !1, filterRenderer: void 0 } : r);
1447
+ const Qn = (e) => {
1448
+ st.current = e, Zn(e);
1449
+ }, [wt, er] = It(w, "", O), [at, tr] = It(H, {}, q), [be, No] = It(v, xl(p), k), [Cn, ct] = It(Y, 0, se), [re, Co] = j(ze), Do = (e) => {
1450
+ Co(e), Ee == null || Ee(e);
1451
+ }, [jt, To] = j(() => new Set(t.filter((e) => e.hidden).map((e) => e.field))), Fo = (e, r) => {
1452
+ const l = new Set(jt);
1453
+ r ? l.add(e) : l.delete(e), To(l), Ye == null || Ye([...l]);
1454
+ }, [Dn, nr] = j({}), [Kt, Eo] = j({}), [_l, Io] = j(0), vt = W(/* @__PURE__ */ new Map()), [kt, Ze] = j(null), Ue = W(0), zt = W(null), qt = W(/* @__PURE__ */ new Map()), [Tn, rr] = j(null), Fn = W(null), or = W(null), St = W(null), [En, ir] = j({ top: 0, height: 0 }), L = ve(() => {
1455
+ const e = t.filter((r) => !jt.has(r.field)).map((r) => r.type === "sequence" ? { ...r, sortable: !1, filterable: !1, editable: !1, filterRenderer: void 0 } : r);
1447
1456
  return [
1448
1457
  ...e.filter((r) => r.pinned === "left"),
1449
1458
  ...e.filter((r) => r.pinned !== "left" && r.pinned !== "right"),
1450
1459
  ...e.filter((r) => r.pinned === "right")
1451
1460
  ];
1452
- }, [t, At]), Sn = (e) => e.sortable === !0, ue = g === "single" ? "single" : g ? "multiple" : null, St = W.length + (ue ? 1 : 0), Je = ke(
1453
- () => Ut.map((e, r) => ({ row: e, index: r, id: i ? i(e, r) : r })),
1454
- [Ut, i]
1455
- ), er = j(/* @__PURE__ */ new Map());
1456
- Je.forEach((e) => er.current.set(e.id, e.row));
1457
- const ut = ke(
1458
- () => Object.entries(ct).filter(([e, r]) => {
1459
- const l = W.find((s) => s.field === e);
1460
- return !!l && !!l.filterable && uo(r);
1461
+ }, [t, jt]), In = (e) => e.sortable === !0, fe = g === "single" ? "single" : g ? "multiple" : null, Nt = L.length + (fe ? 1 : 0), Qe = ve(
1462
+ () => Bt.map((e, r) => ({ row: e, index: r, id: i ? i(e, r) : r })),
1463
+ [Bt, i]
1464
+ ), lr = W(/* @__PURE__ */ new Map());
1465
+ Qe.forEach((e) => lr.current.set(e.id, e.row));
1466
+ const dt = ve(
1467
+ () => Object.entries(at).filter(([e, r]) => {
1468
+ const l = L.find((s) => s.field === e);
1469
+ return !!l && !!l.filterable && xo(r);
1461
1470
  }),
1462
- [ct, W]
1463
- ), [vo, ko] = z(_t);
1471
+ [at, L]
1472
+ ), [Mo, $o] = j(wt);
1464
1473
  ne(() => {
1465
1474
  if (!_) return;
1466
- const e = setTimeout(() => ko(_t), B);
1475
+ const e = setTimeout(() => $o(wt), B);
1467
1476
  return () => clearTimeout(e);
1468
- }, [_t, _, B]);
1469
- const Re = _ ? vo : _t, tr = (e) => e.filterRenderer ? "text" : Kr(e), $e = ke(() => {
1470
- if (_) return Je;
1471
- const e = Re.trim().toLowerCase();
1472
- let r = Je.filter(({ row: s }) => e && !W.some((c) => It(c, s).toLowerCase().includes(e)) ? !1 : ut.every(([c, f]) => {
1473
- const y = W.find((N) => N.field === c);
1474
- return mi(tr(y), f, It(y, s), ve(s, c));
1477
+ }, [wt, _, B]);
1478
+ const Ae = _ ? Mo : wt, sr = (e) => e.filterRenderer ? "text" : Jr(e), Me = ve(() => {
1479
+ if (_) return Qe;
1480
+ const e = Ae.trim().toLowerCase();
1481
+ let r = Qe.filter(({ row: s }) => e && !L.some((c) => Mt(c, s).toLowerCase().includes(e)) ? !1 : dt.every(([c, u]) => {
1482
+ const y = L.find((N) => N.field === c);
1483
+ return $i(sr(y), u, Mt(y, s), we(s, c));
1475
1484
  }));
1476
- const l = me.map((s) => ({ col: W.find((c) => c.field === s.field), dir: s.direction === "asc" ? 1 : -1 })).filter((s) => !!s.col);
1485
+ const l = be.map((s) => ({ col: L.find((c) => c.field === s.field), dir: s.direction === "asc" ? 1 : -1 })).filter((s) => !!s.col);
1477
1486
  return l.length && (r = [...r].sort((s, c) => {
1478
- for (const { col: f, dir: y } of l) {
1479
- const N = ve(s.row, f.field), M = ve(c.row, f.field), O = N == null || N === "", ee = M == null || M === "";
1480
- if (O || ee) {
1481
- if (O !== ee) return O ? 1 : -1;
1487
+ for (const { col: u, dir: y } of l) {
1488
+ const N = we(s.row, u.field), M = we(c.row, u.field), R = N == null || N === "", ee = M == null || M === "";
1489
+ if (R || ee) {
1490
+ if (R !== ee) return R ? 1 : -1;
1482
1491
  continue;
1483
1492
  }
1484
- const be = f.comparator ? f.comparator(N, M, s.row, c.row) : tl(N, M, f);
1485
- if (be !== 0) return be * y;
1493
+ const ye = u.comparator ? u.comparator(N, M, s.row, c.row) : yl(N, M, u);
1494
+ if (ye !== 0) return ye * y;
1486
1495
  }
1487
1496
  return 0;
1488
1497
  })), r;
1489
- }, [Je, W, Re, ut, me, _]), Kt = JSON.stringify([Re, ct, me, oe]), nr = j(Kt);
1498
+ }, [Qe, L, Ae, dt, be, _]), Yt = JSON.stringify([Ae, at, be, re]), ar = W(Yt);
1490
1499
  ne(() => {
1491
- nr.current !== Kt && (nr.current = Kt, dt(0));
1492
- }, [Kt]);
1493
- const ft = _ ? G ?? Je.length : $e.length, Ue = R ? Math.max(1, Math.ceil(ft / oe)) : 1, ie = Math.min(xn, Ue - 1), K = R && !_ ? $e.slice(ie * oe, ie * oe + oe) : $e, So = ft === 0 ? 0 : R ? ie * oe + 1 : 1, No = R ? Math.min(ft, (ie + 1) * oe) : ft, Nn = ke(
1500
+ ar.current !== Yt && (ar.current = Yt, ct(0));
1501
+ }, [Yt]);
1502
+ const ut = _ ? G ?? Qe.length : Me.length, We = A ? Math.max(1, Math.ceil(ut / re)) : 1, oe = Math.min(Cn, We - 1), z = A && !_ ? Me.slice(oe * re, oe * re + re) : Me, Po = ut === 0 ? 0 : A ? oe * re + 1 : 1, Lo = A ? Math.min(ut, (oe + 1) * re) : ut, Mn = ve(
1494
1503
  () => ({
1495
- sort: me.filter((e) => {
1504
+ sort: be.filter((e) => {
1496
1505
  const r = t.find((l) => l.field === e.field);
1497
- return !!r && Sn(r);
1506
+ return !!r && In(r);
1498
1507
  }),
1499
- filters: Object.fromEntries(ut),
1500
- search: Re.trim(),
1501
- page: ie,
1502
- pageSize: oe
1508
+ filters: Object.fromEntries(dt),
1509
+ search: Ae.trim(),
1510
+ page: oe,
1511
+ pageSize: re
1503
1512
  }),
1504
1513
  // eslint-disable-next-line react-hooks/exhaustive-deps
1505
- [me, t, ut, Re, ie, oe]
1506
- ), Co = JSON.stringify(Nn), zt = j(Nn);
1507
- zt.current = Nn;
1508
- const qt = j(S);
1509
- qt.current = S;
1510
- const [Do, Yt] = z(!1), [Cn, Dn] = z(!1), Tn = j(0), Vt = Fe((e) => {
1514
+ [be, t, dt, Ae, oe, re]
1515
+ ), Oo = JSON.stringify(Mn), Vt = W(Mn);
1516
+ Vt.current = Mn;
1517
+ const Ht = W(S);
1518
+ Ht.current = S;
1519
+ const [Ro, Xt] = j(() => _ && !!S), [$n, Pn] = j(!1), Ln = W(0), Gt = Te((e) => {
1511
1520
  var s;
1512
- const r = ++Tn.current, l = (s = qt.current) == null ? void 0 : s.call(qt, e);
1513
- l && typeof l.then == "function" ? (Yt(!0), Dn(!1), l.then(
1521
+ const r = ++Ln.current, l = (s = Ht.current) == null ? void 0 : s.call(Ht, e);
1522
+ l && typeof l.then == "function" ? (Xt(!0), Pn(!1), l.then(
1514
1523
  () => {
1515
- r === Tn.current && Yt(!1);
1524
+ r === Ln.current && Xt(!1);
1516
1525
  },
1517
1526
  () => {
1518
- r === Tn.current && (Yt(!1), Dn(!0));
1527
+ r === Ln.current && (Xt(!1), Pn(!0));
1519
1528
  }
1520
- )) : (Yt(!1), Dn(!1));
1529
+ )) : (Xt(!1), Pn(!1));
1521
1530
  }, []);
1522
1531
  ne(() => {
1523
- _ && Vt(zt.current);
1524
- }, [_, Co, Vt]), ne(() => {
1525
- _ && R && xn > Ue - 1 && dt(Ue - 1);
1526
- }, [_, R, xn, Ue]);
1527
- const Nt = pe ?? Do, rr = (e) => e.map((r) => er.current.get(r)).filter((r) => r !== void 0), [De, Ht] = Et(
1532
+ _ && Gt(Vt.current);
1533
+ }, [_, Oo, Gt]), ne(() => {
1534
+ _ && A && Cn > We - 1 && ct(We - 1);
1535
+ }, [_, A, Cn, We]);
1536
+ const Ct = ge ?? Ro, cr = (e) => e.map((r) => lr.current.get(r)).filter((r) => r !== void 0), [Ce, Jt] = It(
1528
1537
  m,
1529
1538
  x ?? [],
1530
- (e) => E == null ? void 0 : E({ ids: e, rows: rr(e) })
1531
- ), Xt = ke(() => new Set(De), [De]), Gt = (e) => b ? b(e) : !0, Jt = j(null), or = j(!1), To = (e, r) => {
1532
- if (!ue || !Gt(e.row)) return;
1533
- if (ue === "single") {
1534
- Ht(r ? [e.id] : []), Jt.current = e.id;
1539
+ (e) => E == null ? void 0 : E({ ids: e, rows: cr(e) })
1540
+ ), Zt = ve(() => new Set(Ce), [Ce]), Qt = (e) => b ? b(e) : !0, en = W(null), dr = W(!1), Uo = (e, r) => {
1541
+ if (!fe || !Qt(e.row)) return;
1542
+ if (fe === "single") {
1543
+ Jt(r ? [e.id] : []), en.current = e.id;
1535
1544
  return;
1536
1545
  }
1537
- const l = new Set(De), s = or.current && Jt.current !== null ? K.findIndex((f) => f.id === Jt.current) : -1, c = K.findIndex((f) => f.id === e.id);
1546
+ const l = new Set(Ce), s = dr.current && en.current !== null ? z.findIndex((u) => u.id === en.current) : -1, c = z.findIndex((u) => u.id === e.id);
1538
1547
  if (s >= 0 && c >= 0)
1539
- for (let f = Math.min(s, c); f <= Math.max(s, c); f++)
1540
- Gt(K[f].row) && (r ? l.add(K[f].id) : l.delete(K[f].id));
1548
+ for (let u = Math.min(s, c); u <= Math.max(s, c); u++)
1549
+ Qt(z[u].row) && (r ? l.add(z[u].id) : l.delete(z[u].id));
1541
1550
  else r ? l.add(e.id) : l.delete(e.id);
1542
- Jt.current = e.id, Ht([...l]);
1543
- }, Ct = ke(() => $e.filter((e) => Gt(e.row)), [$e, b]), ir = Ct.filter((e) => Xt.has(e.id)).length, lr = Ct.length > 0 && ir === Ct.length, sr = (e) => {
1544
- const r = new Set(De);
1545
- Ct.forEach((l) => e ? r.add(l.id) : r.delete(l.id)), Ht([...r]);
1546
- }, Qt = (e, r, l) => ({
1547
- value: ve(r, e.field),
1548
- formattedValue: It(e, r),
1551
+ en.current = e.id, Jt([...l]);
1552
+ }, Dt = ve(() => Me.filter((e) => Qt(e.row)), [Me, b]), ur = Dt.filter((e) => Zt.has(e.id)).length, fr = Dt.length > 0 && ur === Dt.length, hr = (e) => {
1553
+ const r = new Set(Ce);
1554
+ Dt.forEach((l) => e ? r.add(l.id) : r.delete(l.id)), Jt([...r]);
1555
+ }, tn = (e, r, l) => ({
1556
+ value: we(r, e.field),
1557
+ formattedValue: Mt(e, r),
1549
1558
  row: r,
1550
1559
  rowIndex: l,
1551
1560
  field: e.field,
1552
1561
  column: e
1553
- }), Fn = (e, r) => {
1562
+ }), On = (e, r) => {
1554
1563
  const l = e.editable ?? o;
1555
1564
  return typeof l == "function" ? l(r) : !!l;
1556
- }, Zt = (e, r) => Fn(e, r) && !(e.type === "boolean" && !e.cellEditor), Fo = (e, r) => {
1557
- const l = Qt(e, r.row, r.index), s = Fn(e, l);
1565
+ }, nn = (e, r) => On(e, r) && !(e.type === "boolean" && !e.cellEditor), Ao = (e, r) => {
1566
+ const l = tn(e, r.row, r.index), s = On(e, l);
1558
1567
  return {
1559
1568
  ...l,
1560
1569
  editable: s,
1561
- updateValue: (c) => s && cr(r, e, { value: c })
1570
+ updateValue: (c) => s && gr(r, e, { value: c })
1562
1571
  };
1563
- }, ar = (e, r) => {
1564
- if (!Sn(e)) return;
1565
- const l = me.find((f) => f.field === e.field), s = l ? l.direction === "asc" ? "desc" : null : "asc";
1572
+ }, pr = (e, r) => {
1573
+ if (!In(e)) return;
1574
+ const l = be.find((u) => u.field === e.field), s = l ? l.direction === "asc" ? "desc" : null : "asc";
1566
1575
  let c;
1567
- r && D ? s ? l ? c = me.map((f) => f.field === e.field ? { ...f, direction: s } : f) : c = [...me, { field: e.field, direction: s }] : c = me.filter((f) => f.field !== e.field) : c = s ? [{ field: e.field, direction: s }] : [], go(c);
1568
- }, en = (e, r) => {
1576
+ r && D ? s ? l ? c = be.map((u) => u.field === e.field ? { ...u, direction: s } : u) : c = [...be, { field: e.field, direction: s }] : c = be.filter((u) => u.field !== e.field) : c = s ? [{ field: e.field, direction: s }] : [], No(c);
1577
+ }, rn = (e, r) => {
1569
1578
  var l;
1570
- return (l = jt.current.get(jn(e, r))) == null ? void 0 : l.focus();
1571
- }, Ae = () => {
1572
- Oe.current += 1, Ge(null);
1573
- }, Eo = (e) => {
1574
- for (const r of at.current) {
1575
- const l = ve(r, e.field);
1579
+ return (l = qt.current.get(Hn(e, r))) == null ? void 0 : l.focus();
1580
+ }, Be = () => {
1581
+ Ue.current += 1, Ze(null);
1582
+ }, Wo = (e) => {
1583
+ for (const r of st.current) {
1584
+ const l = we(r, e.field);
1576
1585
  if (l != null && l !== "") return l;
1577
1586
  }
1578
- }, tn = (e, r, l = {}) => {
1579
- if (!Zt(r, Qt(r, e.row, e.index))) return !1;
1580
- const s = ve(e.row, r.field);
1587
+ }, on = (e, r, l = {}) => {
1588
+ if (!nn(r, tn(r, e.row, e.index))) return !1;
1589
+ const s = we(e.row, r.field);
1581
1590
  let c;
1582
- return r.cellEditor ? c = s : r.type === "date" ? c = he(s) ?? "" : c = l.text ?? (s == null ? "" : String(s)), Wt.current = c, Oe.current += 1, Ge({
1591
+ return r.cellEditor ? c = s : r.type === "date" ? c = pe(s) ?? "" : c = l.text ?? (s == null ? "" : String(s)), zt.current = c, Ue.current += 1, Ze({
1583
1592
  id: e.id,
1584
1593
  field: r.field,
1585
1594
  draft: c,
1586
- session: Oe.current,
1595
+ session: Ue.current,
1587
1596
  select: l.select ?? "end",
1588
1597
  invalid: !1
1589
1598
  }), !0;
1590
- }, cr = (e, r, l) => {
1591
- const s = at.current[e.index] ?? e.row, c = ve(s, r.field);
1592
- let f;
1599
+ }, gr = (e, r, l) => {
1600
+ const s = st.current[e.index] ?? e.row, c = we(s, r.field);
1601
+ let u;
1593
1602
  if ("value" in l)
1594
- f = l.value;
1603
+ u = l.value;
1595
1604
  else if (r.valueParser)
1596
- f = r.valueParser(l.text, s);
1605
+ u = r.valueParser(l.text, s);
1597
1606
  else if (r.type === "date") {
1598
- if (l.text !== "" && !se(l.text)) return !1;
1599
- f = hi(l.text, c ?? Eo(r));
1607
+ if (l.text !== "" && !le(l.text)) return !1;
1608
+ u = Ei(l.text, c ?? Wo(r));
1600
1609
  } else if (r.type === "number")
1601
- if (l.text.trim() === "") f = null;
1610
+ if (l.text.trim() === "") u = null;
1602
1611
  else {
1603
1612
  const M = Number(l.text);
1604
1613
  if (!Number.isFinite(M)) return !1;
1605
- f = M;
1614
+ u = M;
1606
1615
  }
1607
1616
  else
1608
- f = l.text;
1617
+ u = l.text;
1609
1618
  if (r.type === "date") {
1610
- if (he(f) === he(c)) return !0;
1611
- const M = he(f);
1619
+ if (pe(u) === pe(c)) return !0;
1620
+ const M = pe(u);
1612
1621
  if (M && (r.dateMin && M < r.dateMin || r.dateMax && M > r.dateMax)) return !1;
1613
- } else if (Object.is(f, c))
1622
+ } else if (Object.is(u, c))
1614
1623
  return !0;
1615
- if (r.validate && !r.validate(f, s)) return !1;
1616
- const y = zn(s, r.field, f), N = at.current.map((M, O) => O === e.index ? y : M);
1617
- return Vn(N), d == null || d({ rowId: e.id, rowIndex: e.index, field: r.field, oldValue: c, newValue: f, row: y }), a == null || a(N), !0;
1618
- }, dr = (e, r, l) => {
1619
- const s = K.findIndex((O) => O.id === e.id), c = W.findIndex((O) => O.field === r);
1624
+ if (r.validate && !r.validate(u, s)) return !1;
1625
+ const y = Gn(s, r.field, u), N = st.current.map((M, R) => R === e.index ? y : M);
1626
+ return Qn(N), d == null || d({ rowId: e.id, rowIndex: e.index, field: r.field, oldValue: c, newValue: u, row: y }), a == null || a(N), !0;
1627
+ }, mr = (e, r, l) => {
1628
+ const s = z.findIndex((R) => R.id === e.id), c = L.findIndex((R) => R.field === r);
1620
1629
  if (s < 0 || c < 0) return null;
1621
- const f = (O, ee) => Zt(ee, Qt(ee, O.row, O.index));
1630
+ const u = (R, ee) => nn(ee, tn(ee, R.row, R.index));
1622
1631
  if (l === "down" || l === "up") {
1623
- const O = l === "down" ? 1 : -1;
1624
- for (let ee = s + O; ee >= 0 && ee < K.length; ee += O)
1625
- if (f(K[ee], W[c])) return { entry: K[ee], col: W[c] };
1632
+ const R = l === "down" ? 1 : -1;
1633
+ for (let ee = s + R; ee >= 0 && ee < z.length; ee += R)
1634
+ if (u(z[ee], L[c])) return { entry: z[ee], col: L[c] };
1626
1635
  return null;
1627
1636
  }
1628
1637
  const y = l === "right" ? 1 : -1;
1629
1638
  let N = s, M = c + y;
1630
- for (; N >= 0 && N < K.length; ) {
1631
- for (; M >= 0 && M < W.length; ) {
1632
- if (f(K[N], W[M])) return { entry: K[N], col: W[M] };
1639
+ for (; N >= 0 && N < z.length; ) {
1640
+ for (; M >= 0 && M < L.length; ) {
1641
+ if (u(z[N], L[M])) return { entry: z[N], col: L[M] };
1633
1642
  M += y;
1634
1643
  }
1635
- N += y, M = y > 0 ? 0 : W.length - 1;
1644
+ N += y, M = y > 0 ? 0 : L.length - 1;
1636
1645
  }
1637
1646
  return null;
1638
- }, Qe = (e, r, l, s = {}) => {
1639
- const { move: c = "none", focus: f = !0 } = s;
1640
- if (!cr(e, r, l))
1641
- return Ge((N) => N && { ...N, invalid: !0 }), !1;
1642
- const y = c === "none" ? null : dr(e, r.field, c);
1643
- return y ? tn(y.entry, y.col, { select: "all" }) : (Ae(), f && en(e.id, r.field)), !0;
1644
- }, ur = (e, r, l) => {
1647
+ }, et = (e, r, l, s = {}) => {
1648
+ const { move: c = "none", focus: u = !0 } = s;
1649
+ if (!gr(e, r, l))
1650
+ return Ze((N) => N && { ...N, invalid: !0 }), !1;
1651
+ const y = c === "none" ? null : mr(e, r.field, c);
1652
+ return y ? on(y.entry, y.col, { select: "all" }) : (Be(), u && rn(e.id, r.field)), !0;
1653
+ }, br = (e, r, l) => {
1645
1654
  if (e.nativeEvent.isComposing) return;
1646
- const s = e.currentTarget.value, c = io(e.currentTarget);
1655
+ const s = e.currentTarget.value, c = po(e.currentTarget);
1647
1656
  if (e.key === "Enter") {
1648
- if (e.preventDefault(), c) return Ge((y) => y && { ...y, invalid: !0 });
1649
- const f = u ? e.shiftKey ? "up" : "down" : "none";
1650
- Qe(r, l, { text: s }, { move: f });
1657
+ if (e.preventDefault(), c) return Ze((y) => y && { ...y, invalid: !0 });
1658
+ const u = f ? e.shiftKey ? "up" : "down" : "none";
1659
+ et(r, l, { text: s }, { move: u });
1651
1660
  } else if (e.key === "Escape")
1652
- e.preventDefault(), Ae(), en(r.id, l.field);
1661
+ e.preventDefault(), Be(), rn(r.id, l.field);
1653
1662
  else if (e.key === "Tab" && !c) {
1654
- const f = e.shiftKey ? "left" : "right";
1655
- dr(r, l.field, f) && (e.preventDefault(), Qe(r, l, { text: s }, { move: f }));
1663
+ const u = e.shiftKey ? "left" : "right";
1664
+ mr(r, l.field, u) && (e.preventDefault(), et(r, l, { text: s }, { move: u }));
1656
1665
  }
1657
- }, Io = (e, r) => {
1658
- var f;
1659
- const l = K[e], s = W[r];
1666
+ }, Bo = (e, r) => {
1667
+ var u;
1668
+ const l = z[e], s = L[r];
1660
1669
  if (!l || !s) return;
1661
- Jn({ id: l.id, field: s.field }), vn.current = jn(l.id, s.field);
1662
- const c = kt.current;
1670
+ rr({ id: l.id, field: s.field }), Fn.current = Hn(l.id, s.field);
1671
+ const c = St.current;
1663
1672
  if (de && c) {
1664
- const y = ((f = c.querySelector("thead")) == null ? void 0 : f.clientHeight) ?? 0, N = e * ge;
1665
- N < c.scrollTop ? c.scrollTo({ top: N, behavior: "auto" }) : N + ge > c.scrollTop + c.clientHeight - y && c.scrollTo({ top: N + ge - c.clientHeight + y, behavior: "auto" });
1673
+ const y = ((u = c.querySelector("thead")) == null ? void 0 : u.clientHeight) ?? 0, N = e * me;
1674
+ N < c.scrollTop ? c.scrollTo({ top: N, behavior: "auto" }) : N + me > c.scrollTop + c.clientHeight - y && c.scrollTo({ top: N + me - c.clientHeight + y, behavior: "auto" });
1666
1675
  }
1667
1676
  };
1668
1677
  ne(() => {
1669
- const e = vn.current;
1678
+ const e = Fn.current;
1670
1679
  if (!e) return;
1671
- const r = jt.current.get(e);
1672
- r && (vn.current = null, r.focus());
1680
+ const r = qt.current.get(e);
1681
+ r && (Fn.current = null, r.focus());
1673
1682
  });
1674
- const Mo = (e, r, l) => {
1683
+ const jo = (e, r, l) => {
1675
1684
  if (!Ve) return !1;
1676
- let s = K.findIndex((f) => f.id === r.id), c = W.findIndex((f) => f.field === l.field);
1685
+ let s = z.findIndex((u) => u.id === r.id), c = L.findIndex((u) => u.field === l.field);
1677
1686
  if (s < 0 || c < 0) return !1;
1678
1687
  switch (e.key) {
1679
1688
  case "ArrowDown":
@@ -1689,164 +1698,173 @@ function sl({
1689
1698
  c -= 1;
1690
1699
  break;
1691
1700
  case "PageDown":
1692
- s += oo;
1701
+ s += ho;
1693
1702
  break;
1694
1703
  case "PageUp":
1695
- s -= oo;
1704
+ s -= ho;
1696
1705
  break;
1697
1706
  case "Home":
1698
1707
  c = 0, (e.ctrlKey || e.metaKey) && (s = 0);
1699
1708
  break;
1700
1709
  case "End":
1701
- c = W.length - 1, (e.ctrlKey || e.metaKey) && (s = K.length - 1);
1710
+ c = L.length - 1, (e.ctrlKey || e.metaKey) && (s = z.length - 1);
1702
1711
  break;
1703
1712
  default:
1704
1713
  return !1;
1705
1714
  }
1706
- return e.preventDefault(), Io(Math.max(0, Math.min(K.length - 1, s)), Math.max(0, Math.min(W.length - 1, c))), !0;
1707
- }, $o = (e, r, l, s) => {
1708
- e.target === e.currentTarget && (Mo(e, r, l) || Zt(l, s) && (e.key === "Enter" || e.key === "F2" ? (e.preventDefault(), tn(r, l)) : !l.cellEditor && l.type !== "date" && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), tn(r, l, { text: e.key }))));
1715
+ return e.preventDefault(), Bo(Math.max(0, Math.min(z.length - 1, s)), Math.max(0, Math.min(L.length - 1, c))), !0;
1716
+ }, Ko = (e, r, l, s) => {
1717
+ e.target === e.currentTarget && (jo(e, r, l) || nn(l, s) && (e.key === "Enter" || e.key === "F2" ? (e.preventDefault(), on(r, l)) : !l.cellEditor && l.type !== "date" && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), on(r, l, { text: e.key }))));
1709
1718
  };
1710
- pn(() => {
1711
- if (!de || !kt.current) return;
1712
- const e = kt.current, r = () => Zn((s) => s.height === e.clientHeight ? s : { ...s, height: e.clientHeight });
1719
+ Pt(() => {
1720
+ if (!de || !St.current) return;
1721
+ const e = St.current, r = () => ir((s) => s.height === e.clientHeight ? s : { ...s, height: e.clientHeight });
1713
1722
  if (r(), typeof ResizeObserver > "u") return;
1714
1723
  const l = new ResizeObserver(r);
1715
1724
  return l.observe(e), () => l.disconnect();
1716
1725
  }, [de]);
1717
- const Dt = de && !Nt && K.length > 0, Po = kn.height || (typeof Q == "number" ? Q : 400), nn = Dt ? Math.max(0, Math.floor(kn.top / ge) - gt) : 0, En = Dt ? Math.min(K.length, Math.ceil((kn.top + Po) / ge) + gt) : K.length, fr = Dt ? K.slice(nn, En) : K, Lo = `${ie}|${oe}|${JSON.stringify(me)}|${Re}|${JSON.stringify(ct)}`, hr = j(!0);
1726
+ const Tt = de && !Ct && z.length > 0, zo = En.height || (typeof P == "number" ? P : 400), ln = Tt ? Math.max(0, Math.floor(En.top / me) - gt) : 0, Rn = Tt ? Math.min(z.length, Math.ceil((En.top + zo) / me) + gt) : z.length, yr = Tt ? z.slice(ln, Rn) : z, qo = `${oe}|${re}|${JSON.stringify(be)}|${Ae}|${JSON.stringify(at)}`, xr = W(!0);
1718
1727
  ne(() => {
1719
- if (hr.current) {
1720
- hr.current = !1;
1728
+ if (xr.current) {
1729
+ xr.current = !1;
1721
1730
  return;
1722
1731
  }
1723
- const e = kt.current;
1732
+ const e = St.current;
1724
1733
  e && typeof e.scrollTo == "function" && e.scrollTop > 0 && e.scrollTo({ top: 0, behavior: "smooth" });
1725
- }, [Lo]);
1726
- const pr = (typeof re == "string" ? re : re == null ? void 0 : re.enter) ?? "slide-up", In = (typeof re == "string" ? re : (re == null ? void 0 : re.exit) ?? (re == null ? void 0 : re.enter)) ?? "slide-up", Mn = Rt && !de, gr = Mn && (In !== "none" || !!Me), mr = rt ?? 380, br = ot ?? 28, rn = j(/* @__PURE__ */ new Map());
1727
- let Oo = 0;
1728
- const Ro = (e) => {
1729
- let r = rn.current.get(e);
1730
- return r === void 0 && (r = Oo++, rn.current.set(e, r)), Math.min(r, 24);
1731
- }, [Te, yr] = z([]), xr = j({ rows: [], order: [], pageKey: "" }), Be = j(/* @__PURE__ */ new Map()), $n = `${ie}|${oe}|${_}`, Pn = Fe((e) => {
1732
- const r = Be.current.get(e);
1733
- r !== void 0 && clearTimeout(r), Be.current.delete(e), yr((l) => {
1734
+ }, [qo]);
1735
+ const _r = (typeof ue == "string" ? ue : ue == null ? void 0 : ue.enter) ?? "slide-up", Un = (typeof ue == "string" ? ue : (ue == null ? void 0 : ue.exit) ?? (ue == null ? void 0 : ue.enter)) ?? "slide-up", An = _t && !de, wr = An && (Un !== "none" || !!T), vr = Ge ?? 380, kr = it ?? 28, sn = W(/* @__PURE__ */ new Map());
1736
+ let Yo = 0;
1737
+ const Vo = (e) => {
1738
+ let r = sn.current.get(e);
1739
+ return r === void 0 && (r = Yo++, sn.current.set(e, r)), Math.min(r, 24);
1740
+ }, [De, Sr] = j([]), Nr = W({ rows: [], order: [], pageKey: "" }), je = W(/* @__PURE__ */ new Map()), Wn = `${oe}|${re}|${_}`, Bn = Te((e) => {
1741
+ const r = je.current.get(e);
1742
+ r !== void 0 && clearTimeout(r), je.current.delete(e), Sr((l) => {
1734
1743
  const s = l.find((c) => c.id === e);
1735
1744
  return s ? l.filter((c) => c.id !== e).map((c) => c.afterId === e ? { ...c, afterId: s.afterId } : c) : l;
1736
1745
  });
1737
1746
  }, []);
1738
- pn(() => {
1739
- const e = xr.current, r = new Set(K.map((c) => c.id));
1740
- rn.current.forEach((c, f) => !r.has(f) && rn.current.delete(f));
1741
- const l = !gr || Nt || Cn || e.pageKey !== $n || Zi();
1742
- let s = Te;
1747
+ Pt(() => {
1748
+ const e = Nr.current, r = new Set(z.map((c) => c.id));
1749
+ sn.current.forEach((c, u) => !r.has(u) && sn.current.delete(u));
1750
+ const l = !wr || Ct || $n || e.pageKey !== Wn || ml();
1751
+ let s = De;
1743
1752
  if (l)
1744
1753
  s = [];
1745
1754
  else {
1746
- s = s.filter((f) => !r.has(f.id));
1747
- const c = e.rows.filter((f) => !r.has(f.id) && !s.some((y) => y.id === f.id));
1755
+ s = s.filter((u) => !r.has(u.id));
1756
+ const c = e.rows.filter((u) => !r.has(u.id) && !s.some((y) => y.id === u.id));
1748
1757
  if (c.length > 0) {
1749
- const f = c.map((y, N) => {
1758
+ const u = c.map((y, N) => {
1750
1759
  const M = e.order.indexOf(y.id);
1751
1760
  return { id: y.id, entry: y, afterId: M > 0 ? e.order[M - 1] : null, batch: N };
1752
1761
  });
1753
- s = [...s, ...f];
1762
+ s = [...s, ...u];
1754
1763
  }
1755
1764
  }
1756
- (s.length !== Te.length || s.some((c, f) => c !== Te[f])) && yr(s), xr.current = { rows: K, order: ro(K, s).map((c) => c.kind === "row" ? c.entry.id : c.ghost.id), pageKey: $n };
1757
- }, [K, Te, Nt, Cn, $n, gr]), ne(() => {
1758
- const e = !!Me;
1759
- Te.forEach((r) => {
1760
- if (Be.current.has(r.id)) return;
1761
- const l = e ? 2500 : mr * 0.8 + br * Math.min(r.batch, 24) + 250;
1762
- Be.current.set(r.id, setTimeout(() => Pn(r.id), l));
1763
- }), Be.current.forEach((r, l) => {
1764
- Te.some((s) => s.id === l) || (clearTimeout(r), Be.current.delete(l));
1765
+ (s.length !== De.length || s.some((c, u) => c !== De[u])) && Sr(s), Nr.current = { rows: z, order: fo(z, s).map((c) => c.kind === "row" ? c.entry.id : c.ghost.id), pageKey: Wn };
1766
+ }, [z, De, Ct, $n, Wn, wr]), ne(() => {
1767
+ const e = !!T;
1768
+ De.forEach((r) => {
1769
+ if (je.current.has(r.id)) return;
1770
+ const l = e ? 2500 : vr * 0.8 + kr * Math.min(r.batch, 24) + 250;
1771
+ je.current.set(r.id, setTimeout(() => Bn(r.id), l));
1772
+ }), je.current.forEach((r, l) => {
1773
+ De.some((s) => s.id === l) || (clearTimeout(r), je.current.delete(l));
1765
1774
  });
1766
- }, [Te, mr, br, Me, Pn]), ne(
1775
+ }, [De, vr, kr, T, Bn]), ne(
1767
1776
  () => () => {
1768
- Be.current.forEach((e) => clearTimeout(e)), Be.current.clear();
1777
+ je.current.forEach((e) => clearTimeout(e)), je.current.clear();
1769
1778
  },
1770
1779
  []
1771
1780
  );
1772
- const Uo = ke(() => ro(fr, Te), [fr, Te]), Ln = Object.keys(_n).length > 0, on = (e) => _n[e.field] ?? (typeof e.width == "number" ? e.width : el), Ao = (e) => Math.max(40, typeof e.minWidth == "number" ? e.minWidth : 60), Bo = (e, r) => {
1781
+ const Ho = ve(() => fo(yr, De), [yr, De]), Cr = W(null), [Xo, Go] = j(0);
1782
+ Pt(() => {
1783
+ const e = Cr.current;
1784
+ if (!e || !ae) return;
1785
+ const r = () => Go(e.offsetHeight);
1786
+ if (r(), typeof ResizeObserver > "u") return;
1787
+ const l = new ResizeObserver(r);
1788
+ return l.observe(e), () => l.disconnect();
1789
+ }, [ae]);
1790
+ const an = Object.keys(Dn).length > 0, cn = (e) => Dn[e.field] ?? (typeof e.width == "number" ? e.width : bl), Jo = (e) => Math.max(40, typeof e.minWidth == "number" ? e.minWidth : 60), dn = (e) => e.overflow ?? (typeof e.width == "number" && e.width < 40 ? "clip" : e.width !== void 0 && e.width !== "" ? "wrap" : void 0), Dr = (e) => typeof e.width == "number" && e.width < 40 ? { paddingLeft: 0, paddingRight: 0 } : null, Zo = L.some((e) => e.width !== void 0 && e.width !== null && e.width !== ""), Qo = L.length > 0 && L.every((e) => typeof e.width == "number"), ei = (e, r) => {
1773
1791
  e.preventDefault(), e.stopPropagation();
1774
- const l = { ..._n };
1775
- Ln || W.forEach((O) => {
1792
+ const l = { ...Dn };
1793
+ an || L.forEach((R) => {
1776
1794
  var ee;
1777
- return l[O.field] = ((ee = wt.current.get(O.field)) == null ? void 0 : ee.offsetWidth) ?? on(O);
1795
+ return l[R.field] = ((ee = vt.current.get(R.field)) == null ? void 0 : ee.offsetWidth) ?? cn(R);
1778
1796
  });
1779
- const s = e.clientX, c = l[r.field] ?? on(r), f = e.currentTarget;
1780
- f.setPointerCapture(e.pointerId), Gn(l);
1781
- const y = (O) => Math.min(r.maxWidth ?? 1 / 0, Math.max(Ao(r), Math.round(O))), N = (O) => Gn((ee) => ({ ...ee, [r.field]: y(c + O.clientX - s) })), M = () => {
1782
- f.removeEventListener("pointermove", N), f.removeEventListener("pointerup", M), f.removeEventListener("pointercancel", M);
1797
+ const s = e.clientX, c = l[r.field] ?? cn(r), u = e.currentTarget;
1798
+ u.setPointerCapture(e.pointerId), nr(l);
1799
+ const y = (R) => Math.min(r.maxWidth ?? 1 / 0, Math.max(Jo(r), Math.round(R))), N = (R) => nr((ee) => ({ ...ee, [r.field]: y(c + R.clientX - s) })), M = () => {
1800
+ u.removeEventListener("pointermove", N), u.removeEventListener("pointerup", M), u.removeEventListener("pointercancel", M);
1783
1801
  };
1784
- f.addEventListener("pointermove", N), f.addEventListener("pointerup", M), f.addEventListener("pointercancel", M);
1802
+ u.addEventListener("pointermove", N), u.addEventListener("pointerup", M), u.addEventListener("pointercancel", M);
1785
1803
  };
1786
- pn(() => {
1787
- var c, f;
1804
+ Pt(() => {
1805
+ var c, u;
1788
1806
  const e = {};
1789
- let r = ue && W.some((y) => y.pinned === "left") ? je : 0;
1790
- for (const y of W)
1791
- y.pinned === "left" && (e[y.field] = r, r += ((c = wt.current.get(y.field)) == null ? void 0 : c.offsetWidth) ?? 0);
1807
+ let r = fe && L.some((y) => y.pinned === "left") ? $e : 0;
1808
+ for (const y of L)
1809
+ y.pinned === "left" && (e[y.field] = r, r += ((c = vt.current.get(y.field)) == null ? void 0 : c.offsetWidth) ?? 0);
1792
1810
  let l = 0;
1793
- for (const y of [...W].reverse())
1794
- y.pinned === "right" && (e[y.field] = l, l += ((f = wt.current.get(y.field)) == null ? void 0 : f.offsetWidth) ?? 0);
1811
+ for (const y of [...L].reverse())
1812
+ y.pinned === "right" && (e[y.field] = l, l += ((u = vt.current.get(y.field)) == null ? void 0 : u.offsetWidth) ?? 0);
1795
1813
  const s = Object.keys(e);
1796
- (s.length !== Object.keys(Bt).length || s.some((y) => e[y] !== Bt[y])) && _o(e);
1814
+ (s.length !== Object.keys(Kt).length || s.some((y) => e[y] !== Kt[y])) && Eo(e);
1797
1815
  }), ne(() => {
1798
- const e = () => wo((r) => r + 1);
1816
+ const e = () => Io((r) => r + 1);
1799
1817
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
1800
1818
  }, []);
1801
- const _r = W.map((e) => e.pinned).lastIndexOf("left"), Wo = W.findIndex((e) => e.pinned === "right"), ln = _r >= 0, wr = (e, r) => ({
1802
- className: e.pinned ? U("rg-grid__pinned", `rg-grid__pinned--${e.pinned}`, r === _r && "rg-grid__pinned--edge", r === Wo && "rg-grid__pinned--edge") : void 0,
1803
- style: e.pinned === "left" ? { left: Bt[e.field] ?? 0 } : e.pinned === "right" ? { right: Bt[e.field] ?? 0 } : void 0
1804
- }), We = typeof He == "object" ? He : {}, sn = ke(() => {
1819
+ const Tr = L.map((e) => e.pinned).lastIndexOf("left"), ti = L.findIndex((e) => e.pinned === "right"), un = Tr >= 0, Fr = (e, r) => ({
1820
+ className: e.pinned ? U("rg-grid__pinned", `rg-grid__pinned--${e.pinned}`, r === Tr && "rg-grid__pinned--edge", r === ti && "rg-grid__pinned--edge") : void 0,
1821
+ style: e.pinned === "left" ? { left: Kt[e.field] ?? 0 } : e.pinned === "right" ? { right: Kt[e.field] ?? 0 } : void 0
1822
+ }), Ke = typeof He == "object" ? He : {}, fn = ve(() => {
1805
1823
  var r;
1806
- const e = (r = We.formats) != null && r.length ? We.formats : ["csv"];
1824
+ const e = (r = Ke.formats) != null && r.length ? Ke.formats : ["csv"];
1807
1825
  return e.filter((l, s) => e.indexOf(l) === s);
1808
- }, [He]), an = (e = {}) => {
1809
- const r = { ...We, ...e, pdf: { ...We.pdf, ...e.pdf } }, l = r.scope ?? "filtered", s = l === "page" || l === "visible", c = s ? K : l === "selected" ? Je.filter((be) => Xt.has(be.id)) : $e, f = r.includeHidden ? t : W, y = s && R ? ie * oe : 0, N = f.map((be) => Mt(be) || be.field), M = [], O = [], ee = [];
1810
- return c.forEach(({ row: be }, On) => {
1811
- const dn = [], $ = [], Tt = {};
1812
- f.forEach((J, Rn) => {
1813
- const te = ve(be, J.field);
1814
- let _e, le;
1826
+ }, [He]), hn = (e = {}) => {
1827
+ const r = { ...Ke, ...e, pdf: { ...Ke.pdf, ...e.pdf } }, l = r.scope ?? "filtered", s = l === "page" || l === "visible", c = s ? z : l === "selected" ? Qe.filter((ye) => Zt.has(ye.id)) : Me, u = r.includeHidden ? t : L, y = s && A ? oe * re : 0, N = u.map((ye) => $t(ye) || ye.field), M = [], R = [], ee = [];
1828
+ return c.forEach(({ row: ye }, jn) => {
1829
+ const mn = [], $ = [], Ft = {};
1830
+ u.forEach((J, Kn) => {
1831
+ const te = we(ye, J.field);
1832
+ let xe, ie;
1815
1833
  if (J.type === "sequence") {
1816
- const fn = Rr(J, On, J.sequenceRestartEachPage ? 0 : y);
1817
- _e = fn, le = fn;
1818
- } else J.exportValue ? (_e = J.exportValue(te, be), le = _e ?? null) : J.type === "date" ? (_e = he(te) ?? "", le = _e) : (_e = It(J, be), J.type === "number" && typeof te == "number" && Number.isFinite(te) || J.type === "boolean" && typeof te == "boolean" ? le = te : J.valueFormatter ? le = _e : te == null ? le = null : typeof te == "string" || typeof te == "boolean" || typeof te == "number" && Number.isFinite(te) ? le = te : te instanceof Date ? le = Number.isNaN(te.getTime()) ? null : te.toISOString() : le = _e);
1819
- dn.push(_e), $.push(le);
1820
- const un = r.jsonKeys === "header" ? N[Rn] : J.field;
1821
- Tt[un] = J.type === "date" && le === "" ? null : le ?? null;
1822
- }), M.push(dn), O.push($), ee.push(Tt);
1823
- }), { opts: r, cols: f, headers: N, display: M, typed: O, records: ee };
1824
- }, cn = (e, r) => `${e.filename ?? "export"}.${r}`, vr = (e = {}) => {
1825
- const r = an(e);
1826
- return Di(r.headers, r.display, { sanitize: r.opts.sanitize });
1827
- }, kr = (e = {}) => {
1828
- const r = { ...We, ...e };
1829
- Ti(vr(e), cn(r, "csv"));
1830
- }, Sr = (e = {}) => {
1831
- const r = an(e);
1834
+ const yn = qr(J, jn, J.sequenceRestartEachPage ? 0 : y);
1835
+ xe = yn, ie = yn;
1836
+ } else J.exportValue ? (xe = J.exportValue(te, ye), ie = xe ?? null) : J.type === "date" ? (xe = pe(te) ?? "", ie = xe) : (xe = Mt(J, ye), J.type === "number" && typeof te == "number" && Number.isFinite(te) || J.type === "boolean" && typeof te == "boolean" ? ie = te : J.valueFormatter ? ie = xe : te == null ? ie = null : typeof te == "string" || typeof te == "boolean" || typeof te == "number" && Number.isFinite(te) ? ie = te : te instanceof Date ? ie = Number.isNaN(te.getTime()) ? null : te.toISOString() : ie = xe);
1837
+ mn.push(xe), $.push(ie);
1838
+ const bn = r.jsonKeys === "header" ? N[Kn] : J.field;
1839
+ Ft[bn] = J.type === "date" && ie === "" ? null : ie ?? null;
1840
+ }), M.push(mn), R.push($), ee.push(Ft);
1841
+ }), { opts: r, cols: u, headers: N, display: M, typed: R, records: ee };
1842
+ }, pn = (e, r) => `${e.filename ?? "export"}.${r}`, Er = (e = {}) => {
1843
+ const r = hn(e);
1844
+ return zi(r.headers, r.display, { sanitize: r.opts.sanitize });
1845
+ }, Ir = (e = {}) => {
1846
+ const r = { ...Ke, ...e };
1847
+ qi(Er(e), pn(r, "csv"));
1848
+ }, Mr = (e = {}) => {
1849
+ const r = hn(e);
1832
1850
  return JSON.stringify(r.records, null, r.opts.jsonIndent ?? 2);
1833
- }, Nr = (e = {}) => {
1834
- const r = { ...We, ...e };
1835
- gn(new Blob([Sr(e)], { type: "application/json;charset=utf-8" }), cn(r, "json"));
1836
- }, Cr = async (e = {}) => {
1837
- const r = an(e), l = r.cols.map((s) => ({
1838
- header: Mt(s) || s.field,
1851
+ }, $r = (e = {}) => {
1852
+ const r = { ...Ke, ...e };
1853
+ _n(new Blob([Mr(e)], { type: "application/json;charset=utf-8" }), pn(r, "json"));
1854
+ }, Pr = async (e = {}) => {
1855
+ const r = hn(e), l = r.cols.map((s) => ({
1856
+ header: $t(s) || s.field,
1839
1857
  kind: s.type === "number" || s.type === "sequence" ? "number" : s.type === "date" ? "date" : s.type === "boolean" ? "boolean" : "text",
1840
1858
  align: s.align ?? (s.type === "number" || s.type === "sequence" ? "right" : void 0)
1841
1859
  }));
1842
- return Qi(l, r.typed, { sheetName: r.opts.sheetName });
1843
- }, Dr = async (e = {}) => {
1844
- const r = { ...We, ...e };
1845
- gn(await Cr(e), cn(r, "xlsx"));
1846
- }, Tr = async (e = {}) => {
1860
+ return gl(l, r.typed, { sheetName: r.opts.sheetName });
1861
+ }, Lr = async (e = {}) => {
1862
+ const r = { ...Ke, ...e };
1863
+ _n(await Pr(e), pn(r, "xlsx"));
1864
+ }, Or = async (e = {}) => {
1847
1865
  var l;
1848
- const r = an(e);
1849
- return Oi(
1866
+ const r = hn(e);
1867
+ return Qi(
1850
1868
  {
1851
1869
  headers: r.headers,
1852
1870
  rows: r.display.map((s) => s.map((c) => c == null ? "" : String(c))),
@@ -1855,154 +1873,154 @@ function sl({
1855
1873
  },
1856
1874
  r.opts.pdf,
1857
1875
  // Only when asked: read the grid's colours, stripes and borders from the page
1858
- (l = r.opts.pdf) != null && l.matchGridStyle ? Ri(Qn.current) : void 0
1876
+ (l = r.opts.pdf) != null && l.matchGridStyle ? el(or.current) : void 0
1859
1877
  );
1860
- }, Fr = async (e = {}) => {
1861
- const r = { ...We, ...e };
1862
- gn(await Tr(e), cn(r, "pdf"));
1863
- }, Er = async (e, r = {}) => e === "csv" ? kr(r) : e === "json" ? Nr(r) : e === "xlsx" ? Dr(r) : Fr(r), Ir = async (e, r = {}) => {
1878
+ }, Rr = async (e = {}) => {
1879
+ const r = { ...Ke, ...e };
1880
+ _n(await Or(e), pn(r, "pdf"));
1881
+ }, Ur = async (e, r = {}) => e === "csv" ? Ir(r) : e === "json" ? $r(r) : e === "xlsx" ? Lr(r) : Rr(r), Ar = async (e, r = {}) => {
1864
1882
  try {
1865
- await Er(e, r);
1883
+ await Ur(e, r);
1866
1884
  } catch (l) {
1867
1885
  const s = l instanceof Error ? l : new Error(String(l));
1868
1886
  mt ? mt(s, e) : console.error(`[react-gridix] ${e.toUpperCase()} export failed:`, s);
1869
1887
  }
1870
- }, [Mr, jo] = z("visible"), Ko = Je.filter((e) => Xt.has(e.id)).length, $r = [
1871
- { value: "visible", label: "Visible rows", count: K.length },
1888
+ }, [Wr, ni] = j("visible"), ri = Qe.filter((e) => Zt.has(e.id)).length, Br = [
1889
+ { value: "visible", label: "Visible rows", count: z.length },
1872
1890
  // Without pagination the visible rows already are every matching row
1873
- ...R ? [{ value: "filtered", label: "All matching rows", count: $e.length }] : [],
1874
- ...ue ? [{ value: "selected", label: "Selected rows", count: Ko }] : []
1875
- ], zo = $r.some((e) => e.value === Mr && e.count > 0) ? Mr : "visible";
1891
+ ...A ? [{ value: "filtered", label: "All matching rows", count: Me.length }] : [],
1892
+ ...fe ? [{ value: "selected", label: "Selected rows", count: ri }] : []
1893
+ ], oi = Br.some((e) => e.value === Wr && e.count > 0) ? Wr : "visible";
1876
1894
  ne(() => {
1877
- Le && (Le.current = {
1878
- getCsv: vr,
1879
- exportCsv: kr,
1880
- getJson: Sr,
1881
- exportJson: Nr,
1882
- getXlsx: Cr,
1883
- exportXlsx: Dr,
1884
- getPdf: Tr,
1885
- exportPdf: Fr,
1886
- exportAs: Er,
1887
- getSelectedRows: () => rr(De),
1888
- getSelectedRowIds: () => De,
1889
- selectAll: () => sr(!0),
1890
- clearSelection: () => Ht([]),
1895
+ Oe && (Oe.current = {
1896
+ getCsv: Er,
1897
+ exportCsv: Ir,
1898
+ getJson: Mr,
1899
+ exportJson: $r,
1900
+ getXlsx: Pr,
1901
+ exportXlsx: Lr,
1902
+ getPdf: Or,
1903
+ exportPdf: Rr,
1904
+ exportAs: Ur,
1905
+ getSelectedRows: () => cr(Ce),
1906
+ getSelectedRowIds: () => Ce,
1907
+ selectAll: () => hr(!0),
1908
+ clearSelection: () => Jt([]),
1891
1909
  refresh: () => {
1892
- _ && Vt(zt.current);
1910
+ _ && Gt(Vt.current);
1893
1911
  }
1894
1912
  });
1895
1913
  }), ne(
1896
1914
  () => () => {
1897
- Le && (Le.current = null);
1915
+ Oe && (Oe.current = null);
1898
1916
  },
1899
- [Le]
1917
+ [Oe]
1900
1918
  );
1901
- const Pr = (e) => {
1902
- var l, s, c, f, y, N, M, O;
1919
+ const jr = (e) => {
1920
+ var l, s, c, u, y, N, M, R;
1903
1921
  const r = e.checkbox ?? {};
1904
1922
  return {
1905
- variant: r.variant ?? Ce,
1923
+ variant: r.variant ?? ot,
1906
1924
  indicator: r.indicator,
1907
1925
  className: r.className,
1908
1926
  style: r.style,
1909
1927
  classNames: {
1910
- root: U(Y.checkbox, (l = r.classNames) == null ? void 0 : l.root),
1911
- control: U(Y.checkboxControl, (s = r.classNames) == null ? void 0 : s.control),
1912
- indicator: U(Y.checkboxIndicator, (c = r.classNames) == null ? void 0 : c.indicator),
1913
- label: (f = r.classNames) == null ? void 0 : f.label
1928
+ root: U(X.checkbox, (l = r.classNames) == null ? void 0 : l.root),
1929
+ control: U(X.checkboxControl, (s = r.classNames) == null ? void 0 : s.control),
1930
+ indicator: U(X.checkboxIndicator, (c = r.classNames) == null ? void 0 : c.indicator),
1931
+ label: (u = r.classNames) == null ? void 0 : u.label
1914
1932
  },
1915
1933
  styles: {
1916
- root: { ...A.checkbox, ...(y = r.styles) == null ? void 0 : y.root },
1917
- control: { ...A.checkboxControl, ...(N = r.styles) == null ? void 0 : N.control },
1918
- indicator: { ...A.checkboxIndicator, ...(M = r.styles) == null ? void 0 : M.indicator },
1919
- label: (O = r.styles) == null ? void 0 : O.label
1934
+ root: { ...K.checkbox, ...(y = r.styles) == null ? void 0 : y.root },
1935
+ control: { ...K.checkboxControl, ...(N = r.styles) == null ? void 0 : N.control },
1936
+ indicator: { ...K.checkboxIndicator, ...(M = r.styles) == null ? void 0 : M.indicator },
1937
+ label: (R = r.styles) == null ? void 0 : R.label
1920
1938
  }
1921
1939
  };
1922
- }, Ze = (e) => e.stopPropagation(), qo = (e, r) => /* @__PURE__ */ h("span", { className: "rg-grid__checkbox-cell", onClick: Ze, onDoubleClick: Ze, children: /* @__PURE__ */ h(
1923
- ht,
1940
+ }, tt = (e) => e.stopPropagation(), ii = (e, r) => /* @__PURE__ */ h("span", { className: "rg-grid__checkbox-cell", onClick: tt, onDoubleClick: tt, children: /* @__PURE__ */ h(
1941
+ ft,
1924
1942
  {
1925
- ...Pr(e),
1943
+ ...jr(e),
1926
1944
  checked: !!r.value,
1927
1945
  disabled: !r.editable,
1928
- "aria-label": `Toggle ${et(e)}`,
1946
+ "aria-label": `Toggle ${nt(e)}`,
1929
1947
  onChange: (l) => r.updateValue(l)
1930
1948
  }
1931
- ) }), Lr = (e) => $e.filter((r) => Fn(e, Qt(e, r.row, r.index))), Yo = (e, r) => {
1932
- const l = new Map(Lr(e).map((f) => [f.index, f])), s = [], c = at.current.map((f, y) => {
1949
+ ) }), Kr = (e) => Me.filter((r) => On(e, tn(e, r.row, r.index))), li = (e, r) => {
1950
+ const l = new Map(Kr(e).map((u) => [u.index, u])), s = [], c = st.current.map((u, y) => {
1933
1951
  const N = l.get(y);
1934
- if (!N) return f;
1935
- const M = ve(f, e.field);
1936
- if (!!M === r || e.validate && !e.validate(r, f)) return f;
1937
- const O = zn(f, e.field, r);
1938
- return s.push({ rowId: N.id, rowIndex: y, field: e.field, oldValue: M, newValue: r, row: O }), O;
1952
+ if (!N) return u;
1953
+ const M = we(u, e.field);
1954
+ if (!!M === r || e.validate && !e.validate(r, u)) return u;
1955
+ const R = Gn(u, e.field, r);
1956
+ return s.push({ rowId: N.id, rowIndex: y, field: e.field, oldValue: M, newValue: r, row: R }), R;
1939
1957
  });
1940
- s.length !== 0 && (Vn(c), s.forEach((f) => d == null ? void 0 : d(f)), a == null || a(c));
1941
- }, Vo = (e) => {
1942
- const r = Lr(e), l = r.length > 0 ? r : $e, s = l.filter((f) => !!ve(f.row, e.field)).length, c = l.length > 0 && s === l.length;
1943
- return /* @__PURE__ */ h("span", { className: "rg-grid__header-checkbox", onClick: Ze, onDoubleClick: Ze, children: /* @__PURE__ */ h(
1944
- ht,
1958
+ s.length !== 0 && (Qn(c), s.forEach((u) => d == null ? void 0 : d(u)), a == null || a(c));
1959
+ }, si = (e) => {
1960
+ const r = Kr(e), l = r.length > 0 ? r : Me, s = l.filter((u) => !!we(u.row, e.field)).length, c = l.length > 0 && s === l.length;
1961
+ return /* @__PURE__ */ h("span", { className: "rg-grid__header-checkbox", onClick: tt, onDoubleClick: tt, children: /* @__PURE__ */ h(
1962
+ ft,
1945
1963
  {
1946
- ...Pr(e),
1964
+ ...jr(e),
1947
1965
  checked: c,
1948
1966
  indeterminate: s > 0 && !c,
1949
1967
  disabled: r.length === 0,
1950
- label: Mt(e) || void 0,
1951
- "aria-label": `Select all ${et(e)}`,
1952
- onChange: (f) => Yo(e, f)
1968
+ label: $t(e) || void 0,
1969
+ "aria-label": `Select all ${nt(e)}`,
1970
+ onChange: (u) => li(e, u)
1953
1971
  }
1954
1972
  ) });
1955
- }, Ho = (e, r, l) => {
1973
+ }, ai = (e, r, l) => {
1956
1974
  if (r.cellEditor)
1957
1975
  return /* @__PURE__ */ h(
1958
1976
  "div",
1959
1977
  {
1960
1978
  className: "rg-grid__custom-editor",
1961
1979
  onBlur: (c) => {
1962
- c.currentTarget.contains(c.relatedTarget) || l.session === Oe.current && (Qe(e, r, { value: Wt.current }, { focus: !1 }) || Ae());
1980
+ c.currentTarget.contains(c.relatedTarget) || l.session === Ue.current && (et(e, r, { value: zt.current }, { focus: !1 }) || Be());
1963
1981
  },
1964
1982
  onKeyDown: (c) => {
1965
- c.key === "Escape" && (c.preventDefault(), c.stopPropagation(), Ae(), en(e.id, r.field));
1983
+ c.key === "Escape" && (c.preventDefault(), c.stopPropagation(), Be(), rn(e.id, r.field));
1966
1984
  },
1967
- children: Ke(r.cellEditor, {
1985
+ children: Pe(r.cellEditor, {
1968
1986
  value: l.draft,
1969
1987
  row: e.row,
1970
1988
  rowIndex: e.index,
1971
1989
  field: r.field,
1972
1990
  column: r,
1973
1991
  onChange: (c) => {
1974
- Wt.current = c, Ge((f) => f && f.session === l.session ? { ...f, draft: c, invalid: !1 } : f);
1992
+ zt.current = c, Ze((u) => u && u.session === l.session ? { ...u, draft: c, invalid: !1 } : u);
1975
1993
  },
1976
- onCommit: (c, f = "none") => {
1977
- l.session === Oe.current && Qe(e, r, { value: c === void 0 ? Wt.current : c }, { move: f });
1994
+ onCommit: (c, u = "none") => {
1995
+ l.session === Ue.current && et(e, r, { value: c === void 0 ? zt.current : c }, { move: u });
1978
1996
  },
1979
1997
  onCancel: () => {
1980
- Ae(), en(e.id, r.field);
1998
+ Be(), rn(e.id, r.field);
1981
1999
  }
1982
2000
  })
1983
2001
  }
1984
2002
  );
1985
2003
  const s = r.type === "date";
1986
2004
  return s ? /* @__PURE__ */ h(
1987
- pi,
2005
+ Ii,
1988
2006
  {
1989
2007
  value: l.draft === null || l.draft === void 0 ? "" : String(l.draft),
1990
- label: `Edit ${et(r)}`,
2008
+ label: `Edit ${nt(r)}`,
1991
2009
  invalid: l.invalid,
1992
2010
  min: r.dateMin,
1993
2011
  max: r.dateMax,
1994
2012
  locale: r.dateLocale,
1995
- theme: F,
1996
- className: U("rg-grid__editor", l.invalid && "rg-grid__editor--invalid", Y.editor),
1997
- style: { textAlign: r.align, ...A.editor },
1998
- onChange: (c) => Ge((f) => f && { ...f, draft: c, invalid: !1 }),
2013
+ theme: Z,
2014
+ className: U("rg-grid__editor", l.invalid && "rg-grid__editor--invalid", X.editor),
2015
+ style: { textAlign: r.align, ...K.editor },
2016
+ onChange: (c) => Ze((u) => u && { ...u, draft: c, invalid: !1 }),
1999
2017
  onPick: (c) => {
2000
- l.session === Oe.current && Qe(e, r, { text: c }, { focus: !0 });
2018
+ l.session === Ue.current && et(e, r, { text: c }, { focus: !0 });
2001
2019
  },
2002
2020
  onBlur: (c) => {
2003
- l.session === Oe.current && (Qe(e, r, { text: c.currentTarget.value }, { focus: !1 }) || Ae());
2021
+ l.session === Ue.current && (et(e, r, { text: c.currentTarget.value }, { focus: !1 }) || Be());
2004
2022
  },
2005
- onKeyDown: (c) => ur(c, e, r)
2023
+ onKeyDown: (c) => br(c, e, r)
2006
2024
  }
2007
2025
  ) : /* @__PURE__ */ h(
2008
2026
  "input",
@@ -2011,155 +2029,165 @@ function sl({
2011
2029
  type: s ? "date" : "text",
2012
2030
  min: s ? r.dateMin : void 0,
2013
2031
  max: s ? r.dateMax : void 0,
2014
- className: U("rg-grid__editor", l.invalid && "rg-grid__editor--invalid", Y.editor),
2015
- style: { textAlign: r.align, ...A.editor },
2032
+ className: U("rg-grid__editor", l.invalid && "rg-grid__editor--invalid", X.editor),
2033
+ style: { textAlign: r.align, ...K.editor },
2016
2034
  value: l.draft === null || l.draft === void 0 ? "" : String(l.draft),
2017
2035
  inputMode: r.type === "number" ? "decimal" : void 0,
2018
- "aria-label": `Edit ${et(r)}`,
2036
+ "aria-label": `Edit ${nt(r)}`,
2019
2037
  "aria-invalid": l.invalid || void 0,
2020
2038
  onChange: (c) => {
2021
- const f = c.target.value;
2022
- Ge((y) => y && { ...y, draft: f, invalid: !1 });
2039
+ const u = c.target.value;
2040
+ Ze((y) => y && { ...y, draft: u, invalid: !1 });
2023
2041
  },
2024
2042
  onFocus: (c) => {
2025
- const f = c.currentTarget;
2026
- s || (l.select === "all" ? f.select() : f.setSelectionRange(f.value.length, f.value.length));
2043
+ const u = c.currentTarget;
2044
+ s || (l.select === "all" ? u.select() : u.setSelectionRange(u.value.length, u.value.length));
2027
2045
  },
2028
2046
  onBlur: (c) => {
2029
- if (l.session === Oe.current) {
2030
- if (io(c.currentTarget)) return Ae();
2031
- Qe(e, r, { text: c.currentTarget.value }, { focus: !1 }) || Ae();
2047
+ if (l.session === Ue.current) {
2048
+ if (po(c.currentTarget)) return Be();
2049
+ et(e, r, { text: c.currentTarget.value }, { focus: !1 }) || Be();
2032
2050
  }
2033
2051
  },
2034
- onKeyDown: (c) => ur(c, e, r)
2052
+ onKeyDown: (c) => br(c, e, r)
2035
2053
  }
2036
2054
  );
2037
- }, Xo = ke(() => {
2055
+ }, ci = ve(() => {
2038
2056
  const e = /* @__PURE__ */ new Map();
2039
- for (const r of W)
2040
- r.filterable && !r.filterRenderer && Kr(r) === "select" && e.set(r.field, bi(r, Ut, (l) => ve(l, r.field), (l) => It(r, l)));
2057
+ for (const r of L)
2058
+ r.filterable && !r.filterRenderer && Jr(r) === "select" && e.set(r.field, Pi(r, Bt, (l) => we(l, r.field), (l) => Mt(r, l)));
2041
2059
  return e;
2042
- }, [W, Ut]), Go = {
2043
- ...rt !== void 0 ? { "--rg-row-duration": `${rt}ms`, "--rg-row-exit-duration": `${Math.round(rt * 0.8)}ms` } : null,
2044
- ...ot !== void 0 ? { "--rg-row-stagger": `${ot}ms` } : null
2045
- }, Jo = Ot || !!ye, Qo = ye ? { "--rg-stripe-a": ye[0], "--rg-stripe-b": ye[1] } : void 0, Zo = Pe && R && (H === "top" || H === "both"), ei = Pe && R && (H === "bottom" || H === "both"), ti = Se && (C || !!yt || pt || !!He), Or = (e) => /* @__PURE__ */ I(
2060
+ }, [L, Bt]), di = {
2061
+ ...Ge !== void 0 ? { "--rg-row-duration": `${Ge}ms`, "--rg-row-exit-duration": `${Math.round(Ge * 0.8)}ms` } : null,
2062
+ ...it !== void 0 ? { "--rg-row-stagger": `${it}ms` } : null
2063
+ }, ui = Ie || !!Se, fi = Se ? { "--rg-stripe-a": Se[0], "--rg-stripe-b": Se[1] } : void 0, hi = Le && A && (V === "top" || V === "both"), pi = Le && A && (V === "bottom" || V === "both"), gi = ke && (C || !!yt || pt || !!He), zr = (e) => /* @__PURE__ */ I(
2046
2064
  "div",
2047
2065
  {
2048
- className: U("rg-grid__footer", e === "top" && "rg-grid__footer--top", Y.footer),
2049
- style: A.footer,
2066
+ className: U("rg-grid__footer", e === "top" && "rg-grid__footer--top", X.footer),
2067
+ style: K.footer,
2050
2068
  "data-position": e,
2051
2069
  children: [
2052
- /* @__PURE__ */ I("span", { ...Z("rowCount", "rg-grid__count"), children: [
2053
- ft === 0 ? "0 rows" : `${So}–${No} of ${ft}`,
2054
- ue && De.length > 0 ? ` · ${De.length} selected` : ""
2070
+ /* @__PURE__ */ I("span", { ...Q("rowCount", "rg-grid__count"), children: [
2071
+ ut === 0 ? "0 rows" : `${Po}–${Lo} of ${ut}`,
2072
+ fe && Ce.length > 0 ? ` · ${Ce.length} selected` : ""
2055
2073
  ] }),
2056
- /* @__PURE__ */ I("div", { ...Z("pagination", "rg-grid__pagination"), children: [
2074
+ /* @__PURE__ */ I("div", { ...Q("pagination", "rg-grid__pagination"), children: [
2057
2075
  /* @__PURE__ */ I("label", { className: "rg-grid__page-size-label", children: [
2058
2076
  "Rows per page",
2059
- /* @__PURE__ */ h("select", { value: oe, onChange: (r) => bo(Number(r.target.value)), ...Z("pageSize", "rg-grid__page-size"), children: (Ee.includes(oe) ? Ee : [...Ee, oe].sort((r, l) => r - l)).map((r) => /* @__PURE__ */ h("option", { value: r, children: r }, r)) })
2077
+ /* @__PURE__ */ h("select", { value: re, onChange: (r) => Do(Number(r.target.value)), ...Q("pageSize", "rg-grid__page-size"), children: (Fe.includes(re) ? Fe : [...Fe, re].sort((r, l) => r - l)).map((r) => /* @__PURE__ */ h("option", { value: r, children: r }, r)) })
2060
2078
  ] }),
2061
- /* @__PURE__ */ h("button", { type: "button", "aria-label": "First page", disabled: ie === 0, onClick: () => dt(0), ...Z("pageButton", "rg-grid__page-btn"), children: "«" }),
2062
- /* @__PURE__ */ h("button", { type: "button", "aria-label": "Previous page", disabled: ie === 0, onClick: () => dt(ie - 1), ...Z("pageButton", "rg-grid__page-btn"), children: "‹" }),
2063
- /* @__PURE__ */ I("span", { ...Z("pageInfo", "rg-grid__page-info"), children: [
2079
+ /* @__PURE__ */ h("button", { type: "button", "aria-label": "First page", disabled: oe === 0, onClick: () => ct(0), ...Q("pageButton", "rg-grid__page-btn"), children: "«" }),
2080
+ /* @__PURE__ */ h("button", { type: "button", "aria-label": "Previous page", disabled: oe === 0, onClick: () => ct(oe - 1), ...Q("pageButton", "rg-grid__page-btn"), children: "‹" }),
2081
+ /* @__PURE__ */ I("span", { ...Q("pageInfo", "rg-grid__page-info"), children: [
2064
2082
  "Page ",
2065
- ie + 1,
2083
+ oe + 1,
2066
2084
  " of ",
2067
- Ue
2085
+ We
2068
2086
  ] }),
2069
- /* @__PURE__ */ h("button", { type: "button", "aria-label": "Next page", disabled: ie >= Ue - 1, onClick: () => dt(ie + 1), ...Z("pageButton", "rg-grid__page-btn"), children: "›" }),
2070
- /* @__PURE__ */ h("button", { type: "button", "aria-label": "Last page", disabled: ie >= Ue - 1, onClick: () => dt(Ue - 1), ...Z("pageButton", "rg-grid__page-btn"), children: "»" })
2087
+ /* @__PURE__ */ h("button", { type: "button", "aria-label": "Next page", disabled: oe >= We - 1, onClick: () => ct(oe + 1), ...Q("pageButton", "rg-grid__page-btn"), children: "›" }),
2088
+ /* @__PURE__ */ h("button", { type: "button", "aria-label": "Last page", disabled: oe >= We - 1, onClick: () => ct(We - 1), ...Q("pageButton", "rg-grid__page-btn"), children: "»" })
2071
2089
  ] })
2072
2090
  ]
2073
2091
  }
2074
- ), ni = (e, r, l) => {
2075
- const s = e.sortIndicator ?? Xe;
2076
- return /* @__PURE__ */ h("span", { ...Z("sortIndicator", U("rg-grid__sort", s !== "default" && "rg-grid__sort--custom")), "aria-hidden": "true", "data-direction": r ?? "none", children: s === "arrow" ? /* @__PURE__ */ h(Ai, { direction: r, priority: l }) : s !== "default" ? Ke(s, { column: e, direction: r, priority: l }) : /* @__PURE__ */ I(tt, { children: [
2077
- r === "asc" ? "▲" : r === "desc" ? "▼" : "↕",
2078
- l !== void 0 && /* @__PURE__ */ h("sup", { className: "rg-grid__sort-order", children: l })
2079
- ] }) });
2080
- }, ri = (e) => /* @__PURE__ */ h("tr", { className: "rg-grid__tr rg-grid__skeleton-row", "aria-hidden": "true", style: de ? { height: ge } : void 0, children: nt ? (
2092
+ ), mi = (e, r, l) => {
2093
+ const s = r === null ? "default" : e.sortIndicator ?? Xe, c = s !== "default", u = Ut && s !== "arrow", y = s === "arrow" ? /* @__PURE__ */ h(tl, { direction: r, priority: l }) : s !== "default" ? Pe(s, { column: e, direction: r, priority: l }) : (
2094
+ // Default: ↕ before sorting, then one ▲ that turns into ▼ (or stays ▲ when not turning)
2095
+ u ? r ? "▲" : "↕" : r === "asc" ? "▲" : r === "desc" ? "▼" : "↕"
2096
+ );
2097
+ return /* @__PURE__ */ I("span", { ...Q("sortIndicator", U("rg-grid__sort", c && "rg-grid__sort--custom")), "aria-hidden": "true", "data-direction": r ?? "none", children: [
2098
+ u ? /* @__PURE__ */ h(nl, { direction: r, children: y }) : y,
2099
+ s === "default" && l !== void 0 && /* @__PURE__ */ h("sup", { className: "rg-grid__sort-order", children: l })
2100
+ ] });
2101
+ }, bi = L.some((e) => e.skeleton), yi = (e) => /* @__PURE__ */ h("tr", { className: "rg-grid__tr rg-grid__skeleton-row", "aria-hidden": "true", style: de ? { height: me } : void 0, children: rt && !bi ? (
2081
2102
  // A custom component draws the whole row content inside one wide cell
2082
- /* @__PURE__ */ h("td", { colSpan: St, className: "rg-grid__td rg-grid__skeleton-cell", children: Ke(nt, { rowIndex: e, columns: W }) })
2083
- ) : /* @__PURE__ */ I(tt, { children: [
2084
- ue && /* @__PURE__ */ h("td", { className: "rg-grid__td", children: /* @__PURE__ */ h("span", { ...Z("skeleton", "rg-grid__skeleton"), style: { ...A.skeleton, width: 18 } }) }),
2085
- W.map((r, l) => /* @__PURE__ */ h("td", { className: "rg-grid__td", style: { textAlign: r.align }, children: /* @__PURE__ */ h("span", { ...Z("skeleton", "rg-grid__skeleton"), style: { ...A.skeleton, width: `${55 + (e * 7 + l * 13) % 35}%` } }) }, r.field))
2086
- ] }) }, `sk${e}`), Rr = (e, r, l = R && !e.sequenceRestartEachPage ? ie * oe : 0) => (e.sequenceStart ?? 1) + l + r, Ur = (e, r, l) => {
2087
- const { row: s, id: c, index: f } = e, y = !!l, N = typeof lt == "function" ? lt(s, f) : lt, M = typeof st == "function" ? st(s, f) : st, O = Xt.has(c), ee = typeof it == "function" ? it(s, f) : it, be = typeof Me == "function" ? Me(s, f) : Me, On = ee || (pr === "none" ? void 0 : U("rg-grid__row--enter", `rg-row-in--${pr}`)), dn = be || U("rg-grid__row--exit", In !== "none" && `rg-row-out--${In}`);
2103
+ /* @__PURE__ */ h("td", { colSpan: Nt, className: "rg-grid__td rg-grid__skeleton-cell", children: Pe(rt, { rowIndex: e, columns: L }) })
2104
+ ) : /* @__PURE__ */ I(ht, { children: [
2105
+ fe && /* @__PURE__ */ h("td", { className: "rg-grid__td", children: /* @__PURE__ */ h("span", { ...Q("skeleton", "rg-grid__skeleton"), style: { ...K.skeleton, width: 18 } }) }),
2106
+ L.map((r, l) => /* @__PURE__ */ h("td", { className: "rg-grid__td", style: { textAlign: r.align }, children: r.skeleton ? (
2107
+ // The column's own placeholder
2108
+ Pe(r.skeleton, { rowIndex: e, column: r })
2109
+ ) : (
2110
+ /* Vary the bar widths a little so the placeholder does not look like a grid of identical stripes */
2111
+ /* @__PURE__ */ h("span", { ...Q("skeleton", "rg-grid__skeleton"), style: { ...K.skeleton, width: `${55 + (e * 7 + l * 13) % 35}%` } })
2112
+ ) }, r.field))
2113
+ ] }) }, `sk${e}`), qr = (e, r, l = A && !e.sequenceRestartEachPage ? oe * re : 0) => (e.sequenceStart ?? 1) + l + r, Yr = (e, r, l) => {
2114
+ const { row: s, id: c, index: u } = e, y = !!l, N = typeof Sn == "function" ? Sn(s, u) : Sn, M = typeof Nn == "function" ? Nn(s, u) : Nn, R = Zt.has(c), ee = typeof lt == "function" ? lt(s, u) : lt, ye = typeof T == "function" ? T(s, u) : T, jn = ee || (_r === "none" ? void 0 : U("rg-grid__row--enter", `rg-row-in--${_r}`)), mn = ye || U("rg-grid__row--exit", Un !== "none" && `rg-row-out--${Un}`);
2088
2115
  return /* @__PURE__ */ I(
2089
2116
  "tr",
2090
2117
  {
2091
- onClick: bt && !y ? () => bt(s, f) : void 0,
2118
+ onClick: bt && !y ? () => bt(s, u) : void 0,
2092
2119
  "aria-hidden": y || void 0,
2093
- onAnimationEnd: l ? ($) => $.target === $.currentTarget && Pn(l.id) : void 0,
2094
- "aria-selected": ue ? O : void 0,
2120
+ onAnimationEnd: l ? ($) => $.target === $.currentTarget && Bn(l.id) : void 0,
2121
+ "aria-selected": fe ? R : void 0,
2095
2122
  className: U(
2096
2123
  "rg-grid__tr",
2097
2124
  "rg-grid__row",
2098
- Jo && (r % 2 === 0 ? "rg-grid__row--stripe-a" : "rg-grid__row--stripe-b"),
2125
+ ui && (r % 2 === 0 ? "rg-grid__row--stripe-a" : "rg-grid__row--stripe-b"),
2099
2126
  // Rows are not animated while virtualizing. New rows play the enter class once, when they are created.
2100
- Mn && !y && On,
2101
- y && dn,
2102
- O && "rg-grid__row--selected",
2127
+ An && !y && jn,
2128
+ y && mn,
2129
+ R && "rg-grid__row--selected",
2103
2130
  bt && "rg-grid__row--clickable",
2104
- Y.row,
2131
+ X.row,
2105
2132
  N
2106
2133
  ),
2107
2134
  style: {
2108
- ...Mn ? { "--rg-i": l ? Math.min(l.batch, 24) : Ro(c) } : null,
2109
- ...de ? { height: ge } : null,
2110
- ...A.row,
2135
+ ...An ? { "--rg-i": l ? Math.min(l.batch, 24) : Vo(c) } : null,
2136
+ ...de ? { height: me } : null,
2137
+ ...K.row,
2111
2138
  ...M
2112
2139
  },
2113
2140
  children: [
2114
- ue && /* @__PURE__ */ h(
2141
+ fe && /* @__PURE__ */ h(
2115
2142
  "td",
2116
2143
  {
2117
- className: U("rg-grid__td rg-grid__select-cell", ln && "rg-grid__pinned rg-grid__pinned--left"),
2118
- style: { width: je, minWidth: je, maxWidth: je, ...ln ? { left: 0 } : null },
2119
- onClick: Ze,
2120
- children: /* @__PURE__ */ h("span", { className: "rg-grid__checkbox-cell", onClickCapture: ($) => or.current = $.shiftKey, children: /* @__PURE__ */ h(
2121
- ht,
2144
+ className: U("rg-grid__td rg-grid__select-cell", un && "rg-grid__pinned rg-grid__pinned--left"),
2145
+ style: { width: $e, minWidth: $e, maxWidth: $e, ...un ? { left: 0 } : null },
2146
+ onClick: tt,
2147
+ children: /* @__PURE__ */ h("span", { className: "rg-grid__checkbox-cell", onClickCapture: ($) => dr.current = $.shiftKey, children: /* @__PURE__ */ h(
2148
+ ft,
2122
2149
  {
2123
- variant: Ce,
2124
- checked: O,
2125
- disabled: y || !Gt(s),
2126
- "aria-label": ue === "single" ? "Select row" : `Select row ${f + 1}`,
2127
- onChange: ($) => To(e, $),
2128
- classNames: { root: Y.checkbox, control: Y.checkboxControl, indicator: Y.checkboxIndicator },
2129
- styles: { root: A.checkbox, control: A.checkboxControl, indicator: A.checkboxIndicator }
2150
+ variant: ot,
2151
+ checked: R,
2152
+ disabled: y || !Qt(s),
2153
+ "aria-label": fe === "single" ? "Select row" : `Select row ${u + 1}`,
2154
+ onChange: ($) => Uo(e, $),
2155
+ classNames: { root: X.checkbox, control: X.checkboxControl, indicator: X.checkboxIndicator },
2156
+ styles: { root: K.checkbox, control: K.checkboxControl, indicator: K.checkboxIndicator }
2130
2157
  }
2131
2158
  ) })
2132
2159
  }
2133
2160
  ),
2134
- W.map(($, Tt) => {
2135
- let J = Fo($, e);
2161
+ L.map(($, Ft) => {
2162
+ let J = Ao($, e);
2136
2163
  if ($.type === "sequence") {
2137
- const Ne = Rr($, r);
2164
+ const Ne = qr($, r);
2138
2165
  J = { ...J, value: Ne, formattedValue: $.valueFormatter ? $.valueFormatter(Ne, s) : String(Ne), editable: !1 };
2139
2166
  }
2140
- const Rn = typeof $.cellClassName == "function" ? $.cellClassName(J) : $.cellClassName, te = typeof $.cellStyle == "function" ? $.cellStyle(J) : $.cellStyle, _e = vt !== null && vt.id === c && vt.field === $.field, le = Zt($, J), un = wr($, Tt), fn = wn ? wn.id === c && wn.field === $.field : r === 0 && Tt === 0;
2167
+ const Kn = typeof $.cellClassName == "function" ? $.cellClassName(J) : $.cellClassName, te = typeof $.cellStyle == "function" ? $.cellStyle(J) : $.cellStyle, xe = kt !== null && kt.id === c && kt.field === $.field, ie = nn($, J), bn = Fr($, Ft), yn = Tn ? Tn.id === c && Tn.field === $.field : r === 0 && Ft === 0;
2141
2168
  return /* @__PURE__ */ h(
2142
2169
  "td",
2143
2170
  {
2144
2171
  ref: y ? void 0 : (Ne) => {
2145
- const Ar = jn(c, $.field);
2146
- Ne ? jt.current.set(Ar, Ne) : jt.current.delete(Ar);
2172
+ const Vr = Hn(c, $.field);
2173
+ Ne ? qt.current.set(Vr, Ne) : qt.current.delete(Vr);
2147
2174
  },
2148
- tabIndex: y ? void 0 : Ve ? fn ? 0 : -1 : le ? 0 : void 0,
2149
- onFocus: Ve && !y ? (Ne) => Ne.target === Ne.currentTarget && Jn({ id: c, field: $.field }) : void 0,
2150
- onDoubleClick: le && !y ? () => tn(e, $) : void 0,
2151
- onKeyDown: y ? void 0 : (Ne) => $o(Ne, e, $, J),
2175
+ tabIndex: y ? void 0 : Ve ? yn ? 0 : -1 : ie ? 0 : void 0,
2176
+ onFocus: Ve && !y ? (Ne) => Ne.target === Ne.currentTarget && rr({ id: c, field: $.field }) : void 0,
2177
+ onDoubleClick: ie && !y ? () => on(e, $) : void 0,
2178
+ onKeyDown: y ? void 0 : (Ne) => Ko(Ne, e, $, J),
2152
2179
  className: U(
2153
2180
  "rg-grid__td",
2154
- le && "rg-grid__td--editable",
2155
- _e && "rg-grid__td--editing",
2156
- un.className,
2157
- Y.cell,
2181
+ ie && "rg-grid__td--editable",
2182
+ xe && "rg-grid__td--editing",
2183
+ dn($) && !xe && `rg-grid__cell--${dn($)}`,
2184
+ bn.className,
2185
+ X.cell,
2158
2186
  $.className,
2159
- Rn
2187
+ Kn
2160
2188
  ),
2161
- style: { textAlign: $.align, ...A.cell, ...$.style, ...te, ...un.style },
2162
- children: _e && vt && !y ? Ho(e, $, vt) : $.cellRenderer ? Ke($.cellRenderer, J) : $.type === "boolean" && !$.cellEditor ? qo($, J) : J.formattedValue
2189
+ style: { textAlign: $.align, ...Dr($), ...K.cell, ...$.style, ...te, ...bn.style },
2190
+ children: xe && kt && !y ? ai(e, $, kt) : $.cellRenderer ? Pe($.cellRenderer, J) : $.type === "boolean" && !$.cellEditor ? ii($, J) : J.formattedValue
2163
2191
  },
2164
2192
  $.field
2165
2193
  );
@@ -2168,161 +2196,180 @@ function sl({
2168
2196
  },
2169
2197
  y ? `ghost:${c}` : c
2170
2198
  );
2171
- }, oi = Re.trim() !== "" || ut.length > 0 ? "no-results" : "no-data", ii = qe ?? (R ? Math.min(oe, 20) : 5);
2199
+ }, xi = Ae.trim() !== "" || dt.length > 0 ? "no-results" : "no-data", _i = qe ?? (A ? Math.min(re, 20) : 5), gn = (ae || Je) && P === void 0 && !de, wi = typeof Re == "number" ? `${Re}px` : Re, vi = gn ? {
2200
+ "--rg-sticky-offset": wi,
2201
+ // The header sits just under the toolbar when the toolbar is sticky too
2202
+ "--rg-sticky-toolbar-h": ae ? `${Xo}px` : "0px"
2203
+ } : null;
2172
2204
  return /* @__PURE__ */ I(
2173
2205
  "div",
2174
2206
  {
2175
- ref: Qn,
2176
- className: U("rg-grid", de && "rg-grid--virtual", Y.root, L),
2177
- style: { ...Qo, ...Go, ...A.root, ...xe },
2178
- "data-rg-theme": F || void 0,
2179
- "aria-busy": Nt || void 0,
2207
+ ref: or,
2208
+ className: U(
2209
+ "rg-grid",
2210
+ de && "rg-grid--virtual",
2211
+ gn && "rg-grid--sticky-page",
2212
+ gn && ae && "rg-grid--sticky-toolbar",
2213
+ gn && Je && "rg-grid--sticky-header",
2214
+ X.root,
2215
+ Wt
2216
+ ),
2217
+ style: { ...fi, ...di, ...vi, ...K.root, ...So },
2218
+ "data-rg-theme": Z || void 0,
2219
+ "aria-busy": Ct || void 0,
2180
2220
  children: [
2181
- ti && /* @__PURE__ */ I("div", { ...Z("toolbar", "rg-grid__toolbar"), children: [
2221
+ gi && /* @__PURE__ */ I("div", { ref: Cr, ...Q("toolbar", "rg-grid__toolbar"), children: [
2182
2222
  /* @__PURE__ */ I("div", { className: "rg-grid__toolbar-left", children: [
2183
2223
  C && /* @__PURE__ */ h(
2184
2224
  "input",
2185
2225
  {
2186
2226
  type: "search",
2187
- value: _t,
2188
- onChange: (e) => Hn(e.target.value),
2189
- placeholder: T,
2227
+ value: wt,
2228
+ onChange: (e) => er(e.target.value),
2229
+ placeholder: F,
2190
2230
  "aria-label": "Search all columns",
2191
- ...Z("search", "rg-grid__search")
2231
+ ...Q("search", "rg-grid__search")
2192
2232
  }
2193
2233
  ),
2194
- ue && De.length > 0 && /* @__PURE__ */ I("span", { className: "rg-grid__selected-count", role: "status", children: [
2195
- De.length,
2234
+ fe && Ce.length > 0 && /* @__PURE__ */ I("span", { className: "rg-grid__selected-count", role: "status", children: [
2235
+ Ce.length,
2196
2236
  " selected"
2197
2237
  ] })
2198
2238
  ] }),
2199
2239
  /* @__PURE__ */ I("div", { className: "rg-grid__toolbar-actions", children: [
2200
2240
  yt,
2201
2241
  pt && /* @__PURE__ */ h(
2202
- Si,
2242
+ Bi,
2203
2243
  {
2204
2244
  columns: t,
2205
- hidden: At,
2206
- onToggle: xo,
2207
- theme: F,
2208
- className: Y.toolButton,
2209
- style: A.toolButton
2245
+ hidden: jt,
2246
+ onToggle: Fo,
2247
+ theme: Z,
2248
+ className: X.toolButton,
2249
+ style: K.toolButton
2210
2250
  }
2211
2251
  ),
2212
- He && (sn.length > 1 ? (
2252
+ He && (fn.length > 1 ? (
2213
2253
  // Several formats: a menu with "which rows" and one button per format
2214
2254
  /* @__PURE__ */ h(
2215
- Ii,
2255
+ Hi,
2216
2256
  {
2217
- formats: sn,
2218
- scopes: $r,
2219
- scope: zo,
2220
- onScopeChange: jo,
2221
- onExport: (e, r) => Ir(e, { scope: r }),
2222
- theme: F,
2223
- className: U(Y.toolButton, Y.exportMenu),
2224
- style: { ...A.toolButton, ...A.exportMenu }
2257
+ formats: fn,
2258
+ scopes: Br,
2259
+ scope: oi,
2260
+ onScopeChange: ni,
2261
+ onExport: (e, r) => Ar(e, { scope: r }),
2262
+ theme: Z,
2263
+ className: U(X.toolButton, X.exportMenu),
2264
+ style: { ...K.toolButton, ...K.exportMenu }
2225
2265
  }
2226
2266
  )
2227
2267
  ) : (
2228
2268
  // One format: a plain button ("Export CSV"), using the scope from `exportable` (default: all matching rows)
2229
- /* @__PURE__ */ h("button", { type: "button", onClick: () => Ir(sn[0]), ...Z("toolButton", "rg-grid__tool-btn"), children: Ei(sn[0]) })
2269
+ /* @__PURE__ */ h("button", { type: "button", onClick: () => Ar(fn[0]), ...Q("toolButton", "rg-grid__tool-btn"), children: Vi(fn[0]) })
2230
2270
  ))
2231
2271
  ] })
2232
2272
  ] }),
2233
- Zo && Or("top"),
2273
+ hi && zr("top"),
2234
2274
  /* @__PURE__ */ h(
2235
2275
  "div",
2236
2276
  {
2237
- ref: kt,
2238
- ...Z("scroll", "rg-grid__scroll"),
2239
- onScroll: de ? (e) => Zn({ top: e.currentTarget.scrollTop, height: e.currentTarget.clientHeight }) : void 0,
2240
- style: { ...A.scroll, ...Q !== void 0 ? { maxHeight: Q } : de ? { maxHeight: 400 } : null },
2277
+ ref: St,
2278
+ ...Q("scroll", U("rg-grid__scroll", `rg-grid__scroll--${At}`)),
2279
+ onScroll: de ? (e) => ir({ top: e.currentTarget.scrollTop, height: e.currentTarget.clientHeight }) : void 0,
2280
+ style: { ...K.scroll, ...P !== void 0 ? { maxHeight: P } : de ? { maxHeight: 400 } : null },
2241
2281
  children: /* @__PURE__ */ I(
2242
2282
  "table",
2243
2283
  {
2244
- ...Z("table", "rg-grid__table"),
2284
+ ...Q("table", "rg-grid__table"),
2245
2285
  role: "grid",
2246
- style: Ln ? {
2247
- ...A.table,
2286
+ style: an ? {
2287
+ ...K.table,
2248
2288
  tableLayout: "fixed",
2249
- width: W.reduce((e, r) => e + on(r), ue ? je : 0),
2289
+ width: L.reduce((e, r) => e + cn(r), fe ? $e : 0),
2250
2290
  minWidth: "100%"
2251
- } : A.table,
2291
+ } : Zo ? {
2292
+ ...K.table,
2293
+ tableLayout: "fixed",
2294
+ // Every width is a number: the table is exactly as wide as their sum (no stretching)
2295
+ ...Qo ? { width: L.reduce((e, r) => e + r.width, fe ? $e : 0) } : null
2296
+ } : K.table,
2252
2297
  children: [
2253
- /* @__PURE__ */ h("thead", { ...Z("thead", "rg-grid__thead"), children: /* @__PURE__ */ I("tr", { ...Z("headerRow", "rg-grid__tr"), children: [
2254
- ue && /* @__PURE__ */ h(
2298
+ /* @__PURE__ */ h("thead", { ...Q("thead", "rg-grid__thead"), children: /* @__PURE__ */ I("tr", { ...Q("headerRow", "rg-grid__tr"), children: [
2299
+ fe && /* @__PURE__ */ h(
2255
2300
  "th",
2256
2301
  {
2257
2302
  scope: "col",
2258
- className: U("rg-grid__th rg-grid__select-cell", ln && "rg-grid__pinned rg-grid__pinned--left", Y.headerCell),
2259
- style: { width: je, minWidth: je, maxWidth: je, ...ln ? { left: 0 } : null, ...A.headerCell },
2260
- children: ue === "multiple" && /* @__PURE__ */ h("span", { className: "rg-grid__checkbox-cell", children: /* @__PURE__ */ h(
2261
- ht,
2303
+ className: U("rg-grid__th rg-grid__select-cell", un && "rg-grid__pinned rg-grid__pinned--left", X.headerCell),
2304
+ style: { width: $e, minWidth: $e, maxWidth: $e, ...un ? { left: 0 } : null, ...K.headerCell },
2305
+ children: fe === "multiple" && /* @__PURE__ */ h("span", { className: "rg-grid__checkbox-cell", children: /* @__PURE__ */ h(
2306
+ ft,
2262
2307
  {
2263
- variant: Ce,
2264
- checked: lr,
2265
- indeterminate: ir > 0 && !lr,
2266
- disabled: Ct.length === 0,
2308
+ variant: ot,
2309
+ checked: fr,
2310
+ indeterminate: ur > 0 && !fr,
2311
+ disabled: Dt.length === 0,
2267
2312
  "aria-label": "Select all rows",
2268
- onChange: sr,
2269
- classNames: { root: Y.checkbox, control: Y.checkboxControl, indicator: Y.checkboxIndicator },
2270
- styles: { root: A.checkbox, control: A.checkboxControl, indicator: A.checkboxIndicator }
2313
+ onChange: hr,
2314
+ classNames: { root: X.checkbox, control: X.checkboxControl, indicator: X.checkboxIndicator },
2315
+ styles: { root: K.checkbox, control: K.checkboxControl, indicator: K.checkboxIndicator }
2271
2316
  }
2272
2317
  ) })
2273
2318
  }
2274
2319
  ),
2275
- W.map((e, r) => {
2276
- const l = me.findIndex((N) => N.field === e.field), s = l >= 0 ? me[l].direction : null, c = Sn(e), f = tr(e), y = wr(e, r);
2320
+ L.map((e, r) => {
2321
+ const l = be.findIndex((N) => N.field === e.field), s = l >= 0 ? be[l].direction : null, c = In(e), u = sr(e), y = Fr(e, r);
2277
2322
  return /* @__PURE__ */ I(
2278
2323
  "th",
2279
2324
  {
2280
2325
  ref: (N) => {
2281
- N ? wt.current.set(e.field, N) : wt.current.delete(e.field);
2326
+ N ? vt.current.set(e.field, N) : vt.current.delete(e.field);
2282
2327
  },
2283
2328
  scope: "col",
2284
2329
  "aria-sort": s ? s === "asc" ? "ascending" : "descending" : c ? "none" : void 0,
2285
2330
  tabIndex: c ? 0 : void 0,
2286
- onClick: (N) => ar(e, N.shiftKey),
2331
+ onClick: (N) => pr(e, N.shiftKey),
2287
2332
  onKeyDown: (N) => {
2288
- c && N.target === N.currentTarget && (N.key === "Enter" || N.key === " ") && (N.preventDefault(), ar(e, N.shiftKey));
2333
+ c && N.target === N.currentTarget && (N.key === "Enter" || N.key === " ") && (N.preventDefault(), pr(e, N.shiftKey));
2289
2334
  },
2290
- className: U("rg-grid__th", c && "rg-grid__th--sortable", y.className, Y.headerCell, e.className, e.headerClassName),
2335
+ className: U("rg-grid__th", c && "rg-grid__th--sortable", dn(e) && `rg-grid__cell--${dn(e)}`, y.className, X.headerCell, e.className, e.headerClassName),
2291
2336
  style: {
2292
- width: Ln ? on(e) : e.width,
2337
+ width: an ? cn(e) : e.width,
2293
2338
  minWidth: e.minWidth,
2339
+ maxWidth: an ? void 0 : e.maxWidth,
2294
2340
  textAlign: e.align,
2295
- ...A.headerCell,
2341
+ ...Dr(e),
2342
+ ...K.headerCell,
2296
2343
  ...e.style,
2297
2344
  ...e.headerStyle,
2298
2345
  ...y.style
2299
2346
  },
2300
2347
  children: [
2301
2348
  /* @__PURE__ */ I("span", { className: "rg-grid__th-content", children: [
2302
- e.headerRenderer ? Ke(e.headerRenderer, { column: e, sortDirection: s }) : e.headerCheckbox && e.type === "boolean" ? Vo(e) : Mt(e),
2349
+ e.headerRenderer ? Pe(e.headerRenderer, { column: e, sortDirection: s }) : e.headerCheckbox && e.type === "boolean" ? si(e) : /* @__PURE__ */ h("span", { className: "rg-grid__th-label", children: $t(e) }),
2303
2350
  e.filterable && /* @__PURE__ */ h(
2304
- ki,
2351
+ Wi,
2305
2352
  {
2306
2353
  column: e,
2307
- label: et(e),
2308
- kind: f,
2309
- value: ct[e.field],
2354
+ label: nt(e),
2355
+ kind: u,
2356
+ value: at[e.field],
2310
2357
  onChange: (N) => {
2311
- const M = { ...ct };
2312
- N === void 0 ? delete M[e.field] : M[e.field] = N, Xn(M);
2358
+ const M = { ...at };
2359
+ N === void 0 ? delete M[e.field] : M[e.field] = N, tr(M);
2313
2360
  },
2314
- options: Xo.get(e.field) ?? [],
2361
+ options: ci.get(e.field) ?? [],
2315
2362
  debounce: e.filterDebounce ?? ce,
2316
- theme: F,
2317
- indicatorClassName: U(Y.filterIndicator, e.filterIndicatorClassName),
2318
- indicatorStyle: { ...A.filterIndicator, ...e.filterIndicatorStyle },
2319
- popupClassName: U(Y.filterPopup, e.filterPopupClassName),
2320
- popupStyle: { ...A.filterPopup, ...e.filterPopupStyle },
2321
- inputClassName: Y.filterInput,
2322
- inputStyle: A.filterInput
2363
+ theme: Z,
2364
+ indicatorClassName: U(X.filterIndicator, e.filterIndicatorClassName),
2365
+ indicatorStyle: { ...K.filterIndicator, ...e.filterIndicatorStyle },
2366
+ popupClassName: U(X.filterPopup, e.filterPopupClassName),
2367
+ popupStyle: { ...K.filterPopup, ...e.filterPopupStyle },
2368
+ inputClassName: X.filterInput,
2369
+ inputStyle: K.filterInput
2323
2370
  }
2324
2371
  ),
2325
- c && ni(e, s, s && me.length > 1 ? l + 1 : void 0)
2372
+ c && mi(e, s, s && be.length > 1 ? l + 1 : void 0)
2326
2373
  ] }),
2327
2374
  e.resizable && /* @__PURE__ */ h(
2328
2375
  "span",
@@ -2330,10 +2377,10 @@ function sl({
2330
2377
  className: "rg-grid__resizer",
2331
2378
  role: "separator",
2332
2379
  "aria-orientation": "vertical",
2333
- "aria-label": `Resize ${et(e)}`,
2334
- onPointerDown: (N) => Bo(N, e),
2335
- onClick: Ze,
2336
- onDoubleClick: Ze
2380
+ "aria-label": `Resize ${nt(e)}`,
2381
+ onPointerDown: (N) => ei(N, e),
2382
+ onClick: tt,
2383
+ onDoubleClick: tt
2337
2384
  }
2338
2385
  )
2339
2386
  ]
@@ -2342,35 +2389,35 @@ function sl({
2342
2389
  );
2343
2390
  })
2344
2391
  ] }) }),
2345
- /* @__PURE__ */ h("tbody", { ...Z("tbody", "rg-grid__tbody"), children: Nt ? Array.from({ length: ii }, (e, r) => ri(r)) : Cn ? /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ I("td", { colSpan: St, ...Z("empty", "rg-grid__empty rg-grid__error"), role: "alert", children: [
2346
- Pt,
2392
+ /* @__PURE__ */ h("tbody", { ...Q("tbody", "rg-grid__tbody"), children: Ct ? Array.from({ length: _i }, (e, r) => yi(r)) : $n ? /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ I("td", { colSpan: Nt, ...Q("empty", "rg-grid__empty rg-grid__error"), role: "alert", children: [
2393
+ Ot,
2347
2394
  " ",
2348
- /* @__PURE__ */ h("button", { type: "button", className: "rg-grid__tool-btn", onClick: () => Vt(zt.current), children: "Retry" })
2349
- ] }) }) : K.length === 0 && Te.length === 0 ? /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ h("td", { colSpan: St, ...Z("empty", U("rg-grid__empty", xt && "rg-grid__empty--custom")), children: xt ? Ke(xt, {
2350
- reason: oi,
2351
- search: Re.trim(),
2352
- filters: Object.fromEntries(ut),
2353
- columns: W,
2395
+ /* @__PURE__ */ h("button", { type: "button", className: "rg-grid__tool-btn", onClick: () => Gt(Vt.current), children: "Retry" })
2396
+ ] }) }) : z.length === 0 && De.length === 0 ? /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ h("td", { colSpan: Nt, ...Q("empty", U("rg-grid__empty", xt && "rg-grid__empty--custom")), children: xt ? Pe(xt, {
2397
+ reason: xi,
2398
+ search: Ae.trim(),
2399
+ filters: Object.fromEntries(dt),
2400
+ columns: L,
2354
2401
  clearAll: () => {
2355
- Hn(""), Xn({});
2402
+ er(""), tr({});
2356
2403
  }
2357
- }) : Lt }) }) : /* @__PURE__ */ I(tt, { children: [
2358
- Dt && nn > 0 && /* @__PURE__ */ h("tr", { "aria-hidden": "true", className: "rg-grid__spacer", children: /* @__PURE__ */ h("td", { colSpan: St, style: { height: nn * ge } }) }),
2359
- Uo.map((e) => e.kind === "row" ? Ur(e.entry, nn + e.i) : Ur(e.ghost.entry, 0, e.ghost)),
2360
- Dt && En < K.length && /* @__PURE__ */ h("tr", { "aria-hidden": "true", className: "rg-grid__spacer", children: /* @__PURE__ */ h("td", { colSpan: St, style: { height: (K.length - En) * ge } }) })
2404
+ }) : Rt }) }) : /* @__PURE__ */ I(ht, { children: [
2405
+ Tt && ln > 0 && /* @__PURE__ */ h("tr", { "aria-hidden": "true", className: "rg-grid__spacer", children: /* @__PURE__ */ h("td", { colSpan: Nt, style: { height: ln * me } }) }),
2406
+ Ho.map((e) => e.kind === "row" ? Yr(e.entry, ln + e.i) : Yr(e.ghost.entry, 0, e.ghost)),
2407
+ Tt && Rn < z.length && /* @__PURE__ */ h("tr", { "aria-hidden": "true", className: "rg-grid__spacer", children: /* @__PURE__ */ h("td", { colSpan: Nt, style: { height: (z.length - Rn) * me } }) })
2361
2408
  ] }) })
2362
2409
  ]
2363
2410
  }
2364
2411
  )
2365
2412
  }
2366
2413
  ),
2367
- ei && Or("bottom")
2414
+ pi && zr("bottom")
2368
2415
  ]
2369
2416
  }
2370
2417
  );
2371
2418
  }
2372
2419
  export {
2373
- ht as Checkbox,
2374
- sl as DataGrid,
2375
- Ai as SortArrow
2420
+ ft as Checkbox,
2421
+ Sl as DataGrid,
2422
+ tl as SortArrow
2376
2423
  };