@credithub/harlan-components 1.4.1 → 1.5.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/dividasPublicas/dividasPublicas.d.ts +3 -0
- package/lib/cjs/components/dividasPublicas/dividasPublicas.js +89 -0
- package/lib/cjs/components/pep/pep.d.ts +3 -0
- package/lib/cjs/components/pep/pep.js +66 -0
- package/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/utils/string.d.ts +1 -0
- package/lib/cjs/utils/string.js +12 -1
- package/lib/esm/components/dividasPublicas/dividasPublicas.d.ts +3 -0
- package/lib/esm/components/dividasPublicas/dividasPublicas.js +61 -0
- package/lib/esm/components/pep/pep.d.ts +3 -0
- package/lib/esm/components/pep/pep.js +38 -0
- package/lib/esm/index.d.ts +2 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/utils/string.d.ts +1 -0
- package/lib/esm/utils/string.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
26
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
27
|
+
if (ar || !(i in from)) {
|
|
28
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
29
|
+
ar[i] = from[i];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
var react_1 = __importStar(require("react"));
|
|
39
|
+
var webservice_1 = require("../webservice");
|
|
40
|
+
var xpath_1 = __importDefault(require("../../utils/xpath"));
|
|
41
|
+
var result_1 = require("../interface/result");
|
|
42
|
+
var addItem_1 = __importDefault(require("../common/addItem"));
|
|
43
|
+
var number_1 = require("../../utils/number");
|
|
44
|
+
var DividasPublicas = function () {
|
|
45
|
+
var ctx = (0, react_1.useContext)(webservice_1.Queries.Finder);
|
|
46
|
+
var Section = ctx.Section;
|
|
47
|
+
return (react_1.default.createElement(Section, { title: "Dividas P\u00FAblicas", subtitle: "Vejas As D\u00EDvidas P\u00FAblicas Com A Uni\u00E3o (Ativa, Fgts E Previdenciaria)", onSuccess: function (document) {
|
|
48
|
+
var parseDividas = function (tipo) { return function (divida) { return ({
|
|
49
|
+
nomeDoDevedor: xpath_1.default.select('string(./nome_devedor)', divida),
|
|
50
|
+
tipoDePessoa: xpath_1.default.select('string(./tipo_pessoa)', divida),
|
|
51
|
+
tipoDeDevedor: xpath_1.default.select('string(./tipo_devedor)', divida),
|
|
52
|
+
unidadeResponsavel: xpath_1.default.select('string(./unidade_responsavel)', divida),
|
|
53
|
+
uFDaUnidadeResponsavel: xpath_1.default.select('string(./uf_unidade_responsavel)', divida),
|
|
54
|
+
numeroDeInscricaoDaDivida: xpath_1.default.select('string(./numero_inscricao)', divida),
|
|
55
|
+
tipoDaSituacaoDaInscricao: xpath_1.default.select('string(./tipo_situacao_inscricao)', divida),
|
|
56
|
+
situacaoDaInscricao: xpath_1.default.select('string(./situacao_inscricao)', divida),
|
|
57
|
+
dataDeInscricao: xpath_1.default.select('string(./data_inscricao)', divida),
|
|
58
|
+
indicadorAjuizado: xpath_1.default.select('string(./indicador_ajuizado)', divida),
|
|
59
|
+
valorConsolidado: (0, number_1.formatMoney)(xpath_1.default.select('string(./valor_consolidado)', divida)),
|
|
60
|
+
tipoDeDivida: tipo
|
|
61
|
+
}); }; };
|
|
62
|
+
var dividas = __spreadArray(__spreadArray(__spreadArray([], xpath_1.default.select('//dividas/fgts/divida', document).map(parseDividas('FGTS')), true), xpath_1.default.select('//dividas/previdenciaria/divida', document).map(parseDividas('Previdenciária')), true), xpath_1.default.select('//dividas/ativa-geral/divida', document).map(parseDividas('Divida Ativa União')), true);
|
|
63
|
+
var children = (react_1.default.createElement(result_1.Result, null,
|
|
64
|
+
react_1.default.createElement(DividasPublicasList, { dividas: dividas })));
|
|
65
|
+
return {
|
|
66
|
+
children: children,
|
|
67
|
+
className: ((dividas === null || dividas === void 0 ? void 0 : dividas.length) && "gradient-error") || "",
|
|
68
|
+
description: (dividas === null || dividas === void 0 ? void 0 : dividas.length) ? "".concat(dividas === null || dividas === void 0 ? void 0 : dividas.length, " d\u00EDvidas encontradas") : 'Nenhuma dívida pública encontrada'
|
|
69
|
+
};
|
|
70
|
+
} }));
|
|
71
|
+
};
|
|
72
|
+
var DividasPublicasList = (0, react_1.memo)(function (_a) {
|
|
73
|
+
var dividas = _a.dividas;
|
|
74
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, dividas.map(function (divida, i) { return (react_1.default.createElement("div", { className: "container", key: i },
|
|
75
|
+
react_1.default.createElement("div", { className: "content" },
|
|
76
|
+
react_1.default.createElement(addItem_1.default, { name: "Nome do Devedor", value: divida.nomeDoDevedor }),
|
|
77
|
+
react_1.default.createElement(addItem_1.default, { name: "Tipo de Pessoa", value: divida.tipoDePessoa }),
|
|
78
|
+
react_1.default.createElement(addItem_1.default, { name: "Tipo de Devedor", value: divida.tipoDeDevedor }),
|
|
79
|
+
react_1.default.createElement(addItem_1.default, { name: "Unidade Respons\u00E1vel", value: divida.unidadeResponsavel }),
|
|
80
|
+
react_1.default.createElement(addItem_1.default, { name: "UF da Unidade Respons\u00E1vel", value: divida.uFDaUnidadeResponsavel }),
|
|
81
|
+
react_1.default.createElement(addItem_1.default, { name: "N\u00FAmero de inscri\u00E7\u00E3o da D\u00EDvida", value: divida.numeroDeInscricaoDaDivida }),
|
|
82
|
+
react_1.default.createElement(addItem_1.default, { name: "Tipo da Situa\u00E7\u00E3o da Inscri\u00E7\u00E3o", value: divida.tipoDaSituacaoDaInscricao }),
|
|
83
|
+
react_1.default.createElement(addItem_1.default, { name: "Situa\u00E7\u00E3o da Inscri\u00E7\u00E3o", value: divida.situacaoDaInscricao }),
|
|
84
|
+
react_1.default.createElement(addItem_1.default, { name: "Data de Inscri\u00E7\u00E3o", value: divida.dataDeInscricao }),
|
|
85
|
+
react_1.default.createElement(addItem_1.default, { name: "Indicador Aju\u00EDzado", value: divida.indicadorAjuizado }),
|
|
86
|
+
react_1.default.createElement(addItem_1.default, { name: "Valor consolidado", value: divida.valorConsolidado }),
|
|
87
|
+
react_1.default.createElement(addItem_1.default, { name: "Tipo de D\u00EDvida", value: divida.tipoDeDivida })))); })));
|
|
88
|
+
});
|
|
89
|
+
exports.default = DividasPublicas;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var react_1 = __importStar(require("react"));
|
|
30
|
+
var webservice_1 = require("../webservice");
|
|
31
|
+
var xpath_1 = __importDefault(require("../../utils/xpath"));
|
|
32
|
+
var result_1 = require("../interface/result");
|
|
33
|
+
var addItem_1 = __importDefault(require("../common/addItem"));
|
|
34
|
+
var PessoaPoliticamenteExposta = function () {
|
|
35
|
+
var ctx = (0, react_1.useContext)(webservice_1.Queries.Finder);
|
|
36
|
+
var Section = ctx.Section;
|
|
37
|
+
return (react_1.default.createElement(Section, { title: "Pessoa Politicamente Exposta", subtitle: "Vejas As Informa\u00E7\u00F5es Dispon\u00EDveis", onSuccess: function (document) {
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
var data = (_a = xpath_1.default.select('//pep', document)) === null || _a === void 0 ? void 0 : _a[0];
|
|
40
|
+
var pepData = ((_b = data === null || data === void 0 ? void 0 : data.childNodes) === null || _b === void 0 ? void 0 : _b.length) ? parsePepData(data) : null;
|
|
41
|
+
var children = pepData ? (react_1.default.createElement(result_1.Result, null,
|
|
42
|
+
react_1.default.createElement("div", { className: "container" },
|
|
43
|
+
react_1.default.createElement("div", { className: "content" }, FIELDS.map(function (field) { return (react_1.default.createElement(addItem_1.default, { key: field.key, name: field.name, value: pepData[field.key] })); }))))) : null;
|
|
44
|
+
return {
|
|
45
|
+
children: children,
|
|
46
|
+
description: ((_c = data === null || data === void 0 ? void 0 : data.childNodes) === null || _c === void 0 ? void 0 : _c.length) ? '' : 'Não foram encontradas informações de pessoa politicamente exposta.',
|
|
47
|
+
};
|
|
48
|
+
} }));
|
|
49
|
+
};
|
|
50
|
+
var parsePepData = function (data) {
|
|
51
|
+
var pep = Object.fromEntries(FIELDS.map(function (field) { return [
|
|
52
|
+
field.key,
|
|
53
|
+
xpath_1.default.select("string(./".concat(field.key, ")"), data) || 'NÃO INFORMADO',
|
|
54
|
+
]; }));
|
|
55
|
+
return pep;
|
|
56
|
+
};
|
|
57
|
+
var FIELDS = [
|
|
58
|
+
{ key: 'sigla_funcao', name: 'Sigla da Função' },
|
|
59
|
+
{ key: 'descricao_funcao', name: 'Descrição da Função' },
|
|
60
|
+
{ key: 'nivel_Funcao', name: 'Nível da Função' },
|
|
61
|
+
{ key: 'nome_orgao', name: 'Nome do Orgão' },
|
|
62
|
+
{ key: 'data_inicio_exercicio', name: 'Data de Início do Exercício' },
|
|
63
|
+
{ key: 'data_fim_exercicio', name: 'Data de Fim do Exercício' },
|
|
64
|
+
{ key: 'data_fim_carencia', name: 'Data de Fim da Carência' },
|
|
65
|
+
];
|
|
66
|
+
exports.default = PessoaPoliticamenteExposta;
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -15,3 +15,5 @@ export { default as ResultWithoutInformation } from "./components/interface/resu
|
|
|
15
15
|
export * from "./components/webservice";
|
|
16
16
|
export * from "./components/interface/result";
|
|
17
17
|
export { default as ConsultaSimples } from "./consultaSimples";
|
|
18
|
+
export { default as DividasPublicas } from './components/dividasPublicas/dividasPublicas';
|
|
19
|
+
export { default as PessoaPoliticamenteExposta } from './components/pep/pep';
|
package/lib/cjs/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.ConsultaSimples = exports.ResultWithoutInformation = exports.BankAccounts = exports.CustomChartSection = exports.Chart = exports.Addresses = exports.ProcessosJuridicos = exports.Dossie = exports.CCF = exports.Protestos = exports.Partners = exports.Contacts = exports.AddItemField = exports.Loading = exports.Header = exports.Section = void 0;
|
|
20
|
+
exports.PessoaPoliticamenteExposta = exports.DividasPublicas = exports.ConsultaSimples = exports.ResultWithoutInformation = exports.BankAccounts = exports.CustomChartSection = exports.Chart = exports.Addresses = exports.ProcessosJuridicos = exports.Dossie = exports.CCF = exports.Protestos = exports.Partners = exports.Contacts = exports.AddItemField = exports.Loading = exports.Header = exports.Section = void 0;
|
|
21
21
|
var section_1 = require("./components/interface/section");
|
|
22
22
|
Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return __importDefault(section_1).default; } });
|
|
23
23
|
var header_1 = require("./components/interface/header");
|
|
@@ -51,3 +51,7 @@ __exportStar(require("./components/webservice"), exports);
|
|
|
51
51
|
__exportStar(require("./components/interface/result"), exports);
|
|
52
52
|
var consultaSimples_1 = require("./consultaSimples");
|
|
53
53
|
Object.defineProperty(exports, "ConsultaSimples", { enumerable: true, get: function () { return __importDefault(consultaSimples_1).default; } });
|
|
54
|
+
var dividasPublicas_1 = require("./components/dividasPublicas/dividasPublicas");
|
|
55
|
+
Object.defineProperty(exports, "DividasPublicas", { enumerable: true, get: function () { return __importDefault(dividasPublicas_1).default; } });
|
|
56
|
+
var pep_1 = require("./components/pep/pep");
|
|
57
|
+
Object.defineProperty(exports, "PessoaPoliticamenteExposta", { enumerable: true, get: function () { return __importDefault(pep_1).default; } });
|
|
@@ -2,3 +2,4 @@ export declare function formatCpf(cpf: string): string;
|
|
|
2
2
|
export declare function formatCnpj(cnpj: string): string;
|
|
3
3
|
export declare function isCnpj(documento: string): boolean;
|
|
4
4
|
export declare function formatDatePtBrToDate(date: string): Date;
|
|
5
|
+
export declare function capitalize(value: string): string | null;
|
package/lib/cjs/utils/string.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatDatePtBrToDate = exports.isCnpj = exports.formatCnpj = exports.formatCpf = void 0;
|
|
3
|
+
exports.capitalize = exports.formatDatePtBrToDate = exports.isCnpj = exports.formatCnpj = exports.formatCpf = void 0;
|
|
4
4
|
function formatCpf(cpf) {
|
|
5
5
|
cpf = cpf.replace(/[^0-9]/g, "");
|
|
6
6
|
if (cpf.length !== 11)
|
|
@@ -25,3 +25,14 @@ function formatDatePtBrToDate(date) {
|
|
|
25
25
|
return new Date((_b = (_a = date === null || date === void 0 ? void 0 : date.split('/')) === null || _a === void 0 ? void 0 : _a.reverse()) === null || _b === void 0 ? void 0 : _b.join('-'));
|
|
26
26
|
}
|
|
27
27
|
exports.formatDatePtBrToDate = formatDatePtBrToDate;
|
|
28
|
+
function capitalize(value) {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
if (!value)
|
|
31
|
+
return null;
|
|
32
|
+
var words = (_a = value === null || value === void 0 ? void 0 : value.toLocaleLowerCase()) === null || _a === void 0 ? void 0 : _a.split(" ");
|
|
33
|
+
for (var i = 0; i < words.length; i++) {
|
|
34
|
+
words[i] = ((_b = words[i][0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) + ((_c = words[i]) === null || _c === void 0 ? void 0 : _c.substr(1));
|
|
35
|
+
}
|
|
36
|
+
return words.join(" ");
|
|
37
|
+
}
|
|
38
|
+
exports.capitalize = capitalize;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import React, { memo, useContext } from "react";
|
|
11
|
+
import { Queries } from "../webservice";
|
|
12
|
+
import XPathUtils from "../../utils/xpath";
|
|
13
|
+
import { Result } from "../interface/result";
|
|
14
|
+
import AddItemField from "../common/addItem";
|
|
15
|
+
import { formatMoney } from "../../utils/number";
|
|
16
|
+
var DividasPublicas = function () {
|
|
17
|
+
var ctx = useContext(Queries.Finder);
|
|
18
|
+
var Section = ctx.Section;
|
|
19
|
+
return (React.createElement(Section, { title: "Dividas P\u00FAblicas", subtitle: "Vejas As D\u00EDvidas P\u00FAblicas Com A Uni\u00E3o (Ativa, Fgts E Previdenciaria)", onSuccess: function (document) {
|
|
20
|
+
var parseDividas = function (tipo) { return function (divida) { return ({
|
|
21
|
+
nomeDoDevedor: XPathUtils.select('string(./nome_devedor)', divida),
|
|
22
|
+
tipoDePessoa: XPathUtils.select('string(./tipo_pessoa)', divida),
|
|
23
|
+
tipoDeDevedor: XPathUtils.select('string(./tipo_devedor)', divida),
|
|
24
|
+
unidadeResponsavel: XPathUtils.select('string(./unidade_responsavel)', divida),
|
|
25
|
+
uFDaUnidadeResponsavel: XPathUtils.select('string(./uf_unidade_responsavel)', divida),
|
|
26
|
+
numeroDeInscricaoDaDivida: XPathUtils.select('string(./numero_inscricao)', divida),
|
|
27
|
+
tipoDaSituacaoDaInscricao: XPathUtils.select('string(./tipo_situacao_inscricao)', divida),
|
|
28
|
+
situacaoDaInscricao: XPathUtils.select('string(./situacao_inscricao)', divida),
|
|
29
|
+
dataDeInscricao: XPathUtils.select('string(./data_inscricao)', divida),
|
|
30
|
+
indicadorAjuizado: XPathUtils.select('string(./indicador_ajuizado)', divida),
|
|
31
|
+
valorConsolidado: formatMoney(XPathUtils.select('string(./valor_consolidado)', divida)),
|
|
32
|
+
tipoDeDivida: tipo
|
|
33
|
+
}); }; };
|
|
34
|
+
var dividas = __spreadArray(__spreadArray(__spreadArray([], XPathUtils.select('//dividas/fgts/divida', document).map(parseDividas('FGTS')), true), XPathUtils.select('//dividas/previdenciaria/divida', document).map(parseDividas('Previdenciária')), true), XPathUtils.select('//dividas/ativa-geral/divida', document).map(parseDividas('Divida Ativa União')), true);
|
|
35
|
+
var children = (React.createElement(Result, null,
|
|
36
|
+
React.createElement(DividasPublicasList, { dividas: dividas })));
|
|
37
|
+
return {
|
|
38
|
+
children: children,
|
|
39
|
+
className: ((dividas === null || dividas === void 0 ? void 0 : dividas.length) && "gradient-error") || "",
|
|
40
|
+
description: (dividas === null || dividas === void 0 ? void 0 : dividas.length) ? "".concat(dividas === null || dividas === void 0 ? void 0 : dividas.length, " d\u00EDvidas encontradas") : 'Nenhuma dívida pública encontrada'
|
|
41
|
+
};
|
|
42
|
+
} }));
|
|
43
|
+
};
|
|
44
|
+
var DividasPublicasList = memo(function (_a) {
|
|
45
|
+
var dividas = _a.dividas;
|
|
46
|
+
return (React.createElement(React.Fragment, null, dividas.map(function (divida, i) { return (React.createElement("div", { className: "container", key: i },
|
|
47
|
+
React.createElement("div", { className: "content" },
|
|
48
|
+
React.createElement(AddItemField, { name: "Nome do Devedor", value: divida.nomeDoDevedor }),
|
|
49
|
+
React.createElement(AddItemField, { name: "Tipo de Pessoa", value: divida.tipoDePessoa }),
|
|
50
|
+
React.createElement(AddItemField, { name: "Tipo de Devedor", value: divida.tipoDeDevedor }),
|
|
51
|
+
React.createElement(AddItemField, { name: "Unidade Respons\u00E1vel", value: divida.unidadeResponsavel }),
|
|
52
|
+
React.createElement(AddItemField, { name: "UF da Unidade Respons\u00E1vel", value: divida.uFDaUnidadeResponsavel }),
|
|
53
|
+
React.createElement(AddItemField, { name: "N\u00FAmero de inscri\u00E7\u00E3o da D\u00EDvida", value: divida.numeroDeInscricaoDaDivida }),
|
|
54
|
+
React.createElement(AddItemField, { name: "Tipo da Situa\u00E7\u00E3o da Inscri\u00E7\u00E3o", value: divida.tipoDaSituacaoDaInscricao }),
|
|
55
|
+
React.createElement(AddItemField, { name: "Situa\u00E7\u00E3o da Inscri\u00E7\u00E3o", value: divida.situacaoDaInscricao }),
|
|
56
|
+
React.createElement(AddItemField, { name: "Data de Inscri\u00E7\u00E3o", value: divida.dataDeInscricao }),
|
|
57
|
+
React.createElement(AddItemField, { name: "Indicador Aju\u00EDzado", value: divida.indicadorAjuizado }),
|
|
58
|
+
React.createElement(AddItemField, { name: "Valor consolidado", value: divida.valorConsolidado }),
|
|
59
|
+
React.createElement(AddItemField, { name: "Tipo de D\u00EDvida", value: divida.tipoDeDivida })))); })));
|
|
60
|
+
});
|
|
61
|
+
export default DividasPublicas;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { Queries } from "../webservice";
|
|
3
|
+
import XPathUtils from "../../utils/xpath";
|
|
4
|
+
import { Result } from "../interface/result";
|
|
5
|
+
import AddItemField from "../common/addItem";
|
|
6
|
+
var PessoaPoliticamenteExposta = function () {
|
|
7
|
+
var ctx = useContext(Queries.Finder);
|
|
8
|
+
var Section = ctx.Section;
|
|
9
|
+
return (React.createElement(Section, { title: "Pessoa Politicamente Exposta", subtitle: "Vejas As Informa\u00E7\u00F5es Dispon\u00EDveis", onSuccess: function (document) {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
var data = (_a = XPathUtils.select('//pep', document)) === null || _a === void 0 ? void 0 : _a[0];
|
|
12
|
+
var pepData = ((_b = data === null || data === void 0 ? void 0 : data.childNodes) === null || _b === void 0 ? void 0 : _b.length) ? parsePepData(data) : null;
|
|
13
|
+
var children = pepData ? (React.createElement(Result, null,
|
|
14
|
+
React.createElement("div", { className: "container" },
|
|
15
|
+
React.createElement("div", { className: "content" }, FIELDS.map(function (field) { return (React.createElement(AddItemField, { key: field.key, name: field.name, value: pepData[field.key] })); }))))) : null;
|
|
16
|
+
return {
|
|
17
|
+
children: children,
|
|
18
|
+
description: ((_c = data === null || data === void 0 ? void 0 : data.childNodes) === null || _c === void 0 ? void 0 : _c.length) ? '' : 'Não foram encontradas informações de pessoa politicamente exposta.',
|
|
19
|
+
};
|
|
20
|
+
} }));
|
|
21
|
+
};
|
|
22
|
+
var parsePepData = function (data) {
|
|
23
|
+
var pep = Object.fromEntries(FIELDS.map(function (field) { return [
|
|
24
|
+
field.key,
|
|
25
|
+
XPathUtils.select("string(./".concat(field.key, ")"), data) || 'NÃO INFORMADO',
|
|
26
|
+
]; }));
|
|
27
|
+
return pep;
|
|
28
|
+
};
|
|
29
|
+
var FIELDS = [
|
|
30
|
+
{ key: 'sigla_funcao', name: 'Sigla da Função' },
|
|
31
|
+
{ key: 'descricao_funcao', name: 'Descrição da Função' },
|
|
32
|
+
{ key: 'nivel_Funcao', name: 'Nível da Função' },
|
|
33
|
+
{ key: 'nome_orgao', name: 'Nome do Orgão' },
|
|
34
|
+
{ key: 'data_inicio_exercicio', name: 'Data de Início do Exercício' },
|
|
35
|
+
{ key: 'data_fim_exercicio', name: 'Data de Fim do Exercício' },
|
|
36
|
+
{ key: 'data_fim_carencia', name: 'Data de Fim da Carência' },
|
|
37
|
+
];
|
|
38
|
+
export default PessoaPoliticamenteExposta;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -15,3 +15,5 @@ export { default as ResultWithoutInformation } from "./components/interface/resu
|
|
|
15
15
|
export * from "./components/webservice";
|
|
16
16
|
export * from "./components/interface/result";
|
|
17
17
|
export { default as ConsultaSimples } from "./consultaSimples";
|
|
18
|
+
export { default as DividasPublicas } from './components/dividasPublicas/dividasPublicas';
|
|
19
|
+
export { default as PessoaPoliticamenteExposta } from './components/pep/pep';
|
package/lib/esm/index.js
CHANGED
|
@@ -15,3 +15,5 @@ export { default as ResultWithoutInformation } from "./components/interface/resu
|
|
|
15
15
|
export * from "./components/webservice";
|
|
16
16
|
export * from "./components/interface/result";
|
|
17
17
|
export { default as ConsultaSimples } from "./consultaSimples";
|
|
18
|
+
export { default as DividasPublicas } from './components/dividasPublicas/dividasPublicas';
|
|
19
|
+
export { default as PessoaPoliticamenteExposta } from './components/pep/pep';
|
|
@@ -2,3 +2,4 @@ export declare function formatCpf(cpf: string): string;
|
|
|
2
2
|
export declare function formatCnpj(cnpj: string): string;
|
|
3
3
|
export declare function isCnpj(documento: string): boolean;
|
|
4
4
|
export declare function formatDatePtBrToDate(date: string): Date;
|
|
5
|
+
export declare function capitalize(value: string): string | null;
|
package/lib/esm/utils/string.js
CHANGED
|
@@ -18,3 +18,13 @@ export function formatDatePtBrToDate(date) {
|
|
|
18
18
|
var _a, _b;
|
|
19
19
|
return new Date((_b = (_a = date === null || date === void 0 ? void 0 : date.split('/')) === null || _a === void 0 ? void 0 : _a.reverse()) === null || _b === void 0 ? void 0 : _b.join('-'));
|
|
20
20
|
}
|
|
21
|
+
export function capitalize(value) {
|
|
22
|
+
var _a, _b, _c;
|
|
23
|
+
if (!value)
|
|
24
|
+
return null;
|
|
25
|
+
var words = (_a = value === null || value === void 0 ? void 0 : value.toLocaleLowerCase()) === null || _a === void 0 ? void 0 : _a.split(" ");
|
|
26
|
+
for (var i = 0; i < words.length; i++) {
|
|
27
|
+
words[i] = ((_b = words[i][0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) + ((_c = words[i]) === null || _c === void 0 ? void 0 : _c.substr(1));
|
|
28
|
+
}
|
|
29
|
+
return words.join(" ");
|
|
30
|
+
}
|