@arquimedes.co/eureka-forms 0.1.2 → 0.2.5
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/@Types/@Types.d.ts +1 -1
- package/dist/@Types/@Types.js +1 -1
- package/dist/@Types/Form.d.ts +63 -63
- package/dist/@Types/Form.js +1 -1
- package/dist/@Types/FormStep.d.ts +105 -105
- package/dist/@Types/FormStep.js +1 -1
- package/dist/@Types/Organization.d.ts +16 -16
- package/dist/@Types/Organization.js +1 -1
- package/dist/App.d.ts +34 -32
- package/dist/App.js +262 -261
- package/dist/App.module.css +21 -0
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.d.ts +4 -4
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +232 -232
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.module.css +46 -0
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.d.ts +12 -12
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +33 -33
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.module.css +48 -0
- package/dist/FormComponents/Form/Form.d.ts +24 -23
- package/dist/FormComponents/Form/Form.js +116 -116
- package/dist/FormComponents/Form/Form.module.css +39 -0
- package/dist/FormComponents/Form/StepperForm/StepperForm.d.ts +4 -4
- package/dist/FormComponents/Form/StepperForm/StepperForm.js +6 -6
- package/dist/FormComponents/Form/StepperForm/StepperForm.module.css +0 -0
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.d.ts +4 -4
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +42 -42
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.module.css +8 -0
- package/dist/FormComponents/Section/Section.d.ts +24 -23
- package/dist/FormComponents/Section/Section.js +25 -25
- package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +9 -9
- package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +37 -37
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +4 -4
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +105 -105
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.module.css +25 -0
- package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.d.ts +9 -9
- package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +25 -25
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +4 -4
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +35 -35
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.module.css +9 -0
- package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.d.ts +9 -9
- package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +25 -25
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +11 -11
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +110 -110
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.module.css +52 -0
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +13 -13
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +165 -165
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.module.css +45 -0
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +4 -4
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +99 -99
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.module.css +25 -0
- package/dist/FormComponents/Step/SelectorStep/SelectorStep.d.ts +9 -9
- package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +37 -37
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +4 -4
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +11 -11
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.module.css +7 -0
- package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.d.ts +9 -9
- package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +37 -37
- package/dist/FormComponents/Step/Step.d.ts +10 -10
- package/dist/FormComponents/Step/Step.js +73 -64
- package/dist/FormComponents/Step/StepFunctions.d.ts +5 -5
- package/dist/FormComponents/Step/StepFunctions.js +51 -51
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +35 -0
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +6 -6
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +112 -112
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.module.css +58 -0
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.d.ts +9 -9
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +25 -25
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +4 -4
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +43 -43
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.module.css +9 -0
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.d.ts +9 -9
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +25 -25
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +4 -4
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +18 -18
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.module.css +35 -0
- package/dist/FormComponents/Step/TitleStep/TitleStep.d.ts +9 -9
- package/dist/FormComponents/Step/TitleStep/TitleStep.js +37 -37
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.d.ts +4 -4
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +77 -77
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.module.css +73 -0
- package/dist/FormComponents/Term/Term.d.ts +15 -15
- package/dist/FormComponents/Term/Term.js +25 -25
- package/dist/Widget.d.ts +1 -1
- package/dist/Widget.js +39 -56
- package/dist/constants/Files/FileExtensions.d.ts +3 -3
- package/dist/constants/Files/FileExtensions.js +65 -65
- package/dist/constants/Files/FileMaxSize.d.ts +2 -2
- package/dist/constants/Files/FileMaxSize.js +2 -2
- package/dist/constants/FormStepTypes.d.ts +33 -33
- package/dist/constants/FormStepTypes.js +39 -39
- package/dist/constants/InternalFormStyle.d.ts +3 -3
- package/dist/constants/InternalFormStyle.js +12 -12
- package/dist/constants/MaterialClassNameSeed.d.ts +1 -1
- package/dist/constants/MaterialClassNameSeed.js +1 -1
- package/dist/controllers/FileService.d.ts +5 -5
- package/dist/controllers/FileService.js +89 -89
- package/dist/index.d.ts +1 -2
- package/dist/index.js +16 -17
- package/dist/index.lib.d.ts +3 -0
- package/dist/index.lib.js +3 -0
- package/dist/index.module.css +14 -0
- package/dist/shared/Loader/Loader.d.ts +18 -18
- package/dist/shared/Loader/Loader.js +26 -26
- package/dist/shared/Loader/Loader.module.css +12 -0
- package/dist/shared/Navbar/Navbar.d.ts +9 -9
- package/dist/shared/Navbar/Navbar.js +18 -18
- package/dist/shared/Navbar/Navbar.module.css +18 -0
- package/dist/shared/RoundedButton/RoundedButton.d.ts +30 -30
- package/dist/shared/RoundedButton/RoundedButton.js +45 -45
- package/dist/shared/RoundedCheckBox/RoundedCheckBox.d.ts +24 -24
- package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +101 -101
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.d.ts +40 -40
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +246 -246
- package/dist/shared/RoundedSelect/RoundedSelect.d.ts +42 -42
- package/dist/shared/RoundedSelect/RoundedSelect.js +171 -171
- package/dist/shared/RoundedTextField/RoundedTextField.d.ts +41 -41
- package/dist/shared/RoundedTextField/RoundedTextField.js +138 -138
- package/package.json +2 -2
|
@@ -1,171 +1,171 @@
|
|
|
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
|
-
};
|
|
38
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
39
|
-
import React, { useEffect } from 'react';
|
|
40
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
41
|
-
import InputLabel from '@material-ui/core/InputLabel';
|
|
42
|
-
import FormControl from '@material-ui/core/FormControl';
|
|
43
|
-
import OutlinedInput from '@material-ui/core/OutlinedInput';
|
|
44
|
-
import Select from '@material-ui/core/Select';
|
|
45
|
-
import { FormHelperText } from '@material-ui/core';
|
|
46
|
-
var useStyles = makeStyles(function (theme) { return ({
|
|
47
|
-
root: {
|
|
48
|
-
display: 'flex',
|
|
49
|
-
flexWrap: 'wrap',
|
|
50
|
-
},
|
|
51
|
-
formControl: {
|
|
52
|
-
margin: theme.spacing(1),
|
|
53
|
-
minWidth: 120,
|
|
54
|
-
},
|
|
55
|
-
selectEmpty: {
|
|
56
|
-
marginTop: theme.spacing(2),
|
|
57
|
-
},
|
|
58
|
-
}); });
|
|
59
|
-
var useOutlinedInputStyles = function (props) {
|
|
60
|
-
return makeStyles({
|
|
61
|
-
root: {
|
|
62
|
-
cursor: props.cantEdit ? 'default' : 'default',
|
|
63
|
-
height: props.height,
|
|
64
|
-
'& $notchedOutline': {
|
|
65
|
-
borderColor: props.outlineColor,
|
|
66
|
-
},
|
|
67
|
-
'&:hover $notchedOutline': {
|
|
68
|
-
borderColor: props.cantEdit
|
|
69
|
-
? props.outlineColor
|
|
70
|
-
: props.focusColor,
|
|
71
|
-
},
|
|
72
|
-
'& .Mui-disabled': {
|
|
73
|
-
cursor: 'default',
|
|
74
|
-
color: props.color,
|
|
75
|
-
},
|
|
76
|
-
'& .Mui-error': {
|
|
77
|
-
color: props.errorColor,
|
|
78
|
-
},
|
|
79
|
-
'&.Mui-error .EF-MuiOutlinedInput-notchedOutline': {
|
|
80
|
-
borderColor: props.outlineColor,
|
|
81
|
-
},
|
|
82
|
-
'&$focused $notchedOutline': {
|
|
83
|
-
borderColor: props.focusColor,
|
|
84
|
-
},
|
|
85
|
-
borderRadius: 10,
|
|
86
|
-
color: props.color,
|
|
87
|
-
},
|
|
88
|
-
focused: {},
|
|
89
|
-
notchedOutline: {},
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
var useLabelInputStyles = function (props) {
|
|
93
|
-
return makeStyles(function () { return ({
|
|
94
|
-
focused: {
|
|
95
|
-
color: props.focusColor + ' !important',
|
|
96
|
-
},
|
|
97
|
-
root: {
|
|
98
|
-
marginTop: props.height != '40px' ? '-4px' : '0px',
|
|
99
|
-
'&.EF-MuiInputLabel-shrink': {
|
|
100
|
-
marginTop: '0px',
|
|
101
|
-
},
|
|
102
|
-
'& .Mui-error': {
|
|
103
|
-
color: props.errorColor,
|
|
104
|
-
},
|
|
105
|
-
'&.Mui-error': {
|
|
106
|
-
color: props.errorColor,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
}); });
|
|
110
|
-
};
|
|
111
|
-
var useHelperTextStyles = function (props) {
|
|
112
|
-
return makeStyles(function () { return ({
|
|
113
|
-
root: {
|
|
114
|
-
'&.Mui-error': {
|
|
115
|
-
color: props.errorColor,
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
}); });
|
|
119
|
-
};
|
|
120
|
-
function CustomSelect(_a) {
|
|
121
|
-
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.cantEdit, cantEdit = _f === void 0 ? false : _f, _g = _a.containerMargin, containerMargin = _g === void 0 ? '8px' : _g, _h = _a.height, height = _h === void 0 ? '40px' : _h, required = _a.required, error = _a.error, others = __rest(_a, ["children", "value", "handleUpdate", "label", "minWidth", "helperText", "color", "errorColor", "focusColor", "outlineColor", "cantEdit", "containerMargin", "height", "required", "error"]);
|
|
122
|
-
var classes = useStyles();
|
|
123
|
-
var outlinedInputClasses = useOutlinedInputStyles({
|
|
124
|
-
focusColor: focusColor,
|
|
125
|
-
outlineColor: outlineColor,
|
|
126
|
-
cantEdit: cantEdit,
|
|
127
|
-
color: color,
|
|
128
|
-
errorColor: errorColor,
|
|
129
|
-
height: height,
|
|
130
|
-
})();
|
|
131
|
-
var labelClasses = useLabelInputStyles({
|
|
132
|
-
focusColor: focusColor,
|
|
133
|
-
outlineColor: outlineColor,
|
|
134
|
-
errorColor: errorColor,
|
|
135
|
-
color: color,
|
|
136
|
-
cantEdit: cantEdit,
|
|
137
|
-
height: height,
|
|
138
|
-
})();
|
|
139
|
-
var helperTextClasses = useHelperTextStyles({
|
|
140
|
-
focusColor: focusColor,
|
|
141
|
-
outlineColor: outlineColor,
|
|
142
|
-
errorColor: errorColor,
|
|
143
|
-
cantEdit: cantEdit,
|
|
144
|
-
color: color,
|
|
145
|
-
height: height,
|
|
146
|
-
})();
|
|
147
|
-
var inputLabel = React.useRef();
|
|
148
|
-
var _j = React.useState(0), labelWidth = _j[0], setLabelWidth = _j[1];
|
|
149
|
-
useEffect(function () {
|
|
150
|
-
setLabelWidth(inputLabel.current.offsetWidth);
|
|
151
|
-
}, [label]);
|
|
152
|
-
return (_jsxs(FormControl, __assign({ variant: "outlined", className: classes.formControl, size: "small", style: minWidth !== undefined
|
|
153
|
-
? { minWidth: minWidth, outlineColor: outlineColor, margin: containerMargin }
|
|
154
|
-
: {
|
|
155
|
-
margin: containerMargin,
|
|
156
|
-
}, fullWidth: true, required: required, error: error }, { children: [_jsx(InputLabel, __assign({ ref: inputLabel, classes: labelClasses }, { children: label }), void 0), _jsx(Select, __assign({}, others, { value: value, onChange: handleUpdate, input: _jsx(OutlinedInput, { disabled: cantEdit, labelWidth: labelWidth, name: label, classes: outlinedInputClasses }, void 0) }, { children: children }), void 0), helperText !== undefined && (_jsx(FormHelperText, __assign({ classes: helperTextClasses }, { children: helperText }), void 0))] }), void 0));
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
|
|
160
|
-
*/
|
|
161
|
-
var RoundedSelect = /** @class */ (function (_super) {
|
|
162
|
-
__extends(RoundedSelect, _super);
|
|
163
|
-
function RoundedSelect() {
|
|
164
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
165
|
-
}
|
|
166
|
-
RoundedSelect.prototype.render = function () {
|
|
167
|
-
return _jsx(CustomSelect, __assign({}, this.props), void 0);
|
|
168
|
-
};
|
|
169
|
-
return RoundedSelect;
|
|
170
|
-
}(React.Component));
|
|
171
|
-
export default RoundedSelect;
|
|
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
|
+
};
|
|
38
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
39
|
+
import React, { useEffect } from 'react';
|
|
40
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
41
|
+
import InputLabel from '@material-ui/core/InputLabel';
|
|
42
|
+
import FormControl from '@material-ui/core/FormControl';
|
|
43
|
+
import OutlinedInput from '@material-ui/core/OutlinedInput';
|
|
44
|
+
import Select from '@material-ui/core/Select';
|
|
45
|
+
import { FormHelperText } from '@material-ui/core';
|
|
46
|
+
var useStyles = makeStyles(function (theme) { return ({
|
|
47
|
+
root: {
|
|
48
|
+
display: 'flex',
|
|
49
|
+
flexWrap: 'wrap',
|
|
50
|
+
},
|
|
51
|
+
formControl: {
|
|
52
|
+
margin: theme.spacing(1),
|
|
53
|
+
minWidth: 120,
|
|
54
|
+
},
|
|
55
|
+
selectEmpty: {
|
|
56
|
+
marginTop: theme.spacing(2),
|
|
57
|
+
},
|
|
58
|
+
}); });
|
|
59
|
+
var useOutlinedInputStyles = function (props) {
|
|
60
|
+
return makeStyles({
|
|
61
|
+
root: {
|
|
62
|
+
cursor: props.cantEdit ? 'default' : 'default',
|
|
63
|
+
height: props.height,
|
|
64
|
+
'& $notchedOutline': {
|
|
65
|
+
borderColor: props.outlineColor,
|
|
66
|
+
},
|
|
67
|
+
'&:hover $notchedOutline': {
|
|
68
|
+
borderColor: props.cantEdit
|
|
69
|
+
? props.outlineColor
|
|
70
|
+
: props.focusColor,
|
|
71
|
+
},
|
|
72
|
+
'& .Mui-disabled': {
|
|
73
|
+
cursor: 'default',
|
|
74
|
+
color: props.color,
|
|
75
|
+
},
|
|
76
|
+
'& .Mui-error': {
|
|
77
|
+
color: props.errorColor,
|
|
78
|
+
},
|
|
79
|
+
'&.Mui-error .EF-MuiOutlinedInput-notchedOutline': {
|
|
80
|
+
borderColor: props.outlineColor,
|
|
81
|
+
},
|
|
82
|
+
'&$focused $notchedOutline': {
|
|
83
|
+
borderColor: props.focusColor,
|
|
84
|
+
},
|
|
85
|
+
borderRadius: 10,
|
|
86
|
+
color: props.color,
|
|
87
|
+
},
|
|
88
|
+
focused: {},
|
|
89
|
+
notchedOutline: {},
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
var useLabelInputStyles = function (props) {
|
|
93
|
+
return makeStyles(function () { return ({
|
|
94
|
+
focused: {
|
|
95
|
+
color: props.focusColor + ' !important',
|
|
96
|
+
},
|
|
97
|
+
root: {
|
|
98
|
+
marginTop: props.height != '40px' ? '-4px' : '0px',
|
|
99
|
+
'&.EF-MuiInputLabel-shrink': {
|
|
100
|
+
marginTop: '0px',
|
|
101
|
+
},
|
|
102
|
+
'& .Mui-error': {
|
|
103
|
+
color: props.errorColor,
|
|
104
|
+
},
|
|
105
|
+
'&.Mui-error': {
|
|
106
|
+
color: props.errorColor,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
}); });
|
|
110
|
+
};
|
|
111
|
+
var useHelperTextStyles = function (props) {
|
|
112
|
+
return makeStyles(function () { return ({
|
|
113
|
+
root: {
|
|
114
|
+
'&.Mui-error': {
|
|
115
|
+
color: props.errorColor,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
}); });
|
|
119
|
+
};
|
|
120
|
+
function CustomSelect(_a) {
|
|
121
|
+
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.cantEdit, cantEdit = _f === void 0 ? false : _f, _g = _a.containerMargin, containerMargin = _g === void 0 ? '8px' : _g, _h = _a.height, height = _h === void 0 ? '40px' : _h, required = _a.required, error = _a.error, others = __rest(_a, ["children", "value", "handleUpdate", "label", "minWidth", "helperText", "color", "errorColor", "focusColor", "outlineColor", "cantEdit", "containerMargin", "height", "required", "error"]);
|
|
122
|
+
var classes = useStyles();
|
|
123
|
+
var outlinedInputClasses = useOutlinedInputStyles({
|
|
124
|
+
focusColor: focusColor,
|
|
125
|
+
outlineColor: outlineColor,
|
|
126
|
+
cantEdit: cantEdit,
|
|
127
|
+
color: color,
|
|
128
|
+
errorColor: errorColor,
|
|
129
|
+
height: height,
|
|
130
|
+
})();
|
|
131
|
+
var labelClasses = useLabelInputStyles({
|
|
132
|
+
focusColor: focusColor,
|
|
133
|
+
outlineColor: outlineColor,
|
|
134
|
+
errorColor: errorColor,
|
|
135
|
+
color: color,
|
|
136
|
+
cantEdit: cantEdit,
|
|
137
|
+
height: height,
|
|
138
|
+
})();
|
|
139
|
+
var helperTextClasses = useHelperTextStyles({
|
|
140
|
+
focusColor: focusColor,
|
|
141
|
+
outlineColor: outlineColor,
|
|
142
|
+
errorColor: errorColor,
|
|
143
|
+
cantEdit: cantEdit,
|
|
144
|
+
color: color,
|
|
145
|
+
height: height,
|
|
146
|
+
})();
|
|
147
|
+
var inputLabel = React.useRef();
|
|
148
|
+
var _j = React.useState(0), labelWidth = _j[0], setLabelWidth = _j[1];
|
|
149
|
+
useEffect(function () {
|
|
150
|
+
setLabelWidth(inputLabel.current.offsetWidth);
|
|
151
|
+
}, [label]);
|
|
152
|
+
return (_jsxs(FormControl, __assign({ variant: "outlined", className: classes.formControl, size: "small", style: minWidth !== undefined
|
|
153
|
+
? { minWidth: minWidth, outlineColor: outlineColor, margin: containerMargin }
|
|
154
|
+
: {
|
|
155
|
+
margin: containerMargin,
|
|
156
|
+
}, fullWidth: true, required: required, error: error }, { children: [_jsx(InputLabel, __assign({ ref: inputLabel, classes: labelClasses }, { children: label }), void 0), _jsx(Select, __assign({}, others, { value: value, onChange: handleUpdate, input: _jsx(OutlinedInput, { disabled: cantEdit, labelWidth: labelWidth, name: label, classes: outlinedInputClasses }, void 0) }, { children: children }), void 0), helperText !== undefined && (_jsx(FormHelperText, __assign({ classes: helperTextClasses }, { children: helperText }), void 0))] }), void 0));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
|
|
160
|
+
*/
|
|
161
|
+
var RoundedSelect = /** @class */ (function (_super) {
|
|
162
|
+
__extends(RoundedSelect, _super);
|
|
163
|
+
function RoundedSelect() {
|
|
164
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
165
|
+
}
|
|
166
|
+
RoundedSelect.prototype.render = function () {
|
|
167
|
+
return _jsx(CustomSelect, __assign({}, this.props), void 0);
|
|
168
|
+
};
|
|
169
|
+
return RoundedSelect;
|
|
170
|
+
}(React.Component));
|
|
171
|
+
export default RoundedSelect;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextFieldProps } from '@material-ui/core/TextField';
|
|
3
|
-
interface StyleProps {
|
|
4
|
-
/** The color of the text */
|
|
5
|
-
textColor?: string;
|
|
6
|
-
/** The color of the outline when selected and hovered on */
|
|
7
|
-
focusColor?: string;
|
|
8
|
-
/** The color of the error to display */
|
|
9
|
-
errorColor?: string;
|
|
10
|
-
/** The color of the outline when it is not selected */
|
|
11
|
-
outlineColor?: string;
|
|
12
|
-
/** The backgroundColor of the input */
|
|
13
|
-
backgroundColor?: string;
|
|
14
|
-
/** The color of the inner input */
|
|
15
|
-
innerBackgroundColor?: string;
|
|
16
|
-
/** The borderRadius of the input */
|
|
17
|
-
borderRadius?: number;
|
|
18
|
-
/** If input is readOnly */
|
|
19
|
-
readOnly?: boolean;
|
|
20
|
-
/** The padding of the input */
|
|
21
|
-
padding?: string;
|
|
22
|
-
/** The size of the font to display the input in */
|
|
23
|
-
fontSize?: number | string;
|
|
24
|
-
/** The weight of the font of the value and the placeholder */
|
|
25
|
-
fontWeight?: number | string;
|
|
26
|
-
/** The fontsize of the shrunken label */
|
|
27
|
-
shrunkenFontSize?: number | string;
|
|
28
|
-
/** If the input is multiline */
|
|
29
|
-
multiline?: boolean;
|
|
30
|
-
/** Cant edit */
|
|
31
|
-
cantEdit?: boolean;
|
|
32
|
-
}
|
|
33
|
-
interface RoundedTextFieldProps extends StyleProps {
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
|
|
37
|
-
*/
|
|
38
|
-
declare class RoundedTextField extends React.Component<RoundedTextFieldProps & TextFieldProps> {
|
|
39
|
-
render(): JSX.Element;
|
|
40
|
-
}
|
|
41
|
-
export default RoundedTextField;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextFieldProps } from '@material-ui/core/TextField';
|
|
3
|
+
interface StyleProps {
|
|
4
|
+
/** The color of the text */
|
|
5
|
+
textColor?: string;
|
|
6
|
+
/** The color of the outline when selected and hovered on */
|
|
7
|
+
focusColor?: string;
|
|
8
|
+
/** The color of the error to display */
|
|
9
|
+
errorColor?: string;
|
|
10
|
+
/** The color of the outline when it is not selected */
|
|
11
|
+
outlineColor?: string;
|
|
12
|
+
/** The backgroundColor of the input */
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
/** The color of the inner input */
|
|
15
|
+
innerBackgroundColor?: string;
|
|
16
|
+
/** The borderRadius of the input */
|
|
17
|
+
borderRadius?: number;
|
|
18
|
+
/** If input is readOnly */
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
/** The padding of the input */
|
|
21
|
+
padding?: string;
|
|
22
|
+
/** The size of the font to display the input in */
|
|
23
|
+
fontSize?: number | string;
|
|
24
|
+
/** The weight of the font of the value and the placeholder */
|
|
25
|
+
fontWeight?: number | string;
|
|
26
|
+
/** The fontsize of the shrunken label */
|
|
27
|
+
shrunkenFontSize?: number | string;
|
|
28
|
+
/** If the input is multiline */
|
|
29
|
+
multiline?: boolean;
|
|
30
|
+
/** Cant edit */
|
|
31
|
+
cantEdit?: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface RoundedTextFieldProps extends StyleProps {
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
|
|
37
|
+
*/
|
|
38
|
+
declare class RoundedTextField extends React.Component<RoundedTextFieldProps & TextFieldProps> {
|
|
39
|
+
render(): JSX.Element;
|
|
40
|
+
}
|
|
41
|
+
export default RoundedTextField;
|