@credithub/harlan-components 1.37.6 → 1.37.7
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/imoveis/imoveisService.js +6 -2
- package/dist/components/refinBoaVista/refinBoaVista.js +11 -2
- package/dist/components/refinSerasa/refinSerasa.js +6 -4
- package/dist/components/score/scoreService.js +7 -5
- package/dist/components/scr/scr.js +7 -9
- package/dist/components/veiculos/veiculos.js +6 -4
- package/dist/components/webservice.js +2 -2
- package/lib/cjs/index.js +46 -29
- package/lib/esm/index.js +46 -29
- package/package.json +1 -1
|
@@ -37,11 +37,15 @@ var ConsultaImoveis = function (_a) {
|
|
|
37
37
|
useEffect(function () {
|
|
38
38
|
var _a;
|
|
39
39
|
(_a = consultaImoveisRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
40
|
-
|
|
40
|
+
}, [consultaImoveisRealizada]);
|
|
41
|
+
useEffect(function () {
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = consultaImoveisRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
44
|
+
if (!consultaImoveisRealizada && response && !dataUpdated) {
|
|
41
45
|
setData(function (prevState) { return (__assign(__assign({}, prevState), { imoveis: response.document })); });
|
|
42
46
|
setDataUpdated(true);
|
|
43
47
|
}
|
|
44
|
-
}, [response, dataUpdated, setData]);
|
|
48
|
+
}, [response, dataUpdated, setData, consultaImoveisRealizada]);
|
|
45
49
|
return consultaImoveisRealizada ? (React.createElement(Section, { ctx: {
|
|
46
50
|
type: isLoading
|
|
47
51
|
? RequestStatus.Loading
|
|
@@ -42,7 +42,10 @@ function useRefinBoaVista(documento) {
|
|
|
42
42
|
return [];
|
|
43
43
|
}, [response]);
|
|
44
44
|
useEffect(function () {
|
|
45
|
-
|
|
45
|
+
var _a;
|
|
46
|
+
if (!((_a = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.refinBoaVista) === null || _a === void 0 ? void 0 : _a.consultaRealizada) &&
|
|
47
|
+
!dataUpdated &&
|
|
48
|
+
(response === null || response === void 0 ? void 0 : response.document)) {
|
|
46
49
|
var refinBoaVistaData_1 = {
|
|
47
50
|
refinBoaVistaData: response.document
|
|
48
51
|
};
|
|
@@ -50,7 +53,13 @@ function useRefinBoaVista(documento) {
|
|
|
50
53
|
setData(function (prevState) { return (__assign(__assign({}, prevState), { refinBoaVista: refinBoaVistaData_1 })); });
|
|
51
54
|
setDataUpdated(true);
|
|
52
55
|
}
|
|
53
|
-
}, [
|
|
56
|
+
}, [
|
|
57
|
+
response,
|
|
58
|
+
dataUpdated,
|
|
59
|
+
setData,
|
|
60
|
+
setConsultasComplementares,
|
|
61
|
+
consultasComplementares
|
|
62
|
+
]);
|
|
54
63
|
return {
|
|
55
64
|
isLoading: isLoading,
|
|
56
65
|
error: error,
|
|
@@ -58,17 +58,19 @@ var RefinSerasa = function (_a) {
|
|
|
58
58
|
(_a = refinSerasaRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
59
59
|
}, [consultaRefinRealizada]);
|
|
60
60
|
useEffect(function () {
|
|
61
|
-
|
|
61
|
+
if (!consultaRefinRealizada &&
|
|
62
|
+
!dataUpdated &&
|
|
63
|
+
response &&
|
|
64
|
+
response.document) {
|
|
62
65
|
setConsultasComplementares &&
|
|
63
|
-
|
|
64
|
-
if (response && !dataUpdated) {
|
|
66
|
+
setConsultasComplementares(function (prev) { return (__assign(__assign({}, prev), { refinSerasa: __assign(__assign({}, prev.refinSerasa), { data: response }) })); });
|
|
65
67
|
var refinSerasaData_1 = {
|
|
66
68
|
refinSerasaData: response.document
|
|
67
69
|
};
|
|
68
70
|
setData(function (prevState) { return (__assign(__assign({}, prevState), { refinSerasa: refinSerasaData_1 })); });
|
|
69
71
|
setDataUpdated(true);
|
|
70
72
|
}
|
|
71
|
-
}, [response, dataUpdated, setData]);
|
|
73
|
+
}, [response, consultaRefinRealizada, dataUpdated, setData]);
|
|
72
74
|
var totalPendencias = useMemo(function () { return pendencias.length; }, [pendencias]);
|
|
73
75
|
var valorTotalPendencias = useMemo(function () {
|
|
74
76
|
return pendencias.reduce(function (acc, curr) {
|
|
@@ -39,15 +39,17 @@ var ConsultaScore = function (_a) {
|
|
|
39
39
|
useEffect(function () {
|
|
40
40
|
var _a;
|
|
41
41
|
(_a = scoreRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
!dataUpdated
|
|
42
|
+
}, [consultaRefinRealizada]);
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
if (!consultaRefinRealizada &&
|
|
45
|
+
!dataUpdated &&
|
|
46
|
+
response &&
|
|
47
|
+
response.document) {
|
|
46
48
|
var scoreData_1 = { scoreData: response.document.score };
|
|
47
49
|
setData(function (prevState) { return (__assign(__assign({}, prevState), { score: scoreData_1 })); });
|
|
48
50
|
setDataUpdated(true);
|
|
49
51
|
}
|
|
50
|
-
}, [
|
|
52
|
+
}, [response, consultaRefinRealizada, dataUpdated, setData]);
|
|
51
53
|
return consultaRefinRealizada ? (React.createElement(Section, { ctx: {
|
|
52
54
|
type: isLoading
|
|
53
55
|
? RequestStatus.Loading
|
|
@@ -64,21 +64,19 @@ function ConsultaSCR(_a) {
|
|
|
64
64
|
(_a = scrRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
65
65
|
}, [consultaSCRRealizada]);
|
|
66
66
|
useEffect(function () {
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
response.document.ns2getResumoDoClienteResponse.return &&
|
|
74
|
-
!dataUpdated) {
|
|
67
|
+
if (!consultaSCRRealizada &&
|
|
68
|
+
!dataUpdated &&
|
|
69
|
+
response &&
|
|
70
|
+
response.document) {
|
|
71
|
+
setConsultasComplementares &&
|
|
72
|
+
setConsultasComplementares(function (prev) { return (__assign(__assign({}, prev), { scr: __assign(__assign({}, prev.scr), { data: response }) })); });
|
|
75
73
|
var scrData_1 = {
|
|
76
74
|
scrData: response.document.ns2getResumoDoClienteResponse.return
|
|
77
75
|
};
|
|
78
76
|
setData(function (prevState) { return (__assign(__assign({}, prevState), { scr: scrData_1 })); });
|
|
79
77
|
setDataUpdated(true);
|
|
80
78
|
}
|
|
81
|
-
}, [response, dataUpdated, setData]);
|
|
79
|
+
}, [response, consultaSCRRealizada, dataUpdated, setData]);
|
|
82
80
|
return consultaSCRRealizada ? (React.createElement(Section, { ctx: {
|
|
83
81
|
type: isLoading
|
|
84
82
|
? RequestStatus.Loading
|
|
@@ -54,15 +54,17 @@ var Veiculos = function (_a) {
|
|
|
54
54
|
(_a = veiculosRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
|
|
55
55
|
}, [consultaVeiculosRealizada]);
|
|
56
56
|
useEffect(function () {
|
|
57
|
-
|
|
57
|
+
if (!consultaVeiculosRealizada &&
|
|
58
|
+
!dataUpdated &&
|
|
59
|
+
response &&
|
|
60
|
+
response.document) {
|
|
58
61
|
setConsultasComplementares &&
|
|
59
|
-
|
|
60
|
-
if (response && response.document && !dataUpdated) {
|
|
62
|
+
setConsultasComplementares(function (prev) { return (__assign(__assign({}, prev), { veiculos: __assign(__assign({}, prev.veiculos), { data: response }) })); });
|
|
61
63
|
var veiculosData_1 = { veiculosData: registros };
|
|
62
64
|
setData(function (prevState) { return (__assign(__assign({}, prevState), { veiculos: veiculosData_1 })); });
|
|
63
65
|
setDataUpdated(true);
|
|
64
66
|
}
|
|
65
|
-
}, [response, dataUpdated, setData]);
|
|
67
|
+
}, [response, consultaVeiculosRealizada, dataUpdated, setData]);
|
|
66
68
|
if (!consultaVeiculosRealizada)
|
|
67
69
|
return null;
|
|
68
70
|
var description = registros.length
|
|
@@ -170,7 +170,7 @@ export function useQuery(query, data, enabled) {
|
|
|
170
170
|
return function () { return clearInterval(interval); };
|
|
171
171
|
}, []);
|
|
172
172
|
var fetch = useCallback(function () {
|
|
173
|
-
if (!shouldFetch)
|
|
173
|
+
if (!shouldFetch || isLoading || response)
|
|
174
174
|
return;
|
|
175
175
|
setIsLoading(true);
|
|
176
176
|
simulateProgress();
|
|
@@ -201,7 +201,7 @@ export function useQuery(query, data, enabled) {
|
|
|
201
201
|
setShouldFetch(false);
|
|
202
202
|
});
|
|
203
203
|
return function () { return abortController.abort(); };
|
|
204
|
-
}, [shouldFetch, client, query, data, simulateProgress]);
|
|
204
|
+
}, [shouldFetch, isLoading, response, client, query, data, simulateProgress]);
|
|
205
205
|
useEffect(function () {
|
|
206
206
|
if (enabled && !isLoading && !shouldFetch && !response && !error) {
|
|
207
207
|
setShouldFetch(true);
|