@credithub/harlan-components 1.20.9 → 1.20.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +3471 -5608
- package/lib/esm/index.js +58948 -26
- package/package.json +3 -3
- package/lib/esm/assets/btn/btnWrapper.d.ts +0 -2
- package/lib/esm/assets/btn/btnWrapper.js +0 -9
- package/lib/esm/assets/btn/chevronDown.d.ts +0 -3
- package/lib/esm/assets/btn/chevronDown.js +0 -29
- package/lib/esm/assets/btn/chevronLeft.d.ts +0 -3
- package/lib/esm/assets/btn/chevronLeft.js +0 -30
- package/lib/esm/assets/btn/chevronRight.d.ts +0 -3
- package/lib/esm/assets/btn/chevronRight.js +0 -30
- package/lib/esm/assets/btn/chevronUp.d.ts +0 -3
- package/lib/esm/assets/btn/chevronUp.js +0 -30
- package/lib/esm/assets/btn/closeIcon.d.ts +0 -3
- package/lib/esm/assets/btn/closeIcon.js +0 -29
- package/lib/esm/assets/btn/thumbDown.d.ts +0 -7
- package/lib/esm/assets/btn/thumbDown.js +0 -11
- package/lib/esm/assets/btn/thumbUp.d.ts +0 -7
- package/lib/esm/assets/btn/thumbUp.js +0 -11
- package/lib/esm/assets/icones/chequesSemFundo.d.ts +0 -4
- package/lib/esm/assets/icones/chequesSemFundo.js +0 -12
- package/lib/esm/assets/icones/consultaSimples.d.ts +0 -4
- package/lib/esm/assets/icones/consultaSimples.js +0 -12
- package/lib/esm/assets/icones/contasBancarias.d.ts +0 -4
- package/lib/esm/assets/icones/contasBancarias.js +0 -12
- package/lib/esm/assets/icones/contato.d.ts +0 -4
- package/lib/esm/assets/icones/contato.js +0 -12
- package/lib/esm/assets/icones/dividasVencidasSerasa.d.ts +0 -4
- package/lib/esm/assets/icones/dividasVencidasSerasa.js +0 -9
- package/lib/esm/assets/icones/dominios.d.ts +0 -4
- package/lib/esm/assets/icones/dominios.js +0 -9
- package/lib/esm/assets/icones/endereco.d.ts +0 -4
- package/lib/esm/assets/icones/endereco.js +0 -12
- package/lib/esm/assets/icones/iconeEmpresa.d.ts +0 -8
- package/lib/esm/assets/icones/iconeEmpresa.js +0 -12
- package/lib/esm/assets/icones/iconePessoa.d.ts +0 -9
- package/lib/esm/assets/icones/iconePessoa.js +0 -12
- package/lib/esm/assets/icones/imoveis.d.ts +0 -4
- package/lib/esm/assets/icones/imoveis.js +0 -9
- package/lib/esm/assets/icones/pefinRefinBoaVista.d.ts +0 -4
- package/lib/esm/assets/icones/pefinRefinBoaVista.js +0 -9
- package/lib/esm/assets/icones/pefinRefinSerasa.d.ts +0 -4
- package/lib/esm/assets/icones/pefinRefinSerasa.js +0 -11
- package/lib/esm/assets/icones/processosJuridicos.d.ts +0 -4
- package/lib/esm/assets/icones/processosJuridicos.js +0 -12
- package/lib/esm/assets/icones/protestos.d.ts +0 -4
- package/lib/esm/assets/icones/protestos.js +0 -12
- package/lib/esm/assets/icones/protestosCredito.d.ts +0 -4
- package/lib/esm/assets/icones/protestosCredito.js +0 -12
- package/lib/esm/assets/icones/protestosGerais.d.ts +0 -4
- package/lib/esm/assets/icones/protestosGerais.js +0 -12
- package/lib/esm/assets/icones/protestosImpostos.d.ts +0 -4
- package/lib/esm/assets/icones/protestosImpostos.js +0 -12
- package/lib/esm/assets/icones/quadroSocietario.d.ts +0 -4
- package/lib/esm/assets/icones/quadroSocietario.js +0 -12
- package/lib/esm/assets/icones/resumoNegativacoes.d.ts +0 -4
- package/lib/esm/assets/icones/resumoNegativacoes.js +0 -11
- package/lib/esm/assets/icones/scoreBoaVista.d.ts +0 -4
- package/lib/esm/assets/icones/scoreBoaVista.js +0 -9
- package/lib/esm/assets/icones/scr.d.ts +0 -4
- package/lib/esm/assets/icones/scr.js +0 -9
- package/lib/esm/assets/icones/ultimaMovimentacao.d.ts +0 -4
- package/lib/esm/assets/icones/ultimaMovimentacao.js +0 -12
- package/lib/esm/assets/icones/veiculos.d.ts +0 -4
- package/lib/esm/assets/icones/veiculos.js +0 -9
- package/lib/esm/components/adresses/addresses.d.ts +0 -19
- package/lib/esm/components/adresses/addresses.js +0 -50
- package/lib/esm/components/adresses/getGeocode.d.ts +0 -6
- package/lib/esm/components/adresses/getGeocode.js +0 -69
- package/lib/esm/components/adresses/map.d.ts +0 -11
- package/lib/esm/components/adresses/map.js +0 -25
- package/lib/esm/components/bank-accounts/bank-accounts.d.ts +0 -3
- package/lib/esm/components/bank-accounts/bank-accounts.js +0 -32
- package/lib/esm/components/ccf/ccf.d.ts +0 -3
- package/lib/esm/components/ccf/ccf.js +0 -37
- package/lib/esm/components/ccf/ccfList.d.ts +0 -12
- package/lib/esm/components/ccf/ccfList.js +0 -24
- package/lib/esm/components/chart/chartContent.d.ts +0 -6
- package/lib/esm/components/chart/chartContent.js +0 -50
- package/lib/esm/components/chart/chartSystem.d.ts +0 -6
- package/lib/esm/components/chart/chartSystem.js +0 -61
- package/lib/esm/components/chart/components/MixedChart.d.ts +0 -7
- package/lib/esm/components/chart/components/MixedChart.js +0 -30
- package/lib/esm/components/chart/components/PieChart.d.ts +0 -7
- package/lib/esm/components/chart/components/PieChart.js +0 -9
- package/lib/esm/components/chart/components/categoryProtestos.d.ts +0 -7
- package/lib/esm/components/chart/components/categoryProtestos.js +0 -17
- package/lib/esm/components/chart/hooks/useCategoryProtestos.d.ts +0 -6
- package/lib/esm/components/chart/hooks/useCategoryProtestos.js +0 -71
- package/lib/esm/components/chart/hooks/useChartData.d.ts +0 -8
- package/lib/esm/components/chart/hooks/useChartData.js +0 -64
- package/lib/esm/components/chart/hooks/useMixedChartData.d.ts +0 -10
- package/lib/esm/components/chart/hooks/useMixedChartData.js +0 -43
- package/lib/esm/components/chart/hooks/usePieChartData.d.ts +0 -6
- package/lib/esm/components/chart/hooks/usePieChartData.js +0 -89
- package/lib/esm/components/chart/quantityResult.d.ts +0 -19
- package/lib/esm/components/chart/quantityResult.js +0 -41
- package/lib/esm/components/chart/types/iChart.d.ts +0 -59
- package/lib/esm/components/chart/types/iChart.js +0 -1
- package/lib/esm/components/chart/utils/chartCustomization.d.ts +0 -7
- package/lib/esm/components/chart/utils/chartCustomization.js +0 -154
- package/lib/esm/components/chart/utils/chartUtils.d.ts +0 -11
- package/lib/esm/components/chart/utils/chartUtils.js +0 -38
- package/lib/esm/components/chart/utils/dataManipulation.d.ts +0 -10
- package/lib/esm/components/chart/utils/dataManipulation.js +0 -97
- package/lib/esm/components/chart/utils/dataProcessing.d.ts +0 -3
- package/lib/esm/components/chart/utils/dataProcessing.js +0 -113
- package/lib/esm/components/common/addItem.d.ts +0 -11
- package/lib/esm/components/common/addItem.js +0 -44
- package/lib/esm/components/common/button.d.ts +0 -5
- package/lib/esm/components/common/button.js +0 -41
- package/lib/esm/components/common/carousel.d.ts +0 -4
- package/lib/esm/components/common/carousel.js +0 -19
- package/lib/esm/components/common/content.d.ts +0 -4
- package/lib/esm/components/common/content.js +0 -8
- package/lib/esm/components/consultaRfb.d.ts +0 -16
- package/lib/esm/components/consultaRfb.js +0 -21
- package/lib/esm/components/consultaSimplesSection/consultaSimplesSection.d.ts +0 -6
- package/lib/esm/components/consultaSimplesSection/consultaSimplesSection.js +0 -93
- package/lib/esm/components/consultasComplementares.d.ts +0 -29
- package/lib/esm/components/consultasComplementares.js +0 -32
- package/lib/esm/components/contacts/contactLikeDislikeSection.d.ts +0 -8
- package/lib/esm/components/contacts/contactLikeDislikeSection.js +0 -68
- package/lib/esm/components/contacts/contacts.d.ts +0 -18
- package/lib/esm/components/contacts/contacts.js +0 -60
- package/lib/esm/components/contacts/contactsLikeDislike.d.ts +0 -9
- package/lib/esm/components/contacts/contactsLikeDislike.js +0 -7
- package/lib/esm/components/contacts/thumbsButton.d.ts +0 -9
- package/lib/esm/components/contacts/thumbsButton.js +0 -41
- package/lib/esm/components/dividasPublicas/dividasPublicas.d.ts +0 -3
- package/lib/esm/components/dividasPublicas/dividasPublicas.js +0 -67
- package/lib/esm/components/dominios/dominios.d.ts +0 -3
- package/lib/esm/components/dominios/dominios.js +0 -29
- package/lib/esm/components/dossie/carrousel/carrousel.d.ts +0 -8
- package/lib/esm/components/dossie/carrousel/carrousel.js +0 -15
- package/lib/esm/components/dossie/companyLogo/companyLogo.d.ts +0 -7
- package/lib/esm/components/dossie/companyLogo/companyLogo.js +0 -25
- package/lib/esm/components/dossie/dossie.d.ts +0 -9
- package/lib/esm/components/dossie/dossie.js +0 -44
- package/lib/esm/components/dossie/summary/cardsAndProducts.d.ts +0 -21
- package/lib/esm/components/dossie/summary/cardsAndProducts.js +0 -209
- package/lib/esm/components/dossie/summary/summary.d.ts +0 -20
- package/lib/esm/components/dossie/summary/summary.js +0 -38
- package/lib/esm/components/dossie/summary/utils.d.ts +0 -10
- package/lib/esm/components/dossie/summary/utils.js +0 -29
- package/lib/esm/components/dossie/transactionTable/transactionTable.d.ts +0 -6
- package/lib/esm/components/dossie/transactionTable/transactionTable.js +0 -33
- package/lib/esm/components/imoveis/imoveisService.d.ts +0 -6
- package/lib/esm/components/imoveis/imoveisService.js +0 -51
- package/lib/esm/components/imoveis/types.d.ts +0 -24
- package/lib/esm/components/imoveis/types.js +0 -1
- package/lib/esm/components/interface/globalStyle.d.ts +0 -2
- package/lib/esm/components/interface/globalStyle.js +0 -9
- package/lib/esm/components/interface/header.d.ts +0 -23
- package/lib/esm/components/interface/header.js +0 -72
- package/lib/esm/components/interface/loading.d.ts +0 -2
- package/lib/esm/components/interface/loading.js +0 -8
- package/lib/esm/components/interface/loadingBar.d.ts +0 -5
- package/lib/esm/components/interface/loadingBar.js +0 -41
- package/lib/esm/components/interface/responsiveGrid.d.ts +0 -9
- package/lib/esm/components/interface/responsiveGrid.js +0 -8
- package/lib/esm/components/interface/result.d.ts +0 -10
- package/lib/esm/components/interface/result.js +0 -18
- package/lib/esm/components/interface/resultWithoutInformation.d.ts +0 -4
- package/lib/esm/components/interface/resultWithoutInformation.js +0 -32
- package/lib/esm/components/interface/section.d.ts +0 -10
- package/lib/esm/components/interface/section.js +0 -30
- package/lib/esm/components/interface/statusMessage.d.ts +0 -7
- package/lib/esm/components/interface/statusMessage.js +0 -25
- package/lib/esm/components/interface/theme.d.ts +0 -73
- package/lib/esm/components/interface/theme.js +0 -73
- package/lib/esm/components/liminar/liminar.d.ts +0 -3
- package/lib/esm/components/liminar/liminar.js +0 -24
- package/lib/esm/components/liminar/types.d.ts +0 -3
- package/lib/esm/components/liminar/types.js +0 -1
- package/lib/esm/components/partners/partner-dividas-publicas.d.ts +0 -5
- package/lib/esm/components/partners/partner-dividas-publicas.js +0 -10
- package/lib/esm/components/partners/partner-protestos.d.ts +0 -5
- package/lib/esm/components/partners/partner-protestos.js +0 -10
- package/lib/esm/components/partners/partner-rfb-status.d.ts +0 -5
- package/lib/esm/components/partners/partner-rfb-status.js +0 -10
- package/lib/esm/components/partners/partnerField.d.ts +0 -9
- package/lib/esm/components/partners/partnerField.js +0 -9
- package/lib/esm/components/partners/partnerList.d.ts +0 -17
- package/lib/esm/components/partners/partnerList.js +0 -28
- package/lib/esm/components/partners/partners.d.ts +0 -5
- package/lib/esm/components/partners/partners.js +0 -52
- package/lib/esm/components/pep/pep.d.ts +0 -3
- package/lib/esm/components/pep/pep.js +0 -41
- package/lib/esm/components/processos-juridicos/envolvidosList.d.ts +0 -10
- package/lib/esm/components/processos-juridicos/envolvidosList.js +0 -24
- package/lib/esm/components/processos-juridicos/processosJuridicos.d.ts +0 -5
- package/lib/esm/components/processos-juridicos/processosJuridicos.js +0 -26
- package/lib/esm/components/processos-juridicos/processosJuridicosList.d.ts +0 -7
- package/lib/esm/components/processos-juridicos/processosJuridicosList.js +0 -64
- package/lib/esm/components/processos-juridicos/types.d.ts +0 -27
- package/lib/esm/components/processos-juridicos/types.js +0 -1
- package/lib/esm/components/protestos/getTotalProtestos.d.ts +0 -1
- package/lib/esm/components/protestos/getTotalProtestos.js +0 -4
- package/lib/esm/components/protestos/protestos.d.ts +0 -3
- package/lib/esm/components/protestos/protestos.js +0 -74
- package/lib/esm/components/protestos/protestosCategory.d.ts +0 -7
- package/lib/esm/components/protestos/protestosCategory.js +0 -46
- package/lib/esm/components/protestos/protestosList.d.ts +0 -36
- package/lib/esm/components/protestos/protestosList.js +0 -120
- package/lib/esm/components/reclameAqui/reclameAquiCarousel.d.ts +0 -5
- package/lib/esm/components/reclameAqui/reclameAquiCarousel.js +0 -100
- package/lib/esm/components/reclameAqui/types.d.ts +0 -31
- package/lib/esm/components/reclameAqui/types.js +0 -1
- package/lib/esm/components/refinBoaVista/refinBoaVista.d.ts +0 -22
- package/lib/esm/components/refinBoaVista/refinBoaVista.js +0 -65
- package/lib/esm/components/refinBoaVista/types.d.ts +0 -48
- package/lib/esm/components/refinBoaVista/types.js +0 -4
- package/lib/esm/components/refinSerasa/refinSerasa.d.ts +0 -22
- package/lib/esm/components/refinSerasa/refinSerasa.js +0 -119
- package/lib/esm/components/refinSerasa/types.d.ts +0 -48
- package/lib/esm/components/refinSerasa/types.js +0 -1
- package/lib/esm/components/resultadoDaPesquisa/resultado-da-pesquisa.d.ts +0 -5
- package/lib/esm/components/resultadoDaPesquisa/resultado-da-pesquisa.js +0 -26
- package/lib/esm/components/score/scoreService.d.ts +0 -6
- package/lib/esm/components/score/scoreService.js +0 -43
- package/lib/esm/components/score/types.d.ts +0 -12
- package/lib/esm/components/score/types.js +0 -1
- package/lib/esm/components/scr/getResumoDeCreditos.d.ts +0 -6
- package/lib/esm/components/scr/getResumoDeCreditos.js +0 -79
- package/lib/esm/components/scr/getResumoDeModalidades.d.ts +0 -8
- package/lib/esm/components/scr/getResumoDeModalidades.js +0 -109
- package/lib/esm/components/scr/scr.d.ts +0 -5
- package/lib/esm/components/scr/scr.js +0 -134
- package/lib/esm/components/scr/types.d.ts +0 -87
- package/lib/esm/components/scr/types.js +0 -1
- package/lib/esm/components/veiculos/types.d.ts +0 -0
- package/lib/esm/components/veiculos/types.js +0 -0
- package/lib/esm/components/veiculos/veiculos.d.ts +0 -22
- package/lib/esm/components/veiculos/veiculos.js +0 -70
- package/lib/esm/components/webservice.d.ts +0 -140
- package/lib/esm/components/webservice.js +0 -233
- package/lib/esm/constants/regex.d.ts +0 -2
- package/lib/esm/constants/regex.js +0 -2
- package/lib/esm/consultaSimples.d.ts +0 -13
- package/lib/esm/consultaSimples.js +0 -57
- package/lib/esm/hooks/useConsultaRfb.d.ts +0 -6
- package/lib/esm/hooks/useConsultaRfb.js +0 -9
- package/lib/esm/hooks/useConsultasComplementares.d.ts +0 -1
- package/lib/esm/hooks/useConsultasComplementares.js +0 -9
- package/lib/esm/hooks/useToggle.d.ts +0 -10
- package/lib/esm/hooks/useToggle.js +0 -24
- package/lib/esm/hooks/useWindowSize.d.ts +0 -4
- package/lib/esm/hooks/useWindowSize.js +0 -19
- package/lib/esm/index.d.ts +0 -23
- package/lib/esm/utils/calculation.d.ts +0 -9
- package/lib/esm/utils/calculation.js +0 -17
- package/lib/esm/utils/date.d.ts +0 -1
- package/lib/esm/utils/date.js +0 -6
- package/lib/esm/utils/fillMissingData.d.ts +0 -6
- package/lib/esm/utils/fillMissingData.js +0 -12
- package/lib/esm/utils/formatter.d.ts +0 -2
- package/lib/esm/utils/formatter.js +0 -5
- package/lib/esm/utils/getUniqueDates.d.ts +0 -5
- package/lib/esm/utils/getUniqueDates.js +0 -9
- package/lib/esm/utils/number.d.ts +0 -4
- package/lib/esm/utils/number.js +0 -20
- package/lib/esm/utils/string.d.ts +0 -11
- package/lib/esm/utils/string.js +0 -64
- package/lib/esm/utils/xpath.d.ts +0 -6
- package/lib/esm/utils/xpath.js +0 -21
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
var _a;
|
|
28
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
29
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
30
|
-
import { Client } from '@credithub/webservice';
|
|
31
|
-
import React, { createContext, useState, useContext, useEffect, useMemo, useCallback } from 'react';
|
|
32
|
-
import Header from './interface/header';
|
|
33
|
-
import cn from 'classnames';
|
|
34
|
-
import StatusMessage from './interface/statusMessage';
|
|
35
|
-
import BtnWrapper from '../assets/btn/btnWrapper';
|
|
36
|
-
import useToggle from '../hooks/useToggle';
|
|
37
|
-
import ChevronUp from '../assets/btn/chevronUp';
|
|
38
|
-
import ChevronDown from '../assets/btn/chevronDown';
|
|
39
|
-
import styled from 'styled-components';
|
|
40
|
-
export var WebService = createContext(new Client.WebService());
|
|
41
|
-
export var WebServiceProvider = function (_a) {
|
|
42
|
-
var credential = _a.credential, children = _a.children;
|
|
43
|
-
return (React.createElement(WebService.Provider, { value: new Client.WebService(credential) }, children));
|
|
44
|
-
};
|
|
45
|
-
export var RequestStatus;
|
|
46
|
-
(function (RequestStatus) {
|
|
47
|
-
RequestStatus[RequestStatus["Empty"] = 0] = "Empty";
|
|
48
|
-
RequestStatus[RequestStatus["Loading"] = 1] = "Loading";
|
|
49
|
-
RequestStatus[RequestStatus["Success"] = 2] = "Success";
|
|
50
|
-
RequestStatus[RequestStatus["Error"] = 3] = "Error";
|
|
51
|
-
})(RequestStatus || (RequestStatus = {}));
|
|
52
|
-
function CustomProvider(Provider, query) {
|
|
53
|
-
return function (_a) {
|
|
54
|
-
var children = _a.children, data = _a.data, urlData = _a.urlData;
|
|
55
|
-
var client = useContext(WebService);
|
|
56
|
-
var abortController = useMemo(function () { return new AbortController(); }, []);
|
|
57
|
-
var _b = useState(null), response = _b[0], setResponse = _b[1];
|
|
58
|
-
var _c = useState(null), error = _c[0], setError = _c[1];
|
|
59
|
-
useEffect(function () {
|
|
60
|
-
client
|
|
61
|
-
.request(query, data, urlData, abortController.signal)
|
|
62
|
-
.then(function (response) {
|
|
63
|
-
return Client.WebService.parse(response).then(function (document) { return ({
|
|
64
|
-
response: response,
|
|
65
|
-
document: document
|
|
66
|
-
}); });
|
|
67
|
-
})
|
|
68
|
-
.then(function (document) { return setResponse(document); })
|
|
69
|
-
.catch(function (requestError) {
|
|
70
|
-
return setError(requestError instanceof Error
|
|
71
|
-
? requestError
|
|
72
|
-
: new Error(requestError));
|
|
73
|
-
});
|
|
74
|
-
return function () { return abortController.abort(); };
|
|
75
|
-
}, []);
|
|
76
|
-
var value = {
|
|
77
|
-
type: error
|
|
78
|
-
? RequestStatus.Error
|
|
79
|
-
: response
|
|
80
|
-
? RequestStatus.Success
|
|
81
|
-
: RequestStatus.Loading,
|
|
82
|
-
error: error,
|
|
83
|
-
data: data,
|
|
84
|
-
urlData: urlData,
|
|
85
|
-
response: response === null || response === void 0 ? void 0 : response.response,
|
|
86
|
-
document: response === null || response === void 0 ? void 0 : response.document,
|
|
87
|
-
Section: function (_a) {
|
|
88
|
-
var props = __rest(_a, []);
|
|
89
|
-
return React.createElement(Section, __assign({}, props, { ctx: value }));
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
return React.createElement(Provider.Provider, { value: value }, children);
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
export function useQuery(query, data, enabled) {
|
|
96
|
-
if (enabled === void 0) { enabled = true; }
|
|
97
|
-
var client = useContext(WebService);
|
|
98
|
-
var abortController = useMemo(function () { return new AbortController(); }, []);
|
|
99
|
-
var _a = useState(null), response = _a[0], setResponse = _a[1];
|
|
100
|
-
var _b = useState(null), error = _b[0], setError = _b[1];
|
|
101
|
-
var _c = useState(true), isLoading = _c[0], setIsLoading = _c[1];
|
|
102
|
-
var fetch = useCallback(function () {
|
|
103
|
-
setIsLoading(true);
|
|
104
|
-
client
|
|
105
|
-
.request(query, data, undefined, abortController.signal)
|
|
106
|
-
.then(function (response) {
|
|
107
|
-
return Client.WebService.parse(response).then(function (document) { return ({
|
|
108
|
-
response: response,
|
|
109
|
-
document: document
|
|
110
|
-
}); });
|
|
111
|
-
})
|
|
112
|
-
.then(function (document) { return setResponse(document); })
|
|
113
|
-
.catch(function (requestError) {
|
|
114
|
-
return setError(requestError instanceof Error && requestError.name !== 'AbortError'
|
|
115
|
-
? requestError
|
|
116
|
-
: new Error(requestError));
|
|
117
|
-
})
|
|
118
|
-
.finally(function () { return setIsLoading(false); });
|
|
119
|
-
}, []);
|
|
120
|
-
useEffect(function () {
|
|
121
|
-
if (enabled)
|
|
122
|
-
fetch();
|
|
123
|
-
}, [fetch, enabled]);
|
|
124
|
-
return {
|
|
125
|
-
response: response,
|
|
126
|
-
error: error,
|
|
127
|
-
isLoading: isLoading,
|
|
128
|
-
refetch: fetch
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
export function useMutation(query, data) {
|
|
132
|
-
var client = useContext(WebService);
|
|
133
|
-
var abortController = useMemo(function () { return new AbortController(); }, []);
|
|
134
|
-
var _a = useState(null), response = _a[0], setResponse = _a[1];
|
|
135
|
-
var _b = useState(null), error = _b[0], setError = _b[1];
|
|
136
|
-
var _c = useState(true), isLoading = _c[0], setIsLoading = _c[1];
|
|
137
|
-
var mutate = useCallback(function () {
|
|
138
|
-
setIsLoading(true);
|
|
139
|
-
client
|
|
140
|
-
.request(query, data, undefined, abortController.signal)
|
|
141
|
-
.then(function (response) {
|
|
142
|
-
return Client.WebService.parse(response).then(function (document) { return ({
|
|
143
|
-
response: response,
|
|
144
|
-
document: document
|
|
145
|
-
}); });
|
|
146
|
-
})
|
|
147
|
-
.then(function (document) { return setResponse(document); })
|
|
148
|
-
.catch(function (requestError) {
|
|
149
|
-
return setError(requestError instanceof Error && requestError.name !== 'AbortError'
|
|
150
|
-
? requestError
|
|
151
|
-
: new Error(requestError));
|
|
152
|
-
})
|
|
153
|
-
.finally(function () { return setIsLoading(false); });
|
|
154
|
-
}, []);
|
|
155
|
-
return {
|
|
156
|
-
isLoading: isLoading,
|
|
157
|
-
error: error,
|
|
158
|
-
response: response,
|
|
159
|
-
mutate: mutate
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
export function query(query) {
|
|
163
|
-
var RequestContext = createContext({
|
|
164
|
-
type: RequestStatus.Empty,
|
|
165
|
-
Section: function (_a) {
|
|
166
|
-
var props = __rest(_a, []);
|
|
167
|
-
return React.createElement(Section, __assign({}, props));
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
return Object.assign(RequestContext, {
|
|
171
|
-
Request: CustomProvider(RequestContext, query)
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
export var Queries = {
|
|
175
|
-
Finder: query("SELECT FROM 'FINDER'.'BILLING'"),
|
|
176
|
-
Protestos: query("SELECT FROM 'IEPTB'.'IEPTBHARLAN'"),
|
|
177
|
-
CCF: query("SELECT FROM 'SEEKLOC'.'CCF'"),
|
|
178
|
-
ProcessosJuridicos: query("SELECT FROM 'PROCESSOSJURIDICOS'.'PROCESSOS'"),
|
|
179
|
-
Liminar: query("SELECT FROM 'LIMINAR'.'CONSULTA'"),
|
|
180
|
-
ReclameAqui: query("SELECT FROM 'RECLAMEAQUI'.'CONSULTA'"),
|
|
181
|
-
Dominios: query("SELECT FROM 'DOMINIOS'.'CONSULTA'"),
|
|
182
|
-
GraficosAnaliticos: query("SELECT FROM 'DOCUMENTHISTORY'.'BASICHISTORY'")
|
|
183
|
-
};
|
|
184
|
-
var Section = function (_a) {
|
|
185
|
-
var onSuccess = _a.onSuccess, _b = _a.isError, isError = _b === void 0 ? function (err) { return ({
|
|
186
|
-
children: React.createElement(React.Fragment, null),
|
|
187
|
-
description: React.createElement(StatusMessage, { type: "warning" }, err.message)
|
|
188
|
-
}); } : _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, _e = _a.minimized, minimized = _e === void 0 ? true : _e, headerProps = __rest(_a, ["onSuccess", "isError", "onLoading", "ctx", "children", "className", "hideHeader", "minimized"]);
|
|
189
|
-
var _f = useToggle(!minimized), isOpen = _f[0], toggleOpen = _f[1];
|
|
190
|
-
if (!ctx)
|
|
191
|
-
return null;
|
|
192
|
-
var renderResponse = function () {
|
|
193
|
-
switch (ctx.type) {
|
|
194
|
-
case RequestStatus.Success:
|
|
195
|
-
return onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(ctx.document, ctx);
|
|
196
|
-
case RequestStatus.Error:
|
|
197
|
-
return isError === null || isError === void 0 ? void 0 : isError(ctx.error, ctx);
|
|
198
|
-
case RequestStatus.Loading:
|
|
199
|
-
return onLoading === null || onLoading === void 0 ? void 0 : onLoading(ctx);
|
|
200
|
-
default:
|
|
201
|
-
return children;
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
var renderedResponse = renderResponse();
|
|
205
|
-
var defaultHeaderActions = (React.createElement(React.Fragment, null,
|
|
206
|
-
React.createElement(BtnWrapper, { hidden: (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Loading, onClick: toggleOpen }, isOpen ? React.createElement(ChevronUp, null) : React.createElement(ChevronDown, null))));
|
|
207
|
-
if (React.isValidElement(renderedResponse)) {
|
|
208
|
-
return (React.createElement("div", null,
|
|
209
|
-
!hideHeader && (React.createElement(Header, __assign({}, headerProps, { className: cn(className, headerStatus[ctx.type]), hidden: hideHeader, variant: ctx.type === RequestStatus.Loading
|
|
210
|
-
? 'loading'
|
|
211
|
-
: headerProps.variant, actions: React.createElement(React.Fragment, null,
|
|
212
|
-
headerProps.actions,
|
|
213
|
-
defaultHeaderActions) }))),
|
|
214
|
-
React.createElement(ShowRenderedChildren, { isOpen: isOpen }, renderedResponse)));
|
|
215
|
-
}
|
|
216
|
-
var _g = renderedResponse, renderedChildren = _g.children, headerReplaceProps = __rest(_g, ["children"]);
|
|
217
|
-
var headerPropsUnified = Object.assign(headerProps, headerReplaceProps);
|
|
218
|
-
return (React.createElement("div", null,
|
|
219
|
-
!hideHeader && (React.createElement(Header, __assign({}, headerPropsUnified, { className: cn(className, headerStatus[ctx.type], headerPropsUnified.className), variant: ctx.type === RequestStatus.Loading
|
|
220
|
-
? 'loading'
|
|
221
|
-
: headerPropsUnified.variant, actions: React.createElement(React.Fragment, null,
|
|
222
|
-
headerPropsUnified.actions,
|
|
223
|
-
renderedChildren && defaultHeaderActions) }))),
|
|
224
|
-
React.createElement(ShowRenderedChildren, { isOpen: isOpen }, renderedChildren)));
|
|
225
|
-
};
|
|
226
|
-
var ShowRenderedChildren = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n\n /* @media print {\n display: block;\n } */\n"], ["\n display: ", ";\n\n /* @media print {\n display: block;\n } */\n"])), function (props) { return (props.isOpen ? 'block' : 'none'); });
|
|
227
|
-
export var headerStatus = (_a = {},
|
|
228
|
-
_a[RequestStatus.Loading] = 'external-source loading',
|
|
229
|
-
_a[RequestStatus.Success] = 'success',
|
|
230
|
-
_a[RequestStatus.Error] = 'external-source error',
|
|
231
|
-
_a[RequestStatus.Empty] = 'external-source error',
|
|
232
|
-
_a);
|
|
233
|
-
var templateObject_1;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export var REGEX_PROTESTOS_DE_CREDITO = /(banco|ativo|securitizadora|factoring|fidc|esc|psc|fomento|mercantil|cheque|sicredi|bco|santander|caixa|bradesco|itaú|itau)/i;
|
|
2
|
-
export var REGEX_PROTESTOS_DE_IMPOSTO = /(procuradoria|secretaria|estado|sefaz|municipio|prefeitura|fazenda|ipva)/i;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HasCreditsType } from './components/consultasComplementares';
|
|
3
|
-
type ConsultaSimplesProps = {
|
|
4
|
-
onClickQSA: (cpfCnpj: string) => void;
|
|
5
|
-
documento: string;
|
|
6
|
-
apiKey: string;
|
|
7
|
-
onClose?: () => void;
|
|
8
|
-
hasCredits?: HasCreditsType;
|
|
9
|
-
onClickPrint: () => void;
|
|
10
|
-
onClickConsultarProcessoJuridico?: (processoId: string) => void;
|
|
11
|
-
};
|
|
12
|
-
declare const ConsultaSimples: React.FC<ConsultaSimplesProps>;
|
|
13
|
-
export default ConsultaSimples;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { Contacts, Partners, Dossie, Addresses, CCF, Protestos, ProcessosJuridicos, BankAccounts, WebServiceProvider, Queries, RefinSerasa, RefinBoaVista, Veiculos, ChartSystem, DividasPublicas } from './';
|
|
7
|
-
import { ConsultasComplementaresProvider } from './components/consultasComplementares';
|
|
8
|
-
import ConsultaSCR from './components/scr/scr';
|
|
9
|
-
import ConsultaScore from './components/score/scoreService';
|
|
10
|
-
import ConsultaImoveis from './components/imoveis/imoveisService';
|
|
11
|
-
import GlobalStyle from './components/interface/globalStyle';
|
|
12
|
-
import { ConsultaRfbProvider } from './components/consultaRfb';
|
|
13
|
-
import styled from 'styled-components';
|
|
14
|
-
import { Chart, registerables } from 'chart.js';
|
|
15
|
-
import Dominios from './components/dominios/dominios';
|
|
16
|
-
import Liminar from './components/liminar/liminar';
|
|
17
|
-
import ConsultaSimplesSection from './components/consultaSimplesSection/consultaSimplesSection';
|
|
18
|
-
Chart.register.apply(Chart, registerables);
|
|
19
|
-
var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 0mm 0mm 0mm 0mm;\n }\n }\n"], ["\n font-family: 'Open Sans Condensed';\n display: flex;\n flex-direction: column;\n gap: 20px;\n\n * {\n -webkit-print-color-adjust: exact !important;\n color-adjust: exact !important;\n print-color-adjust: exact !important;\n }\n\n @media print {\n @page {\n size: auto;\n margin: 0mm 0mm 0mm 0mm;\n }\n }\n"])));
|
|
20
|
-
var ConsultaSimples = function (_a) {
|
|
21
|
-
var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits;
|
|
22
|
-
var documento = _documento.replace(/\D+/g, '');
|
|
23
|
-
return (React.createElement(React.Fragment, null,
|
|
24
|
-
React.createElement(GlobalStyle, null),
|
|
25
|
-
React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits },
|
|
26
|
-
React.createElement(WebServiceProvider, { credential: apiKey },
|
|
27
|
-
React.createElement(Queries.Dominios.Request, { data: { documento: documento, cnpj: documento } },
|
|
28
|
-
React.createElement(Queries.Finder.Request, { data: { documento: documento } },
|
|
29
|
-
React.createElement(Queries.CCF.Request, { data: { documento: documento } },
|
|
30
|
-
React.createElement(Queries.Protestos.Request, { data: { documento: documento } },
|
|
31
|
-
React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
|
|
32
|
-
React.createElement(Queries.Liminar.Request, { data: { documento: documento } },
|
|
33
|
-
React.createElement(Wrapper, null,
|
|
34
|
-
React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose },
|
|
35
|
-
React.createElement(ConsultaRfbProvider, { documento: documento },
|
|
36
|
-
React.createElement(Dossie, { onClickPrint: onClickPrint, documento: documento }),
|
|
37
|
-
React.createElement(Liminar, null),
|
|
38
|
-
React.createElement(Addresses, { apiKey: apiKey }),
|
|
39
|
-
React.createElement(Contacts, null),
|
|
40
|
-
React.createElement(Partners, { onClickQSA: onClickQSA })),
|
|
41
|
-
React.createElement(Dominios, null),
|
|
42
|
-
React.createElement(BankAccounts, null),
|
|
43
|
-
React.createElement(Queries.GraficosAnaliticos.Request, { data: { documento: documento } },
|
|
44
|
-
React.createElement(ChartSystem, { documento: documento }),
|
|
45
|
-
React.createElement(ConsultaSCR, { documento: documento }),
|
|
46
|
-
React.createElement(RefinBoaVista, { documento: documento }),
|
|
47
|
-
React.createElement(RefinSerasa, { documento: documento }),
|
|
48
|
-
React.createElement(ConsultaScore, { documento: documento }),
|
|
49
|
-
React.createElement(ConsultaImoveis, { documento: documento }),
|
|
50
|
-
React.createElement(Veiculos, { documento: documento })),
|
|
51
|
-
React.createElement(Protestos, null),
|
|
52
|
-
React.createElement(CCF, null),
|
|
53
|
-
React.createElement(DividasPublicas, null),
|
|
54
|
-
React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico })))))))))))));
|
|
55
|
-
};
|
|
56
|
-
export default ConsultaSimples;
|
|
57
|
-
var templateObject_1;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ConsultaRfbContext } from '../components/consultaRfb';
|
|
2
|
-
import { useContext } from 'react';
|
|
3
|
-
export var useConsultaRfb = function () {
|
|
4
|
-
var context = useContext(ConsultaRfbContext);
|
|
5
|
-
if (!context) {
|
|
6
|
-
throw new Error('useConsultasComplementares must be used within a ConsultasComplementaresProvider');
|
|
7
|
-
}
|
|
8
|
-
return context;
|
|
9
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useConsultasComplementares: () => import("../components/consultasComplementares").ConsultasComplementaresContextProps;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import { ConsultasComplementaresContext } from '../components/consultasComplementares';
|
|
3
|
-
export var useConsultasComplementares = function () {
|
|
4
|
-
var context = useContext(ConsultasComplementaresContext);
|
|
5
|
-
if (!context) {
|
|
6
|
-
throw new Error('useConsultasComplementares must be used within a ConsultasComplementaresProvider');
|
|
7
|
-
}
|
|
8
|
-
return context;
|
|
9
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom hook to toggle a boolean state.
|
|
3
|
-
* Can be used for toggling visibility, state, etc.
|
|
4
|
-
*
|
|
5
|
-
* @param {boolean} initOpen Initial state value. Defaults to `true`.
|
|
6
|
-
* @param {Function} [onChange] Callback function to be called after state change.
|
|
7
|
-
* @return {[boolean, () => void]} Current state and a toggle function.
|
|
8
|
-
*/
|
|
9
|
-
declare function useToggle(initialState?: boolean, onChange?: (state: boolean) => void): [boolean, () => void];
|
|
10
|
-
export default useToggle;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Custom hook to toggle a boolean state.
|
|
4
|
-
* Can be used for toggling visibility, state, etc.
|
|
5
|
-
*
|
|
6
|
-
* @param {boolean} initOpen Initial state value. Defaults to `true`.
|
|
7
|
-
* @param {Function} [onChange] Callback function to be called after state change.
|
|
8
|
-
* @return {[boolean, () => void]} Current state and a toggle function.
|
|
9
|
-
*/
|
|
10
|
-
function useToggle(initialState, onChange) {
|
|
11
|
-
if (initialState === void 0) { initialState = true; }
|
|
12
|
-
var _a = useState(initialState), state = _a[0], setState = _a[1];
|
|
13
|
-
var toggle = useCallback(function () {
|
|
14
|
-
setState(function (prevState) {
|
|
15
|
-
var newState = !prevState;
|
|
16
|
-
if (onChange) {
|
|
17
|
-
onChange(newState);
|
|
18
|
-
}
|
|
19
|
-
return newState;
|
|
20
|
-
});
|
|
21
|
-
}, [onChange]);
|
|
22
|
-
return [state, toggle];
|
|
23
|
-
}
|
|
24
|
-
export default useToggle;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
export function useWindowSize() {
|
|
3
|
-
var _a = useState({
|
|
4
|
-
width: 0,
|
|
5
|
-
height: 0
|
|
6
|
-
}), windowSize = _a[0], setWindowSize = _a[1];
|
|
7
|
-
useEffect(function () {
|
|
8
|
-
function handleResize() {
|
|
9
|
-
setWindowSize({
|
|
10
|
-
width: window.innerWidth,
|
|
11
|
-
height: window.innerHeight
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
window.addEventListener('resize', handleResize);
|
|
15
|
-
handleResize();
|
|
16
|
-
return function () { return window.removeEventListener('resize', handleResize); };
|
|
17
|
-
}, []);
|
|
18
|
-
return windowSize;
|
|
19
|
-
}
|
package/lib/esm/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export { default as Section } from './components/interface/section';
|
|
2
|
-
export { default as Header } from './components/interface/header';
|
|
3
|
-
export { default as Loading } from './components/interface/loading';
|
|
4
|
-
export { default as AddItemField } from './components/common/addItem';
|
|
5
|
-
export { default as Contacts } from './components/contacts/contacts';
|
|
6
|
-
export { default as Partners } from './components/partners/partners';
|
|
7
|
-
export { default as Protestos } from './components/protestos/protestos';
|
|
8
|
-
export { default as CCF } from './components/ccf/ccf';
|
|
9
|
-
export { default as Dossie } from './components/dossie/dossie';
|
|
10
|
-
export { default as ProcessosJuridicos } from './components/processos-juridicos/processosJuridicos';
|
|
11
|
-
export { default as Addresses } from './components/adresses/addresses';
|
|
12
|
-
export { default as ChartSystem } from './components/chart/chartSystem';
|
|
13
|
-
export { default as BankAccounts } from './components/bank-accounts/bank-accounts';
|
|
14
|
-
export { default as ResultWithoutInformation } from './components/interface/resultWithoutInformation';
|
|
15
|
-
export * from './components/webservice';
|
|
16
|
-
export * from './components/interface/result';
|
|
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';
|
|
20
|
-
export { default as RefinSerasa } from './components/refinSerasa/refinSerasa';
|
|
21
|
-
export { default as RefinBoaVista } from './components/refinBoaVista/refinBoaVista';
|
|
22
|
-
export { default as SCR } from './components/scr/scr';
|
|
23
|
-
export { default as Veiculos } from './components/veiculos/veiculos';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface ItemCalculo {
|
|
2
|
-
quantidade?: number | null;
|
|
3
|
-
valorTotal?: number | null;
|
|
4
|
-
data?: string | Date;
|
|
5
|
-
creation?: string | Date;
|
|
6
|
-
}
|
|
7
|
-
export declare function somarQuantidades(itens: ItemCalculo[]): number;
|
|
8
|
-
export declare function somarValoresTotais(itens: ItemCalculo[]): number;
|
|
9
|
-
export declare function encontrarDataMaisRecente(itens: ItemCalculo[]): string;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export function somarQuantidades(itens) {
|
|
2
|
-
return itens.reduce(function (total, item) { var _a; return total + ((_a = item.quantidade) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
3
|
-
}
|
|
4
|
-
export function somarValoresTotais(itens) {
|
|
5
|
-
return itens.reduce(function (total, item) { var _a; return total + ((_a = item.valorTotal) !== null && _a !== void 0 ? _a : 0); }, 0);
|
|
6
|
-
}
|
|
7
|
-
export function encontrarDataMaisRecente(itens) {
|
|
8
|
-
var maisRecente = itens.reduce(function (maisRecente, item) {
|
|
9
|
-
var dataAtual = item.data ? new Date(item.data) : new Date(0);
|
|
10
|
-
return dataAtual > maisRecente ? dataAtual : maisRecente;
|
|
11
|
-
}, new Date(0));
|
|
12
|
-
return (maisRecente.getDate().toString().padStart(2, '0') +
|
|
13
|
-
'/' +
|
|
14
|
-
(maisRecente.getMonth() + 1).toString().padStart(2, '0') +
|
|
15
|
-
'/' +
|
|
16
|
-
maisRecente.getFullYear().toString());
|
|
17
|
-
}
|
package/lib/esm/utils/date.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isDate(date: string | Date): boolean;
|
package/lib/esm/utils/date.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function fillMissingData(datasetData, uniqueDates) {
|
|
2
|
-
var filledData = uniqueDates.map(function (date) {
|
|
3
|
-
var existingData = datasetData.find(function (dataPoint) {
|
|
4
|
-
var dataPointDate = dataPoint.x instanceof Date
|
|
5
|
-
? dataPoint.x
|
|
6
|
-
: new Date(dataPoint.x);
|
|
7
|
-
return dataPointDate.toISOString() === new Date(date).toISOString();
|
|
8
|
-
});
|
|
9
|
-
return existingData || { x: date, y: null };
|
|
10
|
-
});
|
|
11
|
-
return filledData;
|
|
12
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export function getUniqueDates(datasets, dateProperty) {
|
|
2
|
-
var allDates = datasets
|
|
3
|
-
.map(function (item) { return item[dateProperty]; })
|
|
4
|
-
.filter(function (date) { return date !== undefined; })
|
|
5
|
-
.map(function (date) { return (date instanceof Date ? date.toISOString() : date); })
|
|
6
|
-
.sort(function (a, b) { return new Date(a).getTime() - new Date(b).getTime(); });
|
|
7
|
-
var uniqueDates = Array.from(new Set(allDates));
|
|
8
|
-
return uniqueDates;
|
|
9
|
-
}
|
package/lib/esm/utils/number.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export var formatMoney = function (value) {
|
|
2
|
-
return new Intl.NumberFormat('pt-BR', {
|
|
3
|
-
style: 'currency',
|
|
4
|
-
currency: 'BRL'
|
|
5
|
-
}).format(Number(value));
|
|
6
|
-
};
|
|
7
|
-
export var phoneMask = function (value) {
|
|
8
|
-
if (!value)
|
|
9
|
-
return '';
|
|
10
|
-
value = value.replace(/\D/g, '');
|
|
11
|
-
value = value.replace(/(\d{2})(\d)/, '($1) $2');
|
|
12
|
-
value = value.replace(/(\d)(\d{4})$/, '$1-$2');
|
|
13
|
-
return value;
|
|
14
|
-
};
|
|
15
|
-
export function formatValue(valor) {
|
|
16
|
-
return valor === null || valor === void 0 ? void 0 : valor.toLocaleString('pt-BR');
|
|
17
|
-
}
|
|
18
|
-
export function sum(valores) {
|
|
19
|
-
return valores.reduce(function (a, b) { return a + b; }, 0);
|
|
20
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare function formatCpf(cpf: string): string;
|
|
2
|
-
export declare function formatCnpj(cnpj: string): string;
|
|
3
|
-
export declare function formatDocument(documento: string): string;
|
|
4
|
-
export declare function isCpf(documento: string): boolean;
|
|
5
|
-
export declare function isCnpj(documento: string): boolean;
|
|
6
|
-
export declare const isDocumentoPF: (documento: string) => boolean;
|
|
7
|
-
export declare const converterParaFormatoValido: (data: string) => string;
|
|
8
|
-
export declare function formatDatePtBrToDate(date: string): Date;
|
|
9
|
-
export declare function capitalize(value: string): string | null;
|
|
10
|
-
export declare function capitalizeFirstLetter(value: string): string | null;
|
|
11
|
-
export declare function addNoValueContent<T>(obj: T): T;
|
package/lib/esm/utils/string.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
export function formatCpf(cpf) {
|
|
2
|
-
cpf = cpf.replace(/[^0-9]/g, '');
|
|
3
|
-
if (cpf.length !== 11)
|
|
4
|
-
return '';
|
|
5
|
-
return "".concat(cpf.slice(0, 3), ".").concat(cpf.slice(3, 6), ".").concat(cpf.slice(6, 9), "-").concat(cpf.slice(9));
|
|
6
|
-
}
|
|
7
|
-
export function formatCnpj(cnpj) {
|
|
8
|
-
cnpj = cnpj.replace(/[^0-9]/g, '');
|
|
9
|
-
if (cnpj.length !== 14)
|
|
10
|
-
return '';
|
|
11
|
-
return "".concat(cnpj.slice(0, 2), ".").concat(cnpj.slice(2, 5), ".").concat(cnpj.slice(5, 8), "/").concat(cnpj.slice(8, 12), "-").concat(cnpj.slice(12));
|
|
12
|
-
}
|
|
13
|
-
export function formatDocument(documento) {
|
|
14
|
-
if (isCpf(documento))
|
|
15
|
-
return formatCpf(documento);
|
|
16
|
-
if (isCnpj(documento))
|
|
17
|
-
return formatCnpj(documento);
|
|
18
|
-
return documento;
|
|
19
|
-
}
|
|
20
|
-
export function isCpf(documento) {
|
|
21
|
-
documento = documento.replace(/[^0-9]/g, '');
|
|
22
|
-
return documento.length === 11;
|
|
23
|
-
}
|
|
24
|
-
export function isCnpj(documento) {
|
|
25
|
-
documento = documento.replace(/[^0-9]/g, '');
|
|
26
|
-
return documento.length === 14;
|
|
27
|
-
}
|
|
28
|
-
export var isDocumentoPF = function (documento) {
|
|
29
|
-
var cleanDocument = documento.replace(/\D/g, '');
|
|
30
|
-
return cleanDocument.length === 11;
|
|
31
|
-
};
|
|
32
|
-
export var converterParaFormatoValido = function (data) {
|
|
33
|
-
var _a = data.split('/'), dia = _a[0], mes = _a[1], ano = _a[2];
|
|
34
|
-
return "".concat(mes, "/").concat(dia, "/").concat(ano);
|
|
35
|
-
};
|
|
36
|
-
export function formatDatePtBrToDate(date) {
|
|
37
|
-
var _a, _b;
|
|
38
|
-
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('-'));
|
|
39
|
-
}
|
|
40
|
-
export function capitalize(value) {
|
|
41
|
-
var _a, _b, _c;
|
|
42
|
-
if (!value)
|
|
43
|
-
return null;
|
|
44
|
-
var words = (_a = value === null || value === void 0 ? void 0 : value.toLocaleLowerCase()) === null || _a === void 0 ? void 0 : _a.split(' ');
|
|
45
|
-
for (var i = 0; i < words.length; i++) {
|
|
46
|
-
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));
|
|
47
|
-
}
|
|
48
|
-
return words.join(' ');
|
|
49
|
-
}
|
|
50
|
-
export function capitalizeFirstLetter(value) {
|
|
51
|
-
var _a;
|
|
52
|
-
if (!value)
|
|
53
|
-
return null;
|
|
54
|
-
return ((_a = value === null || value === void 0 ? void 0 : value.charAt(0)) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + (value === null || value === void 0 ? void 0 : value.slice(1));
|
|
55
|
-
}
|
|
56
|
-
export function addNoValueContent(obj) {
|
|
57
|
-
return Object.fromEntries(Object.entries(obj).map(function (_a) {
|
|
58
|
-
var key = _a[0], value = _a[1];
|
|
59
|
-
return [
|
|
60
|
-
key,
|
|
61
|
-
value || '----'
|
|
62
|
-
];
|
|
63
|
-
}));
|
|
64
|
-
}
|
package/lib/esm/utils/xpath.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare class XPathUtils {
|
|
2
|
-
static select<T = string>(expression: string, node: Node | undefined): "" | T;
|
|
3
|
-
static getField(path: string, documentNode: Node, formatter?: (value: string) => string): string;
|
|
4
|
-
static selectArray<T = Node[]>(expression: string, node: Node | undefined): T;
|
|
5
|
-
}
|
|
6
|
-
export default XPathUtils;
|