@credithub/harlan-components 1.3.4 → 1.4.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/components/ccf/ccf.js +2 -5
- package/lib/cjs/components/chart/categoryProtestos.d.ts +4 -0
- package/lib/cjs/components/chart/categoryProtestos.js +97 -0
- package/lib/cjs/components/chart/chartContent.d.ts +7 -0
- package/lib/cjs/components/chart/chartContent.js +77 -0
- package/lib/cjs/components/chart/chartHelper.d.ts +7 -0
- package/lib/cjs/components/chart/chartHelper.js +66 -0
- package/lib/cjs/components/chart/customChart.d.ts +10 -0
- package/lib/cjs/components/chart/customChart.js +125 -0
- package/lib/cjs/components/chart/getUniqueDates.d.ts +2 -0
- package/lib/cjs/components/chart/getUniqueDates.js +8 -0
- package/lib/cjs/components/chart/plotly/barChartDataStrategy.d.ts +14 -0
- package/lib/cjs/components/chart/plotly/barChartDataStrategy.js +152 -0
- package/lib/cjs/components/chart/plotly/baseChartDataStrategy.d.ts +8 -0
- package/lib/cjs/components/chart/plotly/baseChartDataStrategy.js +31 -0
- package/lib/cjs/components/chart/plotly/getSeries.d.ts +3 -0
- package/lib/cjs/components/chart/plotly/getSeries.js +35 -0
- package/lib/cjs/components/chart/plotly/iChartDataStrategy.d.ts +35 -0
- package/lib/cjs/components/chart/plotly/iChartDataStrategy.js +2 -0
- package/lib/cjs/components/chart/plotly/index.d.ts +5 -0
- package/lib/cjs/components/chart/plotly/index.js +20 -0
- package/lib/cjs/components/chart/plotly/layoutLineBarChart.d.ts +39 -0
- package/lib/cjs/components/chart/plotly/layoutLineBarChart.js +65 -0
- package/lib/cjs/components/chart/plotly/lineChartDataStrategy.d.ts +17 -0
- package/lib/cjs/components/chart/plotly/lineChartDataStrategy.js +198 -0
- package/lib/cjs/components/chart/plotly/pieChartDataStrategy.d.ts +5 -0
- package/lib/cjs/components/chart/plotly/pieChartDataStrategy.js +45 -0
- package/lib/cjs/components/chart/plotly/types.d.ts +40 -0
- package/lib/cjs/components/chart/plotly/types.js +2 -0
- package/lib/cjs/components/chart/processChartData.d.ts +5 -0
- package/lib/cjs/components/chart/processChartData.js +41 -0
- package/lib/cjs/components/chart/quantityResult.d.ts +17 -0
- package/lib/cjs/components/chart/quantityResult.js +38 -0
- package/lib/cjs/components/chart/useCalculation.d.ts +6 -0
- package/lib/cjs/components/chart/useCalculation.js +12 -0
- package/lib/cjs/components/chart/useUltimaOcorrenciaCCF.d.ts +2 -0
- package/lib/cjs/components/chart/useUltimaOcorrenciaCCF.js +20 -0
- package/lib/cjs/components/dossie/transactionTable/transactionTable.js +2 -4
- package/lib/cjs/components/processos-juridicos/processosJuridicosList.js +6 -3
- package/lib/cjs/components/protestos/getTotalProtestos.d.ts +1 -0
- package/lib/cjs/components/protestos/getTotalProtestos.js +10 -0
- package/lib/cjs/components/protestos/protestosCategory.js +1 -1
- package/lib/cjs/components/protestos/protestosList.js +2 -1
- package/lib/cjs/components/webservice.d.ts +14 -0
- package/lib/cjs/components/webservice.js +6 -5
- package/lib/cjs/consultaSimples.js +13 -11
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +4 -1
- package/lib/cjs/mock/mockDataInput.d.ts +34 -0
- package/lib/cjs/mock/mockDataInput.js +139 -0
- package/lib/cjs/utils/calculation.d.ts +9 -0
- package/lib/cjs/utils/calculation.js +23 -0
- package/lib/cjs/utils/date.d.ts +1 -0
- package/lib/cjs/utils/date.js +10 -0
- package/lib/cjs/utils/formatter.d.ts +2 -0
- package/lib/cjs/utils/formatter.js +7 -0
- package/lib/cjs/utils/number.d.ts +3 -2
- package/lib/cjs/utils/number.js +9 -5
- package/lib/cjs/utils/string.d.ts +1 -0
- package/lib/cjs/utils/string.js +8 -3
- package/lib/esm/components/ccf/ccf.js +2 -5
- package/lib/esm/components/chart/categoryProtestos.d.ts +4 -0
- package/lib/esm/components/chart/categoryProtestos.js +69 -0
- package/lib/esm/components/chart/chartContent.d.ts +7 -0
- package/lib/esm/components/chart/chartContent.js +49 -0
- package/lib/esm/components/chart/chartHelper.d.ts +7 -0
- package/lib/esm/components/chart/chartHelper.js +60 -0
- package/lib/esm/components/chart/customChart.d.ts +10 -0
- package/lib/esm/components/chart/customChart.js +95 -0
- package/lib/esm/components/chart/getUniqueDates.d.ts +2 -0
- package/lib/esm/components/chart/getUniqueDates.js +4 -0
- package/lib/esm/components/chart/plotly/barChartDataStrategy.d.ts +14 -0
- package/lib/esm/components/chart/plotly/barChartDataStrategy.js +149 -0
- package/lib/esm/components/chart/plotly/baseChartDataStrategy.d.ts +8 -0
- package/lib/esm/components/chart/plotly/baseChartDataStrategy.js +28 -0
- package/lib/esm/components/chart/plotly/getSeries.d.ts +3 -0
- package/lib/esm/components/chart/plotly/getSeries.js +31 -0
- package/lib/esm/components/chart/plotly/iChartDataStrategy.d.ts +35 -0
- package/lib/esm/components/chart/plotly/iChartDataStrategy.js +1 -0
- package/lib/esm/components/chart/plotly/index.d.ts +5 -0
- package/lib/esm/components/chart/plotly/index.js +5 -0
- package/lib/esm/components/chart/plotly/layoutLineBarChart.d.ts +39 -0
- package/lib/esm/components/chart/plotly/layoutLineBarChart.js +62 -0
- package/lib/esm/components/chart/plotly/lineChartDataStrategy.d.ts +17 -0
- package/lib/esm/components/chart/plotly/lineChartDataStrategy.js +195 -0
- package/lib/esm/components/chart/plotly/pieChartDataStrategy.d.ts +5 -0
- package/lib/esm/components/chart/plotly/pieChartDataStrategy.js +42 -0
- package/lib/esm/components/chart/plotly/types.d.ts +40 -0
- package/lib/esm/components/chart/plotly/types.js +1 -0
- package/lib/esm/components/chart/processChartData.d.ts +5 -0
- package/lib/esm/components/chart/processChartData.js +37 -0
- package/lib/esm/components/chart/quantityResult.d.ts +17 -0
- package/lib/esm/components/chart/quantityResult.js +33 -0
- package/lib/esm/components/chart/useCalculation.d.ts +6 -0
- package/lib/esm/components/chart/useCalculation.js +8 -0
- package/lib/esm/components/chart/useUltimaOcorrenciaCCF.d.ts +2 -0
- package/lib/esm/components/chart/useUltimaOcorrenciaCCF.js +15 -0
- package/lib/esm/components/dossie/transactionTable/transactionTable.js +2 -4
- package/lib/esm/components/processos-juridicos/processosJuridicosList.js +6 -3
- package/lib/esm/components/protestos/getTotalProtestos.d.ts +1 -0
- package/lib/esm/components/protestos/getTotalProtestos.js +4 -0
- package/lib/esm/components/protestos/protestosCategory.js +1 -1
- package/lib/esm/components/protestos/protestosList.js +2 -1
- package/lib/esm/components/webservice.d.ts +14 -0
- package/lib/esm/components/webservice.js +3 -2
- package/lib/esm/consultaSimples.js +14 -12
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/mock/mockDataInput.d.ts +34 -0
- package/lib/esm/mock/mockDataInput.js +137 -0
- package/lib/esm/utils/calculation.d.ts +9 -0
- package/lib/esm/utils/calculation.js +17 -0
- package/lib/esm/utils/date.d.ts +1 -0
- package/lib/esm/utils/date.js +6 -0
- package/lib/esm/utils/formatter.d.ts +2 -0
- package/lib/esm/utils/formatter.js +5 -0
- package/lib/esm/utils/number.d.ts +3 -2
- package/lib/esm/utils/number.js +7 -4
- package/lib/esm/utils/string.d.ts +1 -0
- package/lib/esm/utils/string.js +6 -2
- package/package.json +8 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var layoutLineBarChart = function (layoutWidth, lastDate) {
|
|
2
|
+
var currentDate = lastDate;
|
|
3
|
+
var thirtyDaysAgo = new Date(currentDate.getTime() - 30 * 24 * 60 * 60 * 1000);
|
|
4
|
+
var oneDayAhead = new Date(currentDate.getTime() + 24 * 60 * 60 * 1000);
|
|
5
|
+
var formattedThirtyDaysAgo = thirtyDaysAgo.toISOString();
|
|
6
|
+
var formattedOneDayAhead = oneDayAhead.toISOString();
|
|
7
|
+
return {
|
|
8
|
+
title: "",
|
|
9
|
+
width: layoutWidth,
|
|
10
|
+
height: 800,
|
|
11
|
+
xaxis: {
|
|
12
|
+
range: [formattedThirtyDaysAgo, formattedOneDayAhead],
|
|
13
|
+
domain: [0.1, 0.92],
|
|
14
|
+
rangeslider: { visible: true },
|
|
15
|
+
rangeselector: {
|
|
16
|
+
buttons: [
|
|
17
|
+
{
|
|
18
|
+
step: "month",
|
|
19
|
+
stepmode: "backward",
|
|
20
|
+
count: 1,
|
|
21
|
+
label: "1 mês",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
step: "month",
|
|
25
|
+
stepmode: "backward",
|
|
26
|
+
count: 6,
|
|
27
|
+
label: "6 meses",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
step: "year",
|
|
31
|
+
stepmode: "backward",
|
|
32
|
+
count: 1,
|
|
33
|
+
label: "1 ano",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
step: "all",
|
|
37
|
+
label: "all",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
yaxis2: {
|
|
43
|
+
title: "Valor Total de Negativações (R$)",
|
|
44
|
+
titlefont: { color: "#1f77b4" },
|
|
45
|
+
tickfont: { color: "#1f77b4" },
|
|
46
|
+
tickformat: ",.2f",
|
|
47
|
+
},
|
|
48
|
+
yaxis: {
|
|
49
|
+
title: "Quantidade de Ocorrências por Consulta",
|
|
50
|
+
titlefont: {
|
|
51
|
+
color: "#ff7f0e",
|
|
52
|
+
},
|
|
53
|
+
tickfont: {
|
|
54
|
+
color: "#ff7f0e",
|
|
55
|
+
},
|
|
56
|
+
anchor: "x",
|
|
57
|
+
side: "right",
|
|
58
|
+
overlaying: "y2",
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export { layoutLineBarChart };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseChartDataStrategy } from "./";
|
|
2
|
+
import { ChartDataAndLayoutState, DataInput } from "./types";
|
|
3
|
+
export declare class lineDividasPublicas extends BaseChartDataStrategy<DataInput> {
|
|
4
|
+
processData(data: DataInput): ChartDataAndLayoutState;
|
|
5
|
+
}
|
|
6
|
+
export declare class lineCCF extends BaseChartDataStrategy<DataInput> {
|
|
7
|
+
processData(data: DataInput): ChartDataAndLayoutState;
|
|
8
|
+
}
|
|
9
|
+
export declare class lineSerasa extends BaseChartDataStrategy<DataInput> {
|
|
10
|
+
processData(data: DataInput): ChartDataAndLayoutState;
|
|
11
|
+
}
|
|
12
|
+
export declare class lineBoaVista extends BaseChartDataStrategy<DataInput> {
|
|
13
|
+
processData(data: DataInput): ChartDataAndLayoutState;
|
|
14
|
+
}
|
|
15
|
+
export declare class lineProtestos extends BaseChartDataStrategy<DataInput> {
|
|
16
|
+
processData(data: DataInput): ChartDataAndLayoutState;
|
|
17
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { BaseChartDataStrategy } from "./";
|
|
17
|
+
var layout = {};
|
|
18
|
+
var lineDividasPublicas = /** @class */ (function (_super) {
|
|
19
|
+
__extends(lineDividasPublicas, _super);
|
|
20
|
+
function lineDividasPublicas() {
|
|
21
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
lineDividasPublicas.prototype.processData = function (data) {
|
|
24
|
+
var dividasPublicasData = data.dividasPublicasGrafico
|
|
25
|
+
.filter(function (consulta) { return consulta.quantidade !== null; })
|
|
26
|
+
.map(function (consulta) { return ({
|
|
27
|
+
x: consulta.data,
|
|
28
|
+
y: consulta.quantidade,
|
|
29
|
+
}); });
|
|
30
|
+
var color = "#ef4b6c";
|
|
31
|
+
var dividasPublicasState = {
|
|
32
|
+
name: "Dívidas Públicas",
|
|
33
|
+
yaxis: "y",
|
|
34
|
+
marker: {
|
|
35
|
+
color: color,
|
|
36
|
+
},
|
|
37
|
+
textfont: {
|
|
38
|
+
family: "sans serif",
|
|
39
|
+
size: 12,
|
|
40
|
+
color: color,
|
|
41
|
+
},
|
|
42
|
+
type: "scatter",
|
|
43
|
+
mode: "lines+markers+text",
|
|
44
|
+
data: dividasPublicasData,
|
|
45
|
+
connectgaps: true,
|
|
46
|
+
layout: layout,
|
|
47
|
+
};
|
|
48
|
+
return dividasPublicasState;
|
|
49
|
+
};
|
|
50
|
+
return lineDividasPublicas;
|
|
51
|
+
}(BaseChartDataStrategy));
|
|
52
|
+
export { lineDividasPublicas };
|
|
53
|
+
var lineCCF = /** @class */ (function (_super) {
|
|
54
|
+
__extends(lineCCF, _super);
|
|
55
|
+
function lineCCF() {
|
|
56
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
57
|
+
}
|
|
58
|
+
lineCCF.prototype.processData = function (data) {
|
|
59
|
+
var ccfData = data.ccfs
|
|
60
|
+
.filter(function (consulta) { return consulta.quantidade !== null; })
|
|
61
|
+
.map(function (consulta) { return ({
|
|
62
|
+
x: consulta.data,
|
|
63
|
+
y: consulta.quantidade,
|
|
64
|
+
}); });
|
|
65
|
+
var color = "#3f51b5";
|
|
66
|
+
var ccfState = {
|
|
67
|
+
name: "Cheques sem Fundos",
|
|
68
|
+
yaxis: "y",
|
|
69
|
+
marker: {
|
|
70
|
+
color: color,
|
|
71
|
+
},
|
|
72
|
+
textfont: {
|
|
73
|
+
family: "sans serif",
|
|
74
|
+
size: 12,
|
|
75
|
+
color: color,
|
|
76
|
+
},
|
|
77
|
+
type: "scatter",
|
|
78
|
+
mode: "lines+markers+text",
|
|
79
|
+
data: ccfData,
|
|
80
|
+
connectgaps: true,
|
|
81
|
+
layout: layout,
|
|
82
|
+
};
|
|
83
|
+
return ccfState;
|
|
84
|
+
};
|
|
85
|
+
return lineCCF;
|
|
86
|
+
}(BaseChartDataStrategy));
|
|
87
|
+
export { lineCCF };
|
|
88
|
+
var lineSerasa = /** @class */ (function (_super) {
|
|
89
|
+
__extends(lineSerasa, _super);
|
|
90
|
+
function lineSerasa() {
|
|
91
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
92
|
+
}
|
|
93
|
+
lineSerasa.prototype.processData = function (data) {
|
|
94
|
+
var serasaData = data.serasa
|
|
95
|
+
.filter(function (consulta) { return consulta.quantidade !== null; })
|
|
96
|
+
.map(function (consulta) { return ({
|
|
97
|
+
x: consulta.creation,
|
|
98
|
+
y: consulta.quantidade,
|
|
99
|
+
}); });
|
|
100
|
+
var serasaState = {
|
|
101
|
+
name: "Pefin/Refin Serasa",
|
|
102
|
+
yaxis: "y",
|
|
103
|
+
type: "scatter",
|
|
104
|
+
marker: {
|
|
105
|
+
color: "#ffc107",
|
|
106
|
+
},
|
|
107
|
+
textfont: {
|
|
108
|
+
family: "sans serif",
|
|
109
|
+
size: 12,
|
|
110
|
+
color: "#ffc107",
|
|
111
|
+
},
|
|
112
|
+
mode: "lines+markers+text",
|
|
113
|
+
data: serasaData,
|
|
114
|
+
connectgaps: true,
|
|
115
|
+
layout: layout,
|
|
116
|
+
};
|
|
117
|
+
return serasaState;
|
|
118
|
+
};
|
|
119
|
+
return lineSerasa;
|
|
120
|
+
}(BaseChartDataStrategy));
|
|
121
|
+
export { lineSerasa };
|
|
122
|
+
var lineBoaVista = /** @class */ (function (_super) {
|
|
123
|
+
__extends(lineBoaVista, _super);
|
|
124
|
+
function lineBoaVista() {
|
|
125
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
126
|
+
}
|
|
127
|
+
lineBoaVista.prototype.processData = function (data) {
|
|
128
|
+
var boaVistaData = data.boaVista
|
|
129
|
+
.filter(function (consulta) { return consulta.quantidade !== null; })
|
|
130
|
+
.map(function (consulta) { return ({
|
|
131
|
+
x: consulta.creation,
|
|
132
|
+
y: consulta.quantidade,
|
|
133
|
+
}); });
|
|
134
|
+
var color = "#4caf50";
|
|
135
|
+
var boaVistaState = {
|
|
136
|
+
name: "Pefin/Refin Boa Vista",
|
|
137
|
+
yaxis: "y",
|
|
138
|
+
type: "scatter",
|
|
139
|
+
marker: {
|
|
140
|
+
color: color,
|
|
141
|
+
},
|
|
142
|
+
textfont: {
|
|
143
|
+
family: "sans serif",
|
|
144
|
+
size: 12,
|
|
145
|
+
color: color,
|
|
146
|
+
},
|
|
147
|
+
mode: "lines+markers+text",
|
|
148
|
+
data: boaVistaData,
|
|
149
|
+
connectgaps: true,
|
|
150
|
+
layout: layout,
|
|
151
|
+
};
|
|
152
|
+
return boaVistaState;
|
|
153
|
+
};
|
|
154
|
+
return lineBoaVista;
|
|
155
|
+
}(BaseChartDataStrategy));
|
|
156
|
+
export { lineBoaVista };
|
|
157
|
+
var lineProtestos = /** @class */ (function (_super) {
|
|
158
|
+
__extends(lineProtestos, _super);
|
|
159
|
+
function lineProtestos() {
|
|
160
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
161
|
+
}
|
|
162
|
+
lineProtestos.prototype.processData = function (data) {
|
|
163
|
+
var protestosData = data.protestos
|
|
164
|
+
.filter(function (consulta) { return consulta.quantidade !== null; })
|
|
165
|
+
.map(function (consulta) { return ({
|
|
166
|
+
x: consulta.data,
|
|
167
|
+
y: consulta.quantidade,
|
|
168
|
+
}); });
|
|
169
|
+
var protestosState = {
|
|
170
|
+
name: "Protestos",
|
|
171
|
+
yaxis: "y",
|
|
172
|
+
marker: {
|
|
173
|
+
color: "red",
|
|
174
|
+
line: {
|
|
175
|
+
color: "rgb(255, 255, 255)",
|
|
176
|
+
width: 1,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
textfont: {
|
|
180
|
+
bgcolor: "#fffff",
|
|
181
|
+
family: "sans serif",
|
|
182
|
+
size: 12,
|
|
183
|
+
color: "red",
|
|
184
|
+
},
|
|
185
|
+
type: "scatter",
|
|
186
|
+
mode: "lines+markers+text",
|
|
187
|
+
data: protestosData,
|
|
188
|
+
connectgaps: true,
|
|
189
|
+
layout: layout,
|
|
190
|
+
};
|
|
191
|
+
return protestosState;
|
|
192
|
+
};
|
|
193
|
+
return lineProtestos;
|
|
194
|
+
}(BaseChartDataStrategy));
|
|
195
|
+
export { lineProtestos };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { last } from "underscore";
|
|
13
|
+
var PieChartDataStrategy = /** @class */ (function () {
|
|
14
|
+
function PieChartDataStrategy() {
|
|
15
|
+
}
|
|
16
|
+
PieChartDataStrategy.prototype.processData = function (data) {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18
|
+
var totalDeProtestos = (_a = last(data.protestos)) === null || _a === void 0 ? void 0 : _a.quantidade;
|
|
19
|
+
var chequesDevolvidos = (_b = last(data.ccfs)) === null || _b === void 0 ? void 0 : _b.quantidade;
|
|
20
|
+
var totalDePefinRefinSerasa = (_c = last(data.serasa)) === null || _c === void 0 ? void 0 : _c.quantidade;
|
|
21
|
+
var totalDePefinRefinBoaVista = (_d = last(data.boaVista)) === null || _d === void 0 ? void 0 : _d.quantidade;
|
|
22
|
+
var totalDeDividasPublicas = (_e = last(data.dividasPublicasGrafico)) === null || _e === void 0 ? void 0 : _e.quantidade;
|
|
23
|
+
var pieChartLayout = {
|
|
24
|
+
autosize: true,
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
name: "Quantidade de Ocorrências",
|
|
28
|
+
yaxis: "",
|
|
29
|
+
type: "pie",
|
|
30
|
+
data: (_f = [
|
|
31
|
+
{ x: "Protestos", y: totalDeProtestos },
|
|
32
|
+
{ x: "Cheques Devolvidos", y: chequesDevolvidos },
|
|
33
|
+
{ x: "Pefin/Refin Serasa", y: totalDePefinRefinSerasa },
|
|
34
|
+
{ x: "Pefin/Refin Boa Vista", y: totalDePefinRefinBoaVista },
|
|
35
|
+
{ x: "Divídas Públicas", y: totalDeDividasPublicas }
|
|
36
|
+
]) === null || _f === void 0 ? void 0 : _f.map(function (query) { return (__assign(__assign({}, query), { y: query.y || 0 })); }),
|
|
37
|
+
layout: pieChartLayout,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
return PieChartDataStrategy;
|
|
41
|
+
}());
|
|
42
|
+
export { PieChartDataStrategy };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ChartDataState } from "./iChartDataStrategy";
|
|
2
|
+
import { LayoutConfig } from "./layoutLineBarChart";
|
|
3
|
+
export interface Consulta {
|
|
4
|
+
data: string | Date;
|
|
5
|
+
categoria?: string;
|
|
6
|
+
quantidade: number | null;
|
|
7
|
+
creation?: string | Date;
|
|
8
|
+
valorTotal: number | null;
|
|
9
|
+
}
|
|
10
|
+
export interface DataInput {
|
|
11
|
+
ccfs: Consulta[];
|
|
12
|
+
protestos: Consulta[];
|
|
13
|
+
serasa: Consulta[];
|
|
14
|
+
boaVista: Consulta[];
|
|
15
|
+
dividasPublicas: {
|
|
16
|
+
quantidade: number;
|
|
17
|
+
valorTotal: number;
|
|
18
|
+
};
|
|
19
|
+
dividasPublicasGrafico: Consulta[];
|
|
20
|
+
pieChartTotalConfig?: {
|
|
21
|
+
protestos?: {
|
|
22
|
+
total: number | null;
|
|
23
|
+
valorTotal: number | null;
|
|
24
|
+
ultimaOcorrencia: string | null;
|
|
25
|
+
};
|
|
26
|
+
processosJuridicos?: number;
|
|
27
|
+
ccf?: {
|
|
28
|
+
total: number | null;
|
|
29
|
+
ultimaOcorrencia: string | null;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface CategoriaProtestoProps {
|
|
34
|
+
width?: number;
|
|
35
|
+
height?: number;
|
|
36
|
+
}
|
|
37
|
+
export type LineChartMode = "lines" | "markers" | "lines+markers" | "text+markers" | "text+lines" | "text+lines+markers";
|
|
38
|
+
export interface ChartDataAndLayoutState extends ChartDataState {
|
|
39
|
+
layout: LayoutConfig;
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { getSeries } from "./plotly";
|
|
13
|
+
import { createBarChart, createLineChart, createPieChart } from "./chartHelper";
|
|
14
|
+
import { find, sortBy } from "underscore";
|
|
15
|
+
export var processChartData = function (_a) {
|
|
16
|
+
var dataInput = _a.dataInput, dates = _a.dates;
|
|
17
|
+
var chartData = [];
|
|
18
|
+
var adicionarDatasFaltantes = function (dataset) { return dates.map(function (date) { return find(dataset, function (consulta) { return consulta.x === date; }) || ({ x: date, y: null }); }).flat(); };
|
|
19
|
+
var ordenarDatas = function (consultas) { return sortBy(consultas, function (consulta) { return consulta.x.getTime(); }); };
|
|
20
|
+
if (dataInput) {
|
|
21
|
+
var processedDataSets = getSeries(dataInput);
|
|
22
|
+
processedDataSets = processedDataSets.map(function (dataset) { return (__assign(__assign({}, dataset), { x: ordenarDatas(adicionarDatasFaltantes(dataset.data)) })); });
|
|
23
|
+
processedDataSets.forEach(function (dataSet) {
|
|
24
|
+
var chartDataAndLayout = __assign(__assign({}, dataSet), { layout: {} });
|
|
25
|
+
if (dataSet.type === "scatter") {
|
|
26
|
+
chartData.push(createLineChart(chartDataAndLayout));
|
|
27
|
+
}
|
|
28
|
+
else if (dataSet.type === "bar") {
|
|
29
|
+
chartData.push(createBarChart(chartDataAndLayout));
|
|
30
|
+
}
|
|
31
|
+
else if (dataSet.type === "pie") {
|
|
32
|
+
chartData.push(createPieChart(chartDataAndLayout));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return chartData;
|
|
37
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type QuantidadeResultadosProps = Partial<{
|
|
3
|
+
quantidadeProtestos: number;
|
|
4
|
+
quantidadeProcessos: number;
|
|
5
|
+
quantidadeDividas: number;
|
|
6
|
+
quantidadeChequesSemFundos: number;
|
|
7
|
+
quantidadeDividasSerasa: number;
|
|
8
|
+
quantidadeDividasBoaVista: number;
|
|
9
|
+
valorTotalProtestos: number;
|
|
10
|
+
valorTotalDividas: number;
|
|
11
|
+
valorTotalDividasSerasa: number;
|
|
12
|
+
valorTotalDividasBoaVista: number;
|
|
13
|
+
ultimaOcorrenciaProtestos: string;
|
|
14
|
+
ultimaOcorrenciaChequesSemFundos: string;
|
|
15
|
+
}>;
|
|
16
|
+
declare const QuantidadeResultados: React.FC<QuantidadeResultadosProps>;
|
|
17
|
+
export default QuantidadeResultados;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable no-extra-boolean-cast */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import cn from "classnames";
|
|
4
|
+
import AddItemField from "../common/addItem";
|
|
5
|
+
import { formatMoney, formatValue } from "../../utils/number";
|
|
6
|
+
var QuantityContainer = function (_a) {
|
|
7
|
+
var children = _a.children;
|
|
8
|
+
return React.createElement("div", { className: cn('container', 'field-container') }, children);
|
|
9
|
+
};
|
|
10
|
+
var QuantidadeResultados = function (_a) {
|
|
11
|
+
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;
|
|
12
|
+
return (React.createElement(React.Fragment, null,
|
|
13
|
+
React.createElement("div", { className: cn('resumo-de-negativacoes-quantity') },
|
|
14
|
+
React.createElement(QuantityContainer, null,
|
|
15
|
+
React.createElement(AddItemField, { name: "Total Protestos", value: formatValue(quantidadeProtestos), className: cn("field-result") }),
|
|
16
|
+
React.createElement(AddItemField, { name: "Valor Total Protestos", value: formatMoney(valorTotalProtestos), className: cn("field-result") }),
|
|
17
|
+
React.createElement(AddItemField, { hidden: quantidadeProtestos == 0, name: "\u00DAltima Ocorr\u00EAncia", value: ultimaOcorrenciaProtestos, className: cn("field-result") })),
|
|
18
|
+
React.createElement(QuantityContainer, null,
|
|
19
|
+
React.createElement(AddItemField, { name: "Cheques Sem Fundos", value: formatValue(quantidadeChequesSemFundos), className: cn("field-result") }),
|
|
20
|
+
React.createElement(AddItemField, { hidden: quantidadeChequesSemFundos == 0, name: "\u00DAltima Ocorr\u00EAncia", value: ultimaOcorrenciaChequesSemFundos, className: cn("field-result") })),
|
|
21
|
+
React.createElement(QuantityContainer, null,
|
|
22
|
+
React.createElement(AddItemField, { name: "Processos Jur\u00EDdicos", value: formatValue(quantidadeProcessos), className: cn("field-result") })),
|
|
23
|
+
React.createElement(QuantityContainer, null,
|
|
24
|
+
React.createElement(AddItemField, { name: "D\u00EDvidas P\u00FAblicas", value: formatValue(quantidadeDividas), className: cn("field-result") }),
|
|
25
|
+
React.createElement(AddItemField, { name: "Total D\u00EDvidas P\u00FAblicas", value: formatMoney(valorTotalDividas), className: cn("field-result") })),
|
|
26
|
+
React.createElement(QuantityContainer, null,
|
|
27
|
+
React.createElement(AddItemField, { name: "Pefin Refin Serasa", value: formatValue(quantidadeDividasSerasa), className: cn("field-result") }),
|
|
28
|
+
React.createElement(AddItemField, { name: "Total Pefin Refin Serasa", value: formatMoney(valorTotalDividasSerasa), className: cn("field-result") })),
|
|
29
|
+
React.createElement(QuantityContainer, null,
|
|
30
|
+
React.createElement(AddItemField, { name: "Pefin Refin Boa Vista", value: formatValue(quantidadeDividasBoaVista), className: cn("field-result") }),
|
|
31
|
+
React.createElement(AddItemField, { name: "Total Pefin Refin Boa Vista", value: formatMoney(valorTotalDividasBoaVista), className: cn("field-result") })))));
|
|
32
|
+
};
|
|
33
|
+
export default QuantidadeResultados;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { encontrarDataMaisRecente, somarQuantidades, somarValoresTotais, } from "../../utils/calculation";
|
|
3
|
+
export var useCalculation = function (itens) {
|
|
4
|
+
var quantidade = useMemo(function () { return somarQuantidades(itens); }, [itens]);
|
|
5
|
+
var valorTotal = useMemo(function () { return somarValoresTotais(itens); }, [itens]);
|
|
6
|
+
var dataMaisRecente = useMemo(function () { return encontrarDataMaisRecente(itens); }, [itens]);
|
|
7
|
+
return { quantidade: quantidade, valorTotal: valorTotal, dataMaisRecente: dataMaisRecente };
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
2
|
+
import { useContext, useMemo } from "react";
|
|
3
|
+
import { Queries, RequestStatus } from "../webservice";
|
|
4
|
+
import XPathUtils from "../../utils/xpath";
|
|
5
|
+
var useUltimaOcorrenciaCCF = function () {
|
|
6
|
+
var ctxCCF = useContext(Queries.CCF);
|
|
7
|
+
var ultimaOcorrenciaCCF = useMemo(function () {
|
|
8
|
+
if ((ctxCCF === null || ctxCCF === void 0 ? void 0 : ctxCCF.type) === RequestStatus.Success) {
|
|
9
|
+
return XPathUtils.select('string(//ultimaOcorrencia)', ctxCCF === null || ctxCCF === void 0 ? void 0 : ctxCCF.document);
|
|
10
|
+
}
|
|
11
|
+
return undefined;
|
|
12
|
+
}, [ctxCCF === null || ctxCCF === void 0 ? void 0 : ctxCCF.type]);
|
|
13
|
+
return ultimaOcorrenciaCCF;
|
|
14
|
+
};
|
|
15
|
+
export default useUltimaOcorrenciaCCF;
|
|
@@ -23,10 +23,8 @@ export var TransactionsTable = function (_a) {
|
|
|
23
23
|
var _a;
|
|
24
24
|
return (React.createElement("div", { key: index, className: cn("container", "container-quem-consultou") },
|
|
25
25
|
React.createElement("div", { className: cn("transaction-content") },
|
|
26
|
-
React.createElement(AddItemField, { name: "Usu\u00E1rio", value: XPathUtils.select(
|
|
27
|
-
|
|
28
|
-
style: { display: "inline-block" } }),
|
|
29
|
-
React.createElement(AddItemField, { name: "Data", value: (_a = new Date(XPathUtils.select('string(./ultimaConsulta)', event))) === null || _a === void 0 ? void 0 : _a.toLocaleDateString(), style: { display: "inline-block" } }))));
|
|
26
|
+
React.createElement(AddItemField, { name: "Usu\u00E1rio", value: XPathUtils.select("string(./usuario)", event), className: cn("mdl-cell", "mdl-cell--6-col"), style: { display: "inline-block", padding: "2px 0px" } }),
|
|
27
|
+
React.createElement(AddItemField, { name: "Data", value: (_a = new Date(XPathUtils.select("string(./ultimaConsulta)", event))) === null || _a === void 0 ? void 0 : _a.toLocaleDateString(), style: { display: "inline-block" } }))));
|
|
30
28
|
})));
|
|
31
29
|
};
|
|
32
30
|
export default TransactionsTable;
|
|
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React, { memo } from "react";
|
|
24
|
+
import cn from "classnames";
|
|
24
25
|
import { Result } from "../interface/result";
|
|
25
26
|
import AddItem from "../common/addItem";
|
|
26
27
|
import Button from "../common/button";
|
|
@@ -31,7 +32,7 @@ var AddProcessoJuridicoField = function (_a) {
|
|
|
31
32
|
};
|
|
32
33
|
var ProcessoJuridicoItem = memo(function (_a) {
|
|
33
34
|
var processo = _a.processo, children = _a.children;
|
|
34
|
-
return (React.createElement("div", { className: "content-layout" },
|
|
35
|
+
return (React.createElement("div", { className: cn("content-layout", "container-processos") },
|
|
35
36
|
React.createElement(AddProcessoJuridicoField, { name: "N\u00FAmero CNJ", value: processo.numero_novo }),
|
|
36
37
|
React.createElement(AddProcessoJuridicoField, { name: "Assunto(s)", value: processo.assuntos }),
|
|
37
38
|
React.createElement(AddProcessoJuridicoField, { name: "Classe Processual", value: processo.classe_processual }),
|
|
@@ -42,9 +43,11 @@ var ProcessoJuridicoItem = memo(function (_a) {
|
|
|
42
43
|
var ProcessosJuridicosList = function (_a) {
|
|
43
44
|
var processos = _a.processos, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico;
|
|
44
45
|
return processos.map(function (processo, i) { return (React.createElement(React.Fragment, null,
|
|
45
|
-
React.createElement(Result, { isContainer: true, contentClassName:
|
|
46
|
+
React.createElement(Result, { isContainer: true, contentClassName: "container-layout" },
|
|
46
47
|
React.createElement(ProcessoJuridicoItem, { key: i, processo: processo },
|
|
47
|
-
React.createElement(Button, { onClick: function () {
|
|
48
|
+
React.createElement(Button, { onClick: function () {
|
|
49
|
+
return onClickConsultarProcessoJuridico(processo.numero_novo);
|
|
50
|
+
}, price: "R$ 1" }, "Consultar Processo Jur\u00EDdico"))),
|
|
48
51
|
React.createElement(EnvolvidosList, { envolvidos: processo === null || processo === void 0 ? void 0 : processo.envolvidos_ultima_movimentacao }))); });
|
|
49
52
|
};
|
|
50
53
|
export default ProcessosJuridicosList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getTotalProtestos(response: Document): number;
|
|
@@ -6,7 +6,7 @@ import HeaderAction from "../common/headerAction";
|
|
|
6
6
|
import { Result } from "../interface/result";
|
|
7
7
|
var ProtestosCategory = function (_a) {
|
|
8
8
|
var registros = _a.registros, title = _a.title, subtitle = _a.subtitle, children = _a.children;
|
|
9
|
-
var _b = useToggle(
|
|
9
|
+
var _b = useToggle(false), isOpen = _b[0], toggleOpen = _b[1];
|
|
10
10
|
return (React.createElement(React.Fragment, null,
|
|
11
11
|
React.createElement(Header, { title: title, subtitle: subtitle, description: !registros
|
|
12
12
|
? "Não foram encontradas ocorrências."
|
|
@@ -2,6 +2,7 @@ import React, { memo } from "react";
|
|
|
2
2
|
import AddItemField from "../common/addItem";
|
|
3
3
|
import XPathUtils from "../../utils/xpath";
|
|
4
4
|
import { formatMoney } from "../../utils/number";
|
|
5
|
+
import cn from "classnames";
|
|
5
6
|
import { Result } from "../interface/result";
|
|
6
7
|
export var ProtestoItem = memo(function (_a) {
|
|
7
8
|
var protesto = _a.protesto;
|
|
@@ -12,7 +13,7 @@ export var ProtestoItem = memo(function (_a) {
|
|
|
12
13
|
var formatBooleanField = function (value) {
|
|
13
14
|
return value === "true" ? "Sim" : "Não";
|
|
14
15
|
};
|
|
15
|
-
return (React.createElement("div", { className: "content-layout" },
|
|
16
|
+
return (React.createElement("div", { className: cn("content-layout", "container-protestos") },
|
|
16
17
|
React.createElement(AddItemField, { name: "Cart\u00F3rio", value: getField("../nome") }),
|
|
17
18
|
React.createElement(AddItemField, { name: "QUEM PROTESTOU", value: getField("./nomeCedente") }),
|
|
18
19
|
React.createElement(AddItemField, { name: "ATRAV\u00C9S DE", value: getField("./nomeApresentante") }),
|
|
@@ -103,5 +103,19 @@ export declare const Queries: {
|
|
|
103
103
|
urlData?: Client.Form | undefined;
|
|
104
104
|
}>>;
|
|
105
105
|
};
|
|
106
|
+
GraficosAnaliticos: React.Context<RequestContext<string>> & {
|
|
107
|
+
Request: React.FC<React.PropsWithChildren<{
|
|
108
|
+
data?: {
|
|
109
|
+
documento: string;
|
|
110
|
+
} | undefined;
|
|
111
|
+
urlData?: Client.Form | undefined;
|
|
112
|
+
}>>;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export declare const headerStatus: {
|
|
116
|
+
1: string;
|
|
117
|
+
2: string;
|
|
118
|
+
3: string;
|
|
119
|
+
0: string;
|
|
106
120
|
};
|
|
107
121
|
export {};
|
|
@@ -62,7 +62,7 @@ function CustomProvider(Provider, query) {
|
|
|
62
62
|
: new Error(requestError));
|
|
63
63
|
});
|
|
64
64
|
return function () { return abortController.abort(); };
|
|
65
|
-
}, [
|
|
65
|
+
}, []);
|
|
66
66
|
var value = {
|
|
67
67
|
type: error
|
|
68
68
|
? RequestStatus.Error
|
|
@@ -165,6 +165,7 @@ export var Queries = {
|
|
|
165
165
|
CCF: query("SELECT FROM 'SEEKLOC'.'CCF'"),
|
|
166
166
|
ProcessosJuridicos: query("SELECT FROM 'PROCESSOSJURIDICOS'.'PROCESSOS'"),
|
|
167
167
|
ReclameAqui: query("SELECT FROM 'RECLAMEAQUI'.'CONSULTA'"),
|
|
168
|
+
GraficosAnaliticos: query("SELECT FROM 'DOCUMENTHISTORY'.'BASICHISTORY'")
|
|
168
169
|
};
|
|
169
170
|
var Section = function (_a) {
|
|
170
171
|
var onSuccess = _a.onSuccess, _b = _a.onError, onError = _b === void 0 ? function () { return React.createElement(React.Fragment, null, "Erro"); } : _b, _c = _a.onLoading, onLoading = _c === void 0 ? function () { return React.createElement(React.Fragment, null); } : _c, ctx = _a.ctx, children = _a.children, className = _a.className, _d = _a.hideHeader, hideHeader = _d === void 0 ? false : _d, headerProps = __rest(_a, ["onSuccess", "onError", "onLoading", "ctx", "children", "className", "hideHeader"]);
|
|
@@ -194,7 +195,7 @@ var Section = function (_a) {
|
|
|
194
195
|
React.createElement(Header, __assign({}, headerPropsUnified, { className: cn(className, headerStatus[ctx.type], headerPropsUnified.className), hidden: hideHeader })),
|
|
195
196
|
renderedChildren));
|
|
196
197
|
};
|
|
197
|
-
var headerStatus = (_a = {},
|
|
198
|
+
export var headerStatus = (_a = {},
|
|
198
199
|
_a[RequestStatus.Loading] = "external-source loading",
|
|
199
200
|
_a[RequestStatus.Success] = "success",
|
|
200
201
|
_a[RequestStatus.Error] = "external-source error",
|