@credithub/harlan-components 1.52.0 → 1.52.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.
@@ -67,7 +67,7 @@ var ChartSystem = function (_a) {
67
67
  })
68
68
  .filter(function (timestamp) { return timestamp !== null; });
69
69
  if (datasOcorrencias.length > 0) {
70
- ultimaOcorrenciaProtestos = new Date(Math.max.apply(Math, datasOcorrencias)).toLocaleDateString();
70
+ ultimaOcorrenciaProtestos = new Date(Math.max.apply(Math, datasOcorrencias)).toLocaleDateString('pt-BR');
71
71
  }
72
72
  }
73
73
  var loadingProgress = (chartDataProgress + dividasProgress) / 2;
@@ -36,7 +36,7 @@ export var useDividasPublicas = function () {
36
36
  .map(function (data) { return new Date(data).getTime(); })
37
37
  .filter(function (timestamp) { return !isNaN(timestamp); });
38
38
  var ultimaOcorrencia = datasValidas.length > 0
39
- ? new Date(Math.max.apply(Math, datasValidas)).toLocaleDateString()
39
+ ? new Date(Math.max.apply(Math, datasValidas)).toLocaleDateString('pt-BR')
40
40
  : '';
41
41
  return {
42
42
  quantidade: quantidade,
@@ -1,5 +1,5 @@
1
- import { DataInput, TimeFilter } from '../types/iChart';
2
1
  import { ChartDataset, ChartOptions } from 'chart.js';
2
+ import { DataInput, TimeFilter } from '../types/iChart';
3
3
  export declare function createDatasets(data: DataInput, uniqueDates: string[], timeFilter: TimeFilter): ChartDataset<'line' | 'bar', (number | {
4
4
  x: string;
5
5
  y: number | null;
@@ -133,11 +133,27 @@ export function getChartOptions(timeFilter) {
133
133
  type: 'time',
134
134
  time: {
135
135
  unit: unit,
136
- parser: 'yyyy-MM-dd'
136
+ parser: 'yyyy-MM-dd',
137
+ tooltipFormat: 'dd MMM yyyy',
138
+ displayFormats: {
139
+ day: 'dd MMM',
140
+ week: 'dd MMM',
141
+ month: 'MMM yyyy',
142
+ quarter: 'MMM yyyy',
143
+ year: 'yyyy'
144
+ }
137
145
  },
138
146
  title: {
139
147
  display: true,
140
148
  text: 'Data'
149
+ },
150
+ ticks: {
151
+ callback: function (value, index, values) {
152
+ return new Intl.DateTimeFormat('pt-BR', {
153
+ month: 'short',
154
+ year: 'numeric'
155
+ }).format(new Date(value));
156
+ }
141
157
  }
142
158
  }
143
159
  },
@@ -14,7 +14,7 @@ export var useCalculation = function (itens, dataKey) {
14
14
  .map(function (data) { return new Date(data).getTime(); })
15
15
  .filter(function (timestamp) { return !isNaN(timestamp); });
16
16
  return datas.length
17
- ? new Date(Math.max.apply(Math, datas)).toLocaleDateString()
17
+ ? new Date(Math.max.apply(Math, datas)).toLocaleDateString('pt-BR')
18
18
  : null;
19
19
  })();
20
20
  return { quantidade: quantidade, valorTotal: valorTotal, dataMaisRecente: dataMaisRecente };
@@ -67,7 +67,7 @@ var obterUltimaData = function (protestos) {
67
67
  .map(function (p) { return new Date(converterParaFormatoValido(p.dataProtesto)).getTime(); })
68
68
  .filter(function (d) { return !isNaN(d); });
69
69
  return datas.length
70
- ? new Date(Math.max.apply(Math, datas)).toLocaleDateString()
70
+ ? new Date(Math.max.apply(Math, datas)).toLocaleDateString('pt-BR')
71
71
  : null;
72
72
  };
73
73
  export function processProtestData(document) {
@@ -51,11 +51,11 @@ import XPathUtils from '../../../utils/xpath';
51
51
  import { useState } from 'react';
52
52
  import { getAtividadesEconomicasSecundarias, getField, getFieldRfb, getProductsPrices } from './utils';
53
53
  var useCardsAndProducts = function (_a) {
54
- var _b, _c, _d, _e, _f, _g;
54
+ var _b, _c, _d, _e, _f;
55
55
  var finderResponse = _a.finderResponse, rfbResponse = _a.rfbResponse;
56
- var _h = useState(false), isModalOpen = _h[0], setModalOpen = _h[1];
57
- var _j = useConsultasComplementares(), consultasComplementares = _j.consultasComplementares, setConsultasComplementares = _j.setConsultasComplementares, hasCredits = _j.hasCredits;
58
- var _k = useState({}), loadingButtons = _k[0], setLoadingButtons = _k[1];
56
+ var _g = useState(false), isModalOpen = _g[0], setModalOpen = _g[1];
57
+ var _h = useConsultasComplementares(), consultasComplementares = _h.consultasComplementares, setConsultasComplementares = _h.setConsultasComplementares, hasCredits = _h.hasCredits;
58
+ var _j = useState({}), loadingButtons = _j[0], setLoadingButtons = _j[1];
59
59
  var handleModalClick = function () { return setModalOpen(true); };
60
60
  var closeModal = function () { return setModalOpen(false); };
61
61
  var isPF = !!getField('cpf', finderResponse);
@@ -102,7 +102,7 @@ var useCardsAndProducts = function (_a) {
102
102
  });
103
103
  }); };
104
104
  };
105
- var _l = {
105
+ var _k = {
106
106
  cards: [
107
107
  {
108
108
  title: getField('sexo', finderResponse, function (value) {
@@ -282,16 +282,16 @@ var useCardsAndProducts = function (_a) {
282
282
  onClick: handleOnClick('refinSerasa'),
283
283
  hide: (_f = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.refinSerasa) === null || _f === void 0 ? void 0 : _f.consultaRealizada,
284
284
  isLoading: loadingButtons['refinSerasa']
285
- },
286
- {
287
- title: 'Consultar Imóveis SP Capital',
288
- price: productsPrices === null || productsPrices === void 0 ? void 0 : productsPrices.imoveis,
289
- onClick: handleOnClick('imoveis'),
290
- hide: !isPF || ((_g = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.imoveis) === null || _g === void 0 ? void 0 : _g.consultaRealizada),
291
- isLoading: loadingButtons['imoveis']
292
- }
285
+ } /*,
286
+ {
287
+ title: 'Consultar Imóveis SP Capital',
288
+ price: productsPrices?.imoveis,
289
+ onClick: handleOnClick('imoveis'),
290
+ hide: !isPF || consultasComplementares?.imoveis?.consultaRealizada,
291
+ isLoading: loadingButtons['imoveis']
292
+ }*/
293
293
  ]
294
- }, cards = _l.cards, products = _l.products;
294
+ }, cards = _k.cards, products = _k.products;
295
295
  return { cards: cards, products: products, isModalOpen: isModalOpen, closeModal: closeModal };
296
296
  };
297
297
  export default useCardsAndProducts;