@yeverlibs/ds 1.1.11 → 1.1.13
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 +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +282 -151
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +282 -152
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -217,9 +217,9 @@ declare const CheckboxGroup: <T extends string | number | boolean = string>({ op
|
|
|
217
217
|
type ModalProps = {
|
|
218
218
|
isModalOpen: boolean
|
|
219
219
|
setIsModalOpen: Dispatch<SetStateAction<boolean>>
|
|
220
|
-
|
|
220
|
+
endpoint: string
|
|
221
221
|
successMessage?: string
|
|
222
|
-
location
|
|
222
|
+
location: string
|
|
223
223
|
title: string
|
|
224
224
|
message: string
|
|
225
225
|
onSuccess?: () => void
|
|
@@ -1385,6 +1385,10 @@ declare const transformToPercentage: (value: string, isFromInput?: boolean, isSy
|
|
|
1385
1385
|
|
|
1386
1386
|
declare const truncateString: (str: string, num: number) => string;
|
|
1387
1387
|
|
|
1388
|
+
declare const PriceSkeleton: React.FC<{
|
|
1389
|
+
size: 'xsmall' | 'small' | 'medium' | 'large' | 'topbar';
|
|
1390
|
+
}>;
|
|
1391
|
+
|
|
1388
1392
|
declare const colors: {
|
|
1389
1393
|
white: string;
|
|
1390
1394
|
black: string;
|
|
@@ -1511,4 +1515,4 @@ declare const useCopyToClipboard: (successMessage?: string) => {
|
|
|
1511
1515
|
copyToClipboard: (initialText: string) => void;
|
|
1512
1516
|
};
|
|
1513
1517
|
|
|
1514
|
-
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, searchParamsToUrl, shadow, transformDateToAmericanFormat, transformToCurrency, transformToNumber, transformToPercentage, truncateString, useCopyToClipboard, useFetchClientSide };
|
|
1518
|
+
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, PriceSkeleton, 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, searchParamsToUrl, shadow, transformDateToAmericanFormat, transformToCurrency, transformToNumber, transformToPercentage, truncateString, useCopyToClipboard, useFetchClientSide };
|
package/dist/index.d.ts
CHANGED
|
@@ -217,9 +217,9 @@ declare const CheckboxGroup: <T extends string | number | boolean = string>({ op
|
|
|
217
217
|
type ModalProps = {
|
|
218
218
|
isModalOpen: boolean
|
|
219
219
|
setIsModalOpen: Dispatch<SetStateAction<boolean>>
|
|
220
|
-
|
|
220
|
+
endpoint: string
|
|
221
221
|
successMessage?: string
|
|
222
|
-
location
|
|
222
|
+
location: string
|
|
223
223
|
title: string
|
|
224
224
|
message: string
|
|
225
225
|
onSuccess?: () => void
|
|
@@ -1385,6 +1385,10 @@ declare const transformToPercentage: (value: string, isFromInput?: boolean, isSy
|
|
|
1385
1385
|
|
|
1386
1386
|
declare const truncateString: (str: string, num: number) => string;
|
|
1387
1387
|
|
|
1388
|
+
declare const PriceSkeleton: React.FC<{
|
|
1389
|
+
size: 'xsmall' | 'small' | 'medium' | 'large' | 'topbar';
|
|
1390
|
+
}>;
|
|
1391
|
+
|
|
1388
1392
|
declare const colors: {
|
|
1389
1393
|
white: string;
|
|
1390
1394
|
black: string;
|
|
@@ -1511,4 +1515,4 @@ declare const useCopyToClipboard: (successMessage?: string) => {
|
|
|
1511
1515
|
copyToClipboard: (initialText: string) => void;
|
|
1512
1516
|
};
|
|
1513
1517
|
|
|
1514
|
-
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, searchParamsToUrl, shadow, transformDateToAmericanFormat, transformToCurrency, transformToNumber, transformToPercentage, truncateString, useCopyToClipboard, useFetchClientSide };
|
|
1518
|
+
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, PriceSkeleton, 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, searchParamsToUrl, shadow, transformDateToAmericanFormat, transformToCurrency, transformToNumber, transformToPercentage, truncateString, useCopyToClipboard, useFetchClientSide };
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,9 @@ var tw5 = require('tailwind-styled-components');
|
|
|
9
9
|
var Image4 = require('next/image');
|
|
10
10
|
var ReactDOM = require('react-dom');
|
|
11
11
|
var sonner = require('sonner');
|
|
12
|
+
var cache = require('next/cache');
|
|
13
|
+
var headers = require('next/headers');
|
|
14
|
+
var Cookies = require('js-cookie');
|
|
12
15
|
var Select = require('react-select');
|
|
13
16
|
var dateFns = require('date-fns');
|
|
14
17
|
var locale = require('date-fns/locale');
|
|
@@ -18,7 +21,6 @@ var framerMotion = require('framer-motion');
|
|
|
18
21
|
var bar = require('@nivo/bar');
|
|
19
22
|
var line = require('@nivo/line');
|
|
20
23
|
var pie = require('@nivo/pie');
|
|
21
|
-
var Cookies = require('js-cookie');
|
|
22
24
|
var currency = require('currency.js');
|
|
23
25
|
|
|
24
26
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -45,9 +47,9 @@ var React107__namespace = /*#__PURE__*/_interopNamespace(React107);
|
|
|
45
47
|
var tw5__default = /*#__PURE__*/_interopDefault(tw5);
|
|
46
48
|
var Image4__default = /*#__PURE__*/_interopDefault(Image4);
|
|
47
49
|
var ReactDOM__default = /*#__PURE__*/_interopDefault(ReactDOM);
|
|
50
|
+
var Cookies__default = /*#__PURE__*/_interopDefault(Cookies);
|
|
48
51
|
var Select__default = /*#__PURE__*/_interopDefault(Select);
|
|
49
52
|
var Link2__default = /*#__PURE__*/_interopDefault(Link2);
|
|
50
|
-
var Cookies__default = /*#__PURE__*/_interopDefault(Cookies);
|
|
51
53
|
var currency__default = /*#__PURE__*/_interopDefault(currency);
|
|
52
54
|
|
|
53
55
|
// src/lib/utils.ts
|
|
@@ -4128,10 +4130,259 @@ async function handleFormSubmission({
|
|
|
4128
4130
|
}
|
|
4129
4131
|
return result;
|
|
4130
4132
|
}
|
|
4133
|
+
async function getCsrfToken() {
|
|
4134
|
+
const baseURL = process.env.NEXT_PUBLIC_API_URL ?? "http://api.yever.local";
|
|
4135
|
+
const response = await fetch(`${baseURL}/sanctum/csrf-cookie`, {
|
|
4136
|
+
credentials: "include",
|
|
4137
|
+
headers: {
|
|
4138
|
+
"X-Requested-With": "XMLHttpRequest"
|
|
4139
|
+
}
|
|
4140
|
+
});
|
|
4141
|
+
if (!response.ok) {
|
|
4142
|
+
throw new Error("Falha ao obter token CSRF");
|
|
4143
|
+
}
|
|
4144
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
4145
|
+
}
|
|
4146
|
+
async function apiFetch(options) {
|
|
4147
|
+
const baseURL = process.env.NEXT_PUBLIC_API_URL ?? "";
|
|
4148
|
+
const isAbsolute = /^https?:\/\//i.test(options.url);
|
|
4149
|
+
const url = isAbsolute ? options.url : `${baseURL}${options.url}`;
|
|
4150
|
+
const method = (options.method ?? "GET").toString().toLowerCase();
|
|
4151
|
+
const needsCSRFToken = ["post", "put", "delete"].includes(method);
|
|
4152
|
+
const hasCSRFCookie = Cookies__default.default.get("XSRF-TOKEN");
|
|
4153
|
+
if (needsCSRFToken && !hasCSRFCookie) {
|
|
4154
|
+
await getCsrfToken();
|
|
4155
|
+
}
|
|
4156
|
+
const defaultHeaders = {
|
|
4157
|
+
"X-Requested-With": "XMLHttpRequest",
|
|
4158
|
+
Accept: "application/json"
|
|
4159
|
+
};
|
|
4160
|
+
if (!(options.body instanceof FormData)) {
|
|
4161
|
+
defaultHeaders["Content-Type"] = "application/json";
|
|
4162
|
+
}
|
|
4163
|
+
const finalHeaders = new Headers(defaultHeaders);
|
|
4164
|
+
if (options.headers) {
|
|
4165
|
+
if (options.headers instanceof Headers) {
|
|
4166
|
+
options.headers.forEach((v, k) => finalHeaders.set(k, v));
|
|
4167
|
+
} else {
|
|
4168
|
+
Object.entries(options.headers).forEach(([k, v]) => {
|
|
4169
|
+
if (v !== void 0) finalHeaders.set(k, v);
|
|
4170
|
+
});
|
|
4171
|
+
}
|
|
4172
|
+
}
|
|
4173
|
+
const csrfToken = Cookies__default.default.get("XSRF-TOKEN");
|
|
4174
|
+
if (csrfToken) {
|
|
4175
|
+
finalHeaders.set("X-XSRF-TOKEN", csrfToken);
|
|
4176
|
+
}
|
|
4177
|
+
let finalOptions = options;
|
|
4178
|
+
if (options.body) {
|
|
4179
|
+
finalOptions = {
|
|
4180
|
+
...options,
|
|
4181
|
+
body: options.body instanceof FormData ? options.body : JSON.stringify(options.body)
|
|
4182
|
+
};
|
|
4183
|
+
}
|
|
4184
|
+
let response = await fetch(url, {
|
|
4185
|
+
credentials: "include",
|
|
4186
|
+
headers: finalHeaders,
|
|
4187
|
+
...finalOptions
|
|
4188
|
+
});
|
|
4189
|
+
if (response.status === 419) {
|
|
4190
|
+
Cookies__default.default.remove("XSRF-TOKEN");
|
|
4191
|
+
await getCsrfToken();
|
|
4192
|
+
const newToken = Cookies__default.default.get("XSRF-TOKEN");
|
|
4193
|
+
if (newToken) {
|
|
4194
|
+
finalHeaders.set("X-XSRF-TOKEN", newToken);
|
|
4195
|
+
}
|
|
4196
|
+
response = await fetch(url, {
|
|
4197
|
+
credentials: "include",
|
|
4198
|
+
headers: finalHeaders,
|
|
4199
|
+
...options
|
|
4200
|
+
});
|
|
4201
|
+
if (!response.ok) {
|
|
4202
|
+
Cookies__default.default.remove("XSRF-TOKEN");
|
|
4203
|
+
Cookies__default.default.remove("yeverClientUser");
|
|
4204
|
+
window.location.href = "/login";
|
|
4205
|
+
return Promise.reject(new Error("CSRF token expirado"));
|
|
4206
|
+
}
|
|
4207
|
+
}
|
|
4208
|
+
const headers2 = {};
|
|
4209
|
+
response.headers.forEach((value, key) => {
|
|
4210
|
+
headers2[key] = value;
|
|
4211
|
+
});
|
|
4212
|
+
if (!response.ok) {
|
|
4213
|
+
const data2 = await response.json().catch(() => null);
|
|
4214
|
+
const errorMessage = typeof data2 === "object" && data2 !== null && "message" in data2 ? data2.message : "Request failed";
|
|
4215
|
+
const error = new Error(errorMessage);
|
|
4216
|
+
error.status = response.status;
|
|
4217
|
+
error.response = {
|
|
4218
|
+
data: data2,
|
|
4219
|
+
status: response.status
|
|
4220
|
+
};
|
|
4221
|
+
throw error;
|
|
4222
|
+
}
|
|
4223
|
+
let data = null;
|
|
4224
|
+
if (options.responseType === "blob") {
|
|
4225
|
+
data = await response.blob().catch(() => null);
|
|
4226
|
+
} else {
|
|
4227
|
+
data = await response.json().catch(() => null);
|
|
4228
|
+
}
|
|
4229
|
+
return {
|
|
4230
|
+
status: response.status,
|
|
4231
|
+
statusText: response.statusText,
|
|
4232
|
+
data,
|
|
4233
|
+
headers: headers2
|
|
4234
|
+
};
|
|
4235
|
+
}
|
|
4236
|
+
|
|
4237
|
+
// src/utils/parse-parameters-into-url/index.tsx
|
|
4238
|
+
var parseParametersIntoUrl = (url, query, filtersAllowed) => {
|
|
4239
|
+
let urlFiltered = url;
|
|
4240
|
+
for (const key in query) {
|
|
4241
|
+
if (query && Object.keys(query).length > 0) {
|
|
4242
|
+
urlFiltered = urlFiltered.replace(`/${key}/`, `/${query[key]}/`);
|
|
4243
|
+
urlFiltered = urlFiltered.replace(`/${key}`, `/${query[key]}`);
|
|
4244
|
+
if (filtersAllowed && filtersAllowed.includes(key)) {
|
|
4245
|
+
if (urlFiltered.includes("?")) {
|
|
4246
|
+
if (key === "searchNew") {
|
|
4247
|
+
urlFiltered = urlFiltered + `&${key}=${atob(query[key])}`;
|
|
4248
|
+
} else {
|
|
4249
|
+
urlFiltered = urlFiltered + `&${key}=${query[key]}`;
|
|
4250
|
+
}
|
|
4251
|
+
} else {
|
|
4252
|
+
if (key === "searchNew") {
|
|
4253
|
+
urlFiltered = urlFiltered + `?${key}=${atob(query[key])}`;
|
|
4254
|
+
} else {
|
|
4255
|
+
urlFiltered = urlFiltered + `?${key}=${query[key]}`;
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
}
|
|
4260
|
+
}
|
|
4261
|
+
return urlFiltered;
|
|
4262
|
+
};
|
|
4263
|
+
|
|
4264
|
+
// src/lib/fetch-server-side/index.ts
|
|
4265
|
+
var fetchServerSide = async ({
|
|
4266
|
+
urlRequest,
|
|
4267
|
+
parseData,
|
|
4268
|
+
filtersAllowed,
|
|
4269
|
+
method = "GET",
|
|
4270
|
+
body
|
|
4271
|
+
}) => {
|
|
4272
|
+
"use server";
|
|
4273
|
+
try {
|
|
4274
|
+
const headersObject = Object.fromEntries((await headers.headers()).entries());
|
|
4275
|
+
const searchParams = new URLSearchParams(headersObject.referer ? new URL(headersObject.referer).search : "");
|
|
4276
|
+
const query = Array.from(searchParams.entries()).reduce((acc, [key, value]) => {
|
|
4277
|
+
acc[key] = value;
|
|
4278
|
+
return acc;
|
|
4279
|
+
}, {});
|
|
4280
|
+
const url = parseParametersIntoUrl(urlRequest, query, filtersAllowed);
|
|
4281
|
+
const origin = headersObject.host;
|
|
4282
|
+
const cookie = headersObject.cookie;
|
|
4283
|
+
const xsrfToken = cookie?.match(/XSRF-TOKEN=([^;]+)/)?.[1];
|
|
4284
|
+
const requestHeaders = {
|
|
4285
|
+
Cookie: cookie,
|
|
4286
|
+
origin
|
|
4287
|
+
};
|
|
4288
|
+
if (xsrfToken) {
|
|
4289
|
+
requestHeaders["X-XSRF-TOKEN"] = decodeURIComponent(xsrfToken);
|
|
4290
|
+
}
|
|
4291
|
+
let pagination;
|
|
4292
|
+
const res = await apiFetch({
|
|
4293
|
+
url,
|
|
4294
|
+
method,
|
|
4295
|
+
body,
|
|
4296
|
+
headers: requestHeaders,
|
|
4297
|
+
cache: "no-store"
|
|
4298
|
+
});
|
|
4299
|
+
if (res?.data && typeof res.data === "object" && "paginate" in res.data) {
|
|
4300
|
+
pagination = res.data.paginate;
|
|
4301
|
+
}
|
|
4302
|
+
const parsedData = parseData ? parseData(res) : res;
|
|
4303
|
+
return {
|
|
4304
|
+
props: {
|
|
4305
|
+
pagination,
|
|
4306
|
+
data: parsedData
|
|
4307
|
+
}
|
|
4308
|
+
};
|
|
4309
|
+
} catch (error) {
|
|
4310
|
+
const apiError = error;
|
|
4311
|
+
switch (apiError.response?.status) {
|
|
4312
|
+
case 401:
|
|
4313
|
+
navigation.redirect("/login");
|
|
4314
|
+
case 403:
|
|
4315
|
+
return {
|
|
4316
|
+
props: {
|
|
4317
|
+
error: {
|
|
4318
|
+
status: 403,
|
|
4319
|
+
message: "Voc\xEA n\xE3o tem permiss\xE3o para executar essa a\xE7\xE3o",
|
|
4320
|
+
errors: {}
|
|
4321
|
+
},
|
|
4322
|
+
data: null
|
|
4323
|
+
}
|
|
4324
|
+
};
|
|
4325
|
+
case 404:
|
|
4326
|
+
return {
|
|
4327
|
+
props: {
|
|
4328
|
+
error: {
|
|
4329
|
+
status: 404,
|
|
4330
|
+
message: apiError.response.data?.message || "Recurso n\xE3o encontrado",
|
|
4331
|
+
errors: apiError.response?.data?.errors || {}
|
|
4332
|
+
},
|
|
4333
|
+
data: null
|
|
4334
|
+
}
|
|
4335
|
+
};
|
|
4336
|
+
case 422:
|
|
4337
|
+
return {
|
|
4338
|
+
props: {
|
|
4339
|
+
error: {
|
|
4340
|
+
status: 422,
|
|
4341
|
+
message: apiError.response.data?.message || "Erro de valida\xE7\xE3o",
|
|
4342
|
+
errors: apiError.response?.data?.errors
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
};
|
|
4346
|
+
case 500:
|
|
4347
|
+
return {
|
|
4348
|
+
props: {
|
|
4349
|
+
error: {
|
|
4350
|
+
status: 500,
|
|
4351
|
+
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.",
|
|
4352
|
+
errors: {}
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
};
|
|
4356
|
+
default:
|
|
4357
|
+
if (apiError.response?.data?.errors || apiError.response?.data?.message) {
|
|
4358
|
+
return {
|
|
4359
|
+
props: {
|
|
4360
|
+
error: {
|
|
4361
|
+
status: apiError.response.status,
|
|
4362
|
+
message: apiError.response.data?.message,
|
|
4363
|
+
errors: apiError.response.data?.errors
|
|
4364
|
+
}
|
|
4365
|
+
}
|
|
4366
|
+
};
|
|
4367
|
+
}
|
|
4368
|
+
navigation.redirect("/500");
|
|
4369
|
+
}
|
|
4370
|
+
}
|
|
4371
|
+
};
|
|
4372
|
+
|
|
4373
|
+
// src/_design-system/delete-modal/_actions/index.ts
|
|
4374
|
+
async function deleteFunc(endpoint, location) {
|
|
4375
|
+
const response = await fetchServerSide({
|
|
4376
|
+
urlRequest: endpoint,
|
|
4377
|
+
method: "DELETE"
|
|
4378
|
+
});
|
|
4379
|
+
cache.revalidatePath(location);
|
|
4380
|
+
return response;
|
|
4381
|
+
}
|
|
4131
4382
|
var DeleteModal = ({
|
|
4132
4383
|
isModalOpen,
|
|
4133
4384
|
setIsModalOpen,
|
|
4134
|
-
|
|
4385
|
+
endpoint,
|
|
4135
4386
|
successMessage,
|
|
4136
4387
|
location,
|
|
4137
4388
|
title,
|
|
@@ -4141,13 +4392,9 @@ var DeleteModal = ({
|
|
|
4141
4392
|
const [loading, setLoading] = React107.useState(false);
|
|
4142
4393
|
const router = navigation.useRouter();
|
|
4143
4394
|
const handleSubmit = async () => {
|
|
4144
|
-
if (!onDelete) {
|
|
4145
|
-
console.error("DeleteModal: onDelete function is required");
|
|
4146
|
-
return;
|
|
4147
|
-
}
|
|
4148
4395
|
setLoading(true);
|
|
4149
4396
|
await handleFormSubmission({
|
|
4150
|
-
customAction:
|
|
4397
|
+
customAction: () => deleteFunc(endpoint, location),
|
|
4151
4398
|
successMessages: {
|
|
4152
4399
|
custom: successMessage || "Item deletado com sucesso"
|
|
4153
4400
|
},
|
|
@@ -4155,7 +4402,7 @@ var DeleteModal = ({
|
|
|
4155
4402
|
setIsModalOpen(false);
|
|
4156
4403
|
if (onSuccess) {
|
|
4157
4404
|
onSuccess();
|
|
4158
|
-
} else
|
|
4405
|
+
} else {
|
|
4159
4406
|
router.push(location);
|
|
4160
4407
|
}
|
|
4161
4408
|
}
|
|
@@ -6566,15 +6813,15 @@ var TableContent = ({
|
|
|
6566
6813
|
var Table = (props) => {
|
|
6567
6814
|
return /* @__PURE__ */ jsxRuntime.jsx(React107.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(TableContent, { ...props }) });
|
|
6568
6815
|
};
|
|
6569
|
-
var Tabs = ({ headers, children, noGap, active, alignDiv = "full" }) => {
|
|
6816
|
+
var Tabs = ({ headers: headers2, children, noGap, active, alignDiv = "full" }) => {
|
|
6570
6817
|
const [activeTab, setActiveTab] = React107.useState(active || 0);
|
|
6571
|
-
const flattenHeaders = (
|
|
6572
|
-
if (Array.isArray(
|
|
6573
|
-
return
|
|
6818
|
+
const flattenHeaders = (headers3) => {
|
|
6819
|
+
if (Array.isArray(headers3[0])) {
|
|
6820
|
+
return headers3.flat();
|
|
6574
6821
|
}
|
|
6575
|
-
return
|
|
6822
|
+
return headers3;
|
|
6576
6823
|
};
|
|
6577
|
-
const flattenedHeaders = flattenHeaders(
|
|
6824
|
+
const flattenedHeaders = flattenHeaders(headers2);
|
|
6578
6825
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col", noGap ? "" : "gap-4"), children: [
|
|
6579
6826
|
/* @__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
6827
|
"button",
|
|
@@ -8095,138 +8342,6 @@ var PieChart = ({
|
|
|
8095
8342
|
}
|
|
8096
8343
|
);
|
|
8097
8344
|
};
|
|
8098
|
-
async function getCsrfToken() {
|
|
8099
|
-
const baseURL = process.env.NEXT_PUBLIC_API_URL ?? "http://api.yever.local";
|
|
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 headers = {};
|
|
8174
|
-
response.headers.forEach((value, key) => {
|
|
8175
|
-
headers[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
|
|
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/hooks/use-fetch-client-side/index.tsx
|
|
8230
8345
|
var noopLoading = {
|
|
8231
8346
|
loadingActions: {
|
|
8232
8347
|
setLoading: () => {
|
|
@@ -8287,22 +8402,22 @@ function useFetchClientSide({
|
|
|
8287
8402
|
if (body instanceof FormData) {
|
|
8288
8403
|
delete configHeaders["Content-Type"];
|
|
8289
8404
|
}
|
|
8290
|
-
const
|
|
8405
|
+
const headers2 = {
|
|
8291
8406
|
"X-Requested-With": "XMLHttpRequest",
|
|
8292
8407
|
Accept: "application/json",
|
|
8293
8408
|
...configHeaders
|
|
8294
8409
|
};
|
|
8295
8410
|
if (body && !(body instanceof FormData)) {
|
|
8296
|
-
|
|
8411
|
+
headers2["Content-Type"] = "application/json";
|
|
8297
8412
|
}
|
|
8298
8413
|
if (csrfToken) {
|
|
8299
|
-
|
|
8414
|
+
headers2["X-XSRF-TOKEN"] = decodeURIComponent(csrfToken);
|
|
8300
8415
|
}
|
|
8301
8416
|
const response = await apiFetch({
|
|
8302
8417
|
url: customUrl || urlFiltered,
|
|
8303
8418
|
method: customMethod || method,
|
|
8304
8419
|
body,
|
|
8305
|
-
headers,
|
|
8420
|
+
headers: headers2,
|
|
8306
8421
|
credentials: "include",
|
|
8307
8422
|
signal,
|
|
8308
8423
|
responseType: config?.responseType
|
|
@@ -9821,6 +9936,21 @@ var truncateString = (str, num) => {
|
|
|
9821
9936
|
}
|
|
9822
9937
|
return str.slice(0, num) + "...";
|
|
9823
9938
|
};
|
|
9939
|
+
var PriceSkeleton = ({ size }) => {
|
|
9940
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9941
|
+
"span",
|
|
9942
|
+
{
|
|
9943
|
+
className: cn(
|
|
9944
|
+
"block w-full rounded-md bg-gray-200",
|
|
9945
|
+
size === "xsmall" && "h-5 min-w-[96px] max-w-[96px]",
|
|
9946
|
+
size === "small" && "h-6 min-w-[96px] max-w-[96px]",
|
|
9947
|
+
size === "medium" && "h-[28px] min-w-[108px] max-w-[108px]",
|
|
9948
|
+
size === "large" && "h-[36px] min-w-[185px] max-w-[185px]",
|
|
9949
|
+
size === "topbar" && "h-[20px] min-w-[84px] max-w-[84px] bg-black opacity-45"
|
|
9950
|
+
)
|
|
9951
|
+
}
|
|
9952
|
+
);
|
|
9953
|
+
};
|
|
9824
9954
|
|
|
9825
9955
|
// src/_design-system/theme/colors.ts
|
|
9826
9956
|
var colors = {
|
|
@@ -10067,6 +10197,7 @@ exports.Plus = Plus_default;
|
|
|
10067
10197
|
exports.Prechargeback = Prechargeback_default;
|
|
10068
10198
|
exports.PrefetchLink = PrefetchLink;
|
|
10069
10199
|
exports.PreviewPhone = PreviewPhone;
|
|
10200
|
+
exports.PriceSkeleton = PriceSkeleton;
|
|
10070
10201
|
exports.Produto = Produto_default;
|
|
10071
10202
|
exports.Produtos = Produtos_default;
|
|
10072
10203
|
exports.Promocoes = Promocoes_default;
|