@credithub/harlan-components 1.13.2 → 1.13.4

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/adresses/addresses.js +2 -3
  2. package/lib/cjs/components/ccf/ccf.js +1 -1
  3. package/lib/cjs/components/chart/chartContent.js +14 -2
  4. package/lib/cjs/components/chart/chartHelper.d.ts +1 -1
  5. package/lib/cjs/components/chart/customChart.js +2 -2
  6. package/lib/cjs/components/chart/plotly/layoutLineBarChart.js +2 -0
  7. package/lib/cjs/components/chart/quantityResult.js +2 -2
  8. package/lib/cjs/components/consultaSimplesSection/consultaSimplesSection.d.ts +6 -0
  9. package/lib/cjs/components/consultaSimplesSection/consultaSimplesSection.js +110 -0
  10. package/lib/cjs/components/dominios/dominios.js +3 -2
  11. package/lib/cjs/components/dossie/summary/cardsAndProducts.js +1 -1
  12. package/lib/cjs/components/imoveis/imoveisService.js +1 -1
  13. package/lib/cjs/components/interface/header.js +1 -1
  14. package/lib/cjs/components/interface/result.js +1 -1
  15. package/lib/cjs/components/interface/section.js +5 -26
  16. package/lib/cjs/components/interface/statusMessage.d.ts +2 -1
  17. package/lib/cjs/components/interface/statusMessage.js +6 -2
  18. package/lib/cjs/components/partners/partnerList.js +1 -1
  19. package/lib/cjs/components/processos-juridicos/processosJuridicos.js +1 -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/adresses/addresses.js +2 -3
  31. package/lib/esm/components/ccf/ccf.js +1 -1
  32. package/lib/esm/components/chart/chartContent.js +14 -2
  33. package/lib/esm/components/chart/chartHelper.d.ts +1 -1
  34. package/lib/esm/components/chart/customChart.js +2 -2
  35. package/lib/esm/components/chart/plotly/layoutLineBarChart.js +2 -0
  36. package/lib/esm/components/chart/quantityResult.js +2 -2
  37. package/lib/esm/components/consultaSimplesSection/consultaSimplesSection.d.ts +6 -0
  38. package/lib/esm/components/consultaSimplesSection/consultaSimplesSection.js +82 -0
  39. package/lib/esm/components/dominios/dominios.js +3 -2
  40. package/lib/esm/components/dossie/summary/cardsAndProducts.js +1 -1
  41. package/lib/esm/components/imoveis/imoveisService.js +1 -1
  42. package/lib/esm/components/interface/header.js +1 -1
  43. package/lib/esm/components/interface/result.js +1 -1
  44. package/lib/esm/components/interface/section.js +5 -26
  45. package/lib/esm/components/interface/statusMessage.d.ts +2 -1
  46. package/lib/esm/components/interface/statusMessage.js +6 -2
  47. package/lib/esm/components/partners/partnerList.js +1 -1
  48. package/lib/esm/components/processos-juridicos/processosJuridicos.js +1 -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
@@ -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.2",
3
+ "version": "1.13.4",
4
4
  "description": "Provide a set of web components to be used in Harlan and other projects",
5
5
  "keywords": [
6
6
  "harlan",