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