@brightlocal/ui-components 0.1.1 → 0.1.3
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/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +74 -4
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +100 -105
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +30 -10
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +129 -132
- package/dist/alert.d.ts +22 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.d.ts +11 -1
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/aspect-ratio.js +16 -20
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.d.ts +43 -3
- package/dist/avatar.d.ts.map +1 -1
- package/dist/avatar.js +18 -16
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +24 -9
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +34 -32
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +209 -202
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +154 -154
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +63 -8
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +97 -93
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +17 -45
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +49 -50
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +12 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +10 -8
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +58 -18
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +60 -51
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +99 -9
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +142 -128
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +18 -2
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +46 -33
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +70 -7
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +71 -66
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +9 -5
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +61 -82
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts +65 -8
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +41 -55
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +29 -11
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +193 -159
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +115 -9
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +176 -152
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +188 -20
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +119 -121
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +75 -9
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +220 -81
- package/dist/description.cjs +1 -0
- package/dist/description.d.ts +37 -0
- package/dist/description.d.ts.map +1 -0
- package/dist/description.js +25 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +73 -9
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +103 -112
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +92 -0
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +67 -52
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +95 -11
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +146 -106
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +23 -6
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +54 -53
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +27 -17
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +86 -79
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +36 -6
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +44 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +383 -387
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +21 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +51 -41
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +24 -25
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +38 -24
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +68 -136
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +20 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +31 -18
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +3 -0
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +12 -10
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +40 -6
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -76
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +59 -4
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +42 -34
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +9 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +71 -59
- package/dist/radio-group.d.ts +40 -0
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/rating.d.ts +4 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +65 -4
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +53 -36
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +46 -5
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +42 -38
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +30 -0
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +64 -54
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +49 -2
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +48 -36
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +80 -9
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +117 -113
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +24 -2
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +15 -9
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +18 -4
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +72 -66
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +4 -2
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +29 -28
- package/dist/split-layout.d.ts +4 -1
- package/dist/split-layout.d.ts.map +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +3 -1
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +38 -36
- package/package.json +8 -2
- package/src/blocks/data-table.tsx +42 -32
- package/src/blocks/sidebar.tsx +4 -12
- package/src/components/accordion.tsx +163 -77
- package/src/components/alert-dialog.tsx +156 -111
- package/src/components/alert.tsx +26 -13
- package/src/components/aspect-ratio.tsx +25 -16
- package/src/components/avatar.tsx +56 -8
- package/src/components/badge.tsx +65 -42
- package/src/components/breadcrumb.tsx +158 -82
- package/src/components/button.tsx +41 -62
- package/src/components/calendar.tsx +16 -2
- package/src/components/card.tsx +92 -40
- package/src/components/carousel.tsx +240 -115
- package/src/components/centred-layout.tsx +67 -35
- package/src/components/chart.tsx +118 -47
- package/src/components/checkbox.tsx +42 -78
- package/src/components/collapsible.tsx +95 -26
- package/src/components/combobox.tsx +242 -144
- package/src/components/command.tsx +295 -121
- package/src/components/context-menu.tsx +278 -81
- package/src/components/date-picker.tsx +281 -30
- package/src/components/description.tsx +60 -0
- package/src/components/dialog.tsx +162 -86
- package/src/components/drawer.tsx +76 -2
- package/src/components/dropdown-menu.tsx +143 -37
- package/src/components/field.tsx +36 -11
- package/src/components/global-layout.tsx +116 -77
- package/src/components/hover-card.tsx +54 -14
- package/src/components/input-group.tsx +56 -18
- package/src/components/input-password.tsx +3 -4
- package/src/components/input.tsx +93 -186
- package/src/components/label.tsx +56 -15
- package/src/components/logo.tsx +3 -0
- package/src/components/menubar.tsx +58 -4
- package/src/components/popover.tsx +103 -20
- package/src/components/progress.tsx +82 -60
- package/src/components/radio-group.tsx +40 -0
- package/src/components/rating.tsx +4 -1
- package/src/components/resizable.tsx +119 -31
- package/src/components/scroll-area.tsx +123 -56
- package/src/components/select.tsx +21 -1
- package/src/components/separator.tsx +97 -20
- package/src/components/sheet.tsx +180 -79
- package/src/components/skeleton.tsx +40 -10
- package/src/components/slider.tsx +83 -57
- package/src/components/sonner.tsx +10 -7
- package/src/components/split-layout.tsx +4 -1
- package/src/components/table.tsx +1 -1
- package/src/components/toggle-group.tsx +4 -0
- package/src/index.ts +1 -1
- package/dist/input-base.cjs +0 -1
- package/dist/input-base.d.ts +0 -28
- package/dist/input-base.d.ts.map +0 -1
- package/dist/input-base.js +0 -56
- package/src/components/input-base.tsx +0 -86
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as a, jsxs as w, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import { useReactTable as
|
|
1
|
+
import { jsx as a, jsxs as w, Fragment as qe } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { useReactTable as _e, getFacetedMinMaxValues as We, getFacetedUniqueValues as Je, getFacetedRowModel as Ke, getExpandedRowModel as Q, getGroupedRowModel as Qe, getFilteredRowModel as X, getSortedRowModel as Xe, getPaginationRowModel as Ye, getCoreRowModel as Ze, flexRender as k } from "@tanstack/react-table";
|
|
4
4
|
import { createColumnHelper as qt, flexRender as _t } from "@tanstack/react-table";
|
|
5
|
-
import { ArrowDownIcon as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Button as Y
|
|
8
|
-
import { Checkbox as
|
|
9
|
-
import {
|
|
10
|
-
import { Skeleton as
|
|
11
|
-
import { DropdownMenu as
|
|
12
|
-
import { Table as ut, TableHeader as
|
|
13
|
-
import { usePagination as
|
|
5
|
+
import { ArrowDownIcon as et, ArrowUpIcon as tt, ArrowUpDownIcon as at, EllipsisIcon as nt, SearchIcon as lt } from "lucide-react";
|
|
6
|
+
import { cn as b } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
+
import { Button as Y } from "../button.js";
|
|
8
|
+
import { Checkbox as Z } from "../checkbox.js";
|
|
9
|
+
import { InputGroup as ot, InputGroupInput as it, InputGroupAddon as st } from "../input-group.js";
|
|
10
|
+
import { Skeleton as rt } from "../skeleton.js";
|
|
11
|
+
import { DropdownMenu as ct, DropdownMenuTrigger as dt, DropdownMenuContent as gt } from "../dropdown-menu.js";
|
|
12
|
+
import { Table as ut, TableHeader as mt, TableRow as C, TableHead as ft, TableBody as ht, TableCell as x } from "../table.js";
|
|
13
|
+
import { usePagination as pt, Pagination as bt, PaginationContent as wt, PaginationItem as R, PaginationPrevious as Ct, PaginationNext as St, PaginationEllipsis as xt, PaginationLink as kt } from "../pagination.js";
|
|
14
14
|
function Rt({
|
|
15
15
|
columns: n,
|
|
16
16
|
data: l,
|
|
@@ -18,111 +18,111 @@ function Rt({
|
|
|
18
18
|
trackingEl: i,
|
|
19
19
|
trackingLabel: s,
|
|
20
20
|
enableRowSelection: g = !1,
|
|
21
|
-
enableSorting:
|
|
21
|
+
enableSorting: c = !0,
|
|
22
22
|
enableFiltering: d = !1,
|
|
23
23
|
enableGlobalFiltering: h = !1,
|
|
24
|
-
enablePagination:
|
|
25
|
-
enableColumnPinning:
|
|
24
|
+
enablePagination: p = !1,
|
|
25
|
+
enableColumnPinning: S = !1,
|
|
26
26
|
enableRowPinning: u = !1,
|
|
27
|
-
enableColumnOrdering:
|
|
28
|
-
enableGrouping:
|
|
29
|
-
enableExpanding:
|
|
30
|
-
enableFaceting:
|
|
27
|
+
enableColumnOrdering: y = !1,
|
|
28
|
+
enableGrouping: f = !1,
|
|
29
|
+
enableExpanding: T = !1,
|
|
30
|
+
enableFaceting: ae = !1,
|
|
31
31
|
pageSize: q = 10,
|
|
32
|
-
noResultsMessage:
|
|
33
|
-
isLoading:
|
|
34
|
-
skeletonRowCount:
|
|
35
|
-
getSubRows:
|
|
36
|
-
sorting:
|
|
32
|
+
noResultsMessage: ne = "No results.",
|
|
33
|
+
isLoading: le = !1,
|
|
34
|
+
skeletonRowCount: oe,
|
|
35
|
+
getSubRows: ie,
|
|
36
|
+
sorting: se,
|
|
37
37
|
onSortingChange: P,
|
|
38
|
-
columnFilters:
|
|
39
|
-
onColumnFiltersChange:
|
|
40
|
-
globalFilter:
|
|
41
|
-
onGlobalFilterChange:
|
|
42
|
-
rowSelection:
|
|
43
|
-
onRowSelectionChange:
|
|
44
|
-
columnOrder:
|
|
45
|
-
onColumnOrderChange:
|
|
46
|
-
columnPinning:
|
|
38
|
+
columnFilters: re,
|
|
39
|
+
onColumnFiltersChange: N,
|
|
40
|
+
globalFilter: ce,
|
|
41
|
+
onGlobalFilterChange: D,
|
|
42
|
+
rowSelection: de,
|
|
43
|
+
onRowSelectionChange: I,
|
|
44
|
+
columnOrder: ge,
|
|
45
|
+
onColumnOrderChange: M,
|
|
46
|
+
columnPinning: ue,
|
|
47
47
|
onColumnPinningChange: F,
|
|
48
|
-
rowPinning:
|
|
48
|
+
rowPinning: me,
|
|
49
49
|
onRowPinningChange: V,
|
|
50
|
-
grouping:
|
|
50
|
+
grouping: fe,
|
|
51
51
|
onGroupingChange: v,
|
|
52
|
-
expanded:
|
|
52
|
+
expanded: he,
|
|
53
53
|
onExpandedChange: $,
|
|
54
|
-
className:
|
|
54
|
+
className: pe,
|
|
55
55
|
renderToolbar: _,
|
|
56
56
|
renderFooter: W,
|
|
57
57
|
renderPagination: J
|
|
58
|
-
},
|
|
59
|
-
const [
|
|
58
|
+
}, be) {
|
|
59
|
+
const [we, Ce] = r.useState(
|
|
60
60
|
[]
|
|
61
|
-
), [
|
|
61
|
+
), [Se, xe] = r.useState([]), [ke, Re] = r.useState(""), [ye, Te] = r.useState({}), [Pe, Ne] = r.useState([]), [De, Ie] = r.useState({}), [Me, Fe] = r.useState({}), [Ve, ve] = r.useState(
|
|
62
62
|
[]
|
|
63
|
-
), [
|
|
63
|
+
), [$e, Ae] = r.useState(
|
|
64
64
|
{}
|
|
65
|
-
), A =
|
|
65
|
+
), A = se ?? we, G = re ?? Se, z = ce ?? ke, H = de ?? ye, j = ge ?? Pe, E = ue ?? De, L = me ?? Me, O = fe ?? Ve, U = he ?? $e, Ge = r.useCallback(
|
|
66
66
|
(e) => {
|
|
67
67
|
const t = typeof e == "function" ? e(A) : e;
|
|
68
|
-
P ? P(t) :
|
|
68
|
+
P ? P(t) : Ce(t);
|
|
69
69
|
},
|
|
70
70
|
[A, P]
|
|
71
|
-
),
|
|
71
|
+
), ze = r.useCallback(
|
|
72
72
|
(e) => {
|
|
73
|
-
const t = typeof e == "function" ? e(
|
|
74
|
-
|
|
73
|
+
const t = typeof e == "function" ? e(G) : e;
|
|
74
|
+
N ? N(t) : xe(t);
|
|
75
75
|
},
|
|
76
|
-
[
|
|
77
|
-
),
|
|
76
|
+
[G, N]
|
|
77
|
+
), He = r.useCallback(
|
|
78
78
|
(e) => {
|
|
79
79
|
const t = typeof e == "function" ? e(z) : e;
|
|
80
|
-
|
|
80
|
+
D ? D(t) : Re(t);
|
|
81
81
|
},
|
|
82
|
-
[z,
|
|
83
|
-
),
|
|
82
|
+
[z, D]
|
|
83
|
+
), je = r.useCallback(
|
|
84
84
|
(e) => {
|
|
85
|
-
const t = typeof e == "function" ? e(
|
|
86
|
-
|
|
85
|
+
const t = typeof e == "function" ? e(H) : e;
|
|
86
|
+
I ? I(t) : Te(t);
|
|
87
87
|
},
|
|
88
|
-
[
|
|
89
|
-
),
|
|
88
|
+
[H, I]
|
|
89
|
+
), Ee = r.useCallback(
|
|
90
90
|
(e) => {
|
|
91
91
|
const t = typeof e == "function" ? e(j) : e;
|
|
92
|
-
|
|
92
|
+
M ? M(t) : Ne(t);
|
|
93
93
|
},
|
|
94
|
-
[j,
|
|
95
|
-
),
|
|
94
|
+
[j, M]
|
|
95
|
+
), Le = r.useCallback(
|
|
96
96
|
(e) => {
|
|
97
|
-
const t = typeof e == "function" ? e(
|
|
98
|
-
F ? F(t) :
|
|
97
|
+
const t = typeof e == "function" ? e(E) : e;
|
|
98
|
+
F ? F(t) : Ie(t);
|
|
99
99
|
},
|
|
100
|
-
[
|
|
101
|
-
),
|
|
100
|
+
[E, F]
|
|
101
|
+
), Oe = r.useCallback(
|
|
102
102
|
(e) => {
|
|
103
|
-
const t = typeof e == "function" ? e(
|
|
104
|
-
V ? V(t) :
|
|
103
|
+
const t = typeof e == "function" ? e(L) : e;
|
|
104
|
+
V ? V(t) : Fe(t);
|
|
105
105
|
},
|
|
106
|
-
[
|
|
107
|
-
),
|
|
106
|
+
[L, V]
|
|
107
|
+
), Ue = r.useCallback(
|
|
108
108
|
(e) => {
|
|
109
109
|
const t = typeof e == "function" ? e(O) : e;
|
|
110
|
-
v ? v(t) :
|
|
110
|
+
v ? v(t) : ve(t);
|
|
111
111
|
},
|
|
112
112
|
[O, v]
|
|
113
|
-
), K =
|
|
113
|
+
), K = r.useCallback(
|
|
114
114
|
(e) => {
|
|
115
|
-
const t = typeof e == "function" ? e(
|
|
116
|
-
$ ? $(t) :
|
|
115
|
+
const t = typeof e == "function" ? e(U) : e;
|
|
116
|
+
$ ? $(t) : Ae(t);
|
|
117
117
|
},
|
|
118
|
-
[
|
|
119
|
-
),
|
|
118
|
+
[U, $]
|
|
119
|
+
), m = _e({
|
|
120
120
|
data: l,
|
|
121
121
|
columns: n,
|
|
122
|
-
getCoreRowModel:
|
|
122
|
+
getCoreRowModel: Ze(),
|
|
123
123
|
// Pagination
|
|
124
|
-
...
|
|
125
|
-
getPaginationRowModel:
|
|
124
|
+
...p && {
|
|
125
|
+
getPaginationRowModel: Ye(),
|
|
126
126
|
initialState: {
|
|
127
127
|
pagination: {
|
|
128
128
|
pageSize: q
|
|
@@ -130,118 +130,118 @@ function Rt({
|
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
// Sorting
|
|
133
|
-
...
|
|
134
|
-
getSortedRowModel:
|
|
133
|
+
...c && {
|
|
134
|
+
getSortedRowModel: Xe(),
|
|
135
135
|
onSortingChange: Ge
|
|
136
136
|
},
|
|
137
137
|
// Column Filtering
|
|
138
138
|
...d && {
|
|
139
139
|
getFilteredRowModel: X(),
|
|
140
|
-
onColumnFiltersChange:
|
|
140
|
+
onColumnFiltersChange: ze
|
|
141
141
|
},
|
|
142
142
|
// Global Filtering
|
|
143
143
|
...h && {
|
|
144
144
|
getFilteredRowModel: X(),
|
|
145
|
-
onGlobalFilterChange:
|
|
145
|
+
onGlobalFilterChange: He,
|
|
146
146
|
globalFilterFn: "includesString"
|
|
147
147
|
},
|
|
148
148
|
// Row Selection
|
|
149
149
|
...g && {
|
|
150
150
|
enableRowSelection: !0,
|
|
151
|
-
onRowSelectionChange:
|
|
151
|
+
onRowSelectionChange: je
|
|
152
152
|
},
|
|
153
153
|
// Column Ordering
|
|
154
|
-
...
|
|
155
|
-
onColumnOrderChange:
|
|
154
|
+
...y && {
|
|
155
|
+
onColumnOrderChange: Ee
|
|
156
156
|
},
|
|
157
157
|
// Column Pinning
|
|
158
|
-
...
|
|
159
|
-
onColumnPinningChange:
|
|
158
|
+
...S && {
|
|
159
|
+
onColumnPinningChange: Le
|
|
160
160
|
},
|
|
161
161
|
// Row Pinning
|
|
162
162
|
...u && {
|
|
163
163
|
enableRowPinning: !0,
|
|
164
|
-
onRowPinningChange:
|
|
164
|
+
onRowPinningChange: Oe,
|
|
165
165
|
keepPinnedRows: !0
|
|
166
166
|
},
|
|
167
167
|
// Grouping
|
|
168
|
-
...
|
|
169
|
-
getGroupedRowModel:
|
|
168
|
+
...f && {
|
|
169
|
+
getGroupedRowModel: Qe(),
|
|
170
170
|
getExpandedRowModel: Q(),
|
|
171
|
-
onGroupingChange:
|
|
171
|
+
onGroupingChange: Ue,
|
|
172
172
|
onExpandedChange: K
|
|
173
173
|
},
|
|
174
174
|
// Expanding
|
|
175
|
-
...
|
|
175
|
+
...T && {
|
|
176
176
|
getExpandedRowModel: Q(),
|
|
177
177
|
onExpandedChange: K,
|
|
178
|
-
getSubRows:
|
|
178
|
+
getSubRows: ie
|
|
179
179
|
},
|
|
180
180
|
// Faceting (for filter dropdowns)
|
|
181
|
-
...
|
|
182
|
-
getFacetedRowModel:
|
|
183
|
-
getFacetedUniqueValues:
|
|
184
|
-
getFacetedMinMaxValues:
|
|
181
|
+
...ae && {
|
|
182
|
+
getFacetedRowModel: Ke(),
|
|
183
|
+
getFacetedUniqueValues: Je(),
|
|
184
|
+
getFacetedMinMaxValues: We()
|
|
185
185
|
},
|
|
186
186
|
// State
|
|
187
187
|
state: {
|
|
188
188
|
sorting: A,
|
|
189
|
-
columnFilters:
|
|
189
|
+
columnFilters: G,
|
|
190
190
|
globalFilter: z,
|
|
191
|
-
rowSelection:
|
|
191
|
+
rowSelection: H,
|
|
192
192
|
columnOrder: j,
|
|
193
|
-
columnPinning:
|
|
194
|
-
rowPinning:
|
|
193
|
+
columnPinning: E,
|
|
194
|
+
rowPinning: L,
|
|
195
195
|
grouping: O,
|
|
196
|
-
expanded:
|
|
196
|
+
expanded: U
|
|
197
197
|
}
|
|
198
198
|
});
|
|
199
199
|
return /* @__PURE__ */ w(
|
|
200
200
|
"div",
|
|
201
201
|
{
|
|
202
|
-
ref:
|
|
203
|
-
className:
|
|
202
|
+
ref: be,
|
|
203
|
+
className: pe,
|
|
204
204
|
"data-hook": o,
|
|
205
205
|
"data-slot": "data-table",
|
|
206
206
|
"data-tracking-el": i,
|
|
207
207
|
"data-tracking-label": s,
|
|
208
208
|
children: [
|
|
209
|
-
_ && _(
|
|
209
|
+
_ && _(m),
|
|
210
210
|
/* @__PURE__ */ w(ut, { dataHook: `${o}-table`, children: [
|
|
211
|
-
/* @__PURE__ */ a(
|
|
211
|
+
/* @__PURE__ */ a(mt, { children: m.getHeaderGroups().map((e) => /* @__PURE__ */ a(C, { children: e.headers.map((t) => /* @__PURE__ */ a(ft, { colSpan: t.colSpan, children: t.isPlaceholder ? null : k(
|
|
212
212
|
t.column.columnDef.header,
|
|
213
213
|
t.getContext()
|
|
214
214
|
) }, t.id)) }, e.id)) }),
|
|
215
|
-
/* @__PURE__ */ a(ht, { children:
|
|
216
|
-
(e, t) => /* @__PURE__ */ a(
|
|
217
|
-
) : /* @__PURE__ */ w(
|
|
218
|
-
u &&
|
|
219
|
-
|
|
215
|
+
/* @__PURE__ */ a(ht, { children: le ? Array.from({ length: oe ?? q }).map(
|
|
216
|
+
(e, t) => /* @__PURE__ */ a(C, { children: m.getVisibleLeafColumns().map((Ft, Be) => /* @__PURE__ */ a(x, { children: /* @__PURE__ */ a(rt, { className: "h-4 w-full" }) }, `skeleton-${t}-${Be}`)) }, `skeleton-${t}`)
|
|
217
|
+
) : /* @__PURE__ */ w(qe, { children: [
|
|
218
|
+
u && m.getTopRows().map((e) => /* @__PURE__ */ a(
|
|
219
|
+
C,
|
|
220
220
|
{
|
|
221
221
|
"data-state": e.getIsSelected() && "selected",
|
|
222
|
-
children: e.getVisibleCells().map((t) => /* @__PURE__ */ a(
|
|
222
|
+
children: e.getVisibleCells().map((t) => /* @__PURE__ */ a(x, { children: k(
|
|
223
223
|
t.column.columnDef.cell,
|
|
224
224
|
t.getContext()
|
|
225
225
|
) }, t.id))
|
|
226
226
|
},
|
|
227
227
|
e.id
|
|
228
228
|
)),
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
m.getRowModel().rows?.length ? m.getRowModel().rows.map((e) => /* @__PURE__ */ a(
|
|
230
|
+
C,
|
|
231
231
|
{
|
|
232
232
|
"data-state": e.getIsSelected() && "selected",
|
|
233
|
-
children: e.getVisibleCells().map((t) => /* @__PURE__ */ a(
|
|
233
|
+
children: e.getVisibleCells().map((t) => /* @__PURE__ */ a(x, { children: k(
|
|
234
234
|
t.column.columnDef.cell,
|
|
235
235
|
t.getContext()
|
|
236
236
|
) }, t.id))
|
|
237
237
|
},
|
|
238
238
|
e.id
|
|
239
|
-
)) : /* @__PURE__ */ a(
|
|
240
|
-
u &&
|
|
241
|
-
|
|
239
|
+
)) : /* @__PURE__ */ a(C, { children: /* @__PURE__ */ a(x, { colSpan: m.getVisibleLeafColumns().length, children: ne }) }),
|
|
240
|
+
u && m.getBottomRows().map((e) => /* @__PURE__ */ a(
|
|
241
|
+
C,
|
|
242
242
|
{
|
|
243
243
|
"data-state": e.getIsSelected() && "selected",
|
|
244
|
-
children: e.getVisibleCells().map((t) => /* @__PURE__ */ a(
|
|
244
|
+
children: e.getVisibleCells().map((t) => /* @__PURE__ */ a(x, { children: k(
|
|
245
245
|
t.column.columnDef.cell,
|
|
246
246
|
t.getContext()
|
|
247
247
|
) }, t.id))
|
|
@@ -249,32 +249,32 @@ function Rt({
|
|
|
249
249
|
e.id
|
|
250
250
|
))
|
|
251
251
|
] }) }),
|
|
252
|
-
W && W(
|
|
252
|
+
W && W(m)
|
|
253
253
|
] }),
|
|
254
|
-
J && J(
|
|
254
|
+
J && J(m)
|
|
255
255
|
]
|
|
256
256
|
}
|
|
257
257
|
);
|
|
258
258
|
}
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
function
|
|
259
|
+
const yt = r.forwardRef(Rt);
|
|
260
|
+
yt.displayName = "DataTable";
|
|
261
|
+
function Tt({
|
|
262
262
|
column: n,
|
|
263
263
|
title: l,
|
|
264
264
|
className: o,
|
|
265
265
|
dataHook: i,
|
|
266
266
|
trackingEl: s,
|
|
267
267
|
trackingLabel: g,
|
|
268
|
-
align:
|
|
268
|
+
align: c = "left"
|
|
269
269
|
}) {
|
|
270
270
|
if (!n.getCanSort())
|
|
271
271
|
return /* @__PURE__ */ a(
|
|
272
272
|
"div",
|
|
273
273
|
{
|
|
274
|
-
className:
|
|
275
|
-
"text-left",
|
|
276
|
-
|
|
277
|
-
|
|
274
|
+
className: b(
|
|
275
|
+
"text-muted-foreground text-left text-sm leading-normal font-medium",
|
|
276
|
+
c === "right" && "text-right",
|
|
277
|
+
c === "center" && "text-center",
|
|
278
278
|
o
|
|
279
279
|
),
|
|
280
280
|
"data-hook": i,
|
|
@@ -288,10 +288,10 @@ function yt({
|
|
|
288
288
|
return /* @__PURE__ */ a(
|
|
289
289
|
"div",
|
|
290
290
|
{
|
|
291
|
-
className:
|
|
291
|
+
className: b(
|
|
292
292
|
"flex items-center",
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
c === "right" && "justify-end",
|
|
294
|
+
c === "center" && "justify-center",
|
|
295
295
|
o
|
|
296
296
|
),
|
|
297
297
|
"data-slot": "data-table-column-header",
|
|
@@ -301,21 +301,28 @@ function yt({
|
|
|
301
301
|
Y,
|
|
302
302
|
{
|
|
303
303
|
"aria-label": h,
|
|
304
|
-
className:
|
|
304
|
+
className: b("text-muted-foreground h-auto p-0 text-sm font-medium"),
|
|
305
305
|
dataHook: i || `column-header-${n.id}`,
|
|
306
|
-
size:
|
|
307
|
-
variant:
|
|
306
|
+
size: "sm",
|
|
307
|
+
variant: "ghost",
|
|
308
308
|
onClick: () => n.toggleSorting(d === "asc"),
|
|
309
309
|
children: [
|
|
310
310
|
/* @__PURE__ */ a("span", { "aria-hidden": "true", children: l }),
|
|
311
|
-
/* @__PURE__ */ a(
|
|
311
|
+
/* @__PURE__ */ a(
|
|
312
|
+
"span",
|
|
313
|
+
{
|
|
314
|
+
"aria-hidden": "true",
|
|
315
|
+
className: "flex size-3 items-center justify-center",
|
|
316
|
+
children: d === "desc" ? /* @__PURE__ */ a(et, { className: "size-3" }) : d === "asc" ? /* @__PURE__ */ a(tt, { className: "size-3" }) : /* @__PURE__ */ a(at, { className: "size-3" })
|
|
317
|
+
}
|
|
318
|
+
)
|
|
312
319
|
]
|
|
313
320
|
}
|
|
314
321
|
)
|
|
315
322
|
}
|
|
316
323
|
);
|
|
317
324
|
}
|
|
318
|
-
|
|
325
|
+
Tt.displayName = "DataTableColumnHeader";
|
|
319
326
|
function Pt({
|
|
320
327
|
row: n,
|
|
321
328
|
dataHook: l,
|
|
@@ -324,24 +331,24 @@ function Pt({
|
|
|
324
331
|
ariaLabel: s = "Open row actions menu",
|
|
325
332
|
children: g
|
|
326
333
|
}) {
|
|
327
|
-
return /* @__PURE__ */ w(
|
|
334
|
+
return /* @__PURE__ */ w(ct, { children: [
|
|
328
335
|
/* @__PURE__ */ a(dt, { asChild: !0, "data-slot": "data-table-row-actions", children: /* @__PURE__ */ a(
|
|
329
336
|
Y,
|
|
330
337
|
{
|
|
331
338
|
"aria-label": s,
|
|
332
339
|
dataHook: l || `row-actions-${n.id}`,
|
|
333
|
-
size:
|
|
340
|
+
size: "sm",
|
|
334
341
|
trackingEl: o,
|
|
335
342
|
trackingLabel: i,
|
|
336
|
-
variant:
|
|
337
|
-
children: /* @__PURE__ */ a(
|
|
343
|
+
variant: "ghost",
|
|
344
|
+
children: /* @__PURE__ */ a(nt, { className: "size-4" })
|
|
338
345
|
}
|
|
339
346
|
) }),
|
|
340
347
|
/* @__PURE__ */ a(gt, { align: "end", dataHook: `${l}-menu`, children: g })
|
|
341
348
|
] });
|
|
342
349
|
}
|
|
343
350
|
Pt.displayName = "DataTableRowActions";
|
|
344
|
-
function
|
|
351
|
+
function B({
|
|
345
352
|
dataHook: n,
|
|
346
353
|
trackingEl: l,
|
|
347
354
|
trackingLabel: o,
|
|
@@ -351,7 +358,7 @@ function U({
|
|
|
351
358
|
return /* @__PURE__ */ a(
|
|
352
359
|
"div",
|
|
353
360
|
{
|
|
354
|
-
className:
|
|
361
|
+
className: b(
|
|
355
362
|
"flex flex-wrap items-center justify-between gap-2 py-4",
|
|
356
363
|
i
|
|
357
364
|
),
|
|
@@ -363,7 +370,7 @@ function U({
|
|
|
363
370
|
}
|
|
364
371
|
);
|
|
365
372
|
}
|
|
366
|
-
function
|
|
373
|
+
function ee({
|
|
367
374
|
dataHook: n,
|
|
368
375
|
trackingEl: l,
|
|
369
376
|
trackingLabel: o,
|
|
@@ -373,7 +380,7 @@ function ae({
|
|
|
373
380
|
return /* @__PURE__ */ a(
|
|
374
381
|
"div",
|
|
375
382
|
{
|
|
376
|
-
className:
|
|
383
|
+
className: b("flex items-center gap-2", i),
|
|
377
384
|
"data-hook": n,
|
|
378
385
|
"data-slot": "data-table-toolbar-left",
|
|
379
386
|
"data-tracking-el": l,
|
|
@@ -382,8 +389,8 @@ function ae({
|
|
|
382
389
|
}
|
|
383
390
|
);
|
|
384
391
|
}
|
|
385
|
-
|
|
386
|
-
function
|
|
392
|
+
ee.displayName = "DataTableToolbar.Left";
|
|
393
|
+
function te({
|
|
387
394
|
dataHook: n,
|
|
388
395
|
trackingEl: l,
|
|
389
396
|
trackingLabel: o,
|
|
@@ -393,7 +400,7 @@ function ne({
|
|
|
393
400
|
return /* @__PURE__ */ a(
|
|
394
401
|
"div",
|
|
395
402
|
{
|
|
396
|
-
className:
|
|
403
|
+
className: b("flex items-center gap-2", i),
|
|
397
404
|
"data-hook": n,
|
|
398
405
|
"data-slot": "data-table-toolbar-right",
|
|
399
406
|
"data-tracking-el": l,
|
|
@@ -402,50 +409,50 @@ function ne({
|
|
|
402
409
|
}
|
|
403
410
|
);
|
|
404
411
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
function
|
|
412
|
+
te.displayName = "DataTableToolbar.Right";
|
|
413
|
+
B.Left = ee;
|
|
414
|
+
B.Right = te;
|
|
415
|
+
B.displayName = "DataTableToolbar";
|
|
416
|
+
function Nt({
|
|
410
417
|
table: n,
|
|
411
418
|
dataHook: l,
|
|
412
419
|
trackingEl: o,
|
|
413
420
|
trackingLabel: i,
|
|
414
421
|
ariaLabel: s = "Search table",
|
|
415
422
|
placeholder: g = "Search...",
|
|
416
|
-
column:
|
|
423
|
+
column: c,
|
|
417
424
|
width: d,
|
|
418
425
|
className: h
|
|
419
426
|
}) {
|
|
420
|
-
const
|
|
421
|
-
|
|
427
|
+
const p = c ? n.getColumn(c)?.getFilterValue() ?? "" : n.getState().globalFilter ?? "", S = (u) => {
|
|
428
|
+
c ? n.getColumn(c)?.setFilterValue(u) : n.setGlobalFilter(u);
|
|
422
429
|
};
|
|
423
430
|
return /* @__PURE__ */ a(
|
|
424
431
|
"div",
|
|
425
432
|
{
|
|
426
|
-
className:
|
|
433
|
+
className: b(!d && "w-full max-w-sm", h),
|
|
427
434
|
"data-slot": "data-table-search",
|
|
428
435
|
style: d ? { width: d, minWidth: d } : void 0,
|
|
429
|
-
children: /* @__PURE__ */
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
}
|
|
443
|
-
)
|
|
436
|
+
children: /* @__PURE__ */ w(ot, { className: "rounded-full", dataHook: l, children: [
|
|
437
|
+
/* @__PURE__ */ a(
|
|
438
|
+
it,
|
|
439
|
+
{
|
|
440
|
+
"aria-label": s,
|
|
441
|
+
placeholder: g,
|
|
442
|
+
trackingEl: o,
|
|
443
|
+
trackingLabel: i,
|
|
444
|
+
type: "text",
|
|
445
|
+
value: p,
|
|
446
|
+
onChange: (u) => S(u.target.value)
|
|
447
|
+
}
|
|
448
|
+
),
|
|
449
|
+
/* @__PURE__ */ a(st, { className: "pr-3", children: /* @__PURE__ */ a(lt, { className: "size-4" }) })
|
|
450
|
+
] })
|
|
444
451
|
}
|
|
445
452
|
);
|
|
446
453
|
}
|
|
447
|
-
|
|
448
|
-
function
|
|
454
|
+
Nt.displayName = "DataTableSearch";
|
|
455
|
+
function Dt({
|
|
449
456
|
table: n,
|
|
450
457
|
dataHook: l,
|
|
451
458
|
trackingEl: o,
|
|
@@ -453,8 +460,8 @@ function Nt({
|
|
|
453
460
|
className: s,
|
|
454
461
|
ariaLabel: g = "Table pagination"
|
|
455
462
|
}) {
|
|
456
|
-
const
|
|
457
|
-
page:
|
|
463
|
+
const c = n.getState().pagination.pageIndex + 1, d = n.getPageCount(), h = n.getState().pagination.pageSize, p = n.getFilteredRowModel().rows.length, S = p === 0 ? 0 : (c - 1) * h + 1, u = Math.min(c * h, p), y = pt({
|
|
464
|
+
page: c,
|
|
458
465
|
totalPages: d,
|
|
459
466
|
siblingCount: 1,
|
|
460
467
|
boundaryCount: 1
|
|
@@ -462,56 +469,56 @@ function Nt({
|
|
|
462
469
|
return /* @__PURE__ */ w(
|
|
463
470
|
"div",
|
|
464
471
|
{
|
|
465
|
-
className:
|
|
472
|
+
className: b("flex items-center justify-end gap-4", s),
|
|
466
473
|
"data-hook": l,
|
|
467
474
|
"data-slot": "data-table-pagination",
|
|
468
475
|
"data-tracking-el": o,
|
|
469
476
|
"data-tracking-label": i,
|
|
470
477
|
children: [
|
|
471
|
-
/* @__PURE__ */ a("span", { className: "text-muted-foreground text-sm", children:
|
|
478
|
+
/* @__PURE__ */ a("span", { className: "text-muted-foreground text-sm", children: p === 0 ? "0 of 0" : `${S}-${u} of ${p}` }),
|
|
472
479
|
/* @__PURE__ */ a(
|
|
473
|
-
|
|
480
|
+
bt,
|
|
474
481
|
{
|
|
475
482
|
ariaLabel: g,
|
|
476
483
|
className: "mx-0 w-auto justify-end",
|
|
477
484
|
dataHook: `${l}-nav`,
|
|
478
|
-
children: /* @__PURE__ */ a(
|
|
479
|
-
|
|
485
|
+
children: /* @__PURE__ */ a(wt, { children: y.map((f, T) => f === "previous" ? /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
|
|
486
|
+
Ct,
|
|
480
487
|
{
|
|
481
488
|
disabled: !n.getCanPreviousPage(),
|
|
482
489
|
onClick: () => n.previousPage()
|
|
483
490
|
}
|
|
484
|
-
) }, "previous") :
|
|
485
|
-
|
|
491
|
+
) }, "previous") : f === "next" ? /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
|
|
492
|
+
St,
|
|
486
493
|
{
|
|
487
494
|
disabled: !n.getCanNextPage(),
|
|
488
495
|
onClick: () => n.nextPage()
|
|
489
496
|
}
|
|
490
|
-
) }, "next") :
|
|
491
|
-
|
|
497
|
+
) }, "next") : f === "ellipsis" ? /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(xt, {}) }, `ellipsis-${T}`) : /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(
|
|
498
|
+
kt,
|
|
492
499
|
{
|
|
493
|
-
isActive:
|
|
494
|
-
page:
|
|
495
|
-
onClick: () => n.setPageIndex(
|
|
500
|
+
isActive: f === c,
|
|
501
|
+
page: f,
|
|
502
|
+
onClick: () => n.setPageIndex(f - 1)
|
|
496
503
|
}
|
|
497
|
-
) },
|
|
504
|
+
) }, f)) })
|
|
498
505
|
}
|
|
499
506
|
)
|
|
500
507
|
]
|
|
501
508
|
}
|
|
502
509
|
);
|
|
503
510
|
}
|
|
504
|
-
|
|
505
|
-
function
|
|
511
|
+
Dt.displayName = "DataTablePagination";
|
|
512
|
+
function It({
|
|
506
513
|
table: n,
|
|
507
514
|
dataHook: l,
|
|
508
515
|
trackingEl: o,
|
|
509
516
|
trackingLabel: i
|
|
510
517
|
}) {
|
|
511
518
|
return /* @__PURE__ */ a(
|
|
512
|
-
|
|
519
|
+
Z,
|
|
513
520
|
{
|
|
514
|
-
|
|
521
|
+
"aria-label": "Select all",
|
|
515
522
|
checked: n.getIsAllPageRowsSelected() || n.getIsSomePageRowsSelected() && "indeterminate",
|
|
516
523
|
dataHook: l || "select-all-checkbox",
|
|
517
524
|
trackingEl: o,
|
|
@@ -520,17 +527,17 @@ function Mt({
|
|
|
520
527
|
}
|
|
521
528
|
);
|
|
522
529
|
}
|
|
523
|
-
|
|
524
|
-
function
|
|
530
|
+
It.displayName = "DataTableSelectAllCheckbox";
|
|
531
|
+
function Mt({
|
|
525
532
|
row: n,
|
|
526
533
|
dataHook: l,
|
|
527
534
|
trackingEl: o,
|
|
528
535
|
trackingLabel: i
|
|
529
536
|
}) {
|
|
530
537
|
return /* @__PURE__ */ a(
|
|
531
|
-
|
|
538
|
+
Z,
|
|
532
539
|
{
|
|
533
|
-
|
|
540
|
+
"aria-label": "Select row",
|
|
534
541
|
checked: n.getIsSelected(),
|
|
535
542
|
dataHook: l || `select-row-${n.id}`,
|
|
536
543
|
disabled: !n.getCanSelect(),
|
|
@@ -540,16 +547,16 @@ function It({
|
|
|
540
547
|
}
|
|
541
548
|
);
|
|
542
549
|
}
|
|
543
|
-
|
|
550
|
+
Mt.displayName = "DataTableSelectRowCheckbox";
|
|
544
551
|
export {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
552
|
+
yt as DataTable,
|
|
553
|
+
Tt as DataTableColumnHeader,
|
|
554
|
+
Dt as DataTablePagination,
|
|
548
555
|
Pt as DataTableRowActions,
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
556
|
+
Nt as DataTableSearch,
|
|
557
|
+
It as DataTableSelectAllCheckbox,
|
|
558
|
+
Mt as DataTableSelectRowCheckbox,
|
|
559
|
+
B as DataTableToolbar,
|
|
553
560
|
qt as createColumnHelper,
|
|
554
561
|
_t as flexRender
|
|
555
562
|
};
|