@credithub/harlan-components 1.33.0 → 1.35.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/components/adresses/addresses.d.ts +2 -2
- package/dist/components/adresses/addresses.js +33 -11
- package/dist/components/adresses/map.js +1 -1
- package/dist/components/bank-accounts/bank-accounts.js +32 -28
- package/dist/components/ccf/ccf.js +1 -1
- package/dist/components/chart/chartSystem.js +51 -29
- package/dist/components/chart/hooks/useChartData.d.ts +6 -0
- package/dist/components/chart/hooks/useChartData.js +57 -4
- package/dist/components/chart/utils/chartUtils.d.ts +0 -4
- package/dist/components/chart/utils/chartUtils.js +0 -16
- package/dist/components/consultaRfb.js +0 -1
- package/dist/components/consultaSimplesSection/consultaSimplesSection.js +5 -2
- package/dist/components/contacts/contacts.js +7 -4
- package/dist/components/dividasPublicas/dividasPublicas.js +40 -40
- package/dist/components/dominios/dominios.js +6 -6
- package/dist/components/dossie/dossie.js +21 -11
- package/dist/components/dossie/summary/cardsAndProducts.d.ts +6 -8
- package/dist/components/dossie/summary/cardsAndProducts.js +93 -25
- package/dist/components/dossie/summary/styles.d.ts +1 -0
- package/dist/components/dossie/summary/styles.js +33 -8
- package/dist/components/dossie/summary/summary.js +3 -3
- package/dist/components/dossie/summary/utils.js +12 -2
- package/dist/components/imoveis/imoveisService.js +26 -13
- package/dist/components/interface/header.d.ts +7 -3
- package/dist/components/interface/header.js +10 -5
- package/dist/components/interface/loadingBar.d.ts +1 -0
- package/dist/components/interface/loadingBar.js +8 -8
- package/dist/components/interface/section.d.ts +2 -0
- package/dist/components/interface/section.js +7 -6
- package/dist/components/liminar/liminar.js +25 -15
- package/dist/components/llama/llama.d.ts +6 -0
- package/dist/components/llama/llama.js +122 -0
- package/dist/components/partners/partnerList.js +1 -1
- package/dist/components/partners/partners.js +27 -7
- package/dist/components/pep/pep.js +13 -6
- package/dist/components/processos-juridicos/processosJuridicos.js +19 -13
- package/dist/components/protestos/protestos.js +53 -38
- package/dist/components/refinBoaVista/refinBoaVista.js +31 -15
- package/dist/components/refinSerasa/refinSerasa.js +25 -38
- package/dist/components/score/scoreService.js +27 -13
- package/dist/components/scr/scr.js +123 -59
- package/dist/components/section.d.ts +3 -0
- package/dist/components/section.js +93 -0
- package/dist/components/veiculos/veiculos.js +28 -12
- package/dist/components/webservice.d.ts +24 -29
- package/dist/components/webservice.js +152 -130
- package/dist/consultaSimples.js +2 -2
- package/lib/cjs/index.js +1309 -829
- package/lib/esm/index.js +1310 -830
- package/package.json +1 -1
|
@@ -13,14 +13,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
};
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
|
+
import { useGlobalData } from '../../contexts/globalDataContext';
|
|
16
17
|
import { useConsultaRfb } from '../../hooks/useConsultaRfb';
|
|
17
18
|
import { formatCnpj, formatCpf } from '../../utils/string';
|
|
18
19
|
import XPathUtils from '../../utils/xpath';
|
|
19
|
-
import {
|
|
20
|
-
import React, { useContext, useState } from 'react';
|
|
20
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
21
21
|
import styled from 'styled-components';
|
|
22
22
|
import { ReclameAquiCarousel } from '../reclameAqui/reclameAquiCarousel';
|
|
23
|
-
import {
|
|
23
|
+
import { Section } from '../section';
|
|
24
|
+
import { Queries, RequestStatus } from '../webservice';
|
|
24
25
|
import { Carrousel } from './carrousel/carrousel';
|
|
25
26
|
import { createDossieData } from './dossieData';
|
|
26
27
|
import { Summary } from './summary/summary';
|
|
@@ -29,11 +30,25 @@ var DossieContent = styled.div(templateObject_1 || (templateObject_1 = __makeTem
|
|
|
29
30
|
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"])));
|
|
30
31
|
var Dossie = function (_a) {
|
|
31
32
|
var documento = _a.documento;
|
|
32
|
-
var
|
|
33
|
+
var ctx = useContext(Queries.Finder);
|
|
33
34
|
var rfbResponse = useConsultaRfb().rfbResponse;
|
|
34
|
-
var Section = finderCtx.Section;
|
|
35
35
|
var setData = useGlobalData().setData;
|
|
36
36
|
var _b = useState(false), dataUpdated = _b[0], setDataUpdated = _b[1];
|
|
37
|
+
useEffect(function () {
|
|
38
|
+
if (ctx.type === RequestStatus.Success && !dataUpdated && ctx.document) {
|
|
39
|
+
var data = ctx.document;
|
|
40
|
+
var isPF = (documento === null || documento === void 0 ? void 0 : documento.length) === 11;
|
|
41
|
+
var name_1 = (isPF
|
|
42
|
+
? XPathUtils.select('string(//cadastro/nome)', data)
|
|
43
|
+
: XPathUtils.select('string(//cadastro/razaoSocial)', data) ||
|
|
44
|
+
(rfbResponse &&
|
|
45
|
+
XPathUtils.select('string(//RFB/nome)', rfbResponse)));
|
|
46
|
+
var document_1 = isPF ? formatCpf(documento) : formatCnpj(documento);
|
|
47
|
+
var dossieData_1 = createDossieData(data, rfbResponse, name_1, document_1);
|
|
48
|
+
setData(function (prevState) { return (__assign(__assign({}, prevState), { dossie: dossieData_1 })); });
|
|
49
|
+
setDataUpdated(true);
|
|
50
|
+
}
|
|
51
|
+
}, [ctx, rfbResponse, documento, setData, dataUpdated]);
|
|
37
52
|
var response = function (_data) {
|
|
38
53
|
var data = _data instanceof Error ? undefined : _data;
|
|
39
54
|
var isPF = (documento === null || documento === void 0 ? void 0 : documento.length) === 11;
|
|
@@ -45,18 +60,13 @@ var Dossie = function (_a) {
|
|
|
45
60
|
var DossieCarrousel = function () {
|
|
46
61
|
return !isPF ? (React.createElement(ReclameAquiCarousel, { documento: document, nome: name })) : (React.createElement(Carrousel, { name: name, document: document }));
|
|
47
62
|
};
|
|
48
|
-
var dossieData = createDossieData(data, rfbResponse, name, document);
|
|
49
|
-
if (!dataUpdated) {
|
|
50
|
-
setData(function (prevState) { return (__assign(__assign({}, prevState), { dossie: dossieData })); });
|
|
51
|
-
setDataUpdated(true);
|
|
52
|
-
}
|
|
53
63
|
return (React.createElement(DossieContainer, null,
|
|
54
64
|
React.createElement(DossieContent, null,
|
|
55
65
|
React.createElement(DossieCarrousel, null),
|
|
56
66
|
React.createElement(Summary, { finderResponse: data, rfbResponse: rfbResponse, document: document })),
|
|
57
67
|
React.createElement(TransactionsTable, { events: XPathUtils.select('//historico/consulta', data) || [] })));
|
|
58
68
|
};
|
|
59
|
-
return (React.createElement(Section, { ctx:
|
|
69
|
+
return (React.createElement(Section, { ctx: ctx, hideHeader: true, minimized: false, isError: function (e) { return response(e); }, onSuccess: response }));
|
|
60
70
|
};
|
|
61
71
|
export default Dossie;
|
|
62
72
|
var templateObject_1, templateObject_2;
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const useCardsAndProducts: ({ finderResponse, rfbResponse }: {
|
|
3
2
|
finderResponse?: Document;
|
|
4
3
|
rfbResponse?: Document;
|
|
5
4
|
}) => {
|
|
6
|
-
cards:
|
|
5
|
+
cards: {
|
|
7
6
|
title: string | false;
|
|
8
7
|
header: string;
|
|
9
|
-
}
|
|
10
|
-
title: React.JSX.Element[];
|
|
11
|
-
header: string;
|
|
12
|
-
})[];
|
|
8
|
+
}[];
|
|
13
9
|
products: ({
|
|
14
10
|
title: string;
|
|
15
|
-
onClick: () => void
|
|
11
|
+
onClick: () => Promise<void>;
|
|
16
12
|
price: number;
|
|
13
|
+
isLoading: boolean;
|
|
17
14
|
hide?: undefined;
|
|
18
15
|
} | {
|
|
19
16
|
title: string;
|
|
20
17
|
price: number;
|
|
21
|
-
onClick: () => void
|
|
18
|
+
onClick: () => Promise<void>;
|
|
22
19
|
hide: boolean;
|
|
20
|
+
isLoading: boolean;
|
|
23
21
|
})[];
|
|
24
22
|
};
|
|
25
23
|
export default useCardsAndProducts;
|
|
@@ -9,32 +9,97 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
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;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
12
48
|
import { useConsultasComplementares } from '../../../hooks/useConsultasComplementares';
|
|
13
49
|
import { formatMoney } from '../../../utils/number';
|
|
14
50
|
import XPathUtils from '../../../utils/xpath';
|
|
15
|
-
import
|
|
51
|
+
import { useState } from 'react';
|
|
16
52
|
import { getAtividadesEconomicasSecundarias, getField, getFieldRfb, getProductsPrices } from './utils';
|
|
17
53
|
var useCardsAndProducts = function (_a) {
|
|
18
54
|
var _b, _c, _d, _e, _f;
|
|
19
55
|
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse;
|
|
20
56
|
var _g = useConsultasComplementares(), consultasComplementares = _g.consultasComplementares, setConsultasComplementares = _g.setConsultasComplementares, hasCredits = _g.hasCredits;
|
|
57
|
+
var _h = useState({}), loadingButtons = _h[0], setLoadingButtons = _h[1];
|
|
21
58
|
var isPF = !!getField('cpf', finderResponse);
|
|
22
59
|
var productsPrices = getProductsPrices(isPF);
|
|
23
60
|
var handleOnClick = function (key) {
|
|
24
|
-
return function () {
|
|
25
|
-
var callback
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
61
|
+
return function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
62
|
+
var callback;
|
|
63
|
+
return __generator(this, function (_a) {
|
|
64
|
+
switch (_a.label) {
|
|
65
|
+
case 0:
|
|
66
|
+
if (loadingButtons[key])
|
|
67
|
+
return [2 /*return*/];
|
|
68
|
+
setLoadingButtons(function (prev) {
|
|
69
|
+
var _a;
|
|
70
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[key] = true, _a)));
|
|
71
|
+
});
|
|
72
|
+
callback = function () {
|
|
73
|
+
setConsultasComplementares &&
|
|
74
|
+
setConsultasComplementares(function (prev) {
|
|
75
|
+
var _a;
|
|
76
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[key] = __assign(__assign({}, prev[key]), { consultaRealizada: true }), _a)));
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
_a.label = 1;
|
|
80
|
+
case 1:
|
|
81
|
+
_a.trys.push([1, , 5, 6]);
|
|
82
|
+
if (!hasCredits) return [3 /*break*/, 3];
|
|
83
|
+
return [4 /*yield*/, hasCredits(productsPrices[key] * 1000, callback)];
|
|
84
|
+
case 2:
|
|
85
|
+
_a.sent();
|
|
86
|
+
return [3 /*break*/, 4];
|
|
87
|
+
case 3:
|
|
88
|
+
callback();
|
|
89
|
+
_a.label = 4;
|
|
90
|
+
case 4: return [3 /*break*/, 6];
|
|
91
|
+
case 5:
|
|
92
|
+
setLoadingButtons(function (prev) {
|
|
93
|
+
var _a;
|
|
94
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[key] = false, _a)));
|
|
95
|
+
});
|
|
96
|
+
return [7 /*endfinally*/];
|
|
97
|
+
case 6: return [2 /*return*/];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}); };
|
|
36
101
|
};
|
|
37
|
-
var
|
|
102
|
+
var _j = {
|
|
38
103
|
cards: [
|
|
39
104
|
{
|
|
40
105
|
title: getField('sexo', finderResponse, function (value) { return (isPF && (value == 'M' ? 'Masculino' : 'Feminino')) || ''; }),
|
|
@@ -133,10 +198,7 @@ var useCardsAndProducts = function (_a) {
|
|
|
133
198
|
header: 'Atividade Econômica'
|
|
134
199
|
},
|
|
135
200
|
{
|
|
136
|
-
title: getAtividadesEconomicasSecundarias(rfbResponse).
|
|
137
|
-
e,
|
|
138
|
-
".",
|
|
139
|
-
React.createElement("br", null))); }),
|
|
201
|
+
title: getAtividadesEconomicasSecundarias(rfbResponse).join(', '),
|
|
140
202
|
header: 'Atividades Econômicas Secundárias'
|
|
141
203
|
},
|
|
142
204
|
{
|
|
@@ -178,40 +240,46 @@ var useCardsAndProducts = function (_a) {
|
|
|
178
240
|
{
|
|
179
241
|
title: 'Consultar SCR',
|
|
180
242
|
onClick: handleOnClick('scr'),
|
|
181
|
-
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.scr
|
|
243
|
+
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.scr,
|
|
244
|
+
isLoading: loadingButtons['scr']
|
|
182
245
|
},
|
|
183
246
|
{
|
|
184
247
|
title: 'Consultar Veículos',
|
|
185
248
|
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.veiculos,
|
|
186
249
|
onClick: handleOnClick('veiculos'),
|
|
187
|
-
hide: (_b = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _b === void 0 ? void 0 : _b.consultaRealizada
|
|
250
|
+
hide: (_b = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _b === void 0 ? void 0 : _b.consultaRealizada,
|
|
251
|
+
isLoading: loadingButtons['veiculos']
|
|
188
252
|
},
|
|
189
253
|
{
|
|
190
254
|
title: 'Consultar Pefin/Refin Boa Vista',
|
|
191
255
|
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.refinBoaVista,
|
|
192
256
|
onClick: handleOnClick('refinBoaVista'),
|
|
193
|
-
hide: (_c = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.refinBoaVista) === null || _c === void 0 ? void 0 : _c.consultaRealizada
|
|
257
|
+
hide: (_c = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.refinBoaVista) === null || _c === void 0 ? void 0 : _c.consultaRealizada,
|
|
258
|
+
isLoading: loadingButtons['refinBoaVista']
|
|
194
259
|
},
|
|
195
260
|
{
|
|
196
261
|
title: 'Consultar Score Boa Vista',
|
|
197
262
|
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.scoreBoaVista,
|
|
198
263
|
onClick: handleOnClick('scoreBoaVista'),
|
|
199
|
-
hide: (_d = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.scoreBoaVista) === null || _d === void 0 ? void 0 : _d.consultaRealizada
|
|
264
|
+
hide: (_d = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.scoreBoaVista) === null || _d === void 0 ? void 0 : _d.consultaRealizada,
|
|
265
|
+
isLoading: loadingButtons['scoreBoaVista']
|
|
200
266
|
},
|
|
201
267
|
{
|
|
202
268
|
title: 'Consultar Pefin/Refin Serasa',
|
|
203
269
|
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.refinSerasa,
|
|
204
270
|
onClick: handleOnClick('refinSerasa'),
|
|
205
|
-
hide: (_e = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.refinSerasa) === null || _e === void 0 ? void 0 : _e.consultaRealizada
|
|
271
|
+
hide: (_e = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.refinSerasa) === null || _e === void 0 ? void 0 : _e.consultaRealizada,
|
|
272
|
+
isLoading: loadingButtons['refinSerasa']
|
|
206
273
|
},
|
|
207
274
|
{
|
|
208
275
|
title: 'Consultar Imóveis SP Capital',
|
|
209
276
|
price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.imoveis,
|
|
210
277
|
onClick: handleOnClick('imoveis'),
|
|
211
|
-
hide: !isPF || ((_f = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.imoveis) === null || _f === void 0 ? void 0 : _f.consultaRealizada)
|
|
278
|
+
hide: !isPF || ((_f = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.imoveis) === null || _f === void 0 ? void 0 : _f.consultaRealizada),
|
|
279
|
+
isLoading: loadingButtons['imoveis']
|
|
212
280
|
}
|
|
213
281
|
]
|
|
214
|
-
}, cards =
|
|
282
|
+
}, cards = _j.cards, products = _j.products;
|
|
215
283
|
return { cards: cards, products: products };
|
|
216
284
|
};
|
|
217
285
|
export default useCardsAndProducts;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const Spinner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
1
2
|
export declare const ContainerSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
3
|
export declare const ContentSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
4
|
export declare const FieldSummary: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
@@ -2,12 +2,37 @@ 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
|
-
import styled from 'styled-components';
|
|
6
5
|
import Button from '../../../components/common/button';
|
|
7
|
-
|
|
8
|
-
export var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
export var Spinner = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 3px solid ", ";\n border-radius: 50%;\n border-top-color: ", ";\n animation: spin 1s ease-in-out infinite;\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"], ["\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 3px solid ", ";\n border-radius: 50%;\n border-top-color: ", ";\n animation: spin 1s ease-in-out infinite;\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])), function (_a) {
|
|
8
|
+
var theme = _a.theme;
|
|
9
|
+
return theme.colors.cinzaEscuro;
|
|
10
|
+
}, function (_a) {
|
|
11
|
+
var theme = _a.theme;
|
|
12
|
+
return theme.colors.white;
|
|
13
|
+
});
|
|
14
|
+
export var ContainerSummary = styled.div(templateObject_2 || (templateObject_2 = __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"])));
|
|
15
|
+
export var ContentSummary = styled.div(templateObject_3 || (templateObject_3 = __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"])));
|
|
16
|
+
export var FieldSummary = styled.div(templateObject_4 || (templateObject_4 = __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'); });
|
|
17
|
+
export var ButtonsSummary = styled.div(templateObject_5 || (templateObject_5 = __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"])));
|
|
18
|
+
export var ButtonsWrapper = styled.div(templateObject_6 || (templateObject_6 = __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"])));
|
|
19
|
+
export var SummaryButton = styled(Button)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background: ", ";\n color: ", ";\n cursor: ", ";\n opacity: ", ";\n pointer-events: ", ";\n\n &:hover {\n background: ", ";\n }\n"], ["\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background: ", ";\n color: ", ";\n cursor: ", ";\n opacity: ", ";\n pointer-events: ", ";\n\n &:hover {\n background: ", ";\n }\n"])), function (_a) {
|
|
20
|
+
var theme = _a.theme, disabled = _a.disabled;
|
|
21
|
+
return disabled ? theme.colors.cinzaClaro : theme.colors.azulCredithub;
|
|
22
|
+
}, function (_a) {
|
|
23
|
+
var theme = _a.theme, disabled = _a.disabled;
|
|
24
|
+
return disabled ? theme.colors.cinzaEscuro : theme.colors.white;
|
|
25
|
+
}, function (_a) {
|
|
26
|
+
var disabled = _a.disabled;
|
|
27
|
+
return (disabled ? 'not-allowed' : 'pointer');
|
|
28
|
+
}, function (_a) {
|
|
29
|
+
var disabled = _a.disabled;
|
|
30
|
+
return (disabled ? 0.6 : 1);
|
|
31
|
+
}, function (_a) {
|
|
32
|
+
var disabled = _a.disabled;
|
|
33
|
+
return (disabled ? 'none' : 'auto');
|
|
34
|
+
}, function (_a) {
|
|
35
|
+
var theme = _a.theme, disabled = _a.disabled;
|
|
36
|
+
return disabled ? theme.colors.cinzaClaro : theme.colors.azulApoio;
|
|
37
|
+
});
|
|
38
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import AddItemField from '../../../components/common/addItem';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import ButtonAtualizarDadosRfb from '../../../assets/btn/buttonAtualizarDadosRfb';
|
|
3
4
|
import { formatMoney } from '../../../utils/number';
|
|
4
5
|
import useCardsAndProducts from './cardsAndProducts';
|
|
5
|
-
import { ButtonsSummary, ButtonsWrapper, ContainerSummary, ContentSummary, FieldSummary, SummaryButton } from './styles';
|
|
6
|
-
import ButtonAtualizarDadosRfb from '../../../assets/btn/buttonAtualizarDadosRfb';
|
|
6
|
+
import { ButtonsSummary, ButtonsWrapper, ContainerSummary, ContentSummary, FieldSummary, Spinner, SummaryButton } from './styles';
|
|
7
7
|
export var Summary = function (_a) {
|
|
8
8
|
var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse;
|
|
9
9
|
var _b = useCardsAndProducts({
|
|
@@ -17,6 +17,6 @@ export var Summary = function (_a) {
|
|
|
17
17
|
React.createElement(ButtonsWrapper, null,
|
|
18
18
|
React.createElement(ButtonAtualizarDadosRfb, null),
|
|
19
19
|
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%' } },
|
|
20
|
-
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))); })))));
|
|
20
|
+
React.createElement(SummaryButton, { onClick: function () { return (product === null || product === void 0 ? void 0 : product.onClick) && (product === null || product === void 0 ? void 0 : product.onClick()); }, disabled: product.isLoading, smallContent: product.price ? formatMoney(product.price) : undefined }, product.isLoading ? React.createElement(Spinner, null) : product.title))); })))));
|
|
21
21
|
};
|
|
22
22
|
export default Summary;
|
|
@@ -26,8 +26,18 @@ export var getAtividadesEconomicasSecundarias = function (response) {
|
|
|
26
26
|
var rfb = (_a = XPathUtils.selectArray('//RFB', response)) === null || _a === void 0 ? void 0 : _a[0];
|
|
27
27
|
if (!rfb)
|
|
28
28
|
return [];
|
|
29
|
-
var values = XPathUtils.selectArray('//atividade-secundaria', rfb);
|
|
30
|
-
|
|
29
|
+
var values = XPathUtils.selectArray('//atividade-secundaria', rfb).map(function (value) { var _a; return (_a = value.firstChild) === null || _a === void 0 ? void 0 : _a.nodeValue; });
|
|
30
|
+
var combinedString = '';
|
|
31
|
+
var result = [];
|
|
32
|
+
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
|
|
33
|
+
var value = values_1[_i];
|
|
34
|
+
if ((combinedString + value).length > 300) {
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
combinedString += (combinedString ? ', ' : '') + value;
|
|
38
|
+
result.push(value);
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
31
41
|
};
|
|
32
42
|
export var getProductsPrices = function (isPF) { return ({
|
|
33
43
|
refinBoaVista: isPF ? 1.2 : 2.7,
|
|
@@ -15,15 +15,15 @@ import { formatMoney } from '../../utils/number';
|
|
|
15
15
|
import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
16
16
|
import AddItemField from '../common/addItem';
|
|
17
17
|
import { ConsultasComplementaresContext } from '../consultasComplementares';
|
|
18
|
-
import Header from '../interface/header';
|
|
19
18
|
import { Result, ResultContent } from '../interface/result';
|
|
20
19
|
import StatusMessage from '../interface/statusMessage';
|
|
21
|
-
import {
|
|
20
|
+
import { Section } from '../section';
|
|
21
|
+
import { RequestStatus, useQuery } from '../webservice';
|
|
22
22
|
var ConsultaImoveis = function (_a) {
|
|
23
23
|
var _b, _c, _d, _e, _f;
|
|
24
24
|
var documento = _a.documento;
|
|
25
25
|
var consultasComplementaresContext = useContext(ConsultasComplementaresContext);
|
|
26
|
-
var _g = useQuery("SELECT FROM 'IMOVEIS'.'CONSULTA'", { documento: documento }, !!((_c = (_b = consultasComplementaresContext === null || consultasComplementaresContext === void 0 ? void 0 : consultasComplementaresContext.consultasComplementares) === null || _b === void 0 ? void 0 : _b.imoveis) === null || _c === void 0 ? void 0 : _c.consultaRealizada)), response = _g.response, isLoading = _g.isLoading, error = _g.error;
|
|
26
|
+
var _g = useQuery("SELECT FROM 'IMOVEIS'.'CONSULTA'", { documento: documento }, !!((_c = (_b = consultasComplementaresContext === null || consultasComplementaresContext === void 0 ? void 0 : consultasComplementaresContext.consultasComplementares) === null || _b === void 0 ? void 0 : _b.imoveis) === null || _c === void 0 ? void 0 : _c.consultaRealizada)), response = _g.response, isLoading = _g.isLoading, error = _g.error, loadingProgress = _g.loadingProgress;
|
|
27
27
|
var setData = useGlobalData().setData;
|
|
28
28
|
var _h = useState(false), dataUpdated = _h[0], setDataUpdated = _h[1];
|
|
29
29
|
var iptus = ((_d = response === null || response === void 0 ? void 0 : response.document) === null || _d === void 0 ? void 0 : _d.IPTUS) || [];
|
|
@@ -34,11 +34,6 @@ var ConsultaImoveis = function (_a) {
|
|
|
34
34
|
}, [
|
|
35
35
|
(_f = (_e = consultasComplementaresContext === null || consultasComplementaresContext === void 0 ? void 0 : consultasComplementaresContext.consultasComplementares) === null || _e === void 0 ? void 0 : _e.imoveis) === null || _f === void 0 ? void 0 : _f.consultaRealizada
|
|
36
36
|
]);
|
|
37
|
-
var description = error
|
|
38
|
-
? 'Erro ao consultar IPTUs. Tente mais tarde.'
|
|
39
|
-
: iptus.length > 0
|
|
40
|
-
? "Foram encontrados ".concat(iptus.length, " registros de IPTU")
|
|
41
|
-
: 'Nenhum registro de IPTU encontrado para o documento informado.';
|
|
42
37
|
useEffect(function () {
|
|
43
38
|
var _a;
|
|
44
39
|
(_a = consultaImoveisRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
@@ -46,10 +41,22 @@ var ConsultaImoveis = function (_a) {
|
|
|
46
41
|
setData(function (prevState) { return (__assign(__assign({}, prevState), { imoveis: response.document })); });
|
|
47
42
|
setDataUpdated(true);
|
|
48
43
|
}
|
|
49
|
-
}, [response]);
|
|
50
|
-
return consultaImoveisRealizada ? (React.createElement(
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
}, [response, dataUpdated, setData]);
|
|
45
|
+
return consultaImoveisRealizada ? (React.createElement(Section, { ctx: {
|
|
46
|
+
type: isLoading
|
|
47
|
+
? RequestStatus.Loading
|
|
48
|
+
: error
|
|
49
|
+
? RequestStatus.Error
|
|
50
|
+
: RequestStatus.Success,
|
|
51
|
+
error: error || null,
|
|
52
|
+
response: undefined,
|
|
53
|
+
document: iptus,
|
|
54
|
+
refetch: function () { },
|
|
55
|
+
Section: Section,
|
|
56
|
+
progress: loadingProgress
|
|
57
|
+
}, title: "Consulta de IPTU", subtitle: "Registros de IPTU para o documento informado", icon: ImoveisIcon, description: !error && (React.createElement(StatusMessage, { type: iptus.length ? 'success' : 'default' }, iptus.length > 0
|
|
58
|
+
? "Foram encontrados ".concat(iptus.length, " registros de IPTU")
|
|
59
|
+
: 'Nenhum registro de IPTU encontrado para o documento informado.')), onSuccess: function () { return (React.createElement(Result, null, iptus.map(function (iptu, index) {
|
|
53
60
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
54
61
|
return (React.createElement(ResultContent, { key: index, desktop: "repeat(5, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr 1fr" },
|
|
55
62
|
React.createElement(AddItemField, { name: "Endere\u00E7o", value: iptu.ENDERECO }),
|
|
@@ -64,6 +71,12 @@ var ConsultaImoveis = function (_a) {
|
|
|
64
71
|
React.createElement(AddItemField, { name: "Ano de Constru\u00E7\u00E3o", value: String(iptu.ANO) }),
|
|
65
72
|
React.createElement(AddItemField, { name: "Valor do IPTU", value: formatMoney((_f = iptu.VALOR) === null || _f === void 0 ? void 0 : _f.IPTU) }),
|
|
66
73
|
React.createElement(AddItemField, { name: "Valor do Im\u00F3vel", value: formatMoney((_g = iptu.VALOR) === null || _g === void 0 ? void 0 : _g.CONSTRUCAO) })));
|
|
67
|
-
})))
|
|
74
|
+
}))); }, isError: function (err) { return ({
|
|
75
|
+
children: React.createElement(React.Fragment, null),
|
|
76
|
+
description: (React.createElement(StatusMessage, { type: "error" },
|
|
77
|
+
"Erro ao realizar a consulta: ",
|
|
78
|
+
err.message)),
|
|
79
|
+
variant: 'error'
|
|
80
|
+
}); } })) : null;
|
|
68
81
|
};
|
|
69
82
|
export default ConsultaImoveis;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { IconProps } from '@/@types/icon';
|
|
2
|
-
import React, {
|
|
3
|
-
import LoadingBar from './loadingBar';
|
|
2
|
+
import React, { ComponentType, DetailedHTMLProps, HTMLAttributes, ReactNode } from 'react';
|
|
4
3
|
export type HeaderProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLElement> & {
|
|
5
4
|
title?: ReactNode;
|
|
6
5
|
subtitle?: ReactNode;
|
|
7
6
|
description?: ReactNode;
|
|
8
7
|
actions?: ReactNode;
|
|
9
8
|
className?: string;
|
|
10
|
-
loadingProps?:
|
|
9
|
+
loadingProps?: {
|
|
10
|
+
percentage?: number;
|
|
11
|
+
activeRequests?: number;
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
showLoadingBar?: boolean;
|
|
14
|
+
};
|
|
11
15
|
icon?: ComponentType<IconProps>;
|
|
12
16
|
iconProps?: IconProps;
|
|
13
17
|
titleClassName?: string;
|
|
@@ -72,15 +72,19 @@ var Description = styled.div(templateObject_3 || (templateObject_3 = __makeTempl
|
|
|
72
72
|
});
|
|
73
73
|
var HeaderUI = styled(function (_a) {
|
|
74
74
|
var children = _a.children, props = __rest(_a, ["children"]);
|
|
75
|
-
return
|
|
75
|
+
return React.createElement("header", __assign({}, props), children);
|
|
76
76
|
})(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\n @media print {\n page-break-before: avoid;\n page-break-after: avoid;\n page-break-inside: avoid;\n padding: 18px;\n print-color-adjust: exact;\n background: #eae9e9;\n border-radius: 18px;\n }\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\n @media print {\n page-break-before: avoid;\n page-break-after: avoid;\n page-break-inside: avoid;\n padding: 18px;\n print-color-adjust: exact;\n background: #eae9e9;\n border-radius: 18px;\n }\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; });
|
|
77
77
|
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"])));
|
|
78
78
|
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"])));
|
|
79
79
|
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"])));
|
|
80
80
|
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"])));
|
|
81
|
+
var LoadingBarWrapper = styled.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n width: 100%;\n max-width: 300px;\n height: 10px;\n opacity: ", ";\n transition: opacity 0.3s ease;\n"], ["\n width: 100%;\n max-width: 300px;\n height: 10px;\n opacity: ", ";\n transition: opacity 0.3s ease;\n"])), function (_a) {
|
|
82
|
+
var hidden = _a.hidden;
|
|
83
|
+
return (hidden ? 0 : 1);
|
|
84
|
+
});
|
|
81
85
|
var Header = function (_a) {
|
|
82
|
-
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,
|
|
83
|
-
var theme = useTheme();
|
|
86
|
+
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, _c = _a.loadingProps, loadingProps = _c === void 0 ? {} : _c, className = _a.className, titleClassName = _a.titleClassName, subtitleClassName = _a.subtitleClassName, descriptionClassName = _a.descriptionClassName, containerClassName = _a.containerClassName, actionsClassName = _a.actionsClassName, innerRef = _a.innerRef, _d = _a.printBar, printBar = _d === void 0 ? true : _d, props = __rest(_a, ["title", "subtitle", "description", "actions", "icon", "variant", "iconProps", "loadingProps", "className", "titleClassName", "subtitleClassName", "descriptionClassName", "containerClassName", "actionsClassName", "innerRef", "printBar"]);
|
|
87
|
+
var theme = useTheme();
|
|
84
88
|
var headerClass = classNames(className);
|
|
85
89
|
var actionsClass = classNames(actionsClassName);
|
|
86
90
|
var containerClass = classNames(containerClassName);
|
|
@@ -95,7 +99,8 @@ var Header = function (_a) {
|
|
|
95
99
|
React.createElement("div", { className: "text-wrapper-subtitle-description" },
|
|
96
100
|
React.createElement(Subtitle, { hidden: isLoading || !subtitle, className: subtitleClassName }, subtitle),
|
|
97
101
|
React.createElement(Description, { hidden: isLoading || !description, className: descriptionClassName }, description)),
|
|
98
|
-
React.createElement(
|
|
102
|
+
React.createElement(LoadingBarWrapper, { hidden: !isLoading },
|
|
103
|
+
React.createElement(LoadingBar, { percentage: (loadingProps === null || loadingProps === void 0 ? void 0 : loadingProps.percentage) || 0 })))),
|
|
99
104
|
React.createElement(ActionsList, { className: actionsClass }, actions && actions))));
|
|
100
105
|
};
|
|
101
106
|
var getVariantColor = function (type, theme) {
|
|
@@ -108,4 +113,4 @@ var getVariantColor = function (type, theme) {
|
|
|
108
113
|
return options[type];
|
|
109
114
|
};
|
|
110
115
|
export default Header;
|
|
111
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
116
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -26,23 +26,23 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
26
26
|
};
|
|
27
27
|
import React from 'react';
|
|
28
28
|
import styled from 'styled-components';
|
|
29
|
-
var GreyBar = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width:
|
|
29
|
+
var GreyBar = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 18.75rem;\n height: 0.625rem;\n background-color: ", ";\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n visibility: ", ";\n\n @media (max-width: 600px) {\n width: 12.5rem;\n }\n\n @media (max-width: 400px) {\n width: 9.375rem;\n }\n"], ["\n width: 18.75rem;\n height: 0.625rem;\n background-color: ", ";\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n visibility: ", ";\n\n @media (max-width: 600px) {\n width: 12.5rem;\n }\n\n @media (max-width: 400px) {\n width: 9.375rem;\n }\n"])), function (_a) {
|
|
30
30
|
var theme = _a.theme;
|
|
31
31
|
return theme.colors.cinzaClaro;
|
|
32
|
-
});
|
|
33
|
-
var BlueBar = styled(GreyBar)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n width: ", ";\n background-color: ", ";\n"], ["\n display: ", ";\n width: ", ";\n background-color: ", ";\n"])), function (_a) {
|
|
34
|
-
var percentage = _a.percentage;
|
|
35
|
-
return (percentage ? 'block' : 'none');
|
|
36
32
|
}, function (_a) {
|
|
33
|
+
var hidden = _a.hidden;
|
|
34
|
+
return hidden ? 'hidden' : 'visible';
|
|
35
|
+
});
|
|
36
|
+
var BlueBar = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: ", "%;\n height: 100%;\n background-color: ", ";\n border-radius: 10px;\n transition: width 0.4s ease-in-out;\n"], ["\n width: ", "%;\n height: 100%;\n background-color: ", ";\n border-radius: 10px;\n transition: width 0.4s ease-in-out;\n"])), function (_a) {
|
|
37
37
|
var percentage = _a.percentage;
|
|
38
|
-
return percentage
|
|
38
|
+
return Math.min(percentage, 100);
|
|
39
39
|
}, function (_a) {
|
|
40
40
|
var theme = _a.theme;
|
|
41
41
|
return theme.colors.azulCredithub;
|
|
42
42
|
});
|
|
43
43
|
var LoadingBar = function (_a) {
|
|
44
|
-
var _b = _a.percentage, percentage = _b === void 0 ? 0 : _b, props = __rest(_a, ["percentage"]);
|
|
45
|
-
return (React.createElement(GreyBar, __assign({}, props),
|
|
44
|
+
var _b = _a.percentage, percentage = _b === void 0 ? 0 : _b, _c = _a.hidden, hidden = _c === void 0 ? false : _c, props = __rest(_a, ["percentage", "hidden"]);
|
|
45
|
+
return (React.createElement(GreyBar, __assign({ hidden: hidden }, props),
|
|
46
46
|
React.createElement(BlueBar, { percentage: percentage })));
|
|
47
47
|
};
|
|
48
48
|
export default LoadingBar;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { RequestContext } from '../webservice';
|
|
2
3
|
import { HeaderProps } from './header';
|
|
3
4
|
export interface SectionProps extends React.PropsWithChildren<{
|
|
4
5
|
onClose?: () => void;
|
|
5
6
|
onClickPrint?: () => void;
|
|
6
7
|
minimized?: boolean;
|
|
7
8
|
contentClassName?: string;
|
|
9
|
+
ctx?: RequestContext<any>;
|
|
8
10
|
} & HeaderProps> {
|
|
9
11
|
}
|
|
10
12
|
declare const Section: React.FC<SectionProps>;
|
|
@@ -2,16 +2,17 @@ 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
|
-
import
|
|
7
|
-
import useToggle from '../../hooks/useToggle';
|
|
8
|
-
import Header from './header';
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
+
import BtnWrapper from '../../assets/btn/btnWrapper';
|
|
9
7
|
import ChevronDown from '../../assets/btn/chevronDown';
|
|
10
8
|
import ChevronUp from '../../assets/btn/chevronUp';
|
|
11
9
|
import CloseIcon from '../../assets/btn/closeIcon';
|
|
12
|
-
import BtnWrapper from '../../assets/btn/btnWrapper';
|
|
13
|
-
import styled from 'styled-components';
|
|
14
10
|
import PrintIcon from '../../assets/btn/printIcon';
|
|
11
|
+
import useToggle from '../../hooks/useToggle';
|
|
12
|
+
import classNames from 'classnames';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import styled from 'styled-components';
|
|
15
|
+
import Header from './header';
|
|
15
16
|
var SectionContaner = styled.section(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n @media screen {\n background-color: rgb(239, 239, 239);\n }\n page-break-before: avoid;\n page-break-after: avoid;\n page-break-inside: avoid;\n"], ["\n @media screen {\n background-color: rgb(239, 239, 239);\n }\n page-break-before: avoid;\n page-break-after: avoid;\n page-break-inside: avoid;\n"])));
|
|
16
17
|
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'); });
|
|
17
18
|
var Section = function (_a) {
|