@arquimedes.co/eureka-forms 1.5.7-test → 1.5.8-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.
package/dist/App.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface AppProps {
|
|
|
17
17
|
preview?: boolean;
|
|
18
18
|
/** If the form can be edited (For entities) */
|
|
19
19
|
editable?: boolean;
|
|
20
|
+
/** The custom send label to display */
|
|
21
|
+
sendLabel?: string;
|
|
20
22
|
/** The data to fill the form with */
|
|
21
23
|
valuesData?: Record<string, unknown>;
|
|
22
24
|
/** Custom steps to display */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormComponentProps } from '../Form';
|
|
3
|
-
declare function ColumnForm({ form, apiKey, reload, domain, postview, internal, formStyle, widthStats, customSteps, customSend, handleLoaded, originalValues, ...others }: FormComponentProps): JSX.Element;
|
|
3
|
+
declare function ColumnForm({ form, apiKey, reload, domain, postview, internal, formStyle, sendLabel, widthStats, customSteps, customSend, handleLoaded, originalValues, ...others }: FormComponentProps): JSX.Element;
|
|
4
4
|
export default ColumnForm;
|
|
@@ -70,7 +70,7 @@ import axiosInstance from '../../../AxiosAPI';
|
|
|
70
70
|
import widgetInstance from '../../../AxiosWidget';
|
|
71
71
|
function ColumnForm(_a) {
|
|
72
72
|
var _this = this;
|
|
73
|
-
var form = _a.form, apiKey = _a.apiKey, reload = _a.reload, domain = _a.domain, postview = _a.postview, internal = _a.internal, formStyle = _a.formStyle, widthStats = _a.widthStats, customSteps = _a.customSteps, customSend = _a.customSend, handleLoaded = _a.handleLoaded, originalValues = _a.originalValues, others = __rest(_a, ["form", "apiKey", "reload", "domain", "postview", "internal", "formStyle", "widthStats", "customSteps", "customSend", "handleLoaded", "originalValues"]);
|
|
73
|
+
var form = _a.form, apiKey = _a.apiKey, reload = _a.reload, domain = _a.domain, postview = _a.postview, internal = _a.internal, formStyle = _a.formStyle, sendLabel = _a.sendLabel, widthStats = _a.widthStats, customSteps = _a.customSteps, customSend = _a.customSend, handleLoaded = _a.handleLoaded, originalValues = _a.originalValues, others = __rest(_a, ["form", "apiKey", "reload", "domain", "postview", "internal", "formStyle", "sendLabel", "widthStats", "customSteps", "customSend", "handleLoaded", "originalValues"]);
|
|
74
74
|
var _b = useState(false), tempError = _b[0], setTempError = _b[1];
|
|
75
75
|
var _c = useState(calcDependencies(form.steps, originalValues)), dependencyStore = _c[0], setDependencyStore = _c[1];
|
|
76
76
|
var _d = useForm({
|
|
@@ -161,7 +161,7 @@ function ColumnForm(_a) {
|
|
|
161
161
|
color: formStyle.primaryContrastColor,
|
|
162
162
|
}, disabled: loading }, { children: [_jsx("div", __assign({ style: {
|
|
163
163
|
visibility: loading ? 'hidden' : 'visible',
|
|
164
|
-
} }, { children:
|
|
164
|
+
} }, { children: sendLabel !== null && sendLabel !== void 0 ? sendLabel : 'Enviar' }), void 0), loading && (_jsx("div", __assign({ className: styles.loaderContainer }, { children: _jsx(Loader, { color: formStyle.primaryContrastColor, position: "unset" }, void 0) }), void 0))] }), void 0) }), void 0))] }), void 0));
|
|
165
165
|
}
|
|
166
166
|
export default ColumnForm;
|
|
167
167
|
function calcNextSection(form, idSection, sections) {
|
|
@@ -26,6 +26,8 @@ export interface FormComponentProps {
|
|
|
26
26
|
handleLoaded: () => void;
|
|
27
27
|
/** If the form can be edited (For entities) */
|
|
28
28
|
editable: boolean;
|
|
29
|
+
/** The custom send label to display */
|
|
30
|
+
sendLabel?: string;
|
|
29
31
|
}
|
|
30
32
|
declare function FormComponent({ form, internal, postview, organization, containerRef, ...others }: Omit<FormComponentProps, 'widthStats' | 'formStyle' | 'handleLoaded'> & {
|
|
31
33
|
containerRef: any;
|
|
@@ -58,27 +58,20 @@ function FormComponent(_a) {
|
|
|
58
58
|
var currentWidth = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
|
|
59
59
|
if (currentWidth !== undefined) {
|
|
60
60
|
var currentBreakPoint = form.size.blockNum;
|
|
61
|
-
|
|
62
|
-
console.log((form.size.blockSize + form.size.spacingSize) *
|
|
63
|
-
currentBreakPoint +
|
|
64
|
-
40);
|
|
65
|
-
console.log(currentWidth <
|
|
66
|
-
(form.size.blockSize + form.size.spacingSize) *
|
|
67
|
-
currentBreakPoint +
|
|
68
|
-
40);
|
|
61
|
+
var padding = form.isStandAlone ? 40 : 0;
|
|
69
62
|
while (currentWidth <
|
|
70
63
|
(form.size.blockSize + form.size.spacingSize) *
|
|
71
64
|
currentBreakPoint +
|
|
72
|
-
|
|
65
|
+
padding) {
|
|
73
66
|
currentBreakPoint--;
|
|
74
67
|
}
|
|
75
68
|
setWidthStats({
|
|
76
69
|
isResponsive: currentWidth <
|
|
77
70
|
(form.size.blockSize + form.size.spacingSize) *
|
|
78
71
|
form.size.blockNum +
|
|
79
|
-
|
|
72
|
+
padding,
|
|
80
73
|
isMobile: currentWidth <
|
|
81
|
-
(form.size.blockSize + form.size.spacingSize) * 2 +
|
|
74
|
+
(form.size.blockSize + form.size.spacingSize) * 2 + padding,
|
|
82
75
|
currentBreakPoint: currentBreakPoint,
|
|
83
76
|
});
|
|
84
77
|
}
|
package/package.json
CHANGED