tuain-ng-forms-lib 12.0.25 → 12.0.29
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 +48 -174
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/element.js +2 -2
- package/esm2015/lib/classes/forms/field.js +1 -1
- package/esm2015/lib/classes/forms/form.js +1 -1
- package/esm2015/lib/classes/forms/subsection.js +4 -4
- package/esm2015/lib/classes/forms/table/row-data.js +1 -1
- package/esm2015/lib/components/forms/basic-form.js +45 -147
- package/fesm2015/tuain-ng-forms-lib.js +48 -150
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/form.d.ts +1 -1
- package/lib/components/forms/basic-form.d.ts +14 -21
- package/package.json +1 -1
- package/tuain-ng-forms-lib.metadata.json +1 -1
|
@@ -657,7 +657,7 @@
|
|
|
657
657
|
this.disabled = (_a = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.disabled) !== null && _a !== void 0 ? _a : false;
|
|
658
658
|
this.setVisibility((_b = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.visible) !== null && _b !== void 0 ? _b : true);
|
|
659
659
|
this.widget = null;
|
|
660
|
-
this.customAttributes = (_c = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.customAttributes) !== null && _c !== void 0 ? _c :
|
|
660
|
+
this.customAttributes = (_c = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.customAttributes) !== null && _c !== void 0 ? _c : {};
|
|
661
661
|
}
|
|
662
662
|
FormElement.prototype.getCustomAttribute = function (name) { var _a, _b; return (_b = (_a = this.customAttributes) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null; };
|
|
663
663
|
FormElement.prototype.setCustomAttribute = function (name, value) {
|
|
@@ -2110,15 +2110,15 @@
|
|
|
2110
2110
|
var type = receivedElement.type, code = receivedElement.code;
|
|
2111
2111
|
switch (type) {
|
|
2112
2112
|
case elementTypes.field:
|
|
2113
|
-
elementObject = formObject.
|
|
2113
|
+
elementObject = formObject.getField(code);
|
|
2114
2114
|
arrayToAdd = this.subSectionFields;
|
|
2115
2115
|
break;
|
|
2116
2116
|
case elementTypes.table:
|
|
2117
|
-
elementObject = formObject.
|
|
2117
|
+
elementObject = formObject.getTable(code);
|
|
2118
2118
|
arrayToAdd = this.subSectionTables;
|
|
2119
2119
|
break;
|
|
2120
2120
|
case elementTypes.action:
|
|
2121
|
-
elementObject = formObject.
|
|
2121
|
+
elementObject = formObject.getAction(code);
|
|
2122
2122
|
arrayToAdd = this.subSectionActions;
|
|
2123
2123
|
break;
|
|
2124
2124
|
}
|
|
@@ -3773,9 +3773,9 @@
|
|
|
3773
3773
|
/**
|
|
3774
3774
|
* Manejo de event handlers para acciones sobre el formulario
|
|
3775
3775
|
*/
|
|
3776
|
-
BasicFormComponent.prototype.addSectionActivation = function (
|
|
3776
|
+
BasicFormComponent.prototype.addSectionActivation = function (codes, callbackMethod) {
|
|
3777
3777
|
var _this = this;
|
|
3778
|
-
var sectionSet = (Array.isArray(
|
|
3778
|
+
var sectionSet = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
|
|
3779
3779
|
sectionSet.forEach(function (sectionName) {
|
|
3780
3780
|
if (!_this._formSectionsActivate[sectionName]) {
|
|
3781
3781
|
_this._formSectionsActivate[sectionName] = [];
|
|
@@ -3783,9 +3783,9 @@
|
|
|
3783
3783
|
_this._formSectionsActivate[sectionName].push(callbackMethod);
|
|
3784
3784
|
});
|
|
3785
3785
|
};
|
|
3786
|
-
BasicFormComponent.prototype.addSectionInactivation = function (
|
|
3786
|
+
BasicFormComponent.prototype.addSectionInactivation = function (codes, callbackMethod) {
|
|
3787
3787
|
var _this = this;
|
|
3788
|
-
var sectionSet = (Array.isArray(
|
|
3788
|
+
var sectionSet = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
|
|
3789
3789
|
sectionSet.forEach(function (sectionName) {
|
|
3790
3790
|
if (!_this._formSectionsInactivate[sectionName]) {
|
|
3791
3791
|
_this._formSectionsInactivate[sectionName] = [];
|
|
@@ -3793,9 +3793,9 @@
|
|
|
3793
3793
|
_this._formSectionsInactivate[sectionName].push(callbackMethod);
|
|
3794
3794
|
});
|
|
3795
3795
|
};
|
|
3796
|
-
BasicFormComponent.prototype.addActionMethodStart = function (
|
|
3796
|
+
BasicFormComponent.prototype.addActionMethodStart = function (codes, callbackMethod) {
|
|
3797
3797
|
var _this = this;
|
|
3798
|
-
var actionSet = (Array.isArray(
|
|
3798
|
+
var actionSet = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
|
|
3799
3799
|
actionSet.forEach(function (actionName) {
|
|
3800
3800
|
if (!_this._formActionsStart[actionName]) {
|
|
3801
3801
|
_this._formActionsStart[actionName] = [];
|
|
@@ -3803,9 +3803,9 @@
|
|
|
3803
3803
|
_this._formActionsStart[actionName].push(callbackMethod);
|
|
3804
3804
|
});
|
|
3805
3805
|
};
|
|
3806
|
-
BasicFormComponent.prototype.addActionMethodFinish = function (
|
|
3806
|
+
BasicFormComponent.prototype.addActionMethodFinish = function (codes, callbackMethod) {
|
|
3807
3807
|
var _this = this;
|
|
3808
|
-
var actionSet = (Array.isArray(
|
|
3808
|
+
var actionSet = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
|
|
3809
3809
|
actionSet.forEach(function (actionName) {
|
|
3810
3810
|
if (!_this._formActionsFinish[actionName]) {
|
|
3811
3811
|
_this._formActionsFinish[actionName] = [];
|
|
@@ -3988,9 +3988,9 @@
|
|
|
3988
3988
|
/**
|
|
3989
3989
|
* Manejadores de eventos para validaciones sobre campos
|
|
3990
3990
|
*/
|
|
3991
|
-
BasicFormComponent.prototype.addFieldInputValidation = function (
|
|
3991
|
+
BasicFormComponent.prototype.addFieldInputValidation = function (codes, callbackMethod) {
|
|
3992
3992
|
var _this = this;
|
|
3993
|
-
var fieldSet = (Array.isArray(
|
|
3993
|
+
var fieldSet = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
|
|
3994
3994
|
fieldSet.forEach(function (fieldCode) {
|
|
3995
3995
|
if (!_this._fieldInputValidation[fieldCode]) {
|
|
3996
3996
|
_this._fieldInputValidation[fieldCode] = [];
|
|
@@ -3998,9 +3998,9 @@
|
|
|
3998
3998
|
_this._fieldInputValidation[fieldCode].push(callbackMethod);
|
|
3999
3999
|
});
|
|
4000
4000
|
};
|
|
4001
|
-
BasicFormComponent.prototype.addFieldValidationStart = function (
|
|
4001
|
+
BasicFormComponent.prototype.addFieldValidationStart = function (codes, callbackMethod) {
|
|
4002
4002
|
var _this = this;
|
|
4003
|
-
var fieldSet = (Array.isArray(
|
|
4003
|
+
var fieldSet = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
|
|
4004
4004
|
fieldSet.forEach(function (fieldCode) {
|
|
4005
4005
|
if (!_this._fieldValidationsStart[fieldCode]) {
|
|
4006
4006
|
_this._fieldValidationsStart[fieldCode] = [];
|
|
@@ -4008,9 +4008,9 @@
|
|
|
4008
4008
|
_this._fieldValidationsStart[fieldCode].push(callbackMethod);
|
|
4009
4009
|
});
|
|
4010
4010
|
};
|
|
4011
|
-
BasicFormComponent.prototype.addFieldValidationFinish = function (
|
|
4011
|
+
BasicFormComponent.prototype.addFieldValidationFinish = function (codes, callbackMethod) {
|
|
4012
4012
|
var _this = this;
|
|
4013
|
-
var fieldSet = (Array.isArray(
|
|
4013
|
+
var fieldSet = (Array.isArray(codes)) ? codes : (codes ? [codes] : []);
|
|
4014
4014
|
fieldSet.forEach(function (fieldCode) {
|
|
4015
4015
|
if (!_this._fieldValidationsFinish[fieldCode]) {
|
|
4016
4016
|
_this._fieldValidationsFinish[fieldCode] = [];
|
|
@@ -4180,8 +4180,8 @@
|
|
|
4180
4180
|
/**
|
|
4181
4181
|
* Manejadores de eventos para acciones sobre Tablas
|
|
4182
4182
|
*/
|
|
4183
|
-
BasicFormComponent.prototype.addTableActionStart = function (
|
|
4184
|
-
var tableObject = this.getTable(
|
|
4183
|
+
BasicFormComponent.prototype.addTableActionStart = function (code, actionCode, callbackMethod) {
|
|
4184
|
+
var tableObject = this.getTable(code);
|
|
4185
4185
|
if (!tableObject) {
|
|
4186
4186
|
return;
|
|
4187
4187
|
}
|
|
@@ -4190,20 +4190,20 @@
|
|
|
4190
4190
|
return;
|
|
4191
4191
|
}
|
|
4192
4192
|
var tableEventHandlers = null;
|
|
4193
|
-
if (this._tableActionsStart[
|
|
4194
|
-
tableEventHandlers = this._tableActionsStart[
|
|
4193
|
+
if (this._tableActionsStart[code]) {
|
|
4194
|
+
tableEventHandlers = this._tableActionsStart[code];
|
|
4195
4195
|
}
|
|
4196
4196
|
else {
|
|
4197
4197
|
tableEventHandlers = {};
|
|
4198
|
-
this._tableActionsStart[
|
|
4198
|
+
this._tableActionsStart[code] = tableEventHandlers;
|
|
4199
4199
|
}
|
|
4200
4200
|
if (!tableEventHandlers[actionCode]) {
|
|
4201
4201
|
tableEventHandlers[actionCode] = [];
|
|
4202
4202
|
}
|
|
4203
4203
|
tableEventHandlers[actionCode].push(callbackMethod);
|
|
4204
4204
|
};
|
|
4205
|
-
BasicFormComponent.prototype.addTableActionFinish = function (
|
|
4206
|
-
var tableObject = this.getTable(
|
|
4205
|
+
BasicFormComponent.prototype.addTableActionFinish = function (code, actionCode, callbackMethod) {
|
|
4206
|
+
var tableObject = this.getTable(code);
|
|
4207
4207
|
if (!tableObject) {
|
|
4208
4208
|
return;
|
|
4209
4209
|
}
|
|
@@ -4212,75 +4212,75 @@
|
|
|
4212
4212
|
return;
|
|
4213
4213
|
}
|
|
4214
4214
|
var tableEventHandlers = null;
|
|
4215
|
-
if (this._tableActionsFinish[
|
|
4216
|
-
tableEventHandlers = this._tableActionsFinish[
|
|
4215
|
+
if (this._tableActionsFinish[code]) {
|
|
4216
|
+
tableEventHandlers = this._tableActionsFinish[code];
|
|
4217
4217
|
}
|
|
4218
4218
|
else {
|
|
4219
4219
|
tableEventHandlers = {};
|
|
4220
|
-
this._tableActionsFinish[
|
|
4220
|
+
this._tableActionsFinish[code] = tableEventHandlers;
|
|
4221
4221
|
}
|
|
4222
4222
|
if (!tableEventHandlers[actionCode]) {
|
|
4223
4223
|
tableEventHandlers[actionCode] = [];
|
|
4224
4224
|
}
|
|
4225
4225
|
tableEventHandlers[actionCode].push(callbackMethod);
|
|
4226
4226
|
};
|
|
4227
|
-
BasicFormComponent.prototype.addTableSelectionStart = function (
|
|
4228
|
-
var tableObject = this.getTable(
|
|
4227
|
+
BasicFormComponent.prototype.addTableSelectionStart = function (code, callbackMethod) {
|
|
4228
|
+
var tableObject = this.getTable(code);
|
|
4229
4229
|
if (!tableObject) {
|
|
4230
4230
|
return;
|
|
4231
4231
|
}
|
|
4232
4232
|
var tableEventHandlers = null;
|
|
4233
|
-
if (this._tableSelectionsStart[
|
|
4234
|
-
tableEventHandlers = this._tableSelectionsStart[
|
|
4233
|
+
if (this._tableSelectionsStart[code]) {
|
|
4234
|
+
tableEventHandlers = this._tableSelectionsStart[code];
|
|
4235
4235
|
}
|
|
4236
4236
|
else {
|
|
4237
4237
|
tableEventHandlers = [];
|
|
4238
|
-
this._tableSelectionsStart[
|
|
4238
|
+
this._tableSelectionsStart[code] = tableEventHandlers;
|
|
4239
4239
|
}
|
|
4240
4240
|
tableEventHandlers.push(callbackMethod);
|
|
4241
4241
|
};
|
|
4242
|
-
BasicFormComponent.prototype.addTableSelectionFinish = function (
|
|
4243
|
-
var tableObject = this.getTable(
|
|
4242
|
+
BasicFormComponent.prototype.addTableSelectionFinish = function (code, callbackMethod) {
|
|
4243
|
+
var tableObject = this.getTable(code);
|
|
4244
4244
|
if (!tableObject) {
|
|
4245
4245
|
return;
|
|
4246
4246
|
}
|
|
4247
4247
|
var tableEventHandlers = null;
|
|
4248
|
-
if (this._tableSelectionsFinish[
|
|
4249
|
-
tableEventHandlers = this._tableSelectionsFinish[
|
|
4248
|
+
if (this._tableSelectionsFinish[code]) {
|
|
4249
|
+
tableEventHandlers = this._tableSelectionsFinish[code];
|
|
4250
4250
|
}
|
|
4251
4251
|
else {
|
|
4252
4252
|
tableEventHandlers = [];
|
|
4253
|
-
this._tableSelectionsFinish[
|
|
4253
|
+
this._tableSelectionsFinish[code] = tableEventHandlers;
|
|
4254
4254
|
}
|
|
4255
4255
|
tableEventHandlers.push(callbackMethod);
|
|
4256
4256
|
};
|
|
4257
|
-
BasicFormComponent.prototype.addTableGetDataStart = function (
|
|
4258
|
-
var tableObject = this.getTable(
|
|
4257
|
+
BasicFormComponent.prototype.addTableGetDataStart = function (code, callbackMethod) {
|
|
4258
|
+
var tableObject = this.getTable(code);
|
|
4259
4259
|
if (!tableObject) {
|
|
4260
4260
|
return;
|
|
4261
4261
|
}
|
|
4262
4262
|
var tableEventHandlers = null;
|
|
4263
|
-
if (this._tableGetDataStart[
|
|
4264
|
-
tableEventHandlers = this._tableGetDataStart[
|
|
4263
|
+
if (this._tableGetDataStart[code]) {
|
|
4264
|
+
tableEventHandlers = this._tableGetDataStart[code];
|
|
4265
4265
|
}
|
|
4266
4266
|
else {
|
|
4267
4267
|
tableEventHandlers = [];
|
|
4268
|
-
this._tableGetDataStart[
|
|
4268
|
+
this._tableGetDataStart[code] = tableEventHandlers;
|
|
4269
4269
|
}
|
|
4270
4270
|
tableEventHandlers.push(callbackMethod);
|
|
4271
4271
|
};
|
|
4272
|
-
BasicFormComponent.prototype.addTableGetDataFinish = function (
|
|
4273
|
-
var tableObject = this.getTable(
|
|
4272
|
+
BasicFormComponent.prototype.addTableGetDataFinish = function (code, callbackMethod) {
|
|
4273
|
+
var tableObject = this.getTable(code);
|
|
4274
4274
|
if (!tableObject) {
|
|
4275
4275
|
return;
|
|
4276
4276
|
}
|
|
4277
4277
|
var tableEventHandlers = null;
|
|
4278
|
-
if (this._tableGetDataFinish[
|
|
4279
|
-
tableEventHandlers = this._tableGetDataFinish[
|
|
4278
|
+
if (this._tableGetDataFinish[code]) {
|
|
4279
|
+
tableEventHandlers = this._tableGetDataFinish[code];
|
|
4280
4280
|
}
|
|
4281
4281
|
else {
|
|
4282
4282
|
tableEventHandlers = {};
|
|
4283
|
-
this._tableGetDataFinish[
|
|
4283
|
+
this._tableGetDataFinish[code] = tableEventHandlers;
|
|
4284
4284
|
}
|
|
4285
4285
|
tableEventHandlers[GET_DATA_ACTION] = callbackMethod;
|
|
4286
4286
|
};
|
|
@@ -5003,132 +5003,6 @@
|
|
|
5003
5003
|
}
|
|
5004
5004
|
return true;
|
|
5005
5005
|
};
|
|
5006
|
-
/**
|
|
5007
|
-
* Soporte registros en tablas que se editan en campos del formulario
|
|
5008
|
-
*/
|
|
5009
|
-
BasicFormComponent.prototype.defineEditionTable = function (tableEditionDef) {
|
|
5010
|
-
var e_24, _j;
|
|
5011
|
-
var _this = this;
|
|
5012
|
-
var columnFieldMapping = tableEditionDef.columnFieldMapping, recordCaptureFields = tableEditionDef.recordCaptureFields, startCollapsed = tableEditionDef.startCollapsed;
|
|
5013
|
-
tableEditionDef.startCollapsed = (typeof startCollapsed !== 'undefined')
|
|
5014
|
-
? startCollapsed : true;
|
|
5015
|
-
var fieldsMappingTable = {};
|
|
5016
|
-
var fieldsToClear = [];
|
|
5017
|
-
try {
|
|
5018
|
-
for (var columnFieldMapping_1 = __values(columnFieldMapping), columnFieldMapping_1_1 = columnFieldMapping_1.next(); !columnFieldMapping_1_1.done; columnFieldMapping_1_1 = columnFieldMapping_1.next()) {
|
|
5019
|
-
var columnMap = columnFieldMapping_1_1.value;
|
|
5020
|
-
var _k = __read(columnMap, 2), columnName = _k[0], formField = _k[1];
|
|
5021
|
-
fieldsMappingTable[columnName] = formField;
|
|
5022
|
-
fieldsToClear.push(formField);
|
|
5023
|
-
}
|
|
5024
|
-
}
|
|
5025
|
-
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
5026
|
-
finally {
|
|
5027
|
-
try {
|
|
5028
|
-
if (columnFieldMapping_1_1 && !columnFieldMapping_1_1.done && (_j = columnFieldMapping_1.return)) _j.call(columnFieldMapping_1);
|
|
5029
|
-
}
|
|
5030
|
-
finally { if (e_24) throw e_24.error; }
|
|
5031
|
-
}
|
|
5032
|
-
tableEditionDef.fieldsMappingTable = fieldsMappingTable;
|
|
5033
|
-
tableEditionDef.fieldsToClear = fieldsToClear;
|
|
5034
|
-
var tableName = tableEditionDef.tableName, newRecordActionName = tableEditionDef.newRecordActionName, saveRecordActionName = tableEditionDef.saveRecordActionName, cancelSaveRecordActionName = tableEditionDef.cancelSaveRecordActionName, tableEditRecordActionName = tableEditionDef.tableEditRecordActionName, enableRecordEdition = tableEditionDef.enableRecordEdition;
|
|
5035
|
-
this.addActionMethodStart(newRecordActionName, function () {
|
|
5036
|
-
_this.cleanFields(fieldsToClear, null);
|
|
5037
|
-
_this.showFields(recordCaptureFields);
|
|
5038
|
-
if (!enableRecordEdition) {
|
|
5039
|
-
_this.enableRecordEdition(tableEditionDef);
|
|
5040
|
-
}
|
|
5041
|
-
else {
|
|
5042
|
-
enableRecordEdition(tableEditionDef);
|
|
5043
|
-
}
|
|
5044
|
-
_this.hideAction(newRecordActionName);
|
|
5045
|
-
_this.showAction(cancelSaveRecordActionName);
|
|
5046
|
-
_this.showAction(saveRecordActionName);
|
|
5047
|
-
return true;
|
|
5048
|
-
});
|
|
5049
|
-
var recordEditionValidate = tableEditionDef.recordEditionValidate, disableRecordEdition = tableEditionDef.disableRecordEdition;
|
|
5050
|
-
this.addActionMethodStart(saveRecordActionName, function () {
|
|
5051
|
-
return (!recordEditionValidate) ? _this.recordEditionValidate(tableEditionDef)
|
|
5052
|
-
: recordEditionValidate(tableEditionDef);
|
|
5053
|
-
});
|
|
5054
|
-
this.addActionMethodFinish(saveRecordActionName, function () {
|
|
5055
|
-
if (!_this.errorOccured()) {
|
|
5056
|
-
return (!disableRecordEdition) ? _this.disableRecordEdition(tableEditionDef)
|
|
5057
|
-
: disableRecordEdition(tableEditionDef);
|
|
5058
|
-
}
|
|
5059
|
-
});
|
|
5060
|
-
this.addActionMethodStart(cancelSaveRecordActionName, function () {
|
|
5061
|
-
return (!disableRecordEdition) ? _this.disableRecordEdition(tableEditionDef)
|
|
5062
|
-
: disableRecordEdition(tableEditionDef);
|
|
5063
|
-
});
|
|
5064
|
-
this.addTableActionStart(tableName, tableEditRecordActionName, function (tblActObj) {
|
|
5065
|
-
return (!enableRecordEdition)
|
|
5066
|
-
? _this.enableRecordEdition(tableEditionDef, tblActObj)
|
|
5067
|
-
: enableRecordEdition(tableEditionDef, tblActObj);
|
|
5068
|
-
});
|
|
5069
|
-
if (tableEditionDef.startCollapsed) {
|
|
5070
|
-
return (!tableEditionDef.disableRecordEdition)
|
|
5071
|
-
? this.disableRecordEdition(tableEditionDef)
|
|
5072
|
-
: tableEditionDef.disableRecordEdition(tableEditionDef);
|
|
5073
|
-
}
|
|
5074
|
-
else {
|
|
5075
|
-
return (!tableEditionDef.enableRecordEdition)
|
|
5076
|
-
? this.enableRecordEdition(tableEditionDef)
|
|
5077
|
-
: tableEditionDef.enableRecordEdition(tableEditionDef, null);
|
|
5078
|
-
}
|
|
5079
|
-
};
|
|
5080
|
-
BasicFormComponent.prototype.enableRecordEdition = function (tableEditionDef, tableActionObject) {
|
|
5081
|
-
var e_25, _j;
|
|
5082
|
-
if (tableActionObject === void 0) { tableActionObject = null; }
|
|
5083
|
-
if (tableActionObject) {
|
|
5084
|
-
this.copyTableRecordToFields(tableActionObject, tableEditionDef.fieldsMappingTable);
|
|
5085
|
-
}
|
|
5086
|
-
this.showFields(tableEditionDef.recordCaptureFields);
|
|
5087
|
-
this.hideAction(tableEditionDef.newRecordActionName);
|
|
5088
|
-
this.showAction(tableEditionDef.cancelSaveRecordActionName);
|
|
5089
|
-
this.showAction(tableEditionDef.saveRecordActionName);
|
|
5090
|
-
if (tableEditionDef.fieldsToTriggerValidation
|
|
5091
|
-
&& tableEditionDef.fieldsToTriggerValidation.length > 0) {
|
|
5092
|
-
try {
|
|
5093
|
-
for (var _k = __values(tableEditionDef.fieldsToTriggerValidation), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
5094
|
-
var fieldName = _l.value;
|
|
5095
|
-
this.startFieldValidation(fieldName);
|
|
5096
|
-
}
|
|
5097
|
-
}
|
|
5098
|
-
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
5099
|
-
finally {
|
|
5100
|
-
try {
|
|
5101
|
-
if (_l && !_l.done && (_j = _k.return)) _j.call(_k);
|
|
5102
|
-
}
|
|
5103
|
-
finally { if (e_25) throw e_25.error; }
|
|
5104
|
-
}
|
|
5105
|
-
}
|
|
5106
|
-
return true;
|
|
5107
|
-
};
|
|
5108
|
-
BasicFormComponent.prototype.disableRecordEdition = function (tableDefinition) {
|
|
5109
|
-
this.cleanFields(tableDefinition.fieldsToClear, null);
|
|
5110
|
-
this.hideFields(tableDefinition.recordCaptureFields);
|
|
5111
|
-
this.showAction(tableDefinition.newRecordActionName);
|
|
5112
|
-
this.hideAction(tableDefinition.cancelSaveRecordActionName);
|
|
5113
|
-
this.hideAction(tableDefinition.saveRecordActionName);
|
|
5114
|
-
return true;
|
|
5115
|
-
};
|
|
5116
|
-
BasicFormComponent.prototype.recordEditionValidate = function (tableEditionDef) {
|
|
5117
|
-
var recordCaptureFields = tableEditionDef.recordCaptureFields;
|
|
5118
|
-
var validationOk = true;
|
|
5119
|
-
var requiredEmptyFields = this.getRequiredEmptyFields(recordCaptureFields, null);
|
|
5120
|
-
if (requiredEmptyFields.length > 0) {
|
|
5121
|
-
validationOk = false;
|
|
5122
|
-
this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.requiredFields);
|
|
5123
|
-
this.tagFieldsWithError(requiredEmptyFields, null, this.formConfig.formStandardErrors.requiredField);
|
|
5124
|
-
}
|
|
5125
|
-
var validationIssueFields = this.getFieldsWithValidationIssues(recordCaptureFields, null);
|
|
5126
|
-
if (validationIssueFields.length > 0) {
|
|
5127
|
-
validationOk = false;
|
|
5128
|
-
this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.validationFields);
|
|
5129
|
-
}
|
|
5130
|
-
return validationOk;
|
|
5131
|
-
};
|
|
5132
5006
|
return BasicFormComponent;
|
|
5133
5007
|
}());
|
|
5134
5008
|
BasicFormComponent.decorators = [
|