@credithub/harlan-components 1.75.5 → 1.76.1
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.
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
interface LiminarProps {
|
|
3
|
+
/**
|
|
4
|
+
* Se verdadeiro, exibe ações exclusivas para instituições financeiras,
|
|
5
|
+
* como o download de protestos ocultos.
|
|
6
|
+
*/
|
|
7
|
+
isFinancial?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const Liminar: React.FC<LiminarProps>;
|
|
3
10
|
export default Liminar;
|
|
@@ -79,21 +79,22 @@ var businessTypes = [
|
|
|
79
79
|
'banco',
|
|
80
80
|
'cooperativa'
|
|
81
81
|
];
|
|
82
|
-
var Liminar = function () {
|
|
83
|
-
var
|
|
82
|
+
var Liminar = function (_a) {
|
|
83
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
84
|
+
var _o = _a.isFinancial, isFinancial = _o === void 0 ? false : _o;
|
|
84
85
|
var ctx = useContext(Queries.LiminarCenprot);
|
|
85
|
-
var
|
|
86
|
+
var _p = useGlobalData(), globalData = _p.data, setData = _p.setData;
|
|
86
87
|
var fetchLiminarProtestosDoPassado = useLiminarProtestosDoPassado({
|
|
87
|
-
documento: ((
|
|
88
|
+
documento: ((_c = (_b = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _b === void 0 ? void 0 : _b.carousel) === null || _c === void 0 ? void 0 : _c.document) || ''
|
|
88
89
|
}).fetchLiminarProtestosDoPassado;
|
|
89
|
-
var
|
|
90
|
+
var _q = useState(false), isLoadingLiminarProtestosDoPassado = _q[0], setIsLoadingLiminarProtestosDoPassado = _q[1];
|
|
90
91
|
var processedRef = useRef(false);
|
|
91
92
|
var dataHashRef = useRef('');
|
|
92
93
|
var invertedIdsRef = useRef([]);
|
|
93
|
-
var
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
-
var
|
|
94
|
+
var _r = useState(false), isTooltipVisible = _r[0], setTooltipVisible = _r[1];
|
|
95
|
+
var _s = useState(false), isEmailModalOpen = _s[0], setIsEmailModalOpen = _s[1];
|
|
96
|
+
var _t = useState(''), emailModalMessage = _t[0], setEmailModalMessage = _t[1];
|
|
97
|
+
var _u = useFetch("SELECT FROM 'LIMINAR'.'SENDMAIL'"), sendIndiciosEmail = _u.fetch, isEmailSending = _u.isLoading, emailError = _u.error;
|
|
97
98
|
var hideTt = useRef();
|
|
98
99
|
/*
|
|
99
100
|
* Extrai e normaliza os tipos de documento presentes em ctx.document, retornando sempre um array de strings em minúsculo.
|
|
@@ -131,13 +132,13 @@ var Liminar = function () {
|
|
|
131
132
|
});
|
|
132
133
|
});
|
|
133
134
|
}, [
|
|
134
|
-
(
|
|
135
|
-
(
|
|
135
|
+
(_d = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _d === void 0 ? void 0 : _d.carousel,
|
|
136
|
+
(_e = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _e === void 0 ? void 0 : _e.empresa
|
|
136
137
|
]);
|
|
137
138
|
/*
|
|
138
139
|
* Identifica as origens de liminares detectadas e verifica se existe liminar de protesto invertida
|
|
139
140
|
*/
|
|
140
|
-
var
|
|
141
|
+
var _v = useMemo(function () {
|
|
141
142
|
var _a, _b;
|
|
142
143
|
var labels = new Set();
|
|
143
144
|
var indiciosApi = ((_a = ctx.document) === null || _a === void 0 ? void 0 : _a.indiciosDeLiminar) === true;
|
|
@@ -172,8 +173,8 @@ var Liminar = function () {
|
|
|
172
173
|
ctx.document,
|
|
173
174
|
tiposDocumento,
|
|
174
175
|
processosComAssuntoValido,
|
|
175
|
-
(
|
|
176
|
-
]), origensDetectadas =
|
|
176
|
+
(_f = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _f === void 0 ? void 0 : _f.indiciosDeLiminarProtestosDoPassado
|
|
177
|
+
]), origensDetectadas = _v.origensDetectadas, foundBusinessEntity = _v.foundBusinessEntity;
|
|
177
178
|
useEffect(function () {
|
|
178
179
|
var fetch = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
179
180
|
var dossie, processosJuridicos, depsLoaded, newIds, hash, indiciosApi, indiciosDeLiminarProtestosDoPassado, protestosDoPassadoIds, _a, possuiIndiciosDeLiminarProtestosDoPassado, protestosIds, finalStatus;
|
|
@@ -249,8 +250,8 @@ var Liminar = function () {
|
|
|
249
250
|
foundBusinessEntity
|
|
250
251
|
]);
|
|
251
252
|
var ready = processedRef.current &&
|
|
252
|
-
!!((
|
|
253
|
-
!!((
|
|
253
|
+
!!((_g = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _g === void 0 ? void 0 : _g.isLoaded) &&
|
|
254
|
+
!!((_h = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _h === void 0 ? void 0 : _h.carousel) &&
|
|
254
255
|
!isLoadingLiminarProtestosDoPassado &&
|
|
255
256
|
ctx.type !== RequestStatus.Loading;
|
|
256
257
|
var ctxLoading = useMemo(function () { return (__assign(__assign({}, ctx), { type: RequestStatus.Loading })); }, [ctx]);
|
|
@@ -270,8 +271,8 @@ var Liminar = function () {
|
|
|
270
271
|
: 'Processos com indícios encontrados:';
|
|
271
272
|
var shouldRender = isLoadingLiminarProtestosDoPassado ||
|
|
272
273
|
(ready &&
|
|
273
|
-
(((
|
|
274
|
-
((
|
|
274
|
+
(((_j = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _j === void 0 ? void 0 : _j.indiciosDeLiminar) ||
|
|
275
|
+
((_m = (_l = (_k = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _k === void 0 ? void 0 : _k.processosComLiminarIds) === null || _l === void 0 ? void 0 : _l.length) !== null && _m !== void 0 ? _m : 0) > 0));
|
|
275
276
|
// Função para disparar o envio do e-mail e configurar a mensagem do modal
|
|
276
277
|
var handleSendEmailIndicios = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
277
278
|
var documento, ids;
|
|
@@ -328,8 +329,9 @@ var Liminar = function () {
|
|
|
328
329
|
description: (React.createElement(React.Fragment, null,
|
|
329
330
|
React.createElement(StatusMessage, { type: variant }, msg),
|
|
330
331
|
origensDetectadas.map(function (o) { return (React.createElement(StatusMessage, { key: o, type: variant }, o)); }))),
|
|
331
|
-
actions: (React.createElement("div", { style: { textAlign: 'center' }, onClick: function (e) { return e.stopPropagation(); } },
|
|
332
|
-
((
|
|
332
|
+
actions: (React.createElement("div", { style: { textAlign: 'center' }, onClick: function (e) { return e.stopPropagation(); } }, isFinancial &&
|
|
333
|
+
((_c = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _c === void 0 ? void 0 : _c.indiciosDeLiminarProtestosDoPassado) &&
|
|
334
|
+
((_d = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _d === void 0 ? void 0 : _d.protestosDoPassadoIds) && (React.createElement(Button, { onClick: handleSendEmailIndicios, disabled: isEmailSending }, "Baixar Protestos Ocultos"))))
|
|
333
335
|
};
|
|
334
336
|
}
|
|
335
337
|
: undefined }),
|
package/dist/consultaSimples.js
CHANGED
|
@@ -13,11 +13,11 @@ import Dominios from './components/dominios/dominios';
|
|
|
13
13
|
import ConsultaImoveis from './components/imoveis/imoveisService';
|
|
14
14
|
import Liminar from './components/liminar/liminar';
|
|
15
15
|
import ConsultaScore from './components/score/scoreService';
|
|
16
|
+
import ConsultaScoreSerasa from './components/scoreSerasa/scoreSerasa';
|
|
16
17
|
import ConsultaSCR from './components/scr/scr';
|
|
17
18
|
import { GlobalDataProvider } from './contexts/globalDataContext';
|
|
18
19
|
import GlobalStyle from './styles/globalStyle';
|
|
19
20
|
import theme from './styles/theme';
|
|
20
|
-
import ConsultaScoreSerasa from './components/scoreSerasa/scoreSerasa';
|
|
21
21
|
Chart.register.apply(Chart, registerables);
|
|
22
22
|
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 margin-bottom: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 5mm;\n }\n }\n"], ["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n margin-bottom: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 5mm;\n }\n }\n"])));
|
|
23
23
|
var FinderDependency = function (_a) {
|
|
@@ -27,7 +27,7 @@ var FinderDependency = function (_a) {
|
|
|
27
27
|
React.createElement(Queries.Protestos.Request, { data: { documento: documento }, depends: [ctxFinder] }, children)));
|
|
28
28
|
};
|
|
29
29
|
var ConsultaSimples = function (_a) {
|
|
30
|
-
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, _e = _a.printMode, printMode = _e === void 0 ? false : _e;
|
|
30
|
+
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, _e = _a.printMode, printMode = _e === void 0 ? false : _e, _f = _a.isFinancial, isFinancial = _f === void 0 ? false : _f;
|
|
31
31
|
var documento = _documento.replace(/\D+/g, '');
|
|
32
32
|
return (React.createElement(ThemeProvider, { theme: theme },
|
|
33
33
|
React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits, initRefinBoaVista: initRefinBoaVista, initRefinSerasa: initRefinSerasa, initVeiculos: initVeiculos },
|
|
@@ -43,7 +43,7 @@ var ConsultaSimples = function (_a) {
|
|
|
43
43
|
React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint },
|
|
44
44
|
React.createElement(ConsultaRfbProvider, { documento: documento },
|
|
45
45
|
React.createElement(Dossie, { documento: documento, printMode: printMode }),
|
|
46
|
-
React.createElement(Liminar,
|
|
46
|
+
React.createElement(Liminar, { isFinancial: isFinancial }),
|
|
47
47
|
React.createElement(Addresses, { apiKey: apiKey }),
|
|
48
48
|
React.createElement(Contacts, null),
|
|
49
49
|
React.createElement(Partners, { onClickQSA: onClickQSA })),
|