tuain-ng-forms-lib 14.5.26 → 14.5.28
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/esm2020/lib/classes/forms/form.mjs +2 -2
- package/esm2020/lib/components/forms/basic-form.mjs +10 -1
- package/fesm2015/tuain-ng-forms-lib.mjs +10 -1
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +10 -1
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/components/forms/basic-form.d.ts +3 -0
- package/package.json +1 -1
|
@@ -2299,7 +2299,7 @@ class FormStructureAndData {
|
|
|
2299
2299
|
setFieldErrorMessage(code, message) { var _a; (_a = this.getField(code)) === null || _a === void 0 ? void 0 : _a.setErrorMessage(message); }
|
|
2300
2300
|
setFieldOptions(code, optionsArray, idAttribute, nameAttribute) {
|
|
2301
2301
|
const field = this.getField(code);
|
|
2302
|
-
if (field &&
|
|
2302
|
+
if (field && optionsArray) {
|
|
2303
2303
|
const fieldOptions = optionsArray.map(item => ({
|
|
2304
2304
|
fieldOptionId: item[idAttribute],
|
|
2305
2305
|
fieldOptionValue: item[nameAttribute]
|
|
@@ -2692,6 +2692,9 @@ class BasicFormComponent {
|
|
|
2692
2692
|
this.errorMessage = '';
|
|
2693
2693
|
this.errorDetail = '';
|
|
2694
2694
|
this.visible = false;
|
|
2695
|
+
this.fieldsArray = null;
|
|
2696
|
+
this.actionsArray = null;
|
|
2697
|
+
this.sectionsArray = null;
|
|
2695
2698
|
this.busy = false;
|
|
2696
2699
|
this._eventEmiter = this._eventManager;
|
|
2697
2700
|
this.cleanStart();
|
|
@@ -3185,6 +3188,12 @@ class BasicFormComponent {
|
|
|
3185
3188
|
this.fields = (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.fields;
|
|
3186
3189
|
this.actions = (_b = this._formStructure) === null || _b === void 0 ? void 0 : _b.actions;
|
|
3187
3190
|
this.sections = (_c = this._formStructure) === null || _c === void 0 ? void 0 : _c.sections;
|
|
3191
|
+
this.fieldsArray = Object.keys(this.fields)
|
|
3192
|
+
.reduce((accumulator, value) => accumulator.concat(this.fields[value]), []);
|
|
3193
|
+
this.actionsArray = Object.keys(this.actions)
|
|
3194
|
+
.reduce((accumulator, value) => accumulator.concat(this.actions[value]), []);
|
|
3195
|
+
this.sectionsArray = Object.keys(this.sections)
|
|
3196
|
+
.reduce((accumulator, value) => accumulator.concat(this.sections[value]), []);
|
|
3188
3197
|
this._definitionObtained = true;
|
|
3189
3198
|
}
|
|
3190
3199
|
else {
|