@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,246 +1,246 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
39
|
-
import React from 'react';
|
|
40
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
41
|
-
import CalendarTodayRoundedIcon from '@material-ui/icons/CalendarTodayRounded';
|
|
42
|
-
import { KeyboardDatePicker, } from '@material-ui/pickers';
|
|
43
|
-
var useDatePickerStyles = function (props) {
|
|
44
|
-
return makeStyles(function () { return ({
|
|
45
|
-
root: {
|
|
46
|
-
borderRadius: props.borderRadius,
|
|
47
|
-
backgroundColor: props.backgroundColor,
|
|
48
|
-
'& input, textarea': {
|
|
49
|
-
cursor: props.cantEdit ? 'default' : 'text',
|
|
50
|
-
padding: props.padding,
|
|
51
|
-
fontWeight: props.fontWeight,
|
|
52
|
-
color: props.textColor,
|
|
53
|
-
fontSize: props.fontSize,
|
|
54
|
-
'&::placeholder': {
|
|
55
|
-
fontSize: props.fontSize,
|
|
56
|
-
},
|
|
57
|
-
backgroundColor: props.innerBackgroundColor,
|
|
58
|
-
borderRadius: props.borderRadius,
|
|
59
|
-
},
|
|
60
|
-
'& .EF-MuiOutlinedInput-notchedOutline': {
|
|
61
|
-
borderColor: props.outlineColor,
|
|
62
|
-
'& span': {
|
|
63
|
-
fontSize: props.shrunkenFontSize,
|
|
64
|
-
paddingRight: 0,
|
|
65
|
-
paddingLeft: 0,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
'&.Mui-error .EF-MuiOutlinedInput-notchedOutline': {
|
|
69
|
-
borderColor: props.outlineColor,
|
|
70
|
-
},
|
|
71
|
-
'&.Mui-focused .EF-MuiOutlinedInput-notchedOutline': {
|
|
72
|
-
borderColor: props.focusColor,
|
|
73
|
-
borderWidth: 2,
|
|
74
|
-
},
|
|
75
|
-
'&:hover .EF-MuiOutlinedInput-notchedOutline': {
|
|
76
|
-
borderColor: props.cantEdit
|
|
77
|
-
? props.outlineColor
|
|
78
|
-
: props.focusColor,
|
|
79
|
-
},
|
|
80
|
-
'& .EF-MuiInputAdornment-root': {
|
|
81
|
-
'& button': {
|
|
82
|
-
marginRight: -20,
|
|
83
|
-
fontSize: 18,
|
|
84
|
-
padding: 16,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
'& .Mui-error': {
|
|
88
|
-
color: props.errorColor,
|
|
89
|
-
},
|
|
90
|
-
'&.Mui-disabled': {
|
|
91
|
-
cursor: 'default',
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
}); });
|
|
95
|
-
};
|
|
96
|
-
var useDatePickerLabelStyles = function (props) {
|
|
97
|
-
return makeStyles(function () { return ({
|
|
98
|
-
root: {
|
|
99
|
-
marginTop: '-4px',
|
|
100
|
-
fontSize: props.fontSize,
|
|
101
|
-
'&.Mui-focused': {
|
|
102
|
-
color: props.focusColor,
|
|
103
|
-
},
|
|
104
|
-
'&.EF-MuiInputLabel-shrink': {
|
|
105
|
-
marginTop: '0px',
|
|
106
|
-
fontSize: props.shrunkenFontSize,
|
|
107
|
-
},
|
|
108
|
-
'& .Mui-error': {
|
|
109
|
-
color: props.errorColor,
|
|
110
|
-
},
|
|
111
|
-
'&.Mui-error': {
|
|
112
|
-
color: props.errorColor,
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
}); });
|
|
116
|
-
};
|
|
117
|
-
var useDatePickerHelperTextStyles = function (props) {
|
|
118
|
-
return makeStyles(function () { return ({
|
|
119
|
-
root: {
|
|
120
|
-
'&.Mui-error': {
|
|
121
|
-
color: props.errorColor,
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
}); });
|
|
125
|
-
};
|
|
126
|
-
var useDatePickerDialogStyles = function (props) {
|
|
127
|
-
return makeStyles(function () { return ({
|
|
128
|
-
datePicker: {
|
|
129
|
-
'& .EF-MuiPickersModal-dialogRoot': {
|
|
130
|
-
color: props.textColor,
|
|
131
|
-
'& .EF-MuiDialogActions-root': {
|
|
132
|
-
'& .EF-MuiButton-root:hover': {
|
|
133
|
-
backgroundColor: props.hoverColor,
|
|
134
|
-
},
|
|
135
|
-
'& .EF-MuiButton-label': {
|
|
136
|
-
color: props.focusColor,
|
|
137
|
-
},
|
|
138
|
-
'& .EF-MuiTouchRipple-root': {
|
|
139
|
-
color: props.focusColor,
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
//Days labels
|
|
144
|
-
'& .EF-MuiPickersDay-day': {
|
|
145
|
-
color: props.textColor,
|
|
146
|
-
},
|
|
147
|
-
// Selected day label
|
|
148
|
-
'& .EF-MuiPickersDay-daySelected': {
|
|
149
|
-
color: props.backgroundColor,
|
|
150
|
-
backgroundColor: props.focusColor,
|
|
151
|
-
},
|
|
152
|
-
//Title
|
|
153
|
-
'& .EF-MuiPickersDatePickerRoot-toolbar': {
|
|
154
|
-
color: props.backgroundColor,
|
|
155
|
-
backgroundColor: props.focusColor,
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
}); });
|
|
159
|
-
};
|
|
160
|
-
function CustomDatePicker(_a) {
|
|
161
|
-
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.outlineColor, outlineColor = _c === void 0 ? '#0000003b' : _c, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? 'white' : _d, innerBackgroundColor = _a.innerBackgroundColor, _e = _a.textColor, textColor = _e === void 0 ? '#293241' : _e, _f = _a.errorColor, errorColor = _f === void 0 ? '#cc2936' : _f, _g = _a.borderRadius, borderRadius = _g === void 0 ? 10 : _g, _h = _a.padding, padding = _h === void 0 ? '6px 12px' : _h, _j = _a.fontSize, fontSize = _j === void 0 ? '1rem' : _j, _k = _a.shrunkenFontSize, shrunkenFontSize = _k === void 0 ? '1rem' : _k, _l = _a.fontWeight, fontWeight = _l === void 0 ? '300' : _l, _m = _a.showIcon, showIcon = _m === void 0 ? true : _m, _o = _a.cantEdit, cantEdit = _o === void 0 ? false : _o, required = _a.required, others = __rest(_a, ["focusColor", "outlineColor", "backgroundColor", "innerBackgroundColor", "textColor", "errorColor", "borderRadius", "padding", "fontSize", "shrunkenFontSize", "fontWeight", "showIcon", "cantEdit", "required"]);
|
|
162
|
-
var classes = useDatePickerStyles({
|
|
163
|
-
padding: padding,
|
|
164
|
-
cantEdit: cantEdit,
|
|
165
|
-
textColor: textColor,
|
|
166
|
-
focusColor: focusColor,
|
|
167
|
-
hoverColor: focusColor + '0a',
|
|
168
|
-
outlineColor: outlineColor,
|
|
169
|
-
errorColor: errorColor,
|
|
170
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
171
|
-
backgroundColor: backgroundColor,
|
|
172
|
-
borderRadius: borderRadius,
|
|
173
|
-
fontSize: fontSize,
|
|
174
|
-
shrunkenFontSize: shrunkenFontSize,
|
|
175
|
-
fontWeight: fontWeight,
|
|
176
|
-
})();
|
|
177
|
-
var labelClasses = useDatePickerLabelStyles({
|
|
178
|
-
padding: padding,
|
|
179
|
-
cantEdit: cantEdit,
|
|
180
|
-
textColor: textColor,
|
|
181
|
-
focusColor: focusColor,
|
|
182
|
-
hoverColor: focusColor + '0a',
|
|
183
|
-
errorColor: errorColor,
|
|
184
|
-
outlineColor: outlineColor,
|
|
185
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
186
|
-
backgroundColor: backgroundColor,
|
|
187
|
-
borderRadius: borderRadius,
|
|
188
|
-
fontSize: fontSize,
|
|
189
|
-
shrunkenFontSize: shrunkenFontSize,
|
|
190
|
-
fontWeight: fontWeight,
|
|
191
|
-
})();
|
|
192
|
-
var datePicker = useDatePickerDialogStyles({
|
|
193
|
-
padding: padding,
|
|
194
|
-
cantEdit: cantEdit,
|
|
195
|
-
textColor: textColor,
|
|
196
|
-
focusColor: focusColor,
|
|
197
|
-
hoverColor: focusColor + '0a',
|
|
198
|
-
errorColor: errorColor,
|
|
199
|
-
outlineColor: outlineColor,
|
|
200
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
201
|
-
backgroundColor: backgroundColor,
|
|
202
|
-
borderRadius: borderRadius,
|
|
203
|
-
fontSize: fontSize,
|
|
204
|
-
shrunkenFontSize: shrunkenFontSize,
|
|
205
|
-
fontWeight: fontWeight,
|
|
206
|
-
})().datePicker;
|
|
207
|
-
var helperTextStyles = useDatePickerHelperTextStyles({
|
|
208
|
-
padding: padding,
|
|
209
|
-
textColor: textColor,
|
|
210
|
-
focusColor: focusColor,
|
|
211
|
-
errorColor: errorColor,
|
|
212
|
-
outlineColor: outlineColor,
|
|
213
|
-
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
214
|
-
backgroundColor: backgroundColor,
|
|
215
|
-
borderRadius: borderRadius,
|
|
216
|
-
fontSize: fontSize,
|
|
217
|
-
shrunkenFontSize: shrunkenFontSize,
|
|
218
|
-
fontWeight: fontWeight,
|
|
219
|
-
})();
|
|
220
|
-
return (_jsx(KeyboardDatePicker, __assign({}, others, { inputVariant: "outlined", size: "small", disabled: cantEdit, fullWidth: true, placeholder: "dd/MM/yyyy", format: "dd/MM/yyyy", required: required, keyboardIcon: showIcon ? (_jsx(CalendarTodayRoundedIcon, { fontSize: "inherit" }, void 0)) : null, InputLabelProps: { classes: labelClasses }, DialogProps: {
|
|
221
|
-
disableEnforceFocus: true,
|
|
222
|
-
className: datePicker,
|
|
223
|
-
cancelLabel: 'Cancelar',
|
|
224
|
-
} //Fixes the typescript declaration of the library: https://material-ui-pickers.dev/api/KeyboardDatePicker
|
|
225
|
-
, InputProps: {
|
|
226
|
-
required: required,
|
|
227
|
-
classes: classes,
|
|
228
|
-
disabled: cantEdit,
|
|
229
|
-
}, FormHelperTextProps: {
|
|
230
|
-
classes: helperTextStyles,
|
|
231
|
-
}, variant: "dialog" }), void 0));
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Generic datepicker with apps designs. Is class do to the use in the react-hook-forms library
|
|
235
|
-
*/
|
|
236
|
-
var RoundedDatePicker = /** @class */ (function (_super) {
|
|
237
|
-
__extends(RoundedDatePicker, _super);
|
|
238
|
-
function RoundedDatePicker() {
|
|
239
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
240
|
-
}
|
|
241
|
-
RoundedDatePicker.prototype.render = function () {
|
|
242
|
-
return _jsx(CustomDatePicker, __assign({}, this.props), void 0);
|
|
243
|
-
};
|
|
244
|
-
return RoundedDatePicker;
|
|
245
|
-
}(React.Component));
|
|
246
|
-
export default RoundedDatePicker;
|
|
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 } from "react/jsx-runtime";
|
|
39
|
+
import React from 'react';
|
|
40
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
41
|
+
import CalendarTodayRoundedIcon from '@material-ui/icons/CalendarTodayRounded';
|
|
42
|
+
import { KeyboardDatePicker, } from '@material-ui/pickers';
|
|
43
|
+
var useDatePickerStyles = function (props) {
|
|
44
|
+
return makeStyles(function () { return ({
|
|
45
|
+
root: {
|
|
46
|
+
borderRadius: props.borderRadius,
|
|
47
|
+
backgroundColor: props.backgroundColor,
|
|
48
|
+
'& input, textarea': {
|
|
49
|
+
cursor: props.cantEdit ? 'default' : 'text',
|
|
50
|
+
padding: props.padding,
|
|
51
|
+
fontWeight: props.fontWeight,
|
|
52
|
+
color: props.textColor,
|
|
53
|
+
fontSize: props.fontSize,
|
|
54
|
+
'&::placeholder': {
|
|
55
|
+
fontSize: props.fontSize,
|
|
56
|
+
},
|
|
57
|
+
backgroundColor: props.innerBackgroundColor,
|
|
58
|
+
borderRadius: props.borderRadius,
|
|
59
|
+
},
|
|
60
|
+
'& .EF-MuiOutlinedInput-notchedOutline': {
|
|
61
|
+
borderColor: props.outlineColor,
|
|
62
|
+
'& span': {
|
|
63
|
+
fontSize: props.shrunkenFontSize,
|
|
64
|
+
paddingRight: 0,
|
|
65
|
+
paddingLeft: 0,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
'&.Mui-error .EF-MuiOutlinedInput-notchedOutline': {
|
|
69
|
+
borderColor: props.outlineColor,
|
|
70
|
+
},
|
|
71
|
+
'&.Mui-focused .EF-MuiOutlinedInput-notchedOutline': {
|
|
72
|
+
borderColor: props.focusColor,
|
|
73
|
+
borderWidth: 2,
|
|
74
|
+
},
|
|
75
|
+
'&:hover .EF-MuiOutlinedInput-notchedOutline': {
|
|
76
|
+
borderColor: props.cantEdit
|
|
77
|
+
? props.outlineColor
|
|
78
|
+
: props.focusColor,
|
|
79
|
+
},
|
|
80
|
+
'& .EF-MuiInputAdornment-root': {
|
|
81
|
+
'& button': {
|
|
82
|
+
marginRight: -20,
|
|
83
|
+
fontSize: 18,
|
|
84
|
+
padding: 16,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
'& .Mui-error': {
|
|
88
|
+
color: props.errorColor,
|
|
89
|
+
},
|
|
90
|
+
'&.Mui-disabled': {
|
|
91
|
+
cursor: 'default',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
}); });
|
|
95
|
+
};
|
|
96
|
+
var useDatePickerLabelStyles = function (props) {
|
|
97
|
+
return makeStyles(function () { return ({
|
|
98
|
+
root: {
|
|
99
|
+
marginTop: '-4px',
|
|
100
|
+
fontSize: props.fontSize,
|
|
101
|
+
'&.Mui-focused': {
|
|
102
|
+
color: props.focusColor,
|
|
103
|
+
},
|
|
104
|
+
'&.EF-MuiInputLabel-shrink': {
|
|
105
|
+
marginTop: '0px',
|
|
106
|
+
fontSize: props.shrunkenFontSize,
|
|
107
|
+
},
|
|
108
|
+
'& .Mui-error': {
|
|
109
|
+
color: props.errorColor,
|
|
110
|
+
},
|
|
111
|
+
'&.Mui-error': {
|
|
112
|
+
color: props.errorColor,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
}); });
|
|
116
|
+
};
|
|
117
|
+
var useDatePickerHelperTextStyles = function (props) {
|
|
118
|
+
return makeStyles(function () { return ({
|
|
119
|
+
root: {
|
|
120
|
+
'&.Mui-error': {
|
|
121
|
+
color: props.errorColor,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
}); });
|
|
125
|
+
};
|
|
126
|
+
var useDatePickerDialogStyles = function (props) {
|
|
127
|
+
return makeStyles(function () { return ({
|
|
128
|
+
datePicker: {
|
|
129
|
+
'& .EF-MuiPickersModal-dialogRoot': {
|
|
130
|
+
color: props.textColor,
|
|
131
|
+
'& .EF-MuiDialogActions-root': {
|
|
132
|
+
'& .EF-MuiButton-root:hover': {
|
|
133
|
+
backgroundColor: props.hoverColor,
|
|
134
|
+
},
|
|
135
|
+
'& .EF-MuiButton-label': {
|
|
136
|
+
color: props.focusColor,
|
|
137
|
+
},
|
|
138
|
+
'& .EF-MuiTouchRipple-root': {
|
|
139
|
+
color: props.focusColor,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
//Days labels
|
|
144
|
+
'& .EF-MuiPickersDay-day': {
|
|
145
|
+
color: props.textColor,
|
|
146
|
+
},
|
|
147
|
+
// Selected day label
|
|
148
|
+
'& .EF-MuiPickersDay-daySelected': {
|
|
149
|
+
color: props.backgroundColor,
|
|
150
|
+
backgroundColor: props.focusColor,
|
|
151
|
+
},
|
|
152
|
+
//Title
|
|
153
|
+
'& .EF-MuiPickersDatePickerRoot-toolbar': {
|
|
154
|
+
color: props.backgroundColor,
|
|
155
|
+
backgroundColor: props.focusColor,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
}); });
|
|
159
|
+
};
|
|
160
|
+
function CustomDatePicker(_a) {
|
|
161
|
+
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.outlineColor, outlineColor = _c === void 0 ? '#0000003b' : _c, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? 'white' : _d, innerBackgroundColor = _a.innerBackgroundColor, _e = _a.textColor, textColor = _e === void 0 ? '#293241' : _e, _f = _a.errorColor, errorColor = _f === void 0 ? '#cc2936' : _f, _g = _a.borderRadius, borderRadius = _g === void 0 ? 10 : _g, _h = _a.padding, padding = _h === void 0 ? '6px 12px' : _h, _j = _a.fontSize, fontSize = _j === void 0 ? '1rem' : _j, _k = _a.shrunkenFontSize, shrunkenFontSize = _k === void 0 ? '1rem' : _k, _l = _a.fontWeight, fontWeight = _l === void 0 ? '300' : _l, _m = _a.showIcon, showIcon = _m === void 0 ? true : _m, _o = _a.cantEdit, cantEdit = _o === void 0 ? false : _o, required = _a.required, others = __rest(_a, ["focusColor", "outlineColor", "backgroundColor", "innerBackgroundColor", "textColor", "errorColor", "borderRadius", "padding", "fontSize", "shrunkenFontSize", "fontWeight", "showIcon", "cantEdit", "required"]);
|
|
162
|
+
var classes = useDatePickerStyles({
|
|
163
|
+
padding: padding,
|
|
164
|
+
cantEdit: cantEdit,
|
|
165
|
+
textColor: textColor,
|
|
166
|
+
focusColor: focusColor,
|
|
167
|
+
hoverColor: focusColor + '0a',
|
|
168
|
+
outlineColor: outlineColor,
|
|
169
|
+
errorColor: errorColor,
|
|
170
|
+
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
171
|
+
backgroundColor: backgroundColor,
|
|
172
|
+
borderRadius: borderRadius,
|
|
173
|
+
fontSize: fontSize,
|
|
174
|
+
shrunkenFontSize: shrunkenFontSize,
|
|
175
|
+
fontWeight: fontWeight,
|
|
176
|
+
})();
|
|
177
|
+
var labelClasses = useDatePickerLabelStyles({
|
|
178
|
+
padding: padding,
|
|
179
|
+
cantEdit: cantEdit,
|
|
180
|
+
textColor: textColor,
|
|
181
|
+
focusColor: focusColor,
|
|
182
|
+
hoverColor: focusColor + '0a',
|
|
183
|
+
errorColor: errorColor,
|
|
184
|
+
outlineColor: outlineColor,
|
|
185
|
+
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
186
|
+
backgroundColor: backgroundColor,
|
|
187
|
+
borderRadius: borderRadius,
|
|
188
|
+
fontSize: fontSize,
|
|
189
|
+
shrunkenFontSize: shrunkenFontSize,
|
|
190
|
+
fontWeight: fontWeight,
|
|
191
|
+
})();
|
|
192
|
+
var datePicker = useDatePickerDialogStyles({
|
|
193
|
+
padding: padding,
|
|
194
|
+
cantEdit: cantEdit,
|
|
195
|
+
textColor: textColor,
|
|
196
|
+
focusColor: focusColor,
|
|
197
|
+
hoverColor: focusColor + '0a',
|
|
198
|
+
errorColor: errorColor,
|
|
199
|
+
outlineColor: outlineColor,
|
|
200
|
+
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
201
|
+
backgroundColor: backgroundColor,
|
|
202
|
+
borderRadius: borderRadius,
|
|
203
|
+
fontSize: fontSize,
|
|
204
|
+
shrunkenFontSize: shrunkenFontSize,
|
|
205
|
+
fontWeight: fontWeight,
|
|
206
|
+
})().datePicker;
|
|
207
|
+
var helperTextStyles = useDatePickerHelperTextStyles({
|
|
208
|
+
padding: padding,
|
|
209
|
+
textColor: textColor,
|
|
210
|
+
focusColor: focusColor,
|
|
211
|
+
errorColor: errorColor,
|
|
212
|
+
outlineColor: outlineColor,
|
|
213
|
+
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
214
|
+
backgroundColor: backgroundColor,
|
|
215
|
+
borderRadius: borderRadius,
|
|
216
|
+
fontSize: fontSize,
|
|
217
|
+
shrunkenFontSize: shrunkenFontSize,
|
|
218
|
+
fontWeight: fontWeight,
|
|
219
|
+
})();
|
|
220
|
+
return (_jsx(KeyboardDatePicker, __assign({}, others, { inputVariant: "outlined", size: "small", disabled: cantEdit, fullWidth: true, placeholder: "dd/MM/yyyy", format: "dd/MM/yyyy", required: required, keyboardIcon: showIcon ? (_jsx(CalendarTodayRoundedIcon, { fontSize: "inherit" }, void 0)) : null, InputLabelProps: { classes: labelClasses }, DialogProps: {
|
|
221
|
+
disableEnforceFocus: true,
|
|
222
|
+
className: datePicker,
|
|
223
|
+
cancelLabel: 'Cancelar',
|
|
224
|
+
} //Fixes the typescript declaration of the library: https://material-ui-pickers.dev/api/KeyboardDatePicker
|
|
225
|
+
, InputProps: {
|
|
226
|
+
required: required,
|
|
227
|
+
classes: classes,
|
|
228
|
+
disabled: cantEdit,
|
|
229
|
+
}, FormHelperTextProps: {
|
|
230
|
+
classes: helperTextStyles,
|
|
231
|
+
}, variant: "dialog" }), void 0));
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Generic datepicker with apps designs. Is class do to the use in the react-hook-forms library
|
|
235
|
+
*/
|
|
236
|
+
var RoundedDatePicker = /** @class */ (function (_super) {
|
|
237
|
+
__extends(RoundedDatePicker, _super);
|
|
238
|
+
function RoundedDatePicker() {
|
|
239
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
240
|
+
}
|
|
241
|
+
RoundedDatePicker.prototype.render = function () {
|
|
242
|
+
return _jsx(CustomDatePicker, __assign({}, this.props), void 0);
|
|
243
|
+
};
|
|
244
|
+
return RoundedDatePicker;
|
|
245
|
+
}(React.Component));
|
|
246
|
+
export default RoundedDatePicker;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SelectProps } from '@material-ui/core/Select';
|
|
3
|
-
interface RoundedSelectProps extends Omit<SelectProps, 'color'> {
|
|
4
|
-
/** children to display in the options */
|
|
5
|
-
children?: any;
|
|
6
|
-
/** Currently selected value */
|
|
7
|
-
value: any;
|
|
8
|
-
/** function called when value changes */
|
|
9
|
-
handleUpdate: (event: React.ChangeEvent<{
|
|
10
|
-
name?: string | undefined;
|
|
11
|
-
value: any;
|
|
12
|
-
}>, child?: React.ReactNode) => void;
|
|
13
|
-
/** The hight of the container */
|
|
14
|
-
height?: string;
|
|
15
|
-
/** Strig to place in the label */
|
|
16
|
-
label: string;
|
|
17
|
-
/** Minimum width in px of the component */
|
|
18
|
-
minWidth?: number;
|
|
19
|
-
/** The color of the outline when selected and hovered on */
|
|
20
|
-
focusColor?: string;
|
|
21
|
-
/** The color of the error to display */
|
|
22
|
-
errorColor?: string;
|
|
23
|
-
/** the color of the text */
|
|
24
|
-
color?: string;
|
|
25
|
-
/** The color of the outline when it is not selected */
|
|
26
|
-
outlineColor?: string;
|
|
27
|
-
/** If outline should be error color */
|
|
28
|
-
highlightError?: boolean;
|
|
29
|
-
/** The helper Text to display */
|
|
30
|
-
helperText?: string;
|
|
31
|
-
/** If the selector cant be opened, diabled but with same style */
|
|
32
|
-
cantEdit?: boolean;
|
|
33
|
-
/** the margin around the selector */
|
|
34
|
-
containerMargin?: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
|
|
38
|
-
*/
|
|
39
|
-
declare class RoundedSelect extends React.Component<RoundedSelectProps> {
|
|
40
|
-
render(): JSX.Element;
|
|
41
|
-
}
|
|
42
|
-
export default RoundedSelect;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from '@material-ui/core/Select';
|
|
3
|
+
interface RoundedSelectProps extends Omit<SelectProps, 'color'> {
|
|
4
|
+
/** children to display in the options */
|
|
5
|
+
children?: any;
|
|
6
|
+
/** Currently selected value */
|
|
7
|
+
value: any;
|
|
8
|
+
/** function called when value changes */
|
|
9
|
+
handleUpdate: (event: React.ChangeEvent<{
|
|
10
|
+
name?: string | undefined;
|
|
11
|
+
value: any;
|
|
12
|
+
}>, child?: React.ReactNode) => void;
|
|
13
|
+
/** The hight of the container */
|
|
14
|
+
height?: string;
|
|
15
|
+
/** Strig to place in the label */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Minimum width in px of the component */
|
|
18
|
+
minWidth?: number;
|
|
19
|
+
/** The color of the outline when selected and hovered on */
|
|
20
|
+
focusColor?: string;
|
|
21
|
+
/** The color of the error to display */
|
|
22
|
+
errorColor?: string;
|
|
23
|
+
/** the color of the text */
|
|
24
|
+
color?: string;
|
|
25
|
+
/** The color of the outline when it is not selected */
|
|
26
|
+
outlineColor?: string;
|
|
27
|
+
/** If outline should be error color */
|
|
28
|
+
highlightError?: boolean;
|
|
29
|
+
/** The helper Text to display */
|
|
30
|
+
helperText?: string;
|
|
31
|
+
/** If the selector cant be opened, diabled but with same style */
|
|
32
|
+
cantEdit?: boolean;
|
|
33
|
+
/** the margin around the selector */
|
|
34
|
+
containerMargin?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
|
|
38
|
+
*/
|
|
39
|
+
declare class RoundedSelect extends React.Component<RoundedSelectProps> {
|
|
40
|
+
render(): JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
export default RoundedSelect;
|