@credithub/harlan-components 1.58.3 → 1.59.1
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/consultaRfb.js +1 -1
- package/dist/components/dossie/dossie.js +1 -1
- package/dist/components/dossie/summary/cardsAndProducts.d.ts +7 -4
- package/dist/components/dossie/summary/cardsAndProducts.js +11 -7
- package/dist/components/dossie/summary/summary.d.ts +0 -1
- package/dist/components/dossie/summary/summary.js +1 -2
- package/dist/utils/protestosp.js +1 -1
- package/lib/cjs/index.js +182 -182
- package/lib/esm/index.js +182 -182
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ export var ConsultaRfbProvider = function (_a) {
|
|
|
6
6
|
var _b, _c, _d, _e;
|
|
7
7
|
var children = _a.children, documento = _a.documento;
|
|
8
8
|
var _f = useState(false), enableFallback = _f[0], setEnableFallback = _f[1];
|
|
9
|
-
var query = useQuery("SELECT FROM 'RFB'.'CERTIDAO'", { documento: documento }
|
|
9
|
+
var query = useQuery("SELECT FROM 'RFB'.'CERTIDAO'", { documento: documento });
|
|
10
10
|
var queryFallback = useQuery("SELECT FROM 'RECEITAWS'.'CNPJ'", { documento: documento }, enableFallback);
|
|
11
11
|
var executeFallback = function () { return setEnableFallback(true); };
|
|
12
12
|
useEffect(function () {
|
|
@@ -69,7 +69,7 @@ var Dossie = function (_a) {
|
|
|
69
69
|
React.createElement(DossieContainer, null,
|
|
70
70
|
React.createElement(DossieContent, null,
|
|
71
71
|
React.createElement(DossieCarrousel, null),
|
|
72
|
-
React.createElement(Summary, { finderResponse: data,
|
|
72
|
+
React.createElement(Summary, { finderResponse: data, document: document })),
|
|
73
73
|
React.createElement(TransactionsTable, { events: XPathUtils.select('//historico/consulta', data) || [] })),
|
|
74
74
|
!printMode && (React.createElement(GenerativeAIContainer, null,
|
|
75
75
|
React.createElement(GenerativeAI, { documento: document })))));
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const useCardsAndProducts: ({ finderResponse, }: {
|
|
2
3
|
finderResponse?: Document;
|
|
3
|
-
rfbResponse?: Document;
|
|
4
4
|
}) => {
|
|
5
|
-
cards: {
|
|
5
|
+
cards: ({
|
|
6
6
|
title: string | false;
|
|
7
7
|
header: string;
|
|
8
|
-
}
|
|
8
|
+
} | {
|
|
9
|
+
title: string | React.JSX.Element;
|
|
10
|
+
header: string;
|
|
11
|
+
})[];
|
|
9
12
|
products: {
|
|
10
13
|
title: string;
|
|
11
14
|
onClick: () => Promise<void>;
|
|
@@ -45,17 +45,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
import React from 'react';
|
|
48
49
|
import { useConsultasComplementares } from '../../../hooks/useConsultasComplementares';
|
|
49
50
|
import { formatMoney } from '../../../utils/number';
|
|
50
51
|
import XPathUtils from '../../../utils/xpath';
|
|
51
52
|
import { useState } from 'react';
|
|
52
53
|
import { getAtividadesEconomicasSecundarias, getField, getFieldRfb, getProductsPrices } from './utils';
|
|
54
|
+
import { useConsultaRfb } from '../../../hooks/useConsultaRfb';
|
|
55
|
+
import { LoadingDots } from '../generativeAi/styles';
|
|
53
56
|
var useCardsAndProducts = function (_a) {
|
|
54
57
|
var _b, _c, _d, _e, _f;
|
|
55
|
-
var finderResponse = _a.finderResponse
|
|
56
|
-
var _g =
|
|
57
|
-
var _h =
|
|
58
|
-
var _j =
|
|
58
|
+
var finderResponse = _a.finderResponse;
|
|
59
|
+
var _g = useConsultaRfb(), rfbResponse = _g.rfbResponse, rfbIsLoading = _g.isLoading;
|
|
60
|
+
var _h = useState(false), isModalOpen = _h[0], setModalOpen = _h[1];
|
|
61
|
+
var _j = useConsultasComplementares(), consultasComplementares = _j.consultasComplementares, setConsultasComplementares = _j.setConsultasComplementares, hasCredits = _j.hasCredits;
|
|
62
|
+
var _k = useState({}), loadingButtons = _k[0], setLoadingButtons = _k[1];
|
|
59
63
|
var handleModalClick = function () { return setModalOpen(true); };
|
|
60
64
|
var closeModal = function () { return setModalOpen(false); };
|
|
61
65
|
var isPF = !!getField('cpf', finderResponse);
|
|
@@ -102,7 +106,7 @@ var useCardsAndProducts = function (_a) {
|
|
|
102
106
|
});
|
|
103
107
|
}); };
|
|
104
108
|
};
|
|
105
|
-
var
|
|
109
|
+
var _l = {
|
|
106
110
|
cards: [
|
|
107
111
|
{
|
|
108
112
|
title: getField('sexo', finderResponse, function (value) {
|
|
@@ -141,7 +145,7 @@ var useCardsAndProducts = function (_a) {
|
|
|
141
145
|
header: 'UF do RG'
|
|
142
146
|
},
|
|
143
147
|
{
|
|
144
|
-
title: getField('status', finderResponse),
|
|
148
|
+
title: rfbIsLoading ? React.createElement(LoadingDots, null) : getFieldRfb('situacao', rfbResponse) || getField('status', finderResponse),
|
|
145
149
|
header: 'Situação'
|
|
146
150
|
},
|
|
147
151
|
{
|
|
@@ -291,7 +295,7 @@ var useCardsAndProducts = function (_a) {
|
|
|
291
295
|
isLoading: loadingButtons['imoveis']
|
|
292
296
|
}*/
|
|
293
297
|
]
|
|
294
|
-
}, cards =
|
|
298
|
+
}, cards = _l.cards, products = _l.products;
|
|
295
299
|
return { cards: cards, products: products, isModalOpen: isModalOpen, closeModal: closeModal };
|
|
296
300
|
};
|
|
297
301
|
export default useCardsAndProducts;
|
|
@@ -6,10 +6,9 @@ import React from 'react';
|
|
|
6
6
|
import useCardsAndProducts from './cardsAndProducts';
|
|
7
7
|
import { ButtonsSummary, ButtonsWrapper, ContainerSummary, ContentSummary, FieldSummary, Spinner, SummaryButton } from './styles';
|
|
8
8
|
export var Summary = function (_a) {
|
|
9
|
-
var finderResponse = _a.finderResponse
|
|
9
|
+
var finderResponse = _a.finderResponse;
|
|
10
10
|
var _b = useCardsAndProducts({
|
|
11
11
|
finderResponse: finderResponse,
|
|
12
|
-
rfbResponse: rfbResponse
|
|
13
12
|
}), cards = _b.cards, products = _b.products, isModalOpen = _b.isModalOpen, closeModal = _b.closeModal;
|
|
14
13
|
return (React.createElement(React.Fragment, null,
|
|
15
14
|
React.createElement(ContainerSummary, { className: "credithub-container-summary" },
|
package/dist/utils/protestosp.js
CHANGED
|
@@ -57,7 +57,7 @@ export function openFormThenRedirect(chaveUnica, devedorPrincipal) {
|
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
// Build the HTML document for the new window with the form.
|
|
60
|
-
var html = "\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <title>Instrumento de S\u00E3o Paulo</title>\n </head>\n <body>\n <form id=\"submissionForm\" method=\"POST\" action=\"https://protestosp.com.br/Validacoes/Consultar\">\n <input type=\"hidden\" name=\"vTipoDocumento\" value=\"1\">\n <input type=\"hidden\" name=\"ChaveUnica\" value=\"".concat(formattedChaveUnica, "\">\n <input type=\"hidden\" name=\"DevedorPrincipalTipo\" value=\"").concat(devedorPrincipalTipo, "\">\n <input type=\"hidden\" name=\"DevedorPrincipal\" value=\"").concat(formattedDevedorPrincipal, "\">\n <input type=\"hidden\" name=\"ChaveValidacao\" value=\"P35-5030-8000-\">\n <input type=\"hidden\" name=\"PesquisadoDocumentoTipo\" value=\"0\">\n <input type=\"hidden\" name=\"PesquisadoDocumento\" value=\"\">\n <input type=\"hidden\" name=\"X-Requested-With\" value=\"XMLHttpRequest\">\n </form>\n <script>\n // Auto-submit the form.\n document.getElementById('submissionForm').submit();\n // After 2 seconds, close this window.\n </script>\n </body>\n </html>\n ");
|
|
60
|
+
var html = "\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <title>Instrumento de S\u00E3o Paulo</title>\n <meta name=\"referrer\" content=\"no-referrer\" />\n </head>\n <body>\n <form id=\"submissionForm\" method=\"POST\" action=\"https://protestosp.com.br/Validacoes/Consultar\">\n <input type=\"hidden\" name=\"vTipoDocumento\" value=\"1\">\n <input type=\"hidden\" name=\"ChaveUnica\" value=\"".concat(formattedChaveUnica, "\">\n <input type=\"hidden\" name=\"DevedorPrincipalTipo\" value=\"").concat(devedorPrincipalTipo, "\">\n <input type=\"hidden\" name=\"DevedorPrincipal\" value=\"").concat(formattedDevedorPrincipal, "\">\n <input type=\"hidden\" name=\"ChaveValidacao\" value=\"P35-5030-8000-\">\n <input type=\"hidden\" name=\"PesquisadoDocumentoTipo\" value=\"0\">\n <input type=\"hidden\" name=\"PesquisadoDocumento\" value=\"\">\n <input type=\"hidden\" name=\"X-Requested-With\" value=\"XMLHttpRequest\">\n </form>\n <script>\n // Auto-submit the form.\n document.getElementById('submissionForm').submit();\n // After 2 seconds, close this window.\n </script>\n </body>\n </html>\n ");
|
|
61
61
|
newWindow.document.open();
|
|
62
62
|
newWindow.document.write(html);
|
|
63
63
|
setTimeout(function () {
|