@arquimedes.co/eureka-forms 1.5.5-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 */
@@ -29,6 +31,7 @@ export interface AppProps {
29
31
  handleConfirmed?: Function;
30
32
  }
31
33
  export interface CustomStep {
34
+ componentProps?: Record<string, any>;
32
35
  component: ReactNode;
33
36
  updateValue: (idStep: string, values: Record<string, any>, form: Form) => void;
34
37
  }
@@ -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: "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));
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,19 +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
+ var padding = form.isStandAlone ? 40 : 0;
61
62
  while (currentWidth <
62
63
  (form.size.blockSize + form.size.spacingSize) *
63
64
  currentBreakPoint +
64
- 40) {
65
+ padding) {
65
66
  currentBreakPoint--;
66
67
  }
67
68
  setWidthStats({
68
69
  isResponsive: currentWidth <
69
70
  (form.size.blockSize + form.size.spacingSize) *
70
71
  form.size.blockNum +
71
- 40,
72
+ padding,
72
73
  isMobile: currentWidth <
73
- (form.size.blockSize + form.size.spacingSize) * 2 + 40,
74
+ (form.size.blockSize + form.size.spacingSize) * 2 + padding,
74
75
  currentBreakPoint: currentBreakPoint,
75
76
  });
76
77
  }
@@ -33,10 +33,11 @@ import FileUploadStep from './FileUploadStep/FileUploadStep';
33
33
  import CheckBoxStep from './CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep';
34
34
  import CBRStepMapper from './CBRStepMapper';
35
35
  function StepComponent(_a) {
36
+ var _b;
36
37
  var step = _a.step, props = __rest(_a, ["step"]);
37
38
  var customStep = props.customSteps[step.type];
38
39
  if (customStep) {
39
- return customStep.component(__assign({ step: step }, props));
40
+ return customStep.component(__assign(__assign({ step: step }, props), ((_b = customStep.componentProps) !== null && _b !== void 0 ? _b : {})));
40
41
  }
41
42
  switch (step.type) {
42
43
  case Types.TITLE: {
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":"1.5.5-test",
4
+ "version":"1.5.8-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",