@arquimedes.co/eureka-forms 1.9.134 → 2.0.0-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/@Types/Form.d.ts +1 -1
- package/dist/@Types/FormStep.d.ts +2 -2
- package/dist/@Types/GenericFormSteps.d.ts +1 -0
- package/dist/App/App.css +6 -0
- package/dist/{App.d.ts → App/App.d.ts} +13 -21
- package/dist/App/App.js +76 -0
- package/dist/App/AppFunctions.d.ts +16 -0
- package/dist/App/AppFunctions.js +210 -0
- package/dist/App/AppHooks.d.ts +10 -0
- package/dist/App/AppHooks.js +235 -0
- package/dist/Contexts/CustomContext.d.ts +11 -0
- package/dist/Contexts/CustomContext.js +6 -0
- package/dist/Contexts/FormContext.d.ts +4 -0
- package/dist/Contexts/FormContext.js +19 -0
- package/dist/Contexts/SectionContext.d.ts +3 -0
- package/dist/Contexts/SectionContext.js +3 -0
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +2 -4
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +3 -1
- package/dist/Form/Form.d.ts +17 -34
- package/dist/Form/Form.js +73 -124
- package/dist/Form/FormFunctions.d.ts +5 -4
- package/dist/Form/FormFunctions.js +24 -25
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +1 -1
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +34 -58
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.module.css +0 -4
- package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -1
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +122 -3
- package/dist/Form/FormTypes/StepperForm/StepperForm.module.css +53 -0
- package/dist/Form/Hooks.d.ts +9 -0
- package/dist/Form/Hooks.js +7 -0
- package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +1 -1
- package/dist/Form/Section/MaterialSection/MaterialSection.js +15 -16
- package/dist/Form/Section/Section.d.ts +2 -34
- package/dist/Form/Section/Section.js +11 -5
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +1 -1
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +19 -14
- package/dist/Form/Terms/Term/Term.d.ts +1 -8
- package/dist/Form/Terms/Term/Term.js +3 -1
- package/dist/Form/Terms/Terms.d.ts +1 -2
- package/dist/Form/Terms/Terms.js +17 -8
- package/dist/Form/Terms/Terms.module.css +3 -0
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +3 -3
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +49 -38
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +3 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +2 -2
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +11 -5
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +29 -27
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.module.css +0 -6
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +39 -31
- package/dist/FormSteps/AYFStepMapper.js +42 -43
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +1 -1
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +4 -14
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +84 -97
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.module.css +0 -9
- package/dist/FormSteps/CBRStepMapper.js +78 -74
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +1 -1
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +4 -14
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +33 -26
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css +17 -0
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +1 -1
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +4 -14
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +34 -27
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +1 -1
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +4 -2
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +16 -11
- package/dist/FormSteps/CustomStep.d.ts +23 -0
- package/dist/FormSteps/CustomStep.js +37 -0
- package/dist/FormSteps/DatePickerStep/DatePickerStep.js +3 -1
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +1 -1
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +26 -14
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +1 -1
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +4 -14
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +93 -112
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.module.css +0 -9
- package/dist/FormSteps/FileUploadStep/FileUploadStep.js +3 -1
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +1 -1
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +1 -1
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.module.css +0 -7
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +32 -18
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.module.css +0 -7
- package/dist/FormSteps/MapperStep/MapperStep.d.ts +2 -2
- package/dist/FormSteps/MapperStep/MapperStep.js +4 -14
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +1 -9
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +7 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElement.d.ts +3 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElement.js +18 -10
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +1 -9
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +7 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +1 -1
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +44 -228
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.module.css +0 -7
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +30 -14
- package/dist/FormSteps/RatingStep/RatingStep.js +3 -1
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +36 -26
- package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +1 -1
- package/dist/FormSteps/SelectorStep/SelectorStep.js +4 -14
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +1 -1
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +3 -1
- package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +1 -1
- package/dist/FormSteps/SeparatorStep/SeparatorStep.js +4 -14
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +5 -2
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +119 -199
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +9 -10
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +3 -1
- package/dist/FormSteps/Step.d.ts +3 -4
- package/dist/FormSteps/Step.js +12 -8
- package/dist/FormSteps/StepFunctions.d.ts +10 -0
- package/dist/FormSteps/StepFunctions.js +156 -1
- package/dist/FormSteps/StepHooks.d.ts +23 -0
- package/dist/FormSteps/StepHooks.js +87 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +10 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +148 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -6
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +40 -186
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.module.css +0 -9
- package/dist/FormSteps/TextAreaStep/TextAreaStep.js +8 -2
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -1
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +43 -42
- package/dist/FormSteps/TextInputStep/TextInputStep.js +3 -1
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +11 -6
- package/dist/FormSteps/TitleStep/TitleStep.d.ts +1 -1
- package/dist/FormSteps/TitleStep/TitleStep.js +4 -14
- package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
- package/dist/Icons/Construction/LeakIcon.js +2 -1
- package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
- package/dist/Icons/Construction/ProjectIcon.js +2 -1
- package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
- package/dist/Icons/Construction/PropertyIcon.js +2 -1
- package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
- package/dist/Icons/Construction/SpaceIcon.js +2 -1
- package/dist/Icons/DocumentIcon.d.ts +2 -2
- package/dist/Icons/DocumentIcon.js +2 -1
- package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
- package/dist/Icons/Entities/CheckListIcon.js +2 -1
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -1
- package/dist/Icons/Entities/GenericEntityIcon.js +1 -1
- package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -1
- package/dist/Icons/Entities/HandshakeIcon.js +1 -1
- package/dist/Icons/Entities/SupplierIcon.d.ts +2 -1
- package/dist/Icons/Entities/SupplierIcon.js +4 -1
- package/dist/{controllers → Services}/FileService.d.ts +1 -1
- package/dist/{controllers → Services}/FileService.js +5 -5
- package/dist/Services/FormService.d.ts +5 -0
- package/dist/Services/FormService.js +59 -0
- package/dist/Services/OrganizationService.d.ts +2 -0
- package/dist/Services/OrganizationService.js +65 -0
- package/dist/Shared/Navbar/Navbar.module.css +8 -0
- package/dist/{shared → Shared}/Rating/Rating.d.ts +1 -1
- package/dist/Shared/Rating/Rating.module.css +18 -0
- package/dist/{shared → Shared}/Rating/Ratings/LikeRating.js +5 -5
- package/dist/{shared → Shared}/Rating/Ratings/SatisfactionRating.js +9 -9
- package/dist/{shared → Shared}/Rating/Ratings/ScaleRating.js +1 -2
- package/dist/{shared → Shared}/RoundedCheckBox/RoundedCheckBox.d.ts +1 -1
- package/dist/{shared → Shared}/RoundedSmartSelect/RoundedSmartSelect.js +4 -4
- package/dist/{shared → Shared}/RoundedTextField/RoundedTextField.d.ts +1 -1
- package/dist/{shared → Shared}/RoundedTextField/RoundedTextField.js +3 -2
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.d.ts +24 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +25 -0
- package/dist/States/GlobalStateReducer.d.ts +35 -0
- package/dist/States/GlobalStateReducer.js +34 -0
- package/dist/States/SiteStateReducer.d.ts +63 -0
- package/dist/States/SiteStateReducer.js +110 -0
- package/dist/States/WidthStatsStateReducer.d.ts +11 -0
- package/dist/States/WidthStatsStateReducer.js +64 -0
- package/dist/Utils/DraftFunctions.d.ts +3 -0
- package/dist/Utils/DraftFunctions.js +42 -0
- package/dist/Utils/MaterialProviders.d.ts +6 -0
- package/dist/Utils/MaterialProviders.js +31 -0
- package/dist/Utils/store.d.ts +25 -0
- package/dist/Utils/store.js +52 -0
- package/dist/Widget.js +3 -3
- package/dist/constants/CBRFormStepTypes.d.ts +2 -2
- package/dist/constants/CBRFormStepTypes.js +22 -22
- package/dist/hooks.d.ts +5 -0
- package/dist/hooks.js +7 -0
- package/dist/index.js +1 -1
- package/dist/index.lib.d.ts +1 -1
- package/dist/index.lib.js +1 -1
- package/package.json +63 -44
- package/dist/App.js +0 -472
- package/dist/shared/Navbar/Navbar.module.css +0 -18
- package/dist/shared/Rating/Rating.module.css +0 -32
- package/dist/{App.module.css → App/App.module.css} +0 -0
- package/dist/{shared → Shared}/InputIcon/InputIcon.d.ts +0 -0
- package/dist/{shared → Shared}/InputIcon/InputIcon.js +0 -0
- package/dist/{shared → Shared}/Loader/Loader.d.ts +0 -0
- package/dist/{shared → Shared}/Loader/Loader.js +0 -0
- package/dist/{shared → Shared}/Loader/Loader.module.css +0 -0
- package/dist/{shared → Shared}/Navbar/Navbar.d.ts +0 -0
- package/dist/{shared → Shared}/Navbar/Navbar.js +0 -0
- package/dist/{shared → Shared}/Rating/Rating.js +2 -2
- /package/dist/{shared → Shared}/Rating/Ratings/LikeRating.d.ts +0 -0
- /package/dist/{shared → Shared}/Rating/Ratings/SatisfactionRating.d.ts +0 -0
- /package/dist/{shared → Shared}/Rating/Ratings/ScaleRating.d.ts +0 -0
- /package/dist/{shared → Shared}/RoundedButton/RoundedButton.d.ts +0 -0
- /package/dist/{shared → Shared}/RoundedButton/RoundedButton.js +0 -0
- /package/dist/{shared → Shared}/RoundedCheckBox/RoundedCheckBox.js +0 -0
- /package/dist/{shared → Shared}/RoundedDatePicker/RoundedDatePicker.d.ts +0 -0
- /package/dist/{shared → Shared}/RoundedDatePicker/RoundedDatePicker.js +0 -0
- /package/dist/{shared → Shared}/RoundedSelect/RoundedSelect.d.ts +0 -0
- /package/dist/{shared → Shared}/RoundedSelect/RoundedSelect.js +0 -0
- /package/dist/{shared → Shared}/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -0
- /package/dist/{AxiosAPI.d.ts → Utils/AxiosAPI.d.ts} +0 -0
- /package/dist/{AxiosAPI.js → Utils/AxiosAPI.js} +0 -0
- /package/dist/{AxiosWidget.d.ts → Utils/AxiosWidget.d.ts} +0 -0
- /package/dist/{AxiosWidget.js → Utils/AxiosWidget.js} +0 -0
- /package/dist/{utils/CbrFunctions.d.ts → Utils/CBRFunctions.d.ts} +0 -0
- /package/dist/{utils/CbrFunctions.js → Utils/CBRFunctions.js} +0 -0
|
@@ -45,11 +45,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
49
|
+
var t = {};
|
|
50
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
51
|
+
t[p] = s[p];
|
|
52
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
53
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
54
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
55
|
+
t[p[i]] = s[p[i]];
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
};
|
|
48
59
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
60
|
import SmartSelectStep from '../../SmartSelectStep/SmartSelectStep';
|
|
50
61
|
import CBRFormStepTypes from '../../../constants/CBRFormStepTypes';
|
|
51
62
|
import axios from 'axios';
|
|
52
|
-
import InputIcon from '../../../
|
|
63
|
+
import InputIcon from '../../../Shared/InputIcon/InputIcon';
|
|
64
|
+
import FormContext from '../../../Contexts/FormContext';
|
|
65
|
+
import { useContext } from 'react';
|
|
53
66
|
function CBRElementStepComponent(props) {
|
|
54
67
|
return (_jsx(SmartSelectStep, __assign({}, props, { step: props.step, icon: _jsx(InputIcon, { icon: 'LEAK' }), getOptions: getElementOptions, getOptionSelected: function (option, value) {
|
|
55
68
|
return option.id === value.id;
|
|
@@ -60,57 +73,55 @@ function CBRElementStepComponent(props) {
|
|
|
60
73
|
else {
|
|
61
74
|
return null;
|
|
62
75
|
}
|
|
63
|
-
}
|
|
76
|
+
}, renderNestedSteps: function (value) { return (_jsx(ElementSubStepRenderer, __assign({ value: value }, props))); } })));
|
|
64
77
|
}
|
|
65
78
|
export default CBRElementStepComponent;
|
|
66
79
|
function ElementSubStepRenderer(_a) {
|
|
67
80
|
var _b;
|
|
68
|
-
var value = _a.value, stepProps = _a
|
|
81
|
+
var value = _a.value, stepProps = __rest(_a, ["value"]);
|
|
82
|
+
var form = useContext(FormContext);
|
|
69
83
|
if (!value || stepProps == undefined) {
|
|
70
84
|
return _jsx("div", {});
|
|
71
85
|
}
|
|
72
|
-
var subStep =
|
|
86
|
+
var subStep = form.steps[(_b = stepProps.step.subStep) !== null && _b !== void 0 ? _b : ''];
|
|
73
87
|
if ((subStep === null || subStep === void 0 ? void 0 : subStep.type) !== CBRFormStepTypes.CBR_LOCATIVAS) {
|
|
74
88
|
return _jsx("div", {});
|
|
75
89
|
}
|
|
76
90
|
return (_jsx(SmartSelectStep, __assign({}, stepProps, { step: subStep, level: stepProps.level + 1, icon: _jsx(InputIcon, { icon: 'LEAK' }), getOptions: getElementOptions, calcDepError: calcDepError, getOptionSelected: function (option, value) {
|
|
77
91
|
return option.id === value.id;
|
|
78
|
-
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }
|
|
92
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }, renderNestedSteps: function (value) { return (_jsx(ElementSubStepRenderer, __assign({ value: value }, stepProps, { step: subStep }))); } })));
|
|
79
93
|
}
|
|
80
|
-
var getElementOptions = function (
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
case 2: return [2 /*return*/, null];
|
|
110
|
-
}
|
|
111
|
-
});
|
|
94
|
+
var getElementOptions = function (idOrganization, step, dependencyStore) { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
+
var idProyecto, response, father_1;
|
|
96
|
+
var _a, _b, _c;
|
|
97
|
+
return __generator(this, function (_d) {
|
|
98
|
+
switch (_d.label) {
|
|
99
|
+
case 0:
|
|
100
|
+
if (!(step.dependencies && idOrganization)) return [3 /*break*/, 2];
|
|
101
|
+
idProyecto = (_b = (_a = dependencyStore[step.dependencies[0]]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.id;
|
|
102
|
+
if (!idProyecto) {
|
|
103
|
+
return [2 /*return*/, null]; //null para indicar que falta la depedency
|
|
104
|
+
}
|
|
105
|
+
return [4 /*yield*/, axios.get("https://integrations.".concat(process.env.REACT_APP_DOMAIN, "/sinco/cbr/Locativas?idOrganization=").concat(idOrganization))];
|
|
106
|
+
case 1:
|
|
107
|
+
response = (_d.sent()).data;
|
|
108
|
+
father_1 = (_c = dependencyStore[step.dependencies[1]]) === null || _c === void 0 ? void 0 : _c.value;
|
|
109
|
+
if (father_1 !== undefined && father_1.id === undefined) {
|
|
110
|
+
return [2 /*return*/, null];
|
|
111
|
+
}
|
|
112
|
+
return [2 /*return*/, response.filter(function (locativa) {
|
|
113
|
+
if (father_1 === null || father_1 === void 0 ? void 0 : father_1.id) {
|
|
114
|
+
return (locativa.id.startsWith(father_1.id) &&
|
|
115
|
+
locativa.id !== father_1.id);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
return locativa.id.length === 2;
|
|
119
|
+
}
|
|
120
|
+
})];
|
|
121
|
+
case 2: return [2 /*return*/, null];
|
|
122
|
+
}
|
|
112
123
|
});
|
|
113
|
-
};
|
|
124
|
+
}); };
|
|
114
125
|
var calcDepError = function (steps) {
|
|
115
126
|
for (var _i = 0, steps_1 = steps; _i < steps_1.length; _i++) {
|
|
116
127
|
var step = steps_1[_i];
|
|
@@ -12,8 +12,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
14
14
|
import MaterialCBRIncidentsStep from './MaterialCBRIncidentsStep/MaterialCBRIncidentsStep';
|
|
15
|
+
import { useAppSelector } from '../../../hooks';
|
|
15
16
|
function CBRIncidentsStep(props) {
|
|
16
|
-
|
|
17
|
+
var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
|
|
18
|
+
switch (formStyle.type) {
|
|
17
19
|
case FormStyleTypes.MATERIAL:
|
|
18
20
|
default: {
|
|
19
21
|
return _jsx(MaterialCBRIncidentsStep, __assign({}, props));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CBRIncidentsStepProps } from '../../CBRIncidentsStep';
|
|
3
3
|
import { Incident } from '../MaterialCBRIncidentsStep';
|
|
4
|
-
declare function IncidentComponent({ step,
|
|
4
|
+
declare function IncidentComponent({ step, level, incident, handleDelete, ...others }: CBRIncidentsStepProps & {
|
|
5
5
|
incident: Incident;
|
|
6
|
-
handleDelete:
|
|
6
|
+
handleDelete: () => void;
|
|
7
7
|
}): JSX.Element;
|
|
8
8
|
export default IncidentComponent;
|
package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js
CHANGED
|
@@ -25,25 +25,31 @@ import styles from './Incident.module.css';
|
|
|
25
25
|
import StepComponent from '../../../../Step';
|
|
26
26
|
import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded';
|
|
27
27
|
import TextAreaStep from '../../../../TextAreaStep/TextAreaStep';
|
|
28
|
+
import FormContext from '../../../../../Contexts/FormContext';
|
|
29
|
+
import { useAppSelector } from '../../../../../hooks';
|
|
30
|
+
import { useContext } from 'react';
|
|
28
31
|
function IncidentComponent(_a) {
|
|
29
|
-
var step = _a.step,
|
|
32
|
+
var step = _a.step, level = _a.level, incident = _a.incident, handleDelete = _a.handleDelete, others = __rest(_a, ["step", "level", "incident", "handleDelete"]);
|
|
33
|
+
var _b = useAppSelector(function (state) { return state.global; }), formStyle = _b.formStyle, postview = _b.postview;
|
|
34
|
+
var form = useContext(FormContext);
|
|
35
|
+
var widthStats = useAppSelector(function (state) { return state.widthStats; });
|
|
30
36
|
var spaceStep = form.steps[incident.idSpaceStep];
|
|
31
37
|
var elementStep = form.steps[incident.idElementStep];
|
|
32
38
|
var commentStep = form.steps[incident.idCommentStep];
|
|
33
39
|
if (incident.deleted) {
|
|
34
40
|
return _jsx("div", {});
|
|
35
41
|
}
|
|
36
|
-
return (_jsx("div", __assign({ className:
|
|
42
|
+
return (_jsx("div", __assign({ className: widthStats.isMobile || form.size.blockNum < 3
|
|
37
43
|
? styles.mobileContainer
|
|
38
44
|
: styles.container }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
|
|
39
45
|
width: (form.size.blockSize + form.size.spacingSize) *
|
|
40
46
|
(form.size.blockNum - 1),
|
|
41
|
-
} }, { children: [_jsxs("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: [step.unitLabel + ' ' + incident.num, ":"] })), _jsx("div", __assign({ className: !others.editable ||
|
|
47
|
+
} }, { children: [_jsxs("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: [step.unitLabel + ' ' + incident.num, ":"] })), _jsx("div", __assign({ className: !others.editable || postview
|
|
42
48
|
? styles.disabledDeleteBtn
|
|
43
49
|
: styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
|
|
44
|
-
if (others.editable && !
|
|
50
|
+
if (others.editable && !postview) {
|
|
45
51
|
handleDelete();
|
|
46
52
|
}
|
|
47
|
-
} }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })), _jsx(StepComponent, __assign({}, others, {
|
|
53
|
+
} }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })), _jsx(StepComponent, __assign({}, others, { step: spaceStep, level: level + 1 })), _jsx(StepComponent, __assign({}, others, { step: elementStep, level: level + 1 })), _jsx(TextAreaStep, __assign({}, others, { step: commentStep, maxLength: 200, level: level + 1 }))] })) })));
|
|
48
54
|
}
|
|
49
55
|
export default IncidentComponent;
|
|
@@ -31,18 +31,26 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
31
31
|
};
|
|
32
32
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
33
|
/* eslint-disable no-console */
|
|
34
|
-
import { useEffect, useState } from 'react';
|
|
35
|
-
import { Controller } from 'react-hook-form';
|
|
34
|
+
import { useContext, useEffect, useState } from 'react';
|
|
36
35
|
import CBRFormStepTypes from '../../../../constants/CBRFormStepTypes';
|
|
37
36
|
import IncidentComponent from './Incident/Incident';
|
|
38
37
|
import styles from './MaterialCBRIncidentsStep.module.css';
|
|
39
38
|
import { nanoid } from 'nanoid';
|
|
40
|
-
import RoundedButton from '../../../../
|
|
39
|
+
import RoundedButton from '../../../../Shared/RoundedButton/RoundedButton';
|
|
40
|
+
import FormContext from '../../../../Contexts/FormContext';
|
|
41
|
+
import { addStepsDependencies } from '../../../../States/SiteStateReducer';
|
|
42
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
43
|
+
import CustomContext from '../../../../Contexts/CustomContext';
|
|
44
|
+
import { Controller } from 'react-hook-form';
|
|
41
45
|
function Incidents(_a) {
|
|
42
|
-
var step = _a.step,
|
|
46
|
+
var step = _a.step, btnRef = _a.btnRef, editable = _a.editable, onChange = _a.onChange, incidents = _a.incidents, others = __rest(_a, ["step", "btnRef", "editable", "onChange", "incidents"]);
|
|
47
|
+
var customSteps = useContext(CustomContext).customSteps;
|
|
48
|
+
var _b = useAppSelector(function (state) { return state.global; }), formStyle = _b.formStyle, postview = _b.postview;
|
|
49
|
+
var dispatch = useAppDispatch();
|
|
50
|
+
var form = useContext(FormContext);
|
|
43
51
|
/** Form to pass down with aditional steps */
|
|
44
|
-
var
|
|
45
|
-
var
|
|
52
|
+
var _c = useState(__assign(__assign({}, form), { steps: __assign({}, form.steps) })), localForm = _c[0], setLocalForm = _c[1];
|
|
53
|
+
var _d = useState(false), firstRender = _d[0], setFirstRender = _d[1];
|
|
46
54
|
useEffect(function () {
|
|
47
55
|
setFirstRender(true);
|
|
48
56
|
}, []);
|
|
@@ -52,6 +60,7 @@ function Incidents(_a) {
|
|
|
52
60
|
}
|
|
53
61
|
}, [firstRender]);
|
|
54
62
|
var handleAddIncident = function () {
|
|
63
|
+
var _a, _b;
|
|
55
64
|
var current = incidents.filter(function (incident) { return !incident.deleted; });
|
|
56
65
|
var newIncident = {
|
|
57
66
|
idSpaceStep: CBRFormStepTypes.CBR_TIPO_ESPACIO + '-' + nanoid(),
|
|
@@ -62,40 +71,33 @@ function Incidents(_a) {
|
|
|
62
71
|
var newSteps = __assign({}, localForm.steps);
|
|
63
72
|
newSteps[newIncident.idSpaceStep] = __assign(__assign({}, step.spaceStep), { id: newIncident.idSpaceStep, type: CBRFormStepTypes.CBR_TIPO_ESPACIO, dependencies: step.dependencies });
|
|
64
73
|
newSteps[newIncident.idCommentStep] = __assign(__assign({}, step.commentStep), { id: newIncident.idCommentStep, type: CBRFormStepTypes.CBR_COMENTARIO });
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
74
|
+
addRecursiveElementStep(newIncident.idElementStep, step.elementStep, null, newSteps, (_b = (_a = step.dependencies) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '');
|
|
75
|
+
onChange(__spreadArray(__spreadArray([], incidents, true), [newIncident], false));
|
|
76
|
+
setLocalForm(__assign(__assign({}, localForm), { steps: newSteps }));
|
|
77
|
+
dispatch(addStepsDependencies({
|
|
78
|
+
steps: newSteps,
|
|
79
|
+
customSteps: customSteps,
|
|
80
|
+
}));
|
|
73
81
|
};
|
|
74
|
-
var addRecursiveElementStep = function (idStep, step, idParent, steps,
|
|
75
|
-
var _a, _b;
|
|
82
|
+
var addRecursiveElementStep = function (idStep, step, idParent, steps, idProjectDep) {
|
|
76
83
|
var idSubStep = CBRFormStepTypes.CBR_LOCATIVAS + '-' + nanoid();
|
|
77
84
|
var newSubStep = step.subStep ? __assign({}, step.subStep) : undefined;
|
|
78
85
|
var newStep = __assign(__assign({}, step), { id: idStep, type: CBRFormStepTypes.CBR_LOCATIVAS, dependencies: [idProjectDep], subStep: null });
|
|
86
|
+
if (idParent)
|
|
87
|
+
newStep.dependencies.push(idParent);
|
|
79
88
|
if (newSubStep) {
|
|
80
89
|
newStep.subStep = idSubStep;
|
|
81
90
|
}
|
|
82
|
-
if (idParent) {
|
|
83
|
-
dependencyStore[idParent] = {
|
|
84
|
-
type: steps[idParent].type,
|
|
85
|
-
value: null,
|
|
86
|
-
};
|
|
87
|
-
(_b = (_a = newStep.dependencies) === null || _a === void 0 ? void 0 : _a.push) === null || _b === void 0 ? void 0 : _b.call(_a, idParent);
|
|
88
|
-
}
|
|
89
91
|
steps[idStep] = newStep;
|
|
90
92
|
if (newSubStep) {
|
|
91
|
-
addRecursiveElementStep(idSubStep, newSubStep, idStep, steps,
|
|
93
|
+
addRecursiveElementStep(idSubStep, newSubStep, idStep, steps, idProjectDep);
|
|
92
94
|
}
|
|
93
95
|
};
|
|
94
96
|
return (_jsxs("div", __assign({ className: styles.container, style: { color: formStyle.textColor } }, { children: [_jsx("div", __assign({ className: styles.titleLbl }, { children: step.label })), step.description && (_jsx("p", __assign({ className: styles.descriptionPar, style: {
|
|
95
97
|
margin: step.description
|
|
96
98
|
? '10px 0px'
|
|
97
99
|
: '0px 0px 5px 0px',
|
|
98
|
-
} }, { children: step.description }))), incidents.map(function (incident, index) { return (_jsx(IncidentComponent, __assign({ incident: incident,
|
|
100
|
+
} }, { children: step.description }))), incidents.map(function (incident, index) { return (_jsx(IncidentComponent, __assign({ incident: incident, step: step, editable: editable, handleDelete: function () {
|
|
99
101
|
var tempIncidents = __spreadArray([], incidents, true);
|
|
100
102
|
tempIncidents[index].deleted = true;
|
|
101
103
|
var n = 1;
|
|
@@ -107,14 +109,14 @@ function Incidents(_a) {
|
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
111
|
onChange(tempIncidents);
|
|
110
|
-
} }, others), index)); }), _jsxs("div", __assign({ className: styles.btnContainer }, { children: [_jsx("input", { ref: btnRef, className:
|
|
112
|
+
} }, others), index)); }), _jsxs("div", __assign({ className: styles.btnContainer }, { children: [_jsx("input", { ref: btnRef, className: 'hidden-input' }), _jsx(RoundedButton, { disabled: !editable || postview, text: step.addBtnLabel, color: formStyle.primaryContrastColor, backgroundColor: formStyle.primaryColor, fontSize: '1rem', padding: '5px 15px 5px 15px', onClick: function () {
|
|
111
113
|
if (editable && !postview) {
|
|
112
114
|
handleAddIncident();
|
|
113
115
|
}
|
|
114
116
|
} })] }))] })));
|
|
115
117
|
}
|
|
116
118
|
function CBRIncidentsStep(props) {
|
|
117
|
-
return (_jsx(Controller, { name: props.step.id,
|
|
119
|
+
return (_jsx(Controller, { name: props.step.id, defaultValue: [], rules: {
|
|
118
120
|
required: props.step.required
|
|
119
121
|
? 'Este campo es obligatorio'
|
|
120
122
|
: undefined,
|
|
@@ -53,41 +53,49 @@ import WarningRoundedIcon from '@material-ui/icons/WarningRounded';
|
|
|
53
53
|
import axios from 'axios';
|
|
54
54
|
import React, { useState } from 'react';
|
|
55
55
|
import { Dialog } from '@material-ui/core';
|
|
56
|
-
import RoundedButton from '../../../
|
|
57
|
-
import InputIcon from '../../../
|
|
56
|
+
import RoundedButton from '../../../Shared/RoundedButton/RoundedButton';
|
|
57
|
+
import InputIcon from '../../../Shared/InputIcon/InputIcon';
|
|
58
|
+
import { useAppSelector } from '../../../hooks';
|
|
59
|
+
import CBRFormStepTypes from '../../../constants/CBRFormStepTypes';
|
|
58
60
|
var baseUrl = "https://integrations.".concat(process.env.REACT_APP_DOMAIN, "/sinco/cbr/");
|
|
59
61
|
function CBRPropertyStepComponent(props) {
|
|
60
62
|
var _this = this;
|
|
63
|
+
var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
|
|
61
64
|
var _a = useState(undefined), showWarning = _a[0], setShowWarning = _a[1];
|
|
62
|
-
var getInmueblesOptions = function (
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
case 2: return [2 /*return*/, null];
|
|
85
|
-
}
|
|
86
|
-
});
|
|
65
|
+
var getInmueblesOptions = function (idOrganization, step, dependencyStore) { return __awaiter(_this, void 0, void 0, function () {
|
|
66
|
+
var idProyecto, idMacroProyecto;
|
|
67
|
+
var _a, _b, _c, _d;
|
|
68
|
+
return __generator(this, function (_e) {
|
|
69
|
+
switch (_e.label) {
|
|
70
|
+
case 0:
|
|
71
|
+
if (!(step.dependencies && idOrganization)) return [3 /*break*/, 2];
|
|
72
|
+
idProyecto = (_b = (_a = dependencyStore[step.dependencies[0]]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.id;
|
|
73
|
+
idMacroProyecto = (_d = (_c = dependencyStore[step.dependencies[0]]) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.idMacroProyecto;
|
|
74
|
+
if (!idProyecto) {
|
|
75
|
+
return [2 /*return*/, null]; //null para indicar que falta la depedency
|
|
76
|
+
}
|
|
77
|
+
return [4 /*yield*/, axios.get(baseUrl +
|
|
78
|
+
'Inmuebles?idMacro=' +
|
|
79
|
+
idMacroProyecto +
|
|
80
|
+
'&idProyecto=' +
|
|
81
|
+
idProyecto +
|
|
82
|
+
'&idOrganization=' +
|
|
83
|
+
idOrganization)];
|
|
84
|
+
case 1: return [2 /*return*/, (_e.sent()).data];
|
|
85
|
+
case 2: return [2 /*return*/, null];
|
|
86
|
+
}
|
|
87
87
|
});
|
|
88
|
-
};
|
|
89
|
-
return (_jsxs(React.Fragment, { children: [_jsx(SmartSelectStep, __assign({}, props, {
|
|
88
|
+
}); };
|
|
89
|
+
return (_jsxs(React.Fragment, { children: [_jsx(SmartSelectStep, __assign({}, props, { icon: _jsx(InputIcon, { icon: 'PROPERTY' }), getOptionSelected: function (option, value) {
|
|
90
90
|
return option.id === value.id;
|
|
91
|
+
}, calcDepError: function (steps) {
|
|
92
|
+
for (var _i = 0, steps_1 = steps; _i < steps_1.length; _i++) {
|
|
93
|
+
var step = steps_1[_i];
|
|
94
|
+
if (step.type === CBRFormStepTypes.CBR_PROYECTO) {
|
|
95
|
+
return 'Selecciona un proyecto';
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
91
99
|
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }, getValueWarning: props.step.validation
|
|
92
100
|
? function (value) {
|
|
93
101
|
if (value &&
|
|
@@ -129,9 +137,9 @@ function CBRPropertyStepComponent(props) {
|
|
|
129
137
|
maxWidth: '100vw',
|
|
130
138
|
boxSizing: 'content-box',
|
|
131
139
|
},
|
|
132
|
-
}, open: true }, { children: _jsxs("div", __assign({ className: styles.confirmationContainer, style: { color:
|
|
140
|
+
}, open: true }, { children: _jsxs("div", __assign({ className: styles.confirmationContainer, style: { color: formStyle.textColor } }, { children: [_jsx("div", __assign({ className: styles.closeIcon, onClick: function () {
|
|
133
141
|
setShowWarning(undefined);
|
|
134
|
-
} }, { children: _jsx(CloseRoundedIcon, { fontSize: "inherit" }) })), _jsxs("div", __assign({ className: styles.container }, { children: [_jsx("div", __assign({ className: styles.warningContainer, style: { color:
|
|
142
|
+
} }, { children: _jsx(CloseRoundedIcon, { fontSize: "inherit" }) })), _jsxs("div", __assign({ className: styles.container }, { children: [_jsx("div", __assign({ className: styles.warningContainer, style: { color: formStyle.primaryColor } }, { children: _jsx(WarningRoundedIcon, { fontSize: "inherit", style: { fontSize: '160px' } }) })), _jsxs("div", __assign({ className: styles.messageContainer }, { children: ["La garant\u00EDa de su inmueble expir\u00F3 el d\u00EDa", ' ', showWarning.toLocaleDateString(), "."] })), _jsx("div", __assign({ className: styles.btnContainer }, { children: _jsx(RoundedButton, { text: 'Continuar', color: formStyle.primaryContrastColor, backgroundColor: formStyle.primaryColor, fontSize: '1rem', padding: '5px 15px 5px 15px', onClick: function () {
|
|
135
143
|
setShowWarning(undefined);
|
|
136
144
|
} }) }))] }))] })) })))] }));
|
|
137
145
|
}
|
|
@@ -75,52 +75,51 @@ function AYFStepMapper(props) {
|
|
|
75
75
|
]];
|
|
76
76
|
});
|
|
77
77
|
}); };
|
|
78
|
-
var getCiudadesOptions = function (
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
78
|
+
var getCiudadesOptions = function (idOrganization, step, dependencyStore) { return __awaiter(_this, void 0, void 0, function () {
|
|
79
|
+
var nit, params, _i, _a, dep, value, error_1;
|
|
80
|
+
var _b, _c, _d, _e;
|
|
81
|
+
return __generator(this, function (_f) {
|
|
82
|
+
switch (_f.label) {
|
|
83
|
+
case 0:
|
|
84
|
+
if (!idOrganization)
|
|
85
|
+
return [2 /*return*/, null];
|
|
86
|
+
nit = (_b = dependencyStore[step.idNitStep]) === null || _b === void 0 ? void 0 : _b.value;
|
|
87
|
+
params = new URLSearchParams({
|
|
88
|
+
idOrganization: idOrganization,
|
|
89
|
+
idCompany: nit,
|
|
90
|
+
nit: 'true',
|
|
91
|
+
});
|
|
92
|
+
for (_i = 0, _a = (_c = step.dependencies) !== null && _c !== void 0 ? _c : []; _i < _a.length; _i++) {
|
|
93
|
+
dep = _a[_i];
|
|
94
|
+
value = (_d = dependencyStore[dep]) === null || _d === void 0 ? void 0 : _d.value;
|
|
95
|
+
if (value && dep.startsWith('AYF')) {
|
|
96
|
+
switch ((_e = dep.split('-')) === null || _e === void 0 ? void 0 : _e[0]) {
|
|
97
|
+
case AYFFormStepTypes.AYF_START_MONTH:
|
|
98
|
+
params.set('startMonth', value.id);
|
|
99
|
+
break;
|
|
100
|
+
case AYFFormStepTypes.AYF_END_MONTH:
|
|
101
|
+
params.set('endMonth', value.id);
|
|
102
|
+
break;
|
|
103
|
+
case AYFFormStepTypes.AYF_YEAR:
|
|
104
|
+
params.set('year', value);
|
|
105
|
+
break;
|
|
106
|
+
default:
|
|
107
|
+
break;
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
110
|
+
}
|
|
111
|
+
_f.label = 1;
|
|
112
|
+
case 1:
|
|
113
|
+
_f.trys.push([1, 3, , 4]);
|
|
114
|
+
return [4 /*yield*/, axios.get(baseUrl + 'CiudadesICA?' + params.toString())];
|
|
115
|
+
case 2: return [2 /*return*/, (_f.sent()).data];
|
|
116
|
+
case 3:
|
|
117
|
+
error_1 = _f.sent();
|
|
118
|
+
return [2 /*return*/, null];
|
|
119
|
+
case 4: return [2 /*return*/];
|
|
120
|
+
}
|
|
122
121
|
});
|
|
123
|
-
};
|
|
122
|
+
}); };
|
|
124
123
|
switch (props.step.type) {
|
|
125
124
|
case AYFFormStepTypes.AYF_START_MONTH:
|
|
126
125
|
case AYFFormStepTypes.AYF_END_MONTH:
|
|
@@ -11,5 +11,5 @@ export interface ApiSelectorStepProps extends StepProps {
|
|
|
11
11
|
/** Default value to display */
|
|
12
12
|
defaultValue?: Date | null;
|
|
13
13
|
}
|
|
14
|
-
declare function ApiSelectorStep(
|
|
14
|
+
declare function ApiSelectorStep(props: ApiSelectorStepProps): JSX.Element;
|
|
15
15
|
export default ApiSelectorStep;
|
|
@@ -9,23 +9,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
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
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
13
|
import { FormStyleTypes } from '../../constants/FormStepTypes';
|
|
14
|
+
import { useAppSelector } from '../../hooks';
|
|
25
15
|
import MaterialApiSelectorStep from './MaterialApiSelectorStep/MaterialApiSelectorStep';
|
|
26
|
-
function ApiSelectorStep(
|
|
27
|
-
var
|
|
28
|
-
switch (
|
|
16
|
+
function ApiSelectorStep(props) {
|
|
17
|
+
var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
|
|
18
|
+
switch (formStyle.type) {
|
|
29
19
|
case FormStyleTypes.MATERIAL:
|
|
30
20
|
default: {
|
|
31
21
|
return _jsx(MaterialApiSelectorStep, __assign({}, props));
|