@credithub/harlan-components 1.13.3 → 1.13.5

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 (59) hide show
  1. package/lib/cjs/components/ccf/ccf.js +1 -1
  2. package/lib/cjs/components/chart/chartContent.js +14 -2
  3. package/lib/cjs/components/chart/chartHelper.d.ts +1 -1
  4. package/lib/cjs/components/chart/customChart.js +11 -9
  5. package/lib/cjs/components/chart/plotly/layoutLineBarChart.js +2 -0
  6. package/lib/cjs/components/chart/quantityResult.js +2 -2
  7. package/lib/cjs/components/consultaSimplesSection/consultaSimplesSection.d.ts +6 -0
  8. package/lib/cjs/components/consultaSimplesSection/consultaSimplesSection.js +110 -0
  9. package/lib/cjs/components/dominios/dominios.js +3 -2
  10. package/lib/cjs/components/dossie/summary/cardsAndProducts.js +1 -1
  11. package/lib/cjs/components/imoveis/imoveisService.js +1 -1
  12. package/lib/cjs/components/interface/header.js +1 -1
  13. package/lib/cjs/components/interface/result.js +2 -2
  14. package/lib/cjs/components/interface/section.js +5 -26
  15. package/lib/cjs/components/interface/statusMessage.d.ts +2 -1
  16. package/lib/cjs/components/interface/statusMessage.js +6 -2
  17. package/lib/cjs/components/partners/partnerList.js +1 -1
  18. package/lib/cjs/components/processos-juridicos/processosJuridicos.js +1 -1
  19. package/lib/cjs/components/protestos/protestos.js +2 -1
  20. package/lib/cjs/components/protestos/protestosCategory.js +1 -1
  21. package/lib/cjs/components/refinBoaVista/refinBoaVista.js +1 -1
  22. package/lib/cjs/components/refinSerasa/refinSerasa.js +1 -1
  23. package/lib/cjs/components/score/scoreService.js +1 -1
  24. package/lib/cjs/components/scr/scr.js +4 -4
  25. package/lib/cjs/components/veiculos/veiculos.js +1 -1
  26. package/lib/cjs/components/webservice.js +3 -3
  27. package/lib/cjs/consultaSimples.js +3 -60
  28. package/lib/cjs/utils/string.d.ts +1 -0
  29. package/lib/cjs/utils/string.js +8 -1
  30. package/lib/esm/components/ccf/ccf.js +1 -1
  31. package/lib/esm/components/chart/chartContent.js +14 -2
  32. package/lib/esm/components/chart/chartHelper.d.ts +1 -1
  33. package/lib/esm/components/chart/customChart.js +11 -9
  34. package/lib/esm/components/chart/plotly/layoutLineBarChart.js +2 -0
  35. package/lib/esm/components/chart/quantityResult.js +2 -2
  36. package/lib/esm/components/consultaSimplesSection/consultaSimplesSection.d.ts +6 -0
  37. package/lib/esm/components/consultaSimplesSection/consultaSimplesSection.js +82 -0
  38. package/lib/esm/components/dominios/dominios.js +3 -2
  39. package/lib/esm/components/dossie/summary/cardsAndProducts.js +1 -1
  40. package/lib/esm/components/imoveis/imoveisService.js +1 -1
  41. package/lib/esm/components/interface/header.js +1 -1
  42. package/lib/esm/components/interface/result.js +2 -2
  43. package/lib/esm/components/interface/section.js +5 -26
  44. package/lib/esm/components/interface/statusMessage.d.ts +2 -1
  45. package/lib/esm/components/interface/statusMessage.js +6 -2
  46. package/lib/esm/components/partners/partnerList.js +1 -1
  47. package/lib/esm/components/processos-juridicos/processosJuridicos.js +1 -1
  48. package/lib/esm/components/protestos/protestos.js +2 -1
  49. package/lib/esm/components/protestos/protestosCategory.js +1 -1
  50. package/lib/esm/components/refinBoaVista/refinBoaVista.js +1 -1
  51. package/lib/esm/components/refinSerasa/refinSerasa.js +1 -1
  52. package/lib/esm/components/score/scoreService.js +1 -1
  53. package/lib/esm/components/scr/scr.js +4 -4
  54. package/lib/esm/components/veiculos/veiculos.js +1 -1
  55. package/lib/esm/components/webservice.js +3 -3
  56. package/lib/esm/consultaSimples.js +3 -37
  57. package/lib/esm/utils/string.d.ts +1 -0
  58. package/lib/esm/utils/string.js +6 -0
  59. package/package.json +1 -1
@@ -59,7 +59,7 @@ function ConsultaSCR(_a) {
59
59
  }
60
60
  var ResumoDoCliente = function (_a) {
61
61
  var scr = _a.scr, scrRef = _a.scrRef, isLoading = _a.isLoading, error = _a.error;
62
- return (React.createElement(React.Fragment, null,
62
+ return (React.createElement("div", null,
63
63
  React.createElement(Header, { innerRef: scrRef, title: 'SCR', variant: isLoading ? 'loading' : error ? 'error' : 'default', subtitle: 'Resumo do Cliente', description: error ? React.createElement(StatusMessage, { type: "error" }, error.message) : null, icon: ScrIcon }),
64
64
  scr && !isLoading && (React.createElement(Result, null,
65
65
  React.createElement(ResultContent, { desktop: "repeat(4, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr 1fr" },
@@ -71,7 +71,7 @@ var ResumoDoCliente = function (_a) {
71
71
  var FluxosDeVencimentosConsolidados = function (_a) {
72
72
  var _b;
73
73
  var scr = _a.scr, isLoading = _a.isLoading, error = _a.error;
74
- return (React.createElement(React.Fragment, null,
74
+ return (React.createElement("div", null,
75
75
  React.createElement(Header, { title: 'SCR', subtitle: 'Fluxo De Vencimentos Consolidados', variant: isLoading ? 'loading' : error ? 'error' : 'default', icon: ScrIcon }),
76
76
  scr && !isLoading && (React.createElement(Result, null,
77
77
  React.createElement(ResultContent, { desktop: "repeat(4, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr 1fr" },
@@ -90,7 +90,7 @@ var FluxosDeVencimentosConsolidados = function (_a) {
90
90
  };
91
91
  var ResumoList = function (_a) {
92
92
  var isLoading = _a.isLoading, className = _a.className, error = _a.error, resumos = _a.resumos, props = __rest(_a, ["isLoading", "className", "error", "resumos"]);
93
- return (React.createElement(React.Fragment, null,
93
+ return (React.createElement("div", null,
94
94
  React.createElement(Header, __assign({}, props, { variant: isLoading ? 'loading' : error ? 'error' : 'default', icon: ScrIcon })),
95
95
  !isLoading && (React.createElement(Result, null,
96
96
  React.createElement(ResultContent, { desktop: "repeat(4, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr 1fr" }, resumos.map(function (_a, key) {
@@ -101,7 +101,7 @@ var ResumoList = function (_a) {
101
101
  var ResumoModalidades = function (_a) {
102
102
  var scr = _a.scr, isLoading = _a.isLoading, error = _a.error;
103
103
  var resumoModalidades = scr && getResumoDeModalidades(scr) || [];
104
- return (React.createElement(React.Fragment, null,
104
+ return (React.createElement("div", null,
105
105
  React.createElement(Header, { title: "SCR", subtitle: "Modalidade x Data Base", variant: isLoading ? 'loading' : error ? 'error' : 'default', icon: ScrIcon }),
106
106
  !isLoading && (React.createElement(Result, null, resumoModalidades.map(function (resumo, key) { return (React.createElement(ResultContent, { key: key, desktop: "repeat(4, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr 1fr" },
107
107
  React.createElement(AddItemField, { name: "Modalidade", value: resumo.modalidade }),
@@ -41,7 +41,7 @@ function Veiculos(_a) {
41
41
  if (!((_d = consultasComplementares === null || consultasComplementares === void 0 ? void 0 : consultasComplementares.veiculos) === null || _d === void 0 ? void 0 : _d.consultaRealizada))
42
42
  return null;
43
43
  var description = registros.length ? registros.length > 1 ? "Foram encontrados ".concat(registros.length, " ve\u00EDculos registrados no CPF/CNPJ") : 'Foi encontrato 1 veículo registrado no CPF/CNPJ' : 'Nenhum veículo encontrado';
44
- return (React.createElement(React.Fragment, null,
44
+ return (React.createElement("div", null,
45
45
  React.createElement(Header, { innerRef: veiculosRef, title: 'Ve\u00EDculos Registrados no CPF/CNPJ', subtitle: 'Informa\u00E7\u00F5es de Ve\u00EDculos Registrados no CPF/CNPJ', variant: isLoading ? 'loading' : error ? 'error' : 'default', description: React.createElement(StatusMessage, { type: error ? 'error' : registros.length ? 'success' : 'default' }, (error === null || error === void 0 ? void 0 : error.message) || description), icon: VeiculosIcon }),
46
46
  React.createElement(Result, null, registros.map(function (registro, i) { return (React.createElement(ResultContent, { key: i, desktop: "repeat(4, 1fr)", tablet: "repeat(3, 1fr)", mobile: "1fr 1fr" },
47
47
  React.createElement(AddItemField, { name: 'Placa', value: XPathUtils.getField('placa', registro) }),
@@ -184,7 +184,7 @@ export var Queries = {
184
184
  var Section = function (_a) {
185
185
  var onSuccess = _a.onSuccess, _b = _a.isError, isError = _b === void 0 ? function (err) { return ({
186
186
  children: React.createElement(React.Fragment, null),
187
- description: React.createElement(StatusMessage, { type: "error" }, err.message)
187
+ description: React.createElement(StatusMessage, { type: "warning" }, err.message)
188
188
  }); } : _b, _c = _a.onLoading, onLoading = _c === void 0 ? function () { return React.createElement(React.Fragment, null); } : _c, ctx = _a.ctx, children = _a.children, className = _a.className, _d = _a.hideHeader, hideHeader = _d === void 0 ? false : _d, _e = _a.minimized, minimized = _e === void 0 ? true : _e, headerProps = __rest(_a, ["onSuccess", "isError", "onLoading", "ctx", "children", "className", "hideHeader", "minimized"]);
189
189
  var _f = useToggle(!minimized), isOpen = _f[0], toggleOpen = _f[1];
190
190
  if (!ctx)
@@ -205,7 +205,7 @@ var Section = function (_a) {
205
205
  var defaultHeaderActions = (React.createElement(React.Fragment, null,
206
206
  React.createElement(BtnWrapper, { hidden: (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Loading, onClick: toggleOpen }, isOpen ? React.createElement(ChevronUp, null) : React.createElement(ChevronDown, null))));
207
207
  if (React.isValidElement(renderedResponse)) {
208
- return (React.createElement(React.Fragment, null,
208
+ return (React.createElement("div", null,
209
209
  !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,
210
210
  headerProps.actions,
211
211
  defaultHeaderActions)) }))),
@@ -213,7 +213,7 @@ var Section = function (_a) {
213
213
  }
214
214
  var _g = renderedResponse, renderedChildren = _g.children, headerReplaceProps = __rest(_g, ["children"]);
215
215
  var headerPropsUnified = Object.assign(headerProps, headerReplaceProps);
216
- return (React.createElement(React.Fragment, null,
216
+ return (React.createElement("div", null,
217
217
  !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,
218
218
  headerPropsUnified.actions,
219
219
  renderedChildren && defaultHeaderActions)) }))),
@@ -2,42 +2,18 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
2
2
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
3
  return cooked;
4
4
  };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- var __rest = (this && this.__rest) || function (s, e) {
17
- var t = {};
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
- t[p] = s[p];
20
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
- t[p[i]] = s[p[i]];
24
- }
25
- return t;
26
- };
27
- import React, { useContext } from "react";
28
- import { Section, Contacts, Partners, Dossie, Addresses, CCF, Protestos, ProcessosJuridicos, BankAccounts, WebServiceProvider, Queries, CustomChartSection, RefinSerasa, RefinBoaVista, Veiculos, RequestStatus, } from "./";
5
+ import React from "react";
6
+ import { Contacts, Partners, Dossie, Addresses, CCF, Protestos, ProcessosJuridicos, BankAccounts, WebServiceProvider, Queries, CustomChartSection, RefinSerasa, RefinBoaVista, Veiculos, } from "./";
29
7
  import { ConsultasComplementaresProvider } from "./components/consultasComplementares";
30
8
  import ConsultaSCR from "./components/scr/scr";
31
9
  import ConsultaScore from "./components/score/scoreService";
32
10
  import ConsultaImoveis from "./components/imoveis/imoveisService";
33
11
  import GlobalStyle from "./components/interface/globalStyle";
34
- import ConsultaSimplesIcon from "./assets/icones/consultaSimples";
35
- import StatusMessage from "./components/interface/statusMessage";
36
12
  import { ConsultaRfbProvider } from "./components/consultaRfb";
37
13
  import styled from "styled-components";
38
- import { formatDocument } from "./utils/string";
39
14
  import Dominios from "./components/dominios/dominios";
40
15
  import Liminar from "./components/liminar/liminar";
16
+ import ConsultaSimplesSection from "./components/consultaSimplesSection/consultaSimplesSection";
41
17
  var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 20px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 20px;\n"])));
42
18
  var ConsultaSimples = function (_a) {
43
19
  var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, apiKey = _a.apiKey, onClose = _a.onClose, hasCredits = _a.hasCredits;
@@ -74,15 +50,5 @@ var ConsultaSimples = function (_a) {
74
50
  React.createElement(CCF, null),
75
51
  React.createElement(ProcessosJuridicos, { onClickConsultarProcessoJuridico: onClickConsultarProcessoJuridico })))))))))))));
76
52
  };
77
- var ConsultaSimplesSection = function (_a) {
78
- var documento = _a.documento, children = _a.children, onClose = _a.onClose, rest = __rest(_a, ["documento", "children", "onClose"]);
79
- var ctx = useContext(Queries.Finder);
80
- var isSuccess = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Success;
81
- var isError = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Error;
82
- var isLoading = (ctx === null || ctx === void 0 ? void 0 : ctx.type) === RequestStatus.Loading;
83
- return (React.createElement(Section, __assign({ title: "Consulta Simples", subtitle: "Consulta de informa\u00E7\u00F5es do documento.", description: React.createElement(React.Fragment, null,
84
- React.createElement(StatusMessage, { type: "found" }, formatDocument(documento)),
85
- 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));
86
- };
87
53
  export default ConsultaSimples;
88
54
  var templateObject_1;
@@ -6,4 +6,5 @@ export declare function isCnpj(documento: string): boolean;
6
6
  export declare const isDocumentoPF: (documento: string) => boolean;
7
7
  export declare function formatDatePtBrToDate(date: string): Date;
8
8
  export declare function capitalize(value: string): string | null;
9
+ export declare function capitalizeFirstLetter(value: string): string | null;
9
10
  export declare function addNoValueContent<T>(obj: T): T;
@@ -43,6 +43,12 @@ export function capitalize(value) {
43
43
  }
44
44
  return words.join(" ");
45
45
  }
46
+ export function capitalizeFirstLetter(value) {
47
+ var _a;
48
+ if (!value)
49
+ return null;
50
+ return ((_a = value === null || value === void 0 ? void 0 : value.charAt(0)) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + (value === null || value === void 0 ? void 0 : value.slice(1));
51
+ }
46
52
  export function addNoValueContent(obj) {
47
53
  return Object.fromEntries(Object.entries(obj).map(function (_a) {
48
54
  var key = _a[0], value = _a[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credithub/harlan-components",
3
- "version": "1.13.3",
3
+ "version": "1.13.5",
4
4
  "description": "Provide a set of web components to be used in Harlan and other projects",
5
5
  "keywords": [
6
6
  "harlan",