@arquimedes.co/eureka-forms 1.9.90-test → 1.9.92-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 -1
- package/dist/@Types/FormStep.d.ts +4 -4
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +2 -4
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +1 -1
- package/dist/FormComponents/Step/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +2 -4
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/MaterialMapperStep.js +17 -16
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +1 -1
- package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +1 -0
- package/dist/FormComponents/Step/StepFunctions.js +9 -9
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ export interface CBRProjectStep extends GSmartSelect {
|
|
|
8
8
|
type: Types.CBR_PROYECTO | Types.CBR_MACRO_PROYECTO;
|
|
9
9
|
steps: string[];
|
|
10
10
|
/** Only has maxSize if level === 0 */
|
|
11
|
-
maxSize
|
|
11
|
+
maxSize?: number;
|
|
12
12
|
}
|
|
13
13
|
export interface CBRDocTypeStep extends Omit<GSmartSelect, 'showIcon'> {
|
|
14
14
|
type: Types.CBR_TIPO_DOC;
|
|
@@ -11,7 +11,7 @@ export interface CheckBox extends GSteps.GCheckBox {
|
|
|
11
11
|
type: Types.CHECKBOX;
|
|
12
12
|
steps?: string[];
|
|
13
13
|
uncheckedSteps?: string[];
|
|
14
|
-
maxSize
|
|
14
|
+
maxSize?: number;
|
|
15
15
|
}
|
|
16
16
|
export interface Rating extends GSteps.GBaseStep {
|
|
17
17
|
type: Types.RATING;
|
|
@@ -53,7 +53,7 @@ export interface FormSelector extends GSteps.GBaseStep {
|
|
|
53
53
|
searchable: boolean;
|
|
54
54
|
options: FormSelectorOption[];
|
|
55
55
|
size: 1 | 2 | 3 | 4;
|
|
56
|
-
maxSize
|
|
56
|
+
maxSize?: number;
|
|
57
57
|
}
|
|
58
58
|
export type FormSelectorOption = DefaultFormSelectorOption | NestedStepOption | AddSectionOption;
|
|
59
59
|
interface DefaultFormSelectorOption {
|
|
@@ -82,7 +82,7 @@ export interface ClassifierSelector extends GSteps.GBaseStep {
|
|
|
82
82
|
options: Record<string, FormClassifierSelectorOption>;
|
|
83
83
|
required: boolean;
|
|
84
84
|
size: 1 | 2 | 3 | 4;
|
|
85
|
-
maxSize
|
|
85
|
+
maxSize?: number;
|
|
86
86
|
}
|
|
87
87
|
export type FormClassifierSelectorOption = NestedStepClassifierOption | HideValueOption;
|
|
88
88
|
interface NestedStepClassifierOption {
|
|
@@ -110,7 +110,7 @@ export interface EntityValuePicker extends GSteps.GSmartSelect {
|
|
|
110
110
|
idEntityValue?: string;
|
|
111
111
|
}[];
|
|
112
112
|
options: Record<string, FormEntityValuePickerOption>;
|
|
113
|
-
maxSize
|
|
113
|
+
maxSize?: number;
|
|
114
114
|
}
|
|
115
115
|
export type FormEntityValuePickerOption = NestedEntityValuePickerOption | HideFormEntityValuePickerOption;
|
|
116
116
|
interface NestedEntityValuePickerOption {
|
|
@@ -59,16 +59,14 @@ function CheckBox(_a) {
|
|
|
59
59
|
};
|
|
60
60
|
var renderNested = function () {
|
|
61
61
|
var steps = value ? step.steps : step.uncheckedSteps;
|
|
62
|
-
|
|
63
|
-
return;
|
|
64
|
-
return (_jsx(React.Fragment, { children: steps.map(function (idStep) {
|
|
62
|
+
return (_jsx(React.Fragment, { children: steps === null || steps === void 0 ? void 0 : steps.map(function (idStep) {
|
|
65
63
|
var subStep = form.steps[idStep];
|
|
66
64
|
return (_createElement(StepComponent, __assign({}, others, { postview: postview, editable: editable, widthStats: widthStats, getValues: getValues, formStyle: formStyle, errors: errors, form: form, step: subStep, key: idStep, level: level + 1, handleSizeChange: function () {
|
|
67
65
|
sizeChange();
|
|
68
66
|
} })));
|
|
69
67
|
}) }));
|
|
70
68
|
};
|
|
71
|
-
if (level === 0 && step.maxSize < form.size.blockNum) {
|
|
69
|
+
if (level === 0 && step.maxSize && step.maxSize < form.size.blockNum) {
|
|
72
70
|
return (_jsxs("div", __assign({ className: styles.firstLvlContainer, style: {
|
|
73
71
|
width: widthStats.currentBreakPoint <= step.size
|
|
74
72
|
? '100%'
|
|
@@ -95,7 +95,7 @@ function ClassifierSelector(_a) {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
if (level === 0 && step.maxSize < form.size.blockNum) {
|
|
98
|
+
if (level === 0 && step.maxSize && step.maxSize < form.size.blockNum) {
|
|
99
99
|
return (_jsxs("div", __assign({ className: styles.firstLvlContainer, style: {
|
|
100
100
|
width: widthStats.currentBreakPoint <= step.size
|
|
101
101
|
? '100%'
|
|
@@ -129,9 +129,7 @@ function EntityValuePicker(_a) {
|
|
|
129
129
|
: axiosInstance.get(url))];
|
|
130
130
|
case 1:
|
|
131
131
|
response = _d.sent();
|
|
132
|
-
return [2 /*return*/, response.data.filter(function (option) {
|
|
133
|
-
return step.options[option._id].type !== EntityValueOptionTypes.HIDE;
|
|
134
|
-
})];
|
|
132
|
+
return [2 /*return*/, response.data.filter(function (option) { var _a; return ((_a = step.options[option._id]) === null || _a === void 0 ? void 0 : _a.type) !== EntityValueOptionTypes.HIDE; })];
|
|
135
133
|
}
|
|
136
134
|
});
|
|
137
135
|
});
|
|
@@ -176,7 +174,7 @@ function EntityValuePicker(_a) {
|
|
|
176
174
|
}
|
|
177
175
|
}
|
|
178
176
|
};
|
|
179
|
-
if (level === 0 && step.maxSize < form.size.blockNum) {
|
|
177
|
+
if (level === 0 && step.maxSize && step.maxSize < form.size.blockNum) {
|
|
180
178
|
return (_jsxs("div", __assign({ className: styles.firstLvlContainer, style: {
|
|
181
179
|
width: widthStats.currentBreakPoint <= step.size
|
|
182
180
|
? '100%'
|
|
@@ -163,9 +163,12 @@ function MapperStep(props) {
|
|
|
163
163
|
}
|
|
164
164
|
export default MapperStep;
|
|
165
165
|
function calcRecursiveData(element, newSteps, deps, customSteps, originalValues) {
|
|
166
|
+
var _a;
|
|
166
167
|
if (originalValues === void 0) { originalValues = {}; }
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
if (!newSteps)
|
|
169
|
+
return;
|
|
170
|
+
for (var _i = 0, _b = Object.keys(newSteps); _i < _b.length; _i++) {
|
|
171
|
+
var idStep = _b[_i];
|
|
169
172
|
var step = newSteps[idStep];
|
|
170
173
|
if (step.dependencies) {
|
|
171
174
|
for (var i = 0; i < step.dependencies.length; i++) {
|
|
@@ -183,8 +186,8 @@ function calcRecursiveData(element, newSteps, deps, customSteps, originalValues)
|
|
|
183
186
|
}
|
|
184
187
|
switch (step.type) {
|
|
185
188
|
case StepTypes.SELECTOR: {
|
|
186
|
-
for (var
|
|
187
|
-
var option = _c
|
|
189
|
+
for (var _c = 0, _d = step.options; _c < _d.length; _c++) {
|
|
190
|
+
var option = _d[_c];
|
|
188
191
|
if (option.type === OptionTypes.NESTED) {
|
|
189
192
|
for (var i = 0; i < option.steps.length; i++) {
|
|
190
193
|
var idStep_1 = option.steps[i];
|
|
@@ -196,8 +199,8 @@ function calcRecursiveData(element, newSteps, deps, customSteps, originalValues)
|
|
|
196
199
|
break;
|
|
197
200
|
}
|
|
198
201
|
case StepTypes.CLASSIFIER_SELECTOR:
|
|
199
|
-
for (var
|
|
200
|
-
var idOption = _e
|
|
202
|
+
for (var _e = 0, _f = Object.keys(step.options); _e < _f.length; _e++) {
|
|
203
|
+
var idOption = _f[_e];
|
|
201
204
|
var option = step.options[idOption];
|
|
202
205
|
if (option.type === ClassifierOptionTypes.NESTED) {
|
|
203
206
|
for (var i = 0; i < option.steps.length; i++) {
|
|
@@ -210,8 +213,8 @@ function calcRecursiveData(element, newSteps, deps, customSteps, originalValues)
|
|
|
210
213
|
break;
|
|
211
214
|
case StepTypes.RATING:
|
|
212
215
|
if (step.nestedSteps) {
|
|
213
|
-
for (var
|
|
214
|
-
var steps = _g
|
|
216
|
+
for (var _g = 0, _h = step.nestedSteps; _g < _h.length; _g++) {
|
|
217
|
+
var steps = _h[_g];
|
|
215
218
|
for (var i = 0; i < steps.length; i++) {
|
|
216
219
|
var idStep_3 = steps[i];
|
|
217
220
|
var newId = element.ids[idStep_3];
|
|
@@ -229,25 +232,23 @@ function calcRecursiveData(element, newSteps, deps, customSteps, originalValues)
|
|
|
229
232
|
break;
|
|
230
233
|
}
|
|
231
234
|
case StepTypes.CHECKBOX: {
|
|
232
|
-
if (step.steps)
|
|
235
|
+
if (step.steps)
|
|
233
236
|
for (var i = 0; i < step.steps.length; i++) {
|
|
234
237
|
var idStep_5 = step.steps[i];
|
|
235
238
|
var newId = element.ids[idStep_5];
|
|
236
239
|
step.steps[i] = newId;
|
|
237
240
|
}
|
|
238
|
-
|
|
239
|
-
if (step.uncheckedSteps) {
|
|
241
|
+
if (step.uncheckedSteps)
|
|
240
242
|
for (var i = 0; i < step.uncheckedSteps.length; i++) {
|
|
241
243
|
var idStep_6 = step.uncheckedSteps[i];
|
|
242
244
|
var newId = element.ids[idStep_6];
|
|
243
245
|
step.uncheckedSteps[i] = newId;
|
|
244
246
|
}
|
|
245
|
-
}
|
|
246
247
|
break;
|
|
247
248
|
}
|
|
248
249
|
case StepTypes.ENTITYVALUEPICKER:
|
|
249
|
-
for (var
|
|
250
|
-
var filter = _j
|
|
250
|
+
for (var _j = 0, _k = step.filters; _j < _k.length; _j++) {
|
|
251
|
+
var filter = _k[_j];
|
|
251
252
|
if (filter.idStep) {
|
|
252
253
|
var newId = element.ids[filter.idStep];
|
|
253
254
|
if (newId) {
|
|
@@ -256,8 +257,8 @@ function calcRecursiveData(element, newSteps, deps, customSteps, originalValues)
|
|
|
256
257
|
}
|
|
257
258
|
}
|
|
258
259
|
}
|
|
259
|
-
for (var
|
|
260
|
-
var idOption = _l
|
|
260
|
+
for (var _l = 0, _m = Object.keys((_a = step.options) !== null && _a !== void 0 ? _a : {}); _l < _m.length; _l++) {
|
|
261
|
+
var idOption = _m[_l];
|
|
261
262
|
var option = step.options[idOption];
|
|
262
263
|
if (option.type === EntityValueOptionTypes.NESTED) {
|
|
263
264
|
for (var i = 0; i < option.steps.length; i++) {
|
|
@@ -78,7 +78,7 @@ function Selector(_a) {
|
|
|
78
78
|
}) }));
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
if (level === 0 && step.maxSize < form.size.blockNum) {
|
|
81
|
+
if (level === 0 && step.maxSize && step.maxSize < form.size.blockNum) {
|
|
82
82
|
return (_jsxs("div", __assign({ className: styles.firstLvlContainer, style: {
|
|
83
83
|
width: widthStats.currentBreakPoint <= step.size
|
|
84
84
|
? '100%'
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import Types, { ClassifierOptionTypes, EntityValueOptionTypes, OptionTypes, } from '../../constants/FormStepTypes';
|
|
2
2
|
export function calcFillerSize(step, steps, values, size) {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
var _a;
|
|
4
|
+
var maxSize = (_a = step.maxSize) !== null && _a !== void 0 ? _a : size.blockNum;
|
|
5
|
+
if (maxSize < size.blockNum) {
|
|
6
|
+
var stepSize = maxSize - recursivelyCheckOpenSize(step.id, steps, values);
|
|
5
7
|
return (size.blockSize * stepSize + size.spacingSize * (stepSize - 1) + 20);
|
|
6
8
|
}
|
|
7
9
|
else {
|
|
@@ -59,14 +61,12 @@ export function recursivelyCheckOpenSize(idStep, steps, values) {
|
|
|
59
61
|
if (step.type === Types.CHECKBOX) {
|
|
60
62
|
var size = step.size;
|
|
61
63
|
var stepSteps = value ? step.steps : step.uncheckedSteps;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
67
|
-
}
|
|
68
|
-
size += optionSize;
|
|
64
|
+
var optionSize = 0;
|
|
65
|
+
for (var _f = 0, _g = stepSteps !== null && stepSteps !== void 0 ? stepSteps : []; _f < _g.length; _f++) {
|
|
66
|
+
var pStepId = _g[_f];
|
|
67
|
+
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
69
68
|
}
|
|
69
|
+
size += optionSize;
|
|
70
70
|
return size;
|
|
71
71
|
}
|
|
72
72
|
else {
|
package/package.json
CHANGED