@arquimedes.co/eureka-forms 2.0.26 → 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.
@@ -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) {
@@ -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 handle the substeps of a step
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 direct substeps of the step, if modifier returns modified steps
14
+ * @returns list of the ids of the substeps of the step, if modifier returns modified steps
15
15
  */
16
- export declare const calcSubSteps: (step: FormStep | CBRFormStep | AYFFormStep, idModifier?: ((idSubStep: string) => string) | undefined) => string[];
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 handle the substeps of a step
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 direct substeps of the step, if modifier returns modified steps
168
+ * @returns list of the ids of the substeps of the step, if modifier returns modified steps
160
169
  */
161
- export var calcSubSteps = function (step, idModifier) {
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 idStep = steps[i];
178
+ var idSubStep = steps[i];
167
179
  if (idModifier)
168
- steps[i] = idModifier(idStep);
169
- subSteps.push(idStep);
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) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version": "2.0.26",
4
+ "version": "2.0.27",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",