@tetrascience-npm/tetrascience-react-ui 0.5.0-beta.55.1 → 0.5.0-beta.58.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/composed/PlateMapEditor/ManifestFilterPopover.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.js +140 -0
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.js +126 -0
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.js +422 -0
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.js +136 -0
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.js +389 -0
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlateZoomControl.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/PlateZoomControl.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/PlateZoomControl.js +54 -0
- package/dist/components/composed/PlateMapEditor/PlateZoomControl.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/TemplateIOPanel.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/TemplateIOPanel.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/TemplateIOPanel.js +96 -0
- package/dist/components/composed/PlateMapEditor/TemplateIOPanel.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/WellLegend.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/WellLegend.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/WellLegend.js +58 -0
- package/dist/components/composed/PlateMapEditor/WellLegend.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/WellManifestTable.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/WellManifestTable.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/WellManifestTable.js +408 -0
- package/dist/components/composed/PlateMapEditor/WellManifestTable.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.js +177 -0
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/autoFill.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/autoFill.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/autoFill.js +41 -0
- package/dist/components/composed/PlateMapEditor/autoFill.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/csvPlateTriage.cjs +4 -0
- package/dist/components/composed/PlateMapEditor/csvPlateTriage.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/csvPlateTriage.js +103 -0
- package/dist/components/composed/PlateMapEditor/csvPlateTriage.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/helpers.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/helpers.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/helpers.js +11 -0
- package/dist/components/composed/PlateMapEditor/helpers.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/wellGrid.cjs +2 -0
- package/dist/components/composed/PlateMapEditor/wellGrid.cjs.map +1 -0
- package/dist/components/composed/PlateMapEditor/wellGrid.js +56 -0
- package/dist/components/composed/PlateMapEditor/wellGrid.js.map +1 -0
- package/dist/components/ui/data-table/data-table-filter.cjs +1 -1
- package/dist/components/ui/data-table/data-table-filter.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-filter.js +124 -139
- package/dist/components/ui/data-table/data-table-filter.js.map +1 -1
- package/dist/components/ui/data-table/data-table-group.cjs +2 -0
- package/dist/components/ui/data-table/data-table-group.cjs.map +1 -0
- package/dist/components/ui/data-table/data-table-group.js +118 -0
- package/dist/components/ui/data-table/data-table-group.js.map +1 -0
- package/dist/components/ui/data-table/data-table-pagination.cjs +1 -1
- package/dist/components/ui/data-table/data-table-pagination.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-pagination.js +22 -22
- package/dist/components/ui/data-table/data-table-pagination.js.map +1 -1
- 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 +567 -316
- package/dist/components/ui/data-table/data-table.js.map +1 -1
- package/dist/components/ui/popover.cjs +2 -0
- package/dist/components/ui/popover.cjs.map +1 -0
- package/dist/components/ui/popover.js +45 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +580 -1
- package/dist/index.js +637 -593
- package/dist/index.js.map +1 -1
- package/dist/index.tailwind.css +1 -1
- package/package.json +1 -1
|
@@ -1,398 +1,649 @@
|
|
|
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
|
-
function
|
|
13
|
-
const
|
|
14
|
-
switch (
|
|
1
|
+
import { jsx as s, jsxs as C, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { useSensors as Pe, useSensor as P, PointerSensor as je, KeyboardSensor as Be, DndContext as Ue, closestCenter as Ye, DragOverlay as $e } from "@dnd-kit/core";
|
|
3
|
+
import { restrictToHorizontalAxis as qe } from "@dnd-kit/modifiers";
|
|
4
|
+
import { sortableKeyboardCoordinates as We, arrayMove as Xe, SortableContext as Je, horizontalListSortingStrategy as Qe, useSortable as Ze } from "@dnd-kit/sortable";
|
|
5
|
+
import { CSS as et } from "@dnd-kit/utilities";
|
|
6
|
+
import { useReactTable as tt, getPaginationRowModel as nt, getSortedRowModel as ot, getCoreRowModel as rt, flexRender as L } from "@tanstack/react-table";
|
|
7
|
+
import { GripVerticalIcon as st, ArrowUpIcon as at, ArrowDownIcon as it, ArrowUpDownIcon as lt, ChevronDownIcon as ct, ChevronRightIcon as ut } from "lucide-react";
|
|
8
|
+
import * as l from "react";
|
|
9
|
+
import { DataTablePagination as dt } from "./data-table-pagination.js";
|
|
10
|
+
import { Table as j, TableHeader as B, TableBody as U, TableRow as D, TableHead as q, TableCell as I } from "../table.js";
|
|
11
|
+
import { cn as x } from "../../../lib/utils.js";
|
|
12
|
+
function mt(e, n, r) {
|
|
13
|
+
const t = e.toLowerCase().trim(), a = r.toLowerCase().trim();
|
|
14
|
+
switch (n) {
|
|
15
15
|
case "contains":
|
|
16
|
-
return
|
|
16
|
+
return t.includes(a);
|
|
17
17
|
case "equals":
|
|
18
|
-
return
|
|
18
|
+
return t === a;
|
|
19
19
|
case "not_equals":
|
|
20
|
-
return
|
|
20
|
+
return t !== a;
|
|
21
21
|
case "starts_with":
|
|
22
|
-
return
|
|
22
|
+
return t.startsWith(a);
|
|
23
23
|
case "ends_with":
|
|
24
|
-
return
|
|
24
|
+
return t.endsWith(a);
|
|
25
25
|
case "is_empty":
|
|
26
|
-
return
|
|
26
|
+
return t === "";
|
|
27
27
|
case "is_not_empty":
|
|
28
|
-
return
|
|
28
|
+
return t !== "";
|
|
29
29
|
default:
|
|
30
30
|
return !0;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
33
|
+
const W = l.createContext(null);
|
|
34
|
+
function Ft() {
|
|
35
|
+
const e = l.useContext(W);
|
|
36
|
+
if (!e)
|
|
37
37
|
throw new Error("useDataTable must be used within a <DataTable>");
|
|
38
|
-
return
|
|
38
|
+
return e;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
header:
|
|
42
|
-
children:
|
|
43
|
-
position:
|
|
44
|
-
numeric:
|
|
40
|
+
function gt({
|
|
41
|
+
header: e,
|
|
42
|
+
children: n,
|
|
43
|
+
position: r,
|
|
44
|
+
numeric: t,
|
|
45
45
|
truncate: a
|
|
46
46
|
}) {
|
|
47
47
|
const {
|
|
48
|
-
attributes:
|
|
49
|
-
listeners:
|
|
50
|
-
setNodeRef:
|
|
51
|
-
transform:
|
|
52
|
-
transition:
|
|
53
|
-
isDragging:
|
|
54
|
-
} =
|
|
55
|
-
transform:
|
|
56
|
-
|
|
48
|
+
attributes: i,
|
|
49
|
+
listeners: o,
|
|
50
|
+
setNodeRef: c,
|
|
51
|
+
transform: u,
|
|
52
|
+
transition: d,
|
|
53
|
+
isDragging: m
|
|
54
|
+
} = Ze({ id: e.column.id }), g = {
|
|
55
|
+
transform: et.Transform.toString(
|
|
56
|
+
u ? { ...u, scaleX: 1, scaleY: 1 } : null
|
|
57
57
|
),
|
|
58
|
-
transition:
|
|
58
|
+
transition: d,
|
|
59
59
|
position: "relative"
|
|
60
60
|
};
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
|
|
61
|
+
return /* @__PURE__ */ s(
|
|
62
|
+
q,
|
|
63
63
|
{
|
|
64
|
-
ref:
|
|
65
|
-
style:
|
|
66
|
-
variant:
|
|
64
|
+
ref: c,
|
|
65
|
+
style: g,
|
|
66
|
+
variant: t ? "numeric" : void 0,
|
|
67
67
|
truncate: a,
|
|
68
|
-
className:
|
|
68
|
+
className: x(
|
|
69
69
|
"group/header transition-shadow duration-150",
|
|
70
|
-
!
|
|
71
|
-
!
|
|
72
|
-
!
|
|
73
|
-
|
|
70
|
+
!m && r === "first" && "hover:shadow-[inset_-1px_0_0_0_var(--color-border)]",
|
|
71
|
+
!m && r === "last" && "hover:shadow-[inset_1px_0_0_0_var(--color-border)]",
|
|
72
|
+
!m && r === "middle" && "hover:shadow-[inset_1px_0_0_0_var(--color-border),inset_-1px_0_0_0_var(--color-border)]",
|
|
73
|
+
m && "opacity-40"
|
|
74
74
|
),
|
|
75
|
-
children: /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ C("div", { className: x("flex items-center gap-1 min-w-0", t && "flex-row-reverse"), children: [
|
|
76
|
+
/* @__PURE__ */ s("div", { className: "flex-1 min-w-0", children: n }),
|
|
77
|
+
/* @__PURE__ */ s(
|
|
78
78
|
"button",
|
|
79
79
|
{
|
|
80
80
|
type: "button",
|
|
81
81
|
"data-drag-handle": "",
|
|
82
82
|
className: "cursor-grab touch-none text-muted-foreground hover:text-foreground active:cursor-grabbing opacity-0 group-hover/header:opacity-100 transition-opacity",
|
|
83
|
-
...
|
|
84
|
-
...
|
|
85
|
-
children: /* @__PURE__ */
|
|
83
|
+
...i,
|
|
84
|
+
...o,
|
|
85
|
+
children: /* @__PURE__ */ s(st, { className: "size-3.5" })
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
] })
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
header:
|
|
94
|
-
enableSorting:
|
|
95
|
-
numericColumns:
|
|
96
|
-
columnLabels:
|
|
92
|
+
function X({
|
|
93
|
+
header: e,
|
|
94
|
+
enableSorting: n,
|
|
95
|
+
numericColumns: r,
|
|
96
|
+
columnLabels: t,
|
|
97
97
|
truncate: a
|
|
98
98
|
}) {
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
101
|
-
return /* @__PURE__ */
|
|
99
|
+
if (e.isPlaceholder) return null;
|
|
100
|
+
const i = n && e.column.getCanSort(), o = e.column.getIsSorted(), c = r.has(e.column.id);
|
|
101
|
+
return /* @__PURE__ */ C(
|
|
102
102
|
"div",
|
|
103
103
|
{
|
|
104
|
-
className:
|
|
104
|
+
className: x(
|
|
105
105
|
"flex items-center gap-1 min-w-0",
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
i && "group/sort cursor-pointer select-none",
|
|
107
|
+
c && "flex-row-reverse"
|
|
108
108
|
),
|
|
109
|
-
onClick:
|
|
110
|
-
onKeyDown: (
|
|
111
|
-
(
|
|
109
|
+
onClick: i ? e.column.getToggleSortingHandler() : void 0,
|
|
110
|
+
onKeyDown: (u) => {
|
|
111
|
+
(u.key === "Enter" || u.key === " ") && i && e.column.getToggleSortingHandler();
|
|
112
112
|
},
|
|
113
113
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
114
|
+
/* @__PURE__ */ s("span", { className: x("min-w-0", a && "truncate"), children: t[e.column.id] ?? L(e.column.columnDef.header, e.getContext()) }),
|
|
115
|
+
i && /* @__PURE__ */ s(
|
|
116
116
|
"span",
|
|
117
117
|
{
|
|
118
|
-
className:
|
|
119
|
-
!
|
|
118
|
+
className: x(
|
|
119
|
+
!o && "opacity-0 group-hover/sort:opacity-100 transition-opacity"
|
|
120
120
|
),
|
|
121
|
-
children:
|
|
121
|
+
children: o === "asc" ? /* @__PURE__ */ s(at, { className: "size-3.5 text-foreground" }) : o === "desc" ? /* @__PURE__ */ s(it, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ s(lt, { className: "size-3.5 text-muted-foreground" })
|
|
122
122
|
}
|
|
123
123
|
)
|
|
124
124
|
]
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
const z = "—";
|
|
129
|
+
function ft(e, n) {
|
|
130
|
+
const r = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
131
|
+
for (const o of e) {
|
|
132
|
+
const c = o.getValue(n), u = c == null || c === "", d = u ? z : String(c), m = r.get(d);
|
|
133
|
+
m ? m.push(o) : (r.set(d, [o]), t.set(d, u ? null : c));
|
|
134
|
+
}
|
|
135
|
+
const a = [...r.keys()], i = a.every((o) => o === z || typeof t.get(o) == "number");
|
|
136
|
+
return a.sort((o, c) => o === z ? 1 : c === z ? -1 : i ? t.get(o) - t.get(c) : o.localeCompare(c, void 0, { sensitivity: "base", numeric: !0 })), { order: a, buckets: r };
|
|
137
|
+
}
|
|
138
|
+
function pt(e, n, r, t) {
|
|
139
|
+
const a = e.getColumn(n);
|
|
140
|
+
return r.find((i) => i.columnId === n)?.label ?? t[n] ?? (typeof a?.columnDef.header == "string" ? a.columnDef.header : n);
|
|
141
|
+
}
|
|
142
|
+
function ht({ row: e, numericColumns: n, truncate: r }) {
|
|
143
|
+
return /* @__PURE__ */ s(D, { "data-state": e.getIsSelected() ? "selected" : void 0, children: e.getVisibleCells().map((t) => /* @__PURE__ */ s(
|
|
144
|
+
I,
|
|
145
|
+
{
|
|
146
|
+
variant: n.has(t.column.id) ? "numeric" : void 0,
|
|
147
|
+
truncate: r && (t.column.columnDef.meta?.truncate ?? !0),
|
|
148
|
+
children: L(t.column.columnDef.cell, t.getContext())
|
|
149
|
+
},
|
|
150
|
+
t.id
|
|
151
|
+
)) });
|
|
152
|
+
}
|
|
153
|
+
function St({
|
|
154
|
+
groupKey: e,
|
|
155
|
+
groupLabel: n,
|
|
156
|
+
isExpanded: r,
|
|
157
|
+
colSpan: t,
|
|
158
|
+
onToggle: a
|
|
133
159
|
}) {
|
|
134
|
-
return
|
|
135
|
-
|
|
160
|
+
return /* @__PURE__ */ s(D, { "data-slot": "data-table-group-header", children: /* @__PURE__ */ s(I, { colSpan: t, className: "p-0 font-medium", children: /* @__PURE__ */ C(
|
|
161
|
+
"button",
|
|
136
162
|
{
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
163
|
+
type: "button",
|
|
164
|
+
onClick: a,
|
|
165
|
+
"aria-expanded": r,
|
|
166
|
+
"aria-label": `${r ? "Collapse" : "Expand"} group ${e}`,
|
|
167
|
+
className: "flex w-full items-center gap-2 text-left p-4 in-data-[density=compact]:py-2 in-data-[density=relaxed]:py-5 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
168
|
+
children: [
|
|
169
|
+
r ? /* @__PURE__ */ s(ct, { className: "size-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ s(ut, { className: "size-3.5 shrink-0 text-muted-foreground" }),
|
|
170
|
+
/* @__PURE__ */ s("span", { className: "text-xs uppercase tracking-wide text-muted-foreground", children: n }),
|
|
171
|
+
/* @__PURE__ */ s("span", { className: "truncate", children: e })
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
) }) });
|
|
175
|
+
}
|
|
176
|
+
function bt({
|
|
177
|
+
table: e,
|
|
178
|
+
numericColumns: n,
|
|
179
|
+
truncate: r,
|
|
180
|
+
grouping: t,
|
|
181
|
+
groupConfig: a,
|
|
182
|
+
columnLabels: i,
|
|
183
|
+
collapsedGroups: o,
|
|
184
|
+
onToggleGroup: c
|
|
185
|
+
}) {
|
|
186
|
+
const u = e.getVisibleLeafColumns().length, d = e.getSortedRowModel().rows;
|
|
187
|
+
if (d.length === 0)
|
|
188
|
+
return /* @__PURE__ */ s(D, { children: /* @__PURE__ */ s(I, { colSpan: u, className: "h-24 text-center text-muted-foreground", children: "No results." }) });
|
|
189
|
+
const { order: m, buckets: g } = ft(d, t), S = pt(e, t, a, i);
|
|
190
|
+
return /* @__PURE__ */ s(V, { children: m.map((h) => {
|
|
191
|
+
const b = g.get(h) ?? [], p = !o.has(h);
|
|
192
|
+
return /* @__PURE__ */ C(l.Fragment, { children: [
|
|
193
|
+
/* @__PURE__ */ s(
|
|
194
|
+
St,
|
|
195
|
+
{
|
|
196
|
+
groupKey: h,
|
|
197
|
+
groupLabel: S,
|
|
198
|
+
isExpanded: p,
|
|
199
|
+
colSpan: u,
|
|
200
|
+
onToggle: () => c(h)
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
p && b.map((v) => /* @__PURE__ */ s(
|
|
204
|
+
ht,
|
|
205
|
+
{
|
|
206
|
+
row: v,
|
|
207
|
+
numericColumns: n,
|
|
208
|
+
truncate: r
|
|
209
|
+
},
|
|
210
|
+
v.id
|
|
211
|
+
))
|
|
212
|
+
] }, `group-${h}`);
|
|
213
|
+
}) });
|
|
214
|
+
}
|
|
215
|
+
function vt(e, n) {
|
|
216
|
+
if (e.length === 0) return /* @__PURE__ */ new Set();
|
|
217
|
+
const r = e[0], t = /* @__PURE__ */ new Set();
|
|
218
|
+
for (const a of n) {
|
|
219
|
+
const i = "accessorKey" in a ? String(a.accessorKey) : "";
|
|
220
|
+
i && typeof r[i] == "number" && t.add(i);
|
|
221
|
+
}
|
|
222
|
+
return t;
|
|
223
|
+
}
|
|
224
|
+
function Y(e) {
|
|
225
|
+
return e.filter((n) => "accessorKey" in n).map((n) => ({ columnId: String(n.accessorKey) }));
|
|
226
|
+
}
|
|
227
|
+
function Ct(e, n) {
|
|
228
|
+
const r = n.filter(
|
|
229
|
+
(t) => t.columnId && t.operator && (t.value.trim() !== "" || t.operator === "is_empty" || t.operator === "is_not_empty")
|
|
230
|
+
);
|
|
231
|
+
return r.length === 0 ? e : e.filter(
|
|
232
|
+
(t) => r.every((a) => {
|
|
233
|
+
const i = String(t[a.columnId] ?? "");
|
|
234
|
+
return mt(i, a.operator, a.value);
|
|
235
|
+
})
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
function yt(e, n) {
|
|
239
|
+
const r = Pe(
|
|
240
|
+
P(je, { activationConstraint: { distance: 5 } }),
|
|
241
|
+
P(Be, { coordinateGetter: We })
|
|
242
|
+
), [t, a] = l.useState(null), i = l.useCallback((u) => {
|
|
243
|
+
a(String(u.active.id));
|
|
244
|
+
}, []), o = l.useCallback(
|
|
245
|
+
(u) => {
|
|
246
|
+
a(null);
|
|
247
|
+
const { active: d, over: m } = u;
|
|
248
|
+
if (!m || d.id === m.id) return;
|
|
249
|
+
const g = n.length > 0 ? n : e.getAllLeafColumns().map((p) => p.id), S = g.indexOf(String(d.id)), h = g.indexOf(String(m.id));
|
|
250
|
+
if (S === -1 || h === -1) return;
|
|
251
|
+
const b = Xe(g, S, h);
|
|
252
|
+
e.setColumnOrder(b);
|
|
253
|
+
},
|
|
254
|
+
[n, e]
|
|
255
|
+
), c = t ? e.getFlatHeaders().find((u) => u.column.id === t) : null;
|
|
256
|
+
return { sensors: r, draggingHeader: c, handleDragStart: i, handleDragEnd: o };
|
|
257
|
+
}
|
|
258
|
+
function wt(e, n) {
|
|
259
|
+
const [r, t] = l.useState(null), [a, i] = l.useState(() => /* @__PURE__ */ new Set()), o = e === void 0 ? r : e, c = l.useCallback(
|
|
260
|
+
(d) => {
|
|
261
|
+
i(/* @__PURE__ */ new Set()), (n ?? t)(d);
|
|
140
262
|
},
|
|
141
|
-
|
|
142
|
-
)
|
|
263
|
+
[n]
|
|
264
|
+
), u = l.useCallback((d) => {
|
|
265
|
+
i((m) => {
|
|
266
|
+
const g = new Set(m);
|
|
267
|
+
return g.has(d) ? g.delete(d) : g.add(d), g;
|
|
268
|
+
});
|
|
269
|
+
}, []);
|
|
270
|
+
return { grouping: o, collapsedGroups: a, handleGroupingChange: c, toggleGroup: u };
|
|
271
|
+
}
|
|
272
|
+
function xt({
|
|
273
|
+
table: e,
|
|
274
|
+
enableSorting: n,
|
|
275
|
+
numericColumns: r,
|
|
276
|
+
columnLabels: t,
|
|
277
|
+
truncate: a
|
|
278
|
+
}) {
|
|
279
|
+
return /* @__PURE__ */ s(V, { children: e.getHeaderGroups().map((i) => /* @__PURE__ */ s(D, { children: i.headers.map((o) => /* @__PURE__ */ s(
|
|
280
|
+
q,
|
|
281
|
+
{
|
|
282
|
+
variant: r.has(o.column.id) ? "numeric" : void 0,
|
|
283
|
+
truncate: a && (o.column.columnDef.meta?.truncate ?? !0),
|
|
284
|
+
children: /* @__PURE__ */ s(
|
|
285
|
+
X,
|
|
286
|
+
{
|
|
287
|
+
header: o,
|
|
288
|
+
enableSorting: n,
|
|
289
|
+
numericColumns: r,
|
|
290
|
+
columnLabels: t,
|
|
291
|
+
truncate: a && (o.column.columnDef.meta?.truncate ?? !0)
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
},
|
|
295
|
+
o.id
|
|
296
|
+
)) }, i.id)) });
|
|
297
|
+
}
|
|
298
|
+
function Dt({
|
|
299
|
+
table: e,
|
|
300
|
+
enableSorting: n,
|
|
301
|
+
numericColumns: r,
|
|
302
|
+
columnLabels: t,
|
|
303
|
+
truncate: a
|
|
304
|
+
}) {
|
|
305
|
+
return /* @__PURE__ */ s(V, { children: e.getHeaderGroups().map((i) => /* @__PURE__ */ s(D, { children: i.headers.map((o, c) => {
|
|
306
|
+
const u = c === 0 ? "first" : c === i.headers.length - 1 ? "last" : "middle";
|
|
307
|
+
return /* @__PURE__ */ s(
|
|
308
|
+
gt,
|
|
309
|
+
{
|
|
310
|
+
header: o,
|
|
311
|
+
position: u,
|
|
312
|
+
numeric: r.has(o.column.id),
|
|
313
|
+
truncate: a && (o.column.columnDef.meta?.truncate ?? !0),
|
|
314
|
+
children: /* @__PURE__ */ s(
|
|
315
|
+
X,
|
|
316
|
+
{
|
|
317
|
+
header: o,
|
|
318
|
+
enableSorting: n,
|
|
319
|
+
numericColumns: r,
|
|
320
|
+
columnLabels: t,
|
|
321
|
+
truncate: a && (o.column.columnDef.meta?.truncate ?? !0)
|
|
322
|
+
}
|
|
323
|
+
)
|
|
324
|
+
},
|
|
325
|
+
o.id
|
|
326
|
+
);
|
|
327
|
+
}) }, i.id)) });
|
|
143
328
|
}
|
|
144
|
-
function
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
329
|
+
function $({
|
|
330
|
+
table: e,
|
|
331
|
+
useFlexSize: n
|
|
332
|
+
}) {
|
|
333
|
+
return /* @__PURE__ */ s("colgroup", { children: e.getHeaderGroups()[0]?.headers.map(
|
|
334
|
+
(r) => n ? /* @__PURE__ */ s("col", { style: { width: r.column.getSize() } }, r.id) : /* @__PURE__ */ s(
|
|
335
|
+
"col",
|
|
336
|
+
{
|
|
337
|
+
style: r.column.columnDef.size == null ? void 0 : { width: r.column.columnDef.size }
|
|
338
|
+
},
|
|
339
|
+
r.id
|
|
340
|
+
)
|
|
341
|
+
) });
|
|
149
342
|
}
|
|
150
|
-
function
|
|
343
|
+
function Nt(e) {
|
|
344
|
+
const {
|
|
345
|
+
table: n,
|
|
346
|
+
columns: r,
|
|
347
|
+
variant: t,
|
|
348
|
+
containerClassName: a,
|
|
349
|
+
density: i,
|
|
350
|
+
hasExplicitSize: o,
|
|
351
|
+
enableSorting: c,
|
|
352
|
+
enableColumnReorder: u,
|
|
353
|
+
enableGrouping: d,
|
|
354
|
+
grouping: m,
|
|
355
|
+
groupConfig: g,
|
|
356
|
+
collapsedGroups: S,
|
|
357
|
+
onToggleGroup: h,
|
|
358
|
+
numericColumns: b,
|
|
359
|
+
columnLabels: p,
|
|
360
|
+
truncate: v,
|
|
361
|
+
reorderSensors: N,
|
|
362
|
+
draggingHeader: y,
|
|
363
|
+
onDragStart: G,
|
|
364
|
+
onDragEnd: M
|
|
365
|
+
} = e, _ = /* @__PURE__ */ s(
|
|
366
|
+
_t,
|
|
367
|
+
{
|
|
368
|
+
table: n,
|
|
369
|
+
columns: r,
|
|
370
|
+
numericColumns: b,
|
|
371
|
+
truncate: v,
|
|
372
|
+
grouping: d ? m : null,
|
|
373
|
+
groupConfig: g,
|
|
374
|
+
columnLabels: p,
|
|
375
|
+
collapsedGroups: S,
|
|
376
|
+
onToggleGroup: h
|
|
377
|
+
}
|
|
378
|
+
);
|
|
379
|
+
return u ? /* @__PURE__ */ C(
|
|
380
|
+
Ue,
|
|
381
|
+
{
|
|
382
|
+
sensors: N,
|
|
383
|
+
collisionDetection: Ye,
|
|
384
|
+
modifiers: [qe],
|
|
385
|
+
onDragStart: G,
|
|
386
|
+
onDragEnd: M,
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ s(
|
|
389
|
+
Je,
|
|
390
|
+
{
|
|
391
|
+
items: n.getFlatHeaders().map((T) => T.column.id),
|
|
392
|
+
strategy: Qe,
|
|
393
|
+
children: /* @__PURE__ */ C(
|
|
394
|
+
j,
|
|
395
|
+
{
|
|
396
|
+
"data-density": i,
|
|
397
|
+
variant: t,
|
|
398
|
+
containerClassName: a,
|
|
399
|
+
layout: o ? "fixed" : void 0,
|
|
400
|
+
children: [
|
|
401
|
+
o && /* @__PURE__ */ s($, { table: n, useFlexSize: !0 }),
|
|
402
|
+
/* @__PURE__ */ s(B, { children: /* @__PURE__ */ s(
|
|
403
|
+
Dt,
|
|
404
|
+
{
|
|
405
|
+
table: n,
|
|
406
|
+
enableSorting: c,
|
|
407
|
+
numericColumns: b,
|
|
408
|
+
columnLabels: p,
|
|
409
|
+
truncate: v
|
|
410
|
+
}
|
|
411
|
+
) }),
|
|
412
|
+
/* @__PURE__ */ s(U, { children: _ })
|
|
413
|
+
]
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
}
|
|
417
|
+
),
|
|
418
|
+
/* @__PURE__ */ s($e, { dropAnimation: null, children: y && /* @__PURE__ */ s("div", { className: "rounded-md border bg-background px-4 py-3 text-sm font-medium shadow-lg", children: p[y.column.id] ?? (typeof y.column.columnDef.header == "string" ? y.column.columnDef.header : y.column.id) }) })
|
|
419
|
+
]
|
|
420
|
+
}
|
|
421
|
+
) : /* @__PURE__ */ C(
|
|
422
|
+
j,
|
|
423
|
+
{
|
|
424
|
+
"data-density": i,
|
|
425
|
+
variant: t,
|
|
426
|
+
containerClassName: a,
|
|
427
|
+
layout: o ? "fixed" : void 0,
|
|
428
|
+
children: [
|
|
429
|
+
o && /* @__PURE__ */ s($, { table: n, useFlexSize: !1 }),
|
|
430
|
+
/* @__PURE__ */ s(B, { children: /* @__PURE__ */ s(
|
|
431
|
+
xt,
|
|
432
|
+
{
|
|
433
|
+
table: n,
|
|
434
|
+
enableSorting: c,
|
|
435
|
+
numericColumns: b,
|
|
436
|
+
columnLabels: p,
|
|
437
|
+
truncate: v
|
|
438
|
+
}
|
|
439
|
+
) }),
|
|
440
|
+
/* @__PURE__ */ s(U, { children: _ })
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
function _t({
|
|
446
|
+
table: e,
|
|
151
447
|
columns: n,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
448
|
+
numericColumns: r,
|
|
449
|
+
truncate: t,
|
|
450
|
+
grouping: a,
|
|
451
|
+
groupConfig: i,
|
|
452
|
+
columnLabels: o,
|
|
453
|
+
collapsedGroups: c,
|
|
454
|
+
onToggleGroup: u
|
|
455
|
+
}) {
|
|
456
|
+
return a ? /* @__PURE__ */ s(
|
|
457
|
+
bt,
|
|
458
|
+
{
|
|
459
|
+
table: e,
|
|
460
|
+
numericColumns: r,
|
|
461
|
+
truncate: t,
|
|
462
|
+
grouping: a,
|
|
463
|
+
groupConfig: i,
|
|
464
|
+
columnLabels: o,
|
|
465
|
+
collapsedGroups: c,
|
|
466
|
+
onToggleGroup: u
|
|
467
|
+
}
|
|
468
|
+
) : e.getRowModel().rows.length === 0 ? /* @__PURE__ */ s(D, { children: /* @__PURE__ */ s(I, { colSpan: n.length, className: "h-24 text-center text-muted-foreground", children: "No results." }) }) : e.getRowModel().rows.map((d) => /* @__PURE__ */ s(D, { "data-state": d.getIsSelected() ? "selected" : void 0, children: d.getVisibleCells().map((m) => /* @__PURE__ */ s(
|
|
469
|
+
I,
|
|
470
|
+
{
|
|
471
|
+
variant: r.has(m.column.id) ? "numeric" : void 0,
|
|
472
|
+
truncate: t && (m.column.columnDef.meta?.truncate ?? !0),
|
|
473
|
+
children: L(m.column.columnDef.cell, m.getContext())
|
|
474
|
+
},
|
|
475
|
+
m.id
|
|
476
|
+
)) }, d.id));
|
|
477
|
+
}
|
|
478
|
+
function Tt(e) {
|
|
479
|
+
const n = [], r = [], t = [], a = [], i = [];
|
|
480
|
+
return l.Children.forEach(e, (o) => {
|
|
481
|
+
l.isValidElement(o) && o.type === Rt ? n.push(o) : l.isValidElement(o) && o.type.displayName === "DataTableFilter" ? r.push(o) : l.isValidElement(o) && o.type.displayName === "DataTableGroup" ? t.push(o) : l.isValidElement(o) && o.type === dt ? a.push(o) : i.push(o);
|
|
482
|
+
}), { toolbarSlots: n, filterSlots: r, groupSlots: t, paginationSlots: a, restSlots: i };
|
|
483
|
+
}
|
|
484
|
+
function Kt({
|
|
485
|
+
columns: e,
|
|
486
|
+
data: n,
|
|
487
|
+
toolbar: r,
|
|
488
|
+
enableSorting: t = !1,
|
|
155
489
|
enableColumnVisibility: a = !1,
|
|
156
|
-
children:
|
|
157
|
-
columnOrder:
|
|
158
|
-
onColumnOrderChange:
|
|
159
|
-
columnVisibility:
|
|
160
|
-
onColumnVisibilityChange:
|
|
161
|
-
columnLabels:
|
|
162
|
-
onColumnLabelChange:
|
|
163
|
-
enablePagination:
|
|
164
|
-
defaultPageSize:
|
|
165
|
-
pagination:
|
|
166
|
-
onPaginationChange:
|
|
167
|
-
enableColumnReorder:
|
|
168
|
-
enableFiltering:
|
|
169
|
-
filters:
|
|
170
|
-
onFiltersChange:
|
|
171
|
-
filterConfig:
|
|
172
|
-
manualFiltering:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
490
|
+
children: i,
|
|
491
|
+
columnOrder: o,
|
|
492
|
+
onColumnOrderChange: c,
|
|
493
|
+
columnVisibility: u,
|
|
494
|
+
onColumnVisibilityChange: d,
|
|
495
|
+
columnLabels: m,
|
|
496
|
+
onColumnLabelChange: g,
|
|
497
|
+
enablePagination: S = !1,
|
|
498
|
+
defaultPageSize: h = 10,
|
|
499
|
+
pagination: b,
|
|
500
|
+
onPaginationChange: p,
|
|
501
|
+
enableColumnReorder: v = !1,
|
|
502
|
+
enableFiltering: N = !1,
|
|
503
|
+
filters: y,
|
|
504
|
+
onFiltersChange: G,
|
|
505
|
+
filterConfig: M,
|
|
506
|
+
manualFiltering: _ = !1,
|
|
507
|
+
enableGrouping: T = !1,
|
|
508
|
+
grouping: J,
|
|
509
|
+
onGroupingChange: Q,
|
|
510
|
+
groupConfig: O,
|
|
511
|
+
density: Z = "default",
|
|
512
|
+
className: ee,
|
|
513
|
+
variant: te = "card",
|
|
514
|
+
containerClassName: ne,
|
|
515
|
+
truncate: oe = !0
|
|
178
516
|
}) {
|
|
179
|
-
const [re, se] =
|
|
517
|
+
const [re, se] = l.useState([]), [ae, ie] = l.useState({}), [le, ce] = l.useState([]), [ue, de] = l.useState({}), [me, ge] = l.useState({
|
|
180
518
|
pageIndex: 0,
|
|
181
|
-
pageSize:
|
|
182
|
-
}), [
|
|
183
|
-
if (
|
|
184
|
-
return
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
} :
|
|
188
|
-
}, [
|
|
519
|
+
pageSize: h
|
|
520
|
+
}), [fe, pe] = l.useState([]), { grouping: F, collapsedGroups: he, handleGroupingChange: Se, toggleGroup: be } = wt(J, Q), ve = b ?? me, H = y ?? fe, E = u ?? ae, R = o ?? le, K = m ?? ue, Ce = l.useMemo(() => {
|
|
521
|
+
if (S)
|
|
522
|
+
return p ? (f) => {
|
|
523
|
+
const w = typeof f == "function" ? f(b) : f;
|
|
524
|
+
p(w);
|
|
525
|
+
} : ge;
|
|
526
|
+
}, [S, p, b]), ye = l.useMemo(() => {
|
|
189
527
|
if (a)
|
|
190
|
-
return (
|
|
191
|
-
const
|
|
192
|
-
(
|
|
528
|
+
return (f) => {
|
|
529
|
+
const w = typeof f == "function" ? f(E) : f;
|
|
530
|
+
(d ?? ie)(w);
|
|
193
531
|
};
|
|
194
|
-
}, [a,
|
|
195
|
-
(
|
|
196
|
-
(
|
|
532
|
+
}, [a, E, d]), we = l.useCallback(
|
|
533
|
+
(f) => {
|
|
534
|
+
(G ?? pe)(f);
|
|
197
535
|
},
|
|
198
|
-
[
|
|
199
|
-
),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
)
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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);
|
|
536
|
+
[G]
|
|
537
|
+
), xe = l.useMemo(
|
|
538
|
+
() => M ?? Y(e),
|
|
539
|
+
[M, e]
|
|
540
|
+
), A = l.useMemo(
|
|
541
|
+
() => O ?? Y(e),
|
|
542
|
+
[O, e]
|
|
543
|
+
), De = l.useMemo(
|
|
544
|
+
() => !N || _ ? n : Ct(n, H),
|
|
545
|
+
[n, H, N, _]
|
|
546
|
+
), Ne = l.useCallback(
|
|
547
|
+
(f) => {
|
|
548
|
+
const w = typeof f == "function" ? f(R) : f;
|
|
549
|
+
(c ?? ce)(w);
|
|
216
550
|
},
|
|
217
|
-
[
|
|
218
|
-
),
|
|
219
|
-
data:
|
|
220
|
-
columns:
|
|
551
|
+
[R, c]
|
|
552
|
+
), k = tt({
|
|
553
|
+
data: De,
|
|
554
|
+
columns: e,
|
|
221
555
|
state: {
|
|
222
|
-
sorting:
|
|
223
|
-
columnVisibility: a ?
|
|
224
|
-
columnOrder:
|
|
225
|
-
...
|
|
226
|
-
},
|
|
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);
|
|
556
|
+
sorting: t ? re : void 0,
|
|
557
|
+
columnVisibility: a ? E : void 0,
|
|
558
|
+
columnOrder: R.length > 0 ? R : void 0,
|
|
559
|
+
...S ? { pagination: ve } : {}
|
|
237
560
|
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
(
|
|
244
|
-
|
|
561
|
+
onSortingChange: t ? se : void 0,
|
|
562
|
+
onPaginationChange: Ce,
|
|
563
|
+
onColumnVisibilityChange: ye,
|
|
564
|
+
onColumnOrderChange: Ne,
|
|
565
|
+
getCoreRowModel: rt(),
|
|
566
|
+
getSortedRowModel: t || T ? ot() : void 0,
|
|
567
|
+
getPaginationRowModel: S ? nt() : void 0
|
|
568
|
+
}), _e = l.useCallback(
|
|
569
|
+
(f, w) => {
|
|
570
|
+
(g ?? ((Fe, Ke) => de((Ae) => ({ ...Ae, [Fe]: Ke }))))(f, w);
|
|
245
571
|
},
|
|
246
|
-
[]
|
|
247
|
-
),
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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,
|
|
281
|
-
{
|
|
282
|
-
sensors: De,
|
|
283
|
-
collisionDetection: Ke,
|
|
284
|
-
modifiers: [Fe],
|
|
285
|
-
onDragStart: _e,
|
|
286
|
-
onDragEnd: Te,
|
|
287
|
-
children: [
|
|
288
|
-
/* @__PURE__ */ o(
|
|
289
|
-
Pe,
|
|
290
|
-
{
|
|
291
|
-
items: d.getFlatHeaders().map((e) => e.column.id),
|
|
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,
|
|
310
|
-
{
|
|
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
|
-
)
|
|
332
|
-
}
|
|
333
|
-
),
|
|
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) }) })
|
|
335
|
-
]
|
|
336
|
-
}
|
|
337
|
-
) : /* @__PURE__ */ x(
|
|
338
|
-
U,
|
|
572
|
+
[g]
|
|
573
|
+
), {
|
|
574
|
+
sensors: Te,
|
|
575
|
+
draggingHeader: Re,
|
|
576
|
+
handleDragStart: Ie,
|
|
577
|
+
handleDragEnd: Ge
|
|
578
|
+
} = yt(k, R), Me = l.useMemo(
|
|
579
|
+
() => vt(n, e),
|
|
580
|
+
[n, e]
|
|
581
|
+
), ze = e.some((f) => f.size != null), He = {
|
|
582
|
+
table: k,
|
|
583
|
+
columnLabels: K,
|
|
584
|
+
setColumnLabel: _e,
|
|
585
|
+
filters: H,
|
|
586
|
+
setFilters: we,
|
|
587
|
+
filterConfig: xe,
|
|
588
|
+
enableFiltering: N,
|
|
589
|
+
grouping: F,
|
|
590
|
+
setGrouping: Se,
|
|
591
|
+
groupConfig: A,
|
|
592
|
+
enableGrouping: T
|
|
593
|
+
}, { toolbarSlots: Ee, filterSlots: ke, groupSlots: Ve, paginationSlots: Le, restSlots: Oe } = Tt(i);
|
|
594
|
+
return /* @__PURE__ */ s(W.Provider, { value: He, children: /* @__PURE__ */ C("div", { "data-slot": "data-table", className: x("w-full space-y-2", ee), children: [
|
|
595
|
+
r,
|
|
596
|
+
Ee,
|
|
597
|
+
ke,
|
|
598
|
+
Ve,
|
|
599
|
+
/* @__PURE__ */ s(
|
|
600
|
+
Nt,
|
|
339
601
|
{
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
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
|
-
]
|
|
602
|
+
table: k,
|
|
603
|
+
columns: e,
|
|
604
|
+
variant: te,
|
|
605
|
+
containerClassName: ne,
|
|
606
|
+
density: Z,
|
|
607
|
+
hasExplicitSize: ze,
|
|
608
|
+
enableSorting: t,
|
|
609
|
+
enableColumnReorder: v,
|
|
610
|
+
enableGrouping: T,
|
|
611
|
+
grouping: F,
|
|
612
|
+
groupConfig: A,
|
|
613
|
+
collapsedGroups: he,
|
|
614
|
+
onToggleGroup: be,
|
|
615
|
+
numericColumns: Me,
|
|
616
|
+
columnLabels: K,
|
|
617
|
+
truncate: oe,
|
|
618
|
+
reorderSensors: Te,
|
|
619
|
+
draggingHeader: Re,
|
|
620
|
+
onDragStart: Ie,
|
|
621
|
+
onDragEnd: Ge
|
|
372
622
|
}
|
|
373
623
|
),
|
|
374
|
-
|
|
375
|
-
|
|
624
|
+
Le,
|
|
625
|
+
Oe
|
|
376
626
|
] }) });
|
|
377
627
|
}
|
|
378
|
-
function
|
|
379
|
-
className:
|
|
380
|
-
children:
|
|
381
|
-
...
|
|
628
|
+
function Rt({
|
|
629
|
+
className: e,
|
|
630
|
+
children: n,
|
|
631
|
+
...r
|
|
382
632
|
}) {
|
|
383
|
-
return /* @__PURE__ */
|
|
633
|
+
return /* @__PURE__ */ s(
|
|
384
634
|
"div",
|
|
385
635
|
{
|
|
386
636
|
"data-slot": "table-toolbar",
|
|
387
|
-
className:
|
|
388
|
-
...
|
|
389
|
-
children:
|
|
637
|
+
className: x("flex items-center justify-end gap-2", e),
|
|
638
|
+
...r,
|
|
639
|
+
children: n
|
|
390
640
|
}
|
|
391
641
|
);
|
|
392
642
|
}
|
|
393
643
|
export {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
644
|
+
Kt as DataTable,
|
|
645
|
+
Rt as TableToolbar,
|
|
646
|
+
mt as applyFilterCondition,
|
|
647
|
+
Ft as useDataTable
|
|
397
648
|
};
|
|
398
649
|
//# sourceMappingURL=data-table.js.map
|