tuain-ng-forms-lib 0.12.32 → 12.0.4

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.
@@ -54,230 +54,6 @@
54
54
  showLabel: [{ type: core.Input }]
55
55
  };
56
56
 
57
- var MONITORED_ATTRIBUTES = {
58
- _maxLength: 'maxLength',
59
- _onValidation: 'onValidation',
60
- _fieldValue: 'value',
61
- captureType: 'captureType',
62
- fieldTitle: 'title',
63
- fieldType: 'type',
64
- errorMessage: 'errorMessage',
65
- errorType: 'errorType',
66
- errorCode: 'errorCode',
67
- visibleLabel: 'visibleLabel',
68
- fieldRequired: 'required',
69
- fieldOptions: 'options',
70
- };
71
- var FieldComponent = /** @class */ (function () {
72
- function FieldComponent() {
73
- }
74
- FieldComponent.prototype.ngOnInit = function () {
75
- var _this = this;
76
- var _a;
77
- if (this.fieldObject) {
78
- this.formConfig = (_a = this.fieldObject) === null || _a === void 0 ? void 0 : _a._formConfig;
79
- // Atributos estáticos
80
- this.code = this.fieldObject.fieldCode;
81
- this.fieldInfo = this.fieldObject.fieldInfo;
82
- this.fieldAlignment = this.fieldObject.fieldAlignment;
83
- this.tooltipText = this.fieldObject.tooltipText;
84
- // Cargue inicial
85
- this.maxLength = this.fieldObject._maxLength;
86
- this.onValidation = this.fieldObject._onValidation;
87
- this.value = this.fieldObject._fieldValue;
88
- this.captureType = this.fieldObject.captureType;
89
- this.title = this.fieldObject.fieldTitle;
90
- this.type = this.fieldObject.fieldType;
91
- this.errorMessage = this.fieldObject.errorMessage;
92
- this.errorType = this.fieldObject.errorType;
93
- this.errorCode = this.fieldObject.errorCode;
94
- this.visibleLabel = this.fieldObject.visibleLabel;
95
- this.required = this.fieldObject.fieldRequired;
96
- this.options = this.fieldObject.fieldOptions;
97
- this.fieldObject.widget = this;
98
- // Atributos dinámicos
99
- this.fieldObject.attributeChange.subscribe(function (event) {
100
- var name = event.name, value = event.value;
101
- if (_this[MONITORED_ATTRIBUTES[name]]) {
102
- _this[MONITORED_ATTRIBUTES[name]] = value;
103
- }
104
- });
105
- }
106
- this.start();
107
- };
108
- FieldComponent.prototype.start = function () { };
109
- FieldComponent.prototype.focus = function () { };
110
- FieldComponent.prototype.onInputChange = function () {
111
- var _this = this;
112
- setTimeout(function () { return _this.fieldObject.notifyEditionPartial(); }, 50);
113
- };
114
- FieldComponent.prototype.onChangeContent = function () {
115
- var _this = this;
116
- setTimeout(function () { return _this.fieldObject.notifyEditionFinish(); }, 50);
117
- };
118
- FieldComponent.prototype.onShowInfo = function () {
119
- var _this = this;
120
- setTimeout(function () { return _this.fieldObject.notifyEditionDetailRequest(); }, 50);
121
- };
122
- FieldComponent.prototype.numberInputValidation = function (event) {
123
- var k = event.charCode;
124
- return (k > 47 && k < 58);
125
- };
126
- return FieldComponent;
127
- }());
128
- FieldComponent.decorators = [
129
- { type: core.Component, args: [{
130
- selector: 'lib-field',
131
- template: "<ng-content></ng-content>"
132
- },] }
133
- ];
134
- FieldComponent.propDecorators = {
135
- fieldObject: [{ type: core.Input }],
136
- disabled: [{ type: core.Input }]
137
- };
138
-
139
- var ElementComponent = /** @class */ (function () {
140
- function ElementComponent() {
141
- }
142
- ElementComponent.prototype.ngOnInit = function () {
143
- var _a;
144
- this.formConfig = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a._formConfig;
145
- this.start();
146
- };
147
- ElementComponent.prototype.start = function () { };
148
- Object.defineProperty(ElementComponent.prototype, "visible", {
149
- get: function () {
150
- var _a, _b, _c, _d;
151
- var visible = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : true;
152
- return visible && ((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.viewOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
153
- },
154
- enumerable: false,
155
- configurable: true
156
- });
157
- Object.defineProperty(ElementComponent.prototype, "disabled", {
158
- get: function () {
159
- var _a, _b, _c, _d;
160
- var disabled = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : false;
161
- return disabled || !((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.enabledOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
162
- },
163
- enumerable: false,
164
- configurable: true
165
- });
166
- return ElementComponent;
167
- }());
168
- ElementComponent.decorators = [
169
- { type: core.Component, args: [{
170
- selector: 'lib-element',
171
- template: "<ng-content></ng-content>"
172
- },] }
173
- ];
174
- ElementComponent.propDecorators = {
175
- formElement: [{ type: core.Input }],
176
- formManager: [{ type: core.Input }]
177
- };
178
-
179
- var FormErrorComponent = /** @class */ (function () {
180
- function FormErrorComponent() {
181
- }
182
- return FormErrorComponent;
183
- }());
184
- FormErrorComponent.decorators = [
185
- { type: core.Component, args: [{
186
- selector: 'lib-form-error',
187
- template: "<ng-content></ng-content>"
188
- },] }
189
- ];
190
- FormErrorComponent.propDecorators = {
191
- errorTitle: [{ type: core.Input }],
192
- errorMessage: [{ type: core.Input }],
193
- errorType: [{ type: core.Input }]
194
- };
195
-
196
- var FormHeaderComponent = /** @class */ (function () {
197
- function FormHeaderComponent() {
198
- this.goBackEvent = new core.EventEmitter();
199
- }
200
- FormHeaderComponent.prototype.goBackForm = function () {
201
- this.goBackEvent.emit();
202
- };
203
- return FormHeaderComponent;
204
- }());
205
- FormHeaderComponent.decorators = [
206
- { type: core.Component, args: [{
207
- selector: 'lib-form-header',
208
- template: "<ng-content></ng-content>"
209
- },] }
210
- ];
211
- FormHeaderComponent.propDecorators = {
212
- formManager: [{ type: core.Input }],
213
- goBackAction: [{ type: core.Input }],
214
- showTitle: [{ type: core.Input }],
215
- headerActions: [{ type: core.Input }],
216
- goBackEvent: [{ type: core.Output }]
217
- };
218
-
219
- var SectionComponent = /** @class */ (function () {
220
- function SectionComponent() {
221
- }
222
- SectionComponent.prototype.ngOnInit = function () {
223
- this.start();
224
- };
225
- SectionComponent.prototype.start = function () { };
226
- return SectionComponent;
227
- }());
228
- SectionComponent.decorators = [
229
- { type: core.Component, args: [{
230
- selector: 'lib-section',
231
- template: "<ng-content></ng-content>"
232
- },] }
233
- ];
234
- SectionComponent.propDecorators = {
235
- sectionObject: [{ type: core.Input }],
236
- formManager: [{ type: core.Input }]
237
- };
238
-
239
- var SubSectionComponent = /** @class */ (function () {
240
- function SubSectionComponent() {
241
- }
242
- SubSectionComponent.prototype.ngOnInit = function () {
243
- this.start();
244
- };
245
- SubSectionComponent.prototype.start = function () { };
246
- return SubSectionComponent;
247
- }());
248
- SubSectionComponent.decorators = [
249
- { type: core.Component, args: [{
250
- selector: 'lib-subsection',
251
- template: "<ng-content></ng-content>"
252
- },] }
253
- ];
254
- SubSectionComponent.propDecorators = {
255
- subSection: [{ type: core.Input }],
256
- showHeader: [{ type: core.Input }],
257
- formManager: [{ type: core.Input }]
258
- };
259
-
260
- var FieldSearch = /** @class */ (function () {
261
- function FieldSearch(filterDefinition) {
262
- this.fieldCode = filterDefinition.fieldCode;
263
- this.fieldAlias = filterDefinition.fieldAlias || filterDefinition.fieldCode;
264
- this.fieldTitle = filterDefinition.fieldTitle;
265
- this.fieldTypeCode = filterDefinition.fieldTypeCode;
266
- this.operators = filterDefinition.operators;
267
- this.alignment = filterDefinition.alignment;
268
- this.format = filterDefinition.format;
269
- }
270
- return FieldSearch;
271
- }());
272
- var Filter = /** @class */ (function () {
273
- function Filter() {
274
- this.filterModeSimple = true;
275
- this.advancedFilter = [];
276
- this.simpleFilterWords = [];
277
- }
278
- return Filter;
279
- }());
280
-
281
57
  /*! *****************************************************************************
282
58
  Copyright (c) Microsoft Corporation.
283
59
 
@@ -557,45 +333,243 @@
557
333
  else {
558
334
  cooked.raw = raw;
559
335
  }
560
- return cooked;
561
- }
562
- ;
563
- var __setModuleDefault = Object.create ? (function (o, v) {
564
- Object.defineProperty(o, "default", { enumerable: true, value: v });
565
- }) : function (o, v) {
566
- o["default"] = v;
336
+ return cooked;
337
+ }
338
+ ;
339
+ var __setModuleDefault = Object.create ? (function (o, v) {
340
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
341
+ }) : function (o, v) {
342
+ o["default"] = v;
343
+ };
344
+ function __importStar(mod) {
345
+ if (mod && mod.__esModule)
346
+ return mod;
347
+ var result = {};
348
+ if (mod != null)
349
+ for (var k in mod)
350
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
351
+ __createBinding(result, mod, k);
352
+ __setModuleDefault(result, mod);
353
+ return result;
354
+ }
355
+ function __importDefault(mod) {
356
+ return (mod && mod.__esModule) ? mod : { default: mod };
357
+ }
358
+ function __classPrivateFieldGet(receiver, state, kind, f) {
359
+ if (kind === "a" && !f)
360
+ throw new TypeError("Private accessor was defined without a getter");
361
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
362
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
363
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
364
+ }
365
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
366
+ if (kind === "m")
367
+ throw new TypeError("Private method is not writable");
368
+ if (kind === "a" && !f)
369
+ throw new TypeError("Private accessor was defined without a setter");
370
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
371
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
372
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
373
+ }
374
+
375
+ var FieldComponent = /** @class */ (function () {
376
+ function FieldComponent() {
377
+ }
378
+ FieldComponent.prototype.ngOnInit = function () {
379
+ var _this = this;
380
+ var _a, _b;
381
+ if (this.fieldObject) {
382
+ this.formConfig = (_a = this.fieldObject) === null || _a === void 0 ? void 0 : _a._formConfig;
383
+ // Inicialización
384
+ var mapping = Object.entries(this.formConfig.componentFieldAttrMap);
385
+ for (var index = 0; index < mapping.length; index++) {
386
+ var _c = __read(mapping[index], 2), fieldAttr = _c[0], compAttr = _c[1];
387
+ this[compAttr.toString()] = (_b = this.fieldObject) === null || _b === void 0 ? void 0 : _b[fieldAttr.toString()];
388
+ }
389
+ // Subscripción a cambios en atributos
390
+ this.fieldObject.attributeChange.subscribe(function (event) {
391
+ var fieldAttr = event.name, value = event.value;
392
+ var compAttr = _this.formConfig.componentFieldAttrMap[fieldAttr];
393
+ _this.hasOwnProperty(compAttr) && (_this[compAttr] = value);
394
+ });
395
+ }
396
+ this.start();
397
+ };
398
+ FieldComponent.prototype.start = function () { };
399
+ FieldComponent.prototype.focus = function () { };
400
+ FieldComponent.prototype.onInputChange = function () {
401
+ var _this = this;
402
+ setTimeout(function () { return _this.fieldObject.notifyEditionPartial(); }, 50);
403
+ };
404
+ FieldComponent.prototype.onChangeContent = function () {
405
+ var _this = this;
406
+ setTimeout(function () { return _this.fieldObject.notifyEditionFinish(); }, 50);
407
+ };
408
+ FieldComponent.prototype.onShowInfo = function () {
409
+ var _this = this;
410
+ setTimeout(function () { return _this.fieldObject.notifyEditionDetailRequest(); }, 50);
411
+ };
412
+ FieldComponent.prototype.numberInputValidation = function (event) {
413
+ var k = event.charCode;
414
+ return (k > 47 && k < 58);
415
+ };
416
+ return FieldComponent;
417
+ }());
418
+ FieldComponent.decorators = [
419
+ { type: core.Component, args: [{
420
+ selector: 'lib-field',
421
+ template: "<ng-content></ng-content>"
422
+ },] }
423
+ ];
424
+ FieldComponent.propDecorators = {
425
+ fieldObject: [{ type: core.Input }],
426
+ disabled: [{ type: core.Input }]
427
+ };
428
+
429
+ var ElementComponent = /** @class */ (function () {
430
+ function ElementComponent() {
431
+ }
432
+ ElementComponent.prototype.ngOnInit = function () {
433
+ var _a;
434
+ this.formConfig = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a._formConfig;
435
+ this.start();
436
+ };
437
+ ElementComponent.prototype.start = function () { };
438
+ Object.defineProperty(ElementComponent.prototype, "visible", {
439
+ get: function () {
440
+ var _a, _b, _c, _d;
441
+ var visible = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : true;
442
+ return visible && ((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.viewOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
443
+ },
444
+ enumerable: false,
445
+ configurable: true
446
+ });
447
+ Object.defineProperty(ElementComponent.prototype, "disabled", {
448
+ get: function () {
449
+ var _a, _b, _c, _d;
450
+ var disabled = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : false;
451
+ return disabled || !((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.enabledOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
452
+ },
453
+ enumerable: false,
454
+ configurable: true
455
+ });
456
+ return ElementComponent;
457
+ }());
458
+ ElementComponent.decorators = [
459
+ { type: core.Component, args: [{
460
+ selector: 'lib-element',
461
+ template: "<ng-content></ng-content>"
462
+ },] }
463
+ ];
464
+ ElementComponent.propDecorators = {
465
+ formElement: [{ type: core.Input }],
466
+ formManager: [{ type: core.Input }]
467
+ };
468
+
469
+ var FormErrorComponent = /** @class */ (function () {
470
+ function FormErrorComponent() {
471
+ }
472
+ return FormErrorComponent;
473
+ }());
474
+ FormErrorComponent.decorators = [
475
+ { type: core.Component, args: [{
476
+ selector: 'lib-form-error',
477
+ template: "<ng-content></ng-content>"
478
+ },] }
479
+ ];
480
+ FormErrorComponent.propDecorators = {
481
+ errorTitle: [{ type: core.Input }],
482
+ errorMessage: [{ type: core.Input }],
483
+ errorType: [{ type: core.Input }]
484
+ };
485
+
486
+ var FormHeaderComponent = /** @class */ (function () {
487
+ function FormHeaderComponent() {
488
+ this.goBackEvent = new core.EventEmitter();
489
+ }
490
+ FormHeaderComponent.prototype.goBackForm = function () {
491
+ this.goBackEvent.emit();
492
+ };
493
+ return FormHeaderComponent;
494
+ }());
495
+ FormHeaderComponent.decorators = [
496
+ { type: core.Component, args: [{
497
+ selector: 'lib-form-header',
498
+ template: "<ng-content></ng-content>"
499
+ },] }
500
+ ];
501
+ FormHeaderComponent.propDecorators = {
502
+ formManager: [{ type: core.Input }],
503
+ goBackAction: [{ type: core.Input }],
504
+ showTitle: [{ type: core.Input }],
505
+ headerActions: [{ type: core.Input }],
506
+ goBackEvent: [{ type: core.Output }]
507
+ };
508
+
509
+ var SectionComponent = /** @class */ (function () {
510
+ function SectionComponent() {
511
+ }
512
+ SectionComponent.prototype.ngOnInit = function () {
513
+ this.start();
514
+ };
515
+ SectionComponent.prototype.start = function () { };
516
+ return SectionComponent;
517
+ }());
518
+ SectionComponent.decorators = [
519
+ { type: core.Component, args: [{
520
+ selector: 'lib-section',
521
+ template: "<ng-content></ng-content>"
522
+ },] }
523
+ ];
524
+ SectionComponent.propDecorators = {
525
+ sectionObject: [{ type: core.Input }],
526
+ formManager: [{ type: core.Input }]
527
+ };
528
+
529
+ var SubSectionComponent = /** @class */ (function () {
530
+ function SubSectionComponent() {
531
+ }
532
+ SubSectionComponent.prototype.ngOnInit = function () {
533
+ this.start();
534
+ };
535
+ SubSectionComponent.prototype.start = function () { };
536
+ return SubSectionComponent;
537
+ }());
538
+ SubSectionComponent.decorators = [
539
+ { type: core.Component, args: [{
540
+ selector: 'lib-subsection',
541
+ template: "<ng-content></ng-content>"
542
+ },] }
543
+ ];
544
+ SubSectionComponent.propDecorators = {
545
+ subSection: [{ type: core.Input }],
546
+ showHeader: [{ type: core.Input }],
547
+ formManager: [{ type: core.Input }]
567
548
  };
568
- function __importStar(mod) {
569
- if (mod && mod.__esModule)
570
- return mod;
571
- var result = {};
572
- if (mod != null)
573
- for (var k in mod)
574
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
575
- __createBinding(result, mod, k);
576
- __setModuleDefault(result, mod);
577
- return result;
578
- }
579
- function __importDefault(mod) {
580
- return (mod && mod.__esModule) ? mod : { default: mod };
581
- }
582
- function __classPrivateFieldGet(receiver, state, kind, f) {
583
- if (kind === "a" && !f)
584
- throw new TypeError("Private accessor was defined without a getter");
585
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
586
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
587
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
588
- }
589
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
590
- if (kind === "m")
591
- throw new TypeError("Private method is not writable");
592
- if (kind === "a" && !f)
593
- throw new TypeError("Private accessor was defined without a setter");
594
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
595
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
596
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
597
- }
598
549
 
550
+ var FieldSearch = /** @class */ (function () {
551
+ function FieldSearch(filterDefinition) {
552
+ this.fieldCode = filterDefinition.fieldCode;
553
+ this.fieldAlias = filterDefinition.fieldAlias || filterDefinition.fieldCode;
554
+ this.fieldTitle = filterDefinition.fieldTitle;
555
+ this.fieldTypeCode = filterDefinition.fieldTypeCode;
556
+ this.operators = filterDefinition.operators;
557
+ this.alignment = filterDefinition.alignment;
558
+ this.format = filterDefinition.format;
559
+ }
560
+ return FieldSearch;
561
+ }());
562
+ var Filter = /** @class */ (function () {
563
+ function Filter() {
564
+ this.filterModeSimple = true;
565
+ this.advancedFilter = [];
566
+ this.simpleFilterWords = [];
567
+ }
568
+ return Filter;
569
+ }());
570
+
571
+ var NO_ERROR = '00';
572
+ var HEADER$1 = 'HEADER';
599
573
  var elementTypes = {
600
574
  action: 'ACTION',
601
575
  field: 'FIELD',
@@ -1861,7 +1835,7 @@
1861
1835
  return RecordFormSection;
1862
1836
  }());
1863
1837
 
1864
- var HEADER$1 = 'HEADER';
1838
+ var HEADER = 'HEADER';
1865
1839
  var FormAction = /** @class */ (function (_super) {
1866
1840
  __extends(FormAction, _super);
1867
1841
  function FormAction(actionDefinition, formConfig) {
@@ -1874,7 +1848,7 @@
1874
1848
  _this.actionCode = actionDefinition.actionCode ? actionDefinition.actionCode.toString() : '';
1875
1849
  _this.actionName = actionDefinition.actionTitle;
1876
1850
  _this.iconName = actionDefinition.iconName || _this.actionCode;
1877
- _this.location = actionDefinition.position || HEADER$1;
1851
+ _this.location = actionDefinition.position || HEADER;
1878
1852
  _this.backend = (_a = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.serverAction) !== null && _a !== void 0 ? _a : false;
1879
1853
  _this.newState = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.newState;
1880
1854
  _this.customAttributes = (_b = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.customAttributes) !== null && _b !== void 0 ? _b : null;
@@ -2097,11 +2071,12 @@
2097
2071
  if (editable === void 0) { editable = true; }
2098
2072
  (editable) ? this.enable() : this.disable();
2099
2073
  };
2100
- FieldDescriptor.prototype.hasError = function () { return this.errorCode !== '00'; };
2074
+ FieldDescriptor.prototype.hasError = function () { return this.errorCode !== NO_ERROR; };
2075
+ FieldDescriptor.prototype.resetError = function () { (this.errorCode !== NO_ERROR) && this.setError(NO_ERROR, null); };
2101
2076
  FieldDescriptor.prototype.setError = function (code, message, type) {
2102
2077
  if (type === void 0) { type = DEFAULT_ERROR_TYPE; }
2103
- this.setAttr(fldAttr.errorCode, code !== null && code !== void 0 ? code : '00');
2104
- this.setAttr(fldAttr.errorType, (this.errorCode === '00') ? '' : type);
2078
+ this.setAttr(fldAttr.errorCode, code !== null && code !== void 0 ? code : NO_ERROR);
2079
+ this.setAttr(fldAttr.errorType, (this.errorCode === NO_ERROR) ? '' : type);
2105
2080
  this.setAttr(fldAttr.errorMessage, message !== null && message !== void 0 ? message : '');
2106
2081
  };
2107
2082
  FieldDescriptor.prototype.getError = function () { return { type: this.errorType, code: this.errorCode, message: this.errorMessage }; };
@@ -2128,11 +2103,14 @@
2128
2103
  return fieldCurrentValue === '';
2129
2104
  };
2130
2105
  FieldDescriptor.prototype.getValue = function () {
2131
- var _a;
2106
+ var _a, _b;
2132
2107
  switch (this.fieldType) {
2133
- case this._formConfig.fieldTypes.check:
2108
+ case this._formConfig.fieldTypes.boolean:
2134
2109
  return (_a = this._fieldValue) !== null && _a !== void 0 ? _a : false;
2135
2110
  break;
2111
+ case this._formConfig.fieldTypes.check:
2112
+ return (_b = this._fieldValue) !== null && _b !== void 0 ? _b : false;
2113
+ break;
2136
2114
  case this._formConfig.fieldTypes.currency:
2137
2115
  return this._fieldValue.replace(',', '');
2138
2116
  break;
@@ -2156,7 +2134,7 @@
2156
2134
  (attrName === this._formConfig.apifieldattrs.info) && this.setAttr(fldAttr.info, fld.info);
2157
2135
  (attrName === this._formConfig.apifieldattrs.editable) && this.setEditable(fld.editable);
2158
2136
  (attrName === this._formConfig.apifieldattrs.title) && this.setLabel(fld.fieldTitle.toString());
2159
- (attrName === this._formConfig.apifieldattrs.value) && (this.setValue(fld._fieldValue) && this.setChanged(false));
2137
+ (attrName === this._formConfig.apifieldattrs.value) && (this.setValue(fld.fieldValue) && this.setChanged(false));
2160
2138
  (attrName === this._formConfig.apifieldattrs.options) && this.setFieldOptions(fld.fieldOptions);
2161
2139
  (attrName === this._formConfig.apifieldattrs.captureType) && this.setAttr(fldAttr.captureType, fld.captureType || 'INPUT');
2162
2140
  (attrName === this._formConfig.apifieldattrs.type) && this.setFieldType(fld.fieldTypeCode);
@@ -2254,6 +2232,9 @@
2254
2232
  case 'BOOLEAN':
2255
2233
  newFinalValue = !!newValue;
2256
2234
  break;
2235
+ case this._formConfig.fieldTypes.boolean:
2236
+ newFinalValue = !!newValue;
2237
+ break;
2257
2238
  case this._formConfig.fieldTypes.check:
2258
2239
  newFinalValue = !!newValue;
2259
2240
  break;
@@ -2295,8 +2276,6 @@
2295
2276
  return FieldDescriptor;
2296
2277
  }(FormElement));
2297
2278
 
2298
- var HEADER = 'HEADER';
2299
- var NO_ERROR = '00';
2300
2279
  var FormStructureAndData = /** @class */ (function () {
2301
2280
  function FormStructureAndData(definitionReceived, formConfig) {
2302
2281
  var e_1, _d, e_2, _e, e_3, _f, e_4, _g;
@@ -2545,7 +2524,7 @@
2545
2524
  return this._actions;
2546
2525
  };
2547
2526
  FormStructureAndData.prototype.getHeaderActions = function () {
2548
- return this._actions.filter(function (actionItem) { return actionItem.location === HEADER; });
2527
+ return this._actions.filter(function (actionItem) { return actionItem.location === HEADER$1; });
2549
2528
  };
2550
2529
  FormStructureAndData.prototype.getFieldObject = function (elementId) {
2551
2530
  return (this._fieldsObj && elementId && this._fieldsObj[elementId])
@@ -3077,71 +3056,79 @@
3077
3056
  function LibFormManagerService() {
3078
3057
  this.cleanStack();
3079
3058
  }
3080
- /**
3081
- * Métodos virtuales de manejo de formularios
3082
- */
3059
+ // Métodos virtuales para las aplicaciones
3083
3060
  LibFormManagerService.prototype.getFormDefinition = function (formCode) { };
3061
+ LibFormManagerService.prototype.getFormRoute = function (formCode) { };
3062
+ LibFormManagerService.prototype.getRouteForm = function (path) { };
3084
3063
  LibFormManagerService.prototype.execServerAction = function (actionDetail) { };
3085
- LibFormManagerService.prototype.goToRoute = function (navigationArray) { };
3086
- /**
3087
- * Manejo del stack de navegación con atributos estados y parámetros
3088
- */
3089
- LibFormManagerService.prototype.resetPageStack = function () { this.cleanStack(); };
3090
- LibFormManagerService.prototype.cleanStack = function () {
3091
- this.pageStack = [];
3092
- };
3064
+ LibFormManagerService.prototype.goToForm = function (formCode, token, subject) { };
3093
3065
  LibFormManagerService.prototype.loadStack = function () { };
3094
3066
  LibFormManagerService.prototype.saveStack = function () { };
3095
- LibFormManagerService.prototype.stack = function (data) {
3096
- var id = nanoid.nanoid(6);
3097
- this.pageStack.push({ id: id, data: data });
3098
- this.saveStack();
3099
- return id;
3100
- };
3101
- LibFormManagerService.prototype.unstack = function (id) {
3102
- var stackIdx = this.pageStack.findIndex(function (item) { return item.id === id; });
3103
- if (stackIdx >= 0) {
3104
- var formData = this.pageStack[stackIdx].data;
3105
- // Se eliminan los formularios posteriores al solicitado
3106
- this.pageStack.splice(stackIdx + 1);
3067
+ LibFormManagerService.prototype.cleanStack = function () { this.pageStack = []; };
3068
+ LibFormManagerService.prototype.resetPageStack = function () { this.cleanStack(); };
3069
+ LibFormManagerService.prototype.findFormInStack = function (token) {
3070
+ var index = this.pageStack.findIndex(function (item) { return (item === null || item === void 0 ? void 0 : item.token) === token; });
3071
+ var data = (index >= 0) ? this.pageStack[index] : null;
3072
+ return { index: index, data: data };
3073
+ };
3074
+ LibFormManagerService.prototype.replaceItem = function (token, formInfo) {
3075
+ var _a, _b;
3076
+ if (!token || !formInfo) {
3077
+ return;
3078
+ }
3079
+ var _c = this.findFormInStack(token), index = _c.index, storedForm = _c.data;
3080
+ var updatedForm = null;
3081
+ if (index >= 0) {
3082
+ updatedForm = Object.assign({}, storedForm);
3083
+ updatedForm.subject = (_a = formInfo === null || formInfo === void 0 ? void 0 : formInfo.subject) !== null && _a !== void 0 ? _a : storedForm.subject;
3084
+ updatedForm.state = (_b = formInfo === null || formInfo === void 0 ? void 0 : formInfo.state) !== null && _b !== void 0 ? _b : storedForm.state;
3085
+ Object.assign(updatedForm.fields, formInfo.fields);
3086
+ Object.assign(updatedForm.extra, formInfo.extra);
3087
+ this.pageStack[index] = updatedForm;
3107
3088
  this.saveStack();
3108
- return formData;
3109
3089
  }
3110
3090
  };
3111
- LibFormManagerService.prototype.getInputData = function (id) {
3112
- var stackIdx = (id) ? this.pageStack.findIndex(function (item) { return item.id === id; }) : -1;
3113
- if (stackIdx >= 0) {
3114
- var predefinedFields = this.pageStack[stackIdx].data.target.predefinedFields;
3115
- return predefinedFields;
3091
+ LibFormManagerService.prototype.stack = function (origin, target) {
3092
+ var token = nanoid.nanoid(6);
3093
+ this.replaceItem(target.originToken, origin);
3094
+ this.pageStack.push(Object.assign({ token: token }, target));
3095
+ this.saveStack();
3096
+ return token;
3097
+ };
3098
+ LibFormManagerService.prototype.unstack = function (token) {
3099
+ if (token === void 0) { token = null; }
3100
+ var index = (token) ? this.findFormInStack(token).index : this.pageStack.length - 2;
3101
+ var formInfo = null;
3102
+ if (index >= 0) {
3103
+ formInfo = this.pageStack[index];
3104
+ this.pageStack.splice(index + 1);
3105
+ this.saveStack();
3116
3106
  }
3117
- return null;
3107
+ return formInfo;
3118
3108
  };
3119
- LibFormManagerService.prototype.getOriginInfo = function (id) {
3120
- var stackIdx = (id) ? this.pageStack.findIndex(function (item) { return item.id === id; }) : -1;
3121
- if (stackIdx >= 0) {
3122
- var origin = this.pageStack[stackIdx].data.origin;
3123
- return JSON.parse(JSON.stringify(origin));
3124
- }
3125
- return null;
3109
+ LibFormManagerService.prototype.getFormInfo = function (token) {
3110
+ var _a, _b;
3111
+ var data = this.findFormInStack(token).data;
3112
+ return {
3113
+ token: data === null || data === void 0 ? void 0 : data.token,
3114
+ subject: data === null || data === void 0 ? void 0 : data.subject,
3115
+ state: data === null || data === void 0 ? void 0 : data.state,
3116
+ originToken: data === null || data === void 0 ? void 0 : data.originToken,
3117
+ fields: (_a = data === null || data === void 0 ? void 0 : data.fields) !== null && _a !== void 0 ? _a : {},
3118
+ extra: (_b = data === null || data === void 0 ? void 0 : data.extra) !== null && _b !== void 0 ? _b : {}
3119
+ };
3126
3120
  };
3127
- LibFormManagerService.prototype.changeForm = function (origin, target) {
3128
- if (!origin) {
3129
- this.cleanStack();
3130
- }
3131
- var url = target.url, params = target.params;
3132
- var newToken = this.stack({ origin: origin, target: target });
3133
- var navigationArray = __spreadArray(__spreadArray([url], __read(params)), [newToken]);
3134
- this.goToRoute(navigationArray);
3121
+ LibFormManagerService.prototype.openForm = function (origin, target) {
3122
+ var _a;
3123
+ (!origin) && this.cleanStack();
3124
+ target.originToken = (_a = origin === null || origin === void 0 ? void 0 : origin.token) !== null && _a !== void 0 ? _a : null;
3125
+ var token = this.stack(origin, target);
3126
+ this.goToForm(target.name, token, target.subject);
3135
3127
  };
3136
- LibFormManagerService.prototype.changePreviousForm = function (transitionToken) {
3137
- var prevForm = this.unstack(transitionToken);
3138
- if (!prevForm) {
3139
- return;
3140
- }
3141
- var _a = prevForm.origin, url = _a.url, params = _a.params, token = _a.token;
3142
- var navigationArray = __spreadArray([url], __read(params));
3143
- token && navigationArray.push(token);
3144
- this.goToRoute(navigationArray);
3128
+ LibFormManagerService.prototype.backTo = function (targetToken) {
3129
+ if (targetToken === void 0) { targetToken = null; }
3130
+ var formInfo = this.unstack(targetToken);
3131
+ formInfo && formInfo.name && this.goToForm(formInfo.name, formInfo.token, formInfo.subject);
3145
3132
  };
3146
3133
  return LibFormManagerService;
3147
3134
  }());
@@ -3180,11 +3167,8 @@
3180
3167
  var INLINE_ACTION = 'INLINE';
3181
3168
  var GLOBAL_ACTION = 'GLOBAL';
3182
3169
  var GET_DATA_ACTION = 'GETDATA';
3183
- var FORM_CODE = 'form';
3184
- var FORM_SUBJECT = 'formSubject';
3185
- var ORIGIN_PARAM = 'origin';
3186
- var STATE_PARAM = 'mode';
3187
- var REQUIRED_FIELD_MESSAGE = 'Campo requerido';
3170
+ var SUBJECT = 'subject';
3171
+ var TOKEN = 'token';
3188
3172
  var BasicFormComponent = /** @class */ (function () {
3189
3173
  function BasicFormComponent(formManagerService, _eventManager, fileMgmtServices) {
3190
3174
  this.formManagerService = formManagerService;
@@ -3194,9 +3178,9 @@
3194
3178
  this.errorMessage = '';
3195
3179
  this.errorDetail = '';
3196
3180
  this.formStructure = null;
3197
- this.transitionToken = null;
3198
- this.inputDataFields = [];
3199
- this.extraData = null;
3181
+ this.controlToken = null;
3182
+ this.inputDataFields = {};
3183
+ this.extraData = {};
3200
3184
  this.definitionObtained = false;
3201
3185
  this.formVisible = false;
3202
3186
  this.inServerProcess = false;
@@ -3227,8 +3211,8 @@
3227
3211
  this.errorMessage = '';
3228
3212
  this.errorDetail = '';
3229
3213
  this.formStructure = null;
3230
- this.transitionToken = null;
3231
- this.inputDataFields = [];
3214
+ this.controlToken = null;
3215
+ this.inputDataFields = {};
3232
3216
  this.definitionObtained = false;
3233
3217
  // Se limpian los manejadores de eventos
3234
3218
  this.formVisible = false;
@@ -3396,36 +3380,65 @@
3396
3380
  BasicFormComponent.prototype.subscribeAppEvent = function (eventName, callback) {
3397
3381
  this._eventEmiter.subscribe(eventName, callback);
3398
3382
  };
3383
+ BasicFormComponent.prototype.openForm = function (name, data, backData, cleanStack) {
3384
+ if (data === void 0) { data = null; }
3385
+ if (backData === void 0) { backData = null; }
3386
+ if (cleanStack === void 0) { cleanStack = false; }
3387
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3388
+ var origin = null;
3389
+ if (!cleanStack) {
3390
+ origin = Object.assign(Object.assign({}, backData), { name: this.name, url: this._formRoute, token: this.controlToken });
3391
+ origin.subject = (_a = origin === null || origin === void 0 ? void 0 : origin.subject) !== null && _a !== void 0 ? _a : this.formSubject;
3392
+ origin.state = (_b = origin === null || origin === void 0 ? void 0 : origin.state) !== null && _b !== void 0 ? _b : this.currentState;
3393
+ origin.fields = (_c = origin === null || origin === void 0 ? void 0 : origin.fields) !== null && _c !== void 0 ? _c : {};
3394
+ origin.extra = (_d = origin === null || origin === void 0 ? void 0 : origin.extra) !== null && _d !== void 0 ? _d : {};
3395
+ }
3396
+ var target = Object.assign(Object.assign({}, data), { name: name });
3397
+ target.subject = (_e = target === null || target === void 0 ? void 0 : target.subject) !== null && _e !== void 0 ? _e : null;
3398
+ target.state = (_f = target === null || target === void 0 ? void 0 : target.state) !== null && _f !== void 0 ? _f : null;
3399
+ target.fields = (_g = target === null || target === void 0 ? void 0 : target.fields) !== null && _g !== void 0 ? _g : {};
3400
+ target.extra = (_h = target === null || target === void 0 ? void 0 : target.extra) !== null && _h !== void 0 ? _h : {};
3401
+ this.formManagerService.openForm(origin, target);
3402
+ };
3403
+ /**
3404
+ * @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
3405
+ */
3399
3406
  BasicFormComponent.prototype.goToPage = function (navigationArray, predefinedFields, options) {
3400
3407
  if (options === void 0) { options = null; }
3401
- var _a, _b;
3408
+ var _a;
3402
3409
  var origin = null;
3403
3410
  var cleanStack = (_a = options === null || options === void 0 ? void 0 : options.cleanStack) !== null && _a !== void 0 ? _a : false;
3404
- var params = [];
3405
- this.currentState && params.push(this.currentState);
3406
- this.formSubject && params.push(this.formSubject);
3407
3411
  if (!cleanStack) {
3408
3412
  origin = {
3409
- code: this.name,
3413
+ name: this.name,
3410
3414
  url: this._formRoute,
3411
- params: params,
3412
- token: this.transitionToken,
3413
- predefinedFields: this.inputDataFields
3415
+ token: this.controlToken,
3416
+ fields: this.inputDataFields,
3417
+ extra: this.extraData
3414
3418
  };
3415
3419
  }
3416
3420
  var target = {
3421
+ name: this.formManagerService.getRouteForm(navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0]),
3417
3422
  url: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0],
3418
- params: (_b = navigationArray.splice(1)) !== null && _b !== void 0 ? _b : [],
3419
- predefinedFields: predefinedFields,
3423
+ state: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[1],
3424
+ subject: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[2],
3425
+ fields: predefinedFields,
3426
+ extra: null,
3420
3427
  };
3421
- this.formManagerService.changeForm(origin, target);
3428
+ this.formManagerService.openForm(origin, target);
3422
3429
  };
3430
+ /**
3431
+ * @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
3432
+ */
3423
3433
  BasicFormComponent.prototype.goToNewPage = function (nav, flds) { return this.goToPage(nav, flds, { cleanStack: true }); };
3434
+ /**
3435
+ * @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
3436
+ */
3424
3437
  BasicFormComponent.prototype.goToSubPage = function (nav, flds) { return this.goToPage(nav, flds, { cleanStack: false }); };
3425
- BasicFormComponent.prototype.canGoBack = function () { return this.transitionToken !== null; };
3426
- BasicFormComponent.prototype.goBack = function () { return this.formManagerService.changePreviousForm(this.transitionToken); };
3438
+ BasicFormComponent.prototype.canGoBack = function () { return this.originToken !== null; };
3439
+ BasicFormComponent.prototype.goBack = function () { return this.formManagerService.backTo(); };
3427
3440
  BasicFormComponent.prototype.goBackForm = function () { return this.goBack(); };
3428
- BasicFormComponent.prototype.getOriginDetail = function () { return this.formManagerService.getOriginInfo(this.transitionToken); };
3441
+ BasicFormComponent.prototype.getOriginDetail = function () { return this.formManagerService.getFormInfo(this.originToken); };
3429
3442
  BasicFormComponent.prototype.setError = function (errorType, errorMessage, errorDetail) {
3430
3443
  this._errorType = errorType || '';
3431
3444
  this.errorMessage = errorMessage || '';
@@ -3457,44 +3470,23 @@
3457
3470
  configurable: true
3458
3471
  });
3459
3472
  BasicFormComponent.prototype.getFormParameter = function (name) {
3460
- return (this.extraData && name && this.extraData[name]) ? this.extraData[name] : null;
3473
+ var _a, _b;
3474
+ return (name) ? ((_b = (_a = this.extraData) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null) : null;
3461
3475
  };
3462
3476
  BasicFormComponent.prototype.getSubject = function () { return this.formSubject; };
3463
3477
  BasicFormComponent.prototype.getformSubject = function () { return this.getSubject(); };
3464
3478
  BasicFormComponent.prototype.preocessInputParams = function (params) {
3465
- var e_1, _g;
3466
- var _a, _b, _c, _d, _e, _f;
3467
- var allParams = Object.keys(params !== null && params !== void 0 ? params : {});
3468
- if (!allParams || !Array.isArray(allParams) || allParams.length === 0) {
3469
- return;
3470
- }
3471
- this.extraData = [];
3472
- try {
3473
- for (var allParams_1 = __values(allParams), allParams_1_1 = allParams_1.next(); !allParams_1_1.done; allParams_1_1 = allParams_1.next()) {
3474
- var paramName = allParams_1_1.value;
3475
- this.extraData[paramName] = params[paramName].toString();
3476
- }
3477
- }
3478
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
3479
- finally {
3480
- try {
3481
- if (allParams_1_1 && !allParams_1_1.done && (_g = allParams_1.return)) _g.call(allParams_1);
3482
- }
3483
- finally { if (e_1) throw e_1.error; }
3484
- }
3485
- var formName = (_b = (_a = this.extraData) === null || _a === void 0 ? void 0 : _a[FORM_CODE]) !== null && _b !== void 0 ? _b : this.name;
3486
- if (formName !== this.name) {
3487
- this.cleanStart();
3488
- this.name = formName;
3489
- }
3490
- this.formSubject = (_d = (_c = this.extraData) === null || _c === void 0 ? void 0 : _c[FORM_SUBJECT]) !== null && _d !== void 0 ? _d : null;
3491
- var initialState = this.extraData[STATE_PARAM];
3492
- this.transitionToken = (_e = this.extraData[ORIGIN_PARAM]) !== null && _e !== void 0 ? _e : null;
3493
- this.inputDataFields = (_f = this.formManagerService.getInputData(this.transitionToken)) !== null && _f !== void 0 ? _f : [];
3494
- if (!this.transitionToken) {
3495
- this.formManagerService.cleanStack();
3479
+ var _a, _b, _c;
3480
+ this.controlToken = (_a = params === null || params === void 0 ? void 0 : params[TOKEN]) !== null && _a !== void 0 ? _a : null;
3481
+ var _j = this.formManagerService.getFormInfo(this.controlToken), token = _j.token, subject = _j.subject, state = _j.state, fields = _j.fields, extra = _j.extra, originToken = _j.originToken;
3482
+ if (!this.controlToken || this.controlToken !== token) {
3483
+ console.log("No se obtuvo un token v\u00E1lido para abrir el formulario " + this.controlToken + "->" + token);
3496
3484
  }
3497
- return initialState;
3485
+ this.formSubject = (_c = (_b = params === null || params === void 0 ? void 0 : params[SUBJECT]) !== null && _b !== void 0 ? _b : subject) !== null && _c !== void 0 ? _c : null;
3486
+ this.inputDataFields = fields;
3487
+ this.extraData = extra;
3488
+ this.originToken = originToken;
3489
+ return state;
3498
3490
  };
3499
3491
  BasicFormComponent.prototype.subscribeSectionActivation = function () {
3500
3492
  var _this = this;
@@ -3546,12 +3538,10 @@
3546
3538
  }
3547
3539
  };
3548
3540
  BasicFormComponent.prototype.formInit = function (params) {
3549
- var _a;
3550
3541
  return __awaiter(this, void 0, void 0, function () {
3551
- var initialState, formDefinition, _g, _h, inputFieldData, fieldCode, fieldValue, fieldCodes, index, fieldCode, fieldValue, recordResponse;
3552
- var e_2, _j;
3553
- return __generator(this, function (_k) {
3554
- switch (_k.label) {
3542
+ var initialState, formDefinition, inputFieldNames, index, fieldCode, fieldValue, recordResponse;
3543
+ return __generator(this, function (_j) {
3544
+ switch (_j.label) {
3555
3545
  case 0:
3556
3546
  initialState = this.preocessInputParams(params);
3557
3547
  if (!this.name) {
@@ -3561,48 +3551,28 @@
3561
3551
  this.inServerProcess = true;
3562
3552
  return [4 /*yield*/, this.formManagerService.getFormDefinition(this.name)];
3563
3553
  case 1:
3564
- formDefinition = _k.sent();
3554
+ formDefinition = _j.sent();
3565
3555
  this.inServerProcess = false;
3566
3556
  this.formStructure = new FormStructureAndData(formDefinition, this.formConfig);
3567
3557
  this.definitionObtained = true;
3568
3558
  return [3 /*break*/, 3];
3569
3559
  case 2:
3570
3560
  this.cleanData();
3571
- _k.label = 3;
3561
+ _j.label = 3;
3572
3562
  case 3:
3573
3563
  if (!this.supportState(initialState)) {
3574
3564
  initialState = this.formStructure.defaultState;
3575
3565
  }
3576
3566
  this.formStructure.changeState(initialState || this.formStructure.defaultState);
3577
- if (Array.isArray(this.inputDataFields)) {
3578
- try {
3579
- for (_g = __values(this.inputDataFields), _h = _g.next(); !_h.done; _h = _g.next()) {
3580
- inputFieldData = _h.value;
3581
- fieldCode = inputFieldData.fieldCode, fieldValue = inputFieldData.fieldValue;
3582
- if (fieldCode) {
3583
- this.setFieldValue(fieldCode, fieldValue);
3584
- }
3585
- }
3586
- }
3587
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
3588
- finally {
3589
- try {
3590
- if (_h && !_h.done && (_j = _g.return)) _j.call(_g);
3591
- }
3592
- finally { if (e_2) throw e_2.error; }
3593
- }
3594
- }
3595
- else {
3596
- fieldCodes = Object.keys((_a = this.inputDataFields) !== null && _a !== void 0 ? _a : {});
3597
- for (index = 0; index < fieldCodes.length; index++) {
3598
- fieldCode = fieldCodes[index];
3599
- fieldValue = this.inputDataFields[fieldCode];
3600
- this.setFieldValue(fieldCode, fieldValue);
3601
- }
3567
+ inputFieldNames = Object.keys(this.inputDataFields);
3568
+ for (index = 0; index < inputFieldNames.length; index++) {
3569
+ fieldCode = inputFieldNames[index];
3570
+ fieldValue = this.inputDataFields[fieldCode];
3571
+ this.setFieldValue(fieldCode, fieldValue);
3602
3572
  }
3603
3573
  return [4 /*yield*/, this.requestFormAction(formActions.getData)];
3604
3574
  case 4:
3605
- recordResponse = _k.sent();
3575
+ recordResponse = _j.sent();
3606
3576
  this.checkErrorRecordReceived(recordResponse);
3607
3577
  this.formVisible = true;
3608
3578
  this.subscribeSectionActivation();
@@ -3625,7 +3595,7 @@
3625
3595
  this.errorDetail = recordResponse.errorDetail;
3626
3596
  };
3627
3597
  BasicFormComponent.prototype.errorOccured = function () {
3628
- return (this.errorCode !== '00');
3598
+ return (this.errorCode !== NO_ERROR);
3629
3599
  };
3630
3600
  BasicFormComponent.prototype.changeState = function (state) { return this.formStructure.changeState(state); };
3631
3601
  BasicFormComponent.prototype.changeFormMode = function (state) { return this.changeState(state); };
@@ -3633,8 +3603,8 @@
3633
3603
  if (actionSubject === void 0) { actionSubject = {}; }
3634
3604
  return __awaiter(this, void 0, void 0, function () {
3635
3605
  var actionDetail, formActionResponse, error, formResponseData;
3636
- return __generator(this, function (_g) {
3637
- switch (_g.label) {
3606
+ return __generator(this, function (_j) {
3607
+ switch (_j.label) {
3638
3608
  case 0:
3639
3609
  actionDetail = {
3640
3610
  formCode: this.name,
@@ -3646,13 +3616,13 @@
3646
3616
  formData: this.formStructure.getPayload(),
3647
3617
  immutableData: this.formStructure.immutableData,
3648
3618
  };
3649
- this.errorCode = '00';
3619
+ this.errorCode = NO_ERROR;
3650
3620
  this.errorMessage = '';
3651
3621
  this.errorDetail = '';
3652
3622
  this.inServerProcess = true;
3653
3623
  return [4 /*yield*/, this.formManagerService.execServerAction(actionDetail)];
3654
3624
  case 1:
3655
- formActionResponse = _g.sent();
3625
+ formActionResponse = _j.sent();
3656
3626
  this.inServerProcess = false;
3657
3627
  if (formActionResponse && formActionResponse.error.errorType) {
3658
3628
  console.log('Excepción no soportada');
@@ -3671,7 +3641,7 @@
3671
3641
  });
3672
3642
  };
3673
3643
  BasicFormComponent.prototype.updateFormWithServerData = function (formContent) {
3674
- var e_3, _g, e_4, _h, e_5, _j;
3644
+ var e_1, _j, e_2, _k, e_3, _l;
3675
3645
  var currentMode = formContent.currentMode, formSubject = formContent.formSubject, actions = formContent.actions, fields = formContent.fields, recordTables = formContent.recordTables, returnedFile = formContent.returnedFile, immutableData = formContent.immutableData, extraInfo = formContent.extraInfo;
3676
3646
  this.changeState(currentMode !== null && currentMode !== void 0 ? currentMode : this.formStructure.state);
3677
3647
  if (formSubject) {
@@ -3687,12 +3657,12 @@
3687
3657
  }
3688
3658
  }
3689
3659
  }
3690
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
3660
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3691
3661
  finally {
3692
3662
  try {
3693
- if (actions_1_1 && !actions_1_1.done && (_g = actions_1.return)) _g.call(actions_1);
3663
+ if (actions_1_1 && !actions_1_1.done && (_j = actions_1.return)) _j.call(actions_1);
3694
3664
  }
3695
- finally { if (e_3) throw e_3.error; }
3665
+ finally { if (e_1) throw e_1.error; }
3696
3666
  }
3697
3667
  }
3698
3668
  if (fields && fields.length > 0) {
@@ -3705,12 +3675,12 @@
3705
3675
  }
3706
3676
  }
3707
3677
  }
3708
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
3678
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
3709
3679
  finally {
3710
3680
  try {
3711
- if (fields_1_1 && !fields_1_1.done && (_h = fields_1.return)) _h.call(fields_1);
3681
+ if (fields_1_1 && !fields_1_1.done && (_k = fields_1.return)) _k.call(fields_1);
3712
3682
  }
3713
- finally { if (e_4) throw e_4.error; }
3683
+ finally { if (e_2) throw e_2.error; }
3714
3684
  }
3715
3685
  }
3716
3686
  if (recordTables && recordTables.length > 0) {
@@ -3723,12 +3693,12 @@
3723
3693
  }
3724
3694
  }
3725
3695
  }
3726
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
3696
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
3727
3697
  finally {
3728
3698
  try {
3729
- if (recordTables_1_1 && !recordTables_1_1.done && (_j = recordTables_1.return)) _j.call(recordTables_1);
3699
+ if (recordTables_1_1 && !recordTables_1_1.done && (_l = recordTables_1.return)) _l.call(recordTables_1);
3730
3700
  }
3731
- finally { if (e_5) throw e_5.error; }
3701
+ finally { if (e_3) throw e_3.error; }
3732
3702
  }
3733
3703
  }
3734
3704
  if (returnedFile && returnedFile.file) {
@@ -3783,8 +3753,8 @@
3783
3753
  BasicFormComponent.prototype.launchSectionActivation = function (sectionCode) {
3784
3754
  return __awaiter(this, void 0, void 0, function () {
3785
3755
  var sectionObject, clientSectionMethods, clientSectionMethods_1, clientSectionMethods_1_1, clientSectionMethod;
3786
- var e_6, _g;
3787
- return __generator(this, function (_h) {
3756
+ var e_4, _j;
3757
+ return __generator(this, function (_k) {
3788
3758
  sectionObject = this.formStructure.getSectionObject(sectionCode);
3789
3759
  if (!sectionObject) {
3790
3760
  return [2 /*return*/];
@@ -3797,12 +3767,12 @@
3797
3767
  clientSectionMethod(sectionObject);
3798
3768
  }
3799
3769
  }
3800
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
3770
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
3801
3771
  finally {
3802
3772
  try {
3803
- if (clientSectionMethods_1_1 && !clientSectionMethods_1_1.done && (_g = clientSectionMethods_1.return)) _g.call(clientSectionMethods_1);
3773
+ if (clientSectionMethods_1_1 && !clientSectionMethods_1_1.done && (_j = clientSectionMethods_1.return)) _j.call(clientSectionMethods_1);
3804
3774
  }
3805
- finally { if (e_6) throw e_6.error; }
3775
+ finally { if (e_4) throw e_4.error; }
3806
3776
  }
3807
3777
  }
3808
3778
  return [2 /*return*/];
@@ -3812,8 +3782,8 @@
3812
3782
  BasicFormComponent.prototype.launchSectionInactivation = function (sectionCode) {
3813
3783
  return __awaiter(this, void 0, void 0, function () {
3814
3784
  var sectionObject, clientSectionMethods, clientSectionMethods_2, clientSectionMethods_2_1, clientSectionMethod;
3815
- var e_7, _g;
3816
- return __generator(this, function (_h) {
3785
+ var e_5, _j;
3786
+ return __generator(this, function (_k) {
3817
3787
  sectionObject = this.formStructure.getSectionObject(sectionCode);
3818
3788
  if (!sectionObject) {
3819
3789
  return [2 /*return*/];
@@ -3826,12 +3796,12 @@
3826
3796
  clientSectionMethod(sectionObject);
3827
3797
  }
3828
3798
  }
3829
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
3799
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
3830
3800
  finally {
3831
3801
  try {
3832
- if (clientSectionMethods_2_1 && !clientSectionMethods_2_1.done && (_g = clientSectionMethods_2.return)) _g.call(clientSectionMethods_2);
3802
+ if (clientSectionMethods_2_1 && !clientSectionMethods_2_1.done && (_j = clientSectionMethods_2.return)) _j.call(clientSectionMethods_2);
3833
3803
  }
3834
- finally { if (e_7) throw e_7.error; }
3804
+ finally { if (e_5) throw e_5.error; }
3835
3805
  }
3836
3806
  }
3837
3807
  return [2 /*return*/];
@@ -3841,9 +3811,9 @@
3841
3811
  BasicFormComponent.prototype.startAction = function (actionCode) {
3842
3812
  return __awaiter(this, void 0, void 0, function () {
3843
3813
  var actionObject, clientActionMethods, clientActionPromises, clientActionMethods_1, clientActionMethods_1_1, clientActionMethod, continueActionPromise, clientActionResults, continueAction;
3844
- var e_8, _g;
3845
- return __generator(this, function (_h) {
3846
- switch (_h.label) {
3814
+ var e_6, _j;
3815
+ return __generator(this, function (_k) {
3816
+ switch (_k.label) {
3847
3817
  case 0:
3848
3818
  actionObject = this.getAction(actionCode);
3849
3819
  if (!actionObject) {
@@ -3861,22 +3831,22 @@
3861
3831
  clientActionPromises.push(continueActionPromise);
3862
3832
  }
3863
3833
  }
3864
- catch (e_8_1) { e_8 = { error: e_8_1 }; }
3834
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
3865
3835
  finally {
3866
3836
  try {
3867
- if (clientActionMethods_1_1 && !clientActionMethods_1_1.done && (_g = clientActionMethods_1.return)) _g.call(clientActionMethods_1);
3837
+ if (clientActionMethods_1_1 && !clientActionMethods_1_1.done && (_j = clientActionMethods_1.return)) _j.call(clientActionMethods_1);
3868
3838
  }
3869
- finally { if (e_8) throw e_8.error; }
3839
+ finally { if (e_6) throw e_6.error; }
3870
3840
  }
3871
3841
  return [4 /*yield*/, Promise.all(clientActionPromises)];
3872
3842
  case 1:
3873
- clientActionResults = _h.sent();
3843
+ clientActionResults = _k.sent();
3874
3844
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
3875
3845
  if (!continueAction) {
3876
3846
  actionObject.stop();
3877
3847
  return [2 /*return*/];
3878
3848
  }
3879
- _h.label = 2;
3849
+ _k.label = 2;
3880
3850
  case 2:
3881
3851
  this.startServerAction(actionObject);
3882
3852
  return [2 /*return*/];
@@ -3887,8 +3857,8 @@
3887
3857
  BasicFormComponent.prototype.startServerAction = function (actionInput) {
3888
3858
  return __awaiter(this, void 0, void 0, function () {
3889
3859
  var action, finish, actionResult;
3890
- return __generator(this, function (_g) {
3891
- switch (_g.label) {
3860
+ return __generator(this, function (_j) {
3861
+ switch (_j.label) {
3892
3862
  case 0:
3893
3863
  action = (typeof actionInput === 'string')
3894
3864
  ? this.getAction(actionInput) : actionInput;
@@ -3897,19 +3867,19 @@
3897
3867
  if (!action.backend) return [3 /*break*/, 2];
3898
3868
  return [4 /*yield*/, this.requestFormAction(action.actionCode)];
3899
3869
  case 1:
3900
- actionResult = _g.sent();
3870
+ actionResult = _j.sent();
3901
3871
  finish = !this.errorOccured();
3902
- _g.label = 2;
3872
+ _j.label = 2;
3903
3873
  case 2:
3904
3874
  if (!finish) return [3 /*break*/, 4];
3905
3875
  return [4 /*yield*/, this.finishAction(action, actionResult)];
3906
3876
  case 3:
3907
- _g.sent();
3877
+ _j.sent();
3908
3878
  this.changeState(action.newState);
3909
3879
  return [3 /*break*/, 5];
3910
3880
  case 4:
3911
3881
  this.displayActionServerError();
3912
- _g.label = 5;
3882
+ _j.label = 5;
3913
3883
  case 5:
3914
3884
  action.stop();
3915
3885
  return [2 /*return*/];
@@ -3920,9 +3890,9 @@
3920
3890
  BasicFormComponent.prototype.finishAction = function (actionObject, actionResult) {
3921
3891
  return __awaiter(this, void 0, void 0, function () {
3922
3892
  var finishActionMethods, clientActionPromises, finishActionMethods_1, finishActionMethods_1_1, clientActionMethod;
3923
- var e_9, _g;
3924
- return __generator(this, function (_h) {
3925
- switch (_h.label) {
3893
+ var e_7, _j;
3894
+ return __generator(this, function (_k) {
3895
+ switch (_k.label) {
3926
3896
  case 0:
3927
3897
  finishActionMethods = this.formActionsFinish[actionObject.actionCode];
3928
3898
  if (!finishActionMethods) return [3 /*break*/, 2];
@@ -3933,17 +3903,17 @@
3933
3903
  clientActionPromises.push(clientActionMethod(actionObject, actionResult));
3934
3904
  }
3935
3905
  }
3936
- catch (e_9_1) { e_9 = { error: e_9_1 }; }
3906
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
3937
3907
  finally {
3938
3908
  try {
3939
- if (finishActionMethods_1_1 && !finishActionMethods_1_1.done && (_g = finishActionMethods_1.return)) _g.call(finishActionMethods_1);
3909
+ if (finishActionMethods_1_1 && !finishActionMethods_1_1.done && (_j = finishActionMethods_1.return)) _j.call(finishActionMethods_1);
3940
3910
  }
3941
- finally { if (e_9) throw e_9.error; }
3911
+ finally { if (e_7) throw e_7.error; }
3942
3912
  }
3943
3913
  return [4 /*yield*/, Promise.all(clientActionPromises)];
3944
3914
  case 1:
3945
- _h.sent();
3946
- _h.label = 2;
3915
+ _k.sent();
3916
+ _k.label = 2;
3947
3917
  case 2: return [2 /*return*/];
3948
3918
  }
3949
3919
  });
@@ -3989,16 +3959,15 @@
3989
3959
  if (intrinsicValidation === void 0) { intrinsicValidation = true; }
3990
3960
  return __awaiter(this, void 0, void 0, function () {
3991
3961
  var fieldToValidate, validationCallbacks, clientValidationPromises, validationCallbacks_1, validationCallbacks_1_1, validationMethod, continueValidationPromise;
3992
- var e_10, _g;
3993
- return __generator(this, function (_h) {
3994
- switch (_h.label) {
3962
+ var e_8, _j;
3963
+ return __generator(this, function (_k) {
3964
+ switch (_k.label) {
3995
3965
  case 0:
3996
3966
  fieldToValidate = this.getFieldObject(fieldCode);
3997
3967
  if (!fieldToValidate) {
3998
3968
  return [2 /*return*/, false];
3999
3969
  }
4000
- fieldToValidate.setErrorMessage('');
4001
- fieldToValidate.setErrorCode('00');
3970
+ fieldToValidate.resetError();
4002
3971
  validationCallbacks = this.fieldInputValidation[fieldCode];
4003
3972
  if (!validationCallbacks) return [3 /*break*/, 2];
4004
3973
  clientValidationPromises = [];
@@ -4009,17 +3978,17 @@
4009
3978
  clientValidationPromises.push(continueValidationPromise);
4010
3979
  }
4011
3980
  }
4012
- catch (e_10_1) { e_10 = { error: e_10_1 }; }
3981
+ catch (e_8_1) { e_8 = { error: e_8_1 }; }
4013
3982
  finally {
4014
3983
  try {
4015
- if (validationCallbacks_1_1 && !validationCallbacks_1_1.done && (_g = validationCallbacks_1.return)) _g.call(validationCallbacks_1);
3984
+ if (validationCallbacks_1_1 && !validationCallbacks_1_1.done && (_j = validationCallbacks_1.return)) _j.call(validationCallbacks_1);
4016
3985
  }
4017
- finally { if (e_10) throw e_10.error; }
3986
+ finally { if (e_8) throw e_8.error; }
4018
3987
  }
4019
3988
  return [4 /*yield*/, Promise.all(clientValidationPromises)];
4020
3989
  case 1:
4021
- _h.sent();
4022
- _h.label = 2;
3990
+ _k.sent();
3991
+ _k.label = 2;
4023
3992
  case 2: return [2 /*return*/];
4024
3993
  }
4025
3994
  });
@@ -4029,16 +3998,15 @@
4029
3998
  if (intrinsicValidation === void 0) { intrinsicValidation = true; }
4030
3999
  return __awaiter(this, void 0, void 0, function () {
4031
4000
  var fieldToValidate, validationCallbacks, clientValidationPromises, validationCallbacks_2, validationCallbacks_2_1, validationMethod, clientValidationPromise, clientValidationResults, continueValidation;
4032
- var e_11, _g;
4033
- return __generator(this, function (_h) {
4034
- switch (_h.label) {
4001
+ var e_9, _j;
4002
+ return __generator(this, function (_k) {
4003
+ switch (_k.label) {
4035
4004
  case 0:
4036
4005
  fieldToValidate = this.getField(fieldCode);
4037
4006
  if (!fieldToValidate || !intrinsicValidation) {
4038
4007
  return [2 /*return*/];
4039
4008
  }
4040
- fieldToValidate.setErrorMessage('');
4041
- fieldToValidate.setErrorCode('00');
4009
+ fieldToValidate.resetError();
4042
4010
  validationCallbacks = this.fieldValidationsStart[fieldCode];
4043
4011
  if (!validationCallbacks) return [3 /*break*/, 2];
4044
4012
  clientValidationPromises = [];
@@ -4049,21 +4017,21 @@
4049
4017
  clientValidationPromises.push(clientValidationPromise);
4050
4018
  }
4051
4019
  }
4052
- catch (e_11_1) { e_11 = { error: e_11_1 }; }
4020
+ catch (e_9_1) { e_9 = { error: e_9_1 }; }
4053
4021
  finally {
4054
4022
  try {
4055
- if (validationCallbacks_2_1 && !validationCallbacks_2_1.done && (_g = validationCallbacks_2.return)) _g.call(validationCallbacks_2);
4023
+ if (validationCallbacks_2_1 && !validationCallbacks_2_1.done && (_j = validationCallbacks_2.return)) _j.call(validationCallbacks_2);
4056
4024
  }
4057
- finally { if (e_11) throw e_11.error; }
4025
+ finally { if (e_9) throw e_9.error; }
4058
4026
  }
4059
4027
  return [4 /*yield*/, Promise.all(clientValidationPromises)];
4060
4028
  case 1:
4061
- clientValidationResults = _h.sent();
4029
+ clientValidationResults = _k.sent();
4062
4030
  continueValidation = clientValidationResults.reduce(function (total, curr) { return (total && curr); }, true);
4063
4031
  if (!continueValidation) {
4064
4032
  return [2 /*return*/];
4065
4033
  }
4066
- _h.label = 2;
4034
+ _k.label = 2;
4067
4035
  case 2:
4068
4036
  this.startServerFieldValidation(fieldToValidate);
4069
4037
  return [2 /*return*/];
@@ -4074,8 +4042,8 @@
4074
4042
  BasicFormComponent.prototype.startServerFieldValidation = function (inputField) {
4075
4043
  return __awaiter(this, void 0, void 0, function () {
4076
4044
  var fieldObj, finish, validationResult;
4077
- return __generator(this, function (_g) {
4078
- switch (_g.label) {
4045
+ return __generator(this, function (_j) {
4046
+ switch (_j.label) {
4079
4047
  case 0:
4080
4048
  fieldObj = (typeof inputField === 'string')
4081
4049
  ? this.getField(inputField) : inputField;
@@ -4086,20 +4054,20 @@
4086
4054
  return [4 /*yield*/, this
4087
4055
  .requestFormAction(formActions.validate, fieldObj.fieldCode)];
4088
4056
  case 1:
4089
- validationResult = _g.sent();
4057
+ validationResult = _j.sent();
4090
4058
  finish = !this.errorOccured();
4091
- _g.label = 2;
4059
+ _j.label = 2;
4092
4060
  case 2:
4093
4061
  if (!finish) return [3 /*break*/, 4];
4094
4062
  return [4 /*yield*/, this.finishFieldValidation(fieldObj, validationResult)];
4095
4063
  case 3:
4096
- _g.sent();
4064
+ _j.sent();
4097
4065
  return [3 /*break*/, 5];
4098
4066
  case 4:
4099
4067
  fieldObj.setErrorCode(this.errorCode);
4100
4068
  fieldObj.setErrorMessage(this.errorMessage);
4101
4069
  this.displayValidationServerError();
4102
- _g.label = 5;
4070
+ _j.label = 5;
4103
4071
  case 5:
4104
4072
  fieldObj.validating = false;
4105
4073
  return [2 /*return*/];
@@ -4110,9 +4078,9 @@
4110
4078
  BasicFormComponent.prototype.finishFieldValidation = function (fieldObject, validationResult) {
4111
4079
  return __awaiter(this, void 0, void 0, function () {
4112
4080
  var validationCallbacks, clientActionPromises, validationCallbacks_3, validationCallbacks_3_1, validationMethod;
4113
- var e_12, _g;
4114
- return __generator(this, function (_h) {
4115
- switch (_h.label) {
4081
+ var e_10, _j;
4082
+ return __generator(this, function (_k) {
4083
+ switch (_k.label) {
4116
4084
  case 0:
4117
4085
  validationCallbacks = this.fieldValidationsFinish[fieldObject.fieldCode];
4118
4086
  if (!validationCallbacks) return [3 /*break*/, 2];
@@ -4123,17 +4091,17 @@
4123
4091
  clientActionPromises.push(validationMethod(fieldObject, validationResult));
4124
4092
  }
4125
4093
  }
4126
- catch (e_12_1) { e_12 = { error: e_12_1 }; }
4094
+ catch (e_10_1) { e_10 = { error: e_10_1 }; }
4127
4095
  finally {
4128
4096
  try {
4129
- if (validationCallbacks_3_1 && !validationCallbacks_3_1.done && (_g = validationCallbacks_3.return)) _g.call(validationCallbacks_3);
4097
+ if (validationCallbacks_3_1 && !validationCallbacks_3_1.done && (_j = validationCallbacks_3.return)) _j.call(validationCallbacks_3);
4130
4098
  }
4131
- finally { if (e_12) throw e_12.error; }
4099
+ finally { if (e_10) throw e_10.error; }
4132
4100
  }
4133
4101
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4134
4102
  case 1:
4135
- _h.sent();
4136
- _h.label = 2;
4103
+ _k.sent();
4104
+ _k.label = 2;
4137
4105
  case 2: return [2 /*return*/];
4138
4106
  }
4139
4107
  });
@@ -4141,7 +4109,7 @@
4141
4109
  };
4142
4110
  BasicFormComponent.prototype.continueFieldValidation = function (fieldCode) {
4143
4111
  return __awaiter(this, void 0, void 0, function () {
4144
- return __generator(this, function (_g) {
4112
+ return __generator(this, function (_j) {
4145
4113
  return [2 /*return*/, this.startServerFieldValidation(fieldCode)];
4146
4114
  });
4147
4115
  });
@@ -4256,9 +4224,9 @@
4256
4224
  BasicFormComponent.prototype.startTableGlobalAction = function (tableActionEvent) {
4257
4225
  return __awaiter(this, void 0, void 0, function () {
4258
4226
  var tableCode, actionCode, tableObject, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_1, tableActionMethods_1_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
4259
- var e_13, _g;
4260
- return __generator(this, function (_h) {
4261
- switch (_h.label) {
4227
+ var e_11, _j;
4228
+ return __generator(this, function (_k) {
4229
+ switch (_k.label) {
4262
4230
  case 0:
4263
4231
  tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode;
4264
4232
  tableObject = this.getTable(tableCode);
@@ -4287,21 +4255,21 @@
4287
4255
  clientActionPromises.push(clientActionPromise);
4288
4256
  }
4289
4257
  }
4290
- catch (e_13_1) { e_13 = { error: e_13_1 }; }
4258
+ catch (e_11_1) { e_11 = { error: e_11_1 }; }
4291
4259
  finally {
4292
4260
  try {
4293
- if (tableActionMethods_1_1 && !tableActionMethods_1_1.done && (_g = tableActionMethods_1.return)) _g.call(tableActionMethods_1);
4261
+ if (tableActionMethods_1_1 && !tableActionMethods_1_1.done && (_j = tableActionMethods_1.return)) _j.call(tableActionMethods_1);
4294
4262
  }
4295
- finally { if (e_13) throw e_13.error; }
4263
+ finally { if (e_11) throw e_11.error; }
4296
4264
  }
4297
4265
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4298
4266
  case 1:
4299
- clientActionResults = _h.sent();
4267
+ clientActionResults = _k.sent();
4300
4268
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4301
4269
  if (!continueAction) {
4302
4270
  return [2 /*return*/];
4303
4271
  }
4304
- _h.label = 2;
4272
+ _k.label = 2;
4305
4273
  case 2:
4306
4274
  this.startTableServerGlobalAction(tableActionDetail);
4307
4275
  return [2 /*return*/];
@@ -4312,8 +4280,8 @@
4312
4280
  BasicFormComponent.prototype.startTableServerGlobalAction = function (tableActionDetail) {
4313
4281
  return __awaiter(this, void 0, void 0, function () {
4314
4282
  var tableObject, action, tableCode, actionCode, finish, actionResult, actionSubject;
4315
- return __generator(this, function (_g) {
4316
- switch (_g.label) {
4283
+ return __generator(this, function (_j) {
4284
+ switch (_j.label) {
4317
4285
  case 0:
4318
4286
  tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
4319
4287
  if (!tableObject || !action) {
@@ -4331,19 +4299,19 @@
4331
4299
  return [4 /*yield*/, this
4332
4300
  .requestFormAction(formActions.tableAction, actionSubject)];
4333
4301
  case 1:
4334
- actionResult = _g.sent();
4302
+ actionResult = _j.sent();
4335
4303
  finish = !this.errorOccured();
4336
- _g.label = 2;
4304
+ _j.label = 2;
4337
4305
  case 2:
4338
4306
  if (!finish) return [3 /*break*/, 4];
4339
4307
  return [4 /*yield*/, this.finishTableGlobalAction(tableActionDetail, actionResult)];
4340
4308
  case 3:
4341
- _g.sent();
4309
+ _j.sent();
4342
4310
  this.changeState(action.newState);
4343
4311
  return [3 /*break*/, 5];
4344
4312
  case 4:
4345
4313
  this.displayTableServerError();
4346
- _g.label = 5;
4314
+ _j.label = 5;
4347
4315
  case 5:
4348
4316
  tableObject.freeWaiting();
4349
4317
  return [2 /*return*/];
@@ -4354,9 +4322,9 @@
4354
4322
  BasicFormComponent.prototype.finishTableGlobalAction = function (tableActionDetail, actionResult) {
4355
4323
  return __awaiter(this, void 0, void 0, function () {
4356
4324
  var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_2, tableActionMethods_2_1, tableActionMethod;
4357
- var e_14, _g;
4358
- return __generator(this, function (_h) {
4359
- switch (_h.label) {
4325
+ var e_12, _j;
4326
+ return __generator(this, function (_k) {
4327
+ switch (_k.label) {
4360
4328
  case 0:
4361
4329
  tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
4362
4330
  tableEventHandlers = this.tableActionsFinish[tableCode];
@@ -4369,17 +4337,17 @@
4369
4337
  clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
4370
4338
  }
4371
4339
  }
4372
- catch (e_14_1) { e_14 = { error: e_14_1 }; }
4340
+ catch (e_12_1) { e_12 = { error: e_12_1 }; }
4373
4341
  finally {
4374
4342
  try {
4375
- if (tableActionMethods_2_1 && !tableActionMethods_2_1.done && (_g = tableActionMethods_2.return)) _g.call(tableActionMethods_2);
4343
+ if (tableActionMethods_2_1 && !tableActionMethods_2_1.done && (_j = tableActionMethods_2.return)) _j.call(tableActionMethods_2);
4376
4344
  }
4377
- finally { if (e_14) throw e_14.error; }
4345
+ finally { if (e_12) throw e_12.error; }
4378
4346
  }
4379
4347
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4380
4348
  case 1:
4381
- _h.sent();
4382
- _h.label = 2;
4349
+ _k.sent();
4350
+ _k.label = 2;
4383
4351
  case 2: return [2 /*return*/];
4384
4352
  }
4385
4353
  });
@@ -4388,9 +4356,9 @@
4388
4356
  BasicFormComponent.prototype.startTableAction = function (tableActionEvent) {
4389
4357
  return __awaiter(this, void 0, void 0, function () {
4390
4358
  var tableCode, actionCode, actionDetail, tableObject, recordId, recordData, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_3, tableActionMethods_3_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
4391
- var e_15, _g;
4392
- return __generator(this, function (_h) {
4393
- switch (_h.label) {
4359
+ var e_13, _j;
4360
+ return __generator(this, function (_k) {
4361
+ switch (_k.label) {
4394
4362
  case 0:
4395
4363
  tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode, actionDetail = tableActionEvent.actionDetail;
4396
4364
  tableObject = this.getTable(tableCode);
@@ -4422,21 +4390,21 @@
4422
4390
  clientActionPromises.push(clientActionPromise);
4423
4391
  }
4424
4392
  }
4425
- catch (e_15_1) { e_15 = { error: e_15_1 }; }
4393
+ catch (e_13_1) { e_13 = { error: e_13_1 }; }
4426
4394
  finally {
4427
4395
  try {
4428
- if (tableActionMethods_3_1 && !tableActionMethods_3_1.done && (_g = tableActionMethods_3.return)) _g.call(tableActionMethods_3);
4396
+ if (tableActionMethods_3_1 && !tableActionMethods_3_1.done && (_j = tableActionMethods_3.return)) _j.call(tableActionMethods_3);
4429
4397
  }
4430
- finally { if (e_15) throw e_15.error; }
4398
+ finally { if (e_13) throw e_13.error; }
4431
4399
  }
4432
4400
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4433
4401
  case 1:
4434
- clientActionResults = _h.sent();
4402
+ clientActionResults = _k.sent();
4435
4403
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4436
4404
  if (!continueAction) {
4437
4405
  return [2 /*return*/];
4438
4406
  }
4439
- _h.label = 2;
4407
+ _k.label = 2;
4440
4408
  case 2:
4441
4409
  this.startTableServerAction(tableActionDetail);
4442
4410
  return [2 /*return*/];
@@ -4447,8 +4415,8 @@
4447
4415
  BasicFormComponent.prototype.startTableServerAction = function (tableActionDetail) {
4448
4416
  return __awaiter(this, void 0, void 0, function () {
4449
4417
  var tableObject, action, tableCode, actionCode, recordId, recordData, finish, actionResult, actionSubject;
4450
- return __generator(this, function (_g) {
4451
- switch (_g.label) {
4418
+ return __generator(this, function (_j) {
4419
+ switch (_j.label) {
4452
4420
  case 0:
4453
4421
  tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode, recordId = tableActionDetail.recordId, recordData = tableActionDetail.recordData;
4454
4422
  if (!tableObject || !action) {
@@ -4468,9 +4436,9 @@
4468
4436
  return [4 /*yield*/, this
4469
4437
  .requestFormAction(formActions.tableAction, actionSubject)];
4470
4438
  case 1:
4471
- actionResult = _g.sent();
4439
+ actionResult = _j.sent();
4472
4440
  finish = !this.errorOccured();
4473
- _g.label = 2;
4441
+ _j.label = 2;
4474
4442
  case 2:
4475
4443
  if (finish) {
4476
4444
  this.finishTableAction(tableActionDetail, actionResult);
@@ -4491,9 +4459,9 @@
4491
4459
  BasicFormComponent.prototype.finishTableAction = function (tableActionDetail, actionResult) {
4492
4460
  return __awaiter(this, void 0, void 0, function () {
4493
4461
  var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_4, tableActionMethods_4_1, tableActionMethod;
4494
- var e_16, _g;
4495
- return __generator(this, function (_h) {
4496
- switch (_h.label) {
4462
+ var e_14, _j;
4463
+ return __generator(this, function (_k) {
4464
+ switch (_k.label) {
4497
4465
  case 0:
4498
4466
  tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
4499
4467
  tableEventHandlers = this.tableActionsFinish[tableCode];
@@ -4506,17 +4474,17 @@
4506
4474
  clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
4507
4475
  }
4508
4476
  }
4509
- catch (e_16_1) { e_16 = { error: e_16_1 }; }
4477
+ catch (e_14_1) { e_14 = { error: e_14_1 }; }
4510
4478
  finally {
4511
4479
  try {
4512
- if (tableActionMethods_4_1 && !tableActionMethods_4_1.done && (_g = tableActionMethods_4.return)) _g.call(tableActionMethods_4);
4480
+ if (tableActionMethods_4_1 && !tableActionMethods_4_1.done && (_j = tableActionMethods_4.return)) _j.call(tableActionMethods_4);
4513
4481
  }
4514
- finally { if (e_16) throw e_16.error; }
4482
+ finally { if (e_14) throw e_14.error; }
4515
4483
  }
4516
4484
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4517
4485
  case 1:
4518
- _h.sent();
4519
- _h.label = 2;
4486
+ _k.sent();
4487
+ _k.label = 2;
4520
4488
  case 2: return [2 /*return*/];
4521
4489
  }
4522
4490
  });
@@ -4525,9 +4493,9 @@
4525
4493
  BasicFormComponent.prototype.startTableRecordSelection = function (tableActionEvent) {
4526
4494
  return __awaiter(this, void 0, void 0, function () {
4527
4495
  var tableCode, actionDetail, tableObject, recordId, recordData, tableSelectionDetail, tableEventHandlers, clientActionPromises, tableEventHandlers_1, tableEventHandlers_1_1, tableSelectionMethod, clientActionPromise, clientActionResults, continueAction;
4528
- var e_17, _g;
4529
- return __generator(this, function (_h) {
4530
- switch (_h.label) {
4496
+ var e_15, _j;
4497
+ return __generator(this, function (_k) {
4498
+ switch (_k.label) {
4531
4499
  case 0:
4532
4500
  tableCode = tableActionEvent.tableCode, actionDetail = tableActionEvent.actionDetail;
4533
4501
  tableObject = this.getTable(tableCode);
@@ -4552,21 +4520,21 @@
4552
4520
  clientActionPromises.push(clientActionPromise);
4553
4521
  }
4554
4522
  }
4555
- catch (e_17_1) { e_17 = { error: e_17_1 }; }
4523
+ catch (e_15_1) { e_15 = { error: e_15_1 }; }
4556
4524
  finally {
4557
4525
  try {
4558
- if (tableEventHandlers_1_1 && !tableEventHandlers_1_1.done && (_g = tableEventHandlers_1.return)) _g.call(tableEventHandlers_1);
4526
+ if (tableEventHandlers_1_1 && !tableEventHandlers_1_1.done && (_j = tableEventHandlers_1.return)) _j.call(tableEventHandlers_1);
4559
4527
  }
4560
- finally { if (e_17) throw e_17.error; }
4528
+ finally { if (e_15) throw e_15.error; }
4561
4529
  }
4562
4530
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4563
4531
  case 1:
4564
- clientActionResults = _h.sent();
4532
+ clientActionResults = _k.sent();
4565
4533
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4566
4534
  if (!continueAction) {
4567
4535
  return [2 /*return*/];
4568
4536
  }
4569
- _h.label = 2;
4537
+ _k.label = 2;
4570
4538
  case 2:
4571
4539
  this.startTableServerRecordSelection(tableSelectionDetail);
4572
4540
  return [2 /*return*/];
@@ -4577,8 +4545,8 @@
4577
4545
  BasicFormComponent.prototype.startTableServerRecordSelection = function (tableSelectionDetail) {
4578
4546
  return __awaiter(this, void 0, void 0, function () {
4579
4547
  var tableObject, tableCode, recordId, recordData, finish, actionResult, actionSubject;
4580
- return __generator(this, function (_g) {
4581
- switch (_g.label) {
4548
+ return __generator(this, function (_j) {
4549
+ switch (_j.label) {
4582
4550
  case 0:
4583
4551
  tableObject = tableSelectionDetail.tableObject, tableCode = tableSelectionDetail.tableCode, recordId = tableSelectionDetail.recordId, recordData = tableSelectionDetail.recordData;
4584
4552
  if (!tableObject) {
@@ -4598,9 +4566,9 @@
4598
4566
  return [4 /*yield*/, this
4599
4567
  .requestFormAction(formActions.tableAction, actionSubject)];
4600
4568
  case 1:
4601
- actionResult = _g.sent();
4569
+ actionResult = _j.sent();
4602
4570
  finish = !this.errorOccured();
4603
- _g.label = 2;
4571
+ _j.label = 2;
4604
4572
  case 2:
4605
4573
  if (finish) {
4606
4574
  this.finishTableRecordSelection(tableSelectionDetail, actionResult);
@@ -4617,9 +4585,9 @@
4617
4585
  BasicFormComponent.prototype.finishTableRecordSelection = function (tableSelectionDetail, actionResult) {
4618
4586
  return __awaiter(this, void 0, void 0, function () {
4619
4587
  var tableCode, tableEventHandlers, clientActionPromises, tableEventHandlers_2, tableEventHandlers_2_1, tableSelectionMethod;
4620
- var e_18, _g;
4621
- return __generator(this, function (_h) {
4622
- switch (_h.label) {
4588
+ var e_16, _j;
4589
+ return __generator(this, function (_k) {
4590
+ switch (_k.label) {
4623
4591
  case 0:
4624
4592
  tableCode = tableSelectionDetail.tableCode;
4625
4593
  tableEventHandlers = this.tableSelectionsFinish[tableCode];
@@ -4631,17 +4599,17 @@
4631
4599
  clientActionPromises.push(tableSelectionMethod(tableSelectionDetail, actionResult));
4632
4600
  }
4633
4601
  }
4634
- catch (e_18_1) { e_18 = { error: e_18_1 }; }
4602
+ catch (e_16_1) { e_16 = { error: e_16_1 }; }
4635
4603
  finally {
4636
4604
  try {
4637
- if (tableEventHandlers_2_1 && !tableEventHandlers_2_1.done && (_g = tableEventHandlers_2.return)) _g.call(tableEventHandlers_2);
4605
+ if (tableEventHandlers_2_1 && !tableEventHandlers_2_1.done && (_j = tableEventHandlers_2.return)) _j.call(tableEventHandlers_2);
4638
4606
  }
4639
- finally { if (e_18) throw e_18.error; }
4607
+ finally { if (e_16) throw e_16.error; }
4640
4608
  }
4641
4609
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4642
4610
  case 1:
4643
- _h.sent();
4644
- _h.label = 2;
4611
+ _k.sent();
4612
+ _k.label = 2;
4645
4613
  case 2: return [2 /*return*/];
4646
4614
  }
4647
4615
  });
@@ -4650,9 +4618,9 @@
4650
4618
  BasicFormComponent.prototype.startTableSelectionAction = function (tableActionEvent) {
4651
4619
  return __awaiter(this, void 0, void 0, function () {
4652
4620
  var tableCode, actionCode, actionDetail, tableObject, selectedRecords, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_5, tableActionMethods_5_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
4653
- var e_19, _g;
4654
- return __generator(this, function (_h) {
4655
- switch (_h.label) {
4621
+ var e_17, _j;
4622
+ return __generator(this, function (_k) {
4623
+ switch (_k.label) {
4656
4624
  case 0:
4657
4625
  tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode, actionDetail = tableActionEvent.actionDetail;
4658
4626
  tableObject = this.getTable(tableCode);
@@ -4683,21 +4651,21 @@
4683
4651
  clientActionPromises.push(clientActionPromise);
4684
4652
  }
4685
4653
  }
4686
- catch (e_19_1) { e_19 = { error: e_19_1 }; }
4654
+ catch (e_17_1) { e_17 = { error: e_17_1 }; }
4687
4655
  finally {
4688
4656
  try {
4689
- if (tableActionMethods_5_1 && !tableActionMethods_5_1.done && (_g = tableActionMethods_5.return)) _g.call(tableActionMethods_5);
4657
+ if (tableActionMethods_5_1 && !tableActionMethods_5_1.done && (_j = tableActionMethods_5.return)) _j.call(tableActionMethods_5);
4690
4658
  }
4691
- finally { if (e_19) throw e_19.error; }
4659
+ finally { if (e_17) throw e_17.error; }
4692
4660
  }
4693
4661
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4694
4662
  case 1:
4695
- clientActionResults = _h.sent();
4663
+ clientActionResults = _k.sent();
4696
4664
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4697
4665
  if (!continueAction) {
4698
4666
  return [2 /*return*/];
4699
4667
  }
4700
- _h.label = 2;
4668
+ _k.label = 2;
4701
4669
  case 2:
4702
4670
  this.startTableServerSelectionAction(tableActionDetail);
4703
4671
  return [2 /*return*/];
@@ -4708,8 +4676,8 @@
4708
4676
  BasicFormComponent.prototype.startTableServerSelectionAction = function (tableActionDetail) {
4709
4677
  return __awaiter(this, void 0, void 0, function () {
4710
4678
  var tableObject, action, tableCode, actionCode, selectedRecords, finish, actionResult, actionSubject;
4711
- return __generator(this, function (_g) {
4712
- switch (_g.label) {
4679
+ return __generator(this, function (_j) {
4680
+ switch (_j.label) {
4713
4681
  case 0:
4714
4682
  tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode, selectedRecords = tableActionDetail.selectedRecords;
4715
4683
  if (!tableObject || !action) {
@@ -4728,9 +4696,9 @@
4728
4696
  return [4 /*yield*/, this
4729
4697
  .requestFormAction(formActions.tableAction, actionSubject)];
4730
4698
  case 1:
4731
- actionResult = _g.sent();
4699
+ actionResult = _j.sent();
4732
4700
  finish = !this.errorOccured();
4733
- _g.label = 2;
4701
+ _j.label = 2;
4734
4702
  case 2:
4735
4703
  if (finish) {
4736
4704
  this.finishTableSelectionAction(tableActionDetail, actionResult);
@@ -4748,9 +4716,9 @@
4748
4716
  BasicFormComponent.prototype.finishTableSelectionAction = function (tableActionDetail, actionResult) {
4749
4717
  return __awaiter(this, void 0, void 0, function () {
4750
4718
  var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_6, tableActionMethods_6_1, tableActionMethod;
4751
- var e_20, _g;
4752
- return __generator(this, function (_h) {
4753
- switch (_h.label) {
4719
+ var e_18, _j;
4720
+ return __generator(this, function (_k) {
4721
+ switch (_k.label) {
4754
4722
  case 0:
4755
4723
  tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
4756
4724
  tableEventHandlers = this.tableActionsFinish[tableCode];
@@ -4763,17 +4731,17 @@
4763
4731
  clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
4764
4732
  }
4765
4733
  }
4766
- catch (e_20_1) { e_20 = { error: e_20_1 }; }
4734
+ catch (e_18_1) { e_18 = { error: e_18_1 }; }
4767
4735
  finally {
4768
4736
  try {
4769
- if (tableActionMethods_6_1 && !tableActionMethods_6_1.done && (_g = tableActionMethods_6.return)) _g.call(tableActionMethods_6);
4737
+ if (tableActionMethods_6_1 && !tableActionMethods_6_1.done && (_j = tableActionMethods_6.return)) _j.call(tableActionMethods_6);
4770
4738
  }
4771
- finally { if (e_20) throw e_20.error; }
4739
+ finally { if (e_18) throw e_18.error; }
4772
4740
  }
4773
4741
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4774
4742
  case 1:
4775
- _h.sent();
4776
- _h.label = 2;
4743
+ _k.sent();
4744
+ _k.label = 2;
4777
4745
  case 2: return [2 /*return*/];
4778
4746
  }
4779
4747
  });
@@ -4782,9 +4750,9 @@
4782
4750
  BasicFormComponent.prototype.startTableGetData = function (tableActionEvent) {
4783
4751
  return __awaiter(this, void 0, void 0, function () {
4784
4752
  var tableCode, tableObject, tableActionDetail, tableEventHandlers, clientActionPromises, tableEventHandlers_3, tableEventHandlers_3_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
4785
- var e_21, _g;
4786
- return __generator(this, function (_h) {
4787
- switch (_h.label) {
4753
+ var e_19, _j;
4754
+ return __generator(this, function (_k) {
4755
+ switch (_k.label) {
4788
4756
  case 0:
4789
4757
  tableCode = tableActionEvent.tableCode;
4790
4758
  tableObject = this.getTable(tableCode);
@@ -4803,21 +4771,21 @@
4803
4771
  clientActionPromises.push(clientActionPromise);
4804
4772
  }
4805
4773
  }
4806
- catch (e_21_1) { e_21 = { error: e_21_1 }; }
4774
+ catch (e_19_1) { e_19 = { error: e_19_1 }; }
4807
4775
  finally {
4808
4776
  try {
4809
- if (tableEventHandlers_3_1 && !tableEventHandlers_3_1.done && (_g = tableEventHandlers_3.return)) _g.call(tableEventHandlers_3);
4777
+ if (tableEventHandlers_3_1 && !tableEventHandlers_3_1.done && (_j = tableEventHandlers_3.return)) _j.call(tableEventHandlers_3);
4810
4778
  }
4811
- finally { if (e_21) throw e_21.error; }
4779
+ finally { if (e_19) throw e_19.error; }
4812
4780
  }
4813
4781
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4814
4782
  case 1:
4815
- clientActionResults = _h.sent();
4783
+ clientActionResults = _k.sent();
4816
4784
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4817
4785
  if (!continueAction) {
4818
4786
  return [2 /*return*/];
4819
4787
  }
4820
- _h.label = 2;
4788
+ _k.label = 2;
4821
4789
  case 2:
4822
4790
  this.startTableServerGetData(tableActionDetail);
4823
4791
  return [2 /*return*/];
@@ -4828,8 +4796,8 @@
4828
4796
  BasicFormComponent.prototype.startTableServerGetData = function (tableActionDetail) {
4829
4797
  return __awaiter(this, void 0, void 0, function () {
4830
4798
  var tableObject, tableCode, actionSubject, actionResult;
4831
- return __generator(this, function (_g) {
4832
- switch (_g.label) {
4799
+ return __generator(this, function (_j) {
4800
+ switch (_j.label) {
4833
4801
  case 0:
4834
4802
  tableObject = tableActionDetail.tableObject, tableCode = tableActionDetail.tableCode;
4835
4803
  tableObject.putOnWait();
@@ -4837,7 +4805,7 @@
4837
4805
  return [4 /*yield*/, this
4838
4806
  .requestFormAction(formActions.getTableData, actionSubject)];
4839
4807
  case 1:
4840
- actionResult = _g.sent();
4808
+ actionResult = _j.sent();
4841
4809
  if (this.errorOccured()) {
4842
4810
  this.displayTableServerError();
4843
4811
  }
@@ -4853,9 +4821,9 @@
4853
4821
  BasicFormComponent.prototype.finishTableGetData = function (tableActionDetail, actionResult) {
4854
4822
  return __awaiter(this, void 0, void 0, function () {
4855
4823
  var tableCode, tableActionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_7, tableActionMethods_7_1, tableActionMethod;
4856
- var e_22, _g;
4857
- return __generator(this, function (_h) {
4858
- switch (_h.label) {
4824
+ var e_20, _j;
4825
+ return __generator(this, function (_k) {
4826
+ switch (_k.label) {
4859
4827
  case 0:
4860
4828
  tableCode = tableActionDetail.tableCode, tableActionCode = tableActionDetail.tableActionCode;
4861
4829
  tableEventHandlers = this.tableActionsFinish[tableCode];
@@ -4868,17 +4836,17 @@
4868
4836
  clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
4869
4837
  }
4870
4838
  }
4871
- catch (e_22_1) { e_22 = { error: e_22_1 }; }
4839
+ catch (e_20_1) { e_20 = { error: e_20_1 }; }
4872
4840
  finally {
4873
4841
  try {
4874
- if (tableActionMethods_7_1 && !tableActionMethods_7_1.done && (_g = tableActionMethods_7.return)) _g.call(tableActionMethods_7);
4842
+ if (tableActionMethods_7_1 && !tableActionMethods_7_1.done && (_j = tableActionMethods_7.return)) _j.call(tableActionMethods_7);
4875
4843
  }
4876
- finally { if (e_22) throw e_22.error; }
4844
+ finally { if (e_20) throw e_20.error; }
4877
4845
  }
4878
4846
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4879
4847
  case 1:
4880
- _h.sent();
4881
- _h.label = 2;
4848
+ _k.sent();
4849
+ _k.label = 2;
4882
4850
  case 2: return [2 /*return*/];
4883
4851
  }
4884
4852
  });
@@ -4886,12 +4854,12 @@
4886
4854
  };
4887
4855
  BasicFormComponent.prototype.checkSectionRequiredFields = function (sectionCode, reqFieldMessage) {
4888
4856
  this.cleanErrorFields(null, sectionCode);
4889
- var requiredFieldMessage = reqFieldMessage || REQUIRED_FIELD_MESSAGE;
4857
+ var requiredFieldMessage = reqFieldMessage !== null && reqFieldMessage !== void 0 ? reqFieldMessage : this.formConfig.formStandardErrors.requiredField;
4890
4858
  var numErrors = this.tagFieldsWithError(this.getRequiredEmptyFields(null, sectionCode), null, requiredFieldMessage);
4891
4859
  return (numErrors === 0);
4892
4860
  };
4893
4861
  BasicFormComponent.prototype.validateSectionConsistency = function (sectionCode, reqFieldMessage) {
4894
- var e_23, _g, e_24, _h;
4862
+ var e_21, _j, e_22, _k;
4895
4863
  this.resetError();
4896
4864
  var completeFields = this.checkSectionRequiredFields(sectionCode, reqFieldMessage);
4897
4865
  if (!completeFields) {
@@ -4915,12 +4883,12 @@
4915
4883
  }
4916
4884
  }
4917
4885
  }
4918
- catch (e_23_1) { e_23 = { error: e_23_1 }; }
4886
+ catch (e_21_1) { e_21 = { error: e_21_1 }; }
4919
4887
  finally {
4920
4888
  try {
4921
- if (requiredEmptyFields_1_1 && !requiredEmptyFields_1_1.done && (_g = requiredEmptyFields_1.return)) _g.call(requiredEmptyFields_1);
4889
+ if (requiredEmptyFields_1_1 && !requiredEmptyFields_1_1.done && (_j = requiredEmptyFields_1.return)) _j.call(requiredEmptyFields_1);
4922
4890
  }
4923
- finally { if (e_23) throw e_23.error; }
4891
+ finally { if (e_21) throw e_21.error; }
4924
4892
  }
4925
4893
  }
4926
4894
  var validationIssueFields = this.getFieldsWithValidationIssues(null, sectionCode);
@@ -4938,18 +4906,18 @@
4938
4906
  }
4939
4907
  }
4940
4908
  }
4941
- catch (e_24_1) { e_24 = { error: e_24_1 }; }
4909
+ catch (e_22_1) { e_22 = { error: e_22_1 }; }
4942
4910
  finally {
4943
4911
  try {
4944
- if (validationIssueFields_1_1 && !validationIssueFields_1_1.done && (_h = validationIssueFields_1.return)) _h.call(validationIssueFields_1);
4912
+ if (validationIssueFields_1_1 && !validationIssueFields_1_1.done && (_k = validationIssueFields_1.return)) _k.call(validationIssueFields_1);
4945
4913
  }
4946
- finally { if (e_24) throw e_24.error; }
4914
+ finally { if (e_22) throw e_22.error; }
4947
4915
  }
4948
4916
  }
4949
4917
  return validationError;
4950
4918
  };
4951
4919
  BasicFormComponent.prototype.copyTableRecordToFields = function (tableObj, mappingTable) {
4952
- var e_25, _g;
4920
+ var e_23, _j;
4953
4921
  if (mappingTable === void 0) { mappingTable = null; }
4954
4922
  var _a, _b;
4955
4923
  var tableObject = this.getTable(tableObj.tableCode);
@@ -4963,12 +4931,12 @@
4963
4931
  this.setFieldValue(fieldCode, columnValue);
4964
4932
  }
4965
4933
  }
4966
- catch (e_25_1) { e_25 = { error: e_25_1 }; }
4934
+ catch (e_23_1) { e_23 = { error: e_23_1 }; }
4967
4935
  finally {
4968
4936
  try {
4969
- if (columnNames_1_1 && !columnNames_1_1.done && (_g = columnNames_1.return)) _g.call(columnNames_1);
4937
+ if (columnNames_1_1 && !columnNames_1_1.done && (_j = columnNames_1.return)) _j.call(columnNames_1);
4970
4938
  }
4971
- finally { if (e_25) throw e_25.error; }
4939
+ finally { if (e_23) throw e_23.error; }
4972
4940
  }
4973
4941
  return true;
4974
4942
  };
@@ -4976,7 +4944,7 @@
4976
4944
  * Soporte registros en tablas que se editan en campos del formulario
4977
4945
  */
4978
4946
  BasicFormComponent.prototype.defineEditionTable = function (tableEditionDef) {
4979
- var e_26, _g;
4947
+ var e_24, _j;
4980
4948
  var _this = this;
4981
4949
  var columnFieldMapping = tableEditionDef.columnFieldMapping, recordCaptureFields = tableEditionDef.recordCaptureFields, startCollapsed = tableEditionDef.startCollapsed;
4982
4950
  tableEditionDef.startCollapsed = (typeof startCollapsed !== 'undefined')
@@ -4986,17 +4954,17 @@
4986
4954
  try {
4987
4955
  for (var columnFieldMapping_1 = __values(columnFieldMapping), columnFieldMapping_1_1 = columnFieldMapping_1.next(); !columnFieldMapping_1_1.done; columnFieldMapping_1_1 = columnFieldMapping_1.next()) {
4988
4956
  var columnMap = columnFieldMapping_1_1.value;
4989
- var _h = __read(columnMap, 2), columnName = _h[0], formField = _h[1];
4957
+ var _k = __read(columnMap, 2), columnName = _k[0], formField = _k[1];
4990
4958
  fieldsMappingTable[columnName] = formField;
4991
4959
  fieldsToClear.push(formField);
4992
4960
  }
4993
4961
  }
4994
- catch (e_26_1) { e_26 = { error: e_26_1 }; }
4962
+ catch (e_24_1) { e_24 = { error: e_24_1 }; }
4995
4963
  finally {
4996
4964
  try {
4997
- if (columnFieldMapping_1_1 && !columnFieldMapping_1_1.done && (_g = columnFieldMapping_1.return)) _g.call(columnFieldMapping_1);
4965
+ if (columnFieldMapping_1_1 && !columnFieldMapping_1_1.done && (_j = columnFieldMapping_1.return)) _j.call(columnFieldMapping_1);
4998
4966
  }
4999
- finally { if (e_26) throw e_26.error; }
4967
+ finally { if (e_24) throw e_24.error; }
5000
4968
  }
5001
4969
  tableEditionDef.fieldsMappingTable = fieldsMappingTable;
5002
4970
  tableEditionDef.fieldsToClear = fieldsToClear;
@@ -5047,7 +5015,7 @@
5047
5015
  }
5048
5016
  };
5049
5017
  BasicFormComponent.prototype.enableRecordEdition = function (tableEditionDef, tableActionObject) {
5050
- var e_27, _g;
5018
+ var e_25, _j;
5051
5019
  if (tableActionObject === void 0) { tableActionObject = null; }
5052
5020
  if (tableActionObject) {
5053
5021
  this.copyTableRecordToFields(tableActionObject, tableEditionDef.fieldsMappingTable);
@@ -5059,17 +5027,17 @@
5059
5027
  if (tableEditionDef.fieldsToTriggerValidation
5060
5028
  && tableEditionDef.fieldsToTriggerValidation.length > 0) {
5061
5029
  try {
5062
- for (var _h = __values(tableEditionDef.fieldsToTriggerValidation), _j = _h.next(); !_j.done; _j = _h.next()) {
5063
- var fieldName = _j.value;
5030
+ for (var _k = __values(tableEditionDef.fieldsToTriggerValidation), _l = _k.next(); !_l.done; _l = _k.next()) {
5031
+ var fieldName = _l.value;
5064
5032
  this.startFieldValidation(fieldName);
5065
5033
  }
5066
5034
  }
5067
- catch (e_27_1) { e_27 = { error: e_27_1 }; }
5035
+ catch (e_25_1) { e_25 = { error: e_25_1 }; }
5068
5036
  finally {
5069
5037
  try {
5070
- if (_j && !_j.done && (_g = _h.return)) _g.call(_h);
5038
+ if (_l && !_l.done && (_j = _k.return)) _j.call(_k);
5071
5039
  }
5072
- finally { if (e_27) throw e_27.error; }
5040
+ finally { if (e_25) throw e_25.error; }
5073
5041
  }
5074
5042
  }
5075
5043
  return true;