tuain-ng-forms-lib 12.0.42 → 12.0.46
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/bundles/tuain-ng-forms-lib.umd.js +81 -17
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/field.js +13 -6
- package/esm2015/lib/classes/forms/form.js +5 -3
- package/esm2015/lib/classes/forms/section.js +19 -1
- package/esm2015/lib/classes/forms/subsection.js +7 -1
- package/esm2015/lib/components/elements/field.component.js +3 -3
- package/esm2015/lib/components/forms/basic-form.js +11 -3
- package/fesm2015/tuain-ng-forms-lib.js +52 -11
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/field.d.ts +12 -7
- package/lib/classes/forms/form.d.ts +24 -21
- package/lib/classes/forms/section.d.ts +2 -0
- package/lib/classes/forms/subsection.d.ts +2 -0
- package/lib/components/elements/field.component.d.ts +1 -1
- package/lib/components/forms/basic-form.d.ts +24 -21
- package/package.json +1 -1
- package/tuain-ng-forms-lib.metadata.json +1 -1
|
@@ -454,9 +454,10 @@
|
|
|
454
454
|
var _this = this;
|
|
455
455
|
setTimeout(function () { return _this.field.notifyEditionFinish(); }, 50);
|
|
456
456
|
};
|
|
457
|
-
FieldComponent.prototype.onShowInfo = function () {
|
|
457
|
+
FieldComponent.prototype.onShowInfo = function (detail) {
|
|
458
458
|
var _this = this;
|
|
459
|
-
|
|
459
|
+
if (detail === void 0) { detail = null; }
|
|
460
|
+
setTimeout(function () { return _this.field.notifyEditionDetailRequest(detail); }, 50);
|
|
460
461
|
};
|
|
461
462
|
FieldComponent.prototype.numberInputValidation = function (event) {
|
|
462
463
|
var k = event.charCode;
|
|
@@ -1880,8 +1881,12 @@
|
|
|
1880
1881
|
this._attributeChange.next({ name: name, value: value });
|
|
1881
1882
|
}
|
|
1882
1883
|
};
|
|
1883
|
-
FieldDescriptor.prototype.notifyEditionDetailRequest = function () {
|
|
1884
|
-
|
|
1884
|
+
FieldDescriptor.prototype.notifyEditionDetailRequest = function (detail) {
|
|
1885
|
+
var detailEvent = {
|
|
1886
|
+
code: this.fieldCode,
|
|
1887
|
+
detail: detail,
|
|
1888
|
+
};
|
|
1889
|
+
this._detailRequest.next(detailEvent);
|
|
1885
1890
|
};
|
|
1886
1891
|
FieldDescriptor.prototype.setVisibleLabel = function (visibleLabel) { this.setAttr(fldAttr.visibleLabel, visibleLabel); };
|
|
1887
1892
|
FieldDescriptor.prototype.showLabel = function () { this.setVisibleLabel(true); };
|
|
@@ -1944,8 +1949,8 @@
|
|
|
1944
1949
|
};
|
|
1945
1950
|
FieldDescriptor.prototype.getOptionText = function () {
|
|
1946
1951
|
var _this = this;
|
|
1947
|
-
var _a, _b;
|
|
1948
|
-
return (_b = (_a = this.fieldOptions.find(function (item) { return item.fieldOptionId === _this._value; })) === null ||
|
|
1952
|
+
var _a, _b, _c;
|
|
1953
|
+
return (_c = (_b = (_a = this.fieldOptions) === null || _a === void 0 ? void 0 : _a.find(function (item) { return item.fieldOptionId === _this._value; })) === null || _b === void 0 ? void 0 : _b.fieldOptionValue) !== null && _c !== void 0 ? _c : null;
|
|
1949
1954
|
};
|
|
1950
1955
|
FieldDescriptor.prototype.updateFromServer = function (fld) {
|
|
1951
1956
|
var _a;
|
|
@@ -1987,7 +1992,10 @@
|
|
|
1987
1992
|
this.setAttr(fldAttr.maxValue, maxValue);
|
|
1988
1993
|
};
|
|
1989
1994
|
FieldDescriptor.prototype.getFieldOptions = function () {
|
|
1990
|
-
return
|
|
1995
|
+
return this.fieldOptions.map(function (option) {
|
|
1996
|
+
var optionCopy = Object.assign({}, option);
|
|
1997
|
+
return optionCopy;
|
|
1998
|
+
});
|
|
1991
1999
|
};
|
|
1992
2000
|
FieldDescriptor.prototype.setFieldOptions = function (newOptions) {
|
|
1993
2001
|
var _this = this;
|
|
@@ -2135,6 +2143,12 @@
|
|
|
2135
2143
|
RecordFormSubSection.prototype.getFieldNames = function () {
|
|
2136
2144
|
return this.subSectionFields.map(function (field) { return field.fieldCode; });
|
|
2137
2145
|
};
|
|
2146
|
+
RecordFormSubSection.prototype.getActions = function () {
|
|
2147
|
+
return this.subSectionActions;
|
|
2148
|
+
};
|
|
2149
|
+
RecordFormSubSection.prototype.getActionNames = function () {
|
|
2150
|
+
return this.subSectionActions.map(function (action) { return action.actionCode; });
|
|
2151
|
+
};
|
|
2138
2152
|
RecordFormSubSection.prototype.viewOnState = function (state) {
|
|
2139
2153
|
return this.visibleStates.includes(state);
|
|
2140
2154
|
};
|
|
@@ -2264,14 +2278,14 @@
|
|
|
2264
2278
|
}
|
|
2265
2279
|
return fieldsArray;
|
|
2266
2280
|
};
|
|
2267
|
-
RecordFormSection.prototype.
|
|
2281
|
+
RecordFormSection.prototype.getActions = function () {
|
|
2268
2282
|
var e_3, _c;
|
|
2269
|
-
var
|
|
2283
|
+
var actionArray = [];
|
|
2270
2284
|
if (this.subSections && this.subSections.length > 0) {
|
|
2271
2285
|
try {
|
|
2272
2286
|
for (var _d = __values(this.subSections), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
2273
2287
|
var subSection = _e.value;
|
|
2274
|
-
|
|
2288
|
+
actionArray = actionArray.concat(subSection.getActions());
|
|
2275
2289
|
}
|
|
2276
2290
|
}
|
|
2277
2291
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
@@ -2282,10 +2296,50 @@
|
|
|
2282
2296
|
finally { if (e_3) throw e_3.error; }
|
|
2283
2297
|
}
|
|
2284
2298
|
}
|
|
2299
|
+
return actionArray;
|
|
2300
|
+
};
|
|
2301
|
+
RecordFormSection.prototype.getActionNames = function () {
|
|
2302
|
+
var e_4, _c;
|
|
2303
|
+
var actionArray = [];
|
|
2304
|
+
if (this.subSections && this.subSections.length > 0) {
|
|
2305
|
+
try {
|
|
2306
|
+
for (var _d = __values(this.subSections), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
2307
|
+
var subSection = _e.value;
|
|
2308
|
+
actionArray = actionArray.concat(subSection.getActionNames());
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
2312
|
+
finally {
|
|
2313
|
+
try {
|
|
2314
|
+
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
2315
|
+
}
|
|
2316
|
+
finally { if (e_4) throw e_4.error; }
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
return actionArray;
|
|
2320
|
+
};
|
|
2321
|
+
RecordFormSection.prototype.getFieldNames = function () {
|
|
2322
|
+
var e_5, _c;
|
|
2323
|
+
var fieldsArray = [];
|
|
2324
|
+
if (this.subSections && this.subSections.length > 0) {
|
|
2325
|
+
try {
|
|
2326
|
+
for (var _d = __values(this.subSections), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
2327
|
+
var subSection = _e.value;
|
|
2328
|
+
fieldsArray = fieldsArray.concat(subSection.getFieldNames());
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
2332
|
+
finally {
|
|
2333
|
+
try {
|
|
2334
|
+
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
2335
|
+
}
|
|
2336
|
+
finally { if (e_5) throw e_5.error; }
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2285
2339
|
return fieldsArray;
|
|
2286
2340
|
};
|
|
2287
2341
|
RecordFormSection.prototype.getField = function (name) {
|
|
2288
|
-
var
|
|
2342
|
+
var e_6, _c;
|
|
2289
2343
|
var field = null;
|
|
2290
2344
|
if (this.subSections && this.subSections.length > 0) {
|
|
2291
2345
|
try {
|
|
@@ -2297,12 +2351,12 @@
|
|
|
2297
2351
|
}
|
|
2298
2352
|
}
|
|
2299
2353
|
}
|
|
2300
|
-
catch (
|
|
2354
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
2301
2355
|
finally {
|
|
2302
2356
|
try {
|
|
2303
2357
|
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
2304
2358
|
}
|
|
2305
|
-
finally { if (
|
|
2359
|
+
finally { if (e_6) throw e_6.error; }
|
|
2306
2360
|
}
|
|
2307
2361
|
}
|
|
2308
2362
|
return null;
|
|
@@ -2564,7 +2618,7 @@
|
|
|
2564
2618
|
FormStructureAndData.prototype.disableField = function (code) { var _a; (_a = this.getField(code)) === null || _a === void 0 ? void 0 : _a.disable(); };
|
|
2565
2619
|
FormStructureAndData.prototype.getFieldValue = function (code) { var _a; return (_a = this.getField(code)) === null || _a === void 0 ? void 0 : _a.getValue(); };
|
|
2566
2620
|
FormStructureAndData.prototype.getFieldOptionText = function (code) { var _a; return (_a = this.getField(code)) === null || _a === void 0 ? void 0 : _a.getOptionText(); };
|
|
2567
|
-
FormStructureAndData.prototype.getFieldOptions = function (code) { var _a; (_a = this.getField(code)) === null || _a === void 0 ? void 0 : _a.getFieldOptions(); };
|
|
2621
|
+
FormStructureAndData.prototype.getFieldOptions = function (code) { var _a, _b; return (_b = (_a = this.getField(code)) === null || _a === void 0 ? void 0 : _a.getFieldOptions()) !== null && _b !== void 0 ? _b : null; };
|
|
2568
2622
|
FormStructureAndData.prototype.setFieldValue = function (code, value) { var _a; (_a = this.getField(code)) === null || _a === void 0 ? void 0 : _a.setValue(value); };
|
|
2569
2623
|
FormStructureAndData.prototype.setFieldError = function (code, message, type) {
|
|
2570
2624
|
if (type === void 0) { type = 'error'; }
|
|
@@ -2661,7 +2715,7 @@
|
|
|
2661
2715
|
return this.applyOnFields(function (fld) { return fld.setErrorMessage(message); }, codes, secCode, subCode);
|
|
2662
2716
|
};
|
|
2663
2717
|
FormStructureAndData.prototype.cleanErrorFields = function (codes, secCode, subCode) {
|
|
2664
|
-
this.tagFieldsWithError('', codes, secCode, subCode);
|
|
2718
|
+
return this.tagFieldsWithError('', codes, secCode, subCode);
|
|
2665
2719
|
};
|
|
2666
2720
|
FormStructureAndData.prototype.tagEmptyRequiredFields = function (message, codes, secCode, subCode) {
|
|
2667
2721
|
if (codes === void 0) { codes = null; }
|
|
@@ -2767,6 +2821,8 @@
|
|
|
2767
2821
|
FormStructureAndData.prototype.getSubSection = function (code, subCode) { var _a, _b; return (_b = (_a = this.getSection(code)) === null || _a === void 0 ? void 0 : _a.getSubsection(subCode)) !== null && _b !== void 0 ? _b : null; };
|
|
2768
2822
|
FormStructureAndData.prototype.showSubSections = function (code, subCodes) { return this.execOnSubSections(code, subCodes, SHOW); };
|
|
2769
2823
|
FormStructureAndData.prototype.hideSubSections = function (code, subCodes) { return this.execOnSubSections(code, subCodes, HIDE); };
|
|
2824
|
+
FormStructureAndData.prototype.getSectionActions = function (code) { var _a, _b; return (_b = (_a = this.getSection(code)) === null || _a === void 0 ? void 0 : _a.getActions()) !== null && _b !== void 0 ? _b : null; };
|
|
2825
|
+
FormStructureAndData.prototype.getSectionActionNames = function (code) { var _a, _b; return (_b = (_a = this.getSection(code)) === null || _a === void 0 ? void 0 : _a.getActionNames()) !== null && _b !== void 0 ? _b : null; };
|
|
2770
2826
|
FormStructureAndData.prototype.activateSection = function (code) {
|
|
2771
2827
|
var _a, _b;
|
|
2772
2828
|
if (code === this._exclusiveSectionsByAttr[ACTIVE]) {
|
|
@@ -3230,6 +3286,14 @@
|
|
|
3230
3286
|
var _a;
|
|
3231
3287
|
return (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.hideSubSections(code, subCodes);
|
|
3232
3288
|
};
|
|
3289
|
+
BasicFormComponent.prototype.getSectionActions = function (code) {
|
|
3290
|
+
var _a;
|
|
3291
|
+
return (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.getSectionActions(code);
|
|
3292
|
+
};
|
|
3293
|
+
BasicFormComponent.prototype.getSectionActionNames = function (code) {
|
|
3294
|
+
var _a;
|
|
3295
|
+
return (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.getSectionActionNames(code);
|
|
3296
|
+
};
|
|
3233
3297
|
BasicFormComponent.prototype.getTables = function () {
|
|
3234
3298
|
var _a;
|
|
3235
3299
|
return (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.getTables();
|
|
@@ -3366,7 +3430,7 @@
|
|
|
3366
3430
|
BasicFormComponent.prototype.displayActionServerError = function () { };
|
|
3367
3431
|
BasicFormComponent.prototype.displayValidationServerError = function () { };
|
|
3368
3432
|
BasicFormComponent.prototype.displayTableServerError = function () { };
|
|
3369
|
-
BasicFormComponent.prototype.showFieldInfo = function (fieldCode) { };
|
|
3433
|
+
BasicFormComponent.prototype.showFieldInfo = function (fieldCode, detail) { };
|
|
3370
3434
|
BasicFormComponent.prototype.showModalDialog = function (title, body, options, callback, params) { };
|
|
3371
3435
|
BasicFormComponent.prototype.openUploadDialog = function (title, body, options, callback, params) { };
|
|
3372
3436
|
/**
|
|
@@ -3483,7 +3547,7 @@
|
|
|
3483
3547
|
var code = event.code, intrinsicValidation = event.intrinsicValidation;
|
|
3484
3548
|
_this.startFieldInputValidation(code, intrinsicValidation);
|
|
3485
3549
|
});
|
|
3486
|
-
field.detailRequest.subscribe(function (
|
|
3550
|
+
field.detailRequest.subscribe(function (event) { return _this.showFieldInfo(event.code, event.detail); });
|
|
3487
3551
|
});
|
|
3488
3552
|
}
|
|
3489
3553
|
};
|