@arquimedes.co/eureka-forms 2.0.65-test → 2.0.66-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/App.d.ts CHANGED
@@ -34,7 +34,7 @@ export interface AppProps {
34
34
  /** Custom function to call on send */
35
35
  customSubmit?: (values: Record<string, unknown>, reload: () => void) => Promise<void>;
36
36
  /** Custom submit function, when passed it is called */
37
- submit?: (submit: () => Promise<Record<string, any> | void>) => Promise<void>;
37
+ setSubmit?: (submit: () => Promise<Record<string, any> | void>) => Promise<void>;
38
38
  /** Custom submit buttons */
39
39
  customSubmitBtns?: null | ((onSubmit: () => Promise<Record<string, any> | void>, loading: boolean) => JSX.Element);
40
40
  /** Function to call on postview to fetch the download url of a file */
package/dist/App/App.js CHANGED
@@ -74,6 +74,6 @@ function App(_a) {
74
74
  sendLabel: props.sendLabel,
75
75
  fetchDownloadUrl: props.fetchDownloadUrl,
76
76
  customStepProps: (_g = props.customStepProps) !== null && _g !== void 0 ? _g : {},
77
- } }, { children: _jsx("div", __assign({ className: styles.container }, { children: _jsx(FormComponent, { form: form, reload: reload, branding: branding, apiKey: props.apiKey, isWidget: !!isWidget, customSteps: customSteps, containerRef: containerRef, submit: props.submit, customSubmit: props.customSubmit, scrollToTop: props.scrollToTop, customSubmitBtns: props.customSubmitBtns }) })) })));
77
+ } }, { children: _jsx("div", __assign({ className: styles.container }, { children: _jsx(FormComponent, { form: form, reload: reload, branding: branding, apiKey: props.apiKey, isWidget: !!isWidget, customSteps: customSteps, containerRef: containerRef, setSubmit: props.setSubmit, customSubmit: props.customSubmit, scrollToTop: props.scrollToTop, customSubmitBtns: props.customSubmitBtns }) })) })));
78
78
  }
79
79
  }
@@ -20,7 +20,7 @@ export interface WidthStats {
20
20
  isResponsive: boolean;
21
21
  isMobile: boolean;
22
22
  }
23
- type CustomAppProps = Pick<AppProps, 'customSteps' | 'customSubmitBtns' | 'submit'>;
23
+ type CustomAppProps = Pick<AppProps, 'customSteps' | 'customSubmitBtns' | 'setSubmit'>;
24
24
  export interface BaseFormProps extends CustomAppProps {
25
25
  form: Form;
26
26
  branding?: Branding;
@@ -36,5 +36,5 @@ export interface FormComponentProps extends CustomAppProps {
36
36
  onSubmit: (values: FieldValues) => Promise<any>;
37
37
  scrollToTop?: () => void;
38
38
  }
39
- declare function FormComponent({ form, submit, apiKey, reload, isWidget, branding, scrollToTop, customSteps, containerRef, customSubmit, customSubmitBtns, }: BaseFormProps): JSX.Element;
39
+ declare function FormComponent({ form, apiKey, reload, isWidget, branding, setSubmit, scrollToTop, customSteps, containerRef, customSubmit, customSubmitBtns, }: BaseFormProps): JSX.Element;
40
40
  export default FormComponent;
package/dist/Form/Form.js CHANGED
@@ -84,7 +84,7 @@ export var getLocale = function () {
84
84
  function FormComponent(_a) {
85
85
  var _this = this;
86
86
  var _b, _c, _d, _e, _f, _g, _h, _j, _k;
87
- var form = _a.form, submit = _a.submit, apiKey = _a.apiKey, reload = _a.reload, isWidget = _a.isWidget, branding = _a.branding, scrollToTop = _a.scrollToTop, customSteps = _a.customSteps, containerRef = _a.containerRef, customSubmit = _a.customSubmit, customSubmitBtns = _a.customSubmitBtns;
87
+ var form = _a.form, apiKey = _a.apiKey, reload = _a.reload, isWidget = _a.isWidget, branding = _a.branding, setSubmit = _a.setSubmit, scrollToTop = _a.scrollToTop, customSteps = _a.customSteps, containerRef = _a.containerRef, customSubmit = _a.customSubmit, customSubmitBtns = _a.customSubmitBtns;
88
88
  var _l = useAppSelector(function (state) { return state.global; }), idOrganization = _l.idOrganization, internal = _l.internal, postview = _l.postview;
89
89
  var formMethods = useForm({
90
90
  mode: 'onTouched',
@@ -170,7 +170,7 @@ function FormComponent(_a) {
170
170
  return (_jsxs(React.Fragment, { children: [showConfirmation !== undefined && (_jsx(ConfirmationDialog, { confirmation: showConfirmation, onClose: function () {
171
171
  reload();
172
172
  setShowConfirmation(undefined);
173
- } })), form.hasCaptcha && !internal && !postview && (_jsx(ReCAPTCHA, { ref: recaptchaRef, sitekey: "6LcL22kkAAAAAEotDeAFbRATob-u5vbibbCyWL2p", size: 'invisible', badge: 'bottomright' })), _jsx(FormProvider, __assign({}, formMethods, { children: _jsx(FormContext.Provider, __assign({ value: form }, { children: _jsx(FormTypeComponent, { onSubmit: onSubmit, submit: submit, scrollToTop: scrollToTop, customSubmitBtns: customSubmitBtns }) })) }))] }));
173
+ } })), form.hasCaptcha && !internal && !postview && (_jsx(ReCAPTCHA, { ref: recaptchaRef, sitekey: "6LcL22kkAAAAAEotDeAFbRATob-u5vbibbCyWL2p", size: 'invisible', badge: 'bottomright' })), _jsx(FormProvider, __assign({}, formMethods, { children: _jsx(FormContext.Provider, __assign({ value: form }, { children: _jsx(FormTypeComponent, { onSubmit: onSubmit, setSubmit: setSubmit, scrollToTop: scrollToTop, customSubmitBtns: customSubmitBtns }) })) }))] }));
174
174
  };
175
175
  if (!idOrganization)
176
176
  return _jsx(_Fragment, {});
@@ -84,9 +84,9 @@ function ColumnForm(_a) {
84
84
  var next = useAppSelector(function (state) { return state.site.nextSections; });
85
85
  var idCurrent = useAppSelector(function (state) { return state.site.idCurrentSection; });
86
86
  useEffect(function () {
87
- if (props.submit)
88
- props.submit(submit);
89
- }, [props.submit]);
87
+ if (props.setSubmit)
88
+ props.setSubmit(submit);
89
+ }, [props.setSubmit]);
90
90
  /** Esto se usa para no tener que escuchar todo el tiempo los errores del formulario */
91
91
  var handleErrors = handleSubmit(function () { }, function (errors) {
92
92
  console.error('Errors:', errors);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version":"2.0.65-test",
4
+ "version":"2.0.66-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",