@credithub/harlan-components 1.65.1 → 1.66.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.
|
@@ -54,6 +54,32 @@ var Liminar = function () {
|
|
|
54
54
|
}
|
|
55
55
|
return [];
|
|
56
56
|
}, [ctx.document]);
|
|
57
|
+
var processosComAssuntoValido = useMemo(function () {
|
|
58
|
+
var _a, _b, _c;
|
|
59
|
+
var carouselName = ((_b = (_a = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _a === void 0 ? void 0 : _a.carousel) === null || _b === void 0 ? void 0 : _b.name) || '';
|
|
60
|
+
var empresas = (_c = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _c === void 0 ? void 0 : _c.empresa;
|
|
61
|
+
var nomeEmpresaNorm = normalizeName(carouselName);
|
|
62
|
+
if (!Array.isArray(empresas))
|
|
63
|
+
return [];
|
|
64
|
+
return empresas.filter(function (processo) {
|
|
65
|
+
var _a;
|
|
66
|
+
var ativoMatch = (_a = processo.envolvidos_ultima_movimentacao) === null || _a === void 0 ? void 0 : _a.some(function (e) {
|
|
67
|
+
return e.envolvido_tipo === 'Ativo' &&
|
|
68
|
+
similarNames(normalizeName(e.nome_sem_filtro), nomeEmpresaNorm, 0.9);
|
|
69
|
+
});
|
|
70
|
+
if (!ativoMatch)
|
|
71
|
+
return false;
|
|
72
|
+
var assuntos = Array.isArray(processo.assuntos)
|
|
73
|
+
? processo.assuntos
|
|
74
|
+
: [processo.assuntos];
|
|
75
|
+
return assuntos.some(function (a) {
|
|
76
|
+
return validAssuntos.includes(normalizeName(a));
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}, [
|
|
80
|
+
(_a = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _a === void 0 ? void 0 : _a.carousel,
|
|
81
|
+
(_b = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _b === void 0 ? void 0 : _b.empresa
|
|
82
|
+
]);
|
|
57
83
|
var mapTipoToLabel = function (tipo) {
|
|
58
84
|
switch (tipo) {
|
|
59
85
|
case 'cenprot':
|
|
@@ -66,9 +92,8 @@ var Liminar = function () {
|
|
|
66
92
|
return null;
|
|
67
93
|
}
|
|
68
94
|
};
|
|
69
|
-
// Detecta origens de liminar: tipos + processos
|
|
70
95
|
var origensDetectadas = useMemo(function () {
|
|
71
|
-
var _a
|
|
96
|
+
var _a;
|
|
72
97
|
var labels = new Set();
|
|
73
98
|
var indiciosApi = ((_a = ctx.document) === null || _a === void 0 ? void 0 : _a.indiciosDeLiminar) === true;
|
|
74
99
|
if (indiciosApi) {
|
|
@@ -78,53 +103,25 @@ var Liminar = function () {
|
|
|
78
103
|
labels.add(label);
|
|
79
104
|
});
|
|
80
105
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (carouselName && Array.isArray(empresas)) {
|
|
85
|
-
var nomeEmpresaNorm_1 = normalizeName(carouselName);
|
|
86
|
-
var hasJudicial = empresas.some(function (processo) {
|
|
106
|
+
if (processosComAssuntoValido.length > 0) {
|
|
107
|
+
labels.add('Liminar no Judiciário');
|
|
108
|
+
var foundBusinessEntity = processosComAssuntoValido.some(function (processo) {
|
|
87
109
|
var _a;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return false;
|
|
94
|
-
var assuntos = Array.isArray(processo.assuntos)
|
|
95
|
-
? processo.assuntos
|
|
96
|
-
: [processo.assuntos];
|
|
97
|
-
return assuntos.some(function (a) {
|
|
98
|
-
return validAssuntos.includes(normalizeName(a));
|
|
110
|
+
return (_a = processo.envolvidos_ultima_movimentacao) === null || _a === void 0 ? void 0 : _a.some(function (e) {
|
|
111
|
+
if (e.envolvido_tipo !== 'Ativo')
|
|
112
|
+
return false;
|
|
113
|
+
var nomeNorm = normalizeName(e.nome_sem_filtro);
|
|
114
|
+
return businessTypes.some(function (type) { return nomeNorm.includes(type); });
|
|
99
115
|
});
|
|
100
116
|
});
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
var foundBusinessEntity = empresas.some(function (processo) {
|
|
104
|
-
var _a;
|
|
105
|
-
return (_a = processo.envolvidos_ultima_movimentacao) === null || _a === void 0 ? void 0 : _a.some(function (e) {
|
|
106
|
-
if (e.envolvido_tipo !== 'Ativo')
|
|
107
|
-
return false;
|
|
108
|
-
var nomeNorm = normalizeName(e.nome_sem_filtro);
|
|
109
|
-
return businessTypes.some(function (type) { return nomeNorm.includes(type); });
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
if (foundBusinessEntity) {
|
|
113
|
-
setShowInversionInfo(true);
|
|
114
|
-
}
|
|
117
|
+
if (foundBusinessEntity) {
|
|
118
|
+
setShowInversionInfo(true);
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
return Array.from(labels);
|
|
118
|
-
}, [
|
|
119
|
-
ctx.document,
|
|
120
|
-
tiposDocumento,
|
|
121
|
-
(_a = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _a === void 0 ? void 0 : _a.carousel,
|
|
122
|
-
(_b = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _b === void 0 ? void 0 : _b.empresa
|
|
123
|
-
]);
|
|
124
|
-
// Indica se houve erro 404 (processo não encontrado)
|
|
122
|
+
}, [ctx.document, tiposDocumento, processosComAssuntoValido]);
|
|
125
123
|
var isErro404 = useMemo(function () { return ctx.type === RequestStatus.Error && !!ctx.error; }, [ctx.type, ctx.error]);
|
|
126
124
|
var derivedCtx = useMemo(function () { return (__assign(__assign({}, ctx), { type: isErro404 ? RequestStatus.Success : ctx.type, document: isErro404 ? { indiciosDeLiminar: false } : ctx.document })); }, [ctx, isErro404]);
|
|
127
|
-
// Efeito principal: atualiza estado global e resultados
|
|
128
125
|
useEffect(function () {
|
|
129
126
|
var _a, _b, _c, _d;
|
|
130
127
|
if (!((_a = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _a === void 0 ? void 0 : _a.carousel) ||
|
|
@@ -167,7 +164,14 @@ var Liminar = function () {
|
|
|
167
164
|
processingRef.current = false;
|
|
168
165
|
processedRef.current = true;
|
|
169
166
|
}, [ctx, globalData, origensDetectadas, setData, isErro404]);
|
|
170
|
-
|
|
167
|
+
var scrollToProcesso = function (id) {
|
|
168
|
+
var el = document.getElementById(id);
|
|
169
|
+
if (el) {
|
|
170
|
+
el.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
171
|
+
el.classList.add('highlighted-process');
|
|
172
|
+
setTimeout(function () { return el.classList.remove('highlighted-process'); }, 3000);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
171
175
|
if (processedRef.current && resultRef.current === 'Não encontrado') {
|
|
172
176
|
return null;
|
|
173
177
|
}
|
|
@@ -176,7 +180,18 @@ var Liminar = function () {
|
|
|
176
180
|
"Liminares para Remo\u00E7\u00E3o de Protesto",
|
|
177
181
|
showInversionInfo && (React.createElement(TooltipContainer, null,
|
|
178
182
|
React.createElement(TooltipIcon, null),
|
|
179
|
-
React.createElement(TooltipText, null,
|
|
183
|
+
React.createElement(TooltipText, null,
|
|
184
|
+
"Aten\u00E7\u00E3o: Em alguns casos, o sistema judicial pode registrar os pap\u00E9is das partes de forma invertida, dificultando a interpreta\u00E7\u00E3o direta. Por isso, utilizamos algoritmos internos para detectar esse padr\u00E3o com base em contexto e palavras-chave.",
|
|
185
|
+
processosComAssuntoValido.length > 0 && (React.createElement(React.Fragment, null,
|
|
186
|
+
React.createElement("br", null),
|
|
187
|
+
React.createElement("br", null),
|
|
188
|
+
"Processos com ind\u00EDcios encontrados:",
|
|
189
|
+
React.createElement("ul", { style: { marginTop: '6px', paddingLeft: '18px' } }, processosComAssuntoValido.map(function (proc, idx) { return (React.createElement("li", { key: idx, onClick: function () { return scrollToProcesso(proc.id); }, style: {
|
|
190
|
+
fontSize: '13px',
|
|
191
|
+
cursor: 'pointer',
|
|
192
|
+
textDecoration: 'underline',
|
|
193
|
+
color: '#007aff'
|
|
194
|
+
} }, proc.id)); }))))))))), subtitle: processingRef.current
|
|
180
195
|
? 'Carregando liminar...'
|
|
181
196
|
: 'Indícios de liminares para ocultação de registros.', icon: ProtestosIcon, ctx: processingRef.current
|
|
182
197
|
? __assign(__assign({}, ctx), { type: RequestStatus.Loading }) : derivedCtx, onSuccess: processingRef.current
|
|
@@ -24,13 +24,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
}
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
|
+
import { sortProcessosByDate } from '../../utils/sortProcessosByDate';
|
|
27
28
|
import React, { memo } from 'react';
|
|
28
29
|
import styled from 'styled-components';
|
|
29
30
|
import AddItem from '../common/addItem';
|
|
30
31
|
import Button from '../common/button';
|
|
31
32
|
import { Result, ResultContent } from '../interface/result';
|
|
32
33
|
import EnvolvidosList from './envolvidosList';
|
|
33
|
-
import { sortProcessosByDate } from '../../utils/sortProcessosByDate';
|
|
34
34
|
var AddProcessoJuridicoField = function (_a) {
|
|
35
35
|
var value = _a.value, props = __rest(_a, ["value"]);
|
|
36
36
|
return (React.createElement(AddItem, __assign({}, props, { value: value || 'Não Informado' })));
|
|
@@ -40,7 +40,7 @@ var ConsultarProcessoBtn = styled(Button)(templateObject_2 || (templateObject_2
|
|
|
40
40
|
var ResultWrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
|
|
41
41
|
var ProcessoJuridicoItem = memo(function (_a) {
|
|
42
42
|
var processo = _a.processo, children = _a.children;
|
|
43
|
-
return (React.createElement(ProcessoJuridicoWrapper,
|
|
43
|
+
return (React.createElement(ProcessoJuridicoWrapper, { id: processo.id },
|
|
44
44
|
React.createElement(ResultWrapper, null,
|
|
45
45
|
React.createElement(ResultContent, { fullWidth: true, desktop: "1.5fr 1.5fr repeat(3, 1fr)", tablet: "repeat(3, 1fr)" },
|
|
46
46
|
React.createElement(AddProcessoJuridicoField, { name: "N\u00FAmero CNJ", value: processo.numero_novo }),
|