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