@credithub/harlan-components 1.36.2 → 1.36.8

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.
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
13
  function verb(n) { return function (v) { return step([n, v]); }; }
14
14
  function step(op) {
15
15
  if (f) throw new TypeError("Generator is already executing.");
@@ -71,7 +71,7 @@ var DividasPublicas = function () {
71
71
  ? totalOcorrencias === 1
72
72
  ? 'Encontrada uma dívida pública'
73
73
  : "".concat(totalOcorrencias, " d\u00EDvidas encontradas")
74
- : 'Nenhuma dívida pública encontrada'))
74
+ : 'Não há ocorrência de dívida pública'))
75
75
  };
76
76
  } }));
77
77
  };
@@ -14,14 +14,17 @@ var Link = styled.a(templateObject_1 || (templateObject_1 = __makeTemplateObject
14
14
  var Dominios = function () {
15
15
  var ctx = useContext(Queries.Dominios);
16
16
  return (React.createElement(Section, { ctx: ctx, title: "Dom\u00EDnios na Internet", subtitle: "Informa\u00E7\u00F5es de dom\u00EDnios na internet.", icon: DominiosIcon, onSuccess: function (document) {
17
+ var children = document.length ? (React.createElement(Result, { resultContentStriped: false },
18
+ React.createElement(ResultContent, { desktop: "1fr 1fr 1fr", tablet: "1fr 1fr", mobile: "1fr 1fr" }, document.map(function (data, key) { return (React.createElement(AddItemField, { key: key, name: "Dom\u00EDnio", value: React.createElement(Link, { href: "https://www.".concat(data), target: "_blank", rel: "noreferrer" }, data) })); })))) : null;
19
+ console.log(document === null || document === void 0 ? void 0 : document.length);
20
+ var description = (React.createElement(StatusMessage, { type: (document === null || document === void 0 ? void 0 : document.length) ? 'success' : 'default' }, document.length
21
+ ? document.length === 1
22
+ ? 'Foi encontrado 1 registro de domínio'
23
+ : "Foram encontrados ".concat(document.length, " registros de dom\u00EDnios.")
24
+ : 'Não foram encontrados registros de domínios.'));
17
25
  return {
18
- children: document.length ? (React.createElement(Result, { resultContentStriped: false }, document.map(function (data) { return (React.createElement(ResultContent, { desktop: "1fr 1fr 1fr", tablet: "1fr 1fr", mobile: "1fr 1fr", key: data },
19
- React.createElement(AddItemField, { name: "Dom\u00EDnio", value: React.createElement(Link, { href: "https://www.".concat(data), target: "_blank", rel: "noreferrer" }, data) }))); }))) : null,
20
- description: (React.createElement(StatusMessage, { type: (document === null || document === void 0 ? void 0 : document.length) ? 'success' : 'default' }, document.length
21
- ? (document === null || document === void 0 ? void 0 : document.length) === 1
22
- ? 'Foi encontrado 1 registro de domínio'
23
- : "Foram encontrados ".concat(document === null || document === void 0 ? void 0 : document.length, " registros de dom\u00EDnios.")
24
- : 'Não foram encontrados registros de domínios.'))
26
+ children: children,
27
+ description: description
25
28
  };
26
29
  } }));
27
30
  };
@@ -19,8 +19,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
19
  });
20
20
  };
21
21
  var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
24
  function verb(n) { return function (v) { return step([n, v]); }; }
25
25
  function step(op) {
26
26
  if (f) throw new TypeError("Generator is already executing.");
@@ -30,6 +30,16 @@ import { Queries, RequestStatus } from '../webservice';
30
30
  import ProtestosCategory from './protestosCategory';
31
31
  import { ProtestoItem } from './protestosList';
32
32
  var ResultProtestos = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n row-gap: 20px;\n margin-top: 20px;\n"], ["\n display: flex;\n flex-direction: column;\n row-gap: 20px;\n margin-top: 20px;\n"])));
33
+ var byDate = function (protesto, protesto2) {
34
+ var _a, _b;
35
+ var v0 = ((_a = formatDatePtBrToDate(XPathUtils.select('string(./dataProtesto)', protesto2))) === null || _a === void 0 ? void 0 : _a.getTime()) || 0;
36
+ var v1 = ((_b = formatDatePtBrToDate(XPathUtils.select('string(./dataProtesto)', protesto))) === null || _b === void 0 ? void 0 : _b.getTime()) || 0;
37
+ if (v0 > v1)
38
+ return 1;
39
+ if (v0 < v1)
40
+ return -1;
41
+ return 0;
42
+ };
33
43
  var Protestos = function () {
34
44
  var ctx = useContext(Queries.Protestos);
35
45
  var setData = useGlobalData().setData;
@@ -39,11 +49,6 @@ var Protestos = function () {
39
49
  return;
40
50
  }
41
51
  var data = ctx.document;
42
- var byDate = function (protesto, protesto2) {
43
- var _a, _b;
44
- return (((_a = formatDatePtBrToDate(XPathUtils.select('string(./dataProtesto)', protesto2))) === null || _a === void 0 ? void 0 : _a.getTime()) || 0) -
45
- (((_b = formatDatePtBrToDate(XPathUtils.select('string(./dataProtesto)', protesto))) === null || _b === void 0 ? void 0 : _b.getTime()) || 0);
46
- };
47
52
  var registrosText = XPathUtils.select('string(//registros)', data);
48
53
  var registros = extractIntegerFromText(registrosText);
49
54
  var filterProtestos = function (regex, data) {
@@ -86,15 +91,21 @@ var Protestos = function () {
86
91
  var elements = [
87
92
  {
88
93
  total: protestosDeCredito.length,
89
- element: (React.createElement(ProtestosCategory, { title: "Protestos de Cr\u00E9dito", subtitle: "Protestos de cr\u00E9dito em geral.", registros: protestosDeCredito.length, icon: ProtestosCreditoIcon }, protestosDeCredito.map(function (protesto, i) { return (React.createElement(ProtestoItem, { protesto: protesto, key: i })); })))
94
+ element: (React.createElement(ProtestosCategory, { title: "Protestos de Cr\u00E9dito", subtitle: "Protestos de cr\u00E9dito em geral.", registros: protestosDeCredito.length, icon: ProtestosCreditoIcon }, protestosDeCredito
95
+ .sort(byDate)
96
+ .map(function (protesto, i) { return (React.createElement(ProtestoItem, { protesto: protesto, key: i })); })))
90
97
  },
91
98
  {
92
99
  total: protestosDeImposto.length,
93
- element: (React.createElement(ProtestosCategory, { title: "Protestos de Imposto", subtitle: "Protestos de impostos federais, estaduais e municipais.", registros: protestosDeImposto.length, icon: ProtestosImpostosIcon }, protestosDeImposto.map(function (protestoElement, index) { return (React.createElement(ProtestoItem, { protesto: protestoElement, key: index })); })))
100
+ element: (React.createElement(ProtestosCategory, { title: "Protestos de Imposto", subtitle: "Protestos de impostos federais, estaduais e municipais.", registros: protestosDeImposto.length, icon: ProtestosImpostosIcon }, protestosDeImposto
101
+ .sort(byDate)
102
+ .map(function (protestoElement, index) { return (React.createElement(ProtestoItem, { protesto: protestoElement, key: index })); })))
94
103
  },
95
104
  {
96
105
  total: protestosGerais.length,
97
- element: (React.createElement(ProtestosCategory, { title: "Protestos Gerais", subtitle: "Protestos de outros tipos.", registros: protestosGerais.length, icon: ProtestosGeraisIcon }, protestosGerais.map(function (protestoElement, index) { return (React.createElement(ProtestoItem, { protesto: protestoElement, key: index })); })))
106
+ element: (React.createElement(ProtestosCategory, { title: "Protestos Gerais", subtitle: "Protestos de outros tipos.", registros: protestosGerais.length, icon: ProtestosGeraisIcon }, protestosGerais
107
+ .sort(byDate)
108
+ .map(function (protestoElement, index) { return (React.createElement(ProtestoItem, { protesto: protestoElement, key: index })); })))
98
109
  }
99
110
  ].sort(function (a, b) { return b.total - a.total; });
100
111
  var children = registros ? (React.createElement(ResultProtestos, null, elements.map(function (_a) {
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
13
  function verb(n) { return function (v) { return step([n, v]); }; }
14
14
  function step(op) {
15
15
  if (f) throw new TypeError("Generator is already executing.");
@@ -69,7 +69,7 @@ function RefinBoaVista(_a) {
69
69
  }, [consultaRealizada]);
70
70
  var description = pendencias.length
71
71
  ? "Foram encontrados ".concat(pendencias.length, " ocorr\u00EAncias")
72
- : 'Nenhuma ocorrência encontrada';
72
+ : 'Não ocorrência de Pefin/Refin Boa Vista';
73
73
  if (!consultaRealizada)
74
74
  return null;
75
75
  return (React.createElement(Section, { ctx: {
@@ -78,7 +78,7 @@ var RefinSerasa = function (_a) {
78
78
  }, [pendencias]);
79
79
  var description = useMemo(function () {
80
80
  if (totalPendencias === 0) {
81
- return 'Nenhuma ocorrência encontrada';
81
+ return 'Não ocorrência de Pefin/Refin Serasa';
82
82
  }
83
83
  return totalPendencias === 1
84
84
  ? "Foi encontrada 1 ocorr\u00EAncia no valor de ".concat(formatMoney(valorTotalPendencias))
@@ -96,7 +96,7 @@ var RefinSerasa = function (_a) {
96
96
  refetch: function () { },
97
97
  Section: Section,
98
98
  progress: loadingProgress
99
- }, title: "Pefin/Refin e Contratos Vencidos Serasa", subtitle: "Confira as Pend\u00EAncias Financeiras deste documento", icon: PefinRefinSerasaIcon, description: !error && (React.createElement(StatusMessage, { type: totalPendencias === 0 ? 'success' : 'error' }, description)), variant: totalPendencias === 0 ? 'default' : 'error', onSuccess: function () { return (React.createElement(Result, null, pendencias.map(function (pendencia, i) { return (React.createElement(ResultContent, { key: i, desktop: "repeat(5, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr 1fr" },
99
+ }, title: "Pefin/Refin e Contratos Vencidos Serasa", subtitle: "Confira as Pend\u00EAncias Financeiras deste documento", icon: PefinRefinSerasaIcon, description: !error && (React.createElement(StatusMessage, { type: totalPendencias === 0 ? 'default' : 'error' }, description)), variant: totalPendencias === 0 ? 'default' : 'error', onSuccess: function () { return (React.createElement(Result, null, pendencias.map(function (pendencia, i) { return (React.createElement(ResultContent, { key: i, desktop: "repeat(5, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr 1fr" },
100
100
  React.createElement(AddItemField, { name: "Tipo de Ocorr\u00EAncia", value: pendencia.ocorrencia }),
101
101
  React.createElement(AddItemField, { name: "Credor", value: pendencia.credor }),
102
102
  React.createElement(AddItemField, { name: "Data de Entrada", value: pendencia.entrada }),
@@ -35,7 +35,7 @@ var ConsultaScore = function (_a) {
35
35
  ]);
36
36
  var description = scoreData
37
37
  ? "Score: ".concat(scoreData.score)
38
- : 'Nenhuma informação de score disponível para este documento.';
38
+ : 'Não informação de score disponível para este documento.';
39
39
  useEffect(function () {
40
40
  var _a;
41
41
  (_a = scoreRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
@@ -58,7 +58,7 @@ function ConsultaSCR(_a) {
58
58
  var resumoDeCreditos = (scr && getResumoDeCreditos(scr)) || [];
59
59
  var description = scr
60
60
  ? 'Resumo do Cliente'
61
- : 'Nenhuma informação disponível para este documento.';
61
+ : 'Não informação disponível para este documento.';
62
62
  useEffect(function () {
63
63
  var _a;
64
64
  (_a = scrRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView();
package/dist/server.js CHANGED
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
13
  function verb(n) { return function (v) { return step([n, v]); }; }
14
14
  function step(op) {
15
15
  if (f) throw new TypeError("Generator is already executing.");
@@ -13,6 +13,8 @@ export function converterParaFormatoValido(data) {
13
13
  return "".concat(mes, "/").concat(dia, "/").concat(ano);
14
14
  }
15
15
  export function formatDatePtBrToDate(date) {
16
- var _a, _b;
17
- return new Date((_b = (_a = date === null || date === void 0 ? void 0 : date.split('/')) === null || _a === void 0 ? void 0 : _a.reverse()) === null || _b === void 0 ? void 0 : _b.join('-'));
16
+ var _a;
17
+ var x = (_a = date === null || date === void 0 ? void 0 : date.split('/')) === null || _a === void 0 ? void 0 : _a.reverse();
18
+ var b = x === null || x === void 0 ? void 0 : x.join('-');
19
+ return new Date(b);
18
20
  }