@arquimedes.co/eureka-forms 1.7.9-test → 1.8.1-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.
@@ -57,8 +57,8 @@ function Incidents(_a) {
57
57
  num: current.length + 1,
58
58
  };
59
59
  var newSteps = __assign({}, localForm.steps);
60
- newSteps[newIncident.idSpaceStep] = __assign({ id: newIncident.idSpaceStep, type: CBRFormStepTypes.CBR_TIPO_ESPACIO, dependencies: step.dependencies }, step.spaceStep);
61
- newSteps[newIncident.idCommentStep] = __assign({ id: newIncident.idCommentStep, type: CBRFormStepTypes.CBR_COMENTARIO }, step.commentStep);
60
+ newSteps[newIncident.idSpaceStep] = __assign(__assign({}, step.spaceStep), { id: newIncident.idSpaceStep, type: CBRFormStepTypes.CBR_TIPO_ESPACIO, dependencies: step.dependencies });
61
+ newSteps[newIncident.idCommentStep] = __assign(__assign({}, step.commentStep), { id: newIncident.idCommentStep, type: CBRFormStepTypes.CBR_COMENTARIO });
62
62
  var deps = __assign({}, dependencyStore);
63
63
  addRecursiveElementStep(newIncident.idElementStep, step.elementStep, null, newSteps, deps, (_b = (_a = step.dependencies) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '');
64
64
  onChange(__spreadArray(__spreadArray([], incidents, true), [newIncident], false));
@@ -24,20 +24,26 @@ function TextAreaStep(_a) {
24
24
  var _b = useState(false), hovering = _b[0], setHovering = _b[1];
25
25
  var _c = useState(false), focus = _c[0], setFocus = _c[1];
26
26
  var calcStyle = function () {
27
+ var backgroundColor = formStyle.stepBackgroundColor;
27
28
  if (focus) {
28
29
  return {
29
30
  border: '2px solid ' + formStyle.primaryColor,
30
31
  marginTop: -1,
31
32
  marginLeft: -1,
32
33
  marginBottom: 0,
34
+ backgroundColor: backgroundColor,
33
35
  };
34
36
  }
35
37
  else if (hovering) {
36
- return { border: '1px solid ' + formStyle.primaryColor };
38
+ return {
39
+ border: '1px solid ' + formStyle.primaryColor,
40
+ backgroundColor: backgroundColor,
41
+ };
37
42
  }
38
43
  else {
39
44
  return {
40
45
  border: '1px solid ' + formStyle.outlineColor,
46
+ backgroundColor: backgroundColor,
41
47
  };
42
48
  }
43
49
  };
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { SelectProps } from '@material-ui/core/Select';
3
- interface ColorProps {
4
- /** The color of the helper text when not error */
5
- helperTextColor?: string;
3
+ interface StyleProps {
6
4
  /** The color of the outline when selected and hovered on */
7
5
  focusColor?: string;
8
6
  /** The color of the outline when it is not selected */
9
7
  outlineColor?: string;
8
+ /** The color of the background */
9
+ backgroundColor?: string;
10
10
  /** The color of the error to display */
11
11
  errorColor?: string;
12
12
  /** If the style should change on hover */
@@ -15,10 +15,20 @@ interface ColorProps {
15
15
  height?: string;
16
16
  /** The color of the text in the form */
17
17
  color?: string;
18
+ /** The fontsize of the content */
19
+ fontSize?: string;
20
+ /** The color of the inner input */
21
+ innerBackgroundColor?: string;
22
+ /** If input is readOnly */
23
+ readOnly?: boolean;
24
+ /** The color of the helper text when not error */
25
+ helperTextColor?: string;
26
+ /** The borderRadius of the input */
27
+ borderRadius?: number;
18
28
  /** If custom iconComponent exists */
19
29
  showIcon?: boolean;
20
30
  }
21
- interface RoundedSelectProps extends Omit<SelectProps, 'color'>, ColorProps {
31
+ interface RoundedSelectProps extends Omit<SelectProps, 'color'>, StyleProps {
22
32
  /** children to display in the options */
23
33
  children?: any;
24
34
  /** Currently selected value */
@@ -42,6 +52,8 @@ interface RoundedSelectProps extends Omit<SelectProps, 'color'>, ColorProps {
42
52
  containerMargin?: string;
43
53
  /** The icon to display */
44
54
  iconComponent?: any;
55
+ /** The color of the inner input */
56
+ innerBackgroundColor?: string;
45
57
  }
46
58
  /**
47
59
  * Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
@@ -61,8 +61,14 @@ var useOutlinedInputStyles = function (props) {
61
61
  root: {
62
62
  cursor: props.cantEdit ? 'default' : 'default',
63
63
  height: props.height,
64
+ borderRadius: props.borderRadius,
65
+ backgroundColor: props.innerBackgroundColor,
66
+ fontSize: props.fontSize,
64
67
  '& $notchedOutline': {
65
68
  borderColor: props.outlineColor,
69
+ '& legend': {
70
+ fontSize: 'calc(' + props.fontSize + ' * 0.75)',
71
+ },
66
72
  },
67
73
  '&:hover $notchedOutline': {
68
74
  borderColor: props.cantEdit
@@ -88,7 +94,6 @@ var useOutlinedInputStyles = function (props) {
88
94
  '& .EF-MuiSelect-iconOpen': {
89
95
  transform: props.showIcon ? 'none' : 'rotate(180deg)',
90
96
  },
91
- borderRadius: 10,
92
97
  color: props.color,
93
98
  },
94
99
  focused: {},
@@ -130,43 +135,33 @@ var useHelperTextStyles = function (props) {
130
135
  }); });
131
136
  };
132
137
  function CustomSelect(_a) {
133
- var children = _a.children, value = _a.value, handleUpdate = _a.handleUpdate, label = _a.label, minWidth = _a.minWidth, helperText = _a.helperText, _b = _a.color, color = _b === void 0 ? '#293241' : _b, _c = _a.errorColor, errorColor = _c === void 0 ? '#cc2936' : _c, _d = _a.focusColor, focusColor = _d === void 0 ? '#3d5a7f' : _d, _e = _a.outlineColor, outlineColor = _e === void 0 ? '#0000003b' : _e, _f = _a.helperTextColor, helperTextColor = _f === void 0 ? '#989898' : _f, _g = _a.cantEdit, cantEdit = _g === void 0 ? false : _g, _h = _a.showIcon, showIcon = _h === void 0 ? true : _h, _j = _a.containerMargin, containerMargin = _j === void 0 ? '8px' : _j, _k = _a.height, height = _k === void 0 ? '40px' : _k, required = _a.required, iconComponent = _a.iconComponent, error = _a.error, others = __rest(_a, ["children", "value", "handleUpdate", "label", "minWidth", "helperText", "color", "errorColor", "focusColor", "outlineColor", "helperTextColor", "cantEdit", "showIcon", "containerMargin", "height", "required", "iconComponent", "error"]);
134
- var classes = useStyles();
135
- var outlinedInputClasses = useOutlinedInputStyles({
136
- helperTextColor: helperTextColor,
137
- outlineColor: outlineColor,
138
- errorColor: errorColor,
139
- focusColor: focusColor,
140
- cantEdit: cantEdit,
141
- height: height,
138
+ var children = _a.children, value = _a.value, handleUpdate = _a.handleUpdate, label = _a.label, minWidth = _a.minWidth, helperText = _a.helperText, _b = _a.color, color = _b === void 0 ? '#293241' : _b, _c = _a.errorColor, errorColor = _c === void 0 ? '#cc2936' : _c, _d = _a.focusColor, focusColor = _d === void 0 ? '#3d5a7f' : _d, _e = _a.fontSize, fontSize = _e === void 0 ? '1rem' : _e, _f = _a.outlineColor, outlineColor = _f === void 0 ? '#0000003b' : _f, _g = _a.helperTextColor, helperTextColor = _g === void 0 ? '#989898' : _g, _h = _a.backgroundColor, backgroundColor = _h === void 0 ? '#ffffff' : _h, _j = _a.readOnly, readOnly = _j === void 0 ? false : _j, _k = _a.borderRadius, borderRadius = _k === void 0 ? 10 : _k, innerBackgroundColor = _a.innerBackgroundColor, _l = _a.cantEdit, cantEdit = _l === void 0 ? false : _l, _m = _a.showIcon, showIcon = _m === void 0 ? true : _m, _o = _a.containerMargin, containerMargin = _o === void 0 ? '8px' : _o, _p = _a.height, height = _p === void 0 ? '40px' : _p, required = _a.required, iconComponent = _a.iconComponent, error = _a.error, others = __rest(_a, ["children", "value", "handleUpdate", "label", "minWidth", "helperText", "color", "errorColor", "focusColor", "fontSize", "outlineColor", "helperTextColor", "backgroundColor", "readOnly", "borderRadius", "innerBackgroundColor", "cantEdit", "showIcon", "containerMargin", "height", "required", "iconComponent", "error"]);
139
+ var props = {
142
140
  color: color,
143
- showIcon: showIcon && iconComponent !== undefined,
144
- })();
145
- var labelClasses = useLabelInputStyles({
146
- helperTextColor: helperTextColor,
147
- outlineColor: outlineColor,
148
- errorColor: errorColor,
149
- focusColor: focusColor,
150
- cantEdit: cantEdit,
151
141
  height: height,
152
- color: color,
153
- })();
154
- var helperTextClasses = useHelperTextStyles({
155
- helperTextColor: helperTextColor,
156
- outlineColor: outlineColor,
157
142
  errorColor: errorColor,
158
143
  focusColor: focusColor,
144
+ outlineColor: outlineColor,
145
+ innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
146
+ helperTextColor: helperTextColor,
147
+ backgroundColor: backgroundColor,
148
+ borderRadius: borderRadius,
149
+ readOnly: readOnly,
150
+ fontSize: fontSize,
159
151
  cantEdit: cantEdit,
160
- height: height,
161
- color: color,
162
- })();
152
+ showIcon: showIcon && iconComponent !== undefined,
153
+ };
154
+ var classes = useStyles();
155
+ var outlinedInputClasses = useOutlinedInputStyles(props)();
156
+ var labelClasses = useLabelInputStyles(props)();
157
+ var helperTextClasses = useHelperTextStyles(props)();
163
158
  return (_jsxs(FormControl, __assign({ variant: "outlined", className: classes.formControl, size: "small", style: minWidth !== undefined
164
159
  ? { minWidth: minWidth, outlineColor: outlineColor, margin: containerMargin }
165
160
  : {
166
161
  margin: containerMargin,
167
- }, fullWidth: true, required: required, error: error }, { children: [_jsx(InputLabel, __assign({ classes: labelClasses }, { children: label }), void 0), _jsx(Select, __assign({}, others, { value: value, onChange: handleUpdate }, (showIcon && iconComponent
162
+ }, fullWidth: true, required: required, error: error }, { children: [label && _jsx(InputLabel, __assign({ classes: labelClasses }, { children: label }), void 0), _jsx(Select, __assign({}, others, { value: value, onChange: handleUpdate }, (showIcon && iconComponent
168
163
  ? { IconComponent: iconComponent }
169
- : {}), { input: _jsx(OutlinedInput, { disabled: cantEdit, name: label, label: label + (required ? ' *' : ''), classes: outlinedInputClasses }, void 0) }, { children: children }), void 0), helperText !== undefined && (_jsx(FormHelperText, __assign({ classes: helperTextClasses }, { children: helperText }), void 0))] }), void 0));
164
+ : {}), { input: _jsx(OutlinedInput, { disabled: cantEdit, name: label, label: label ? label + (required ? ' *' : '') : undefined, classes: outlinedInputClasses }, void 0) }, { children: children }), void 0), helperText !== undefined && (_jsx(FormHelperText, __assign({ classes: helperTextClasses }, { children: helperText }), void 0))] }), void 0));
170
165
  }
171
166
  /**
172
167
  * Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
@@ -173,6 +173,6 @@ export default function RoundedSmartSelect(_a) {
173
173
  else {
174
174
  return (_jsxs(RoundedSelect, __assign({ onBlur: onBlur, inputRef: inputRef, name: name, fullWidth: true, handleUpdate: handleUpdate, onOpen: function () {
175
175
  //Show loading icon if loading
176
- }, 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 }, { children: [_jsx(MenuItem, __assign({ value: '', style: { whiteSpace: 'normal' } }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), options.map(function (option) { return (_jsx(MenuItem, __assign({ value: option.value, style: { whiteSpace: 'normal' } }, { children: option.label }), option.value)); })] }), void 0));
176
+ }, value: value, color: color, errorColor: errorColor, focusColor: focusColor, helperTextColor: helperTextColor, innerBackgroundColor: innerBackgroundColor, outlineColor: outlineColor, cantEdit: cantEdit, label: label, required: required, readOnly: readOnly, helperText: helperText, containerMargin: containerMargin, height: height, error: error, iconComponent: iconComponent, showIcon: showIcon }, { children: [_jsx(MenuItem, __assign({ value: '', style: { whiteSpace: 'normal' } }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), options.map(function (option) { return (_jsx(MenuItem, __assign({ value: option.value, style: { whiteSpace: 'normal' } }, { children: option.label }), option.value)); })] }), void 0));
177
177
  }
178
178
  }
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.7.9-test",
4
+ "version":"1.8.1-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",