@arquimedes.co/eureka-forms 1.9.16-test → 1.9.17-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 +98 -205
- package/dist/AxiosAPI.js +3 -3
- package/dist/AxiosWidget.js +4 -4
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +104 -207
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +5 -17
- package/dist/FormComponents/Form/Form.js +29 -56
- package/dist/FormComponents/Form/StepperForm/StepperForm.js +1 -1
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +7 -30
- package/dist/FormComponents/Section/Section.js +2 -13
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +9 -32
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +47 -64
- package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +41 -102
- package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +37 -92
- package/dist/FormComponents/Step/AYFStepMapper.js +23 -75
- package/dist/FormComponents/Step/CBRStepMapper.js +56 -144
- package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +3 -26
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +6 -21
- package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +3 -26
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +32 -65
- package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +2 -13
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +6 -21
- package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +2 -13
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +27 -88
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +81 -171
- package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.js +15 -41
- package/dist/FormComponents/Step/RatingStep/RatingStep.js +2 -13
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +25 -52
- package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +3 -26
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +1 -2
- package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +3 -26
- package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +83 -145
- package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +2 -13
- package/dist/FormComponents/Step/Step.js +19 -39
- package/dist/FormComponents/Step/StepFunctions.js +14 -16
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +43 -62
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +2 -13
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +6 -21
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +2 -13
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +3 -15
- package/dist/FormComponents/Step/TitleStep/TitleStep.js +3 -26
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +19 -35
- package/dist/FormComponents/Term/Term.js +2 -13
- package/dist/Widget.js +13 -25
- 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 +29 -86
- package/dist/index.js +4 -15
- package/dist/shared/Loader/Loader.js +5 -17
- package/dist/shared/Navbar/Navbar.js +2 -14
- package/dist/shared/Rating/Rating.js +4 -27
- package/dist/shared/Rating/Ratings/LikeRating.js +9 -21
- package/dist/shared/Rating/Ratings/SatisfactionRating.js +15 -27
- package/dist/shared/Rating/Ratings/ScaleRating.js +22 -49
- package/dist/shared/RoundedButton/RoundedButton.js +12 -24
- package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +39 -84
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +235 -286
- package/dist/shared/RoundedSelect/RoundedSelect.js +103 -152
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +125 -160
- package/dist/shared/RoundedTextField/RoundedTextField.js +92 -137
- package/dist/utils/CbrFunctions.js +30 -30
- package/package.json +4 -4
|
@@ -1,50 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
2
|
import CBRFormStepTypes from '../../constants/CBRFormStepTypes';
|
|
50
3
|
import PersonRoundedIcon from '@material-ui/icons/PersonRounded';
|
|
@@ -55,71 +8,41 @@ import CBRIncidentsStep from './@Construction/CBRIncidentsStep/CBRIncidentsStep'
|
|
|
55
8
|
import CBRLocativasStep from './@Construction/CBRLocativasStep/CBRLocativasStep';
|
|
56
9
|
import axios from 'axios';
|
|
57
10
|
import CBRPropertyStep from './@Construction/CBRPropertyStep/CBRPropertyStep';
|
|
58
|
-
|
|
11
|
+
const baseUrl = `https://integrations.${process.env.REACT_APP_DOMAIN}/sinco/cbr/`;
|
|
59
12
|
function CBRStepMapper(props) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return [2 /*return*/, proyectos];
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}); };
|
|
86
|
-
var getMacroProyectoOptions = function (idOrganization) { return __awaiter(_this, void 0, void 0, function () {
|
|
87
|
-
return __generator(this, function (_a) {
|
|
88
|
-
switch (_a.label) {
|
|
89
|
-
case 0: return [4 /*yield*/, axios.get(baseUrl + 'MacroProyectos?idOrganization=' + idOrganization)];
|
|
90
|
-
case 1: return [2 /*return*/, (_a.sent()).data];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}); };
|
|
94
|
-
var getTipoSolicitanteOptions = function (idOrganization) { return __awaiter(_this, void 0, void 0, function () {
|
|
95
|
-
return __generator(this, function (_a) {
|
|
96
|
-
switch (_a.label) {
|
|
97
|
-
case 0: return [4 /*yield*/, axios.get(baseUrl + 'TiposSolicitante?idOrganization=' + idOrganization)];
|
|
98
|
-
case 1: return [2 /*return*/, (_a.sent()).data];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}); };
|
|
102
|
-
var getTipoEspaciosOptions = function (idOrganization, step, dependencyStore) { return __awaiter(_this, void 0, void 0, function () {
|
|
103
|
-
var idProyecto;
|
|
104
|
-
var _a;
|
|
105
|
-
return __generator(this, function (_b) {
|
|
106
|
-
switch (_b.label) {
|
|
107
|
-
case 0:
|
|
108
|
-
if (!step.dependencies) return [3 /*break*/, 2];
|
|
109
|
-
idProyecto = (_a = dependencyStore[step.dependencies[0]]) === null || _a === void 0 ? void 0 : _a.id;
|
|
110
|
-
if (!idProyecto) {
|
|
111
|
-
return [2 /*return*/, null]; //null para indicar que falta la depedency
|
|
112
|
-
}
|
|
113
|
-
return [4 /*yield*/, axios.get(baseUrl +
|
|
114
|
-
'TiposEspacio?idProyecto=' +
|
|
115
|
-
idProyecto +
|
|
116
|
-
'&idOrganization=' +
|
|
117
|
-
idOrganization)];
|
|
118
|
-
case 1: return [2 /*return*/, (_b.sent()).data];
|
|
119
|
-
case 2: return [2 /*return*/, null];
|
|
13
|
+
const getTipoDocOptions = async (idOrganization) => {
|
|
14
|
+
return (await axios.get(baseUrl + 'TiposDoc?idOrganization=' + idOrganization)).data;
|
|
15
|
+
};
|
|
16
|
+
const getProyectoOptions = async (idOrganization, step, dependencyStore) => {
|
|
17
|
+
const idMacroProyecto = dependencyStore[step.dependencies?.[0] ?? '']?.id;
|
|
18
|
+
let proyectos = (await axios.get(baseUrl + 'Proyectos?idOrganization=' + idOrganization)).data;
|
|
19
|
+
if (idMacroProyecto) {
|
|
20
|
+
proyectos = proyectos.filter((proyecto) => proyecto.idMacroProyecto === idMacroProyecto);
|
|
21
|
+
}
|
|
22
|
+
return proyectos;
|
|
23
|
+
};
|
|
24
|
+
const getMacroProyectoOptions = async (idOrganization) => {
|
|
25
|
+
return (await axios.get(baseUrl + 'MacroProyectos?idOrganization=' + idOrganization)).data;
|
|
26
|
+
};
|
|
27
|
+
const getTipoSolicitanteOptions = async (idOrganization) => {
|
|
28
|
+
return (await axios.get(baseUrl + 'TiposSolicitante?idOrganization=' + idOrganization)).data;
|
|
29
|
+
};
|
|
30
|
+
const getTipoEspaciosOptions = async (idOrganization, step, dependencyStore) => {
|
|
31
|
+
if (step.dependencies) {
|
|
32
|
+
const idProyecto = dependencyStore[step.dependencies[0]]?.id;
|
|
33
|
+
if (!idProyecto) {
|
|
34
|
+
return null; //null para indicar que falta la depedency
|
|
120
35
|
}
|
|
121
|
-
|
|
122
|
-
|
|
36
|
+
return (await axios.get(baseUrl +
|
|
37
|
+
'TiposEspacio?idProyecto=' +
|
|
38
|
+
idProyecto +
|
|
39
|
+
'&idOrganization=' +
|
|
40
|
+
idOrganization)).data;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
123
46
|
switch (props.step.type) {
|
|
124
47
|
case CBRFormStepTypes.CBR_CEL:
|
|
125
48
|
case CBRFormStepTypes.CBR_EMAIL:
|
|
@@ -128,77 +51,66 @@ function CBRStepMapper(props) {
|
|
|
128
51
|
case CBRFormStepTypes.CBR_FIRST_NAME:
|
|
129
52
|
case CBRFormStepTypes.CBR_MIDDLE_NAME:
|
|
130
53
|
case CBRFormStepTypes.CBR_SECOND_LAST_NAME:
|
|
131
|
-
return _jsx(TextInputStep,
|
|
54
|
+
return _jsx(TextInputStep, { ...props, step: props.step });
|
|
132
55
|
case CBRFormStepTypes.CBR_DOC:
|
|
133
|
-
return (_jsx(TextInputStep,
|
|
56
|
+
return (_jsx(TextInputStep, { ...props, step: props.step, icon: _jsx(DocumentIconComponent, {}) }));
|
|
134
57
|
case CBRFormStepTypes.CBR_TIPO_DOC:
|
|
135
|
-
return (_jsx(SmartSelectStep,
|
|
136
|
-
return option.id === value.id;
|
|
137
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } })));
|
|
58
|
+
return (_jsx(SmartSelectStep, { ...props, step: { ...props.step, showIcon: false }, getOptions: getTipoDocOptions, getOptionSelected: (option, value) => option.id === value.id, getValueString: (value) => value?.id }));
|
|
138
59
|
case CBRFormStepTypes.CBR_MACRO_PROYECTO:
|
|
139
|
-
return (_jsx(SmartSelectStep,
|
|
60
|
+
return (_jsx(SmartSelectStep, { ...props, step: props.step, icon: _jsx(ProjectIcon, { fill: "#757575", style: {
|
|
140
61
|
display: 'flex',
|
|
141
62
|
height: 23,
|
|
142
63
|
width: 23,
|
|
143
|
-
} }), getOptions: getMacroProyectoOptions, getOptionSelected:
|
|
144
|
-
return option.id === value.id;
|
|
145
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } })));
|
|
64
|
+
} }), getOptions: getMacroProyectoOptions, getOptionSelected: (option, value) => option.id === value.id, getValueString: (value) => value?.id }));
|
|
146
65
|
case CBRFormStepTypes.CBR_PROYECTO:
|
|
147
|
-
return (_jsx(SmartSelectStep,
|
|
66
|
+
return (_jsx(SmartSelectStep, { ...props, step: props.step, icon: _jsx(ProjectIcon, { fill: "#757575", style: {
|
|
148
67
|
display: 'flex',
|
|
149
68
|
height: 24,
|
|
150
69
|
width: 24,
|
|
151
|
-
} }), getOptions: getProyectoOptions, getOptionSelected:
|
|
152
|
-
return option.id === value.id;
|
|
153
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } })));
|
|
70
|
+
} }), getOptions: getProyectoOptions, getOptionSelected: (option, value) => option.id === value.id, getValueString: (value) => value?.id }));
|
|
154
71
|
case CBRFormStepTypes.CBR_INMUEBLE:
|
|
155
|
-
return _jsx(CBRPropertyStep,
|
|
72
|
+
return _jsx(CBRPropertyStep, { ...props, step: props.step });
|
|
156
73
|
case CBRFormStepTypes.CBR_TIPO_SOLICITANTE:
|
|
157
|
-
return (_jsx(SmartSelectStep,
|
|
74
|
+
return (_jsx(SmartSelectStep, { ...props, step: props.step, icon: _jsx(PersonRoundedIcon, { fill: "#757575", style: {
|
|
158
75
|
display: 'flex',
|
|
159
76
|
height: 23,
|
|
160
77
|
width: 23,
|
|
161
78
|
marginRight: 3,
|
|
162
79
|
marginTop: 1,
|
|
163
|
-
} }), getOptions: getTipoSolicitanteOptions, getOptionSelected:
|
|
164
|
-
return option.id === value.id;
|
|
165
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } })));
|
|
80
|
+
} }), getOptions: getTipoSolicitanteOptions, getOptionSelected: (option, value) => option.id === value.id, getValueString: (value) => value?.id }));
|
|
166
81
|
case CBRFormStepTypes.CBR_TIPO_ESPACIO:
|
|
167
|
-
return (_jsx(SmartSelectStep,
|
|
82
|
+
return (_jsx(SmartSelectStep, { ...props, step: props.step, icon: _jsx(SpaceTypeIcon, { fill: "#757575", style: {
|
|
168
83
|
display: 'flex',
|
|
169
84
|
height: 23,
|
|
170
85
|
width: 23,
|
|
171
|
-
} }), getOptions: getTipoEspaciosOptions, calcDepError:
|
|
172
|
-
for (
|
|
173
|
-
var type = _a[_i];
|
|
86
|
+
} }), getOptions: getTipoEspaciosOptions, calcDepError: (types) => {
|
|
87
|
+
for (const type of types) {
|
|
174
88
|
if (type === CBRFormStepTypes.CBR_PROYECTO) {
|
|
175
89
|
return 'Selecciona un proyecto';
|
|
176
90
|
}
|
|
177
91
|
}
|
|
178
92
|
return undefined;
|
|
179
|
-
}, getOptionSelected:
|
|
180
|
-
return option.id === value.id;
|
|
181
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } })));
|
|
93
|
+
}, getOptionSelected: (option, value) => option.id === value.id, getValueString: (value) => value?.id }));
|
|
182
94
|
case CBRFormStepTypes.CBR_LOCATIVAS:
|
|
183
|
-
return _jsx(CBRLocativasStep,
|
|
95
|
+
return _jsx(CBRLocativasStep, { ...props, step: props.step });
|
|
184
96
|
case CBRFormStepTypes.CBR_COMENTARIO:
|
|
185
|
-
return _jsx(TextAreaStep,
|
|
97
|
+
return _jsx(TextAreaStep, { ...props, step: props.step });
|
|
186
98
|
case CBRFormStepTypes.CBR_INCIDENCIAS:
|
|
187
|
-
return _jsx(CBRIncidentsStep,
|
|
99
|
+
return _jsx(CBRIncidentsStep, { ...props, step: props.step });
|
|
188
100
|
default:
|
|
189
101
|
return _jsx("div", {});
|
|
190
102
|
}
|
|
191
103
|
}
|
|
192
104
|
export default CBRStepMapper;
|
|
193
105
|
function DocumentIconComponent(props) {
|
|
194
|
-
return (_jsx("div",
|
|
106
|
+
return (_jsx("div", { style: {
|
|
195
107
|
marginRight: 2,
|
|
196
|
-
}
|
|
108
|
+
}, children: _jsx(DocumentIcon, { className: props.className, fill: "#757575", style: {
|
|
197
109
|
display: 'flex',
|
|
198
110
|
height: 23,
|
|
199
111
|
width: 23,
|
|
200
|
-
} }) }))
|
|
112
|
+
} }) }));
|
|
201
113
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
114
|
+
const SpaceTypeIcon = (props) => (_jsxs("svg", { fill: props.fill, className: props.class, style: props.style, width: "512pt", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", children: [_jsx("title", { children: "SpaceType" }), _jsxs("g", { id: "space_type", "data-name": "space type", children: [_jsx("path", { d: "M29.74,39A10.21,10.21,0,0,0,27.61,39,1.63,1.63,0,0,0,26,40.61V53.35A1.63,1.63,0,0,0,27.61,55h1.74A1.63,1.63,0,0,0,31,53.35V40.61A1.63,1.63,0,0,0,29.74,39Z" }), _jsx("path", { d: "M57.35,39a10.27,10.27,0,0,0-2.13.05A1.63,1.63,0,0,0,54,40.61V53.35A1.63,1.63,0,0,0,55.61,55h1.74A1.63,1.63,0,0,0,59,53.35V40.61A1.63,1.63,0,0,0,57.35,39Z" }), _jsx("path", { d: "M33,54a1,1,0,0,0,1,1H51a1,1,0,0,0,1-1V49H33Z" }), _jsx("path", { d: "M49,42H36a3,3,0,0,0-3,3v2H52V45A3,3,0,0,0,49,42Z" }), _jsx("path", { d: "M54,31a5,5,0,0,0-5-5H36a5,5,0,0,0-5,5v6.39a3.62,3.62,0,0,1,1.86,2.24A4.68,4.68,0,0,1,33,41c1.37-1.37,4.2-1,16-1a5,5,0,0,1,2.68.78c.64.39.07.39.46-1.15a3.65,3.65,0,0,1,1.43-2C54.15,37.19,54,38.41,54,31Z" }), _jsx("path", { d: "M17,32c-5.85,0-4.33,0-4-.05a7.06,7.06,0,0,0,6-7,7,7,0,0,0-4.47,1.59,7.08,7.08,0,0,0-2.07-5.05,7.06,7.06,0,0,0-2.07,5.05,7,7,0,0,0-4.47-1.59,7.07,7.07,0,0,0,6,7c.36.08,1.89.05-4,.05l1.71,6H3V55H5V50H20v5h2V38H15.26ZM15,45H10V43h5Z" }), _jsx("path", { d: "M26,21h6L31,10H19L18,21h6V40.61a3.63,3.63,0,0,1,2-3.24Z" })] })] }));
|
|
115
|
+
const DocumentIcon = (props) => (_jsx("svg", { fill: props.fill, className: props.class, style: props.style, id: "bold", enableBackground: "new 0 0 24 24", height: "512", viewBox: "0 0 24 24", width: "512", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "m21.25 3h-18.5c-1.517 0-2.75 1.233-2.75 2.75v12.5c0 1.517 1.233 2.75 2.75 2.75h18.5c1.517 0 2.75-1.233 2.75-2.75v-12.5c0-1.517-1.233-2.75-2.75-2.75zm-13.75 4c1.378 0 2.5 1.122 2.5 2.5s-1.122 2.5-2.5 2.5-2.5-1.122-2.5-2.5 1.122-2.5 2.5-2.5zm4.5 9.25c0 .414-.336.75-.75.75h-7.5c-.414 0-.75-.336-.75-.75v-.5c0-1.517 1.233-2.75 2.75-2.75h3.5c1.517 0 2.75 1.233 2.75 2.75zm8.25.75h-5.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h5.5c.414 0 .75.336.75.75s-.336.75-.75.75zm0-4h-5.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h5.5c.414 0 .75.336.75.75s-.336.75-.75.75zm0-4h-5.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h5.5c.414 0 .75.336.75.75s-.336.75-.75.75z" }) }));
|
|
116
|
+
const ProjectIcon = (props) => (_jsx("svg", { fill: props.fill, className: props.class, style: props.style, height: "480pt", viewBox: "0 -8 480 480", width: "480pt", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "m440 448v-49.960938c10.546875-6.214843 16.726562-17.816406 16-30.039062 0-17.671875-10.742188-32-24-32s-24 14.328125-24 32c-.726562 12.222656 5.453125 23.824219 16 30.039062v49.960938h-56v-243.054688l-48-24v43.054688h24v16h-24v32h24v16h-24v32h24v16h-24v32h24v16h-24v32h24v16h-24v16h-16v-321.96875l-96-27.421875v29.390625h56v16h-56v32h56v16h-56v32h56v16h-56v32h56v16h-56v32h56v16h-56v32h56v16h-56v32h56v16h-56v16h-16v-448h-144v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v32h72v16h-72v16h-48v16h480v-16zm0 0" }) }));
|
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
2
|
import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
25
3
|
import MaterialCheckBoxStep from './MaterialCheckBoxStep/MaterialCheckBoxStep';
|
|
26
|
-
function CheckboxStep(
|
|
27
|
-
var formStyle = _a.formStyle, others = __rest(_a, ["formStyle"]);
|
|
4
|
+
function CheckboxStep({ formStyle, ...others }) {
|
|
28
5
|
switch (formStyle.type) {
|
|
29
6
|
case FormStyleTypes.MATERIAL: {
|
|
30
|
-
return _jsx(MaterialCheckBoxStep,
|
|
7
|
+
return _jsx(MaterialCheckBoxStep, { formStyle: formStyle, ...others });
|
|
31
8
|
}
|
|
32
9
|
default: {
|
|
33
|
-
return _jsx(MaterialCheckBoxStep,
|
|
10
|
+
return _jsx(MaterialCheckBoxStep, { formStyle: formStyle, ...others });
|
|
34
11
|
}
|
|
35
12
|
}
|
|
36
13
|
}
|
|
@@ -1,39 +1,24 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import styles from './MaterialCheckBoxStep.module.css';
|
|
14
3
|
import { calcStepWidth } from '../../StepFunctions';
|
|
15
4
|
import RoundedCheckBox from '../../../../shared/RoundedCheckBox/RoundedCheckBox';
|
|
16
5
|
import { Controller } from 'react-hook-form';
|
|
17
|
-
function CheckBoxStep(
|
|
18
|
-
|
|
19
|
-
return (_jsxs("div", __assign({ className: styles.container, style: {
|
|
6
|
+
function CheckBoxStep({ step, form, errors, control, editable, postview, formStyle, widthStats, }) {
|
|
7
|
+
return (_jsxs("div", { className: styles.container, style: {
|
|
20
8
|
width: widthStats.currentBreakPoint <= step.size
|
|
21
9
|
? '100%'
|
|
22
10
|
: calcStepWidth(step.size, form.size),
|
|
23
11
|
minHeight: step.description || step.required ? '55px' : '43px',
|
|
24
|
-
}
|
|
12
|
+
}, children: [_jsxs("div", { className: styles.labelCheckBoxContainer, children: [step.label && (_jsxs("div", { className: styles.checkboxLbl, children: [step.label, step.required ? ' *' : '', ":"] })), _jsx(Controller, { name: step.id, control: control, defaultValue: false, rules: {
|
|
25
13
|
required: step.required
|
|
26
14
|
? 'Este campo es obligatorio'
|
|
27
15
|
: undefined,
|
|
28
|
-
}, shouldUnregister: true, render:
|
|
29
|
-
var field = _a.field;
|
|
30
|
-
return (_jsx(RoundedCheckBox, __assign({}, field, { "data-testid": step.id, inputRef: field.ref, padding: "0px", size: "1.6rem", cantEdit: !editable || postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: field.value })));
|
|
31
|
-
} })] })), (step.description || !!errors[step.id]) && (_jsx("div", __assign({ className: styles.descriptionPar, style: {
|
|
16
|
+
}, shouldUnregister: true, render: ({ field }) => (_jsx(RoundedCheckBox, { ...field, "data-testid": step.id, inputRef: field.ref, padding: "0px", size: "1.6rem", cantEdit: !editable || postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: field.value })) })] }), (step.description || !!errors[step.id]) && (_jsx("div", { className: styles.descriptionPar, style: {
|
|
32
17
|
color: !!errors[step.id]
|
|
33
18
|
? formStyle.errorColor
|
|
34
19
|
: formStyle.descriptionTextColor,
|
|
35
|
-
}
|
|
20
|
+
}, children: !!errors[step.id]
|
|
36
21
|
? 'Este campo es obligatorio'
|
|
37
|
-
: step.description }))
|
|
22
|
+
: step.description }))] }));
|
|
38
23
|
}
|
|
39
24
|
export default CheckBoxStep;
|
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
2
|
import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
25
3
|
import MaterialClassifierSelectorStep from './MaterialClassifierSelectorStep/MaterialClassifierSelectorStep';
|
|
26
|
-
function ClassifierSelectorStep(
|
|
27
|
-
var formStyle = _a.formStyle, others = __rest(_a, ["formStyle"]);
|
|
4
|
+
function ClassifierSelectorStep({ formStyle, ...others }) {
|
|
28
5
|
switch (formStyle.type) {
|
|
29
6
|
case FormStyleTypes.MATERIAL: {
|
|
30
|
-
return (_jsx(MaterialClassifierSelectorStep,
|
|
7
|
+
return (_jsx(MaterialClassifierSelectorStep, { formStyle: formStyle, ...others }));
|
|
31
8
|
}
|
|
32
9
|
default: {
|
|
33
|
-
return (_jsx(MaterialClassifierSelectorStep,
|
|
10
|
+
return (_jsx(MaterialClassifierSelectorStep, { formStyle: formStyle, ...others }));
|
|
34
11
|
}
|
|
35
12
|
}
|
|
36
13
|
}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
1
|
import { createElement as _createElement } from "react";
|
|
24
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
3
|
import React, { useState } from 'react';
|
|
@@ -29,77 +7,69 @@ import StepComponent from '../../Step';
|
|
|
29
7
|
import { Controller } from 'react-hook-form';
|
|
30
8
|
import { calcFillerSize, calcStepWidth } from '../../StepFunctions';
|
|
31
9
|
import RoundedSmartSelect from '../../../../shared/RoundedSmartSelect/RoundedSmartSelect';
|
|
32
|
-
function ClassifierSelector(
|
|
33
|
-
|
|
34
|
-
var _b = useState(level === 0
|
|
10
|
+
function ClassifierSelector({ step, form, level, errors, value, onBlur, control, editable, onChange, postview, inputRef, formStyle, getValues, widthStats, handleSizeChange, ...others }) {
|
|
11
|
+
const [fillerSize, setFillerSize] = useState(level === 0
|
|
35
12
|
? calcFillerSize(step, form.steps, getValues(), form.size)
|
|
36
|
-
: 0)
|
|
13
|
+
: 0);
|
|
37
14
|
if (!step.idClassifier) {
|
|
38
15
|
return _jsx("div", {});
|
|
39
16
|
}
|
|
40
|
-
|
|
17
|
+
const classifier = form.classifiers[step.idClassifier];
|
|
41
18
|
if (!classifier) {
|
|
42
19
|
return _jsx("div", {});
|
|
43
20
|
}
|
|
44
|
-
|
|
45
|
-
.filter(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
value: classifier,
|
|
56
|
-
label: (_a = form.classifiers[classifier]) === null || _a === void 0 ? void 0 : _a.name,
|
|
57
|
-
}
|
|
58
|
-
: { value: classifier._id, label: classifier.name };
|
|
59
|
-
});
|
|
60
|
-
var sizeChange = function () {
|
|
21
|
+
const options = classifier.children
|
|
22
|
+
.filter((classifier) => step.options[typeof classifier === 'string'
|
|
23
|
+
? classifier
|
|
24
|
+
: classifier?._id]?.type !== ClassifierOptionTypes.HIDE)
|
|
25
|
+
.map((classifier) => typeof classifier === 'string'
|
|
26
|
+
? {
|
|
27
|
+
value: classifier,
|
|
28
|
+
label: form.classifiers[classifier]?.name,
|
|
29
|
+
}
|
|
30
|
+
: { value: classifier._id, label: classifier.name });
|
|
31
|
+
const sizeChange = () => {
|
|
61
32
|
handleSizeChange();
|
|
62
33
|
if (level === 0) {
|
|
63
34
|
setFillerSize(calcFillerSize(step, form.steps, getValues(), form.size));
|
|
64
35
|
}
|
|
65
36
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
37
|
+
const renderSelect = () => {
|
|
38
|
+
return (_jsx("div", { className: styles.container, style: {
|
|
69
39
|
width: widthStats.currentBreakPoint <= step.size
|
|
70
40
|
? '100%'
|
|
71
41
|
: calcStepWidth(step.size, form.size),
|
|
72
42
|
minHeight: step.description || step.required ? '55px' : '43px',
|
|
73
|
-
}
|
|
43
|
+
}, children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: "transparent", innerBackgroundColor: formStyle.stepBackgroundColor ?? 'white', label: step.label ? step.label : classifier.name, required: step.required, height: '31px', searchable: step.searchable, icon: undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", handleUpdate: (value) => {
|
|
74
44
|
onChange(value);
|
|
75
45
|
sizeChange();
|
|
76
|
-
}, getOptionSelected:
|
|
77
|
-
return option.value ===
|
|
46
|
+
}, getOptionSelected: (option, value) => {
|
|
47
|
+
return option.value === value?.value;
|
|
78
48
|
}, helperText: errors[step.id]
|
|
79
49
|
? errors[step.id].message
|
|
80
|
-
: step.description, error: !!errors[step.id] }) }
|
|
50
|
+
: step.description, error: !!errors[step.id] }) }, step.id));
|
|
81
51
|
};
|
|
82
|
-
|
|
52
|
+
const mapNestedOption = () => {
|
|
83
53
|
if (value) {
|
|
84
|
-
|
|
85
|
-
if (
|
|
86
|
-
return (_jsx(React.Fragment, { children: currentOption.steps.map(
|
|
87
|
-
|
|
88
|
-
return (_createElement(StepComponent,
|
|
54
|
+
const currentOption = step.options[value.value];
|
|
55
|
+
if (currentOption?.type === ClassifierOptionTypes.NESTED) {
|
|
56
|
+
return (_jsx(React.Fragment, { children: currentOption.steps.map((idStep, index) => {
|
|
57
|
+
const subStep = form.steps[idStep];
|
|
58
|
+
return (_createElement(StepComponent, { ...others, postview: postview, editable: editable, widthStats: widthStats, getValues: getValues, formStyle: formStyle, errors: errors, form: form, control: control, step: subStep, key: index, level: level + 1, handleSizeChange: () => {
|
|
89
59
|
sizeChange();
|
|
90
|
-
} }))
|
|
60
|
+
} }));
|
|
91
61
|
}) }));
|
|
92
62
|
}
|
|
93
63
|
}
|
|
94
64
|
};
|
|
95
65
|
if (level === 0 && step.maxSize < form.size.blockNum) {
|
|
96
|
-
return (_jsxs("div",
|
|
66
|
+
return (_jsxs("div", { className: styles.firstLvlContainer, style: {
|
|
97
67
|
width: widthStats.currentBreakPoint <= step.size
|
|
98
68
|
? '100%'
|
|
99
69
|
: 'fit-content',
|
|
100
|
-
}
|
|
70
|
+
}, children: [renderSelect(), mapNestedOption(), level === 0 && step.maxSize < form.size.blockNum && (_jsx("div", { className: styles.smallSeparator, style: {
|
|
101
71
|
width: fillerSize,
|
|
102
|
-
} }, "SEPARATOR"))] }))
|
|
72
|
+
} }, "SEPARATOR"))] }));
|
|
103
73
|
}
|
|
104
74
|
else {
|
|
105
75
|
return (_jsxs(React.Fragment, { children: [renderSelect(), mapNestedOption(), level === 0 && _jsx("div", { className: styles.separator })] }));
|
|
@@ -111,8 +81,5 @@ function ClassifierSelectorStep(props) {
|
|
|
111
81
|
required: props.step.required
|
|
112
82
|
? 'Este campo es obligatorio'
|
|
113
83
|
: undefined,
|
|
114
|
-
}, shouldUnregister: true, render:
|
|
115
|
-
var field = _a.field;
|
|
116
|
-
return (_jsx(ClassifierSelector, __assign({}, props, { inputRef: field.ref, value: field.value, onChange: field.onChange, onBlur: field.onBlur })));
|
|
117
|
-
} }));
|
|
84
|
+
}, shouldUnregister: true, render: ({ field }) => (_jsx(ClassifierSelector, { ...props, inputRef: field.ref, value: field.value, onChange: field.onChange, onBlur: field.onBlur })) }));
|
|
118
85
|
}
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
14
3
|
import MaterialDatePickerStep from './MaterialDatePickerStep/MaterialDatePickerStep';
|
|
15
4
|
function DatePickerStep(props) {
|
|
16
5
|
switch (props.formStyle.type) {
|
|
17
6
|
case FormStyleTypes.MATERIAL: {
|
|
18
|
-
return _jsx(MaterialDatePickerStep,
|
|
7
|
+
return _jsx(MaterialDatePickerStep, { ...props });
|
|
19
8
|
}
|
|
20
9
|
default: {
|
|
21
|
-
return _jsx(MaterialDatePickerStep,
|
|
10
|
+
return _jsx(MaterialDatePickerStep, { ...props });
|
|
22
11
|
}
|
|
23
12
|
}
|
|
24
13
|
}
|
package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js
CHANGED
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import styles from './MaterialDatePickerStep.module.css';
|
|
14
3
|
import { Controller } from 'react-hook-form';
|
|
15
4
|
import RoundedDatePicker from '../../../../shared/RoundedDatePicker/RoundedDatePicker';
|
|
16
5
|
import { calcStepWidth } from '../../StepFunctions';
|
|
17
|
-
function DatePickerStep(
|
|
18
|
-
|
|
19
|
-
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
6
|
+
function DatePickerStep({ step, form, errors, control, editable, postview, formStyle, widthStats, defaultValue = null, }) {
|
|
7
|
+
return (_jsx("div", { className: styles.container, style: {
|
|
20
8
|
width: widthStats.currentBreakPoint <= step.size
|
|
21
9
|
? '100%'
|
|
22
10
|
: calcStepWidth(step.size, form.size),
|
|
23
11
|
minHeight: step.description || step.required ? '55px' : '43px',
|
|
24
|
-
}
|
|
12
|
+
}, children: _jsx(Controller, { name: step.id, control: control, defaultValue: defaultValue, rules: {
|
|
25
13
|
required: step.required
|
|
26
14
|
? 'Este campo es obligatorio'
|
|
27
15
|
: undefined,
|
|
28
|
-
}, shouldUnregister: true, render:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
? errors[step.id].message
|
|
32
|
-
: step.description, error: !!errors[step.id], required: step.required })));
|
|
33
|
-
} }) })));
|
|
16
|
+
}, shouldUnregister: true, render: ({ field }) => (_jsx(RoundedDatePicker, { ...field, pickTime: step.pickTime, inputRef: field.ref, cantEdit: !editable || postview, "data-testid": step.id, secondaryColor: formStyle.secondaryColor, contrastColor: formStyle.secondaryContrastColor, accentColor: formStyle.textColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, helperTextColor: formStyle.descriptionTextColor, fontWeight: 400, label: step.label, helperText: errors[step.id]
|
|
17
|
+
? errors[step.id].message
|
|
18
|
+
: step.description, error: !!errors[step.id], required: step.required })) }) }));
|
|
34
19
|
}
|
|
35
20
|
export default DatePickerStep;
|