@arquimedes.co/eureka-forms 2.0.68-test → 2.0.70-test
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.
|
@@ -57,7 +57,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
57
57
|
return t;
|
|
58
58
|
};
|
|
59
59
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
60
|
-
import { useContext, useEffect, useState } from 'react';
|
|
60
|
+
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
61
61
|
import styles from './ColumnForm.module.css';
|
|
62
62
|
import React from 'react';
|
|
63
63
|
import Terms from '../../Terms/Terms';
|
|
@@ -91,7 +91,7 @@ function ColumnForm(_a) {
|
|
|
91
91
|
var handleErrors = handleSubmit(function () { }, function (errors) {
|
|
92
92
|
console.error('Errors:', errors);
|
|
93
93
|
});
|
|
94
|
-
var submit = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
94
|
+
var submit = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
95
95
|
var valid, values, state;
|
|
96
96
|
return __generator(this, function (_a) {
|
|
97
97
|
switch (_a.label) {
|
|
@@ -119,7 +119,7 @@ function ColumnForm(_a) {
|
|
|
119
119
|
return [2 /*return*/, values];
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
|
-
}); };
|
|
122
|
+
}); }, [form]);
|
|
123
123
|
return (_jsxs("div", __assign({ className: styles.container, style: { color: formStyle.textColor } }, { children: [loading && _jsx("div", { className: styles.curtain }), previous.map(function (idSection) { return (_jsx(Section, { idSection: idSection }, idSection)); }), next.map(function (idSection) { return (_jsx(Section, { idSection: idSection }, idSection)); }), _jsx(Terms, {}), !postview && editable && (_jsxs(React.Fragment, { children: [customSubmitBtns === undefined && (_jsx("div", __assign({ className: styles.submitBtnContainer }, { children: _jsx(CustomBtn, { onClick: submit, width: "calc(100% - 70px)", label: sendLabel !== null && sendLabel !== void 0 ? sendLabel : 'Enviar', backgroundColor: formStyle.primaryColor, color: formStyle.primaryContrastColor, loading: loading, "data-testid": "form__submit" }) }))), customSubmitBtns === null || customSubmitBtns === void 0 ? void 0 : customSubmitBtns(submit, loading)] }))] })));
|
|
124
124
|
}
|
|
125
125
|
export default ColumnForm;
|
package/package.json
CHANGED