@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,138 +1,77 @@
|
|
|
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 SmartSelectStep from '../../SmartSelectStep/SmartSelectStep';
|
|
50
3
|
import CBRFormStepTypes from '../../../../constants/CBRFormStepTypes';
|
|
51
4
|
import axios from 'axios';
|
|
52
5
|
function CBRLocativasStep(props) {
|
|
53
|
-
return (_jsx(SmartSelectStep,
|
|
6
|
+
return (_jsx(SmartSelectStep, { ...props, step: props.step, icon: _jsx(Leak, { fill: "#757575", style: {
|
|
54
7
|
display: 'flex',
|
|
55
8
|
height: 23,
|
|
56
9
|
width: 23,
|
|
57
10
|
marginTop: 2,
|
|
58
|
-
} }), getOptions: getLocativasOptions, getOptionSelected:
|
|
59
|
-
return option.id === value.id;
|
|
60
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }, calcDepError: calcDepError, calcInvalidDeps: calcInvalidDependencies, valueOverwrite: function (value) {
|
|
11
|
+
} }), getOptions: getLocativasOptions, getOptionSelected: (option, value) => option.id === value.id, getValueString: (value) => value?.id, calcDepError: calcDepError, calcInvalidDeps: calcInvalidDependencies, valueOverwrite: (value) => {
|
|
61
12
|
if (value) {
|
|
62
|
-
return
|
|
13
|
+
return { ...value, subStep: props.step.subStep };
|
|
63
14
|
}
|
|
64
15
|
else {
|
|
65
16
|
return null;
|
|
66
17
|
}
|
|
67
|
-
}
|
|
18
|
+
}, children: _jsx(LocativasSubStepRenderer, {}) }));
|
|
68
19
|
}
|
|
69
20
|
export default CBRLocativasStep;
|
|
70
|
-
function LocativasSubStepRenderer(
|
|
71
|
-
var _b;
|
|
72
|
-
var value = _a.value, stepProps = _a.stepProps;
|
|
21
|
+
function LocativasSubStepRenderer({ value, stepProps, }) {
|
|
73
22
|
if (!value || stepProps == undefined) {
|
|
74
23
|
return _jsx("div", {});
|
|
75
24
|
}
|
|
76
|
-
|
|
77
|
-
if (
|
|
25
|
+
const subStep = stepProps?.form.steps[stepProps.step.subStep ?? ''];
|
|
26
|
+
if (subStep?.type !== CBRFormStepTypes.CBR_LOCATIVAS) {
|
|
78
27
|
return _jsx("div", {});
|
|
79
28
|
}
|
|
80
|
-
return (_jsx(SmartSelectStep,
|
|
29
|
+
return (_jsx(SmartSelectStep, { ...stepProps, step: subStep, level: stepProps.level + 1, icon: _jsx(Leak, { fill: "#757575", style: {
|
|
81
30
|
display: 'flex',
|
|
82
31
|
height: 23,
|
|
83
32
|
width: 23,
|
|
84
33
|
marginTop: 2,
|
|
85
|
-
} }), calcInvalidDeps: calcInvalidDependencies, getOptions: getLocativasOptions, calcDepError: calcDepError, getOptionSelected:
|
|
86
|
-
return option.id === value.id;
|
|
87
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }, { children: _jsx(LocativasSubStepRenderer, {}) })));
|
|
34
|
+
} }), calcInvalidDeps: calcInvalidDependencies, getOptions: getLocativasOptions, calcDepError: calcDepError, getOptionSelected: (option, value) => option.id === value.id, getValueString: (value) => value?.id, children: _jsx(LocativasSubStepRenderer, {}) }));
|
|
88
35
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
case 0:
|
|
95
|
-
if (!step.dependencies) return [3 /*break*/, 2];
|
|
96
|
-
idProyecto = (_a = dependencyStore[step.dependencies[0]]) === null || _a === void 0 ? void 0 : _a.id;
|
|
97
|
-
if (!idProyecto) {
|
|
98
|
-
return [2 /*return*/, null]; //null para indicar que falta la depedency
|
|
99
|
-
}
|
|
100
|
-
return [4 /*yield*/, axios.get("https://integrations.".concat(process.env.REACT_APP_DOMAIN, "/sinco/cbr/Locativas?idOrganization=").concat(idOrganization))];
|
|
101
|
-
case 1:
|
|
102
|
-
response = (_b.sent()).data;
|
|
103
|
-
father_1 = dependencyStore[step.dependencies[1]];
|
|
104
|
-
if (father_1 !== undefined && father_1.id === undefined) {
|
|
105
|
-
return [2 /*return*/, null];
|
|
106
|
-
}
|
|
107
|
-
return [2 /*return*/, response.filter(function (locativa) {
|
|
108
|
-
if (father_1 === null || father_1 === void 0 ? void 0 : father_1.id) {
|
|
109
|
-
return (locativa.id.startsWith(father_1.id) &&
|
|
110
|
-
locativa.id !== father_1.id);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
return locativa.id.length === 2;
|
|
114
|
-
}
|
|
115
|
-
})];
|
|
116
|
-
case 2: return [2 /*return*/, null];
|
|
36
|
+
const getLocativasOptions = async (idOrganization, step, dependencyStore) => {
|
|
37
|
+
if (step.dependencies) {
|
|
38
|
+
const idProyecto = dependencyStore[step.dependencies[0]]?.id;
|
|
39
|
+
if (!idProyecto) {
|
|
40
|
+
return null; //null para indicar que falta la depedency
|
|
117
41
|
}
|
|
118
|
-
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
42
|
+
//Calc resp given dep, and depency Store
|
|
43
|
+
const response = (await axios.get(`https://integrations.${process.env.REACT_APP_DOMAIN}/sinco/cbr/Locativas?idOrganization=${idOrganization}`)).data;
|
|
44
|
+
const father = dependencyStore[step.dependencies[1]];
|
|
45
|
+
if (father !== undefined && father.id === undefined) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return response.filter((locativa) => {
|
|
49
|
+
if (father?.id) {
|
|
50
|
+
return (locativa.id.startsWith(father.id) &&
|
|
51
|
+
locativa.id !== father.id);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return locativa.id.length === 2;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const calcInvalidDependencies = (step, dependencyStore) => {
|
|
63
|
+
const deps = [];
|
|
123
64
|
if (step.dependencies) {
|
|
124
|
-
for (
|
|
125
|
-
|
|
126
|
-
if (((_a = dependencyStore[idDep]) === null || _a === void 0 ? void 0 : _a.id) === undefined) {
|
|
65
|
+
for (const idDep of step.dependencies) {
|
|
66
|
+
if (dependencyStore[idDep]?.id === undefined) {
|
|
127
67
|
deps.push(idDep);
|
|
128
68
|
}
|
|
129
69
|
}
|
|
130
70
|
}
|
|
131
71
|
return deps;
|
|
132
72
|
};
|
|
133
|
-
|
|
134
|
-
for (
|
|
135
|
-
var type = _a[_i];
|
|
73
|
+
const calcDepError = (types) => {
|
|
74
|
+
for (const type of types) {
|
|
136
75
|
if (type === CBRFormStepTypes.CBR_PROYECTO) {
|
|
137
76
|
return 'Selecciona un proyecto';
|
|
138
77
|
}
|
|
@@ -142,4 +81,4 @@ var calcDepError = function (types) {
|
|
|
142
81
|
}
|
|
143
82
|
return undefined;
|
|
144
83
|
};
|
|
145
|
-
|
|
84
|
+
const Leak = (props) => (_jsxs("svg", { fill: props.fill, className: props.class, style: props.style, height: "512pt", viewBox: "0 -86 512.00056 512", width: "512pt", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "m203.484375 196.359375c2.402344 0 4.753906-.867187 6.601563-2.492187l26.621093-23.394532c3.03125-2.664062 4.164063-6.890625 2.871094-10.714844l-9.21875-27.257812 21.613281-18.996094c3.03125-2.664062 4.164063-6.890625 2.871094-10.714844l-11.359375-33.570312c-1.070313-3.167969-3.652344-5.589844-6.882813-6.457031l-57.925781-15.519531c-5.335937-1.433594-10.816406 1.734374-12.246093 7.070312-1.429688 5.335938 1.734374 10.820312 7.070312 12.25l52.753906 14.132812 7.507813 22.1875-21.613281 18.996094c-3.03125 2.664063-4.164063 6.890625-2.871094 10.714844l9.21875 27.257812-17.59375 15.460938-130.027344-34.839844 30.992188-115.667968c.6875-2.5625.328124-5.292969-.996094-7.589844-1.328125-2.296875-3.511719-3.972656-6.074219-4.660156l-45.574219-12.210938c-5.332031-1.429688-10.816406 1.734375-12.246094 7.070312l-36.636718 136.722657c-.6875 2.5625-.324219 5.292969 1 7.589843 1.324218 2.292969 3.511718 3.972657 6.070312 4.65625l45.574219 12.210938c.867187.234375 1.738281.34375 2.597656.34375 4.414063 0 8.453125-2.945312 9.652344-7.414062l.464844-1.734376 135.199219 36.226563c.851562.230469 1.722656.34375 2.585937.34375zm-181.238281-56.703125 31.460937-117.40625 26.253907 7.035156-31.457032 117.40625zm0 0" }), _jsx("path", { d: "m511.660156 144.136719-36.636718-136.722657c-1.429688-5.332031-6.910157-8.5-12.246094-7.070312l-45.574219 12.210938c-2.5625.6875-4.746094 2.363281-6.070313 4.660156-1.328124 2.296875-1.6875 5.023437-1 7.585937l.464844 1.734375-135.199218 36.226563c-3.28125.878906-5.894532 3.367187-6.933594 6.605469-1.039063 3.238281-.363282 6.777343 1.796875 9.40625l19.121093 23.265624-5.867187 25.070313c-.796875 3.40625.242187 6.980469 2.738281 9.425781l19.386719 18.988282-6.847656 28.496093c-.824219 3.429688.21875 7.039063 2.742187 9.5 1.894532 1.84375 4.40625 2.839844 6.980469 2.839844.863281 0 1.730469-.113281 2.585937-.34375l57.925782-15.519531c5.335937-1.429688 8.5-6.914063 7.070312-12.25-1.429687-5.332032-6.914062-8.5-12.246094-7.070313l-41.683593 11.171875 4.246093-17.664062c.820313-3.421875-.214843-7.023438-2.726562-9.484375l-19.417969-19.015625 5.714844-24.398438c.710937-3.035156-.035156-6.222656-2.011719-8.628906l-12.40625-15.09375 120.207032-32.207031 30.992187 115.667969c1.199219 4.46875 5.238281 7.414062 9.65625 7.414062.855469 0 1.726563-.109375 2.59375-.339844l45.574219-12.210937c2.5625-.6875 4.746094-2.363281 6.070312-4.660157 1.328125-2.296874 1.6875-5.027343 1-7.589843zm-48.160156 2.554687-30.996094-115.667968s0 0 0-.003907v-.003906l-.464844-1.730469 26.257813-7.035156 31.457031 117.40625zm0 0" }), _jsx("path", { d: "m263.386719 203.265625c-1.894531-2.078125-4.574219-3.261719-7.386719-3.261719-2.808594 0-5.492188 1.183594-7.386719 3.261719-.78125.855469-1.640625 1.789063-2.570312 2.792969-14.488281 15.730468-44.640625 48.457031-44.640625 79.34375 0 30.105468 24.492187 54.601562 54.597656 54.601562s54.597656-24.496094 54.597656-54.601562c0-30.886719-30.148437-63.613282-44.640625-79.339844-.925781-1.007812-1.789062-1.941406-2.570312-2.796875zm-7.386719 116.738281c-19.078125 0-34.597656-15.523437-34.597656-34.601562 0-20.492188 20.960937-45.539063 34.597656-60.601563 13.636719 15.0625 34.597656 40.109375 34.597656 60.601563 0 19.078125-15.519531 34.601562-34.597656 34.601562zm0 0" }), _jsx("path", { d: "m129.878906 54.871094c.917969.261718 1.839844.386718 2.75.386718 4.351563 0 8.355469-2.863281 9.609375-7.253906 1.519531-5.3125-1.554687-10.847656-6.867187-12.363281h-.007813c-5.308593-1.519531-10.839843 1.554687-12.359375 6.867187-1.515625 5.308594 1.5625 10.847657 6.875 12.363282zm0 0" }), _jsx("path", { d: "m407.335938 149.527344-.007813.003906c-5.335937 1.421875-8.507813 6.898438-7.082031 12.238281 1.191406 4.472657 5.238281 7.421875 9.65625 7.421875.855468 0 1.722656-.109375 2.585937-.339844 5.335938-1.421874 8.507813-6.902343 7.085938-12.238281-1.425781-5.335937-6.90625-8.511719-12.238281-7.085937zm0 0" })] }));
|
|
@@ -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 styles from './CBRPropertyStep.module.css';
|
|
50
3
|
import SmartSelectStep from '../../SmartSelectStep/SmartSelectStep';
|
|
@@ -54,49 +7,41 @@ import axios from 'axios';
|
|
|
54
7
|
import React, { useState } from 'react';
|
|
55
8
|
import { Dialog } from '@material-ui/core';
|
|
56
9
|
import RoundedButton from '../../../../shared/RoundedButton/RoundedButton';
|
|
57
|
-
|
|
10
|
+
const baseUrl = `https://integrations.${process.env.REACT_APP_DOMAIN}/sinco/cbr/`;
|
|
58
11
|
function CBRPropertyStepComponent(props) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
case 0:
|
|
67
|
-
if (!step.dependencies) return [3 /*break*/, 2];
|
|
68
|
-
idProyecto = (_a = dependencyStore[step.dependencies[0]]) === null || _a === void 0 ? void 0 : _a.id;
|
|
69
|
-
idMacroProyecto = (_b = dependencyStore[step.dependencies[0]]) === null || _b === void 0 ? void 0 : _b.idMacroProyecto;
|
|
70
|
-
if (!idProyecto) {
|
|
71
|
-
return [2 /*return*/, null]; //null para indicar que falta la depedency
|
|
72
|
-
}
|
|
73
|
-
return [4 /*yield*/, axios.get(baseUrl +
|
|
74
|
-
'Inmuebles?idMacro=' +
|
|
75
|
-
idMacroProyecto +
|
|
76
|
-
'&idProyecto=' +
|
|
77
|
-
idProyecto +
|
|
78
|
-
'&idOrganization=' +
|
|
79
|
-
idOrganization)];
|
|
80
|
-
case 1: return [2 /*return*/, (_c.sent()).data];
|
|
81
|
-
case 2: return [2 /*return*/, null];
|
|
12
|
+
const [showWarning, setShowWarning] = useState(undefined);
|
|
13
|
+
const getInmueblesOptions = async (idOrganization, step, dependencyStore) => {
|
|
14
|
+
if (step.dependencies) {
|
|
15
|
+
const idProyecto = dependencyStore[step.dependencies[0]]?.id;
|
|
16
|
+
const idMacroProyecto = dependencyStore[step.dependencies[0]]?.idMacroProyecto;
|
|
17
|
+
if (!idProyecto) {
|
|
18
|
+
return null; //null para indicar que falta la depedency
|
|
82
19
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
20
|
+
return (await axios.get(baseUrl +
|
|
21
|
+
'Inmuebles?idMacro=' +
|
|
22
|
+
idMacroProyecto +
|
|
23
|
+
'&idProyecto=' +
|
|
24
|
+
idProyecto +
|
|
25
|
+
'&idOrganization=' +
|
|
26
|
+
idOrganization)).data;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return (_jsxs(React.Fragment, { children: [_jsx(SmartSelectStep, { ...props, step: props.step, icon: _jsx(PropertyIcon, { fill: "#757575", style: {
|
|
86
33
|
display: 'flex',
|
|
87
34
|
height: 23,
|
|
88
35
|
width: 23,
|
|
89
|
-
} }), getOptionSelected:
|
|
90
|
-
|
|
91
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }, getValueWarning: props.step.validation
|
|
92
|
-
? function (value) {
|
|
36
|
+
} }), getOptionSelected: (option, value) => option.id === value.id, getValueString: (value) => value?.id, getValueWarning: props.step.validation
|
|
37
|
+
? (value) => {
|
|
93
38
|
if (value &&
|
|
94
39
|
value.entrega !== undefined &&
|
|
95
40
|
props.step.validation) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
41
|
+
const date = new Date(value.entrega);
|
|
42
|
+
const today = new Date();
|
|
43
|
+
const time = today.getTime() - date.getTime();
|
|
44
|
+
const days = time / (1000 * 3600 * 24);
|
|
100
45
|
if (days > props.step.validation.maxDays) {
|
|
101
46
|
return props.step.validation.message;
|
|
102
47
|
}
|
|
@@ -104,30 +49,30 @@ function CBRPropertyStepComponent(props) {
|
|
|
104
49
|
return null;
|
|
105
50
|
}
|
|
106
51
|
: undefined, changeListener: props.step.validation
|
|
107
|
-
?
|
|
52
|
+
? (value) => {
|
|
108
53
|
if (value &&
|
|
109
54
|
value.entrega !== undefined &&
|
|
110
55
|
props.step.validation) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
56
|
+
const date = new Date(value.entrega);
|
|
57
|
+
const today = new Date();
|
|
58
|
+
const time = today.getTime() - date.getTime();
|
|
59
|
+
const days = time / (1000 * 3600 * 24);
|
|
115
60
|
if (days > props.step.validation.maxDays) {
|
|
116
61
|
setShowWarning(date);
|
|
117
62
|
}
|
|
118
63
|
}
|
|
119
64
|
}
|
|
120
|
-
: undefined, getOptions: getInmueblesOptions })
|
|
65
|
+
: undefined, getOptions: getInmueblesOptions }), showWarning !== undefined && (_jsx(Dialog, { PaperProps: {
|
|
121
66
|
style: {
|
|
122
67
|
borderRadius: '20px',
|
|
123
68
|
maxWidth: '100vw',
|
|
124
69
|
boxSizing: 'content-box',
|
|
125
70
|
},
|
|
126
|
-
}, open: true
|
|
71
|
+
}, open: true, children: _jsxs("div", { className: styles.confirmationContainer, style: { color: props.formStyle.textColor }, children: [_jsx("div", { className: styles.closeIcon, onClick: () => {
|
|
127
72
|
setShowWarning(undefined);
|
|
128
|
-
}
|
|
73
|
+
}, children: _jsx(CloseRoundedIcon, { fontSize: "inherit" }) }), _jsxs("div", { className: styles.container, children: [_jsx("div", { className: styles.warningContainer, style: { color: props.formStyle.primaryColor }, children: _jsx(WarningRoundedIcon, { fontSize: "inherit", style: { fontSize: '160px' } }) }), _jsxs("div", { className: styles.messageContainer, children: ["La garant\u00EDa de su inmueble expir\u00F3 el d\u00EDa", ' ', showWarning.toLocaleDateString(), "."] }), _jsx("div", { className: styles.btnContainer, children: _jsx(RoundedButton, { text: 'Continuar', color: props.formStyle.primaryContrastColor, backgroundColor: props.formStyle.primaryColor, fontSize: '1rem', padding: '5px 15px 5px 15px', onClick: () => {
|
|
129
74
|
setShowWarning(undefined);
|
|
130
|
-
} }) })
|
|
75
|
+
} }) })] })] }) }))] }));
|
|
131
76
|
}
|
|
132
77
|
export default CBRPropertyStepComponent;
|
|
133
|
-
|
|
78
|
+
const PropertyIcon = (props) => (_jsx("svg", { fill: props.fill, className: props.class, style: props.style, height: "512", viewBox: "0 0 512 512", width: "512", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { id: "_01-home", "data-name": "01-home", children: _jsxs("g", { id: "glyph", children: [_jsx("path", { d: "m256 4c-108.075 0-196 87.925-196 196 0 52.5 31.807 119.92 94.537 200.378a1065.816 1065.816 0 0 0 93.169 104.294 12 12 0 0 0 16.588 0 1065.816 1065.816 0 0 0 93.169-104.294c62.73-80.458 94.537-147.878 94.537-200.378 0-108.075-87.925-196-196-196zm0 336c-77.2 0-140-62.8-140-140s62.8-140 140-140 140 62.8 140 140-62.8 140-140 140z" }), _jsx("path", { d: "m352.072 183.121-88-80a12 12 0 0 0 -16.144 0l-88 80a12.006 12.006 0 0 0 -2.23 15.039 12.331 12.331 0 0 0 10.66 5.84h11.642v76a12 12 0 0 0 12 12h28a12 12 0 0 0 12-12v-44a12 12 0 0 1 12-12h24a12 12 0 0 1 12 12v44a12 12 0 0 0 12 12h28a12 12 0 0 0 12-12v-76h11.642a12.331 12.331 0 0 0 10.66-5.84 12.006 12.006 0 0 0 -2.23-15.039z" })] }) }) }));
|
|
@@ -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 } from "react/jsx-runtime";
|
|
49
2
|
import AYFFormStepTypes from '../../constants/AYFFormStepTypes';
|
|
50
3
|
import TextInputStep from './TextInputStep/TextInputStep';
|
|
@@ -53,49 +6,44 @@ import CalendarTodayRoundedIcon from '@material-ui/icons/CalendarTodayRounded';
|
|
|
53
6
|
import DescriptionIcon from '@material-ui/icons/Description';
|
|
54
7
|
import DatePickerStep from './DatePickerStep/DatePickerStep';
|
|
55
8
|
function AYFStepMapper(props) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
]];
|
|
73
|
-
});
|
|
74
|
-
}); };
|
|
9
|
+
const getMonths = async () => {
|
|
10
|
+
return [
|
|
11
|
+
{ id: '1', label: 'Enero' },
|
|
12
|
+
{ id: '2', label: 'Febrero' },
|
|
13
|
+
{ id: '3', label: 'Marzo' },
|
|
14
|
+
{ id: '4', label: 'Abril' },
|
|
15
|
+
{ id: '5', label: 'Mayo' },
|
|
16
|
+
{ id: '6', label: 'Junio' },
|
|
17
|
+
{ id: '7', label: 'Julio' },
|
|
18
|
+
{ id: '8', label: 'Agosto' },
|
|
19
|
+
{ id: '9', label: 'Septiembre' },
|
|
20
|
+
{ id: '10', label: 'Octubre' },
|
|
21
|
+
{ id: '11', label: 'Noviembre ' },
|
|
22
|
+
{ id: '12', label: 'Diciembre' },
|
|
23
|
+
];
|
|
24
|
+
};
|
|
75
25
|
switch (props.step.type) {
|
|
76
26
|
case AYFFormStepTypes.AYF_START_MONTH:
|
|
77
27
|
case AYFFormStepTypes.AYF_END_MONTH:
|
|
78
|
-
return (_jsx(SmartSelectStep,
|
|
79
|
-
return option.id === value.id;
|
|
80
|
-
}, defaultValue: props.step.type === AYFFormStepTypes.AYF_START_MONTH
|
|
28
|
+
return (_jsx(SmartSelectStep, { ...props, step: props.step, getOptions: getMonths, getOptionSelected: (option, value) => option.id === value.id, defaultValue: props.step.type === AYFFormStepTypes.AYF_START_MONTH
|
|
81
29
|
? { id: '1', label: 'Enero' }
|
|
82
|
-
: { id: '12', label: 'Diciembre' }, getValueString:
|
|
30
|
+
: { id: '12', label: 'Diciembre' }, getValueString: (value) => value?.id, icon: _jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
83
31
|
color: '#757575',
|
|
84
32
|
fontSize: 20,
|
|
85
33
|
marginRight: 4,
|
|
86
34
|
marginTop: 2,
|
|
87
|
-
} }) }))
|
|
35
|
+
} }) }));
|
|
88
36
|
case AYFFormStepTypes.AYF_YEAR:
|
|
89
|
-
return (_jsx(TextInputStep,
|
|
37
|
+
return (_jsx(TextInputStep, { ...props, step: props.step, defaultValue: new Date().getFullYear().toString(), icon: _jsx(CalendarTodayRoundedIcon, { fontSize: "inherit", style: {
|
|
90
38
|
color: '#757575',
|
|
91
39
|
fontSize: 20,
|
|
92
40
|
marginRight: 4,
|
|
93
41
|
marginTop: 2,
|
|
94
|
-
} }) }))
|
|
42
|
+
} }) }));
|
|
95
43
|
case AYFFormStepTypes.AYF_BILL_NUM:
|
|
96
|
-
return (_jsx(TextInputStep,
|
|
44
|
+
return (_jsx(TextInputStep, { ...props, step: props.step, icon: _jsx(DescriptionIcon, { style: { color: '#757575', fontSize: 23 } }) }));
|
|
97
45
|
case AYFFormStepTypes.AYF_CUT_OFF_DATE:
|
|
98
|
-
return (_jsx(DatePickerStep,
|
|
46
|
+
return (_jsx(DatePickerStep, { ...props, step: props.step, defaultValue: new Date() }));
|
|
99
47
|
default:
|
|
100
48
|
return _jsx("div", {});
|
|
101
49
|
}
|