@arquimedes.co/eureka-forms 0.2.30-test → 0.2.31-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.
@@ -94,7 +94,7 @@ function ColumnForm(_a) {
94
94
  switch (_c.label) {
95
95
  case 0:
96
96
  if (!(apiKey || internal)) return [3 /*break*/, 8];
97
- return [4 /*yield*/, trigger()];
97
+ return [4 /*yield*/, trigger(undefined, { shouldFocus: true })];
98
98
  case 1:
99
99
  valid = _c.sent();
100
100
  values = getValues();
@@ -31,7 +31,7 @@ import StepComponent from '../../Step';
31
31
  import { Controller } from 'react-hook-form';
32
32
  import { calcFillerSize, calcStepWidth } from '../../StepFunctions';
33
33
  function ClassifierSelector(_a) {
34
- var step = _a.step, form = _a.form, level = _a.level, errors = _a.errors, value = _a.value, onBlur = _a.onBlur, control = _a.control, onChange = _a.onChange, postview = _a.postview, formStyle = _a.formStyle, getValues = _a.getValues, widthStats = _a.widthStats, handleSizeChange = _a.handleSizeChange, others = __rest(_a, ["step", "form", "level", "errors", "value", "onBlur", "control", "onChange", "postview", "formStyle", "getValues", "widthStats", "handleSizeChange"]);
34
+ var step = _a.step, form = _a.form, level = _a.level, errors = _a.errors, value = _a.value, onBlur = _a.onBlur, control = _a.control, onChange = _a.onChange, postview = _a.postview, inputRef = _a.inputRef, formStyle = _a.formStyle, getValues = _a.getValues, widthStats = _a.widthStats, handleSizeChange = _a.handleSizeChange, others = __rest(_a, ["step", "form", "level", "errors", "value", "onBlur", "control", "onChange", "postview", "inputRef", "formStyle", "getValues", "widthStats", "handleSizeChange"]);
35
35
  var _b = useState(level === 0 ? calcFillerSize(step, form.steps, getValues(), form) : 0), fillerSize = _b[0], setFillerSize = _b[1];
36
36
  if (!step.idClassifier) {
37
37
  return _jsx("div", {}, void 0);
@@ -56,7 +56,7 @@ function ClassifierSelector(_a) {
56
56
  } }, { children: _jsxs(RoundedSelect, __assign({ fullWidth: true, value: value, cantEdit: postview, errorColor: formStyle.errorColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, label: step.label ? step.label : classifier.name, required: step.required, containerMargin: "0px", height: '31px', onBlur: onBlur, handleUpdate: function (event) {
57
57
  onChange(event.target.value);
58
58
  sizeChange();
59
- }, helperText: errors[step.id]
59
+ }, inputRef: inputRef, helperText: errors[step.id]
60
60
  ? errors[step.id].message
61
61
  : step.description, error: !!errors[step.id] }, { children: [_jsx(MenuItem, __assign({ value: '' }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), classifier.children
62
62
  .filter(function (classifier) {
@@ -100,6 +100,6 @@ function ClassifierSelectorStep(props) {
100
100
  : undefined,
101
101
  }, shouldUnregister: true, render: function (_a) {
102
102
  var field = _a.field;
103
- return (_jsx(ClassifierSelector, __assign({}, props, { value: field.value, onChange: field.onChange, onBlur: field.onBlur }), void 0));
103
+ return (_jsx(ClassifierSelector, __assign({}, props, { inputRef: field.ref, value: field.value, onChange: field.onChange, onBlur: field.onBlur }), void 0));
104
104
  } }, void 0));
105
105
  }
@@ -27,7 +27,7 @@ function DatePickerStep(_a) {
27
27
  : undefined,
28
28
  }, shouldUnregister: true, render: function (_a) {
29
29
  var field = _a.field;
30
- return (_jsx(RoundedDatePicker, __assign({}, field, { showIcon: step.showIcon, cantEdit: postview, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, fontWeight: 400, label: step.label, helperText: errors[step.id]
30
+ return (_jsx(RoundedDatePicker, __assign({}, field, { showIcon: step.showIcon, inputRef: field.ref, cantEdit: postview, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, fontWeight: 400, label: step.label, helperText: errors[step.id]
31
31
  ? errors[step.id].message
32
32
  : step.description, error: !!errors[step.id], required: step.required }), void 0));
33
33
  } }, void 0) }), void 0));
@@ -64,7 +64,7 @@ import { getUploadUrls, postFile } from '../../../../controllers/FileService';
64
64
  import FileComponent from './FileComponent/FileComponent';
65
65
  import maxSize from '../../../../constants/Files/FileMaxSize';
66
66
  function FileUploadStep(_a) {
67
- var step = _a.step, errors = _a.errors, postview = _a.postview, onChange = _a.onChange, value = _a.value, formStyle = _a.formStyle, domain = _a.domain, clearErrors = _a.clearErrors, fetchDownloadUrl = _a.fetchDownloadUrl;
67
+ var step = _a.step, errors = _a.errors, value = _a.value, domain = _a.domain, btnRef = _a.btnRef, postview = _a.postview, onChange = _a.onChange, formStyle = _a.formStyle, clearErrors = _a.clearErrors, fetchDownloadUrl = _a.fetchDownloadUrl;
68
68
  var _b = useState(undefined), error = _b[0], setError = _b[1];
69
69
  var _c = useState([]), fileChange = _c[0], setFileChange = _c[1];
70
70
  var inputRef = useRef();
@@ -216,16 +216,16 @@ function FileUploadStep(_a) {
216
216
  }
217
217
  inputRef.current.value = '';
218
218
  }
219
- }, multiple: true, accept: getAcceptedExtensions() }, void 0), _jsx("div", __assign({ className: styles.btnContainer }, { children: _jsx(RoundedButton, { disabled: postview, text: 'Examinar' + (step.required ? ' *' : ''), color: formStyle.primaryContrastColor, backgroundColor: formStyle.primaryColor, fontSize: '1rem', padding: '5px 15px 5px 15px', onClick: function () {
220
- if (!postview) {
221
- var input = inputRef.current;
222
- if (input !== null) {
223
- clearErrors(step.id);
224
- setError(undefined);
225
- input.click();
219
+ }, multiple: true, accept: getAcceptedExtensions() }, void 0), _jsxs("div", __assign({ className: styles.btnContainer }, { children: [_jsx("input", { ref: btnRef, className: styles.hiddenInput }, void 0), _jsx(RoundedButton, { disabled: postview, text: 'Examinar' + (step.required ? ' *' : ''), color: formStyle.primaryContrastColor, backgroundColor: formStyle.primaryColor, fontSize: '1rem', padding: '5px 15px 5px 15px', onClick: function () {
220
+ if (!postview) {
221
+ var input = inputRef.current;
222
+ if (input !== null) {
223
+ clearErrors(step.id);
224
+ setError(undefined);
225
+ input.click();
226
+ }
226
227
  }
227
- }
228
- } }, void 0) }), void 0), _jsx("div", __assign({ className: styles.filesContainer }, { children: value.map(function (file, index) { return (_jsx(FileComponent, { formStyle: formStyle, file: file, error: (!!errors[step.id] &&
228
+ } }, void 0)] }), void 0), _jsx("div", __assign({ className: styles.filesContainer }, { children: value.map(function (file, index) { return (_jsx(FileComponent, { formStyle: formStyle, file: file, error: (!!errors[step.id] &&
229
229
  file.state !== 'DONE') ||
230
230
  file.state === 'ERROR', handleRemove: function () {
231
231
  if (value.filter(function (val) {
@@ -250,7 +250,7 @@ function UploadStepComponent(props) {
250
250
  },
251
251
  }, shouldUnregister: true, render: function (_a) {
252
252
  var field = _a.field;
253
- return (_jsx(FileUploadStep, __assign({}, props, { onChange: field.onChange, value: field.value }), void 0));
253
+ return (_jsx(FileUploadStep, __assign({}, props, { btnRef: field.ref, onChange: field.onChange, value: field.value }), void 0));
254
254
  } }, void 0));
255
255
  }
256
256
  export default UploadStepComponent;
@@ -44,3 +44,10 @@
44
44
  .filesContainer {
45
45
  padding-top: 5px;
46
46
  }
47
+
48
+ .hiddenInput {
49
+ height: 0;
50
+ width: 0;
51
+ padding: 0;
52
+ border-width: 0;
53
+ }
@@ -31,7 +31,7 @@ import StepComponent from '../../Step';
31
31
  import { calcFillerSize, calcStepWidth } from '../../StepFunctions';
32
32
  import { Controller } from 'react-hook-form';
33
33
  function Selector(_a) {
34
- var step = _a.step, form = _a.form, value = _a.value, level = _a.level, onBlur = _a.onBlur, control = _a.control, onChange = _a.onChange, postview = _a.postview, formStyle = _a.formStyle, getValues = _a.getValues, widthStats = _a.widthStats, handleSizeChange = _a.handleSizeChange, errors = _a.errors, others = __rest(_a, ["step", "form", "value", "level", "onBlur", "control", "onChange", "postview", "formStyle", "getValues", "widthStats", "handleSizeChange", "errors"]);
34
+ var step = _a.step, form = _a.form, value = _a.value, level = _a.level, onBlur = _a.onBlur, control = _a.control, onChange = _a.onChange, postview = _a.postview, formStyle = _a.formStyle, getValues = _a.getValues, widthStats = _a.widthStats, handleSizeChange = _a.handleSizeChange, errors = _a.errors, inputRef = _a.inputRef, others = __rest(_a, ["step", "form", "value", "level", "onBlur", "control", "onChange", "postview", "formStyle", "getValues", "widthStats", "handleSizeChange", "errors", "inputRef"]);
35
35
  var _b = useState(level === 0 ? calcFillerSize(step, form.steps, getValues(), form) : 0), fillerSize = _b[0], setFillerSize = _b[1];
36
36
  var sizeChange = function () {
37
37
  handleSizeChange();
@@ -46,7 +46,7 @@ function Selector(_a) {
46
46
  : calcStepWidth(step.size, form),
47
47
  maxWidth: '100%',
48
48
  minHeight: step.description || step.required ? '55px' : '43px',
49
- } }, { children: _jsxs(RoundedSelect, __assign({ value: value, fullWidth: true, cantEdit: postview, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, label: step.label, required: step.required, containerMargin: "0px", height: '31px', onBlur: onBlur, handleUpdate: function (event) {
49
+ } }, { children: _jsxs(RoundedSelect, __assign({ value: value, fullWidth: true, inputRef: inputRef, cantEdit: postview, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, label: step.label, required: step.required, containerMargin: "0px", height: '31px', onBlur: onBlur, handleUpdate: function (event) {
50
50
  onChange(event.target.value);
51
51
  sizeChange();
52
52
  }, helperText: errors[step.id]
@@ -93,7 +93,7 @@ function SelectorStep(props) {
93
93
  : undefined,
94
94
  }, shouldUnregister: true, render: function (_a) {
95
95
  var field = _a.field;
96
- return (_jsx(Selector, __assign({}, props, { value: field.value, onChange: field.onChange, onBlur: field.onBlur }), void 0));
96
+ return (_jsx(Selector, __assign({}, props, { inputRef: field.ref, value: field.value, onChange: field.onChange, onBlur: field.onBlur }), void 0));
97
97
  } }, void 0));
98
98
  }
99
99
  export default SelectorStep;
@@ -76,7 +76,7 @@ function TextAreaStep(_a) {
76
76
  : {}, shouldUnregister: true, render: function (_a) {
77
77
  var _b;
78
78
  var field = _a.field;
79
- return (_jsx(Editor, { onBlur: field.onBlur, editorState: field.value, onEditorStateChange: field.onChange, toolbarClassName: styles.toolbar, editorClassName: styles.editor, wrapperClassName: styles.wrapper, editorStyle: { lineHeight: '85%' }, placeholder: (_b = step.description) !== null && _b !== void 0 ? _b : '', toolbar: {
79
+ return (_jsx(Editor, { editorRef: field.ref, onBlur: field.onBlur, editorState: field.value, onEditorStateChange: field.onChange, toolbarClassName: styles.toolbar, editorClassName: styles.editor, wrapperClassName: styles.wrapper, editorStyle: { lineHeight: '85%' }, placeholder: (_b = step.description) !== null && _b !== void 0 ? _b : '', toolbar: {
80
80
  options: ['inline', 'list', 'history'],
81
81
  inline: {
82
82
  options: [
@@ -103,7 +103,7 @@ function TextAreaStep(_a) {
103
103
  : undefined,
104
104
  }, shouldUnregister: true, render: function (_a) {
105
105
  var field = _a.field;
106
- return (_jsx(RoundedTextField, __assign({}, field, { label: step.label, required: step.required, cantEdit: postview, fontWeight: 400, multiline: true, minRows: 4, maxRows: 6, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.backgroundColor, innerBackgroundColor: formStyle.stepBackgroundColor, helperText: errors[step.id]
106
+ return (_jsx(RoundedTextField, __assign({}, field, { label: step.label, inputRef: field.ref, required: step.required, cantEdit: postview, fontWeight: 400, multiline: true, minRows: 4, maxRows: 6, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.backgroundColor, innerBackgroundColor: formStyle.stepBackgroundColor, helperText: errors[step.id]
107
107
  ? errors[step.id].message
108
108
  : step.description, error: !!errors[step.id] }), void 0));
109
109
  } }, void 0) }), void 0));
@@ -35,7 +35,7 @@ function TextInputStep(_a) {
35
35
  : undefined,
36
36
  }, shouldUnregister: true, render: function (_a) {
37
37
  var field = _a.field;
38
- return (_jsx(RoundedTextField, __assign({}, field, { label: step.label, cantEdit: postview, required: step.required, fontWeight: 400, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.backgroundColor, innerBackgroundColor: formStyle.stepBackgroundColor, helperText: errors[step.id]
38
+ return (_jsx(RoundedTextField, __assign({}, field, { label: step.label, inputRef: field.ref, cantEdit: postview, required: step.required, fontWeight: 400, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.backgroundColor, innerBackgroundColor: formStyle.stepBackgroundColor, helperText: errors[step.id]
39
39
  ? errors[step.id].message
40
40
  : step.description, error: !!errors[step.id] }), void 0));
41
41
  } }, void 0) }), void 0));
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": "0.2.30-test",
4
+ "version": "0.2.31-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",