@credithub/harlan-components 1.91.7 → 1.91.9

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.
@@ -35,14 +35,18 @@ var GenerativeAIContainer = styled.div(templateObject_3 || (templateObject_3 = _
35
35
  // Utilitário para obter o nome da empresa, priorizando ReceitaWS
36
36
  var getCompanyName = function (isPF, finderDoc, rfbDoc) {
37
37
  if (isPF) {
38
+ // PRIORIDADE: nome atualizado da Receita Federal (via CERTIDAO)
39
+ var rfbName_1 = XPathUtils.select('string(//RFB/nome)', rfbDoc);
40
+ if (rfbName_1)
41
+ return rfbName_1;
42
+ // fallback: nome do Finder
38
43
  return XPathUtils.select('string(//cadastro/nome)', finderDoc);
39
44
  }
40
- // prioridade 1 → ReceitaWS
45
+ // para CNPJ
41
46
  var rfbName = (rfbDoc && XPathUtils.select('string(//RFB/nome)', rfbDoc)) ||
42
47
  '';
43
48
  if (rfbName)
44
49
  return rfbName;
45
- // prioridade 2 → Finder
46
50
  return ((finderDoc &&
47
51
  XPathUtils.select('string(//cadastro/razaoSocial)', finderDoc)) ||
48
52
  '');
@@ -1,4 +1,3 @@
1
- // No arquivo section.tsx
2
1
  var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
2
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
3
  return cooked;
@@ -40,13 +39,16 @@ import StatusMessage from './interface/statusMessage';
40
39
  import { RequestStatus } from './webservice';
41
40
  var ButtonWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n justify-content: center;\n width: 100%;\n height: 40%;\n max-height: 52px;\n max-width: 300px;\n margin: 0 auto;\n"], ["\n justify-content: center;\n width: 100%;\n height: 40%;\n max-height: 52px;\n max-width: 300px;\n margin: 0 auto;\n"])));
42
41
  var Section = forwardRef(function (_a, ref) {
43
- var onSuccess = _a.onSuccess, _b = _a.isError, isError = _b === void 0 ? function (err, ctx) { return ({
44
- children: React.createElement(React.Fragment, null),
45
- description: (React.createElement(React.Fragment, null,
46
- React.createElement(StatusMessage, { type: "error" }, err.message))),
47
- actions: (React.createElement(React.Fragment, null, (ctx === null || ctx === void 0 ? void 0 : ctx.refetch) && (React.createElement(ButtonWrapper, null,
48
- React.createElement(Button, { onClick: function () { return ctx.refetch(); } }, "Tentar Novamente")))))
49
- }); } : _b, _c = _a.onLoading, onLoading = _c === void 0 ? function () { return React.createElement(React.Fragment, null); } : _c, ctx = _a.ctx, className = _a.className, _d = _a.hideHeader, hideHeader = _d === void 0 ? false : _d, _e = _a.minimized, minimized = _e === void 0 ? false : _e, headerProps = __rest(_a, ["onSuccess", "isError", "onLoading", "ctx", "className", "hideHeader", "minimized"]);
42
+ var onSuccess = _a.onSuccess, _b = _a.isError, isError = _b === void 0 ? function (err, ctx) {
43
+ var shouldPush = (err === null || err === void 0 ? void 0 : err.push) === true;
44
+ return {
45
+ children: React.createElement(React.Fragment, null),
46
+ description: shouldPush ? (React.createElement(React.Fragment, null,
47
+ React.createElement(StatusMessage, { type: "error" }, err.message))) : null,
48
+ actions: (React.createElement(React.Fragment, null, (ctx === null || ctx === void 0 ? void 0 : ctx.refetch) && (React.createElement(ButtonWrapper, null,
49
+ React.createElement(Button, { onClick: function () { return ctx.refetch(); } }, "Tentar Novamente")))))
50
+ };
51
+ } : _b, _c = _a.onLoading, onLoading = _c === void 0 ? function () { return React.createElement(React.Fragment, null); } : _c, ctx = _a.ctx, className = _a.className, _d = _a.hideHeader, hideHeader = _d === void 0 ? false : _d, _e = _a.minimized, minimized = _e === void 0 ? false : _e, headerProps = __rest(_a, ["onSuccess", "isError", "onLoading", "ctx", "className", "hideHeader", "minimized"]);
50
52
  var _f = useToggle(!minimized), isOpen = _f[0], toggleOpen = _f[1];
51
53
  if (!ctx)
52
54
  return null;