@cryptlex/web-components 1.3.3 → 1.3.4
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/components/data-table/column-picker.es.js +7 -10
- package/dist/components/data-table/column-picker.es.js.map +1 -1
- package/dist/components/data-table/data-table.es.js +41 -41
- package/dist/components/data-table/data-table.es.js.map +1 -1
- package/dist/components/data-table/table-actions.es.js +15 -19
- package/dist/components/data-table/table-actions.es.js.map +1 -1
- package/dist/components/data-table/table-commons.es.js +21 -24
- package/dist/components/data-table/table-commons.es.js.map +1 -1
- package/dist/components/data-table/table-utils/createTableFetchFn.es.js +8 -9
- package/dist/components/data-table/table-utils/createTableFetchFn.es.js.map +1 -1
- package/dist/components/data-table/table-utils/types.es.js.map +1 -1
- package/dist/components/info-card/info-card.es.js +11 -14
- package/dist/components/info-card/info-card.es.js.map +1 -1
- package/dist/components/sidebar/app-layout.es.js +2 -5
- package/dist/components/sidebar/app-layout.es.js.map +1 -1
- package/dist/components/ui/avatar.es.js +12 -14
- package/dist/components/ui/avatar.es.js.map +1 -1
- package/dist/components/ui/button.es.js +1 -1
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/chart.es.js +40 -51
- package/dist/components/ui/chart.es.js.map +1 -1
- package/dist/components/ui/collapsible.es.js +1 -0
- package/dist/components/ui/collapsible.es.js.map +1 -1
- package/dist/components/ui/dialog.es.js +23 -22
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/components/ui/drawer.es.js +5 -38
- package/dist/components/ui/drawer.es.js.map +1 -1
- package/dist/components/ui/form.es.js +28 -29
- package/dist/components/ui/form.es.js.map +1 -1
- package/dist/components/ui/mutli-select.es.js +8 -10
- package/dist/components/ui/mutli-select.es.js.map +1 -1
- package/dist/components/ui/password-input.es.js +9 -8
- package/dist/components/ui/password-input.es.js.map +1 -1
- package/dist/components/ui/search-input.es.js +5 -4
- package/dist/components/ui/search-input.es.js.map +1 -1
- package/dist/components/ui/select.es.js +4 -9
- package/dist/components/ui/select.es.js.map +1 -1
- package/dist/components/ui/separator.es.js +17 -18
- package/dist/components/ui/separator.es.js.map +1 -1
- package/dist/components/ui/sheet.es.js +1 -0
- package/dist/components/ui/sheet.es.js.map +1 -1
- package/dist/components/ui/sonner.es.js +3 -2
- package/dist/components/ui/sonner.es.js.map +1 -1
- package/dist/components/ui/tooltip.es.js +9 -8
- package/dist/components/ui/tooltip.es.js.map +1 -1
- package/dist/index.es.d.ts +12 -67
- package/dist/index.es.js +104 -113
- package/dist/index.es.js.map +1 -1
- package/package.json +9 -6
- package/dist/components/data-table/table-utils/fetch.es.js +0 -40
- package/dist/components/data-table/table-utils/fetch.es.js.map +0 -1
- package/dist/components/ui/dynamic-input.es.js +0 -141
- package/dist/components/ui/dynamic-input.es.js.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,90 +1,87 @@
|
|
|
1
1
|
import { Accordion as t, AccordionContent as a, AccordionItem as n, AccordionTrigger as i } from "./components/ui/accordion.es.js";
|
|
2
2
|
import { Avatar as m, AvatarFallback as l, AvatarImage as d } from "./components/ui/avatar.es.js";
|
|
3
3
|
import { Badge as S, badgeVariants as g } from "./components/ui/badge.es.js";
|
|
4
|
-
import { Breadcrumb as
|
|
4
|
+
import { Breadcrumb as b, BreadcrumbEllipsis as C, BreadcrumbItem as D, BreadcrumbLink as x, BreadcrumbList as c, BreadcrumbPage as f, BreadcrumbSeparator as s } from "./components/ui/breadcrumb.es.js";
|
|
5
5
|
import { Button as I, buttonVariants as P } from "./components/ui/button.es.js";
|
|
6
6
|
import { Calendar as F } from "./components/ui/calendar.es.js";
|
|
7
|
-
import { Card as E, CardContent as
|
|
8
|
-
import { ChartContainer as
|
|
7
|
+
import { Card as E, CardContent as R, CardDescription as v, CardFooter as h, CardHeader as A, CardTitle as O } from "./components/ui/card.es.js";
|
|
8
|
+
import { ChartContainer as B, ChartLegend as _, ChartLegendContent as y, ChartStyle as G, ChartTooltip as H, ChartTooltipContent as k } from "./components/ui/chart.es.js";
|
|
9
9
|
import { Checkbox as V } from "./components/ui/checkbox.es.js";
|
|
10
10
|
import { Collapsible as z, CollapsibleContent as K, CollapsibleTrigger as X } from "./components/ui/collapsible.es.js";
|
|
11
11
|
import { Command as q, CommandDialog as J, CommandEmpty as Q, CommandGroup as W, CommandInput as Z, CommandItem as $, CommandList as ee, CommandSeparator as oe, CommandShortcut as re } from "./components/ui/command.es.js";
|
|
12
12
|
import { Dialog as ae, DialogClose as ne, DialogContent as ie, DialogDescription as pe, DialogFooter as me, DialogHeader as le, DialogOverlay as de, DialogPortal as ue, DialogTitle as Se, DialogTrigger as ge } from "./components/ui/dialog.es.js";
|
|
13
|
-
import { Drawer as
|
|
14
|
-
import { DropdownMenu as Fe, DropdownMenuCheckboxItem as we, DropdownMenuContent as Ee, DropdownMenuGroup as
|
|
13
|
+
import { Drawer as be, DrawerClose as Ce, DrawerContent as De, DrawerDescription as xe, DrawerFooter as ce, DrawerHeader as fe, DrawerOverlay as se, DrawerPortal as Me, DrawerTitle as Ie, DrawerTrigger as Pe } from "./components/ui/drawer.es.js";
|
|
14
|
+
import { DropdownMenu as Fe, DropdownMenuCheckboxItem as we, DropdownMenuContent as Ee, DropdownMenuGroup as Re, DropdownMenuItem as ve, DropdownMenuLabel as he, DropdownMenuPortal as Ae, DropdownMenuRadioGroup as Oe, DropdownMenuRadioItem as Ne, DropdownMenuSeparator as Be, DropdownMenuShortcut as _e, DropdownMenuSub as ye, DropdownMenuSubContent as Ge, DropdownMenuSubTrigger as He, DropdownMenuTrigger as ke } from "./components/ui/dropdown-menu.es.js";
|
|
15
15
|
import { Form as Ve, FormControl as Ye, FormDescription as ze, FormField as Ke, FormItem as Xe, FormLabel as je, FormMessage as qe, useFormField as Je } from "./components/ui/form.es.js";
|
|
16
16
|
import { Input as We } from "./components/ui/input.es.js";
|
|
17
17
|
import { InputOTP as $e, InputOTPGroup as eo, InputOTPSeparator as oo, InputOTPSlot as ro } from "./components/ui/input-otp.es.js";
|
|
18
18
|
import { Label as ao } from "./components/ui/label.es.js";
|
|
19
19
|
import { Loader as io } from "./components/ui/loader.es.js";
|
|
20
20
|
import "./components/ui/mutli-select.es.js";
|
|
21
|
-
import { NavigationMenu as mo, NavigationMenuContent as lo, NavigationMenuIndicator as uo, NavigationMenuItem as So, NavigationMenuLink as go, NavigationMenuList as To, NavigationMenuListItem as
|
|
21
|
+
import { NavigationMenu as mo, NavigationMenuContent as lo, NavigationMenuIndicator as uo, NavigationMenuItem as So, NavigationMenuLink as go, NavigationMenuList as To, NavigationMenuListItem as bo, NavigationMenuTrigger as Co, NavigationMenuViewport as Do, navigationMenuTriggerStyle as xo } from "./components/ui/navigation-menu.es.js";
|
|
22
22
|
import { Pagination as fo, PaginationContent as so, PaginationEllipsis as Mo, PaginationItem as Io, PaginationLink as Po, PaginationNext as Lo, PaginationPrevious as Fo } from "./components/ui/pagination.es.js";
|
|
23
23
|
import { PasswordInput as Eo } from "./components/ui/password-input.es.js";
|
|
24
|
-
import { Popover as
|
|
25
|
-
import { RadioGroup as
|
|
24
|
+
import { Popover as vo, PopoverAnchor as ho, PopoverContent as Ao, PopoverTrigger as Oo } from "./components/ui/popover.es.js";
|
|
25
|
+
import { RadioGroup as Bo, RadioGroupItem as _o } from "./components/ui/radio-group.es.js";
|
|
26
26
|
import { SearchInput as Go } from "./components/ui/search-input.es.js";
|
|
27
|
-
import { Select as
|
|
27
|
+
import { Select as ko, SelectContent as Uo, SelectGroup as Vo, SelectItem as Yo, SelectLabel as zo, SelectScrollDownButton as Ko, SelectScrollUpButton as Xo, SelectSeparator as jo, SelectTrigger as qo, SelectValue as Jo } from "./components/ui/select.es.js";
|
|
28
28
|
import { Separator as Wo } from "./components/ui/separator.es.js";
|
|
29
29
|
import { Sheet as $o, SheetClose as er, SheetContent as or, SheetDescription as rr, SheetFooter as tr, SheetHeader as ar, SheetOverlay as nr, SheetPortal as ir, SheetTitle as pr, SheetTrigger as mr } from "./components/ui/sheet.es.js";
|
|
30
|
-
import { Sidebar as dr, SidebarContent as ur, SidebarFooter as Sr, SidebarGroup as gr, SidebarGroupAction as Tr, SidebarGroupContent as
|
|
31
|
-
import { Skeleton as
|
|
30
|
+
import { Sidebar as dr, SidebarContent as ur, SidebarFooter as Sr, SidebarGroup as gr, SidebarGroupAction as Tr, SidebarGroupContent as br, SidebarGroupLabel as Cr, SidebarHeader as Dr, SidebarInput as xr, SidebarInset as cr, SidebarMenu as fr, SidebarMenuAction as sr, SidebarMenuBadge as Mr, SidebarMenuButton as Ir, SidebarMenuItem as Pr, SidebarMenuSkeleton as Lr, SidebarMenuSub as Fr, SidebarMenuSubButton as wr, SidebarMenuSubItem as Er, SidebarProvider as Rr, SidebarRail as vr, SidebarSeparator as hr, SidebarTrigger as Ar, useSidebar as Or } from "./components/ui/sidebar.es.js";
|
|
31
|
+
import { Skeleton as Br } from "./components/ui/skeleton.es.js";
|
|
32
32
|
import { Toaster as yr } from "./components/ui/sonner.es.js";
|
|
33
|
-
import { Table as
|
|
33
|
+
import { Table as Hr, TableBody as kr, TableCaption as Ur, TableCell as Vr, TableFooter as Yr, TableHead as zr, TableHeader as Kr, TableRow as Xr } from "./components/ui/table.es.js";
|
|
34
34
|
import { Tabs as qr, TabsContent as Jr, TabsList as Qr, TabsTrigger as Wr } from "./components/ui/tabs.es.js";
|
|
35
35
|
import { Tooltip as $r, TooltipContent as et, TooltipProvider as ot, TooltipTrigger as rt } from "./components/ui/tooltip.es.js";
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import { SideBar as na } from "./components/sidebar/sidebar.es.js";
|
|
53
|
-
import { StaticDataTable as pa } from "./components/static-data-table/data-table.es.js";
|
|
36
|
+
import { TablePageLayout as at } from "./components/ui/table-page-layout.es.js";
|
|
37
|
+
import { useIsMobile as it } from "./hooks/use-mobile.es.js";
|
|
38
|
+
import { cn as mt, getThemeHue as lt, logout as dt, setThemeHue as ut } from "./utils/index.es.js";
|
|
39
|
+
import { DataTable as gt } from "./components/data-table/data-table.es.js";
|
|
40
|
+
import { CHECK_BOX as bt, DEFAULT_DATE_COLUMNS as Ct, ID_COLUMN as Dt } from "./components/data-table/table-commons.es.js";
|
|
41
|
+
import { COMPARISON_OPERATOR_LABELS as ct, DEFAULT_FILTERABLE_FIELDS as ft, FILTERABLE_PROPERTY_TYPES as st, FILTER_COMPARISON_OPERATORS as Mt, OPERATORS_FOR_FILTER_TYPE as It, RESOURCE_DEFINITIONS as Pt, RESOURCE_NAMES as Lt, getLicenseStatus as Ft, getResourceDisplayName as wt, getValidityDisplay as Et, getValueFromData as Rt, secondsToDuration as vt } from "./components/data-table/table-utils/constants.es.js";
|
|
42
|
+
import { createTableFetchFn as At } from "./components/data-table/table-utils/createTableFetchFn.es.js";
|
|
43
|
+
import { FormatDate as Nt } from "./components/data-table/table-utils/date.es.js";
|
|
44
|
+
import { getLinkDisplay as _t } from "./components/data-table/table-utils/link-display.es.js";
|
|
45
|
+
import { convertCamelCaseToTitleCase as Gt, convertToTitleCase as Ht, pluralizeTimes as kt } from "./components/data-table/table-utils/string.es.js";
|
|
46
|
+
import { DYNAMIC_INPUT_TARGET as Vt } from "./components/data-table/table-utils/types.es.js";
|
|
47
|
+
import { InfoCard as zt } from "./components/info-card/info-card.es.js";
|
|
48
|
+
import { AppLayout as Xt } from "./components/sidebar/app-layout.es.js";
|
|
49
|
+
import { NavMain as qt } from "./components/sidebar/nav-main.es.js";
|
|
50
|
+
import { SideBar as Qt } from "./components/sidebar/sidebar.es.js";
|
|
51
|
+
import { StaticDataTable as Zt } from "./components/static-data-table/data-table.es.js";
|
|
54
52
|
export {
|
|
55
53
|
t as Accordion,
|
|
56
54
|
a as AccordionContent,
|
|
57
55
|
n as AccordionItem,
|
|
58
56
|
i as AccordionTrigger,
|
|
59
|
-
|
|
60
|
-
oa as AppLayout,
|
|
57
|
+
Xt as AppLayout,
|
|
61
58
|
m as Avatar,
|
|
62
59
|
l as AvatarFallback,
|
|
63
60
|
d as AvatarImage,
|
|
64
61
|
S as Badge,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
b as Breadcrumb,
|
|
63
|
+
C as BreadcrumbEllipsis,
|
|
64
|
+
D as BreadcrumbItem,
|
|
65
|
+
x as BreadcrumbLink,
|
|
66
|
+
c as BreadcrumbList,
|
|
70
67
|
f as BreadcrumbPage,
|
|
71
68
|
s as BreadcrumbSeparator,
|
|
72
69
|
I as Button,
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
bt as CHECK_BOX,
|
|
71
|
+
ct as COMPARISON_OPERATOR_LABELS,
|
|
75
72
|
F as Calendar,
|
|
76
73
|
E as Card,
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
R as CardContent,
|
|
75
|
+
v as CardDescription,
|
|
79
76
|
h as CardFooter,
|
|
80
|
-
|
|
77
|
+
A as CardHeader,
|
|
81
78
|
O as CardTitle,
|
|
82
|
-
|
|
79
|
+
B as ChartContainer,
|
|
83
80
|
_ as ChartLegend,
|
|
84
81
|
y as ChartLegendContent,
|
|
85
82
|
G as ChartStyle,
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
H as ChartTooltip,
|
|
84
|
+
k as ChartTooltipContent,
|
|
88
85
|
V as Checkbox,
|
|
89
86
|
z as Collapsible,
|
|
90
87
|
K as CollapsibleContent,
|
|
@@ -98,10 +95,10 @@ export {
|
|
|
98
95
|
ee as CommandList,
|
|
99
96
|
oe as CommandSeparator,
|
|
100
97
|
re as CommandShortcut,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
Ct as DEFAULT_DATE_COLUMNS,
|
|
99
|
+
ft as DEFAULT_FILTERABLE_FIELDS,
|
|
100
|
+
Vt as DYNAMIC_INPUT_TARGET,
|
|
101
|
+
gt as DataTable,
|
|
105
102
|
ae as Dialog,
|
|
106
103
|
ne as DialogClose,
|
|
107
104
|
ie as DialogContent,
|
|
@@ -112,11 +109,11 @@ export {
|
|
|
112
109
|
ue as DialogPortal,
|
|
113
110
|
Se as DialogTitle,
|
|
114
111
|
ge as DialogTrigger,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
be as Drawer,
|
|
113
|
+
Ce as DrawerClose,
|
|
114
|
+
De as DrawerContent,
|
|
115
|
+
xe as DrawerDescription,
|
|
116
|
+
ce as DrawerFooter,
|
|
120
117
|
fe as DrawerHeader,
|
|
121
118
|
se as DrawerOverlay,
|
|
122
119
|
Me as DrawerPortal,
|
|
@@ -125,21 +122,20 @@ export {
|
|
|
125
122
|
Fe as DropdownMenu,
|
|
126
123
|
we as DropdownMenuCheckboxItem,
|
|
127
124
|
Ee as DropdownMenuContent,
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
Re as DropdownMenuGroup,
|
|
126
|
+
ve as DropdownMenuItem,
|
|
130
127
|
he as DropdownMenuLabel,
|
|
131
|
-
|
|
128
|
+
Ae as DropdownMenuPortal,
|
|
132
129
|
Oe as DropdownMenuRadioGroup,
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
Ne as DropdownMenuRadioItem,
|
|
131
|
+
Be as DropdownMenuSeparator,
|
|
135
132
|
_e as DropdownMenuShortcut,
|
|
136
133
|
ye as DropdownMenuSub,
|
|
137
134
|
Ge as DropdownMenuSubContent,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
Ft as FILTER_COMPARISON_OPERATORS,
|
|
135
|
+
He as DropdownMenuSubTrigger,
|
|
136
|
+
ke as DropdownMenuTrigger,
|
|
137
|
+
st as FILTERABLE_PROPERTY_TYPES,
|
|
138
|
+
Mt as FILTER_COMPARISON_OPERATORS,
|
|
143
139
|
Ve as Form,
|
|
144
140
|
Ye as FormControl,
|
|
145
141
|
ze as FormDescription,
|
|
@@ -147,9 +143,9 @@ export {
|
|
|
147
143
|
Xe as FormItem,
|
|
148
144
|
je as FormLabel,
|
|
149
145
|
qe as FormMessage,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
Nt as FormatDate,
|
|
147
|
+
Dt as ID_COLUMN,
|
|
148
|
+
zt as InfoCard,
|
|
153
149
|
We as Input,
|
|
154
150
|
$e as InputOTP,
|
|
155
151
|
eo as InputOTPGroup,
|
|
@@ -157,17 +153,17 @@ export {
|
|
|
157
153
|
ro as InputOTPSlot,
|
|
158
154
|
ao as Label,
|
|
159
155
|
io as Loader,
|
|
160
|
-
|
|
156
|
+
qt as NavMain,
|
|
161
157
|
mo as NavigationMenu,
|
|
162
158
|
lo as NavigationMenuContent,
|
|
163
159
|
uo as NavigationMenuIndicator,
|
|
164
160
|
So as NavigationMenuItem,
|
|
165
161
|
go as NavigationMenuLink,
|
|
166
162
|
To as NavigationMenuList,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
163
|
+
bo as NavigationMenuListItem,
|
|
164
|
+
Co as NavigationMenuTrigger,
|
|
165
|
+
Do as NavigationMenuViewport,
|
|
166
|
+
It as OPERATORS_FOR_FILTER_TYPE,
|
|
171
167
|
fo as Pagination,
|
|
172
168
|
so as PaginationContent,
|
|
173
169
|
Mo as PaginationEllipsis,
|
|
@@ -176,17 +172,16 @@ export {
|
|
|
176
172
|
Lo as PaginationNext,
|
|
177
173
|
Fo as PaginationPrevious,
|
|
178
174
|
Eo as PasswordInput,
|
|
179
|
-
|
|
175
|
+
vo as Popover,
|
|
180
176
|
ho as PopoverAnchor,
|
|
181
|
-
|
|
177
|
+
Ao as PopoverContent,
|
|
182
178
|
Oo as PopoverTrigger,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
179
|
+
Pt as RESOURCE_DEFINITIONS,
|
|
180
|
+
Lt as RESOURCE_NAMES,
|
|
181
|
+
Bo as RadioGroup,
|
|
186
182
|
_o as RadioGroupItem,
|
|
187
|
-
nt as Search,
|
|
188
183
|
Go as SearchInput,
|
|
189
|
-
|
|
184
|
+
ko as Select,
|
|
190
185
|
Uo as SelectContent,
|
|
191
186
|
Vo as SelectGroup,
|
|
192
187
|
Yo as SelectItem,
|
|
@@ -207,17 +202,17 @@ export {
|
|
|
207
202
|
ir as SheetPortal,
|
|
208
203
|
pr as SheetTitle,
|
|
209
204
|
mr as SheetTrigger,
|
|
210
|
-
|
|
205
|
+
Qt as SideBar,
|
|
211
206
|
dr as Sidebar,
|
|
212
207
|
ur as SidebarContent,
|
|
213
208
|
Sr as SidebarFooter,
|
|
214
209
|
gr as SidebarGroup,
|
|
215
210
|
Tr as SidebarGroupAction,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
211
|
+
br as SidebarGroupContent,
|
|
212
|
+
Cr as SidebarGroupLabel,
|
|
213
|
+
Dr as SidebarHeader,
|
|
214
|
+
xr as SidebarInput,
|
|
215
|
+
cr as SidebarInset,
|
|
221
216
|
fr as SidebarMenu,
|
|
222
217
|
sr as SidebarMenuAction,
|
|
223
218
|
Mr as SidebarMenuBadge,
|
|
@@ -227,20 +222,20 @@ export {
|
|
|
227
222
|
Fr as SidebarMenuSub,
|
|
228
223
|
wr as SidebarMenuSubButton,
|
|
229
224
|
Er as SidebarMenuSubItem,
|
|
230
|
-
|
|
231
|
-
|
|
225
|
+
Rr as SidebarProvider,
|
|
226
|
+
vr as SidebarRail,
|
|
232
227
|
hr as SidebarSeparator,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
228
|
+
Ar as SidebarTrigger,
|
|
229
|
+
Br as Skeleton,
|
|
230
|
+
Zt as StaticDataTable,
|
|
231
|
+
Hr as Table,
|
|
232
|
+
kr as TableBody,
|
|
238
233
|
Ur as TableCaption,
|
|
239
234
|
Vr as TableCell,
|
|
240
235
|
Yr as TableFooter,
|
|
241
236
|
zr as TableHead,
|
|
242
237
|
Kr as TableHeader,
|
|
243
|
-
|
|
238
|
+
at as TablePageLayout,
|
|
244
239
|
Xr as TableRow,
|
|
245
240
|
qr as Tabs,
|
|
246
241
|
Jr as TabsContent,
|
|
@@ -251,29 +246,25 @@ export {
|
|
|
251
246
|
et as TooltipContent,
|
|
252
247
|
ot as TooltipProvider,
|
|
253
248
|
rt as TooltipTrigger,
|
|
254
|
-
Ht as US_BASE_URL,
|
|
255
249
|
g as badgeVariants,
|
|
256
250
|
P as buttonVariants,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
Jt as pluralizeTimes,
|
|
273
|
-
Bt as secondsToDuration,
|
|
274
|
-
Tt as setThemeHue,
|
|
251
|
+
mt as cn,
|
|
252
|
+
Gt as convertCamelCaseToTitleCase,
|
|
253
|
+
Ht as convertToTitleCase,
|
|
254
|
+
At as createTableFetchFn,
|
|
255
|
+
Ft as getLicenseStatus,
|
|
256
|
+
_t as getLinkDisplay,
|
|
257
|
+
wt as getResourceDisplayName,
|
|
258
|
+
lt as getThemeHue,
|
|
259
|
+
Et as getValidityDisplay,
|
|
260
|
+
Rt as getValueFromData,
|
|
261
|
+
dt as logout,
|
|
262
|
+
xo as navigationMenuTriggerStyle,
|
|
263
|
+
kt as pluralizeTimes,
|
|
264
|
+
vt as secondsToDuration,
|
|
265
|
+
ut as setThemeHue,
|
|
275
266
|
Je as useFormField,
|
|
276
|
-
|
|
267
|
+
it as useIsMobile,
|
|
277
268
|
Or as useSidebar
|
|
278
269
|
};
|
|
279
270
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptlex/web-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "React component library for Cryptlex web applications",
|
|
5
5
|
"author": "Cryptlex",
|
|
6
6
|
"type": "module",
|
|
@@ -62,10 +62,12 @@
|
|
|
62
62
|
"@tanstack/react-router": "^1.87.1",
|
|
63
63
|
"@tanstack/react-table": "^8.20.5",
|
|
64
64
|
"class-variance-authority": "^0.7.0",
|
|
65
|
+
"openapi-fetch": ">=0.13.3",
|
|
65
66
|
"clsx": "^2.1.1",
|
|
66
67
|
"cmdk": "1.0.0",
|
|
67
68
|
"date-fns": "^3.0.0",
|
|
68
69
|
"input-otp": "^1.4.1",
|
|
70
|
+
"lodash-es": "^4.17.21",
|
|
69
71
|
"lucide-react": "^0.453.0",
|
|
70
72
|
"react": "^18.3.1",
|
|
71
73
|
"react-day-picker": "8.10.1",
|
|
@@ -75,11 +77,12 @@
|
|
|
75
77
|
"sonner": "^1.7.0",
|
|
76
78
|
"tailwindcss": "^3.4.14",
|
|
77
79
|
"tailwindcss-animate": "^1.0.7",
|
|
80
|
+
"use-debounce": "^10.0.4",
|
|
78
81
|
"vaul": "^1.1.1",
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
82
|
+
"rollup-preserve-directives": "^1.1.3"
|
|
83
|
+
},
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"@cryptlex/web-api-types": "^1.17.0"
|
|
83
86
|
},
|
|
84
87
|
"devDependencies": {
|
|
85
88
|
"@eslint/js": "^9.11.1",
|
|
@@ -92,11 +95,11 @@
|
|
|
92
95
|
"@storybook/react": "^8.4.2",
|
|
93
96
|
"@storybook/react-vite": "^8.4.2",
|
|
94
97
|
"@storybook/test": "^8.4.2",
|
|
98
|
+
"@types/lodash-es": "^4.17.12",
|
|
95
99
|
"@types/node": "^22.7.8",
|
|
96
100
|
"@types/react": "^18.3.10",
|
|
97
101
|
"@types/react-dom": "^18.3.0",
|
|
98
102
|
"@vitejs/plugin-react": "^4.3.2",
|
|
99
|
-
"@types/lodash": "^4.17.1",
|
|
100
103
|
"autoprefixer": "^10.4.20",
|
|
101
104
|
"eslint": "^9.11.1",
|
|
102
105
|
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import i from "openapi-fetch";
|
|
2
|
-
const c = "AT";
|
|
3
|
-
function n() {
|
|
4
|
-
return localStorage.getItem(c);
|
|
5
|
-
}
|
|
6
|
-
const a = localStorage.getItem("apiBaseUrl") ?? "https://api.dev.cryptlex.com", h = async (t, s, o) => {
|
|
7
|
-
const e = await fetch(`${a}${t}`, {
|
|
8
|
-
method: s,
|
|
9
|
-
headers: {
|
|
10
|
-
"Content-Type": "application/json",
|
|
11
|
-
Authorization: `Bearer ${n()}`
|
|
12
|
-
},
|
|
13
|
-
body: o ? JSON.stringify(o) : null
|
|
14
|
-
});
|
|
15
|
-
if (e.ok) return await e.json();
|
|
16
|
-
throw await e.json();
|
|
17
|
-
}, r = i({
|
|
18
|
-
baseUrl: a
|
|
19
|
-
// TODO Telemetry signal
|
|
20
|
-
// headers: {}
|
|
21
|
-
}), l = {
|
|
22
|
-
async onRequest(t) {
|
|
23
|
-
return t.headers.set("Authorization", `Bearer ${n()}`), t;
|
|
24
|
-
}
|
|
25
|
-
}, u = {
|
|
26
|
-
async onResponse(t) {
|
|
27
|
-
if (!t.ok)
|
|
28
|
-
throw await t.json();
|
|
29
|
-
return t;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
r.use(l);
|
|
33
|
-
r.use(u);
|
|
34
|
-
export {
|
|
35
|
-
a as US_BASE_URL,
|
|
36
|
-
r as ctxClient,
|
|
37
|
-
h as fetchClient,
|
|
38
|
-
n as getAccessToken
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=fetch.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.es.js","sources":["../../../../lib/components/data-table/table-utils/fetch.ts"],"sourcesContent":["import type { paths } from '@cryptlex/web-api-types';\nimport createClient, { Middleware } from 'openapi-fetch';\nconst ACCESS_TOKEN = 'AT';\n\nexport function getAccessToken() {\n return localStorage.getItem(ACCESS_TOKEN);\n}\n// TODO: Use different urls for diff envs\nexport const US_BASE_URL = localStorage.getItem('apiBaseUrl') ?? 'https://api.dev.cryptlex.com';\ntype Methods = 'GET' | 'POST' | 'PATCH' | 'PUT';\n/**\n *\n * @param url\n * @param method\n * @param body\n * @returns\n */\nexport const fetchClient = async (url: string, method: Methods, body?: any) => {\n const response = await fetch(`${US_BASE_URL}${url}`, {\n method,\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${getAccessToken()}`,\n },\n body: body ? JSON.stringify(body) : null,\n });\n if (response.ok) return await response.json();\n throw await response.json();\n};\n\nexport const ctxClient = createClient<paths>({\n baseUrl: US_BASE_URL,\n // TODO Telemetry signal\n // headers: {}\n});\n\nconst authMiddleware: Middleware = {\n async onRequest(req) {\n req.headers.set('Authorization', `Bearer ${getAccessToken()}`);\n return req;\n },\n};\n\nconst errorMiddleware: Middleware = {\n async onResponse(res) {\n if (!res.ok) {\n throw await res.json();\n }\n return res;\n },\n};\n\nctxClient.use(authMiddleware);\nctxClient.use(errorMiddleware);\n"],"names":["ACCESS_TOKEN","getAccessToken","US_BASE_URL","fetchClient","url","method","body","response","ctxClient","createClient","authMiddleware","req","errorMiddleware","res"],"mappings":";AAEA,MAAMA,IAAe;AAEd,SAASC,IAAiB;AACxB,SAAA,aAAa,QAAQD,CAAY;AAC1C;AAEO,MAAME,IAAc,aAAa,QAAQ,YAAY,KAAK,gCASpDC,IAAc,OAAOC,GAAaC,GAAiBC,MAAe;AAC7E,QAAMC,IAAW,MAAM,MAAM,GAAGL,CAAW,GAAGE,CAAG,IAAI;AAAA,IACnD,QAAAC;AAAA,IACA,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,eAAiB,UAAUJ,GAAgB;AAAA,IAC7C;AAAA,IACA,MAAMK,IAAO,KAAK,UAAUA,CAAI,IAAI;AAAA,EAAA,CACrC;AACD,MAAIC,EAAS,GAAW,QAAA,MAAMA,EAAS,KAAK;AACtC,QAAA,MAAMA,EAAS,KAAK;AAC5B,GAEaC,IAAYC,EAAoB;AAAA,EAC3C,SAASP;AAAA;AAAA;AAGX,CAAC,GAEKQ,IAA6B;AAAA,EACjC,MAAM,UAAUC,GAAK;AACnB,WAAAA,EAAI,QAAQ,IAAI,iBAAiB,UAAUV,EAAgB,CAAA,EAAE,GACtDU;AAAA,EAAA;AAEX,GAEMC,IAA8B;AAAA,EAClC,MAAM,WAAWC,GAAK;AAChB,QAAA,CAACA,EAAI;AACD,YAAA,MAAMA,EAAI,KAAK;AAEhB,WAAAA;AAAA,EAAA;AAEX;AAEAL,EAAU,IAAIE,CAAc;AAC5BF,EAAU,IAAII,CAAe;"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "./accordion.es.js";
|
|
3
|
-
import "./avatar.es.js";
|
|
4
|
-
import "./badge.es.js";
|
|
5
|
-
import "./breadcrumb.es.js";
|
|
6
|
-
import { Button as N } from "./button.es.js";
|
|
7
|
-
import "./calendar.es.js";
|
|
8
|
-
import "./card.es.js";
|
|
9
|
-
import "./chart.es.js";
|
|
10
|
-
import "./checkbox.es.js";
|
|
11
|
-
import "@radix-ui/react-collapsible";
|
|
12
|
-
import "./command.es.js";
|
|
13
|
-
import "./dialog.es.js";
|
|
14
|
-
import "./drawer.es.js";
|
|
15
|
-
import "./dropdown-menu.es.js";
|
|
16
|
-
import "./form.es.js";
|
|
17
|
-
import "./input.es.js";
|
|
18
|
-
import "./input-otp.es.js";
|
|
19
|
-
import "./label.es.js";
|
|
20
|
-
import { cn as f } from "../../utils/index.es.js";
|
|
21
|
-
import { ChevronsUpDown as v, Command as g, Loader as w, Check as x } from "lucide-react";
|
|
22
|
-
import "./mutli-select.es.js";
|
|
23
|
-
import "./navigation-menu.es.js";
|
|
24
|
-
import "./pagination.es.js";
|
|
25
|
-
import "./password-input.es.js";
|
|
26
|
-
import { Popover as T, PopoverTrigger as b, PopoverContent as I } from "./popover.es.js";
|
|
27
|
-
import "./radio-group.es.js";
|
|
28
|
-
import * as h from "react";
|
|
29
|
-
import "./select.es.js";
|
|
30
|
-
import "./separator.es.js";
|
|
31
|
-
import "./sheet.es.js";
|
|
32
|
-
import "./sidebar.es.js";
|
|
33
|
-
import "sonner";
|
|
34
|
-
import "./table.es.js";
|
|
35
|
-
import "./tabs.es.js";
|
|
36
|
-
import "./tooltip.es.js";
|
|
37
|
-
import { useQuery as E } from "@tanstack/react-query";
|
|
38
|
-
import { CommandInput as R, CommandList as O, CommandItem as P } from "cmdk";
|
|
39
|
-
import { useDebounce as A } from "use-debounce";
|
|
40
|
-
import { DYNAMIC_INPUT_TARGET as y } from "../data-table/table-utils/types.es.js";
|
|
41
|
-
import { ctxClient as d } from "../data-table/table-utils/fetch.es.js";
|
|
42
|
-
const C = "w-[250px]";
|
|
43
|
-
function ve({ onChange: r, target: i, placeholder: p }) {
|
|
44
|
-
const [a, s] = h.useState(!1), [n, o] = h.useState(), c = h.useCallback(
|
|
45
|
-
(t) => {
|
|
46
|
-
o(t), r(t.id);
|
|
47
|
-
},
|
|
48
|
-
[r]
|
|
49
|
-
), m = n ? n.name : `Select ${y[i].toLocaleLowerCase()} `;
|
|
50
|
-
return /* @__PURE__ */ l(T, { open: a, onOpenChange: s, children: [
|
|
51
|
-
/* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ l(N, { variant: "outline", role: "combobox", className: f("justify-between", C), children: [
|
|
52
|
-
m,
|
|
53
|
-
/* @__PURE__ */ e(v, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
54
|
-
] }) }),
|
|
55
|
-
/* @__PURE__ */ e(I, { side: "bottom", className: f("p-0", C), children: /* @__PURE__ */ e(
|
|
56
|
-
D,
|
|
57
|
-
{
|
|
58
|
-
target: i,
|
|
59
|
-
selectedResult: n,
|
|
60
|
-
onSelectResult: c,
|
|
61
|
-
placeholder: p
|
|
62
|
-
}
|
|
63
|
-
) })
|
|
64
|
-
] });
|
|
65
|
-
}
|
|
66
|
-
function D({ selectedResult: r, onSelectResult: i, target: p, placeholder: a }) {
|
|
67
|
-
const [s, n] = h.useState("");
|
|
68
|
-
return /* @__PURE__ */ l(g, { className: "h-auto rounded-lg border border-b-0 shadow-md", children: [
|
|
69
|
-
/* @__PURE__ */ e(R, { value: s, onValueChange: (m) => {
|
|
70
|
-
n(m);
|
|
71
|
-
}, placeholder: a }),
|
|
72
|
-
/* @__PURE__ */ e(
|
|
73
|
-
G,
|
|
74
|
-
{
|
|
75
|
-
target: p,
|
|
76
|
-
query: s,
|
|
77
|
-
selectedResult: r,
|
|
78
|
-
onSelectResult: (m) => {
|
|
79
|
-
i(m);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
] });
|
|
84
|
-
}
|
|
85
|
-
function G({ query: r, selectedResult: i, onSelectResult: p, target: a }) {
|
|
86
|
-
const s = async () => a === y.USER ? await d.GET("/v3/users", {
|
|
87
|
-
params: {
|
|
88
|
-
query: {
|
|
89
|
-
page: 1,
|
|
90
|
-
limit: 30,
|
|
91
|
-
query: r,
|
|
92
|
-
userType: "user"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}).then((t) => t.data) : a === y.ORGANIZATION ? await d.GET("/v3/organizations", {
|
|
96
|
-
params: {
|
|
97
|
-
query: {
|
|
98
|
-
page: 1,
|
|
99
|
-
limit: 30,
|
|
100
|
-
query: r
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}).then((t) => t.data) : await d.GET("/v3/resellers", {
|
|
104
|
-
params: {
|
|
105
|
-
query: {
|
|
106
|
-
page: 1,
|
|
107
|
-
limit: 30,
|
|
108
|
-
query: r,
|
|
109
|
-
userType: "user"
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}).then((t) => t.data), [n] = A(r, 300), { data: o, isLoading: c, isError: m } = E({
|
|
113
|
-
queryKey: ["search", n],
|
|
114
|
-
queryFn: s
|
|
115
|
-
});
|
|
116
|
-
return /* @__PURE__ */ l(O, { children: [
|
|
117
|
-
/* @__PURE__ */ e("div", { className: "flex justify-center", children: c && /* @__PURE__ */ e(w, { className: "my-4" }) }),
|
|
118
|
-
!m && !c && !(o != null && o.length) && /* @__PURE__ */ e("div", { className: "p-4 text-sm text-center", children: "No Match" }),
|
|
119
|
-
m && /* @__PURE__ */ e("div", { className: "p-4 text-sm text-center", children: "Something went wrong" }),
|
|
120
|
-
o == null ? void 0 : o.map((t) => {
|
|
121
|
-
const { id: u, name: S } = t;
|
|
122
|
-
return /* @__PURE__ */ l(P, { onSelect: () => p({ id: u, name: S }), value: `${u}`, children: [
|
|
123
|
-
/* @__PURE__ */ e(
|
|
124
|
-
x,
|
|
125
|
-
{
|
|
126
|
-
className: f(
|
|
127
|
-
"mr-2 h-4 w-4",
|
|
128
|
-
(i == null ? void 0 : i.id) === u ? "opacity-100" : "opacity-0"
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
S
|
|
133
|
-
] }, u);
|
|
134
|
-
})
|
|
135
|
-
] });
|
|
136
|
-
}
|
|
137
|
-
export {
|
|
138
|
-
ve as DynamicInput,
|
|
139
|
-
D as Search
|
|
140
|
-
};
|
|
141
|
-
//# sourceMappingURL=dynamic-input.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-input.es.js","sources":["../../../lib/components/ui/dynamic-input.tsx"],"sourcesContent":["import { DYNAMIC_INPUT_TARGET, ctxClient } from '@/components/data-table';\nimport { Button, Popover, PopoverContent, PopoverTrigger } from '@/index';\nimport { cn } from '@/utils';\nimport type { components } from '@cryptlex/web-api-types';\nimport { useQuery } from '@tanstack/react-query';\nimport { CommandInput, CommandItem, CommandList } from 'cmdk';\nimport { Check, ChevronsUpDown, Command, Loader } from 'lucide-react';\nimport * as React from 'react';\nimport { useDebounce } from 'use-debounce';\n\ntype UserDto = components['schemas']['UserDto'] & { organizationId?: string };\ntype OrganizationDto = components['schemas']['OrganizationDto'];\ntype ResellerDto = components['schemas']['ResellerDto'];\n// width for properly viewing the popover\nconst POPOVER_WIDTH = 'w-[250px]';\n\n/**\n *\n * @param onChange\n * @param target fthis is used to make the component generic and reusble for differnt use cases\n * @param placeholder placeholder to be showing in the input for searching\n * @returns return id of the seleced value, can be customized to return full selected value\n */\ninterface DynamicInputProps {\n onChange: (id: any) => void;\n target: DYNAMIC_INPUT_TARGET;\n placeholder: string;\n}\nexport function DynamicInput({ onChange, target, placeholder }: DynamicInputProps) {\n const [open, setOpen] = React.useState(false);\n // select option\n const [selected, setSelected] = React.useState<\n Partial<UserDto> | Partial<OrganizationDto> | Partial<ResellerDto> | undefined\n >();\n\n const handleSetActive = React.useCallback(\n (dto: Partial<UserDto> | Partial<OrganizationDto> | Partial<ResellerDto>) => {\n setSelected(dto);\n onChange(dto.id);\n },\n [onChange],\n );\n // display selected option with its name\n const displayName = selected\n ? selected.name\n : `Select ${DYNAMIC_INPUT_TARGET[target].toLocaleLowerCase()} `;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n {/* Button to show the selected option */}\n <PopoverTrigger asChild>\n <Button variant=\"outline\" role=\"combobox\" className={cn('justify-between', POPOVER_WIDTH)}>\n {displayName}\n <ChevronsUpDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </Button>\n </PopoverTrigger>\n\n <PopoverContent side=\"bottom\" className={cn('p-0', POPOVER_WIDTH)}>\n {/*Search input */}\n <Search\n target={target}\n selectedResult={selected}\n onSelectResult={handleSetActive}\n placeholder={placeholder}\n />\n </PopoverContent>\n </Popover>\n );\n}\n\ninterface SearchProps {\n selectedResult?: Partial<UserDto> | Partial<OrganizationDto> | Partial<ResellerDto>;\n onSelectResult: (dto: Partial<UserDto> | Partial<OrganizationDto> | Partial<ResellerDto>) => void;\n target: DYNAMIC_INPUT_TARGET;\n placeholder: string;\n}\n\nexport function Search({ selectedResult, onSelectResult, target, placeholder }: SearchProps) {\n const [searchQuery, setSearchQuery] = React.useState('');\n const handleSelectResult = (\n dto: Partial<UserDto> | Partial<OrganizationDto> | Partial<ResellerDto>,\n ) => {\n onSelectResult(dto);\n };\n\n const handleChange = (value: string) => {\n setSearchQuery(value);\n };\n\n return (\n <Command className=\"h-auto rounded-lg border border-b-0 shadow-md\">\n <CommandInput value={searchQuery} onValueChange={handleChange} placeholder={placeholder} />\n\n <SearchResults\n target={target}\n query={searchQuery}\n selectedResult={selectedResult}\n onSelectResult={handleSelectResult}\n />\n </Command>\n );\n}\n\ninterface SearchResultsProps {\n query: string;\n selectedResult: SearchProps['selectedResult'];\n onSelectResult: SearchProps['onSelectResult'];\n target: DYNAMIC_INPUT_TARGET;\n}\n\nfunction SearchResults({ query, selectedResult, onSelectResult, target }: SearchResultsProps) {\n // fetch function that targets different end points based on the DYNAMIC_INPUT_TARGET which can be license USER, ORGANIZATION or RESELLER\n const fetchFn = async () => {\n if (target === DYNAMIC_INPUT_TARGET.USER) {\n return await ctxClient\n .GET('/v3/users', {\n params: {\n query: {\n page: 1,\n limit: 30,\n query,\n userType: 'user',\n },\n },\n })\n .then((res) => res.data);\n } else if (target === DYNAMIC_INPUT_TARGET.ORGANIZATION) {\n return await ctxClient\n .GET('/v3/organizations', {\n params: {\n query: {\n page: 1,\n limit: 30,\n query,\n },\n },\n })\n .then((res) => res.data);\n } else {\n return await ctxClient\n .GET('/v3/resellers', {\n params: {\n query: {\n page: 1,\n limit: 30,\n query,\n userType: 'user',\n },\n },\n })\n .then((res) => res.data);\n }\n };\n //https://github.com/TanStack/query/issues/293#issuecomment-1368066935\n //https://github.com/TanStack/query/issues/293\n const [debouncedQuery] = useDebounce(query, 300);\n const { data, isLoading, isError } = useQuery({\n queryKey: ['search', debouncedQuery],\n queryFn: fetchFn,\n });\n\n return (\n <CommandList>\n <div className=\"flex justify-center\">{isLoading && <Loader className=\"my-4\" />}</div>\n\n {!isError && !isLoading && !data?.length && (\n <div className=\"p-4 text-sm text-center\">No Match</div>\n )}\n {isError && <div className=\"p-4 text-sm text-center\">Something went wrong</div>}\n {data?.map((d) => {\n const { id, name } = d;\n return (\n <CommandItem key={id} onSelect={() => onSelectResult({ id, name })} value={`${id}`}>\n <Check\n className={cn(\n 'mr-2 h-4 w-4',\n selectedResult?.id === id ? 'opacity-100' : 'opacity-0',\n )}\n />\n {name}\n </CommandItem>\n );\n })}\n </CommandList>\n );\n}\n"],"names":["POPOVER_WIDTH","DynamicInput","onChange","target","placeholder","open","setOpen","React","selected","setSelected","handleSetActive","dto","displayName","DYNAMIC_INPUT_TARGET","jsxs","Popover","jsx","PopoverTrigger","Button","cn","ChevronsUpDown","PopoverContent","Search","selectedResult","onSelectResult","searchQuery","setSearchQuery","Command","CommandInput","value","SearchResults","query","fetchFn","ctxClient","res","debouncedQuery","useDebounce","data","isLoading","isError","useQuery","CommandList","Loader","d","id","name","CommandItem","Check"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAMA,IAAgB;AAcf,SAASC,GAAa,EAAE,UAAAC,GAAU,QAAAC,GAAQ,aAAAC,KAAkC;AACjF,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAM,SAAS,EAAK,GAEtC,CAACC,GAAUC,CAAW,IAAIF,EAAM,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