@brightlocal/ui-components 2.25.0 → 2.27.0
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/README.md +4 -2
- package/component-meta.json +3809 -182
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +23 -9
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +95 -87
- package/dist/blocks/progress-screen.cjs +1 -0
- package/dist/blocks/progress-screen.d.ts +109 -0
- package/dist/blocks/progress-screen.d.ts.map +1 -0
- package/dist/blocks/progress-screen.js +339 -0
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +155 -153
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +44 -40
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +28 -28
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +42 -41
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +4 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +161 -161
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +155 -4
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +462 -309
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +31 -5
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +276 -194
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +462 -451
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.js +10 -8
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +5 -2
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +97 -91
- package/dist/list.cjs +1 -1
- package/dist/list.js +65 -63
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +61 -3
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +142 -65
- package/dist/route-progress.cjs +1 -0
- package/dist/route-progress.d.ts +103 -0
- package/dist/route-progress.d.ts.map +1 -0
- package/dist/route-progress.js +106 -0
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +35 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +102 -65
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +11 -15
- package/dist/spinner.cjs +1 -0
- package/dist/spinner.d.ts +57 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/spinner.js +35 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.d.ts.map +1 -1
- package/dist/stepper.js +26 -25
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +6 -2
- package/package.json +15 -6
- package/src/blocks/progress-screen.tsx +481 -0
- package/src/blocks/sidebar.tsx +22 -15
- package/src/components/alert.tsx +68 -33
- package/src/components/breadcrumb.tsx +9 -4
- package/src/components/button.tsx +2 -5
- package/src/components/chip.tsx +4 -3
- package/src/components/combobox.tsx +15 -8
- package/src/components/data-table.tsx +358 -16
- package/src/components/global-layout.tsx +228 -62
- package/src/components/link.tsx +88 -63
- package/src/components/list.tsx +5 -5
- package/src/components/progress.tsx +217 -30
- package/src/components/route-progress.tsx +354 -0
- package/src/components/sheet.tsx +87 -5
- package/src/components/sonner.tsx +3 -12
- package/src/components/spinner.tsx +94 -0
- package/src/components/stepper.tsx +3 -4
- package/src/components/table.tsx +6 -2
- package/src/index.ts +3 -0
- package/dist/browser-entry.d.ts +0 -19
- package/dist/browser-entry.d.ts.map +0 -1
- package/src/browser-entry.ts +0 -99
- package/src/browser-tokens.css +0 -1
package/dist/data-table.js
CHANGED
|
@@ -1,309 +1,387 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useReactTable as
|
|
4
|
-
import { useVirtualizer as
|
|
5
|
-
import { ArrowDown as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Checkbox as
|
|
9
|
-
import { InputGroup as
|
|
10
|
-
import { usePagination as
|
|
11
|
-
import { Skeleton as
|
|
12
|
-
import { Table as
|
|
13
|
-
import { TypographyMuted as
|
|
14
|
-
function
|
|
15
|
-
const [
|
|
16
|
-
|
|
1
|
+
import { jsx as a, jsxs as f, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { useReactTable as re, getExpandedRowModel as se, getFilteredRowModel as de, getSortedRowModel as ce, getPaginationRowModel as ue, getCoreRowModel as ge, flexRender as G } from "@tanstack/react-table";
|
|
4
|
+
import { useVirtualizer as pe } from "@tanstack/react-virtual";
|
|
5
|
+
import { ArrowDown as me, ArrowUp as he, ArrowUpDown as be, ChevronRight as fe, Search as xe, X as Se } from "@brightlocal/icons";
|
|
6
|
+
import { cn as g } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
+
import { Button as V } from "./button.js";
|
|
8
|
+
import { Checkbox as L } from "./checkbox.js";
|
|
9
|
+
import { InputGroup as we, InputGroupAddon as j, InputGroupInput as Ce } from "./input-group.js";
|
|
10
|
+
import { usePagination as ke, Pagination as ve, PaginationContent as Te, PaginationItem as E, PaginationPrevious as Pe, PaginationNext as Re, PaginationEllipsis as ye, PaginationLink as De } from "./pagination.js";
|
|
11
|
+
import { Skeleton as B } from "./skeleton.js";
|
|
12
|
+
import { Table as _, TableBody as U, TableRow as k, TableCell as v, TableHeader as Ne, TableHead as ze } from "./table.js";
|
|
13
|
+
import { TypographyMuted as Ae } from "./typography.js";
|
|
14
|
+
function y(e, n, l) {
|
|
15
|
+
const [t, i] = p.useState(n), o = e !== void 0 ? e : t, r = p.useRef(o);
|
|
16
|
+
p.useEffect(() => {
|
|
17
17
|
r.current = o;
|
|
18
18
|
});
|
|
19
|
-
const
|
|
20
|
-
(
|
|
21
|
-
const u = typeof
|
|
22
|
-
|
|
19
|
+
const s = e !== void 0, d = p.useCallback(
|
|
20
|
+
(c) => {
|
|
21
|
+
const u = typeof c == "function" ? c(r.current) : c;
|
|
22
|
+
s || i(u), l?.(u);
|
|
23
23
|
},
|
|
24
|
-
[
|
|
24
|
+
[s, l]
|
|
25
25
|
);
|
|
26
26
|
return [o, d];
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function sa(e) {
|
|
29
29
|
const {
|
|
30
30
|
columns: n,
|
|
31
31
|
data: l,
|
|
32
|
-
enableSorting:
|
|
32
|
+
enableSorting: t = !0,
|
|
33
33
|
enableGlobalFiltering: i = !1,
|
|
34
34
|
enableRowSelection: o = !1,
|
|
35
35
|
enablePagination: r = !1,
|
|
36
|
-
pageSize:
|
|
36
|
+
pageSize: s = 10,
|
|
37
37
|
manualSorting: d = !1,
|
|
38
|
-
manualFiltering:
|
|
38
|
+
manualFiltering: c = !1,
|
|
39
39
|
manualPagination: u = !1,
|
|
40
40
|
rowCount: h,
|
|
41
|
-
pageCount:
|
|
42
|
-
enableExpanding:
|
|
43
|
-
getSubRows:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
D
|
|
41
|
+
pageCount: m,
|
|
42
|
+
enableExpanding: S = !1,
|
|
43
|
+
getSubRows: x,
|
|
44
|
+
getRowCanExpand: w,
|
|
45
|
+
paginateExpandedRows: P = !1,
|
|
46
|
+
getRowId: b,
|
|
47
|
+
pagination: I,
|
|
48
|
+
onPaginationChange: D,
|
|
49
|
+
sorting: R,
|
|
50
|
+
onSortingChange: N,
|
|
51
|
+
globalFilter: C,
|
|
52
|
+
onGlobalFilterChange: F,
|
|
53
|
+
rowSelection: z,
|
|
54
|
+
onRowSelectionChange: A,
|
|
55
|
+
expanded: M,
|
|
56
|
+
onExpandedChange: $
|
|
57
|
+
} = e, [Q, Y] = y(
|
|
58
|
+
I,
|
|
59
|
+
{ pageIndex: 0, pageSize: s },
|
|
60
|
+
D
|
|
61
|
+
), [Z, ee] = y(
|
|
62
|
+
R,
|
|
61
63
|
[],
|
|
62
|
-
|
|
63
|
-
), [
|
|
64
|
-
|
|
64
|
+
N
|
|
65
|
+
), [ae, te] = y(
|
|
66
|
+
C,
|
|
65
67
|
"",
|
|
66
|
-
|
|
67
|
-
), [
|
|
68
|
-
|
|
68
|
+
F
|
|
69
|
+
), [ne, oe] = y(z, {}, A), [le, ie] = y(
|
|
70
|
+
M,
|
|
69
71
|
{},
|
|
70
|
-
|
|
72
|
+
$
|
|
71
73
|
);
|
|
72
|
-
return
|
|
74
|
+
return re({
|
|
73
75
|
data: l,
|
|
74
76
|
columns: n,
|
|
75
|
-
getCoreRowModel:
|
|
76
|
-
...
|
|
77
|
+
getCoreRowModel: ge(),
|
|
78
|
+
...b && { getRowId: b },
|
|
77
79
|
...(r || u) && {
|
|
78
|
-
onPaginationChange:
|
|
80
|
+
onPaginationChange: Y
|
|
79
81
|
},
|
|
80
82
|
...r && {
|
|
81
83
|
...!u && {
|
|
82
|
-
getPaginationRowModel:
|
|
84
|
+
getPaginationRowModel: ue()
|
|
83
85
|
}
|
|
84
86
|
},
|
|
85
87
|
...u && {
|
|
86
88
|
manualPagination: !0,
|
|
87
89
|
...h != null && { rowCount: h },
|
|
88
|
-
...
|
|
90
|
+
...m != null && { pageCount: m }
|
|
89
91
|
},
|
|
90
|
-
|
|
92
|
+
// Always forward the flag — TanStack defaults `enableSorting` to true,
|
|
93
|
+
// so omitting it would leave `column.getCanSort()` returning true even
|
|
94
|
+
// when the consumer disabled sorting table-wide.
|
|
95
|
+
enableSorting: t,
|
|
96
|
+
...t && {
|
|
91
97
|
...!d && {
|
|
92
|
-
getSortedRowModel:
|
|
98
|
+
getSortedRowModel: ce()
|
|
93
99
|
},
|
|
94
|
-
onSortingChange:
|
|
100
|
+
onSortingChange: ee,
|
|
95
101
|
...d && { manualSorting: !0 }
|
|
96
102
|
},
|
|
97
103
|
...i && {
|
|
98
|
-
...!
|
|
99
|
-
getFilteredRowModel:
|
|
104
|
+
...!c && {
|
|
105
|
+
getFilteredRowModel: de()
|
|
100
106
|
},
|
|
101
|
-
...
|
|
102
|
-
onGlobalFilterChange:
|
|
107
|
+
...c && { manualFiltering: !0 },
|
|
108
|
+
onGlobalFilterChange: te,
|
|
103
109
|
globalFilterFn: "includesString"
|
|
104
110
|
},
|
|
111
|
+
// Always forward — TanStack defaults `enableRowSelection` to true, so
|
|
112
|
+
// omitting it would leave `row.getCanSelect()` returning true and
|
|
113
|
+
// `DataTableSelectRowCheckbox` enabled on tables without selection.
|
|
114
|
+
enableRowSelection: o,
|
|
105
115
|
...o && {
|
|
106
|
-
|
|
107
|
-
onRowSelectionChange: te
|
|
116
|
+
onRowSelectionChange: oe
|
|
108
117
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
// Always forward the flag — TanStack defaults `enableExpanding` to true,
|
|
119
|
+
// so omitting it would leave `row.getCanExpand()` returning true and
|
|
120
|
+
// `DataTableExpandRowButton` interactive on tables without expanding.
|
|
121
|
+
enableExpanding: S,
|
|
122
|
+
...S && {
|
|
123
|
+
getExpandedRowModel: se(),
|
|
124
|
+
onExpandedChange: ie,
|
|
125
|
+
getSubRows: x,
|
|
126
|
+
...w && { getRowCanExpand: w },
|
|
127
|
+
// Forward only with client-side pagination: `paginateExpandedRows:
|
|
128
|
+
// false` defers expansion to the pagination row model, so without one
|
|
129
|
+
// it would suppress row expansion entirely.
|
|
130
|
+
...r && !u && { paginateExpandedRows: P }
|
|
113
131
|
},
|
|
114
132
|
state: {
|
|
115
|
-
pagination:
|
|
116
|
-
sorting:
|
|
117
|
-
globalFilter:
|
|
118
|
-
rowSelection:
|
|
119
|
-
expanded:
|
|
133
|
+
pagination: Q,
|
|
134
|
+
sorting: Z,
|
|
135
|
+
globalFilter: ae,
|
|
136
|
+
rowSelection: ne,
|
|
137
|
+
expanded: le
|
|
120
138
|
}
|
|
121
139
|
});
|
|
122
140
|
}
|
|
123
|
-
function
|
|
141
|
+
function $e({
|
|
124
142
|
table: e,
|
|
125
143
|
dataHook: n,
|
|
126
144
|
trackingEl: l,
|
|
127
|
-
trackingLabel:
|
|
145
|
+
trackingLabel: t,
|
|
128
146
|
isLoading: i = !1,
|
|
129
147
|
skeletonRowCount: o,
|
|
130
148
|
noResultsMessage: r = "No results.",
|
|
131
|
-
stickyHeader:
|
|
149
|
+
stickyHeader: s = !1,
|
|
132
150
|
className: d,
|
|
133
|
-
layout:
|
|
151
|
+
layout: c,
|
|
134
152
|
minWidth: u,
|
|
135
153
|
scrollRegionLabel: h,
|
|
136
|
-
footer:
|
|
154
|
+
footer: m,
|
|
155
|
+
getRowClassName: S,
|
|
156
|
+
renderExpandedContent: x
|
|
137
157
|
}) {
|
|
138
|
-
const
|
|
139
|
-
return /* @__PURE__ */
|
|
158
|
+
const w = e.getVisibleLeafColumns().length, P = o ?? e.getState().pagination.pageSize ?? 10;
|
|
159
|
+
return /* @__PURE__ */ a(
|
|
140
160
|
"div",
|
|
141
161
|
{
|
|
142
162
|
"aria-busy": i || void 0,
|
|
143
|
-
className:
|
|
163
|
+
className: g("border-border overflow-auto rounded-md border", d),
|
|
144
164
|
"data-hook": n,
|
|
145
165
|
"data-slot": "data-table-view",
|
|
146
166
|
"data-tracking-el": l,
|
|
147
|
-
"data-tracking-label":
|
|
148
|
-
children: /* @__PURE__ */
|
|
149
|
-
|
|
167
|
+
"data-tracking-label": t,
|
|
168
|
+
children: /* @__PURE__ */ f(
|
|
169
|
+
_,
|
|
150
170
|
{
|
|
151
171
|
dataHook: `${n}-table`,
|
|
152
|
-
layout:
|
|
172
|
+
layout: c,
|
|
153
173
|
minWidth: u,
|
|
154
174
|
scrollRegionLabel: h,
|
|
155
175
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
|
|
176
|
+
/* @__PURE__ */ a(W, { stickyHeader: s, table: e }),
|
|
177
|
+
/* @__PURE__ */ a(U, { children: i ? /* @__PURE__ */ f(T, { children: [
|
|
178
|
+
/* @__PURE__ */ a(
|
|
179
|
+
X,
|
|
160
180
|
{
|
|
161
|
-
colCount:
|
|
162
|
-
rowCount:
|
|
181
|
+
colCount: w,
|
|
182
|
+
rowCount: P
|
|
163
183
|
}
|
|
164
184
|
),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
] }) : /* @__PURE__ */
|
|
167
|
-
|
|
185
|
+
/* @__PURE__ */ a(k, { className: "sr-only", children: /* @__PURE__ */ a(v, { colSpan: w, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
|
|
186
|
+
] }) : /* @__PURE__ */ a(T, { children: e.getRowModel().rows.length > 0 ? e.getRowModel().rows.map((b) => /* @__PURE__ */ a(
|
|
187
|
+
O,
|
|
188
|
+
{
|
|
189
|
+
columnCount: w,
|
|
190
|
+
getRowClassName: S,
|
|
191
|
+
renderExpandedContent: x,
|
|
192
|
+
row: b
|
|
193
|
+
},
|
|
194
|
+
b.id
|
|
195
|
+
)) : /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(v, { align: "center", colSpan: w, size: "lg", children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: r }) }) }) }) }),
|
|
196
|
+
m
|
|
168
197
|
]
|
|
169
198
|
}
|
|
170
199
|
)
|
|
171
200
|
}
|
|
172
201
|
);
|
|
173
202
|
}
|
|
174
|
-
|
|
175
|
-
function
|
|
203
|
+
$e.displayName = "DataTable";
|
|
204
|
+
function W({
|
|
176
205
|
table: e,
|
|
177
206
|
stickyHeader: n
|
|
178
207
|
}) {
|
|
179
|
-
return /* @__PURE__ */
|
|
180
|
-
const i =
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
-
|
|
208
|
+
return /* @__PURE__ */ a(Ne, { className: g(n && "sticky top-0 z-10"), children: e.getHeaderGroups().map((l) => /* @__PURE__ */ a(k, { children: l.headers.map((t) => {
|
|
209
|
+
const i = t.column.getCanSort() ? t.column.getIsSorted() : !1, o = i === "asc" ? "ascending" : i === "desc" ? "descending" : t.column.getCanSort() ? "none" : void 0, r = t.column.columnDef.meta;
|
|
210
|
+
return /* @__PURE__ */ a(
|
|
211
|
+
ze,
|
|
183
212
|
{
|
|
184
213
|
"aria-sort": o,
|
|
185
|
-
colSpan:
|
|
214
|
+
colSpan: t.colSpan,
|
|
186
215
|
minWidth: r?.minWidth,
|
|
187
216
|
width: r?.width,
|
|
188
|
-
children:
|
|
189
|
-
|
|
190
|
-
|
|
217
|
+
children: t.isPlaceholder ? null : G(
|
|
218
|
+
t.column.columnDef.header,
|
|
219
|
+
t.getContext()
|
|
191
220
|
)
|
|
192
221
|
},
|
|
193
|
-
|
|
222
|
+
t.id
|
|
194
223
|
);
|
|
195
224
|
}) }, l.id)) });
|
|
196
225
|
}
|
|
197
|
-
function
|
|
198
|
-
|
|
226
|
+
function O({
|
|
227
|
+
row: e,
|
|
228
|
+
columnCount: n,
|
|
229
|
+
getRowClassName: l,
|
|
230
|
+
renderExpandedContent: t
|
|
231
|
+
}) {
|
|
232
|
+
const i = e.getCanExpand(), o = e.getIsExpanded(), r = t && i && o ? t(e) : null;
|
|
233
|
+
return /* @__PURE__ */ f(T, { children: [
|
|
234
|
+
/* @__PURE__ */ a(
|
|
235
|
+
k,
|
|
236
|
+
{
|
|
237
|
+
className: g(
|
|
238
|
+
// Rows have no hover of their own — the chevron/action buttons are
|
|
239
|
+
// the interactive elements. Ghost buttons (the only bg-transparent
|
|
240
|
+
// variant) get bg-secondary on hover because their default
|
|
241
|
+
// hover:bg-accent is invisible on bg-muted rows (accent equals
|
|
242
|
+
// muted in light mode). Scoped to .bg-transparent so variant
|
|
243
|
+
// buttons in cells (primary, destructive, …) keep their own hover.
|
|
244
|
+
"[&_[data-slot=button].bg-transparent:hover]:bg-secondary",
|
|
245
|
+
// Surfaces are mutually exclusive: an expanded parent shares the
|
|
246
|
+
// table head's bg-muted at ANY depth; other expanded-zone rows
|
|
247
|
+
// (sub-rows) get the lighter accent wash.
|
|
248
|
+
i && o ? "bg-muted" : e.depth > 0 && "bg-accent/50",
|
|
249
|
+
l?.(e)
|
|
250
|
+
),
|
|
251
|
+
"data-depth": e.depth,
|
|
252
|
+
"data-expanded": i ? String(o) : void 0,
|
|
253
|
+
"data-state": e.getIsSelected() ? "selected" : void 0,
|
|
254
|
+
children: e.getVisibleCells().map((s) => /* @__PURE__ */ a(v, { children: G(s.column.columnDef.cell, s.getContext()) }, s.id))
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
r != null && // No data-depth here: panels are not data rows, and sharing the
|
|
258
|
+
// parent's depth would break depth-based selectors and counts.
|
|
259
|
+
/* @__PURE__ */ a(
|
|
260
|
+
k,
|
|
261
|
+
{
|
|
262
|
+
className: "bg-accent/50 [&_[data-slot=button].bg-transparent:hover]:bg-secondary",
|
|
263
|
+
"data-slot": "data-table-expanded-row",
|
|
264
|
+
children: /* @__PURE__ */ a(v, { colSpan: n, children: r })
|
|
265
|
+
}
|
|
266
|
+
)
|
|
267
|
+
] });
|
|
199
268
|
}
|
|
200
|
-
function
|
|
269
|
+
function X({
|
|
201
270
|
rowCount: e,
|
|
202
271
|
colCount: n
|
|
203
272
|
}) {
|
|
204
|
-
return /* @__PURE__ */
|
|
273
|
+
return /* @__PURE__ */ a(T, { children: Array.from({ length: e }).map((l, t) => /* @__PURE__ */ a(k, { children: Array.from({ length: n }).map((i, o) => /* @__PURE__ */ a(v, { children: /* @__PURE__ */ a(B, { className: "h-4 w-full" }) }, `skeleton-${t}-${o}`)) }, `skeleton-${t}`)) });
|
|
205
274
|
}
|
|
206
|
-
function
|
|
275
|
+
function Ee({
|
|
207
276
|
table: e,
|
|
208
277
|
dataHook: n,
|
|
209
278
|
trackingEl: l,
|
|
210
|
-
trackingLabel:
|
|
279
|
+
trackingLabel: t,
|
|
211
280
|
isLoading: i = !1,
|
|
212
281
|
skeletonRowCount: o,
|
|
213
282
|
noResultsMessage: r = "No results.",
|
|
214
|
-
stickyHeader:
|
|
283
|
+
stickyHeader: s = !1,
|
|
215
284
|
className: d,
|
|
216
|
-
layout:
|
|
285
|
+
layout: c,
|
|
217
286
|
minWidth: u,
|
|
218
287
|
scrollRegionLabel: h,
|
|
219
|
-
footer:
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
288
|
+
footer: m,
|
|
289
|
+
getRowClassName: S,
|
|
290
|
+
height: x,
|
|
291
|
+
estimateSize: w = 48,
|
|
292
|
+
overscan: P = 5
|
|
223
293
|
}) {
|
|
224
|
-
const
|
|
225
|
-
count:
|
|
294
|
+
const b = e.getVisibleLeafColumns().length, I = o ?? e.getState().pagination.pageSize ?? 10, D = p.useRef(null), R = e.getRowModel().rows, N = pe({
|
|
295
|
+
count: R.length,
|
|
226
296
|
getScrollElement: () => D.current,
|
|
227
|
-
estimateSize: () =>
|
|
228
|
-
overscan:
|
|
229
|
-
}),
|
|
230
|
-
return /* @__PURE__ */
|
|
297
|
+
estimateSize: () => w,
|
|
298
|
+
overscan: P
|
|
299
|
+
}), C = N.getVirtualItems(), F = N.getTotalSize(), z = C.length > 0 ? C[0].start : 0, A = C.length > 0 ? F - C[C.length - 1].end : 0;
|
|
300
|
+
return /* @__PURE__ */ a(
|
|
231
301
|
"div",
|
|
232
302
|
{
|
|
233
303
|
ref: D,
|
|
234
304
|
"aria-busy": i || void 0,
|
|
235
|
-
className:
|
|
305
|
+
className: g("border-border overflow-auto rounded-md border", d),
|
|
236
306
|
"data-hook": n,
|
|
237
307
|
"data-slot": "data-table-view",
|
|
238
308
|
"data-tracking-el": l,
|
|
239
|
-
"data-tracking-label":
|
|
240
|
-
style:
|
|
241
|
-
children: /* @__PURE__ */
|
|
242
|
-
|
|
309
|
+
"data-tracking-label": t,
|
|
310
|
+
style: x != null ? { height: x } : void 0,
|
|
311
|
+
children: /* @__PURE__ */ f(
|
|
312
|
+
_,
|
|
243
313
|
{
|
|
244
314
|
dataHook: `${n}-table`,
|
|
245
|
-
layout:
|
|
315
|
+
layout: c,
|
|
246
316
|
minWidth: u,
|
|
247
317
|
scrollRegionLabel: h,
|
|
248
318
|
children: [
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
|
|
319
|
+
/* @__PURE__ */ a(W, { stickyHeader: s, table: e }),
|
|
320
|
+
/* @__PURE__ */ a(U, { children: i ? /* @__PURE__ */ f(T, { children: [
|
|
321
|
+
/* @__PURE__ */ a(
|
|
322
|
+
X,
|
|
253
323
|
{
|
|
254
|
-
colCount:
|
|
255
|
-
rowCount:
|
|
324
|
+
colCount: b,
|
|
325
|
+
rowCount: I
|
|
256
326
|
}
|
|
257
327
|
),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
] }) :
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
const
|
|
263
|
-
return /* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ a(k, { className: "sr-only", children: /* @__PURE__ */ a(v, { colSpan: b, children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: "Loading data…" }) }) })
|
|
329
|
+
] }) : R.length > 0 ? /* @__PURE__ */ f(T, { children: [
|
|
330
|
+
z > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: b, style: { height: z } }) }),
|
|
331
|
+
C.map((M) => {
|
|
332
|
+
const $ = R[M.index];
|
|
333
|
+
return /* @__PURE__ */ a(
|
|
334
|
+
O,
|
|
335
|
+
{
|
|
336
|
+
columnCount: b,
|
|
337
|
+
getRowClassName: S,
|
|
338
|
+
row: $
|
|
339
|
+
},
|
|
340
|
+
$.id
|
|
341
|
+
);
|
|
264
342
|
}),
|
|
265
|
-
|
|
266
|
-
] }) : /* @__PURE__ */
|
|
267
|
-
|
|
343
|
+
A > 0 && /* @__PURE__ */ a("tr", { "aria-hidden": "true", children: /* @__PURE__ */ a("td", { colSpan: b, style: { height: A } }) })
|
|
344
|
+
] }) : /* @__PURE__ */ a(k, { children: /* @__PURE__ */ a(v, { align: "center", colSpan: b, size: "lg", children: /* @__PURE__ */ a("div", { "aria-live": "polite", role: "status", children: r }) }) }) }),
|
|
345
|
+
m
|
|
268
346
|
]
|
|
269
347
|
}
|
|
270
348
|
)
|
|
271
349
|
}
|
|
272
350
|
);
|
|
273
351
|
}
|
|
274
|
-
|
|
275
|
-
function
|
|
352
|
+
Ee.displayName = "VirtualizedDataTable";
|
|
353
|
+
function Ie({
|
|
276
354
|
column: e,
|
|
277
355
|
title: n,
|
|
278
356
|
className: l,
|
|
279
|
-
dataHook:
|
|
357
|
+
dataHook: t,
|
|
280
358
|
trackingEl: i,
|
|
281
359
|
trackingLabel: o,
|
|
282
360
|
align: r = "left",
|
|
283
|
-
getSortLabel:
|
|
361
|
+
getSortLabel: s
|
|
284
362
|
}) {
|
|
285
363
|
if (!e.getCanSort())
|
|
286
|
-
return /* @__PURE__ */
|
|
364
|
+
return /* @__PURE__ */ a(
|
|
287
365
|
"div",
|
|
288
366
|
{
|
|
289
|
-
className:
|
|
367
|
+
className: g(
|
|
290
368
|
"text-muted-foreground text-left text-sm leading-normal font-medium",
|
|
291
369
|
r === "right" && "text-right",
|
|
292
370
|
r === "center" && "text-center",
|
|
293
371
|
l
|
|
294
372
|
),
|
|
295
|
-
"data-hook":
|
|
373
|
+
"data-hook": t,
|
|
296
374
|
"data-slot": "data-table-column-header",
|
|
297
375
|
"data-tracking-el": i,
|
|
298
376
|
"data-tracking-label": o,
|
|
299
377
|
children: n
|
|
300
378
|
}
|
|
301
379
|
);
|
|
302
|
-
const d = e.getIsSorted(),
|
|
303
|
-
return /* @__PURE__ */
|
|
380
|
+
const d = e.getIsSorted(), c = s ? s(n, d) : d === "desc" ? `Sort by ${n}, currently descending` : d === "asc" ? `Sort by ${n}, currently ascending` : `Sort by ${n}`;
|
|
381
|
+
return /* @__PURE__ */ a(
|
|
304
382
|
"div",
|
|
305
383
|
{
|
|
306
|
-
className:
|
|
384
|
+
className: g(
|
|
307
385
|
"flex items-center",
|
|
308
386
|
r === "right" && "justify-end",
|
|
309
387
|
r === "center" && "justify-center",
|
|
@@ -312,23 +390,23 @@ function Ae({
|
|
|
312
390
|
"data-slot": "data-table-column-header",
|
|
313
391
|
"data-tracking-el": i,
|
|
314
392
|
"data-tracking-label": o,
|
|
315
|
-
children: /* @__PURE__ */
|
|
316
|
-
|
|
393
|
+
children: /* @__PURE__ */ f(
|
|
394
|
+
V,
|
|
317
395
|
{
|
|
318
|
-
"aria-label":
|
|
396
|
+
"aria-label": c,
|
|
319
397
|
className: "text-muted-foreground h-auto p-0 text-sm font-medium",
|
|
320
|
-
dataHook:
|
|
398
|
+
dataHook: t || `column-header-${e.id}`,
|
|
321
399
|
size: "sm",
|
|
322
400
|
variant: "ghost",
|
|
323
401
|
onClick: () => e.toggleSorting(d === "asc"),
|
|
324
402
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", children: n }),
|
|
404
|
+
/* @__PURE__ */ a(
|
|
327
405
|
"span",
|
|
328
406
|
{
|
|
329
407
|
"aria-hidden": "true",
|
|
330
408
|
className: "flex size-3 items-center justify-center",
|
|
331
|
-
children: d === "desc" ? /* @__PURE__ */
|
|
409
|
+
children: d === "desc" ? /* @__PURE__ */ a(me, { size: 12 }) : d === "asc" ? /* @__PURE__ */ a(he, { size: 12 }) : /* @__PURE__ */ a(be, { size: 12 })
|
|
332
410
|
}
|
|
333
411
|
)
|
|
334
412
|
]
|
|
@@ -337,162 +415,162 @@ function Ae({
|
|
|
337
415
|
}
|
|
338
416
|
);
|
|
339
417
|
}
|
|
340
|
-
|
|
341
|
-
function
|
|
418
|
+
Ie.displayName = "DataTableColumnHeader";
|
|
419
|
+
function Fe({
|
|
342
420
|
table: e,
|
|
343
421
|
ariaLabel: n,
|
|
344
422
|
placeholder: l,
|
|
345
|
-
clearSearchAriaLabel:
|
|
423
|
+
clearSearchAriaLabel: t,
|
|
346
424
|
...i
|
|
347
425
|
}) {
|
|
348
|
-
const o = e.getState().globalFilter ?? "", r = (
|
|
349
|
-
e.setGlobalFilter(
|
|
426
|
+
const o = e.getState().globalFilter ?? "", r = (s) => {
|
|
427
|
+
e.setGlobalFilter(s);
|
|
350
428
|
};
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
|
|
429
|
+
return /* @__PURE__ */ f(we, { "data-slot": "data-table-search", ...i, children: [
|
|
430
|
+
/* @__PURE__ */ a(j, { className: "pl-3", children: /* @__PURE__ */ a(xe, {}) }),
|
|
431
|
+
/* @__PURE__ */ a(
|
|
432
|
+
Ce,
|
|
355
433
|
{
|
|
356
434
|
"aria-label": n ?? "Search table",
|
|
357
435
|
placeholder: l ?? "Search...",
|
|
358
436
|
type: "text",
|
|
359
437
|
value: o,
|
|
360
|
-
onChange: (
|
|
438
|
+
onChange: (s) => r(s.target.value)
|
|
361
439
|
}
|
|
362
440
|
),
|
|
363
|
-
o && /* @__PURE__ */
|
|
364
|
-
|
|
441
|
+
o && /* @__PURE__ */ a(j, { className: "pr-1", children: /* @__PURE__ */ a(
|
|
442
|
+
V,
|
|
365
443
|
{
|
|
366
|
-
"aria-label":
|
|
444
|
+
"aria-label": t ?? "Clear search",
|
|
367
445
|
className: "h-auto p-1",
|
|
368
446
|
"data-slot": "data-table-search-clear",
|
|
369
447
|
dataHook: `${i.dataHook}-clear`,
|
|
370
448
|
variant: "ghost",
|
|
371
449
|
onClick: () => r(""),
|
|
372
|
-
children: /* @__PURE__ */
|
|
450
|
+
children: /* @__PURE__ */ a(Se, { size: 14 })
|
|
373
451
|
}
|
|
374
452
|
) })
|
|
375
453
|
] });
|
|
376
454
|
}
|
|
377
|
-
|
|
378
|
-
function
|
|
379
|
-
const { pageIndex: n, pageSize: l } = e.getState().pagination,
|
|
380
|
-
(
|
|
455
|
+
Fe.displayName = "DataTableSearch";
|
|
456
|
+
function Me(e) {
|
|
457
|
+
const { pageIndex: n, pageSize: l } = e.getState().pagination, t = e.getRowCount(), i = e.getPageCount(), o = e.getCanPreviousPage(), r = e.getCanNextPage(), s = n + 1, d = t === 0 ? 0 : n * l + 1, c = Math.min(s * l, t), u = p.useCallback(
|
|
458
|
+
(x) => e.setPageIndex(x - 1),
|
|
381
459
|
[e]
|
|
382
|
-
), h =
|
|
383
|
-
(
|
|
460
|
+
), h = p.useCallback(() => e.nextPage(), [e]), m = p.useCallback(() => e.previousPage(), [e]), S = p.useCallback(
|
|
461
|
+
(x) => e.setPageSize(x),
|
|
384
462
|
[e]
|
|
385
463
|
);
|
|
386
|
-
return
|
|
464
|
+
return p.useMemo(
|
|
387
465
|
() => ({
|
|
388
466
|
pageIndex: n,
|
|
389
467
|
pageSize: l,
|
|
390
|
-
totalRows:
|
|
468
|
+
totalRows: t,
|
|
391
469
|
totalPages: i,
|
|
392
470
|
startRow: d,
|
|
393
|
-
endRow:
|
|
394
|
-
currentPage:
|
|
471
|
+
endRow: c,
|
|
472
|
+
currentPage: s,
|
|
395
473
|
canPrev: o,
|
|
396
474
|
canNext: r,
|
|
397
475
|
goToPage: u,
|
|
398
476
|
nextPage: h,
|
|
399
|
-
previousPage:
|
|
400
|
-
setPageSize:
|
|
477
|
+
previousPage: m,
|
|
478
|
+
setPageSize: S
|
|
401
479
|
}),
|
|
402
480
|
[
|
|
403
481
|
n,
|
|
404
482
|
l,
|
|
405
|
-
|
|
483
|
+
t,
|
|
406
484
|
i,
|
|
407
485
|
d,
|
|
408
|
-
s,
|
|
409
486
|
c,
|
|
487
|
+
s,
|
|
410
488
|
o,
|
|
411
489
|
r,
|
|
412
490
|
u,
|
|
413
491
|
h,
|
|
414
|
-
|
|
415
|
-
|
|
492
|
+
m,
|
|
493
|
+
S
|
|
416
494
|
]
|
|
417
495
|
);
|
|
418
496
|
}
|
|
419
|
-
const
|
|
420
|
-
function
|
|
421
|
-
const e =
|
|
497
|
+
const H = p.createContext(null);
|
|
498
|
+
function q() {
|
|
499
|
+
const e = p.useContext(H);
|
|
422
500
|
if (!e)
|
|
423
501
|
throw new Error(
|
|
424
502
|
"DataTablePagination sub-components must be used within <DataTablePagination>"
|
|
425
503
|
);
|
|
426
504
|
return e;
|
|
427
505
|
}
|
|
428
|
-
function
|
|
506
|
+
function Be({
|
|
429
507
|
renderText: e,
|
|
430
508
|
className: n
|
|
431
509
|
}) {
|
|
432
|
-
const { info: l } =
|
|
433
|
-
return d == null ? null : /* @__PURE__ */
|
|
510
|
+
const { info: l } = q(), { startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: s } = l, d = e ? e({ startRow: t, endRow: i, totalRows: o, pageIndex: r, pageSize: s }) : o === 0 ? null : `${t}-${i} of ${o}`;
|
|
511
|
+
return d == null ? null : /* @__PURE__ */ a(
|
|
434
512
|
"span",
|
|
435
513
|
{
|
|
436
|
-
className:
|
|
514
|
+
className: g("text-muted-foreground text-sm", n),
|
|
437
515
|
"data-slot": "data-table-pagination-row-count",
|
|
438
516
|
children: d
|
|
439
517
|
}
|
|
440
518
|
);
|
|
441
519
|
}
|
|
442
|
-
|
|
443
|
-
function
|
|
520
|
+
Be.displayName = "DataTablePaginationRowCount";
|
|
521
|
+
function J({
|
|
444
522
|
ariaLabel: e = "Table pagination",
|
|
445
523
|
dataHook: n,
|
|
446
524
|
className: l
|
|
447
525
|
}) {
|
|
448
|
-
const { info:
|
|
449
|
-
page:
|
|
450
|
-
totalPages:
|
|
526
|
+
const { info: t } = q(), i = ke({
|
|
527
|
+
page: t.currentPage,
|
|
528
|
+
totalPages: t.totalPages
|
|
451
529
|
});
|
|
452
|
-
return /* @__PURE__ */
|
|
453
|
-
|
|
530
|
+
return /* @__PURE__ */ a(
|
|
531
|
+
ve,
|
|
454
532
|
{
|
|
455
533
|
ariaLabel: e,
|
|
456
|
-
className:
|
|
534
|
+
className: g("mx-0 w-auto justify-end", l),
|
|
457
535
|
dataHook: n ?? "pagination-nav",
|
|
458
|
-
children: /* @__PURE__ */
|
|
459
|
-
|
|
536
|
+
children: /* @__PURE__ */ a(Te, { children: i.map((o, r) => o === "previous" ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(
|
|
537
|
+
Pe,
|
|
460
538
|
{
|
|
461
|
-
disabled: !
|
|
462
|
-
onClick: () =>
|
|
539
|
+
disabled: !t.canPrev,
|
|
540
|
+
onClick: () => t.previousPage()
|
|
463
541
|
}
|
|
464
|
-
) }, "previous") : o === "next" ? /* @__PURE__ */
|
|
465
|
-
|
|
542
|
+
) }, "previous") : o === "next" ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(
|
|
543
|
+
Re,
|
|
466
544
|
{
|
|
467
|
-
disabled: !
|
|
468
|
-
onClick: () =>
|
|
545
|
+
disabled: !t.canNext,
|
|
546
|
+
onClick: () => t.nextPage()
|
|
469
547
|
}
|
|
470
|
-
) }, "next") : o === "ellipsis" ? /* @__PURE__ */
|
|
471
|
-
|
|
548
|
+
) }, "next") : o === "ellipsis" ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(ye, {}) }, `ellipsis-${r}`) : /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(
|
|
549
|
+
De,
|
|
472
550
|
{
|
|
473
|
-
isActive: o ===
|
|
551
|
+
isActive: o === t.currentPage,
|
|
474
552
|
page: o,
|
|
475
|
-
onClick: () =>
|
|
553
|
+
onClick: () => t.goToPage(o)
|
|
476
554
|
}
|
|
477
555
|
) }, o)) })
|
|
478
556
|
}
|
|
479
557
|
);
|
|
480
558
|
}
|
|
481
|
-
|
|
482
|
-
function
|
|
559
|
+
J.displayName = "DataTablePaginationNav";
|
|
560
|
+
function He({
|
|
483
561
|
table: e,
|
|
484
562
|
dataHook: n,
|
|
485
563
|
showRowCount: l = !0,
|
|
486
|
-
renderRowCount:
|
|
564
|
+
renderRowCount: t,
|
|
487
565
|
trackingEl: i,
|
|
488
566
|
trackingLabel: o,
|
|
489
567
|
className: r,
|
|
490
|
-
ariaLabel:
|
|
568
|
+
ariaLabel: s = "Table pagination",
|
|
491
569
|
children: d
|
|
492
570
|
}) {
|
|
493
|
-
const
|
|
494
|
-
() => ({ info:
|
|
495
|
-
[
|
|
571
|
+
const c = Me(e), u = p.useMemo(
|
|
572
|
+
() => ({ info: c }),
|
|
573
|
+
[c]
|
|
496
574
|
), h = {
|
|
497
575
|
"data-hook": n,
|
|
498
576
|
"data-slot": "data-table-pagination",
|
|
@@ -500,36 +578,36 @@ function Me({
|
|
|
500
578
|
"data-tracking-label": o
|
|
501
579
|
};
|
|
502
580
|
if (d)
|
|
503
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ a(H.Provider, { value: u, children: /* @__PURE__ */ a(
|
|
504
582
|
"div",
|
|
505
583
|
{
|
|
506
|
-
className:
|
|
584
|
+
className: g("flex w-full items-center gap-4", r),
|
|
507
585
|
...h,
|
|
508
586
|
children: d
|
|
509
587
|
}
|
|
510
588
|
) });
|
|
511
|
-
const
|
|
512
|
-
startRow:
|
|
513
|
-
endRow:
|
|
514
|
-
totalRows:
|
|
515
|
-
pageIndex:
|
|
516
|
-
pageSize:
|
|
517
|
-
}) :
|
|
518
|
-
return /* @__PURE__ */
|
|
589
|
+
const m = !l || t === null ? null : t ? t({
|
|
590
|
+
startRow: c.startRow,
|
|
591
|
+
endRow: c.endRow,
|
|
592
|
+
totalRows: c.totalRows,
|
|
593
|
+
pageIndex: c.pageIndex,
|
|
594
|
+
pageSize: c.pageSize
|
|
595
|
+
}) : c.totalRows === 0 ? null : `${c.startRow}-${c.endRow} of ${c.totalRows}`;
|
|
596
|
+
return /* @__PURE__ */ a(H.Provider, { value: u, children: /* @__PURE__ */ f(
|
|
519
597
|
"div",
|
|
520
598
|
{
|
|
521
|
-
className:
|
|
599
|
+
className: g(
|
|
522
600
|
"flex w-full items-center gap-4",
|
|
523
|
-
|
|
601
|
+
m != null ? "justify-between" : "justify-end",
|
|
524
602
|
r
|
|
525
603
|
),
|
|
526
604
|
...h,
|
|
527
605
|
children: [
|
|
528
|
-
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
-
|
|
606
|
+
m != null && /* @__PURE__ */ a("span", { className: "text-muted-foreground text-sm", children: m }),
|
|
607
|
+
/* @__PURE__ */ a(
|
|
608
|
+
J,
|
|
531
609
|
{
|
|
532
|
-
ariaLabel:
|
|
610
|
+
ariaLabel: s,
|
|
533
611
|
dataHook: `${n}-nav`
|
|
534
612
|
}
|
|
535
613
|
)
|
|
@@ -537,125 +615,198 @@ function Me({
|
|
|
537
615
|
}
|
|
538
616
|
) });
|
|
539
617
|
}
|
|
540
|
-
|
|
541
|
-
function
|
|
618
|
+
He.displayName = "DataTablePagination";
|
|
619
|
+
function Ve({
|
|
542
620
|
table: e,
|
|
543
621
|
dataHook: n,
|
|
544
622
|
trackingEl: l,
|
|
545
|
-
trackingLabel:
|
|
623
|
+
trackingLabel: t,
|
|
546
624
|
selectAllAriaLabel: i
|
|
547
625
|
}) {
|
|
548
|
-
return /* @__PURE__ */
|
|
549
|
-
|
|
626
|
+
return /* @__PURE__ */ a(
|
|
627
|
+
L,
|
|
550
628
|
{
|
|
551
629
|
"aria-label": i ?? "Select all",
|
|
552
630
|
checked: e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected() && "indeterminate",
|
|
553
631
|
dataHook: n || "select-all-checkbox",
|
|
554
632
|
trackingEl: l,
|
|
555
|
-
trackingLabel:
|
|
633
|
+
trackingLabel: t,
|
|
556
634
|
onCheckedChange: (o) => e.toggleAllPageRowsSelected(!!o)
|
|
557
635
|
}
|
|
558
636
|
);
|
|
559
637
|
}
|
|
560
|
-
|
|
561
|
-
function
|
|
638
|
+
Ve.displayName = "DataTableSelectAllCheckbox";
|
|
639
|
+
function je({
|
|
562
640
|
row: e,
|
|
563
641
|
dataHook: n,
|
|
564
642
|
trackingEl: l,
|
|
565
|
-
trackingLabel:
|
|
643
|
+
trackingLabel: t,
|
|
566
644
|
selectRowAriaLabel: i
|
|
567
645
|
}) {
|
|
568
|
-
return /* @__PURE__ */
|
|
569
|
-
|
|
646
|
+
return /* @__PURE__ */ a(
|
|
647
|
+
L,
|
|
570
648
|
{
|
|
571
649
|
"aria-label": i ?? "Select row",
|
|
572
650
|
checked: e.getIsSelected(),
|
|
573
651
|
dataHook: n || `select-row-${e.id}`,
|
|
574
652
|
disabled: !e.getCanSelect(),
|
|
575
653
|
trackingEl: l,
|
|
576
|
-
trackingLabel:
|
|
654
|
+
trackingLabel: t,
|
|
577
655
|
onCheckedChange: (o) => e.toggleSelected(!!o)
|
|
578
656
|
}
|
|
579
657
|
);
|
|
580
658
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
659
|
+
je.displayName = "DataTableSelectRowCheckbox";
|
|
660
|
+
function Ge({
|
|
661
|
+
row: e,
|
|
662
|
+
rowName: n,
|
|
663
|
+
dataHook: l,
|
|
664
|
+
trackingEl: t,
|
|
665
|
+
trackingLabel: i,
|
|
666
|
+
expandLabel: o,
|
|
667
|
+
collapseLabel: r,
|
|
668
|
+
className: s
|
|
669
|
+
}) {
|
|
670
|
+
if (!e.getCanExpand())
|
|
671
|
+
return /* @__PURE__ */ a(
|
|
672
|
+
"span",
|
|
673
|
+
{
|
|
674
|
+
"aria-hidden": "true",
|
|
675
|
+
className: g("inline-block size-9", s),
|
|
676
|
+
"data-slot": "data-table-expand-row-spacer"
|
|
677
|
+
}
|
|
678
|
+
);
|
|
679
|
+
const d = e.getIsExpanded(), c = d ? r : o;
|
|
680
|
+
let u;
|
|
681
|
+
return c && (n !== void 0 || !c.includes("{name}")) ? u = c.replaceAll("{name}", n ?? "") : n !== void 0 ? u = d ? `Collapse details for ${n}` : `Expand details for ${n}` : u = d ? "Collapse row" : "Expand row", /* @__PURE__ */ a(
|
|
682
|
+
V,
|
|
683
|
+
{
|
|
684
|
+
iconOnly: !0,
|
|
685
|
+
"aria-expanded": d,
|
|
686
|
+
"aria-label": u,
|
|
687
|
+
className: s,
|
|
688
|
+
"data-state": d ? "open" : "closed",
|
|
689
|
+
dataHook: l || `expand-row-${e.id}`,
|
|
690
|
+
size: "sm",
|
|
691
|
+
trackingEl: t,
|
|
692
|
+
trackingLabel: i,
|
|
693
|
+
variant: "ghost",
|
|
694
|
+
onClick: e.getToggleExpandedHandler(),
|
|
695
|
+
children: /* @__PURE__ */ a(
|
|
696
|
+
fe,
|
|
697
|
+
{
|
|
698
|
+
"aria-hidden": "true",
|
|
699
|
+
className: g(
|
|
700
|
+
"duration-base transition-transform ease-in-out",
|
|
701
|
+
d && "rotate-90"
|
|
702
|
+
)
|
|
703
|
+
}
|
|
704
|
+
)
|
|
705
|
+
}
|
|
706
|
+
);
|
|
707
|
+
}
|
|
708
|
+
Ge.displayName = "DataTableExpandRowButton";
|
|
709
|
+
function Le({
|
|
710
|
+
fields: e = 3,
|
|
711
|
+
loadingLabel: n,
|
|
712
|
+
dataHook: l,
|
|
713
|
+
className: t
|
|
714
|
+
}) {
|
|
715
|
+
return /* @__PURE__ */ f(
|
|
716
|
+
"div",
|
|
717
|
+
{
|
|
718
|
+
className: g("relative flex flex-col gap-2 py-1", t),
|
|
719
|
+
"data-hook": l || "data-table-expanded-skeleton",
|
|
720
|
+
"data-slot": "data-table-expanded-skeleton",
|
|
721
|
+
role: "status",
|
|
722
|
+
children: [
|
|
723
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: n ?? "Loading details" }),
|
|
724
|
+
Array.from({ length: e }, (i, o) => /* @__PURE__ */ f("div", { "aria-hidden": "true", className: "flex items-center gap-4", children: [
|
|
725
|
+
/* @__PURE__ */ a(B, { className: "h-4 w-24 shrink-0" }),
|
|
726
|
+
/* @__PURE__ */ a(B, { className: "h-4 w-48 max-w-full" })
|
|
727
|
+
] }, o))
|
|
728
|
+
]
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
Le.displayName = "DataTableExpandedSkeleton";
|
|
733
|
+
const K = p.createContext(null);
|
|
734
|
+
function _e() {
|
|
735
|
+
const e = p.useContext(K);
|
|
585
736
|
if (!e)
|
|
586
737
|
throw new Error(
|
|
587
738
|
"DataTableBulkActions components must be used within <DataTableBulkActions>"
|
|
588
739
|
);
|
|
589
740
|
return e;
|
|
590
741
|
}
|
|
591
|
-
function
|
|
742
|
+
function Ue({
|
|
592
743
|
table: e,
|
|
593
744
|
dataHook: n,
|
|
594
745
|
trackingEl: l,
|
|
595
|
-
trackingLabel:
|
|
746
|
+
trackingLabel: t,
|
|
596
747
|
className: i,
|
|
597
748
|
children: o
|
|
598
749
|
}) {
|
|
599
|
-
const r = e.getFilteredSelectedRowModel().rows.length,
|
|
600
|
-
() => ({ selectedCount: r, totalCount:
|
|
601
|
-
[r,
|
|
750
|
+
const r = e.getFilteredSelectedRowModel().rows.length, s = e.getRowCount(), d = p.useMemo(
|
|
751
|
+
() => ({ selectedCount: r, totalCount: s }),
|
|
752
|
+
[r, s]
|
|
602
753
|
);
|
|
603
|
-
return r === 0 ? null : /* @__PURE__ */
|
|
754
|
+
return r === 0 ? null : /* @__PURE__ */ a(K.Provider, { value: d, children: /* @__PURE__ */ a(
|
|
604
755
|
"div",
|
|
605
756
|
{
|
|
606
|
-
className:
|
|
757
|
+
className: g("flex items-center gap-2.5", i),
|
|
607
758
|
"data-hook": n,
|
|
608
759
|
"data-slot": "data-table-bulk-actions",
|
|
609
760
|
"data-tracking-el": l ?? "data-table-bulk-actions",
|
|
610
|
-
"data-tracking-label":
|
|
761
|
+
"data-tracking-label": t,
|
|
611
762
|
children: o
|
|
612
763
|
}
|
|
613
764
|
) });
|
|
614
765
|
}
|
|
615
|
-
|
|
616
|
-
function
|
|
766
|
+
Ue.displayName = "DataTableBulkActions";
|
|
767
|
+
function We({
|
|
617
768
|
dataHook: e = "data-table-bulk-actions-summary",
|
|
618
769
|
className: n,
|
|
619
770
|
children: l
|
|
620
771
|
}) {
|
|
621
|
-
const { selectedCount:
|
|
772
|
+
const { selectedCount: t, totalCount: i } = _e();
|
|
622
773
|
let o;
|
|
623
|
-
return typeof l == "function" ? o = l({ selectedCount:
|
|
624
|
-
|
|
774
|
+
return typeof l == "function" ? o = l({ selectedCount: t, totalCount: i }) : l != null ? o = l : o = `${t} of ${i} row(s) selected.`, /* @__PURE__ */ a(
|
|
775
|
+
Ae,
|
|
625
776
|
{
|
|
626
777
|
asChild: !0,
|
|
627
|
-
className:
|
|
778
|
+
className: g("min-w-0", n),
|
|
628
779
|
dataHook: e,
|
|
629
|
-
children: /* @__PURE__ */
|
|
780
|
+
children: /* @__PURE__ */ a("span", { "data-slot": "data-table-bulk-actions-summary", role: "status", children: o })
|
|
630
781
|
}
|
|
631
782
|
);
|
|
632
783
|
}
|
|
633
|
-
|
|
634
|
-
function
|
|
784
|
+
We.displayName = "DataTableBulkActionsSummary";
|
|
785
|
+
function Oe({
|
|
635
786
|
dataHook: e = "data-table-bulk-actions-actions",
|
|
636
787
|
className: n,
|
|
637
788
|
children: l
|
|
638
789
|
}) {
|
|
639
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ a(
|
|
640
791
|
"div",
|
|
641
792
|
{
|
|
642
|
-
className:
|
|
793
|
+
className: g("flex shrink-0 items-center gap-2", n),
|
|
643
794
|
"data-hook": e,
|
|
644
795
|
"data-slot": "data-table-bulk-actions-actions",
|
|
645
796
|
children: l
|
|
646
797
|
}
|
|
647
798
|
);
|
|
648
799
|
}
|
|
649
|
-
|
|
650
|
-
function
|
|
800
|
+
Oe.displayName = "DataTableBulkActionsActions";
|
|
801
|
+
function Xe({
|
|
651
802
|
dataHook: e,
|
|
652
803
|
className: n,
|
|
653
804
|
children: l
|
|
654
805
|
}) {
|
|
655
|
-
return /* @__PURE__ */
|
|
806
|
+
return /* @__PURE__ */ a(
|
|
656
807
|
"div",
|
|
657
808
|
{
|
|
658
|
-
className:
|
|
809
|
+
className: g(
|
|
659
810
|
"flex flex-col gap-3 py-4 sm:flex-row sm:items-center",
|
|
660
811
|
n
|
|
661
812
|
),
|
|
@@ -665,15 +816,15 @@ function Le({
|
|
|
665
816
|
}
|
|
666
817
|
);
|
|
667
818
|
}
|
|
668
|
-
|
|
669
|
-
function
|
|
819
|
+
Xe.displayName = "DataTableToolbar";
|
|
820
|
+
function qe({
|
|
670
821
|
className: e,
|
|
671
822
|
children: n
|
|
672
823
|
}) {
|
|
673
|
-
return /* @__PURE__ */
|
|
824
|
+
return /* @__PURE__ */ a(
|
|
674
825
|
"div",
|
|
675
826
|
{
|
|
676
|
-
className:
|
|
827
|
+
className: g(
|
|
677
828
|
"flex w-full min-w-0 items-center gap-2 sm:w-auto sm:flex-1",
|
|
678
829
|
e
|
|
679
830
|
),
|
|
@@ -682,15 +833,15 @@ function Ue({
|
|
|
682
833
|
}
|
|
683
834
|
);
|
|
684
835
|
}
|
|
685
|
-
|
|
686
|
-
function
|
|
836
|
+
qe.displayName = "DataTableToolbarLeft";
|
|
837
|
+
function Je({
|
|
687
838
|
className: e,
|
|
688
839
|
children: n
|
|
689
840
|
}) {
|
|
690
|
-
return /* @__PURE__ */
|
|
841
|
+
return /* @__PURE__ */ a(
|
|
691
842
|
"div",
|
|
692
843
|
{
|
|
693
|
-
className:
|
|
844
|
+
className: g(
|
|
694
845
|
"flex w-full items-center justify-end gap-2 sm:w-auto",
|
|
695
846
|
e
|
|
696
847
|
),
|
|
@@ -699,23 +850,25 @@ function We({
|
|
|
699
850
|
}
|
|
700
851
|
);
|
|
701
852
|
}
|
|
702
|
-
|
|
853
|
+
Je.displayName = "DataTableToolbarRight";
|
|
703
854
|
export {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
Be as
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
855
|
+
$e as DataTable,
|
|
856
|
+
Ue as DataTableBulkActions,
|
|
857
|
+
Oe as DataTableBulkActionsActions,
|
|
858
|
+
We as DataTableBulkActionsSummary,
|
|
859
|
+
Ie as DataTableColumnHeader,
|
|
860
|
+
Ge as DataTableExpandRowButton,
|
|
861
|
+
Le as DataTableExpandedSkeleton,
|
|
862
|
+
He as DataTablePagination,
|
|
863
|
+
J as DataTablePaginationNav,
|
|
864
|
+
Be as DataTablePaginationRowCount,
|
|
865
|
+
Fe as DataTableSearch,
|
|
866
|
+
Ve as DataTableSelectAllCheckbox,
|
|
867
|
+
je as DataTableSelectRowCheckbox,
|
|
868
|
+
Xe as DataTableToolbar,
|
|
869
|
+
qe as DataTableToolbarLeft,
|
|
870
|
+
Je as DataTableToolbarRight,
|
|
871
|
+
Ee as VirtualizedDataTable,
|
|
872
|
+
sa as useDataTable,
|
|
873
|
+
_e as useDataTableBulkActionsContext
|
|
721
874
|
};
|