@arquimedes.co/eureka-forms 1.9.17-test → 1.9.20-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.
Files changed (64) hide show
  1. package/dist/App.js +205 -98
  2. package/dist/AxiosAPI.js +3 -3
  3. package/dist/AxiosWidget.js +4 -4
  4. package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +207 -104
  5. package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +17 -5
  6. package/dist/FormComponents/Form/Form.js +56 -29
  7. package/dist/FormComponents/Form/StepperForm/StepperForm.js +1 -1
  8. package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +30 -7
  9. package/dist/FormComponents/Section/Section.js +13 -2
  10. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +13 -2
  11. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +32 -9
  12. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +64 -47
  13. package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +102 -41
  14. package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +92 -37
  15. package/dist/FormComponents/Step/AYFStepMapper.js +75 -23
  16. package/dist/FormComponents/Step/CBRStepMapper.js +144 -56
  17. package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +26 -3
  18. package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +21 -6
  19. package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +26 -3
  20. package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +65 -32
  21. package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +13 -2
  22. package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +21 -6
  23. package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +13 -2
  24. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +88 -27
  25. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +171 -81
  26. package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.js +41 -15
  27. package/dist/FormComponents/Step/RatingStep/RatingStep.js +13 -2
  28. package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +52 -25
  29. package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +26 -3
  30. package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -1
  31. package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +26 -3
  32. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +145 -83
  33. package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +13 -2
  34. package/dist/FormComponents/Step/Step.js +39 -19
  35. package/dist/FormComponents/Step/StepFunctions.js +16 -14
  36. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +62 -43
  37. package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +13 -2
  38. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +21 -6
  39. package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +13 -2
  40. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +15 -3
  41. package/dist/FormComponents/Step/TitleStep/TitleStep.js +26 -3
  42. package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +35 -19
  43. package/dist/FormComponents/Term/Term.js +13 -2
  44. package/dist/Widget.js +25 -13
  45. package/dist/constants/Files/FileExtensions.js +3 -3
  46. package/dist/constants/Files/FileMaxSize.js +1 -1
  47. package/dist/constants/InternalFormStyle.js +1 -1
  48. package/dist/constants/MaterialClassNameSeed.js +1 -1
  49. package/dist/controllers/FileService.js +86 -29
  50. package/dist/index.js +15 -4
  51. package/dist/shared/Loader/Loader.js +17 -5
  52. package/dist/shared/Navbar/Navbar.js +14 -2
  53. package/dist/shared/Rating/Rating.js +27 -4
  54. package/dist/shared/Rating/Ratings/LikeRating.js +21 -9
  55. package/dist/shared/Rating/Ratings/SatisfactionRating.js +27 -15
  56. package/dist/shared/Rating/Ratings/ScaleRating.js +49 -22
  57. package/dist/shared/RoundedButton/RoundedButton.js +24 -12
  58. package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +84 -39
  59. package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +286 -235
  60. package/dist/shared/RoundedSelect/RoundedSelect.js +152 -103
  61. package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +160 -125
  62. package/dist/shared/RoundedTextField/RoundedTextField.js +137 -92
  63. package/dist/utils/CbrFunctions.js +30 -30
  64. package/package.json +1 -1
@@ -1,106 +1,146 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __assign = (this && this.__assign) || function () {
17
+ __assign = Object.assign || function(t) {
18
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
19
+ s = arguments[i];
20
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
+ t[p] = s[p];
22
+ }
23
+ return t;
24
+ };
25
+ return __assign.apply(this, arguments);
26
+ };
27
+ var __rest = (this && this.__rest) || function (s, e) {
28
+ var t = {};
29
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
30
+ t[p] = s[p];
31
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
32
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
33
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
34
+ t[p[i]] = s[p[i]];
35
+ }
36
+ return t;
37
+ };
1
38
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
39
  import React from 'react';
3
40
  import { makeStyles } from '@material-ui/core/styles';
4
41
  import TextField from '@material-ui/core/TextField';
5
- const useTextfieldStyles = (props) => makeStyles(() => ({
6
- root: {
7
- borderRadius: props.borderRadius,
8
- backgroundColor: props.backgroundColor,
9
- '& input, textarea': {
10
- cursor: props.cantEdit ? 'default' : 'text',
11
- padding: props.multiline ? props.padding : props.padding,
12
- fontWeight: props.fontWeight,
13
- color: props.textColor,
14
- fontSize: props.fontSize,
15
- '&::placeholder': {
42
+ var useTextfieldStyles = function (props) {
43
+ return makeStyles(function () { return ({
44
+ root: {
45
+ borderRadius: props.borderRadius,
46
+ backgroundColor: props.backgroundColor,
47
+ '& input, textarea': {
48
+ cursor: props.cantEdit ? 'default' : 'text',
49
+ padding: props.multiline ? props.padding : props.padding,
50
+ fontWeight: props.fontWeight,
51
+ color: props.textColor,
16
52
  fontSize: props.fontSize,
53
+ '&::placeholder': {
54
+ fontSize: props.fontSize,
55
+ },
56
+ backgroundColor: props.innerBackgroundColor,
57
+ borderRadius: props.borderRadius,
17
58
  },
18
- backgroundColor: props.innerBackgroundColor,
19
- borderRadius: props.borderRadius,
20
- },
21
- '& label': {
22
- marginTop: props.multiline ? '0px' : '-4px',
23
- fontSize: props.fontSize,
24
- whiteSpace: 'nowrap',
25
- overflow: 'hidden',
26
- textOverflow: 'ellipsis',
27
- maxWidth: 'calc(100% - 22px)',
28
- },
29
- '& label.EF-MuiInputLabel-shrink': {
30
- marginTop: '0px',
31
- maxWidth: 'calc(100% - 5px)',
32
- },
33
- '& input + fieldset': {
34
- borderRadius: props.borderRadius,
35
- },
36
- '& .EF-MuiInput-underline:after': {
37
- borderBottomColor: props.outlineColor,
38
- },
39
- '& .EF-MuiOutlinedInput-root': {
40
- borderRadius: props.borderRadius,
41
- '&.Mui-focused fieldset': {
42
- borderColor: props.focusColor,
43
- borderWidth: props.readOnly ? 1 : 2,
59
+ '& label': {
60
+ marginTop: props.multiline ? '0px' : '-4px',
61
+ fontSize: props.fontSize,
62
+ whiteSpace: 'nowrap',
63
+ overflow: 'hidden',
64
+ textOverflow: 'ellipsis',
65
+ maxWidth: 'calc(100% - 22px)',
66
+ },
67
+ '& label.EF-MuiInputLabel-shrink': {
68
+ marginTop: '0px',
69
+ maxWidth: 'calc(100% - 5px)',
70
+ },
71
+ '& input + fieldset': {
72
+ borderRadius: props.borderRadius,
44
73
  },
45
- '& .EF-MuiOutlinedInput-notchedOutline': {
46
- borderColor: props.outlineColor,
47
- '& legend': {
48
- fontSize: 'calc(' + props.fontSize + ' * 0.75)',
74
+ '& .EF-MuiInput-underline:after': {
75
+ borderBottomColor: props.outlineColor,
76
+ },
77
+ '& .EF-MuiOutlinedInput-root': {
78
+ borderRadius: props.borderRadius,
79
+ '&.Mui-focused fieldset': {
80
+ borderColor: props.focusColor,
81
+ borderWidth: props.readOnly ? 1 : 2,
82
+ },
83
+ '& .EF-MuiOutlinedInput-notchedOutline': {
84
+ borderColor: props.outlineColor,
85
+ '& legend': {
86
+ fontSize: 'calc(' + props.fontSize + ' * 0.75)',
87
+ },
49
88
  },
50
89
  },
90
+ '& .EF-MuiOutlinedInput-root:hover .EF-MuiOutlinedInput-notchedOutline': {
91
+ borderColor: props.cantEdit
92
+ ? props.outlineColor
93
+ : props.focusColor,
94
+ },
95
+ '& label.Mui-focused': {
96
+ color: props.focusColor,
97
+ },
98
+ '& .Mui-error': {
99
+ color: props.errorColor,
100
+ },
101
+ '& .EF-MuiOutlinedInput-adornedEnd': {
102
+ paddingRight: '7px',
103
+ },
104
+ '& .EF-MuiFormHelperText-root': {
105
+ color: props.helperTextColor,
106
+ marginRight: props.maxLength ? 40 : 14,
107
+ },
108
+ '& .EF-MuiOutlinedInput-multiline': {
109
+ padding: 0,
110
+ backgroundColor: props.innerBackgroundColor,
111
+ },
51
112
  },
52
- '& .EF-MuiOutlinedInput-root:hover .EF-MuiOutlinedInput-notchedOutline': {
53
- borderColor: props.cantEdit
54
- ? props.outlineColor
55
- : props.focusColor,
56
- },
57
- '& label.Mui-focused': {
58
- color: props.focusColor,
59
- },
60
- '& .Mui-error': {
61
- color: props.errorColor,
62
- },
63
- '& .EF-MuiOutlinedInput-adornedEnd': {
64
- paddingRight: '7px',
65
- },
66
- '& .EF-MuiFormHelperText-root': {
67
- color: props.helperTextColor,
68
- marginRight: props.maxLength ? 40 : 14,
69
- },
70
- '& .EF-MuiOutlinedInput-multiline': {
71
- padding: 0,
72
- backgroundColor: props.innerBackgroundColor,
73
- },
74
- },
75
- }));
76
- function CustomTextfield({ focusColor = '#3d5a7f', helperTextColor = '#989898', outlineColor = '#0000003b', backgroundColor = 'transparent', innerBackgroundColor = 'white', textColor = '#293241', readOnly = false, borderRadius = 10, padding = '6px 12px', fontSize = '1rem', errorColor = '#cc2936', fontWeight = '300', multiline = false, cantEdit = false, maxLength, value, icon, ...others }) {
77
- const classes = useTextfieldStyles({
78
- padding,
79
- textColor,
80
- errorColor,
81
- focusColor,
82
- outlineColor,
83
- innerBackgroundColor: innerBackgroundColor ?? backgroundColor,
84
- helperTextColor,
85
- backgroundColor,
86
- borderRadius,
87
- readOnly,
88
- fontSize,
89
- fontWeight,
90
- multiline,
91
- cantEdit,
92
- maxLength,
113
+ }); });
114
+ };
115
+ function CustomTextfield(_a) {
116
+ var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.helperTextColor, helperTextColor = _c === void 0 ? '#989898' : _c, _d = _a.outlineColor, outlineColor = _d === void 0 ? '#0000003b' : _d, _e = _a.backgroundColor, backgroundColor = _e === void 0 ? 'transparent' : _e, _f = _a.innerBackgroundColor, innerBackgroundColor = _f === void 0 ? 'white' : _f, _g = _a.textColor, textColor = _g === void 0 ? '#293241' : _g, _h = _a.readOnly, readOnly = _h === void 0 ? false : _h, _j = _a.borderRadius, borderRadius = _j === void 0 ? 10 : _j, _k = _a.padding, padding = _k === void 0 ? '6px 12px' : _k, _l = _a.fontSize, fontSize = _l === void 0 ? '1rem' : _l, _m = _a.errorColor, errorColor = _m === void 0 ? '#cc2936' : _m, _o = _a.fontWeight, fontWeight = _o === void 0 ? '300' : _o, _p = _a.multiline, multiline = _p === void 0 ? false : _p, _q = _a.cantEdit, cantEdit = _q === void 0 ? false : _q, maxLength = _a.maxLength, value = _a.value, icon = _a.icon, others = __rest(_a, ["focusColor", "helperTextColor", "outlineColor", "backgroundColor", "innerBackgroundColor", "textColor", "readOnly", "borderRadius", "padding", "fontSize", "errorColor", "fontWeight", "multiline", "cantEdit", "maxLength", "value", "icon"]);
117
+ var classes = useTextfieldStyles({
118
+ padding: padding,
119
+ textColor: textColor,
120
+ errorColor: errorColor,
121
+ focusColor: focusColor,
122
+ outlineColor: outlineColor,
123
+ innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
124
+ helperTextColor: helperTextColor,
125
+ backgroundColor: backgroundColor,
126
+ borderRadius: borderRadius,
127
+ readOnly: readOnly,
128
+ fontSize: fontSize,
129
+ fontWeight: fontWeight,
130
+ multiline: multiline,
131
+ cantEdit: cantEdit,
132
+ maxLength: maxLength,
93
133
  })();
94
- const length = maxLength ? value.length : null;
95
- const inputProps = {
96
- readOnly,
134
+ var length = maxLength ? value.length : null;
135
+ var inputProps = {
136
+ readOnly: readOnly,
97
137
  disabled: cantEdit,
98
138
  endAdornment: icon,
99
139
  };
100
140
  if (maxLength) {
101
- inputProps.inputProps = { maxLength };
141
+ inputProps.inputProps = { maxLength: maxLength };
102
142
  }
103
- return (_jsxs("div", { style: { position: 'relative', width: '100%', maxWidth: '100%' }, children: [_jsx(TextField, { classes: classes, ...others, value: value ?? '', multiline: multiline, variant: "outlined", size: "small", fullWidth: true, InputProps: inputProps }), length !== null && (_jsxs("div", { style: others.helperText
143
+ return (_jsxs("div", __assign({ style: { position: 'relative', width: '100%', maxWidth: '100%' } }, { children: [_jsx(TextField, __assign({ classes: classes }, others, { value: value !== null && value !== void 0 ? value : '', multiline: multiline, variant: "outlined", size: "small", fullWidth: true, InputProps: inputProps })), length !== null && (_jsxs("div", __assign({ style: others.helperText
104
144
  ? {
105
145
  position: 'absolute',
106
146
  bottom: '3px',
@@ -115,14 +155,19 @@ function CustomTextfield({ focusColor = '#3d5a7f', helperTextColor = '#989898',
115
155
  paddingRight: '8px',
116
156
  paddingTop: '2px',
117
157
  paddingBottom: '2px',
118
- }, children: [length, "/", maxLength] }))] }));
158
+ } }, { children: [length, "/", maxLength] })))] })));
119
159
  }
120
160
  /**
121
161
  * Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
122
162
  */
123
- class RoundedTextField extends React.Component {
124
- render() {
125
- return _jsx(CustomTextfield, { ...this.props });
163
+ var RoundedTextField = /** @class */ (function (_super) {
164
+ __extends(RoundedTextField, _super);
165
+ function RoundedTextField() {
166
+ return _super !== null && _super.apply(this, arguments) || this;
126
167
  }
127
- }
168
+ RoundedTextField.prototype.render = function () {
169
+ return _jsx(CustomTextfield, __assign({}, this.props));
170
+ };
171
+ return RoundedTextField;
172
+ }(React.Component));
128
173
  export default RoundedTextField;
@@ -1,11 +1,25 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  import CBRFormStepTypes from '../constants/CBRFormStepTypes';
2
- export const calcCbrForm = (form, formValues) => {
3
- for (let step of Object.values(form.steps)) {
13
+ export var calcCbrForm = function (form, formValues) {
14
+ var _a;
15
+ for (var _i = 0, _b = Object.values(form.steps); _i < _b.length; _i++) {
16
+ var step = _b[_i];
4
17
  if (step.type === CBRFormStepTypes.CBR_INCIDENCIAS) {
5
- const incidentStep = step;
6
- const incValue = formValues[incidentStep.id ?? ''];
18
+ var incidentStep = step;
19
+ var incValue = formValues[(_a = incidentStep.id) !== null && _a !== void 0 ? _a : ''];
7
20
  if (incValue) {
8
- for (const incident of incValue) {
21
+ for (var _c = 0, incValue_1 = incValue; _c < incValue_1.length; _c++) {
22
+ var incident = incValue_1[_c];
9
23
  handleAddIncident(incident, incidentStep, form.steps, formValues);
10
24
  }
11
25
  }
@@ -13,38 +27,24 @@ export const calcCbrForm = (form, formValues) => {
13
27
  }
14
28
  return form;
15
29
  };
16
- const handleAddIncident = (incident, step, steps, formValues) => {
17
- const spaceStep = {
18
- ...step.spaceStep,
19
- id: incident.idSpaceStep,
20
- type: CBRFormStepTypes.CBR_TIPO_ESPACIO,
21
- dependencies: step.dependencies,
22
- };
30
+ var handleAddIncident = function (incident, step, steps, formValues) {
31
+ var _a, _b;
32
+ var spaceStep = __assign(__assign({}, step.spaceStep), { id: incident.idSpaceStep, type: CBRFormStepTypes.CBR_TIPO_ESPACIO, dependencies: step.dependencies });
23
33
  steps[incident.idSpaceStep] = spaceStep;
24
- const commentStep = {
25
- ...step.commentStep,
26
- id: incident.idCommentStep,
27
- type: CBRFormStepTypes.CBR_COMENTARIO,
28
- };
34
+ var commentStep = __assign(__assign({}, step.commentStep), { id: incident.idCommentStep, type: CBRFormStepTypes.CBR_COMENTARIO });
29
35
  steps[incident.idCommentStep] = commentStep;
30
- addRecursiveElementStep(incident.idElementStep, step.elementStep, null, steps, step.dependencies?.[0] ?? '', formValues);
36
+ addRecursiveElementStep(incident.idElementStep, step.elementStep, null, steps, (_b = (_a = step.dependencies) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '', formValues);
31
37
  };
32
- const addRecursiveElementStep = (idStep, step, idParent, steps, idProjectDep, formValues) => {
33
- const idSubStep = formValues[idStep]?.subStep;
34
- const newSubStep = step.subStep ? { ...step.subStep } : undefined;
35
- const newStep = {
36
- ...step,
37
- id: idStep,
38
- type: CBRFormStepTypes.CBR_LOCATIVAS,
39
- parentStep: idParent,
40
- dependencies: [idProjectDep],
41
- subStep: null,
42
- };
38
+ var addRecursiveElementStep = function (idStep, step, idParent, steps, idProjectDep, formValues) {
39
+ var _a, _b, _c;
40
+ var idSubStep = (_a = formValues[idStep]) === null || _a === void 0 ? void 0 : _a.subStep;
41
+ var newSubStep = step.subStep ? __assign({}, step.subStep) : undefined;
42
+ var newStep = __assign(__assign({}, step), { id: idStep, type: CBRFormStepTypes.CBR_LOCATIVAS, parentStep: idParent, dependencies: [idProjectDep], subStep: null });
43
43
  if (newSubStep) {
44
44
  newStep.subStep = idSubStep;
45
45
  }
46
46
  if (idParent) {
47
- newStep.dependencies?.push?.(idParent);
47
+ (_c = (_b = newStep.dependencies) === null || _b === void 0 ? void 0 : _b.push) === null || _c === void 0 ? void 0 : _c.call(_b, idParent);
48
48
  }
49
49
  steps[idStep] = newStep;
50
50
  if (newSubStep) {
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.9.17-test",
4
+ "version":"1.9.20-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",