@credithub/harlan-components 1.19.5 → 1.20.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/lib/cjs/index.js +12 -61
- package/lib/esm/components/dossie/dossie.d.ts +1 -0
- package/lib/esm/components/dossie/dossie.js +2 -2
- package/lib/esm/components/dossie/summary/summary.d.ts +1 -0
- package/lib/esm/components/dossie/summary/summary.js +5 -55
- package/lib/esm/consultaSimples.d.ts +1 -0
- package/lib/esm/consultaSimples.js +2 -2
- package/package.json +1 -1
package/lib/cjs/index.js
CHANGED
|
@@ -13836,7 +13836,7 @@ var ProtestosCategory = function (_a) {
|
|
|
13836
13836
|
React.createElement(Result, null, children))));
|
|
13837
13837
|
};
|
|
13838
13838
|
|
|
13839
|
-
var __awaiter
|
|
13839
|
+
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13840
13840
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13841
13841
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13842
13842
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -13845,7 +13845,7 @@ var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _argu
|
|
|
13845
13845
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13846
13846
|
});
|
|
13847
13847
|
};
|
|
13848
|
-
var __generator
|
|
13848
|
+
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
13849
13849
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13850
13850
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13851
13851
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -13898,9 +13898,9 @@ var Instrumento = function (_a) {
|
|
|
13898
13898
|
var _c = React.useState(false), isLoading = _c[0], setIsLoading = _c[1];
|
|
13899
13899
|
if (!nm_chave)
|
|
13900
13900
|
return null;
|
|
13901
|
-
return (React.createElement(Button$1, { onClick: function () { return __awaiter
|
|
13901
|
+
return (React.createElement(Button$1, { onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
13902
13902
|
var request, pdfWindow, e_1;
|
|
13903
|
-
return __generator
|
|
13903
|
+
return __generator(this, function (_a) {
|
|
13904
13904
|
switch (_a.label) {
|
|
13905
13905
|
case 0:
|
|
13906
13906
|
setIsLoading(true);
|
|
@@ -22103,42 +22103,6 @@ var __makeTemplateObject$h = (undefined && undefined.__makeTemplateObject) || fu
|
|
|
22103
22103
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
22104
22104
|
return cooked;
|
|
22105
22105
|
};
|
|
22106
|
-
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22107
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22108
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22109
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
22110
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22111
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22112
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22113
|
-
});
|
|
22114
|
-
};
|
|
22115
|
-
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
22116
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
22117
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
22118
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
22119
|
-
function step(op) {
|
|
22120
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
22121
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
22122
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
22123
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
22124
|
-
switch (op[0]) {
|
|
22125
|
-
case 0: case 1: t = op; break;
|
|
22126
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22127
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
22128
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
22129
|
-
default:
|
|
22130
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
22131
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
22132
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
22133
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
22134
|
-
if (t[2]) _.ops.pop();
|
|
22135
|
-
_.trys.pop(); continue;
|
|
22136
|
-
}
|
|
22137
|
-
op = body.call(thisArg, _);
|
|
22138
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
22139
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
22140
|
-
}
|
|
22141
|
-
};
|
|
22142
22106
|
var ContainerSummary$1 = styled.div(templateObject_1$h || (templateObject_1$h = __makeTemplateObject$h(["\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 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"])));
|
|
22143
22107
|
var ContentSummary = styled.div(templateObject_2$9 || (templateObject_2$9 = __makeTemplateObject$h(["\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"])));
|
|
22144
22108
|
var FieldSummary = styled.div(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject$h(["\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'); });
|
|
@@ -22146,7 +22110,7 @@ var ButtonsSummary = styled.div(templateObject_4$3 || (templateObject_4$3 = __ma
|
|
|
22146
22110
|
var ButtonsWrapper = styled.div(templateObject_5$2 || (templateObject_5$2 = __makeTemplateObject$h(["\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"])));
|
|
22147
22111
|
var SummaryButton = styled(Button$1)(templateObject_6$2 || (templateObject_6$2 = __makeTemplateObject$h(["\n height: 100%;\n"], ["\n height: 100%;\n"])));
|
|
22148
22112
|
var Summary = function (_a) {
|
|
22149
|
-
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse,
|
|
22113
|
+
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse, onClickPrint = _a.onClickPrint;
|
|
22150
22114
|
var _b = useCardsAndProducts({
|
|
22151
22115
|
finderResponse: finderResponse,
|
|
22152
22116
|
rfbResponse: rfbResponse
|
|
@@ -22158,25 +22122,12 @@ var Summary = function (_a) {
|
|
|
22158
22122
|
React.createElement(ButtonsWrapper, null,
|
|
22159
22123
|
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%' } },
|
|
22160
22124
|
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))); }),
|
|
22161
|
-
React.createElement(PrintButton, {
|
|
22125
|
+
React.createElement(PrintButton, { onClickPrint: onClickPrint })))));
|
|
22162
22126
|
};
|
|
22163
22127
|
var PrintButton = function (_a) {
|
|
22164
|
-
var
|
|
22165
|
-
var client = React.useContext(WebService);
|
|
22166
|
-
var url = React.useMemo(function () {
|
|
22167
|
-
var url = new URL('https://pdfnode.credithub.com.br/relatorio/analitico/pdf');
|
|
22168
|
-
url.searchParams.append('apiKey', client.apiKey);
|
|
22169
|
-
url.searchParams.append('documento', document.replace(/\D/g, ''));
|
|
22170
|
-
return url;
|
|
22171
|
-
}, [document, client.apiKey]);
|
|
22172
|
-
var onClick = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
22173
|
-
return __generator(this, function (_a) {
|
|
22174
|
-
window.open(url.toString(), '_blank');
|
|
22175
|
-
return [2 /*return*/];
|
|
22176
|
-
});
|
|
22177
|
-
}); }, [url]);
|
|
22128
|
+
var onClickPrint = _a.onClickPrint;
|
|
22178
22129
|
return (React.createElement(ButtonsSummary, null,
|
|
22179
|
-
React.createElement(SummaryButton, { onClick:
|
|
22130
|
+
React.createElement(SummaryButton, { onClick: onClickPrint }, "PDF para Impress\u00E3o")));
|
|
22180
22131
|
};
|
|
22181
22132
|
var templateObject_1$h, templateObject_2$9, templateObject_3$4, templateObject_4$3, templateObject_5$2, templateObject_6$2;
|
|
22182
22133
|
|
|
@@ -28263,7 +28214,7 @@ var __makeTemplateObject$c = (undefined && undefined.__makeTemplateObject) || fu
|
|
|
28263
28214
|
var DossieContent = styled.div(templateObject_1$c || (templateObject_1$c = __makeTemplateObject$c(["\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 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"])));
|
|
28264
28215
|
var DossieContainer = styled.div(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject$c(["\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"])));
|
|
28265
28216
|
var Dossie = function (_a) {
|
|
28266
|
-
var documento = _a.documento;
|
|
28217
|
+
var documento = _a.documento, onClickPrint = _a.onClickPrint;
|
|
28267
28218
|
var finderCtx = React.useContext(Queries.Finder);
|
|
28268
28219
|
var rfbResponse = useConsultaRfb().rfbResponse;
|
|
28269
28220
|
var Section = finderCtx.Section;
|
|
@@ -28281,7 +28232,7 @@ var Dossie = function (_a) {
|
|
|
28281
28232
|
return (React.createElement(DossieContainer, null,
|
|
28282
28233
|
React.createElement(DossieContent, null,
|
|
28283
28234
|
React.createElement(DossieCarrousel, null),
|
|
28284
|
-
React.createElement(Summary, { finderResponse: data, rfbResponse: rfbResponse, document: document })),
|
|
28235
|
+
React.createElement(Summary, { onClickPrint: onClickPrint, finderResponse: data, rfbResponse: rfbResponse, document: document })),
|
|
28285
28236
|
React.createElement(TransactionsTable, { events: XPathUtils.select('//historico/consulta', data) || [] })));
|
|
28286
28237
|
};
|
|
28287
28238
|
return (React.createElement(Section, { ctx: finderCtx, hideHeader: true, minimized: false, isError: function (e) { return response(e); }, onSuccess: response }));
|
|
@@ -65504,7 +65455,7 @@ var __makeTemplateObject = (undefined && undefined.__makeTemplateObject) || func
|
|
|
65504
65455
|
Chart$1.register.apply(Chart$1, registerables);
|
|
65505
65456
|
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 font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n"])));
|
|
65506
65457
|
var ConsultaSimples = function (_a) {
|
|
65507
|
-
var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits;
|
|
65458
|
+
var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits;
|
|
65508
65459
|
var documento = _documento.replace(/\D+/g, '');
|
|
65509
65460
|
return (React.createElement(React.Fragment, null,
|
|
65510
65461
|
React.createElement(GlobalStyle, null),
|
|
@@ -65519,7 +65470,7 @@ var ConsultaSimples = function (_a) {
|
|
|
65519
65470
|
React.createElement(Wrapper, null,
|
|
65520
65471
|
React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose },
|
|
65521
65472
|
React.createElement(ConsultaRfbProvider, { documento: documento },
|
|
65522
|
-
React.createElement(Dossie, { documento: documento }),
|
|
65473
|
+
React.createElement(Dossie, { onClickPrint: onClickPrint, documento: documento }),
|
|
65523
65474
|
React.createElement(Liminar, null),
|
|
65524
65475
|
React.createElement(Addresses, { apiKey: apiKey }),
|
|
65525
65476
|
React.createElement(Contacts, null),
|
|
@@ -17,7 +17,7 @@ import { useConsultaRfb } from '../../hooks/useConsultaRfb';
|
|
|
17
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 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"])));
|
|
18
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
|
-
var documento = _a.documento;
|
|
20
|
+
var documento = _a.documento, onClickPrint = _a.onClickPrint;
|
|
21
21
|
var finderCtx = useContext(Queries.Finder);
|
|
22
22
|
var rfbResponse = useConsultaRfb().rfbResponse;
|
|
23
23
|
var Section = finderCtx.Section;
|
|
@@ -35,7 +35,7 @@ var Dossie = function (_a) {
|
|
|
35
35
|
return (React.createElement(DossieContainer, null,
|
|
36
36
|
React.createElement(DossieContent, null,
|
|
37
37
|
React.createElement(DossieCarrousel, null),
|
|
38
|
-
React.createElement(Summary, { finderResponse: data, rfbResponse: rfbResponse, document: document })),
|
|
38
|
+
React.createElement(Summary, { onClickPrint: onClickPrint, finderResponse: data, rfbResponse: rfbResponse, document: document })),
|
|
39
39
|
React.createElement(TransactionsTable, { events: XPathUtils.select('//historico/consulta', data) || [] })));
|
|
40
40
|
};
|
|
41
41
|
return (React.createElement(Section, { ctx: finderCtx, hideHeader: true, minimized: false, isError: function (e) { return response(e); }, onSuccess: response }));
|
|
@@ -2,49 +2,12 @@ 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
|
-
|
|
6
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
16
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
18
|
-
function step(op) {
|
|
19
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
20
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
21
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
22
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23
|
-
switch (op[0]) {
|
|
24
|
-
case 0: case 1: t = op; break;
|
|
25
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
26
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
27
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
28
|
-
default:
|
|
29
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
30
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
31
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
32
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33
|
-
if (t[2]) _.ops.pop();
|
|
34
|
-
_.trys.pop(); continue;
|
|
35
|
-
}
|
|
36
|
-
op = body.call(thisArg, _);
|
|
37
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
38
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
import React, { useCallback, useContext, useMemo } from 'react';
|
|
5
|
+
import React from 'react';
|
|
42
6
|
import AddItemField from '../../../components/common/addItem';
|
|
43
7
|
import Button from '../../../components/common/button';
|
|
44
8
|
import { formatMoney } from '../../../utils/number';
|
|
45
9
|
import useCardsAndProducts from './cardsAndProducts';
|
|
46
10
|
import styled from 'styled-components';
|
|
47
|
-
import { WebService } from '../../../components/webservice';
|
|
48
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 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"])));
|
|
49
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"])));
|
|
50
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'); });
|
|
@@ -52,7 +15,7 @@ var ButtonsSummary = styled.div(templateObject_4 || (templateObject_4 = __makeTe
|
|
|
52
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"])));
|
|
53
16
|
var SummaryButton = styled(Button)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 100%;\n"], ["\n height: 100%;\n"])));
|
|
54
17
|
export var Summary = function (_a) {
|
|
55
|
-
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse,
|
|
18
|
+
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse, onClickPrint = _a.onClickPrint;
|
|
56
19
|
var _b = useCardsAndProducts({
|
|
57
20
|
finderResponse: finderResponse,
|
|
58
21
|
rfbResponse: rfbResponse
|
|
@@ -64,25 +27,12 @@ export var Summary = function (_a) {
|
|
|
64
27
|
React.createElement(ButtonsWrapper, null,
|
|
65
28
|
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%' } },
|
|
66
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))); }),
|
|
67
|
-
React.createElement(PrintButton, {
|
|
30
|
+
React.createElement(PrintButton, { onClickPrint: onClickPrint })))));
|
|
68
31
|
};
|
|
69
32
|
var PrintButton = function (_a) {
|
|
70
|
-
var
|
|
71
|
-
var client = useContext(WebService);
|
|
72
|
-
var url = useMemo(function () {
|
|
73
|
-
var url = new URL('https://pdfnode.credithub.com.br/relatorio/analitico/pdf');
|
|
74
|
-
url.searchParams.append('apiKey', client.apiKey);
|
|
75
|
-
url.searchParams.append('documento', document.replace(/\D/g, ''));
|
|
76
|
-
return url;
|
|
77
|
-
}, [document, client.apiKey]);
|
|
78
|
-
var onClick = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
79
|
-
return __generator(this, function (_a) {
|
|
80
|
-
window.open(url.toString(), '_blank');
|
|
81
|
-
return [2 /*return*/];
|
|
82
|
-
});
|
|
83
|
-
}); }, [url]);
|
|
33
|
+
var onClickPrint = _a.onClickPrint;
|
|
84
34
|
return (React.createElement(ButtonsSummary, null,
|
|
85
|
-
React.createElement(SummaryButton, { onClick:
|
|
35
|
+
React.createElement(SummaryButton, { onClick: onClickPrint }, "PDF para Impress\u00E3o")));
|
|
86
36
|
};
|
|
87
37
|
export default Summary;
|
|
88
38
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -6,6 +6,7 @@ type ConsultaSimplesProps = {
|
|
|
6
6
|
apiKey: string;
|
|
7
7
|
onClose?: () => void;
|
|
8
8
|
hasCredits?: HasCreditsType;
|
|
9
|
+
onClickPrint: () => void;
|
|
9
10
|
onClickConsultarProcessoJuridico?: (processoId: string) => void;
|
|
10
11
|
};
|
|
11
12
|
declare const ConsultaSimples: React.FC<ConsultaSimplesProps>;
|
|
@@ -18,7 +18,7 @@ import ConsultaSimplesSection from './components/consultaSimplesSection/consulta
|
|
|
18
18
|
Chart.register.apply(Chart, registerables);
|
|
19
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 font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n"])));
|
|
20
20
|
var ConsultaSimples = function (_a) {
|
|
21
|
-
var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits;
|
|
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, '');
|
|
23
23
|
return (React.createElement(React.Fragment, null,
|
|
24
24
|
React.createElement(GlobalStyle, null),
|
|
@@ -33,7 +33,7 @@ var ConsultaSimples = function (_a) {
|
|
|
33
33
|
React.createElement(Wrapper, null,
|
|
34
34
|
React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose },
|
|
35
35
|
React.createElement(ConsultaRfbProvider, { documento: documento },
|
|
36
|
-
React.createElement(Dossie, { documento: documento }),
|
|
36
|
+
React.createElement(Dossie, { onClickPrint: onClickPrint, documento: documento }),
|
|
37
37
|
React.createElement(Liminar, null),
|
|
38
38
|
React.createElement(Addresses, { apiKey: apiKey }),
|
|
39
39
|
React.createElement(Contacts, null),
|