@credithub/harlan-components 1.13.9 → 1.15.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/index.js +48432 -65
- package/lib/esm/components/chart/chartContent.d.ts +3 -4
- package/lib/esm/components/chart/chartContent.js +41 -50
- package/lib/esm/components/chart/chartSystem.d.ts +6 -0
- package/lib/esm/components/chart/chartSystem.js +45 -0
- package/lib/esm/components/chart/components/MixedChart.d.ts +7 -0
- package/lib/esm/components/chart/components/MixedChart.js +30 -0
- package/lib/esm/components/chart/components/PieChart.d.ts +7 -0
- package/lib/esm/components/chart/components/PieChart.js +9 -0
- package/lib/esm/components/chart/components/categoryProtestos.d.ts +7 -0
- package/lib/esm/components/chart/components/categoryProtestos.js +17 -0
- package/lib/esm/components/chart/hooks/useCategoryProtestos.d.ts +6 -0
- package/lib/esm/components/chart/hooks/useCategoryProtestos.js +71 -0
- package/lib/esm/components/chart/hooks/useChartData.d.ts +8 -0
- package/lib/esm/components/chart/hooks/useChartData.js +59 -0
- package/lib/esm/components/chart/hooks/useMixedChartData.d.ts +10 -0
- package/lib/esm/components/chart/hooks/useMixedChartData.js +43 -0
- package/lib/esm/components/chart/hooks/usePieChartData.d.ts +6 -0
- package/lib/esm/components/chart/hooks/usePieChartData.js +89 -0
- package/lib/esm/components/chart/quantityResult.js +23 -22
- package/lib/esm/components/chart/types/iChart.d.ts +58 -0
- package/lib/esm/components/chart/utils/chartCustomization.d.ts +7 -0
- package/lib/esm/components/chart/utils/chartCustomization.js +154 -0
- package/lib/esm/components/chart/utils/chartUtils.d.ts +11 -0
- package/lib/esm/components/chart/utils/chartUtils.js +37 -0
- package/lib/esm/components/chart/utils/dataManipulation.d.ts +10 -0
- package/lib/esm/components/chart/utils/dataManipulation.js +97 -0
- package/lib/esm/components/chart/utils/dataProcessing.d.ts +3 -0
- package/lib/esm/components/chart/utils/dataProcessing.js +86 -0
- package/lib/esm/consultaSimples.js +5 -3
- package/lib/esm/hooks/useWindowSize.d.ts +4 -0
- package/lib/esm/hooks/useWindowSize.js +19 -0
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +4 -1
- package/lib/esm/utils/fillMissingData.d.ts +6 -0
- package/lib/esm/utils/fillMissingData.js +12 -0
- package/lib/esm/utils/getUniqueDates.d.ts +5 -0
- package/lib/esm/utils/getUniqueDates.js +9 -0
- package/package.json +12 -2
- package/lib/cjs/assets/btn/btnWrapper.d.ts +0 -2
- package/lib/cjs/assets/btn/btnWrapper.js +0 -14
- package/lib/cjs/assets/btn/chevronDown.d.ts +0 -3
- package/lib/cjs/assets/btn/chevronDown.js +0 -34
- package/lib/cjs/assets/btn/chevronLeft.d.ts +0 -3
- package/lib/cjs/assets/btn/chevronLeft.js +0 -35
- package/lib/cjs/assets/btn/chevronRight.d.ts +0 -3
- package/lib/cjs/assets/btn/chevronRight.js +0 -35
- package/lib/cjs/assets/btn/chevronUp.d.ts +0 -3
- package/lib/cjs/assets/btn/chevronUp.js +0 -35
- package/lib/cjs/assets/btn/closeIcon.d.ts +0 -3
- package/lib/cjs/assets/btn/closeIcon.js +0 -34
- package/lib/cjs/assets/btn/thumbDown.d.ts +0 -7
- package/lib/cjs/assets/btn/thumbDown.js +0 -16
- package/lib/cjs/assets/btn/thumbUp.d.ts +0 -7
- package/lib/cjs/assets/btn/thumbUp.js +0 -16
- package/lib/cjs/assets/icones/chequesSemFundo.d.ts +0 -4
- package/lib/cjs/assets/icones/chequesSemFundo.js +0 -17
- package/lib/cjs/assets/icones/consultaSimples.d.ts +0 -4
- package/lib/cjs/assets/icones/consultaSimples.js +0 -17
- package/lib/cjs/assets/icones/contasBancarias.d.ts +0 -4
- package/lib/cjs/assets/icones/contasBancarias.js +0 -17
- package/lib/cjs/assets/icones/contato.d.ts +0 -4
- package/lib/cjs/assets/icones/contato.js +0 -17
- package/lib/cjs/assets/icones/dividasVencidasSerasa.d.ts +0 -4
- package/lib/cjs/assets/icones/dividasVencidasSerasa.js +0 -14
- package/lib/cjs/assets/icones/dominios.d.ts +0 -4
- package/lib/cjs/assets/icones/dominios.js +0 -14
- package/lib/cjs/assets/icones/endereco.d.ts +0 -4
- package/lib/cjs/assets/icones/endereco.js +0 -17
- package/lib/cjs/assets/icones/iconeEmpresa.d.ts +0 -8
- package/lib/cjs/assets/icones/iconeEmpresa.js +0 -17
- package/lib/cjs/assets/icones/iconePessoa.d.ts +0 -9
- package/lib/cjs/assets/icones/iconePessoa.js +0 -17
- package/lib/cjs/assets/icones/imoveis.d.ts +0 -4
- package/lib/cjs/assets/icones/imoveis.js +0 -14
- package/lib/cjs/assets/icones/pefinRefinBoaVista.d.ts +0 -4
- package/lib/cjs/assets/icones/pefinRefinBoaVista.js +0 -14
- package/lib/cjs/assets/icones/pefinRefinSerasa.d.ts +0 -4
- package/lib/cjs/assets/icones/pefinRefinSerasa.js +0 -16
- package/lib/cjs/assets/icones/processosJuridicos.d.ts +0 -4
- package/lib/cjs/assets/icones/processosJuridicos.js +0 -17
- package/lib/cjs/assets/icones/protestos.d.ts +0 -4
- package/lib/cjs/assets/icones/protestos.js +0 -17
- package/lib/cjs/assets/icones/protestosCredito.d.ts +0 -4
- package/lib/cjs/assets/icones/protestosCredito.js +0 -17
- package/lib/cjs/assets/icones/protestosGerais.d.ts +0 -4
- package/lib/cjs/assets/icones/protestosGerais.js +0 -17
- package/lib/cjs/assets/icones/protestosImpostos.d.ts +0 -4
- package/lib/cjs/assets/icones/protestosImpostos.js +0 -17
- package/lib/cjs/assets/icones/quadroSocietario.d.ts +0 -4
- package/lib/cjs/assets/icones/quadroSocietario.js +0 -17
- package/lib/cjs/assets/icones/resumoNegativacoes.d.ts +0 -4
- package/lib/cjs/assets/icones/resumoNegativacoes.js +0 -16
- package/lib/cjs/assets/icones/scoreBoaVista.d.ts +0 -4
- package/lib/cjs/assets/icones/scoreBoaVista.js +0 -14
- package/lib/cjs/assets/icones/scr.d.ts +0 -4
- package/lib/cjs/assets/icones/scr.js +0 -14
- package/lib/cjs/assets/icones/ultimaMovimentacao.d.ts +0 -4
- package/lib/cjs/assets/icones/ultimaMovimentacao.js +0 -17
- package/lib/cjs/assets/icones/veiculos.d.ts +0 -4
- package/lib/cjs/assets/icones/veiculos.js +0 -14
- package/lib/cjs/components/adresses/addresses.d.ts +0 -19
- package/lib/cjs/components/adresses/addresses.js +0 -74
- package/lib/cjs/components/adresses/getGeocode.d.ts +0 -6
- package/lib/cjs/components/adresses/getGeocode.js +0 -73
- package/lib/cjs/components/adresses/map.d.ts +0 -11
- package/lib/cjs/components/adresses/map.js +0 -50
- package/lib/cjs/components/bank-accounts/bank-accounts.d.ts +0 -3
- package/lib/cjs/components/bank-accounts/bank-accounts.js +0 -33
- package/lib/cjs/components/ccf/ccf.d.ts +0 -3
- package/lib/cjs/components/ccf/ccf.js +0 -65
- package/lib/cjs/components/ccf/ccfList.d.ts +0 -12
- package/lib/cjs/components/ccf/ccfList.js +0 -52
- package/lib/cjs/components/chart/categoryProtestos.d.ts +0 -4
- package/lib/cjs/components/chart/categoryProtestos.js +0 -97
- package/lib/cjs/components/chart/chartContent.d.ts +0 -7
- package/lib/cjs/components/chart/chartContent.js +0 -87
- package/lib/cjs/components/chart/chartHelper.d.ts +0 -7
- package/lib/cjs/components/chart/chartHelper.js +0 -66
- package/lib/cjs/components/chart/customChart.d.ts +0 -10
- package/lib/cjs/components/chart/customChart.js +0 -142
- package/lib/cjs/components/chart/getUniqueDates.d.ts +0 -2
- package/lib/cjs/components/chart/getUniqueDates.js +0 -8
- package/lib/cjs/components/chart/plotly/barChartDataStrategy.d.ts +0 -14
- package/lib/cjs/components/chart/plotly/barChartDataStrategy.js +0 -152
- package/lib/cjs/components/chart/plotly/baseChartDataStrategy.d.ts +0 -8
- package/lib/cjs/components/chart/plotly/baseChartDataStrategy.js +0 -31
- package/lib/cjs/components/chart/plotly/getSeries.d.ts +0 -3
- package/lib/cjs/components/chart/plotly/getSeries.js +0 -35
- package/lib/cjs/components/chart/plotly/iChartDataStrategy.d.ts +0 -35
- package/lib/cjs/components/chart/plotly/iChartDataStrategy.js +0 -2
- package/lib/cjs/components/chart/plotly/index.d.ts +0 -5
- package/lib/cjs/components/chart/plotly/index.js +0 -20
- package/lib/cjs/components/chart/plotly/layoutLineBarChart.d.ts +0 -39
- package/lib/cjs/components/chart/plotly/layoutLineBarChart.js +0 -67
- package/lib/cjs/components/chart/plotly/lineChartDataStrategy.d.ts +0 -17
- package/lib/cjs/components/chart/plotly/lineChartDataStrategy.js +0 -198
- package/lib/cjs/components/chart/plotly/pieChartDataStrategy.d.ts +0 -5
- package/lib/cjs/components/chart/plotly/pieChartDataStrategy.js +0 -45
- package/lib/cjs/components/chart/plotly/types.d.ts +0 -40
- package/lib/cjs/components/chart/plotly/types.js +0 -2
- package/lib/cjs/components/chart/processChartData.d.ts +0 -5
- package/lib/cjs/components/chart/processChartData.js +0 -41
- package/lib/cjs/components/chart/quantityResult.d.ts +0 -17
- package/lib/cjs/components/chart/quantityResult.js +0 -45
- package/lib/cjs/components/chart/useCalculation.d.ts +0 -6
- package/lib/cjs/components/chart/useCalculation.js +0 -12
- package/lib/cjs/components/chart/useDividasPublicas.d.ts +0 -5
- package/lib/cjs/components/chart/useDividasPublicas.js +0 -26
- package/lib/cjs/components/chart/useUltimaOcorrenciaCCF.d.ts +0 -2
- package/lib/cjs/components/chart/useUltimaOcorrenciaCCF.js +0 -20
- package/lib/cjs/components/common/addItem.d.ts +0 -11
- package/lib/cjs/components/common/addItem.js +0 -49
- package/lib/cjs/components/common/button.d.ts +0 -5
- package/lib/cjs/components/common/button.js +0 -46
- package/lib/cjs/components/common/carousel.d.ts +0 -4
- package/lib/cjs/components/common/carousel.js +0 -24
- package/lib/cjs/components/consultaRfb.d.ts +0 -16
- package/lib/cjs/components/consultaRfb.js +0 -48
- package/lib/cjs/components/consultaSimplesSection/consultaSimplesSection.d.ts +0 -6
- package/lib/cjs/components/consultaSimplesSection/consultaSimplesSection.js +0 -110
- package/lib/cjs/components/consultasComplementares.d.ts +0 -29
- package/lib/cjs/components/consultasComplementares.js +0 -59
- package/lib/cjs/components/contacts/contactLikeDislikeSection.d.ts +0 -8
- package/lib/cjs/components/contacts/contactLikeDislikeSection.js +0 -96
- package/lib/cjs/components/contacts/contacts.d.ts +0 -18
- package/lib/cjs/components/contacts/contacts.js +0 -75
- package/lib/cjs/components/contacts/contactsLikeDislike.d.ts +0 -9
- package/lib/cjs/components/contacts/contactsLikeDislike.js +0 -12
- package/lib/cjs/components/contacts/thumbsButton.d.ts +0 -9
- package/lib/cjs/components/contacts/thumbsButton.js +0 -46
- package/lib/cjs/components/dividasPublicas/dividasPublicas.d.ts +0 -3
- package/lib/cjs/components/dividasPublicas/dividasPublicas.js +0 -89
- package/lib/cjs/components/dominios/dominios.d.ts +0 -3
- package/lib/cjs/components/dominios/dominios.js +0 -53
- package/lib/cjs/components/dossie/carrousel/carrousel.d.ts +0 -8
- package/lib/cjs/components/dossie/carrousel/carrousel.js +0 -22
- package/lib/cjs/components/dossie/companyLogo/companyLogo.d.ts +0 -7
- package/lib/cjs/components/dossie/companyLogo/companyLogo.js +0 -31
- package/lib/cjs/components/dossie/dossie.d.ts +0 -8
- package/lib/cjs/components/dossie/dossie.js +0 -74
- package/lib/cjs/components/dossie/summary/cardsAndProducts.d.ts +0 -29
- package/lib/cjs/components/dossie/summary/cardsAndProducts.js +0 -212
- package/lib/cjs/components/dossie/summary/summary.d.ts +0 -18
- package/lib/cjs/components/dossie/summary/summary.js +0 -35
- package/lib/cjs/components/dossie/summary/utils.d.ts +0 -10
- package/lib/cjs/components/dossie/summary/utils.js +0 -38
- package/lib/cjs/components/dossie/transactionTable/transactionTable.d.ts +0 -6
- package/lib/cjs/components/dossie/transactionTable/transactionTable.js +0 -40
- package/lib/cjs/components/imoveis/imoveisService.d.ts +0 -6
- package/lib/cjs/components/imoveis/imoveisService.js +0 -79
- package/lib/cjs/components/imoveis/types.d.ts +0 -24
- package/lib/cjs/components/imoveis/types.js +0 -2
- package/lib/cjs/components/interface/globalStyle.d.ts +0 -2
- package/lib/cjs/components/interface/globalStyle.js +0 -11
- package/lib/cjs/components/interface/header.d.ts +0 -23
- package/lib/cjs/components/interface/header.js +0 -77
- package/lib/cjs/components/interface/loading.d.ts +0 -2
- package/lib/cjs/components/interface/loading.js +0 -14
- package/lib/cjs/components/interface/loadingBar.d.ts +0 -5
- package/lib/cjs/components/interface/loadingBar.js +0 -46
- package/lib/cjs/components/interface/responsiveGrid.d.ts +0 -8
- package/lib/cjs/components/interface/responsiveGrid.js +0 -13
- package/lib/cjs/components/interface/result.d.ts +0 -9
- package/lib/cjs/components/interface/result.js +0 -22
- package/lib/cjs/components/interface/resultWithoutInformation.d.ts +0 -4
- package/lib/cjs/components/interface/resultWithoutInformation.js +0 -37
- package/lib/cjs/components/interface/section.d.ts +0 -10
- package/lib/cjs/components/interface/section.js +0 -36
- package/lib/cjs/components/interface/statusMessage.d.ts +0 -7
- package/lib/cjs/components/interface/statusMessage.js +0 -30
- package/lib/cjs/components/interface/theme.d.ts +0 -73
- package/lib/cjs/components/interface/theme.js +0 -75
- package/lib/cjs/components/liminar/liminar.d.ts +0 -3
- package/lib/cjs/components/liminar/liminar.js +0 -46
- package/lib/cjs/components/liminar/types.d.ts +0 -3
- package/lib/cjs/components/liminar/types.js +0 -2
- package/lib/cjs/components/partners/partner-dividas-publicas.d.ts +0 -5
- package/lib/cjs/components/partners/partner-dividas-publicas.js +0 -15
- package/lib/cjs/components/partners/partner-protestos.d.ts +0 -5
- package/lib/cjs/components/partners/partner-protestos.js +0 -15
- package/lib/cjs/components/partners/partner-rfb-status.d.ts +0 -5
- package/lib/cjs/components/partners/partner-rfb-status.js +0 -15
- package/lib/cjs/components/partners/partnerField.d.ts +0 -9
- package/lib/cjs/components/partners/partnerField.js +0 -14
- package/lib/cjs/components/partners/partnerList.d.ts +0 -16
- package/lib/cjs/components/partners/partnerList.js +0 -44
- package/lib/cjs/components/partners/partners.d.ts +0 -3
- package/lib/cjs/components/partners/partners.js +0 -77
- package/lib/cjs/components/pep/pep.d.ts +0 -3
- package/lib/cjs/components/pep/pep.js +0 -66
- package/lib/cjs/components/processos-juridicos/envolvidosList.d.ts +0 -10
- package/lib/cjs/components/processos-juridicos/envolvidosList.js +0 -27
- package/lib/cjs/components/processos-juridicos/processosJuridicos.d.ts +0 -5
- package/lib/cjs/components/processos-juridicos/processosJuridicos.js +0 -51
- package/lib/cjs/components/processos-juridicos/processosJuridicosList.d.ts +0 -7
- package/lib/cjs/components/processos-juridicos/processosJuridicosList.js +0 -90
- package/lib/cjs/components/processos-juridicos/types.d.ts +0 -27
- package/lib/cjs/components/processos-juridicos/types.js +0 -2
- package/lib/cjs/components/protestos/getTotalProtestos.d.ts +0 -1
- package/lib/cjs/components/protestos/getTotalProtestos.js +0 -10
- package/lib/cjs/components/protestos/protestos.d.ts +0 -3
- package/lib/cjs/components/protestos/protestos.js +0 -94
- package/lib/cjs/components/protestos/protestosCategory.d.ts +0 -7
- package/lib/cjs/components/protestos/protestosCategory.js +0 -55
- package/lib/cjs/components/protestos/protestosList.d.ts +0 -33
- package/lib/cjs/components/protestos/protestosList.js +0 -73
- package/lib/cjs/components/reclameAqui/reclameAquiCarousel.d.ts +0 -5
- package/lib/cjs/components/reclameAqui/reclameAquiCarousel.js +0 -129
- package/lib/cjs/components/reclameAqui/types.d.ts +0 -31
- package/lib/cjs/components/reclameAqui/types.js +0 -2
- package/lib/cjs/components/refinBoaVista/refinBoaVista.d.ts +0 -22
- package/lib/cjs/components/refinBoaVista/refinBoaVista.js +0 -86
- package/lib/cjs/components/refinBoaVista/types.d.ts +0 -48
- package/lib/cjs/components/refinBoaVista/types.js +0 -7
- package/lib/cjs/components/refinSerasa/refinSerasa.d.ts +0 -22
- package/lib/cjs/components/refinSerasa/refinSerasa.js +0 -129
- package/lib/cjs/components/refinSerasa/types.d.ts +0 -48
- package/lib/cjs/components/refinSerasa/types.js +0 -2
- package/lib/cjs/components/refinSerasa/usePendencias.d.ts +0 -0
- package/lib/cjs/components/refinSerasa/usePendencias.js +0 -0
- package/lib/cjs/components/resultadoDaPesquisa/resultado-da-pesquisa.d.ts +0 -5
- package/lib/cjs/components/resultadoDaPesquisa/resultado-da-pesquisa.js +0 -31
- package/lib/cjs/components/score/scoreService.d.ts +0 -6
- package/lib/cjs/components/score/scoreService.js +0 -71
- package/lib/cjs/components/score/types.d.ts +0 -12
- package/lib/cjs/components/score/types.js +0 -2
- package/lib/cjs/components/scr/getResumoDeCreditos.d.ts +0 -6
- package/lib/cjs/components/scr/getResumoDeCreditos.js +0 -93
- package/lib/cjs/components/scr/getResumoDeModalidades.d.ts +0 -8
- package/lib/cjs/components/scr/getResumoDeModalidades.js +0 -95
- package/lib/cjs/components/scr/scr.d.ts +0 -5
- package/lib/cjs/components/scr/scr.js +0 -140
- package/lib/cjs/components/scr/types.d.ts +0 -86
- package/lib/cjs/components/scr/types.js +0 -2
- package/lib/cjs/components/veiculos/types.d.ts +0 -0
- package/lib/cjs/components/veiculos/types.js +0 -0
- package/lib/cjs/components/veiculos/veiculos.d.ts +0 -22
- package/lib/cjs/components/veiculos/veiculos.js +0 -89
- package/lib/cjs/components/webservice.d.ts +0 -140
- package/lib/cjs/components/webservice.js +0 -262
- package/lib/cjs/constants/regex.d.ts +0 -2
- package/lib/cjs/constants/regex.js +0 -5
- package/lib/cjs/consultaSimples.d.ts +0 -11
- package/lib/cjs/consultaSimples.js +0 -59
- package/lib/cjs/hooks/useConsultaRfb.d.ts +0 -6
- package/lib/cjs/hooks/useConsultaRfb.js +0 -13
- package/lib/cjs/hooks/useConsultasComplementares.d.ts +0 -1
- package/lib/cjs/hooks/useConsultasComplementares.js +0 -13
- package/lib/cjs/hooks/useToggle.d.ts +0 -10
- package/lib/cjs/hooks/useToggle.js +0 -26
- package/lib/cjs/index.d.ts +0 -23
- package/lib/cjs/utils/calculation.d.ts +0 -9
- package/lib/cjs/utils/calculation.js +0 -23
- package/lib/cjs/utils/date.d.ts +0 -1
- package/lib/cjs/utils/date.js +0 -10
- package/lib/cjs/utils/formatter.d.ts +0 -2
- package/lib/cjs/utils/formatter.js +0 -7
- package/lib/cjs/utils/number.d.ts +0 -4
- package/lib/cjs/utils/number.js +0 -27
- package/lib/cjs/utils/string.d.ts +0 -10
- package/lib/cjs/utils/string.js +0 -73
- package/lib/cjs/utils/xpath.d.ts +0 -6
- package/lib/cjs/utils/xpath.js +0 -23
- package/lib/esm/components/chart/categoryProtestos.d.ts +0 -4
- package/lib/esm/components/chart/categoryProtestos.js +0 -69
- package/lib/esm/components/chart/chartHelper.d.ts +0 -7
- package/lib/esm/components/chart/chartHelper.js +0 -60
- package/lib/esm/components/chart/customChart.d.ts +0 -10
- package/lib/esm/components/chart/customChart.js +0 -112
- package/lib/esm/components/chart/getUniqueDates.d.ts +0 -2
- package/lib/esm/components/chart/getUniqueDates.js +0 -4
- package/lib/esm/components/chart/plotly/barChartDataStrategy.d.ts +0 -14
- package/lib/esm/components/chart/plotly/barChartDataStrategy.js +0 -149
- package/lib/esm/components/chart/plotly/baseChartDataStrategy.d.ts +0 -8
- package/lib/esm/components/chart/plotly/baseChartDataStrategy.js +0 -28
- package/lib/esm/components/chart/plotly/getSeries.d.ts +0 -3
- package/lib/esm/components/chart/plotly/getSeries.js +0 -31
- package/lib/esm/components/chart/plotly/iChartDataStrategy.d.ts +0 -35
- package/lib/esm/components/chart/plotly/index.d.ts +0 -5
- package/lib/esm/components/chart/plotly/index.js +0 -5
- package/lib/esm/components/chart/plotly/layoutLineBarChart.d.ts +0 -39
- package/lib/esm/components/chart/plotly/layoutLineBarChart.js +0 -64
- package/lib/esm/components/chart/plotly/lineChartDataStrategy.d.ts +0 -17
- package/lib/esm/components/chart/plotly/lineChartDataStrategy.js +0 -195
- package/lib/esm/components/chart/plotly/pieChartDataStrategy.d.ts +0 -5
- package/lib/esm/components/chart/plotly/pieChartDataStrategy.js +0 -42
- package/lib/esm/components/chart/plotly/types.d.ts +0 -40
- package/lib/esm/components/chart/plotly/types.js +0 -1
- package/lib/esm/components/chart/processChartData.d.ts +0 -5
- package/lib/esm/components/chart/processChartData.js +0 -37
- package/lib/esm/components/chart/useCalculation.d.ts +0 -6
- package/lib/esm/components/chart/useCalculation.js +0 -8
- package/lib/esm/components/chart/useDividasPublicas.d.ts +0 -5
- package/lib/esm/components/chart/useDividasPublicas.js +0 -21
- package/lib/esm/components/chart/useUltimaOcorrenciaCCF.d.ts +0 -2
- package/lib/esm/components/chart/useUltimaOcorrenciaCCF.js +0 -15
- /package/lib/esm/components/chart/{plotly/iChartDataStrategy.js → types/iChart.js} +0 -0
package/lib/cjs/utils/xpath.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var webservice_1 = require("@credithub/webservice");
|
|
4
|
-
var XPathUtils = /** @class */ (function () {
|
|
5
|
-
function XPathUtils() {
|
|
6
|
-
}
|
|
7
|
-
XPathUtils.select = function (expression, node) {
|
|
8
|
-
if (node === undefined)
|
|
9
|
-
return '';
|
|
10
|
-
return webservice_1.xpath.select(expression, node);
|
|
11
|
-
};
|
|
12
|
-
XPathUtils.getField = function (path, documentNode, formatter) {
|
|
13
|
-
var value = XPathUtils.select("string(".concat(path, ")"), documentNode);
|
|
14
|
-
return formatter ? formatter(value) : value;
|
|
15
|
-
};
|
|
16
|
-
XPathUtils.selectArray = function (expression, node) {
|
|
17
|
-
if (node === undefined)
|
|
18
|
-
return [];
|
|
19
|
-
return webservice_1.xpath.select(expression, node);
|
|
20
|
-
};
|
|
21
|
-
return XPathUtils;
|
|
22
|
-
}());
|
|
23
|
-
exports.default = XPathUtils;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
2
|
-
import Plot from "react-plotly.js";
|
|
3
|
-
import { Queries } from "../webservice";
|
|
4
|
-
import XPathUtils from "../../utils/xpath";
|
|
5
|
-
import { REGEX_PROTESTOS_DE_CREDITO, REGEX_PROTESTOS_DE_IMPOSTO } from "../../constants/regex";
|
|
6
|
-
var CategoriaProtesto = function (_a) {
|
|
7
|
-
var _b = _a.width, width = _b === void 0 ? 600 : _b, _c = _a.height, height = _c === void 0 ? 400 : _c;
|
|
8
|
-
var ctx = useContext(Queries.Protestos);
|
|
9
|
-
var Section = ctx.Section;
|
|
10
|
-
return (React.createElement(Section, { hideHeader: true, onSuccess: function (document) {
|
|
11
|
-
var _a, _b, _c;
|
|
12
|
-
var filterProtestos = function (regex, data) {
|
|
13
|
-
return XPathUtils.selectArray("//body//protesto", data).filter(function (protesto) {
|
|
14
|
-
return regex.test(XPathUtils.select("string(./nomeCedente)", protesto));
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
var data = [
|
|
18
|
-
{
|
|
19
|
-
categoria: 'Protestos de Crédito',
|
|
20
|
-
quantidade: (_a = filterProtestos(REGEX_PROTESTOS_DE_CREDITO, document)) === null || _a === void 0 ? void 0 : _a.length
|
|
21
|
-
}, {
|
|
22
|
-
categoria: 'Protestos de Impostos',
|
|
23
|
-
quantidade: (_b = filterProtestos(REGEX_PROTESTOS_DE_IMPOSTO, document)) === null || _b === void 0 ? void 0 : _b.length
|
|
24
|
-
}, {
|
|
25
|
-
categoria: 'Protestos em Geral',
|
|
26
|
-
quantidade: (_c = XPathUtils.selectArray("//body//protesto", document).filter(function (protesto) {
|
|
27
|
-
var nomeCedente = XPathUtils.select("string(./nomeCedente)", protesto);
|
|
28
|
-
return (!REGEX_PROTESTOS_DE_IMPOSTO.test(nomeCedente) &&
|
|
29
|
-
!REGEX_PROTESTOS_DE_CREDITO.test(nomeCedente));
|
|
30
|
-
})) === null || _c === void 0 ? void 0 : _c.length
|
|
31
|
-
}
|
|
32
|
-
];
|
|
33
|
-
// Filtrar dados com quantidade nula ou zero
|
|
34
|
-
var dadosFiltrados = data === null || data === void 0 ? void 0 : data.filter(function (dado) { return dado.quantidade > 0; });
|
|
35
|
-
if (dadosFiltrados.length === 0) {
|
|
36
|
-
return React.createElement(React.Fragment, null);
|
|
37
|
-
}
|
|
38
|
-
var categoriaParaCor = {
|
|
39
|
-
"Protestos de Crédito": 'red',
|
|
40
|
-
"Protestos de Impostos": "orange",
|
|
41
|
-
};
|
|
42
|
-
var categorias = dadosFiltrados.map(function (dado) { return dado.categoria; });
|
|
43
|
-
var quantidades = dadosFiltrados.map(function (dado) { return dado.quantidade; });
|
|
44
|
-
var cores = categorias.map(function (categoria) { return categoriaParaCor[categoria] || "rgb(30, 144, 255)"; });
|
|
45
|
-
var plotData = [
|
|
46
|
-
{
|
|
47
|
-
x: categorias,
|
|
48
|
-
y: quantidades,
|
|
49
|
-
type: "bar",
|
|
50
|
-
marker: {
|
|
51
|
-
color: cores,
|
|
52
|
-
},
|
|
53
|
-
text: quantidades.map(String),
|
|
54
|
-
textposition: "auto",
|
|
55
|
-
},
|
|
56
|
-
];
|
|
57
|
-
var layout = {
|
|
58
|
-
title: "Protestos por Categoria",
|
|
59
|
-
width: width,
|
|
60
|
-
height: height,
|
|
61
|
-
yaxis: { fixedrange: true, autorange: true },
|
|
62
|
-
xaxis: { fixedrange: true },
|
|
63
|
-
margin: { l: 50, r: 50, b: 100, t: 50, pad: 4 },
|
|
64
|
-
};
|
|
65
|
-
var config = { displayModeBar: false, responsive: true };
|
|
66
|
-
return React.createElement(Plot, { data: plotData, layout: layout, config: config });
|
|
67
|
-
} }));
|
|
68
|
-
};
|
|
69
|
-
export default CategoriaProtesto;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import Plotly from "react-plotly.js";
|
|
2
|
-
import { ChartDataAndLayoutState } from "./plotly/types";
|
|
3
|
-
export declare const createPieChart: (data: ChartDataAndLayoutState) => Plotly.PieData & {
|
|
4
|
-
possuiPendencias: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare const createBarChart: (data: ChartDataAndLayoutState) => Plotly.Data;
|
|
7
|
-
export declare const createLineChart: (data: ChartDataAndLayoutState) => Plotly.Data;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { formatValue } from "../../utils/number";
|
|
2
|
-
export var createPieChart = function (data) {
|
|
3
|
-
var _a;
|
|
4
|
-
var defaultColors = [
|
|
5
|
-
"#ff4081",
|
|
6
|
-
"#3f51b5",
|
|
7
|
-
"#008cf8",
|
|
8
|
-
"#ffc107",
|
|
9
|
-
"#4caf50",
|
|
10
|
-
"#58508d",
|
|
11
|
-
];
|
|
12
|
-
return {
|
|
13
|
-
values: data.data.map(function (d) { return d.y; }).filter(function (y) { return y !== null; }).map(function (value) { return formatValue(value); }),
|
|
14
|
-
labels: data.data.map(function (d) { return d.x; }),
|
|
15
|
-
possuiPendencias: !!data.data.map(function (d) { return d.y; }).filter(function (y) { return y; }).length,
|
|
16
|
-
type: "pie",
|
|
17
|
-
marker: {
|
|
18
|
-
colors: ((_a = data.marker) === null || _a === void 0 ? void 0 : _a.color) ? [data.marker.color] : defaultColors,
|
|
19
|
-
},
|
|
20
|
-
textinfo: "value",
|
|
21
|
-
hovertemplate: "Total de %{label}: %{value}<extra></extra>",
|
|
22
|
-
textfont: data.textfont || {
|
|
23
|
-
family: "Arial, sans-serif",
|
|
24
|
-
size: 14,
|
|
25
|
-
color: "white",
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export var createBarChart = function (data) {
|
|
30
|
-
var _a;
|
|
31
|
-
return {
|
|
32
|
-
x: data.data.map(function (d) { return d.x; }),
|
|
33
|
-
y: data.data.map(function (d) { return d.y; }),
|
|
34
|
-
type: "bar",
|
|
35
|
-
name: data.name,
|
|
36
|
-
yaxis: data.yaxis,
|
|
37
|
-
marker: { color: ((_a = data.marker) === null || _a === void 0 ? void 0 : _a.color) || "#000000" },
|
|
38
|
-
text: data.text,
|
|
39
|
-
textposition: "auto",
|
|
40
|
-
textfont: data.textfont,
|
|
41
|
-
hovertemplate: data.hovertemplate || "%{y}<extra></extra>",
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export var createLineChart = function (data) {
|
|
45
|
-
var _a;
|
|
46
|
-
return {
|
|
47
|
-
x: data.data.map(function (d) { return d.x; }),
|
|
48
|
-
y: data.data.map(function (d) { return d.y; }),
|
|
49
|
-
type: "scatter",
|
|
50
|
-
mode: "lines+markers",
|
|
51
|
-
name: data.name,
|
|
52
|
-
yaxis: data.yaxis,
|
|
53
|
-
line: { color: ((_a = data.marker) === null || _a === void 0 ? void 0 : _a.color) || "#000000" },
|
|
54
|
-
connectgaps: data.connectgaps || false,
|
|
55
|
-
text: data.text,
|
|
56
|
-
textposition: "auto",
|
|
57
|
-
textfont: data.textfont,
|
|
58
|
-
hovertemplate: data.hovertemplate || "%{x|%d/%m/%Y}<br>".concat(data.name, ": %{y} <extra></extra>"),
|
|
59
|
-
};
|
|
60
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { DataInput } from "./plotly/types";
|
|
3
|
-
interface ChartProps {
|
|
4
|
-
dataInput: DataInput;
|
|
5
|
-
}
|
|
6
|
-
export declare const ResumoDeNegativacoesChartSection: ({ documento }: {
|
|
7
|
-
documento: string;
|
|
8
|
-
}) => React.JSX.Element;
|
|
9
|
-
declare const CustomChart: React.FC<ChartProps>;
|
|
10
|
-
export default CustomChart;
|
|
@@ -1,112 +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
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
17
|
-
import React, { useContext, useEffect, useMemo } from "react";
|
|
18
|
-
import { useCalculation } from "./useCalculation";
|
|
19
|
-
import ChartContent from "./chartContent";
|
|
20
|
-
import QuantidadeResultados from "./quantityResult";
|
|
21
|
-
import { Queries, RequestStatus, useQuery } from "../webservice";
|
|
22
|
-
import { formatDatePtBrToDate } from "../../utils/string";
|
|
23
|
-
import { groupBy, sortBy, unique } from "underscore";
|
|
24
|
-
import Header from "../interface/header";
|
|
25
|
-
import useUltimaOcorrenciaCCF from "./useUltimaOcorrenciaCCF";
|
|
26
|
-
import StatusMessage from "../interface/statusMessage";
|
|
27
|
-
import styled from "styled-components";
|
|
28
|
-
import BtnWrapper from "../../assets/btn/btnWrapper";
|
|
29
|
-
import ChevronUp from "../../assets/btn/chevronUp";
|
|
30
|
-
import useToggle from "../../hooks/useToggle";
|
|
31
|
-
import ChevronDown from "../../assets/btn/chevronDown";
|
|
32
|
-
import theme from "../interface/theme";
|
|
33
|
-
import ResumoDeNegativacoesIcon from "../../assets/icones/resumoNegativacoes";
|
|
34
|
-
import useDividasPublicas from "./useDividasPublicas";
|
|
35
|
-
var Content = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n"], ["\n display: ", ";\n"])), function (props) { return props.isOpen ? 'block' : 'none'; });
|
|
36
|
-
export var ResumoDeNegativacoesChartSection = function (_a) {
|
|
37
|
-
var documento = _a.documento;
|
|
38
|
-
var _b = useQuery("SELECT FROM 'DOCUMENTHISTORY'.'BASICHISTORY'", { documento: documento }), response = _b.response, error = _b.error, isLoading = _b.isLoading, refetch = _b.refetch;
|
|
39
|
-
var _c = useToggle(), isOpen = _c[0], toggleOpen = _c[1];
|
|
40
|
-
var ctxProtestos = useContext(Queries.Protestos);
|
|
41
|
-
var ctxCCF = useContext(Queries.CCF);
|
|
42
|
-
var ctxProcessosJuridicos = useContext(Queries.ProcessosJuridicos);
|
|
43
|
-
var defaultHeaderActions = (React.createElement(React.Fragment, null,
|
|
44
|
-
React.createElement(BtnWrapper, { hidden: isLoading, onClick: toggleOpen }, isOpen ? React.createElement(ChevronUp, null) : React.createElement(ChevronDown, null))));
|
|
45
|
-
var quantidadeProcessosJuridicos = useMemo(function () {
|
|
46
|
-
var _a, _b;
|
|
47
|
-
if ((ctxProcessosJuridicos === null || ctxProcessosJuridicos === void 0 ? void 0 : ctxProcessosJuridicos.type) === RequestStatus.Success)
|
|
48
|
-
return (_b = (_a = ctxProcessosJuridicos === null || ctxProcessosJuridicos === void 0 ? void 0 : ctxProcessosJuridicos.document) === null || _a === void 0 ? void 0 : _a.empresa) === null || _b === void 0 ? void 0 : _b.length;
|
|
49
|
-
return undefined;
|
|
50
|
-
}, [ctxProcessosJuridicos === null || ctxProcessosJuridicos === void 0 ? void 0 : ctxProcessosJuridicos.type]);
|
|
51
|
-
var liveQueriesIsFinish = useMemo(function () {
|
|
52
|
-
return [ctxProtestos === null || ctxProtestos === void 0 ? void 0 : ctxProtestos.type, ctxCCF === null || ctxCCF === void 0 ? void 0 : ctxCCF.type].map(function (type) { return type != RequestStatus.Loading; }).every(function (e) { return e; });
|
|
53
|
-
}, [ctxProtestos === null || ctxProtestos === void 0 ? void 0 : ctxProtestos.type, ctxCCF === null || ctxCCF === void 0 ? void 0 : ctxCCF.type]);
|
|
54
|
-
useEffect(function () {
|
|
55
|
-
if (liveQueriesIsFinish) {
|
|
56
|
-
refetch();
|
|
57
|
-
}
|
|
58
|
-
}, [liveQueriesIsFinish]);
|
|
59
|
-
var process = function (_data) {
|
|
60
|
-
if (!_data)
|
|
61
|
-
return null;
|
|
62
|
-
var data = JSON.parse(_data);
|
|
63
|
-
data.pieChartTotalConfig = {
|
|
64
|
-
processosJuridicos: quantidadeProcessosJuridicos,
|
|
65
|
-
};
|
|
66
|
-
var removeZeros = function (current, index, arr) {
|
|
67
|
-
// Combine firstOrLastObjects check for efficiency
|
|
68
|
-
return index === 0 || index === arr.length - 1 || Number(current.quantidade) > 0;
|
|
69
|
-
};
|
|
70
|
-
var removeSameAsNext = function (current, index, arr) {
|
|
71
|
-
// Return early for first/last objects
|
|
72
|
-
if (index === 0 || index === arr.length - 1)
|
|
73
|
-
return true;
|
|
74
|
-
return current.quantidade !== arr[index + 1].quantidade;
|
|
75
|
-
};
|
|
76
|
-
var grouped = groupBy(data.protestos, function (e) { return e.data; });
|
|
77
|
-
data.protestos = Object.values(grouped).map(function (e) {
|
|
78
|
-
if (e.length === 1)
|
|
79
|
-
return e;
|
|
80
|
-
return e.filter(function (el) { return Number(el.quantidade) > 0; });
|
|
81
|
-
}).flat();
|
|
82
|
-
data.protestos = sortBy(unique(data.protestos, function (x) { return x.data; }).filter(removeZeros).filter(removeSameAsNext).map(function (info) { return (__assign(__assign({}, info), { data: formatDatePtBrToDate(info.data) })); }), function (info) { return info.data; });
|
|
83
|
-
data.ccfs = sortBy(unique(data.ccfs, function (x) { return x.data; }).filter(removeZeros)
|
|
84
|
-
.filter(removeSameAsNext)
|
|
85
|
-
.map(function (info) { return (__assign(__assign({}, info), { data: formatDatePtBrToDate(info.data) })); }), function (info) { return info.data; });
|
|
86
|
-
data.boaVista = data.boaVista.map(function (pefin) { return (__assign(__assign({}, pefin), { creation: formatDatePtBrToDate(pefin.creation) })); }).filter(function (info) { return info.creation; });
|
|
87
|
-
data.serasa = data.serasa.map(function (pefin) { return (__assign(__assign({}, pefin), { creation: formatDatePtBrToDate(pefin.creation) })); }).filter(function (info) { return info.creation; });
|
|
88
|
-
data.dividasPublicasGrafico = data.dividasPublicasGrafico.map(function (info) { return (__assign(__assign({}, info), { data: formatDatePtBrToDate(info.data) })); }).filter(function (info) { return info.data; });
|
|
89
|
-
return React.createElement(CustomChart, { dataInput: data });
|
|
90
|
-
};
|
|
91
|
-
return (React.createElement("div", null,
|
|
92
|
-
React.createElement(Header, { title: "Resumo de Negativa\u00E7\u00F5es", subtitle: "Veja a quantidade de ocorr\u00EAncias conforme o documento foi consultado ao longo do tempo.", description: error && React.createElement(StatusMessage, { type: "error" }, error.message), variant: isLoading ? 'loading' : 'default', actions: isLoading ? null : defaultHeaderActions, icon: ResumoDeNegativacoesIcon }),
|
|
93
|
-
React.createElement(Content, { isOpen: isOpen }, !isLoading && (response === null || response === void 0 ? void 0 : response.document) && process(response === null || response === void 0 ? void 0 : response.document))));
|
|
94
|
-
};
|
|
95
|
-
var ChartWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 20px 30px;\n //background-color: ", ";\n"], ["\n padding: 20px 30px;\n //background-color: ", ";\n"])), theme.colors.white);
|
|
96
|
-
var CustomChart = function (_a) {
|
|
97
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
98
|
-
var dataInput = _a.dataInput;
|
|
99
|
-
var ultimaOcorrenciaCCF = useUltimaOcorrenciaCCF();
|
|
100
|
-
var _k = useDividasPublicas(), quantidadeDividas = _k.quantidade, valorTotalDividas = _k.valorTotal;
|
|
101
|
-
var quantidadeDeProtestos = ((_c = (_b = dataInput === null || dataInput === void 0 ? void 0 : dataInput.protestos) === null || _b === void 0 ? void 0 : _b[(dataInput === null || dataInput === void 0 ? void 0 : dataInput.protestos.length) - 1]) === null || _c === void 0 ? void 0 : _c.quantidade) || 0;
|
|
102
|
-
var valorTotalProtestos = ((_e = (_d = dataInput === null || dataInput === void 0 ? void 0 : dataInput.protestos) === null || _d === void 0 ? void 0 : _d[(dataInput === null || dataInput === void 0 ? void 0 : dataInput.protestos.length) - 1]) === null || _e === void 0 ? void 0 : _e.valorTotal) || 0;
|
|
103
|
-
var _l = useCalculation(dataInput.serasa), quantidadeDeNegativacoesSerasa = _l.quantidade, valorTotalDeNegativacoesSerasa = _l.valorTotal;
|
|
104
|
-
var _m = useCalculation(dataInput.boaVista), quantidadeDeNegativacoesBoaVista = _m.quantidade, valorTotalDeNegativacoesBoaVista = _m.valorTotal;
|
|
105
|
-
var quantidadeCCF = useCalculation(dataInput.ccfs).quantidade;
|
|
106
|
-
var ultimaOcorrenciaProtestos = (_h = (_g = dataInput === null || dataInput === void 0 ? void 0 : dataInput.protestos[((_f = dataInput === null || dataInput === void 0 ? void 0 : dataInput.protestos) === null || _f === void 0 ? void 0 : _f.length) - 1]) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.toLocaleDateString();
|
|
107
|
-
return (React.createElement(ChartWrapper, null,
|
|
108
|
-
React.createElement(ChartContent, { dataInput: dataInput }),
|
|
109
|
-
React.createElement(QuantidadeResultados, { quantidadeProtestos: quantidadeDeProtestos, quantidadeProcessos: (_j = dataInput === null || dataInput === void 0 ? void 0 : dataInput.pieChartTotalConfig) === null || _j === void 0 ? void 0 : _j.processosJuridicos, quantidadeDividas: quantidadeDividas, quantidadeDividasSerasa: quantidadeDeNegativacoesSerasa, quantidadeDividasBoaVista: quantidadeDeNegativacoesBoaVista, quantidadeChequesSemFundos: quantidadeCCF, ultimaOcorrenciaChequesSemFundos: ultimaOcorrenciaCCF, valorTotalDividasSerasa: valorTotalDeNegativacoesSerasa, valorTotalDividasBoaVista: valorTotalDeNegativacoesBoaVista, valorTotalProtestos: valorTotalProtestos, valorTotalDividas: valorTotalDividas, ultimaOcorrenciaProtestos: ultimaOcorrenciaProtestos })));
|
|
110
|
-
};
|
|
111
|
-
export default CustomChart;
|
|
112
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { union, unique } from "underscore";
|
|
2
|
-
export function getUniqueDates(data) {
|
|
3
|
-
return union(data.ccfs.map(function (ccf) { return ccf.data; }), unique(data.protestos, "data").map(function (protesto) { return protesto.data; }), unique(data.serasa, "creation").map(function (pefinRefin) { return pefinRefin.creation; }), unique(data.boaVista, "creation").map(function (pefinRefin) { return pefinRefin.creation; }), unique(data.dividasPublicasGrafico, "data").map(function (dividas) { return dividas.data; })).filter(function (date) { return date; }).sort(function (dateA, dateB) { return dateA.getTime() - dateB.getTime(); });
|
|
4
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BaseChartDataStrategy } from "./";
|
|
2
|
-
import { ChartDataAndLayoutState, DataInput } from "./types";
|
|
3
|
-
export declare class barDividasPublicas extends BaseChartDataStrategy<DataInput> {
|
|
4
|
-
processData(data: DataInput): ChartDataAndLayoutState;
|
|
5
|
-
}
|
|
6
|
-
export declare class barProtestos extends BaseChartDataStrategy<DataInput> {
|
|
7
|
-
processData(data: DataInput): ChartDataAndLayoutState;
|
|
8
|
-
}
|
|
9
|
-
export declare class barSerasa extends BaseChartDataStrategy<DataInput> {
|
|
10
|
-
processData(data: DataInput): ChartDataAndLayoutState;
|
|
11
|
-
}
|
|
12
|
-
export declare class barBoaVista extends BaseChartDataStrategy<DataInput> {
|
|
13
|
-
processData(data: DataInput): ChartDataAndLayoutState;
|
|
14
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
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 barDividasPublicas = /** @class */ (function (_super) {
|
|
19
|
-
__extends(barDividasPublicas, _super);
|
|
20
|
-
function barDividasPublicas() {
|
|
21
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
-
}
|
|
23
|
-
barDividasPublicas.prototype.processData = function (data) {
|
|
24
|
-
var dividasPublicasData = data.dividasPublicasGrafico
|
|
25
|
-
.filter(function (consulta) {
|
|
26
|
-
return consulta.valorTotal !== null;
|
|
27
|
-
})
|
|
28
|
-
.map(function (consulta) { return ({
|
|
29
|
-
x: consulta.data,
|
|
30
|
-
y: consulta.valorTotal,
|
|
31
|
-
}); });
|
|
32
|
-
if ((dividasPublicasData === null || dividasPublicasData === void 0 ? void 0 : dividasPublicasData.length) > 1) {
|
|
33
|
-
dividasPublicasData[(dividasPublicasData === null || dividasPublicasData === void 0 ? void 0 : dividasPublicasData.length) - 1].y = data.dividasPublicas.valorTotal;
|
|
34
|
-
}
|
|
35
|
-
var dividasPublicasState = {
|
|
36
|
-
name: "Dívidas",
|
|
37
|
-
yaxis: "y2",
|
|
38
|
-
type: "bar",
|
|
39
|
-
textposition: "auto",
|
|
40
|
-
marker: {
|
|
41
|
-
color: "#bb3b55",
|
|
42
|
-
opacity: 0.6,
|
|
43
|
-
line: {
|
|
44
|
-
color: "#bb3b55",
|
|
45
|
-
width: 1.5,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
hovertemplate: "%{x|%d/%m/%Y}<br> Dívidas Públicas: R$ %{y} <extra></extra>",
|
|
49
|
-
data: dividasPublicasData,
|
|
50
|
-
layout: layout,
|
|
51
|
-
};
|
|
52
|
-
return dividasPublicasState;
|
|
53
|
-
};
|
|
54
|
-
return barDividasPublicas;
|
|
55
|
-
}(BaseChartDataStrategy));
|
|
56
|
-
export { barDividasPublicas };
|
|
57
|
-
var barProtestos = /** @class */ (function (_super) {
|
|
58
|
-
__extends(barProtestos, _super);
|
|
59
|
-
function barProtestos() {
|
|
60
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
61
|
-
}
|
|
62
|
-
barProtestos.prototype.processData = function (data) {
|
|
63
|
-
var protestosData = data.protestos
|
|
64
|
-
.filter(function (consulta) { return consulta.valorTotal !== null; })
|
|
65
|
-
.map(function (consulta) { return ({
|
|
66
|
-
x: consulta.data,
|
|
67
|
-
y: consulta.valorTotal,
|
|
68
|
-
}); });
|
|
69
|
-
var protestosState = {
|
|
70
|
-
name: "Protestos",
|
|
71
|
-
yaxis: "y2",
|
|
72
|
-
type: "bar",
|
|
73
|
-
textposition: "outside",
|
|
74
|
-
marker: {
|
|
75
|
-
color: "#800000",
|
|
76
|
-
opacity: 0.6,
|
|
77
|
-
line: {
|
|
78
|
-
color: "#800000",
|
|
79
|
-
width: 1.5,
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
hovertemplate: "%{x|%d/%m/%Y}<br> Protestos: R$ %{y} <extra></extra>",
|
|
83
|
-
data: protestosData,
|
|
84
|
-
layout: layout,
|
|
85
|
-
};
|
|
86
|
-
return protestosState;
|
|
87
|
-
};
|
|
88
|
-
return barProtestos;
|
|
89
|
-
}(BaseChartDataStrategy));
|
|
90
|
-
export { barProtestos };
|
|
91
|
-
var barSerasa = /** @class */ (function (_super) {
|
|
92
|
-
__extends(barSerasa, _super);
|
|
93
|
-
function barSerasa() {
|
|
94
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
95
|
-
}
|
|
96
|
-
barSerasa.prototype.processData = function (data) {
|
|
97
|
-
var serasaData = data.serasa
|
|
98
|
-
.filter(function (consulta) { return consulta.valorTotal !== null; })
|
|
99
|
-
.map(function (consulta) { return ({
|
|
100
|
-
x: consulta.creation,
|
|
101
|
-
y: consulta.valorTotal,
|
|
102
|
-
}); });
|
|
103
|
-
var serasaState = {
|
|
104
|
-
name: "Pefin/Refin Serasa",
|
|
105
|
-
yaxis: "y2",
|
|
106
|
-
type: "bar",
|
|
107
|
-
color: "orange",
|
|
108
|
-
marker: {
|
|
109
|
-
color: "rgb(158,202,225)",
|
|
110
|
-
opacity: 0.6,
|
|
111
|
-
line: {
|
|
112
|
-
color: "rgb(8,48,107)",
|
|
113
|
-
width: 1.5,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
hovertemplate: "%{x|%d/%m/%Y}<br> Serasa: R$ %{y} <extra></extra>",
|
|
117
|
-
data: serasaData,
|
|
118
|
-
layout: layout,
|
|
119
|
-
};
|
|
120
|
-
return serasaState;
|
|
121
|
-
};
|
|
122
|
-
return barSerasa;
|
|
123
|
-
}(BaseChartDataStrategy));
|
|
124
|
-
export { barSerasa };
|
|
125
|
-
var barBoaVista = /** @class */ (function (_super) {
|
|
126
|
-
__extends(barBoaVista, _super);
|
|
127
|
-
function barBoaVista() {
|
|
128
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
129
|
-
}
|
|
130
|
-
barBoaVista.prototype.processData = function (data) {
|
|
131
|
-
var boaVistaData = data.boaVista
|
|
132
|
-
.filter(function (consulta) { return consulta.valorTotal !== null; })
|
|
133
|
-
.map(function (consulta) { return ({
|
|
134
|
-
x: consulta.creation,
|
|
135
|
-
y: consulta.valorTotal,
|
|
136
|
-
}); });
|
|
137
|
-
var boaVistaState = {
|
|
138
|
-
name: "Pefin/Refin Boa Vista",
|
|
139
|
-
yaxis: "y2",
|
|
140
|
-
type: "bar",
|
|
141
|
-
hovertemplate: "%{x|%d/%m/%Y}<br> Boa Vista: R$ %{y} <extra></extra>",
|
|
142
|
-
data: boaVistaData,
|
|
143
|
-
layout: layout,
|
|
144
|
-
};
|
|
145
|
-
return boaVistaState;
|
|
146
|
-
};
|
|
147
|
-
return barBoaVista;
|
|
148
|
-
}(BaseChartDataStrategy));
|
|
149
|
-
export { barBoaVista };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ChartDataState, IChartDataStrategy } from "./iChartDataStrategy";
|
|
2
|
-
import { LayoutConfig } from "./layoutLineBarChart";
|
|
3
|
-
import { ChartDataAndLayoutState } from "./types";
|
|
4
|
-
export declare abstract class BaseChartDataStrategy<T> implements IChartDataStrategy<T> {
|
|
5
|
-
abstract processData(data: T): ChartDataAndLayoutState;
|
|
6
|
-
protected parseDate(dateStr: string): Date;
|
|
7
|
-
protected createProcessedData(chartData: ChartDataState, layout?: LayoutConfig): ChartDataAndLayoutState;
|
|
8
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
var BaseChartDataStrategy = /** @class */ (function () {
|
|
13
|
-
function BaseChartDataStrategy() {
|
|
14
|
-
}
|
|
15
|
-
BaseChartDataStrategy.prototype.parseDate = function (dateStr) {
|
|
16
|
-
var _a = dateStr.split("/").map(Number), day = _a[0], month = _a[1], year = _a[2];
|
|
17
|
-
return new Date(year, month - 1, day);
|
|
18
|
-
};
|
|
19
|
-
BaseChartDataStrategy.prototype.createProcessedData = function (chartData, layout) {
|
|
20
|
-
var processedData = chartData.data.map(function (d) { return ({
|
|
21
|
-
x: d.x.toISOString(),
|
|
22
|
-
y: d.y,
|
|
23
|
-
}); });
|
|
24
|
-
return __assign(__assign({}, chartData), { data: processedData, text: processedData.map(function (d) { return (d.y !== null ? d.y.toString() : ""); }), layout: layout || {} });
|
|
25
|
-
};
|
|
26
|
-
return BaseChartDataStrategy;
|
|
27
|
-
}());
|
|
28
|
-
export { BaseChartDataStrategy };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { find, isEqual, sortBy } from "underscore";
|
|
2
|
-
import { barDividasPublicas, barProtestos, barSerasa, barBoaVista, lineProtestos, lineDividasPublicas, lineCCF, lineSerasa, lineBoaVista, } from "./";
|
|
3
|
-
import { getUniqueDates } from "../getUniqueDates";
|
|
4
|
-
export function getSeries(data) {
|
|
5
|
-
var strategies = [
|
|
6
|
-
new lineCCF(),
|
|
7
|
-
new lineProtestos(),
|
|
8
|
-
new lineSerasa(),
|
|
9
|
-
new lineBoaVista(),
|
|
10
|
-
new lineDividasPublicas(),
|
|
11
|
-
new barSerasa(),
|
|
12
|
-
new barBoaVista(),
|
|
13
|
-
new barProtestos(),
|
|
14
|
-
new barDividasPublicas(),
|
|
15
|
-
];
|
|
16
|
-
var processedDataSets = strategies.map(function (strategy) {
|
|
17
|
-
return strategy.processData(data);
|
|
18
|
-
});
|
|
19
|
-
var dates = getUniqueDates(data);
|
|
20
|
-
processedDataSets.forEach(function (dataset) {
|
|
21
|
-
dataset.data = dates.map(function (date) {
|
|
22
|
-
var foundItem = find(dataset.data, function (d) { return isEqual(d.x, date); });
|
|
23
|
-
return foundItem !== null && foundItem !== void 0 ? foundItem : { x: date, y: null };
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
processedDataSets.forEach(function (dataset) {
|
|
27
|
-
dataset.data = sortBy(dataset.data, function (d) { return d.x.getTime(); });
|
|
28
|
-
//dataset.data = sortBy(dataset.data, (d) => new Date(d.x).getTime());
|
|
29
|
-
});
|
|
30
|
-
return processedDataSets;
|
|
31
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ChartDataAndLayoutState } from "./types";
|
|
2
|
-
export interface ChartDataState {
|
|
3
|
-
name: string;
|
|
4
|
-
yaxis: string;
|
|
5
|
-
type: string;
|
|
6
|
-
data: {
|
|
7
|
-
x: string | Date;
|
|
8
|
-
y: number | null;
|
|
9
|
-
}[];
|
|
10
|
-
text?: string[];
|
|
11
|
-
textposition?: string;
|
|
12
|
-
values?: number[];
|
|
13
|
-
labels?: string[];
|
|
14
|
-
color?: string;
|
|
15
|
-
marker?: {
|
|
16
|
-
color: string;
|
|
17
|
-
opacity?: number;
|
|
18
|
-
line?: {
|
|
19
|
-
color: string;
|
|
20
|
-
width: number;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
textfont?: {
|
|
24
|
-
bgcolor?: string;
|
|
25
|
-
family: string;
|
|
26
|
-
size: number;
|
|
27
|
-
color: string;
|
|
28
|
-
};
|
|
29
|
-
mode?: string;
|
|
30
|
-
connectgaps?: boolean;
|
|
31
|
-
hovertemplate?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface IChartDataStrategy<T> {
|
|
34
|
-
processData: (data: T) => ChartDataAndLayoutState;
|
|
35
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { BaseChartDataStrategy } from "./baseChartDataStrategy";
|
|
2
|
-
export { barDividasPublicas, barProtestos, barSerasa, barBoaVista, } from "./barChartDataStrategy";
|
|
3
|
-
export { lineDividasPublicas, lineCCF, lineSerasa, lineBoaVista, lineProtestos, } from "./lineChartDataStrategy";
|
|
4
|
-
export { getSeries } from "./getSeries";
|
|
5
|
-
export { layoutLineBarChart } from "./layoutLineBarChart";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { BaseChartDataStrategy } from "./baseChartDataStrategy";
|
|
2
|
-
export { barDividasPublicas, barProtestos, barSerasa, barBoaVista, } from "./barChartDataStrategy";
|
|
3
|
-
export { lineDividasPublicas, lineCCF, lineSerasa, lineBoaVista, lineProtestos, } from "./lineChartDataStrategy";
|
|
4
|
-
export { getSeries } from "./getSeries";
|
|
5
|
-
export { layoutLineBarChart } from "./layoutLineBarChart";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export interface LayoutConfig extends Partial<Plotly.Layout> {
|
|
2
|
-
xaxis?: {
|
|
3
|
-
range: [string, string];
|
|
4
|
-
domain: [number, number];
|
|
5
|
-
rangeslider: {};
|
|
6
|
-
rangeselector: {
|
|
7
|
-
buttons: Array<{
|
|
8
|
-
step: "month" | "year" | "all";
|
|
9
|
-
stepmode?: "backward" | "todate";
|
|
10
|
-
count?: number;
|
|
11
|
-
label?: string;
|
|
12
|
-
}>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
yaxis2?: {
|
|
16
|
-
title: string;
|
|
17
|
-
titlefont: {
|
|
18
|
-
color: string;
|
|
19
|
-
};
|
|
20
|
-
tickfont: {
|
|
21
|
-
color: string;
|
|
22
|
-
};
|
|
23
|
-
tickformat: string;
|
|
24
|
-
};
|
|
25
|
-
yaxis?: {
|
|
26
|
-
title: string;
|
|
27
|
-
titlefont: {
|
|
28
|
-
color: string;
|
|
29
|
-
};
|
|
30
|
-
tickfont: {
|
|
31
|
-
color: string;
|
|
32
|
-
};
|
|
33
|
-
anchor: "x";
|
|
34
|
-
side: "right";
|
|
35
|
-
overlaying: "y2";
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
declare const layoutLineBarChart: (layoutWidth: number, lastDate: Date) => LayoutConfig;
|
|
39
|
-
export { layoutLineBarChart };
|