@arquimedes.co/eureka-forms 1.3.0-test → 1.4.3-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 (66) hide show
  1. package/dist/@Types/CBRFormStep.d.ts +72 -0
  2. package/dist/@Types/CBRFormStep.js +1 -0
  3. package/dist/@Types/Form.d.ts +4 -1
  4. package/dist/@Types/FormStep.d.ts +11 -46
  5. package/dist/@Types/GenericFormSteps.d.ts +58 -0
  6. package/dist/@Types/GenericFormSteps.js +1 -0
  7. package/dist/App.d.ts +3 -1
  8. package/dist/App.js +17 -6
  9. package/dist/App.module.css +1 -0
  10. package/dist/FormComponents/Form/ColumnForm/ColumnForm.d.ts +1 -1
  11. package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +98 -59
  12. package/dist/FormComponents/Form/Form.d.ts +5 -1
  13. package/dist/FormComponents/Form/Form.js +22 -10
  14. package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +2 -1
  15. package/dist/FormComponents/Section/Section.d.ts +4 -1
  16. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +9 -0
  17. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +25 -0
  18. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +8 -0
  19. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +48 -0
  20. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.module.css +60 -0
  21. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +11 -0
  22. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +112 -0
  23. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.module.css +34 -0
  24. package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.d.ts +9 -0
  25. package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +122 -0
  26. package/dist/FormComponents/Step/CBRStepMapper.d.ts +13 -0
  27. package/dist/FormComponents/Step/CBRStepMapper.js +243 -0
  28. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_INMUEBLE.json +13151 -0
  29. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_LOCATIVAS.json +71 -0
  30. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_PROYECTO.json +74 -0
  31. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_TIPO_DOC.json +50 -0
  32. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_TIPO_ESPACIO.json +320 -0
  33. package/dist/FormComponents/Step/CBRStepValuesTemp/CBR_TIPO_SOLICITANTE.json +42 -0
  34. package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +2 -2
  35. package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +12 -7
  36. package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +1 -1
  37. package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +7 -5
  38. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +4 -0
  39. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +145 -0
  40. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.module.css +9 -0
  41. package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.d.ts +22 -0
  42. package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +25 -0
  43. package/dist/FormComponents/Step/Step.js +10 -7
  44. package/dist/FormComponents/Step/StepFunctions.d.ts +3 -3
  45. package/dist/FormComponents/Step/StepFunctions.js +5 -5
  46. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +5 -2
  47. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.module.css +1 -2
  48. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -1
  49. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +3 -3
  50. package/dist/FormComponents/Step/TextInputStep/TextInputStep.d.ts +2 -0
  51. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +3 -1
  52. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.module.css +1 -8
  53. package/dist/constants/CBRFormStepTypes.d.ts +20 -0
  54. package/dist/constants/CBRFormStepTypes.js +21 -0
  55. package/dist/constants/FormStepTypes.d.ts +0 -6
  56. package/dist/constants/FormStepTypes.js +0 -7
  57. package/dist/shared/RoundedCheckBox/RoundedCheckBox.d.ts +1 -1
  58. package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +1 -1
  59. package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +1 -1
  60. package/dist/shared/RoundedSelect/RoundedSelect.d.ts +5 -1
  61. package/dist/shared/RoundedSelect/RoundedSelect.js +8 -2
  62. package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +63 -0
  63. package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +172 -0
  64. package/dist/shared/RoundedTextField/RoundedTextField.d.ts +2 -0
  65. package/dist/shared/RoundedTextField/RoundedTextField.js +7 -2
  66. package/package.json +2 -1
@@ -0,0 +1,172 @@
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
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import Autocomplete, { createFilterOptions, } from '@material-ui/lab/Autocomplete';
25
+ import { makeStyles } from '@material-ui/core/styles';
26
+ import TextField from '@material-ui/core/TextField';
27
+ import { Popper } from '@material-ui/core';
28
+ import RoundedSelect from '../RoundedSelect/RoundedSelect';
29
+ var filter = createFilterOptions();
30
+ var useTextfieldStyles = function (props) {
31
+ return makeStyles(function () { return ({
32
+ root: {
33
+ borderRadius: props.borderRadius,
34
+ backgroundColor: props.backgroundColor,
35
+ '& input, textarea': {
36
+ cursor: props.cantEdit ? 'default' : 'text',
37
+ fontWeight: props.fontWeight,
38
+ color: props.color,
39
+ fontSize: props.fontSize,
40
+ '&::placeholder': {
41
+ fontSize: props.fontSize,
42
+ },
43
+ backgroundColor: props.innerBackgroundColor,
44
+ borderRadius: props.borderRadius,
45
+ height: props.height,
46
+ marginTop: '0px !important',
47
+ padding: '0px 38px 0px 12px !important',
48
+ },
49
+ '& .EF-MuiInputBase-root': {
50
+ padding: '0px !important',
51
+ pointerEvents: 'all',
52
+ },
53
+ '& label': {
54
+ marginTop: '-4px',
55
+ fontSize: props.fontSize,
56
+ whiteSpace: 'nowrap',
57
+ overflow: 'hidden',
58
+ textOverflow: 'ellipsis',
59
+ maxWidth: 'calc(100% - 22px)',
60
+ },
61
+ '& label.EF-MuiInputLabel-shrink': {
62
+ marginTop: '0px',
63
+ maxWidth: 'calc(100% - 5px)',
64
+ },
65
+ '& input + fieldset': {
66
+ borderRadius: props.borderRadius,
67
+ },
68
+ '& .EF-MuiInput-underline:after': {
69
+ borderBottomColor: props.outlineColor,
70
+ },
71
+ '& .EF-MuiOutlinedInput-root': {
72
+ borderRadius: props.borderRadius,
73
+ '&.Mui-focused fieldset': {
74
+ borderColor: props.focusColor,
75
+ borderWidth: props.readOnly ? 1 : 2,
76
+ },
77
+ '& .EF-MuiOutlinedInput-notchedOutline': {
78
+ borderColor: props.outlineColor,
79
+ },
80
+ height: props.height,
81
+ '& .EF-MuiAutocomplete-input': {
82
+ height: props.height,
83
+ marginTop: -10,
84
+ },
85
+ '& .EF-MuiAutocomplete-input::placeholder': {
86
+ color: 'var(--greyFont)',
87
+ opacity: 1,
88
+ },
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 + ' !important',
100
+ },
101
+ '& .EF-MuiFormHelperText-root': {
102
+ color: props.helperTextColor,
103
+ },
104
+ '& .EF-MuiFormLabel-root.Mui-disabled': {
105
+ color: '#0000008a',
106
+ },
107
+ '& .EF-MuiOutlinedInput-notchedOutline': {
108
+ borderColor: '#0000003b',
109
+ },
110
+ '.EF-MuiAutocomplete-popupIndicator': {
111
+ padding: 0,
112
+ },
113
+ '& .EF-MuiAutocomplete-popupIndicatorOpen': {
114
+ transform: props.showIcon ? 'none' : 'rotate(180deg)',
115
+ },
116
+ },
117
+ }); });
118
+ };
119
+ export default function RoundedSmartSelect(_a) {
120
+ var _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, handleUpdate = _a.handleUpdate, label = _a.label, _c = _a.color, color = _c === void 0 ? '#293241' : _c, _d = _a.errorColor, errorColor = _d === void 0 ? '#cc2936' : _d, _e = _a.focusColor, focusColor = _e === void 0 ? '#3d5a7f' : _e, _f = _a.helperTextColor, helperTextColor = _f === void 0 ? '#989898' : _f, _g = _a.outlineColor, outlineColor = _g === void 0 ? '#b8b8b8' : _g, _h = _a.backgroundColor, backgroundColor = _h === void 0 ? '#ffffff' : _h, _j = _a.cantEdit, cantEdit = _j === void 0 ? false : _j, _k = _a.loading, loading = _k === void 0 ? false : _k, _l = _a.height, height = _l === void 0 ? '31px' : _l, _m = _a.fontSize, fontSize = _m === void 0 ? '1rem' : _m, required = _a.required, error = _a.error, innerBackgroundColor = _a.innerBackgroundColor, getOptionSelected = _a.getOptionSelected, helperText = _a.helperText, _o = _a.readOnly, readOnly = _o === void 0 ? false : _o, _p = _a.borderRadius, borderRadius = _p === void 0 ? 10 : _p, _q = _a.fontWeight, fontWeight = _q === void 0 ? '400' : _q, icon = _a.icon, iconComponent = _a.iconComponent, _r = _a.searchable, searchable = _r === void 0 ? false : _r, _s = _a.containerMargin, containerMargin = _s === void 0 ? '0px' : _s, _t = _a.showIcon, showIcon = _t === void 0 ? true : _t, inputRef = _a.inputRef, disabled = _a.disabled, onBlur = _a.onBlur, name = _a.name;
121
+ var props = {
122
+ color: color,
123
+ height: height,
124
+ errorColor: errorColor,
125
+ focusColor: focusColor,
126
+ outlineColor: outlineColor,
127
+ innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
128
+ helperTextColor: helperTextColor,
129
+ backgroundColor: backgroundColor,
130
+ borderRadius: borderRadius,
131
+ readOnly: readOnly,
132
+ fontSize: fontSize,
133
+ fontWeight: fontWeight,
134
+ cantEdit: cantEdit,
135
+ showIcon: showIcon && icon !== undefined,
136
+ };
137
+ var textFieldClasses = useTextfieldStyles(props)();
138
+ if (searchable) {
139
+ return (_jsx(Autocomplete, { size: "small", fullWidth: true, openOnFocus: true, disabled: cantEdit || disabled, popupIcon: showIcon && icon ? icon : undefined, onOpen: function () {
140
+ //Show loading icon if loading
141
+ }, loading: loading, loadingText: 'Cargando...', closeIcon: false, options: options, getOptionLabel: function (option) {
142
+ // Value selected with enter, right from the input
143
+ if (typeof option === 'string') {
144
+ return option;
145
+ }
146
+ else if (option.inputValue) {
147
+ return option.inputValue;
148
+ }
149
+ else {
150
+ // Regular option
151
+ return option.label;
152
+ }
153
+ }, getOptionSelected: getOptionSelected, PopperComponent: function (_a) {
154
+ var style = _a.style, props = __rest(_a, ["style"]);
155
+ return (_jsx(Popper, __assign({}, props, { style: __assign(__assign({}, style), { zIndex: 1305 }) }), void 0));
156
+ }, value: value ? value : null, onChange: function (event, newValue) {
157
+ handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(newValue);
158
+ }, filterOptions: function (options, params) {
159
+ if (value) {
160
+ return options;
161
+ }
162
+ else {
163
+ return filter(options, params);
164
+ }
165
+ }, renderOption: function (option) { return option.label; }, renderInput: function (params) { return (_jsx(TextField, __assign({ classes: textFieldClasses }, params, { inputRef: inputRef, onBlur: onBlur, name: name, variant: "outlined", label: label, required: required, error: error, helperText: helperText }), void 0)); }, style: { pointerEvents: 'none' }, noOptionsText: "No hay opciones" }, void 0));
166
+ }
167
+ else {
168
+ return (_jsx(RoundedSelect, { onBlur: onBlur, inputRef: inputRef, name: name, fullWidth: true, handleUpdate: handleUpdate, onOpen: function () {
169
+ //Show loading icon if loading
170
+ }, value: value, color: color, errorColor: errorColor, focusColor: focusColor, helperTextColor: helperTextColor, outlineColor: outlineColor, cantEdit: cantEdit, label: label, required: required, readOnly: readOnly, helperText: helperText, containerMargin: containerMargin, height: height, error: error, iconComponent: iconComponent, showIcon: showIcon }, void 0));
171
+ }
172
+ }
@@ -31,6 +31,8 @@ interface StyleProps {
31
31
  cantEdit?: boolean;
32
32
  /** The color of the helper text when not error */
33
33
  helperTextColor?: string;
34
+ /** The icon to display */
35
+ icon?: React.ReactNode;
34
36
  }
35
37
  interface RoundedTextFieldProps extends StyleProps {
36
38
  }
@@ -95,6 +95,9 @@ var useTextfieldStyles = function (props) {
95
95
  '& .Mui-error': {
96
96
  color: props.errorColor,
97
97
  },
98
+ '& .EF-MuiOutlinedInput-adornedEnd': {
99
+ paddingRight: '7px',
100
+ },
98
101
  '& .EF-MuiFormHelperText-root': {
99
102
  color: props.helperTextColor,
100
103
  },
@@ -102,7 +105,7 @@ var useTextfieldStyles = function (props) {
102
105
  }); });
103
106
  };
104
107
  function CustomTextfield(_a) {
105
- 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 ? 'white' : _e, innerBackgroundColor = _a.innerBackgroundColor, _f = _a.textColor, textColor = _f === void 0 ? '#293241' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.borderRadius, borderRadius = _h === void 0 ? 10 : _h, _j = _a.padding, padding = _j === void 0 ? '6px 12px' : _j, _k = _a.fontSize, fontSize = _k === void 0 ? '1rem' : _k, _l = _a.shrunkenFontSize, shrunkenFontSize = _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, others = __rest(_a, ["focusColor", "helperTextColor", "outlineColor", "backgroundColor", "innerBackgroundColor", "textColor", "readOnly", "borderRadius", "padding", "fontSize", "shrunkenFontSize", "errorColor", "fontWeight", "multiline", "cantEdit"]);
108
+ 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 ? 'white' : _e, innerBackgroundColor = _a.innerBackgroundColor, _f = _a.textColor, textColor = _f === void 0 ? '#293241' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.borderRadius, borderRadius = _h === void 0 ? 10 : _h, _j = _a.padding, padding = _j === void 0 ? '6px 12px' : _j, _k = _a.fontSize, fontSize = _k === void 0 ? '1rem' : _k, _l = _a.shrunkenFontSize, shrunkenFontSize = _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, inputProps = _a.inputProps, value = _a.value, icon = _a.icon, others = __rest(_a, ["focusColor", "helperTextColor", "outlineColor", "backgroundColor", "innerBackgroundColor", "textColor", "readOnly", "borderRadius", "padding", "fontSize", "shrunkenFontSize", "errorColor", "fontWeight", "multiline", "cantEdit", "inputProps", "value", "icon"]);
106
109
  var classes = useTextfieldStyles({
107
110
  padding: padding,
108
111
  textColor: textColor,
@@ -120,9 +123,11 @@ function CustomTextfield(_a) {
120
123
  multiline: multiline,
121
124
  cantEdit: cantEdit,
122
125
  })();
123
- return (_jsx(TextField, __assign({ classes: classes }, others, { multiline: multiline, variant: "outlined", size: "small", fullWidth: true, InputProps: {
126
+ return (_jsx(TextField, __assign({ classes: classes }, others, { value: value !== null && value !== void 0 ? value : '', multiline: multiline, variant: "outlined", size: "small", fullWidth: true, InputProps: {
124
127
  readOnly: readOnly,
125
128
  disabled: cantEdit,
129
+ inputProps: inputProps,
130
+ endAdornment: icon,
126
131
  } }), void 0));
127
132
  }
128
133
  /**
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.3.0-test",
4
+ "version":"1.4.3-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",
@@ -21,6 +21,7 @@
21
21
  "axios": "^0.21.x",
22
22
  "date-fns": "^2.23.x",
23
23
  "draft-js": "^0.11.x",
24
+ "nanoid": "^3.3.3",
24
25
  "react-draft-wysiwyg": "^1.14.x",
25
26
  "react-hook-form": "^7.6.4",
26
27
  "react-router-dom": "^5.2.0",