@credithub/harlan-components 1.3.3 → 1.4.0
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/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/webservice.d.ts +14 -0
- package/lib/cjs/components/webservice.js +7 -6
- 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/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/webservice.d.ts +14 -0
- package/lib/esm/components/webservice.js +4 -3
- 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,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;
|
|
@@ -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."
|
|
@@ -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
|
|
@@ -161,10 +161,11 @@ export function query(query) {
|
|
|
161
161
|
}
|
|
162
162
|
export var Queries = {
|
|
163
163
|
Finder: query("SELECT FROM 'FINDER'.'BILLING'"),
|
|
164
|
-
Protestos: query("SELECT FROM '
|
|
164
|
+
Protestos: query("SELECT FROM 'IEPTB'.'IEPTBHARLAN'"),
|
|
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",
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Section, Contacts, Partners, Dossie, Addresses, CCF, Protestos, ProcessosJuridicos, BankAccounts, WebServiceProvider, Queries, } from "./";
|
|
2
|
+
import { Section, Contacts, Partners, Dossie, Addresses, CCF, Protestos, ProcessosJuridicos, BankAccounts, WebServiceProvider, Queries, CustomChartSection, } from "./";
|
|
3
3
|
var ConsultaSimples = function (_a) {
|
|
4
4
|
var documento = _a.documento, apiKey = _a.apiKey, onClose = _a.onClose;
|
|
5
5
|
return (React.createElement(WebServiceProvider, { credential: apiKey },
|
|
6
6
|
React.createElement(Section, { title: "Consulta Simples", subtitle: "Informa\u00E7\u00F5es agregadas do CPF ou CNPJ", description: "Registro encontrado", onClose: onClose },
|
|
7
7
|
React.createElement(Queries.Finder.Request, { data: { documento: documento } },
|
|
8
|
-
React.createElement(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
React.createElement(Queries.CCF.Request, { data: { documento: documento } },
|
|
9
|
+
React.createElement(Queries.Protestos.Request, { data: { documento: documento } },
|
|
10
|
+
React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
|
|
11
|
+
React.createElement(Dossie, { onOpenNewTransactionModal: console.log }),
|
|
12
|
+
React.createElement(Addresses, { apiKey: apiKey }),
|
|
13
|
+
React.createElement(Contacts, { onClickConsutarEmail: console.log }),
|
|
14
|
+
React.createElement(Partners, null),
|
|
15
|
+
React.createElement(BankAccounts, null),
|
|
16
|
+
React.createElement(Queries.GraficosAnaliticos.Request, { data: { documento: documento } },
|
|
17
|
+
React.createElement(CustomChartSection, { documento: documento })),
|
|
18
|
+
React.createElement(Protestos, null),
|
|
19
|
+
React.createElement(CCF, null),
|
|
20
|
+
React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: console.log }))))))));
|
|
19
21
|
};
|
|
20
22
|
export default ConsultaSimples;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { default as CCF } from "./components/ccf/ccf";
|
|
|
9
9
|
export { default as Dossie } from "./components/dossie/dossie";
|
|
10
10
|
export { default as ProcessosJuridicos } from "./components/processos-juridicos/processosJuridicos";
|
|
11
11
|
export { default as Addresses } from "./components/adresses/adresses";
|
|
12
|
+
export { default as Chart, ResumoDeNegativacoesChartSection as CustomChartSection } from "./components/chart/customChart";
|
|
12
13
|
export { default as BankAccounts } from "./components/bank-accounts/bank-accounts";
|
|
13
14
|
export { default as ResultWithoutInformation } from "./components/interface/resultWithoutInformation";
|
|
14
15
|
export * from "./components/webservice";
|
package/lib/esm/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export { default as CCF } from "./components/ccf/ccf";
|
|
|
9
9
|
export { default as Dossie } from "./components/dossie/dossie";
|
|
10
10
|
export { default as ProcessosJuridicos } from "./components/processos-juridicos/processosJuridicos";
|
|
11
11
|
export { default as Addresses } from "./components/adresses/adresses";
|
|
12
|
+
export { default as Chart, ResumoDeNegativacoesChartSection as CustomChartSection } from "./components/chart/customChart";
|
|
12
13
|
export { default as BankAccounts } from "./components/bank-accounts/bank-accounts";
|
|
13
14
|
export { default as ResultWithoutInformation } from "./components/interface/resultWithoutInformation";
|
|
14
15
|
export * from "./components/webservice";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const mockDataInput: {
|
|
2
|
+
ccfs: {
|
|
3
|
+
data: string;
|
|
4
|
+
quantidade: number;
|
|
5
|
+
creation: string;
|
|
6
|
+
valorTotal: number;
|
|
7
|
+
}[];
|
|
8
|
+
protestos: {
|
|
9
|
+
data: string;
|
|
10
|
+
categoria: string;
|
|
11
|
+
quantidade: number;
|
|
12
|
+
creation: string;
|
|
13
|
+
valorTotal: number;
|
|
14
|
+
}[];
|
|
15
|
+
serasa: {
|
|
16
|
+
data: string;
|
|
17
|
+
quantidade: number;
|
|
18
|
+
creation: string;
|
|
19
|
+
valorTotal: number;
|
|
20
|
+
}[];
|
|
21
|
+
boaVista: {
|
|
22
|
+
data: string;
|
|
23
|
+
quantidade: number;
|
|
24
|
+
creation: string;
|
|
25
|
+
valorTotal: number;
|
|
26
|
+
}[];
|
|
27
|
+
dividasPublicasGrafico: {
|
|
28
|
+
data: string;
|
|
29
|
+
quantidade: number;
|
|
30
|
+
creation: string;
|
|
31
|
+
valorTotal: number;
|
|
32
|
+
}[];
|
|
33
|
+
};
|
|
34
|
+
export default mockDataInput;
|