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