laif-ds 0.2.41 → 0.2.43

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,274 +1,326 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as l } from "react/jsx-runtime";
3
- import { cn as v } from "../../../../../lib/utils.js";
4
- import { flexRender as P } from "../../../../../node_modules/@tanstack/react-table/build/lib/index.js";
5
- import { useRef as V, useState as j, useMemo as R, useLayoutEffect as X, useEffect as E } from "react";
6
- import { Button as b } from "../../../button.js";
7
- import { Icon as W } from "../../../icon.js";
8
- import { Popover as J, PopoverTrigger as K, PopoverContent as Q } from "../../../popover.js";
9
- import { ScrollArea as Y, ScrollBar as _ } from "../../../scroll-area.js";
10
- import { Skeleton as Z } from "../../../skeleton.js";
11
- import { Table as ee, TableHeader as te, TableRow as D, TableHead as oe, TableBody as ne, TableCell as A } from "../../../table.js";
12
- function ge({
2
+ import { jsx as n, jsxs as i } from "react/jsx-runtime";
3
+ import { cn as u } from "../../../../../lib/utils.js";
4
+ import { flexRender as B } from "../../../../../node_modules/@tanstack/react-table/build/lib/index.js";
5
+ import { useRef as Z, useState as E, useMemo as T, useLayoutEffect as ee, useEffect as L } from "react";
6
+ import { Button as S } from "../../../button.js";
7
+ import { Icon as z } from "../../../icon.js";
8
+ import { Popover as te, PopoverTrigger as oe, PopoverContent as ne } from "../../../popover.js";
9
+ import { ScrollArea as re, ScrollBar as q } from "../../../scroll-area.js";
10
+ import { Skeleton as F } from "../../../skeleton.js";
11
+ import { Table as se, TableHeader as le, TableRow as y, TableHead as ce, TableBody as ie, TableCell as R } from "../../../table.js";
12
+ function xe({
13
13
  table: s,
14
- tableContainerRef: c,
15
- loading: x,
16
- data: $,
17
- emptyComponent: q,
18
- notFoundMessage: L,
19
- onAddFilter: U,
20
- maxSortedColumns: y = 3,
21
- i18n: g
14
+ tableContainerRef: d,
15
+ loading: v,
16
+ data: W,
17
+ emptyComponent: U,
18
+ notFoundMessage: M,
19
+ onAddFilter: V,
20
+ maxSortedColumns: h = 3,
21
+ i18n: w,
22
+ isServerSide: A = !1,
23
+ filterBadges: X = [],
24
+ advancedFilterBadge: D,
25
+ searchbarGlobalFilter: J
22
26
  }) {
23
- const z = V({}), [F, G] = j({}), [M, T] = j(8), C = s.getHeaderGroups()[0], H = C ? C.headers : [], p = R(
24
- () => H.filter((t) => t.column.getIsVisible()),
25
- [H]
26
- ), I = R(
27
- () => p.filter((t) => t.column.columnDef.meta?.pinned === "left"),
28
- [p]
29
- ), O = R(
30
- () => p.filter((t) => t.column.columnDef.meta?.pinned === "right"),
31
- [p]
32
- ), B = () => {
33
- const t = c.current;
34
- if (!t) return 8;
35
- const e = t.querySelector("thead tr"), o = t.querySelector("tbody tr"), r = e?.getBoundingClientRect().height ?? 40, f = o?.getBoundingClientRect().height ?? 32.5, S = t.offsetHeight - r, u = Math.floor(S / f);
36
- return u > 1 ? u : 8;
37
- }, h = (t = 0) => {
27
+ const K = (o) => {
28
+ if (X.some((l) => l.columnId === o)) return !0;
29
+ const t = (l) => l.some((c) => c.columnId === o), r = (l) => l ? l.some((c) => t(c.conditions) ? !0 : c.groups ? r(c.groups) : !1) : !1;
30
+ if (D?.rootGroup) {
31
+ if (t(D.rootGroup.conditions))
32
+ return !0;
33
+ if (D.rootGroup.groups)
34
+ return r(D.rootGroup.groups);
35
+ }
36
+ return !1;
37
+ }, I = Z({}), [Q, Y] = E({}), [H, $] = E(8), O = s.getHeaderGroups()[0], G = O ? O.headers : [], x = T(
38
+ () => G.filter((o) => o.column.getIsVisible()),
39
+ [G]
40
+ ), P = T(
41
+ () => x.filter((o) => o.column.columnDef.meta?.pinned === "left"),
42
+ [x]
43
+ ), _ = T(
44
+ () => x.filter((o) => o.column.columnDef.meta?.pinned === "right"),
45
+ [x]
46
+ ), j = () => {
47
+ const o = d.current;
48
+ if (!o) return 8;
49
+ const e = o.querySelector("thead tr"), t = o.querySelector("tbody tr"), r = e?.getBoundingClientRect().height ?? 40, l = t?.getBoundingClientRect().height ?? 32.5, N = o.offsetHeight - r, a = Math.floor(N / l);
50
+ return a > 1 ? a : 8;
51
+ }, b = (o = 0) => {
38
52
  const e = {};
39
- let o = !1;
40
- if (!c.current) {
41
- t < 5 && setTimeout(() => h(t + 1), 100);
53
+ let t = !1;
54
+ if (!d.current) {
55
+ o < 5 && setTimeout(() => b(o + 1), 100);
42
56
  return;
43
57
  }
44
- const r = c.current.querySelector(
58
+ const r = d.current.querySelector(
45
59
  "tbody tr:first-child"
46
60
  );
47
- let f = 0;
48
- for (const u of I) {
49
- const m = u.column.id;
50
- e[m] = { side: "left", offset: f };
51
- let i = 0;
52
- const d = r?.querySelector(
53
- `[data-column-id="${m}"]`
54
- ), a = z.current[m];
55
- d && d.offsetWidth > 0 ? i = d.getBoundingClientRect().width : a && a.offsetWidth > 0 ? i = a.getBoundingClientRect().width : (o = !0, i = 150), f += i;
61
+ let l = 0;
62
+ for (const a of P) {
63
+ const f = a.column.id;
64
+ e[f] = { side: "left", offset: l };
65
+ let m = 0;
66
+ const g = r?.querySelector(
67
+ `[data-column-id="${f}"]`
68
+ ), p = I.current[f];
69
+ g && g.offsetWidth > 0 ? m = g.getBoundingClientRect().width : p && p.offsetWidth > 0 ? m = p.getBoundingClientRect().width : (t = !0, m = 150), l += m;
56
70
  }
57
- let w = 0;
58
- for (const u of [...O].reverse()) {
59
- const m = u.column.id;
60
- e[m] = { side: "right", offset: w };
61
- let i = 0;
62
- const d = r?.querySelector(
63
- `[data-column-id="${m}"]`
64
- ), a = z.current[m];
65
- d && d.offsetWidth > 0 ? i = d.getBoundingClientRect().width : a && a.offsetWidth > 0 ? i = a.getBoundingClientRect().width : (o = !0, i = 150), w += i;
71
+ let c = 0;
72
+ for (const a of [..._].reverse()) {
73
+ const f = a.column.id;
74
+ e[f] = { side: "right", offset: c };
75
+ let m = 0;
76
+ const g = r?.querySelector(
77
+ `[data-column-id="${f}"]`
78
+ ), p = I.current[f];
79
+ g && g.offsetWidth > 0 ? m = g.getBoundingClientRect().width : p && p.offsetWidth > 0 ? m = p.getBoundingClientRect().width : (t = !0, m = 150), c += m;
66
80
  }
67
- G(e);
68
- const S = B();
69
- T(S), o && t < 5 && setTimeout(
70
- () => h(t + 1),
71
- 100 * (t + 1)
81
+ Y(e);
82
+ const N = j();
83
+ $(N), t && o < 5 && setTimeout(
84
+ () => b(o + 1),
85
+ 100 * (o + 1)
72
86
  );
73
87
  };
74
- X(() => {
88
+ ee(() => {
75
89
  (() => {
76
90
  requestAnimationFrame(() => {
77
91
  requestAnimationFrame(() => {
78
92
  setTimeout(() => {
79
- h();
93
+ b();
80
94
  }, 50);
81
95
  });
82
96
  });
83
97
  })();
84
98
  }, [
85
- I,
86
- O,
87
- p.map((t) => t.id).join("|"),
88
- x,
89
- $,
99
+ P,
100
+ _,
101
+ x.map((o) => o.id).join("|"),
102
+ v,
103
+ W,
90
104
  s.getState().pagination
91
- ]), E(() => {
92
- const t = () => {
93
- clearTimeout(t.timeout), t.timeout = setTimeout(() => h(), 100);
105
+ ]), L(() => {
106
+ const o = () => {
107
+ clearTimeout(o.timeout), o.timeout = setTimeout(() => b(), 100);
94
108
  };
95
- window.addEventListener("resize", t);
96
- const e = c.current;
97
- let o = null;
98
- return e && typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
99
- h();
100
- }), o.observe(e)), () => {
101
- window.removeEventListener("resize", t), clearTimeout(t.timeout), o && o.disconnect();
109
+ window.addEventListener("resize", o);
110
+ const e = d.current;
111
+ let t = null;
112
+ return e && typeof ResizeObserver < "u" && (t = new ResizeObserver(() => {
113
+ b();
114
+ }), t.observe(e)), () => {
115
+ window.removeEventListener("resize", o), clearTimeout(o.timeout), t && t.disconnect();
102
116
  };
103
- }, []), E(() => {
104
- if (x) {
105
- const t = () => {
106
- const r = B();
107
- T(r);
117
+ }, []), L(() => {
118
+ if (v) {
119
+ const o = () => {
120
+ const r = j();
121
+ $(r);
108
122
  };
109
- t();
110
- const e = c.current;
111
- let o = null;
112
- return e && typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
113
- t();
114
- }), o.observe(e)), () => {
115
- o && o.disconnect();
123
+ o();
124
+ const e = d.current;
125
+ let t = null;
126
+ return e && typeof ResizeObserver < "u" && (t = new ResizeObserver(() => {
127
+ o();
128
+ }), t.observe(e)), () => {
129
+ t && t.disconnect();
116
130
  };
117
131
  }
118
- }, [x, c]);
119
- const N = (t, e, o) => {
120
- const r = F[t];
132
+ }, [v, d]);
133
+ const k = (o, e, t) => {
134
+ const r = Q[o];
121
135
  if (!r || !e || r.side !== e) return;
122
- const f = r.side === "left" ? `${r.offset}px` : void 0, w = r.side === "right" ? `${r.offset}px` : void 0;
136
+ const l = r.side === "left" ? `${r.offset}px` : void 0, c = r.side === "right" ? `${r.offset}px` : void 0;
123
137
  return {
124
138
  position: "sticky",
125
- left: f,
126
- right: w,
127
- zIndex: o ? 49 : 48,
139
+ left: l,
140
+ right: c,
141
+ zIndex: t ? 49 : 48,
128
142
  background: "var(--d-background)",
129
143
  // Use separate shadow for pinned columns to avoid conflicts
130
- boxShadow: e === "left" ? `inset -1px ${o ? "0" : "-1px"} 0 var(--d-border), 2px 0 4px -2px rgba(0,0,0,0.1)` : `inset 1px ${o ? "0" : "-1px"} 0 var(--d-border), -2px 0 4px -2px rgba(0,0,0,0.1)`
144
+ boxShadow: e === "left" ? `inset -1px ${t ? "0" : "-1px"} 0 var(--d-border), 2px 0 4px -2px rgba(0,0,0,0.1)` : `inset 1px ${t ? "0" : "-1px"} 0 var(--d-border), -2px 0 4px -2px rgba(0,0,0,0.1)`
131
145
  };
132
146
  };
133
147
  return /* @__PURE__ */ n(
134
148
  "div",
135
149
  {
136
150
  className: "flex max-h-full min-h-0 max-w-full min-w-0 flex-1",
137
- ref: c,
138
- children: /* @__PURE__ */ l(Y, { className: "border-d-border h-full min-h-0 w-full rounded-md border", children: [
139
- /* @__PURE__ */ n(_, { orientation: "horizontal" }),
140
- /* @__PURE__ */ n(_, { orientation: "vertical" }),
141
- /* @__PURE__ */ l(ee, { className: "w-full", style: { minWidth: "max-content" }, children: [
142
- /* @__PURE__ */ n(te, { children: s.getHeaderGroups().map((t) => /* @__PURE__ */ n(D, { children: t.headers.map((e) => /* @__PURE__ */ n(
143
- oe,
151
+ ref: d,
152
+ children: /* @__PURE__ */ i(re, { className: "border-d-border h-full min-h-0 w-full rounded-md border", children: [
153
+ /* @__PURE__ */ n(q, { orientation: "horizontal" }),
154
+ /* @__PURE__ */ n(q, { orientation: "vertical" }),
155
+ /* @__PURE__ */ i(se, { className: "w-full", style: { minWidth: "max-content" }, children: [
156
+ /* @__PURE__ */ n(le, { children: s.getHeaderGroups().map((o) => /* @__PURE__ */ n(y, { children: o.headers.map((e) => /* @__PURE__ */ n(
157
+ ce,
144
158
  {
145
- ref: (o) => {
146
- z.current[e.column.id] = o;
159
+ ref: (t) => {
160
+ I.current[e.column.id] = t;
147
161
  },
148
- className: v(
162
+ className: u(
149
163
  "bg-d-background sticky top-0 h-8 px-0",
150
164
  e.column.columnDef.meta?.pinned ? "z-[49]" : "z-10"
151
165
  ),
152
- style: N(
166
+ style: k(
153
167
  e.column.id,
154
168
  e.column.columnDef.meta?.pinned,
155
169
  !0
156
170
  ),
157
- children: e.isPlaceholder ? null : /* @__PURE__ */ l(J, { children: [
171
+ children: e.isPlaceholder ? null : /* @__PURE__ */ i(te, { children: [
158
172
  /* @__PURE__ */ n(
159
- K,
173
+ oe,
160
174
  {
161
175
  asChild: !0,
162
- onClick: (o) => {
163
- e.column.columnDef.meta?.sortable || e.column.columnDef.meta?.filterable || (o.preventDefault(), o.stopPropagation());
176
+ onClick: (t) => {
177
+ e.column.columnDef.meta?.sortable || e.column.columnDef.meta?.filterable || (t.preventDefault(), t.stopPropagation());
164
178
  },
165
- children: /* @__PURE__ */ l(
179
+ children: /* @__PURE__ */ i(
166
180
  "div",
167
181
  {
168
- className: v(
182
+ className: u(
169
183
  "flex h-full items-center justify-between gap-2 px-2",
170
184
  e.column.columnDef.meta?.sortable || e.column.columnDef.meta?.filterable ? "hover:bg-d-secondary-foreground/10 cursor-pointer" : "cursor-not-allowed"
171
185
  ),
172
186
  children: [
173
- P(
187
+ B(
174
188
  e.column.columnDef.header,
175
189
  e.getContext()
176
190
  ),
177
- e.column.getIsSorted() === "desc" && /* @__PURE__ */ n(
178
- b,
179
- {
180
- variant: "ghost",
181
- size: "icon",
182
- className: "size-7",
183
- iconLeft: e.column.columnDef.meta?.type === "number" ? "ArrowUp01" : e.column.columnDef.meta?.type === "string" ? "ArrowUpAz" : "ArrowUpNarrowWide",
184
- onClick: (o) => {
185
- e.column.toggleSorting(!1, !0), o.stopPropagation(), o.preventDefault();
191
+ /* @__PURE__ */ i("div", { className: "flex flex-row items-center gap-1", children: [
192
+ e.column.columnDef.meta?.searchable && /* @__PURE__ */ n(
193
+ z,
194
+ {
195
+ name: "Search",
196
+ className: u(
197
+ "text-d-foreground/30 max-h-3.5 max-w-3.5",
198
+ !!J && "text-d-primary"
199
+ )
186
200
  }
187
- }
188
- ),
189
- e.column.getIsSorted() === "asc" && /* @__PURE__ */ n(
190
- b,
191
- {
192
- variant: "ghost",
193
- size: "icon",
194
- className: "size-7",
195
- iconRight: e.column.columnDef.meta?.type === "number" ? "ArrowDown01" : e.column.columnDef.meta?.type === "string" ? "ArrowDownAz" : "ArrowDownNarrowWide",
196
- onClick: (o) => {
197
- e.column.toggleSorting(!0, !0), o.stopPropagation(), o.preventDefault();
201
+ ),
202
+ e.column.columnDef.meta?.filterable && /* @__PURE__ */ n(
203
+ z,
204
+ {
205
+ name: "Filter",
206
+ className: u(
207
+ "text-d-foreground/30 max-h-3.5 max-w-3.5",
208
+ K(e.column.id) && "text-d-primary"
209
+ )
198
210
  }
199
- }
200
- )
211
+ ),
212
+ e.column.columnDef.meta?.sortable && /* @__PURE__ */ i("div", { className: "flex flex-col py-1", children: [
213
+ /* @__PURE__ */ n(
214
+ S,
215
+ {
216
+ iconLeft: "ChevronUp",
217
+ size: "icon",
218
+ className: u(
219
+ "hover:bg-d-foreground/10 max-h-4 max-w-6",
220
+ e.column.getIsSorted() === "asc" && "hover:text-d-destructive hover:bg-d-destructive/20"
221
+ ),
222
+ variant: e.column.getIsSorted() === "asc" ? "ghost-accent" : "ghost",
223
+ onClick: (t) => {
224
+ e.column.getIsSorted() === "asc" ? e.column.clearSorting() : e.column.toggleSorting(
225
+ !1,
226
+ !0
227
+ ), t.stopPropagation(), t.preventDefault();
228
+ },
229
+ disabled: s.getState().sorting.length >= h && !e.column.getIsSorted()
230
+ }
231
+ ),
232
+ /* @__PURE__ */ n(
233
+ S,
234
+ {
235
+ iconLeft: "ChevronDown",
236
+ size: "icon",
237
+ className: u(
238
+ "hover:bg-d-foreground/10 max-h-4 max-w-6",
239
+ e.column.getIsSorted() === "desc" && "hover:text-d-destructive hover:bg-d-destructive/20"
240
+ ),
241
+ variant: e.column.getIsSorted() === "desc" ? "ghost-accent" : "ghost",
242
+ onClick: (t) => {
243
+ e.column.getIsSorted() === "desc" ? e.column.clearSorting() : e.column.toggleSorting(
244
+ !0,
245
+ !0
246
+ ), t.stopPropagation(), t.preventDefault();
247
+ },
248
+ disabled: s.getState().sorting.length >= h && !e.column.getIsSorted()
249
+ }
250
+ )
251
+ ] })
252
+ ] })
201
253
  ]
202
254
  }
203
255
  )
204
256
  }
205
257
  ),
206
- /* @__PURE__ */ n(Q, { className: "w-40 p-0", children: /* @__PURE__ */ l("div", { className: "flex flex-col text-sm", children: [
207
- e.column.columnDef.meta?.sortable && /* @__PURE__ */ l(
258
+ /* @__PURE__ */ n(ne, { className: "w-40 p-0", children: /* @__PURE__ */ i("div", { className: "flex flex-col text-sm", children: [
259
+ e.column.columnDef.meta?.sortable && /* @__PURE__ */ i(
208
260
  "div",
209
261
  {
210
- className: v(
262
+ className: u(
211
263
  "group hover:bg-d-secondary-foreground/5 relative flex cursor-pointer items-center justify-between rounded px-2 py-1.5",
212
264
  e.column.getIsSorted() && "bg-d-secondary-foreground/5",
213
- s.getState().sorting.length >= y && !e.column.getIsSorted() && "pointer-events-none cursor-not-allowed opacity-60"
265
+ s.getState().sorting.length >= h && !e.column.getIsSorted() && "pointer-events-none cursor-not-allowed opacity-60"
214
266
  ),
215
- "aria-disabled": s.getState().sorting.length >= y && !e.column.getIsSorted(),
267
+ "aria-disabled": s.getState().sorting.length >= h && !e.column.getIsSorted(),
216
268
  children: [
217
- /* @__PURE__ */ n("span", { className: "text-md", children: g.sorting.sort }),
218
- /* @__PURE__ */ n(W, { name: "ChevronRight", size: "xs" }),
219
- /* @__PURE__ */ l("div", { className: "bg-d-background border-d-border absolute top-0 left-full ml-0 hidden w-48 flex-col rounded-md border p-1 shadow-md group-hover:flex", children: [
269
+ /* @__PURE__ */ n("span", { className: "text-md", children: w.sorting.sort }),
270
+ /* @__PURE__ */ n(z, { name: "ChevronRight", size: "xs" }),
271
+ /* @__PURE__ */ i("div", { className: "bg-d-background border-d-border absolute top-0 left-full ml-0 hidden w-48 flex-col rounded-md border p-1 shadow-md group-hover:flex", children: [
220
272
  /* @__PURE__ */ n(
221
- b,
273
+ S,
222
274
  {
223
275
  className: "justify-start",
224
276
  variant: "ghost",
225
277
  size: "sm",
226
278
  iconLeft: e.column.columnDef.meta?.type === "number" ? "ArrowDown01" : e.column.columnDef.meta?.type === "string" ? "ArrowDownAz" : "ArrowDownNarrowWide",
227
279
  onClick: () => {
228
- !e.column.getIsSorted() && s.getState().sorting.length >= y || e.column.toggleSorting(
280
+ !e.column.getIsSorted() && s.getState().sorting.length >= h || e.column.toggleSorting(
229
281
  !1,
230
282
  !0
231
283
  );
232
284
  },
233
- children: g.sorting.ascending
285
+ children: w.sorting.ascending
234
286
  }
235
287
  ),
236
288
  /* @__PURE__ */ n(
237
- b,
289
+ S,
238
290
  {
239
291
  className: "justify-start",
240
292
  variant: "ghost",
241
293
  size: "sm",
242
294
  iconLeft: e.column.columnDef.meta?.type === "number" ? "ArrowUp01" : e.column.columnDef.meta?.type === "string" ? "ArrowUpAz" : "ArrowUpNarrowWide",
243
295
  onClick: () => {
244
- !e.column.getIsSorted() && s.getState().sorting.length >= y || e.column.toggleSorting(!0, !0);
296
+ !e.column.getIsSorted() && s.getState().sorting.length >= h || e.column.toggleSorting(!0, !0);
245
297
  },
246
- children: g.sorting.descending
298
+ children: w.sorting.descending
247
299
  }
248
300
  ),
249
301
  e.column.getIsSorted() && /* @__PURE__ */ n(
250
- b,
302
+ S,
251
303
  {
252
304
  className: "text-d-destructive/80 hover:text-d-destructive justify-start",
253
305
  variant: "ghost",
254
306
  size: "sm",
255
307
  iconLeft: "CircleX",
256
308
  onClick: () => e.column.clearSorting(),
257
- children: g.sorting.clearSort
309
+ children: w.sorting.clearSort
258
310
  }
259
311
  )
260
312
  ] })
261
313
  ]
262
314
  }
263
315
  ),
264
- e.column.columnDef.meta?.filterable && /* @__PURE__ */ l(
316
+ e.column.columnDef.meta?.filterable && /* @__PURE__ */ i(
265
317
  "div",
266
318
  {
267
319
  className: "hover:bg-d-secondary-foreground/5 relative flex cursor-pointer items-center justify-between rounded px-2 py-1.5",
268
- onClick: () => U(e),
320
+ onClick: () => V(e),
269
321
  children: [
270
- /* @__PURE__ */ n("span", { className: "text-md", children: g.filters.filter }),
271
- /* @__PURE__ */ n(W, { name: "Filter", size: "xs" })
322
+ /* @__PURE__ */ n("span", { className: "text-md", children: w.filters.filter }),
323
+ /* @__PURE__ */ n(z, { name: "Filter", size: "xs" })
272
324
  ]
273
325
  }
274
326
  )
@@ -276,44 +328,58 @@ function ge({
276
328
  ] })
277
329
  },
278
330
  e.id
279
- )) }, t.id)) }),
280
- /* @__PURE__ */ n(ne, { children: x ? Array.from({ length: M }).map(
281
- (t, e) => /* @__PURE__ */ n(D, { children: s.getHeaderGroups()[0].headers.map((o, r) => /* @__PURE__ */ n(
282
- A,
283
- {
284
- "data-column-id": o.column.id,
285
- className: v(
286
- "border-0",
287
- o.column.columnDef.meta?.pinned && "bg-d-background z-[50]"
288
- ),
289
- style: N(
290
- o.column.id,
291
- o.column.columnDef.meta?.pinned,
292
- !1
293
- ),
294
- children: /* @__PURE__ */ n(Z, { className: "h-6 w-full" })
295
- },
296
- `skeleton-cell-${e}-${r}`
297
- )) }, `skeleton-row-${e}`)
298
- ) : s.getRowModel().rows?.length ? s.getRowModel().rows.map((t) => /* @__PURE__ */ n(
299
- D,
331
+ )) }, o.id)) }),
332
+ /* @__PURE__ */ n(ie, { children: v && A ? Array.from({ length: H }).map((o, e) => /* @__PURE__ */ n(y, { children: s.getHeaderGroups()[0].headers.map((t, r) => /* @__PURE__ */ n(
333
+ R,
334
+ {
335
+ "data-column-id": t.column.id,
336
+ className: u(
337
+ "border-0",
338
+ t.column.columnDef.meta?.pinned && "bg-d-background z-[50]"
339
+ ),
340
+ style: k(
341
+ t.column.id,
342
+ t.column.columnDef.meta?.pinned,
343
+ !1
344
+ ),
345
+ children: /* @__PURE__ */ n(F, { className: "h-6 w-full" })
346
+ },
347
+ `skeleton-cell-${e}-${r}`
348
+ )) }, `skeleton-row-${e}`)) : v && !A ? Array.from({ length: H }).map((o, e) => /* @__PURE__ */ n(y, { children: s.getHeaderGroups()[0].headers.map((t, r) => /* @__PURE__ */ n(
349
+ R,
350
+ {
351
+ "data-column-id": t.column.id,
352
+ className: u(
353
+ "border-0",
354
+ t.column.columnDef.meta?.pinned && "bg-d-background z-[50]"
355
+ ),
356
+ style: k(
357
+ t.column.id,
358
+ t.column.columnDef.meta?.pinned,
359
+ !1
360
+ ),
361
+ children: /* @__PURE__ */ n(F, { className: "h-6 w-full" })
362
+ },
363
+ `skeleton-cell-${e}-${r}`
364
+ )) }, `skeleton-row-${e}`)) : s.getRowModel().rows?.length ? s.getRowModel().rows.map((o) => /* @__PURE__ */ n(
365
+ y,
300
366
  {
301
- "data-state": t.getIsSelected() && "selected",
367
+ "data-state": o.getIsSelected() && "selected",
302
368
  className: "border-0 shadow-[inset_0_-1px_0_var(--d-border)]",
303
- children: t.getVisibleCells().map((e) => /* @__PURE__ */ n(
304
- A,
369
+ children: o.getVisibleCells().map((e) => /* @__PURE__ */ n(
370
+ R,
305
371
  {
306
372
  "data-column-id": e.column.id,
307
- className: v(
373
+ className: u(
308
374
  "border-0",
309
375
  e.column.columnDef.meta?.pinned ? "bg-d-background z-[50]" : "shadow-[inset_-1px_0_0_var(--d-border)]"
310
376
  ),
311
- style: N(
377
+ style: k(
312
378
  e.column.id,
313
379
  e.column.columnDef.meta?.pinned,
314
380
  !1
315
381
  ),
316
- children: P(
382
+ children: B(
317
383
  e.column.columnDef.cell,
318
384
  e.getContext()
319
385
  )
@@ -321,13 +387,13 @@ function ge({
321
387
  e.id
322
388
  ))
323
389
  },
324
- t.id
325
- )) : /* @__PURE__ */ n(D, { children: /* @__PURE__ */ n(
326
- A,
390
+ o.id
391
+ )) : /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n(
392
+ R,
327
393
  {
328
394
  colSpan: s?.getHeaderGroups()?.[0]?.headers?.length ?? 1,
329
395
  className: "pt-4 text-center",
330
- children: q || L
396
+ children: U || M
331
397
  }
332
398
  ) }) })
333
399
  ] })
@@ -336,5 +402,5 @@ function ge({
336
402
  );
337
403
  }
338
404
  export {
339
- ge as DataTableBody
405
+ xe as DataTableBody
340
406
  };