@arquimedes.co/eureka-forms 2.0.25 → 2.0.27
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/AppFunctions.js
CHANGED
|
@@ -81,7 +81,7 @@ export var addMapperStep = function (step, customSteps) {
|
|
|
81
81
|
var nested = addMapperStep(nestedStep, customSteps);
|
|
82
82
|
steps = __assign(__assign({}, steps), nested.steps);
|
|
83
83
|
mappers = __assign(__assign({}, mappers), nested.mappers);
|
|
84
|
-
mappers[nestedStep.id] = [nested.element];
|
|
84
|
+
mappers[element.ids[nestedStep.id]] = [nested.element];
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
return { element: element, mappers: mappers, steps: steps };
|
|
@@ -106,7 +106,7 @@ export function calcRecursiveData(element, newSteps, customSteps) {
|
|
|
106
106
|
if (custom === null || custom === void 0 ? void 0 : custom.calcRecursiveData) {
|
|
107
107
|
custom.calcRecursiveData(step, element.ids);
|
|
108
108
|
}
|
|
109
|
-
calcSubSteps(step, function (idStep) { var _a; return (_a = element.ids[idStep]) !== null && _a !== void 0 ? _a : idStep; });
|
|
109
|
+
calcSubSteps(step.id, newSteps, function (idStep) { var _a; return (_a = element.ids[idStep]) !== null && _a !== void 0 ? _a : idStep; });
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
export var mapOriginalValue = function (step, value, values, form) {
|
|
@@ -20,15 +20,16 @@ import { useFormStep } from '../../StepHooks';
|
|
|
20
20
|
import StepFillerContainer from '../../Utils/@StepFiller/StepFiller';
|
|
21
21
|
import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
|
|
22
22
|
function CheckBoxStep(_a) {
|
|
23
|
+
var _b;
|
|
23
24
|
var step = _a.step, editable = _a.editable;
|
|
24
|
-
var
|
|
25
|
-
defaultValue: false,
|
|
25
|
+
var _c = useFormStep(step, {
|
|
26
|
+
defaultValue: (_b = step.defaultValue) !== null && _b !== void 0 ? _b : false,
|
|
26
27
|
rules: {
|
|
27
28
|
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
28
29
|
},
|
|
29
30
|
sizeChange: true,
|
|
30
|
-
}), ref =
|
|
31
|
-
var
|
|
31
|
+
}), ref = _c.ref, value = _c.value, onChange = _c.onChange, error = _c.error, field = _c.field;
|
|
32
|
+
var _d = useAppSelector(function (state) { return state.global; }), formStyle = _d.formStyle, postview = _d.postview;
|
|
32
33
|
var form = useContext(FormContext);
|
|
33
34
|
var renderNested = function () {
|
|
34
35
|
var steps = value ? step.steps : step.uncheckedSteps;
|
|
@@ -8,9 +8,9 @@ export declare const calcStepWidth: (stepSize: 1 | 2 | 3 | 4, size: FormSize) =>
|
|
|
8
8
|
export declare const calcDefaultValue: (step: FormStep | CBRFormStep) => any;
|
|
9
9
|
export declare const iterateNestedSteps: (idStep: string, steps: Record<string, FormStep>, iteration: (step: FormStep) => void) => void;
|
|
10
10
|
/**
|
|
11
|
-
* Utility function to
|
|
11
|
+
* Utility function to calc the substeps of a step
|
|
12
12
|
* @param step step to calc the substeps
|
|
13
13
|
* @param idModifier optional modifier for the ids of the substeps and all other properties
|
|
14
|
-
* @returns list of the ids of the
|
|
14
|
+
* @returns list of the ids of the substeps of the step, if modifier returns modified steps
|
|
15
15
|
*/
|
|
16
|
-
export declare const calcSubSteps: (
|
|
16
|
+
export declare const calcSubSteps: (idStep: string, allSteps: Record<string, FormStep | CBRFormStep | AYFFormStep>, idModifier?: ((idSubStep: string) => string) | undefined) => string[];
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
1
10
|
import { ApiSelectorOptionTypes, ClassifierOptionTypes, EntityValueDataTypes, EntityValueOptionTypes, OptionTypes, StepTypes, } from '../constants/FormStepTypes';
|
|
2
11
|
import CBRFormStepTypes from '../constants/CBRFormStepTypes';
|
|
3
12
|
import AYFFormStepTypes from '../constants/AYFFormStepTypes';
|
|
@@ -146,27 +155,30 @@ export var iterateNestedSteps = function (idStep, steps, iteration) {
|
|
|
146
155
|
}
|
|
147
156
|
}
|
|
148
157
|
else {
|
|
149
|
-
for (var _b = 0, _c = calcSubSteps(step); _b < _c.length; _b++) {
|
|
158
|
+
for (var _b = 0, _c = calcSubSteps(step.id, steps); _b < _c.length; _b++) {
|
|
150
159
|
var idSubStep = _c[_b];
|
|
151
160
|
iterateNestedSteps(idSubStep, steps, iteration);
|
|
152
161
|
}
|
|
153
162
|
}
|
|
154
163
|
};
|
|
155
164
|
/**
|
|
156
|
-
* Utility function to
|
|
165
|
+
* Utility function to calc the substeps of a step
|
|
157
166
|
* @param step step to calc the substeps
|
|
158
167
|
* @param idModifier optional modifier for the ids of the substeps and all other properties
|
|
159
|
-
* @returns list of the ids of the
|
|
168
|
+
* @returns list of the ids of the substeps of the step, if modifier returns modified steps
|
|
160
169
|
*/
|
|
161
|
-
export var calcSubSteps = function (
|
|
170
|
+
export var calcSubSteps = function (idStep, allSteps, idModifier) {
|
|
162
171
|
var _a;
|
|
172
|
+
var step = allSteps[idStep];
|
|
163
173
|
var subSteps = [];
|
|
174
|
+
if (!step)
|
|
175
|
+
return [];
|
|
164
176
|
var handleSteps = function (steps) {
|
|
165
177
|
for (var i = 0; i < steps.length; i++) {
|
|
166
|
-
var
|
|
178
|
+
var idSubStep = steps[i];
|
|
167
179
|
if (idModifier)
|
|
168
|
-
steps[i] = idModifier(
|
|
169
|
-
subSteps.push(
|
|
180
|
+
steps[i] = idModifier(steps[i]);
|
|
181
|
+
subSteps.push.apply(subSteps, __spreadArray([idSubStep], calcSubSteps(idSubStep, allSteps, idModifier), false));
|
|
170
182
|
}
|
|
171
183
|
};
|
|
172
184
|
switch (step.type) {
|