@arquimedes.co/eureka-forms 1.9.19-test → 1.9.20-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +205 -98
- package/dist/AxiosAPI.js +3 -3
- package/dist/AxiosWidget.js +4 -4
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +207 -104
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +17 -5
- package/dist/FormComponents/Form/Form.js +56 -29
- package/dist/FormComponents/Form/StepperForm/StepperForm.js +1 -1
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +30 -7
- package/dist/FormComponents/Section/Section.js +13 -2
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +13 -2
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +32 -9
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +64 -47
- package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +102 -41
- package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +92 -37
- package/dist/FormComponents/Step/AYFStepMapper.js +75 -23
- package/dist/FormComponents/Step/CBRStepMapper.js +144 -56
- package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +26 -3
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +21 -6
- package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +26 -3
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +65 -32
- package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +13 -2
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +21 -6
- package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +13 -2
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +88 -27
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +171 -81
- package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.js +41 -15
- package/dist/FormComponents/Step/RatingStep/RatingStep.js +13 -2
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +52 -25
- package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +26 -3
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -1
- package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +26 -3
- package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +145 -83
- package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +13 -2
- package/dist/FormComponents/Step/Step.js +39 -19
- package/dist/FormComponents/Step/StepFunctions.js +16 -14
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +62 -43
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +13 -2
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +21 -6
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +13 -2
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +15 -3
- package/dist/FormComponents/Step/TitleStep/TitleStep.js +26 -3
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +35 -19
- package/dist/FormComponents/Term/Term.js +13 -2
- package/dist/Widget.js +25 -13
- package/dist/constants/Files/FileExtensions.js +3 -3
- package/dist/constants/Files/FileMaxSize.js +1 -1
- package/dist/constants/InternalFormStyle.js +1 -1
- package/dist/constants/MaterialClassNameSeed.js +1 -1
- package/dist/controllers/FileService.js +86 -29
- package/dist/index.js +15 -4
- package/dist/shared/Loader/Loader.js +17 -5
- package/dist/shared/Navbar/Navbar.js +14 -2
- package/dist/shared/Rating/Rating.js +27 -4
- package/dist/shared/Rating/Ratings/LikeRating.js +21 -9
- package/dist/shared/Rating/Ratings/SatisfactionRating.js +27 -15
- package/dist/shared/Rating/Ratings/ScaleRating.js +49 -22
- package/dist/shared/RoundedButton/RoundedButton.js +24 -12
- package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +84 -39
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +286 -235
- package/dist/shared/RoundedSelect/RoundedSelect.js +152 -103
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +160 -125
- package/dist/shared/RoundedTextField/RoundedTextField.js +137 -92
- package/dist/utils/CbrFunctions.js +30 -30
- package/package.json +1 -3
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
28
|
+
var t = {};
|
|
29
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
30
|
+
t[p] = s[p];
|
|
31
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
32
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
33
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
34
|
+
t[p[i]] = s[p[i]];
|
|
35
|
+
}
|
|
36
|
+
return t;
|
|
37
|
+
};
|
|
1
38
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
39
|
import React, { cloneElement } from 'react';
|
|
3
40
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -5,249 +42,258 @@ import CalendarTodayRoundedIcon from '@material-ui/icons/CalendarTodayRounded';
|
|
|
5
42
|
import { DatePicker, DateTimePicker, } from '@material-ui/pickers';
|
|
6
43
|
import { getLocale } from '../../FormComponents/Form/Form';
|
|
7
44
|
import { format } from 'date-fns';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
height: props.height,
|
|
14
|
-
'& input, textarea': {
|
|
45
|
+
var useDatePickerStyles = function (props) {
|
|
46
|
+
return makeStyles(function () { return ({
|
|
47
|
+
root: {
|
|
48
|
+
borderRadius: props.borderRadius,
|
|
49
|
+
backgroundColor: props.backgroundColor,
|
|
15
50
|
cursor: props.cantEdit ? 'default' : 'pointer',
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
51
|
+
height: props.height,
|
|
52
|
+
'& input, textarea': {
|
|
53
|
+
cursor: props.cantEdit ? 'default' : 'pointer',
|
|
54
|
+
padding: props.padding,
|
|
55
|
+
fontWeight: props.fontWeight,
|
|
56
|
+
color: props.textColor,
|
|
21
57
|
fontSize: props.fontSize,
|
|
58
|
+
'&::placeholder': {
|
|
59
|
+
fontSize: props.fontSize,
|
|
60
|
+
},
|
|
61
|
+
backgroundColor: props.innerBackgroundColor,
|
|
62
|
+
borderRadius: props.borderRadius,
|
|
22
63
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'& span': {
|
|
29
|
-
fontSize: '0.75rem',
|
|
64
|
+
'& .EF-MuiOutlinedInput-notchedOutline': {
|
|
65
|
+
borderColor: props.outlineColor,
|
|
66
|
+
'& span': {
|
|
67
|
+
fontSize: '0.75rem',
|
|
68
|
+
},
|
|
30
69
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
borderColor: props.outlineColor,
|
|
34
|
-
},
|
|
35
|
-
'&.Mui-focused .EF-MuiOutlinedInput-notchedOutline': {
|
|
36
|
-
borderColor: props.focusColor,
|
|
37
|
-
borderWidth: 2,
|
|
38
|
-
},
|
|
39
|
-
'&:hover .EF-MuiOutlinedInput-notchedOutline': {
|
|
40
|
-
borderColor: props.cantEdit
|
|
41
|
-
? props.outlineColor
|
|
42
|
-
: props.focusColor,
|
|
43
|
-
},
|
|
44
|
-
'& .EF-MuiInputAdornment-root': {
|
|
45
|
-
width: 5,
|
|
46
|
-
'& button': {
|
|
47
|
-
marginLeft: -25,
|
|
48
|
-
fontSize: 18,
|
|
49
|
-
padding: 16,
|
|
70
|
+
'&.Mui-error .EF-MuiOutlinedInput-notchedOutline': {
|
|
71
|
+
borderColor: props.outlineColor,
|
|
50
72
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
overflow: 'hidden',
|
|
67
|
-
maxWidth: 'calc(100% - 50px)',
|
|
68
|
-
marginTop: props.height != '40px' ? '-4px' : '0px',
|
|
69
|
-
textOverflow: 'ellipsis',
|
|
70
|
-
fontSize: props.fontSize,
|
|
71
|
-
'&.Mui-focused': {
|
|
72
|
-
color: props.focusColor,
|
|
73
|
-
},
|
|
74
|
-
'&.EF-MuiInputLabel-shrink': {
|
|
75
|
-
marginTop: '0px',
|
|
76
|
-
maxWidth: 'calc(100% - 5px)',
|
|
77
|
-
},
|
|
78
|
-
'& .Mui-error': {
|
|
79
|
-
color: props.errorColor,
|
|
80
|
-
},
|
|
81
|
-
'&.Mui-error': {
|
|
82
|
-
color: props.errorColor,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
}));
|
|
86
|
-
const useDatePickerHelperTextStyles = (props) => makeStyles(() => ({
|
|
87
|
-
root: {
|
|
88
|
-
color: props.helperTextColor,
|
|
89
|
-
'&.Mui-error': {
|
|
90
|
-
color: props.errorColor,
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
}));
|
|
94
|
-
const useDatePickerDialogStyles = (props) => makeStyles(() => ({
|
|
95
|
-
datePicker: {
|
|
96
|
-
'& .EF-MuiPickersModal-dialogRoot': {
|
|
97
|
-
color: props.textColor,
|
|
98
|
-
'& .EF-MuiDialogActions-root': {
|
|
99
|
-
'& .EF-MuiButton-root:hover': {
|
|
100
|
-
backgroundColor: props.hoverColor,
|
|
101
|
-
},
|
|
102
|
-
'& .EF-MuiButton-label': {
|
|
103
|
-
color: props.focusColor,
|
|
104
|
-
},
|
|
105
|
-
'& .EF-MuiTouchRipple-root': {
|
|
106
|
-
color: props.focusColor,
|
|
73
|
+
'&.Mui-focused .EF-MuiOutlinedInput-notchedOutline': {
|
|
74
|
+
borderColor: props.focusColor,
|
|
75
|
+
borderWidth: 2,
|
|
76
|
+
},
|
|
77
|
+
'&:hover .EF-MuiOutlinedInput-notchedOutline': {
|
|
78
|
+
borderColor: props.cantEdit
|
|
79
|
+
? props.outlineColor
|
|
80
|
+
: props.focusColor,
|
|
81
|
+
},
|
|
82
|
+
'& .EF-MuiInputAdornment-root': {
|
|
83
|
+
width: 5,
|
|
84
|
+
'& button': {
|
|
85
|
+
marginLeft: -25,
|
|
86
|
+
fontSize: 18,
|
|
87
|
+
padding: 16,
|
|
107
88
|
},
|
|
108
89
|
},
|
|
90
|
+
'&.Erk-MuiOutlinedInput-adornedEnd': {
|
|
91
|
+
paddingRight: 11,
|
|
92
|
+
},
|
|
93
|
+
'& .Mui-error': {
|
|
94
|
+
color: props.errorColor,
|
|
95
|
+
},
|
|
96
|
+
'&.Mui-disabled': {
|
|
97
|
+
cursor: 'default',
|
|
98
|
+
},
|
|
109
99
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
color: props.focusColor,
|
|
135
|
-
},
|
|
136
|
-
'& .EF-MuiTabs-indicator': {
|
|
137
|
-
backgroundColor: props.contrastColor,
|
|
138
|
-
},
|
|
139
|
-
'& .EF-MuiPickersClockNumber-clockNumber': {
|
|
140
|
-
color: props.accentColor,
|
|
141
|
-
},
|
|
142
|
-
'& .EF-MuiPickersClockNumber-clockNumberSelected': {
|
|
143
|
-
color: props.backgroundColor,
|
|
144
|
-
},
|
|
145
|
-
'& .EF-MuiPickersClock-pin, .EF-MuiPickersClockPointer-pointer': {
|
|
146
|
-
backgroundColor: props.focusColor,
|
|
147
|
-
},
|
|
148
|
-
'& .EF-MuiPickersClockPointer-noPoint': {
|
|
149
|
-
backgroundColor: props.focusColor,
|
|
150
|
-
},
|
|
151
|
-
'& .EF-MuiPickersClockPointer-thumb': {
|
|
152
|
-
borderColor: props.focusColor,
|
|
153
|
-
},
|
|
154
|
-
'& .EF-MuiPickersDay-dayDisabled': {
|
|
155
|
-
color: 'rgba(0, 0, 0, 0.38)',
|
|
156
|
-
pointerEvents: 'all',
|
|
157
|
-
},
|
|
158
|
-
'& .EF-MuiPickersDay-current': {
|
|
159
|
-
color: props.backgroundColor,
|
|
160
|
-
backgroundColor: props.secondaryColor,
|
|
100
|
+
}); });
|
|
101
|
+
};
|
|
102
|
+
var useDatePickerLabelStyles = function (props) {
|
|
103
|
+
return makeStyles(function () { return ({
|
|
104
|
+
root: {
|
|
105
|
+
whiteSpace: 'nowrap',
|
|
106
|
+
overflow: 'hidden',
|
|
107
|
+
maxWidth: 'calc(100% - 50px)',
|
|
108
|
+
marginTop: props.height != '40px' ? '-4px' : '0px',
|
|
109
|
+
textOverflow: 'ellipsis',
|
|
110
|
+
fontSize: props.fontSize,
|
|
111
|
+
'&.Mui-focused': {
|
|
112
|
+
color: props.focusColor,
|
|
113
|
+
},
|
|
114
|
+
'&.EF-MuiInputLabel-shrink': {
|
|
115
|
+
marginTop: '0px',
|
|
116
|
+
maxWidth: 'calc(100% - 5px)',
|
|
117
|
+
},
|
|
118
|
+
'& .Mui-error': {
|
|
119
|
+
color: props.errorColor,
|
|
120
|
+
},
|
|
121
|
+
'&.Mui-error': {
|
|
122
|
+
color: props.errorColor,
|
|
123
|
+
},
|
|
161
124
|
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
125
|
+
}); });
|
|
126
|
+
};
|
|
127
|
+
var useDatePickerHelperTextStyles = function (props) {
|
|
128
|
+
return makeStyles(function () { return ({
|
|
129
|
+
root: {
|
|
130
|
+
color: props.helperTextColor,
|
|
131
|
+
'&.Mui-error': {
|
|
132
|
+
color: props.errorColor,
|
|
133
|
+
},
|
|
165
134
|
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
135
|
+
}); });
|
|
136
|
+
};
|
|
137
|
+
var useDatePickerDialogStyles = function (props) {
|
|
138
|
+
return makeStyles(function () { return ({
|
|
139
|
+
datePicker: {
|
|
140
|
+
'& .EF-MuiPickersModal-dialogRoot': {
|
|
141
|
+
color: props.textColor,
|
|
142
|
+
'& .EF-MuiDialogActions-root': {
|
|
143
|
+
'& .EF-MuiButton-root:hover': {
|
|
144
|
+
backgroundColor: props.hoverColor,
|
|
145
|
+
},
|
|
146
|
+
'& .EF-MuiButton-label': {
|
|
147
|
+
color: props.focusColor,
|
|
148
|
+
},
|
|
149
|
+
'& .EF-MuiTouchRipple-root': {
|
|
150
|
+
color: props.focusColor,
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
//Days labels
|
|
155
|
+
'& .EF-MuiPickersDay-day': {
|
|
156
|
+
color: props.textColor,
|
|
157
|
+
},
|
|
158
|
+
// Selected day label
|
|
159
|
+
'& .EF-MuiPickersDay-daySelected': {
|
|
160
|
+
color: props.backgroundColor,
|
|
161
|
+
backgroundColor: props.focusColor,
|
|
162
|
+
},
|
|
163
|
+
//Title
|
|
164
|
+
'& .EF-MuiPickersDatePickerRoot-toolbar': {
|
|
165
|
+
color: props.backgroundColor,
|
|
166
|
+
backgroundColor: props.focusColor,
|
|
167
|
+
},
|
|
168
|
+
//Title
|
|
169
|
+
'& .EF-MuiPickersToolbar-toolbar': {
|
|
170
|
+
color: props.backgroundColor,
|
|
171
|
+
backgroundColor: props.focusColor,
|
|
172
|
+
},
|
|
173
|
+
'& .EF-MuiPickerDTTabs-tabs': {
|
|
174
|
+
color: props.backgroundColor,
|
|
175
|
+
backgroundColor: props.focusColor,
|
|
176
|
+
},
|
|
177
|
+
'& .EF-MuiPickersYear-yearSelected, .EF-MuiPickersYear-root:focus': {
|
|
178
|
+
color: props.focusColor,
|
|
179
|
+
},
|
|
180
|
+
'& .EF-MuiTabs-indicator': {
|
|
181
|
+
backgroundColor: props.contrastColor,
|
|
182
|
+
},
|
|
183
|
+
'& .EF-MuiPickersClockNumber-clockNumber': {
|
|
184
|
+
color: props.accentColor,
|
|
185
|
+
},
|
|
186
|
+
'& .EF-MuiPickersClockNumber-clockNumberSelected': {
|
|
187
|
+
color: props.backgroundColor,
|
|
188
|
+
},
|
|
189
|
+
'& .EF-MuiPickersClock-pin, .EF-MuiPickersClockPointer-pointer': {
|
|
190
|
+
backgroundColor: props.focusColor,
|
|
191
|
+
},
|
|
192
|
+
'& .EF-MuiPickersClockPointer-noPoint': {
|
|
193
|
+
backgroundColor: props.focusColor,
|
|
194
|
+
},
|
|
195
|
+
'& .EF-MuiPickersClockPointer-thumb': {
|
|
196
|
+
borderColor: props.focusColor,
|
|
197
|
+
},
|
|
198
|
+
'& .EF-MuiPickersDay-dayDisabled': {
|
|
199
|
+
color: 'rgba(0, 0, 0, 0.38)',
|
|
200
|
+
pointerEvents: 'all',
|
|
201
|
+
},
|
|
202
|
+
'& .EF-MuiPickersDay-current': {
|
|
203
|
+
color: props.backgroundColor,
|
|
204
|
+
backgroundColor: props.secondaryColor,
|
|
205
|
+
},
|
|
206
|
+
'& .EF-MuiPickersDay-hidden': {
|
|
207
|
+
opacity: 0.4,
|
|
208
|
+
pointerEvents: 'none',
|
|
209
|
+
},
|
|
210
|
+
'& .EF-MuiPickersDay-hidden.EF-MuiPickersDay-current': {
|
|
211
|
+
opacity: 0.8,
|
|
212
|
+
pointerEvents: 'none',
|
|
213
|
+
},
|
|
169
214
|
},
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function CustomDatePicker(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
215
|
+
}); });
|
|
216
|
+
};
|
|
217
|
+
function CustomDatePicker(_a) {
|
|
218
|
+
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.secondaryColor, secondaryColor = _c === void 0 ? '#98c1d9' : _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.contrastColor, contrastColor = _g === void 0 ? '#ee6c4d' : _g, _h = _a.accentColor, accentColor = _h === void 0 ? '#293241' : _h, _j = _a.errorColor, errorColor = _j === void 0 ? '#cc2936' : _j, _k = _a.borderRadius, borderRadius = _k === void 0 ? 10 : _k, _l = _a.padding, padding = _l === void 0 ? '6px 0px 6px 12px' : _l, _m = _a.fontSize, fontSize = _m === void 0 ? '1rem' : _m, _o = _a.shrunkenFontSize, shrunkenFontSize = _o === void 0 ? '1rem' : _o, _p = _a.helperTextColor, helperTextColor = _p === void 0 ? '#989898' : _p, _q = _a.fontWeight, fontWeight = _q === void 0 ? '300' : _q, _r = _a.height, height = _r === void 0 ? '31px' : _r, _s = _a.cantEdit, cantEdit = _s === void 0 ? false : _s, _t = _a.pickTime, pickTime = _t === void 0 ? false : _t, onChange = _a.onChange, required = _a.required, others = __rest(_a, ["focusColor", "secondaryColor", "outlineColor", "backgroundColor", "innerBackgroundColor", "textColor", "contrastColor", "accentColor", "errorColor", "borderRadius", "padding", "fontSize", "shrunkenFontSize", "helperTextColor", "fontWeight", "height", "cantEdit", "pickTime", "onChange", "required"]);
|
|
219
|
+
var classes = useDatePickerStyles({
|
|
220
|
+
padding: padding,
|
|
221
|
+
cantEdit: cantEdit,
|
|
222
|
+
textColor: textColor,
|
|
223
|
+
focusColor: focusColor,
|
|
178
224
|
hoverColor: focusColor + '0a',
|
|
179
|
-
outlineColor,
|
|
180
|
-
errorColor,
|
|
181
|
-
innerBackgroundColor: innerBackgroundColor
|
|
182
|
-
backgroundColor,
|
|
183
|
-
borderRadius,
|
|
184
|
-
fontSize,
|
|
185
|
-
shrunkenFontSize,
|
|
186
|
-
fontWeight,
|
|
187
|
-
helperTextColor,
|
|
188
|
-
height,
|
|
225
|
+
outlineColor: outlineColor,
|
|
226
|
+
errorColor: errorColor,
|
|
227
|
+
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
228
|
+
backgroundColor: backgroundColor,
|
|
229
|
+
borderRadius: borderRadius,
|
|
230
|
+
fontSize: fontSize,
|
|
231
|
+
shrunkenFontSize: shrunkenFontSize,
|
|
232
|
+
fontWeight: fontWeight,
|
|
233
|
+
helperTextColor: helperTextColor,
|
|
234
|
+
height: height,
|
|
189
235
|
})();
|
|
190
|
-
|
|
191
|
-
padding,
|
|
192
|
-
cantEdit,
|
|
193
|
-
textColor,
|
|
194
|
-
focusColor,
|
|
236
|
+
var labelClasses = useDatePickerLabelStyles({
|
|
237
|
+
padding: padding,
|
|
238
|
+
cantEdit: cantEdit,
|
|
239
|
+
textColor: textColor,
|
|
240
|
+
focusColor: focusColor,
|
|
195
241
|
hoverColor: focusColor + '0a',
|
|
196
|
-
errorColor,
|
|
197
|
-
outlineColor,
|
|
198
|
-
innerBackgroundColor: innerBackgroundColor
|
|
199
|
-
backgroundColor,
|
|
200
|
-
borderRadius,
|
|
201
|
-
fontSize,
|
|
202
|
-
shrunkenFontSize,
|
|
203
|
-
fontWeight,
|
|
204
|
-
helperTextColor,
|
|
205
|
-
height,
|
|
242
|
+
errorColor: errorColor,
|
|
243
|
+
outlineColor: outlineColor,
|
|
244
|
+
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
245
|
+
backgroundColor: backgroundColor,
|
|
246
|
+
borderRadius: borderRadius,
|
|
247
|
+
fontSize: fontSize,
|
|
248
|
+
shrunkenFontSize: shrunkenFontSize,
|
|
249
|
+
fontWeight: fontWeight,
|
|
250
|
+
helperTextColor: helperTextColor,
|
|
251
|
+
height: height,
|
|
206
252
|
})();
|
|
207
|
-
|
|
208
|
-
padding,
|
|
209
|
-
cantEdit,
|
|
210
|
-
textColor,
|
|
211
|
-
secondaryColor,
|
|
212
|
-
accentColor,
|
|
213
|
-
contrastColor,
|
|
214
|
-
focusColor,
|
|
253
|
+
var datePicker = useDatePickerDialogStyles({
|
|
254
|
+
padding: padding,
|
|
255
|
+
cantEdit: cantEdit,
|
|
256
|
+
textColor: textColor,
|
|
257
|
+
secondaryColor: secondaryColor,
|
|
258
|
+
accentColor: accentColor,
|
|
259
|
+
contrastColor: contrastColor,
|
|
260
|
+
focusColor: focusColor,
|
|
215
261
|
hoverColor: focusColor + '0a',
|
|
216
|
-
errorColor,
|
|
217
|
-
outlineColor,
|
|
218
|
-
innerBackgroundColor: innerBackgroundColor
|
|
219
|
-
backgroundColor,
|
|
220
|
-
borderRadius,
|
|
221
|
-
fontSize,
|
|
222
|
-
shrunkenFontSize,
|
|
223
|
-
fontWeight,
|
|
224
|
-
helperTextColor,
|
|
225
|
-
height,
|
|
226
|
-
})();
|
|
227
|
-
|
|
228
|
-
padding,
|
|
229
|
-
textColor,
|
|
230
|
-
focusColor,
|
|
231
|
-
errorColor,
|
|
232
|
-
outlineColor,
|
|
233
|
-
innerBackgroundColor: innerBackgroundColor
|
|
234
|
-
backgroundColor,
|
|
235
|
-
borderRadius,
|
|
236
|
-
fontSize,
|
|
237
|
-
shrunkenFontSize,
|
|
238
|
-
fontWeight,
|
|
239
|
-
helperTextColor,
|
|
240
|
-
height,
|
|
262
|
+
errorColor: errorColor,
|
|
263
|
+
outlineColor: outlineColor,
|
|
264
|
+
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
265
|
+
backgroundColor: backgroundColor,
|
|
266
|
+
borderRadius: borderRadius,
|
|
267
|
+
fontSize: fontSize,
|
|
268
|
+
shrunkenFontSize: shrunkenFontSize,
|
|
269
|
+
fontWeight: fontWeight,
|
|
270
|
+
helperTextColor: helperTextColor,
|
|
271
|
+
height: height,
|
|
272
|
+
})().datePicker;
|
|
273
|
+
var helperTextStyles = useDatePickerHelperTextStyles({
|
|
274
|
+
padding: padding,
|
|
275
|
+
textColor: textColor,
|
|
276
|
+
focusColor: focusColor,
|
|
277
|
+
errorColor: errorColor,
|
|
278
|
+
outlineColor: outlineColor,
|
|
279
|
+
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
280
|
+
backgroundColor: backgroundColor,
|
|
281
|
+
borderRadius: borderRadius,
|
|
282
|
+
fontSize: fontSize,
|
|
283
|
+
shrunkenFontSize: shrunkenFontSize,
|
|
284
|
+
fontWeight: fontWeight,
|
|
285
|
+
helperTextColor: helperTextColor,
|
|
286
|
+
height: height,
|
|
241
287
|
})();
|
|
242
288
|
if (pickTime) {
|
|
243
|
-
return (_jsx(DateTimePicker, {
|
|
289
|
+
return (_jsx(DateTimePicker, __assign({}, others, { inputVariant: "outlined", size: "small", disabled: cantEdit, fullWidth: true, onChange: onChange, placeholder: format(new Date(), 'Pp', { locale: getLocale() }), format: "Pp", required: required, InputLabelProps: { classes: labelClasses }, DialogProps: {
|
|
244
290
|
disableEnforceFocus: true,
|
|
245
291
|
className: datePicker,
|
|
246
292
|
cancelLabel: '',
|
|
247
293
|
} //Fixes the typescript declaration of the library: https://material-ui-pickers.dev/api/KeyboardDatePicker
|
|
248
294
|
, InputProps: {
|
|
249
|
-
required,
|
|
250
|
-
classes,
|
|
295
|
+
required: required,
|
|
296
|
+
classes: classes,
|
|
251
297
|
disabled: cantEdit,
|
|
252
298
|
endAdornment: (_jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
253
299
|
color: '#757575',
|
|
@@ -255,24 +301,24 @@ function CustomDatePicker({ focusColor = '#3d5a7f', secondaryColor = '#98c1d9',
|
|
|
255
301
|
} })),
|
|
256
302
|
}, FormHelperTextProps: {
|
|
257
303
|
classes: helperTextStyles,
|
|
258
|
-
}, renderDay: (day, selectedDate, dayInCurrentMonth, dayComponent)
|
|
304
|
+
}, renderDay: function (day, selectedDate, dayInCurrentMonth, dayComponent) {
|
|
259
305
|
if (!day) {
|
|
260
306
|
return dayComponent;
|
|
261
307
|
}
|
|
262
|
-
return (_jsx("div", { onClick: ()
|
|
308
|
+
return (_jsx("div", __assign({ onClick: function () {
|
|
263
309
|
onChange(day);
|
|
264
|
-
}, children: cloneElement(dayComponent) }));
|
|
265
|
-
}, variant: "dialog" }));
|
|
310
|
+
} }, { children: cloneElement(dayComponent) })));
|
|
311
|
+
}, variant: "dialog" })));
|
|
266
312
|
}
|
|
267
313
|
else {
|
|
268
|
-
return (_jsx(DatePicker, {
|
|
314
|
+
return (_jsx(DatePicker, __assign({}, others, { inputVariant: "outlined", size: "small", disabled: cantEdit, fullWidth: true, onChange: onChange, placeholder: format(new Date(), 'P', { locale: getLocale() }), format: "P", required: required, InputLabelProps: { classes: labelClasses }, DialogProps: {
|
|
269
315
|
disableEnforceFocus: true,
|
|
270
316
|
className: datePicker,
|
|
271
317
|
cancelLabel: '',
|
|
272
318
|
} //Fixes the typescript declaration of the library: https://material-ui-pickers.dev/api/KeyboardDatePicker
|
|
273
319
|
, InputProps: {
|
|
274
|
-
required,
|
|
275
|
-
classes,
|
|
320
|
+
required: required,
|
|
321
|
+
classes: classes,
|
|
276
322
|
disabled: cantEdit,
|
|
277
323
|
endAdornment: (_jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
278
324
|
color: '#757575',
|
|
@@ -280,22 +326,27 @@ function CustomDatePicker({ focusColor = '#3d5a7f', secondaryColor = '#98c1d9',
|
|
|
280
326
|
} })),
|
|
281
327
|
}, FormHelperTextProps: {
|
|
282
328
|
classes: helperTextStyles,
|
|
283
|
-
}, renderDay: (day, selectedDate, dayInCurrentMonth, dayComponent)
|
|
329
|
+
}, renderDay: function (day, selectedDate, dayInCurrentMonth, dayComponent) {
|
|
284
330
|
if (!day) {
|
|
285
331
|
return dayComponent;
|
|
286
332
|
}
|
|
287
|
-
return (_jsx("div", { onClick: ()
|
|
333
|
+
return (_jsx("div", __assign({ onClick: function () {
|
|
288
334
|
onChange(day);
|
|
289
|
-
}, children: cloneElement(dayComponent) }));
|
|
290
|
-
}, variant: "dialog" }));
|
|
335
|
+
} }, { children: cloneElement(dayComponent) })));
|
|
336
|
+
}, variant: "dialog" })));
|
|
291
337
|
}
|
|
292
338
|
}
|
|
293
339
|
/**
|
|
294
340
|
* Generic datepicker with apps designs. Is class do to the use in the react-hook-forms library
|
|
295
341
|
*/
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
342
|
+
var RoundedDatePicker = /** @class */ (function (_super) {
|
|
343
|
+
__extends(RoundedDatePicker, _super);
|
|
344
|
+
function RoundedDatePicker() {
|
|
345
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
299
346
|
}
|
|
300
|
-
|
|
347
|
+
RoundedDatePicker.prototype.render = function () {
|
|
348
|
+
return _jsx(CustomDatePicker, __assign({}, this.props));
|
|
349
|
+
};
|
|
350
|
+
return RoundedDatePicker;
|
|
351
|
+
}(React.Component));
|
|
301
352
|
export default RoundedDatePicker;
|