@credithub/harlan-components 1.60.0 → 1.60.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.
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import ProtestosIcon from '../../assets/icones/protestos';
13
13
  import { useGlobalData } from '../../contexts/globalDataContext';
14
- import { normalizeName, similarNames } from '../../utils/similarNames';
14
+ import { normalizeName, similarProcessos } from '../../utils/similarNames';
15
15
  import React, { useContext, useEffect, useMemo, useRef } from 'react';
16
16
  import StatusMessage from '../interface/statusMessage';
17
17
  import Section from '../section';
@@ -56,7 +56,8 @@ var Liminar = function () {
56
56
  useEffect(function () {
57
57
  var _a, _b, _c;
58
58
  // Skip processing if we don't have the necessary data
59
- if (!((_a = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _a === void 0 ? void 0 : _a.carousel) || !((_b = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _b === void 0 ? void 0 : _b.isLoaded)) {
59
+ if (!((_a = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _a === void 0 ? void 0 : _a.carousel) ||
60
+ !((_b = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _b === void 0 ? void 0 : _b.isLoaded)) {
60
61
  return;
61
62
  }
62
63
  // Skip if we're still loading
@@ -88,14 +89,14 @@ var Liminar = function () {
88
89
  var _a;
89
90
  var hasAtivoEnvolvido = (_a = processo.envolvidos_ultima_movimentacao) === null || _a === void 0 ? void 0 : _a.some(function (envolvido) {
90
91
  return envolvido.envolvido_tipo === 'Ativo' &&
91
- similarNames(normalizeName(envolvido.nome_sem_filtro), empresaNomeNormalizado);
92
+ similarProcessos(normalizeName(envolvido.nome_sem_filtro), empresaNomeNormalizado);
92
93
  });
93
94
  var assuntos = Array.isArray(processo.assuntos)
94
95
  ? processo.assuntos
95
96
  : [processo.assuntos];
96
97
  var hasValidAssunto = assuntos.some(function (assunto) {
97
98
  return validAssuntos.some(function (valid) {
98
- return similarNames(normalizeName(assunto), valid);
99
+ return similarProcessos(normalizeName(assunto), valid);
99
100
  });
100
101
  });
101
102
  return hasAtivoEnvolvido && hasValidAssunto;
@@ -106,7 +107,9 @@ var Liminar = function () {
106
107
  }
107
108
  // Determine final status
108
109
  var isSuccess = ctx.type === RequestStatus.Success || isProcessoNaoEncontrado;
109
- var indiciosDeLiminar = isSuccess ? ((_c = ctx.document) === null || _c === void 0 ? void 0 : _c.indiciosDeLiminar) === true : false;
110
+ var indiciosDeLiminar = isSuccess
111
+ ? ((_c = ctx.document) === null || _c === void 0 ? void 0 : _c.indiciosDeLiminar) === true
112
+ : false;
110
113
  var finalStatus = indiciosDeLiminar || (processosAtivo && processosAtivo.length > 0)
111
114
  ? 'Encontrado'
112
115
  : 'Não encontrado';
@@ -136,7 +139,8 @@ var Liminar = function () {
136
139
  return null;
137
140
  return (React.createElement(Section, { title: "Liminares para Remo\u00E7\u00E3o de Protesto", subtitle: processingRef.current
138
141
  ? 'Carregando liminar...'
139
- : 'Indícios de liminares para ocultação de registros.', icon: ProtestosIcon, ctx: processingRef.current ? __assign(__assign({}, ctx), { type: RequestStatus.Loading }) : derivedCtx, onSuccess: processingRef.current
142
+ : 'Indícios de liminares para ocultação de registros.', icon: ProtestosIcon, ctx: processingRef.current
143
+ ? __assign(__assign({}, ctx), { type: RequestStatus.Loading }) : derivedCtx, onSuccess: processingRef.current
140
144
  ? undefined
141
145
  : function (data, context) {
142
146
  var _a;
@@ -18,7 +18,8 @@ import { GlobalDataProvider } from './contexts/globalDataContext';
18
18
  import GlobalStyle from './styles/globalStyle';
19
19
  import theme from './styles/theme';
20
20
  Chart.register.apply(Chart, registerables);
21
- 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\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\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"])));
21
+ var ConsultaSimplesContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:not(:last-child) {\n margin-bottom: 20px;\n }\n"], ["\n &:not(:last-child) {\n margin-bottom: 20px;\n }\n"])));
22
+ var Wrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 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\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"])));
22
23
  var FinderDependency = function (_a) {
23
24
  var children = _a.children, documento = _a.documento;
24
25
  var ctxFinder = useContext(Queries.Finder);
@@ -28,39 +29,40 @@ var FinderDependency = function (_a) {
28
29
  var ConsultaSimples = function (_a) {
29
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
31
  var documento = _documento.replace(/\D+/g, '');
31
- return (React.createElement(ThemeProvider, { theme: theme },
32
- React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits, initRefinBoaVista: initRefinBoaVista, initRefinSerasa: initRefinSerasa, initVeiculos: initVeiculos },
33
- React.createElement(WebServiceProvider, { credential: apiKey },
34
- React.createElement(Queries.Dominios.Request, { data: { documento: documento, cnpj: documento } },
35
- React.createElement(Queries.Finder.Request, { data: { documento: documento } },
36
- React.createElement(FinderDependency, { documento: documento },
37
- React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
38
- React.createElement(Queries.Liminar.Request, { data: { documento: documento } },
39
- React.createElement(Queries.LiminarCenprot.Request, { data: { documento: documento } },
40
- React.createElement(Wrapper, null,
41
- React.createElement(GlobalDataProvider, null,
42
- React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint },
43
- React.createElement(ConsultaRfbProvider, { documento: documento },
44
- React.createElement(Dossie, { documento: documento, printMode: printMode }),
45
- React.createElement(Liminar, null),
46
- React.createElement(Addresses, { apiKey: apiKey }),
47
- React.createElement(Contacts, null),
48
- React.createElement(Partners, { onClickQSA: onClickQSA })),
49
- React.createElement(Dominios, null),
50
- React.createElement(BankAccounts, null),
51
- React.createElement(Queries.GraficosAnaliticos.Request, { data: { documento: documento } },
52
- React.createElement(ChartSystem, { documento: documento }),
53
- React.createElement(ConsultaSCR, { documento: documento }),
54
- React.createElement(RefinBoaVista, { documento: documento }),
55
- React.createElement(RefinSerasa, { documento: documento }),
56
- React.createElement(ConsultaScore, { documento: documento }),
57
- React.createElement(ConsultaImoveis, { documento: documento }),
58
- React.createElement(Veiculos, { documento: documento })),
59
- React.createElement(Protestos, null),
60
- React.createElement(CCF, null),
61
- React.createElement(DividasPublicas, null),
62
- React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico })))))))))))),
63
- React.createElement(GlobalStyle, null)));
32
+ return (React.createElement(ConsultaSimplesContainer, null,
33
+ React.createElement(ThemeProvider, { theme: theme },
34
+ React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits, initRefinBoaVista: initRefinBoaVista, initRefinSerasa: initRefinSerasa, initVeiculos: initVeiculos },
35
+ React.createElement(WebServiceProvider, { credential: apiKey },
36
+ React.createElement(Queries.Dominios.Request, { data: { documento: documento, cnpj: documento } },
37
+ React.createElement(Queries.Finder.Request, { data: { documento: documento } },
38
+ React.createElement(FinderDependency, { documento: documento },
39
+ React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
40
+ React.createElement(Queries.Liminar.Request, { data: { documento: documento } },
41
+ React.createElement(Queries.LiminarCenprot.Request, { data: { documento: documento } },
42
+ React.createElement(Wrapper, null,
43
+ React.createElement(GlobalDataProvider, null,
44
+ React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint },
45
+ React.createElement(ConsultaRfbProvider, { documento: documento },
46
+ React.createElement(Dossie, { documento: documento, printMode: printMode }),
47
+ React.createElement(Liminar, null),
48
+ React.createElement(Addresses, { apiKey: apiKey }),
49
+ React.createElement(Contacts, null),
50
+ React.createElement(Partners, { onClickQSA: onClickQSA })),
51
+ React.createElement(Dominios, null),
52
+ React.createElement(BankAccounts, null),
53
+ React.createElement(Queries.GraficosAnaliticos.Request, { data: { documento: documento } },
54
+ React.createElement(ChartSystem, { documento: documento }),
55
+ React.createElement(ConsultaSCR, { documento: documento }),
56
+ React.createElement(RefinBoaVista, { documento: documento }),
57
+ React.createElement(RefinSerasa, { documento: documento }),
58
+ React.createElement(ConsultaScore, { documento: documento }),
59
+ React.createElement(ConsultaImoveis, { documento: documento }),
60
+ React.createElement(Veiculos, { documento: documento })),
61
+ React.createElement(Protestos, null),
62
+ React.createElement(CCF, null),
63
+ React.createElement(DividasPublicas, null),
64
+ React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico })))))))))))),
65
+ React.createElement(GlobalStyle, null))));
64
66
  };
65
67
  export default ConsultaSimples;
66
- var templateObject_1;
68
+ var templateObject_1, templateObject_2;
@@ -1,2 +1,3 @@
1
1
  export declare const normalizeName: (name: string) => string;
2
2
  export declare const similarNames: (name1: string, name2: string) => boolean;
3
+ export declare const similarProcessos: (name1: string, name2: string) => boolean;
@@ -12,3 +12,7 @@ export var similarNames = function (name1, name2) {
12
12
  var similarity = stringSimilarity.compareTwoStrings(name1, name2);
13
13
  return similarity >= 0.5;
14
14
  };
15
+ export var similarProcessos = function (name1, name2) {
16
+ var similarity = stringSimilarity.compareTwoStrings(name1, name2);
17
+ return similarity >= 0.8;
18
+ };