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