@credithub/harlan-components 1.13.8 → 1.13.9
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/lib/cjs/components/common/button.js +1 -1
- package/lib/cjs/components/dossie/carrousel/carrousel.js +1 -1
- package/lib/cjs/components/dossie/companyLogo/companyLogo.js +7 -8
- package/lib/cjs/components/dossie/dossie.js +6 -5
- package/lib/cjs/components/dossie/summary/cardsAndProducts.js +2 -2
- package/lib/cjs/components/dossie/summary/summary.js +12 -9
- package/lib/cjs/components/interface/theme.d.ts +6 -0
- package/lib/cjs/components/interface/theme.js +6 -0
- package/lib/cjs/consultaSimples.js +1 -1
- package/lib/esm/components/common/button.js +1 -1
- package/lib/esm/components/dossie/carrousel/carrousel.js +1 -1
- package/lib/esm/components/dossie/companyLogo/companyLogo.js +7 -8
- package/lib/esm/components/dossie/dossie.js +6 -5
- package/lib/esm/components/dossie/summary/cardsAndProducts.js +2 -2
- package/lib/esm/components/dossie/summary/summary.js +12 -9
- package/lib/esm/components/interface/theme.d.ts +6 -0
- package/lib/esm/components/interface/theme.js +6 -0
- package/lib/esm/consultaSimples.js +1 -1
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ var classnames_1 = __importDefault(require("classnames"));
|
|
|
33
33
|
var react_1 = __importDefault(require("react"));
|
|
34
34
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
35
35
|
var theme_1 = __importDefault(require("../interface/theme"));
|
|
36
|
-
var StyledButton = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-style: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n background-color: ", ";\n color: ", ";\n \n padding:
|
|
36
|
+
var StyledButton = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-style: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n background-color: ", ";\n color: ", ";\n \n padding: 8px 20px;\n border: none;\n border-radius: 3.75rem;\n cursor: pointer;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n \n transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;\n\n &:hover {\n background-color: #0056b3;\n }\n\n width: 100% !important;\n"], ["\n font-style: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n background-color: ", ";\n color: ", ";\n \n padding: 8px 20px;\n border: none;\n border-radius: 3.75rem;\n cursor: pointer;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n \n transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;\n\n &:hover {\n background-color: #0056b3;\n }\n\n width: 100% !important;\n"])), theme_1.default.typography.headline14.fontStyle, theme_1.default.typography.headline14.fontWeight, theme_1.default.typography.headline14.fontSize, theme_1.default.typography.headline14.lineHeight, theme_1.default.colors.azulCredithub, theme_1.default.colors.white);
|
|
37
37
|
var SmallContent = styled_components_1.default.small(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: #fdeb35;\n display: block;\n margin-top: 0.25rem;\n"], ["\n color: #fdeb35;\n display: block;\n margin-top: 0.25rem;\n"])));
|
|
38
38
|
var Button = function (_a) {
|
|
39
39
|
var children = _a.children, className = _a.className, smallContent = _a.smallContent, props = __rest(_a, ["children", "className", "smallContent"]);
|
|
@@ -11,7 +11,7 @@ exports.Carrousel = void 0;
|
|
|
11
11
|
var react_1 = __importDefault(require("react"));
|
|
12
12
|
var companyLogo_1 = __importDefault(require("../companyLogo/companyLogo"));
|
|
13
13
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
14
|
-
var CarouselContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n
|
|
14
|
+
var CarouselContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n"])));
|
|
15
15
|
var Carrousel = function (_a) {
|
|
16
16
|
var name = _a.name, document = _a.document;
|
|
17
17
|
return (react_1.default.createElement(CarouselContainer, null,
|
|
@@ -13,20 +13,19 @@ var iconeEmpresa_1 = __importDefault(require("../../../assets/icones/iconeEmpres
|
|
|
13
13
|
var iconePessoa_1 = __importDefault(require("../../../assets/icones/iconePessoa"));
|
|
14
14
|
var string_1 = require("../../../utils/string");
|
|
15
15
|
var theme_1 = __importDefault(require("../../../components/interface/theme"));
|
|
16
|
-
var LogoContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center
|
|
17
|
-
var CompanyName = styled_components_1.default.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size:
|
|
18
|
-
var DocumentContainer = styled_components_1.default.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size:
|
|
19
|
-
var DocumentPrefix = styled_components_1.default.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 0.5rem;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 0.5rem;\n"])));
|
|
16
|
+
var LogoContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center; \n row-gap: 20px;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center; \n row-gap: 20px;\n"])));
|
|
17
|
+
var CompanyName = styled_components_1.default.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: ", ";\n color: ", ";\n text-align: center;\n line-height: ", ";\n font-weight: ", ";\n"], ["\n font-size: ", ";\n color: ", ";\n text-align: center;\n line-height: ", ";\n font-weight: ", ";\n"])), theme_1.default.typography.headline14.fontSize, theme_1.default.colors.cinzaEscuro, theme_1.default.typography.headline14.lineHeight, theme_1.default.typography.headline14.fontWeight);
|
|
18
|
+
var DocumentContainer = styled_components_1.default.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n \n color: ", ";\n background-color: ", ";\n \n text-align: center;\n position: relative;\n padding: 5px 20px;\n border-radius: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n \n color: ", ";\n background-color: ", ";\n \n text-align: center;\n position: relative;\n padding: 5px 20px;\n border-radius: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), theme_1.default.typography.body14.fontSize, theme_1.default.typography.body14.fontWeight, theme_1.default.typography.body14.lineHeight, theme_1.default.colors.cinzaEscuro, theme_1.default.colors.cinzaClaro);
|
|
20
19
|
var Companylogo = function (_a) {
|
|
21
20
|
var name = _a.name, document = _a.document;
|
|
21
|
+
console.log((0, string_1.isDocumentoPF)(document), document);
|
|
22
22
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
23
23
|
react_1.default.createElement(LogoContainer, null,
|
|
24
24
|
react_1.default.createElement(CompanyName, null, name),
|
|
25
25
|
(0, string_1.isDocumentoPF)(document) ? (react_1.default.createElement(iconePessoa_1.default, { size: 60, circleFill: theme_1.default.colors.cinzaClaro, pathFill: theme_1.default.colors.cinzaEscuro, className: "company-logo-icon" })) : (react_1.default.createElement(iconeEmpresa_1.default, { size: 60, circleFill: theme_1.default.colors.cinzaClaro, className: "company-logo-icon" })),
|
|
26
26
|
react_1.default.createElement(DocumentContainer, null,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
document)))));
|
|
27
|
+
(0, string_1.isDocumentoPF)(document) ? "CPF: " : "CNPJ: ",
|
|
28
|
+
document))));
|
|
30
29
|
};
|
|
31
30
|
exports.default = Companylogo;
|
|
32
|
-
var templateObject_1, templateObject_2, templateObject_3
|
|
31
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -36,14 +36,14 @@ var react_1 = __importStar(require("react"));
|
|
|
36
36
|
var summary_1 = require("./summary/summary");
|
|
37
37
|
var transactionTable_1 = require("./transactionTable/transactionTable");
|
|
38
38
|
var carrousel_1 = require("./carrousel/carrousel");
|
|
39
|
-
var result_1 = require("../interface/result");
|
|
40
39
|
var reclameAquiCarousel_1 = require("../reclameAqui/reclameAquiCarousel");
|
|
41
40
|
var webservice_1 = require("../webservice");
|
|
42
41
|
var xpath_1 = __importDefault(require("../../utils/xpath"));
|
|
43
42
|
var string_1 = require("../../utils/string");
|
|
44
43
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
45
44
|
var useConsultaRfb_1 = require("../../hooks/useConsultaRfb");
|
|
46
|
-
var
|
|
45
|
+
var DossieContent = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: 1fr 2fr;\n justify-items: center;\n align-items: flex-start;\n margin-bottom: 20px;\n gap: 20px;\n\n @media (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n \n"], ["\n display: grid;\n grid-template-columns: 1fr 2fr;\n justify-items: center;\n align-items: flex-start;\n margin-bottom: 20px;\n gap: 20px;\n\n @media (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n \n"])));
|
|
46
|
+
var DossieContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 0px 70px;\n\n @media (max-width: 1000px) {\n padding: 0px 30px;\n }\n"], ["\n padding: 0px 70px;\n\n @media (max-width: 1000px) {\n padding: 0px 30px;\n }\n"])));
|
|
47
47
|
var Dossie = function (_a) {
|
|
48
48
|
var documento = _a.documento;
|
|
49
49
|
var finderCtx = (0, react_1.useContext)(webservice_1.Queries.Finder);
|
|
@@ -52,6 +52,7 @@ var Dossie = function (_a) {
|
|
|
52
52
|
var response = function (_data) {
|
|
53
53
|
var data = _data instanceof Error ? undefined : _data;
|
|
54
54
|
var isPF = (documento === null || documento === void 0 ? void 0 : documento.length) === 11;
|
|
55
|
+
console.log('isPF', isPF, documento);
|
|
55
56
|
var name = (isPF
|
|
56
57
|
? xpath_1.default.select("string(//cadastro/nome)", data)
|
|
57
58
|
: xpath_1.default.select("string(//cadastro/razaoSocial)", data) || rfbResponse && xpath_1.default.select("string(//RFB/nome)", rfbResponse));
|
|
@@ -61,8 +62,8 @@ var Dossie = function (_a) {
|
|
|
61
62
|
var DossieCarrousel = function () {
|
|
62
63
|
return !isPF ? (react_1.default.createElement(reclameAquiCarousel_1.ReclameAquiCarousel, { documento: document, nome: name })) : (react_1.default.createElement(carrousel_1.Carrousel, { name: name, document: document }));
|
|
63
64
|
};
|
|
64
|
-
return (react_1.default.createElement(
|
|
65
|
-
react_1.default.createElement(
|
|
65
|
+
return (react_1.default.createElement(DossieContainer, null,
|
|
66
|
+
react_1.default.createElement(DossieContent, null,
|
|
66
67
|
react_1.default.createElement(DossieCarrousel, null),
|
|
67
68
|
react_1.default.createElement(summary_1.Summary, { finderResponse: data, rfbResponse: rfbResponse })),
|
|
68
69
|
react_1.default.createElement(transactionTable_1.TransactionsTable, { events: xpath_1.default.select("//historico/consulta", data) || [] })));
|
|
@@ -70,4 +71,4 @@ var Dossie = function (_a) {
|
|
|
70
71
|
return (react_1.default.createElement(Section, { ctx: finderCtx, hideHeader: true, minimized: false, isError: function (e) { return response(e); }, onSuccess: response }));
|
|
71
72
|
};
|
|
72
73
|
exports.default = Dossie;
|
|
73
|
-
var templateObject_1;
|
|
74
|
+
var templateObject_1, templateObject_2;
|
|
@@ -109,7 +109,7 @@ var useCardsAndProducts = function (_a) {
|
|
|
109
109
|
header: "Estado Civil",
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
|
-
title: (0, utils_1.getField)("renda", finderResponse, number_1.formatMoney),
|
|
112
|
+
title: isPF ? (0, utils_1.getField)("renda", finderResponse, number_1.formatMoney) : '',
|
|
113
113
|
header: "Renda",
|
|
114
114
|
},
|
|
115
115
|
{
|
|
@@ -150,7 +150,7 @@ var useCardsAndProducts = function (_a) {
|
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
152
|
title: isPF && (0, utils_1.getField)("faixaIdade", finderResponse),
|
|
153
|
-
header: "Faixa de Idade da Empresa",
|
|
153
|
+
header: isPF ? "Faixa de Idade" : "Faixa de Idade da Empresa",
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
title: (0, utils_1.getField)("quantidadeFuncionarios", finderResponse),
|
|
@@ -14,19 +14,22 @@ var button_1 = __importDefault(require("../../../components/common/button"));
|
|
|
14
14
|
var number_1 = require("../../../utils/number");
|
|
15
15
|
var cardsAndProducts_1 = __importDefault(require("./cardsAndProducts"));
|
|
16
16
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
17
|
-
var ContainerSummary = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display:
|
|
18
|
-
var ContentSummary = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid;\n grid-row: 1 / 8;\n grid-template-columns: repeat(
|
|
19
|
-
var FieldSummary = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n margin-bottom: 1rem;\n grid-column: ", ";\n
|
|
17
|
+
var ContainerSummary = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n padding: 0 20px;\n width: 100%;\n justify-content: space-between;\n @media (max-width: 768px) {\n padding: 0px;\n }\n\n @media (max-width: 992px) {\n flex-direction: column;\n }\n \n"], ["\n display: flex;\n padding: 0 20px;\n width: 100%;\n justify-content: space-between;\n @media (max-width: 768px) {\n padding: 0px;\n }\n\n @media (max-width: 992px) {\n flex-direction: column;\n }\n \n"])));
|
|
18
|
+
var ContentSummary = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid;\n grid-row: 1 / 8;\n grid-template-columns: repeat(4, 1fr);\n gap: 0 1rem;\n\n @media (max-width: 1280px) {\n grid-template-columns: repeat(3, 1fr);\n justify-content: center;\n align-items: center;\n }\n\n @media (max-width: 768px) {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n flex-direction: row;\n width: 100%;\n }\n"], ["\n display: grid;\n grid-row: 1 / 8;\n grid-template-columns: repeat(4, 1fr);\n gap: 0 1rem;\n\n @media (max-width: 1280px) {\n grid-template-columns: repeat(3, 1fr);\n justify-content: center;\n align-items: center;\n }\n\n @media (max-width: 768px) {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n flex-direction: row;\n width: 100%;\n }\n"])));
|
|
19
|
+
var FieldSummary = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n margin-bottom: 1rem;\n grid-column: ", ";\n"], ["\n align-items: center;\n margin-bottom: 1rem;\n grid-column: ", ";\n"])), function (props) { return (props.fullRow ? "1 / 3" : "auto"); });
|
|
20
20
|
var ButtonsSummary = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0.5rem;\n\n @media (max-width: 768px) {\n align-items: center;\n max-width: 100%;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0.5rem;\n\n @media (max-width: 768px) {\n align-items: center;\n max-width: 100%;\n }\n"])));
|
|
21
|
+
var ButtonsWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex; \n gap: 10px; \n flex-direction: column;\n\n @media (max-width: 1000px) {\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n flex-direction: row;\n }\n\n @media (max-width: 768px) {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n flex-direction: row;\n }\n"], ["\n display: flex; \n gap: 10px; \n flex-direction: column;\n\n @media (max-width: 1000px) {\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n flex-direction: row;\n }\n\n @media (max-width: 768px) {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n flex-direction: row;\n }\n"])));
|
|
22
|
+
var SummaryButton = (0, styled_components_1.default)(button_1.default)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 100%;\n"], ["\n height: 100%;\n"])));
|
|
21
23
|
var Summary = function (_a) {
|
|
22
24
|
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse;
|
|
23
25
|
var _b = (0, cardsAndProducts_1.default)({ finderResponse: finderResponse, rfbResponse: rfbResponse }), cards = _b.cards, products = _b.products;
|
|
24
|
-
return (react_1.default.createElement(
|
|
25
|
-
react_1.default.createElement(
|
|
26
|
-
react_1.default.createElement(
|
|
27
|
-
|
|
28
|
-
react_1.default.createElement(
|
|
26
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
|
+
react_1.default.createElement(ContainerSummary, { className: "credithub-container-summary" },
|
|
28
|
+
react_1.default.createElement(ContentSummary, { className: "credithub-content-summary" }, cards.map(function (card, index) { return (react_1.default.createElement(FieldSummary, { key: index, fullRow: card.header === "Nome" || card.header === "Nome Da Mãe" },
|
|
29
|
+
react_1.default.createElement(addItem_1.default, { name: card.header, value: card.title }))); })),
|
|
30
|
+
react_1.default.createElement(ButtonsWrapper, null, products.map(function (product, index) { return (react_1.default.createElement(ButtonsSummary, { key: index, style: { display: (product === null || product === void 0 ? void 0 : product.hide) ? 'none' : '', width: '100%' } },
|
|
31
|
+
react_1.default.createElement(SummaryButton, { onClick: function () { return (product === null || product === void 0 ? void 0 : product.onClick) && (product === null || product === void 0 ? void 0 : product.onClick()); }, smallContent: (0, number_1.formatMoney)(product.price) }, product.title))); })))));
|
|
29
32
|
};
|
|
30
33
|
exports.Summary = Summary;
|
|
31
34
|
exports.default = exports.Summary;
|
|
32
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
35
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -22,7 +22,7 @@ var consultaSimplesSection_1 = __importDefault(require("./components/consultaSim
|
|
|
22
22
|
var Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 20px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 20px;\n"])));
|
|
23
23
|
var ConsultaSimples = function (_a) {
|
|
24
24
|
var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits;
|
|
25
|
-
var documento = _documento.replace(/\D
|
|
25
|
+
var documento = _documento.replace(/\D+/g, "");
|
|
26
26
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
27
|
react_1.default.createElement(globalStyle_1.default, null),
|
|
28
28
|
react_1.default.createElement(consultasComplementares_1.ConsultasComplementaresProvider, { hasCredits: hasCredits },
|
|
@@ -28,7 +28,7 @@ import classNames from "classnames";
|
|
|
28
28
|
import React from "react";
|
|
29
29
|
import styled from "styled-components";
|
|
30
30
|
import theme from "../interface/theme";
|
|
31
|
-
var StyledButton = styled.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-style: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n background-color: ", ";\n color: ", ";\n \n padding:
|
|
31
|
+
var StyledButton = styled.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-style: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n background-color: ", ";\n color: ", ";\n \n padding: 8px 20px;\n border: none;\n border-radius: 3.75rem;\n cursor: pointer;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n \n transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;\n\n &:hover {\n background-color: #0056b3;\n }\n\n width: 100% !important;\n"], ["\n font-style: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n background-color: ", ";\n color: ", ";\n \n padding: 8px 20px;\n border: none;\n border-radius: 3.75rem;\n cursor: pointer;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n \n transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;\n\n &:hover {\n background-color: #0056b3;\n }\n\n width: 100% !important;\n"])), theme.typography.headline14.fontStyle, theme.typography.headline14.fontWeight, theme.typography.headline14.fontSize, theme.typography.headline14.lineHeight, theme.colors.azulCredithub, theme.colors.white);
|
|
32
32
|
var SmallContent = styled.small(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: #fdeb35;\n display: block;\n margin-top: 0.25rem;\n"], ["\n color: #fdeb35;\n display: block;\n margin-top: 0.25rem;\n"])));
|
|
33
33
|
var Button = function (_a) {
|
|
34
34
|
var children = _a.children, className = _a.className, smallContent = _a.smallContent, props = __rest(_a, ["children", "className", "smallContent"]);
|
|
@@ -5,7 +5,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import Companylogo from "../companyLogo/companyLogo";
|
|
7
7
|
import styled from "styled-components";
|
|
8
|
-
var CarouselContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n
|
|
8
|
+
var CarouselContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n"])));
|
|
9
9
|
export var Carrousel = function (_a) {
|
|
10
10
|
var name = _a.name, document = _a.document;
|
|
11
11
|
return (React.createElement(CarouselContainer, null,
|
|
@@ -8,20 +8,19 @@ import IconeEmpresa from "../../../assets/icones/iconeEmpresa";
|
|
|
8
8
|
import IconePessoa from "../../../assets/icones/iconePessoa";
|
|
9
9
|
import { isDocumentoPF } from "../../../utils/string";
|
|
10
10
|
import theme from "../../../components/interface/theme";
|
|
11
|
-
var LogoContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center
|
|
12
|
-
var CompanyName = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size:
|
|
13
|
-
var DocumentContainer = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size:
|
|
14
|
-
var DocumentPrefix = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 0.5rem;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 0.5rem;\n"])));
|
|
11
|
+
var LogoContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center; \n row-gap: 20px;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center; \n row-gap: 20px;\n"])));
|
|
12
|
+
var CompanyName = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: ", ";\n color: ", ";\n text-align: center;\n line-height: ", ";\n font-weight: ", ";\n"], ["\n font-size: ", ";\n color: ", ";\n text-align: center;\n line-height: ", ";\n font-weight: ", ";\n"])), theme.typography.headline14.fontSize, theme.colors.cinzaEscuro, theme.typography.headline14.lineHeight, theme.typography.headline14.fontWeight);
|
|
13
|
+
var DocumentContainer = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n \n color: ", ";\n background-color: ", ";\n \n text-align: center;\n position: relative;\n padding: 5px 20px;\n border-radius: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n \n color: ", ";\n background-color: ", ";\n \n text-align: center;\n position: relative;\n padding: 5px 20px;\n border-radius: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), theme.typography.body14.fontSize, theme.typography.body14.fontWeight, theme.typography.body14.lineHeight, theme.colors.cinzaEscuro, theme.colors.cinzaClaro);
|
|
15
14
|
var Companylogo = function (_a) {
|
|
16
15
|
var name = _a.name, document = _a.document;
|
|
16
|
+
console.log(isDocumentoPF(document), document);
|
|
17
17
|
return (React.createElement(React.Fragment, null,
|
|
18
18
|
React.createElement(LogoContainer, null,
|
|
19
19
|
React.createElement(CompanyName, null, name),
|
|
20
20
|
isDocumentoPF(document) ? (React.createElement(IconePessoa, { size: 60, circleFill: theme.colors.cinzaClaro, pathFill: theme.colors.cinzaEscuro, className: "company-logo-icon" })) : (React.createElement(IconeEmpresa, { size: 60, circleFill: theme.colors.cinzaClaro, className: "company-logo-icon" })),
|
|
21
21
|
React.createElement(DocumentContainer, null,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
document)))));
|
|
22
|
+
isDocumentoPF(document) ? "CPF: " : "CNPJ: ",
|
|
23
|
+
document))));
|
|
25
24
|
};
|
|
26
25
|
export default Companylogo;
|
|
27
|
-
var templateObject_1, templateObject_2, templateObject_3
|
|
26
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -8,14 +8,14 @@ import React, { useContext } from "react";
|
|
|
8
8
|
import { Summary } from "./summary/summary";
|
|
9
9
|
import { TransactionsTable } from "./transactionTable/transactionTable";
|
|
10
10
|
import { Carrousel } from "./carrousel/carrousel";
|
|
11
|
-
import { Result } from "../interface/result";
|
|
12
11
|
import { ReclameAquiCarousel } from "../reclameAqui/reclameAquiCarousel";
|
|
13
12
|
import { Queries } from "../webservice";
|
|
14
13
|
import XPathUtils from "../../utils/xpath";
|
|
15
14
|
import { formatCnpj, formatCpf } from "../../utils/string";
|
|
16
15
|
import styled from "styled-components";
|
|
17
16
|
import { useConsultaRfb } from "../../hooks/useConsultaRfb";
|
|
18
|
-
var
|
|
17
|
+
var DossieContent = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: 1fr 2fr;\n justify-items: center;\n align-items: flex-start;\n margin-bottom: 20px;\n gap: 20px;\n\n @media (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n \n"], ["\n display: grid;\n grid-template-columns: 1fr 2fr;\n justify-items: center;\n align-items: flex-start;\n margin-bottom: 20px;\n gap: 20px;\n\n @media (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n \n"])));
|
|
18
|
+
var DossieContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 0px 70px;\n\n @media (max-width: 1000px) {\n padding: 0px 30px;\n }\n"], ["\n padding: 0px 70px;\n\n @media (max-width: 1000px) {\n padding: 0px 30px;\n }\n"])));
|
|
19
19
|
var Dossie = function (_a) {
|
|
20
20
|
var documento = _a.documento;
|
|
21
21
|
var finderCtx = useContext(Queries.Finder);
|
|
@@ -24,6 +24,7 @@ var Dossie = function (_a) {
|
|
|
24
24
|
var response = function (_data) {
|
|
25
25
|
var data = _data instanceof Error ? undefined : _data;
|
|
26
26
|
var isPF = (documento === null || documento === void 0 ? void 0 : documento.length) === 11;
|
|
27
|
+
console.log('isPF', isPF, documento);
|
|
27
28
|
var name = (isPF
|
|
28
29
|
? XPathUtils.select("string(//cadastro/nome)", data)
|
|
29
30
|
: XPathUtils.select("string(//cadastro/razaoSocial)", data) || rfbResponse && XPathUtils.select("string(//RFB/nome)", rfbResponse));
|
|
@@ -33,8 +34,8 @@ var Dossie = function (_a) {
|
|
|
33
34
|
var DossieCarrousel = function () {
|
|
34
35
|
return !isPF ? (React.createElement(ReclameAquiCarousel, { documento: document, nome: name })) : (React.createElement(Carrousel, { name: name, document: document }));
|
|
35
36
|
};
|
|
36
|
-
return (React.createElement(
|
|
37
|
-
React.createElement(
|
|
37
|
+
return (React.createElement(DossieContainer, null,
|
|
38
|
+
React.createElement(DossieContent, null,
|
|
38
39
|
React.createElement(DossieCarrousel, null),
|
|
39
40
|
React.createElement(Summary, { finderResponse: data, rfbResponse: rfbResponse })),
|
|
40
41
|
React.createElement(TransactionsTable, { events: XPathUtils.select("//historico/consulta", data) || [] })));
|
|
@@ -42,4 +43,4 @@ var Dossie = function (_a) {
|
|
|
42
43
|
return (React.createElement(Section, { ctx: finderCtx, hideHeader: true, minimized: false, isError: function (e) { return response(e); }, onSuccess: response }));
|
|
43
44
|
};
|
|
44
45
|
export default Dossie;
|
|
45
|
-
var templateObject_1;
|
|
46
|
+
var templateObject_1, templateObject_2;
|
|
@@ -104,7 +104,7 @@ var useCardsAndProducts = function (_a) {
|
|
|
104
104
|
header: "Estado Civil",
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
|
-
title: getField("renda", finderResponse, formatMoney),
|
|
107
|
+
title: isPF ? getField("renda", finderResponse, formatMoney) : '',
|
|
108
108
|
header: "Renda",
|
|
109
109
|
},
|
|
110
110
|
{
|
|
@@ -145,7 +145,7 @@ var useCardsAndProducts = function (_a) {
|
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
147
|
title: isPF && getField("faixaIdade", finderResponse),
|
|
148
|
-
header: "Faixa de Idade da Empresa",
|
|
148
|
+
header: isPF ? "Faixa de Idade" : "Faixa de Idade da Empresa",
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
title: getField("quantidadeFuncionarios", finderResponse),
|
|
@@ -8,18 +8,21 @@ import Button from "../../../components/common/button";
|
|
|
8
8
|
import { formatMoney } from "../../../utils/number";
|
|
9
9
|
import useCardsAndProducts from "./cardsAndProducts";
|
|
10
10
|
import styled from "styled-components";
|
|
11
|
-
var ContainerSummary = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display:
|
|
12
|
-
var ContentSummary = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid;\n grid-row: 1 / 8;\n grid-template-columns: repeat(
|
|
13
|
-
var FieldSummary = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n margin-bottom: 1rem;\n grid-column: ", ";\n
|
|
11
|
+
var ContainerSummary = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n padding: 0 20px;\n width: 100%;\n justify-content: space-between;\n @media (max-width: 768px) {\n padding: 0px;\n }\n\n @media (max-width: 992px) {\n flex-direction: column;\n }\n \n"], ["\n display: flex;\n padding: 0 20px;\n width: 100%;\n justify-content: space-between;\n @media (max-width: 768px) {\n padding: 0px;\n }\n\n @media (max-width: 992px) {\n flex-direction: column;\n }\n \n"])));
|
|
12
|
+
var ContentSummary = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid;\n grid-row: 1 / 8;\n grid-template-columns: repeat(4, 1fr);\n gap: 0 1rem;\n\n @media (max-width: 1280px) {\n grid-template-columns: repeat(3, 1fr);\n justify-content: center;\n align-items: center;\n }\n\n @media (max-width: 768px) {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n flex-direction: row;\n width: 100%;\n }\n"], ["\n display: grid;\n grid-row: 1 / 8;\n grid-template-columns: repeat(4, 1fr);\n gap: 0 1rem;\n\n @media (max-width: 1280px) {\n grid-template-columns: repeat(3, 1fr);\n justify-content: center;\n align-items: center;\n }\n\n @media (max-width: 768px) {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n flex-direction: row;\n width: 100%;\n }\n"])));
|
|
13
|
+
var FieldSummary = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n margin-bottom: 1rem;\n grid-column: ", ";\n"], ["\n align-items: center;\n margin-bottom: 1rem;\n grid-column: ", ";\n"])), function (props) { return (props.fullRow ? "1 / 3" : "auto"); });
|
|
14
14
|
var ButtonsSummary = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0.5rem;\n\n @media (max-width: 768px) {\n align-items: center;\n max-width: 100%;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n gap: 0.5rem;\n\n @media (max-width: 768px) {\n align-items: center;\n max-width: 100%;\n }\n"])));
|
|
15
|
+
var ButtonsWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex; \n gap: 10px; \n flex-direction: column;\n\n @media (max-width: 1000px) {\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n flex-direction: row;\n }\n\n @media (max-width: 768px) {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n flex-direction: row;\n }\n"], ["\n display: flex; \n gap: 10px; \n flex-direction: column;\n\n @media (max-width: 1000px) {\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n flex-direction: row;\n }\n\n @media (max-width: 768px) {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n flex-direction: row;\n }\n"])));
|
|
16
|
+
var SummaryButton = styled(Button)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 100%;\n"], ["\n height: 100%;\n"])));
|
|
15
17
|
export var Summary = function (_a) {
|
|
16
18
|
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse;
|
|
17
19
|
var _b = useCardsAndProducts({ finderResponse: finderResponse, rfbResponse: rfbResponse }), cards = _b.cards, products = _b.products;
|
|
18
|
-
return (React.createElement(
|
|
19
|
-
React.createElement(
|
|
20
|
-
React.createElement(
|
|
21
|
-
|
|
22
|
-
React.createElement(
|
|
20
|
+
return (React.createElement(React.Fragment, null,
|
|
21
|
+
React.createElement(ContainerSummary, { className: "credithub-container-summary" },
|
|
22
|
+
React.createElement(ContentSummary, { className: "credithub-content-summary" }, cards.map(function (card, index) { return (React.createElement(FieldSummary, { key: index, fullRow: card.header === "Nome" || card.header === "Nome Da Mãe" },
|
|
23
|
+
React.createElement(AddItemField, { name: card.header, value: card.title }))); })),
|
|
24
|
+
React.createElement(ButtonsWrapper, null, products.map(function (product, index) { return (React.createElement(ButtonsSummary, { key: index, style: { display: (product === null || product === void 0 ? void 0 : product.hide) ? 'none' : '', width: '100%' } },
|
|
25
|
+
React.createElement(SummaryButton, { onClick: function () { return (product === null || product === void 0 ? void 0 : product.onClick) && (product === null || product === void 0 ? void 0 : product.onClick()); }, smallContent: formatMoney(product.price) }, product.title))); })))));
|
|
23
26
|
};
|
|
24
27
|
export default Summary;
|
|
25
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
28
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -17,7 +17,7 @@ import ConsultaSimplesSection from "./components/consultaSimplesSection/consulta
|
|
|
17
17
|
var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 20px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 20px;\n"])));
|
|
18
18
|
var ConsultaSimples = function (_a) {
|
|
19
19
|
var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits;
|
|
20
|
-
var documento = _documento.replace(/\D
|
|
20
|
+
var documento = _documento.replace(/\D+/g, "");
|
|
21
21
|
return (React.createElement(React.Fragment, null,
|
|
22
22
|
React.createElement(GlobalStyle, null),
|
|
23
23
|
React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits },
|