flexi-datagrid 1.2.7 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,17 +1,17 @@
1
- import { ArrowDown as e, ArrowUp as t, ArrowUpDown as n, ChevronDown as r, ChevronLeft as i, ChevronRight as a, ChevronsLeft as o, ChevronsRight as s, Filter as ee, Pin as te, PinOff as ne, RotateCcw as re, Settings as ie, X as c } from "lucide-react";
2
- import { useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
3
- import { createPortal as ae } from "react-dom";
4
- import { Fragment as oe, jsx as p, jsxs as m } from "react/jsx-runtime";
1
+ import { ArrowDown as e, ArrowUp as t, ArrowUpDown as n, ChevronDown as r, ChevronLeft as i, ChevronRight as a, ChevronsLeft as o, ChevronsRight as s, Filter as ee, Pin as te, PinOff as ne, RotateCcw as re, Settings as ie, X as ae } from "lucide-react";
2
+ import { useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
3
+ import { createPortal as oe } from "react-dom";
4
+ import { Fragment as se, jsx as f, jsxs as p } from "react/jsx-runtime";
5
5
  //#region src/Datatable.tsx
6
- var h = (e) => {
6
+ var m = (e) => {
7
7
  let t = [];
8
8
  return e.forEach((e) => {
9
- e.children && e.children.length > 0 ? t.push(...h(e.children)) : t.push(e);
9
+ e.children && e.children.length > 0 ? t.push(...m(e.children)) : t.push(e);
10
10
  }), t;
11
- }, g = (...e) => e.filter(Boolean).join(" "), se = (e) => {
11
+ }, h = (...e) => e.filter(Boolean).join(" "), ce = (e) => {
12
12
  if (e === !0) return "left";
13
13
  if (e === "left" || e === "right") return e;
14
- }, ce = (e, t, n) => {
14
+ }, le = (e, t, n) => {
15
15
  let r = (e) => {
16
16
  let n = t[e];
17
17
  return n === "left" ? 0 : n === "right" ? 2 : 1;
@@ -26,55 +26,55 @@ var h = (e) => {
26
26
  children: i(e.children)
27
27
  } : e);
28
28
  return i(e);
29
- }, le = 48, ue = 150, de = 60;
30
- function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy: b = !1, defaultGroupBy: me = [], onPinChange: he, onGroupChange: x, containerStyle: ge, tableStyle: _e, bordered: ve = !1, pinnedBottomRowData: S = [], pinnedRowClassName: ye, rowHeight: C = le, overscan: be = 8, onColumnResize: xe, onColumnReorder: Se, rowClassRules: Ce, onRowClick: we, rowSpanColumns: w, controlPanel: Te = !1, defaultDisplayPinnedIcon: Ee = !0, defaultHiddenColumns: De = [], onColumnVisibilityChange: T, pagination: E = !1, defaultPageSize: Oe = 10, pageSizeOptions: ke = [
29
+ }, ue = 48, de = 150, fe = 60;
30
+ function g({ columns: g, data: _, rowKey: pe, actions: v, isLoading: me, groupBy: y = !1, defaultGroupBy: he = [], onPinChange: ge, onGroupChange: b, containerStyle: _e, tableStyle: ve, bordered: ye = !1, pinnedBottomRowData: x = [], pinnedRowClassName: be, rowHeight: S = ue, overscan: xe = 8, onColumnResize: Se, onColumnReorder: Ce, rowClassRules: we, onRowClick: Te, rowSpanColumns: C, controlPanel: Ee = !1, defaultDisplayPinnedIcon: De = !0, defaultHiddenColumns: Oe = [], onColumnVisibilityChange: w, pagination: T = !1, defaultPageSize: ke = 10, pageSizeOptions: Ae = [
31
31
  10,
32
32
  25,
33
33
  50,
34
34
  100
35
- ], onPageChange: D }) {
36
- let [O, Ae] = f(null), [k, je] = f({}), [A, Me] = f(""), [Ne, Pe] = f(null), [Fe, Ie] = f(null), j = d(/* @__PURE__ */ new Map()), [M, Le] = f(me), [Re, ze] = f({}), [Be, Ve] = f(!1), [N, He] = f({
35
+ ], onPageChange: E }) {
36
+ let [D, je] = d(null), [O, Me] = d({}), [k, Ne] = d(""), [Pe, Fe] = d(null), [Ie, Le] = d(null), Re = u(/* @__PURE__ */ new Map()), [A, ze] = d(he), [Be, Ve] = d({}), [He, Ue] = d(!1), [j, We] = d({
37
37
  key: null,
38
38
  direction: null
39
- }), [Ue, We] = f({}), [Ge, Ke] = f({}), [qe, Je] = f(Ee), [P, Ye] = f(De), [F, Xe] = f(!1), Ze = d(null), I = d(null), [L, R] = f(1), [z, Qe] = f(Oe), $e = d(null), et = d(!1), B = d(null), V = u(() => h(_), [_]), [H, tt] = f(() => {
39
+ }), [Ge, Ke] = d({}), [qe, Je] = d({}), [Ye, Xe] = d(De), [M, Ze] = d(Oe), [N, Qe] = d(!1), $e = u(null), P = u(null), [F, I] = d(1), [L, et] = d(ke), tt = u(null), nt = u(!1), R = u(null), z = l(() => m(g), [g]), [B, rt] = d(() => {
40
40
  let e = {};
41
- return V.forEach((t) => {
42
- let n = se(t.pinned);
41
+ return z.forEach((t) => {
42
+ let n = ce(t.pinned);
43
43
  n && (e[t.key] = n);
44
44
  }), e;
45
- }), U = u(() => ce(_, H, Ge), [
46
- _,
47
- H,
48
- Ge
49
- ]), W = u(() => {
50
- let e = h(U), t = b ? M : [];
51
- return e.filter((e) => !t.includes(e.key) && !P.includes(e.key));
45
+ }), V = l(() => le(g, B, qe), [
46
+ g,
47
+ B,
48
+ qe
49
+ ]), H = l(() => {
50
+ let e = m(V), t = y ? A : [];
51
+ return e.filter((e) => !t.includes(e.key) && !M.includes(e.key));
52
52
  }, [
53
- U,
54
- M,
55
- b,
56
- P
57
- ]), G = d(null), nt = d(null);
58
- l(() => {
53
+ V,
54
+ A,
55
+ y,
56
+ M
57
+ ]), U = u(null), it = u(null);
58
+ c(() => {
59
59
  function e(e) {
60
- let t = e.target, n = O ? j.current.get(O) : null;
61
- nt.current && !nt.current.contains(t) && !(n && n.contains(t)) && (Ae(null), Me(""));
60
+ let t = e.target, n = D ? Re.current.get(D) : null;
61
+ it.current && !it.current.contains(t) && !(n && n.contains(t)) && (je(null), Ne(""));
62
62
  }
63
63
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
64
- }, [O]), l(() => {
65
- if (!F) return;
64
+ }, [D]), c(() => {
65
+ if (!N) return;
66
66
  function e(e) {
67
67
  let t = e.target;
68
- Ze.current && !Ze.current.contains(t) && !(I.current && I.current.contains(t)) && Xe(!1);
68
+ $e.current && !$e.current.contains(t) && !(P.current && P.current.contains(t)) && Qe(!1);
69
69
  }
70
70
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
71
- }, [F]), l(() => {
72
- if (!F) return;
71
+ }, [N]), c(() => {
72
+ if (!N) return;
73
73
  let e = () => {
74
- let e = I.current, t = G.current;
74
+ let e = P.current, t = U.current;
75
75
  if (!e || !t) return;
76
76
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
77
- Ie({
77
+ Le({
78
78
  top: n.bottom - r.top + 4,
79
79
  right: r.right - n.right
80
80
  });
@@ -82,13 +82,13 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
82
82
  return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
83
83
  window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
84
84
  };
85
- }, [F]), l(() => {
86
- if (!O) return;
85
+ }, [N]), c(() => {
86
+ if (!D) return;
87
87
  let e = () => {
88
- let e = j.current.get(O), t = G.current;
88
+ let e = Re.current.get(D), t = U.current;
89
89
  if (!e || !t) return;
90
90
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
91
- Pe({
91
+ Fe({
92
92
  top: n.bottom - r.top + 4,
93
93
  left: n.left - r.left
94
94
  });
@@ -96,94 +96,94 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
96
96
  return e(), window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
97
97
  window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
98
98
  };
99
- }, [O]);
100
- let rt = (e) => typeof fe == "function" ? fe(e) : String(e[fe]), it = (e, t) => {
101
- if (!Ce) return;
99
+ }, [D]);
100
+ let at = (e) => typeof pe == "function" ? pe(e) : String(e[pe]), ot = (e, t) => {
101
+ if (!we) return;
102
102
  let n;
103
- for (let r in Ce) Ce[r](e, t) && (n = n ? `${n} ${r}` : r);
103
+ for (let r in we) we[r](e, t) && (n = n ? `${n} ${r}` : r);
104
104
  return n;
105
- }, at = (e) => {
106
- tt((t) => {
105
+ }, st = (e) => {
106
+ rt((t) => {
107
107
  let n = t[e], r = n ? n === "left" ? "right" : void 0 : "left", i = { ...t };
108
- return r ? i[e] = r : delete i[e], he && he(e, !!r, r), i;
108
+ return r ? i[e] = r : delete i[e], ge && ge(e, !!r, r), i;
109
109
  });
110
- }, ot = (e) => {
111
- Ye((t) => {
110
+ }, ct = (e) => {
111
+ Ze((t) => {
112
112
  let n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
113
- return T && T(n), n;
113
+ return w && w(n), n;
114
114
  });
115
- }, st = () => {
116
- Je(Ee), Ye(De), T && T(De);
117
- }, ct = (e) => {
115
+ }, lt = () => {
116
+ Xe(De), Ze(Oe), w && w(Oe);
117
+ }, ut = (e) => {
118
118
  let t = "asc";
119
- N.key === e && (t = N.direction === "asc" ? "desc" : N.direction === "desc" ? null : "asc"), He({
119
+ j.key === e && (t = j.direction === "asc" ? "desc" : j.direction === "desc" ? null : "asc"), We({
120
120
  key: t ? e : null,
121
121
  direction: t
122
122
  });
123
- }, lt = (e, t, n) => {
124
- if (et.current) {
123
+ }, dt = (e, t, n) => {
124
+ if (nt.current) {
125
125
  e.preventDefault();
126
126
  return;
127
127
  }
128
- $e.current = t, n && e.dataTransfer.setData("text/plain", t), e.dataTransfer.effectAllowed = "move";
129
- }, ut = (e, t, n) => {
128
+ tt.current = t, n && e.dataTransfer.setData("text/plain", t), e.dataTransfer.effectAllowed = "move";
129
+ }, ft = (e, t, n) => {
130
130
  let r = e.map((e) => e.key);
131
131
  if (r.includes(t) && r.includes(n)) return e;
132
132
  for (let r of e) if (r.children && r.children.length > 0) {
133
- let e = ut(r.children, t, n);
133
+ let e = ft(r.children, t, n);
134
134
  if (e) return e;
135
135
  }
136
136
  return null;
137
- }, dt = (e, t) => {
137
+ }, pt = (e, t) => {
138
138
  e.preventDefault(), e.stopPropagation();
139
- let n = $e.current;
140
- if ($e.current = null, !n || n === t) return;
141
- let r = ut(U, n, t);
139
+ let n = tt.current;
140
+ if (tt.current = null, !n || n === t) return;
141
+ let r = ft(V, n, t);
142
142
  if (!r) return;
143
143
  let i = r.map((e) => e.key), a = i.indexOf(n), o = i.indexOf(t);
144
144
  i.splice(o, 0, i.splice(a, 1)[0]);
145
- let s = { ...Ge };
145
+ let s = { ...qe };
146
146
  i.forEach((e, t) => {
147
147
  s[e] = t;
148
- }), Ke(s), Se && Se(h(ce(_, H, s)).map((e) => e.key));
149
- }, ft = (e, t) => {
150
- e.preventDefault(), e.stopPropagation(), et.current = !0, B.current = {
148
+ }), Je(s), Ce && Ce(m(le(g, B, s)).map((e) => e.key));
149
+ }, mt = (e, t) => {
150
+ e.preventDefault(), e.stopPropagation(), nt.current = !0, R.current = {
151
151
  key: t.key,
152
152
  startX: e.clientX,
153
- startWidth: K(t)
153
+ startWidth: W(t)
154
154
  };
155
- let n = t.minWidth ?? de, r = t.maxWidth, i = (e) => {
156
- let t = B.current;
155
+ let n = t.minWidth ?? fe, r = t.maxWidth, i = (e) => {
156
+ let t = R.current;
157
157
  if (!t) return;
158
158
  let i = t.startWidth + (e.clientX - t.startX);
159
- i = Math.max(n, i), r && (i = Math.min(r, i)), We((e) => e[t.key] === i ? e : {
159
+ i = Math.max(n, i), r && (i = Math.min(r, i)), Ke((e) => e[t.key] === i ? e : {
160
160
  ...e,
161
161
  [t.key]: i
162
162
  });
163
163
  }, a = () => {
164
- let e = B.current;
165
- B.current = null, window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", a), requestAnimationFrame(() => {
166
- et.current = !1;
167
- }), e && xe && We((t) => (t[e.key] !== void 0 && xe(e.key, t[e.key]), t));
164
+ let e = R.current;
165
+ R.current = null, window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", a), requestAnimationFrame(() => {
166
+ nt.current = !1;
167
+ }), e && Se && Ke((t) => (t[e.key] !== void 0 && Se(e.key, t[e.key]), t));
168
168
  };
169
169
  window.addEventListener("mousemove", i), window.addEventListener("mouseup", a);
170
- }, pt = (e) => {
171
- e.preventDefault(), Ve(!1);
170
+ }, ht = (e) => {
171
+ e.preventDefault(), Ue(!1);
172
172
  let t = e.dataTransfer.getData("text/plain");
173
- if (t && !M.includes(t)) {
174
- let e = [...M, t];
175
- Le(e), x && x(e);
173
+ if (t && !A.includes(t)) {
174
+ let e = [...A, t];
175
+ ze(e), b && b(e);
176
176
  }
177
- }, mt = (e) => {
178
- let t = M.filter((t) => t !== e);
179
- Le(t), ze({}), x && x(t);
180
- }, ht = u(() => {
177
+ }, gt = (e) => {
178
+ let t = A.filter((t) => t !== e);
179
+ ze(t), Ve({}), b && b(t);
180
+ }, _t = l(() => {
181
181
  let e = (t) => {
182
182
  let n = 0;
183
183
  return t.forEach((t) => {
184
184
  n = t.children && t.children.length > 0 ? Math.max(n, 1 + e(t.children)) : Math.max(n, 1);
185
185
  }), n;
186
- }, t = e(U), n = Array.from({ length: t }, () => []), r = (e) => !e.children || e.children.length === 0 ? b && M.includes(e.key) || P.includes(e.key) ? 0 : 1 : e.children.reduce((e, t) => e + r(t), 0), i = b ? M : [], a = (e, o) => {
186
+ }, t = e(V), n = Array.from({ length: t }, () => []), r = (e) => !e.children || e.children.length === 0 ? y && A.includes(e.key) || M.includes(e.key) ? 0 : 1 : e.children.reduce((e, t) => e + r(t), 0), i = y ? A : [], a = (e, o) => {
187
187
  e.forEach((e) => {
188
188
  if (i.includes(e.key)) return;
189
189
  let s = r(e);
@@ -198,75 +198,75 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
198
198
  }));
199
199
  });
200
200
  };
201
- return a(U, 0), n.filter((e) => e.length > 0);
201
+ return a(V, 0), n.filter((e) => e.length > 0);
202
202
  }, [
203
- U,
204
- M,
205
- b,
206
- P
207
- ]), K = (e) => {
208
- if (Ue[e.key] !== void 0) return Ue[e.key];
209
- let t = e.style?.width || e.headerStyle?.width || `${ue}px`;
210
- return typeof t == "number" ? t : parseInt(String(t), 10) || ue;
211
- }, gt = u(() => {
203
+ V,
204
+ A,
205
+ y,
206
+ M
207
+ ]), W = (e) => {
208
+ if (Ge[e.key] !== void 0) return Ge[e.key];
209
+ let t = e.style?.width || e.headerStyle?.width || `${de}px`;
210
+ return typeof t == "number" ? t : parseInt(String(t), 10) || de;
211
+ }, vt = l(() => {
212
212
  let e = {}, t = 0;
213
- b && M.length > 0 && (t += 48), W.forEach((n) => {
214
- H[n.key] === "left" && (e[n.key] = {
213
+ y && A.length > 0 && (t += 48), H.forEach((n) => {
214
+ B[n.key] === "left" && (e[n.key] = {
215
215
  side: "left",
216
216
  offset: t
217
- }, t += K(n));
217
+ }, t += W(n));
218
218
  });
219
- let n = y ? 100 : 0;
220
- for (let t = W.length - 1; t >= 0; t--) {
221
- let r = W[t];
222
- H[r.key] === "right" && (e[r.key] = {
219
+ let n = v ? 100 : 0;
220
+ for (let t = H.length - 1; t >= 0; t--) {
221
+ let r = H[t];
222
+ B[r.key] === "right" && (e[r.key] = {
223
223
  side: "right",
224
224
  offset: n
225
- }, n += K(r));
225
+ }, n += W(r));
226
226
  }
227
227
  return e;
228
228
  }, [
229
- W,
230
229
  H,
231
- M,
232
- b,
230
+ B,
231
+ A,
233
232
  y,
234
- Ue
235
- ]), _t = (e, t) => {
236
- je((n) => {
233
+ v,
234
+ Ge
235
+ ]), yt = (e, t) => {
236
+ Me((n) => {
237
237
  let r = n[e] || [], i = r.includes(t) ? r.filter((e) => e !== t) : [...r, t], a = {
238
238
  ...n,
239
239
  [e]: i
240
240
  };
241
241
  return a[e].length === 0 && delete a[e], a;
242
242
  });
243
- }, vt = (e) => {
244
- je((t) => {
243
+ }, bt = (e) => {
244
+ Me((t) => {
245
245
  let n = { ...t };
246
246
  return delete n[e], n;
247
247
  });
248
- }, q = u(() => {
248
+ }, G = l(() => {
249
249
  let e = /* @__PURE__ */ new Map();
250
- return V.forEach((t) => e.set(t.key, t)), e;
251
- }, [V]), yt = u(() => {
252
- if (!O) return [];
253
- let e = q.get(O), t = v.map((t) => e?.getValue ? e.getValue(t) : t[O]);
250
+ return z.forEach((t) => e.set(t.key, t)), e;
251
+ }, [z]), xt = l(() => {
252
+ if (!D) return [];
253
+ let e = G.get(D), t = _.map((t) => e?.getValue ? e.getValue(t) : t[D]);
254
254
  return Array.from(new Set(t)).filter((e) => e != null);
255
255
  }, [
256
- v,
257
- O,
258
- q
259
- ]), bt = u(() => {
260
- if (!A.trim()) return yt;
261
- let e = A.toLowerCase();
262
- return yt.filter((t) => String(t).toLowerCase().includes(e));
263
- }, [yt, A]), J = u(() => {
264
- let e = Object.entries(k).filter(([, e]) => e && e.length > 0), t = e.length === 0 ? v : v.filter((t) => e.every(([e, n]) => {
265
- let r = q.get(e), i = r?.getValue ? r.getValue(t) : t[e];
256
+ _,
257
+ D,
258
+ G
259
+ ]), St = l(() => {
260
+ if (!k.trim()) return xt;
261
+ let e = k.toLowerCase();
262
+ return xt.filter((t) => String(t).toLowerCase().includes(e));
263
+ }, [xt, k]), K = l(() => {
264
+ let e = Object.entries(O).filter(([, e]) => e && e.length > 0), t = e.length === 0 ? _ : _.filter((t) => e.every(([e, n]) => {
265
+ let r = G.get(e), i = r?.getValue ? r.getValue(t) : t[e];
266
266
  return n.includes(i);
267
267
  }));
268
- if (N.key && N.direction) {
269
- let { key: e, direction: n } = N, r = q.get(e);
268
+ if (j.key && j.direction) {
269
+ let { key: e, direction: n } = j, r = G.get(e);
270
270
  t = [...t].sort((t, i) => {
271
271
  let a = r?.getValue ? r.getValue(t) : t[e], o = r?.getValue ? r.getValue(i) : i[e];
272
272
  if (a === o) return 0;
@@ -281,40 +281,40 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
281
281
  }
282
282
  return t;
283
283
  }, [
284
- v,
285
- k,
286
- N,
287
- q
288
- ]), Y = J.length, X = E ? Math.max(1, Math.ceil(Y / z)) : 1;
289
- l(() => {
290
- R(1);
291
- }, [
292
- k,
293
- N,
294
- z,
295
- E
296
- ]), l(() => {
297
- L > X && R(X);
298
- }, [L, X]);
299
- let xt = u(() => {
300
- if (!E) return J;
301
- let e = (L - 1) * z;
302
- return J.slice(e, e + z);
284
+ _,
285
+ O,
286
+ j,
287
+ G
288
+ ]), q = K.length, J = T ? Math.max(1, Math.ceil(q / L)) : 1;
289
+ c(() => {
290
+ I(1);
303
291
  }, [
304
- J,
305
- E,
292
+ O,
293
+ j,
306
294
  L,
307
- z
308
- ]), St = (e) => {
309
- let t = Math.min(Math.max(1, e), X);
310
- R(t), D && D(t, z);
311
- }, Ct = (e) => {
312
- Qe(e), R(1), D && D(1, e);
313
- }, wt = u(() => {
314
- if (!b || M.length === 0) return xt;
295
+ T
296
+ ]), c(() => {
297
+ F > J && I(J);
298
+ }, [F, J]);
299
+ let Ct = l(() => {
300
+ if (!T) return K;
301
+ let e = (F - 1) * L;
302
+ return K.slice(e, e + L);
303
+ }, [
304
+ K,
305
+ T,
306
+ F,
307
+ L
308
+ ]), Y = (e) => {
309
+ let t = Math.min(Math.max(1, e), J);
310
+ I(t), E && E(t, L);
311
+ }, wt = (e) => {
312
+ et(e), I(1), E && E(1, e);
313
+ }, Tt = l(() => {
314
+ if (!y || A.length === 0) return Ct;
315
315
  let e = (t, n, r = "") => {
316
- if (n >= M.length) return t;
317
- let i = M[n], a = q.get(i), o = {};
316
+ if (n >= A.length) return t;
317
+ let i = A[n], a = G.get(i), o = {};
318
318
  return t.forEach((e) => {
319
319
  let t = a?.getValue ? a.getValue(e) : e[i], n = String(t ?? "N/A");
320
320
  o[n] || (o[n] = []), o[n].push(e);
@@ -334,35 +334,35 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
334
334
  };
335
335
  });
336
336
  };
337
- return e(xt, 0);
337
+ return e(Ct, 0);
338
338
  }, [
339
- xt,
340
- M,
341
- b,
342
- q
343
- ]), Tt = (e) => {
344
- ze((t) => {
339
+ Ct,
340
+ A,
341
+ y,
342
+ G
343
+ ]), Et = (e) => {
344
+ Ve((t) => {
345
345
  let n = t[e] !== !1;
346
346
  return {
347
347
  ...t,
348
348
  [e]: !n
349
349
  };
350
350
  });
351
- }, Et = u(() => {
352
- if (!b || M.length === 0) return wt;
351
+ }, X = l(() => {
352
+ if (!y || A.length === 0) return Tt;
353
353
  let e = [], t = (n) => {
354
354
  n.forEach((n) => {
355
- n.isGroupRow ? (e.push(n), Re[n.path] !== !1 && t(n.children)) : e.push(n);
355
+ n.isGroupRow ? (e.push(n), Be[n.path] !== !1 && t(n.children)) : e.push(n);
356
356
  });
357
357
  };
358
- return t(wt), e;
358
+ return t(Tt), e;
359
359
  }, [
360
- wt,
361
- Re,
362
- M,
363
- b
364
- ]), Dt = d(null), [Ot, kt] = f(0), [At, jt] = f(0);
365
- l(() => {
360
+ Tt,
361
+ Be,
362
+ A,
363
+ y
364
+ ]), Dt = u(null), [Ot, kt] = d(0), [At, jt] = d(0);
365
+ c(() => {
366
366
  let e = Dt.current;
367
367
  if (!e) return;
368
368
  let t = () => kt(e.scrollTop);
@@ -372,37 +372,37 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
372
372
  e.removeEventListener("scroll", t), n?.disconnect();
373
373
  };
374
374
  }, []);
375
- let Z = Et.length, { startIndex: Q, endIndex: Mt, topSpacerHeight: Nt, bottomSpacerHeight: Pt } = u(() => {
375
+ let Z = X.length, { startIndex: Q, endIndex: Mt, topSpacerHeight: Nt, bottomSpacerHeight: Pt } = l(() => {
376
376
  if (At === 0) return {
377
377
  startIndex: 0,
378
378
  endIndex: Z,
379
379
  topSpacerHeight: 0,
380
380
  bottomSpacerHeight: 0
381
381
  };
382
- let e = Math.max(0, Z - 1), t = Math.min(e, Math.floor(Ot / C)), n = Math.ceil(At / C) + 1, r = Math.max(0, t - be), i = Math.min(Z, t + n + be);
382
+ let e = Math.max(0, Z - 1), t = Math.min(e, Math.floor(Ot / S)), n = Math.ceil(At / S) + 1, r = Math.max(0, t - xe), i = Math.min(Z, t + n + xe);
383
383
  return {
384
384
  startIndex: r,
385
385
  endIndex: i,
386
- topSpacerHeight: r * C,
387
- bottomSpacerHeight: (Z - i) * C
386
+ topSpacerHeight: r * S,
387
+ bottomSpacerHeight: (Z - i) * S
388
388
  };
389
389
  }, [
390
390
  Ot,
391
391
  At,
392
392
  Z,
393
- C,
394
- be
395
- ]), Ft = u(() => Et.slice(Q, Mt), [
396
- Et,
393
+ S,
394
+ xe
395
+ ]), Ft = l(() => X.slice(Q, Mt), [
396
+ X,
397
397
  Q,
398
398
  Mt
399
- ]), It = u(() => {
399
+ ]), It = l(() => {
400
400
  let e = /* @__PURE__ */ new Map();
401
- if (!w || w.length === 0) return e;
401
+ if (!C || C.length === 0) return e;
402
402
  let t = (e, t) => {
403
- let n = q.get(t);
403
+ let n = G.get(t);
404
404
  return n?.getValue ? n.getValue(e) : e[t];
405
- }, n = Ft, r = n.map(() => w.map(() => !0)), i = null;
405
+ }, n = Ft, r = n.map(() => C.map(() => !0)), i = null;
406
406
  for (let e = 0; e < n.length; e++) {
407
407
  let a = n[e];
408
408
  if (a.isGroupRow) {
@@ -411,14 +411,14 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
411
411
  }
412
412
  if (i !== null) {
413
413
  let o = n[i], s = !0;
414
- for (let n = 0; n < w.length; n++) {
415
- let i = w[n];
414
+ for (let n = 0; n < C.length; n++) {
415
+ let i = C[n];
416
416
  s && t(a, i) === t(o, i) ? r[e][n] = !1 : (s = !1, r[e][n] = !0);
417
417
  }
418
418
  }
419
419
  i = e;
420
420
  }
421
- return w.forEach((t, i) => {
421
+ return C.forEach((t, i) => {
422
422
  let a = 0;
423
423
  for (; a < n.length;) {
424
424
  if (n[a].isGroupRow || !r[a][i]) {
@@ -440,11 +440,11 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
440
440
  }), e;
441
441
  }, [
442
442
  Ft,
443
- w,
444
- q,
443
+ C,
444
+ G,
445
445
  Q
446
446
  ]), Lt = (e, t = !1, n) => {
447
- let r = gt[e];
447
+ let r = vt[e];
448
448
  if (!r) return n || {};
449
449
  let i = r.side === "right";
450
450
  return {
@@ -456,124 +456,124 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
456
456
  boxShadow: i ? "-2px 0 5px -2px rgba(0,0,0,0.1)" : "2px 0 5px -2px rgba(0,0,0,0.1)",
457
457
  ...n
458
458
  };
459
- }, Rt = u(() => S.map((e, t) => (S.length - 1 - t) * 48), [S]), $ = W.length + +!!y + (b && M.length > 0 ? 1 : 0), zt = /* @__PURE__ */ p("button", {
459
+ }, Rt = l(() => x.map((e, t) => (x.length - 1 - t) * 48), [x]), $ = H.length + +!!v + (y && A.length > 0 ? 1 : 0), zt = /* @__PURE__ */ f("button", {
460
460
  type: "button",
461
- ref: I,
461
+ ref: P,
462
462
  onClick: (e) => {
463
- e.stopPropagation(), Xe((e) => !e);
463
+ e.stopPropagation(), Qe((e) => !e);
464
464
  },
465
- className: g("flexi-icon-btn", "flexi-settings-btn", F && "flexi-settings-btn--active"),
465
+ className: h("flexi-icon-btn", N && "flexi-settings-btn--active"),
466
466
  title: "Grid display settings",
467
- children: /* @__PURE__ */ p(ie, { className: "flexi-icon-sm" })
468
- }), Bt = F && Fe && G.current && ae(/* @__PURE__ */ m("div", {
469
- ref: Ze,
467
+ children: /* @__PURE__ */ f(ie, { className: "flexi-icon-sm" })
468
+ }), Bt = N && Ie && U.current && oe(/* @__PURE__ */ p("div", {
469
+ ref: $e,
470
470
  className: "flexi-settings-menu",
471
471
  style: {
472
- top: Fe.top,
473
- right: Fe.right,
472
+ top: Ie.top,
473
+ right: Ie.right,
474
474
  zIndex: 9999
475
475
  },
476
476
  children: [
477
- /* @__PURE__ */ m("div", {
477
+ /* @__PURE__ */ p("div", {
478
478
  className: "flexi-settings-section",
479
- children: [/* @__PURE__ */ p("span", {
479
+ children: [/* @__PURE__ */ f("span", {
480
480
  className: "flexi-settings-heading",
481
481
  children: "Action Icons"
482
- }), /* @__PURE__ */ m("label", {
482
+ }), /* @__PURE__ */ p("label", {
483
483
  className: "flexi-filter-option",
484
- children: [/* @__PURE__ */ p("input", {
484
+ children: [/* @__PURE__ */ f("input", {
485
485
  type: "checkbox",
486
486
  className: "flexi-checkbox",
487
- checked: qe,
488
- onChange: () => Je((e) => !e)
489
- }), /* @__PURE__ */ p("span", {
487
+ checked: Ye,
488
+ onChange: () => Xe((e) => !e)
489
+ }), /* @__PURE__ */ f("span", {
490
490
  className: "flexi-filter-option-text",
491
491
  children: "Show pin icon on hover"
492
492
  })]
493
493
  })]
494
494
  }),
495
- /* @__PURE__ */ p("div", { className: "flexi-settings-divider" }),
496
- /* @__PURE__ */ m("div", {
495
+ /* @__PURE__ */ f("div", { className: "flexi-settings-divider" }),
496
+ /* @__PURE__ */ p("div", {
497
497
  className: "flexi-settings-section",
498
- children: [/* @__PURE__ */ p("span", {
498
+ children: [/* @__PURE__ */ f("span", {
499
499
  className: "flexi-settings-heading",
500
500
  children: "Columns"
501
- }), V.map((e) => /* @__PURE__ */ m("label", {
501
+ }), z.map((e) => /* @__PURE__ */ p("label", {
502
502
  className: "flexi-filter-option",
503
- children: [/* @__PURE__ */ p("input", {
503
+ children: [/* @__PURE__ */ f("input", {
504
504
  type: "checkbox",
505
505
  className: "flexi-checkbox",
506
- checked: !P.includes(e.key),
507
- onChange: () => ot(e.key)
508
- }), /* @__PURE__ */ p("span", {
506
+ checked: !M.includes(e.key),
507
+ onChange: () => ct(e.key)
508
+ }), /* @__PURE__ */ f("span", {
509
509
  className: "flexi-filter-option-text",
510
510
  children: e.header
511
511
  })]
512
512
  }, e.key))]
513
513
  }),
514
- /* @__PURE__ */ p("div", { className: "flexi-settings-divider" }),
515
- /* @__PURE__ */ m("button", {
514
+ /* @__PURE__ */ f("div", { className: "flexi-settings-divider" }),
515
+ /* @__PURE__ */ p("button", {
516
516
  type: "button",
517
- onClick: st,
517
+ onClick: lt,
518
518
  className: "flexi-settings-reset",
519
519
  title: "Reset pin icon visibility and hidden columns to their defaults",
520
- children: [/* @__PURE__ */ p(re, { className: "flexi-icon-sm" }), /* @__PURE__ */ p("span", { children: "Reset to defaults" })]
520
+ children: [/* @__PURE__ */ f(re, { className: "flexi-icon-sm" }), /* @__PURE__ */ f("span", { children: "Reset to defaults" })]
521
521
  })
522
522
  ]
523
- }), G.current);
524
- return /* @__PURE__ */ m("div", {
525
- ref: G,
523
+ }), U.current);
524
+ return /* @__PURE__ */ p("div", {
525
+ ref: U,
526
526
  className: "flexi-root",
527
527
  children: [
528
- b && /* @__PURE__ */ p("div", {
528
+ y && /* @__PURE__ */ f("div", {
529
529
  onDragOver: (e) => {
530
- e.preventDefault(), Ve(!0);
530
+ e.preventDefault(), Ue(!0);
531
531
  },
532
- onDragLeave: () => Ve(!1),
533
- onDrop: pt,
534
- className: g("flexi-groupzone", Be && "flexi-groupzone--dragover"),
535
- children: M.length === 0 ? /* @__PURE__ */ p("span", {
532
+ onDragLeave: () => Ue(!1),
533
+ onDrop: ht,
534
+ className: h("flexi-groupzone", He && "flexi-groupzone--dragover"),
535
+ children: A.length === 0 ? /* @__PURE__ */ f("span", {
536
536
  className: "flexi-groupzone-hint",
537
537
  children: "Drag a column header here to group your records by that field"
538
- }) : /* @__PURE__ */ m("div", {
538
+ }) : /* @__PURE__ */ p("div", {
539
539
  className: "flexi-groupzone-chips",
540
- children: [/* @__PURE__ */ p("span", {
540
+ children: [/* @__PURE__ */ f("span", {
541
541
  className: "flexi-groupzone-label",
542
542
  children: "Grouped By:"
543
- }), M.map((e) => /* @__PURE__ */ m("div", {
543
+ }), A.map((e) => /* @__PURE__ */ p("div", {
544
544
  className: "flexi-chip",
545
- children: [/* @__PURE__ */ p("span", { children: V.find((t) => t.key === e)?.header || e }), /* @__PURE__ */ p("button", {
545
+ children: [/* @__PURE__ */ f("span", { children: z.find((t) => t.key === e)?.header || e }), /* @__PURE__ */ f("button", {
546
546
  type: "button",
547
- onClick: () => mt(e),
547
+ onClick: () => gt(e),
548
548
  className: "flexi-icon-btn flexi-chip-remove",
549
- children: /* @__PURE__ */ p(c, { className: "flexi-icon-xs" })
549
+ children: /* @__PURE__ */ f(ae, { className: "flexi-icon-xs" })
550
550
  })]
551
551
  }, e))]
552
552
  })
553
553
  }),
554
- /* @__PURE__ */ p("div", {
554
+ /* @__PURE__ */ f("div", {
555
555
  ref: Dt,
556
556
  className: "flexi-table-wrap",
557
- style: ge,
558
- children: /* @__PURE__ */ m("table", {
559
- className: g("flexi-table", ve && "flexi-table--bordered"),
560
- style: _e,
557
+ style: _e,
558
+ children: /* @__PURE__ */ p("table", {
559
+ className: h("flexi-table", ye && "flexi-table--bordered"),
560
+ style: ve,
561
561
  children: [
562
- /* @__PURE__ */ m("colgroup", { children: [
563
- b && M.length > 0 && /* @__PURE__ */ p("col", { style: { width: "48px" } }),
564
- W.map((e) => /* @__PURE__ */ p("col", { style: {
562
+ /* @__PURE__ */ p("colgroup", { children: [
563
+ y && A.length > 0 && /* @__PURE__ */ f("col", { style: { width: "48px" } }),
564
+ H.map((e) => /* @__PURE__ */ f("col", { style: {
565
565
  ...e.style,
566
- width: K(e)
566
+ width: W(e)
567
567
  } }, e.key)),
568
- y && /* @__PURE__ */ p("col", { style: { width: "100px" } })
568
+ v && /* @__PURE__ */ f("col", { style: { width: "100px" } })
569
569
  ] }),
570
- /* @__PURE__ */ p("thead", {
570
+ /* @__PURE__ */ f("thead", {
571
571
  className: "flexi-thead",
572
- children: ht.map((r, i) => /* @__PURE__ */ m("tr", {
572
+ children: _t.map((r, i) => /* @__PURE__ */ p("tr", {
573
573
  className: "flexi-header-row",
574
574
  children: [
575
- i === 0 && b && M.length > 0 && /* @__PURE__ */ p("th", {
576
- rowSpan: ht.length,
575
+ i === 0 && y && A.length > 0 && /* @__PURE__ */ f("th", {
576
+ rowSpan: _t.length,
577
577
  className: "flexi-group-spacer-th",
578
578
  style: {
579
579
  position: "sticky",
@@ -584,144 +584,141 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
584
584
  }
585
585
  }),
586
586
  r.map(({ col: a, rowSpan: o, colSpan: s }, re) => {
587
- let ie = (k[a.key]?.length || 0) > 0, c = !!H[a.key], l = Lt(a.key, !0, a.headerStyle), u = !a.children || a.children.length === 0, d = N.key === a.key, f = !!(b && u), oe = u && a.resizable !== !1, h = i === 0 && re === r.length - 1;
588
- return /* @__PURE__ */ m("th", {
587
+ let ie = (O[a.key]?.length || 0) > 0, ae = !!B[a.key], c = Lt(a.key, !0, a.headerStyle), l = !a.children || a.children.length === 0, u = j.key === a.key, d = !!(y && l), se = l && a.resizable !== !1;
588
+ return i === 0 && r.length - 1, /* @__PURE__ */ p("th", {
589
589
  rowSpan: o,
590
590
  colSpan: s,
591
591
  draggable: !0,
592
- onDragStart: (e) => lt(e, a.key, u),
592
+ onDragStart: (e) => dt(e, a.key, l),
593
593
  onDragOver: (e) => e.preventDefault(),
594
- onDrop: (e) => dt(e, a.key),
595
- className: g("flexi-th", "flexi-th--draggable", f && "flexi-th--group-draggable", c && "flexi-th--pinned", a.className, a.headerClassName),
596
- style: l,
597
- children: [/* @__PURE__ */ m("div", {
594
+ onDrop: (e) => pt(e, a.key),
595
+ className: h("flexi-th", "flexi-th--draggable", d && "flexi-th--group-draggable", ae && "flexi-th--pinned", a.className, a.headerClassName),
596
+ style: c,
597
+ children: [/* @__PURE__ */ p("div", {
598
598
  className: "flexi-th-inner",
599
599
  children: [
600
- /* @__PURE__ */ m("div", {
601
- className: g("flexi-th-label", a.sortable && u && "flexi-th-label--sortable"),
602
- onClick: () => a.sortable && u && ct(a.key),
603
- children: [/* @__PURE__ */ p("span", {
600
+ /* @__PURE__ */ p("div", {
601
+ className: h("flexi-th-label", a.sortable && l && "flexi-th-label--sortable"),
602
+ onClick: () => a.sortable && l && ut(a.key),
603
+ children: [/* @__PURE__ */ f("span", {
604
604
  className: "flexi-th-text",
605
605
  children: a.header
606
- }), u && a.sortable && /* @__PURE__ */ p("span", {
607
- className: g("flexi-sort-icon", d && "flexi-sort-icon--active"),
608
- children: d && N.direction === "asc" ? /* @__PURE__ */ p(t, { className: "flexi-icon-sm" }) : d && N.direction === "desc" ? /* @__PURE__ */ p(e, { className: "flexi-icon-sm" }) : /* @__PURE__ */ p(n, { className: "flexi-icon-sm" })
606
+ }), l && a.sortable && /* @__PURE__ */ f("span", {
607
+ className: h("flexi-sort-icon", u && "flexi-sort-icon--active"),
608
+ children: u && j.direction === "asc" ? /* @__PURE__ */ f(t, { className: "flexi-icon-sm" }) : u && j.direction === "desc" ? /* @__PURE__ */ f(e, { className: "flexi-icon-sm" }) : /* @__PURE__ */ f(n, { className: "flexi-icon-sm" })
609
609
  })]
610
610
  }),
611
- /* @__PURE__ */ m("div", {
611
+ /* @__PURE__ */ p("div", {
612
612
  className: "flexi-th-actions",
613
- children: [
614
- u && a.filterable && /* @__PURE__ */ p("button", {
615
- type: "button",
616
- ref: (e) => {
617
- e ? j.current.set(a.key, e) : j.current.delete(a.key);
618
- },
619
- onClick: (e) => {
620
- e.stopPropagation(), Me(""), Ae(O === a.key ? null : a.key);
621
- },
622
- className: g("flexi-icon-btn", "flexi-filter-btn", ie && "flexi-filter-btn--active"),
623
- children: /* @__PURE__ */ p(ee, { className: "flexi-icon-sm" })
624
- }),
625
- u && qe && /* @__PURE__ */ p("button", {
626
- type: "button",
627
- onClick: (e) => {
628
- e.stopPropagation(), at(a.key);
629
- },
630
- className: g("flexi-icon-btn", "flexi-pin-btn", c && "flexi-pin-btn--pinned"),
631
- title: H[a.key] === "left" ? "Pinned left (click to pin right)" : H[a.key] === "right" ? "Pinned right (click to unpin)" : "Pin column left",
632
- children: p(c ? ne : te, { className: "flexi-icon-sm" })
633
- }),
634
- Te && h && zt
635
- ]
613
+ children: [l && a.filterable && /* @__PURE__ */ f("button", {
614
+ type: "button",
615
+ ref: (e) => {
616
+ e ? Re.current.set(a.key, e) : Re.current.delete(a.key);
617
+ },
618
+ onClick: (e) => {
619
+ e.stopPropagation(), Ne(""), je(D === a.key ? null : a.key);
620
+ },
621
+ className: h("flexi-icon-btn", "flexi-filter-btn", ie && "flexi-filter-btn--active"),
622
+ children: /* @__PURE__ */ f(ee, { className: "flexi-icon-sm" })
623
+ }), l && Ye && /* @__PURE__ */ f("button", {
624
+ type: "button",
625
+ onClick: (e) => {
626
+ e.stopPropagation(), st(a.key);
627
+ },
628
+ className: h("flexi-icon-btn", "flexi-pin-btn", ae && "flexi-pin-btn--pinned"),
629
+ title: B[a.key] === "left" ? "Pinned left (click to pin right)" : B[a.key] === "right" ? "Pinned right (click to unpin)" : "Pin column left",
630
+ children: f(ae ? ne : te, { className: "flexi-icon-sm" })
631
+ })]
636
632
  }),
637
- O === a.key && u && Ne && G.current && ae(/* @__PURE__ */ m("div", {
638
- ref: nt,
633
+ D === a.key && l && Pe && U.current && oe(/* @__PURE__ */ p("div", {
634
+ ref: it,
639
635
  className: "flexi-filter-dropdown",
640
636
  style: {
641
- top: Ne.top,
642
- left: Ne.left,
637
+ top: Pe.top,
638
+ left: Pe.left,
643
639
  zIndex: 9999
644
640
  },
645
641
  children: [
646
- /* @__PURE__ */ p("div", {
642
+ /* @__PURE__ */ f("div", {
647
643
  className: "flexi-filter-search",
648
- children: /* @__PURE__ */ p("input", {
644
+ children: /* @__PURE__ */ f("input", {
649
645
  type: "text",
650
646
  placeholder: "Search values...",
651
- value: A,
652
- onChange: (e) => Me(e.target.value),
647
+ value: k,
648
+ onChange: (e) => Ne(e.target.value),
653
649
  className: "flexi-input",
654
650
  onClick: (e) => e.stopPropagation()
655
651
  })
656
652
  }),
657
- /* @__PURE__ */ p("div", {
653
+ /* @__PURE__ */ f("div", {
658
654
  className: "flexi-filter-list",
659
- children: bt.length === 0 ? /* @__PURE__ */ p("div", {
655
+ children: St.length === 0 ? /* @__PURE__ */ f("div", {
660
656
  className: "flexi-filter-empty",
661
657
  children: "No results found"
662
- }) : bt.map((e, t) => /* @__PURE__ */ m("label", {
658
+ }) : St.map((e, t) => /* @__PURE__ */ p("label", {
663
659
  className: "flexi-filter-option",
664
- children: [/* @__PURE__ */ p("input", {
660
+ children: [/* @__PURE__ */ f("input", {
665
661
  type: "checkbox",
666
662
  className: "flexi-checkbox",
667
- checked: k[a.key]?.includes(e) || !1,
668
- onChange: () => _t(a.key, e)
669
- }), /* @__PURE__ */ p("span", {
663
+ checked: O[a.key]?.includes(e) || !1,
664
+ onChange: () => yt(a.key, e)
665
+ }), /* @__PURE__ */ f("span", {
670
666
  className: "flexi-filter-option-text",
671
667
  children: String(e)
672
668
  })]
673
669
  }, t))
674
670
  }),
675
- ie && /* @__PURE__ */ p("div", {
671
+ ie && /* @__PURE__ */ f("div", {
676
672
  className: "flexi-filter-footer",
677
- children: /* @__PURE__ */ p("button", {
673
+ children: /* @__PURE__ */ f("button", {
678
674
  type: "button",
679
- onClick: () => vt(a.key),
675
+ onClick: () => bt(a.key),
680
676
  className: "flexi-filter-clear",
681
677
  children: "Clear Filter"
682
678
  })
683
679
  })
684
680
  ]
685
- }), G.current)
681
+ }), U.current)
686
682
  ]
687
- }), oe && /* @__PURE__ */ p("div", {
683
+ }), se && /* @__PURE__ */ f("div", {
688
684
  className: "flexi-th-resizer",
689
- onMouseDown: (e) => ft(e, a),
685
+ onMouseDown: (e) => mt(e, a),
690
686
  onClick: (e) => e.stopPropagation(),
691
687
  onDragStart: (e) => e.preventDefault()
692
688
  })]
693
689
  }, a.key);
694
690
  }),
695
- i === 0 && y && /* @__PURE__ */ p("th", {
696
- rowSpan: ht.length,
697
- className: "flexi-actions-th",
691
+ Ee && i === 0 && /* @__PURE__ */ f("div", {
692
+ className: "flexi-actions-th flexi-th",
698
693
  style: {
699
694
  position: "sticky",
700
695
  top: 0,
701
696
  right: 0,
702
- zIndex: 35,
703
- backgroundColor: "rgb(248, 250, 252)"
697
+ zIndex: 55,
698
+ display: "flex",
699
+ justifyContent: "center",
700
+ alignItems: "center"
704
701
  },
705
- children: Te && zt
702
+ children: Ee && zt
706
703
  })
707
704
  ]
708
705
  }, `header-row-${i}`))
709
706
  }),
710
- /* @__PURE__ */ p("tbody", {
707
+ /* @__PURE__ */ f("tbody", {
711
708
  className: "flexi-tbody",
712
- children: pe ? /* @__PURE__ */ p("tr", { children: /* @__PURE__ */ p("td", {
709
+ children: me ? /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", {
713
710
  colSpan: $,
714
711
  className: "flexi-empty-cell",
715
712
  children: "Loading records..."
716
- }) }) : Et.length === 0 ? /* @__PURE__ */ p("tr", { children: /* @__PURE__ */ p("td", {
713
+ }) }) : X.length === 0 ? /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", {
717
714
  colSpan: $,
718
715
  className: "flexi-empty-cell",
719
716
  children: "No records found matching criteria."
720
- }) }) : /* @__PURE__ */ m(oe, { children: [
721
- Nt > 0 && /* @__PURE__ */ p("tr", {
717
+ }) }) : /* @__PURE__ */ p(se, { children: [
718
+ Nt > 0 && /* @__PURE__ */ f("tr", {
722
719
  "aria-hidden": "true",
723
720
  style: { height: Nt },
724
- children: /* @__PURE__ */ p("td", {
721
+ children: /* @__PURE__ */ f("td", {
725
722
  colSpan: $,
726
723
  style: {
727
724
  padding: 0,
@@ -731,10 +728,10 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
731
728
  })
732
729
  }),
733
730
  Ft.map((e, t) => Vt(e, Q + t)),
734
- Pt > 0 && /* @__PURE__ */ p("tr", {
731
+ Pt > 0 && /* @__PURE__ */ f("tr", {
735
732
  "aria-hidden": "true",
736
733
  style: { height: Pt },
737
- children: /* @__PURE__ */ p("td", {
734
+ children: /* @__PURE__ */ f("td", {
738
735
  colSpan: $,
739
736
  style: {
740
737
  padding: 0,
@@ -745,76 +742,76 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
745
742
  })
746
743
  ] })
747
744
  }),
748
- S.length > 0 && /* @__PURE__ */ p("tbody", {
745
+ x.length > 0 && /* @__PURE__ */ f("tbody", {
749
746
  className: "flexi-tbody flexi-tbody--pinned-bottom",
750
- children: S.map((e, t) => Ht(e, t))
747
+ children: x.map((e, t) => Ht(e, t))
751
748
  })
752
749
  ]
753
750
  })
754
751
  }),
755
752
  Bt,
756
- E && /* @__PURE__ */ m("div", {
753
+ T && /* @__PURE__ */ p("div", {
757
754
  className: "flexi-pagination",
758
755
  children: [
759
- /* @__PURE__ */ m("div", {
756
+ /* @__PURE__ */ p("div", {
760
757
  className: "flexi-pagination-size",
761
- children: [/* @__PURE__ */ p("span", { children: "Rows per page" }), /* @__PURE__ */ p("select", {
762
- value: z,
763
- onChange: (e) => Ct(Number(e.target.value)),
758
+ children: [/* @__PURE__ */ f("span", { children: "Rows per page" }), /* @__PURE__ */ f("select", {
759
+ value: L,
760
+ onChange: (e) => wt(Number(e.target.value)),
764
761
  className: "flexi-pagination-select",
765
- children: ke.map((e) => /* @__PURE__ */ p("option", {
762
+ children: Ae.map((e) => /* @__PURE__ */ f("option", {
766
763
  value: e,
767
764
  children: e
768
765
  }, e))
769
766
  })]
770
767
  }),
771
- /* @__PURE__ */ p("div", {
768
+ /* @__PURE__ */ f("div", {
772
769
  className: "flexi-pagination-info",
773
- children: Y === 0 ? "0 of 0" : `${(L - 1) * z + 1}–${Math.min(L * z, Y)} of ${Y}`
770
+ children: q === 0 ? "0 of 0" : `${(F - 1) * L + 1}–${Math.min(F * L, q)} of ${q}`
774
771
  }),
775
- /* @__PURE__ */ m("div", {
772
+ /* @__PURE__ */ p("div", {
776
773
  className: "flexi-pagination-controls",
777
774
  children: [
778
- /* @__PURE__ */ p("button", {
775
+ /* @__PURE__ */ f("button", {
779
776
  type: "button",
780
- onClick: () => St(1),
781
- disabled: L === 1,
777
+ onClick: () => Y(1),
778
+ disabled: F === 1,
782
779
  className: "flexi-icon-btn",
783
780
  title: "First page",
784
- children: /* @__PURE__ */ p(o, { className: "flexi-icon-sm" })
781
+ children: /* @__PURE__ */ f(o, { className: "flexi-icon-sm" })
785
782
  }),
786
- /* @__PURE__ */ p("button", {
783
+ /* @__PURE__ */ f("button", {
787
784
  type: "button",
788
- onClick: () => St(L - 1),
789
- disabled: L === 1,
785
+ onClick: () => Y(F - 1),
786
+ disabled: F === 1,
790
787
  className: "flexi-icon-btn",
791
788
  title: "Previous page",
792
- children: /* @__PURE__ */ p(i, { className: "flexi-icon-sm" })
789
+ children: /* @__PURE__ */ f(i, { className: "flexi-icon-sm" })
793
790
  }),
794
- /* @__PURE__ */ m("span", {
791
+ /* @__PURE__ */ p("span", {
795
792
  className: "flexi-pagination-page",
796
793
  children: [
797
794
  "Page ",
798
- L,
795
+ F,
799
796
  " of ",
800
- X
797
+ J
801
798
  ]
802
799
  }),
803
- /* @__PURE__ */ p("button", {
800
+ /* @__PURE__ */ f("button", {
804
801
  type: "button",
805
- onClick: () => St(L + 1),
806
- disabled: L === X,
802
+ onClick: () => Y(F + 1),
803
+ disabled: F === J,
807
804
  className: "flexi-icon-btn",
808
805
  title: "Next page",
809
- children: /* @__PURE__ */ p(a, { className: "flexi-icon-sm" })
806
+ children: /* @__PURE__ */ f(a, { className: "flexi-icon-sm" })
810
807
  }),
811
- /* @__PURE__ */ p("button", {
808
+ /* @__PURE__ */ f("button", {
812
809
  type: "button",
813
- onClick: () => St(X),
814
- disabled: L === X,
810
+ onClick: () => Y(J),
811
+ disabled: F === J,
815
812
  className: "flexi-icon-btn",
816
813
  title: "Last page",
817
- children: /* @__PURE__ */ p(s, { className: "flexi-icon-sm" })
814
+ children: /* @__PURE__ */ f(s, { className: "flexi-icon-sm" })
818
815
  })
819
816
  ]
820
817
  })
@@ -824,11 +821,11 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
824
821
  });
825
822
  function Vt(e, t) {
826
823
  if (e.isGroupRow) {
827
- let n = Re[e.path] !== !1;
828
- return /* @__PURE__ */ m("tr", {
824
+ let n = Be[e.path] !== !1;
825
+ return /* @__PURE__ */ p("tr", {
829
826
  className: "flexi-group-row",
830
- style: { height: C },
831
- children: [/* @__PURE__ */ p("td", {
827
+ style: { height: S },
828
+ children: [/* @__PURE__ */ f("td", {
832
829
  className: "flexi-group-cell",
833
830
  style: {
834
831
  position: "sticky",
@@ -837,35 +834,35 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
837
834
  backgroundColor: "rgba(248, 250, 252, 0.9)",
838
835
  paddingLeft: `${e.depth * 12 + 16}px`
839
836
  },
840
- children: /* @__PURE__ */ m("button", {
837
+ children: /* @__PURE__ */ p("button", {
841
838
  type: "button",
842
- onClick: () => Tt(e.path),
839
+ onClick: () => Et(e.path),
843
840
  className: "flexi-group-toggle",
844
841
  children: [
845
- p(n ? r : a, { className: "flexi-icon-md flexi-icon-muted" }),
846
- /* @__PURE__ */ p("span", {
842
+ f(n ? r : a, { className: "flexi-icon-md flexi-icon-muted" }),
843
+ /* @__PURE__ */ f("span", {
847
844
  className: "flexi-group-value",
848
845
  children: e.groupValue
849
846
  }),
850
- /* @__PURE__ */ p("span", {
847
+ /* @__PURE__ */ f("span", {
851
848
  className: "flexi-group-count",
852
849
  children: e.totalItemsCount
853
850
  })
854
851
  ]
855
852
  })
856
- }), /* @__PURE__ */ p("td", {
853
+ }), /* @__PURE__ */ f("td", {
857
854
  colSpan: $ - 1,
858
855
  className: "flexi-group-filler"
859
856
  })]
860
857
  }, `group-header-${e.path}-${t}`);
861
858
  }
862
- let n = rt(e);
863
- return /* @__PURE__ */ m("tr", {
864
- className: g("flexi-row", we && "flexi-row--clickable", it(e, t)),
865
- style: { height: C },
866
- onClick: we ? (n) => we(e, t, n) : void 0,
859
+ let n = at(e);
860
+ return /* @__PURE__ */ p("tr", {
861
+ className: h("flexi-row", Te && "flexi-row--clickable", ot(e, t)),
862
+ style: { height: S },
863
+ onClick: Te ? (n) => Te(e, t, n) : void 0,
867
864
  children: [
868
- b && M?.length > 0 && /* @__PURE__ */ p("td", {
865
+ y && A?.length > 0 && /* @__PURE__ */ f("td", {
869
866
  className: "flexi-row-indent-cell",
870
867
  style: {
871
868
  position: "sticky",
@@ -873,46 +870,46 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
873
870
  zIndex: 10
874
871
  }
875
872
  }),
876
- W?.map((n) => {
877
- let r = w?.includes(n.key) ? It.get(t)?.[n.key] : void 0;
873
+ H?.map((n) => {
874
+ let r = C?.includes(n.key) ? It.get(t)?.[n.key] : void 0;
878
875
  if (r === "skip") return null;
879
- let i = e[n.key], a = Lt(n.key, !1, n.style), o = !!H[n.key];
880
- return /* @__PURE__ */ p("td", {
876
+ let i = e[n.key], a = Lt(n.key, !1, n.style), o = !!B[n.key];
877
+ return /* @__PURE__ */ f("td", {
881
878
  rowSpan: typeof r == "number" ? r : void 0,
882
- className: g("flexi-cell", o && "flexi-cell--pinned", n.className),
879
+ className: h("flexi-cell", o && "flexi-cell--pinned", n.className),
883
880
  style: a,
884
- children: n.render ? n.render(i, e) : /* @__PURE__ */ p("span", {
881
+ children: n.render ? n.render(i, e) : /* @__PURE__ */ f("span", {
885
882
  className: "flexi-cell-text",
886
883
  children: i
887
884
  })
888
885
  }, n.key);
889
886
  }),
890
- y && /* @__PURE__ */ p("td", {
887
+ v && /* @__PURE__ */ f("td", {
891
888
  className: "flexi-actions-cell",
892
889
  style: {
893
890
  position: "sticky",
894
891
  right: 0
895
892
  },
896
- children: /* @__PURE__ */ p("div", {
893
+ children: /* @__PURE__ */ f("div", {
897
894
  className: "flexi-actions-inner",
898
- children: y(e)
895
+ children: v(e)
899
896
  })
900
897
  })
901
898
  ]
902
899
  }, n ?? `row-${t}`);
903
900
  }
904
901
  function Ht(e, t) {
905
- let n = typeof ye == "function" ? ye(e, t) : ye, r = {
902
+ let n = typeof be == "function" ? be(e, t) : be, r = {
906
903
  position: "sticky",
907
904
  bottom: `${Rt[t]}px`,
908
905
  background: "#",
909
906
  zIndex: 45
910
907
  };
911
- return /* @__PURE__ */ m("tr", {
912
- className: g("flexi-row", "flexi-row--pinned-bottom", n),
908
+ return /* @__PURE__ */ p("tr", {
909
+ className: h("flexi-row", "flexi-row--pinned-bottom", n),
913
910
  style: r,
914
911
  children: [
915
- b && M?.length > 0 && /* @__PURE__ */ p("td", {
912
+ y && A?.length > 0 && /* @__PURE__ */ f("td", {
916
913
  className: "flexi-row-indent-cell",
917
914
  style: {
918
915
  position: "sticky",
@@ -920,26 +917,26 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
920
917
  zIndex: 10
921
918
  }
922
919
  }),
923
- W?.map((t) => {
924
- let n = e[t.key], r = Lt(t.key, !1, t.style), i = !!H[t.key], a = t.pinnedRender ?? t.render;
925
- return /* @__PURE__ */ p("td", {
926
- className: g("flexi-cell", i && "flexi-cell--pinned", t.className),
920
+ H?.map((t) => {
921
+ let n = e[t.key], r = Lt(t.key, !1, t.style), i = !!B[t.key], a = t.pinnedRender ?? t.render;
922
+ return /* @__PURE__ */ f("td", {
923
+ className: h("flexi-cell", i && "flexi-cell--pinned", t.className),
927
924
  style: r,
928
- children: a ? a(n, e) : /* @__PURE__ */ p("span", {
925
+ children: a ? a(n, e) : /* @__PURE__ */ f("span", {
929
926
  className: "flexi-cell-text",
930
927
  children: n
931
928
  })
932
929
  }, t.key);
933
930
  }),
934
- y && /* @__PURE__ */ p("td", {
931
+ v && /* @__PURE__ */ f("td", {
935
932
  className: "flexi-actions-cell",
936
933
  style: {
937
934
  position: "sticky",
938
935
  right: 0
939
936
  },
940
- children: /* @__PURE__ */ p("div", {
937
+ children: /* @__PURE__ */ f("div", {
941
938
  className: "flexi-actions-inner",
942
- children: y(e)
939
+ children: v(e)
943
940
  })
944
941
  })
945
942
  ]
@@ -947,4 +944,4 @@ function _({ columns: _, data: v, rowKey: fe, actions: y, isLoading: pe, groupBy
947
944
  }
948
945
  }
949
946
  //#endregion
950
- export { _ as DataTable };
947
+ export { g as DataTable };