@yeverlibs/ds 1.1.4 → 1.1.6
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.mts +2 -44
- package/dist/index.d.ts +2 -44
- package/dist/index.js +33 -249
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -249
- package/dist/index.mjs.map +1 -1
- package/dist/paginate.d-DS7epQ82.d.mts +8 -0
- package/dist/paginate.d-DS7epQ82.d.ts +8 -0
- package/dist/server.d.mts +39 -0
- package/dist/server.d.ts +39 -0
- package/dist/server.js +253 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +247 -0
- package/dist/server.mjs.map +1 -0
- package/package.json +13 -1
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { Dispatch, SetStateAction, ReactElement, MemoExoticComponent, HTMLProps, ReactNode } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as tailwind_styled_components_dist_tailwind from 'tailwind-styled-components/dist/tailwind';
|
|
5
|
+
import { P as PaginatedData } from './paginate.d-DS7epQ82.mjs';
|
|
5
6
|
import * as react_hook_form from 'react-hook-form';
|
|
6
7
|
import { FieldValues, UseFormReturn, Path, ReactNode as ReactNode$1, SubmitHandler } from 'react-hook-form';
|
|
7
8
|
import { ResponsiveBarSvgProps, BarDatum } from '@nivo/bar';
|
|
@@ -492,13 +493,6 @@ type StatusBadgeProps = {
|
|
|
492
493
|
};
|
|
493
494
|
declare const StatusBadge: React.FC<StatusBadgeProps>;
|
|
494
495
|
|
|
495
|
-
type PaginatedData = {
|
|
496
|
-
current: number
|
|
497
|
-
last: number
|
|
498
|
-
total: number
|
|
499
|
-
per_page: number
|
|
500
|
-
}
|
|
501
|
-
|
|
502
496
|
type Column<T> = {
|
|
503
497
|
Header?: string
|
|
504
498
|
accessor: keyof T | ((row: T) => React.ReactNode) | 'actions'
|
|
@@ -913,42 +907,6 @@ interface ChartProps extends Omit<Partial<PieSvgProps<{
|
|
|
913
907
|
}
|
|
914
908
|
declare const PieChart: React.FC<ChartProps>;
|
|
915
909
|
|
|
916
|
-
type fetchServerSideProps<T = string | number | boolean | null | undefined | object> = {
|
|
917
|
-
urlRequest: string
|
|
918
|
-
parseData?: (data: string | number | boolean | null | undefined | object) => T
|
|
919
|
-
filtersAllowed?: string[]
|
|
920
|
-
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
|
|
921
|
-
body?: string | number | boolean | null | undefined | object
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
declare const fetchServerSide: <T>({ urlRequest, parseData, filtersAllowed, method, body, }: fetchServerSideProps<T>) => Promise<{
|
|
925
|
-
props: {
|
|
926
|
-
pagination: PaginatedData | undefined;
|
|
927
|
-
data: T;
|
|
928
|
-
error?: undefined;
|
|
929
|
-
};
|
|
930
|
-
} | {
|
|
931
|
-
props: {
|
|
932
|
-
error: {
|
|
933
|
-
status: number;
|
|
934
|
-
message: string;
|
|
935
|
-
errors: Record<string, string[]>;
|
|
936
|
-
};
|
|
937
|
-
data: null;
|
|
938
|
-
pagination?: undefined;
|
|
939
|
-
};
|
|
940
|
-
} | {
|
|
941
|
-
props: {
|
|
942
|
-
error: {
|
|
943
|
-
status: number;
|
|
944
|
-
message: string | undefined;
|
|
945
|
-
errors: Record<string, string[]> | undefined;
|
|
946
|
-
};
|
|
947
|
-
pagination?: undefined;
|
|
948
|
-
data?: undefined;
|
|
949
|
-
};
|
|
950
|
-
}>;
|
|
951
|
-
|
|
952
910
|
declare function Configuracoes(props: React$1.SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
|
|
953
911
|
declare const MemoConfiguracoes: React$1.MemoExoticComponent<typeof Configuracoes>;
|
|
954
912
|
|
|
@@ -1501,4 +1459,4 @@ declare const useCopyToClipboard: (successMessage?: string) => {
|
|
|
1501
1459
|
copyToClipboard: (initialText: string) => void;
|
|
1502
1460
|
};
|
|
1503
1461
|
|
|
1504
|
-
export { Alert, MemoAlertDefault as AlertDefault, MemoAlertError as AlertError, MemoAlertGuard as AlertGuard, MemoAlertInfo as AlertInfo, MemoAlertWarning as AlertWarning, MemoApi as Api, MemoArrowLeft as ArrowLeft, MemoArrowNarrowUpRight as ArrowNarrowUpRight, Avatar, BarChart, MemoBoleto as Boleto, Box, Button, type ButtonProps, ButtonToggleGroup, type ButtonToggleGroupProps, CSV, MemoCalendar as Calendar, MemoCard as Card, MemoCarrFree as CarrFree, MemoCarretDown as CarretDown, MemoCarretSingleRight as CarretSingleRight, CarrinhoAbandonado, MemoCart as Cart, MemoChargeback as Chargeback, MemoCheck as Check, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxOption, MemoCheckout as Checkout, MemoChevronDown as ChevronDown, MemoChevronLeftDouble as ChevronLeftDouble, MemoCloseCheckbox as CloseCheckbox, MemoCloseIcon as CloseIcon, MemoCloud as Cloud, MemoCodeCircle as CodeCircle, type Column, MemoConfiguracoes as Configuracoes, MemoCopy as Copy, MemoCopyLink as CopyLink, Counter, MemoCreditCard as CreditCard, MemoCupom as Cupom, CurrencyInput, CustomSelect, MemoDashboard as Dashboard, DatePicker, type DatePickerProps, type DateStateProps, DeleteModal, MemoDelivery as Delivery, MemoDepoimentos as Depoimentos, MemoDistribuicao as Distribuicao, MemoDistribution as Distribution, MemoDominios as Dominios, MemoDownloadArrow as DownloadArrow, MemoDrag as Drag, DropdownContext, DropdownItens, DropdownTrigger, DrowpdownButton, MemoEdit as Edit, Emails, MemoExtrato as Extrato, MemoEyeInput as EyeInput, MemoEyeOff as EyeOff, FeedbackBadge, MemoFileMinus as FileMinus, FileUploadWithDisplayName as FileUpload, FilterDrawer, MemoFilterLines as FilterLines, FilterList, FilterListContext, FilterTrigger, MemoFinanceiro as Financeiro, FormWrapper, MemoFrete as Frete, MemoFreteGratis as FreteGratis, GeneralPageLinks, MemoGestao as Gestao, MemoGlobe as Globe, GlobeVariant, Grid, GridColumn, Guard, Heading, MemoHeadphones as Headphones, MemoHelp as Help, MemoHelpCircle as HelpCircle, Home, MemoInfoCircle as InfoCircle, Input, MemoIntegracoes as Integracoes, LineChart, Link$1 as Link, MemoLink as LinkIcon, type LinkProps, MemoLoadingSpinner as LoadingSpinner, MemoLock as Lock, MemoLockInput as LockInput, Logistica, MemoLoja as Loja, LojaAlert, LojaAlertSuccess, MemoMail as Mail, MemoMailInput as MailInput, MemoMarkerPin as MarkerPin, MemoMarketing as Marketing, MediumRisk, MemoMessage as Message, Modal, MemoMoney as Money, MultiSelect, NewIcons, MemoNewMessage as NewMessage, MemoNewNotification as NewNotification, MemoNotificacoes as Notificacoes, MemoNotification as Notification, NotificationItem, MemoNotifications as Notifications, type OpenAsBlobOptions, MemoOrderBump as OrderBump, PageContainer,
|
|
1462
|
+
export { Alert, MemoAlertDefault as AlertDefault, MemoAlertError as AlertError, MemoAlertGuard as AlertGuard, MemoAlertInfo as AlertInfo, MemoAlertWarning as AlertWarning, MemoApi as Api, MemoArrowLeft as ArrowLeft, MemoArrowNarrowUpRight as ArrowNarrowUpRight, Avatar, BarChart, MemoBoleto as Boleto, Box, Button, type ButtonProps, ButtonToggleGroup, type ButtonToggleGroupProps, CSV, MemoCalendar as Calendar, MemoCard as Card, MemoCarrFree as CarrFree, MemoCarretDown as CarretDown, MemoCarretSingleRight as CarretSingleRight, CarrinhoAbandonado, MemoCart as Cart, MemoChargeback as Chargeback, MemoCheck as Check, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxOption, MemoCheckout as Checkout, MemoChevronDown as ChevronDown, MemoChevronLeftDouble as ChevronLeftDouble, MemoCloseCheckbox as CloseCheckbox, MemoCloseIcon as CloseIcon, MemoCloud as Cloud, MemoCodeCircle as CodeCircle, type Column, MemoConfiguracoes as Configuracoes, MemoCopy as Copy, MemoCopyLink as CopyLink, Counter, MemoCreditCard as CreditCard, MemoCupom as Cupom, CurrencyInput, CustomSelect, MemoDashboard as Dashboard, DatePicker, type DatePickerProps, type DateStateProps, DeleteModal, MemoDelivery as Delivery, MemoDepoimentos as Depoimentos, MemoDistribuicao as Distribuicao, MemoDistribution as Distribution, MemoDominios as Dominios, MemoDownloadArrow as DownloadArrow, MemoDrag as Drag, DropdownContext, DropdownItens, DropdownTrigger, DrowpdownButton, MemoEdit as Edit, Emails, MemoExtrato as Extrato, MemoEyeInput as EyeInput, MemoEyeOff as EyeOff, FeedbackBadge, MemoFileMinus as FileMinus, FileUploadWithDisplayName as FileUpload, FilterDrawer, MemoFilterLines as FilterLines, FilterList, FilterListContext, FilterTrigger, MemoFinanceiro as Financeiro, FormWrapper, MemoFrete as Frete, MemoFreteGratis as FreteGratis, GeneralPageLinks, MemoGestao as Gestao, MemoGlobe as Globe, GlobeVariant, Grid, GridColumn, Guard, Heading, MemoHeadphones as Headphones, MemoHelp as Help, MemoHelpCircle as HelpCircle, Home, MemoInfoCircle as InfoCircle, Input, MemoIntegracoes as Integracoes, LineChart, Link$1 as Link, MemoLink as LinkIcon, type LinkProps, MemoLoadingSpinner as LoadingSpinner, MemoLock as Lock, MemoLockInput as LockInput, Logistica, MemoLoja as Loja, LojaAlert, LojaAlertSuccess, MemoMail as Mail, MemoMailInput as MailInput, MemoMarkerPin as MarkerPin, MemoMarketing as Marketing, MediumRisk, MemoMessage as Message, Modal, MemoMoney as Money, MultiSelect, NewIcons, MemoNewMessage as NewMessage, MemoNewNotification as NewNotification, MemoNotificacoes as Notificacoes, MemoNotification as Notification, NotificationItem, MemoNotifications as Notifications, type OpenAsBlobOptions, MemoOrderBump as OrderBump, PageContainer, PaginatedData, PaymentCard, MemoPermissaoDeAcesso as PermissaoDeAcesso, PhoneCall, PieChart, MemoPix as Pix, MemoPixels as Pixels, Planilha, MemoPlus as Plus, MemoPrechargeback as Prechargeback, PrefetchLink, PreviewPhone, MemoProduto as Produto, MemoProdutos as Produtos, MemoPromocoes as Promocoes, RecuperacaoDeCarrinho, MemoRefresh as Refresh, MemoRelatorios as Relatorios, MemoRestricaoDeAcesso as RestricaoDeAcesso, Ribbon, MemoRisco as Risco, MemoSac as Sac, MemoSearchMd as SearchMd, SelectableOption, Separator, MemoSignout as Signout, SliderInput, SlidingPanel, Spinner$1 as Spinner, MemoSpinner as SpinnerIcon, StatusBadge, MemoStore as Store, Switch$1 as Switch, MemoSwitch as SwitchIcon, type SwitchProps, Table, Tabs, Text, Textarea, TimeInput, TimerCounter, type CounterInputProps$1 as TimerCounterProps, TimerCounterWithoutSeconds, type CounterInputProps as TimerCounterWithoutSecondsProps, Tooltip, MemoTransfer as Transfer, MemoTrash as Trash, MemoTruck as Truck, MemoUpsell as Upsell, MemoUser as User, MemoUsers as Users, MemoVerticalPoints as VerticalPoints, MemoWarning as Warning, MemoWebhook as Webhook, MemoWebhook$1 as WebhookConfig, MemoWhatsapp as Whatsapp, Xlsx, MemoYever as Yever, calculateCurrencyOperation, cn, colors, fontFamily, formatCNPJ, formatCNPJCPF, formatCPF, formatCurrency, formatCurrencyShort, formatDate, formatDateAndReturnPassedHours, formatDateGeneric, formatDateInPassedDays, formatDateTime, formatDateToISO, formatIP, formatName, formatNumberToCurrency, formatPhone, formatPostalCode, formatRawDigitsToCurrency, formatTime$1 as formatTimeWithSeconds, formatTime as formatTimeWithoutSeconds, getDates, handleFormSubmission, nextReplaceUrl, parseFormattedCurrency, parseParametersIntoUrl, shadow, transformDateToAmericanFormat, transformToCurrency, transformToNumber, transformToPercentage, truncateString, useCopyToClipboard };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { Dispatch, SetStateAction, ReactElement, MemoExoticComponent, HTMLProps, ReactNode } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as tailwind_styled_components_dist_tailwind from 'tailwind-styled-components/dist/tailwind';
|
|
5
|
+
import { P as PaginatedData } from './paginate.d-DS7epQ82.js';
|
|
5
6
|
import * as react_hook_form from 'react-hook-form';
|
|
6
7
|
import { FieldValues, UseFormReturn, Path, ReactNode as ReactNode$1, SubmitHandler } from 'react-hook-form';
|
|
7
8
|
import { ResponsiveBarSvgProps, BarDatum } from '@nivo/bar';
|
|
@@ -492,13 +493,6 @@ type StatusBadgeProps = {
|
|
|
492
493
|
};
|
|
493
494
|
declare const StatusBadge: React.FC<StatusBadgeProps>;
|
|
494
495
|
|
|
495
|
-
type PaginatedData = {
|
|
496
|
-
current: number
|
|
497
|
-
last: number
|
|
498
|
-
total: number
|
|
499
|
-
per_page: number
|
|
500
|
-
}
|
|
501
|
-
|
|
502
496
|
type Column<T> = {
|
|
503
497
|
Header?: string
|
|
504
498
|
accessor: keyof T | ((row: T) => React.ReactNode) | 'actions'
|
|
@@ -913,42 +907,6 @@ interface ChartProps extends Omit<Partial<PieSvgProps<{
|
|
|
913
907
|
}
|
|
914
908
|
declare const PieChart: React.FC<ChartProps>;
|
|
915
909
|
|
|
916
|
-
type fetchServerSideProps<T = string | number | boolean | null | undefined | object> = {
|
|
917
|
-
urlRequest: string
|
|
918
|
-
parseData?: (data: string | number | boolean | null | undefined | object) => T
|
|
919
|
-
filtersAllowed?: string[]
|
|
920
|
-
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
|
|
921
|
-
body?: string | number | boolean | null | undefined | object
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
declare const fetchServerSide: <T>({ urlRequest, parseData, filtersAllowed, method, body, }: fetchServerSideProps<T>) => Promise<{
|
|
925
|
-
props: {
|
|
926
|
-
pagination: PaginatedData | undefined;
|
|
927
|
-
data: T;
|
|
928
|
-
error?: undefined;
|
|
929
|
-
};
|
|
930
|
-
} | {
|
|
931
|
-
props: {
|
|
932
|
-
error: {
|
|
933
|
-
status: number;
|
|
934
|
-
message: string;
|
|
935
|
-
errors: Record<string, string[]>;
|
|
936
|
-
};
|
|
937
|
-
data: null;
|
|
938
|
-
pagination?: undefined;
|
|
939
|
-
};
|
|
940
|
-
} | {
|
|
941
|
-
props: {
|
|
942
|
-
error: {
|
|
943
|
-
status: number;
|
|
944
|
-
message: string | undefined;
|
|
945
|
-
errors: Record<string, string[]> | undefined;
|
|
946
|
-
};
|
|
947
|
-
pagination?: undefined;
|
|
948
|
-
data?: undefined;
|
|
949
|
-
};
|
|
950
|
-
}>;
|
|
951
|
-
|
|
952
910
|
declare function Configuracoes(props: React$1.SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
|
|
953
911
|
declare const MemoConfiguracoes: React$1.MemoExoticComponent<typeof Configuracoes>;
|
|
954
912
|
|
|
@@ -1501,4 +1459,4 @@ declare const useCopyToClipboard: (successMessage?: string) => {
|
|
|
1501
1459
|
copyToClipboard: (initialText: string) => void;
|
|
1502
1460
|
};
|
|
1503
1461
|
|
|
1504
|
-
export { Alert, MemoAlertDefault as AlertDefault, MemoAlertError as AlertError, MemoAlertGuard as AlertGuard, MemoAlertInfo as AlertInfo, MemoAlertWarning as AlertWarning, MemoApi as Api, MemoArrowLeft as ArrowLeft, MemoArrowNarrowUpRight as ArrowNarrowUpRight, Avatar, BarChart, MemoBoleto as Boleto, Box, Button, type ButtonProps, ButtonToggleGroup, type ButtonToggleGroupProps, CSV, MemoCalendar as Calendar, MemoCard as Card, MemoCarrFree as CarrFree, MemoCarretDown as CarretDown, MemoCarretSingleRight as CarretSingleRight, CarrinhoAbandonado, MemoCart as Cart, MemoChargeback as Chargeback, MemoCheck as Check, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxOption, MemoCheckout as Checkout, MemoChevronDown as ChevronDown, MemoChevronLeftDouble as ChevronLeftDouble, MemoCloseCheckbox as CloseCheckbox, MemoCloseIcon as CloseIcon, MemoCloud as Cloud, MemoCodeCircle as CodeCircle, type Column, MemoConfiguracoes as Configuracoes, MemoCopy as Copy, MemoCopyLink as CopyLink, Counter, MemoCreditCard as CreditCard, MemoCupom as Cupom, CurrencyInput, CustomSelect, MemoDashboard as Dashboard, DatePicker, type DatePickerProps, type DateStateProps, DeleteModal, MemoDelivery as Delivery, MemoDepoimentos as Depoimentos, MemoDistribuicao as Distribuicao, MemoDistribution as Distribution, MemoDominios as Dominios, MemoDownloadArrow as DownloadArrow, MemoDrag as Drag, DropdownContext, DropdownItens, DropdownTrigger, DrowpdownButton, MemoEdit as Edit, Emails, MemoExtrato as Extrato, MemoEyeInput as EyeInput, MemoEyeOff as EyeOff, FeedbackBadge, MemoFileMinus as FileMinus, FileUploadWithDisplayName as FileUpload, FilterDrawer, MemoFilterLines as FilterLines, FilterList, FilterListContext, FilterTrigger, MemoFinanceiro as Financeiro, FormWrapper, MemoFrete as Frete, MemoFreteGratis as FreteGratis, GeneralPageLinks, MemoGestao as Gestao, MemoGlobe as Globe, GlobeVariant, Grid, GridColumn, Guard, Heading, MemoHeadphones as Headphones, MemoHelp as Help, MemoHelpCircle as HelpCircle, Home, MemoInfoCircle as InfoCircle, Input, MemoIntegracoes as Integracoes, LineChart, Link$1 as Link, MemoLink as LinkIcon, type LinkProps, MemoLoadingSpinner as LoadingSpinner, MemoLock as Lock, MemoLockInput as LockInput, Logistica, MemoLoja as Loja, LojaAlert, LojaAlertSuccess, MemoMail as Mail, MemoMailInput as MailInput, MemoMarkerPin as MarkerPin, MemoMarketing as Marketing, MediumRisk, MemoMessage as Message, Modal, MemoMoney as Money, MultiSelect, NewIcons, MemoNewMessage as NewMessage, MemoNewNotification as NewNotification, MemoNotificacoes as Notificacoes, MemoNotification as Notification, NotificationItem, MemoNotifications as Notifications, type OpenAsBlobOptions, MemoOrderBump as OrderBump, PageContainer,
|
|
1462
|
+
export { Alert, MemoAlertDefault as AlertDefault, MemoAlertError as AlertError, MemoAlertGuard as AlertGuard, MemoAlertInfo as AlertInfo, MemoAlertWarning as AlertWarning, MemoApi as Api, MemoArrowLeft as ArrowLeft, MemoArrowNarrowUpRight as ArrowNarrowUpRight, Avatar, BarChart, MemoBoleto as Boleto, Box, Button, type ButtonProps, ButtonToggleGroup, type ButtonToggleGroupProps, CSV, MemoCalendar as Calendar, MemoCard as Card, MemoCarrFree as CarrFree, MemoCarretDown as CarretDown, MemoCarretSingleRight as CarretSingleRight, CarrinhoAbandonado, MemoCart as Cart, MemoChargeback as Chargeback, MemoCheck as Check, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxOption, MemoCheckout as Checkout, MemoChevronDown as ChevronDown, MemoChevronLeftDouble as ChevronLeftDouble, MemoCloseCheckbox as CloseCheckbox, MemoCloseIcon as CloseIcon, MemoCloud as Cloud, MemoCodeCircle as CodeCircle, type Column, MemoConfiguracoes as Configuracoes, MemoCopy as Copy, MemoCopyLink as CopyLink, Counter, MemoCreditCard as CreditCard, MemoCupom as Cupom, CurrencyInput, CustomSelect, MemoDashboard as Dashboard, DatePicker, type DatePickerProps, type DateStateProps, DeleteModal, MemoDelivery as Delivery, MemoDepoimentos as Depoimentos, MemoDistribuicao as Distribuicao, MemoDistribution as Distribution, MemoDominios as Dominios, MemoDownloadArrow as DownloadArrow, MemoDrag as Drag, DropdownContext, DropdownItens, DropdownTrigger, DrowpdownButton, MemoEdit as Edit, Emails, MemoExtrato as Extrato, MemoEyeInput as EyeInput, MemoEyeOff as EyeOff, FeedbackBadge, MemoFileMinus as FileMinus, FileUploadWithDisplayName as FileUpload, FilterDrawer, MemoFilterLines as FilterLines, FilterList, FilterListContext, FilterTrigger, MemoFinanceiro as Financeiro, FormWrapper, MemoFrete as Frete, MemoFreteGratis as FreteGratis, GeneralPageLinks, MemoGestao as Gestao, MemoGlobe as Globe, GlobeVariant, Grid, GridColumn, Guard, Heading, MemoHeadphones as Headphones, MemoHelp as Help, MemoHelpCircle as HelpCircle, Home, MemoInfoCircle as InfoCircle, Input, MemoIntegracoes as Integracoes, LineChart, Link$1 as Link, MemoLink as LinkIcon, type LinkProps, MemoLoadingSpinner as LoadingSpinner, MemoLock as Lock, MemoLockInput as LockInput, Logistica, MemoLoja as Loja, LojaAlert, LojaAlertSuccess, MemoMail as Mail, MemoMailInput as MailInput, MemoMarkerPin as MarkerPin, MemoMarketing as Marketing, MediumRisk, MemoMessage as Message, Modal, MemoMoney as Money, MultiSelect, NewIcons, MemoNewMessage as NewMessage, MemoNewNotification as NewNotification, MemoNotificacoes as Notificacoes, MemoNotification as Notification, NotificationItem, MemoNotifications as Notifications, type OpenAsBlobOptions, MemoOrderBump as OrderBump, PageContainer, PaginatedData, PaymentCard, MemoPermissaoDeAcesso as PermissaoDeAcesso, PhoneCall, PieChart, MemoPix as Pix, MemoPixels as Pixels, Planilha, MemoPlus as Plus, MemoPrechargeback as Prechargeback, PrefetchLink, PreviewPhone, MemoProduto as Produto, MemoProdutos as Produtos, MemoPromocoes as Promocoes, RecuperacaoDeCarrinho, MemoRefresh as Refresh, MemoRelatorios as Relatorios, MemoRestricaoDeAcesso as RestricaoDeAcesso, Ribbon, MemoRisco as Risco, MemoSac as Sac, MemoSearchMd as SearchMd, SelectableOption, Separator, MemoSignout as Signout, SliderInput, SlidingPanel, Spinner$1 as Spinner, MemoSpinner as SpinnerIcon, StatusBadge, MemoStore as Store, Switch$1 as Switch, MemoSwitch as SwitchIcon, type SwitchProps, Table, Tabs, Text, Textarea, TimeInput, TimerCounter, type CounterInputProps$1 as TimerCounterProps, TimerCounterWithoutSeconds, type CounterInputProps as TimerCounterWithoutSecondsProps, Tooltip, MemoTransfer as Transfer, MemoTrash as Trash, MemoTruck as Truck, MemoUpsell as Upsell, MemoUser as User, MemoUsers as Users, MemoVerticalPoints as VerticalPoints, MemoWarning as Warning, MemoWebhook as Webhook, MemoWebhook$1 as WebhookConfig, MemoWhatsapp as Whatsapp, Xlsx, MemoYever as Yever, calculateCurrencyOperation, cn, colors, fontFamily, formatCNPJ, formatCNPJCPF, formatCPF, formatCurrency, formatCurrencyShort, formatDate, formatDateAndReturnPassedHours, formatDateGeneric, formatDateInPassedDays, formatDateTime, formatDateToISO, formatIP, formatName, formatNumberToCurrency, formatPhone, formatPostalCode, formatRawDigitsToCurrency, formatTime$1 as formatTimeWithSeconds, formatTime as formatTimeWithoutSeconds, getDates, handleFormSubmission, nextReplaceUrl, parseFormattedCurrency, parseParametersIntoUrl, shadow, transformDateToAmericanFormat, transformToCurrency, transformToNumber, transformToPercentage, truncateString, useCopyToClipboard };
|
package/dist/index.js
CHANGED
|
@@ -19,8 +19,6 @@ var Select2 = require('react-select');
|
|
|
19
19
|
var bar = require('@nivo/bar');
|
|
20
20
|
var line = require('@nivo/line');
|
|
21
21
|
var pie = require('@nivo/pie');
|
|
22
|
-
var headers = require('next/headers');
|
|
23
|
-
var Cookies = require('js-cookie');
|
|
24
22
|
var currency = require('currency.js');
|
|
25
23
|
|
|
26
24
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -50,7 +48,6 @@ var ReactDOM__default = /*#__PURE__*/_interopDefault(ReactDOM);
|
|
|
50
48
|
var dynamic__default = /*#__PURE__*/_interopDefault(dynamic);
|
|
51
49
|
var Link2__default = /*#__PURE__*/_interopDefault(Link2);
|
|
52
50
|
var Select2__default = /*#__PURE__*/_interopDefault(Select2);
|
|
53
|
-
var Cookies__default = /*#__PURE__*/_interopDefault(Cookies);
|
|
54
51
|
var currency__default = /*#__PURE__*/_interopDefault(currency);
|
|
55
52
|
|
|
56
53
|
// src/lib/utils.ts
|
|
@@ -6566,15 +6563,15 @@ var TableContent = ({
|
|
|
6566
6563
|
var Table = (props) => {
|
|
6567
6564
|
return /* @__PURE__ */ jsxRuntime.jsx(React107.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(TableContent, { ...props }) });
|
|
6568
6565
|
};
|
|
6569
|
-
var Tabs = ({ headers
|
|
6566
|
+
var Tabs = ({ headers, children, noGap, active, alignDiv = "full" }) => {
|
|
6570
6567
|
const [activeTab, setActiveTab] = React107.useState(active || 0);
|
|
6571
|
-
const flattenHeaders = (
|
|
6572
|
-
if (Array.isArray(
|
|
6573
|
-
return
|
|
6568
|
+
const flattenHeaders = (headers2) => {
|
|
6569
|
+
if (Array.isArray(headers2[0])) {
|
|
6570
|
+
return headers2.flat();
|
|
6574
6571
|
}
|
|
6575
|
-
return
|
|
6572
|
+
return headers2;
|
|
6576
6573
|
};
|
|
6577
|
-
const flattenedHeaders = flattenHeaders(
|
|
6574
|
+
const flattenedHeaders = flattenHeaders(headers);
|
|
6578
6575
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col", noGap ? "" : "gap-4"), children: [
|
|
6579
6576
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4 overflow-x-auto overflow-y-hidden border-b border-gray-300", children: flattenedHeaders.map((header, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6580
6577
|
"button",
|
|
@@ -8095,245 +8092,6 @@ var PieChart = ({
|
|
|
8095
8092
|
}
|
|
8096
8093
|
);
|
|
8097
8094
|
};
|
|
8098
|
-
async function getCsrfToken() {
|
|
8099
|
-
const baseURL = process.env.NEXT_PUBLIC_API_URL ?? "";
|
|
8100
|
-
const response = await fetch(`${baseURL}/sanctum/csrf-cookie`, {
|
|
8101
|
-
credentials: "include",
|
|
8102
|
-
headers: {
|
|
8103
|
-
"X-Requested-With": "XMLHttpRequest"
|
|
8104
|
-
}
|
|
8105
|
-
});
|
|
8106
|
-
if (!response.ok) {
|
|
8107
|
-
throw new Error("Falha ao obter token CSRF");
|
|
8108
|
-
}
|
|
8109
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
8110
|
-
}
|
|
8111
|
-
async function apiFetch(options) {
|
|
8112
|
-
const baseURL = process.env.NEXT_PUBLIC_API_URL ?? "";
|
|
8113
|
-
const isAbsolute = /^https?:\/\//i.test(options.url);
|
|
8114
|
-
const url = isAbsolute ? options.url : `${baseURL}${options.url}`;
|
|
8115
|
-
const method = (options.method ?? "GET").toString().toLowerCase();
|
|
8116
|
-
const needsCSRFToken = ["post", "put", "delete"].includes(method);
|
|
8117
|
-
const hasCSRFCookie = Cookies__default.default.get("XSRF-TOKEN");
|
|
8118
|
-
if (needsCSRFToken && !hasCSRFCookie) {
|
|
8119
|
-
await getCsrfToken();
|
|
8120
|
-
}
|
|
8121
|
-
const defaultHeaders = {
|
|
8122
|
-
"X-Requested-With": "XMLHttpRequest",
|
|
8123
|
-
Accept: "application/json"
|
|
8124
|
-
};
|
|
8125
|
-
if (!(options.body instanceof FormData)) {
|
|
8126
|
-
defaultHeaders["Content-Type"] = "application/json";
|
|
8127
|
-
}
|
|
8128
|
-
const finalHeaders = new Headers(defaultHeaders);
|
|
8129
|
-
if (options.headers) {
|
|
8130
|
-
if (options.headers instanceof Headers) {
|
|
8131
|
-
options.headers.forEach((v, k) => finalHeaders.set(k, v));
|
|
8132
|
-
} else {
|
|
8133
|
-
Object.entries(options.headers).forEach(([k, v]) => {
|
|
8134
|
-
if (v !== void 0) finalHeaders.set(k, v);
|
|
8135
|
-
});
|
|
8136
|
-
}
|
|
8137
|
-
}
|
|
8138
|
-
const csrfToken = Cookies__default.default.get("XSRF-TOKEN");
|
|
8139
|
-
if (csrfToken) {
|
|
8140
|
-
finalHeaders.set("X-XSRF-TOKEN", csrfToken);
|
|
8141
|
-
}
|
|
8142
|
-
let finalOptions = options;
|
|
8143
|
-
if (options.body) {
|
|
8144
|
-
finalOptions = {
|
|
8145
|
-
...options,
|
|
8146
|
-
body: options.body instanceof FormData ? options.body : JSON.stringify(options.body)
|
|
8147
|
-
};
|
|
8148
|
-
}
|
|
8149
|
-
let response = await fetch(url, {
|
|
8150
|
-
credentials: "include",
|
|
8151
|
-
headers: finalHeaders,
|
|
8152
|
-
...finalOptions
|
|
8153
|
-
});
|
|
8154
|
-
if (response.status === 419) {
|
|
8155
|
-
Cookies__default.default.remove("XSRF-TOKEN");
|
|
8156
|
-
await getCsrfToken();
|
|
8157
|
-
const newToken = Cookies__default.default.get("XSRF-TOKEN");
|
|
8158
|
-
if (newToken) {
|
|
8159
|
-
finalHeaders.set("X-XSRF-TOKEN", newToken);
|
|
8160
|
-
}
|
|
8161
|
-
response = await fetch(url, {
|
|
8162
|
-
credentials: "include",
|
|
8163
|
-
headers: finalHeaders,
|
|
8164
|
-
...options
|
|
8165
|
-
});
|
|
8166
|
-
if (!response.ok) {
|
|
8167
|
-
Cookies__default.default.remove("XSRF-TOKEN");
|
|
8168
|
-
Cookies__default.default.remove("yeverClientUser");
|
|
8169
|
-
window.location.href = "/login";
|
|
8170
|
-
return Promise.reject(new Error("CSRF token expirado"));
|
|
8171
|
-
}
|
|
8172
|
-
}
|
|
8173
|
-
const headers2 = {};
|
|
8174
|
-
response.headers.forEach((value, key) => {
|
|
8175
|
-
headers2[key] = value;
|
|
8176
|
-
});
|
|
8177
|
-
if (!response.ok) {
|
|
8178
|
-
const data2 = await response.json().catch(() => null);
|
|
8179
|
-
const errorMessage = typeof data2 === "object" && data2 !== null && "message" in data2 ? data2.message : "Request failed";
|
|
8180
|
-
const error = new Error(errorMessage);
|
|
8181
|
-
error.status = response.status;
|
|
8182
|
-
error.response = {
|
|
8183
|
-
data: data2,
|
|
8184
|
-
status: response.status
|
|
8185
|
-
};
|
|
8186
|
-
throw error;
|
|
8187
|
-
}
|
|
8188
|
-
let data = null;
|
|
8189
|
-
if (options.responseType === "blob") {
|
|
8190
|
-
data = await response.blob().catch(() => null);
|
|
8191
|
-
} else {
|
|
8192
|
-
data = await response.json().catch(() => null);
|
|
8193
|
-
}
|
|
8194
|
-
return {
|
|
8195
|
-
status: response.status,
|
|
8196
|
-
statusText: response.statusText,
|
|
8197
|
-
data,
|
|
8198
|
-
headers: headers2
|
|
8199
|
-
};
|
|
8200
|
-
}
|
|
8201
|
-
|
|
8202
|
-
// src/utils/parse-parameters-into-url/index.tsx
|
|
8203
|
-
var parseParametersIntoUrl = (url, query, filtersAllowed) => {
|
|
8204
|
-
let urlFiltered = url;
|
|
8205
|
-
for (const key in query) {
|
|
8206
|
-
if (query && Object.keys(query).length > 0) {
|
|
8207
|
-
urlFiltered = urlFiltered.replace(`/${key}/`, `/${query[key]}/`);
|
|
8208
|
-
urlFiltered = urlFiltered.replace(`/${key}`, `/${query[key]}`);
|
|
8209
|
-
if (filtersAllowed && filtersAllowed.includes(key)) {
|
|
8210
|
-
if (urlFiltered.includes("?")) {
|
|
8211
|
-
if (key === "searchNew") {
|
|
8212
|
-
urlFiltered = urlFiltered + `&${key}=${atob(query[key])}`;
|
|
8213
|
-
} else {
|
|
8214
|
-
urlFiltered = urlFiltered + `&${key}=${query[key]}`;
|
|
8215
|
-
}
|
|
8216
|
-
} else {
|
|
8217
|
-
if (key === "searchNew") {
|
|
8218
|
-
urlFiltered = urlFiltered + `?${key}=${atob(query[key])}`;
|
|
8219
|
-
} else {
|
|
8220
|
-
urlFiltered = urlFiltered + `?${key}=${query[key]}`;
|
|
8221
|
-
}
|
|
8222
|
-
}
|
|
8223
|
-
}
|
|
8224
|
-
}
|
|
8225
|
-
}
|
|
8226
|
-
return urlFiltered;
|
|
8227
|
-
};
|
|
8228
|
-
|
|
8229
|
-
// src/lib/fetch-server-side/index.ts
|
|
8230
|
-
var fetchServerSide = async ({
|
|
8231
|
-
urlRequest,
|
|
8232
|
-
parseData,
|
|
8233
|
-
filtersAllowed,
|
|
8234
|
-
method = "GET",
|
|
8235
|
-
body
|
|
8236
|
-
}) => {
|
|
8237
|
-
"use server";
|
|
8238
|
-
try {
|
|
8239
|
-
const headersObject = Object.fromEntries((await headers.headers()).entries());
|
|
8240
|
-
const searchParams = new URLSearchParams(headersObject.referer ? new URL(headersObject.referer).search : "");
|
|
8241
|
-
const query = Array.from(searchParams.entries()).reduce((acc, [key, value]) => {
|
|
8242
|
-
acc[key] = value;
|
|
8243
|
-
return acc;
|
|
8244
|
-
}, {});
|
|
8245
|
-
const url = parseParametersIntoUrl(urlRequest, query, filtersAllowed);
|
|
8246
|
-
const origin = headersObject.host;
|
|
8247
|
-
const cookie = headersObject.cookie;
|
|
8248
|
-
const xsrfToken = cookie?.match(/XSRF-TOKEN=([^;]+)/)?.[1];
|
|
8249
|
-
const requestHeaders = {
|
|
8250
|
-
Cookie: cookie,
|
|
8251
|
-
origin
|
|
8252
|
-
};
|
|
8253
|
-
if (xsrfToken) {
|
|
8254
|
-
requestHeaders["X-XSRF-TOKEN"] = decodeURIComponent(xsrfToken);
|
|
8255
|
-
}
|
|
8256
|
-
let pagination;
|
|
8257
|
-
const res = await apiFetch({
|
|
8258
|
-
url,
|
|
8259
|
-
method,
|
|
8260
|
-
body,
|
|
8261
|
-
headers: requestHeaders,
|
|
8262
|
-
cache: "no-store"
|
|
8263
|
-
});
|
|
8264
|
-
if (res?.data && typeof res.data === "object" && "paginate" in res.data) {
|
|
8265
|
-
pagination = res.data.paginate;
|
|
8266
|
-
}
|
|
8267
|
-
const parsedData = parseData ? parseData(res) : res;
|
|
8268
|
-
return {
|
|
8269
|
-
props: {
|
|
8270
|
-
pagination,
|
|
8271
|
-
data: parsedData
|
|
8272
|
-
}
|
|
8273
|
-
};
|
|
8274
|
-
} catch (error) {
|
|
8275
|
-
const apiError = error;
|
|
8276
|
-
switch (apiError.response?.status) {
|
|
8277
|
-
case 401:
|
|
8278
|
-
navigation.redirect("/login");
|
|
8279
|
-
case 403:
|
|
8280
|
-
return {
|
|
8281
|
-
props: {
|
|
8282
|
-
error: {
|
|
8283
|
-
status: 403,
|
|
8284
|
-
message: "Voc\xEA n\xE3o tem permiss\xE3o para executar essa a\xE7\xE3o",
|
|
8285
|
-
errors: {}
|
|
8286
|
-
},
|
|
8287
|
-
data: null
|
|
8288
|
-
}
|
|
8289
|
-
};
|
|
8290
|
-
case 404:
|
|
8291
|
-
return {
|
|
8292
|
-
props: {
|
|
8293
|
-
error: {
|
|
8294
|
-
status: 404,
|
|
8295
|
-
message: apiError.response.data?.message || "Recurso n\xE3o encontrado",
|
|
8296
|
-
errors: apiError.response?.data?.errors || {}
|
|
8297
|
-
},
|
|
8298
|
-
data: null
|
|
8299
|
-
}
|
|
8300
|
-
};
|
|
8301
|
-
case 422:
|
|
8302
|
-
return {
|
|
8303
|
-
props: {
|
|
8304
|
-
error: {
|
|
8305
|
-
status: 422,
|
|
8306
|
-
message: apiError.response.data?.message || "Erro de valida\xE7\xE3o",
|
|
8307
|
-
errors: apiError.response?.data?.errors
|
|
8308
|
-
}
|
|
8309
|
-
}
|
|
8310
|
-
};
|
|
8311
|
-
case 500:
|
|
8312
|
-
return {
|
|
8313
|
-
props: {
|
|
8314
|
-
error: {
|
|
8315
|
-
status: 500,
|
|
8316
|
-
message: apiError.response.data?.message || "Ocorreu um erro durante o processamento dessa requisi\xE7\xE3o. A Yever foi notificada e estamos atuando para sanar o problema.",
|
|
8317
|
-
errors: {}
|
|
8318
|
-
}
|
|
8319
|
-
}
|
|
8320
|
-
};
|
|
8321
|
-
default:
|
|
8322
|
-
if (apiError.response?.data?.errors || apiError.response?.data?.message) {
|
|
8323
|
-
return {
|
|
8324
|
-
props: {
|
|
8325
|
-
error: {
|
|
8326
|
-
status: apiError.response.status,
|
|
8327
|
-
message: apiError.response.data?.message,
|
|
8328
|
-
errors: apiError.response.data?.errors
|
|
8329
|
-
}
|
|
8330
|
-
}
|
|
8331
|
-
};
|
|
8332
|
-
}
|
|
8333
|
-
navigation.redirect("/500");
|
|
8334
|
-
}
|
|
8335
|
-
}
|
|
8336
|
-
};
|
|
8337
8095
|
var Dropshiping = (props) => {
|
|
8338
8096
|
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: 25, height: 25, viewBox: "0 0 25 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
8339
8097
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9856,6 +9614,33 @@ var shadow = {
|
|
|
9856
9614
|
store: "0px 4px 8px 3px rgba(0, 0, 0, 0.04)"
|
|
9857
9615
|
};
|
|
9858
9616
|
var shadow_default = shadow;
|
|
9617
|
+
|
|
9618
|
+
// src/utils/parse-parameters-into-url/index.tsx
|
|
9619
|
+
var parseParametersIntoUrl = (url, query, filtersAllowed) => {
|
|
9620
|
+
let urlFiltered = url;
|
|
9621
|
+
for (const key in query) {
|
|
9622
|
+
if (query && Object.keys(query).length > 0) {
|
|
9623
|
+
urlFiltered = urlFiltered.replace(`/${key}/`, `/${query[key]}/`);
|
|
9624
|
+
urlFiltered = urlFiltered.replace(`/${key}`, `/${query[key]}`);
|
|
9625
|
+
if (filtersAllowed && filtersAllowed.includes(key)) {
|
|
9626
|
+
if (urlFiltered.includes("?")) {
|
|
9627
|
+
if (key === "searchNew") {
|
|
9628
|
+
urlFiltered = urlFiltered + `&${key}=${atob(query[key])}`;
|
|
9629
|
+
} else {
|
|
9630
|
+
urlFiltered = urlFiltered + `&${key}=${query[key]}`;
|
|
9631
|
+
}
|
|
9632
|
+
} else {
|
|
9633
|
+
if (key === "searchNew") {
|
|
9634
|
+
urlFiltered = urlFiltered + `?${key}=${atob(query[key])}`;
|
|
9635
|
+
} else {
|
|
9636
|
+
urlFiltered = urlFiltered + `?${key}=${query[key]}`;
|
|
9637
|
+
}
|
|
9638
|
+
}
|
|
9639
|
+
}
|
|
9640
|
+
}
|
|
9641
|
+
}
|
|
9642
|
+
return urlFiltered;
|
|
9643
|
+
};
|
|
9859
9644
|
var useCopyToClipboard = (successMessage) => {
|
|
9860
9645
|
const copyToClipboard = (initialText) => {
|
|
9861
9646
|
const textArea = document.createElement("textarea");
|
|
@@ -10042,7 +9827,6 @@ exports.Yever = Yever_default;
|
|
|
10042
9827
|
exports.calculateCurrencyOperation = calculateCurrencyOperation;
|
|
10043
9828
|
exports.cn = cn;
|
|
10044
9829
|
exports.colors = colors_default;
|
|
10045
|
-
exports.fetchServerSide = fetchServerSide;
|
|
10046
9830
|
exports.fontFamily = font_family_default;
|
|
10047
9831
|
exports.formatCNPJ = formatCNPJ;
|
|
10048
9832
|
exports.formatCNPJCPF = formatCNPJCPF;
|