react-gridix 0.1.0 → 0.2.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,99 +1,9 @@
1
- import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as je, useId as Me, useRef as Q, useEffect as be, useState as M, useMemo as $e, createElement as ie } from "react";
3
- import { createPortal as lt } from "react-dom";
4
- const ut = je(function({ variant: s = "primary", size: c = "md", loading: h = !1, disabled: v, className: b, children: _, ...m }, E) {
5
- const x = ["rk-btn", `rk-btn--${s}`, `rk-btn--${c}`, b].filter(Boolean).join(" ");
6
- return /* @__PURE__ */ p("button", { ref: E, className: x, disabled: v || h, "aria-busy": h || void 0, ...m, children: [
7
- h && /* @__PURE__ */ o("span", { className: "rk-spinner", "aria-hidden": "true" }),
8
- _
9
- ] });
10
- }), ft = je(function({ label: s, error: c, hint: h, id: v, className: b, ..._ }, m) {
11
- const E = Me(), x = v ?? E, I = c || h ? `${x}-desc` : void 0;
12
- return /* @__PURE__ */ p("div", { className: ["rk-field", b].filter(Boolean).join(" "), children: [
13
- s && /* @__PURE__ */ o("label", { className: "rk-label", htmlFor: x, children: s }),
14
- /* @__PURE__ */ o(
15
- "input",
16
- {
17
- ref: m,
18
- id: x,
19
- className: `rk-input${c ? " rk-input--error" : ""}`,
20
- "aria-invalid": c ? !0 : void 0,
21
- "aria-describedby": I,
22
- ..._
23
- }
24
- ),
25
- (c || h) && /* @__PURE__ */ o("span", { id: I, className: c ? "rk-error-text" : "rk-hint", children: c ?? h })
26
- ] });
27
- });
28
- function ht({ title: l, footer: s, className: c, children: h, ...v }) {
29
- return /* @__PURE__ */ p("div", { className: ["rk-card", c].filter(Boolean).join(" "), ...v, children: [
30
- l && /* @__PURE__ */ o("div", { className: "rk-card__header", children: l }),
31
- /* @__PURE__ */ o("div", { className: "rk-card__body", children: h }),
32
- s && /* @__PURE__ */ o("div", { className: "rk-card__footer", children: s })
33
- ] });
34
- }
35
- function kt({ tone: l = "neutral", className: s, children: c, ...h }) {
36
- return /* @__PURE__ */ o("span", { className: ["rk-badge", `rk-badge--${l}`, s].filter(Boolean).join(" "), ...h, children: c });
37
- }
38
- function bt({ tone: l = "info", title: s, onClose: c, className: h, children: v, ...b }) {
39
- return /* @__PURE__ */ p(
40
- "div",
41
- {
42
- role: l === "danger" || l === "warning" ? "alert" : "status",
43
- className: ["rk-alert", `rk-alert--${l}`, h].filter(Boolean).join(" "),
44
- ...b,
45
- children: [
46
- /* @__PURE__ */ p("div", { className: "rk-alert__content", children: [
47
- s && /* @__PURE__ */ o("strong", { className: "rk-alert__title", children: s }),
48
- /* @__PURE__ */ o("div", { children: v })
49
- ] }),
50
- c && /* @__PURE__ */ o("button", { type: "button", className: "rk-alert__close", "aria-label": "Dismiss", onClick: c, children: "×" })
51
- ]
52
- }
53
- );
54
- }
55
- function gt({ open: l, onClose: s, title: c, footer: h, children: v }) {
56
- const b = Me(), _ = Q(null);
57
- return be(() => {
58
- var I;
59
- if (!l) return;
60
- const m = document.activeElement;
61
- (I = _.current) == null || I.focus();
62
- const E = (P) => {
63
- P.key === "Escape" && s();
64
- };
65
- document.addEventListener("keydown", E);
66
- const x = document.body.style.overflow;
67
- return document.body.style.overflow = "hidden", () => {
68
- var P;
69
- document.removeEventListener("keydown", E), document.body.style.overflow = x, (P = m == null ? void 0 : m.focus) == null || P.call(m);
70
- };
71
- }, [l, s]), !l || typeof document > "u" ? null : lt(
72
- /* @__PURE__ */ o("div", { className: "rk-overlay", onMouseDown: (m) => m.target === m.currentTarget && s(), children: /* @__PURE__ */ p(
73
- "div",
74
- {
75
- ref: _,
76
- role: "dialog",
77
- "aria-modal": "true",
78
- "aria-labelledby": c ? b : void 0,
79
- tabIndex: -1,
80
- className: "rk-modal",
81
- children: [
82
- c && /* @__PURE__ */ p("div", { className: "rk-modal__header", children: [
83
- /* @__PURE__ */ o("h2", { id: b, className: "rk-modal__title", children: c }),
84
- /* @__PURE__ */ o("button", { type: "button", className: "rk-alert__close", "aria-label": "Close", onClick: s, children: "×" })
85
- ] }),
86
- /* @__PURE__ */ o("div", { className: "rk-modal__body", children: v }),
87
- h && /* @__PURE__ */ o("div", { className: "rk-modal__footer", children: h })
88
- ]
89
- }
90
- ) }),
91
- document.body
92
- );
93
- }
94
- const J = (...l) => l.filter(Boolean).join(" ");
95
- function it() {
96
- return /* @__PURE__ */ o("svg", { viewBox: "0 0 16 16", width: "100%", height: "100%", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ o(
1
+ import { jsxs as x, jsx as f, Fragment as lt } from "react/jsx-runtime";
2
+ import { useState as $, useCallback as Te, useLayoutEffect as Dn, useEffect as j, useRef as F, createElement as ge, useMemo as Z } from "react";
3
+ import { createPortal as In } from "react-dom";
4
+ const Se = (...r) => r.filter(Boolean).join(" ");
5
+ function Tn() {
6
+ return /* @__PURE__ */ f("svg", { viewBox: "0 0 16 16", width: "100%", height: "100%", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ f(
97
7
  "path",
98
8
  {
99
9
  d: "M3.5 8.5l3 3 6-7",
@@ -105,510 +15,1339 @@ function it() {
105
15
  }
106
16
  ) });
107
17
  }
108
- function ot() {
109
- return /* @__PURE__ */ o("svg", { viewBox: "0 0 16 16", width: "100%", height: "100%", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ o("path", { d: "M4 8h8", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round" }) });
18
+ function Ln() {
19
+ return /* @__PURE__ */ f("svg", { viewBox: "0 0 16 16", width: "100%", height: "100%", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ f("path", { d: "M4 8h8", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round" }) });
110
20
  }
111
- function Ke({
112
- checked: l,
21
+ function me({
22
+ checked: r,
113
23
  onChange: s,
114
- indeterminate: c = !1,
115
- variant: h = "native",
116
- disabled: v = !1,
117
- label: b,
118
- "aria-label": _,
119
- id: m,
120
- name: E,
121
- indicator: x,
122
- className: I,
123
- style: P,
124
- classNames: j = {},
125
- styles: y = {}
24
+ indeterminate: a = !1,
25
+ variant: d = "native",
26
+ disabled: p = !1,
27
+ label: c,
28
+ "aria-label": m,
29
+ id: _,
30
+ name: N,
31
+ indicator: O,
32
+ className: P,
33
+ style: b,
34
+ classNames: D = {},
35
+ styles: S = {}
126
36
  }) {
127
- const B = c ? "indeterminate" : l ? "checked" : "unchecked";
128
- return /* @__PURE__ */ p(
37
+ const T = a ? "indeterminate" : r ? "checked" : "unchecked";
38
+ return /* @__PURE__ */ x(
129
39
  "label",
130
40
  {
131
- className: J(
41
+ className: Se(
132
42
  "rk-checkbox",
133
- `rk-checkbox--${h}`,
134
- B === "checked" && "rk-checkbox--checked",
135
- c && "rk-checkbox--indeterminate",
136
- v && "rk-checkbox--disabled",
137
- j.root,
138
- I
43
+ `rk-checkbox--${d}`,
44
+ T === "checked" && "rk-checkbox--checked",
45
+ a && "rk-checkbox--indeterminate",
46
+ p && "rk-checkbox--disabled",
47
+ D.root,
48
+ P
139
49
  ),
140
- style: { ...y.root, ...P },
141
- "data-state": B,
50
+ style: { ...S.root, ...b },
51
+ "data-state": T,
142
52
  children: [
143
- h === "native" ? /* @__PURE__ */ o(
53
+ d === "native" ? /* @__PURE__ */ f(
144
54
  "input",
145
55
  {
146
56
  type: "checkbox",
147
- id: m,
148
- name: E,
149
- ref: (F) => {
150
- F && (F.indeterminate = c);
57
+ id: _,
58
+ name: N,
59
+ ref: (M) => {
60
+ M && (M.indeterminate = a);
151
61
  },
152
- className: J("rk-checkbox__control", j.control),
153
- style: y.control,
154
- checked: l,
155
- disabled: v,
156
- "aria-label": _,
157
- "data-state": B,
158
- onChange: (F) => s(F.target.checked)
62
+ className: Se("rk-checkbox__control", D.control),
63
+ style: S.control,
64
+ checked: r,
65
+ disabled: p,
66
+ "aria-label": m,
67
+ "data-state": T,
68
+ onChange: (M) => s(M.target.checked)
159
69
  }
160
- ) : /* @__PURE__ */ o(
70
+ ) : /* @__PURE__ */ f(
161
71
  "button",
162
72
  {
163
73
  type: "button",
164
74
  role: "checkbox",
165
- id: m,
166
- className: J("rk-checkbox__control", j.control),
167
- style: y.control,
168
- "aria-checked": c ? "mixed" : l,
169
- "aria-label": _,
170
- disabled: v,
171
- "data-state": B,
172
- onClick: () => s(!l),
173
- children: /* @__PURE__ */ o(
75
+ id: _,
76
+ className: Se("rk-checkbox__control", D.control),
77
+ style: S.control,
78
+ "aria-checked": a ? "mixed" : r,
79
+ "aria-label": m,
80
+ disabled: p,
81
+ "data-state": T,
82
+ onClick: () => s(!r),
83
+ children: /* @__PURE__ */ f(
174
84
  "span",
175
85
  {
176
- className: J(
86
+ className: Se(
177
87
  "rk-checkbox__indicator",
178
- x !== void 0 && !c && "rk-checkbox__indicator--custom",
179
- j.indicator
88
+ O !== void 0 && !a && "rk-checkbox__indicator--custom",
89
+ D.indicator
180
90
  ),
181
- style: y.indicator,
182
- "data-state": B,
91
+ style: S.indicator,
92
+ "data-state": T,
183
93
  "aria-hidden": "true",
184
- children: c ? h === "tick" ? /* @__PURE__ */ o(ot, {}) : null : x !== void 0 ? x : h === "tick" ? /* @__PURE__ */ o(it, {}) : null
94
+ children: a ? d === "tick" ? /* @__PURE__ */ f(Ln, {}) : null : O !== void 0 ? O : d === "tick" ? /* @__PURE__ */ f(Tn, {}) : null
185
95
  }
186
96
  )
187
97
  }
188
98
  ),
189
- b != null && /* @__PURE__ */ o("span", { className: J("rk-checkbox__label", j.label), style: y.label, children: b })
99
+ c != null && c !== !1 && c !== "" && /* @__PURE__ */ f("span", { className: Se("rk-checkbox__label", D.label), style: S.label, children: c })
190
100
  ]
191
101
  }
192
102
  );
193
103
  }
194
- const $ = (...l) => l.filter(Boolean).join(" "), Pe = (l, s) => `${typeof l}:${l}\0${s}`;
195
- function ke(l, s) {
196
- const c = s[l.field];
197
- return l.valueFormatter ? l.valueFormatter(c, s) : l.type === "boolean" && typeof c == "boolean" ? c ? "Yes" : "No" : c == null ? "" : c instanceof Date ? c.toLocaleDateString() : String(c);
104
+ const Mn = /^(\d{4})-(\d{2})-(\d{2})$/, kr = (r) => String(r).padStart(2, "0");
105
+ function Ie(r) {
106
+ const s = Mn.exec(r);
107
+ if (!s) return null;
108
+ const [a, d, p] = [Number(s[1]), Number(s[2]), Number(s[3])], c = new Date(a, d - 1, p);
109
+ return c.getFullYear() === a && c.getMonth() === d - 1 && c.getDate() === p ? c : null;
110
+ }
111
+ function H(r) {
112
+ var s;
113
+ if (r instanceof Date)
114
+ return Number.isNaN(r.getTime()) ? null : `${r.getFullYear()}-${kr(r.getMonth() + 1)}-${kr(r.getDate())}`;
115
+ if (typeof r == "number") return Number.isFinite(r) ? H(new Date(r)) : null;
116
+ if (typeof r == "string") {
117
+ const a = r.trim();
118
+ if (a === "") return null;
119
+ const d = (s = /^\d{4}-\d{2}-\d{2}/.exec(a)) == null ? void 0 : s[0];
120
+ if (d) return Ie(d) ? d : null;
121
+ const p = Date.parse(a);
122
+ return Number.isNaN(p) ? null : H(new Date(p));
123
+ }
124
+ return null;
125
+ }
126
+ function Fn(r, s, a) {
127
+ const d = H(r);
128
+ return d ? Ie(d).toLocaleDateString(s, a ?? { year: "numeric", month: "short", day: "numeric" }) : r == null ? "" : String(r);
129
+ }
130
+ function $n(r, s) {
131
+ var a;
132
+ return r === "" ? null : s instanceof Date ? Ie(r) : typeof s == "number" ? ((a = Ie(r)) == null ? void 0 : a.getTime()) ?? null : r;
133
+ }
134
+ function _r(r) {
135
+ return r.filterType ? r.filterType : r.type === "number" ? "number" : r.type === "date" ? "date" : r.type === "boolean" ? "select" : "text";
136
+ }
137
+ const On = (r) => typeof r == "object" && r !== null && !Array.isArray(r);
138
+ function wr(r) {
139
+ if (r == null) return !1;
140
+ if (typeof r == "string") return r.trim() !== "";
141
+ if (Array.isArray(r)) return r.length > 0;
142
+ if (On(r)) {
143
+ const s = r;
144
+ return typeof s.min == "number" || typeof s.max == "number" || !!s.from || !!s.to;
145
+ }
146
+ return !1;
147
+ }
148
+ function Pn(r, s, a, d) {
149
+ switch (r) {
150
+ case "text":
151
+ return a.toLowerCase().includes(String(s).trim().toLowerCase());
152
+ case "exact":
153
+ return a.toLowerCase() === String(s).trim().toLowerCase();
154
+ case "number": {
155
+ const { min: p, max: c } = s, m = typeof d == "number" ? d : d == null || d === "" ? NaN : Number(d);
156
+ return Number.isNaN(m) ? !1 : (typeof p != "number" || m >= p) && (typeof c != "number" || m <= c);
157
+ }
158
+ case "date": {
159
+ const { from: p, to: c } = s, m = H(d);
160
+ return m ? (!p || m >= p) && (!c || m <= c) : !1;
161
+ }
162
+ case "select":
163
+ return s.includes(String(d ?? ""));
164
+ }
165
+ }
166
+ function An(r, s, a, d) {
167
+ if (r.filterOptions) return r.filterOptions.map((c) => typeof c == "string" ? { value: c, label: c } : c);
168
+ if (r.type === "boolean")
169
+ return [
170
+ { value: "true", label: "Yes" },
171
+ { value: "false", label: "No" }
172
+ ];
173
+ const p = /* @__PURE__ */ new Map();
174
+ for (const c of s) {
175
+ const m = a(c);
176
+ if (m == null || m === "") continue;
177
+ const _ = String(m);
178
+ p.has(_) || p.set(_, d(c));
179
+ }
180
+ return [...p].map(([c, m]) => ({ value: c, label: m })).sort((c, m) => c.label.localeCompare(m.label, void 0, { numeric: !0 }));
181
+ }
182
+ const Ft = typeof window < "u" ? Dn : j;
183
+ function Ce(r, s, a) {
184
+ const [d, p] = $(s), c = r !== void 0, m = c ? r : d, _ = Te(
185
+ (N) => {
186
+ c || p(N), a == null || a(N);
187
+ },
188
+ [c, a]
189
+ );
190
+ return [m, _];
191
+ }
192
+ const C = (...r) => r.filter(Boolean).join(" "), ot = (r) => r.headerName ?? (r.type === "boolean" ? "" : r.field), pe = (r) => ot(r) || r.field;
193
+ function Nr({ anchorRef: r, open: s, onClose: a, label: d, theme: p, className: c, style: m, children: _ }) {
194
+ const N = F(null), [O, P] = $({ top: 0, left: 0 }), b = Te(() => {
195
+ var B;
196
+ const D = r.current;
197
+ if (!D) return;
198
+ const S = D.getBoundingClientRect(), T = ((B = N.current) == null ? void 0 : B.offsetWidth) ?? 260, M = Math.max(8, Math.min(S.left, window.innerWidth - T - 8));
199
+ P({ top: S.bottom + 6, left: M });
200
+ }, [r]);
201
+ return Ft(() => {
202
+ s && b();
203
+ }, [s, b]), j(() => {
204
+ if (!s) return;
205
+ const D = (T) => {
206
+ var B, ie;
207
+ const M = T.target;
208
+ (B = N.current) != null && B.contains(M) || (ie = r.current) != null && ie.contains(M) || a();
209
+ }, S = (T) => {
210
+ var M;
211
+ T.key === "Escape" && (a(), (M = r.current) == null || M.focus());
212
+ };
213
+ return document.addEventListener("mousedown", D), document.addEventListener("keydown", S), window.addEventListener("resize", b), window.addEventListener("scroll", b, !0), () => {
214
+ document.removeEventListener("mousedown", D), document.removeEventListener("keydown", S), window.removeEventListener("resize", b), window.removeEventListener("scroll", b, !0);
215
+ };
216
+ }, [s, a, b, r]), !s || typeof document > "u" ? null : In(
217
+ /* @__PURE__ */ f(
218
+ "div",
219
+ {
220
+ ref: N,
221
+ role: "dialog",
222
+ "aria-label": d,
223
+ "data-rk-theme": p || void 0,
224
+ className: C("rk-grid-popup", c),
225
+ style: { position: "fixed", top: O.top, left: O.left, ...m },
226
+ children: _
227
+ }
228
+ ),
229
+ document.body
230
+ );
231
+ }
232
+ const it = (r) => {
233
+ if (r.trim() === "") return;
234
+ const s = Number(r);
235
+ return Number.isFinite(s) ? s : void 0;
236
+ }, Er = (r) => typeof r == "object" && r !== null && !Array.isArray(r);
237
+ function Kn({
238
+ value: r,
239
+ onChange: s,
240
+ label: a,
241
+ inputClassName: d,
242
+ inputStyle: p
243
+ }) {
244
+ const c = Er(r) ? r : {}, [m, _] = $(c.min === void 0 ? "" : String(c.min)), [N, O] = $(c.max === void 0 ? "" : String(c.max));
245
+ j(() => {
246
+ it(m) !== c.min && _(c.min === void 0 ? "" : String(c.min)), it(N) !== c.max && O(c.max === void 0 ? "" : String(c.max));
247
+ }, [c.min, c.max]);
248
+ const P = (b, D) => {
249
+ const S = it(b), T = it(D);
250
+ s(S === void 0 && T === void 0 ? void 0 : { min: S, max: T });
251
+ };
252
+ return /* @__PURE__ */ x("div", { className: "rk-grid__filter-fields", children: [
253
+ /* @__PURE__ */ x("label", { className: "rk-grid__filter-field", children: [
254
+ /* @__PURE__ */ f("span", { children: "Min" }),
255
+ /* @__PURE__ */ f(
256
+ "input",
257
+ {
258
+ autoFocus: !0,
259
+ type: "number",
260
+ className: C("rk-grid__filter-input", d),
261
+ style: p,
262
+ value: m,
263
+ "aria-label": `Minimum ${a}`,
264
+ onChange: (b) => {
265
+ _(b.target.value), P(b.target.value, N);
266
+ }
267
+ }
268
+ )
269
+ ] }),
270
+ /* @__PURE__ */ x("label", { className: "rk-grid__filter-field", children: [
271
+ /* @__PURE__ */ f("span", { children: "Max" }),
272
+ /* @__PURE__ */ f(
273
+ "input",
274
+ {
275
+ type: "number",
276
+ className: C("rk-grid__filter-input", d),
277
+ style: p,
278
+ value: N,
279
+ "aria-label": `Maximum ${a}`,
280
+ onChange: (b) => {
281
+ O(b.target.value), P(m, b.target.value);
282
+ }
283
+ }
284
+ )
285
+ ] })
286
+ ] });
287
+ }
288
+ function Bn({
289
+ value: r,
290
+ onChange: s,
291
+ label: a,
292
+ inputClassName: d,
293
+ inputStyle: p
294
+ }) {
295
+ const c = Er(r) ? r : {}, m = (_, N) => s(!_ && !N ? void 0 : { from: _ || void 0, to: N || void 0 });
296
+ return /* @__PURE__ */ x("div", { className: "rk-grid__filter-fields", children: [
297
+ /* @__PURE__ */ x("label", { className: "rk-grid__filter-field", children: [
298
+ /* @__PURE__ */ f("span", { children: "From" }),
299
+ /* @__PURE__ */ f(
300
+ "input",
301
+ {
302
+ autoFocus: !0,
303
+ type: "date",
304
+ className: C("rk-grid__filter-input", d),
305
+ style: p,
306
+ value: c.from ?? "",
307
+ "aria-label": `${a} from`,
308
+ onChange: (_) => m(_.target.value, c.to)
309
+ }
310
+ )
311
+ ] }),
312
+ /* @__PURE__ */ x("label", { className: "rk-grid__filter-field", children: [
313
+ /* @__PURE__ */ f("span", { children: "To" }),
314
+ /* @__PURE__ */ f(
315
+ "input",
316
+ {
317
+ type: "date",
318
+ className: C("rk-grid__filter-input", d),
319
+ style: p,
320
+ value: c.to ?? "",
321
+ "aria-label": `${a} to`,
322
+ onChange: (_) => m(c.from, _.target.value)
323
+ }
324
+ )
325
+ ] })
326
+ ] });
327
+ }
328
+ function Rn({
329
+ value: r,
330
+ onChange: s,
331
+ options: a
332
+ }) {
333
+ const d = Array.isArray(r) ? r : [], p = (c, m) => {
334
+ const _ = m ? [...d, c] : d.filter((N) => N !== c);
335
+ s(_.length ? _ : void 0);
336
+ };
337
+ return /* @__PURE__ */ x("div", { className: "rk-grid__filter-fields rk-grid__filter-options", role: "group", children: [
338
+ a.length === 0 && /* @__PURE__ */ f("span", { className: "rk-grid__filter-empty", children: "No values" }),
339
+ a.map((c) => /* @__PURE__ */ f(
340
+ me,
341
+ {
342
+ checked: d.includes(c.value),
343
+ onChange: (m) => p(c.value, m),
344
+ label: c.label ?? c.value
345
+ },
346
+ c.value
347
+ ))
348
+ ] });
349
+ }
350
+ function Wn({
351
+ column: r,
352
+ label: s,
353
+ kind: a,
354
+ value: d,
355
+ onChange: p,
356
+ options: c,
357
+ theme: m,
358
+ indicatorClassName: _,
359
+ indicatorStyle: N,
360
+ popupClassName: O,
361
+ popupStyle: P,
362
+ inputClassName: b,
363
+ inputStyle: D
364
+ }) {
365
+ const [S, T] = $(!1), M = F(null), B = wr(d), ie = Te(() => T(!1), []), Le = typeof d == "string" ? d : "", st = () => {
366
+ if (r.filterRenderer)
367
+ return ge(r.filterRenderer, { column: r, value: Le, onChange: (z) => p(z || void 0) });
368
+ switch (a) {
369
+ case "number":
370
+ return /* @__PURE__ */ f(Kn, { value: d, onChange: p, label: s, inputClassName: b, inputStyle: D });
371
+ case "date":
372
+ return /* @__PURE__ */ f(Bn, { value: d, onChange: p, label: s, inputClassName: b, inputStyle: D });
373
+ case "select":
374
+ return /* @__PURE__ */ f(Rn, { value: d, onChange: p, options: c });
375
+ default:
376
+ return /* @__PURE__ */ f(
377
+ "input",
378
+ {
379
+ autoFocus: !0,
380
+ type: "text",
381
+ className: C("rk-grid__filter-input", b),
382
+ style: D,
383
+ value: Le,
384
+ placeholder: r.filterPlaceholder ?? (a === "exact" ? "Exactly…" : `Filter ${s}…`),
385
+ "aria-label": `Filter text for ${s}`,
386
+ onChange: (z) => p(z.target.value || void 0),
387
+ onKeyDown: (z) => {
388
+ var oe;
389
+ z.key === "Enter" && (T(!1), (oe = M.current) == null || oe.focus());
390
+ }
391
+ }
392
+ );
393
+ }
394
+ };
395
+ return /* @__PURE__ */ x(lt, { children: [
396
+ /* @__PURE__ */ f(
397
+ "button",
398
+ {
399
+ ref: M,
400
+ type: "button",
401
+ className: C(
402
+ "rk-grid__filter-btn",
403
+ B && "rk-grid__filter-btn--active",
404
+ S && "rk-grid__filter-btn--open",
405
+ _
406
+ ),
407
+ style: N,
408
+ "aria-label": `Filter ${s}`,
409
+ "aria-haspopup": "dialog",
410
+ "aria-expanded": S,
411
+ "data-active": B || void 0,
412
+ onClick: (z) => {
413
+ z.stopPropagation(), T((oe) => !oe);
414
+ },
415
+ onKeyDown: (z) => z.stopPropagation(),
416
+ children: r.filterIndicator ? ge(r.filterIndicator, { column: r, active: B, open: S }) : /* @__PURE__ */ f("span", { className: "rk-grid__filter-dot", "aria-hidden": "true" })
417
+ }
418
+ ),
419
+ /* @__PURE__ */ x(
420
+ Nr,
421
+ {
422
+ anchorRef: M,
423
+ open: S,
424
+ onClose: ie,
425
+ label: `Filter ${s}`,
426
+ theme: m,
427
+ className: O,
428
+ style: P,
429
+ children: [
430
+ st(),
431
+ B && /* @__PURE__ */ f("button", { type: "button", className: "rk-grid__filter-clear", onClick: () => p(void 0), children: "Clear" })
432
+ ]
433
+ }
434
+ )
435
+ ] });
436
+ }
437
+ function jn({ columns: r, hidden: s, onToggle: a, theme: d, className: p, style: c }) {
438
+ const [m, _] = $(!1), N = F(null), O = Te(() => _(!1), []), P = r.filter((b) => !s.has(b.field)).length;
439
+ return /* @__PURE__ */ x(lt, { children: [
440
+ /* @__PURE__ */ f(
441
+ "button",
442
+ {
443
+ ref: N,
444
+ type: "button",
445
+ className: C("rk-grid__tool-btn", p),
446
+ style: c,
447
+ "aria-haspopup": "dialog",
448
+ "aria-expanded": m,
449
+ onClick: () => _((b) => !b),
450
+ children: "Columns"
451
+ }
452
+ ),
453
+ /* @__PURE__ */ f(Nr, { anchorRef: N, open: m, onClose: O, label: "Show or hide columns", theme: d, children: /* @__PURE__ */ f("div", { className: "rk-grid__filter-fields rk-grid__filter-options", role: "group", "aria-label": "Columns", children: r.filter((b) => b.hideable !== !1).map((b) => {
454
+ const D = !s.has(b.field);
455
+ return /* @__PURE__ */ f(
456
+ me,
457
+ {
458
+ checked: D,
459
+ disabled: D && P <= 1,
460
+ onChange: (S) => a(b.field, !S),
461
+ label: pe(b)
462
+ },
463
+ b.field
464
+ );
465
+ }) }) })
466
+ ] });
467
+ }
468
+ const Vn = /^[=+\-@\t\r]/;
469
+ function Un(r, s, a) {
470
+ if (r == null) return "";
471
+ let d = String(r);
472
+ return a && typeof r == "string" && Vn.test(d) && !Number.isFinite(Number(d)) && (d = `'${d}`), d.includes(s) || /["\r\n]/.test(d) ? `"${d.replace(/"/g, '""')}"` : d;
473
+ }
474
+ function zn(r, s, a = {}) {
475
+ const { delimiter: d = ",", sanitize: p = !0 } = a, c = (m) => m.map((_) => Un(_, d, p)).join(d);
476
+ return [c(r), ...s.map(c)].join(`\r
477
+ `);
478
+ }
479
+ function qn(r, s) {
480
+ if (typeof document > "u") return;
481
+ const a = new Blob(["\uFEFF", r], { type: "text/csv;charset=utf-8" }), d = URL.createObjectURL(a), p = document.createElement("a");
482
+ p.href = d, p.download = s, p.style.display = "none", document.body.appendChild(p), p.click(), p.remove(), setTimeout(() => URL.revokeObjectURL(d), 1e3);
483
+ }
484
+ const $t = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), Sr = (r, s) => Object.prototype.hasOwnProperty.call(r, s);
485
+ function U(r, s) {
486
+ if (r === null || typeof r != "object") return;
487
+ if (Sr(r, s)) return r[s];
488
+ let a = r;
489
+ for (const d of s.split(".")) {
490
+ if (a == null || typeof a != "object" || $t.has(d)) return;
491
+ a = a[d];
492
+ }
493
+ return a;
198
494
  }
199
- function at(l, s) {
200
- return typeof l == "number" && typeof s == "number" ? l - s : l instanceof Date && s instanceof Date ? l.getTime() - s.getTime() : typeof l == "boolean" && typeof s == "boolean" ? Number(l) - Number(s) : String(l).localeCompare(String(s), void 0, { numeric: !0, sensitivity: "base" });
495
+ function yr(r, s, a) {
496
+ if (Array.isArray(r)) {
497
+ const d = [...r];
498
+ return d[s] = a, d;
499
+ }
500
+ return { ...r, [s]: a };
201
501
  }
202
- function mt({
203
- columns: l,
502
+ function Ot(r, s, a) {
503
+ const d = r ?? {};
504
+ if (Sr(d, s) || !s.includes("."))
505
+ return $t.has(s) ? r : yr(d, s, a);
506
+ const [p, ...c] = s.split(".");
507
+ if ($t.has(p)) return r;
508
+ const m = d[p];
509
+ return yr(d, p, Ot(m !== null && typeof m == "object" ? m : {}, c.join("."), a));
510
+ }
511
+ const ee = 44, Hn = 150, xr = 10, Mt = (r, s) => `${typeof r}:${r}\0${s}`;
512
+ function De(r, s) {
513
+ const a = U(s, r.field);
514
+ return r.valueFormatter ? r.valueFormatter(a, s) : r.type === "boolean" && typeof a == "boolean" ? a ? "Yes" : "No" : r.type === "date" ? Fn(a, r.dateLocale, r.dateFormat) : a == null ? "" : a instanceof Date ? a.toLocaleDateString() : String(a);
515
+ }
516
+ function Jn(r, s, a) {
517
+ if (a.type === "date") {
518
+ const d = H(r) ?? "", p = H(s) ?? "";
519
+ return d < p ? -1 : d > p ? 1 : 0;
520
+ }
521
+ return typeof r == "number" && typeof s == "number" ? r - s : r instanceof Date && s instanceof Date ? r.getTime() - s.getTime() : typeof r == "boolean" && typeof s == "boolean" ? Number(r) - Number(s) : String(r).localeCompare(String(s), void 0, { numeric: !0, sensitivity: "base" });
522
+ }
523
+ const Yn = (r) => r ? Array.isArray(r) ? r : [r] : [], vr = (r) => r.type === "date" && r.validity.badInput;
524
+ function ei({
525
+ columns: r,
204
526
  rows: s,
205
- getRowId: c,
206
- editable: h = !1,
207
- enterMovesDown: v = !0,
208
- onCellEdit: b,
209
- onRowsChange: _,
210
- sortable: m = !0,
211
- defaultSort: E = null,
212
- onSortChange: x,
213
- searchable: I = !0,
214
- searchPlaceholder: P = "Search…",
215
- columnFilters: j = !0,
216
- pagination: y = !0,
217
- paginationPosition: B = "bottom",
218
- pageSize: F = 10,
219
- pageSizeOptions: oe = [5, 10, 25, 50],
220
- onRowClick: ae,
221
- toolbar: ge,
222
- emptyMessage: Fe = "No rows to show",
223
- striped: Le = !1,
224
- checkboxVariant: Ve = "native",
225
- maxHeight: me,
226
- className: Re,
227
- style: Ae,
228
- classNames: S = {},
229
- styles: D = {},
230
- rowClassName: de,
231
- rowStyle: se
527
+ getRowId: a,
528
+ editable: d = !1,
529
+ enterMovesDown: p = !0,
530
+ onCellEdit: c,
531
+ onRowsChange: m,
532
+ rowSelection: _ = !1,
533
+ selectedRowIds: N,
534
+ defaultSelectedRowIds: O,
535
+ onSelectionChange: P,
536
+ isRowSelectable: b,
537
+ sort: D,
538
+ defaultSort: S = null,
539
+ onSortChange: T,
540
+ multiSort: M = !1,
541
+ searchable: B = !1,
542
+ searchPlaceholder: ie = "Search…",
543
+ search: Le,
544
+ onSearchChange: st,
545
+ filters: z,
546
+ onFiltersChange: oe,
547
+ pagination: Y = !1,
548
+ paginationPosition: Me = "bottom",
549
+ pageSize: Cr = 10,
550
+ pageSizeOptions: at = [5, 10, 25, 50],
551
+ page: Dr,
552
+ onPageChange: Ir,
553
+ onPageSizeChange: dt,
554
+ serverSide: V = !1,
555
+ rowCount: Tr,
556
+ onQueryChange: Pt,
557
+ queryDebounce: At = 250,
558
+ loading: Lr,
559
+ loadingRows: Mr,
560
+ skeletonRow: Kt,
561
+ errorMessage: Fr = "Could not load the data.",
562
+ columnMenu: Bt = !1,
563
+ onColumnVisibilityChange: ct,
564
+ keyboardNavigation: ft = !1,
565
+ virtualize: q = !1,
566
+ rowHeight: X = 40,
567
+ overscan: Rt = 6,
568
+ exportable: Fe = !1,
569
+ apiRef: be,
570
+ onRowClick: ut,
571
+ toolbar: Wt,
572
+ emptyMessage: $r = "No rows to show",
573
+ striped: Or = !1,
574
+ stripeColors: $e,
575
+ checkboxVariant: ht = "native",
576
+ animateRows: jt = !0,
577
+ theme: pt,
578
+ maxHeight: Oe,
579
+ className: Pr,
580
+ style: Ar,
581
+ classNames: I = {},
582
+ styles: v = {},
583
+ rowClassName: gt,
584
+ rowStyle: mt
232
585
  }) {
233
- const g = (e, t) => ({
234
- className: $(t, S[e]),
235
- style: D[e]
236
- }), [pe, _e] = M(s), A = Q(s);
237
- be(() => {
238
- A.current = s, _e(s);
586
+ const L = (e, t) => ({
587
+ className: C(t, I[e]),
588
+ style: v[e]
589
+ }), [Pe, Vt] = $(s), le = F(s);
590
+ j(() => {
591
+ le.current = s, Vt(s);
239
592
  }, [s]);
240
- const ve = (e) => {
241
- A.current = e, _e(e);
242
- }, [U, ze] = M(""), [z, xe] = M({}), [w, We] = M(E), [qe, W] = M(0), [T, Ge] = M(F), [q, G] = M(null), L = Q(0), X = Q(null), ce = Q(/* @__PURE__ */ new Map()), ye = $e(
243
- () => pe.map((e, t) => ({ row: e, index: t, id: c ? c(e, t) : t })),
244
- [pe, c]
245
- ), O = $e(() => {
246
- const e = U.trim().toLowerCase(), t = Object.entries(z).filter(([, n]) => n.trim() !== "");
247
- let r = ye.filter(({ row: n }) => e && !l.some((d) => ke(d, n).toLowerCase().includes(e)) ? !1 : t.every(([i, d]) => {
248
- const f = l.find((a) => a.field === i);
249
- return f ? ke(f, n).toLowerCase().includes(d.trim().toLowerCase()) : !0;
593
+ const Ut = (e) => {
594
+ le.current = e, Vt(e);
595
+ }, [ke, Kr] = Ce(Le, "", st), [se, Br] = Ce(z, {}, oe), [R, Rr] = Ce(D, Yn(S), T), [bt, ae] = Ce(Dr, 0, Ir), [A, Wr] = $(Cr), jr = (e) => {
596
+ Wr(e), dt == null || dt(e);
597
+ }, [Ae, Vr] = $(() => new Set(r.filter((e) => e.hidden).map((e) => e.field))), Ur = (e, t) => {
598
+ const n = new Set(Ae);
599
+ t ? n.add(e) : n.delete(e), Vr(n), ct == null || ct([...n]);
600
+ }, [kt, zt] = $({}), [Ke, zr] = $({}), [Xn, qr] = $(0), _e = F(/* @__PURE__ */ new Map()), [ye, de] = $(null), ce = F(0), Be = F(null), Re = F(/* @__PURE__ */ new Map()), [_t, qt] = $(null), yt = F(null), xe = F(null), [xt, Ht] = $({ top: 0, height: 0 }), y = Z(() => {
601
+ const e = r.filter((t) => !Ae.has(t.field));
602
+ return [
603
+ ...e.filter((t) => t.pinned === "left"),
604
+ ...e.filter((t) => t.pinned !== "left" && t.pinned !== "right"),
605
+ ...e.filter((t) => t.pinned === "right")
606
+ ];
607
+ }, [r, Ae]), vt = (e) => e.sortable === !0, W = _ === "single" ? "single" : _ ? "multiple" : null, ve = y.length + (W ? 1 : 0), fe = Z(
608
+ () => Pe.map((e, t) => ({ row: e, index: t, id: a ? a(e, t) : t })),
609
+ [Pe, a]
610
+ ), Jt = F(/* @__PURE__ */ new Map());
611
+ fe.forEach((e) => Jt.current.set(e.id, e.row));
612
+ const We = Z(
613
+ () => Object.entries(se).filter(([e, t]) => {
614
+ const n = y.find((l) => l.field === e);
615
+ return !!n && !!n.filterable && wr(t);
616
+ }),
617
+ [se, y]
618
+ ), [Hr, Jr] = $(ke);
619
+ j(() => {
620
+ if (!V) return;
621
+ const e = setTimeout(() => Jr(ke), At);
622
+ return () => clearTimeout(e);
623
+ }, [ke, V, At]);
624
+ const ue = V ? Hr : ke, Yt = (e) => e.filterRenderer ? "text" : _r(e), G = Z(() => {
625
+ if (V) return fe;
626
+ const e = ue.trim().toLowerCase();
627
+ let t = fe.filter(({ row: l }) => e && !y.some((i) => De(i, l).toLowerCase().includes(e)) ? !1 : We.every(([i, o]) => {
628
+ const g = y.find((h) => h.field === i);
629
+ return Pn(Yt(g), o, De(g, l), U(l, i));
250
630
  }));
251
- if (w) {
252
- const n = l.find((i) => i.field === w.field);
253
- if (n) {
254
- const i = w.direction === "asc" ? 1 : -1;
255
- r = [...r].sort((d, f) => {
256
- const a = d.row[n.field], u = f.row[n.field], k = a == null || a === "", N = u == null || u === "";
257
- return k || N ? k === N ? 0 : k ? 1 : -1 : (n.comparator ? n.comparator(a, u, d.row, f.row) : at(a, u)) * i;
258
- });
631
+ const n = R.map((l) => ({ col: y.find((i) => i.field === l.field), dir: l.direction === "asc" ? 1 : -1 })).filter((l) => !!l.col);
632
+ return n.length && (t = [...t].sort((l, i) => {
633
+ for (const { col: o, dir: g } of n) {
634
+ const h = U(l.row, o.field), u = U(i.row, o.field), k = h == null || h === "", E = u == null || u === "";
635
+ if (k || E) {
636
+ if (k !== E) return k ? 1 : -1;
637
+ continue;
638
+ }
639
+ const nt = o.comparator ? o.comparator(h, u, l.row, i.row) : Jn(h, u, o);
640
+ if (nt !== 0) return nt * g;
641
+ }
642
+ return 0;
643
+ })), t;
644
+ }, [fe, y, ue, We, R, V]), je = JSON.stringify([ue, se, R, A]), Xt = F(je);
645
+ j(() => {
646
+ Xt.current !== je && (Xt.current = je, ae(0));
647
+ }, [je]);
648
+ const he = V ? Tr ?? fe.length : G.length, Q = Y ? Math.max(1, Math.ceil(he / A)) : 1, K = Math.min(bt, Q - 1), w = Y && !V ? G.slice(K * A, K * A + A) : G, Yr = he === 0 ? 0 : Y ? K * A + 1 : 1, Xr = Y ? Math.min(he, (K + 1) * A) : he, wt = Z(
649
+ () => ({
650
+ sort: R.filter((e) => {
651
+ const t = r.find((n) => n.field === e.field);
652
+ return !!t && vt(t);
653
+ }),
654
+ filters: Object.fromEntries(We),
655
+ search: ue.trim(),
656
+ page: K,
657
+ pageSize: A
658
+ }),
659
+ // eslint-disable-next-line react-hooks/exhaustive-deps
660
+ [R, r, We, ue, K, A]
661
+ ), Gr = JSON.stringify(wt), Ve = F(wt);
662
+ Ve.current = wt;
663
+ const Ue = F(Pt);
664
+ Ue.current = Pt;
665
+ const [Qr, ze] = $(!1), [Zr, Nt] = $(!1), Et = F(0), qe = Te((e) => {
666
+ var l;
667
+ const t = ++Et.current, n = (l = Ue.current) == null ? void 0 : l.call(Ue, e);
668
+ n && typeof n.then == "function" ? (ze(!0), Nt(!1), n.then(
669
+ () => {
670
+ t === Et.current && ze(!1);
671
+ },
672
+ () => {
673
+ t === Et.current && (ze(!1), Nt(!0));
259
674
  }
675
+ )) : (ze(!1), Nt(!1));
676
+ }, []);
677
+ j(() => {
678
+ V && qe(Ve.current);
679
+ }, [V, Gr, qe]), j(() => {
680
+ V && Y && bt > Q - 1 && ae(Q - 1);
681
+ }, [V, Y, bt, Q]);
682
+ const St = Lr ?? Qr, Gt = (e) => e.map((t) => Jt.current.get(t)).filter((t) => t !== void 0), [J, He] = Ce(
683
+ N,
684
+ O ?? [],
685
+ (e) => P == null ? void 0 : P({ ids: e, rows: Gt(e) })
686
+ ), Ct = Z(() => new Set(J), [J]), Je = (e) => b ? b(e) : !0, Ye = F(null), Qt = F(!1), en = (e, t) => {
687
+ if (!W || !Je(e.row)) return;
688
+ if (W === "single") {
689
+ He(t ? [e.id] : []), Ye.current = e.id;
690
+ return;
260
691
  }
261
- return r;
262
- }, [ye, l, U, z, w]);
263
- be(() => W(0), [U, z, w, T]);
264
- const V = O.length, Y = y ? Math.max(1, Math.ceil(V / T)) : 1, C = Math.min(qe, Y - 1), K = y ? O.slice(C * T, C * T + T) : O, Oe = V === 0 ? 0 : y ? C * T + 1 : 1, Ye = y ? Math.min(V, (C + 1) * T) : V, Ne = (e) => e.sortable ?? m, we = (e) => e.filterable ?? j, Z = (e, t, r) => ({
265
- value: t[e.field],
266
- formattedValue: ke(e, t),
692
+ const n = new Set(J), l = Qt.current && Ye.current !== null ? w.findIndex((o) => o.id === Ye.current) : -1, i = w.findIndex((o) => o.id === e.id);
693
+ if (l >= 0 && i >= 0)
694
+ for (let o = Math.min(l, i); o <= Math.max(l, i); o++)
695
+ Je(w[o].row) && (t ? n.add(w[o].id) : n.delete(w[o].id));
696
+ else t ? n.add(e.id) : n.delete(e.id);
697
+ Ye.current = e.id, He([...n]);
698
+ }, we = Z(() => G.filter((e) => Je(e.row)), [G, b]), Zt = we.filter((e) => Ct.has(e.id)).length, er = we.length > 0 && Zt === we.length, tr = (e) => {
699
+ const t = new Set(J);
700
+ we.forEach((n) => e ? t.add(n.id) : t.delete(n.id)), He([...t]);
701
+ }, Xe = (e, t, n) => ({
702
+ value: U(t, e.field),
703
+ formattedValue: De(e, t),
267
704
  row: t,
268
- rowIndex: r,
705
+ rowIndex: n,
269
706
  field: e.field,
270
707
  column: e
271
- }), ue = (e, t) => {
272
- const r = e.editable ?? h;
273
- return typeof r == "function" ? r(t) : !!r;
274
- }, ee = (e, t) => ue(e, t) && !(e.type === "boolean" && !e.cellEditor), He = (e, t) => {
275
- const r = Z(e, t.row, t.index), n = ue(e, r);
708
+ }), Dt = (e, t) => {
709
+ const n = e.editable ?? d;
710
+ return typeof n == "function" ? n(t) : !!n;
711
+ }, Ge = (e, t) => Dt(e, t) && !(e.type === "boolean" && !e.cellEditor), tn = (e, t) => {
712
+ const n = Xe(e, t.row, t.index), l = Dt(e, n);
276
713
  return {
277
- ...r,
278
- editable: n,
279
- updateValue: (i) => n && Ce(t, e, { value: i })
714
+ ...n,
715
+ editable: l,
716
+ updateValue: (i) => l && nr(t, e, { value: i })
280
717
  };
281
- }, De = (e) => {
282
- if (!Ne(e)) return;
283
- let t;
284
- !w || w.field !== e.field ? t = { field: e.field, direction: "asc" } : w.direction === "asc" ? t = { field: e.field, direction: "desc" } : t = null, We(t), x == null || x(t);
285
- }, te = (e, t) => {
286
- var r;
287
- return (r = ce.current.get(Pe(e, t))) == null ? void 0 : r.focus();
288
- }, R = () => {
289
- L.current += 1, G(null);
290
- }, re = (e, t, r = {}) => {
291
- if (!ee(t, Z(t, e.row, e.index))) return !1;
292
- const n = e.row[t.field], i = t.cellEditor ? n : r.text ?? (n == null ? "" : String(n));
293
- return X.current = i, L.current += 1, G({
718
+ }, rr = (e, t) => {
719
+ if (!vt(e)) return;
720
+ const n = R.find((o) => o.field === e.field), l = n ? n.direction === "asc" ? "desc" : null : "asc";
721
+ let i;
722
+ t && M ? l ? n ? i = R.map((o) => o.field === e.field ? { ...o, direction: l } : o) : i = [...R, { field: e.field, direction: l }] : i = R.filter((o) => o.field !== e.field) : i = l ? [{ field: e.field, direction: l }] : [], Rr(i);
723
+ }, Qe = (e, t) => {
724
+ var n;
725
+ return (n = Re.current.get(Mt(e, t))) == null ? void 0 : n.focus();
726
+ }, te = () => {
727
+ ce.current += 1, de(null);
728
+ }, rn = (e) => {
729
+ for (const t of le.current) {
730
+ const n = U(t, e.field);
731
+ if (n != null && n !== "") return n;
732
+ }
733
+ }, Ze = (e, t, n = {}) => {
734
+ if (!Ge(t, Xe(t, e.row, e.index))) return !1;
735
+ const l = U(e.row, t.field);
736
+ let i;
737
+ return t.cellEditor ? i = l : t.type === "date" ? i = H(l) ?? "" : i = n.text ?? (l == null ? "" : String(l)), Be.current = i, ce.current += 1, de({
294
738
  id: e.id,
295
739
  field: t.field,
296
740
  draft: i,
297
- session: L.current,
298
- select: r.select ?? "end",
741
+ session: ce.current,
742
+ select: n.select ?? "end",
299
743
  invalid: !1
300
744
  }), !0;
301
- }, Ce = (e, t, r) => {
302
- const n = A.current[e.index] ?? e.row, i = n[t.field];
303
- let d;
304
- if ("value" in r)
305
- d = r.value;
745
+ }, nr = (e, t, n) => {
746
+ const l = le.current[e.index] ?? e.row, i = U(l, t.field);
747
+ let o;
748
+ if ("value" in n)
749
+ o = n.value;
306
750
  else if (t.valueParser)
307
- d = t.valueParser(r.text, n);
308
- else if (t.type === "number")
309
- if (r.text.trim() === "") d = null;
751
+ o = t.valueParser(n.text, l);
752
+ else if (t.type === "date") {
753
+ if (n.text !== "" && !Ie(n.text)) return !1;
754
+ o = $n(n.text, i ?? rn(t));
755
+ } else if (t.type === "number")
756
+ if (n.text.trim() === "") o = null;
310
757
  else {
311
- const u = Number(r.text);
758
+ const u = Number(n.text);
312
759
  if (!Number.isFinite(u)) return !1;
313
- d = u;
760
+ o = u;
314
761
  }
315
762
  else
316
- d = r.text;
317
- if (Object.is(d, i)) return !0;
318
- if (t.validate && !t.validate(d, n)) return !1;
319
- const f = { ...n, [t.field]: d }, a = A.current.map((u, k) => k === e.index ? f : u);
320
- return ve(a), b == null || b({ rowId: e.id, rowIndex: e.index, field: t.field, oldValue: i, newValue: d, row: f }), _ == null || _(a), !0;
321
- }, Ee = (e, t, r) => {
322
- const n = K.findIndex((k) => k.id === e.id), i = l.findIndex((k) => k.field === t);
323
- if (n < 0 || i < 0) return null;
324
- const d = (k, N) => ee(N, Z(N, k.row, k.index));
325
- if (r === "down" || r === "up") {
326
- const k = r === "down" ? 1 : -1;
327
- for (let N = n + k; N >= 0 && N < K.length; N += k)
328
- if (d(K[N], l[i])) return { entry: K[N], col: l[i] };
763
+ o = n.text;
764
+ if (t.type === "date") {
765
+ if (H(o) === H(i)) return !0;
766
+ const u = H(o);
767
+ if (u && (t.dateMin && u < t.dateMin || t.dateMax && u > t.dateMax)) return !1;
768
+ } else if (Object.is(o, i))
769
+ return !0;
770
+ if (t.validate && !t.validate(o, l)) return !1;
771
+ const g = Ot(l, t.field, o), h = le.current.map((u, k) => k === e.index ? g : u);
772
+ return Ut(h), c == null || c({ rowId: e.id, rowIndex: e.index, field: t.field, oldValue: i, newValue: o, row: g }), m == null || m(h), !0;
773
+ }, ir = (e, t, n) => {
774
+ const l = w.findIndex((k) => k.id === e.id), i = y.findIndex((k) => k.field === t);
775
+ if (l < 0 || i < 0) return null;
776
+ const o = (k, E) => Ge(E, Xe(E, k.row, k.index));
777
+ if (n === "down" || n === "up") {
778
+ const k = n === "down" ? 1 : -1;
779
+ for (let E = l + k; E >= 0 && E < w.length; E += k)
780
+ if (o(w[E], y[i])) return { entry: w[E], col: y[i] };
329
781
  return null;
330
782
  }
331
- const f = r === "right" ? 1 : -1;
332
- let a = n, u = i + f;
333
- for (; a >= 0 && a < K.length; ) {
334
- for (; u >= 0 && u < l.length; ) {
335
- if (d(K[a], l[u])) return { entry: K[a], col: l[u] };
336
- u += f;
783
+ const g = n === "right" ? 1 : -1;
784
+ let h = l, u = i + g;
785
+ for (; h >= 0 && h < w.length; ) {
786
+ for (; u >= 0 && u < y.length; ) {
787
+ if (o(w[h], y[u])) return { entry: w[h], col: y[u] };
788
+ u += g;
337
789
  }
338
- a += f, u = f > 0 ? 0 : l.length - 1;
790
+ h += g, u = g > 0 ? 0 : y.length - 1;
339
791
  }
340
792
  return null;
341
- }, H = (e, t, r, n = {}) => {
342
- const { move: i = "none", focus: d = !0 } = n;
343
- if (!Ce(e, t, r))
344
- return G((a) => a && { ...a, invalid: !0 }), !1;
345
- const f = i === "none" ? null : Ee(e, t.field, i);
346
- return f ? re(f.entry, f.col, { select: "all" }) : (R(), d && te(e.id, t.field)), !0;
347
- }, Je = (e, t, r) => {
793
+ }, Ne = (e, t, n, l = {}) => {
794
+ const { move: i = "none", focus: o = !0 } = l;
795
+ if (!nr(e, t, n))
796
+ return de((h) => h && { ...h, invalid: !0 }), !1;
797
+ const g = i === "none" ? null : ir(e, t.field, i);
798
+ return g ? Ze(g.entry, g.col, { select: "all" }) : (te(), o && Qe(e.id, t.field)), !0;
799
+ }, nn = (e, t, n) => {
348
800
  if (e.nativeEvent.isComposing) return;
349
- const n = e.currentTarget.value;
801
+ const l = e.currentTarget.value, i = vr(e.currentTarget);
350
802
  if (e.key === "Enter") {
351
- e.preventDefault();
352
- const i = v ? e.shiftKey ? "up" : "down" : "none";
353
- H(t, r, { text: n }, { move: i });
803
+ if (e.preventDefault(), i) return de((g) => g && { ...g, invalid: !0 });
804
+ const o = p ? e.shiftKey ? "up" : "down" : "none";
805
+ Ne(t, n, { text: l }, { move: o });
354
806
  } else if (e.key === "Escape")
355
- e.preventDefault(), R(), te(t.id, r.field);
356
- else if (e.key === "Tab") {
357
- const i = e.shiftKey ? "left" : "right";
358
- Ee(t, r.field, i) && (e.preventDefault(), H(t, r, { text: n }, { move: i }));
807
+ e.preventDefault(), te(), Qe(t.id, n.field);
808
+ else if (e.key === "Tab" && !i) {
809
+ const o = e.shiftKey ? "left" : "right";
810
+ ir(t, n.field, o) && (e.preventDefault(), Ne(t, n, { text: l }, { move: o }));
359
811
  }
360
- }, Qe = (e, t, r, n) => {
361
- e.target !== e.currentTarget || !ee(r, n) || (e.key === "Enter" || e.key === "F2" ? (e.preventDefault(), re(t, r)) : !r.cellEditor && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), re(t, r, { text: e.key })));
362
- }, Ue = (e, t, r) => t.cellEditor ? /* @__PURE__ */ o(
363
- "div",
364
- {
365
- className: "rk-grid__custom-editor",
366
- onBlur: (n) => {
367
- n.currentTarget.contains(n.relatedTarget) || r.session === L.current && (H(e, t, { value: X.current }, { focus: !1 }) || R());
368
- },
369
- onKeyDown: (n) => {
370
- n.key === "Escape" && (n.preventDefault(), n.stopPropagation(), R(), te(e.id, t.field));
371
- },
372
- children: ie(t.cellEditor, {
373
- value: r.draft,
374
- row: e.row,
375
- rowIndex: e.index,
376
- field: t.field,
377
- column: t,
378
- onChange: (n) => {
379
- X.current = n, G((i) => i && i.session === r.session ? { ...i, draft: n, invalid: !1 } : i);
380
- },
381
- onCommit: (n, i = "none") => {
382
- r.session === L.current && H(e, t, { value: n === void 0 ? X.current : n }, { move: i });
383
- },
384
- onCancel: () => {
385
- R(), te(e.id, t.field);
386
- }
387
- })
812
+ }, on = (e, t) => {
813
+ var o;
814
+ const n = w[e], l = y[t];
815
+ if (!n || !l) return;
816
+ qt({ id: n.id, field: l.field }), yt.current = Mt(n.id, l.field);
817
+ const i = xe.current;
818
+ if (q && i) {
819
+ const g = ((o = i.querySelector("thead")) == null ? void 0 : o.clientHeight) ?? 0, h = e * X;
820
+ h < i.scrollTop ? i.scrollTo({ top: h, behavior: "auto" }) : h + X > i.scrollTop + i.clientHeight - g && i.scrollTo({ top: h + X - i.clientHeight + g, behavior: "auto" });
388
821
  }
389
- ) : /* @__PURE__ */ o(
390
- "input",
391
- {
392
- autoFocus: !0,
393
- className: $("rk-grid__editor", r.invalid && "rk-grid__editor--invalid", S.editor),
394
- style: { textAlign: t.align, ...D.editor },
395
- value: r.draft === null || r.draft === void 0 ? "" : String(r.draft),
396
- inputMode: t.type === "number" ? "decimal" : void 0,
397
- "aria-label": `Edit ${t.headerName ?? t.field}`,
398
- "aria-invalid": r.invalid || void 0,
399
- onChange: (n) => {
400
- const i = n.target.value;
401
- G((d) => d && { ...d, draft: i, invalid: !1 });
402
- },
403
- onFocus: (n) => {
404
- const i = n.currentTarget;
405
- r.select === "all" ? i.select() : i.setSelectionRange(i.value.length, i.value.length);
406
- },
407
- onBlur: (n) => {
408
- r.session === L.current && (H(e, t, { text: n.currentTarget.value }, { focus: !1 }) || R());
409
- },
410
- onKeyDown: (n) => Je(n, e, t)
822
+ };
823
+ j(() => {
824
+ const e = yt.current;
825
+ if (!e) return;
826
+ const t = Re.current.get(e);
827
+ t && (yt.current = null, t.focus());
828
+ });
829
+ const ln = (e, t, n) => {
830
+ if (!ft) return !1;
831
+ let l = w.findIndex((o) => o.id === t.id), i = y.findIndex((o) => o.field === n.field);
832
+ if (l < 0 || i < 0) return !1;
833
+ switch (e.key) {
834
+ case "ArrowDown":
835
+ l += 1;
836
+ break;
837
+ case "ArrowUp":
838
+ l -= 1;
839
+ break;
840
+ case "ArrowRight":
841
+ i += 1;
842
+ break;
843
+ case "ArrowLeft":
844
+ i -= 1;
845
+ break;
846
+ case "PageDown":
847
+ l += xr;
848
+ break;
849
+ case "PageUp":
850
+ l -= xr;
851
+ break;
852
+ case "Home":
853
+ i = 0, (e.ctrlKey || e.metaKey) && (l = 0);
854
+ break;
855
+ case "End":
856
+ i = y.length - 1, (e.ctrlKey || e.metaKey) && (l = w.length - 1);
857
+ break;
858
+ default:
859
+ return !1;
860
+ }
861
+ return e.preventDefault(), on(Math.max(0, Math.min(w.length - 1, l)), Math.max(0, Math.min(y.length - 1, i))), !0;
862
+ }, sn = (e, t, n, l) => {
863
+ e.target === e.currentTarget && (ln(e, t, n) || Ge(n, l) && (e.key === "Enter" || e.key === "F2" ? (e.preventDefault(), Ze(t, n)) : !n.cellEditor && n.type !== "date" && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), Ze(t, n, { text: e.key }))));
864
+ };
865
+ Ft(() => {
866
+ if (!q || !xe.current) return;
867
+ const e = xe.current, t = () => Ht((l) => l.height === e.clientHeight ? l : { ...l, height: e.clientHeight });
868
+ if (t(), typeof ResizeObserver > "u") return;
869
+ const n = new ResizeObserver(t);
870
+ return n.observe(e), () => n.disconnect();
871
+ }, [q]);
872
+ const Ee = q && !St && w.length > 0, an = xt.height || (typeof Oe == "number" ? Oe : 400), et = Ee ? Math.max(0, Math.floor(xt.top / X) - Rt) : 0, It = Ee ? Math.min(w.length, Math.ceil((xt.top + an) / X) + Rt) : w.length, dn = Ee ? w.slice(et, It) : w, or = `${K}|${A}|${JSON.stringify(R)}|${ue}|${JSON.stringify(se)}`, lr = F(!0);
873
+ j(() => {
874
+ if (lr.current) {
875
+ lr.current = !1;
876
+ return;
411
877
  }
412
- ), Ie = (e) => {
413
- var r, n, i, d, f, a, u, k;
878
+ const e = xe.current;
879
+ e && typeof e.scrollTo == "function" && e.scrollTop > 0 && e.scrollTo({ top: 0, behavior: "smooth" });
880
+ }, [or]);
881
+ const Tt = Object.keys(kt).length > 0, tt = (e) => kt[e.field] ?? (typeof e.width == "number" ? e.width : Hn), cn = (e) => Math.max(40, typeof e.minWidth == "number" ? e.minWidth : 60), fn = (e, t) => {
882
+ e.preventDefault(), e.stopPropagation();
883
+ const n = { ...kt };
884
+ Tt || y.forEach((k) => {
885
+ var E;
886
+ return n[k.field] = ((E = _e.current.get(k.field)) == null ? void 0 : E.offsetWidth) ?? tt(k);
887
+ });
888
+ const l = e.clientX, i = n[t.field] ?? tt(t), o = e.currentTarget;
889
+ o.setPointerCapture(e.pointerId), zt(n);
890
+ const g = (k) => Math.min(t.maxWidth ?? 1 / 0, Math.max(cn(t), Math.round(k))), h = (k) => zt((E) => ({ ...E, [t.field]: g(i + k.clientX - l) })), u = () => {
891
+ o.removeEventListener("pointermove", h), o.removeEventListener("pointerup", u), o.removeEventListener("pointercancel", u);
892
+ };
893
+ o.addEventListener("pointermove", h), o.addEventListener("pointerup", u), o.addEventListener("pointercancel", u);
894
+ };
895
+ Ft(() => {
896
+ var i, o;
897
+ const e = {};
898
+ let t = W && y.some((g) => g.pinned === "left") ? ee : 0;
899
+ for (const g of y)
900
+ g.pinned === "left" && (e[g.field] = t, t += ((i = _e.current.get(g.field)) == null ? void 0 : i.offsetWidth) ?? 0);
901
+ let n = 0;
902
+ for (const g of [...y].reverse())
903
+ g.pinned === "right" && (e[g.field] = n, n += ((o = _e.current.get(g.field)) == null ? void 0 : o.offsetWidth) ?? 0);
904
+ const l = Object.keys(e);
905
+ (l.length !== Object.keys(Ke).length || l.some((g) => e[g] !== Ke[g])) && zr(e);
906
+ }), j(() => {
907
+ const e = () => qr((t) => t + 1);
908
+ return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
909
+ }, []);
910
+ const sr = y.map((e) => e.pinned).lastIndexOf("left"), un = y.findIndex((e) => e.pinned === "right"), rt = sr >= 0, ar = (e, t) => ({
911
+ className: e.pinned ? C("rk-grid__pinned", `rk-grid__pinned--${e.pinned}`, t === sr && "rk-grid__pinned--edge", t === un && "rk-grid__pinned--edge") : void 0,
912
+ style: e.pinned === "left" ? { left: Ke[e.field] ?? 0 } : e.pinned === "right" ? { right: Ke[e.field] ?? 0 } : void 0
913
+ }), dr = typeof Fe == "object" ? Fe : {}, cr = (e = {}) => {
914
+ const t = { ...dr, ...e }, n = t.scope ?? "filtered", l = n === "page" ? w : n === "selected" ? fe.filter((h) => Ct.has(h.id)) : G, i = t.includeHidden ? r : y, o = i.map((h) => ot(h) || h.field), g = l.map(
915
+ ({ row: h }) => i.map((u) => {
916
+ const k = U(h, u.field);
917
+ return u.exportValue ? u.exportValue(k, h) : u.type === "date" ? H(k) ?? "" : De(u, h);
918
+ })
919
+ );
920
+ return zn(o, g, { sanitize: t.sanitize });
921
+ }, fr = (e = {}) => {
922
+ const t = { ...dr, ...e };
923
+ qn(cr(e), `${t.filename ?? "export"}.csv`);
924
+ };
925
+ j(() => {
926
+ be && (be.current = {
927
+ getCsv: cr,
928
+ exportCsv: fr,
929
+ getSelectedRows: () => Gt(J),
930
+ getSelectedRowIds: () => J,
931
+ selectAll: () => tr(!0),
932
+ clearSelection: () => He([]),
933
+ refresh: () => {
934
+ V && qe(Ve.current);
935
+ }
936
+ });
937
+ }), j(
938
+ () => () => {
939
+ be && (be.current = null);
940
+ },
941
+ [be]
942
+ );
943
+ const ur = (e) => {
944
+ var n, l, i, o, g, h, u, k;
414
945
  const t = e.checkbox ?? {};
415
946
  return {
416
- variant: t.variant ?? Ve,
947
+ variant: t.variant ?? ht,
417
948
  indicator: t.indicator,
418
949
  className: t.className,
419
950
  style: t.style,
420
951
  classNames: {
421
- root: $(S.checkbox, (r = t.classNames) == null ? void 0 : r.root),
422
- control: $(S.checkboxControl, (n = t.classNames) == null ? void 0 : n.control),
423
- indicator: $(S.checkboxIndicator, (i = t.classNames) == null ? void 0 : i.indicator),
424
- label: (d = t.classNames) == null ? void 0 : d.label
952
+ root: C(I.checkbox, (n = t.classNames) == null ? void 0 : n.root),
953
+ control: C(I.checkboxControl, (l = t.classNames) == null ? void 0 : l.control),
954
+ indicator: C(I.checkboxIndicator, (i = t.classNames) == null ? void 0 : i.indicator),
955
+ label: (o = t.classNames) == null ? void 0 : o.label
425
956
  },
426
957
  styles: {
427
- root: { ...D.checkbox, ...(f = t.styles) == null ? void 0 : f.root },
428
- control: { ...D.checkboxControl, ...(a = t.styles) == null ? void 0 : a.control },
429
- indicator: { ...D.checkboxIndicator, ...(u = t.styles) == null ? void 0 : u.indicator },
958
+ root: { ...v.checkbox, ...(g = t.styles) == null ? void 0 : g.root },
959
+ control: { ...v.checkboxControl, ...(h = t.styles) == null ? void 0 : h.control },
960
+ indicator: { ...v.checkboxIndicator, ...(u = t.styles) == null ? void 0 : u.indicator },
430
961
  label: (k = t.styles) == null ? void 0 : k.label
431
962
  }
432
963
  };
433
- }, ne = (e) => e.stopPropagation(), Xe = (e, t) => /* @__PURE__ */ o("span", { className: "rk-grid__checkbox-cell", onClick: ne, onDoubleClick: ne, children: /* @__PURE__ */ o(
434
- Ke,
964
+ }, re = (e) => e.stopPropagation(), hn = (e, t) => /* @__PURE__ */ f("span", { className: "rk-grid__checkbox-cell", onClick: re, onDoubleClick: re, children: /* @__PURE__ */ f(
965
+ me,
435
966
  {
436
- ...Ie(e),
967
+ ...ur(e),
437
968
  checked: !!t.value,
438
969
  disabled: !t.editable,
439
- "aria-label": `Toggle ${e.headerName ?? e.field}`,
440
- onChange: (r) => t.updateValue(r)
970
+ "aria-label": `Toggle ${pe(e)}`,
971
+ onChange: (n) => t.updateValue(n)
441
972
  }
442
- ) }), Be = (e) => O.filter((t) => ue(e, Z(e, t.row, t.index))), Ze = (e, t) => {
443
- const r = new Map(Be(e).map((d) => [d.index, d])), n = [], i = A.current.map((d, f) => {
444
- const a = r.get(f);
445
- if (!a) return d;
446
- const u = d[e.field];
447
- if (!!u === t || e.validate && !e.validate(t, d)) return d;
448
- const k = { ...d, [e.field]: t };
449
- return n.push({ rowId: a.id, rowIndex: f, field: e.field, oldValue: u, newValue: t, row: k }), k;
973
+ ) }), hr = (e) => G.filter((t) => Dt(e, Xe(e, t.row, t.index))), pn = (e, t) => {
974
+ const n = new Map(hr(e).map((o) => [o.index, o])), l = [], i = le.current.map((o, g) => {
975
+ const h = n.get(g);
976
+ if (!h) return o;
977
+ const u = U(o, e.field);
978
+ if (!!u === t || e.validate && !e.validate(t, o)) return o;
979
+ const k = Ot(o, e.field, t);
980
+ return l.push({ rowId: h.id, rowIndex: g, field: e.field, oldValue: u, newValue: t, row: k }), k;
450
981
  });
451
- n.length !== 0 && (ve(i), n.forEach((d) => b == null ? void 0 : b(d)), _ == null || _(i));
452
- }, et = (e) => {
453
- const t = Be(e), r = t.length > 0 ? t : O, n = r.filter((d) => !!d.row[e.field]).length, i = r.length > 0 && n === r.length;
454
- return /* @__PURE__ */ o("span", { className: "rk-grid__header-checkbox", onClick: ne, onDoubleClick: ne, children: /* @__PURE__ */ o(
455
- Ke,
982
+ l.length !== 0 && (Ut(i), l.forEach((o) => c == null ? void 0 : c(o)), m == null || m(i));
983
+ }, gn = (e) => {
984
+ const t = hr(e), n = t.length > 0 ? t : G, l = n.filter((o) => !!U(o.row, e.field)).length, i = n.length > 0 && l === n.length;
985
+ return /* @__PURE__ */ f("span", { className: "rk-grid__header-checkbox", onClick: re, onDoubleClick: re, children: /* @__PURE__ */ f(
986
+ me,
456
987
  {
457
- ...Ie(e),
988
+ ...ur(e),
458
989
  checked: i,
459
- indeterminate: n > 0 && !i,
990
+ indeterminate: l > 0 && !i,
460
991
  disabled: t.length === 0,
461
- label: e.headerName ?? e.field,
462
- onChange: (d) => Ze(e, d)
992
+ label: ot(e) || void 0,
993
+ "aria-label": `Select all ${pe(e)}`,
994
+ onChange: (o) => pn(e, o)
463
995
  }
464
996
  ) });
465
- }, tt = y && (B === "top" || B === "both"), rt = !y || B === "bottom" || B === "both", Se = (e) => /* @__PURE__ */ p(
997
+ }, mn = (e, t, n) => {
998
+ if (t.cellEditor)
999
+ return /* @__PURE__ */ f(
1000
+ "div",
1001
+ {
1002
+ className: "rk-grid__custom-editor",
1003
+ onBlur: (i) => {
1004
+ i.currentTarget.contains(i.relatedTarget) || n.session === ce.current && (Ne(e, t, { value: Be.current }, { focus: !1 }) || te());
1005
+ },
1006
+ onKeyDown: (i) => {
1007
+ i.key === "Escape" && (i.preventDefault(), i.stopPropagation(), te(), Qe(e.id, t.field));
1008
+ },
1009
+ children: ge(t.cellEditor, {
1010
+ value: n.draft,
1011
+ row: e.row,
1012
+ rowIndex: e.index,
1013
+ field: t.field,
1014
+ column: t,
1015
+ onChange: (i) => {
1016
+ Be.current = i, de((o) => o && o.session === n.session ? { ...o, draft: i, invalid: !1 } : o);
1017
+ },
1018
+ onCommit: (i, o = "none") => {
1019
+ n.session === ce.current && Ne(e, t, { value: i === void 0 ? Be.current : i }, { move: o });
1020
+ },
1021
+ onCancel: () => {
1022
+ te(), Qe(e.id, t.field);
1023
+ }
1024
+ })
1025
+ }
1026
+ );
1027
+ const l = t.type === "date";
1028
+ return /* @__PURE__ */ f(
1029
+ "input",
1030
+ {
1031
+ autoFocus: !0,
1032
+ type: l ? "date" : "text",
1033
+ min: l ? t.dateMin : void 0,
1034
+ max: l ? t.dateMax : void 0,
1035
+ className: C("rk-grid__editor", n.invalid && "rk-grid__editor--invalid", I.editor),
1036
+ style: { textAlign: t.align, ...v.editor },
1037
+ value: n.draft === null || n.draft === void 0 ? "" : String(n.draft),
1038
+ inputMode: t.type === "number" ? "decimal" : void 0,
1039
+ "aria-label": `Edit ${pe(t)}`,
1040
+ "aria-invalid": n.invalid || void 0,
1041
+ onChange: (i) => {
1042
+ const o = i.target.value;
1043
+ de((g) => g && { ...g, draft: o, invalid: !1 });
1044
+ },
1045
+ onFocus: (i) => {
1046
+ const o = i.currentTarget;
1047
+ l || (n.select === "all" ? o.select() : o.setSelectionRange(o.value.length, o.value.length));
1048
+ },
1049
+ onBlur: (i) => {
1050
+ if (n.session === ce.current) {
1051
+ if (vr(i.currentTarget)) return te();
1052
+ Ne(e, t, { text: i.currentTarget.value }, { focus: !1 }) || te();
1053
+ }
1054
+ },
1055
+ onKeyDown: (i) => nn(i, e, t)
1056
+ }
1057
+ );
1058
+ }, bn = Z(() => {
1059
+ const e = /* @__PURE__ */ new Map();
1060
+ for (const t of y)
1061
+ t.filterable && !t.filterRenderer && _r(t) === "select" && e.set(t.field, An(t, Pe, (n) => U(n, t.field), (n) => De(t, n)));
1062
+ return e;
1063
+ }, [y, Pe]), kn = Or || !!$e, _n = $e ? { "--rk-stripe-a": $e[0], "--rk-stripe-b": $e[1] } : void 0, yn = Y && (Me === "top" || Me === "both"), xn = Y && (Me === "bottom" || Me === "both"), vn = B || !!Wt || Bt || !!Fe, pr = (e) => /* @__PURE__ */ x(
466
1064
  "div",
467
1065
  {
468
- className: $("rk-grid__footer", e === "top" && "rk-grid__footer--top", S.footer),
469
- style: D.footer,
1066
+ className: C("rk-grid__footer", e === "top" && "rk-grid__footer--top", I.footer),
1067
+ style: v.footer,
470
1068
  "data-position": e,
471
1069
  children: [
472
- /* @__PURE__ */ o("span", { ...g("rowCount", "rk-grid__count"), children: V === 0 ? "0 rows" : `${Oe}–${Ye} of ${V}` }),
473
- y && /* @__PURE__ */ p("div", { ...g("pagination", "rk-grid__pagination"), children: [
474
- /* @__PURE__ */ p("label", { className: "rk-grid__page-size-label", children: [
1070
+ /* @__PURE__ */ x("span", { ...L("rowCount", "rk-grid__count"), children: [
1071
+ he === 0 ? "0 rows" : `${Yr}–${Xr} of ${he}`,
1072
+ W && J.length > 0 ? ` · ${J.length} selected` : ""
1073
+ ] }),
1074
+ /* @__PURE__ */ x("div", { ...L("pagination", "rk-grid__pagination"), children: [
1075
+ /* @__PURE__ */ x("label", { className: "rk-grid__page-size-label", children: [
475
1076
  "Rows per page",
476
- /* @__PURE__ */ o(
477
- "select",
478
- {
479
- value: T,
480
- onChange: (t) => Ge(Number(t.target.value)),
481
- ...g("pageSize", "rk-grid__page-size"),
482
- children: (oe.includes(T) ? oe : [...oe, T].sort((t, r) => t - r)).map(
483
- (t) => /* @__PURE__ */ o("option", { value: t, children: t }, t)
484
- )
485
- }
486
- )
1077
+ /* @__PURE__ */ f("select", { value: A, onChange: (t) => jr(Number(t.target.value)), ...L("pageSize", "rk-grid__page-size"), children: (at.includes(A) ? at : [...at, A].sort((t, n) => t - n)).map((t) => /* @__PURE__ */ f("option", { value: t, children: t }, t)) })
487
1078
  ] }),
488
- /* @__PURE__ */ o("button", { type: "button", "aria-label": "First page", disabled: C === 0, onClick: () => W(0), ...g("pageButton", "rk-grid__page-btn"), children: "«" }),
489
- /* @__PURE__ */ o("button", { type: "button", "aria-label": "Previous page", disabled: C === 0, onClick: () => W(C - 1), ...g("pageButton", "rk-grid__page-btn"), children: "‹" }),
490
- /* @__PURE__ */ p("span", { ...g("pageInfo", "rk-grid__page-info"), children: [
1079
+ /* @__PURE__ */ f("button", { type: "button", "aria-label": "First page", disabled: K === 0, onClick: () => ae(0), ...L("pageButton", "rk-grid__page-btn"), children: "«" }),
1080
+ /* @__PURE__ */ f("button", { type: "button", "aria-label": "Previous page", disabled: K === 0, onClick: () => ae(K - 1), ...L("pageButton", "rk-grid__page-btn"), children: "‹" }),
1081
+ /* @__PURE__ */ x("span", { ...L("pageInfo", "rk-grid__page-info"), children: [
491
1082
  "Page ",
492
- C + 1,
1083
+ K + 1,
493
1084
  " of ",
494
- Y
1085
+ Q
495
1086
  ] }),
496
- /* @__PURE__ */ o("button", { type: "button", "aria-label": "Next page", disabled: C >= Y - 1, onClick: () => W(C + 1), ...g("pageButton", "rk-grid__page-btn"), children: "›" }),
497
- /* @__PURE__ */ o("button", { type: "button", "aria-label": "Last page", disabled: C >= Y - 1, onClick: () => W(Y - 1), ...g("pageButton", "rk-grid__page-btn"), children: "»" })
1087
+ /* @__PURE__ */ f("button", { type: "button", "aria-label": "Next page", disabled: K >= Q - 1, onClick: () => ae(K + 1), ...L("pageButton", "rk-grid__page-btn"), children: "›" }),
1088
+ /* @__PURE__ */ f("button", { type: "button", "aria-label": "Last page", disabled: K >= Q - 1, onClick: () => ae(Q - 1), ...L("pageButton", "rk-grid__page-btn"), children: "»" })
498
1089
  ] })
499
1090
  ]
500
1091
  }
501
- ), nt = l.some(we);
502
- return /* @__PURE__ */ p("div", { className: $("rk-grid", S.root, Re), style: { ...D.root, ...Ae }, children: [
503
- (I || ge) && /* @__PURE__ */ p("div", { ...g("toolbar", "rk-grid__toolbar"), children: [
504
- I ? /* @__PURE__ */ o(
505
- "input",
506
- {
507
- type: "search",
508
- value: U,
509
- onChange: (e) => ze(e.target.value),
510
- placeholder: P,
511
- "aria-label": "Search all columns",
512
- ...g("search", "rk-grid__search")
513
- }
514
- ) : /* @__PURE__ */ o("span", {}),
515
- ge
516
- ] }),
517
- tt && Se("top"),
518
- /* @__PURE__ */ o("div", { ...g("scroll", "rk-grid__scroll"), style: { ...D.scroll, ...me !== void 0 ? { maxHeight: me } : null }, children: /* @__PURE__ */ p("table", { ...g("table", "rk-grid__table"), role: "grid", children: [
519
- /* @__PURE__ */ p("thead", { ...g("thead", "rk-grid__thead"), children: [
520
- /* @__PURE__ */ o("tr", { ...g("headerRow", "rk-grid__tr"), children: l.map((e) => {
521
- const t = (w == null ? void 0 : w.field) === e.field ? w.direction : null, r = Ne(e);
522
- return /* @__PURE__ */ o(
523
- "th",
1092
+ ), wn = (e) => /* @__PURE__ */ f("tr", { className: "rk-grid__tr rk-grid__skeleton-row", "aria-hidden": "true", style: q ? { height: X } : void 0, children: Kt ? (
1093
+ // A custom component draws the whole row content inside one wide cell
1094
+ /* @__PURE__ */ f("td", { colSpan: ve, className: "rk-grid__td rk-grid__skeleton-cell", children: ge(Kt, { rowIndex: e, columns: y }) })
1095
+ ) : /* @__PURE__ */ x(lt, { children: [
1096
+ W && /* @__PURE__ */ f("td", { className: "rk-grid__td", children: /* @__PURE__ */ f("span", { ...L("skeleton", "rk-grid__skeleton"), style: { ...v.skeleton, width: 18 } }) }),
1097
+ y.map((t, n) => /* @__PURE__ */ f("td", { className: "rk-grid__td", style: { textAlign: t.align }, children: /* @__PURE__ */ f("span", { ...L("skeleton", "rk-grid__skeleton"), style: { ...v.skeleton, width: `${55 + (e * 7 + n * 13) % 35}%` } }) }, t.field))
1098
+ ] }) }, `sk${e}`), Nn = (e, t) => {
1099
+ const { row: n, id: l, index: i } = e, o = typeof gt == "function" ? gt(n, i) : gt, g = typeof mt == "function" ? mt(n, i) : mt, h = Ct.has(l);
1100
+ return /* @__PURE__ */ x(
1101
+ "tr",
1102
+ {
1103
+ onClick: ut ? () => ut(n, i) : void 0,
1104
+ "aria-selected": W ? h : void 0,
1105
+ className: C(
1106
+ "rk-grid__tr",
1107
+ "rk-grid__row",
1108
+ kn && (t % 2 === 0 ? "rk-grid__row--stripe-a" : "rk-grid__row--stripe-b"),
1109
+ jt && !q && "rk-grid__row--enter",
1110
+ h && "rk-grid__row--selected",
1111
+ ut && "rk-grid__row--clickable",
1112
+ I.row,
1113
+ o
1114
+ ),
1115
+ style: {
1116
+ ...jt && !q ? { "--rk-i": Math.min(t, 24) } : null,
1117
+ ...q ? { height: X } : null,
1118
+ ...v.row,
1119
+ ...g
1120
+ },
1121
+ children: [
1122
+ W && /* @__PURE__ */ f(
1123
+ "td",
524
1124
  {
525
- scope: "col",
526
- "aria-sort": t ? t === "asc" ? "ascending" : "descending" : r ? "none" : void 0,
527
- tabIndex: r ? 0 : void 0,
528
- onClick: () => De(e),
529
- onKeyDown: (n) => {
530
- r && n.target === n.currentTarget && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), De(e));
1125
+ className: C("rk-grid__td rk-grid__select-cell", rt && "rk-grid__pinned rk-grid__pinned--left"),
1126
+ style: { width: ee, minWidth: ee, maxWidth: ee, ...rt ? { left: 0 } : null },
1127
+ onClick: re,
1128
+ children: /* @__PURE__ */ f("span", { className: "rk-grid__checkbox-cell", onClickCapture: (u) => Qt.current = u.shiftKey, children: /* @__PURE__ */ f(
1129
+ me,
1130
+ {
1131
+ variant: ht,
1132
+ checked: h,
1133
+ disabled: !Je(n),
1134
+ "aria-label": W === "single" ? "Select row" : `Select row ${i + 1}`,
1135
+ onChange: (u) => en(e, u),
1136
+ classNames: { root: I.checkbox, control: I.checkboxControl, indicator: I.checkboxIndicator },
1137
+ styles: { root: v.checkbox, control: v.checkboxControl, indicator: v.checkboxIndicator }
1138
+ }
1139
+ ) })
1140
+ }
1141
+ ),
1142
+ y.map((u, k) => {
1143
+ const E = tn(u, e), nt = typeof u.cellClassName == "function" ? u.cellClassName(E) : u.cellClassName, Sn = typeof u.cellStyle == "function" ? u.cellStyle(E) : u.cellStyle, gr = ye !== null && ye.id === l && ye.field === u.field, Lt = Ge(u, E), mr = ar(u, k), Cn = _t ? _t.id === l && _t.field === u.field : t === 0 && k === 0;
1144
+ return /* @__PURE__ */ f(
1145
+ "td",
1146
+ {
1147
+ ref: (ne) => {
1148
+ const br = Mt(l, u.field);
1149
+ ne ? Re.current.set(br, ne) : Re.current.delete(br);
1150
+ },
1151
+ tabIndex: ft ? Cn ? 0 : -1 : Lt ? 0 : void 0,
1152
+ onFocus: ft ? (ne) => ne.target === ne.currentTarget && qt({ id: l, field: u.field }) : void 0,
1153
+ onDoubleClick: Lt ? () => Ze(e, u) : void 0,
1154
+ onKeyDown: (ne) => sn(ne, e, u, E),
1155
+ className: C(
1156
+ "rk-grid__td",
1157
+ Lt && "rk-grid__td--editable",
1158
+ gr && "rk-grid__td--editing",
1159
+ mr.className,
1160
+ I.cell,
1161
+ u.className,
1162
+ nt
1163
+ ),
1164
+ style: { textAlign: u.align, ...v.cell, ...u.style, ...Sn, ...mr.style },
1165
+ children: gr && ye ? mn(e, u, ye) : u.cellRenderer ? ge(u.cellRenderer, E) : u.type === "boolean" && !u.cellEditor ? hn(u, E) : E.formattedValue
531
1166
  },
532
- className: $("rk-grid__th", r && "rk-grid__th--sortable", S.headerCell, e.headerClassName),
533
- style: { width: e.width, minWidth: e.minWidth, textAlign: e.align, ...D.headerCell, ...e.headerStyle },
534
- children: /* @__PURE__ */ p("span", { className: "rk-grid__th-content", children: [
535
- e.headerRenderer ? ie(e.headerRenderer, { column: e, sortDirection: t }) : e.headerCheckbox && e.type === "boolean" ? et(e) : e.headerName ?? e.field,
536
- r && /* @__PURE__ */ o("span", { className: "rk-grid__sort", "aria-hidden": "true", children: t === "asc" ? "▲" : t === "desc" ? "▼" : "↕" })
537
- ] })
538
- },
539
- e.field
540
- );
541
- }) }),
542
- nt && /* @__PURE__ */ o("tr", { ...g("filterRow", "rk-grid__tr"), children: l.map((e) => /* @__PURE__ */ o("th", { ...g("filterCell", "rk-grid__filter-cell"), children: we(e) && (e.filterRenderer ? ie(e.filterRenderer, {
543
- column: e,
544
- value: z[e.field] ?? "",
545
- onChange: (t) => xe((r) => ({ ...r, [e.field]: t }))
546
- }) : /* @__PURE__ */ o(
547
- "input",
1167
+ u.field
1168
+ );
1169
+ })
1170
+ ]
1171
+ },
1172
+ l
1173
+ );
1174
+ }, En = Mr ?? (Y ? Math.min(A, 20) : 5);
1175
+ return /* @__PURE__ */ x(
1176
+ "div",
1177
+ {
1178
+ className: C("rk-grid", q && "rk-grid--virtual", I.root, Pr),
1179
+ style: { ..._n, ...v.root, ...Ar },
1180
+ "data-rk-theme": pt || void 0,
1181
+ "aria-busy": St || void 0,
1182
+ children: [
1183
+ vn && /* @__PURE__ */ x("div", { ...L("toolbar", "rk-grid__toolbar"), children: [
1184
+ /* @__PURE__ */ x("div", { className: "rk-grid__toolbar-left", children: [
1185
+ B && /* @__PURE__ */ f(
1186
+ "input",
1187
+ {
1188
+ type: "search",
1189
+ value: ke,
1190
+ onChange: (e) => Kr(e.target.value),
1191
+ placeholder: ie,
1192
+ "aria-label": "Search all columns",
1193
+ ...L("search", "rk-grid__search")
1194
+ }
1195
+ ),
1196
+ W && J.length > 0 && /* @__PURE__ */ x("span", { className: "rk-grid__selected-count", role: "status", children: [
1197
+ J.length,
1198
+ " selected"
1199
+ ] })
1200
+ ] }),
1201
+ /* @__PURE__ */ x("div", { className: "rk-grid__toolbar-actions", children: [
1202
+ Wt,
1203
+ Bt && /* @__PURE__ */ f(
1204
+ jn,
1205
+ {
1206
+ columns: r,
1207
+ hidden: Ae,
1208
+ onToggle: Ur,
1209
+ theme: pt,
1210
+ className: I.toolButton,
1211
+ style: v.toolButton
1212
+ }
1213
+ ),
1214
+ Fe && /* @__PURE__ */ f("button", { type: "button", onClick: () => fr(), ...L("toolButton", "rk-grid__tool-btn"), children: "Export CSV" })
1215
+ ] })
1216
+ ] }),
1217
+ yn && pr("top"),
1218
+ /* @__PURE__ */ f(
1219
+ "div",
548
1220
  {
549
- value: z[e.field] ?? "",
550
- onChange: (t) => xe((r) => ({ ...r, [e.field]: t.target.value })),
551
- placeholder: "Filter",
552
- "aria-label": `Filter ${e.headerName ?? e.field}`,
553
- ...g("filterInput", "rk-grid__filter-input")
1221
+ ref: xe,
1222
+ ...L("scroll", "rk-grid__scroll"),
1223
+ onScroll: q ? (e) => Ht({ top: e.currentTarget.scrollTop, height: e.currentTarget.clientHeight }) : void 0,
1224
+ style: { ...v.scroll, ...Oe !== void 0 ? { maxHeight: Oe } : q ? { maxHeight: 400 } : null },
1225
+ children: /* @__PURE__ */ x(
1226
+ "table",
1227
+ {
1228
+ ...L("table", "rk-grid__table"),
1229
+ role: "grid",
1230
+ style: Tt ? {
1231
+ ...v.table,
1232
+ tableLayout: "fixed",
1233
+ width: y.reduce((e, t) => e + tt(t), W ? ee : 0),
1234
+ minWidth: "100%"
1235
+ } : v.table,
1236
+ children: [
1237
+ /* @__PURE__ */ f("thead", { ...L("thead", "rk-grid__thead"), children: /* @__PURE__ */ x("tr", { ...L("headerRow", "rk-grid__tr"), children: [
1238
+ W && /* @__PURE__ */ f(
1239
+ "th",
1240
+ {
1241
+ scope: "col",
1242
+ className: C("rk-grid__th rk-grid__select-cell", rt && "rk-grid__pinned rk-grid__pinned--left", I.headerCell),
1243
+ style: { width: ee, minWidth: ee, maxWidth: ee, ...rt ? { left: 0 } : null, ...v.headerCell },
1244
+ children: W === "multiple" && /* @__PURE__ */ f("span", { className: "rk-grid__checkbox-cell", children: /* @__PURE__ */ f(
1245
+ me,
1246
+ {
1247
+ variant: ht,
1248
+ checked: er,
1249
+ indeterminate: Zt > 0 && !er,
1250
+ disabled: we.length === 0,
1251
+ "aria-label": "Select all rows",
1252
+ onChange: tr,
1253
+ classNames: { root: I.checkbox, control: I.checkboxControl, indicator: I.checkboxIndicator },
1254
+ styles: { root: v.checkbox, control: v.checkboxControl, indicator: v.checkboxIndicator }
1255
+ }
1256
+ ) })
1257
+ }
1258
+ ),
1259
+ y.map((e, t) => {
1260
+ const n = R.findIndex((h) => h.field === e.field), l = n >= 0 ? R[n].direction : null, i = vt(e), o = Yt(e), g = ar(e, t);
1261
+ return /* @__PURE__ */ x(
1262
+ "th",
1263
+ {
1264
+ ref: (h) => {
1265
+ h ? _e.current.set(e.field, h) : _e.current.delete(e.field);
1266
+ },
1267
+ scope: "col",
1268
+ "aria-sort": l ? l === "asc" ? "ascending" : "descending" : i ? "none" : void 0,
1269
+ tabIndex: i ? 0 : void 0,
1270
+ onClick: (h) => rr(e, h.shiftKey),
1271
+ onKeyDown: (h) => {
1272
+ i && h.target === h.currentTarget && (h.key === "Enter" || h.key === " ") && (h.preventDefault(), rr(e, h.shiftKey));
1273
+ },
1274
+ className: C("rk-grid__th", i && "rk-grid__th--sortable", g.className, I.headerCell, e.className, e.headerClassName),
1275
+ style: {
1276
+ width: Tt ? tt(e) : e.width,
1277
+ minWidth: e.minWidth,
1278
+ textAlign: e.align,
1279
+ ...v.headerCell,
1280
+ ...e.style,
1281
+ ...e.headerStyle,
1282
+ ...g.style
1283
+ },
1284
+ children: [
1285
+ /* @__PURE__ */ x("span", { className: "rk-grid__th-content", children: [
1286
+ e.headerRenderer ? ge(e.headerRenderer, { column: e, sortDirection: l }) : e.headerCheckbox && e.type === "boolean" ? gn(e) : ot(e),
1287
+ e.filterable && /* @__PURE__ */ f(
1288
+ Wn,
1289
+ {
1290
+ column: e,
1291
+ label: pe(e),
1292
+ kind: o,
1293
+ value: se[e.field],
1294
+ onChange: (h) => {
1295
+ const u = { ...se };
1296
+ h === void 0 ? delete u[e.field] : u[e.field] = h, Br(u);
1297
+ },
1298
+ options: bn.get(e.field) ?? [],
1299
+ theme: pt,
1300
+ indicatorClassName: C(I.filterIndicator, e.filterIndicatorClassName),
1301
+ indicatorStyle: { ...v.filterIndicator, ...e.filterIndicatorStyle },
1302
+ popupClassName: C(I.filterPopup, e.filterPopupClassName),
1303
+ popupStyle: { ...v.filterPopup, ...e.filterPopupStyle },
1304
+ inputClassName: I.filterInput,
1305
+ inputStyle: v.filterInput
1306
+ }
1307
+ ),
1308
+ i && /* @__PURE__ */ x("span", { className: "rk-grid__sort", "aria-hidden": "true", children: [
1309
+ l === "asc" ? "▲" : l === "desc" ? "▼" : "↕",
1310
+ l && R.length > 1 && /* @__PURE__ */ f("sup", { className: "rk-grid__sort-order", children: n + 1 })
1311
+ ] })
1312
+ ] }),
1313
+ e.resizable && /* @__PURE__ */ f(
1314
+ "span",
1315
+ {
1316
+ className: "rk-grid__resizer",
1317
+ role: "separator",
1318
+ "aria-orientation": "vertical",
1319
+ "aria-label": `Resize ${pe(e)}`,
1320
+ onPointerDown: (h) => fn(h, e),
1321
+ onClick: re,
1322
+ onDoubleClick: re
1323
+ }
1324
+ )
1325
+ ]
1326
+ },
1327
+ e.field
1328
+ );
1329
+ })
1330
+ ] }) }),
1331
+ /* @__PURE__ */ f("tbody", { ...L("tbody", "rk-grid__tbody"), children: St ? Array.from({ length: En }, (e, t) => wn(t)) : Zr ? /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ x("td", { colSpan: ve, ...L("empty", "rk-grid__empty rk-grid__error"), role: "alert", children: [
1332
+ Fr,
1333
+ " ",
1334
+ /* @__PURE__ */ f("button", { type: "button", className: "rk-grid__tool-btn", onClick: () => qe(Ve.current), children: "Retry" })
1335
+ ] }) }) : w.length === 0 ? /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", { colSpan: ve, ...L("empty", "rk-grid__empty"), children: $r }) }) : /* @__PURE__ */ x(lt, { children: [
1336
+ Ee && et > 0 && /* @__PURE__ */ f("tr", { "aria-hidden": "true", className: "rk-grid__spacer", children: /* @__PURE__ */ f("td", { colSpan: ve, style: { height: et * X } }) }),
1337
+ dn.map((e, t) => Nn(e, et + t)),
1338
+ Ee && It < w.length && /* @__PURE__ */ f("tr", { "aria-hidden": "true", className: "rk-grid__spacer", children: /* @__PURE__ */ f("td", { colSpan: ve, style: { height: (w.length - It) * X } }) })
1339
+ ] }) }, or)
1340
+ ]
1341
+ }
1342
+ )
554
1343
  }
555
- )) }, e.field)) })
556
- ] }),
557
- /* @__PURE__ */ o("tbody", { ...g("tbody", "rk-grid__tbody"), children: K.length === 0 ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: l.length, ...g("empty", "rk-grid__empty"), children: Fe }) }) : K.map((e, t) => {
558
- const { row: r, id: n, index: i } = e, d = typeof de == "function" ? de(r, i) : de, f = typeof se == "function" ? se(r, i) : se;
559
- return /* @__PURE__ */ o(
560
- "tr",
561
- {
562
- onClick: ae ? () => ae(r, i) : void 0,
563
- className: $(
564
- "rk-grid__tr",
565
- "rk-grid__row",
566
- Le && t % 2 === 1 && "rk-grid__row--striped",
567
- ae && "rk-grid__row--clickable",
568
- S.row,
569
- d
570
- ),
571
- style: { ...D.row, ...f },
572
- children: l.map((a) => {
573
- const u = He(a, e), k = typeof a.cellClassName == "function" ? a.cellClassName(u) : a.cellClassName, N = typeof a.cellStyle == "function" ? a.cellStyle(u) : a.cellStyle, fe = q !== null && q.id === n && q.field === a.field, he = ee(a, u);
574
- return /* @__PURE__ */ o(
575
- "td",
576
- {
577
- ref: (le) => {
578
- const Te = Pe(n, a.field);
579
- le ? ce.current.set(Te, le) : ce.current.delete(Te);
580
- },
581
- tabIndex: he ? 0 : void 0,
582
- onDoubleClick: he ? () => re(e, a) : void 0,
583
- onKeyDown: (le) => Qe(le, e, a, u),
584
- className: $(
585
- "rk-grid__td",
586
- he && "rk-grid__td--editable",
587
- fe && "rk-grid__td--editing",
588
- S.cell,
589
- k
590
- ),
591
- style: { textAlign: a.align, ...D.cell, ...N },
592
- children: fe && q ? Ue(e, a, q) : a.cellRenderer ? ie(a.cellRenderer, u) : a.type === "boolean" && !a.cellEditor ? Xe(a, u) : u.formattedValue
593
- },
594
- a.field
595
- );
596
- })
597
- },
598
- n
599
- );
600
- }) })
601
- ] }) }),
602
- rt && Se("bottom")
603
- ] });
1344
+ ),
1345
+ xn && pr("bottom")
1346
+ ]
1347
+ }
1348
+ );
604
1349
  }
605
1350
  export {
606
- bt as Alert,
607
- kt as Badge,
608
- ut as Button,
609
- ht as Card,
610
- Ke as Checkbox,
611
- mt as DataGrid,
612
- ft as Input,
613
- gt as Modal
1351
+ me as Checkbox,
1352
+ ei as DataGrid
614
1353
  };