@arquimedes.co/eureka-forms 1.4.3-test → 1.4.4-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.js CHANGED
@@ -68,10 +68,18 @@ import widgetInstance from './AxiosWidget';
68
68
  function App(_a) {
69
69
  var _this = this;
70
70
  var _b, _c, _d, _e;
71
- var apiKey = _a.apiKey, domain = _a.domain, preview = _a.preview, formData = _a.formData, postview = _a.postview, isWidget = _a.isWidget, internal = _a.internal, valuesData = _a.valuesData, customSend = _a.customSend, customSteps = _a.customSteps, handleConfirmed = _a.handleConfirmed, others = __rest(_a, ["apiKey", "domain", "preview", "formData", "postview", "isWidget", "internal", "valuesData", "customSend", "customSteps", "handleConfirmed"]);
72
- var _f = useState(undefined), form = _f[0], setForm = _f[1];
73
- var _g = useState({}), originalValues = _g[0], setOriginalValues = _g[1];
74
- var _h = useState(undefined), organizationInfo = _h[0], setOrganizationInfo = _h[1];
71
+ var apiKey = _a.apiKey, domain = _a.domain, preview = _a.preview, formData = _a.formData, postview = _a.postview, isWidget = _a.isWidget, internal = _a.internal, valuesData = _a.valuesData, _f = _a.customSend, customSend = _f === void 0 ? function (a, b) { return __awaiter(_this, void 0, void 0, function () {
72
+ return __generator(this, function (_a) {
73
+ // eslint-disable-next-line no-console
74
+ console.log('HOLA', a, b);
75
+ return [2 /*return*/];
76
+ });
77
+ }); } : _f, customSteps = _a.customSteps, handleConfirmed = _a.handleConfirmed, others = __rest(_a, ["apiKey", "domain", "preview", "formData", "postview", "isWidget", "internal", "valuesData", "customSend", "customSteps", "handleConfirmed"]);
78
+ // eslint-disable-next-line no-console
79
+ console.log(formData, valuesData, customSend);
80
+ var _g = useState(undefined), form = _g[0], setForm = _g[1];
81
+ var _h = useState({}), originalValues = _h[0], setOriginalValues = _h[1];
82
+ var _j = useState(undefined), organizationInfo = _j[0], setOrganizationInfo = _j[1];
75
83
  function fetchPreview(formData) {
76
84
  return __awaiter(this, void 0, void 0, function () {
77
85
  var response;
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { SmartSelectStepProps } from '../../SmartSelectStep/SmartSelectStep';
3
2
  import { StepProps } from '../../Step';
4
3
  import { CBRElementStep } from '../../../../@Types/CBRFormStep';
5
- declare function CBRLocativasStep(props: SmartSelectStepProps): JSX.Element;
4
+ declare function CBRLocativasStep(props: LocativasSubStepRendererProps): JSX.Element;
6
5
  export default CBRLocativasStep;
7
6
  export interface LocativasSubStepRendererProps extends Omit<StepProps, 'step'> {
8
7
  step: CBRElementStep;
@@ -57,6 +57,8 @@ function CBRLocativasStep(props) {
57
57
  marginTop: 2,
58
58
  } }, void 0), getOptions: getLocativasOptions, getOptionSelected: function (option, value) {
59
59
  return option.id === value.id;
60
+ }, valueOverwrite: function (value) {
61
+ return __assign(__assign({}, value), { idSubStep: props.step.subStep });
60
62
  }, iconComponent: LeakIconComponent }, { children: _jsx(LocativasSubStepRenderer, {}, void 0) }), void 0));
61
63
  }
62
64
  export default CBRLocativasStep;
@@ -66,7 +66,7 @@ import React from 'react';
66
66
  function SmartSelect(_a) {
67
67
  var _this = this;
68
68
  var _b, _c, _d;
69
- var icon = _a.icon, step = _a.step, form = _a.form, value = _a.value, onBlur = _a.onBlur, errors = _a.errors, trigger = _a.trigger, children = _a.children, onChange = _a.onChange, inputRef = _a.inputRef, postview = _a.postview, formStyle = _a.formStyle, getOptions = _a.getOptions, widthStats = _a.widthStats, calcDepError = _a.calcDepError, iconComponent = _a.iconComponent, dependencyStore = _a.dependencyStore, getOptionSelected = _a.getOptionSelected, setDependencyStore = _a.setDependencyStore, others = __rest(_a, ["icon", "step", "form", "value", "onBlur", "errors", "trigger", "children", "onChange", "inputRef", "postview", "formStyle", "getOptions", "widthStats", "calcDepError", "iconComponent", "dependencyStore", "getOptionSelected", "setDependencyStore"]);
69
+ var icon = _a.icon, step = _a.step, form = _a.form, value = _a.value, onBlur = _a.onBlur, errors = _a.errors, trigger = _a.trigger, children = _a.children, onChange = _a.onChange, inputRef = _a.inputRef, postview = _a.postview, formStyle = _a.formStyle, getOptions = _a.getOptions, widthStats = _a.widthStats, calcDepError = _a.calcDepError, iconComponent = _a.iconComponent, valueOverwrite = _a.valueOverwrite, dependencyStore = _a.dependencyStore, getOptionSelected = _a.getOptionSelected, setDependencyStore = _a.setDependencyStore, others = __rest(_a, ["icon", "step", "form", "value", "onBlur", "errors", "trigger", "children", "onChange", "inputRef", "postview", "formStyle", "getOptions", "widthStats", "calcDepError", "iconComponent", "valueOverwrite", "dependencyStore", "getOptionSelected", "setDependencyStore"]);
70
70
  var _e = useState(), options = _e[0], setOptions = _e[1];
71
71
  var _f = useState(), depError = _f[0], setDepError = _f[1];
72
72
  var calcOptions = function () { return __awaiter(_this, void 0, void 0, function () {
@@ -123,7 +123,9 @@ function SmartSelect(_a) {
123
123
  if (dependencyStore[step.id] !== undefined) {
124
124
  setDependencyStore(__assign(__assign({}, dependencyStore), (_a = {}, _a[step.id] = value, _a)));
125
125
  }
126
- onChange(value);
126
+ valueOverwrite
127
+ ? onChange(valueOverwrite(value))
128
+ : onChange(value);
127
129
  }, getOptionSelected: getOptionSelected, helperText: depError !== null && depError !== void 0 ? depError : (errors[step.id]
128
130
  ? errors[step.id].message
129
131
  : step.description), error: depError !== undefined || !!errors[step.id] }, void 0) }), void 0), children &&
@@ -17,6 +17,8 @@ export interface SmartSelectStepProps extends Omit<StepProps, 'step'> {
17
17
  calcDepError?: (types: Types[]) => string | undefined;
18
18
  /** children to render */
19
19
  children?: React.ReactElement<any, string>;
20
+ /** Function that overwrites the value before setting it */
21
+ valueOverwrite?: (value: any) => any;
20
22
  }
21
23
  declare function SmartSelectStep(props: SmartSelectStepProps): JSX.Element;
22
24
  export default SmartSelectStep;
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.4.3-test",
4
+ "version":"1.4.4-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",