laif-ds 0.2.75 → 0.2.76

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.
@@ -22,132 +22,140 @@ const U = {
22
22
  gif: ".gif",
23
23
  image: "image/*",
24
24
  video: "video/*",
25
- audio: "audio/*"
25
+ audio: "audio/*",
26
+ // Keep both extensions and MIME aliases because archive file types are
27
+ // reported inconsistently across browsers and operating systems.
28
+ zip: ".zip,application/zip,application/x-zip-compressed,multipart/x-zip",
29
+ rar: ".rar,application/vnd.rar,application/x-rar-compressed",
30
+ "7z": ".7z,application/x-7z-compressed",
31
+ tar: ".tar,application/x-tar",
32
+ gz: ".gz,application/gzip,application/x-gzip",
33
+ tgz: ".tgz,.tar.gz,application/gzip,application/x-compressed-tar"
26
34
  }, R = (g) => Math.ceil(g / (1024 * 1024)), ee = ({
27
35
  extensions: g = ["pdf", "image", "video", "audio"],
28
- multiple: f = !1,
29
- onUpload: b,
30
- description: y = "Trascina un file o clicca per selezionare",
31
- formatDescription: w = "Formato accettato: PDF, Immagini, Video, Audio",
32
- selectedLabel: N = "File selezionati",
33
- maxTotalSize: d,
34
- removeAllLabel: j = "rimuovi tutto",
36
+ multiple: p = !1,
37
+ onUpload: z,
38
+ description: I = "Trascina un file o clicca per selezionare",
39
+ formatDescription: b = "Formato accettato: PDF, Immagini, Video, Audio",
40
+ selectedLabel: y = "File selezionati",
41
+ maxTotalSize: c,
42
+ removeAllLabel: N = "rimuovi tutto",
35
43
  maxFiles: x,
36
- id: i,
37
- "data-testid": z
44
+ id: s,
45
+ "data-testid": j
38
46
  }) => {
39
- const u = g.map((e) => U[e]).join(","), [s, p] = l.useState([]), [D, I] = l.useState(""), a = (e) => {
40
- const o = Array.from(e).filter(
41
- (n) => u.split(",").some((t) => (t = t.trim(), n.type.startsWith(t.replace("/*", "")) || n.name.toLowerCase().endsWith(t.replace("*", ""))))
47
+ const f = g.map((e) => U[e]).join(","), [a, u] = l.useState([]), [w, D] = l.useState(""), o = (e) => {
48
+ const n = Array.from(e).filter(
49
+ (i) => f.split(",").some((t) => (t = t.trim(), i.type.startsWith(t.replace("/*", "")) || i.name.toLowerCase().endsWith(t.replace("*", ""))))
42
50
  );
43
- let c = [];
51
+ let d = [];
44
52
  const m = [];
45
- if (f) {
46
- let n = o;
53
+ if (p) {
54
+ let i = n;
47
55
  if (typeof x == "number") {
48
- const t = Math.max(x - s.length, 0);
49
- t < o.length && (n = o.slice(0, t), m.push(`Max ${x} file`));
56
+ const t = Math.max(x - a.length, 0);
57
+ t < n.length && (i = n.slice(0, t), m.push(`Max ${x} file`));
50
58
  }
51
- if (typeof d == "number") {
52
- const t = d;
53
- let F = s.reduce((h, A) => h + (A.size || 0), 0);
59
+ if (typeof c == "number") {
60
+ const t = c;
61
+ let F = a.reduce((h, A) => h + (A.size || 0), 0);
54
62
  const M = [];
55
63
  let $ = !1;
56
- for (const h of n)
64
+ for (const h of i)
57
65
  F + (h.size || 0) <= t ? (M.push(h), F += h.size || 0) : $ || (m.push(`Max ${R(t)} MB`), $ = !0);
58
- n = M;
66
+ i = M;
59
67
  }
60
- c = [...s, ...n];
68
+ d = [...a, ...i];
61
69
  } else {
62
- const n = o[0] ? [o[0]] : [];
63
- if (typeof d == "number" && n[0]) {
64
- const t = d;
65
- (n[0].size || 0) > t ? (m.push(`Max ${R(t)} MB`), c = s) : c = n;
70
+ const i = n[0] ? [n[0]] : [];
71
+ if (typeof c == "number" && i[0]) {
72
+ const t = c;
73
+ (i[0].size || 0) > t ? (m.push(`Max ${R(t)} MB`), d = a) : d = i;
66
74
  } else
67
- c = n;
75
+ d = i;
68
76
  }
69
- p(c), I(m.join(" • ")), b?.(c);
77
+ u(d), D(m.join(" • ")), z?.(d);
70
78
  }, E = (e) => {
71
- e.target.files && a(e.target.files), e.target.value = "";
79
+ e.target.files && o(e.target.files), e.target.value = "";
72
80
  }, L = (e) => {
73
- e.preventDefault(), a(e.dataTransfer.files);
81
+ e.preventDefault(), o(e.dataTransfer.files);
74
82
  }, C = (e) => {
75
- const o = s.filter((c, m) => m !== e);
76
- p(o), I(""), b?.(o);
83
+ const n = a.filter((d, m) => m !== e);
84
+ u(n), D(""), z?.(n);
77
85
  };
78
86
  return /* @__PURE__ */ v("div", { className: "mx-auto w-full space-y-4", children: [
79
- (f || s.length === 0) && /* @__PURE__ */ r(
87
+ (p || a.length === 0) && /* @__PURE__ */ r(
80
88
  V,
81
89
  {
82
- accept: u,
83
- multiple: f,
90
+ accept: f,
91
+ multiple: p,
84
92
  onDrop: L,
85
93
  onChange: E,
86
- description: y,
87
- formatDescription: w,
88
- errorCaption: D,
89
- id: i,
90
- "data-testid": z
94
+ description: I,
95
+ formatDescription: b,
96
+ errorCaption: w,
97
+ id: s,
98
+ "data-testid": j
91
99
  }
92
100
  ),
93
- s.length > 0 && /* @__PURE__ */ r(B, { children: /* @__PURE__ */ v(P, { size: "sm", className: "shadow-none", children: [
101
+ a.length > 0 && /* @__PURE__ */ r(B, { children: /* @__PURE__ */ v(P, { size: "sm", className: "shadow-none", children: [
94
102
  /* @__PURE__ */ v(_, { className: "flex justify-between", children: [
95
- /* @__PURE__ */ r(W, { children: N }),
103
+ /* @__PURE__ */ r(W, { children: y }),
96
104
  /* @__PURE__ */ r(
97
105
  S,
98
106
  {
99
107
  size: "sm",
100
108
  variant: "ghost",
101
109
  className: "text-xs",
102
- onClick: () => p([]),
103
- children: j
110
+ onClick: () => u([]),
111
+ children: N
104
112
  }
105
113
  )
106
114
  ] }),
107
- /* @__PURE__ */ r(H, { children: f ? /* @__PURE__ */ r("div", { className: "flex flex-nowrap gap-2 overflow-x-auto py-2", children: s.map((e, o) => /* @__PURE__ */ r(
115
+ /* @__PURE__ */ r(H, { children: p ? /* @__PURE__ */ r("div", { className: "flex flex-nowrap gap-2 overflow-x-auto py-2", children: a.map((e, n) => /* @__PURE__ */ r(
108
116
  k,
109
117
  {
110
118
  file: e,
111
- onRemove: () => C(o)
119
+ onRemove: () => C(n)
112
120
  },
113
- e.name + o
114
- )) }) : /* @__PURE__ */ r(k, { file: s[0], onRemove: () => C(0) }) })
121
+ e.name + n
122
+ )) }) : /* @__PURE__ */ r(k, { file: a[0], onRemove: () => C(0) }) })
115
123
  ] }) })
116
124
  ] });
117
125
  }, V = ({
118
126
  accept: g,
119
- multiple: f,
120
- onDrop: b,
121
- onChange: y,
122
- description: w,
123
- formatDescription: N,
124
- errorCaption: d,
125
- id: j,
127
+ multiple: p,
128
+ onDrop: z,
129
+ onChange: I,
130
+ description: b,
131
+ formatDescription: y,
132
+ errorCaption: c,
133
+ id: N,
126
134
  "data-testid": x
127
135
  }) => {
128
- const i = l.useRef(null), [z, u] = l.useState(!1), s = l.useId(), p = l.useId(), D = l.useId(), I = l.useId();
136
+ const s = l.useRef(null), [j, f] = l.useState(!1), a = l.useId(), u = l.useId(), w = l.useId(), D = l.useId();
129
137
  return /* @__PURE__ */ v(
130
138
  "div",
131
139
  {
132
- id: j,
140
+ id: N,
133
141
  "data-testid": x,
134
142
  role: "button",
135
143
  tabIndex: 0,
136
- "aria-label": w || "Seleziona file",
137
- "aria-describedby": `${s} ${p}${d ? ` ${D}` : ""}`,
138
- onKeyDown: (a) => {
139
- (a.key === "Enter" || a.key === " ") && (a.preventDefault(), i.current && (i.current.value = "", i.current.click()));
144
+ "aria-label": b || "Seleziona file",
145
+ "aria-describedby": `${a} ${u}${c ? ` ${w}` : ""}`,
146
+ onKeyDown: (o) => {
147
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), s.current && (s.current.value = "", s.current.click()));
140
148
  },
141
149
  onClick: () => {
142
- i.current && (i.current.value = "", i.current.click());
150
+ s.current && (s.current.value = "", s.current.click());
143
151
  },
144
- onDragEnter: () => u(!0),
145
- onDragOver: (a) => a.preventDefault(),
146
- onDragLeave: () => u(!1),
147
- onDrop: (a) => {
148
- u(!1), b(a);
152
+ onDragEnter: () => f(!0),
153
+ onDragOver: (o) => o.preventDefault(),
154
+ onDragLeave: () => f(!1),
155
+ onDrop: (o) => {
156
+ f(!1), z(o);
149
157
  },
150
- className: `border-d-border flex w-full cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed px-4 py-8 ${z ? "bg-muted/40" : ""}`,
158
+ className: `border-d-border flex w-full cursor-pointer flex-col items-center gap-3 rounded-lg border-2 border-dashed px-4 py-8 ${j ? "bg-muted/40" : ""}`,
151
159
  children: [
152
160
  /* @__PURE__ */ r(
153
161
  K,
@@ -157,27 +165,27 @@ const U = {
157
165
  }
158
166
  ),
159
167
  /* @__PURE__ */ v("div", { className: "max-w-xs text-center", children: [
160
- /* @__PURE__ */ r("p", { id: s, className: "text-d-muted-foreground text-sm font-medium", children: w }),
168
+ /* @__PURE__ */ r("p", { id: a, className: "text-d-muted-foreground text-sm font-medium", children: b }),
161
169
  /* @__PURE__ */ r(
162
170
  "p",
163
171
  {
164
- id: p,
172
+ id: u,
165
173
  className: "text-d-muted-foreground text-muted-foreground mt-1 text-xs",
166
- children: N
174
+ children: y
167
175
  }
168
176
  ),
169
- d ? /* @__PURE__ */ r("p", { id: D, className: "mt-2 text-xs font-medium text-red-600", children: d }) : null
177
+ c ? /* @__PURE__ */ r("p", { id: w, className: "mt-2 text-xs font-medium text-red-600", children: c }) : null
170
178
  ] }),
171
179
  /* @__PURE__ */ r(
172
180
  O,
173
181
  {
174
- ref: i,
175
- id: I,
182
+ ref: s,
183
+ id: D,
176
184
  type: "file",
177
185
  className: "hidden",
178
186
  accept: g,
179
- multiple: f,
180
- onChange: y
187
+ multiple: p,
188
+ onChange: I
181
189
  }
182
190
  )
183
191
  ]
@@ -1,111 +1,112 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as D } from "react/jsx-runtime";
3
- import { flexRender as ee } from "../../../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
- import { useRef as te, useState as E, useMemo as b, useCallback as F, useLayoutEffect as oe, useEffect as G } from "react";
5
- import { cn as ne } from "../../../../../lib/utils.js";
6
- import { ScrollArea as re, ScrollBar as L } from "../../../scroll-area.js";
7
- import { Table as se, TableBody as C, TableRow as P, TableCell as A } from "../../../table.js";
8
- import { getPinnedStyle as ie } from "../data-table.service.js";
9
- import { DataTableHeaderComponent as ce } from "./data-table-header.js";
10
- import { SkeletonRows as le } from "./data-table-skeleton-rows.js";
11
- function be({
2
+ import { jsx as s, jsxs as C } from "react/jsx-runtime";
3
+ import { flexRender as oe } from "../../../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
+ import { useRef as ne, useState as G, useMemo as b, useCallback as F, useLayoutEffect as re, useEffect as B } from "react";
5
+ import { cn as L } from "../../../../../lib/utils.js";
6
+ import { ScrollArea as se, ScrollBar as P } from "../../../scroll-area.js";
7
+ import { Table as ie, TableBody as A, TableRow as I, TableCell as M } from "../../../table.js";
8
+ import { getPinnedStyle as ce } from "../data-table.service.js";
9
+ import { DataTableHeaderComponent as le } from "./data-table-header.js";
10
+ import { SkeletonRows as ue } from "./data-table-skeleton-rows.js";
11
+ function Re({
12
12
  table: u,
13
- tableContainerRef: s,
13
+ tableContainerRef: i,
14
14
  loading: d,
15
- data: I,
16
- emptyComponent: M,
17
- notFoundMessage: W,
18
- onAddFilter: j,
19
- maxSortedColumns: V = 3,
20
- i18n: $,
15
+ data: W,
16
+ emptyComponent: j,
17
+ notFoundMessage: V,
18
+ onAddFilter: $,
19
+ maxSortedColumns: U = 3,
20
+ i18n: J,
21
21
  isServerSide: p = !1,
22
- filterBadges: U = [],
22
+ filterBadges: K = [],
23
23
  advancedFilterBadge: R,
24
- searchbarGlobalFilter: J,
25
- serverDebounceTime: N = 750
24
+ searchbarGlobalFilter: Q,
25
+ serverDebounceTime: D = 750,
26
+ rowClassName: x
26
27
  }) {
27
- const K = (e) => {
28
- if (U.some((n) => n.columnId === e)) return !0;
29
- const o = (n) => n.some((c) => c.columnId === e), i = (n) => n ? n.some((c) => o(c.conditions) ? !0 : c.groups ? i(c.groups) : !1) : !1;
28
+ const X = (e) => {
29
+ if (K.some((r) => r.columnId === e)) return !0;
30
+ const o = (r) => r.some((c) => c.columnId === e), n = (r) => r ? r.some((c) => o(c.conditions) ? !0 : c.groups ? n(c.groups) : !1) : !1;
30
31
  if (R?.rootGroup) {
31
32
  if (o(R.rootGroup.conditions))
32
33
  return !0;
33
34
  if (R.rootGroup.groups)
34
- return i(R.rootGroup.groups);
35
+ return n(R.rootGroup.groups);
35
36
  }
36
37
  return !1;
37
- }, y = te({}), [z, Q] = E({}), [X, B] = E(8), [k, _] = E(!1), T = b(() => {
38
+ }, z = ne({}), [k, Y] = G({}), [Z, N] = G(8), [v, _] = G(!1), y = b(() => {
38
39
  let e;
39
40
  const t = (o) => {
40
41
  clearTimeout(e), e = setTimeout(
41
42
  () => _(o),
42
- N
43
+ D
43
44
  );
44
45
  };
45
46
  return t.cancel = () => {
46
47
  clearTimeout(e);
47
48
  }, t;
48
- }, [N]), q = b(() => {
49
+ }, [D]), q = b(() => {
49
50
  const e = u.getHeaderGroups()[0];
50
51
  return e ? e.headers : [];
51
52
  }, [u.getHeaderGroups]), g = b(
52
53
  () => q.filter((e) => e.column.getIsVisible()),
53
54
  [q]
54
- ), v = b(
55
+ ), H = b(
55
56
  () => g.filter((e) => e.column.columnDef.meta?.pinned === "left"),
56
57
  [g]
57
- ), H = b(
58
+ ), S = b(
58
59
  () => g.filter((e) => e.column.columnDef.meta?.pinned === "right"),
59
60
  [g]
60
- ), Y = b(
61
+ ), ee = b(
61
62
  () => g.map((e) => e.id).join("|"),
62
63
  [g]
63
- ), Z = u.getState().pagination, x = F(() => {
64
- const e = s.current;
64
+ ), te = u.getState().pagination, T = F(() => {
65
+ const e = i.current;
65
66
  if (!e) return 8;
66
- const t = e.querySelector("thead tr"), o = e.querySelector("tbody tr"), i = t?.getBoundingClientRect().height ?? 40, n = o?.getBoundingClientRect().height ?? 32.5, S = e.offsetHeight - i, w = Math.floor(S / n);
67
+ const t = e.querySelector("thead tr"), o = e.querySelector("tbody tr"), n = t?.getBoundingClientRect().height ?? 40, r = o?.getBoundingClientRect().height ?? 32.5, O = e.offsetHeight - n, w = Math.floor(O / r);
67
68
  return w > 1 ? w : 8;
68
- }, [s]), a = F(
69
+ }, [i]), a = F(
69
70
  (e = 0) => {
70
71
  const t = {};
71
72
  let o = !1;
72
- if (!s.current) {
73
+ if (!i.current) {
73
74
  e < 5 && setTimeout(() => a(e + 1), 100);
74
75
  return;
75
76
  }
76
- const i = s.current.querySelector(
77
+ const n = i.current.querySelector(
77
78
  "tbody tr:first-child"
78
79
  );
79
- let n = 0;
80
- for (const w of v) {
80
+ let r = 0;
81
+ for (const w of H) {
81
82
  const f = w.column.id;
82
- t[f] = { side: "left", offset: n };
83
+ t[f] = { side: "left", offset: r };
83
84
  let l = 0;
84
- const m = i?.querySelector(
85
+ const m = n?.querySelector(
85
86
  `[data-column-id="${f}"]`
86
- ), h = y.current[f];
87
- m && m.offsetWidth > 0 ? l = m.getBoundingClientRect().width : h && h.offsetWidth > 0 ? l = h.getBoundingClientRect().width : (o = !0, l = 150), n += l;
87
+ ), h = z.current[f];
88
+ m && m.offsetWidth > 0 ? l = m.getBoundingClientRect().width : h && h.offsetWidth > 0 ? l = h.getBoundingClientRect().width : (o = !0, l = 150), r += l;
88
89
  }
89
90
  let c = 0;
90
- for (const w of [...H].reverse()) {
91
+ for (const w of [...S].reverse()) {
91
92
  const f = w.column.id;
92
93
  t[f] = { side: "right", offset: c };
93
94
  let l = 0;
94
- const m = i?.querySelector(
95
+ const m = n?.querySelector(
95
96
  `[data-column-id="${f}"]`
96
- ), h = y.current[f];
97
+ ), h = z.current[f];
97
98
  m && m.offsetWidth > 0 ? l = m.getBoundingClientRect().width : h && h.offsetWidth > 0 ? l = h.getBoundingClientRect().width : (o = !0, l = 150), c += l;
98
99
  }
99
- Q(t);
100
- const S = x();
101
- B(S), o && e < 5 && setTimeout(
100
+ Y(t);
101
+ const O = T();
102
+ N(O), o && e < 5 && setTimeout(
102
103
  () => a(e + 1),
103
104
  100 * (e + 1)
104
105
  );
105
106
  },
106
- [x, v, H, s]
107
+ [T, H, S, i]
107
108
  );
108
- return oe(() => {
109
+ return re(() => {
109
110
  (() => {
110
111
  requestAnimationFrame(() => {
111
112
  requestAnimationFrame(() => {
@@ -116,33 +117,33 @@ function be({
116
117
  });
117
118
  })();
118
119
  }, [
119
- v,
120
120
  H,
121
- Y,
121
+ S,
122
+ ee,
122
123
  d,
123
- I,
124
- Z,
124
+ W,
125
+ te,
125
126
  a
126
- ]), G(() => {
127
+ ]), B(() => {
127
128
  const e = () => {
128
129
  clearTimeout(e.timeout), e.timeout = setTimeout(() => a(), 100);
129
130
  };
130
131
  window.addEventListener("resize", e);
131
- const t = s.current;
132
+ const t = i.current;
132
133
  let o = null;
133
134
  return t && typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
134
135
  a();
135
136
  }), o.observe(t)), () => {
136
137
  window.removeEventListener("resize", e), clearTimeout(e.timeout), o && o.disconnect();
137
138
  };
138
- }, [a, s]), G(() => {
139
+ }, [a, i]), B(() => {
139
140
  if (d) {
140
141
  const e = () => {
141
- const i = x();
142
- B(i);
142
+ const n = T();
143
+ N(n);
143
144
  };
144
145
  e();
145
- const t = s.current;
146
+ const t = i.current;
146
147
  let o = null;
147
148
  return t && typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
148
149
  e();
@@ -150,84 +151,91 @@ function be({
150
151
  o && o.disconnect();
151
152
  };
152
153
  }
153
- }, [x, d, s]), G(() => (d ? (_(!0), T.cancel()) : T(!1), () => {
154
- T.cancel();
155
- }), [d, T]), /* @__PURE__ */ r(
154
+ }, [T, d, i]), B(() => (d ? (_(!0), y.cancel()) : y(!1), () => {
155
+ y.cancel();
156
+ }), [d, y]), /* @__PURE__ */ s(
156
157
  "div",
157
158
  {
158
159
  className: "flex max-h-full min-h-0 max-w-full min-w-0 flex-1",
159
- ref: s,
160
- children: /* @__PURE__ */ D(re, { className: "border-d-border h-full min-h-0 w-full rounded-md border", children: [
161
- /* @__PURE__ */ r(L, { orientation: "horizontal", className: "z-[100]" }),
162
- /* @__PURE__ */ r(L, { orientation: "vertical" }),
163
- /* @__PURE__ */ D(se, { className: "w-full min-w-max", children: [
164
- /* @__PURE__ */ r(
165
- ce,
160
+ ref: i,
161
+ children: /* @__PURE__ */ C(se, { className: "border-d-border h-full min-h-0 w-full rounded-md border", children: [
162
+ /* @__PURE__ */ s(P, { orientation: "horizontal", className: "z-[100]" }),
163
+ /* @__PURE__ */ s(P, { orientation: "vertical" }),
164
+ /* @__PURE__ */ C(ie, { className: "w-full min-w-max", children: [
165
+ /* @__PURE__ */ s(
166
+ le,
166
167
  {
167
168
  table: u,
168
- headerRefs: y,
169
- pinnedOffsets: z,
170
- maxSortedColumns: V,
171
- i18n: $,
172
- searchbarGlobalFilter: J,
173
- isColumnFiltered: K,
174
- onAddFilter: j
169
+ headerRefs: z,
170
+ pinnedOffsets: k,
171
+ maxSortedColumns: U,
172
+ i18n: J,
173
+ searchbarGlobalFilter: Q,
174
+ isColumnFiltered: X,
175
+ onAddFilter: $
175
176
  }
176
177
  ),
177
- /* @__PURE__ */ r(
178
- C,
178
+ /* @__PURE__ */ s(
179
+ A,
179
180
  {
180
181
  "data-table-body": "skeleton",
181
- className: p && k || !p && d ? "" : "absolute -z-100 h-0 min-h-0 overflow-hidden opacity-0",
182
- children: (p && k || !p && d) && /* @__PURE__ */ r(
183
- le,
182
+ className: p && v || !p && d ? "" : "absolute -z-100 h-0 min-h-0 overflow-hidden opacity-0",
183
+ children: (p && v || !p && d) && /* @__PURE__ */ s(
184
+ ue,
184
185
  {
185
- skeletonRowCount: X,
186
- pinnedOffsets: z,
186
+ skeletonRowCount: Z,
187
+ pinnedOffsets: k,
187
188
  table: u
188
189
  }
189
190
  )
190
191
  }
191
192
  ),
192
- /* @__PURE__ */ r(
193
- C,
193
+ /* @__PURE__ */ s(
194
+ A,
194
195
  {
195
196
  "data-table-body": "data",
196
- className: p && k || !p && d ? "absolute -z-100 h-0 min-h-0 overflow-hidden opacity-0" : "",
197
- children: u.getRowModel().rows?.length ? u.getRowModel().rows.map((e) => /* @__PURE__ */ r(
198
- P,
197
+ className: p && v || !p && d ? "absolute -z-100 h-0 min-h-0 overflow-hidden opacity-0" : "",
198
+ children: u.getRowModel().rows?.length ? u.getRowModel().rows.map((e) => /* @__PURE__ */ s(
199
+ I,
199
200
  {
200
201
  "data-state": e.getIsSelected() && "selected",
201
- className: "border-0 shadow-[inset_0_-1px_0_var(--d-border)]",
202
- children: e.getVisibleCells().map((t) => /* @__PURE__ */ r(
203
- A,
204
- {
205
- "data-column-id": t.column.id,
206
- className: ne(
207
- "border-0",
208
- t.column.columnDef.meta?.pinned ? "bg-d-background z-[50]" : "shadow-[inset_-1px_0_0_var(--d-border)]"
209
- ),
210
- style: ie(
211
- t.column.id,
212
- z,
213
- t.column.columnDef.meta?.pinned,
214
- !1
215
- ),
216
- children: ee(
217
- t.column.columnDef.cell,
218
- t.getContext()
219
- )
220
- },
221
- t.id
222
- ))
202
+ className: L(
203
+ "border-0 shadow-[inset_0_-1px_0_var(--d-border)]",
204
+ typeof x == "function" ? x(e) : x
205
+ ),
206
+ children: e.getVisibleCells().map((t) => {
207
+ const o = t.column.columnDef.meta?.cellClassName, n = typeof o == "function" ? o(t.getValue(), e.original) : o;
208
+ return /* @__PURE__ */ s(
209
+ M,
210
+ {
211
+ "data-column-id": t.column.id,
212
+ className: L(
213
+ "border-0",
214
+ t.column.columnDef.meta?.pinned ? "bg-d-background z-[50]" : "shadow-[inset_-1px_0_0_var(--d-border)]",
215
+ n
216
+ ),
217
+ style: ce(
218
+ t.column.id,
219
+ k,
220
+ t.column.columnDef.meta?.pinned,
221
+ !1
222
+ ),
223
+ children: oe(
224
+ t.column.columnDef.cell,
225
+ t.getContext()
226
+ )
227
+ },
228
+ t.id
229
+ );
230
+ })
223
231
  },
224
232
  e.id
225
- )) : /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(
226
- A,
233
+ )) : /* @__PURE__ */ s(I, { children: /* @__PURE__ */ s(
234
+ M,
227
235
  {
228
236
  colSpan: u?.getHeaderGroups()?.[0]?.headers?.length ?? 1,
229
237
  className: "pt-4 text-center",
230
- children: M || W
238
+ children: j || V
231
239
  }
232
240
  ) })
233
241
  }
@@ -238,5 +246,5 @@ function be({
238
246
  );
239
247
  }
240
248
  export {
241
- be as DataTableBody
249
+ Re as DataTableBody
242
250
  };
@@ -6,8 +6,8 @@ import { cn as l } from "../../../../../lib/utils.js";
6
6
  import { Button as i } from "../../../button.js";
7
7
  import { Icon as m } from "../../../icon.js";
8
8
  import { Popover as D, PopoverTrigger as y, PopoverContent as N } from "../../../popover.js";
9
- import { TableHeader as I, TableRow as h, TableHead as z } from "../../../table.js";
10
- import { getPinnedStyle as C } from "../data-table.service.js";
9
+ import { TableHeader as I, TableRow as h, TableHead as C } from "../../../table.js";
10
+ import { getPinnedStyle as z } from "../data-table.service.js";
11
11
  function F({
12
12
  table: r,
13
13
  headerRefs: g,
@@ -20,16 +20,17 @@ function F({
20
20
  }) {
21
21
  const [x, u] = S.useState({});
22
22
  return /* @__PURE__ */ t(I, { children: r.getHeaderGroups().map((a) => /* @__PURE__ */ t(h, { children: a.headers.map((e) => /* @__PURE__ */ t(
23
- z,
23
+ C,
24
24
  {
25
25
  ref: (o) => {
26
26
  g.current[e.column.id] = o;
27
27
  },
28
28
  className: l(
29
29
  "bg-d-background sticky top-0 h-8 px-0",
30
- e.column.columnDef.meta?.pinned ? "z-[49]" : "z-10"
30
+ e.column.columnDef.meta?.pinned ? "z-[49]" : "z-10",
31
+ e.column.columnDef.meta?.headerClassName
31
32
  ),
32
- style: C(
33
+ style: z(
33
34
  e.column.id,
34
35
  d,
35
36
  e.column.columnDef.meta?.pinned,