@brightlocal/ui-components 2.26.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 +3761 -360
- 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 +138 -3
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +455 -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 +8 -6
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +52 -20
- 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 +14 -2
- package/src/blocks/progress-screen.tsx +481 -0
- package/src/blocks/sidebar.tsx +22 -15
- 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 +333 -14
- package/src/components/global-layout.tsx +228 -62
- package/src/components/link.tsx +39 -5
- 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/data-table.js
CHANGED
|
@@ -1,109 +1,111 @@
|
|
|
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,
|
|
91
93
|
// so omitting it would leave `column.getCanSort()` returning true even
|
|
92
94
|
// when the consumer disabled sorting table-wide.
|
|
93
|
-
enableSorting:
|
|
94
|
-
...
|
|
95
|
+
enableSorting: t,
|
|
96
|
+
...t && {
|
|
95
97
|
...!d && {
|
|
96
|
-
getSortedRowModel:
|
|
98
|
+
getSortedRowModel: ce()
|
|
97
99
|
},
|
|
98
|
-
onSortingChange:
|
|
100
|
+
onSortingChange: ee,
|
|
99
101
|
...d && { manualSorting: !0 }
|
|
100
102
|
},
|
|
101
103
|
...i && {
|
|
102
|
-
...!
|
|
103
|
-
getFilteredRowModel:
|
|
104
|
+
...!c && {
|
|
105
|
+
getFilteredRowModel: de()
|
|
104
106
|
},
|
|
105
|
-
...
|
|
106
|
-
onGlobalFilterChange:
|
|
107
|
+
...c && { manualFiltering: !0 },
|
|
108
|
+
onGlobalFilterChange: te,
|
|
107
109
|
globalFilterFn: "includesString"
|
|
108
110
|
},
|
|
109
111
|
// Always forward — TanStack defaults `enableRowSelection` to true, so
|
|
@@ -111,206 +113,275 @@ function nt(e) {
|
|
|
111
113
|
// `DataTableSelectRowCheckbox` enabled on tables without selection.
|
|
112
114
|
enableRowSelection: o,
|
|
113
115
|
...o && {
|
|
114
|
-
onRowSelectionChange:
|
|
116
|
+
onRowSelectionChange: oe
|
|
115
117
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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 }
|
|
120
131
|
},
|
|
121
132
|
state: {
|
|
122
|
-
pagination:
|
|
123
|
-
sorting:
|
|
124
|
-
globalFilter:
|
|
125
|
-
rowSelection:
|
|
126
|
-
expanded:
|
|
133
|
+
pagination: Q,
|
|
134
|
+
sorting: Z,
|
|
135
|
+
globalFilter: ae,
|
|
136
|
+
rowSelection: ne,
|
|
137
|
+
expanded: le
|
|
127
138
|
}
|
|
128
139
|
});
|
|
129
140
|
}
|
|
130
|
-
function
|
|
141
|
+
function $e({
|
|
131
142
|
table: e,
|
|
132
143
|
dataHook: n,
|
|
133
144
|
trackingEl: l,
|
|
134
|
-
trackingLabel:
|
|
145
|
+
trackingLabel: t,
|
|
135
146
|
isLoading: i = !1,
|
|
136
147
|
skeletonRowCount: o,
|
|
137
148
|
noResultsMessage: r = "No results.",
|
|
138
|
-
stickyHeader:
|
|
149
|
+
stickyHeader: s = !1,
|
|
139
150
|
className: d,
|
|
140
|
-
layout:
|
|
151
|
+
layout: c,
|
|
141
152
|
minWidth: u,
|
|
142
153
|
scrollRegionLabel: h,
|
|
143
|
-
footer:
|
|
154
|
+
footer: m,
|
|
155
|
+
getRowClassName: S,
|
|
156
|
+
renderExpandedContent: x
|
|
144
157
|
}) {
|
|
145
|
-
const
|
|
146
|
-
return /* @__PURE__ */
|
|
158
|
+
const w = e.getVisibleLeafColumns().length, P = o ?? e.getState().pagination.pageSize ?? 10;
|
|
159
|
+
return /* @__PURE__ */ a(
|
|
147
160
|
"div",
|
|
148
161
|
{
|
|
149
162
|
"aria-busy": i || void 0,
|
|
150
|
-
className:
|
|
163
|
+
className: g("border-border overflow-auto rounded-md border", d),
|
|
151
164
|
"data-hook": n,
|
|
152
165
|
"data-slot": "data-table-view",
|
|
153
166
|
"data-tracking-el": l,
|
|
154
|
-
"data-tracking-label":
|
|
155
|
-
children: /* @__PURE__ */
|
|
156
|
-
|
|
167
|
+
"data-tracking-label": t,
|
|
168
|
+
children: /* @__PURE__ */ f(
|
|
169
|
+
_,
|
|
157
170
|
{
|
|
158
171
|
dataHook: `${n}-table`,
|
|
159
|
-
layout:
|
|
172
|
+
layout: c,
|
|
160
173
|
minWidth: u,
|
|
161
174
|
scrollRegionLabel: h,
|
|
162
175
|
children: [
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
|
|
176
|
+
/* @__PURE__ */ a(W, { stickyHeader: s, table: e }),
|
|
177
|
+
/* @__PURE__ */ a(U, { children: i ? /* @__PURE__ */ f(T, { children: [
|
|
178
|
+
/* @__PURE__ */ a(
|
|
179
|
+
X,
|
|
167
180
|
{
|
|
168
|
-
colCount:
|
|
169
|
-
rowCount:
|
|
181
|
+
colCount: w,
|
|
182
|
+
rowCount: P
|
|
170
183
|
}
|
|
171
184
|
),
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
] }) : /* @__PURE__ */
|
|
174
|
-
|
|
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
|
|
175
197
|
]
|
|
176
198
|
}
|
|
177
199
|
)
|
|
178
200
|
}
|
|
179
201
|
);
|
|
180
202
|
}
|
|
181
|
-
|
|
182
|
-
function
|
|
203
|
+
$e.displayName = "DataTable";
|
|
204
|
+
function W({
|
|
183
205
|
table: e,
|
|
184
206
|
stickyHeader: n
|
|
185
207
|
}) {
|
|
186
|
-
return /* @__PURE__ */
|
|
187
|
-
const i =
|
|
188
|
-
return /* @__PURE__ */
|
|
189
|
-
|
|
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,
|
|
190
212
|
{
|
|
191
213
|
"aria-sort": o,
|
|
192
|
-
colSpan:
|
|
214
|
+
colSpan: t.colSpan,
|
|
193
215
|
minWidth: r?.minWidth,
|
|
194
216
|
width: r?.width,
|
|
195
|
-
children:
|
|
196
|
-
|
|
197
|
-
|
|
217
|
+
children: t.isPlaceholder ? null : G(
|
|
218
|
+
t.column.columnDef.header,
|
|
219
|
+
t.getContext()
|
|
198
220
|
)
|
|
199
221
|
},
|
|
200
|
-
|
|
222
|
+
t.id
|
|
201
223
|
);
|
|
202
224
|
}) }, l.id)) });
|
|
203
225
|
}
|
|
204
|
-
function
|
|
205
|
-
|
|
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
|
+
] });
|
|
206
268
|
}
|
|
207
|
-
function
|
|
269
|
+
function X({
|
|
208
270
|
rowCount: e,
|
|
209
271
|
colCount: n
|
|
210
272
|
}) {
|
|
211
|
-
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}`)) });
|
|
212
274
|
}
|
|
213
|
-
function
|
|
275
|
+
function Ee({
|
|
214
276
|
table: e,
|
|
215
277
|
dataHook: n,
|
|
216
278
|
trackingEl: l,
|
|
217
|
-
trackingLabel:
|
|
279
|
+
trackingLabel: t,
|
|
218
280
|
isLoading: i = !1,
|
|
219
281
|
skeletonRowCount: o,
|
|
220
282
|
noResultsMessage: r = "No results.",
|
|
221
|
-
stickyHeader:
|
|
283
|
+
stickyHeader: s = !1,
|
|
222
284
|
className: d,
|
|
223
|
-
layout:
|
|
285
|
+
layout: c,
|
|
224
286
|
minWidth: u,
|
|
225
287
|
scrollRegionLabel: h,
|
|
226
|
-
footer:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
288
|
+
footer: m,
|
|
289
|
+
getRowClassName: S,
|
|
290
|
+
height: x,
|
|
291
|
+
estimateSize: w = 48,
|
|
292
|
+
overscan: P = 5
|
|
230
293
|
}) {
|
|
231
|
-
const
|
|
232
|
-
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,
|
|
233
296
|
getScrollElement: () => D.current,
|
|
234
|
-
estimateSize: () =>
|
|
235
|
-
overscan:
|
|
236
|
-
}),
|
|
237
|
-
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(
|
|
238
301
|
"div",
|
|
239
302
|
{
|
|
240
303
|
ref: D,
|
|
241
304
|
"aria-busy": i || void 0,
|
|
242
|
-
className:
|
|
305
|
+
className: g("border-border overflow-auto rounded-md border", d),
|
|
243
306
|
"data-hook": n,
|
|
244
307
|
"data-slot": "data-table-view",
|
|
245
308
|
"data-tracking-el": l,
|
|
246
|
-
"data-tracking-label":
|
|
247
|
-
style:
|
|
248
|
-
children: /* @__PURE__ */
|
|
249
|
-
|
|
309
|
+
"data-tracking-label": t,
|
|
310
|
+
style: x != null ? { height: x } : void 0,
|
|
311
|
+
children: /* @__PURE__ */ f(
|
|
312
|
+
_,
|
|
250
313
|
{
|
|
251
314
|
dataHook: `${n}-table`,
|
|
252
|
-
layout:
|
|
315
|
+
layout: c,
|
|
253
316
|
minWidth: u,
|
|
254
317
|
scrollRegionLabel: h,
|
|
255
318
|
children: [
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
|
|
319
|
+
/* @__PURE__ */ a(W, { stickyHeader: s, table: e }),
|
|
320
|
+
/* @__PURE__ */ a(U, { children: i ? /* @__PURE__ */ f(T, { children: [
|
|
321
|
+
/* @__PURE__ */ a(
|
|
322
|
+
X,
|
|
260
323
|
{
|
|
261
|
-
colCount:
|
|
262
|
-
rowCount:
|
|
324
|
+
colCount: b,
|
|
325
|
+
rowCount: I
|
|
263
326
|
}
|
|
264
327
|
),
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
] }) :
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const
|
|
270
|
-
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
|
+
);
|
|
271
342
|
}),
|
|
272
|
-
|
|
273
|
-
] }) : /* @__PURE__ */
|
|
274
|
-
|
|
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
|
|
275
346
|
]
|
|
276
347
|
}
|
|
277
348
|
)
|
|
278
349
|
}
|
|
279
350
|
);
|
|
280
351
|
}
|
|
281
|
-
|
|
282
|
-
function
|
|
352
|
+
Ee.displayName = "VirtualizedDataTable";
|
|
353
|
+
function Ie({
|
|
283
354
|
column: e,
|
|
284
355
|
title: n,
|
|
285
356
|
className: l,
|
|
286
|
-
dataHook:
|
|
357
|
+
dataHook: t,
|
|
287
358
|
trackingEl: i,
|
|
288
359
|
trackingLabel: o,
|
|
289
360
|
align: r = "left",
|
|
290
|
-
getSortLabel:
|
|
361
|
+
getSortLabel: s
|
|
291
362
|
}) {
|
|
292
363
|
if (!e.getCanSort())
|
|
293
|
-
return /* @__PURE__ */
|
|
364
|
+
return /* @__PURE__ */ a(
|
|
294
365
|
"div",
|
|
295
366
|
{
|
|
296
|
-
className:
|
|
367
|
+
className: g(
|
|
297
368
|
"text-muted-foreground text-left text-sm leading-normal font-medium",
|
|
298
369
|
r === "right" && "text-right",
|
|
299
370
|
r === "center" && "text-center",
|
|
300
371
|
l
|
|
301
372
|
),
|
|
302
|
-
"data-hook":
|
|
373
|
+
"data-hook": t,
|
|
303
374
|
"data-slot": "data-table-column-header",
|
|
304
375
|
"data-tracking-el": i,
|
|
305
376
|
"data-tracking-label": o,
|
|
306
377
|
children: n
|
|
307
378
|
}
|
|
308
379
|
);
|
|
309
|
-
const d = e.getIsSorted(),
|
|
310
|
-
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(
|
|
311
382
|
"div",
|
|
312
383
|
{
|
|
313
|
-
className:
|
|
384
|
+
className: g(
|
|
314
385
|
"flex items-center",
|
|
315
386
|
r === "right" && "justify-end",
|
|
316
387
|
r === "center" && "justify-center",
|
|
@@ -319,23 +390,23 @@ function Ae({
|
|
|
319
390
|
"data-slot": "data-table-column-header",
|
|
320
391
|
"data-tracking-el": i,
|
|
321
392
|
"data-tracking-label": o,
|
|
322
|
-
children: /* @__PURE__ */
|
|
323
|
-
|
|
393
|
+
children: /* @__PURE__ */ f(
|
|
394
|
+
V,
|
|
324
395
|
{
|
|
325
|
-
"aria-label":
|
|
396
|
+
"aria-label": c,
|
|
326
397
|
className: "text-muted-foreground h-auto p-0 text-sm font-medium",
|
|
327
|
-
dataHook:
|
|
398
|
+
dataHook: t || `column-header-${e.id}`,
|
|
328
399
|
size: "sm",
|
|
329
400
|
variant: "ghost",
|
|
330
401
|
onClick: () => e.toggleSorting(d === "asc"),
|
|
331
402
|
children: [
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", children: n }),
|
|
404
|
+
/* @__PURE__ */ a(
|
|
334
405
|
"span",
|
|
335
406
|
{
|
|
336
407
|
"aria-hidden": "true",
|
|
337
408
|
className: "flex size-3 items-center justify-center",
|
|
338
|
-
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 })
|
|
339
410
|
}
|
|
340
411
|
)
|
|
341
412
|
]
|
|
@@ -344,162 +415,162 @@ function Ae({
|
|
|
344
415
|
}
|
|
345
416
|
);
|
|
346
417
|
}
|
|
347
|
-
|
|
348
|
-
function
|
|
418
|
+
Ie.displayName = "DataTableColumnHeader";
|
|
419
|
+
function Fe({
|
|
349
420
|
table: e,
|
|
350
421
|
ariaLabel: n,
|
|
351
422
|
placeholder: l,
|
|
352
|
-
clearSearchAriaLabel:
|
|
423
|
+
clearSearchAriaLabel: t,
|
|
353
424
|
...i
|
|
354
425
|
}) {
|
|
355
|
-
const o = e.getState().globalFilter ?? "", r = (
|
|
356
|
-
e.setGlobalFilter(
|
|
426
|
+
const o = e.getState().globalFilter ?? "", r = (s) => {
|
|
427
|
+
e.setGlobalFilter(s);
|
|
357
428
|
};
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
|
|
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,
|
|
362
433
|
{
|
|
363
434
|
"aria-label": n ?? "Search table",
|
|
364
435
|
placeholder: l ?? "Search...",
|
|
365
436
|
type: "text",
|
|
366
437
|
value: o,
|
|
367
|
-
onChange: (
|
|
438
|
+
onChange: (s) => r(s.target.value)
|
|
368
439
|
}
|
|
369
440
|
),
|
|
370
|
-
o && /* @__PURE__ */
|
|
371
|
-
|
|
441
|
+
o && /* @__PURE__ */ a(j, { className: "pr-1", children: /* @__PURE__ */ a(
|
|
442
|
+
V,
|
|
372
443
|
{
|
|
373
|
-
"aria-label":
|
|
444
|
+
"aria-label": t ?? "Clear search",
|
|
374
445
|
className: "h-auto p-1",
|
|
375
446
|
"data-slot": "data-table-search-clear",
|
|
376
447
|
dataHook: `${i.dataHook}-clear`,
|
|
377
448
|
variant: "ghost",
|
|
378
449
|
onClick: () => r(""),
|
|
379
|
-
children: /* @__PURE__ */
|
|
450
|
+
children: /* @__PURE__ */ a(Se, { size: 14 })
|
|
380
451
|
}
|
|
381
452
|
) })
|
|
382
453
|
] });
|
|
383
454
|
}
|
|
384
|
-
|
|
385
|
-
function
|
|
386
|
-
const { pageIndex: n, pageSize: l } = e.getState().pagination,
|
|
387
|
-
(
|
|
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),
|
|
388
459
|
[e]
|
|
389
|
-
), h =
|
|
390
|
-
(
|
|
460
|
+
), h = p.useCallback(() => e.nextPage(), [e]), m = p.useCallback(() => e.previousPage(), [e]), S = p.useCallback(
|
|
461
|
+
(x) => e.setPageSize(x),
|
|
391
462
|
[e]
|
|
392
463
|
);
|
|
393
|
-
return
|
|
464
|
+
return p.useMemo(
|
|
394
465
|
() => ({
|
|
395
466
|
pageIndex: n,
|
|
396
467
|
pageSize: l,
|
|
397
|
-
totalRows:
|
|
468
|
+
totalRows: t,
|
|
398
469
|
totalPages: i,
|
|
399
470
|
startRow: d,
|
|
400
|
-
endRow:
|
|
401
|
-
currentPage:
|
|
471
|
+
endRow: c,
|
|
472
|
+
currentPage: s,
|
|
402
473
|
canPrev: o,
|
|
403
474
|
canNext: r,
|
|
404
475
|
goToPage: u,
|
|
405
476
|
nextPage: h,
|
|
406
|
-
previousPage:
|
|
407
|
-
setPageSize:
|
|
477
|
+
previousPage: m,
|
|
478
|
+
setPageSize: S
|
|
408
479
|
}),
|
|
409
480
|
[
|
|
410
481
|
n,
|
|
411
482
|
l,
|
|
412
|
-
|
|
483
|
+
t,
|
|
413
484
|
i,
|
|
414
485
|
d,
|
|
415
|
-
s,
|
|
416
486
|
c,
|
|
487
|
+
s,
|
|
417
488
|
o,
|
|
418
489
|
r,
|
|
419
490
|
u,
|
|
420
491
|
h,
|
|
421
|
-
|
|
422
|
-
|
|
492
|
+
m,
|
|
493
|
+
S
|
|
423
494
|
]
|
|
424
495
|
);
|
|
425
496
|
}
|
|
426
|
-
const
|
|
427
|
-
function
|
|
428
|
-
const e =
|
|
497
|
+
const H = p.createContext(null);
|
|
498
|
+
function q() {
|
|
499
|
+
const e = p.useContext(H);
|
|
429
500
|
if (!e)
|
|
430
501
|
throw new Error(
|
|
431
502
|
"DataTablePagination sub-components must be used within <DataTablePagination>"
|
|
432
503
|
);
|
|
433
504
|
return e;
|
|
434
505
|
}
|
|
435
|
-
function
|
|
506
|
+
function Be({
|
|
436
507
|
renderText: e,
|
|
437
508
|
className: n
|
|
438
509
|
}) {
|
|
439
|
-
const { info: l } =
|
|
440
|
-
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(
|
|
441
512
|
"span",
|
|
442
513
|
{
|
|
443
|
-
className:
|
|
514
|
+
className: g("text-muted-foreground text-sm", n),
|
|
444
515
|
"data-slot": "data-table-pagination-row-count",
|
|
445
516
|
children: d
|
|
446
517
|
}
|
|
447
518
|
);
|
|
448
519
|
}
|
|
449
|
-
|
|
450
|
-
function
|
|
520
|
+
Be.displayName = "DataTablePaginationRowCount";
|
|
521
|
+
function J({
|
|
451
522
|
ariaLabel: e = "Table pagination",
|
|
452
523
|
dataHook: n,
|
|
453
524
|
className: l
|
|
454
525
|
}) {
|
|
455
|
-
const { info:
|
|
456
|
-
page:
|
|
457
|
-
totalPages:
|
|
526
|
+
const { info: t } = q(), i = ke({
|
|
527
|
+
page: t.currentPage,
|
|
528
|
+
totalPages: t.totalPages
|
|
458
529
|
});
|
|
459
|
-
return /* @__PURE__ */
|
|
460
|
-
|
|
530
|
+
return /* @__PURE__ */ a(
|
|
531
|
+
ve,
|
|
461
532
|
{
|
|
462
533
|
ariaLabel: e,
|
|
463
|
-
className:
|
|
534
|
+
className: g("mx-0 w-auto justify-end", l),
|
|
464
535
|
dataHook: n ?? "pagination-nav",
|
|
465
|
-
children: /* @__PURE__ */
|
|
466
|
-
|
|
536
|
+
children: /* @__PURE__ */ a(Te, { children: i.map((o, r) => o === "previous" ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(
|
|
537
|
+
Pe,
|
|
467
538
|
{
|
|
468
|
-
disabled: !
|
|
469
|
-
onClick: () =>
|
|
539
|
+
disabled: !t.canPrev,
|
|
540
|
+
onClick: () => t.previousPage()
|
|
470
541
|
}
|
|
471
|
-
) }, "previous") : o === "next" ? /* @__PURE__ */
|
|
472
|
-
|
|
542
|
+
) }, "previous") : o === "next" ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(
|
|
543
|
+
Re,
|
|
473
544
|
{
|
|
474
|
-
disabled: !
|
|
475
|
-
onClick: () =>
|
|
545
|
+
disabled: !t.canNext,
|
|
546
|
+
onClick: () => t.nextPage()
|
|
476
547
|
}
|
|
477
|
-
) }, "next") : o === "ellipsis" ? /* @__PURE__ */
|
|
478
|
-
|
|
548
|
+
) }, "next") : o === "ellipsis" ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(ye, {}) }, `ellipsis-${r}`) : /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(
|
|
549
|
+
De,
|
|
479
550
|
{
|
|
480
|
-
isActive: o ===
|
|
551
|
+
isActive: o === t.currentPage,
|
|
481
552
|
page: o,
|
|
482
|
-
onClick: () =>
|
|
553
|
+
onClick: () => t.goToPage(o)
|
|
483
554
|
}
|
|
484
555
|
) }, o)) })
|
|
485
556
|
}
|
|
486
557
|
);
|
|
487
558
|
}
|
|
488
|
-
|
|
489
|
-
function
|
|
559
|
+
J.displayName = "DataTablePaginationNav";
|
|
560
|
+
function He({
|
|
490
561
|
table: e,
|
|
491
562
|
dataHook: n,
|
|
492
563
|
showRowCount: l = !0,
|
|
493
|
-
renderRowCount:
|
|
564
|
+
renderRowCount: t,
|
|
494
565
|
trackingEl: i,
|
|
495
566
|
trackingLabel: o,
|
|
496
567
|
className: r,
|
|
497
|
-
ariaLabel:
|
|
568
|
+
ariaLabel: s = "Table pagination",
|
|
498
569
|
children: d
|
|
499
570
|
}) {
|
|
500
|
-
const
|
|
501
|
-
() => ({ info:
|
|
502
|
-
[
|
|
571
|
+
const c = Me(e), u = p.useMemo(
|
|
572
|
+
() => ({ info: c }),
|
|
573
|
+
[c]
|
|
503
574
|
), h = {
|
|
504
575
|
"data-hook": n,
|
|
505
576
|
"data-slot": "data-table-pagination",
|
|
@@ -507,36 +578,36 @@ function Me({
|
|
|
507
578
|
"data-tracking-label": o
|
|
508
579
|
};
|
|
509
580
|
if (d)
|
|
510
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ a(H.Provider, { value: u, children: /* @__PURE__ */ a(
|
|
511
582
|
"div",
|
|
512
583
|
{
|
|
513
|
-
className:
|
|
584
|
+
className: g("flex w-full items-center gap-4", r),
|
|
514
585
|
...h,
|
|
515
586
|
children: d
|
|
516
587
|
}
|
|
517
588
|
) });
|
|
518
|
-
const
|
|
519
|
-
startRow:
|
|
520
|
-
endRow:
|
|
521
|
-
totalRows:
|
|
522
|
-
pageIndex:
|
|
523
|
-
pageSize:
|
|
524
|
-
}) :
|
|
525
|
-
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(
|
|
526
597
|
"div",
|
|
527
598
|
{
|
|
528
|
-
className:
|
|
599
|
+
className: g(
|
|
529
600
|
"flex w-full items-center gap-4",
|
|
530
|
-
|
|
601
|
+
m != null ? "justify-between" : "justify-end",
|
|
531
602
|
r
|
|
532
603
|
),
|
|
533
604
|
...h,
|
|
534
605
|
children: [
|
|
535
|
-
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
-
|
|
606
|
+
m != null && /* @__PURE__ */ a("span", { className: "text-muted-foreground text-sm", children: m }),
|
|
607
|
+
/* @__PURE__ */ a(
|
|
608
|
+
J,
|
|
538
609
|
{
|
|
539
|
-
ariaLabel:
|
|
610
|
+
ariaLabel: s,
|
|
540
611
|
dataHook: `${n}-nav`
|
|
541
612
|
}
|
|
542
613
|
)
|
|
@@ -544,125 +615,198 @@ function Me({
|
|
|
544
615
|
}
|
|
545
616
|
) });
|
|
546
617
|
}
|
|
547
|
-
|
|
548
|
-
function
|
|
618
|
+
He.displayName = "DataTablePagination";
|
|
619
|
+
function Ve({
|
|
549
620
|
table: e,
|
|
550
621
|
dataHook: n,
|
|
551
622
|
trackingEl: l,
|
|
552
|
-
trackingLabel:
|
|
623
|
+
trackingLabel: t,
|
|
553
624
|
selectAllAriaLabel: i
|
|
554
625
|
}) {
|
|
555
|
-
return /* @__PURE__ */
|
|
556
|
-
|
|
626
|
+
return /* @__PURE__ */ a(
|
|
627
|
+
L,
|
|
557
628
|
{
|
|
558
629
|
"aria-label": i ?? "Select all",
|
|
559
630
|
checked: e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected() && "indeterminate",
|
|
560
631
|
dataHook: n || "select-all-checkbox",
|
|
561
632
|
trackingEl: l,
|
|
562
|
-
trackingLabel:
|
|
633
|
+
trackingLabel: t,
|
|
563
634
|
onCheckedChange: (o) => e.toggleAllPageRowsSelected(!!o)
|
|
564
635
|
}
|
|
565
636
|
);
|
|
566
637
|
}
|
|
567
|
-
|
|
568
|
-
function
|
|
638
|
+
Ve.displayName = "DataTableSelectAllCheckbox";
|
|
639
|
+
function je({
|
|
569
640
|
row: e,
|
|
570
641
|
dataHook: n,
|
|
571
642
|
trackingEl: l,
|
|
572
|
-
trackingLabel:
|
|
643
|
+
trackingLabel: t,
|
|
573
644
|
selectRowAriaLabel: i
|
|
574
645
|
}) {
|
|
575
|
-
return /* @__PURE__ */
|
|
576
|
-
|
|
646
|
+
return /* @__PURE__ */ a(
|
|
647
|
+
L,
|
|
577
648
|
{
|
|
578
649
|
"aria-label": i ?? "Select row",
|
|
579
650
|
checked: e.getIsSelected(),
|
|
580
651
|
dataHook: n || `select-row-${e.id}`,
|
|
581
652
|
disabled: !e.getCanSelect(),
|
|
582
653
|
trackingEl: l,
|
|
583
|
-
trackingLabel:
|
|
654
|
+
trackingLabel: t,
|
|
584
655
|
onCheckedChange: (o) => e.toggleSelected(!!o)
|
|
585
656
|
}
|
|
586
657
|
);
|
|
587
658
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
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);
|
|
592
736
|
if (!e)
|
|
593
737
|
throw new Error(
|
|
594
738
|
"DataTableBulkActions components must be used within <DataTableBulkActions>"
|
|
595
739
|
);
|
|
596
740
|
return e;
|
|
597
741
|
}
|
|
598
|
-
function
|
|
742
|
+
function Ue({
|
|
599
743
|
table: e,
|
|
600
744
|
dataHook: n,
|
|
601
745
|
trackingEl: l,
|
|
602
|
-
trackingLabel:
|
|
746
|
+
trackingLabel: t,
|
|
603
747
|
className: i,
|
|
604
748
|
children: o
|
|
605
749
|
}) {
|
|
606
|
-
const r = e.getFilteredSelectedRowModel().rows.length,
|
|
607
|
-
() => ({ selectedCount: r, totalCount:
|
|
608
|
-
[r,
|
|
750
|
+
const r = e.getFilteredSelectedRowModel().rows.length, s = e.getRowCount(), d = p.useMemo(
|
|
751
|
+
() => ({ selectedCount: r, totalCount: s }),
|
|
752
|
+
[r, s]
|
|
609
753
|
);
|
|
610
|
-
return r === 0 ? null : /* @__PURE__ */
|
|
754
|
+
return r === 0 ? null : /* @__PURE__ */ a(K.Provider, { value: d, children: /* @__PURE__ */ a(
|
|
611
755
|
"div",
|
|
612
756
|
{
|
|
613
|
-
className:
|
|
757
|
+
className: g("flex items-center gap-2.5", i),
|
|
614
758
|
"data-hook": n,
|
|
615
759
|
"data-slot": "data-table-bulk-actions",
|
|
616
760
|
"data-tracking-el": l ?? "data-table-bulk-actions",
|
|
617
|
-
"data-tracking-label":
|
|
761
|
+
"data-tracking-label": t,
|
|
618
762
|
children: o
|
|
619
763
|
}
|
|
620
764
|
) });
|
|
621
765
|
}
|
|
622
|
-
|
|
623
|
-
function
|
|
766
|
+
Ue.displayName = "DataTableBulkActions";
|
|
767
|
+
function We({
|
|
624
768
|
dataHook: e = "data-table-bulk-actions-summary",
|
|
625
769
|
className: n,
|
|
626
770
|
children: l
|
|
627
771
|
}) {
|
|
628
|
-
const { selectedCount:
|
|
772
|
+
const { selectedCount: t, totalCount: i } = _e();
|
|
629
773
|
let o;
|
|
630
|
-
return typeof l == "function" ? o = l({ selectedCount:
|
|
631
|
-
|
|
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,
|
|
632
776
|
{
|
|
633
777
|
asChild: !0,
|
|
634
|
-
className:
|
|
778
|
+
className: g("min-w-0", n),
|
|
635
779
|
dataHook: e,
|
|
636
|
-
children: /* @__PURE__ */
|
|
780
|
+
children: /* @__PURE__ */ a("span", { "data-slot": "data-table-bulk-actions-summary", role: "status", children: o })
|
|
637
781
|
}
|
|
638
782
|
);
|
|
639
783
|
}
|
|
640
|
-
|
|
641
|
-
function
|
|
784
|
+
We.displayName = "DataTableBulkActionsSummary";
|
|
785
|
+
function Oe({
|
|
642
786
|
dataHook: e = "data-table-bulk-actions-actions",
|
|
643
787
|
className: n,
|
|
644
788
|
children: l
|
|
645
789
|
}) {
|
|
646
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ a(
|
|
647
791
|
"div",
|
|
648
792
|
{
|
|
649
|
-
className:
|
|
793
|
+
className: g("flex shrink-0 items-center gap-2", n),
|
|
650
794
|
"data-hook": e,
|
|
651
795
|
"data-slot": "data-table-bulk-actions-actions",
|
|
652
796
|
children: l
|
|
653
797
|
}
|
|
654
798
|
);
|
|
655
799
|
}
|
|
656
|
-
|
|
657
|
-
function
|
|
800
|
+
Oe.displayName = "DataTableBulkActionsActions";
|
|
801
|
+
function Xe({
|
|
658
802
|
dataHook: e,
|
|
659
803
|
className: n,
|
|
660
804
|
children: l
|
|
661
805
|
}) {
|
|
662
|
-
return /* @__PURE__ */
|
|
806
|
+
return /* @__PURE__ */ a(
|
|
663
807
|
"div",
|
|
664
808
|
{
|
|
665
|
-
className:
|
|
809
|
+
className: g(
|
|
666
810
|
"flex flex-col gap-3 py-4 sm:flex-row sm:items-center",
|
|
667
811
|
n
|
|
668
812
|
),
|
|
@@ -672,15 +816,15 @@ function Le({
|
|
|
672
816
|
}
|
|
673
817
|
);
|
|
674
818
|
}
|
|
675
|
-
|
|
676
|
-
function
|
|
819
|
+
Xe.displayName = "DataTableToolbar";
|
|
820
|
+
function qe({
|
|
677
821
|
className: e,
|
|
678
822
|
children: n
|
|
679
823
|
}) {
|
|
680
|
-
return /* @__PURE__ */
|
|
824
|
+
return /* @__PURE__ */ a(
|
|
681
825
|
"div",
|
|
682
826
|
{
|
|
683
|
-
className:
|
|
827
|
+
className: g(
|
|
684
828
|
"flex w-full min-w-0 items-center gap-2 sm:w-auto sm:flex-1",
|
|
685
829
|
e
|
|
686
830
|
),
|
|
@@ -689,15 +833,15 @@ function Ue({
|
|
|
689
833
|
}
|
|
690
834
|
);
|
|
691
835
|
}
|
|
692
|
-
|
|
693
|
-
function
|
|
836
|
+
qe.displayName = "DataTableToolbarLeft";
|
|
837
|
+
function Je({
|
|
694
838
|
className: e,
|
|
695
839
|
children: n
|
|
696
840
|
}) {
|
|
697
|
-
return /* @__PURE__ */
|
|
841
|
+
return /* @__PURE__ */ a(
|
|
698
842
|
"div",
|
|
699
843
|
{
|
|
700
|
-
className:
|
|
844
|
+
className: g(
|
|
701
845
|
"flex w-full items-center justify-end gap-2 sm:w-auto",
|
|
702
846
|
e
|
|
703
847
|
),
|
|
@@ -706,23 +850,25 @@ function We({
|
|
|
706
850
|
}
|
|
707
851
|
);
|
|
708
852
|
}
|
|
709
|
-
|
|
853
|
+
Je.displayName = "DataTableToolbarRight";
|
|
710
854
|
export {
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
Be as
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
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
|
|
728
874
|
};
|