@credithub/harlan-components 1.21.2 → 1.22.0
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/assets/btn/printIcon.d.ts +3 -0
- package/dist/assets/btn/printIcon.js +30 -0
- package/dist/components/chart/chartSystem.js +2 -1
- package/dist/components/common/button.js +1 -1
- package/dist/components/common/printSectionWrapper.d.ts +5 -0
- package/dist/components/common/printSectionWrapper.js +36 -0
- package/dist/components/dominios/dominios.js +2 -2
- package/dist/components/dossie/dossie.d.ts +0 -1
- package/dist/components/dossie/dossie.js +15 -13
- package/dist/components/dossie/summary/summary.d.ts +0 -1
- package/dist/components/dossie/summary/summary.js +4 -11
- package/dist/components/dossie/transactionTable/transactionTable.js +2 -2
- package/dist/components/interface/header.d.ts +1 -0
- package/dist/components/interface/header.js +23 -21
- package/dist/components/interface/responsiveGrid.js +1 -1
- package/dist/components/interface/result.js +3 -2
- package/dist/components/interface/section.d.ts +1 -0
- package/dist/components/interface/section.js +4 -1
- package/dist/components/protestos/protestosList.js +1 -1
- package/dist/components/webservice.js +17 -20
- package/dist/consultaSimples.js +3 -3
- package/lib/cjs/index.js +199 -140
- package/lib/esm/index.js +200 -141
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import theme from '../../components/interface/theme';
|
|
24
|
+
import React from 'react';
|
|
25
|
+
function PrintIcon(_a) {
|
|
26
|
+
var _b = _a.fill, fill = _b === void 0 ? theme.colors.cinzaEscuro : _b, rest = __rest(_a, ["fill"]);
|
|
27
|
+
return (React.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "20", height: "18", fill: "none", viewBox: "0 0 20 18" }, rest),
|
|
28
|
+
React.createElement("path", { fill: fill, d: "M6 18c-.55 0-1.02-.196-1.412-.587A1.926 1.926 0 014 16v-2H2c-.55 0-1.02-.196-1.413-.588A1.926 1.926 0 010 12V8c0-.85.292-1.563.875-2.138S2.167 5 3 5h14c.85 0 1.563.287 2.137.862C19.712 6.438 20 7.15 20 8v4c0 .55-.196 1.02-.587 1.412A1.926 1.926 0 0118 14h-2v2c0 .55-.196 1.02-.588 1.413A1.926 1.926 0 0114 18H6zm-4-6h2c0-.55.196-1.02.588-1.412A1.926 1.926 0 016 10h8c.55 0 1.02.196 1.412.588.392.391.588.862.588 1.412h2V8a.967.967 0 00-.288-.713A.968.968 0 0017 7H3a.968.968 0 00-.712.287A.968.968 0 002 8v4zm12-7V2H6v3H4V2c0-.55.196-1.02.588-1.413A1.926 1.926 0 016 0h8c.55 0 1.02.196 1.412.588C15.804.979 16 1.45 16 2v3h-2zm2 4.5c.283 0 .52-.096.712-.287A.967.967 0 0017 8.5a.967.967 0 00-.288-.713A.968.968 0 0016 7.5a.968.968 0 00-.713.287A.967.967 0 0015 8.5c0 .283.096.52.287.713.192.191.43.287.713.287zM14 16v-4H6v4h8z" })));
|
|
29
|
+
}
|
|
30
|
+
export default PrintIcon;
|
|
@@ -17,6 +17,7 @@ import useChartData from './hooks/useChartData';
|
|
|
17
17
|
import ResumoDeNegativacoesIcon from '../../assets/icones/resumoNegativacoes';
|
|
18
18
|
import { ConsultasComplementaresContext } from '../consultasComplementares';
|
|
19
19
|
import { converterParaFormatoValido } from '../../utils/string';
|
|
20
|
+
import { PrintSectionWrapper } from '../common/printSectionWrapper';
|
|
20
21
|
var Content = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n padding: 0px 30px;\n\n @media print {\n display: block;\n }\n"], ["\n display: ", ";\n padding: 0px 30px;\n\n @media print {\n display: block;\n }\n"])), function (props) { return (props.isOpen ? 'block' : 'none'); });
|
|
21
22
|
var ChartSystem = function (_a) {
|
|
22
23
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
@@ -51,7 +52,7 @@ var ChartSystem = function (_a) {
|
|
|
51
52
|
if (consultaPefinBoaVista || consultaPefinSerasa)
|
|
52
53
|
refetch();
|
|
53
54
|
}, [consultaPefinBoaVista, consultaPefinSerasa]);
|
|
54
|
-
return (React.createElement(
|
|
55
|
+
return (React.createElement(PrintSectionWrapper, null,
|
|
55
56
|
React.createElement(Header, { title: "Resumo de Negativa\u00E7\u00F5es", subtitle: "Veja a quantidade de ocorr\u00EAncias conforme o documento foi consultado ao longo do tempo", description: errorMessage && (React.createElement(StatusMessage, { type: "error" }, errorMessage)), variant: isLoading ? 'loading' : 'default', icon: ResumoDeNegativacoesIcon, actions: React.createElement(BtnWrapper, { onClick: toggleOpen }, isOpen ? React.createElement(ChevronUp, null) : React.createElement(ChevronDown, null)) }),
|
|
56
57
|
React.createElement(Content, { isOpen: isOpen },
|
|
57
58
|
data && React.createElement(ChartContent, { dataInput: data }),
|
|
@@ -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: 8px 20px;\n border: none;\n border-radius: 60px;\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:\n background-color 0.3s ease-in-out,\n 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: 60px;\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:\n background-color 0.3s ease-in-out,\n 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);
|
|
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: 60px;\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:\n background-color 0.3s ease-in-out,\n color 0.3s ease-in-out;\n\n &:hover {\n background-color: #0056b3;\n }\n\n width: 100% !important;\n min-height: 40px;\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: 60px;\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:\n background-color 0.3s ease-in-out,\n color 0.3s ease-in-out;\n\n &:hover {\n background-color: #0056b3;\n }\n\n width: 100% !important;\n min-height: 40px;\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: 4px;\n\n @media print {\n display: none;\n }\n"], ["\n color: #fdeb35;\n display: block;\n margin-top: 4px;\n\n @media print {\n display: none;\n }\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"]);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import styled, { css } from 'styled-components';
|
|
29
|
+
var PrintSectionStyle = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
30
|
+
return props.enabled && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n @media print {\n background: #ffffff;\n box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.15);\n border-radius: 30px;\n }\n "], ["\n @media print {\n background: #ffffff;\n box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.15);\n border-radius: 30px;\n }\n "])));
|
|
31
|
+
});
|
|
32
|
+
export var PrintSectionWrapper = function (_a) {
|
|
33
|
+
var _b = _a.enabled, enabled = _b === void 0 ? true : _b, children = _a.children, rest = __rest(_a, ["enabled", "children"]);
|
|
34
|
+
return (React.createElement(PrintSectionStyle, __assign({ enabled: enabled }, rest), children));
|
|
35
|
+
};
|
|
36
|
+
var templateObject_1, templateObject_2;
|
|
@@ -15,8 +15,8 @@ var Dominios = function () {
|
|
|
15
15
|
var Section = ctx.Section;
|
|
16
16
|
return (React.createElement(Section, { title: "Dom\u00EDnios na Internet", subtitle: "Informa\u00E7\u00F5es de dom\u00EDnios na internet.", icon: DominiosIcon, onSuccess: function (document) {
|
|
17
17
|
return {
|
|
18
|
-
children: (React.createElement(Result, { resultContentStriped: false }, document.map(function (data) { return (React.createElement(ResultContent, { desktop: "1fr 1fr 1fr", tablet: "1fr 1fr", mobile: "1fr 1fr", key: data },
|
|
19
|
-
React.createElement(AddItemField, { name: "Dom\u00EDnio", value: React.createElement(Link, { href: "https://www.".concat(data), target: "_blank", rel: "noreferrer" }, data) }))); }))),
|
|
18
|
+
children: document.length ? (React.createElement(Result, { resultContentStriped: false }, document.map(function (data) { return (React.createElement(ResultContent, { desktop: "1fr 1fr 1fr", tablet: "1fr 1fr", mobile: "1fr 1fr", key: data },
|
|
19
|
+
React.createElement(AddItemField, { name: "Dom\u00EDnio", value: React.createElement(Link, { href: "https://www.".concat(data), target: "_blank", rel: "noreferrer" }, data) }))); }))) : null,
|
|
20
20
|
description: (React.createElement(StatusMessage, { type: (document === null || document === void 0 ? void 0 : document.length) ? 'success' : 'default' }, document.length
|
|
21
21
|
? (document === null || document === void 0 ? void 0 : document.length) === 1
|
|
22
22
|
? 'Foi encontrado 1 registro de domínio'
|
|
@@ -2,8 +2,6 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
6
|
-
//eslint-disable-ban-types
|
|
7
5
|
import React, { useContext } from 'react';
|
|
8
6
|
import { Summary } from './summary/summary';
|
|
9
7
|
import { TransactionsTable } from './transactionTable/transactionTable';
|
|
@@ -16,26 +14,30 @@ import styled from 'styled-components';
|
|
|
16
14
|
import { useConsultaRfb } from '../../hooks/useConsultaRfb';
|
|
17
15
|
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 screen and (max-width: 992px) {\n grid-template-columns: 1fr;\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 screen and (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n"])));
|
|
18
16
|
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"])));
|
|
17
|
+
var useDossieData = function (documento, rfbResponse) {
|
|
18
|
+
var isPF = (documento === null || documento === void 0 ? void 0 : documento.length) === 11;
|
|
19
|
+
var name = isPF
|
|
20
|
+
? XPathUtils.select('string(//cadastro/nome)', rfbResponse)
|
|
21
|
+
: XPathUtils.select('string(//cadastro/razaoSocial)', rfbResponse) ||
|
|
22
|
+
(rfbResponse && XPathUtils.select('string(//RFB/nome)', rfbResponse));
|
|
23
|
+
var document = isPF ? formatCpf(documento) : formatCnpj(documento);
|
|
24
|
+
return { isPF: isPF, name: name, document: document };
|
|
25
|
+
};
|
|
19
26
|
var Dossie = function (_a) {
|
|
20
|
-
var documento = _a.documento
|
|
27
|
+
var documento = _a.documento;
|
|
21
28
|
var finderCtx = useContext(Queries.Finder);
|
|
22
29
|
var rfbResponse = useConsultaRfb().rfbResponse;
|
|
23
30
|
var Section = finderCtx.Section;
|
|
31
|
+
var _b = useDossieData(documento, rfbResponse), isPF = _b.isPF, name = _b.name, document = _b.document;
|
|
32
|
+
var DossieCarrousel = function () {
|
|
33
|
+
return !isPF ? (React.createElement(ReclameAquiCarousel, { documento: document, nome: name })) : (React.createElement(Carrousel, { name: name, document: document }));
|
|
34
|
+
};
|
|
24
35
|
var response = function (_data) {
|
|
25
36
|
var data = _data instanceof Error ? undefined : _data;
|
|
26
|
-
var isPF = (documento === null || documento === void 0 ? void 0 : documento.length) === 11;
|
|
27
|
-
var name = (isPF
|
|
28
|
-
? XPathUtils.select('string(//cadastro/nome)', data)
|
|
29
|
-
: XPathUtils.select('string(//cadastro/razaoSocial)', data) ||
|
|
30
|
-
(rfbResponse && XPathUtils.select('string(//RFB/nome)', rfbResponse)));
|
|
31
|
-
var document = isPF ? formatCpf(documento) : formatCnpj(documento);
|
|
32
|
-
var DossieCarrousel = function () {
|
|
33
|
-
return !isPF ? (React.createElement(ReclameAquiCarousel, { documento: document, nome: name })) : (React.createElement(Carrousel, { name: name, document: document }));
|
|
34
|
-
};
|
|
35
37
|
return (React.createElement(DossieContainer, null,
|
|
36
38
|
React.createElement(DossieContent, null,
|
|
37
39
|
React.createElement(DossieCarrousel, null),
|
|
38
|
-
React.createElement(Summary, {
|
|
40
|
+
React.createElement(Summary, { finderResponse: data, rfbResponse: rfbResponse, document: document })),
|
|
39
41
|
React.createElement(TransactionsTable, { events: XPathUtils.select('//historico/consulta', data) || [] })));
|
|
40
42
|
};
|
|
41
43
|
return (React.createElement(Section, { ctx: finderCtx, hideHeader: true, minimized: false, isError: function (e) { return response(e); }, onSuccess: response }));
|
|
@@ -12,10 +12,10 @@ var ContainerSummary = styled.div(templateObject_1 || (templateObject_1 = __make
|
|
|
12
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 16px;\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(2, 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 16px;\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(2, 1fr);\n flex-direction: row;\n width: 100%;\n }\n"])));
|
|
13
13
|
var FieldSummary = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n margin-bottom: 16px;\n grid-column: ", ";\n"], ["\n align-items: center;\n margin-bottom: 16px;\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: 8px;\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: 8px;\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 @media print {\n display: none;\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\n @media print {\n display: none;\n }\n"])));
|
|
15
|
+
var ButtonsWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n gap: 10px;\n min-width: fit-content;\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 @media print {\n display: none;\n }\n"], ["\n display: flex;\n gap: 10px;\n min-width: fit-content;\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 @media print {\n display: none;\n }\n"])));
|
|
16
16
|
var SummaryButton = styled(Button)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 100%;\n"], ["\n height: 100%;\n"])));
|
|
17
17
|
export var Summary = function (_a) {
|
|
18
|
-
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse
|
|
18
|
+
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse;
|
|
19
19
|
var _b = useCardsAndProducts({
|
|
20
20
|
finderResponse: finderResponse,
|
|
21
21
|
rfbResponse: rfbResponse
|
|
@@ -24,15 +24,8 @@ export var Summary = function (_a) {
|
|
|
24
24
|
React.createElement(ContainerSummary, { className: "credithub-container-summary" },
|
|
25
25
|
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' },
|
|
26
26
|
React.createElement(AddItemField, { name: card.header, value: card.title }))); })),
|
|
27
|
-
React.createElement(ButtonsWrapper, null,
|
|
28
|
-
|
|
29
|
-
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: product.price ? formatMoney(product.price) : undefined }, product.title))); }),
|
|
30
|
-
React.createElement(PrintButton, { onClickPrint: onClickPrint })))));
|
|
31
|
-
};
|
|
32
|
-
var PrintButton = function (_a) {
|
|
33
|
-
var onClickPrint = _a.onClickPrint;
|
|
34
|
-
return (React.createElement(ButtonsSummary, null,
|
|
35
|
-
React.createElement(SummaryButton, { onClick: onClickPrint }, "PDF para Impress\u00E3o")));
|
|
27
|
+
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%' } },
|
|
28
|
+
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: product.price ? formatMoney(product.price) : undefined }, product.title))); })))));
|
|
36
29
|
};
|
|
37
30
|
export default Summary;
|
|
38
31
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -8,8 +8,8 @@ import XPathUtils from '../../../utils/xpath';
|
|
|
8
8
|
import styled from 'styled-components';
|
|
9
9
|
import IconePessoa from '../../../assets/icones/iconePessoa';
|
|
10
10
|
import theme from '../../../components/interface/theme';
|
|
11
|
-
var StyledContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: 1fr 2fr;\n margin-bottom: 20px;\n border-top: 1.6px solid ", ";\n padding: 16px;\n @media (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n"], ["\n display: grid;\n grid-template-columns: 1fr 2fr;\n margin-bottom: 20px;\n border-top: 1.6px solid ", ";\n padding: 16px;\n @media (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n"])), theme.colors.cinzaClaro);
|
|
12
|
-
var Header = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n grid-row: 1 / 6;\n padding: 16px;\n margin: 16px;\n row-gap: 20px;\n @media (max-width: 992px) {\n padding: 0 0 16px 0;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n grid-row: 1 / 6;\n padding: 16px;\n margin: 16px;\n row-gap: 20px;\n @media (max-width: 992px) {\n padding: 0 0 16px 0;\n }\n"])));
|
|
11
|
+
var StyledContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: 1fr 2fr;\n margin-bottom: 20px;\n border-top: 1.6px solid ", ";\n padding: 16px;\n @media screen and (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n"], ["\n display: grid;\n grid-template-columns: 1fr 2fr;\n margin-bottom: 20px;\n border-top: 1.6px solid ", ";\n padding: 16px;\n @media screen and (max-width: 992px) {\n grid-template-columns: 1fr;\n }\n"])), theme.colors.cinzaClaro);
|
|
12
|
+
var Header = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n grid-row: 1 / 6;\n padding: 16px;\n margin: 16px;\n row-gap: 20px;\n @media (max-width: 992px) {\n padding: 0 0 16px 0;\n justify-content: flex-start;\n }\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n grid-row: 1 / 6;\n padding: 16px;\n margin: 16px;\n row-gap: 20px;\n @media (max-width: 992px) {\n padding: 0 0 16px 0;\n justify-content: flex-start;\n }\n"])));
|
|
13
13
|
var Title = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 18px;\n font-weight: bold;\n text-align: center;\n"], ["\n font-size: 18px;\n font-weight: bold;\n text-align: center;\n"])));
|
|
14
14
|
var TransactionContent = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 16px;\n align-items: flex-start;\n"], ["\n display: flex;\n align-items: center;\n padding: 16px;\n align-items: flex-start;\n"])));
|
|
15
15
|
var UserField = styled.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n flex: 1;\n padding-right: 16px;\n"], ["\n flex: 1;\n padding-right: 16px;\n"])));
|
|
@@ -18,6 +18,7 @@ export type HeaderProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTML
|
|
|
18
18
|
actionsClassName?: string;
|
|
19
19
|
innerRef?: React.LegacyRef<HTMLDivElement>;
|
|
20
20
|
variant?: 'default' | 'error' | 'loading';
|
|
21
|
+
printBar?: boolean;
|
|
21
22
|
};
|
|
22
23
|
declare const Header: React.FC<HeaderProps>;
|
|
23
24
|
export default Header;
|
|
@@ -24,40 +24,42 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
|
-
import React from 'react';
|
|
27
|
+
import React, { useMemo } from 'react';
|
|
28
28
|
import classNames from 'classnames';
|
|
29
29
|
import styled from 'styled-components';
|
|
30
30
|
import theme from './theme';
|
|
31
31
|
import LoadingBar from './loadingBar';
|
|
32
32
|
var Title = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n"], ["\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n"])), theme.typography.headline24.fontSize, theme.typography.headline24.fontWeight, theme.typography.headline24.lineHeight, theme.colors.azulCredithub);
|
|
33
|
-
var Subtitle = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"], ["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), theme.typography.body18.fontSize, theme.typography.body18.fontStyle, theme.typography.body18.fontWeight, theme.typography.body18.lineHeight);
|
|
34
|
-
var Description = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display:
|
|
33
|
+
var Subtitle = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"], ["\n display: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) { return (props.hidden ? 'none' : 'block'); }, theme.typography.body18.fontSize, theme.typography.body18.fontStyle, theme.typography.body18.fontWeight, theme.typography.body18.lineHeight);
|
|
34
|
+
var Description = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: ", ";\n gap: 10px;\n font-style: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n\n @media screen and (max-width: 768px) {\n flex-direction: column;\n }\n"], ["\n display: ", ";\n gap: 10px;\n font-style: ", ";\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n letter-spacing: ", ";\n\n @media screen and (max-width: 768px) {\n flex-direction: column;\n }\n"])), function (props) { return (props.hidden ? 'none' : 'flex'); }, theme.typography.label14.fontStyle, theme.typography.label14.fontWeight, theme.typography.label14.fontSize, theme.typography.label14.lineHeight, theme.typography.label14.letterSpacing);
|
|
35
35
|
var HeaderUI = styled(function (_a) {
|
|
36
36
|
var children = _a.children, props = __rest(_a, ["children"]);
|
|
37
37
|
return (React.createElement("header", __assign({}, props), children));
|
|
38
|
-
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background: #ffffff !important;\n
|
|
39
|
-
var HeaderContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n gap: 20px;\n"], ["\n display: flex;\n gap: 20px;\n"])));
|
|
38
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n @media screen {\n background: #ffffff !important;\n box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.15);\n border-radius: 30px;\n }\n padding: 30px 20px;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n\n ", " {\n color: ", ";\n }\n"], ["\n @media screen {\n background: #ffffff !important;\n box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.15);\n border-radius: 30px;\n }\n padding: 30px 20px;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n\n ", " {\n color: ", ";\n }\n"])), Title, function (props) { return props.color; });
|
|
39
|
+
var HeaderContainer = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n gap: 20px;\n\n @media print {\n width: 100%;\n }\n"], ["\n display: flex;\n gap: 20px;\n\n @media print {\n width: 100%;\n }\n"])));
|
|
40
40
|
var ActionsList = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n gap: 10px;\n"], ["\n display: flex;\n flex-direction: row;\n gap: 10px;\n"])));
|
|
41
|
-
var IconWrapper = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n align-items:
|
|
42
|
-
var TextWrapper = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 10px;\n\n .text-wrapper-subtitle-description {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 20px;\n align-items: center;\n\n @media (max-width: 768px) {\n align-items: flex-start;\n }\n\n @media print {\n flex-direction: row;\n }\n }\n"], ["\n display: flex;\n flex-direction: column;\n gap: 10px;\n\n .text-wrapper-subtitle-description {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 20px;\n align-items: center;\n\n @media (max-width: 768px) {\n align-items: flex-start;\n }\n\n @media print {\n flex-direction: row;\n }\n }\n"])))
|
|
41
|
+
var IconWrapper = styled.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n padding-top: 5px;\n width: 30px;\n"], ["\n display: flex;\n align-items: flex-start;\n padding-top: 5px;\n width: 30px;\n"])));
|
|
42
|
+
var TextWrapper = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 10px;\n\n @media print {\n width: 100%;\n border-bottom: ", " solid\n ", ";\n padding-bottom: 30px;\n }\n\n .text-wrapper-subtitle-description {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 20px;\n align-items: center;\n\n @media (max-width: 768px) {\n align-items: flex-start;\n }\n\n @media print {\n flex-direction: row;\n }\n }\n"], ["\n display: flex;\n flex-direction: column;\n gap: 10px;\n\n @media print {\n width: 100%;\n border-bottom: ", " solid\n ", ";\n padding-bottom: 30px;\n }\n\n .text-wrapper-subtitle-description {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 20px;\n align-items: center;\n\n @media (max-width: 768px) {\n align-items: flex-start;\n }\n\n @media print {\n flex-direction: row;\n }\n }\n"])), function (_a) {
|
|
43
|
+
var _b = _a.printBar, printBar = _b === void 0 ? true : _b;
|
|
44
|
+
return (printBar ? '1px' : '0px');
|
|
45
|
+
}, theme.colors.cinzaClaro);
|
|
43
46
|
var Header = function (_a) {
|
|
44
|
-
var title = _a.title, subtitle = _a.subtitle, description = _a.description, actions = _a.actions, Icon = _a.icon,
|
|
47
|
+
var title = _a.title, subtitle = _a.subtitle, description = _a.description, actions = _a.actions, Icon = _a.icon, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, iconProps = _a.iconProps, loadingProps = _a.loadingProps, className = _a.className, titleClassName = _a.titleClassName, subtitleClassName = _a.subtitleClassName, descriptionClassName = _a.descriptionClassName, containerClassName = _a.containerClassName, actionsClassName = _a.actionsClassName, innerRef = _a.innerRef, _c = _a.printBar, printBar = _c === void 0 ? true : _c, props = __rest(_a, ["title", "subtitle", "description", "actions", "icon", "variant", "iconProps", "loadingProps", "className", "titleClassName", "subtitleClassName", "descriptionClassName", "containerClassName", "actionsClassName", "innerRef", "printBar"]);
|
|
45
48
|
var headerClass = classNames(className);
|
|
46
49
|
var actionsClass = classNames(actionsClassName);
|
|
47
50
|
var containerClass = classNames(containerClassName);
|
|
48
|
-
var isLoading =
|
|
49
|
-
var variantColor = getVariantColor(
|
|
50
|
-
return (React.createElement(
|
|
51
|
-
React.createElement(
|
|
52
|
-
React.createElement(
|
|
53
|
-
|
|
54
|
-
React.createElement(
|
|
55
|
-
|
|
56
|
-
React.createElement(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
React.createElement(ActionsList, { className: actionsClass }, actions && actions))));
|
|
51
|
+
var isLoading = variant === 'loading';
|
|
52
|
+
var variantColor = useMemo(function () { return getVariantColor(variant); }, [variant]);
|
|
53
|
+
return (React.createElement(HeaderUI, __assign({ className: headerClass, ref: innerRef, color: variantColor }, props),
|
|
54
|
+
React.createElement(HeaderContainer, { className: containerClass },
|
|
55
|
+
React.createElement(IconWrapper, null, Icon && React.createElement(Icon, __assign({}, iconProps, { circleFill: variantColor }))),
|
|
56
|
+
React.createElement(TextWrapper, { printBar: printBar },
|
|
57
|
+
React.createElement(Title, { hidden: !title, className: classNames(titleClassName) }, title),
|
|
58
|
+
React.createElement("div", { className: "text-wrapper-subtitle-description" },
|
|
59
|
+
React.createElement(Subtitle, { hidden: isLoading || !subtitle, className: subtitleClassName }, subtitle),
|
|
60
|
+
React.createElement(Description, { hidden: isLoading || !description, className: descriptionClassName }, description)),
|
|
61
|
+
React.createElement(LoadingBar, { percentage: (loadingProps === null || loadingProps === void 0 ? void 0 : loadingProps.percentage) || 0, hidden: !isLoading }))),
|
|
62
|
+
React.createElement(ActionsList, { className: actionsClass }, actions && actions)));
|
|
61
63
|
};
|
|
62
64
|
var getVariantColor = function (type) {
|
|
63
65
|
if (type === void 0) { type = 'default'; }
|
|
@@ -3,6 +3,6 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled from 'styled-components';
|
|
6
|
-
var ResponsiveGrid = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n ", ";\n\n @media (max-width: 767px) {\n grid-template-columns: ", ";\n gap: 16px;\n }\n\n @media (min-width: 768px) {\n grid-template-columns: ", ";\n }\n\n @media (min-width: 1000px) {\n grid-template-columns: ", ";\n }\n\n @media print {\n grid-template-columns: ", ";\n }\n"], ["\n display: grid;\n ", ";\n\n @media (max-width: 767px) {\n grid-template-columns: ", ";\n gap: 16px;\n }\n\n @media (min-width: 768px) {\n grid-template-columns: ", ";\n }\n\n @media (min-width: 1000px) {\n grid-template-columns: ", ";\n }\n\n @media print {\n grid-template-columns: ", ";\n }\n"])), function (props) { return props.fullWidth && 'width: 100%'; }, function (props) { return props.mobile || 'auto'; }, function (props) { return props.tablet || 'auto'; }, function (props) { return props.desktop || 'auto'; }, function (props) { return props.desktop || 'auto'; });
|
|
6
|
+
var ResponsiveGrid = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: grid;\n ", ";\n\n @media (max-width: 767px) {\n grid-template-columns: ", ";\n gap: 16px;\n }\n\n @media (min-width: 768px) {\n grid-template-columns: ", ";\n }\n\n @media (min-width: 1000px) {\n grid-template-columns: ", ";\n }\n\n @media print {\n grid-template-columns: ", ";\n }\n"], ["\n display: grid;\n ", ";\n\n @media (max-width: 767px) {\n grid-template-columns: ", ";\n gap: 16px;\n }\n\n @media (min-width: 768px) {\n grid-template-columns: ", ";\n }\n\n @media (min-width: 1000px) {\n grid-template-columns: ", ";\n }\n\n @media print {\n grid-template-columns: ", ";\n }\n"])), function (props) { return props.fullWidth && 'width: 100%'; }, function (props) { return props.mobile || 'auto'; }, function (props) { return props.tablet || 'auto'; }, function (props) { return props.desktop || 'auto'; }, function (props) { return props.print || props.desktop || 'auto'; });
|
|
7
7
|
export default ResponsiveGrid;
|
|
8
8
|
var templateObject_1;
|
|
@@ -4,8 +4,9 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import ResponsiveGrid from './responsiveGrid';
|
|
7
|
+
import theme from './theme';
|
|
7
8
|
export var ResultContent = styled(ResponsiveGrid)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 18px 59px;\n box-sizing: border-box;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 8px;\n\n > * {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n }\n"], ["\n padding: 18px 59px;\n box-sizing: border-box;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 8px;\n\n > * {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n }\n"])));
|
|
8
|
-
export var Result = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n flex-direction: column;\n padding: 37px 20px;\n\n ", " {\n :nth-child(odd) {\n background: ", ";\n border-radius: 60px;\n }\n }\n"], ["\n display: ", ";\n flex-direction: column;\n padding: 37px 20px;\n\n ", " {\n :nth-child(odd) {\n background: ", ";\n border-radius: 60px;\n }\n }\n"])), function (props) {
|
|
9
|
+
export var Result = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n flex-direction: column;\n padding: 37px 20px;\n\n ", " {\n :nth-child(odd) {\n background: ", ";\n border-radius: 60px;\n }\n\n @media print {\n :not(:last-child) {\n border-radius: 0px !important;\n border-bottom: 1px solid ", ";\n }\n }\n }\n"], ["\n display: ", ";\n flex-direction: column;\n padding: 37px 20px;\n\n ", " {\n :nth-child(odd) {\n background: ", ";\n border-radius: 60px;\n }\n\n @media print {\n :not(:last-child) {\n border-radius: 0px !important;\n border-bottom: 1px solid ", ";\n }\n }\n }\n"])), function (props) {
|
|
9
10
|
var _a;
|
|
10
11
|
var haveChildren = Array.isArray(props.children)
|
|
11
12
|
? (_a = props.children) === null || _a === void 0 ? void 0 : _a.length
|
|
@@ -14,5 +15,5 @@ export var Result = styled.div(templateObject_2 || (templateObject_2 = __makeTem
|
|
|
14
15
|
}, ResultContent, function (_a) {
|
|
15
16
|
var _b = _a.resultContentStriped, resultContentStriped = _b === void 0 ? true : _b;
|
|
16
17
|
return resultContentStriped ? '#FFFFFF' : 'transparent';
|
|
17
|
-
});
|
|
18
|
+
}, theme.colors.cinzaClaro);
|
|
18
19
|
var templateObject_1, templateObject_2;
|
|
@@ -11,15 +11,18 @@ import ChevronUp from '../../assets/btn/chevronUp';
|
|
|
11
11
|
import CloseIcon from '../../assets/btn/closeIcon';
|
|
12
12
|
import BtnWrapper from '../../assets/btn/btnWrapper';
|
|
13
13
|
import styled from 'styled-components';
|
|
14
|
+
import PrintIcon from '../../assets/btn/printIcon';
|
|
14
15
|
var SectionContaner = styled.section(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n @media screen {\n background-color: rgb(239, 239, 239);\n }\n"], ["\n @media screen {\n background-color: rgb(239, 239, 239);\n }\n"])));
|
|
15
16
|
var ResultContainer = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n position: relative;\n margin-top: 20px;\n flex-direction: column;\n row-gap: 20px;\n @media screen {\n background-color: #efefef;\n }\n"], ["\n display: ", ";\n position: relative;\n margin-top: 20px;\n flex-direction: column;\n row-gap: 20px;\n @media screen {\n background-color: #efefef;\n }\n"])), function (props) { return (props.hide ? 'none' : 'flex'); });
|
|
16
17
|
var Section = function (_a) {
|
|
17
|
-
var title = _a.title, subtitle = _a.subtitle, description = _a.description, _b = _a.minimized, minimized = _b === void 0 ? false : _b, onClose = _a.onClose, variant = _a.variant, loadingProps = _a.loadingProps, icon = _a.icon, actions = _a.actions, children = _a.children, className = _a.className, contentClassName = _a.contentClassName;
|
|
18
|
+
var title = _a.title, subtitle = _a.subtitle, description = _a.description, _b = _a.minimized, minimized = _b === void 0 ? false : _b, onClose = _a.onClose, variant = _a.variant, loadingProps = _a.loadingProps, icon = _a.icon, actions = _a.actions, children = _a.children, onClickPrint = _a.onClickPrint, className = _a.className, contentClassName = _a.contentClassName;
|
|
18
19
|
var _c = useToggle(!minimized), isOpen = _c[0], toggleOpen = _c[1];
|
|
19
20
|
var sectionClass = classNames(className);
|
|
20
21
|
var sectionContentClass = classNames(contentClassName);
|
|
21
22
|
return (React.createElement(SectionContaner, { className: sectionClass },
|
|
22
23
|
React.createElement(Header, { title: title, subtitle: subtitle, description: description, loadingProps: loadingProps, icon: icon, variant: variant, actions: React.createElement(React.Fragment, null,
|
|
24
|
+
React.createElement(BtnWrapper, null,
|
|
25
|
+
React.createElement(PrintIcon, { onClick: onClickPrint })),
|
|
23
26
|
children && (React.createElement(BtnWrapper, { hidden: variant === 'loading', onClick: toggleOpen }, isOpen ? React.createElement(ChevronUp, null) : React.createElement(ChevronDown, null))),
|
|
24
27
|
onClose && (React.createElement(BtnWrapper, { onClick: onClose },
|
|
25
28
|
React.createElement(CloseIcon, null))),
|
|
@@ -51,7 +51,7 @@ export var ProtestoItem = memo(function (_a) {
|
|
|
51
51
|
var formatBooleanField = function (value) {
|
|
52
52
|
return value === 'true' ? 'Sim' : 'Não';
|
|
53
53
|
};
|
|
54
|
-
return (React.createElement(ResultContent, { desktop: "repeat(8, 1fr)", tablet: "repeat(4, 1fr)", mobile:
|
|
54
|
+
return (React.createElement(ResultContent, { print: "repeat(7, 1fr)", desktop: "repeat(8, 1fr)", tablet: "repeat(4, 1fr)", mobile: "repeat(2, 1fr)" },
|
|
55
55
|
React.createElement(AddItemField, { name: "Quem Protestou", value: getField('./nomeCedente') }),
|
|
56
56
|
React.createElement(AddItemField, { name: "Atrav\u00E9s De", value: getField('./nomeApresentante') }),
|
|
57
57
|
React.createElement(AddItemField, { name: "CPF/CNPJ Protestado", value: formatDocument(getField('./cpfCnpj')) }),
|
|
@@ -25,6 +25,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
27
|
var _a;
|
|
28
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
28
29
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
29
30
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
30
31
|
import { Client } from '@credithub/webservice';
|
|
@@ -37,6 +38,7 @@ import useToggle from '../hooks/useToggle';
|
|
|
37
38
|
import ChevronUp from '../assets/btn/chevronUp';
|
|
38
39
|
import ChevronDown from '../assets/btn/chevronDown';
|
|
39
40
|
import styled from 'styled-components';
|
|
41
|
+
import { PrintSectionWrapper } from './common/printSectionWrapper';
|
|
40
42
|
export var WebService = createContext(new Client.WebService());
|
|
41
43
|
export var WebServiceProvider = function (_a) {
|
|
42
44
|
var credential = _a.credential, children = _a.children;
|
|
@@ -189,38 +191,33 @@ var Section = function (_a) {
|
|
|
189
191
|
var _f = useToggle(!minimized), isOpen = _f[0], toggleOpen = _f[1];
|
|
190
192
|
if (!ctx)
|
|
191
193
|
return null;
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
+
var type = ctx.type;
|
|
195
|
+
var renderResponse = useCallback(function () {
|
|
196
|
+
switch (type) {
|
|
194
197
|
case RequestStatus.Success:
|
|
195
|
-
return onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(ctx.document, ctx);
|
|
198
|
+
return onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(ctx === null || ctx === void 0 ? void 0 : ctx.document, ctx);
|
|
196
199
|
case RequestStatus.Error:
|
|
197
|
-
return isError === null || isError === void 0 ? void 0 : isError(ctx.error, ctx);
|
|
200
|
+
return isError === null || isError === void 0 ? void 0 : isError(ctx === null || ctx === void 0 ? void 0 : ctx.error, ctx);
|
|
198
201
|
case RequestStatus.Loading:
|
|
199
202
|
return onLoading === null || onLoading === void 0 ? void 0 : onLoading(ctx);
|
|
200
203
|
default:
|
|
201
204
|
return children;
|
|
202
205
|
}
|
|
203
|
-
};
|
|
206
|
+
}, [type]);
|
|
204
207
|
var renderedResponse = renderResponse();
|
|
205
|
-
var defaultHeaderActions = (React.createElement(React.
|
|
206
|
-
|
|
208
|
+
var defaultHeaderActions = useMemo(function () { return (React.createElement(BtnWrapper, { hidden: type === RequestStatus.Loading, onClick: toggleOpen }, isOpen ? React.createElement(ChevronUp, null) : React.createElement(ChevronDown, null))); }, [type, isOpen, toggleOpen]);
|
|
209
|
+
var renderHeader = function (props) { return (React.createElement(Header, __assign({ printBar: renderedResponse !== null && isOpen }, props, { className: cn(className, headerStatus[type], props.className), variant: type === RequestStatus.Loading ? 'loading' : props.variant, actions: React.createElement(React.Fragment, null,
|
|
210
|
+
props.actions,
|
|
211
|
+
renderedResponse && defaultHeaderActions) }))); };
|
|
207
212
|
if (React.isValidElement(renderedResponse)) {
|
|
208
|
-
return (React.createElement(
|
|
209
|
-
!hideHeader && (
|
|
210
|
-
? 'loading'
|
|
211
|
-
: headerProps.variant, actions: React.createElement(React.Fragment, null,
|
|
212
|
-
headerProps.actions,
|
|
213
|
-
defaultHeaderActions) }))),
|
|
213
|
+
return (React.createElement(PrintSectionWrapper, { enabled: !hideHeader },
|
|
214
|
+
!hideHeader && renderHeader(headerProps),
|
|
214
215
|
React.createElement(ShowRenderedChildren, { isOpen: isOpen }, renderedResponse)));
|
|
215
216
|
}
|
|
216
217
|
var _g = renderedResponse, renderedChildren = _g.children, headerReplaceProps = __rest(_g, ["children"]);
|
|
217
|
-
var headerPropsUnified =
|
|
218
|
-
return (React.createElement(
|
|
219
|
-
!hideHeader && (
|
|
220
|
-
? 'loading'
|
|
221
|
-
: headerPropsUnified.variant, actions: React.createElement(React.Fragment, null,
|
|
222
|
-
headerPropsUnified.actions,
|
|
223
|
-
renderedChildren && defaultHeaderActions) }))),
|
|
218
|
+
var headerPropsUnified = __assign(__assign(__assign({}, headerProps), headerReplaceProps), { printBar: renderedChildren !== null && isOpen });
|
|
219
|
+
return (React.createElement(PrintSectionWrapper, { enabled: !hideHeader },
|
|
220
|
+
!hideHeader && renderHeader(headerPropsUnified),
|
|
224
221
|
React.createElement(ShowRenderedChildren, { isOpen: isOpen }, renderedChildren)));
|
|
225
222
|
};
|
|
226
223
|
var ShowRenderedChildren = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n\n /* @media print {\n display: block;\n } */\n"], ["\n display: ", ";\n\n /* @media print {\n display: block;\n } */\n"])), function (props) { return (props.isOpen ? 'block' : 'none'); });
|
package/dist/consultaSimples.js
CHANGED
|
@@ -16,7 +16,7 @@ import Dominios from './components/dominios/dominios';
|
|
|
16
16
|
import Liminar from './components/liminar/liminar';
|
|
17
17
|
import ConsultaSimplesSection from './components/consultaSimplesSection/consultaSimplesSection';
|
|
18
18
|
Chart.register.apply(Chart, registerables);
|
|
19
|
-
var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin:
|
|
19
|
+
var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 5mm;\n }\n }\n"], ["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 5mm;\n }\n }\n"])));
|
|
20
20
|
var ConsultaSimples = function (_a) {
|
|
21
21
|
var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits;
|
|
22
22
|
var documento = _documento.replace(/\D+/g, '');
|
|
@@ -31,9 +31,9 @@ var ConsultaSimples = function (_a) {
|
|
|
31
31
|
React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
|
|
32
32
|
React.createElement(Queries.Liminar.Request, { data: { documento: documento } },
|
|
33
33
|
React.createElement(Wrapper, null,
|
|
34
|
-
React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose },
|
|
34
|
+
React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint },
|
|
35
35
|
React.createElement(ConsultaRfbProvider, { documento: documento },
|
|
36
|
-
React.createElement(Dossie, {
|
|
36
|
+
React.createElement(Dossie, { documento: documento }),
|
|
37
37
|
React.createElement(Liminar, null),
|
|
38
38
|
React.createElement(Addresses, { apiKey: apiKey }),
|
|
39
39
|
React.createElement(Contacts, null),
|