@credithub/harlan-components 1.78.3 → 1.79.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.
@@ -17,7 +17,7 @@ var PartnerList = memo(function (_a) {
17
17
  React.createElement(PartnerField, { name: partner.cnpj ? 'CNPJ' : 'CPF', value: (_b = (partner.cnpj || partner.cpf)) !== null && _b !== void 0 ? _b : '', onClick: function () { var _a, _b; return (_a = partner.onClickCpfCnpj) === null || _a === void 0 ? void 0 : _a.call(partner, (_b = (partner.cnpj || partner.cpf)) !== null && _b !== void 0 ? _b : ''); } }),
18
18
  React.createElement(PartnerField, { name: "Protestos", value: partner === null || partner === void 0 ? void 0 : partner.protestos }),
19
19
  React.createElement(PartnerField, { name: "Situa\u00E7\u00E3o na Receita Federal", value: partner.receitaStatus }),
20
- React.createElement(PartnerField, { name: "Dividas P\u00FAblicas", value: partner.dividasPublicas }),
20
+ React.createElement(PartnerField, { name: "D\u00EDvidas P\u00FAblicas", value: partner.dividasPublicas }),
21
21
  React.createElement("div", null, (partner.cpf || partner.cnpj) && (React.createElement(ButtonPartner, { onClick: function (e) {
22
22
  e.preventDefault();
23
23
  onClickQSA(partner.cpf || partner.cnpj || '');
@@ -150,7 +150,16 @@ var Protestos = function () {
150
150
  }, [total, iaOverrides]);
151
151
  return (React.createElement(Section, { ctx: ctx, title: "Apontamentos na Central de Protestos (CENPROT)", subtitle: "Consulta de protestos de cr\u00E9dito, imposto e gerais.", icon: ProtestosIcon, onSuccess: handleSuccess, actions: typeof harlan !== 'undefined' ? (React.createElement(BtnWrapper, null,
152
152
  React.createElement(Button, { onClick: function () {
153
- harlan === null || harlan === void 0 ? void 0 : harlan.call('creditHub::addLiminar');
153
+ var _a;
154
+ // Obtém o documento do contexto e formata adequadamente
155
+ var documento = ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.data) === null || _a === void 0 ? void 0 : _a.documento) || '';
156
+ var formattedDoc = (function () {
157
+ var cleanDoc = documento.replace(/\D+/g, '');
158
+ return cleanDoc.length === 14
159
+ ? "".concat(cleanDoc.slice(0, 2), ".").concat(cleanDoc.slice(2, 5), ".").concat(cleanDoc.slice(5, 8), "/").concat(cleanDoc.slice(8, 12), "-").concat(cleanDoc.slice(12))
160
+ : "".concat(cleanDoc.slice(0, 3), ".").concat(cleanDoc.slice(3, 6), ".").concat(cleanDoc.slice(6, 9), "-").concat(cleanDoc.slice(9));
161
+ })();
162
+ harlan === null || harlan === void 0 ? void 0 : harlan.call('creditHub::addLiminar', { document: formattedDoc });
154
163
  } }, "Apontar Protesto"))) : null }));
155
164
  };
156
165
  export default React.memo(Protestos);