@credithub/harlan-components 1.18.0 → 1.18.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.
package/lib/cjs/index.js CHANGED
@@ -47721,7 +47721,8 @@ var QuantityContainer = function (_a) {
47721
47721
  };
47722
47722
  var QuantidadeResultadosWrapper = styled(ResultContent)(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject$8(["\n padding: 18px 20px;\n row-gap: 20px;\n > * {\n row-gap: 10px;\n }\n @media only screen and (max-width: 768px) {\n > * {\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n }\n }\n"], ["\n padding: 18px 20px;\n row-gap: 20px;\n > * {\n row-gap: 10px;\n }\n @media only screen and (max-width: 768px) {\n > * {\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n }\n }\n"])), theme.colors.cinzaClaro);
47723
47723
  var QuantidadeResultados = function (_a) {
47724
- var _b = _a.quantidadeProtestos, quantidadeProtestos = _b === void 0 ? 0 : _b, _c = _a.quantidadeProcessos, quantidadeProcessos = _c === void 0 ? 0 : _c, _d = _a.quantidadeDividas, quantidadeDividas = _d === void 0 ? 0 : _d, _e = _a.quantidadeChequesSemFundos, quantidadeChequesSemFundos = _e === void 0 ? 0 : _e, _f = _a.quantidadeDividasSerasa, quantidadeDividasSerasa = _f === void 0 ? 0 : _f, _g = _a.quantidadeDividasBoaVista, quantidadeDividasBoaVista = _g === void 0 ? 0 : _g, _h = _a.valorTotalProtestos, valorTotalProtestos = _h === void 0 ? 0 : _h, _j = _a.valorTotalDividas, valorTotalDividas = _j === void 0 ? 0 : _j, _k = _a.valorTotalDividasSerasa, valorTotalDividasSerasa = _k === void 0 ? 0 : _k, _l = _a.valorTotalDividasBoaVista, valorTotalDividasBoaVista = _l === void 0 ? 0 : _l, _m = _a.ultimaOcorrenciaProtestos, ultimaOcorrenciaProtestos = _m === void 0 ? null : _m, _o = _a.ultimaOcorrenciaChequesSemFundos, ultimaOcorrenciaChequesSemFundos = _o === void 0 ? null : _o;
47724
+ var _b, _c, _d, _e;
47725
+ var data = _a.data, _f = _a.quantidadeProtestos, quantidadeProtestos = _f === void 0 ? 0 : _f, _g = _a.quantidadeProcessos, quantidadeProcessos = _g === void 0 ? 0 : _g, _h = _a.quantidadeDividas, quantidadeDividas = _h === void 0 ? 0 : _h, _j = _a.quantidadeChequesSemFundos, quantidadeChequesSemFundos = _j === void 0 ? 0 : _j, _k = _a.quantidadeDividasSerasa, quantidadeDividasSerasa = _k === void 0 ? 0 : _k, _l = _a.quantidadeDividasBoaVista, quantidadeDividasBoaVista = _l === void 0 ? 0 : _l, _m = _a.valorTotalProtestos, valorTotalProtestos = _m === void 0 ? 0 : _m, _o = _a.valorTotalDividas, valorTotalDividas = _o === void 0 ? 0 : _o, _p = _a.valorTotalDividasSerasa, valorTotalDividasSerasa = _p === void 0 ? 0 : _p, _q = _a.valorTotalDividasBoaVista, valorTotalDividasBoaVista = _q === void 0 ? 0 : _q, _r = _a.ultimaOcorrenciaProtestos, ultimaOcorrenciaProtestos = _r === void 0 ? null : _r, _s = _a.ultimaOcorrenciaChequesSemFundos, ultimaOcorrenciaChequesSemFundos = _s === void 0 ? null : _s;
47725
47726
  return (React.createElement(Result, { resultContentStriped: false },
47726
47727
  React.createElement(QuantidadeResultadosWrapper, { desktop: "repeat(6, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr" },
47727
47728
  React.createElement(QuantityContainer, null,
@@ -47737,11 +47738,11 @@ var QuantidadeResultados = function (_a) {
47737
47738
  React.createElement(AddItemField, { name: "D\u00EDvidas P\u00FAblicas", value: formatValue(quantidadeDividas) }),
47738
47739
  React.createElement(AddItemField, { name: "Total D\u00EDvidas P\u00FAblicas", value: formatMoney(valorTotalDividas) })),
47739
47740
  React.createElement(QuantityContainer, null,
47740
- React.createElement(AddItemField, { name: "Pefin Refin Serasa", value: formatValue(quantidadeDividasSerasa) }),
47741
- React.createElement(AddItemField, { name: "Total Pefin Refin Serasa", value: formatMoney(valorTotalDividasSerasa) })),
47741
+ React.createElement(AddItemField, { hidden: !((_b = data === null || data === void 0 ? void 0 : data.serasa) === null || _b === void 0 ? void 0 : _b.length), name: "Pefin Refin Serasa", value: formatValue(quantidadeDividasSerasa) }),
47742
+ React.createElement(AddItemField, { hidden: !((_c = data === null || data === void 0 ? void 0 : data.serasa) === null || _c === void 0 ? void 0 : _c.length), name: "Total Pefin Refin Serasa", value: formatMoney(valorTotalDividasSerasa) })),
47742
47743
  React.createElement(QuantityContainer, null,
47743
- React.createElement(AddItemField, { name: "Pefin Refin Boa Vista", value: formatValue(quantidadeDividasBoaVista) }),
47744
- React.createElement(AddItemField, { name: "Total Pefin Refin Boa Vista", value: formatMoney(valorTotalDividasBoaVista) })))));
47744
+ React.createElement(AddItemField, { hidden: !((_d = data === null || data === void 0 ? void 0 : data.boaVista) === null || _d === void 0 ? void 0 : _d.length), name: "Pefin Refin Boa Vista", value: formatValue(quantidadeDividasBoaVista) }),
47745
+ React.createElement(AddItemField, { hidden: !((_e = data === null || data === void 0 ? void 0 : data.boaVista) === null || _e === void 0 ? void 0 : _e.length), name: "Total Pefin Refin Boa Vista", value: formatMoney(valorTotalDividasBoaVista) })))));
47745
47746
  };
47746
47747
  var templateObject_1$8;
47747
47748
 
@@ -63077,7 +63078,7 @@ function createDatasets(data, uniqueDates, timeFilter) {
63077
63078
  }));
63078
63079
  var datasetData = uniqueDates.map(function (date) {
63079
63080
  var _a;
63080
- var value = (_a = dateValues.get(date)) !== null && _a !== void 0 ? _a : 0;
63081
+ var value = (_a = dateValues.get(date)) !== null && _a !== void 0 ? _a : null;
63081
63082
  return { x: date, y: value };
63082
63083
  });
63083
63084
  var datasetConfiguration = __assign$6({ type: chartType, label: label, data: datasetData, borderColor: borderColor, backgroundColor: chartType === "bar" ? borderColor + "60" : undefined, tension: chartType === "line" ? 0.4 : undefined, spanGaps: true, showLine: chartType === "line", pointRadius: 2, yAxisID: yAxisID }, (chartType === "bar" && {
@@ -63216,8 +63217,8 @@ var useMixedChartData = function (dataInput, timeFilter) {
63216
63217
  var fullProcessedData = {
63217
63218
  protestos: addMissingDateEntries(dataInput.protestos, fullDataStartDate, endDate),
63218
63219
  ccfs: addMissingDateEntries(dataInput.ccfs, fullDataStartDate, endDate),
63219
- serasa: addMissingDateEntries(dataInput.serasa, fullDataStartDate, endDate),
63220
- boaVista: addMissingDateEntries(dataInput.boaVista, fullDataStartDate, endDate),
63220
+ serasa: dataInput.serasa,
63221
+ boaVista: dataInput.boaVista,
63221
63222
  dividasPublicasGrafico: addMissingDateEntries(dataInput.dividasPublicasGrafico, fullDataStartDate, endDate),
63222
63223
  };
63223
63224
  var processedData = {
@@ -64837,7 +64838,7 @@ var ChartSystem = function (_a) {
64837
64838
  React.createElement(Result, null,
64838
64839
  React.createElement(Content, { isOpen: isOpen },
64839
64840
  data && React.createElement(ChartContent, { dataInput: data }),
64840
- !isLoading && (React.createElement(QuantidadeResultados, { quantidadeProtestos: quantidadeProtestos, quantidadeProcessos: (_f = data === null || data === void 0 ? void 0 : data.pieChartTotalConfig) === null || _f === void 0 ? void 0 : _f.processosJuridicos, quantidadeDividas: quantidadeDividas, quantidadeDividasSerasa: quantidadeSerasa, quantidadeDividasBoaVista: quantidadeBoaVista, quantidadeChequesSemFundos: quantidadeCCFs, ultimaOcorrenciaChequesSemFundos: ultimaOcorrenciaCCF, valorTotalDividasSerasa: valorTotalSerasa, valorTotalDividasBoaVista: valorTotalBoaVista, valorTotalProtestos: valorTotalProtestos, valorTotalDividas: valorTotalDividas, ultimaOcorrenciaProtestos: ultimaOcorrenciaProtestos }))))));
64841
+ !isLoading && (React.createElement(QuantidadeResultados, { data: data, quantidadeProtestos: quantidadeProtestos, quantidadeProcessos: (_f = data === null || data === void 0 ? void 0 : data.pieChartTotalConfig) === null || _f === void 0 ? void 0 : _f.processosJuridicos, quantidadeDividas: quantidadeDividas, quantidadeDividasSerasa: quantidadeSerasa, quantidadeDividasBoaVista: quantidadeBoaVista, quantidadeChequesSemFundos: quantidadeCCFs, ultimaOcorrenciaChequesSemFundos: ultimaOcorrenciaCCF, valorTotalDividasSerasa: valorTotalSerasa, valorTotalDividasBoaVista: valorTotalBoaVista, valorTotalProtestos: valorTotalProtestos, valorTotalDividas: valorTotalDividas, ultimaOcorrenciaProtestos: ultimaOcorrenciaProtestos }))))));
64841
64842
  };
64842
64843
  var templateObject_1$4;
64843
64844
 
@@ -39,7 +39,7 @@ var ChartSystem = function (_a) {
39
39
  React.createElement(Result, null,
40
40
  React.createElement(Content, { isOpen: isOpen },
41
41
  data && React.createElement(ChartContent, { dataInput: data }),
42
- !isLoading && (React.createElement(QuantidadeResultados, { quantidadeProtestos: quantidadeProtestos, quantidadeProcessos: (_f = data === null || data === void 0 ? void 0 : data.pieChartTotalConfig) === null || _f === void 0 ? void 0 : _f.processosJuridicos, quantidadeDividas: quantidadeDividas, quantidadeDividasSerasa: quantidadeSerasa, quantidadeDividasBoaVista: quantidadeBoaVista, quantidadeChequesSemFundos: quantidadeCCFs, ultimaOcorrenciaChequesSemFundos: ultimaOcorrenciaCCF, valorTotalDividasSerasa: valorTotalSerasa, valorTotalDividasBoaVista: valorTotalBoaVista, valorTotalProtestos: valorTotalProtestos, valorTotalDividas: valorTotalDividas, ultimaOcorrenciaProtestos: ultimaOcorrenciaProtestos }))))));
42
+ !isLoading && (React.createElement(QuantidadeResultados, { data: data, quantidadeProtestos: quantidadeProtestos, quantidadeProcessos: (_f = data === null || data === void 0 ? void 0 : data.pieChartTotalConfig) === null || _f === void 0 ? void 0 : _f.processosJuridicos, quantidadeDividas: quantidadeDividas, quantidadeDividasSerasa: quantidadeSerasa, quantidadeDividasBoaVista: quantidadeBoaVista, quantidadeChequesSemFundos: quantidadeCCFs, ultimaOcorrenciaChequesSemFundos: ultimaOcorrenciaCCF, valorTotalDividasSerasa: valorTotalSerasa, valorTotalDividasBoaVista: valorTotalBoaVista, valorTotalProtestos: valorTotalProtestos, valorTotalDividas: valorTotalDividas, ultimaOcorrenciaProtestos: ultimaOcorrenciaProtestos }))))));
43
43
  };
44
44
  export default ChartSystem;
45
45
  var templateObject_1;
@@ -4,7 +4,7 @@ import "chartjs-adapter-date-fns";
4
4
  export declare const useMixedChartData: (dataInput: DataInput, timeFilter?: TimeFilter) => {
5
5
  data: ChartData<"line" | "bar", (number | {
6
6
  x: string;
7
- y: number;
7
+ y: number | null;
8
8
  })[], string>;
9
9
  options: ChartOptions<"line" | "bar">;
10
10
  };
@@ -11,8 +11,8 @@ export var useMixedChartData = function (dataInput, timeFilter) {
11
11
  var fullProcessedData = {
12
12
  protestos: addMissingDateEntries(dataInput.protestos, fullDataStartDate, endDate),
13
13
  ccfs: addMissingDateEntries(dataInput.ccfs, fullDataStartDate, endDate),
14
- serasa: addMissingDateEntries(dataInput.serasa, fullDataStartDate, endDate),
15
- boaVista: addMissingDateEntries(dataInput.boaVista, fullDataStartDate, endDate),
14
+ serasa: dataInput.serasa,
15
+ boaVista: dataInput.boaVista,
16
16
  dividasPublicasGrafico: addMissingDateEntries(dataInput.dividasPublicasGrafico, fullDataStartDate, endDate),
17
17
  };
18
18
  var processedData = {
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
+ import { DataInput } from "./types/iChart";
2
3
  type QuantidadeResultadosProps = Partial<{
4
+ data: DataInput | null;
3
5
  quantidadeProtestos: number;
4
6
  quantidadeProcessos: number;
5
7
  quantidadeDividas: number;
@@ -15,7 +15,8 @@ var QuantityContainer = function (_a) {
15
15
  };
16
16
  var QuantidadeResultadosWrapper = styled(ResultContent)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 18px 20px;\n row-gap: 20px;\n > * {\n row-gap: 10px;\n }\n @media only screen and (max-width: 768px) {\n > * {\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n }\n }\n"], ["\n padding: 18px 20px;\n row-gap: 20px;\n > * {\n row-gap: 10px;\n }\n @media only screen and (max-width: 768px) {\n > * {\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n }\n }\n"])), theme.colors.cinzaClaro);
17
17
  var QuantidadeResultados = function (_a) {
18
- var _b = _a.quantidadeProtestos, quantidadeProtestos = _b === void 0 ? 0 : _b, _c = _a.quantidadeProcessos, quantidadeProcessos = _c === void 0 ? 0 : _c, _d = _a.quantidadeDividas, quantidadeDividas = _d === void 0 ? 0 : _d, _e = _a.quantidadeChequesSemFundos, quantidadeChequesSemFundos = _e === void 0 ? 0 : _e, _f = _a.quantidadeDividasSerasa, quantidadeDividasSerasa = _f === void 0 ? 0 : _f, _g = _a.quantidadeDividasBoaVista, quantidadeDividasBoaVista = _g === void 0 ? 0 : _g, _h = _a.valorTotalProtestos, valorTotalProtestos = _h === void 0 ? 0 : _h, _j = _a.valorTotalDividas, valorTotalDividas = _j === void 0 ? 0 : _j, _k = _a.valorTotalDividasSerasa, valorTotalDividasSerasa = _k === void 0 ? 0 : _k, _l = _a.valorTotalDividasBoaVista, valorTotalDividasBoaVista = _l === void 0 ? 0 : _l, _m = _a.ultimaOcorrenciaProtestos, ultimaOcorrenciaProtestos = _m === void 0 ? null : _m, _o = _a.ultimaOcorrenciaChequesSemFundos, ultimaOcorrenciaChequesSemFundos = _o === void 0 ? null : _o;
18
+ var _b, _c, _d, _e;
19
+ var data = _a.data, _f = _a.quantidadeProtestos, quantidadeProtestos = _f === void 0 ? 0 : _f, _g = _a.quantidadeProcessos, quantidadeProcessos = _g === void 0 ? 0 : _g, _h = _a.quantidadeDividas, quantidadeDividas = _h === void 0 ? 0 : _h, _j = _a.quantidadeChequesSemFundos, quantidadeChequesSemFundos = _j === void 0 ? 0 : _j, _k = _a.quantidadeDividasSerasa, quantidadeDividasSerasa = _k === void 0 ? 0 : _k, _l = _a.quantidadeDividasBoaVista, quantidadeDividasBoaVista = _l === void 0 ? 0 : _l, _m = _a.valorTotalProtestos, valorTotalProtestos = _m === void 0 ? 0 : _m, _o = _a.valorTotalDividas, valorTotalDividas = _o === void 0 ? 0 : _o, _p = _a.valorTotalDividasSerasa, valorTotalDividasSerasa = _p === void 0 ? 0 : _p, _q = _a.valorTotalDividasBoaVista, valorTotalDividasBoaVista = _q === void 0 ? 0 : _q, _r = _a.ultimaOcorrenciaProtestos, ultimaOcorrenciaProtestos = _r === void 0 ? null : _r, _s = _a.ultimaOcorrenciaChequesSemFundos, ultimaOcorrenciaChequesSemFundos = _s === void 0 ? null : _s;
19
20
  return (React.createElement(Result, { resultContentStriped: false },
20
21
  React.createElement(QuantidadeResultadosWrapper, { desktop: "repeat(6, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr" },
21
22
  React.createElement(QuantityContainer, null,
@@ -31,11 +32,11 @@ var QuantidadeResultados = function (_a) {
31
32
  React.createElement(AddItemField, { name: "D\u00EDvidas P\u00FAblicas", value: formatValue(quantidadeDividas) }),
32
33
  React.createElement(AddItemField, { name: "Total D\u00EDvidas P\u00FAblicas", value: formatMoney(valorTotalDividas) })),
33
34
  React.createElement(QuantityContainer, null,
34
- React.createElement(AddItemField, { name: "Pefin Refin Serasa", value: formatValue(quantidadeDividasSerasa) }),
35
- React.createElement(AddItemField, { name: "Total Pefin Refin Serasa", value: formatMoney(valorTotalDividasSerasa) })),
35
+ React.createElement(AddItemField, { hidden: !((_b = data === null || data === void 0 ? void 0 : data.serasa) === null || _b === void 0 ? void 0 : _b.length), name: "Pefin Refin Serasa", value: formatValue(quantidadeDividasSerasa) }),
36
+ React.createElement(AddItemField, { hidden: !((_c = data === null || data === void 0 ? void 0 : data.serasa) === null || _c === void 0 ? void 0 : _c.length), name: "Total Pefin Refin Serasa", value: formatMoney(valorTotalDividasSerasa) })),
36
37
  React.createElement(QuantityContainer, null,
37
- React.createElement(AddItemField, { name: "Pefin Refin Boa Vista", value: formatValue(quantidadeDividasBoaVista) }),
38
- React.createElement(AddItemField, { name: "Total Pefin Refin Boa Vista", value: formatMoney(valorTotalDividasBoaVista) })))));
38
+ React.createElement(AddItemField, { hidden: !((_d = data === null || data === void 0 ? void 0 : data.boaVista) === null || _d === void 0 ? void 0 : _d.length), name: "Pefin Refin Boa Vista", value: formatValue(quantidadeDividasBoaVista) }),
39
+ React.createElement(AddItemField, { hidden: !((_e = data === null || data === void 0 ? void 0 : data.boaVista) === null || _e === void 0 ? void 0 : _e.length), name: "Total Pefin Refin Boa Vista", value: formatMoney(valorTotalDividasBoaVista) })))));
39
40
  };
40
41
  export default QuantidadeResultados;
41
42
  var templateObject_1;
@@ -34,7 +34,7 @@ export interface DataSetCommon {
34
34
  label: string;
35
35
  data: {
36
36
  x: string;
37
- y: number;
37
+ y: number | null;
38
38
  }[];
39
39
  borderColor?: string;
40
40
  backgroundColor?: string;
@@ -2,6 +2,6 @@ import { DataInput, TimeFilter } from "../types/iChart";
2
2
  import { ChartDataset, ChartOptions } from "chart.js";
3
3
  export declare function createDatasets(data: DataInput, uniqueDates: string[], timeFilter: TimeFilter): ChartDataset<"line" | "bar", (number | {
4
4
  x: string;
5
- y: number;
5
+ y: number | null;
6
6
  })[]>[];
7
7
  export declare function getChartOptions(timeFilter: TimeFilter): ChartOptions<"line" | "bar">;
@@ -23,7 +23,7 @@ export function createDatasets(data, uniqueDates, timeFilter) {
23
23
  }));
24
24
  var datasetData = uniqueDates.map(function (date) {
25
25
  var _a;
26
- var value = (_a = dateValues.get(date)) !== null && _a !== void 0 ? _a : 0;
26
+ var value = (_a = dateValues.get(date)) !== null && _a !== void 0 ? _a : null;
27
27
  return { x: date, y: value };
28
28
  });
29
29
  var datasetConfiguration = __assign({ type: chartType, label: label, data: datasetData, borderColor: borderColor, backgroundColor: chartType === "bar" ? borderColor + "60" : undefined, tension: chartType === "line" ? 0.4 : undefined, spanGaps: true, showLine: chartType === "line", pointRadius: 2, yAxisID: yAxisID }, (chartType === "bar" && {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credithub/harlan-components",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "description": "Provide a set of web components to be used in Harlan and other projects",
5
5
  "keywords": [
6
6
  "harlan",