eai-frontend-components 2.0.65 → 2.0.67
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/index.d.ts +8 -8
- package/dist/index.esm.js +7 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -208,7 +208,7 @@ declare const Command: React$1.ForwardRefExoticComponent<Omit<{
|
|
|
208
208
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
209
209
|
} & {
|
|
210
210
|
asChild?: boolean;
|
|
211
|
-
}, "key" |
|
|
211
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
212
212
|
label?: string;
|
|
213
213
|
shouldFilter?: boolean;
|
|
214
214
|
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
@@ -224,7 +224,7 @@ declare const CommandInput: React$1.ForwardRefExoticComponent<Omit<Omit<Pick<Pic
|
|
|
224
224
|
ref?: React$1.Ref<HTMLInputElement>;
|
|
225
225
|
} & {
|
|
226
226
|
asChild?: boolean;
|
|
227
|
-
}, "key" | "asChild" | keyof React$1.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "
|
|
227
|
+
}, "key" | "asChild" | keyof React$1.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
|
|
228
228
|
value?: string;
|
|
229
229
|
onValueChange?: (search: string) => void;
|
|
230
230
|
} & React$1.RefAttributes<HTMLInputElement>, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
@@ -234,7 +234,7 @@ declare const CommandList: React$1.ForwardRefExoticComponent<Omit<{
|
|
|
234
234
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
235
235
|
} & {
|
|
236
236
|
asChild?: boolean;
|
|
237
|
-
}, "key" |
|
|
237
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
238
238
|
label?: string;
|
|
239
239
|
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
240
240
|
declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
|
|
@@ -243,14 +243,14 @@ declare const CommandEmpty: React$1.ForwardRefExoticComponent<Omit<{
|
|
|
243
243
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
244
244
|
} & {
|
|
245
245
|
asChild?: boolean;
|
|
246
|
-
}, "key" |
|
|
246
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
247
247
|
declare const CommandGroup: React$1.ForwardRefExoticComponent<Omit<{
|
|
248
248
|
children?: React$1.ReactNode;
|
|
249
249
|
} & Omit<Pick<Pick<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React$1.HTMLAttributes<HTMLDivElement>> & {
|
|
250
250
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
251
251
|
} & {
|
|
252
252
|
asChild?: boolean;
|
|
253
|
-
}, "key" |
|
|
253
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
|
|
254
254
|
heading?: React$1.ReactNode;
|
|
255
255
|
value?: string;
|
|
256
256
|
forceMount?: boolean;
|
|
@@ -259,7 +259,7 @@ declare const CommandSeparator: React$1.ForwardRefExoticComponent<Omit<Pick<Pick
|
|
|
259
259
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
260
260
|
} & {
|
|
261
261
|
asChild?: boolean;
|
|
262
|
-
}, "key" |
|
|
262
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
263
263
|
alwaysRender?: boolean;
|
|
264
264
|
} & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
265
265
|
declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
|
|
@@ -268,7 +268,7 @@ declare const CommandItem: React$1.ForwardRefExoticComponent<Omit<{
|
|
|
268
268
|
ref?: React$1.Ref<HTMLDivElement>;
|
|
269
269
|
} & {
|
|
270
270
|
asChild?: boolean;
|
|
271
|
-
}, "key" |
|
|
271
|
+
}, "key" | keyof React$1.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
|
|
272
272
|
disabled?: boolean;
|
|
273
273
|
onSelect?: (value: string) => void;
|
|
274
274
|
value?: string;
|
|
@@ -1341,7 +1341,7 @@ declare const addDaysToToday: (days: number) => Date;
|
|
|
1341
1341
|
declare const isValidDate: (date: Date | undefined) => date is Date;
|
|
1342
1342
|
declare const isDateRangeValid: (startDate: Date, endDate: Date, maxDays?: number) => boolean;
|
|
1343
1343
|
|
|
1344
|
-
declare const downloadWithServiceWorker: (urlDownload: string
|
|
1344
|
+
declare const downloadWithServiceWorker: (urlDownload: string) => Promise<void>;
|
|
1345
1345
|
|
|
1346
1346
|
/**
|
|
1347
1347
|
* Formats a phone number string with proper mask.
|
package/dist/index.esm.js
CHANGED
|
@@ -542,7 +542,7 @@ const DrawerOverlay = React$1.forwardRef(({ className, ...props }, ref) => jsx(D
|
|
|
542
542
|
DrawerOverlay.displayName = Drawer$1.Overlay.displayName;
|
|
543
543
|
const DrawerContent = React$1.forwardRef(({ className, children, ...props }, ref) => (jsxs(DrawerPortal, { children: [jsx(DrawerOverlay, {}), jsxs(Drawer$1.Content, { ref: ref, className: cn('fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background', className), ...props, children: [jsx("div", { className: 'mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted' }), children] })] })));
|
|
544
544
|
DrawerContent.displayName = 'DrawerContent';
|
|
545
|
-
const DrawerHeader = ({ className, ...props }) => jsx("div", { className: cn('grid gap-1.5', className), ...props });
|
|
545
|
+
const DrawerHeader = ({ className, ...props }) => (jsx("div", { className: cn('grid gap-1.5 py-4', className), ...props }));
|
|
546
546
|
DrawerHeader.displayName = 'DrawerHeader';
|
|
547
547
|
const DrawerFooter = ({ className, ...props }) => (jsx("div", { className: cn('mt-auto flex flex-col gap-2 p-4', className), ...props }));
|
|
548
548
|
DrawerFooter.displayName = 'DrawerFooter';
|
|
@@ -9516,7 +9516,7 @@ const MultiSelect = React$1.forwardRef(({ control, name, label, subLabel, helpTe
|
|
|
9516
9516
|
}
|
|
9517
9517
|
};
|
|
9518
9518
|
return (jsx(FormField, { control: control, name: name, render: ({ field }) => (jsxs(FormItem, { children: [jsxs("div", { className: 'flex items-center space-x-1.5', children: [label && formLabelAndSubLabel(FormLabel, label, subLabel, required), helpText && formHelpText(helpText)] }), jsxs(Popover, { open: isPopoverOpen, onOpenChange: setIsPopoverOpen, modal: modalPopover, children: [jsx(PopoverTrigger, { asChild: true, children: jsx(Button, { ref: ref, ...props, onClick: handleTogglePopover, type: 'button', className: cn('flex w-full p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-background hover:bg-background [&_svg]:size-3.5', className), children: field.value?.length > 0 ? (jsxs("div", { className: 'flex justify-between items-center w-full', children: [jsxs("div", { className: 'flex items-center', children: [jsx("div", { className: `grid grid-cols-${maxCount}`, children: field.value.slice(0, maxCount).map((option) => {
|
|
9519
|
-
return (jsxs(Badge, { className: cn(multiSelectVariants({ variant })), onClick: (event) => {
|
|
9519
|
+
return (jsxs(Badge, { className: cn('justify-between', multiSelectVariants({ variant })), onClick: (event) => {
|
|
9520
9520
|
event.stopPropagation();
|
|
9521
9521
|
toggleOption(option, field);
|
|
9522
9522
|
}, children: [jsx("div", { className: 'truncate', children: option?.label }), jsx(X, { className: 'ml-2 cursor-pointer text-zinc-500' })] }, `msoptlbl-${option.value}`));
|
|
@@ -10327,12 +10327,15 @@ const NavUser = ({ userName, userEmail, userInitials, callbackLogout }) => {
|
|
|
10327
10327
|
} }) }) }), jsxs(DropdownMenuContent, { className: 'w-[250px] rounded-lg', side: isMobile ? 'bottom' : 'right', align: 'end', sideOffset: 4, children: [jsx(DropdownMenuLabel, { className: 'p-0 font-normal', children: jsxs("div", { className: 'flex items-center gap-2 px-1 py-1.5 text-left text-sm', children: [jsxs(Avatar, { className: 'h-8 w-8 rounded-lg', children: [jsx(AvatarImage, { src: userInitials, alt: userName }), jsx(AvatarFallback, { className: 'rounded-lg bg-background-primary text-white', children: userInitials })] }), jsxs("div", { className: 'grid flex-1 text-left text-sm leading-tight', children: [jsx("span", { className: 'truncate font-semibold', children: userName }), jsx("span", { className: 'truncate text-xs', children: userEmail })] })] }) }), jsx(DropdownMenuItem, { className: 'p-0 font-normal cursor-pointer', onClick: () => handleLogout(), children: jsxs("div", { className: 'flex items-center gap-2 px-1 py-1.5 text-left text-sm', children: [jsx("div", { className: 'flex w-8 h-8 p-2 items-center rounded-md', children: jsx(LogOut, { size: 16 }) }), "Log out"] }) })] })] }) }) }));
|
|
10328
10328
|
};
|
|
10329
10329
|
|
|
10330
|
-
const downloadWithServiceWorker = async (urlDownload
|
|
10330
|
+
const downloadWithServiceWorker = async (urlDownload) => {
|
|
10331
10331
|
try {
|
|
10332
10332
|
const response = await fetch(urlDownload);
|
|
10333
10333
|
if (!response.ok) {
|
|
10334
10334
|
throw new Error('Erro ao fazer o download');
|
|
10335
10335
|
}
|
|
10336
|
+
const contentDisposition = response.headers.get('content-disposition');
|
|
10337
|
+
const match = contentDisposition?.match(/filename\*?=(?:UTF-8''|")?([^";\n]+)"?/i);
|
|
10338
|
+
const fileName = match?.[1] ? decodeURIComponent(match[1].trim()) : (urlDownload.split('/').pop()?.split('?')[0] ?? 'download');
|
|
10336
10339
|
const blob = await response.blob();
|
|
10337
10340
|
const url = window.URL.createObjectURL(blob);
|
|
10338
10341
|
const a = document.createElement('a');
|
|
@@ -10374,7 +10377,7 @@ function DataTableExport({ exportData, totalRows }) {
|
|
|
10374
10377
|
return {};
|
|
10375
10378
|
}
|
|
10376
10379
|
const params = new URLSearchParams(exportData.params).toString();
|
|
10377
|
-
downloadWithServiceWorker(`${exportData.url}?${params}
|
|
10380
|
+
downloadWithServiceWorker(`${exportData.url}?${params}`);
|
|
10378
10381
|
};
|
|
10379
10382
|
const renderExport = () => {
|
|
10380
10383
|
if (!exportData)
|