@credithub/harlan-components 1.9.0 → 1.10.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/assets/btn/btnWrapper.d.ts +2 -0
- package/lib/cjs/assets/btn/btnWrapper.js +14 -0
- package/lib/cjs/assets/btn/chevronDown.d.ts +3 -0
- package/lib/cjs/assets/btn/chevronDown.js +34 -0
- package/lib/cjs/assets/btn/chevronLeft.d.ts +3 -0
- package/lib/cjs/assets/btn/chevronLeft.js +35 -0
- package/lib/cjs/assets/btn/chevronRight.d.ts +3 -0
- package/lib/cjs/assets/btn/chevronRight.js +35 -0
- package/lib/cjs/assets/btn/chevronUp.d.ts +3 -0
- package/lib/cjs/assets/btn/chevronUp.js +35 -0
- package/lib/cjs/assets/btn/closeIcon.d.ts +3 -0
- package/lib/cjs/assets/btn/closeIcon.js +34 -0
- package/lib/cjs/assets/btn/thumbDown.d.ts +7 -0
- package/lib/cjs/assets/btn/thumbDown.js +16 -0
- package/lib/cjs/assets/btn/thumbUp.d.ts +7 -0
- package/lib/cjs/assets/btn/thumbUp.js +16 -0
- package/lib/cjs/assets/icones/chequesSemFundo.d.ts +4 -0
- package/lib/cjs/assets/icones/chequesSemFundo.js +17 -0
- package/lib/cjs/assets/icones/consultaSimples.d.ts +4 -0
- package/lib/cjs/assets/icones/consultaSimples.js +17 -0
- package/lib/cjs/assets/icones/contasBancarias.d.ts +4 -0
- package/lib/cjs/assets/icones/contasBancarias.js +17 -0
- package/lib/cjs/assets/icones/contato.d.ts +4 -0
- package/lib/cjs/assets/icones/contato.js +17 -0
- package/lib/cjs/assets/icones/endereco.d.ts +4 -0
- package/lib/cjs/assets/icones/endereco.js +17 -0
- package/lib/cjs/assets/icones/iconeEmpresa.d.ts +8 -0
- package/lib/cjs/assets/icones/iconeEmpresa.js +17 -0
- package/lib/cjs/assets/icones/iconePessoa.d.ts +9 -0
- package/lib/cjs/assets/icones/iconePessoa.js +17 -0
- package/lib/cjs/assets/icones/processosJuridicos.d.ts +4 -0
- package/lib/cjs/assets/icones/processosJuridicos.js +17 -0
- package/lib/cjs/assets/icones/protestos.d.ts +4 -0
- package/lib/cjs/assets/icones/protestos.js +17 -0
- package/lib/cjs/assets/icones/protestosCredito.d.ts +4 -0
- package/lib/cjs/assets/icones/protestosCredito.js +17 -0
- package/lib/cjs/assets/icones/protestosGerais.d.ts +4 -0
- package/lib/cjs/assets/icones/protestosGerais.js +17 -0
- package/lib/cjs/assets/icones/protestosImpostos.d.ts +4 -0
- package/lib/cjs/assets/icones/protestosImpostos.js +17 -0
- package/lib/cjs/assets/icones/quadroSocietario.d.ts +4 -0
- package/lib/cjs/assets/icones/quadroSocietario.js +17 -0
- package/lib/cjs/assets/icones/ultimaMovimentacao.d.ts +4 -0
- package/lib/cjs/assets/icones/ultimaMovimentacao.js +17 -0
- package/lib/cjs/components/adresses/{adresses.d.ts → addresses.d.ts} +1 -0
- package/lib/cjs/components/adresses/addresses.js +81 -0
- package/lib/cjs/components/bank-accounts/bank-accounts.js +16 -9
- package/lib/cjs/components/ccf/ccf.js +10 -10
- package/lib/cjs/components/ccf/ccfList.js +10 -3
- package/lib/cjs/components/chart/categoryProtestos.js +2 -2
- package/lib/cjs/components/chart/chartContent.js +11 -13
- package/lib/cjs/components/chart/customChart.js +21 -8
- package/lib/cjs/components/chart/quantityResult.js +28 -20
- package/lib/cjs/components/common/addItem.js +11 -2
- package/lib/cjs/components/common/button.d.ts +1 -1
- package/lib/cjs/components/common/button.js +13 -4
- package/lib/cjs/components/consultaRfb.d.ts +16 -0
- package/lib/cjs/components/consultaRfb.js +48 -0
- package/lib/cjs/components/contacts/contacts.d.ts +1 -1
- package/lib/cjs/components/contacts/contacts.js +13 -9
- package/lib/cjs/components/contacts/contactsLikeDislike.js +1 -3
- package/lib/cjs/components/contacts/thumbsButton.d.ts +4 -5
- package/lib/cjs/components/contacts/thumbsButton.js +37 -13
- package/lib/cjs/components/dividasPublicas/dividasPublicas.js +1 -1
- package/lib/cjs/components/dossie/carrousel/carrousel.js +8 -1
- package/lib/cjs/components/dossie/companyLogo/companyLogo.js +21 -8
- package/lib/cjs/components/dossie/dossie.d.ts +2 -0
- package/lib/cjs/components/dossie/dossie.js +31 -17
- package/lib/cjs/components/dossie/summary/cardsAndProducts.d.ts +29 -0
- package/lib/cjs/components/dossie/summary/cardsAndProducts.js +212 -0
- package/lib/cjs/components/dossie/summary/summary.d.ts +2 -1
- package/lib/cjs/components/dossie/summary/summary.js +18 -251
- package/lib/cjs/components/dossie/summary/utils.d.ts +10 -0
- package/lib/cjs/components/dossie/summary/utils.js +38 -0
- package/lib/cjs/components/dossie/transactionTable/transactionTable.js +27 -18
- package/lib/cjs/components/imoveis/imoveisService.js +24 -33
- package/lib/cjs/components/interface/globalStyle.d.ts +2 -0
- package/lib/cjs/components/interface/globalStyle.js +11 -0
- package/lib/cjs/components/interface/header.d.ts +9 -3
- package/lib/cjs/components/interface/header.js +44 -23
- package/lib/cjs/components/interface/loadingBar.d.ts +5 -0
- package/lib/cjs/components/interface/loadingBar.js +46 -0
- package/lib/cjs/components/interface/responsiveGrid.d.ts +8 -0
- package/lib/cjs/components/interface/responsiveGrid.js +13 -0
- package/lib/cjs/components/interface/result.d.ts +9 -7
- package/lib/cjs/components/interface/result.js +17 -32
- package/lib/cjs/components/interface/resultWithoutInformation.js +1 -1
- package/lib/cjs/components/interface/section.d.ts +3 -7
- package/lib/cjs/components/interface/section.js +17 -6
- package/lib/cjs/components/interface/statusMessage.d.ts +6 -0
- package/lib/cjs/components/interface/statusMessage.js +26 -0
- package/lib/cjs/components/interface/theme.d.ts +61 -0
- package/lib/cjs/components/interface/theme.js +63 -0
- package/lib/cjs/components/partners/partnerList.d.ts +1 -1
- package/lib/cjs/components/partners/partnerList.js +4 -3
- package/lib/cjs/components/partners/partners.js +33 -18
- package/lib/cjs/components/pep/pep.js +1 -1
- package/lib/cjs/components/processos-juridicos/envolvidosList.js +16 -11
- package/lib/cjs/components/processos-juridicos/processosJuridicos.js +6 -6
- package/lib/cjs/components/processos-juridicos/processosJuridicosList.js +23 -12
- package/lib/cjs/components/protestos/getTotalProtestos.d.ts +1 -1
- package/lib/cjs/components/protestos/protestos.js +24 -14
- package/lib/cjs/components/protestos/protestosCategory.js +43 -9
- package/lib/cjs/components/protestos/protestosList.js +9 -11
- package/lib/cjs/components/reclameAqui/reclameAquiCarousel.js +59 -34
- package/lib/cjs/components/refinBoaVista/refinBoaVista.js +19 -24
- package/lib/cjs/components/refinBoaVista/types.d.ts +1 -1
- package/lib/cjs/components/refinBoaVista/types.js +1 -1
- package/lib/cjs/components/refinSerasa/refinSerasa.js +28 -42
- package/lib/cjs/components/resultadoDaPesquisa/resultado-da-pesquisa.d.ts +5 -0
- package/lib/cjs/components/resultadoDaPesquisa/resultado-da-pesquisa.js +31 -0
- package/lib/cjs/components/score/scoreService.js +12 -20
- package/lib/cjs/components/scr/scr.js +38 -58
- package/lib/cjs/components/scr/types.d.ts +1 -1
- package/lib/cjs/components/veiculos/veiculos.js +23 -28
- package/lib/cjs/components/webservice.d.ts +3 -2
- package/lib/cjs/components/webservice.js +29 -7
- package/lib/cjs/consultaSimples.js +88 -25
- package/lib/cjs/hooks/useConsultaRfb.d.ts +6 -0
- package/lib/cjs/hooks/useConsultaRfb.js +13 -0
- package/lib/cjs/hooks/useConsultasComplementares.d.ts +1 -0
- package/lib/cjs/hooks/useConsultasComplementares.js +13 -0
- package/lib/cjs/index.d.ts +8 -8
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/utils/string.d.ts +1 -0
- package/lib/cjs/utils/string.js +11 -3
- package/lib/cjs/utils/xpath.d.ts +2 -1
- package/lib/cjs/utils/xpath.js +7 -0
- package/lib/esm/assets/btn/btnWrapper.d.ts +2 -0
- package/lib/esm/assets/btn/btnWrapper.js +9 -0
- package/lib/esm/assets/btn/chevronDown.d.ts +3 -0
- package/lib/esm/assets/btn/chevronDown.js +29 -0
- package/lib/esm/assets/btn/chevronLeft.d.ts +3 -0
- package/lib/esm/assets/btn/chevronLeft.js +30 -0
- package/lib/esm/assets/btn/chevronRight.d.ts +3 -0
- package/lib/esm/assets/btn/chevronRight.js +30 -0
- package/lib/esm/assets/btn/chevronUp.d.ts +3 -0
- package/lib/esm/assets/btn/chevronUp.js +30 -0
- package/lib/esm/assets/btn/closeIcon.d.ts +3 -0
- package/lib/esm/assets/btn/closeIcon.js +29 -0
- package/lib/esm/assets/btn/thumbDown.d.ts +7 -0
- package/lib/esm/assets/btn/thumbDown.js +11 -0
- package/lib/esm/assets/btn/thumbUp.d.ts +7 -0
- package/lib/esm/assets/btn/thumbUp.js +11 -0
- package/lib/esm/assets/icones/chequesSemFundo.d.ts +4 -0
- package/lib/esm/assets/icones/chequesSemFundo.js +12 -0
- package/lib/esm/assets/icones/consultaSimples.d.ts +4 -0
- package/lib/esm/assets/icones/consultaSimples.js +12 -0
- package/lib/esm/assets/icones/contasBancarias.d.ts +4 -0
- package/lib/esm/assets/icones/contasBancarias.js +12 -0
- package/lib/esm/assets/icones/contato.d.ts +4 -0
- package/lib/esm/assets/icones/contato.js +12 -0
- package/lib/esm/assets/icones/endereco.d.ts +4 -0
- package/lib/esm/assets/icones/endereco.js +12 -0
- package/lib/esm/assets/icones/iconeEmpresa.d.ts +8 -0
- package/lib/esm/assets/icones/iconeEmpresa.js +12 -0
- package/lib/esm/assets/icones/iconePessoa.d.ts +9 -0
- package/lib/esm/assets/icones/iconePessoa.js +12 -0
- package/lib/esm/assets/icones/processosJuridicos.d.ts +4 -0
- package/lib/esm/assets/icones/processosJuridicos.js +12 -0
- package/lib/esm/assets/icones/protestos.d.ts +4 -0
- package/lib/esm/assets/icones/protestos.js +12 -0
- package/lib/esm/assets/icones/protestosCredito.d.ts +4 -0
- package/lib/esm/assets/icones/protestosCredito.js +12 -0
- package/lib/esm/assets/icones/protestosGerais.d.ts +4 -0
- package/lib/esm/assets/icones/protestosGerais.js +12 -0
- package/lib/esm/assets/icones/protestosImpostos.d.ts +4 -0
- package/lib/esm/assets/icones/protestosImpostos.js +12 -0
- package/lib/esm/assets/icones/quadroSocietario.d.ts +4 -0
- package/lib/esm/assets/icones/quadroSocietario.js +12 -0
- package/lib/esm/assets/icones/ultimaMovimentacao.d.ts +4 -0
- package/lib/esm/assets/icones/ultimaMovimentacao.js +12 -0
- package/lib/esm/components/adresses/{adresses.d.ts → addresses.d.ts} +1 -0
- package/lib/esm/components/adresses/addresses.js +53 -0
- package/lib/esm/components/bank-accounts/bank-accounts.js +17 -10
- package/lib/esm/components/ccf/ccf.js +10 -10
- package/lib/esm/components/ccf/ccfList.js +11 -4
- package/lib/esm/components/chart/categoryProtestos.js +2 -2
- package/lib/esm/components/chart/chartContent.js +11 -13
- package/lib/esm/components/chart/customChart.js +21 -8
- package/lib/esm/components/chart/quantityResult.js +28 -20
- package/lib/esm/components/common/addItem.js +11 -2
- package/lib/esm/components/common/button.d.ts +1 -1
- package/lib/esm/components/common/button.js +15 -6
- package/lib/esm/components/consultaRfb.d.ts +16 -0
- package/lib/esm/components/consultaRfb.js +21 -0
- package/lib/esm/components/contacts/contacts.d.ts +1 -1
- package/lib/esm/components/contacts/contacts.js +14 -10
- package/lib/esm/components/contacts/contactsLikeDislike.js +1 -3
- package/lib/esm/components/contacts/thumbsButton.d.ts +4 -5
- package/lib/esm/components/contacts/thumbsButton.js +37 -13
- package/lib/esm/components/dividasPublicas/dividasPublicas.js +1 -1
- package/lib/esm/components/dossie/carrousel/carrousel.js +8 -1
- package/lib/esm/components/dossie/companyLogo/companyLogo.js +21 -8
- package/lib/esm/components/dossie/dossie.d.ts +2 -0
- package/lib/esm/components/dossie/dossie.js +32 -18
- package/lib/esm/components/dossie/summary/cardsAndProducts.d.ts +29 -0
- package/lib/esm/components/dossie/summary/cardsAndProducts.js +207 -0
- package/lib/esm/components/dossie/summary/summary.d.ts +2 -1
- package/lib/esm/components/dossie/summary/summary.js +18 -228
- package/lib/esm/components/dossie/summary/utils.d.ts +10 -0
- package/lib/esm/components/dossie/summary/utils.js +29 -0
- package/lib/esm/components/dossie/transactionTable/transactionTable.js +27 -18
- package/lib/esm/components/imoveis/imoveisService.js +25 -34
- package/lib/esm/components/interface/globalStyle.d.ts +2 -0
- package/lib/esm/components/interface/globalStyle.js +9 -0
- package/lib/esm/components/interface/header.d.ts +9 -3
- package/lib/esm/components/interface/header.js +44 -23
- package/lib/esm/components/interface/loadingBar.d.ts +5 -0
- package/lib/esm/components/interface/loadingBar.js +41 -0
- package/lib/esm/components/interface/responsiveGrid.d.ts +8 -0
- package/lib/esm/components/interface/responsiveGrid.js +8 -0
- package/lib/esm/components/interface/result.d.ts +9 -7
- package/lib/esm/components/interface/result.js +16 -30
- package/lib/esm/components/interface/resultWithoutInformation.js +1 -1
- package/lib/esm/components/interface/section.d.ts +3 -7
- package/lib/esm/components/interface/section.js +17 -6
- package/lib/esm/components/interface/statusMessage.d.ts +6 -0
- package/lib/esm/components/interface/statusMessage.js +21 -0
- package/lib/esm/components/interface/theme.d.ts +61 -0
- package/lib/esm/components/interface/theme.js +61 -0
- package/lib/esm/components/partners/partnerList.d.ts +1 -1
- package/lib/esm/components/partners/partnerList.js +4 -3
- package/lib/esm/components/partners/partners.js +33 -18
- package/lib/esm/components/pep/pep.js +1 -1
- package/lib/esm/components/processos-juridicos/envolvidosList.js +16 -11
- package/lib/esm/components/processos-juridicos/processosJuridicos.js +6 -6
- package/lib/esm/components/processos-juridicos/processosJuridicosList.js +24 -13
- package/lib/esm/components/protestos/getTotalProtestos.d.ts +1 -1
- package/lib/esm/components/protestos/protestos.js +24 -14
- package/lib/esm/components/protestos/protestosCategory.js +43 -9
- package/lib/esm/components/protestos/protestosList.js +10 -12
- package/lib/esm/components/reclameAqui/reclameAquiCarousel.js +59 -34
- package/lib/esm/components/refinBoaVista/refinBoaVista.js +21 -26
- package/lib/esm/components/refinBoaVista/types.d.ts +1 -1
- package/lib/esm/components/refinBoaVista/types.js +1 -1
- package/lib/esm/components/refinSerasa/refinSerasa.js +30 -44
- package/lib/esm/components/resultadoDaPesquisa/resultado-da-pesquisa.d.ts +5 -0
- package/lib/esm/components/resultadoDaPesquisa/resultado-da-pesquisa.js +26 -0
- package/lib/esm/components/score/scoreService.js +13 -21
- package/lib/esm/components/scr/scr.js +40 -60
- package/lib/esm/components/scr/types.d.ts +1 -1
- package/lib/esm/components/veiculos/veiculos.js +25 -30
- package/lib/esm/components/webservice.d.ts +3 -2
- package/lib/esm/components/webservice.js +29 -7
- package/lib/esm/consultaSimples.js +66 -26
- package/lib/esm/hooks/useConsultaRfb.d.ts +6 -0
- package/lib/esm/hooks/useConsultaRfb.js +9 -0
- package/lib/esm/hooks/useConsultasComplementares.d.ts +1 -0
- package/lib/esm/hooks/useConsultasComplementares.js +9 -0
- package/lib/esm/index.d.ts +8 -8
- package/lib/esm/index.js +8 -8
- package/lib/esm/utils/string.d.ts +1 -0
- package/lib/esm/utils/string.js +9 -2
- package/lib/esm/utils/xpath.d.ts +2 -1
- package/lib/esm/utils/xpath.js +7 -0
- package/package.json +12 -4
- package/lib/cjs/components/adresses/adresses.js +0 -68
- package/lib/cjs/mock/dossie.d.ts +0 -207
- package/lib/cjs/mock/dossie.js +0 -630
- package/lib/cjs/mock/mockDataInput.d.ts +0 -34
- package/lib/cjs/mock/mockDataInput.js +0 -139
- package/lib/esm/components/adresses/adresses.js +0 -40
- package/lib/esm/mock/dossie.d.ts +0 -207
- package/lib/esm/mock/dossie.js +0 -628
- package/lib/esm/mock/mockDataInput.d.ts +0 -34
- package/lib/esm/mock/mockDataInput.js +0 -137
|
@@ -1,3 +1,7 @@
|
|
|
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
|
+
};
|
|
1
5
|
var __assign = (this && this.__assign) || function () {
|
|
2
6
|
__assign = Object.assign || function(t) {
|
|
3
7
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -27,6 +31,12 @@ import { Client } from "@credithub/webservice";
|
|
|
27
31
|
import React, { createContext, useState, useContext, useEffect, useMemo, useCallback, } from "react";
|
|
28
32
|
import Header from "./interface/header";
|
|
29
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";
|
|
30
40
|
export var WebService = createContext(new Client.WebService());
|
|
31
41
|
export var WebServiceProvider = function (_a) {
|
|
32
42
|
var credential = _a.credential, children = _a.children;
|
|
@@ -170,7 +180,11 @@ export var Queries = {
|
|
|
170
180
|
GraficosAnaliticos: query("SELECT FROM 'DOCUMENTHISTORY'.'BASICHISTORY'")
|
|
171
181
|
};
|
|
172
182
|
var Section = function (_a) {
|
|
173
|
-
var onSuccess = _a.onSuccess, _b = _a.
|
|
183
|
+
var onSuccess = _a.onSuccess, _b = _a.isError, isError = _b === void 0 ? function (err) { return ({
|
|
184
|
+
children: React.createElement(React.Fragment, null),
|
|
185
|
+
description: React.createElement(StatusMessage, { type: "error" }, err.message)
|
|
186
|
+
}); } : _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"]);
|
|
187
|
+
var _f = useToggle(!minimized), isOpen = _f[0], toggleOpen = _f[1];
|
|
174
188
|
if (!ctx)
|
|
175
189
|
return null;
|
|
176
190
|
var renderResponse = function () {
|
|
@@ -178,7 +192,7 @@ var Section = function (_a) {
|
|
|
178
192
|
case RequestStatus.Success:
|
|
179
193
|
return onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(ctx.document, ctx);
|
|
180
194
|
case RequestStatus.Error:
|
|
181
|
-
return
|
|
195
|
+
return isError === null || isError === void 0 ? void 0 : isError(ctx.error, ctx);
|
|
182
196
|
case RequestStatus.Loading:
|
|
183
197
|
return onLoading === null || onLoading === void 0 ? void 0 : onLoading(ctx);
|
|
184
198
|
default:
|
|
@@ -186,20 +200,28 @@ var Section = function (_a) {
|
|
|
186
200
|
}
|
|
187
201
|
};
|
|
188
202
|
var renderedResponse = renderResponse();
|
|
203
|
+
var defaultHeaderActions = (React.createElement(React.Fragment, null,
|
|
204
|
+
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))));
|
|
189
205
|
if (React.isValidElement(renderedResponse)) {
|
|
190
206
|
return (React.createElement(React.Fragment, null,
|
|
191
|
-
React.createElement(Header, __assign({}, headerProps, { className: cn(className, headerStatus[ctx.type]), hidden: hideHeader
|
|
192
|
-
|
|
207
|
+
!hideHeader && (React.createElement(Header, __assign({}, headerProps, { className: cn(className, headerStatus[ctx.type]), hidden: hideHeader, variant: ctx.type === RequestStatus.Loading ? 'loading' : headerProps.variant, actions: (React.createElement(React.Fragment, null,
|
|
208
|
+
headerProps.actions,
|
|
209
|
+
defaultHeaderActions)) }))),
|
|
210
|
+
React.createElement(ShowRenderedChildren, { isOpen: isOpen }, renderedResponse)));
|
|
193
211
|
}
|
|
194
|
-
var
|
|
212
|
+
var _g = renderedResponse, renderedChildren = _g.children, headerReplaceProps = __rest(_g, ["children"]);
|
|
195
213
|
var headerPropsUnified = Object.assign(headerProps, headerReplaceProps);
|
|
196
214
|
return (React.createElement(React.Fragment, null,
|
|
197
|
-
React.createElement(Header, __assign({}, headerPropsUnified, { className: cn(className, headerStatus[ctx.type], headerPropsUnified.className),
|
|
198
|
-
|
|
215
|
+
!hideHeader && (React.createElement(Header, __assign({}, headerPropsUnified, { className: cn(className, headerStatus[ctx.type], headerPropsUnified.className), variant: ctx.type === RequestStatus.Loading ? 'loading' : headerPropsUnified.variant, actions: (React.createElement(React.Fragment, null,
|
|
216
|
+
headerPropsUnified.actions,
|
|
217
|
+
renderedChildren && defaultHeaderActions)) }))),
|
|
218
|
+
(React.createElement(ShowRenderedChildren, { isOpen: isOpen }, renderedChildren))));
|
|
199
219
|
};
|
|
220
|
+
var ShowRenderedChildren = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: ", ";\n"], ["\n display: ", ";\n"])), function (props) { return props.isOpen ? 'block' : 'none'; });
|
|
200
221
|
export var headerStatus = (_a = {},
|
|
201
222
|
_a[RequestStatus.Loading] = "external-source loading",
|
|
202
223
|
_a[RequestStatus.Success] = "success",
|
|
203
224
|
_a[RequestStatus.Error] = "external-source error",
|
|
204
225
|
_a[RequestStatus.Empty] = "external-source error",
|
|
205
226
|
_a);
|
|
227
|
+
var templateObject_1;
|
|
@@ -1,33 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { useContext } from "react";
|
|
24
|
+
import { Section, Contacts, Partners, Dossie, Addresses, CCF, Protestos, ProcessosJuridicos, BankAccounts, WebServiceProvider, Queries, CustomChartSection, RefinSerasa, RefinBoaVista, Veiculos, RequestStatus, } from "./";
|
|
3
25
|
import { ConsultasComplementaresProvider } from "./components/consultasComplementares";
|
|
4
26
|
import ConsultaSCR from "./components/scr/scr";
|
|
5
27
|
import ConsultaScore from "./components/score/scoreService";
|
|
6
28
|
import ConsultaImoveis from "./components/imoveis/imoveisService";
|
|
29
|
+
import GlobalStyle from "./components/interface/globalStyle";
|
|
30
|
+
import ConsultaSimplesIcon from "./assets/icones/consultaSimples";
|
|
31
|
+
import StatusMessage from "./components/interface/statusMessage";
|
|
32
|
+
import { ConsultaRfbProvider } from "./components/consultaRfb";
|
|
33
|
+
import ResultadoDaPesquisa from "./components/resultadoDaPesquisa/resultado-da-pesquisa";
|
|
7
34
|
var ConsultaSimples = function (_a) {
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
React.createElement(
|
|
19
|
-
React.createElement(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
React.createElement(
|
|
26
|
-
React.createElement(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
var _documento = _a.documento, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits;
|
|
36
|
+
var documento = _documento.replace(/\D+/, "");
|
|
37
|
+
return (React.createElement(React.Fragment, null,
|
|
38
|
+
React.createElement(GlobalStyle, null),
|
|
39
|
+
React.createElement(ConsultasComplementaresProvider, { hasCredits: hasCredits },
|
|
40
|
+
React.createElement(WebServiceProvider, { credential: apiKey },
|
|
41
|
+
React.createElement(Queries.Finder.Request, { data: { documento: documento } },
|
|
42
|
+
React.createElement(Queries.CCF.Request, { data: { documento: documento } },
|
|
43
|
+
React.createElement(Queries.Protestos.Request, { data: { documento: documento } },
|
|
44
|
+
React.createElement(Queries.ProcessosJuridicos.Request, { data: { documento: documento } },
|
|
45
|
+
React.createElement(ResultadoDaPesquisa, { documento: documento }),
|
|
46
|
+
React.createElement(ConsultaSimplesSection, { onClose: onClose },
|
|
47
|
+
React.createElement(ConsultaRfbProvider, { documento: documento },
|
|
48
|
+
React.createElement(Dossie, { documento: documento, onOpenNewTransactionModal: console.log }),
|
|
49
|
+
React.createElement(Addresses, { apiKey: apiKey }),
|
|
50
|
+
React.createElement(Contacts, { onClickConsultarEmail: console.log }),
|
|
51
|
+
React.createElement(Partners, null)),
|
|
52
|
+
React.createElement(BankAccounts, null),
|
|
53
|
+
React.createElement(Queries.GraficosAnaliticos.Request, { data: { documento: documento } },
|
|
54
|
+
React.createElement(CustomChartSection, { documento: documento }),
|
|
55
|
+
React.createElement(ConsultaSCR, { documento: documento }),
|
|
56
|
+
React.createElement(RefinBoaVista, { documento: documento }),
|
|
57
|
+
React.createElement(RefinSerasa, { documento: documento }),
|
|
58
|
+
React.createElement(ConsultaScore, { documento: documento }),
|
|
59
|
+
React.createElement(ConsultaImoveis, { documento: documento }),
|
|
60
|
+
React.createElement(Veiculos, { documento: documento })),
|
|
61
|
+
React.createElement(Protestos, null),
|
|
62
|
+
React.createElement(CCF, null),
|
|
63
|
+
React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: console.log }))))))))));
|
|
64
|
+
};
|
|
65
|
+
var ConsultaSimplesSection = function (_a) {
|
|
66
|
+
var children = _a.children, onClose = _a.onClose, rest = __rest(_a, ["children", "onClose"]);
|
|
67
|
+
var ctx = useContext(Queries.Finder);
|
|
68
|
+
var isSuccess = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Success;
|
|
69
|
+
var isError = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Error;
|
|
70
|
+
var isLoading = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Loading;
|
|
71
|
+
return (React.createElement(Section, __assign({ title: "Consulta Simples", subtitle: "Informa\u00E7\u00F5es agregadas do CPF ou CNPJ", description: React.createElement(StatusMessage, { type: isSuccess ? 'success' : 'error' }, isSuccess ? "Registro encontrado" : isError && (ctx === null || ctx === void 0 ? void 0 : ctx.error.message)), onClose: onClose, icon: ConsultaSimplesIcon, variant: isLoading ? 'loading' : 'default' }, rest), children));
|
|
32
72
|
};
|
|
33
73
|
export default ConsultaSimples;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useConsultasComplementares: () => import("../components/consultasComplementares").ConsultasComplementaresContextProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
};
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -8,16 +8,16 @@ export { default as Protestos } from "./components/protestos/protestos";
|
|
|
8
8
|
export { default as CCF } from "./components/ccf/ccf";
|
|
9
9
|
export { default as Dossie } from "./components/dossie/dossie";
|
|
10
10
|
export { default as ProcessosJuridicos } from "./components/processos-juridicos/processosJuridicos";
|
|
11
|
-
export { default as Addresses } from "./components/adresses/
|
|
12
|
-
export { default as Chart, ResumoDeNegativacoesChartSection as CustomChartSection } from "./components/chart/customChart";
|
|
11
|
+
export { default as Addresses } from "./components/adresses/addresses";
|
|
12
|
+
export { default as Chart, ResumoDeNegativacoesChartSection as CustomChartSection, } from "./components/chart/customChart";
|
|
13
13
|
export { default as BankAccounts } from "./components/bank-accounts/bank-accounts";
|
|
14
14
|
export { default as ResultWithoutInformation } from "./components/interface/resultWithoutInformation";
|
|
15
15
|
export * from "./components/webservice";
|
|
16
16
|
export * from "./components/interface/result";
|
|
17
17
|
export { default as ConsultaSimples } from "./consultaSimples";
|
|
18
|
-
export { default as DividasPublicas } from
|
|
19
|
-
export { default as PessoaPoliticamenteExposta } from
|
|
20
|
-
export { default as RefinSerasa } from
|
|
21
|
-
export { default as RefinBoaVista } from
|
|
22
|
-
export { default as SCR } from
|
|
23
|
-
export { default as Veiculos } from
|
|
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";
|
package/lib/esm/index.js
CHANGED
|
@@ -8,16 +8,16 @@ export { default as Protestos } from "./components/protestos/protestos";
|
|
|
8
8
|
export { default as CCF } from "./components/ccf/ccf";
|
|
9
9
|
export { default as Dossie } from "./components/dossie/dossie";
|
|
10
10
|
export { default as ProcessosJuridicos } from "./components/processos-juridicos/processosJuridicos";
|
|
11
|
-
export { default as Addresses } from "./components/adresses/
|
|
12
|
-
export { default as Chart, ResumoDeNegativacoesChartSection as CustomChartSection } from "./components/chart/customChart";
|
|
11
|
+
export { default as Addresses } from "./components/adresses/addresses";
|
|
12
|
+
export { default as Chart, ResumoDeNegativacoesChartSection as CustomChartSection, } from "./components/chart/customChart";
|
|
13
13
|
export { default as BankAccounts } from "./components/bank-accounts/bank-accounts";
|
|
14
14
|
export { default as ResultWithoutInformation } from "./components/interface/resultWithoutInformation";
|
|
15
15
|
export * from "./components/webservice";
|
|
16
16
|
export * from "./components/interface/result";
|
|
17
17
|
export { default as ConsultaSimples } from "./consultaSimples";
|
|
18
|
-
export { default as DividasPublicas } from
|
|
19
|
-
export { default as PessoaPoliticamenteExposta } from
|
|
20
|
-
export { default as RefinSerasa } from
|
|
21
|
-
export { default as RefinBoaVista } from
|
|
22
|
-
export { default as SCR } from
|
|
23
|
-
export { default as Veiculos } from
|
|
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,6 +1,7 @@
|
|
|
1
1
|
export declare function formatCpf(cpf: string): string;
|
|
2
2
|
export declare function formatCnpj(cnpj: string): string;
|
|
3
3
|
export declare function isCnpj(documento: string): boolean;
|
|
4
|
+
export declare const isDocumentoPF: (documento: string) => boolean;
|
|
4
5
|
export declare function formatDatePtBrToDate(date: string): Date;
|
|
5
6
|
export declare function capitalize(value: string): string | null;
|
|
6
7
|
export declare function addNoValueContent<T>(obj: T): T;
|
package/lib/esm/utils/string.js
CHANGED
|
@@ -14,9 +14,13 @@ export function isCnpj(documento) {
|
|
|
14
14
|
documento = documento.replace(/[^0-9]/g, "");
|
|
15
15
|
return documento.length === 14;
|
|
16
16
|
}
|
|
17
|
+
export var isDocumentoPF = function (documento) {
|
|
18
|
+
var cleanDocument = documento.replace(/\D/g, "");
|
|
19
|
+
return cleanDocument.length === 11;
|
|
20
|
+
};
|
|
17
21
|
export function formatDatePtBrToDate(date) {
|
|
18
22
|
var _a, _b;
|
|
19
|
-
return new Date((_b = (_a = date === null || date === void 0 ? void 0 : date.split(
|
|
23
|
+
return new Date((_b = (_a = date === null || date === void 0 ? void 0 : date.split("/")) === null || _a === void 0 ? void 0 : _a.reverse()) === null || _b === void 0 ? void 0 : _b.join("-"));
|
|
20
24
|
}
|
|
21
25
|
export function capitalize(value) {
|
|
22
26
|
var _a, _b, _c;
|
|
@@ -31,6 +35,9 @@ export function capitalize(value) {
|
|
|
31
35
|
export function addNoValueContent(obj) {
|
|
32
36
|
return Object.fromEntries(Object.entries(obj).map(function (_a) {
|
|
33
37
|
var key = _a[0], value = _a[1];
|
|
34
|
-
return [
|
|
38
|
+
return [
|
|
39
|
+
key,
|
|
40
|
+
value || "----",
|
|
41
|
+
];
|
|
35
42
|
}));
|
|
36
43
|
}
|
package/lib/esm/utils/xpath.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare class XPathUtils {
|
|
2
|
-
static select<T = string>(expression: string, node: Node | undefined): T;
|
|
2
|
+
static select<T = string>(expression: string, node: Node | undefined): "" | T;
|
|
3
3
|
static getField(path: string, documentNode: Node, formatter?: (value: string) => string): string;
|
|
4
|
+
static selectArray<T = Node[]>(expression: string, node: Node | undefined): T;
|
|
4
5
|
}
|
|
5
6
|
export default XPathUtils;
|
package/lib/esm/utils/xpath.js
CHANGED
|
@@ -3,12 +3,19 @@ var XPathUtils = /** @class */ (function () {
|
|
|
3
3
|
function XPathUtils() {
|
|
4
4
|
}
|
|
5
5
|
XPathUtils.select = function (expression, node) {
|
|
6
|
+
if (node === undefined)
|
|
7
|
+
return '';
|
|
6
8
|
return x.select(expression, node);
|
|
7
9
|
};
|
|
8
10
|
XPathUtils.getField = function (path, documentNode, formatter) {
|
|
9
11
|
var value = XPathUtils.select("string(".concat(path, ")"), documentNode);
|
|
10
12
|
return formatter ? formatter(value) : value;
|
|
11
13
|
};
|
|
14
|
+
XPathUtils.selectArray = function (expression, node) {
|
|
15
|
+
if (node === undefined)
|
|
16
|
+
return [];
|
|
17
|
+
return x.select(expression, node);
|
|
18
|
+
};
|
|
12
19
|
return XPathUtils;
|
|
13
20
|
}());
|
|
14
21
|
export default XPathUtils;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credithub/harlan-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Provide a set of web components to be used in Harlan and other projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"harlan",
|
|
@@ -28,12 +28,16 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@credithub/webservice": "^1.1.2",
|
|
31
|
+
"@emotion/stylis": "^0.8.5",
|
|
31
32
|
"@itseasy21/react-elastic-carousel": "^0.12.3",
|
|
32
33
|
"@react-google-maps/api": "^2.19.2",
|
|
33
34
|
"axios": "^1.6.2",
|
|
34
|
-
"classnames": "^2.
|
|
35
|
+
"classnames": "^2.5.1",
|
|
36
|
+
"date-fns": "^3.3.1",
|
|
35
37
|
"plotly.js": "^2.27.1",
|
|
38
|
+
"react-is": "^18.2.0",
|
|
36
39
|
"react-plotly.js": "^2.6.0",
|
|
40
|
+
"styled-components": "^5.3.11",
|
|
37
41
|
"underscore": "^1.13.6"
|
|
38
42
|
},
|
|
39
43
|
"devDependencies": {
|
|
@@ -43,16 +47,19 @@
|
|
|
43
47
|
"@babel/preset-react": "^7.23.3",
|
|
44
48
|
"@babel/preset-typescript": "^7.23.3",
|
|
45
49
|
"@babel/runtime": "^7.23.2",
|
|
50
|
+
"@svgr/core": "^8.1.0",
|
|
51
|
+
"@types/classnames": "^2.3.1",
|
|
46
52
|
"@types/node": "^20.8.10",
|
|
47
53
|
"@types/plotly.js": "^2.12.30",
|
|
48
54
|
"@types/react": "^18.2.0",
|
|
49
55
|
"@types/react-dom": "^18.2.0",
|
|
50
56
|
"@types/react-plotly.js": "^2.6.3",
|
|
57
|
+
"@types/styled-components": "^5.1.34",
|
|
51
58
|
"@types/supercluster": "^7.1.3",
|
|
52
59
|
"@types/underscore": "^1.11.15",
|
|
53
60
|
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
54
61
|
"@typescript-eslint/parser": "^6.9.1",
|
|
55
|
-
"@vitejs/plugin-react": "^4.2.
|
|
62
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
56
63
|
"babel-plugin-module-resolver": "^5.0.0",
|
|
57
64
|
"eslint": "^8.52.0",
|
|
58
65
|
"eslint-config-standard-with-typescript": "^39.1.1",
|
|
@@ -75,7 +82,8 @@
|
|
|
75
82
|
"tsconfig-paths-jest": "^0.0.1",
|
|
76
83
|
"typescript": "^5.2.2",
|
|
77
84
|
"typescript-plugin-css-modules": "^5.0.2",
|
|
78
|
-
"vite": "^5.
|
|
85
|
+
"vite": "^5.1.4",
|
|
86
|
+
"vite-plugin-svgr": "^4.2.0"
|
|
79
87
|
},
|
|
80
88
|
"peerDependencies": {
|
|
81
89
|
"react": "^18.2.0",
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
var react_1 = __importStar(require("react"));
|
|
30
|
-
var classnames_1 = __importDefault(require("classnames"));
|
|
31
|
-
var result_1 = require("../interface/result");
|
|
32
|
-
var addItem_1 = __importDefault(require("../common/addItem"));
|
|
33
|
-
var webservice_1 = require("../webservice");
|
|
34
|
-
var xpath_1 = __importDefault(require("../../utils/xpath"));
|
|
35
|
-
var LazyMap = react_1.default.lazy(function () { return Promise.resolve().then(function () { return __importStar(require("./map")); }); });
|
|
36
|
-
var Addresses = function (_a) {
|
|
37
|
-
var apiKey = _a.apiKey;
|
|
38
|
-
var ctx = (0, react_1.useContext)(webservice_1.Queries.Finder);
|
|
39
|
-
var Section = ctx.Section;
|
|
40
|
-
return (react_1.default.createElement(Section, { title: "Endere\u00E7os", subtitle: "Localiza\u00E7\u00E3o", description: "Endere\u00E7amento e Mapa", ctx: ctx, onError: function () { return react_1.default.createElement(react_1.default.Fragment, null, "Erro"); }, onSuccess: function (data) {
|
|
41
|
-
var _addresses = xpath_1.default.select("//enderecos/enderecos", data);
|
|
42
|
-
var addresses = _addresses.map(function (address) { return ({
|
|
43
|
-
type: xpath_1.default.select('string(//tipoLogradouro)', address),
|
|
44
|
-
address: xpath_1.default.select('string(//logradouro)', address),
|
|
45
|
-
number: xpath_1.default.select('string(//numero)', address),
|
|
46
|
-
zipcode: xpath_1.default.select('string(//cep)', address),
|
|
47
|
-
district: xpath_1.default.select('string(//bairro)', address),
|
|
48
|
-
city: xpath_1.default.select('string(//cidade)', address),
|
|
49
|
-
state: xpath_1.default.select('string(//uf)', address),
|
|
50
|
-
urlImage: '',
|
|
51
|
-
urlMaps: ''
|
|
52
|
-
}); });
|
|
53
|
-
return (react_1.default.createElement(result_1.Result, null,
|
|
54
|
-
react_1.default.createElement(react_1.default.Suspense, { fallback: react_1.default.createElement("div", null, "Carregando...") }, addresses.map(function (address, index) { return (react_1.default.createElement("div", { key: index, className: (0, classnames_1.default)("container") },
|
|
55
|
-
react_1.default.createElement("div", { className: (0, classnames_1.default)("addresses-content") },
|
|
56
|
-
react_1.default.createElement(addItem_1.default, { name: "Tipo", value: address.type, style: { display: "inline-block" } }),
|
|
57
|
-
react_1.default.createElement(addItem_1.default, { name: "Endere\u00E7o", value: address.address, style: { display: "inline-block" } }),
|
|
58
|
-
react_1.default.createElement(addItem_1.default, { name: "N\u00FAmero", value: address.number, style: { display: "inline-block" } }),
|
|
59
|
-
react_1.default.createElement(addItem_1.default, { name: "CEP", value: address.zipcode, style: { display: "inline-block" } }),
|
|
60
|
-
react_1.default.createElement(addItem_1.default, { name: "Bairro", value: address.district, style: { display: "inline-block" } }),
|
|
61
|
-
react_1.default.createElement(addItem_1.default, { name: "Cidade", value: address.city, style: { display: "inline-block" } }),
|
|
62
|
-
react_1.default.createElement(addItem_1.default, { name: "Estado", value: address.state, style: { display: "inline-block" } })),
|
|
63
|
-
react_1.default.createElement("div", { className: (0, classnames_1.default)("field map") },
|
|
64
|
-
react_1.default.createElement("a", { href: '' },
|
|
65
|
-
react_1.default.createElement(LazyMap, { address: address.address, apiKey: apiKey }))))); }))));
|
|
66
|
-
} }));
|
|
67
|
-
};
|
|
68
|
-
exports.default = Addresses;
|