@credithub/harlan-components 1.86.0 → 1.86.2
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/consultaSimplesSection/consultaSimplesSection.js +14 -17
- package/dist/components/dossie/generativeAi/generativeAi.js +7 -5
- package/dist/components/liminar/liminar.js +1 -4
- package/dist/consultaSimples.js +0 -2
- package/lib/cjs/index.js +588 -10686
- package/lib/esm/index.js +588 -10686
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ var spin = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObjec
|
|
|
39
39
|
// Componente Spinner sutil
|
|
40
40
|
var Spinner = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-left-color: #222;\n border-radius: 50%;\n width: 9px;\n height: 9px;\n animation: ", " 1s linear infinite;\n margin-right: 8px;\n display: inline-block;\n vertical-align: middle;\n"], ["\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-left-color: #222;\n border-radius: 50%;\n width: 9px;\n height: 9px;\n animation: ", " 1s linear infinite;\n margin-right: 8px;\n display: inline-block;\n vertical-align: middle;\n"])), spin);
|
|
41
41
|
var ConsultaSimplesSection = function (_a) {
|
|
42
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
42
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
43
43
|
var documento = _a.documento, children = _a.children, onClose = _a.onClose, isFinancial = _a.isFinancial, rest = __rest(_a, ["documento", "children", "onClose", "isFinancial"]);
|
|
44
44
|
var ctx = useContext(Queries.Finder);
|
|
45
45
|
var data = useGlobalData().data;
|
|
@@ -84,17 +84,18 @@ var ConsultaSimplesSection = function (_a) {
|
|
|
84
84
|
? "".concat(data.processosJuridicos, " ").concat(data.processosJuridicos === 1 ? 'Processo Jurídico' : 'Processos Jurídicos')
|
|
85
85
|
: '',
|
|
86
86
|
loaded: (_l = (_k = data.processosJuridicosData) === null || _k === void 0 ? void 0 : _k.isLoaded) !== null && _l !== void 0 ? _l : false
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
label: 'Liminar',
|
|
90
|
-
text: data.liminar &&
|
|
91
|
-
(data.liminar.totalProtestos === 'NADA CONSTA' ||
|
|
92
|
-
data.liminar.message === 'Encontrado')
|
|
93
|
-
? 'Indício de Liminar'
|
|
94
|
-
: '',
|
|
95
|
-
loaded: (_o = (_m = data.liminar) === null || _m === void 0 ? void 0 : _m.isLoaded) !== null && _o !== void 0 ? _o : false
|
|
96
87
|
}
|
|
97
|
-
|
|
88
|
+
// {
|
|
89
|
+
// label: 'Liminar',
|
|
90
|
+
// text:
|
|
91
|
+
// data.liminar &&
|
|
92
|
+
// (data.liminar.totalProtestos === 'NADA CONSTA' ||
|
|
93
|
+
// data.liminar.message === 'Encontrado')
|
|
94
|
+
// ? 'Indício de Liminar'
|
|
95
|
+
// : '',
|
|
96
|
+
// loaded: data.liminar?.isLoaded ?? false
|
|
97
|
+
// }
|
|
98
|
+
].filter(function (e) { return (e.label === 'Liminar' ? isFinancial : e); });
|
|
98
99
|
var isError = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Error;
|
|
99
100
|
var isLoading = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Loading;
|
|
100
101
|
var hasPendencias = data.ccf ||
|
|
@@ -102,12 +103,8 @@ var ConsultaSimplesSection = function (_a) {
|
|
|
102
103
|
data.dividasPublicas ||
|
|
103
104
|
data.processosJuridicos ||
|
|
104
105
|
receitaStatus ||
|
|
105
|
-
((
|
|
106
|
-
var statusType = isError
|
|
107
|
-
? 'warning'
|
|
108
|
-
: hasPendencias
|
|
109
|
-
? 'error'
|
|
110
|
-
: 'success';
|
|
106
|
+
((_m = data.liminar) === null || _m === void 0 ? void 0 : _m.message) === 'Encontrado';
|
|
107
|
+
var statusType = isError ? 'warning' : hasPendencias ? 'error' : 'success';
|
|
111
108
|
return (React.createElement(Section, __assign({ title: "Consulta Simples", subtitle: "Consulta de informa\u00E7\u00F5es do documento.", description: React.createElement(React.Fragment, null,
|
|
112
109
|
React.createElement(StatusMessage, null, format(new Date(), "dd/MM/yyyy 'às' HH:mm")),
|
|
113
110
|
React.createElement(StatusMessage, { type: "found" }, formatDocument(documento)),
|
|
@@ -65,7 +65,6 @@ import StatusMessage from '../../../components/interface/statusMessage';
|
|
|
65
65
|
import { useStreamQuery } from '../../../components/streamQuery';
|
|
66
66
|
import { useGlobalData } from '../../../contexts/globalDataContext';
|
|
67
67
|
import useToggle from '../../../hooks/useToggle';
|
|
68
|
-
import { isDocumentHistoryReady, isGlobalReady } from '../../../utils/isGlobalReady';
|
|
69
68
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
70
69
|
import ReactMarkdown from 'react-markdown';
|
|
71
70
|
import remarkGfm from 'remark-gfm';
|
|
@@ -90,11 +89,14 @@ var GenerativeAI = function (_a) {
|
|
|
90
89
|
var lastQueryRef = useRef(null);
|
|
91
90
|
var lastUserMessageRef = useRef(null);
|
|
92
91
|
var messageHistoryRef = useRef(null);
|
|
92
|
+
// const isGlobalDataReady = useMemo(() => {
|
|
93
|
+
// return isFinancial
|
|
94
|
+
// ? isGlobalReady(globalData) // clientes financeiros
|
|
95
|
+
// : isDocumentHistoryReady(globalData); // demais clientes
|
|
96
|
+
// }, [globalData, isFinancial]);
|
|
93
97
|
var isGlobalDataReady = useMemo(function () {
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
: isDocumentHistoryReady(globalData); // demais clientes
|
|
97
|
-
}, [globalData, isFinancial]);
|
|
98
|
+
return !!globalData.documentHistory; // verificação direta
|
|
99
|
+
}, [globalData]);
|
|
98
100
|
// Atualiza o payload serializado sempre que os dados globais mudarem
|
|
99
101
|
useEffect(function () {
|
|
100
102
|
if (globalData && documento && isGlobalDataReady) {
|
|
@@ -49,7 +49,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49
49
|
import ProtestosIcon from '../../assets/icones/protestos';
|
|
50
50
|
import { useGlobalData } from '../../contexts/globalDataContext';
|
|
51
51
|
import theme from '../../styles/theme';
|
|
52
|
-
import { isDocumentHistoryReady } from '../../utils/isGlobalReady';
|
|
53
52
|
import { formatMoney } from '../../utils/number';
|
|
54
53
|
import { normalizeName, normalizeNameStrong, similarCompanyNames } from '../../utils/similarNames';
|
|
55
54
|
import { hasOneOfTags } from '../../utils/tags';
|
|
@@ -181,10 +180,9 @@ var Liminar = function (_a) {
|
|
|
181
180
|
processosComAssuntoValido,
|
|
182
181
|
(_f = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _f === void 0 ? void 0 : _f.indiciosDeLiminarProtestosDoPassado
|
|
183
182
|
]), origensDetectadas = _w.origensDetectadas, foundBusinessEntity = _w.foundBusinessEntity;
|
|
184
|
-
var documentHistoryReady = useMemo(function () { return isDocumentHistoryReady(globalData); }, [globalData]);
|
|
185
183
|
var protestosIsReady = useMemo(function () { var _a; return (_a = globalData === null || globalData === void 0 ? void 0 : globalData.protestosData) === null || _a === void 0 ? void 0 : _a.isLoaded; }, [globalData]);
|
|
186
184
|
useEffect(function () {
|
|
187
|
-
if (!
|
|
185
|
+
if (!protestosIsReady)
|
|
188
186
|
return;
|
|
189
187
|
var fetch = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
190
188
|
var dossie, processosJuridicos, depsLoaded, newIds, hash, indiciosApi, indiciosDeLiminarProtestosDoPassado, protestosDoPassadoIds, _a, possuiIndiciosDeLiminarProtestosDoPassado, protestosIds, finalStatus, descricaoLiminar;
|
|
@@ -258,7 +256,6 @@ var Liminar = function (_a) {
|
|
|
258
256
|
ctx.document,
|
|
259
257
|
globalData === null || globalData === void 0 ? void 0 : globalData.dossie,
|
|
260
258
|
globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData,
|
|
261
|
-
globalData === null || globalData === void 0 ? void 0 : globalData.documentHistory,
|
|
262
259
|
processosComAssuntoValido,
|
|
263
260
|
setData,
|
|
264
261
|
foundBusinessEntity
|
package/dist/consultaSimples.js
CHANGED
|
@@ -11,7 +11,6 @@ import ConsultaSimplesSection from './components/consultaSimplesSection/consulta
|
|
|
11
11
|
import { ConsultasComplementaresProvider } from './components/consultasComplementares';
|
|
12
12
|
import Dominios from './components/dominios/dominios';
|
|
13
13
|
import ConsultaImoveis from './components/imoveis/imoveisService';
|
|
14
|
-
import Liminar from './components/liminar/liminar';
|
|
15
14
|
import ProtestosSP from './components/protestos/protestosSp';
|
|
16
15
|
import ConsultaScore from './components/score/scoreService';
|
|
17
16
|
import ConsultaScoreSerasa from './components/scoreSerasa/scoreSerasa';
|
|
@@ -73,7 +72,6 @@ var ConsultaSimples = function (_a) {
|
|
|
73
72
|
React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial },
|
|
74
73
|
React.createElement(ConsultaRfbProvider, { documento: documento },
|
|
75
74
|
React.createElement(Dossie, { documento: documento, printMode: printMode, isFinancial: isFinancial }),
|
|
76
|
-
React.createElement(Liminar, { isFinancial: isFinancial, hasCredits: hasCredits, tags: tags }),
|
|
77
75
|
React.createElement(Addresses, { apiKey: apiKey }),
|
|
78
76
|
React.createElement(Contacts, null),
|
|
79
77
|
React.createElement(Partners, { onClickQSA: onClickQSA })),
|