@credithub/harlan-components 1.1.1

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.
Files changed (162) hide show
  1. package/README.md +44 -0
  2. package/lib/cjs/components/adresses/adresses.d.ts +18 -0
  3. package/lib/cjs/components/adresses/adresses.js +68 -0
  4. package/lib/cjs/components/adresses/getGeocode.d.ts +6 -0
  5. package/lib/cjs/components/adresses/getGeocode.js +74 -0
  6. package/lib/cjs/components/adresses/map.d.ts +11 -0
  7. package/lib/cjs/components/adresses/map.js +50 -0
  8. package/lib/cjs/components/bank-accounts/bank-accounts.d.ts +3 -0
  9. package/lib/cjs/components/bank-accounts/bank-accounts.js +28 -0
  10. package/lib/cjs/components/ccf/ccf.d.ts +6 -0
  11. package/lib/cjs/components/ccf/ccf.js +31 -0
  12. package/lib/cjs/components/ccf/ccfList.d.ts +13 -0
  13. package/lib/cjs/components/ccf/ccfList.js +46 -0
  14. package/lib/cjs/components/common/addItem.d.ts +11 -0
  15. package/lib/cjs/components/common/addItem.js +40 -0
  16. package/lib/cjs/components/common/button.d.ts +5 -0
  17. package/lib/cjs/components/common/button.js +15 -0
  18. package/lib/cjs/components/common/carousel.d.ts +4 -0
  19. package/lib/cjs/components/common/carousel.js +24 -0
  20. package/lib/cjs/components/common/headerAction.d.ts +9 -0
  21. package/lib/cjs/components/common/headerAction.js +15 -0
  22. package/lib/cjs/components/contacts/contacts.d.ts +14 -0
  23. package/lib/cjs/components/contacts/contacts.js +68 -0
  24. package/lib/cjs/components/contacts/contactsLikeDislike.d.ts +9 -0
  25. package/lib/cjs/components/contacts/contactsLikeDislike.js +14 -0
  26. package/lib/cjs/components/contacts/thumbsButton.d.ts +10 -0
  27. package/lib/cjs/components/contacts/thumbsButton.js +22 -0
  28. package/lib/cjs/components/dossie/carrousel/carrousel.d.ts +8 -0
  29. package/lib/cjs/components/dossie/carrousel/carrousel.js +15 -0
  30. package/lib/cjs/components/dossie/companyLogo/companyLogo.d.ts +7 -0
  31. package/lib/cjs/components/dossie/companyLogo/companyLogo.js +19 -0
  32. package/lib/cjs/components/dossie/dossie.d.ts +35 -0
  33. package/lib/cjs/components/dossie/dossie.js +66 -0
  34. package/lib/cjs/components/dossie/summary/summary.d.ts +17 -0
  35. package/lib/cjs/components/dossie/summary/summary.js +187 -0
  36. package/lib/cjs/components/dossie/transactionTable/transactionTable.d.ts +6 -0
  37. package/lib/cjs/components/dossie/transactionTable/transactionTable.js +39 -0
  38. package/lib/cjs/components/interface/header.d.ts +16 -0
  39. package/lib/cjs/components/interface/header.js +56 -0
  40. package/lib/cjs/components/interface/result.d.ts +7 -0
  41. package/lib/cjs/components/interface/result.js +38 -0
  42. package/lib/cjs/components/interface/section.d.ts +14 -0
  43. package/lib/cjs/components/interface/section.js +45 -0
  44. package/lib/cjs/components/partners/partnerField.d.ts +9 -0
  45. package/lib/cjs/components/partners/partnerField.js +14 -0
  46. package/lib/cjs/components/partners/partnerList.d.ts +16 -0
  47. package/lib/cjs/components/partners/partnerList.js +43 -0
  48. package/lib/cjs/components/partners/partners.d.ts +3 -0
  49. package/lib/cjs/components/partners/partners.js +55 -0
  50. package/lib/cjs/components/processos-juridicos/envolvidosList.d.ts +9 -0
  51. package/lib/cjs/components/processos-juridicos/envolvidosList.js +22 -0
  52. package/lib/cjs/components/processos-juridicos/processosJuridicos.d.ts +7 -0
  53. package/lib/cjs/components/processos-juridicos/processosJuridicos.js +24 -0
  54. package/lib/cjs/components/processos-juridicos/processosJuridicosList.d.ts +15 -0
  55. package/lib/cjs/components/processos-juridicos/processosJuridicosList.js +52 -0
  56. package/lib/cjs/components/protestos/protestos.d.ts +3 -0
  57. package/lib/cjs/components/protestos/protestos.js +69 -0
  58. package/lib/cjs/components/protestos/protestosCategory.d.ts +7 -0
  59. package/lib/cjs/components/protestos/protestosCategory.js +21 -0
  60. package/lib/cjs/components/protestos/protestosList.d.ts +33 -0
  61. package/lib/cjs/components/protestos/protestosList.js +73 -0
  62. package/lib/cjs/components/reclameAqui/reclameAquiCarousel.d.ts +26 -0
  63. package/lib/cjs/components/reclameAqui/reclameAquiCarousel.js +64 -0
  64. package/lib/cjs/components/resultWithoutInformation/ResultWithoutInformation.d.ts +4 -0
  65. package/lib/cjs/components/resultWithoutInformation/ResultWithoutInformation.js +37 -0
  66. package/lib/cjs/components/webservice.d.ts +67 -0
  67. package/lib/cjs/components/webservice.js +150 -0
  68. package/lib/cjs/constants/regex.d.ts +2 -0
  69. package/lib/cjs/constants/regex.js +5 -0
  70. package/lib/cjs/hooks/useToggle.d.ts +10 -0
  71. package/lib/cjs/hooks/useToggle.js +26 -0
  72. package/lib/cjs/index.d.ts +12 -0
  73. package/lib/cjs/index.js +43 -0
  74. package/lib/cjs/mock/dossie.d.ts +207 -0
  75. package/lib/cjs/mock/dossie.js +630 -0
  76. package/lib/cjs/utils/number.d.ts +1 -0
  77. package/lib/cjs/utils/number.js +10 -0
  78. package/lib/cjs/utils/string.d.ts +3 -0
  79. package/lib/cjs/utils/string.js +22 -0
  80. package/lib/cjs/utils/xpath.d.ts +4 -0
  81. package/lib/cjs/utils/xpath.js +12 -0
  82. package/lib/esm/components/adresses/adresses.d.ts +18 -0
  83. package/lib/esm/components/adresses/adresses.js +40 -0
  84. package/lib/esm/components/adresses/getGeocode.d.ts +6 -0
  85. package/lib/esm/components/adresses/getGeocode.js +67 -0
  86. package/lib/esm/components/adresses/map.d.ts +11 -0
  87. package/lib/esm/components/adresses/map.js +25 -0
  88. package/lib/esm/components/bank-accounts/bank-accounts.d.ts +3 -0
  89. package/lib/esm/components/bank-accounts/bank-accounts.js +23 -0
  90. package/lib/esm/components/ccf/ccf.d.ts +6 -0
  91. package/lib/esm/components/ccf/ccf.js +26 -0
  92. package/lib/esm/components/ccf/ccfList.d.ts +13 -0
  93. package/lib/esm/components/ccf/ccfList.js +18 -0
  94. package/lib/esm/components/common/addItem.d.ts +11 -0
  95. package/lib/esm/components/common/addItem.js +35 -0
  96. package/lib/esm/components/common/button.d.ts +5 -0
  97. package/lib/esm/components/common/button.js +10 -0
  98. package/lib/esm/components/common/carousel.d.ts +4 -0
  99. package/lib/esm/components/common/carousel.js +19 -0
  100. package/lib/esm/components/common/headerAction.d.ts +9 -0
  101. package/lib/esm/components/common/headerAction.js +10 -0
  102. package/lib/esm/components/contacts/contacts.d.ts +14 -0
  103. package/lib/esm/components/contacts/contacts.js +40 -0
  104. package/lib/esm/components/contacts/contactsLikeDislike.d.ts +9 -0
  105. package/lib/esm/components/contacts/contactsLikeDislike.js +9 -0
  106. package/lib/esm/components/contacts/thumbsButton.d.ts +10 -0
  107. package/lib/esm/components/contacts/thumbsButton.js +17 -0
  108. package/lib/esm/components/dossie/carrousel/carrousel.d.ts +8 -0
  109. package/lib/esm/components/dossie/carrousel/carrousel.js +8 -0
  110. package/lib/esm/components/dossie/companyLogo/companyLogo.d.ts +7 -0
  111. package/lib/esm/components/dossie/companyLogo/companyLogo.js +14 -0
  112. package/lib/esm/components/dossie/dossie.d.ts +35 -0
  113. package/lib/esm/components/dossie/dossie.js +38 -0
  114. package/lib/esm/components/dossie/summary/summary.d.ts +17 -0
  115. package/lib/esm/components/dossie/summary/summary.js +180 -0
  116. package/lib/esm/components/dossie/transactionTable/transactionTable.d.ts +6 -0
  117. package/lib/esm/components/dossie/transactionTable/transactionTable.js +32 -0
  118. package/lib/esm/components/interface/header.d.ts +16 -0
  119. package/lib/esm/components/interface/header.js +51 -0
  120. package/lib/esm/components/interface/result.d.ts +7 -0
  121. package/lib/esm/components/interface/result.js +31 -0
  122. package/lib/esm/components/interface/section.d.ts +14 -0
  123. package/lib/esm/components/interface/section.js +40 -0
  124. package/lib/esm/components/partners/partnerField.d.ts +9 -0
  125. package/lib/esm/components/partners/partnerField.js +9 -0
  126. package/lib/esm/components/partners/partnerList.d.ts +16 -0
  127. package/lib/esm/components/partners/partnerList.js +15 -0
  128. package/lib/esm/components/partners/partners.d.ts +3 -0
  129. package/lib/esm/components/partners/partners.js +27 -0
  130. package/lib/esm/components/processos-juridicos/envolvidosList.d.ts +9 -0
  131. package/lib/esm/components/processos-juridicos/envolvidosList.js +17 -0
  132. package/lib/esm/components/processos-juridicos/processosJuridicos.d.ts +7 -0
  133. package/lib/esm/components/processos-juridicos/processosJuridicos.js +19 -0
  134. package/lib/esm/components/processos-juridicos/processosJuridicosList.d.ts +15 -0
  135. package/lib/esm/components/processos-juridicos/processosJuridicosList.js +24 -0
  136. package/lib/esm/components/protestos/protestos.d.ts +3 -0
  137. package/lib/esm/components/protestos/protestos.js +41 -0
  138. package/lib/esm/components/protestos/protestosCategory.d.ts +7 -0
  139. package/lib/esm/components/protestos/protestosCategory.js +16 -0
  140. package/lib/esm/components/protestos/protestosList.d.ts +33 -0
  141. package/lib/esm/components/protestos/protestosList.js +43 -0
  142. package/lib/esm/components/reclameAqui/reclameAquiCarousel.d.ts +26 -0
  143. package/lib/esm/components/reclameAqui/reclameAquiCarousel.js +57 -0
  144. package/lib/esm/components/resultWithoutInformation/ResultWithoutInformation.d.ts +4 -0
  145. package/lib/esm/components/resultWithoutInformation/ResultWithoutInformation.js +32 -0
  146. package/lib/esm/components/webservice.d.ts +67 -0
  147. package/lib/esm/components/webservice.js +119 -0
  148. package/lib/esm/constants/regex.d.ts +2 -0
  149. package/lib/esm/constants/regex.js +2 -0
  150. package/lib/esm/hooks/useToggle.d.ts +10 -0
  151. package/lib/esm/hooks/useToggle.js +24 -0
  152. package/lib/esm/index.d.ts +12 -0
  153. package/lib/esm/index.js +12 -0
  154. package/lib/esm/mock/dossie.d.ts +207 -0
  155. package/lib/esm/mock/dossie.js +628 -0
  156. package/lib/esm/utils/number.d.ts +1 -0
  157. package/lib/esm/utils/number.js +6 -0
  158. package/lib/esm/utils/string.d.ts +3 -0
  159. package/lib/esm/utils/string.js +16 -0
  160. package/lib/esm/utils/xpath.d.ts +4 -0
  161. package/lib/esm/utils/xpath.js +10 -0
  162. package/package.json +79 -0
@@ -0,0 +1,12 @@
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
+ return webservice_1.xpath.select(expression, node);
9
+ };
10
+ return XPathUtils;
11
+ }());
12
+ exports.default = XPathUtils;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ export type Address = {
3
+ type: string;
4
+ address: string;
5
+ number: string;
6
+ zipcode: string;
7
+ district: string;
8
+ city: string;
9
+ state: string;
10
+ urlMaps: string;
11
+ urlImage: string;
12
+ main?: boolean;
13
+ };
14
+ interface Addresses {
15
+ apiKey: string;
16
+ }
17
+ declare const Addresses: React.FC<Addresses>;
18
+ export default Addresses;
@@ -0,0 +1,40 @@
1
+ import React, { useContext } from "react";
2
+ import cn from "classnames";
3
+ import { Result } from "../interface/result";
4
+ import AddItemField from "../common/addItem";
5
+ import { Queries } from "../webservice";
6
+ import XPathUtils from "../../utils/xpath";
7
+ var LazyMap = React.lazy(function () { return import("./map"); });
8
+ var Addresses = function (_a) {
9
+ var apiKey = _a.apiKey;
10
+ var ctx = useContext(Queries.Finder);
11
+ var Section = ctx.Section;
12
+ return (React.createElement(Section, { title: "Endere\u00E7os", subtitle: "Localiza\u00E7\u00E3o", description: "Endere\u00E7amento e Mapa", ctx: ctx, onLoading: function () { return React.createElement(React.Fragment, null, "Carregando..."); }, onError: function () { return React.createElement(React.Fragment, null, "Erro"); }, onSuccess: function (data) {
13
+ var _addresses = XPathUtils.select("//enderecos/enderecos", data);
14
+ var addresses = _addresses.map(function (address) { return ({
15
+ type: XPathUtils.select('string(//tipoLogradouro)', address),
16
+ address: XPathUtils.select('string(//logradouro)', address),
17
+ number: XPathUtils.select('string(//numero)', address),
18
+ zipcode: XPathUtils.select('string(//cep)', address),
19
+ district: XPathUtils.select('string(//bairro)', address),
20
+ city: XPathUtils.select('string(//cidade)', address),
21
+ state: XPathUtils.select('string(//uf)', address),
22
+ urlImage: '',
23
+ urlMaps: ''
24
+ }); });
25
+ return (React.createElement(Result, null,
26
+ React.createElement(React.Suspense, { fallback: React.createElement("div", null, "Carregando...") }, addresses.map(function (address, index) { return (React.createElement("div", { key: index, className: cn("container") },
27
+ React.createElement("div", { className: cn("addresses-content") },
28
+ React.createElement(AddItemField, { name: "Tipo", value: address.type, style: { display: "inline-block" } }),
29
+ React.createElement(AddItemField, { name: "Endere\u00E7o", value: address.address, style: { display: "inline-block" } }),
30
+ React.createElement(AddItemField, { name: "N\u00FAmero", value: address.number, style: { display: "inline-block" } }),
31
+ React.createElement(AddItemField, { name: "CEP", value: address.zipcode, style: { display: "inline-block" } }),
32
+ React.createElement(AddItemField, { name: "Bairro", value: address.district, style: { display: "inline-block" } }),
33
+ React.createElement(AddItemField, { name: "Cidade", value: address.city, style: { display: "inline-block" } }),
34
+ React.createElement(AddItemField, { name: "Estado", value: address.state, style: { display: "inline-block" } })),
35
+ React.createElement("div", { className: cn("field map") },
36
+ React.createElement("a", { href: '' },
37
+ React.createElement(LazyMap, { address: address.address, apiKey: apiKey }))))); }))));
38
+ } }));
39
+ };
40
+ export default Addresses;
@@ -0,0 +1,6 @@
1
+ interface GeocodeResponse {
2
+ lat: number;
3
+ lng: number;
4
+ }
5
+ export declare function getGeocode(address: string, apiKey: string): Promise<GeocodeResponse | null>;
6
+ export {};
@@ -0,0 +1,67 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import axios from "axios";
38
+ export function getGeocode(address, apiKey) {
39
+ return __awaiter(this, void 0, void 0, function () {
40
+ var response, results, location_1, error_1;
41
+ return __generator(this, function (_a) {
42
+ switch (_a.label) {
43
+ case 0:
44
+ _a.trys.push([0, 2, , 3]);
45
+ return [4 /*yield*/, axios.get("https://maps.googleapis.com/maps/api/geocode/json", {
46
+ params: {
47
+ address: address,
48
+ key: apiKey,
49
+ },
50
+ })];
51
+ case 1:
52
+ response = _a.sent();
53
+ results = response.data.results;
54
+ if (results.length > 0) {
55
+ location_1 = results[0].geometry.location;
56
+ return [2 /*return*/, { lat: location_1.lat, lng: location_1.lng }];
57
+ }
58
+ return [2 /*return*/, null];
59
+ case 2:
60
+ error_1 = _a.sent();
61
+ console.error("Erro ao obter geocódigo:", error_1);
62
+ return [2 /*return*/, null];
63
+ case 3: return [2 /*return*/];
64
+ }
65
+ });
66
+ });
67
+ }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ interface MapContainerProps {
3
+ address: string;
4
+ apiKey: string;
5
+ }
6
+ interface MapContainerProps {
7
+ log?: number;
8
+ lat?: number;
9
+ }
10
+ declare const MapContainer: React.FC<MapContainerProps>;
11
+ export default MapContainer;
@@ -0,0 +1,25 @@
1
+ import React, { useEffect, useState } from "react";
2
+ import { GoogleMap, LoadScript, Marker } from "@react-google-maps/api";
3
+ import { getGeocode } from "./getGeocode";
4
+ var MapContainer = function (_a) {
5
+ var address = _a.address, apiKey = _a.apiKey;
6
+ var _b = useState({ lat: 0, lng: 0 }), coordinates = _b[0], setCoordinates = _b[1];
7
+ useEffect(function () {
8
+ getGeocode(address, apiKey).then(function (coords) {
9
+ if (coords) {
10
+ setCoordinates(coords);
11
+ }
12
+ });
13
+ }, [address, apiKey]);
14
+ var mapStyles = {
15
+ height: "100px",
16
+ width: "100px",
17
+ };
18
+ if (!coordinates) {
19
+ return React.createElement("div", null, "Carregando mapa...");
20
+ }
21
+ return (React.createElement(LoadScript, { googleMapsApiKey: apiKey },
22
+ React.createElement(GoogleMap, { mapContainerStyle: mapStyles, zoom: 13, center: coordinates },
23
+ React.createElement(Marker, { position: coordinates }))));
24
+ };
25
+ export default MapContainer;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const BankAccounts: () => React.JSX.Element;
3
+ export default BankAccounts;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { useContext } from "react";
3
+ import { Queries } from "../webservice";
4
+ import { Result } from '../interface/result';
5
+ import AddItemField from '../common/addItem';
6
+ import XPathUtils from '../../utils/xpath';
7
+ import ResultWithoutInformation from '../resultWithoutInformation/ResultWithoutInformation';
8
+ var BankAccounts = function () {
9
+ var ctx = useContext(Queries.Finder);
10
+ var Section = ctx.Section;
11
+ return (React.createElement(Section, { title: 'Informações de Contas Bancárias', subtitle: 'Vejas as informações disponíveis de contas bancárias', ctx: ctx, onSuccess: function (data) {
12
+ var accounts = XPathUtils.select('//bank-info/node', data);
13
+ if (!(accounts === null || accounts === void 0 ? void 0 : accounts.length))
14
+ return React.createElement(ResultWithoutInformation, null);
15
+ return (React.createElement(Result, null, accounts.map(function (account, key) {
16
+ return React.createElement(Result, { key: key, isContainer: true },
17
+ React.createElement(AddItemField, { name: "Banco", value: XPathUtils.select('string(banco)', account) }),
18
+ React.createElement(AddItemField, { name: "Ag\u00EAncia", value: XPathUtils.select('string(agencia)', account) }),
19
+ React.createElement(AddItemField, { name: "Conta", value: XPathUtils.select('string(conta)', account) }));
20
+ })));
21
+ } }));
22
+ };
23
+ export default BankAccounts;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { CCFData } from './ccfList';
3
+ declare const CCF: React.FC<{
4
+ data: CCFData[];
5
+ }>;
6
+ export default CCF;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import Header from '../interface/header';
3
+ import { Result } from '../interface/result';
4
+ import CCFList from './ccfList';
5
+ import classNames from 'classnames';
6
+ import HeaderAction from '../common/headerAction';
7
+ import useToggle from '../../hooks/useToggle';
8
+ var CCF = function (_a) {
9
+ var data = _a.data;
10
+ var _b = useToggle(false), isOpen = _b[0], toggleOpen = _b[1];
11
+ if (!(data === null || data === void 0 ? void 0 : data.length))
12
+ return (React.createElement(Result, null,
13
+ React.createElement(Header, { title: "Cheques Sem Fundos" }),
14
+ React.createElement(CCFList, { data: data })));
15
+ return (React.createElement(Result, null,
16
+ React.createElement(Header, { title: "Cheques Sem Fundo Em Institui\u00E7\u00E3o Banc\u00E1ria", subtitle: "Detalhes Acerca De Cheques Sem Fundo Emitidos", description: "Foram localizados ".concat(data.reduce(function (acc, _a) {
17
+ var quantidadeDeOcorrencias = _a.quantidadeDeOcorrencias;
18
+ return acc + quantidadeDeOcorrencias;
19
+ }, 0), " cheques sem fundo em institui\u00E7\u00F5es banc\u00E1rias."),
20
+ //style={{ background: 'url("images/textures/brilliant.png"), linear-gradient(rgb(247, 8, 8), rgb(255, 255, 255) 160%)' }}
21
+ className: classNames({
22
+ 'gradient-error': data === null || data === void 0 ? void 0 : data.length
23
+ }), actions: React.createElement(HeaderAction, { iconClass: isOpen ? "minus-square-o" : "plus-square-o", onClick: toggleOpen }) }),
24
+ isOpen && (React.createElement(CCFList, { data: data }))));
25
+ };
26
+ export default CCF;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ export type CCFData = {
3
+ banco: string;
4
+ codigoBancario: string;
5
+ agencia: string;
6
+ quantidadeDeOcorrencias: number;
7
+ ultimaOcorrencia: string;
8
+ alinea: string;
9
+ };
10
+ declare const CCFList: React.FC<{
11
+ data: CCFData[];
12
+ }>;
13
+ export default CCFList;
@@ -0,0 +1,18 @@
1
+ import React, { memo } from "react";
2
+ import { Result } from "../interface/result";
3
+ import AddCffField from "../common/addItem";
4
+ var CCFItem = memo(function (_a) {
5
+ var ccf = _a.ccf;
6
+ return (React.createElement("div", { className: "content-layout" },
7
+ React.createElement(AddCffField, { name: "Banco", value: ccf.banco }),
8
+ React.createElement(AddCffField, { name: "C\u00F3digo Banc\u00E1rio", value: ccf.codigoBancario }),
9
+ React.createElement(AddCffField, { name: "Ag\u00EAncia", value: ccf.agencia }),
10
+ React.createElement(AddCffField, { name: "Qtde. Ocorr\u00EAncias", value: ccf.quantidadeDeOcorrencias }),
11
+ React.createElement(AddCffField, { name: "\u00DAltima Ocorr\u00EAncia (h\u00E1 24 dias)", value: ccf.ultimaOcorrencia }),
12
+ React.createElement(AddCffField, { name: "Al\u00EDnea", value: ccf.alinea })));
13
+ });
14
+ var CCFList = function (_a) {
15
+ var data = _a.data;
16
+ return (React.createElement(Result, { isContainer: true, contentClassName: 'container-layout' }, (data === null || data === void 0 ? void 0 : data.length) ? data.map(function (ccf, i) { return (React.createElement(CCFItem, { key: i, ccf: ccf })); }) : (React.createElement(AddCffField, { name: "Informa\u00E7\u00E3o", value: "N\u00E3o foi encontrado registros de Cheques Sem Fundos para o documento consultado." }))));
17
+ };
18
+ export default CCFList;
@@ -0,0 +1,11 @@
1
+ import React, { CSSProperties, DetailedHTMLProps, HTMLAttributes, ReactNode } from "react";
2
+ export interface AddItemProps extends React.PropsWithChildren<{
3
+ name: ReactNode;
4
+ value: ReactNode;
5
+ valueClassName?: string;
6
+ nameClassName?: string;
7
+ styleName?: CSSProperties;
8
+ } & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>> {
9
+ }
10
+ declare function AddItemField({ name, value, children, className, valueClassName, nameClassName, styleName, ...props }: AddItemProps): React.JSX.Element;
11
+ export default AddItemField;
@@ -0,0 +1,35 @@
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 from "react";
24
+ import cn from "classnames";
25
+ function AddItemField(_a) {
26
+ var name = _a.name, value = _a.value, children = _a.children, className = _a.className, valueClassName = _a.valueClassName, nameClassName = _a.nameClassName, styleName = _a.styleName, props = __rest(_a, ["name", "value", "children", "className", "valueClassName", "nameClassName", "styleName"]);
27
+ var fieldClassName = cn("field", className);
28
+ var valueClass = cn("value", valueClassName);
29
+ var nameClass = cn("name", nameClassName);
30
+ return (React.createElement("div", __assign({}, props, { className: fieldClassName }),
31
+ React.createElement("div", { className: valueClass }, value),
32
+ React.createElement("div", { className: nameClass, style: styleName }, name),
33
+ children));
34
+ }
35
+ export default AddItemField;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const Button: React.FC<React.PropsWithChildren<React.HTMLProps<HTMLDivElement> & {
3
+ price?: string;
4
+ }>>;
5
+ export default Button;
@@ -0,0 +1,10 @@
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ var Button = function (_a) {
4
+ var children = _a.children, className = _a.className, price = _a.price;
5
+ var buttonClassName = classNames('button', 'product-button', className);
6
+ return (React.createElement("button", { className: buttonClassName },
7
+ children,
8
+ price && React.createElement("small", null, price)));
9
+ };
10
+ export default Button;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ReactElasticCarouselProps } from '@itseasy21/react-elastic-carousel';
3
+ declare const Carousel: React.ForwardRefExoticComponent<ReactElasticCarouselProps & React.RefAttributes<unknown>>;
4
+ export default Carousel;
@@ -0,0 +1,19 @@
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
+ /* eslint-disable @typescript-eslint/no-explicit-any */
13
+ import React from 'react';
14
+ import CarouselElastic from '@itseasy21/react-elastic-carousel';
15
+ var CustomCarousel = function (props, ref) {
16
+ return React.createElement(CarouselElastic, __assign({}, props, { ref: ref }));
17
+ };
18
+ var Carousel = React.forwardRef(CustomCarousel);
19
+ export default Carousel;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ interface HeaderActionProps {
3
+ iconClass: string;
4
+ onClick: () => void;
5
+ className?: string;
6
+ iconClassName?: string;
7
+ }
8
+ declare const HeaderAction: React.FC<HeaderActionProps>;
9
+ export default HeaderAction;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import classNames from "classnames";
3
+ var HeaderAction = function (_a) {
4
+ var iconClass = _a.iconClass, onClick = _a.onClick, className = _a.className, iconClassName = _a.iconClassName;
5
+ var actionClass = classNames("header-action", className);
6
+ var iconClassNames = classNames("fa fa-".concat(iconClass), iconClassName);
7
+ return (React.createElement("li", { className: actionClass, onClick: onClick, "aria-hidden": "true" },
8
+ React.createElement("i", { className: iconClassNames })));
9
+ };
10
+ export default HeaderAction;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ export type Contact = {
3
+ tipo: string;
4
+ valor: string;
5
+ likes?: number;
6
+ dislikes?: number;
7
+ onClickLike: () => void;
8
+ onClickDislike: () => void;
9
+ };
10
+ export type ContactsProps = {
11
+ onClickConsutarEmail: () => void;
12
+ };
13
+ declare const Contacts: React.FC<ContactsProps>;
14
+ export default Contacts;
@@ -0,0 +1,40 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
10
+ import React, { memo, useContext } from "react";
11
+ import { Result } from "../interface/result";
12
+ import AddItemField from "../common/addItem";
13
+ import ContactsLikeDislike from "./contactsLikeDislike";
14
+ import { Queries } from "../webservice";
15
+ import XPathUtils from "../../utils/xpath";
16
+ var Contacts = function (_a) {
17
+ var onClickConsutarEmail = _a.onClickConsutarEmail;
18
+ var ctx = useContext(Queries.Finder);
19
+ var Section = ctx.Section;
20
+ return (React.createElement(Section, { ctx: ctx, title: "Contato", subtitle: "Meios De Contato", description: "Telefone, e-mail e outros", onError: function () { return React.createElement(React.Fragment, null, "Erro"); }, onLoading: function () { return React.createElement(React.Fragment, null, "Carregando"); }, onSuccess: function (data) {
21
+ var telefones = __spreadArray(__spreadArray([], XPathUtils.select('//telefones/fixos/fixos', data), true), XPathUtils.select('//telefones/moveis/moveis', data), true).map(function (telefone) { return ({ tipo: 'Telefone', valor: XPathUtils.select('string(./telefone)', telefone) }); });
22
+ var emails = XPathUtils.select('//emails/emails', data).map(function (email) { return ({ tipo: 'Email', valor: XPathUtils.select('string(./email)', email) }); });
23
+ var contacts = __spreadArray(__spreadArray([], telefones, true), emails, true);
24
+ var children = (React.createElement(Result, null,
25
+ React.createElement(Result, { isContainer: true }, contacts.map(function (_a, key) {
26
+ var tipo = _a.tipo, valor = _a.valor;
27
+ return (React.createElement(ContactField, { key: key, tipo: tipo, valor: valor, onClickLike: console.log, onClickDislike: console.log }));
28
+ }))));
29
+ return {
30
+ children: children,
31
+ actions: (React.createElement("li", { className: "contacts-atualizar-email" },
32
+ React.createElement("button", { className: "button", onClick: onClickConsutarEmail }, "Consultar E-mail em Dom\u00EDnio")))
33
+ };
34
+ } }));
35
+ };
36
+ var ContactField = memo(function (contact) {
37
+ return (React.createElement(AddItemField, { name: contact.tipo, value: contact.valor },
38
+ React.createElement(ContactsLikeDislike, { likes: contact === null || contact === void 0 ? void 0 : contact.likes, dislikes: contact === null || contact === void 0 ? void 0 : contact.dislikes, onClickLike: contact.onClickLike, onClickDislike: contact.onClickDislike })));
39
+ });
40
+ export default Contacts;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export type ContactsLikeDislikeProps = {
3
+ likes?: number;
4
+ dislikes?: number;
5
+ onClickLike: () => void;
6
+ onClickDislike: () => void;
7
+ };
8
+ declare const ContactsLikeDislike: React.FC<ContactsLikeDislikeProps>;
9
+ export default ContactsLikeDislike;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import ThumbsButton from "./thumbsButton";
3
+ var ContactsLikeDislike = function (_a) {
4
+ var likes = _a.likes, dislikes = _a.dislikes, onClickLike = _a.onClickLike, onClickDislike = _a.onClickDislike;
5
+ return (React.createElement("div", { className: "thumbs-container" },
6
+ React.createElement(ThumbsButton, { action: "like", count: likes, iconClass: "fa-thumbs-o-up", onClick: onClickLike }),
7
+ React.createElement(ThumbsButton, { action: "dislike", count: dislikes, iconClass: "fa-thumbs-o-down", onClick: onClickDislike })));
8
+ };
9
+ export default ContactsLikeDislike;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ type ThumbsButtonProps = {
3
+ count?: number;
4
+ iconClass: string;
5
+ action: "like" | "dislike";
6
+ onClick: () => void;
7
+ className?: string;
8
+ };
9
+ declare const ThumbsButton: React.FC<ThumbsButtonProps>;
10
+ export default ThumbsButton;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import classnames from "classnames";
3
+ var ThumbsButton = function (_a) {
4
+ var _b = _a.count, count = _b === void 0 ? 0 : _b, action = _a.action, iconClass = _a.iconClass, onClick = _a.onClick, className = _a.className;
5
+ var likeButtonIsActive = action == 'like' && count > 0;
6
+ var dislikeButtonIsActive = action == 'dislike' && count > 0;
7
+ var buttonClasses = classnames('thumbs-field', {
8
+ 'thumbs-field-like': likeButtonIsActive,
9
+ 'thumbs-field-dislike': dislikeButtonIsActive
10
+ }, className);
11
+ return (React.createElement("div", { className: buttonClasses, onClick: onClick },
12
+ React.createElement("span", null,
13
+ dislikeButtonIsActive ? "-".concat(count) : count,
14
+ " "),
15
+ React.createElement("i", { className: "fa ".concat(iconClass) })));
16
+ };
17
+ export default ThumbsButton;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface CarrouselProps {
3
+ name: string;
4
+ document: string;
5
+ image?: string;
6
+ }
7
+ export declare const Carrousel: React.FC<CarrouselProps>;
8
+ export default Carrousel;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import Companylogo from "../companyLogo/companyLogo";
3
+ export var Carrousel = function (_a) {
4
+ var name = _a.name, document = _a.document;
5
+ return (React.createElement("div", { className: "carrousel-container" },
6
+ React.createElement(Companylogo, { name: name, document: document })));
7
+ };
8
+ export default Carrousel;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface CircleImageProps {
3
+ name: string;
4
+ document: string;
5
+ }
6
+ declare const Companylogo: React.FC<CircleImageProps>;
7
+ export default Companylogo;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import cn from "classnames";
3
+ import AddItemField from "../../../components/common/addItem";
4
+ var Companylogo = function (_a) {
5
+ var name = _a.name, document = _a.document;
6
+ var hiddenStyle = { display: "none" };
7
+ return (React.createElement(React.Fragment, null,
8
+ React.createElement("div", { className: cn("companyLogo-icon") },
9
+ React.createElement("i", { className: "fa fa-user-circle-o" })),
10
+ React.createElement("div", { className: cn("content", "companyLogo-content") },
11
+ React.createElement(AddItemField, { name: "Nome", value: name, className: cn("field", "companyLogo-field"), styleName: hiddenStyle }),
12
+ React.createElement(AddItemField, { name: "Documento", value: document, styleName: hiddenStyle }))));
13
+ };
14
+ export default Companylogo;
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import { ReclameAquiCarouselProps } from "../reclameAqui/reclameAquiCarousel";
3
+ interface Target {
4
+ "@types": string;
5
+ "@version": string;
6
+ about: {
7
+ [name: string]: unknown;
8
+ };
9
+ identificator: {
10
+ [name: string]: string;
11
+ };
12
+ }
13
+ interface DossieUiProps {
14
+ dossie?: {
15
+ target: Target;
16
+ identificator: string;
17
+ webhook?: string | null;
18
+ events: {
19
+ [name: string]: {};
20
+ }[];
21
+ notations: {
22
+ [name: string]: {};
23
+ };
24
+ relations: {
25
+ [name: string]: {};
26
+ };
27
+ associates: {
28
+ [name: string]: {};
29
+ }[];
30
+ };
31
+ reclameAquiData?: Omit<ReclameAquiCarouselProps, 'nome' | 'cnpj'>[];
32
+ onOpenNewTransactionModal: () => void;
33
+ }
34
+ declare const Dossie: React.FC<DossieUiProps>;
35
+ export default Dossie;
@@ -0,0 +1,38 @@
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
+ //eslint-disable-ban-types
13
+ import React, { useContext } from "react";
14
+ import cn from "classnames";
15
+ import { Summary } from "./summary/summary";
16
+ import { TransactionsTable } from "./transactionTable/transactionTable";
17
+ import { Carrousel } from "./carrousel/carrousel";
18
+ import { Result } from "../interface/result";
19
+ import { ReclameAquiCarousel } from "../reclameAqui/reclameAquiCarousel";
20
+ import { Queries } from "../webservice";
21
+ import XPathUtils from "../../utils/xpath";
22
+ import { formatCnpj, formatCpf } from "../../utils/string";
23
+ var Dossie = function (_a) {
24
+ var _b = _a.reclameAquiData, reclameAquiData = _b === void 0 ? [] : _b;
25
+ var ctx = useContext(Queries.Finder);
26
+ var Section = ctx.Section;
27
+ return (React.createElement(Section, { ctx: ctx, hideHeader: true, onError: function () { return React.createElement(React.Fragment, null, "Erro"); }, onLoading: function () { return React.createElement(React.Fragment, null, "Carregando..."); }, onSuccess: function (data) {
28
+ var isPF = !!XPathUtils.select('string(//cadastro/cpf)', data);
29
+ var name = isPF ? XPathUtils.select('string(//cadastro/nome)', data) : XPathUtils.select('string(//cadastro/razaoSocial)', data);
30
+ var document = isPF ? formatCpf(XPathUtils.select('string(//cadastro/cpf)', data)) : formatCnpj(XPathUtils.select('string(//cadastro/cnpj)', data));
31
+ return (React.createElement(Result, null,
32
+ React.createElement("div", { className: cn("dossie-grid", "dossie") },
33
+ reclameAquiData && !isPF ? (React.createElement(ReclameAquiCarousel, { data: reclameAquiData === null || reclameAquiData === void 0 ? void 0 : reclameAquiData.map(function (empresa) { return (__assign(__assign({}, empresa), { nome: name, cnpj: document })); }) })) : (React.createElement(Carrousel, { name: name, document: document })),
34
+ React.createElement(TransactionsTable, { events: XPathUtils.select('//historico/consulta', data) })),
35
+ React.createElement(Summary, { finderResponse: data })));
36
+ } }));
37
+ };
38
+ export default Dossie;