@tetrascience-npm/tetrascience-react-ui 0.5.0-beta.41.1 → 0.5.0-beta.42.1

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,293 +1,342 @@
1
- import { jsx as t, jsxs as b } from "react/jsx-runtime";
2
- import { useSensors as xe, useSensor as A, PointerSensor as ye, KeyboardSensor as Ce, DndContext as we, closestCenter as De, DragOverlay as Te } from "@dnd-kit/core";
3
- import { restrictToHorizontalAxis as _e } from "@dnd-kit/modifiers";
4
- import { sortableKeyboardCoordinates as Ne, arrayMove as Ie, SortableContext as Re, horizontalListSortingStrategy as He, useSortable as Me } from "@dnd-kit/sortable";
5
- import { CSS as Oe } from "@dnd-kit/utilities";
6
- import { useReactTable as ke, getPaginationRowModel as ze, getSortedRowModel as Ve, getCoreRowModel as Ee, flexRender as B } from "@tanstack/react-table";
7
- import { GripVerticalIcon as Ae, ArrowUpIcon as Le, ArrowDownIcon as Ke, ArrowUpDownIcon as Pe } from "lucide-react";
8
- import * as s from "react";
9
- import { DataTablePagination as je } from "./data-table-pagination.js";
10
- import { Table as L, TableHeader as K, TableRow as D, TableBody as P, TableHead as G, TableCell as j } from "../table.js";
11
- import { cn as S } from "../../../lib/utils.js";
12
- const X = s.createContext(null);
13
- function tt() {
14
- const o = s.useContext(X);
15
- if (!o)
1
+ import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
+ import { useSensors as Oe, useSensor as P, PointerSensor as ke, KeyboardSensor as Ve, DndContext as ze, closestCenter as Ee, DragOverlay as Le } from "@dnd-kit/core";
3
+ import { restrictToHorizontalAxis as Ke } from "@dnd-kit/modifiers";
4
+ import { sortableKeyboardCoordinates as Ae, arrayMove as Fe, SortableContext as je, horizontalListSortingStrategy as Pe, useSortable as qe } from "@dnd-kit/sortable";
5
+ import { CSS as Ue } from "@dnd-kit/utilities";
6
+ import { useReactTable as We, getPaginationRowModel as Be, getSortedRowModel as Ge, getCoreRowModel as Xe, flexRender as Y } from "@tanstack/react-table";
7
+ import { GripVerticalIcon as Ye, ArrowUpIcon as Je, ArrowDownIcon as Qe, ArrowUpDownIcon as Ze } from "lucide-react";
8
+ import * as i from "react";
9
+ import { DataTablePagination as $e } from "./data-table-pagination.js";
10
+ import { Table as q, TableHeader as U, TableRow as _, TableBody as W, TableHead as J, TableCell as B } from "../table.js";
11
+ import { cn as y } from "../../../lib/utils.js";
12
+ function et(t, a, c) {
13
+ const n = t.toLowerCase().trim(), s = c.toLowerCase().trim();
14
+ switch (a) {
15
+ case "contains":
16
+ return n.includes(s);
17
+ case "equals":
18
+ return n === s;
19
+ case "not_equals":
20
+ return n !== s;
21
+ case "starts_with":
22
+ return n.startsWith(s);
23
+ case "ends_with":
24
+ return n.endsWith(s);
25
+ case "is_empty":
26
+ return n === "";
27
+ case "is_not_empty":
28
+ return n !== "";
29
+ default:
30
+ return !0;
31
+ }
32
+ }
33
+ const Q = i.createContext(null);
34
+ function gt() {
35
+ const t = i.useContext(Q);
36
+ if (!t)
16
37
  throw new Error("useDataTable must be used within a <DataTable>");
17
- return o;
38
+ return t;
18
39
  }
19
- function Fe({
20
- header: o,
40
+ function tt({
41
+ header: t,
21
42
  children: a,
22
- position: l,
23
- numeric: i
43
+ position: c,
44
+ numeric: n
24
45
  }) {
25
46
  const {
26
- attributes: n,
27
- listeners: g,
28
- setNodeRef: v,
29
- transform: m,
30
- transition: T,
31
- isDragging: f
32
- } = Me({ id: o.column.id }), _ = {
33
- transform: Oe.Transform.toString(
34
- m ? { ...m, scaleX: 1, scaleY: 1 } : null
47
+ attributes: s,
48
+ listeners: l,
49
+ setNodeRef: S,
50
+ transform: f,
51
+ transition: D,
52
+ isDragging: g
53
+ } = qe({ id: t.column.id }), T = {
54
+ transform: Ue.Transform.toString(
55
+ f ? { ...f, scaleX: 1, scaleY: 1 } : null
35
56
  ),
36
- transition: T,
57
+ transition: D,
37
58
  position: "relative"
38
59
  };
39
- return /* @__PURE__ */ t(
40
- G,
60
+ return /* @__PURE__ */ r(
61
+ J,
41
62
  {
42
- ref: v,
43
- style: _,
44
- variant: i ? "numeric" : void 0,
45
- className: S(
63
+ ref: S,
64
+ style: T,
65
+ variant: n ? "numeric" : void 0,
66
+ className: y(
46
67
  "group/header transition-shadow duration-150",
47
- !f && l === "first" && "hover:shadow-[inset_-1px_0_0_0_var(--color-border)]",
48
- !f && l === "last" && "hover:shadow-[inset_1px_0_0_0_var(--color-border)]",
49
- !f && l === "middle" && "hover:shadow-[inset_1px_0_0_0_var(--color-border),inset_-1px_0_0_0_var(--color-border)]",
50
- f && "opacity-40"
68
+ !g && c === "first" && "hover:shadow-[inset_-1px_0_0_0_var(--color-border)]",
69
+ !g && c === "last" && "hover:shadow-[inset_1px_0_0_0_var(--color-border)]",
70
+ !g && c === "middle" && "hover:shadow-[inset_1px_0_0_0_var(--color-border),inset_-1px_0_0_0_var(--color-border)]",
71
+ g && "opacity-40"
51
72
  ),
52
- children: /* @__PURE__ */ b("div", { className: S("flex items-center gap-1", i && "flex-row-reverse"), children: [
53
- /* @__PURE__ */ t("div", { className: "flex-1", children: a }),
54
- /* @__PURE__ */ t(
73
+ children: /* @__PURE__ */ b("div", { className: y("flex items-center gap-1", n && "flex-row-reverse"), children: [
74
+ /* @__PURE__ */ r("div", { className: "flex-1", children: a }),
75
+ /* @__PURE__ */ r(
55
76
  "button",
56
77
  {
57
78
  type: "button",
58
79
  "data-drag-handle": "",
59
80
  className: "cursor-grab touch-none text-muted-foreground hover:text-foreground active:cursor-grabbing opacity-0 group-hover/header:opacity-100 transition-opacity",
60
- ...n,
61
- ...g,
62
- children: /* @__PURE__ */ t(Ae, { className: "size-3.5" })
81
+ ...s,
82
+ ...l,
83
+ children: /* @__PURE__ */ r(Ye, { className: "size-3.5" })
63
84
  }
64
85
  )
65
86
  ] })
66
87
  }
67
88
  );
68
89
  }
69
- function F({
70
- header: o,
90
+ function G({
91
+ header: t,
71
92
  enableSorting: a,
72
- numericColumns: l,
73
- columnLabels: i
93
+ numericColumns: c,
94
+ columnLabels: n
74
95
  }) {
75
- if (o.isPlaceholder) return null;
76
- const n = a && o.column.getCanSort(), g = o.column.getIsSorted(), v = l.has(o.column.id);
96
+ if (t.isPlaceholder) return null;
97
+ const s = a && t.column.getCanSort(), l = t.column.getIsSorted(), S = c.has(t.column.id);
77
98
  return /* @__PURE__ */ b(
78
99
  "div",
79
100
  {
80
- className: S(
101
+ className: y(
81
102
  "flex items-center gap-1",
82
- n && "group/sort cursor-pointer select-none",
83
- v && "flex-row-reverse"
103
+ s && "group/sort cursor-pointer select-none",
104
+ S && "flex-row-reverse"
84
105
  ),
85
- onClick: n ? o.column.getToggleSortingHandler() : void 0,
86
- onKeyDown: (m) => {
87
- (m.key === "Enter" || m.key === " ") && n && o.column.getToggleSortingHandler();
106
+ onClick: s ? t.column.getToggleSortingHandler() : void 0,
107
+ onKeyDown: (f) => {
108
+ (f.key === "Enter" || f.key === " ") && s && t.column.getToggleSortingHandler();
88
109
  },
89
110
  children: [
90
- i[o.column.id] ?? B(o.column.columnDef.header, o.getContext()),
91
- n && /* @__PURE__ */ t(
111
+ n[t.column.id] ?? Y(t.column.columnDef.header, t.getContext()),
112
+ s && /* @__PURE__ */ r(
92
113
  "span",
93
114
  {
94
- className: S(
95
- !g && "opacity-0 group-hover/sort:opacity-100 transition-opacity"
115
+ className: y(
116
+ !l && "opacity-0 group-hover/sort:opacity-100 transition-opacity"
96
117
  ),
97
- children: g === "asc" ? /* @__PURE__ */ t(Le, { className: "size-3.5 text-foreground" }) : g === "desc" ? /* @__PURE__ */ t(Ke, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ t(Pe, { className: "size-3.5 text-muted-foreground" })
118
+ children: l === "asc" ? /* @__PURE__ */ r(Je, { className: "size-3.5 text-foreground" }) : l === "desc" ? /* @__PURE__ */ r(Qe, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ r(Ze, { className: "size-3.5 text-muted-foreground" })
98
119
  }
99
120
  )
100
121
  ]
101
122
  }
102
123
  );
103
124
  }
104
- function U({
105
- table: o,
125
+ function X({
126
+ table: t,
106
127
  columns: a,
107
- numericColumns: l
128
+ numericColumns: c
108
129
  }) {
109
- return o.getRowModel().rows.length === 0 ? /* @__PURE__ */ t(D, { children: /* @__PURE__ */ t(j, { colSpan: a.length, className: "h-24 text-center text-muted-foreground", children: "No results." }) }) : o.getRowModel().rows.map((i) => /* @__PURE__ */ t(D, { "data-state": i.getIsSelected() ? "selected" : void 0, children: i.getVisibleCells().map((n) => /* @__PURE__ */ t(j, { variant: l.has(n.column.id) ? "numeric" : void 0, children: B(n.column.columnDef.cell, n.getContext()) }, n.id)) }, i.id));
130
+ return t.getRowModel().rows.length === 0 ? /* @__PURE__ */ r(_, { children: /* @__PURE__ */ r(B, { colSpan: a.length, className: "h-24 text-center text-muted-foreground", children: "No results." }) }) : t.getRowModel().rows.map((n) => /* @__PURE__ */ r(_, { "data-state": n.getIsSelected() ? "selected" : void 0, children: n.getVisibleCells().map((s) => /* @__PURE__ */ r(B, { variant: c.has(s.column.id) ? "numeric" : void 0, children: Y(s.column.columnDef.cell, s.getContext()) }, s.id)) }, n.id));
110
131
  }
111
- function Ue(o) {
112
- const a = [], l = [], i = [];
113
- return s.Children.forEach(o, (n) => {
114
- s.isValidElement(n) && n.type === Be ? a.push(n) : s.isValidElement(n) && n.type === je ? l.push(n) : i.push(n);
115
- }), { toolbarSlots: a, paginationSlots: l, restSlots: i };
132
+ function ot(t) {
133
+ const a = [], c = [], n = [], s = [];
134
+ return i.Children.forEach(t, (l) => {
135
+ i.isValidElement(l) && l.type === rt ? a.push(l) : i.isValidElement(l) && l.type.displayName === "DataTableFilter" ? c.push(l) : i.isValidElement(l) && l.type === $e ? n.push(l) : s.push(l);
136
+ }), { toolbarSlots: a, filterSlots: c, paginationSlots: n, restSlots: s };
116
137
  }
117
- function ot({
118
- columns: o,
138
+ function pt({
139
+ columns: t,
119
140
  data: a,
120
- toolbar: l,
121
- enableSorting: i = !1,
122
- enableColumnVisibility: n = !1,
123
- children: g,
124
- columnOrder: v,
125
- onColumnOrderChange: m,
126
- columnVisibility: T,
127
- onColumnVisibilityChange: f,
128
- columnLabels: _,
129
- onColumnLabelChange: H,
130
- enablePagination: y = !1,
131
- defaultPageSize: Y = 10,
132
- pagination: N,
133
- onPaginationChange: I,
134
- enableColumnReorder: q = !1,
135
- density: M = "default",
136
- className: J,
137
- variant: O = "card",
138
- containerClassName: k
141
+ toolbar: c,
142
+ enableSorting: n = !1,
143
+ enableColumnVisibility: s = !1,
144
+ children: l,
145
+ columnOrder: S,
146
+ onColumnOrderChange: f,
147
+ columnVisibility: D,
148
+ onColumnVisibilityChange: g,
149
+ columnLabels: T,
150
+ onColumnLabelChange: k,
151
+ enablePagination: x = !1,
152
+ defaultPageSize: Z = 10,
153
+ pagination: I,
154
+ onPaginationChange: N,
155
+ enableColumnReorder: $ = !1,
156
+ enableFiltering: M = !1,
157
+ filters: ee,
158
+ onFiltersChange: V,
159
+ filterConfig: R,
160
+ manualFiltering: z = !1,
161
+ density: E = "default",
162
+ className: te,
163
+ variant: L = "card",
164
+ containerClassName: K
139
165
  }) {
140
- const [Q, W] = s.useState([]), [Z, $] = s.useState({}), [ee, te] = s.useState([]), [oe, ne] = s.useState({}), [re, se] = s.useState({
166
+ const [oe, re] = i.useState([]), [ne, se] = i.useState({}), [ie, ae] = i.useState([]), [le, ce] = i.useState({}), [de, ue] = i.useState({
141
167
  pageIndex: 0,
142
- pageSize: Y
143
- }), ie = N ?? re, R = T ?? Z, p = v ?? ee, C = _ ?? oe, ae = s.useMemo(() => {
144
- if (y)
145
- return I ? (e) => {
146
- const r = typeof e == "function" ? e(N) : e;
147
- I(r);
148
- } : se;
149
- }, [y, I, N]), le = s.useMemo(() => {
150
- if (n)
168
+ pageSize: Z
169
+ }), [me, fe] = i.useState([]), ge = I ?? de, H = ee ?? me, O = D ?? ne, p = S ?? ie, C = T ?? le, pe = i.useMemo(() => {
170
+ if (x)
171
+ return N ? (e) => {
172
+ const o = typeof e == "function" ? e(I) : e;
173
+ N(o);
174
+ } : ue;
175
+ }, [x, N, I]), he = i.useMemo(() => {
176
+ if (s)
151
177
  return (e) => {
152
- const r = typeof e == "function" ? e(R) : e;
153
- (f ?? $)(r);
178
+ const o = typeof e == "function" ? e(O) : e;
179
+ (g ?? se)(o);
154
180
  };
155
- }, [n, R, f]), ce = s.useCallback(
181
+ }, [s, O, g]), be = i.useCallback(
156
182
  (e) => {
157
- const r = typeof e == "function" ? e(p) : e;
158
- (m ?? te)(r);
183
+ (V ?? fe)(e);
159
184
  },
160
- [p, m]
161
- ), d = ke({
162
- data: a,
163
- columns: o,
185
+ [V]
186
+ ), ye = i.useMemo(() => R || t.filter((e) => "accessorKey" in e).map((e) => ({ columnId: String(e.accessorKey) })), [R, t]), Se = i.useMemo(() => {
187
+ if (!M || z) return a;
188
+ const e = H.filter(
189
+ (o) => o.columnId && o.operator && (o.value.trim() !== "" || o.operator === "is_empty" || o.operator === "is_not_empty")
190
+ );
191
+ return e.length === 0 ? a : a.filter(
192
+ (o) => e.every((d) => {
193
+ const u = String(
194
+ o[d.columnId] ?? ""
195
+ );
196
+ return et(u, d.operator, d.value);
197
+ })
198
+ );
199
+ }, [a, H, M, z]), ve = i.useCallback(
200
+ (e) => {
201
+ const o = typeof e == "function" ? e(p) : e;
202
+ (f ?? ae)(o);
203
+ },
204
+ [p, f]
205
+ ), m = We({
206
+ data: Se,
207
+ columns: t,
164
208
  state: {
165
- sorting: i ? Q : void 0,
166
- columnVisibility: n ? R : void 0,
209
+ sorting: n ? oe : void 0,
210
+ columnVisibility: s ? O : void 0,
167
211
  columnOrder: p.length > 0 ? p : void 0,
168
- ...y ? { pagination: ie } : {}
212
+ ...x ? { pagination: ge } : {}
169
213
  },
170
- onSortingChange: i ? W : void 0,
171
- onPaginationChange: ae,
172
- onColumnVisibilityChange: le,
173
- onColumnOrderChange: ce,
174
- getCoreRowModel: Ee(),
175
- getSortedRowModel: i ? Ve() : void 0,
176
- getPaginationRowModel: y ? ze() : void 0
177
- }), de = s.useCallback(
178
- (e, r) => {
179
- (H ?? ((c, u) => ne((w) => ({ ...w, [c]: u }))))(e, r);
214
+ onSortingChange: n ? re : void 0,
215
+ onPaginationChange: pe,
216
+ onColumnVisibilityChange: he,
217
+ onColumnOrderChange: ve,
218
+ getCoreRowModel: Xe(),
219
+ getSortedRowModel: n ? Ge() : void 0,
220
+ getPaginationRowModel: x ? Be() : void 0
221
+ }), xe = i.useCallback(
222
+ (e, o) => {
223
+ (k ?? ((d, u) => ce((w) => ({ ...w, [d]: u }))))(e, o);
180
224
  },
181
- [H]
182
- ), ue = xe(
183
- A(ye, { activationConstraint: { distance: 5 } }),
184
- A(Ce, { coordinateGetter: Ne })
185
- ), [z, V] = s.useState(null), me = s.useCallback(
225
+ [k]
226
+ ), Ce = Oe(
227
+ P(ke, { activationConstraint: { distance: 5 } }),
228
+ P(Ve, { coordinateGetter: Ae })
229
+ ), [A, F] = i.useState(null), we = i.useCallback(
186
230
  (e) => {
187
- V(String(e.active.id));
231
+ F(String(e.active.id));
188
232
  },
189
233
  []
190
- ), ge = s.useCallback(
234
+ ), _e = i.useCallback(
191
235
  (e) => {
192
- V(null);
193
- const { active: r, over: c } = e;
194
- if (!c || r.id === c.id) return;
195
- const u = p.length > 0 ? p : d.getAllLeafColumns().map((ve) => ve.id), w = u.indexOf(String(r.id)), E = u.indexOf(String(c.id));
196
- if (w === -1 || E === -1) return;
197
- const Se = Ie(u, w, E);
198
- d.setColumnOrder(Se);
236
+ F(null);
237
+ const { active: o, over: d } = e;
238
+ if (!d || o.id === d.id) return;
239
+ const u = p.length > 0 ? p : m.getAllLeafColumns().map((He) => He.id), w = u.indexOf(String(o.id)), j = u.indexOf(String(d.id));
240
+ if (w === -1 || j === -1) return;
241
+ const Re = Fe(u, w, j);
242
+ m.setColumnOrder(Re);
199
243
  },
200
- [p, d]
201
- ), x = z ? d.getFlatHeaders().find((e) => e.column.id === z) : null, h = s.useMemo(() => {
244
+ [p, m]
245
+ ), v = A ? m.getFlatHeaders().find((e) => e.column.id === A) : null, h = i.useMemo(() => {
202
246
  if (a.length === 0) return /* @__PURE__ */ new Set();
203
- const e = a[0], r = /* @__PURE__ */ new Set();
204
- for (const c of o) {
205
- const u = "accessorKey" in c ? String(c.accessorKey) : "";
206
- u && typeof e[u] == "number" && r.add(u);
247
+ const e = a[0], o = /* @__PURE__ */ new Set();
248
+ for (const d of t) {
249
+ const u = "accessorKey" in d ? String(d.accessorKey) : "";
250
+ u && typeof e[u] == "number" && o.add(u);
207
251
  }
208
- return r;
209
- }, [a, o]), fe = {
210
- table: d,
252
+ return o;
253
+ }, [a, t]), De = {
254
+ table: m,
211
255
  columnLabels: C,
212
- setColumnLabel: de
213
- }, { toolbarSlots: pe, paginationSlots: he, restSlots: be } = Ue(g);
214
- return /* @__PURE__ */ t(X.Provider, { value: fe, children: /* @__PURE__ */ b("div", { "data-slot": "data-table", className: S("w-full space-y-2", J), children: [
215
- l,
216
- pe,
217
- q ? /* @__PURE__ */ b(
218
- we,
256
+ setColumnLabel: xe,
257
+ filters: H,
258
+ setFilters: be,
259
+ filterConfig: ye,
260
+ enableFiltering: M
261
+ }, { toolbarSlots: Te, filterSlots: Ie, paginationSlots: Ne, restSlots: Me } = ot(l);
262
+ return /* @__PURE__ */ r(Q.Provider, { value: De, children: /* @__PURE__ */ b("div", { "data-slot": "data-table", className: y("w-full space-y-2", te), children: [
263
+ c,
264
+ Te,
265
+ Ie,
266
+ $ ? /* @__PURE__ */ b(
267
+ ze,
219
268
  {
220
- sensors: ue,
221
- collisionDetection: De,
222
- modifiers: [_e],
223
- onDragStart: me,
224
- onDragEnd: ge,
269
+ sensors: Ce,
270
+ collisionDetection: Ee,
271
+ modifiers: [Ke],
272
+ onDragStart: we,
273
+ onDragEnd: _e,
225
274
  children: [
226
- /* @__PURE__ */ t(
227
- Re,
275
+ /* @__PURE__ */ r(
276
+ je,
228
277
  {
229
- items: d.getFlatHeaders().map((e) => e.column.id),
230
- strategy: He,
231
- children: /* @__PURE__ */ b(L, { "data-density": M, variant: O, containerClassName: k, children: [
232
- /* @__PURE__ */ t(K, { children: d.getHeaderGroups().map((e) => /* @__PURE__ */ t(D, { children: e.headers.map((r, c) => /* @__PURE__ */ t(
233
- Fe,
278
+ items: m.getFlatHeaders().map((e) => e.column.id),
279
+ strategy: Pe,
280
+ children: /* @__PURE__ */ b(q, { "data-density": E, variant: L, containerClassName: K, children: [
281
+ /* @__PURE__ */ r(U, { children: m.getHeaderGroups().map((e) => /* @__PURE__ */ r(_, { children: e.headers.map((o, d) => /* @__PURE__ */ r(
282
+ tt,
234
283
  {
235
- header: r,
236
- position: c === 0 ? "first" : c === e.headers.length - 1 ? "last" : "middle",
237
- numeric: h.has(r.column.id),
238
- children: /* @__PURE__ */ t(
239
- F,
284
+ header: o,
285
+ position: d === 0 ? "first" : d === e.headers.length - 1 ? "last" : "middle",
286
+ numeric: h.has(o.column.id),
287
+ children: /* @__PURE__ */ r(
288
+ G,
240
289
  {
241
- header: r,
242
- enableSorting: i,
290
+ header: o,
291
+ enableSorting: n,
243
292
  numericColumns: h,
244
293
  columnLabels: C
245
294
  }
246
295
  )
247
296
  },
248
- r.id
297
+ o.id
249
298
  )) }, e.id)) }),
250
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(U, { table: d, columns: o, numericColumns: h }) })
299
+ /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(X, { table: m, columns: t, numericColumns: h }) })
251
300
  ] })
252
301
  }
253
302
  ),
254
- /* @__PURE__ */ t(Te, { dropAnimation: null, children: x && /* @__PURE__ */ t("div", { className: "rounded-md border bg-background px-4 py-3 text-sm font-medium shadow-lg", children: C[x.column.id] ?? (typeof x.column.columnDef.header == "string" ? x.column.columnDef.header : x.column.id) }) })
303
+ /* @__PURE__ */ r(Le, { dropAnimation: null, children: v && /* @__PURE__ */ r("div", { className: "rounded-md border bg-background px-4 py-3 text-sm font-medium shadow-lg", children: C[v.column.id] ?? (typeof v.column.columnDef.header == "string" ? v.column.columnDef.header : v.column.id) }) })
255
304
  ]
256
305
  }
257
- ) : /* @__PURE__ */ b(L, { "data-density": M, variant: O, containerClassName: k, children: [
258
- /* @__PURE__ */ t(K, { children: d.getHeaderGroups().map((e) => /* @__PURE__ */ t(D, { children: e.headers.map((r) => /* @__PURE__ */ t(G, { variant: h.has(r.column.id) ? "numeric" : void 0, children: /* @__PURE__ */ t(
259
- F,
306
+ ) : /* @__PURE__ */ b(q, { "data-density": E, variant: L, containerClassName: K, children: [
307
+ /* @__PURE__ */ r(U, { children: m.getHeaderGroups().map((e) => /* @__PURE__ */ r(_, { children: e.headers.map((o) => /* @__PURE__ */ r(J, { variant: h.has(o.column.id) ? "numeric" : void 0, children: /* @__PURE__ */ r(
308
+ G,
260
309
  {
261
- header: r,
262
- enableSorting: i,
310
+ header: o,
311
+ enableSorting: n,
263
312
  numericColumns: h,
264
313
  columnLabels: C
265
314
  }
266
- ) }, r.id)) }, e.id)) }),
267
- /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(U, { table: d, columns: o, numericColumns: h }) })
315
+ ) }, o.id)) }, e.id)) }),
316
+ /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(X, { table: m, columns: t, numericColumns: h }) })
268
317
  ] }),
269
- he,
270
- be
318
+ Ne,
319
+ Me
271
320
  ] }) });
272
321
  }
273
- function Be({
274
- className: o,
322
+ function rt({
323
+ className: t,
275
324
  children: a,
276
- ...l
325
+ ...c
277
326
  }) {
278
- return /* @__PURE__ */ t(
327
+ return /* @__PURE__ */ r(
279
328
  "div",
280
329
  {
281
330
  "data-slot": "table-toolbar",
282
- className: S("flex items-center gap-2", o),
283
- ...l,
331
+ className: y("flex items-center justify-end gap-2", t),
332
+ ...c,
284
333
  children: a
285
334
  }
286
335
  );
287
336
  }
288
337
  export {
289
- ot as DataTable,
290
- Be as TableToolbar,
291
- tt as useDataTable
338
+ pt as DataTable,
339
+ rt as TableToolbar,
340
+ gt as useDataTable
292
341
  };
293
342
  //# sourceMappingURL=data-table.js.map