@credithub/harlan-components 1.29.0 → 1.30.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.
|
@@ -51,7 +51,7 @@ var ChartSystem = function (_a) {
|
|
|
51
51
|
useEffect(function () {
|
|
52
52
|
if (consultaPefinBoaVista || consultaPefinSerasa)
|
|
53
53
|
refetch();
|
|
54
|
-
}, [consultaPefinBoaVista, consultaPefinSerasa]);
|
|
54
|
+
}, [consultaPefinBoaVista, consultaPefinSerasa, refetch]);
|
|
55
55
|
return (React.createElement(PrintSectionWrapper, null,
|
|
56
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)) }),
|
|
57
57
|
React.createElement(Content, { isOpen: isOpen },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Queries, RequestStatus, useQuery } from '../../../components/webservice';
|
|
2
|
+
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { processData, processProtestData } from '../utils/dataProcessing';
|
|
4
4
|
var useChartData = function (documento) {
|
|
5
5
|
var _a = useState(null), data = _a[0], setData = _a[1];
|
|
@@ -35,7 +35,7 @@ var useChartData = function (documento) {
|
|
|
35
35
|
if (liveQueriesIsFinish) {
|
|
36
36
|
refetch();
|
|
37
37
|
}
|
|
38
|
-
}, [liveQueriesIsFinish]);
|
|
38
|
+
}, [liveQueriesIsFinish, refetch]);
|
|
39
39
|
useEffect(function () {
|
|
40
40
|
if (!isLoading &&
|
|
41
41
|
!queryError &&
|
|
@@ -57,7 +57,8 @@ var useChartData = function (documento) {
|
|
|
57
57
|
response,
|
|
58
58
|
queryError,
|
|
59
59
|
liveQueriesIsFinish,
|
|
60
|
-
quantidadeProcessosJuridicos
|
|
60
|
+
quantidadeProcessosJuridicos,
|
|
61
|
+
dadosProtestos
|
|
61
62
|
]);
|
|
62
63
|
return { data: data, isLoading: isLoading, error: errorState || queryError, refetch: refetch };
|
|
63
64
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
1
|
import { useWindowSize } from '../../../hooks/useWindowSize';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
3
|
export var usePieChartData = function (dataInput) {
|
|
4
4
|
var width = useWindowSize().width;
|
|
5
5
|
return useMemo(function () {
|
|
6
6
|
var _a;
|
|
7
|
-
var getLastValue = function (arr) { var _a; return arr.length > 0 ? (_a = arr[arr.length - 1].quantidade) !== null && _a !== void 0 ? _a : 0 : 0; };
|
|
7
|
+
var getLastValue = function (arr) { var _a; return arr.length > 0 ? ((_a = arr[arr.length - 1].quantidade) !== null && _a !== void 0 ? _a : 0) : 0; };
|
|
8
8
|
var totalProtestos = getLastValue(dataInput.protestos);
|
|
9
9
|
var totalCCFs = getLastValue(dataInput.ccfs);
|
|
10
10
|
var totalSerasa = getLastValue(dataInput.serasa);
|
|
@@ -85,5 +85,5 @@ export var usePieChartData = function (dataInput) {
|
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
return { data: chartData, options: options };
|
|
88
|
-
}, [dataInput]);
|
|
88
|
+
}, [dataInput, width]);
|
|
89
89
|
};
|
package/dist/consultaSimples.js
CHANGED
|
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { Chart, registerables } from 'chart.js';
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import styled from 'styled-components';
|
|
7
|
+
import styled, { ThemeProvider } from 'styled-components';
|
|
8
8
|
import { Addresses, BankAccounts, CCF, ChartSystem, Contacts, DividasPublicas, Dossie, Partners, ProcessosJuridicos, Protestos, Queries, RefinBoaVista, RefinSerasa, Veiculos, WebServiceProvider } from './';
|
|
9
9
|
import { ConsultaRfbProvider } from './components/consultaRfb';
|
|
10
10
|
import ConsultaSimplesSection from './components/consultaSimplesSection/consultaSimplesSection';
|
|
@@ -12,6 +12,7 @@ import { ConsultasComplementaresProvider } from './components/consultasComplemen
|
|
|
12
12
|
import Dominios from './components/dominios/dominios';
|
|
13
13
|
import ConsultaImoveis from './components/imoveis/imoveisService';
|
|
14
14
|
import GlobalStyle from './components/interface/globalStyle';
|
|
15
|
+
import theme from './components/interface/theme';
|
|
15
16
|
import Liminar from './components/liminar/liminar';
|
|
16
17
|
import ConsultaScore from './components/score/scoreService';
|
|
17
18
|
import ConsultaSCR from './components/scr/scr';
|
|
@@ -21,8 +22,7 @@ var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateO
|
|
|
21
22
|
var ConsultaSimples = function (_a) {
|
|
22
23
|
var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits, _b = _a.initRefinBoaVista, initRefinBoaVista = _b === void 0 ? false : _b, _c = _a.initRefinSerasa, initRefinSerasa = _c === void 0 ? false : _c, _d = _a.initVeiculos, initVeiculos = _d === void 0 ? false : _d;
|
|
23
24
|
var documento = _documento.replace(/\D+/g, '');
|
|
24
|
-
return (React.createElement(
|
|
25
|
-
React.createElement(GlobalStyle, null),
|
|
25
|
+
return (React.createElement(ThemeProvider, { theme: theme },
|
|
26
26
|
React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits, initRefinBoaVista: initRefinBoaVista, initRefinSerasa: initRefinSerasa, initVeiculos: initVeiculos },
|
|
27
27
|
React.createElement(WebServiceProvider, { credential: apiKey },
|
|
28
28
|
React.createElement(Queries.Dominios.Request, { data: { documento: documento, cnpj: documento } },
|
|
@@ -53,7 +53,8 @@ var ConsultaSimples = function (_a) {
|
|
|
53
53
|
React.createElement(Protestos, null),
|
|
54
54
|
React.createElement(CCF, null),
|
|
55
55
|
React.createElement(DividasPublicas, null),
|
|
56
|
-
React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico }))))))))))))
|
|
56
|
+
React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico })))))))))))),
|
|
57
|
+
React.createElement(GlobalStyle, null)));
|
|
57
58
|
};
|
|
58
59
|
export default ConsultaSimples;
|
|
59
60
|
var templateObject_1;
|