@arquimedes.co/eureka-forms 1.9.27-test → 1.9.29-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/CBRFormStep.d.ts +1 -3
- package/dist/@Types/FormStep.d.ts +25 -2
- package/dist/App.d.ts +2 -1
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.d.ts +2 -0
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +74 -50
- package/dist/FormComponents/Form/Form.js +3 -1
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +1 -1
- package/dist/FormComponents/Section/Section.js +1 -3
- package/dist/FormComponents/Step/@Construction/CBRElementStep/CBRElementStep.d.ts +8 -0
- package/dist/FormComponents/Step/@Construction/{CBRLocativasStep/CBRLocativasStep.js → CBRElementStep/CBRElementStep.js} +14 -23
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +1 -3
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +1 -1
- package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +3 -3
- package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +2 -6
- package/dist/FormComponents/Step/CBRStepMapper.js +13 -30
- package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +1 -3
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +13 -2
- package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +1 -3
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +3 -3
- package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +1 -3
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +13 -2
- package/dist/FormComponents/Step/EntityValueStep/EntityValueStep.d.ts +15 -0
- package/dist/FormComponents/Step/EntityValueStep/EntityValueStep.js +129 -0
- package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +1 -3
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +13 -2
- package/dist/FormComponents/Step/MapperStep/MapperStep.d.ts +9 -0
- package/dist/FormComponents/Step/MapperStep/MapperStep.js +35 -0
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/MapperElement.d.ts +11 -0
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/MapperElement.js +49 -0
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/MapperElement.module.css +60 -0
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +8 -0
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/MaterialMapperStep.js +182 -0
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/MaterialMapperStep.module.css +13 -0
- package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.js +2 -2
- package/dist/FormComponents/Step/RatingStep/RatingStep.js +1 -3
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +3 -3
- package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +1 -3
- package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +1 -3
- package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +17 -6
- package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.d.ts +3 -3
- package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +1 -3
- package/dist/FormComponents/Step/Step.d.ts +1 -1
- package/dist/FormComponents/Step/Step.js +8 -0
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +13 -2
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +1 -3
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +13 -2
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +1 -3
- package/dist/FormComponents/Step/TitleStep/TitleStep.js +1 -3
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +13 -2
- package/dist/FormComponents/Term/Term.js +1 -3
- package/dist/Icons/Construction/LeakIcon.d.ts +3 -0
- package/dist/Icons/Construction/LeakIcon.js +16 -0
- package/dist/Icons/Construction/ProjectIcon.d.ts +3 -0
- package/dist/Icons/Construction/ProjectIcon.js +16 -0
- package/dist/Icons/Construction/PropertyIcon.d.ts +3 -0
- package/dist/Icons/Construction/PropertyIcon.js +16 -0
- package/dist/Icons/Construction/SpaceIcon.d.ts +3 -0
- package/dist/Icons/Construction/SpaceIcon.js +16 -0
- package/dist/Icons/DocumentIcon.d.ts +3 -0
- package/dist/Icons/DocumentIcon.js +16 -0
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -0
- package/dist/Icons/Entities/GenericEntityIcon.js +17 -0
- package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -0
- package/dist/Icons/Entities/HandshakeIcon.js +17 -0
- package/dist/constants/FormStepTypes.d.ts +9 -3
- package/dist/constants/FormStepTypes.js +21 -14
- package/dist/constants/IconTypes.d.ts +10 -0
- package/dist/constants/IconTypes.js +11 -0
- package/dist/index.lib.d.ts +0 -1
- package/dist/index.lib.js +0 -1
- package/dist/shared/InputIcon/InputIcon.d.ts +7 -0
- package/dist/shared/InputIcon/InputIcon.js +81 -0
- package/dist/shared/RoundedSelect/RoundedSelect.js +17 -3
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +12 -5
- package/dist/utils/CbrFunctions.js +1 -1
- package/package.json +2 -2
- package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.d.ts +0 -8
|
@@ -9,6 +9,17 @@ 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
|
+
};
|
|
12
23
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
24
|
import styles from './MaterialCheckBoxStep.module.css';
|
|
14
25
|
import { calcStepWidth } from '../../StepFunctions';
|
|
@@ -26,8 +37,8 @@ function CheckBoxStep(_a) {
|
|
|
26
37
|
? 'Este campo es obligatorio'
|
|
27
38
|
: undefined,
|
|
28
39
|
}, shouldUnregister: true, render: function (_a) {
|
|
29
|
-
var
|
|
30
|
-
return (_jsx(RoundedCheckBox, __assign({}, field, { "data-testid": step.id, inputRef:
|
|
40
|
+
var _b = _a.field, ref = _b.ref, field = __rest(_b, ["ref"]);
|
|
41
|
+
return (_jsx(RoundedCheckBox, __assign({}, field, { "data-testid": step.id, inputRef: ref, padding: "0px", size: "1.6rem", error: !!errors[step.id], cantEdit: !editable || postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: field.value })));
|
|
31
42
|
} })] })), (step.description || !!errors[step.id]) && (_jsx("div", __assign({ className: styles.descriptionPar, style: {
|
|
32
43
|
color: !!errors[step.id]
|
|
33
44
|
? formStyle.errorColor
|
|
@@ -26,9 +26,7 @@ import MaterialClassifierSelectorStep from './MaterialClassifierSelectorStep/Mat
|
|
|
26
26
|
function ClassifierSelectorStep(_a) {
|
|
27
27
|
var formStyle = _a.formStyle, others = __rest(_a, ["formStyle"]);
|
|
28
28
|
switch (formStyle.type) {
|
|
29
|
-
case FormStyleTypes.MATERIAL:
|
|
30
|
-
return (_jsx(MaterialClassifierSelectorStep, __assign({ formStyle: formStyle }, others)));
|
|
31
|
-
}
|
|
29
|
+
case FormStyleTypes.MATERIAL:
|
|
32
30
|
default: {
|
|
33
31
|
return (_jsx(MaterialClassifierSelectorStep, __assign({ formStyle: formStyle }, others)));
|
|
34
32
|
}
|
|
@@ -58,7 +58,7 @@ function ClassifierSelector(_a) {
|
|
|
58
58
|
: { value: classifier._id, label: classifier.name };
|
|
59
59
|
});
|
|
60
60
|
var sizeChange = function () {
|
|
61
|
-
handleSizeChange();
|
|
61
|
+
handleSizeChange === null || handleSizeChange === void 0 ? void 0 : handleSizeChange();
|
|
62
62
|
if (level === 0) {
|
|
63
63
|
setFillerSize(calcFillerSize(step, form.steps, getValues(), form.size));
|
|
64
64
|
}
|
|
@@ -112,7 +112,7 @@ function ClassifierSelectorStep(props) {
|
|
|
112
112
|
? 'Este campo es obligatorio'
|
|
113
113
|
: undefined,
|
|
114
114
|
}, shouldUnregister: true, render: function (_a) {
|
|
115
|
-
var
|
|
116
|
-
return (_jsx(ClassifierSelector, __assign({}, props, { inputRef:
|
|
115
|
+
var _b = _a.field, ref = _b.ref, field = __rest(_b, ["ref"]);
|
|
116
|
+
return (_jsx(ClassifierSelector, __assign({}, props, field, { inputRef: ref })));
|
|
117
117
|
} }));
|
|
118
118
|
}
|
|
@@ -14,9 +14,7 @@ import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
|
14
14
|
import MaterialDatePickerStep from './MaterialDatePickerStep/MaterialDatePickerStep';
|
|
15
15
|
function DatePickerStep(props) {
|
|
16
16
|
switch (props.formStyle.type) {
|
|
17
|
-
case FormStyleTypes.MATERIAL:
|
|
18
|
-
return _jsx(MaterialDatePickerStep, __assign({}, props));
|
|
19
|
-
}
|
|
17
|
+
case FormStyleTypes.MATERIAL:
|
|
20
18
|
default: {
|
|
21
19
|
return _jsx(MaterialDatePickerStep, __assign({}, props));
|
|
22
20
|
}
|
package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js
CHANGED
|
@@ -9,6 +9,17 @@ 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
|
+
};
|
|
12
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
24
|
import styles from './MaterialDatePickerStep.module.css';
|
|
14
25
|
import { Controller } from 'react-hook-form';
|
|
@@ -26,8 +37,8 @@ function DatePickerStep(_a) {
|
|
|
26
37
|
? 'Este campo es obligatorio'
|
|
27
38
|
: undefined,
|
|
28
39
|
}, shouldUnregister: true, render: function (_a) {
|
|
29
|
-
var
|
|
30
|
-
return (_jsx(RoundedDatePicker, __assign({}, field, { pickTime: step.pickTime, inputRef:
|
|
40
|
+
var _b = _a.field, ref = _b.ref, field = __rest(_b, ["ref"]);
|
|
41
|
+
return (_jsx(RoundedDatePicker, __assign({}, field, { pickTime: step.pickTime, inputRef: 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]
|
|
31
42
|
? errors[step.id].message
|
|
32
43
|
: step.description, error: !!errors[step.id], required: step.required })));
|
|
33
44
|
} }) })));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { EntityValuePicker } from '../../../@Types/FormStep';
|
|
3
|
+
import { StepProps } from '../Step';
|
|
4
|
+
export interface StepOptions {
|
|
5
|
+
id: string | number;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EntityValuePickerStepProps extends StepProps {
|
|
9
|
+
/** The EntityValuePickerStep to display */
|
|
10
|
+
step: EntityValuePicker;
|
|
11
|
+
/** Default value to display */
|
|
12
|
+
defaultValue?: Date | null;
|
|
13
|
+
}
|
|
14
|
+
declare function EntityValuePickerStep({ step, ...props }: EntityValuePickerStepProps): JSX.Element;
|
|
15
|
+
export default EntityValuePickerStep;
|
|
@@ -0,0 +1,129 @@
|
|
|
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
|
+
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
|
+
};
|
|
59
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
60
|
+
import FormStepTypes, { FormStyleTypes, } from '../../../constants/FormStepTypes';
|
|
61
|
+
import InputIcon from '../../../shared/InputIcon/InputIcon';
|
|
62
|
+
import SmartSelectStep from '../SmartSelectStep/SmartSelectStep';
|
|
63
|
+
import widgetInstance from '../../../AxiosWidget';
|
|
64
|
+
import axiosInstance from '../../../AxiosAPI';
|
|
65
|
+
function EntityValuePickerStep(_a) {
|
|
66
|
+
var _this = this;
|
|
67
|
+
var step = _a.step, props = __rest(_a, ["step"]);
|
|
68
|
+
var getEntityValueOptions = function (_a, _step, dependencyStore, domain) {
|
|
69
|
+
var idOrganization = _a.idOrganization;
|
|
70
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
71
|
+
var params, _i, _b, filter, value, currentValue, url, response;
|
|
72
|
+
var _c;
|
|
73
|
+
return __generator(this, function (_d) {
|
|
74
|
+
switch (_d.label) {
|
|
75
|
+
case 0:
|
|
76
|
+
params = new URLSearchParams({
|
|
77
|
+
idOrganization: idOrganization,
|
|
78
|
+
});
|
|
79
|
+
if (domain) {
|
|
80
|
+
params.set('idOrganization', domain);
|
|
81
|
+
}
|
|
82
|
+
for (_i = 0, _b = step.filters; _i < _b.length; _i++) {
|
|
83
|
+
filter = _b[_i];
|
|
84
|
+
value = filter.value;
|
|
85
|
+
if (filter.idStep) {
|
|
86
|
+
currentValue = dependencyStore[filter.idStep];
|
|
87
|
+
if (currentValue) {
|
|
88
|
+
if (typeof currentValue === 'string')
|
|
89
|
+
value = currentValue;
|
|
90
|
+
else
|
|
91
|
+
value = (_c = currentValue.id) !== null && _c !== void 0 ? _c : currentValue.id;
|
|
92
|
+
//TODO: Manejo de multiple!
|
|
93
|
+
}
|
|
94
|
+
else if (filter.required) {
|
|
95
|
+
return [2 /*return*/, null];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (value)
|
|
99
|
+
params.set(filter.idProperty, value);
|
|
100
|
+
}
|
|
101
|
+
url = "/entities/".concat(step.idEntity, "/values?").concat(params.toString());
|
|
102
|
+
return [4 /*yield*/, (domain
|
|
103
|
+
? widgetInstance.get(url)
|
|
104
|
+
: axiosInstance.get(url))];
|
|
105
|
+
case 1:
|
|
106
|
+
response = _d.sent();
|
|
107
|
+
return [2 /*return*/, response.data];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
switch (props.formStyle.type) {
|
|
113
|
+
case FormStyleTypes.MATERIAL:
|
|
114
|
+
default: {
|
|
115
|
+
return (_jsx(SmartSelectStep, __assign({}, props, { step: step, icon: step.icon ? _jsx(InputIcon, { icon: step.icon }) : undefined, getOptions: getEntityValueOptions, getOptionSelected: function (option, value) {
|
|
116
|
+
return option._id === value._id;
|
|
117
|
+
}, calcDepError: function (steps) {
|
|
118
|
+
for (var _i = 0, steps_1 = steps; _i < steps_1.length; _i++) {
|
|
119
|
+
var step_1 = steps_1[_i];
|
|
120
|
+
if (step_1.type === FormStepTypes.ENTITYVALUEPICKER) {
|
|
121
|
+
return 'Selecciona un ' + step_1.label;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return undefined;
|
|
125
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value._id; } })));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
export default EntityValuePickerStep;
|
|
@@ -14,9 +14,7 @@ import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
|
14
14
|
import MaterialFileUploadStep from './MaterialFileUploadStep/MaterialFileUploadStep';
|
|
15
15
|
function FileUploadStep(props) {
|
|
16
16
|
switch (props.formStyle.type) {
|
|
17
|
-
case FormStyleTypes.MATERIAL:
|
|
18
|
-
return _jsx(MaterialFileUploadStep, __assign({}, props));
|
|
19
|
-
}
|
|
17
|
+
case FormStyleTypes.MATERIAL:
|
|
20
18
|
default: {
|
|
21
19
|
return _jsx(MaterialFileUploadStep, __assign({}, props));
|
|
22
20
|
}
|
package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js
CHANGED
|
@@ -45,6 +45,17 @@ 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
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
49
60
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
50
61
|
if (ar || !(i in from)) {
|
|
@@ -250,8 +261,8 @@ function UploadStepComponent(props) {
|
|
|
250
261
|
array.find(function (file) { return !file.S3Key; }) === undefined;
|
|
251
262
|
},
|
|
252
263
|
}, shouldUnregister: true, render: function (_a) {
|
|
253
|
-
var
|
|
254
|
-
return (_jsx(FileUploadStep, __assign({}, props, { btnRef:
|
|
264
|
+
var _b = _a.field, ref = _b.ref, field = __rest(_b, ["ref"]);
|
|
265
|
+
return (_jsx(FileUploadStep, __assign({}, props, field, { btnRef: ref })));
|
|
255
266
|
} }));
|
|
256
267
|
}
|
|
257
268
|
export default UploadStepComponent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Mapper } from '../../../@Types/FormStep';
|
|
3
|
+
import { StepProps } from '../Step';
|
|
4
|
+
export interface MapperStepProps extends StepProps {
|
|
5
|
+
/** The MapperStep to display */
|
|
6
|
+
step: Mapper;
|
|
7
|
+
}
|
|
8
|
+
declare function MapperStep({ step, formStyle, ...others }: MapperStepProps): JSX.Element;
|
|
9
|
+
export default MapperStep;
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
25
|
+
import MaterialMapperStep from './MaterialMapperStep/MaterialMapperStep';
|
|
26
|
+
function MapperStep(_a) {
|
|
27
|
+
var step = _a.step, formStyle = _a.formStyle, others = __rest(_a, ["step", "formStyle"]);
|
|
28
|
+
switch (formStyle.type) {
|
|
29
|
+
case FormStyleTypes.MATERIAL:
|
|
30
|
+
default: {
|
|
31
|
+
return (_jsx(MaterialMapperStep, __assign({ step: step, formStyle: formStyle }, others)));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export default MapperStep;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormStep } from '../../../../../@Types/FormStep';
|
|
3
|
+
import { MapperStepProps } from '../../MapperStep';
|
|
4
|
+
import { MapperElement } from '../MaterialMapperStep';
|
|
5
|
+
declare function MapperElementComponent({ step, form, index, level, element, formStyle, handleDelete, ...others }: MapperStepProps & {
|
|
6
|
+
index: number;
|
|
7
|
+
element: MapperElement;
|
|
8
|
+
handleDelete: Function;
|
|
9
|
+
steps: Record<string, FormStep>;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
export default MapperElementComponent;
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
import { createElement as _createElement } from "react";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded';
|
|
26
|
+
import styles from './MapperElement.module.css';
|
|
27
|
+
import StepComponent from '../../../Step';
|
|
28
|
+
function MapperElementComponent(_a) {
|
|
29
|
+
var step = _a.step, form = _a.form, index = _a.index, level = _a.level, element = _a.element, formStyle = _a.formStyle, handleDelete = _a.handleDelete, others = __rest(_a, ["step", "form", "index", "level", "element", "formStyle", "handleDelete"]);
|
|
30
|
+
if (element.deleted) {
|
|
31
|
+
return _jsx("div", {});
|
|
32
|
+
}
|
|
33
|
+
return (_jsx("div", __assign({ className: others.widthStats.isMobile || form.size.blockNum < 3
|
|
34
|
+
? styles.mobileContainer
|
|
35
|
+
: styles.container }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
|
|
36
|
+
width: (form.size.blockSize + form.size.spacingSize) *
|
|
37
|
+
(form.size.blockNum - 1),
|
|
38
|
+
} }, { children: [_jsxs("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: [step.unitLabel + ' ' + index + 1, ":"] })), _jsx("div", __assign({ className: !others.editable || others.postview
|
|
39
|
+
? styles.disabledDeleteBtn
|
|
40
|
+
: styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
|
|
41
|
+
if (others.editable && !others.postview) {
|
|
42
|
+
handleDelete();
|
|
43
|
+
}
|
|
44
|
+
} }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })), step.rootSteps.map(function (idSubStep, index) {
|
|
45
|
+
var subStep = form.steps[idSubStep];
|
|
46
|
+
return (_createElement(StepComponent, __assign({}, others, { formStyle: formStyle, form: form, step: subStep, key: index, level: level + 1 })));
|
|
47
|
+
})] })) })));
|
|
48
|
+
}
|
|
49
|
+
export default MapperElementComponent;
|
package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/MapperElement.module.css
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.container,
|
|
2
|
+
.mobileContainer {
|
|
3
|
+
background-color: #f0f0f0;
|
|
4
|
+
border: 1px solid #d6d6d6;
|
|
5
|
+
width: fit-content;
|
|
6
|
+
border-radius: 20px;
|
|
7
|
+
margin-bottom: 10px;
|
|
8
|
+
margin-top: 10px;
|
|
9
|
+
margin-left: auto;
|
|
10
|
+
margin-right: auto;
|
|
11
|
+
padding-top: 20px;
|
|
12
|
+
padding-bottom: 20px;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
.container {
|
|
16
|
+
max-width: calc(100% - 112px);
|
|
17
|
+
padding-right: 55px;
|
|
18
|
+
padding-left: 55px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.mobileContainer {
|
|
22
|
+
max-width: calc(100% - 42px);
|
|
23
|
+
padding-right: 20px;
|
|
24
|
+
padding-left: 20px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.titleLbl {
|
|
28
|
+
width: 100%;
|
|
29
|
+
font-size: 20px;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
cursor: default;
|
|
35
|
+
margin-left: 10px;
|
|
36
|
+
margin-bottom: 10px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.contentContainer {
|
|
40
|
+
margin-left: auto;
|
|
41
|
+
margin-right: auto;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-flow: row wrap;
|
|
44
|
+
height: fit-content;
|
|
45
|
+
max-width: 100%;
|
|
46
|
+
overflow-x: hidden;
|
|
47
|
+
overflow-y: hidden;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.deleteBtn,
|
|
51
|
+
.disabledDeleteBtn {
|
|
52
|
+
font-size: 24px;
|
|
53
|
+
position: absolute;
|
|
54
|
+
right: 15px;
|
|
55
|
+
top: 15px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.deleteBtn {
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MapperStepProps } from '../MapperStep';
|
|
3
|
+
export interface MapperElement {
|
|
4
|
+
ids: Record<string, string>;
|
|
5
|
+
deleted?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare function MapperStep(props: MapperStepProps): JSX.Element;
|
|
8
|
+
export default MapperStep;
|
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
|
+
if (ar || !(i in from)) {
|
|
26
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
27
|
+
ar[i] = from[i];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
+
};
|
|
32
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
+
import { useState, useEffect } from 'react';
|
|
34
|
+
import styles from './MaterialMapperStep.module.css';
|
|
35
|
+
import { Controller } from 'react-hook-form';
|
|
36
|
+
import StepTypes, { ClassifierOptionTypes, MapperStyleTypes, OptionTypes, } from '../../../../constants/FormStepTypes';
|
|
37
|
+
import RoundedButton from '../../../../shared/RoundedButton/RoundedButton';
|
|
38
|
+
import { nanoid } from 'nanoid';
|
|
39
|
+
import { calcStepDependencyValue } from '../../../Form/ColumnForm/ColumnForm';
|
|
40
|
+
import MapperElementComponent from './Element/MapperElement';
|
|
41
|
+
function Elements(_a) {
|
|
42
|
+
var step = _a.step, form = _a.form, btnRef = _a.btnRef, editable = _a.editable, postview = _a.postview, onChange = _a.onChange, elements = _a.elements, formStyle = _a.formStyle, dependencyStore = _a.dependencyStore, setDependencyStore = _a.setDependencyStore, others = __rest(_a, ["step", "form", "btnRef", "editable", "postview", "onChange", "elements", "formStyle", "dependencyStore", "setDependencyStore"]);
|
|
43
|
+
var _b = useState(false), firstRender = _b[0], setFirstRender = _b[1];
|
|
44
|
+
/** Mapper Steps to pass down */
|
|
45
|
+
var _c = useState((function () {
|
|
46
|
+
var steps = {};
|
|
47
|
+
var deps = __assign({}, dependencyStore);
|
|
48
|
+
for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
|
|
49
|
+
var element = elements_1[_i];
|
|
50
|
+
var newSteps = {};
|
|
51
|
+
for (var _a = 0, _b = Object.keys(step.steps); _a < _b.length; _a++) {
|
|
52
|
+
var idStep = _b[_a];
|
|
53
|
+
var baseStep = form.steps[idStep];
|
|
54
|
+
var newIdStep = element.ids[idStep];
|
|
55
|
+
newSteps[newIdStep] = __assign(__assign({}, baseStep), { id: newIdStep });
|
|
56
|
+
steps[newIdStep] = newSteps[newIdStep];
|
|
57
|
+
}
|
|
58
|
+
calcRecursiveData(element, newSteps, deps);
|
|
59
|
+
}
|
|
60
|
+
setDependencyStore(deps);
|
|
61
|
+
return steps;
|
|
62
|
+
})()), localSteps = _c[0], setLocalSteps = _c[1];
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
setFirstRender(true);
|
|
65
|
+
}, []);
|
|
66
|
+
useEffect(function () {
|
|
67
|
+
if (firstRender && elements.length === 0 && !postview && editable) {
|
|
68
|
+
handleAddElement();
|
|
69
|
+
}
|
|
70
|
+
}, [firstRender]);
|
|
71
|
+
var handleAddElement = function () {
|
|
72
|
+
var idElement = nanoid();
|
|
73
|
+
var newElement = {
|
|
74
|
+
ids: {},
|
|
75
|
+
};
|
|
76
|
+
var newSteps = {};
|
|
77
|
+
for (var _i = 0, _a = Object.keys(step.steps); _i < _a.length; _i++) {
|
|
78
|
+
var idStep = _a[_i];
|
|
79
|
+
var baseStep = form.steps[idStep];
|
|
80
|
+
var newIdStep = step.id + '-' + idStep + '-' + idElement;
|
|
81
|
+
newElement.ids[idStep] = newIdStep;
|
|
82
|
+
newSteps[newIdStep] = __assign(__assign({}, baseStep), { id: newIdStep });
|
|
83
|
+
}
|
|
84
|
+
var deps = __assign({}, dependencyStore);
|
|
85
|
+
calcRecursiveData(newElement, newSteps, deps);
|
|
86
|
+
onChange(__spreadArray(__spreadArray([], elements, true), [newElement], false));
|
|
87
|
+
setLocalSteps(__assign(__assign({}, localSteps), newSteps));
|
|
88
|
+
setDependencyStore(deps);
|
|
89
|
+
};
|
|
90
|
+
var calcStyles = function () {
|
|
91
|
+
switch (step.style) {
|
|
92
|
+
case MapperStyleTypes.LIST:
|
|
93
|
+
return { container: styles.listContainer };
|
|
94
|
+
case MapperStyleTypes.PILL:
|
|
95
|
+
default:
|
|
96
|
+
return { container: styles.pillContainer };
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var container = calcStyles().container;
|
|
100
|
+
return (_jsxs("div", __assign({ className: container, style: { color: formStyle.textColor } }, { children: [_jsx("div", __assign({ className: styles.titleLbl }, { children: step.label })), step.description && (_jsx("p", __assign({ className: styles.descriptionPar, style: {
|
|
101
|
+
margin: step.description
|
|
102
|
+
? '10px 0px'
|
|
103
|
+
: '0px 0px 5px 0px',
|
|
104
|
+
} }, { children: step.description }))), elements.map(function (incident, index) { return (_jsx(MapperElementComponent, __assign({ index: index, element: incident, formStyle: formStyle, step: step, form: form, steps: step.steps, editable: editable, postview: postview, dependencyStore: dependencyStore, setDependencyStore: setDependencyStore, handleDelete: function () {
|
|
105
|
+
var tempElements = __spreadArray([], elements, true);
|
|
106
|
+
tempElements[index].deleted = true;
|
|
107
|
+
onChange(tempElements);
|
|
108
|
+
} }, others), index)); }), _jsxs("div", __assign({ className: styles.btnContainer }, { children: [_jsx("input", { ref: btnRef, className: styles.hiddenInput }), _jsx(RoundedButton, { disabled: !editable || postview, text: step.addBtnLabel, color: formStyle.primaryContrastColor, backgroundColor: formStyle.primaryColor, fontSize: '1rem', padding: '5px 15px 5px 15px', onClick: function () {
|
|
109
|
+
if (editable && !postview) {
|
|
110
|
+
handleAddElement();
|
|
111
|
+
}
|
|
112
|
+
} })] }))] })));
|
|
113
|
+
}
|
|
114
|
+
function MapperStep(props) {
|
|
115
|
+
return (_jsx(Controller, { name: props.step.id, control: props.control, defaultValue: [], rules: {
|
|
116
|
+
required: props.step.required
|
|
117
|
+
? 'Este campo es obligatorio'
|
|
118
|
+
: undefined,
|
|
119
|
+
}, shouldUnregister: true, render: function (_a) {
|
|
120
|
+
var _b = _a.field, ref = _b.ref, value = _b.value, field = __rest(_b, ["ref", "value"]);
|
|
121
|
+
return (_jsx(Elements, __assign({}, props, field, { elements: value, btnRef: ref })));
|
|
122
|
+
} }));
|
|
123
|
+
}
|
|
124
|
+
export default MapperStep;
|
|
125
|
+
function calcRecursiveData(element, newSteps, deps) {
|
|
126
|
+
for (var _i = 0, _a = Object.keys(newSteps); _i < _a.length; _i++) {
|
|
127
|
+
var idStep = _a[_i];
|
|
128
|
+
var step = newSteps[idStep];
|
|
129
|
+
if (step.dependencies) {
|
|
130
|
+
for (var i = 0; i < step.dependencies.length; i++) {
|
|
131
|
+
var idDep = step.dependencies[i];
|
|
132
|
+
var newId = element.ids[idDep];
|
|
133
|
+
if (newId) {
|
|
134
|
+
step.dependencies[i] = element.ids[newId];
|
|
135
|
+
deps[newId] = calcStepDependencyValue(newSteps[newId], {});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
switch (step.type) {
|
|
140
|
+
case StepTypes.SELECTOR: {
|
|
141
|
+
for (var _b = 0, _c = step.options; _b < _c.length; _b++) {
|
|
142
|
+
var option = _c[_b];
|
|
143
|
+
if (option.type === OptionTypes.NESTED) {
|
|
144
|
+
for (var i = 0; i < option.steps.length; i++) {
|
|
145
|
+
var idStep_1 = option.steps[i];
|
|
146
|
+
var newId = element.ids[idStep_1];
|
|
147
|
+
option.steps[i] = newId;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
case StepTypes.CLASSIFIER_SELECTOR:
|
|
154
|
+
for (var _d = 0, _e = Object.keys(step.options); _d < _e.length; _d++) {
|
|
155
|
+
var idOption = _e[_d];
|
|
156
|
+
var option = step.options[idOption];
|
|
157
|
+
if (option.type === ClassifierOptionTypes.NESTED) {
|
|
158
|
+
for (var i = 0; i < option.steps.length; i++) {
|
|
159
|
+
var idStep_2 = option.steps[i];
|
|
160
|
+
var newId = element.ids[idStep_2];
|
|
161
|
+
option.steps[i] = newId;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
break;
|
|
166
|
+
case StepTypes.RATING:
|
|
167
|
+
if (step.nestedSteps) {
|
|
168
|
+
for (var _f = 0, _g = step.nestedSteps; _f < _g.length; _f++) {
|
|
169
|
+
var steps = _g[_f];
|
|
170
|
+
for (var i = 0; i < steps.length; i++) {
|
|
171
|
+
var idStep_3 = steps[i];
|
|
172
|
+
var newId = element.ids[idStep_3];
|
|
173
|
+
steps[i] = newId;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
default:
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|