@credithub/harlan-components 1.78.4 → 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.
- package/dist/components/protestos/protestos.js +10 -1
- package/lib/cjs/index.js +11 -2
- package/lib/esm/index.js +11 -2
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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);
|