tuain-ng-forms-lib 0.12.31 → 12.0.3

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.
Files changed (36) hide show
  1. package/bundles/tuain-ng-forms-lib.umd.js +721 -847
  2. package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
  3. package/esm2015/lib/classes/forms/action.js +5 -5
  4. package/esm2015/lib/classes/forms/element.js +7 -6
  5. package/esm2015/lib/classes/forms/field.js +52 -95
  6. package/esm2015/lib/classes/forms/form.constants.js +13 -82
  7. package/esm2015/lib/classes/forms/form.js +9 -10
  8. package/esm2015/lib/classes/forms/subsection.js +5 -5
  9. package/esm2015/lib/classes/forms/table/column.js +5 -5
  10. package/esm2015/lib/classes/forms/table/row-data.js +6 -4
  11. package/esm2015/lib/classes/forms/table/table.js +15 -13
  12. package/esm2015/lib/components/elements/action.component.js +3 -1
  13. package/esm2015/lib/components/elements/field.component.js +13 -31
  14. package/esm2015/lib/components/elements/layout/element.component.js +3 -6
  15. package/esm2015/lib/components/elements/layout/form-error.component.js +1 -1
  16. package/esm2015/lib/components/elements/tables/table.component.js +7 -7
  17. package/esm2015/lib/components/forms/basic-form.js +92 -90
  18. package/esm2015/lib/services/form-manager.service.js +60 -54
  19. package/fesm2015/tuain-ng-forms-lib.js +289 -403
  20. package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
  21. package/lib/classes/forms/action.d.ts +1 -1
  22. package/lib/classes/forms/element.d.ts +2 -1
  23. package/lib/classes/forms/field.d.ts +3 -1
  24. package/lib/classes/forms/form.constants.d.ts +12 -74
  25. package/lib/classes/forms/form.d.ts +2 -1
  26. package/lib/classes/forms/table/column.d.ts +2 -1
  27. package/lib/classes/forms/table/table.d.ts +1 -1
  28. package/lib/components/elements/action.component.d.ts +1 -0
  29. package/lib/components/elements/field.component.d.ts +1 -3
  30. package/lib/components/elements/layout/element.component.d.ts +1 -2
  31. package/lib/components/elements/layout/form-error.component.d.ts +0 -1
  32. package/lib/components/elements/tables/table.component.d.ts +1 -0
  33. package/lib/components/forms/basic-form.d.ts +23 -4
  34. package/lib/services/form-manager.service.d.ts +22 -15
  35. package/package.json +1 -1
  36. package/tuain-ng-forms-lib.metadata.json +1 -1
@@ -10,6 +10,8 @@
10
10
  this.showLabel = true;
11
11
  }
12
12
  ActionComponent.prototype.ngOnInit = function () {
13
+ var _a;
14
+ this.formConfig = (_a = this.actionObject) === null || _a === void 0 ? void 0 : _a._formConfig;
13
15
  this.start();
14
16
  };
15
17
  ActionComponent.prototype.start = function () { };
@@ -52,311 +54,6 @@
52
54
  showLabel: [{ type: core.Input }]
53
55
  };
54
56
 
55
- var componentConstants = {
56
- recordsPerPage: 10,
57
- // Constantes para el despliegue de formularios
58
- ELEMENTTYPE_ACTION: 'ACTION',
59
- ELEMENTTYPE_FIELD: 'FIELD',
60
- ELEMENTTYPE_TABLE: 'TABLE',
61
- // Acciones de formularios
62
- FORMACTION_TABLEACTION: 'TABLEACTION',
63
- FORMACTION_GETDATA: 'GETDATA',
64
- FORMACTION_GETTABLEDATA: 'GETTABLEDATA',
65
- FORMACTION_VALIDATE: 'VALIDATE',
66
- // Errores etándar de formularios
67
- FORMERROR_VALIDATION_CODE: '13',
68
- FORMERROR_TYPE_WARNING: 'WARNING',
69
- FORMERROR_REQUIRED_FIELDS: 'Todos los campos requeridos deben ser diligenciados',
70
- FORMERROR_VALIDATION_TITLE: 'Advertencia',
71
- FORMERROR_VALIDATION_FIELDS: 'Existen campos con problemas de validación',
72
- // Valores para los controles de navegació
73
- FORMNAVIGATION_FIRST: 'first',
74
- FORMNAVIGATION_PREVGROUP: 'prevgroup',
75
- FORMNAVIGATION_NEXTGROUP: 'nextgroup',
76
- FORMNAVIGATION_LAST: 'last',
77
- FIELDTYPE_ARRAY: 'ARRAY',
78
- FIELDTYPE_CHECK: 'CHECK',
79
- FIELDTYPE_DATE: 'DATE',
80
- FIELDTYPE_MAP: 'MAP',
81
- FIELDTYPE_CURRENCY: 'CURRENCY',
82
- FIELDTYPE_SELECT: 'SELECT',
83
- FIELDTYPE_TEXT: 'TEXT',
84
- FIELD_REQUIRED_MESSAGE: 'Campo requerido',
85
- FORMTABLEACTION_SORT: 'SORT',
86
- FORMTABLEACTION_REFRESH: 'REFRESH',
87
- FORMTABLEACTION_NAVIGATE: 'NAVIGATE',
88
- FORMTABLEACTION_INLINE: 'INLINE',
89
- FORMTABLEACTION_GLOBAL: 'GLOBAL',
90
- FORMTABLEACTION_ROWSELECTION: 'ROWSELECTION',
91
- FORMTABLEACTION_SELECTION: 'SELECTION',
92
- TABLE_SORT_ASCENDING: 'asc',
93
- TABLE_SORT_DESCENDING: 'desc',
94
- SERVICE_ERRORCODE_NOERROR: '00',
95
- };
96
- var operators = {
97
- G: '>',
98
- L: '<',
99
- GE: '>=',
100
- LE: '<=',
101
- EQ: '==',
102
- NOT_EQ: '!=',
103
- CONTENT: 'Contiene',
104
- NOT_CONTENT: 'No Contiene',
105
- BETWEEN: 'Entre',
106
- };
107
- var tableFieldStyles = {
108
- TEXT: {
109
- 'text-align': 'left'
110
- },
111
- TITLE: {
112
- 'text-align': 'left'
113
- },
114
- LABEL: {
115
- 'text-align': 'left'
116
- },
117
- MESSAGE: {
118
- 'text-align': 'left'
119
- },
120
- NUMBER: {
121
- 'text-align': 'right'
122
- },
123
- DATE: {
124
- 'text-align': 'right'
125
- },
126
- CHECK: {
127
- 'text-align': 'center'
128
- },
129
- ARRAY: {
130
- 'text-align': 'left'
131
- },
132
- SELECT: {
133
- 'text-align': 'left'
134
- }
135
- };
136
- var DEFAULT_STATE_FLOW = {
137
- defaultState: 'CREATE',
138
- states: ['CREATE', 'EDIT', 'VIEW'],
139
- transitions: [
140
- { name: 'VIEW1', origin: 'CREATE', destination: 'VIEW' },
141
- { name: 'VIEW2', origin: 'EDIT', destination: 'VIEW' },
142
- { name: 'EDIT1', origin: 'CREATE', destination: 'EDIT' },
143
- { name: 'EDIT2', origin: 'VIEW', destination: 'EDIT' },
144
- { name: 'CREATE1', origin: 'EDIT', destination: 'CREATE' },
145
- { name: 'CREATE2', origin: 'VIEW', destination: 'CREATE' },
146
- ]
147
- };
148
-
149
- var MONITORED_ATTRIBUTES$1 = {
150
- _maxLength: 'maxLength',
151
- _onValidation: '_onValidation',
152
- _fieldValue: 'value',
153
- captureType: 'captureType',
154
- fieldTitle: 'fieldTitle',
155
- fieldType: 'fieldType',
156
- errorMessage: 'errorMessage',
157
- errorType: 'errorType',
158
- errorCode: 'errorCode',
159
- visibleLabel: 'visibleLabel',
160
- fieldRequired: 'fieldRequired',
161
- fieldOptions: 'fieldOptions',
162
- };
163
- var FieldComponent = /** @class */ (function () {
164
- function FieldComponent() {
165
- this.componentConstants = Object.assign({}, componentConstants);
166
- }
167
- FieldComponent.prototype.ngOnInit = function () {
168
- var _this = this;
169
- if (this.fieldObject) {
170
- // Atributos estáticos
171
- this.code = this.fieldObject.fieldCode;
172
- this.fieldInfo = this.fieldObject.fieldInfo;
173
- this.fieldAlignment = this.fieldObject.fieldAlignment;
174
- this.tooltipText = this.fieldObject.tooltipText;
175
- this.fieldObject.widget = this;
176
- // Atributos dinámicos
177
- this.fieldObject.attributeChange.subscribe(function (event) {
178
- var name = event.name, value = event.value;
179
- if (_this[MONITORED_ATTRIBUTES$1[name]]) {
180
- _this[MONITORED_ATTRIBUTES$1[name]] = value;
181
- }
182
- });
183
- }
184
- this.start();
185
- };
186
- FieldComponent.prototype.start = function () { };
187
- FieldComponent.prototype.focus = function () { };
188
- FieldComponent.prototype.onInputChange = function () {
189
- var _this = this;
190
- setTimeout(function () { return _this.fieldObject.notifyEditionPartial(); }, 50);
191
- };
192
- FieldComponent.prototype.onChangeContent = function () {
193
- var _this = this;
194
- setTimeout(function () { return _this.fieldObject.notifyEditionFinish(); }, 50);
195
- };
196
- FieldComponent.prototype.onShowInfo = function () {
197
- var _this = this;
198
- setTimeout(function () { return _this.fieldObject.notifyEditionDetailRequest(); }, 50);
199
- };
200
- FieldComponent.prototype.numberInputValidation = function (event) {
201
- var k = event.charCode;
202
- return (k > 47 && k < 58);
203
- };
204
- return FieldComponent;
205
- }());
206
- FieldComponent.decorators = [
207
- { type: core.Component, args: [{
208
- selector: 'lib-field',
209
- template: "<ng-content></ng-content>"
210
- },] }
211
- ];
212
- FieldComponent.ctorParameters = function () { return []; };
213
- FieldComponent.propDecorators = {
214
- fieldObject: [{ type: core.Input }],
215
- disabled: [{ type: core.Input }]
216
- };
217
-
218
- var ElementComponent = /** @class */ (function () {
219
- function ElementComponent() {
220
- this.componentConstants = Object.assign({}, componentConstants);
221
- }
222
- ElementComponent.prototype.ngOnInit = function () {
223
- this.start();
224
- };
225
- ElementComponent.prototype.start = function () { };
226
- Object.defineProperty(ElementComponent.prototype, "visible", {
227
- get: function () {
228
- var _a, _b, _c, _d;
229
- var visible = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : true;
230
- return visible && ((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.viewOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
231
- },
232
- enumerable: false,
233
- configurable: true
234
- });
235
- Object.defineProperty(ElementComponent.prototype, "disabled", {
236
- get: function () {
237
- var _a, _b, _c, _d;
238
- var disabled = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : false;
239
- return disabled || !((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.enabledOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
240
- },
241
- enumerable: false,
242
- configurable: true
243
- });
244
- return ElementComponent;
245
- }());
246
- ElementComponent.decorators = [
247
- { type: core.Component, args: [{
248
- selector: 'lib-element',
249
- template: "<ng-content></ng-content>"
250
- },] }
251
- ];
252
- ElementComponent.ctorParameters = function () { return []; };
253
- ElementComponent.propDecorators = {
254
- formElement: [{ type: core.Input }],
255
- formManager: [{ type: core.Input }]
256
- };
257
-
258
- var FormErrorComponent = /** @class */ (function () {
259
- function FormErrorComponent() {
260
- }
261
- return FormErrorComponent;
262
- }());
263
- FormErrorComponent.decorators = [
264
- { type: core.Component, args: [{
265
- selector: 'lib-form-error',
266
- template: "<ng-content></ng-content>"
267
- },] }
268
- ];
269
- FormErrorComponent.propDecorators = {
270
- errorTitle: [{ type: core.Input }],
271
- errorMessage: [{ type: core.Input }],
272
- errorType: [{ type: core.Input }]
273
- };
274
-
275
- var FormHeaderComponent = /** @class */ (function () {
276
- function FormHeaderComponent() {
277
- this.goBackEvent = new core.EventEmitter();
278
- }
279
- FormHeaderComponent.prototype.goBackForm = function () {
280
- this.goBackEvent.emit();
281
- };
282
- return FormHeaderComponent;
283
- }());
284
- FormHeaderComponent.decorators = [
285
- { type: core.Component, args: [{
286
- selector: 'lib-form-header',
287
- template: "<ng-content></ng-content>"
288
- },] }
289
- ];
290
- FormHeaderComponent.propDecorators = {
291
- formManager: [{ type: core.Input }],
292
- goBackAction: [{ type: core.Input }],
293
- showTitle: [{ type: core.Input }],
294
- headerActions: [{ type: core.Input }],
295
- goBackEvent: [{ type: core.Output }]
296
- };
297
-
298
- var SectionComponent = /** @class */ (function () {
299
- function SectionComponent() {
300
- }
301
- SectionComponent.prototype.ngOnInit = function () {
302
- this.start();
303
- };
304
- SectionComponent.prototype.start = function () { };
305
- return SectionComponent;
306
- }());
307
- SectionComponent.decorators = [
308
- { type: core.Component, args: [{
309
- selector: 'lib-section',
310
- template: "<ng-content></ng-content>"
311
- },] }
312
- ];
313
- SectionComponent.propDecorators = {
314
- sectionObject: [{ type: core.Input }],
315
- formManager: [{ type: core.Input }]
316
- };
317
-
318
- var SubSectionComponent = /** @class */ (function () {
319
- function SubSectionComponent() {
320
- }
321
- SubSectionComponent.prototype.ngOnInit = function () {
322
- this.start();
323
- };
324
- SubSectionComponent.prototype.start = function () { };
325
- return SubSectionComponent;
326
- }());
327
- SubSectionComponent.decorators = [
328
- { type: core.Component, args: [{
329
- selector: 'lib-subsection',
330
- template: "<ng-content></ng-content>"
331
- },] }
332
- ];
333
- SubSectionComponent.propDecorators = {
334
- subSection: [{ type: core.Input }],
335
- showHeader: [{ type: core.Input }],
336
- formManager: [{ type: core.Input }]
337
- };
338
-
339
- var FieldSearch = /** @class */ (function () {
340
- function FieldSearch(filterDefinition) {
341
- this.fieldCode = filterDefinition.fieldCode;
342
- this.fieldAlias = filterDefinition.fieldAlias || filterDefinition.fieldCode;
343
- this.fieldTitle = filterDefinition.fieldTitle;
344
- this.fieldTypeCode = filterDefinition.fieldTypeCode;
345
- this.operators = filterDefinition.operators;
346
- this.alignment = filterDefinition.alignment;
347
- this.format = filterDefinition.format;
348
- }
349
- return FieldSearch;
350
- }());
351
- var Filter = /** @class */ (function () {
352
- function Filter() {
353
- this.filterModeSimple = true;
354
- this.advancedFilter = [];
355
- this.simpleFilterWords = [];
356
- }
357
- return Filter;
358
- }());
359
-
360
57
  /*! *****************************************************************************
361
58
  Copyright (c) Microsoft Corporation.
362
59
 
@@ -633,51 +330,273 @@
633
330
  if (Object.defineProperty) {
634
331
  Object.defineProperty(cooked, "raw", { value: raw });
635
332
  }
636
- else {
637
- cooked.raw = raw;
333
+ else {
334
+ cooked.raw = raw;
335
+ }
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 }]
548
+ };
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 = [];
638
567
  }
639
- return cooked;
640
- }
641
- ;
642
- var __setModuleDefault = Object.create ? (function (o, v) {
643
- Object.defineProperty(o, "default", { enumerable: true, value: v });
644
- }) : function (o, v) {
645
- o["default"] = v;
568
+ return Filter;
569
+ }());
570
+
571
+ var NO_ERROR = '00';
572
+ var HEADER$1 = 'HEADER';
573
+ var elementTypes = {
574
+ action: 'ACTION',
575
+ field: 'FIELD',
576
+ table: 'TABLE',
577
+ };
578
+ var formActions = {
579
+ tableAction: 'TABLEACTION',
580
+ getData: 'GETDATA',
581
+ getTableData: 'GETTABLEDATA',
582
+ validate: 'VALIDATE',
583
+ };
584
+ var operators = {
585
+ G: '>',
586
+ L: '<',
587
+ GE: '>=',
588
+ LE: '<=',
589
+ EQ: '==',
590
+ NOT_EQ: '!=',
591
+ CONTENT: 'Contiene',
592
+ NOT_CONTENT: 'No Contiene',
593
+ BETWEEN: 'Entre',
646
594
  };
647
- function __importStar(mod) {
648
- if (mod && mod.__esModule)
649
- return mod;
650
- var result = {};
651
- if (mod != null)
652
- for (var k in mod)
653
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
654
- __createBinding(result, mod, k);
655
- __setModuleDefault(result, mod);
656
- return result;
657
- }
658
- function __importDefault(mod) {
659
- return (mod && mod.__esModule) ? mod : { default: mod };
660
- }
661
- function __classPrivateFieldGet(receiver, state, kind, f) {
662
- if (kind === "a" && !f)
663
- throw new TypeError("Private accessor was defined without a getter");
664
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
665
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
666
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
667
- }
668
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
669
- if (kind === "m")
670
- throw new TypeError("Private method is not writable");
671
- if (kind === "a" && !f)
672
- throw new TypeError("Private accessor was defined without a setter");
673
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
674
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
675
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
676
- }
677
595
 
678
596
  var FormElement = /** @class */ (function () {
679
- function FormElement(elementDefinition) {
597
+ function FormElement(elementDefinition, formConfig) {
680
598
  var _a, _b;
599
+ this._formConfig = formConfig;
681
600
  this._isForced = false;
682
601
  this.setVisibleStates(elementDefinition.visibleStates);
683
602
  this.setEnabledStates(elementDefinition.enabledStates);
@@ -686,9 +605,9 @@
686
605
  this.setVisibility((_b = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.visible) !== null && _b !== void 0 ? _b : true);
687
606
  this.widget = null;
688
607
  }
689
- FormElement.prototype.isField = function () { return this.elementType === componentConstants.ELEMENTTYPE_FIELD; };
690
- FormElement.prototype.isAction = function () { return this.elementType === componentConstants.ELEMENTTYPE_ACTION; };
691
- FormElement.prototype.isTable = function () { return this.elementType === componentConstants.ELEMENTTYPE_TABLE; };
608
+ FormElement.prototype.isField = function () { return this.elementType === elementTypes.field; };
609
+ FormElement.prototype.isAction = function () { return this.elementType === elementTypes.action; };
610
+ FormElement.prototype.isTable = function () { return this.elementType === elementTypes.table; };
692
611
  FormElement.prototype.setVisibleStates = function (newStates) {
693
612
  var visibleStates = (!Array.isArray(newStates) && typeof newStates === 'string')
694
613
  ? newStates.split(',').map(function (state) { return state.trim(); }).filter(function (state) { return state.length > 0; })
@@ -748,13 +667,14 @@
748
667
  }());
749
668
 
750
669
  var RecordTableColumn = /** @class */ (function () {
751
- function RecordTableColumn(recTableColReceived) {
670
+ function RecordTableColumn(recTableColReceived, formConfig) {
752
671
  var _a, _b, _c;
672
+ this._formConfig = formConfig;
753
673
  if (recTableColReceived) {
754
674
  this.fieldCode = recTableColReceived.fieldCode;
755
675
  this.fieldTitle = recTableColReceived.fieldTitle;
756
- this.fieldType = recTableColReceived.fieldTypeCode || componentConstants.FIELDTYPE_TEXT;
757
- var defaultTypeAlignment = (tableFieldStyles[this.fieldType] != null) ? tableFieldStyles[this.fieldType]['text-align'] : 'left';
676
+ this.fieldType = recTableColReceived.fieldTypeCode || this._formConfig.fieldTypes.text;
677
+ var defaultTypeAlignment = (this._formConfig.tableFieldStyles[this.fieldType] != null) ? this._formConfig.tableFieldStyles[this.fieldType]['text-align'] : 'left';
758
678
  this.fieldAlignment = (recTableColReceived.alignment != null) ? recTableColReceived.alignment.toLowerCase() : defaultTypeAlignment;
759
679
  this.visible = (_a = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.visible) !== null && _a !== void 0 ? _a : true;
760
680
  this.sortable = (_b = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.sortable) !== null && _b !== void 0 ? _b : false;
@@ -843,6 +763,8 @@
843
763
  return outputValue;
844
764
  }
845
765
 
766
+ var DATE_TYPE = 'DATE';
767
+ var CURRENCY_TYPE = 'CURRENCY';
846
768
  var TableRecordData = /** @class */ (function () {
847
769
  function TableRecordData(recordReceived, recordDefinition, selectionFieldName) {
848
770
  var _this = this;
@@ -879,10 +801,10 @@
879
801
  }
880
802
  }
881
803
  TableRecordData.prototype.formatFieldValue = function (fieldType, fieldValue) {
882
- if (fieldType === componentConstants.FIELDTYPE_CURRENCY) {
804
+ if (fieldType === CURRENCY_TYPE) {
883
805
  return formatCurrency(fieldValue);
884
806
  }
885
- else if (fieldType === componentConstants.FIELDTYPE_DATE && fieldValue) {
807
+ else if (fieldType === DATE_TYPE && fieldValue) {
886
808
  return new Date(fieldValue).toISOString().split('T')[0];
887
809
  }
888
810
  return fieldValue || '';
@@ -993,6 +915,8 @@
993
915
  return TableRecordData;
994
916
  }());
995
917
 
918
+ var TABLE_SORT_ASCENDING = 'asc';
919
+ var TABLE_SORT_DESCENDING = 'desc';
996
920
  var TABLE_FILTER_TYPES = {
997
921
  simpleFilterChange: 'SIMPLE_CHANGE',
998
922
  simpleFilterFinish: 'SIMPLE_FINISH',
@@ -1001,11 +925,11 @@
1001
925
  };
1002
926
  var RecordTable = /** @class */ (function (_super) {
1003
927
  __extends(RecordTable, _super);
1004
- function RecordTable(tableReceived) {
928
+ function RecordTable(tableReceived, formConfig) {
1005
929
  var e_1, _h, e_2, _j, e_3, _k;
1006
930
  var _this = this;
1007
931
  var _a, _b, _c, _d, _e, _f, _g;
1008
- _this = _super.call(this, tableReceived) || this;
932
+ _this = _super.call(this, tableReceived, formConfig) || this;
1009
933
  _this._inlineActionTrigger = new rxjs.Subject();
1010
934
  _this._globalActionTrigger = new rxjs.Subject();
1011
935
  _this._recordSelectionTrigger = new rxjs.Subject();
@@ -1015,7 +939,7 @@
1015
939
  _this._tableColumnObj = {};
1016
940
  _this._actionsObj = {};
1017
941
  _this.allSelected = false;
1018
- _this.elementType = componentConstants.ELEMENTTYPE_TABLE;
942
+ _this.elementType = elementTypes.table;
1019
943
  _this.waiting = false;
1020
944
  _this.complexFilter = false;
1021
945
  _this.currentPage = 1;
@@ -1038,12 +962,12 @@
1038
962
  _this.customAttributes = (_f = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.customAttributes) !== null && _f !== void 0 ? _f : {};
1039
963
  _this.sortable = (_g = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.sortable) !== null && _g !== void 0 ? _g : false;
1040
964
  _this.sorting = { columnName: '', direction: '' };
1041
- _this.recordsPerPage = componentConstants.recordsPerPage;
965
+ _this.recordsPerPage = formConfig.defaultRecordsPerPage;
1042
966
  if (tableReceived.fields) {
1043
967
  try {
1044
968
  for (var _l = __values(tableReceived.fields), _m = _l.next(); !_m.done; _m = _l.next()) {
1045
969
  var columnReceived = _m.value;
1046
- var columnDefinition = new RecordTableColumn(columnReceived);
970
+ var columnDefinition = new RecordTableColumn(columnReceived, _this._formConfig);
1047
971
  _this.columns.push(columnDefinition);
1048
972
  _this._tableColumnObj[columnDefinition.fieldCode] = columnDefinition;
1049
973
  }
@@ -1303,7 +1227,7 @@
1303
1227
  ? this._actionsObj[actionCode] : null;
1304
1228
  };
1305
1229
  RecordTable.prototype.getActions = function (actionClass, actionTypes) {
1306
- if (actionClass === void 0) { actionClass = componentConstants.FORMTABLEACTION_INLINE; }
1230
+ if (actionClass === void 0) { actionClass = this._formConfig.tableActions.inline; }
1307
1231
  if (actionTypes === void 0) { actionTypes = null; }
1308
1232
  return this._actions.filter(function (actionDef) {
1309
1233
  var typeIncluded = (actionTypes) ? actionTypes.includes(actionDef.actionType) : true;
@@ -1378,14 +1302,14 @@
1378
1302
  RecordTable.prototype.setRequiredOrder = function (columnField) {
1379
1303
  if (columnField !== this.sorting.columnName) {
1380
1304
  this.sorting.columnName = columnField;
1381
- this.sorting.direction = componentConstants.TABLE_SORT_ASCENDING;
1305
+ this.sorting.direction = TABLE_SORT_ASCENDING;
1382
1306
  }
1383
1307
  else {
1384
- if (this.sorting.direction === componentConstants.TABLE_SORT_ASCENDING) {
1385
- this.sorting.direction = componentConstants.TABLE_SORT_DESCENDING;
1308
+ if (this.sorting.direction === TABLE_SORT_ASCENDING) {
1309
+ this.sorting.direction = TABLE_SORT_DESCENDING;
1386
1310
  }
1387
1311
  else {
1388
- this.sorting.direction = componentConstants.TABLE_SORT_ASCENDING;
1312
+ this.sorting.direction = TABLE_SORT_ASCENDING;
1389
1313
  }
1390
1314
  }
1391
1315
  };
@@ -1407,7 +1331,7 @@
1407
1331
  else if (recordAColumn > recordBColumn) {
1408
1332
  result = 1;
1409
1333
  }
1410
- return direction === componentConstants.TABLE_SORT_ASCENDING ? result : -result;
1334
+ return direction === TABLE_SORT_ASCENDING ? result : -result;
1411
1335
  };
1412
1336
  return RecordTable;
1413
1337
  }(FormElement));
@@ -1570,13 +1494,15 @@
1570
1494
  this.hasActions = false;
1571
1495
  }
1572
1496
  LibTableComponent.prototype.ngOnInit = function () {
1573
- this.tableFieldStyles = tableFieldStyles;
1497
+ var _a;
1498
+ this.formConfig = (_a = this.tableObject) === null || _a === void 0 ? void 0 : _a._formConfig;
1499
+ this.tableFieldStyles = this.formConfig.tableFieldStyles;
1574
1500
  this.selectable = this.tableObject.selectable;
1575
1501
  this.hasActions = this.tableObject.hasActions;
1576
1502
  this.tableObject.widget = this;
1577
- this.inlineActions = this.tableObject.getActions(componentConstants.FORMTABLEACTION_INLINE);
1578
- this.globalActions = this.tableObject.getActions(componentConstants.FORMTABLEACTION_GLOBAL);
1579
- this.selectionActions = this.tableObject.getActions(componentConstants.FORMTABLEACTION_SELECTION);
1503
+ this.inlineActions = this.tableObject.getActions(this.formConfig.tableActions.inline);
1504
+ this.globalActions = this.tableObject.getActions(this.formConfig.tableActions.global);
1505
+ this.selectionActions = this.tableObject.getActions(this.formConfig.tableActions.selection);
1580
1506
  this.start();
1581
1507
  };
1582
1508
  LibTableComponent.prototype.start = function () { };
@@ -1694,15 +1620,15 @@
1694
1620
  var arrayToAdd = null;
1695
1621
  var type = receivedElement.type, code = receivedElement.code;
1696
1622
  switch (type) {
1697
- case componentConstants.ELEMENTTYPE_FIELD:
1623
+ case elementTypes.field:
1698
1624
  elementObject = formObject.getFieldObject(code);
1699
1625
  arrayToAdd = this.subSectionFields;
1700
1626
  break;
1701
- case componentConstants.ELEMENTTYPE_TABLE:
1627
+ case elementTypes.table:
1702
1628
  elementObject = formObject.getTableObject(code);
1703
1629
  arrayToAdd = this.subSectionTables;
1704
1630
  break;
1705
- case componentConstants.ELEMENTTYPE_ACTION:
1631
+ case elementTypes.action:
1706
1632
  elementObject = formObject.getActionObject(code);
1707
1633
  arrayToAdd = this.subSectionActions;
1708
1634
  break;
@@ -1909,20 +1835,20 @@
1909
1835
  return RecordFormSection;
1910
1836
  }());
1911
1837
 
1912
- var HEADER$1 = 'HEADER';
1838
+ var HEADER = 'HEADER';
1913
1839
  var FormAction = /** @class */ (function (_super) {
1914
1840
  __extends(FormAction, _super);
1915
- function FormAction(actionDefinition) {
1841
+ function FormAction(actionDefinition, formConfig) {
1916
1842
  var _this = this;
1917
1843
  var _a, _b;
1918
- _this = _super.call(this, actionDefinition) || this;
1844
+ _this = _super.call(this, actionDefinition, formConfig) || this;
1919
1845
  _this._actionActivated = new rxjs.Subject();
1920
1846
  _this.inProgress = false;
1921
- _this.elementType = componentConstants.ELEMENTTYPE_ACTION;
1847
+ _this.elementType = elementTypes.action;
1922
1848
  _this.actionCode = actionDefinition.actionCode ? actionDefinition.actionCode.toString() : '';
1923
1849
  _this.actionName = actionDefinition.actionTitle;
1924
1850
  _this.iconName = actionDefinition.iconName || _this.actionCode;
1925
- _this.location = actionDefinition.position || HEADER$1;
1851
+ _this.location = actionDefinition.position || HEADER;
1926
1852
  _this.backend = (_a = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.serverAction) !== null && _a !== void 0 ? _a : false;
1927
1853
  _this.newState = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.newState;
1928
1854
  _this.customAttributes = (_b = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.customAttributes) !== null && _b !== void 0 ? _b : null;
@@ -1952,58 +1878,9 @@
1952
1878
  }(FormElement));
1953
1879
 
1954
1880
  var UNDEFINED = 'undefined';
1955
- var FIELD_VALUE = 'fieldValue';
1956
- var FIELD_OPTIONS = 'fieldOptions';
1957
- var FIELD_TITLE = 'fieldTitle';
1958
- var FIELD_CAPTURE_TYPE = 'captureType';
1959
- var FIELD_TYPE = 'fieldTypeCode';
1960
- var FIELD_MAX_LENGTH = 'maxLength';
1961
- var FIELD_VISIBLE = 'visible';
1962
- var FIELD_LABEL_VISIBLE = 'visibleLabel';
1963
- var FIELD_REQUIRED = 'required';
1964
- var FIELD_ERR_CODE = 'errorCode';
1965
- var FIELD_ERR_MSG = 'errorMessage';
1966
- var FIELD_TOOLTIP = 'tooltipText';
1967
- var FIELD_INFO = 'info';
1968
- var FIELD_EDITABLE = 'editable';
1969
- var FIELD_TYPES = {
1970
- boolean: 'BOOLEAN',
1971
- array: 'ARRAY',
1972
- check: 'CHECK',
1973
- date: 'DATE',
1974
- daterange: 'DATERANGE',
1975
- time: 'TIME',
1976
- timerange: 'TIMERANGE',
1977
- map: 'MAP',
1978
- number: 'NUMBER',
1979
- decimal: 'DECIMAL',
1980
- currency: 'CURRENCY',
1981
- select: 'SELECT',
1982
- typeahead: 'TYPEAHEAD',
1983
- text: 'TEXT',
1984
- password: 'PASSWORD',
1985
- label: 'LABEL',
1986
- html: 'HTML',
1987
- title: 'TITLE',
1988
- message: 'MESSAGE',
1989
- link: 'LINK',
1990
- warning: 'WARNING',
1991
- avatar: 'AVATAR',
1992
- email: 'EMAIL',
1993
- phone: 'PHONE',
1994
- };
1995
- var FIELD_TYPES_FORMATS = {
1996
- EMAIL: new RegExp('^\\w+([\\.-]?\\w+)@\\w+([\\.-]?\\w+)(\\.\\w{2,3})+$'),
1997
- };
1998
- var INTRINSIC_ERROR_MESSAGES = {
1999
- EMAIL: "El valor no corresponde a un correo v\u00E1lido",
2000
- DEFAULT: "El valor no se ajusta al formato establecido",
2001
- };
2002
1881
  var DEFAULT_ERROR_TYPE = 'error';
2003
1882
  var DEFAULT_CAPTURE_TYPE = 'INPUT';
2004
1883
  var DEFAULT_ALIGNMENT = 'left';
2005
- var MONITORED_ATTRIBUTES = ['_maxLength', '_onValidation', 'captureType', 'fieldTitle', 'fieldType',
2006
- 'errorMessage', 'errorType', 'errorCode', 'visibleLabel', 'fieldRequired', 'fieldOptions', '_fieldValue'];
2007
1884
  var STD_MAX_LENGTH = 50;
2008
1885
  var BIG_MAX_LENGTH = 500;
2009
1886
  var fldAttr = {
@@ -2037,22 +1914,22 @@
2037
1914
  };
2038
1915
  var FieldDescriptor = /** @class */ (function (_super) {
2039
1916
  __extends(FieldDescriptor, _super);
2040
- function FieldDescriptor(inputFieldReceived) {
1917
+ function FieldDescriptor(inputFieldReceived, formConfig) {
2041
1918
  var _this = this;
2042
1919
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
2043
- _this = _super.call(this, inputFieldReceived) || this;
1920
+ _this = _super.call(this, inputFieldReceived, formConfig) || this;
2044
1921
  _this._editionFinish = new rxjs.Subject();
2045
1922
  _this._editionPartial = new rxjs.Subject();
2046
1923
  _this._detailRequest = new rxjs.Subject();
2047
1924
  _this._attributeChange = new rxjs.Subject();
2048
- _this.elementType = componentConstants.ELEMENTTYPE_FIELD;
1925
+ _this.elementType = elementTypes.field;
2049
1926
  var fld = (inputFieldReceived) ? inputFieldReceived : {};
2050
1927
  _this.setAttr(fldAttr.code, fld.fieldCode);
2051
1928
  _this.setAttr(fldAttr.title, (_a = fld.fieldTitle) !== null && _a !== void 0 ? _a : _this.fieldCode);
2052
1929
  _this.setAttr(fldAttr.captureType, (_b = fld.captureType) !== null && _b !== void 0 ? _b : DEFAULT_CAPTURE_TYPE);
2053
1930
  _this.setAttr(fldAttr.defaultValue, (_c = fld.defaultValue) !== null && _c !== void 0 ? _c : null);
2054
- var defaultTypeAlignment = (tableFieldStyles[_this.fieldType] != null)
2055
- ? tableFieldStyles[_this.fieldType]['text-align'] : DEFAULT_ALIGNMENT;
1931
+ var defaultTypeAlignment = (_this._formConfig.tableFieldStyles[_this.fieldType] != null)
1932
+ ? _this._formConfig.tableFieldStyles[_this.fieldType]['text-align'] : DEFAULT_ALIGNMENT;
2056
1933
  var fieldAlignment = (fld.alignment != null) ? fld.alignment.toLowerCase() : defaultTypeAlignment;
2057
1934
  _this.setAttr(fldAttr.alignment, fieldAlignment);
2058
1935
  _this.setAttr(fldAttr.info, fld.info || '');
@@ -2073,7 +1950,7 @@
2073
1950
  _this.setAttr(fldAttr.outputOnly, (_h = fld.outputOnly) !== null && _h !== void 0 ? _h : false);
2074
1951
  var maxLength = (_j = fld.maxLength) !== null && _j !== void 0 ? _j : (_this.captureType === 'TEXTAREA' ? BIG_MAX_LENGTH : STD_MAX_LENGTH);
2075
1952
  _this.setAttr(fldAttr.maxLength, maxLength);
2076
- _this.setAttr(fldAttr.intrinsicErrorMessage, (_k = INTRINSIC_ERROR_MESSAGES[_this.fieldType]) !== null && _k !== void 0 ? _k : INTRINSIC_ERROR_MESSAGES.DEFAULT);
1953
+ _this.setAttr(fldAttr.intrinsicErrorMessage, (_k = _this._formConfig.fieldTypeErrMsg[_this.fieldType]) !== null && _k !== void 0 ? _k : _this._formConfig.fieldTypeErrMsg.DEFAULT);
2077
1954
  _this.setFieldType(fld.fieldTypeCode);
2078
1955
  _this.setEditable((_l = fld.editable) !== null && _l !== void 0 ? _l : true);
2079
1956
  _this.setVisibleLabel((_m = fld.visibleLabel) !== null && _m !== void 0 ? _m : true);
@@ -2154,13 +2031,13 @@
2154
2031
  this._editionPartial.next({ code: this.fieldCode, intrinsicValidation: intrinsicValidation });
2155
2032
  };
2156
2033
  FieldDescriptor.prototype.notifyEditionFinish = function () {
2157
- var _a, _b, _c, _d;
2034
+ var _a, _b, _c, _d, _e;
2158
2035
  var intrinsicValidation = true;
2159
- var fieldDefaultFormat = (_a = FIELD_TYPES_FORMATS === null || FIELD_TYPES_FORMATS === void 0 ? void 0 : FIELD_TYPES_FORMATS[this.fieldType]) !== null && _a !== void 0 ? _a : null;
2036
+ var fieldDefaultFormat = (_b = (_a = this._formConfig.fieldTypesPatterns) === null || _a === void 0 ? void 0 : _a[this.fieldType]) !== null && _b !== void 0 ? _b : null;
2160
2037
  var fieldValue = this.getValue();
2161
2038
  if (fieldValue && (fieldDefaultFormat || this.fieldFormat)) {
2162
- intrinsicValidation = ((_b = fieldDefaultFormat === null || fieldDefaultFormat === void 0 ? void 0 : fieldDefaultFormat.test(fieldValue)) !== null && _b !== void 0 ? _b : true)
2163
- && ((_d = (_c = this.fieldFormat) === null || _c === void 0 ? void 0 : _c.test(fieldValue)) !== null && _d !== void 0 ? _d : true);
2039
+ intrinsicValidation = ((_c = fieldDefaultFormat === null || fieldDefaultFormat === void 0 ? void 0 : fieldDefaultFormat.test(fieldValue)) !== null && _c !== void 0 ? _c : true)
2040
+ && ((_e = (_d = this.fieldFormat) === null || _d === void 0 ? void 0 : _d.test(fieldValue)) !== null && _e !== void 0 ? _e : true);
2164
2041
  if (!intrinsicValidation) {
2165
2042
  this.setError('99', this._intrinsicErrorMessage);
2166
2043
  }
@@ -2168,16 +2045,15 @@
2168
2045
  this._editionFinish.next({ code: this.fieldCode, intrinsicValidation: intrinsicValidation });
2169
2046
  };
2170
2047
  FieldDescriptor.prototype.setAttr = function (name, value) {
2171
- if (this[name]) {
2172
- this[name] = value;
2173
- }
2174
- if (MONITORED_ATTRIBUTES.includes(name)) {
2048
+ this[name] = value;
2049
+ if (this._formConfig.monitoredFieldAttributes.includes(name)) {
2175
2050
  this._attributeChange.next({ name: name, value: value });
2176
2051
  }
2177
2052
  };
2178
2053
  FieldDescriptor.prototype.notifyEditionDetailRequest = function () {
2179
2054
  this._detailRequest.next(this.fieldCode);
2180
2055
  };
2056
+ FieldDescriptor.prototype.getCustomAttribute = function (name) { var _a, _b; return (_b = (_a = this.customAttributes) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null; };
2181
2057
  FieldDescriptor.prototype.setVisibleLabel = function (visibleLabel) { this.setAttr(fldAttr.visibleLabel, visibleLabel); };
2182
2058
  FieldDescriptor.prototype.showLabel = function () { this.setVisibleLabel(true); };
2183
2059
  FieldDescriptor.prototype.hideLabel = function () { this.setVisibleLabel(false); };
@@ -2195,11 +2071,12 @@
2195
2071
  if (editable === void 0) { editable = true; }
2196
2072
  (editable) ? this.enable() : this.disable();
2197
2073
  };
2198
- 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); };
2199
2076
  FieldDescriptor.prototype.setError = function (code, message, type) {
2200
2077
  if (type === void 0) { type = DEFAULT_ERROR_TYPE; }
2201
- this.setAttr(fldAttr.errorCode, code !== null && code !== void 0 ? code : '00');
2202
- 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);
2203
2080
  this.setAttr(fldAttr.errorMessage, message !== null && message !== void 0 ? message : '');
2204
2081
  };
2205
2082
  FieldDescriptor.prototype.getError = function () { return { type: this.errorType, code: this.errorCode, message: this.errorMessage }; };
@@ -2218,7 +2095,7 @@
2218
2095
  if (fieldCurrentValue === undefined || fieldCurrentValue === null) {
2219
2096
  return true;
2220
2097
  }
2221
- if ((this.fieldType === FIELD_TYPES.array || this.fieldType === FIELD_TYPES.phone)
2098
+ if ((this.fieldType === this._formConfig.fieldTypes.array || this.fieldType === this._formConfig.fieldTypes.phone)
2222
2099
  && Array.isArray(fieldCurrentValue) && fieldCurrentValue.length === 0) {
2223
2100
  return true;
2224
2101
  }
@@ -2226,12 +2103,15 @@
2226
2103
  return fieldCurrentValue === '';
2227
2104
  };
2228
2105
  FieldDescriptor.prototype.getValue = function () {
2229
- var _a;
2106
+ var _a, _b;
2230
2107
  switch (this.fieldType) {
2231
- case componentConstants.FIELDTYPE_CHECK:
2108
+ case this._formConfig.fieldTypes.boolean:
2232
2109
  return (_a = this._fieldValue) !== null && _a !== void 0 ? _a : false;
2233
2110
  break;
2234
- case componentConstants.FIELDTYPE_CURRENCY:
2111
+ case this._formConfig.fieldTypes.check:
2112
+ return (_b = this._fieldValue) !== null && _b !== void 0 ? _b : false;
2113
+ break;
2114
+ case this._formConfig.fieldTypes.currency:
2235
2115
  return this._fieldValue.replace(',', '');
2236
2116
  break;
2237
2117
  default:
@@ -2245,33 +2125,33 @@
2245
2125
  for (var index = 0; index < fieldKeys.length; index++) {
2246
2126
  var attrName = fieldKeys[index];
2247
2127
  var attrValue = fld[attrName];
2248
- (attrName === FIELD_VISIBLE) && this.setVisibility(attrValue);
2249
- (attrName === FIELD_LABEL_VISIBLE) && this.setVisibleLabel(fld.visibleLabel);
2250
- (attrName === FIELD_REQUIRED) && this.setAttr(fldAttr.required, (_a = fld.required) !== null && _a !== void 0 ? _a : false);
2251
- (attrName === FIELD_ERR_CODE) && this.setAttr(fldAttr.errorCode, fld.errorCode);
2252
- (attrName === FIELD_ERR_MSG) && this.setAttr(fldAttr.errorMessage, fld.errorMessage);
2253
- (attrName === FIELD_TOOLTIP) && this.setAttr(fldAttr.tooltipText, fld.tooltip);
2254
- (attrName === FIELD_INFO) && this.setAttr(fldAttr.info, fld.info);
2255
- (attrName === FIELD_EDITABLE) && this.setEditable(fld.editable);
2256
- (attrName === FIELD_TITLE) && this.setLabel(fld.fieldTitle.toString());
2257
- (attrName === FIELD_VALUE) && (this.setValue(fld._fieldValue) && this.setChanged(false));
2258
- (attrName === FIELD_OPTIONS) && this.setFieldOptions(fld.fieldOptions);
2259
- (attrName === FIELD_CAPTURE_TYPE) && this.setAttr(fldAttr.captureType, fld.captureType || 'INPUT');
2260
- (attrName === FIELD_TYPE) && this.setFieldType(fld.fieldTypeCode);
2261
- (attrName === FIELD_MAX_LENGTH) && this.setAttr(fldAttr.maxLength, fld.maxLength);
2128
+ (attrName === this._formConfig.apifieldattrs.visible) && this.setVisibility(attrValue);
2129
+ (attrName === this._formConfig.apifieldattrs.labelVisible) && this.setVisibleLabel(fld.visibleLabel);
2130
+ (attrName === this._formConfig.apifieldattrs.required) && this.setAttr(fldAttr.required, (_a = fld.required) !== null && _a !== void 0 ? _a : false);
2131
+ (attrName === this._formConfig.apifieldattrs.errorCode) && this.setAttr(fldAttr.errorCode, fld.errorCode);
2132
+ (attrName === this._formConfig.apifieldattrs.errorMessage) && this.setAttr(fldAttr.errorMessage, fld.errorMessage);
2133
+ (attrName === this._formConfig.apifieldattrs.tooltip) && this.setAttr(fldAttr.tooltipText, fld.tooltip);
2134
+ (attrName === this._formConfig.apifieldattrs.info) && this.setAttr(fldAttr.info, fld.info);
2135
+ (attrName === this._formConfig.apifieldattrs.editable) && this.setEditable(fld.editable);
2136
+ (attrName === this._formConfig.apifieldattrs.title) && this.setLabel(fld.fieldTitle.toString());
2137
+ (attrName === this._formConfig.apifieldattrs.value) && (this.setValue(fld._fieldValue) && this.setChanged(false));
2138
+ (attrName === this._formConfig.apifieldattrs.options) && this.setFieldOptions(fld.fieldOptions);
2139
+ (attrName === this._formConfig.apifieldattrs.captureType) && this.setAttr(fldAttr.captureType, fld.captureType || 'INPUT');
2140
+ (attrName === this._formConfig.apifieldattrs.type) && this.setFieldType(fld.fieldTypeCode);
2141
+ (attrName === this._formConfig.apifieldattrs.maxLength) && this.setAttr(fldAttr.maxLength, fld.maxLength);
2262
2142
  }
2263
2143
  };
2264
2144
  FieldDescriptor.prototype.setFieldType = function (inputFieldType) {
2265
2145
  this.setAttr(fldAttr.type, inputFieldType);
2266
2146
  };
2267
2147
  FieldDescriptor.prototype.format = function () {
2268
- if (this.fieldType === componentConstants.FIELDTYPE_CURRENCY) {
2148
+ if (this.fieldType === this._formConfig.fieldTypes.currency) {
2269
2149
  this.setAttr(fldAttr.value, formatCurrency(this._fieldValue));
2270
2150
  }
2271
2151
  };
2272
2152
  FieldDescriptor.prototype.setMinValue = function (minValue) {
2273
2153
  var _a, _b, _c;
2274
- if (this.fieldType === componentConstants.FIELDTYPE_DATE
2154
+ if (this.fieldType === this._formConfig.fieldTypes.date
2275
2155
  && ((_a = this.widget) === null || _a === void 0 ? void 0 : _a.setMinValue)) {
2276
2156
  this.setAttr(fldAttr.minValue, minValue);
2277
2157
  if (!minValue) {
@@ -2285,7 +2165,7 @@
2285
2165
  };
2286
2166
  FieldDescriptor.prototype.setMaxValue = function (maxValue) {
2287
2167
  var _a, _b, _c;
2288
- if (this.fieldType === componentConstants.FIELDTYPE_DATE
2168
+ if (this.fieldType === this._formConfig.fieldTypes.date
2289
2169
  && ((_a = this.widget) === null || _a === void 0 ? void 0 : _a.setMaxValue)) {
2290
2170
  this.setAttr(fldAttr.maxValue, maxValue);
2291
2171
  if (!maxValue) {
@@ -2318,11 +2198,11 @@
2318
2198
  fieldOptions = (fieldOptions && Array.isArray(fieldOptions)
2319
2199
  && fieldOptions.length > 0) ? fieldOptions : [];
2320
2200
  this.setAttr(fldAttr.options, fieldOptions);
2321
- if (this.fieldType === componentConstants.FIELDTYPE_ARRAY && this.widget) {
2201
+ if (this.fieldType === this._formConfig.fieldTypes.array && this.widget) {
2322
2202
  return (_a = this.widget) === null || _a === void 0 ? void 0 : _a.refereshContent();
2323
2203
  }
2324
2204
  if (this._fieldValue) {
2325
- if (this.fieldType === componentConstants.FIELDTYPE_ARRAY && Array.isArray(this._fieldValue)) {
2205
+ if (this.fieldType === this._formConfig.fieldTypes.array && Array.isArray(this._fieldValue)) {
2326
2206
  var fieldValue = (_b = this._fieldValue) === null || _b === void 0 ? void 0 : _b.filter(function (item) { return _this.fieldOptions.find(function (opt) { return opt.fieldOptionId === item; }); });
2327
2207
  this.setAttr(fldAttr.value, fieldValue);
2328
2208
  }
@@ -2352,10 +2232,13 @@
2352
2232
  case 'BOOLEAN':
2353
2233
  newFinalValue = !!newValue;
2354
2234
  break;
2355
- case componentConstants.FIELDTYPE_CHECK:
2235
+ case this._formConfig.fieldTypes.boolean:
2236
+ newFinalValue = !!newValue;
2237
+ break;
2238
+ case this._formConfig.fieldTypes.check:
2356
2239
  newFinalValue = !!newValue;
2357
2240
  break;
2358
- case componentConstants.FIELDTYPE_ARRAY:
2241
+ case this._formConfig.fieldTypes.array:
2359
2242
  if (newValue === null || newValue === '') {
2360
2243
  newFinalValue = [];
2361
2244
  }
@@ -2369,7 +2252,7 @@
2369
2252
  newFinalValue = newValue;
2370
2253
  }
2371
2254
  break;
2372
- case componentConstants.FIELDTYPE_MAP:
2255
+ case this._formConfig.fieldTypes.map:
2373
2256
  newFinalValue = newValue;
2374
2257
  if (newFinalValue && this.widget && widgetUpdate) {
2375
2258
  var latitude = parseFloat(newFinalValue[0]);
@@ -2377,7 +2260,7 @@
2377
2260
  (_a = this.widget) === null || _a === void 0 ? void 0 : _a.setLocation(latitude, longitude);
2378
2261
  }
2379
2262
  break;
2380
- case componentConstants.FIELDTYPE_CURRENCY:
2263
+ case this._formConfig.fieldTypes.currency:
2381
2264
  newFinalValue = formatCurrency(this._fieldValue);
2382
2265
  break;
2383
2266
  default:
@@ -2393,17 +2276,17 @@
2393
2276
  return FieldDescriptor;
2394
2277
  }(FormElement));
2395
2278
 
2396
- var HEADER = 'HEADER';
2397
- var NO_ERROR = '00';
2398
2279
  var FormStructureAndData = /** @class */ (function () {
2399
- function FormStructureAndData(definitionReceived) {
2280
+ function FormStructureAndData(definitionReceived, formConfig) {
2400
2281
  var e_1, _d, e_2, _e, e_3, _f, e_4, _g;
2282
+ var _this = this;
2401
2283
  this._fieldsObj = {};
2402
2284
  this._actionsObj = {};
2403
2285
  this._tableObj = {};
2404
2286
  this._sectionsObj = {};
2405
2287
  this._immutableData = {};
2406
2288
  this._extraInfo = {};
2289
+ this._formConfig = formConfig;
2407
2290
  this.state = '';
2408
2291
  this._actions = [];
2409
2292
  this._fields = [];
@@ -2439,7 +2322,7 @@
2439
2322
  try {
2440
2323
  for (var formActions_1 = __values(formActions), formActions_1_1 = formActions_1.next(); !formActions_1_1.done; formActions_1_1 = formActions_1.next()) {
2441
2324
  var actionReceived = formActions_1_1.value;
2442
- var globalAction = new FormAction(actionReceived);
2325
+ var globalAction = new FormAction(actionReceived, this._formConfig);
2443
2326
  var globalActionCode = globalAction.actionCode;
2444
2327
  if (globalActionCode) {
2445
2328
  this._actions.push(globalAction);
@@ -2470,7 +2353,7 @@
2470
2353
  try {
2471
2354
  for (var formFields_1 = __values(formFields), formFields_1_1 = formFields_1.next(); !formFields_1_1.done; formFields_1_1 = formFields_1.next()) {
2472
2355
  var fieldReceived = formFields_1_1.value;
2473
- var fieldToAdd = new FieldDescriptor(fieldReceived);
2356
+ var fieldToAdd = new FieldDescriptor(fieldReceived, this._formConfig);
2474
2357
  var fieldCode = fieldToAdd.fieldCode;
2475
2358
  if (fieldCode) {
2476
2359
  this._fields.push(fieldToAdd);
@@ -2497,14 +2380,14 @@
2497
2380
  enabledStates = __spreadArray([], __read(visibleStates));
2498
2381
  }
2499
2382
  if (!visibleStates || visibleStates.length === 0) {
2500
- visibleStates = DEFAULT_STATE_FLOW.states;
2383
+ visibleStates = _this._formConfig.defaultStateFlow.states;
2501
2384
  }
2502
2385
  return Object.assign(Object.assign({}, objDef), { visibleStates: visibleStates, enabledStates: enabledStates });
2503
2386
  });
2504
2387
  try {
2505
2388
  for (var tables_1 = __values(tables), tables_1_1 = tables_1.next(); !tables_1_1.done; tables_1_1 = tables_1.next()) {
2506
2389
  var tableReceived = tables_1_1.value;
2507
- var tableToAdd = new RecordTable(tableReceived);
2390
+ var tableToAdd = new RecordTable(tableReceived, this._formConfig);
2508
2391
  var tableCode = tableToAdd.tableCode;
2509
2392
  if (tableCode) {
2510
2393
  this._tables.push(tableToAdd);
@@ -2614,7 +2497,7 @@
2614
2497
  FormStructureAndData.prototype.setStateFlow = function (states, transitions, defaultState) {
2615
2498
  var _this = this;
2616
2499
  if (!states || !transitions) {
2617
- this._stateFlow = JSON.parse(JSON.stringify(DEFAULT_STATE_FLOW));
2500
+ this._stateFlow = JSON.parse(JSON.stringify(this._formConfig.defaultStateFlow));
2618
2501
  return;
2619
2502
  }
2620
2503
  this._stateFlow.states = states;
@@ -2641,7 +2524,7 @@
2641
2524
  return this._actions;
2642
2525
  };
2643
2526
  FormStructureAndData.prototype.getHeaderActions = function () {
2644
- return this._actions.filter(function (actionItem) { return actionItem.location === HEADER; });
2527
+ return this._actions.filter(function (actionItem) { return actionItem.location === HEADER$1; });
2645
2528
  };
2646
2529
  FormStructureAndData.prototype.getFieldObject = function (elementId) {
2647
2530
  return (this._fieldsObj && elementId && this._fieldsObj[elementId])
@@ -3173,71 +3056,79 @@
3173
3056
  function LibFormManagerService() {
3174
3057
  this.cleanStack();
3175
3058
  }
3176
- /**
3177
- * Métodos virtuales de manejo de formularios
3178
- */
3059
+ // Métodos virtuales para las aplicaciones
3179
3060
  LibFormManagerService.prototype.getFormDefinition = function (formCode) { };
3061
+ LibFormManagerService.prototype.getFormRoute = function (formCode) { };
3062
+ LibFormManagerService.prototype.getRouteForm = function (path) { };
3180
3063
  LibFormManagerService.prototype.execServerAction = function (actionDetail) { };
3181
- LibFormManagerService.prototype.goToRoute = function (navigationArray) { };
3182
- /**
3183
- * Manejo del stack de navegación con atributos estados y parámetros
3184
- */
3185
- LibFormManagerService.prototype.resetPageStack = function () { this.cleanStack(); };
3186
- LibFormManagerService.prototype.cleanStack = function () {
3187
- this.pageStack = [];
3188
- };
3064
+ LibFormManagerService.prototype.goToForm = function (formCode, token, subject) { };
3189
3065
  LibFormManagerService.prototype.loadStack = function () { };
3190
3066
  LibFormManagerService.prototype.saveStack = function () { };
3191
- LibFormManagerService.prototype.stack = function (data) {
3192
- var id = nanoid.nanoid(6);
3193
- this.pageStack.push({ id: id, data: data });
3194
- this.saveStack();
3195
- return id;
3196
- };
3197
- LibFormManagerService.prototype.unstack = function (id) {
3198
- var stackIdx = this.pageStack.findIndex(function (item) { return item.id === id; });
3199
- if (stackIdx >= 0) {
3200
- var formData = this.pageStack[stackIdx].data;
3201
- // Se eliminan los formularios posteriores al solicitado
3202
- 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;
3203
3088
  this.saveStack();
3204
- return formData;
3205
3089
  }
3206
3090
  };
3207
- LibFormManagerService.prototype.getInputData = function (id) {
3208
- var stackIdx = (id) ? this.pageStack.findIndex(function (item) { return item.id === id; }) : -1;
3209
- if (stackIdx >= 0) {
3210
- var predefinedFields = this.pageStack[stackIdx].data.target.predefinedFields;
3211
- 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();
3212
3106
  }
3213
- return null;
3107
+ return formInfo;
3214
3108
  };
3215
- LibFormManagerService.prototype.getOriginInfo = function (id) {
3216
- var stackIdx = (id) ? this.pageStack.findIndex(function (item) { return item.id === id; }) : -1;
3217
- if (stackIdx >= 0) {
3218
- var origin = this.pageStack[stackIdx].data.origin;
3219
- return JSON.parse(JSON.stringify(origin));
3220
- }
3221
- 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
+ };
3222
3120
  };
3223
- LibFormManagerService.prototype.changeForm = function (origin, target) {
3224
- if (!origin) {
3225
- this.cleanStack();
3226
- }
3227
- var url = target.url, params = target.params;
3228
- var newToken = this.stack({ origin: origin, target: target });
3229
- var navigationArray = __spreadArray(__spreadArray([url], __read(params)), [newToken]);
3230
- 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);
3231
3127
  };
3232
- LibFormManagerService.prototype.changePreviousForm = function (transitionToken) {
3233
- var prevForm = this.unstack(transitionToken);
3234
- if (!prevForm) {
3235
- return;
3236
- }
3237
- var _a = prevForm.origin, url = _a.url, params = _a.params, token = _a.token;
3238
- var navigationArray = __spreadArray([url], __read(params));
3239
- token && navigationArray.push(token);
3240
- 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);
3241
3132
  };
3242
3133
  return LibFormManagerService;
3243
3134
  }());
@@ -3276,11 +3167,8 @@
3276
3167
  var INLINE_ACTION = 'INLINE';
3277
3168
  var GLOBAL_ACTION = 'GLOBAL';
3278
3169
  var GET_DATA_ACTION = 'GETDATA';
3279
- var FORM_CODE = 'form';
3280
- var FORM_SUBJECT = 'formSubject';
3281
- var ORIGIN_PARAM = 'origin';
3282
- var STATE_PARAM = 'mode';
3283
- var REQUIRED_FIELD_MESSAGE = 'Campo requerido';
3170
+ var SUBJECT = 'subject';
3171
+ var TOKEN = 'token';
3284
3172
  var BasicFormComponent = /** @class */ (function () {
3285
3173
  function BasicFormComponent(formManagerService, _eventManager, fileMgmtServices) {
3286
3174
  this.formManagerService = formManagerService;
@@ -3290,10 +3178,9 @@
3290
3178
  this.errorMessage = '';
3291
3179
  this.errorDetail = '';
3292
3180
  this.formStructure = null;
3293
- this.transitionToken = null;
3294
- this.inputDataFields = [];
3295
- this.extraData = null;
3296
- this.componentConstants = componentConstants;
3181
+ this.controlToken = null;
3182
+ this.inputDataFields = {};
3183
+ this.extraData = {};
3297
3184
  this.definitionObtained = false;
3298
3185
  this.formVisible = false;
3299
3186
  this.inServerProcess = false;
@@ -3315,14 +3202,17 @@
3315
3202
  this.cleanStart();
3316
3203
  this.customPreProcessing();
3317
3204
  }
3205
+ BasicFormComponent.prototype.setConfig = function (formConfig) {
3206
+ this.formConfig = formConfig;
3207
+ };
3318
3208
  BasicFormComponent.prototype.cleanStart = function () {
3319
3209
  this._errorType = '';
3320
3210
  this.errorCode = '';
3321
3211
  this.errorMessage = '';
3322
3212
  this.errorDetail = '';
3323
3213
  this.formStructure = null;
3324
- this.transitionToken = null;
3325
- this.inputDataFields = [];
3214
+ this.controlToken = null;
3215
+ this.inputDataFields = {};
3326
3216
  this.definitionObtained = false;
3327
3217
  // Se limpian los manejadores de eventos
3328
3218
  this.formVisible = false;
@@ -3490,36 +3380,65 @@
3490
3380
  BasicFormComponent.prototype.subscribeAppEvent = function (eventName, callback) {
3491
3381
  this._eventEmiter.subscribe(eventName, callback);
3492
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
+ */
3493
3406
  BasicFormComponent.prototype.goToPage = function (navigationArray, predefinedFields, options) {
3494
3407
  if (options === void 0) { options = null; }
3495
- var _a, _b;
3408
+ var _a;
3496
3409
  var origin = null;
3497
3410
  var cleanStack = (_a = options === null || options === void 0 ? void 0 : options.cleanStack) !== null && _a !== void 0 ? _a : false;
3498
- var params = [];
3499
- this.currentState && params.push(this.currentState);
3500
- this.formSubject && params.push(this.formSubject);
3501
3411
  if (!cleanStack) {
3502
3412
  origin = {
3503
- code: this.name,
3413
+ name: this.name,
3504
3414
  url: this._formRoute,
3505
- params: params,
3506
- token: this.transitionToken,
3507
- predefinedFields: this.inputDataFields
3415
+ token: this.controlToken,
3416
+ fields: this.inputDataFields,
3417
+ extra: this.extraData
3508
3418
  };
3509
3419
  }
3510
3420
  var target = {
3421
+ name: this.formManagerService.getRouteForm(navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0]),
3511
3422
  url: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0],
3512
- params: (_b = navigationArray.splice(1)) !== null && _b !== void 0 ? _b : [],
3513
- 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,
3514
3427
  };
3515
- this.formManagerService.changeForm(origin, target);
3428
+ this.formManagerService.openForm(origin, target);
3516
3429
  };
3430
+ /**
3431
+ * @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
3432
+ */
3517
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
+ */
3518
3437
  BasicFormComponent.prototype.goToSubPage = function (nav, flds) { return this.goToPage(nav, flds, { cleanStack: false }); };
3519
- BasicFormComponent.prototype.canGoBack = function () { return this.transitionToken !== null; };
3520
- 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(); };
3521
3440
  BasicFormComponent.prototype.goBackForm = function () { return this.goBack(); };
3522
- BasicFormComponent.prototype.getOriginDetail = function () { return this.formManagerService.getOriginInfo(this.transitionToken); };
3441
+ BasicFormComponent.prototype.getOriginDetail = function () { return this.formManagerService.getFormInfo(this.originToken); };
3523
3442
  BasicFormComponent.prototype.setError = function (errorType, errorMessage, errorDetail) {
3524
3443
  this._errorType = errorType || '';
3525
3444
  this.errorMessage = errorMessage || '';
@@ -3551,44 +3470,23 @@
3551
3470
  configurable: true
3552
3471
  });
3553
3472
  BasicFormComponent.prototype.getFormParameter = function (name) {
3554
- 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;
3555
3475
  };
3556
3476
  BasicFormComponent.prototype.getSubject = function () { return this.formSubject; };
3557
3477
  BasicFormComponent.prototype.getformSubject = function () { return this.getSubject(); };
3558
3478
  BasicFormComponent.prototype.preocessInputParams = function (params) {
3559
- var e_1, _g;
3560
- var _a, _b, _c, _d, _e, _f;
3561
- var allParams = Object.keys(params !== null && params !== void 0 ? params : {});
3562
- if (!allParams || !Array.isArray(allParams) || allParams.length === 0) {
3563
- return;
3564
- }
3565
- this.extraData = [];
3566
- try {
3567
- for (var allParams_1 = __values(allParams), allParams_1_1 = allParams_1.next(); !allParams_1_1.done; allParams_1_1 = allParams_1.next()) {
3568
- var paramName = allParams_1_1.value;
3569
- this.extraData[paramName] = params[paramName].toString();
3570
- }
3571
- }
3572
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
3573
- finally {
3574
- try {
3575
- if (allParams_1_1 && !allParams_1_1.done && (_g = allParams_1.return)) _g.call(allParams_1);
3576
- }
3577
- finally { if (e_1) throw e_1.error; }
3578
- }
3579
- var formName = (_b = (_a = this.extraData) === null || _a === void 0 ? void 0 : _a[FORM_CODE]) !== null && _b !== void 0 ? _b : this.name;
3580
- if (formName !== this.name) {
3581
- this.cleanStart();
3582
- this.name = formName;
3583
- }
3584
- this.formSubject = (_d = (_c = this.extraData) === null || _c === void 0 ? void 0 : _c[FORM_SUBJECT]) !== null && _d !== void 0 ? _d : null;
3585
- var initialState = this.extraData[STATE_PARAM];
3586
- this.transitionToken = (_e = this.extraData[ORIGIN_PARAM]) !== null && _e !== void 0 ? _e : null;
3587
- this.inputDataFields = (_f = this.formManagerService.getInputData(this.transitionToken)) !== null && _f !== void 0 ? _f : [];
3588
- if (!this.transitionToken) {
3589
- 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);
3590
3484
  }
3591
- 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;
3592
3490
  };
3593
3491
  BasicFormComponent.prototype.subscribeSectionActivation = function () {
3594
3492
  var _this = this;
@@ -3640,12 +3538,10 @@
3640
3538
  }
3641
3539
  };
3642
3540
  BasicFormComponent.prototype.formInit = function (params) {
3643
- var _a;
3644
3541
  return __awaiter(this, void 0, void 0, function () {
3645
- var initialState, formDefinition, _g, _h, inputFieldData, fieldCode, fieldValue, fieldCodes, index, fieldCode, fieldValue, recordResponse;
3646
- var e_2, _j;
3647
- return __generator(this, function (_k) {
3648
- switch (_k.label) {
3542
+ var initialState, formDefinition, inputFieldNames, index, fieldCode, fieldValue, recordResponse;
3543
+ return __generator(this, function (_j) {
3544
+ switch (_j.label) {
3649
3545
  case 0:
3650
3546
  initialState = this.preocessInputParams(params);
3651
3547
  if (!this.name) {
@@ -3655,48 +3551,28 @@
3655
3551
  this.inServerProcess = true;
3656
3552
  return [4 /*yield*/, this.formManagerService.getFormDefinition(this.name)];
3657
3553
  case 1:
3658
- formDefinition = _k.sent();
3554
+ formDefinition = _j.sent();
3659
3555
  this.inServerProcess = false;
3660
- this.formStructure = new FormStructureAndData(formDefinition);
3556
+ this.formStructure = new FormStructureAndData(formDefinition, this.formConfig);
3661
3557
  this.definitionObtained = true;
3662
3558
  return [3 /*break*/, 3];
3663
3559
  case 2:
3664
3560
  this.cleanData();
3665
- _k.label = 3;
3561
+ _j.label = 3;
3666
3562
  case 3:
3667
3563
  if (!this.supportState(initialState)) {
3668
3564
  initialState = this.formStructure.defaultState;
3669
3565
  }
3670
3566
  this.formStructure.changeState(initialState || this.formStructure.defaultState);
3671
- if (Array.isArray(this.inputDataFields)) {
3672
- try {
3673
- for (_g = __values(this.inputDataFields), _h = _g.next(); !_h.done; _h = _g.next()) {
3674
- inputFieldData = _h.value;
3675
- fieldCode = inputFieldData.fieldCode, fieldValue = inputFieldData.fieldValue;
3676
- if (fieldCode) {
3677
- this.setFieldValue(fieldCode, fieldValue);
3678
- }
3679
- }
3680
- }
3681
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
3682
- finally {
3683
- try {
3684
- if (_h && !_h.done && (_j = _g.return)) _j.call(_g);
3685
- }
3686
- finally { if (e_2) throw e_2.error; }
3687
- }
3688
- }
3689
- else {
3690
- fieldCodes = Object.keys((_a = this.inputDataFields) !== null && _a !== void 0 ? _a : {});
3691
- for (index = 0; index < fieldCodes.length; index++) {
3692
- fieldCode = fieldCodes[index];
3693
- fieldValue = this.inputDataFields[fieldCode];
3694
- this.setFieldValue(fieldCode, fieldValue);
3695
- }
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);
3696
3572
  }
3697
- return [4 /*yield*/, this.requestFormAction(componentConstants.FORMACTION_GETDATA)];
3573
+ return [4 /*yield*/, this.requestFormAction(formActions.getData)];
3698
3574
  case 4:
3699
- recordResponse = _k.sent();
3575
+ recordResponse = _j.sent();
3700
3576
  this.checkErrorRecordReceived(recordResponse);
3701
3577
  this.formVisible = true;
3702
3578
  this.subscribeSectionActivation();
@@ -3719,7 +3595,7 @@
3719
3595
  this.errorDetail = recordResponse.errorDetail;
3720
3596
  };
3721
3597
  BasicFormComponent.prototype.errorOccured = function () {
3722
- return (this.errorCode !== componentConstants.SERVICE_ERRORCODE_NOERROR);
3598
+ return (this.errorCode !== NO_ERROR);
3723
3599
  };
3724
3600
  BasicFormComponent.prototype.changeState = function (state) { return this.formStructure.changeState(state); };
3725
3601
  BasicFormComponent.prototype.changeFormMode = function (state) { return this.changeState(state); };
@@ -3727,8 +3603,8 @@
3727
3603
  if (actionSubject === void 0) { actionSubject = {}; }
3728
3604
  return __awaiter(this, void 0, void 0, function () {
3729
3605
  var actionDetail, formActionResponse, error, formResponseData;
3730
- return __generator(this, function (_g) {
3731
- switch (_g.label) {
3606
+ return __generator(this, function (_j) {
3607
+ switch (_j.label) {
3732
3608
  case 0:
3733
3609
  actionDetail = {
3734
3610
  formCode: this.name,
@@ -3740,13 +3616,13 @@
3740
3616
  formData: this.formStructure.getPayload(),
3741
3617
  immutableData: this.formStructure.immutableData,
3742
3618
  };
3743
- this.errorCode = '00';
3619
+ this.errorCode = NO_ERROR;
3744
3620
  this.errorMessage = '';
3745
3621
  this.errorDetail = '';
3746
3622
  this.inServerProcess = true;
3747
3623
  return [4 /*yield*/, this.formManagerService.execServerAction(actionDetail)];
3748
3624
  case 1:
3749
- formActionResponse = _g.sent();
3625
+ formActionResponse = _j.sent();
3750
3626
  this.inServerProcess = false;
3751
3627
  if (formActionResponse && formActionResponse.error.errorType) {
3752
3628
  console.log('Excepción no soportada');
@@ -3765,7 +3641,7 @@
3765
3641
  });
3766
3642
  };
3767
3643
  BasicFormComponent.prototype.updateFormWithServerData = function (formContent) {
3768
- var e_3, _g, e_4, _h, e_5, _j;
3644
+ var e_1, _j, e_2, _k, e_3, _l;
3769
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;
3770
3646
  this.changeState(currentMode !== null && currentMode !== void 0 ? currentMode : this.formStructure.state);
3771
3647
  if (formSubject) {
@@ -3781,12 +3657,12 @@
3781
3657
  }
3782
3658
  }
3783
3659
  }
3784
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
3660
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3785
3661
  finally {
3786
3662
  try {
3787
- 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);
3788
3664
  }
3789
- finally { if (e_3) throw e_3.error; }
3665
+ finally { if (e_1) throw e_1.error; }
3790
3666
  }
3791
3667
  }
3792
3668
  if (fields && fields.length > 0) {
@@ -3799,12 +3675,12 @@
3799
3675
  }
3800
3676
  }
3801
3677
  }
3802
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
3678
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
3803
3679
  finally {
3804
3680
  try {
3805
- 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);
3806
3682
  }
3807
- finally { if (e_4) throw e_4.error; }
3683
+ finally { if (e_2) throw e_2.error; }
3808
3684
  }
3809
3685
  }
3810
3686
  if (recordTables && recordTables.length > 0) {
@@ -3817,12 +3693,12 @@
3817
3693
  }
3818
3694
  }
3819
3695
  }
3820
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
3696
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
3821
3697
  finally {
3822
3698
  try {
3823
- 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);
3824
3700
  }
3825
- finally { if (e_5) throw e_5.error; }
3701
+ finally { if (e_3) throw e_3.error; }
3826
3702
  }
3827
3703
  }
3828
3704
  if (returnedFile && returnedFile.file) {
@@ -3877,8 +3753,8 @@
3877
3753
  BasicFormComponent.prototype.launchSectionActivation = function (sectionCode) {
3878
3754
  return __awaiter(this, void 0, void 0, function () {
3879
3755
  var sectionObject, clientSectionMethods, clientSectionMethods_1, clientSectionMethods_1_1, clientSectionMethod;
3880
- var e_6, _g;
3881
- return __generator(this, function (_h) {
3756
+ var e_4, _j;
3757
+ return __generator(this, function (_k) {
3882
3758
  sectionObject = this.formStructure.getSectionObject(sectionCode);
3883
3759
  if (!sectionObject) {
3884
3760
  return [2 /*return*/];
@@ -3891,12 +3767,12 @@
3891
3767
  clientSectionMethod(sectionObject);
3892
3768
  }
3893
3769
  }
3894
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
3770
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
3895
3771
  finally {
3896
3772
  try {
3897
- 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);
3898
3774
  }
3899
- finally { if (e_6) throw e_6.error; }
3775
+ finally { if (e_4) throw e_4.error; }
3900
3776
  }
3901
3777
  }
3902
3778
  return [2 /*return*/];
@@ -3906,8 +3782,8 @@
3906
3782
  BasicFormComponent.prototype.launchSectionInactivation = function (sectionCode) {
3907
3783
  return __awaiter(this, void 0, void 0, function () {
3908
3784
  var sectionObject, clientSectionMethods, clientSectionMethods_2, clientSectionMethods_2_1, clientSectionMethod;
3909
- var e_7, _g;
3910
- return __generator(this, function (_h) {
3785
+ var e_5, _j;
3786
+ return __generator(this, function (_k) {
3911
3787
  sectionObject = this.formStructure.getSectionObject(sectionCode);
3912
3788
  if (!sectionObject) {
3913
3789
  return [2 /*return*/];
@@ -3920,12 +3796,12 @@
3920
3796
  clientSectionMethod(sectionObject);
3921
3797
  }
3922
3798
  }
3923
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
3799
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
3924
3800
  finally {
3925
3801
  try {
3926
- 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);
3927
3803
  }
3928
- finally { if (e_7) throw e_7.error; }
3804
+ finally { if (e_5) throw e_5.error; }
3929
3805
  }
3930
3806
  }
3931
3807
  return [2 /*return*/];
@@ -3935,9 +3811,9 @@
3935
3811
  BasicFormComponent.prototype.startAction = function (actionCode) {
3936
3812
  return __awaiter(this, void 0, void 0, function () {
3937
3813
  var actionObject, clientActionMethods, clientActionPromises, clientActionMethods_1, clientActionMethods_1_1, clientActionMethod, continueActionPromise, clientActionResults, continueAction;
3938
- var e_8, _g;
3939
- return __generator(this, function (_h) {
3940
- switch (_h.label) {
3814
+ var e_6, _j;
3815
+ return __generator(this, function (_k) {
3816
+ switch (_k.label) {
3941
3817
  case 0:
3942
3818
  actionObject = this.getAction(actionCode);
3943
3819
  if (!actionObject) {
@@ -3955,22 +3831,22 @@
3955
3831
  clientActionPromises.push(continueActionPromise);
3956
3832
  }
3957
3833
  }
3958
- catch (e_8_1) { e_8 = { error: e_8_1 }; }
3834
+ catch (e_6_1) { e_6 = { error: e_6_1 }; }
3959
3835
  finally {
3960
3836
  try {
3961
- 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);
3962
3838
  }
3963
- finally { if (e_8) throw e_8.error; }
3839
+ finally { if (e_6) throw e_6.error; }
3964
3840
  }
3965
3841
  return [4 /*yield*/, Promise.all(clientActionPromises)];
3966
3842
  case 1:
3967
- clientActionResults = _h.sent();
3843
+ clientActionResults = _k.sent();
3968
3844
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
3969
3845
  if (!continueAction) {
3970
3846
  actionObject.stop();
3971
3847
  return [2 /*return*/];
3972
3848
  }
3973
- _h.label = 2;
3849
+ _k.label = 2;
3974
3850
  case 2:
3975
3851
  this.startServerAction(actionObject);
3976
3852
  return [2 /*return*/];
@@ -3981,8 +3857,8 @@
3981
3857
  BasicFormComponent.prototype.startServerAction = function (actionInput) {
3982
3858
  return __awaiter(this, void 0, void 0, function () {
3983
3859
  var action, finish, actionResult;
3984
- return __generator(this, function (_g) {
3985
- switch (_g.label) {
3860
+ return __generator(this, function (_j) {
3861
+ switch (_j.label) {
3986
3862
  case 0:
3987
3863
  action = (typeof actionInput === 'string')
3988
3864
  ? this.getAction(actionInput) : actionInput;
@@ -3991,19 +3867,19 @@
3991
3867
  if (!action.backend) return [3 /*break*/, 2];
3992
3868
  return [4 /*yield*/, this.requestFormAction(action.actionCode)];
3993
3869
  case 1:
3994
- actionResult = _g.sent();
3870
+ actionResult = _j.sent();
3995
3871
  finish = !this.errorOccured();
3996
- _g.label = 2;
3872
+ _j.label = 2;
3997
3873
  case 2:
3998
3874
  if (!finish) return [3 /*break*/, 4];
3999
3875
  return [4 /*yield*/, this.finishAction(action, actionResult)];
4000
3876
  case 3:
4001
- _g.sent();
3877
+ _j.sent();
4002
3878
  this.changeState(action.newState);
4003
3879
  return [3 /*break*/, 5];
4004
3880
  case 4:
4005
3881
  this.displayActionServerError();
4006
- _g.label = 5;
3882
+ _j.label = 5;
4007
3883
  case 5:
4008
3884
  action.stop();
4009
3885
  return [2 /*return*/];
@@ -4014,9 +3890,9 @@
4014
3890
  BasicFormComponent.prototype.finishAction = function (actionObject, actionResult) {
4015
3891
  return __awaiter(this, void 0, void 0, function () {
4016
3892
  var finishActionMethods, clientActionPromises, finishActionMethods_1, finishActionMethods_1_1, clientActionMethod;
4017
- var e_9, _g;
4018
- return __generator(this, function (_h) {
4019
- switch (_h.label) {
3893
+ var e_7, _j;
3894
+ return __generator(this, function (_k) {
3895
+ switch (_k.label) {
4020
3896
  case 0:
4021
3897
  finishActionMethods = this.formActionsFinish[actionObject.actionCode];
4022
3898
  if (!finishActionMethods) return [3 /*break*/, 2];
@@ -4027,17 +3903,17 @@
4027
3903
  clientActionPromises.push(clientActionMethod(actionObject, actionResult));
4028
3904
  }
4029
3905
  }
4030
- catch (e_9_1) { e_9 = { error: e_9_1 }; }
3906
+ catch (e_7_1) { e_7 = { error: e_7_1 }; }
4031
3907
  finally {
4032
3908
  try {
4033
- 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);
4034
3910
  }
4035
- finally { if (e_9) throw e_9.error; }
3911
+ finally { if (e_7) throw e_7.error; }
4036
3912
  }
4037
3913
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4038
3914
  case 1:
4039
- _h.sent();
4040
- _h.label = 2;
3915
+ _k.sent();
3916
+ _k.label = 2;
4041
3917
  case 2: return [2 /*return*/];
4042
3918
  }
4043
3919
  });
@@ -4083,16 +3959,15 @@
4083
3959
  if (intrinsicValidation === void 0) { intrinsicValidation = true; }
4084
3960
  return __awaiter(this, void 0, void 0, function () {
4085
3961
  var fieldToValidate, validationCallbacks, clientValidationPromises, validationCallbacks_1, validationCallbacks_1_1, validationMethod, continueValidationPromise;
4086
- var e_10, _g;
4087
- return __generator(this, function (_h) {
4088
- switch (_h.label) {
3962
+ var e_8, _j;
3963
+ return __generator(this, function (_k) {
3964
+ switch (_k.label) {
4089
3965
  case 0:
4090
3966
  fieldToValidate = this.getFieldObject(fieldCode);
4091
3967
  if (!fieldToValidate) {
4092
3968
  return [2 /*return*/, false];
4093
3969
  }
4094
- fieldToValidate.setErrorMessage('');
4095
- fieldToValidate.setErrorCode('00');
3970
+ fieldToValidate.resetError();
4096
3971
  validationCallbacks = this.fieldInputValidation[fieldCode];
4097
3972
  if (!validationCallbacks) return [3 /*break*/, 2];
4098
3973
  clientValidationPromises = [];
@@ -4103,17 +3978,17 @@
4103
3978
  clientValidationPromises.push(continueValidationPromise);
4104
3979
  }
4105
3980
  }
4106
- catch (e_10_1) { e_10 = { error: e_10_1 }; }
3981
+ catch (e_8_1) { e_8 = { error: e_8_1 }; }
4107
3982
  finally {
4108
3983
  try {
4109
- 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);
4110
3985
  }
4111
- finally { if (e_10) throw e_10.error; }
3986
+ finally { if (e_8) throw e_8.error; }
4112
3987
  }
4113
3988
  return [4 /*yield*/, Promise.all(clientValidationPromises)];
4114
3989
  case 1:
4115
- _h.sent();
4116
- _h.label = 2;
3990
+ _k.sent();
3991
+ _k.label = 2;
4117
3992
  case 2: return [2 /*return*/];
4118
3993
  }
4119
3994
  });
@@ -4123,16 +3998,15 @@
4123
3998
  if (intrinsicValidation === void 0) { intrinsicValidation = true; }
4124
3999
  return __awaiter(this, void 0, void 0, function () {
4125
4000
  var fieldToValidate, validationCallbacks, clientValidationPromises, validationCallbacks_2, validationCallbacks_2_1, validationMethod, clientValidationPromise, clientValidationResults, continueValidation;
4126
- var e_11, _g;
4127
- return __generator(this, function (_h) {
4128
- switch (_h.label) {
4001
+ var e_9, _j;
4002
+ return __generator(this, function (_k) {
4003
+ switch (_k.label) {
4129
4004
  case 0:
4130
4005
  fieldToValidate = this.getField(fieldCode);
4131
4006
  if (!fieldToValidate || !intrinsicValidation) {
4132
4007
  return [2 /*return*/];
4133
4008
  }
4134
- fieldToValidate.setErrorMessage('');
4135
- fieldToValidate.setErrorCode('00');
4009
+ fieldToValidate.resetError();
4136
4010
  validationCallbacks = this.fieldValidationsStart[fieldCode];
4137
4011
  if (!validationCallbacks) return [3 /*break*/, 2];
4138
4012
  clientValidationPromises = [];
@@ -4143,21 +4017,21 @@
4143
4017
  clientValidationPromises.push(clientValidationPromise);
4144
4018
  }
4145
4019
  }
4146
- catch (e_11_1) { e_11 = { error: e_11_1 }; }
4020
+ catch (e_9_1) { e_9 = { error: e_9_1 }; }
4147
4021
  finally {
4148
4022
  try {
4149
- 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);
4150
4024
  }
4151
- finally { if (e_11) throw e_11.error; }
4025
+ finally { if (e_9) throw e_9.error; }
4152
4026
  }
4153
4027
  return [4 /*yield*/, Promise.all(clientValidationPromises)];
4154
4028
  case 1:
4155
- clientValidationResults = _h.sent();
4029
+ clientValidationResults = _k.sent();
4156
4030
  continueValidation = clientValidationResults.reduce(function (total, curr) { return (total && curr); }, true);
4157
4031
  if (!continueValidation) {
4158
4032
  return [2 /*return*/];
4159
4033
  }
4160
- _h.label = 2;
4034
+ _k.label = 2;
4161
4035
  case 2:
4162
4036
  this.startServerFieldValidation(fieldToValidate);
4163
4037
  return [2 /*return*/];
@@ -4168,8 +4042,8 @@
4168
4042
  BasicFormComponent.prototype.startServerFieldValidation = function (inputField) {
4169
4043
  return __awaiter(this, void 0, void 0, function () {
4170
4044
  var fieldObj, finish, validationResult;
4171
- return __generator(this, function (_g) {
4172
- switch (_g.label) {
4045
+ return __generator(this, function (_j) {
4046
+ switch (_j.label) {
4173
4047
  case 0:
4174
4048
  fieldObj = (typeof inputField === 'string')
4175
4049
  ? this.getField(inputField) : inputField;
@@ -4178,22 +4052,22 @@
4178
4052
  if (!fieldObj.backend) return [3 /*break*/, 2];
4179
4053
  fieldObj.validating = true;
4180
4054
  return [4 /*yield*/, this
4181
- .requestFormAction(componentConstants.FORMACTION_VALIDATE, fieldObj.fieldCode)];
4055
+ .requestFormAction(formActions.validate, fieldObj.fieldCode)];
4182
4056
  case 1:
4183
- validationResult = _g.sent();
4057
+ validationResult = _j.sent();
4184
4058
  finish = !this.errorOccured();
4185
- _g.label = 2;
4059
+ _j.label = 2;
4186
4060
  case 2:
4187
4061
  if (!finish) return [3 /*break*/, 4];
4188
4062
  return [4 /*yield*/, this.finishFieldValidation(fieldObj, validationResult)];
4189
4063
  case 3:
4190
- _g.sent();
4064
+ _j.sent();
4191
4065
  return [3 /*break*/, 5];
4192
4066
  case 4:
4193
4067
  fieldObj.setErrorCode(this.errorCode);
4194
4068
  fieldObj.setErrorMessage(this.errorMessage);
4195
4069
  this.displayValidationServerError();
4196
- _g.label = 5;
4070
+ _j.label = 5;
4197
4071
  case 5:
4198
4072
  fieldObj.validating = false;
4199
4073
  return [2 /*return*/];
@@ -4204,9 +4078,9 @@
4204
4078
  BasicFormComponent.prototype.finishFieldValidation = function (fieldObject, validationResult) {
4205
4079
  return __awaiter(this, void 0, void 0, function () {
4206
4080
  var validationCallbacks, clientActionPromises, validationCallbacks_3, validationCallbacks_3_1, validationMethod;
4207
- var e_12, _g;
4208
- return __generator(this, function (_h) {
4209
- switch (_h.label) {
4081
+ var e_10, _j;
4082
+ return __generator(this, function (_k) {
4083
+ switch (_k.label) {
4210
4084
  case 0:
4211
4085
  validationCallbacks = this.fieldValidationsFinish[fieldObject.fieldCode];
4212
4086
  if (!validationCallbacks) return [3 /*break*/, 2];
@@ -4217,17 +4091,17 @@
4217
4091
  clientActionPromises.push(validationMethod(fieldObject, validationResult));
4218
4092
  }
4219
4093
  }
4220
- catch (e_12_1) { e_12 = { error: e_12_1 }; }
4094
+ catch (e_10_1) { e_10 = { error: e_10_1 }; }
4221
4095
  finally {
4222
4096
  try {
4223
- 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);
4224
4098
  }
4225
- finally { if (e_12) throw e_12.error; }
4099
+ finally { if (e_10) throw e_10.error; }
4226
4100
  }
4227
4101
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4228
4102
  case 1:
4229
- _h.sent();
4230
- _h.label = 2;
4103
+ _k.sent();
4104
+ _k.label = 2;
4231
4105
  case 2: return [2 /*return*/];
4232
4106
  }
4233
4107
  });
@@ -4235,7 +4109,7 @@
4235
4109
  };
4236
4110
  BasicFormComponent.prototype.continueFieldValidation = function (fieldCode) {
4237
4111
  return __awaiter(this, void 0, void 0, function () {
4238
- return __generator(this, function (_g) {
4112
+ return __generator(this, function (_j) {
4239
4113
  return [2 /*return*/, this.startServerFieldValidation(fieldCode)];
4240
4114
  });
4241
4115
  });
@@ -4350,9 +4224,9 @@
4350
4224
  BasicFormComponent.prototype.startTableGlobalAction = function (tableActionEvent) {
4351
4225
  return __awaiter(this, void 0, void 0, function () {
4352
4226
  var tableCode, actionCode, tableObject, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_1, tableActionMethods_1_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
4353
- var e_13, _g;
4354
- return __generator(this, function (_h) {
4355
- switch (_h.label) {
4227
+ var e_11, _j;
4228
+ return __generator(this, function (_k) {
4229
+ switch (_k.label) {
4356
4230
  case 0:
4357
4231
  tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode;
4358
4232
  tableObject = this.getTable(tableCode);
@@ -4381,21 +4255,21 @@
4381
4255
  clientActionPromises.push(clientActionPromise);
4382
4256
  }
4383
4257
  }
4384
- catch (e_13_1) { e_13 = { error: e_13_1 }; }
4258
+ catch (e_11_1) { e_11 = { error: e_11_1 }; }
4385
4259
  finally {
4386
4260
  try {
4387
- 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);
4388
4262
  }
4389
- finally { if (e_13) throw e_13.error; }
4263
+ finally { if (e_11) throw e_11.error; }
4390
4264
  }
4391
4265
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4392
4266
  case 1:
4393
- clientActionResults = _h.sent();
4267
+ clientActionResults = _k.sent();
4394
4268
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4395
4269
  if (!continueAction) {
4396
4270
  return [2 /*return*/];
4397
4271
  }
4398
- _h.label = 2;
4272
+ _k.label = 2;
4399
4273
  case 2:
4400
4274
  this.startTableServerGlobalAction(tableActionDetail);
4401
4275
  return [2 /*return*/];
@@ -4406,8 +4280,8 @@
4406
4280
  BasicFormComponent.prototype.startTableServerGlobalAction = function (tableActionDetail) {
4407
4281
  return __awaiter(this, void 0, void 0, function () {
4408
4282
  var tableObject, action, tableCode, actionCode, finish, actionResult, actionSubject;
4409
- return __generator(this, function (_g) {
4410
- switch (_g.label) {
4283
+ return __generator(this, function (_j) {
4284
+ switch (_j.label) {
4411
4285
  case 0:
4412
4286
  tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
4413
4287
  if (!tableObject || !action) {
@@ -4423,21 +4297,21 @@
4423
4297
  actionCode: actionCode
4424
4298
  };
4425
4299
  return [4 /*yield*/, this
4426
- .requestFormAction(componentConstants.FORMACTION_TABLEACTION, actionSubject)];
4300
+ .requestFormAction(formActions.tableAction, actionSubject)];
4427
4301
  case 1:
4428
- actionResult = _g.sent();
4302
+ actionResult = _j.sent();
4429
4303
  finish = !this.errorOccured();
4430
- _g.label = 2;
4304
+ _j.label = 2;
4431
4305
  case 2:
4432
4306
  if (!finish) return [3 /*break*/, 4];
4433
4307
  return [4 /*yield*/, this.finishTableGlobalAction(tableActionDetail, actionResult)];
4434
4308
  case 3:
4435
- _g.sent();
4309
+ _j.sent();
4436
4310
  this.changeState(action.newState);
4437
4311
  return [3 /*break*/, 5];
4438
4312
  case 4:
4439
4313
  this.displayTableServerError();
4440
- _g.label = 5;
4314
+ _j.label = 5;
4441
4315
  case 5:
4442
4316
  tableObject.freeWaiting();
4443
4317
  return [2 /*return*/];
@@ -4448,9 +4322,9 @@
4448
4322
  BasicFormComponent.prototype.finishTableGlobalAction = function (tableActionDetail, actionResult) {
4449
4323
  return __awaiter(this, void 0, void 0, function () {
4450
4324
  var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_2, tableActionMethods_2_1, tableActionMethod;
4451
- var e_14, _g;
4452
- return __generator(this, function (_h) {
4453
- switch (_h.label) {
4325
+ var e_12, _j;
4326
+ return __generator(this, function (_k) {
4327
+ switch (_k.label) {
4454
4328
  case 0:
4455
4329
  tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
4456
4330
  tableEventHandlers = this.tableActionsFinish[tableCode];
@@ -4463,17 +4337,17 @@
4463
4337
  clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
4464
4338
  }
4465
4339
  }
4466
- catch (e_14_1) { e_14 = { error: e_14_1 }; }
4340
+ catch (e_12_1) { e_12 = { error: e_12_1 }; }
4467
4341
  finally {
4468
4342
  try {
4469
- 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);
4470
4344
  }
4471
- finally { if (e_14) throw e_14.error; }
4345
+ finally { if (e_12) throw e_12.error; }
4472
4346
  }
4473
4347
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4474
4348
  case 1:
4475
- _h.sent();
4476
- _h.label = 2;
4349
+ _k.sent();
4350
+ _k.label = 2;
4477
4351
  case 2: return [2 /*return*/];
4478
4352
  }
4479
4353
  });
@@ -4482,9 +4356,9 @@
4482
4356
  BasicFormComponent.prototype.startTableAction = function (tableActionEvent) {
4483
4357
  return __awaiter(this, void 0, void 0, function () {
4484
4358
  var tableCode, actionCode, actionDetail, tableObject, recordId, recordData, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_3, tableActionMethods_3_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
4485
- var e_15, _g;
4486
- return __generator(this, function (_h) {
4487
- switch (_h.label) {
4359
+ var e_13, _j;
4360
+ return __generator(this, function (_k) {
4361
+ switch (_k.label) {
4488
4362
  case 0:
4489
4363
  tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode, actionDetail = tableActionEvent.actionDetail;
4490
4364
  tableObject = this.getTable(tableCode);
@@ -4516,21 +4390,21 @@
4516
4390
  clientActionPromises.push(clientActionPromise);
4517
4391
  }
4518
4392
  }
4519
- catch (e_15_1) { e_15 = { error: e_15_1 }; }
4393
+ catch (e_13_1) { e_13 = { error: e_13_1 }; }
4520
4394
  finally {
4521
4395
  try {
4522
- 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);
4523
4397
  }
4524
- finally { if (e_15) throw e_15.error; }
4398
+ finally { if (e_13) throw e_13.error; }
4525
4399
  }
4526
4400
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4527
4401
  case 1:
4528
- clientActionResults = _h.sent();
4402
+ clientActionResults = _k.sent();
4529
4403
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4530
4404
  if (!continueAction) {
4531
4405
  return [2 /*return*/];
4532
4406
  }
4533
- _h.label = 2;
4407
+ _k.label = 2;
4534
4408
  case 2:
4535
4409
  this.startTableServerAction(tableActionDetail);
4536
4410
  return [2 /*return*/];
@@ -4541,8 +4415,8 @@
4541
4415
  BasicFormComponent.prototype.startTableServerAction = function (tableActionDetail) {
4542
4416
  return __awaiter(this, void 0, void 0, function () {
4543
4417
  var tableObject, action, tableCode, actionCode, recordId, recordData, finish, actionResult, actionSubject;
4544
- return __generator(this, function (_g) {
4545
- switch (_g.label) {
4418
+ return __generator(this, function (_j) {
4419
+ switch (_j.label) {
4546
4420
  case 0:
4547
4421
  tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode, recordId = tableActionDetail.recordId, recordData = tableActionDetail.recordData;
4548
4422
  if (!tableObject || !action) {
@@ -4554,17 +4428,17 @@
4554
4428
  if (!action.backend) return [3 /*break*/, 2];
4555
4429
  actionSubject = {
4556
4430
  tableCode: tableCode,
4557
- actionType: componentConstants.FORMTABLEACTION_INLINE,
4431
+ actionType: this.formConfig.tableActions.inline,
4558
4432
  actionCode: actionCode,
4559
4433
  tableRecordId: recordId,
4560
4434
  tableRecordData: recordData
4561
4435
  };
4562
4436
  return [4 /*yield*/, this
4563
- .requestFormAction(componentConstants.FORMACTION_TABLEACTION, actionSubject)];
4437
+ .requestFormAction(formActions.tableAction, actionSubject)];
4564
4438
  case 1:
4565
- actionResult = _g.sent();
4439
+ actionResult = _j.sent();
4566
4440
  finish = !this.errorOccured();
4567
- _g.label = 2;
4441
+ _j.label = 2;
4568
4442
  case 2:
4569
4443
  if (finish) {
4570
4444
  this.finishTableAction(tableActionDetail, actionResult);
@@ -4585,9 +4459,9 @@
4585
4459
  BasicFormComponent.prototype.finishTableAction = function (tableActionDetail, actionResult) {
4586
4460
  return __awaiter(this, void 0, void 0, function () {
4587
4461
  var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_4, tableActionMethods_4_1, tableActionMethod;
4588
- var e_16, _g;
4589
- return __generator(this, function (_h) {
4590
- switch (_h.label) {
4462
+ var e_14, _j;
4463
+ return __generator(this, function (_k) {
4464
+ switch (_k.label) {
4591
4465
  case 0:
4592
4466
  tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
4593
4467
  tableEventHandlers = this.tableActionsFinish[tableCode];
@@ -4600,17 +4474,17 @@
4600
4474
  clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
4601
4475
  }
4602
4476
  }
4603
- catch (e_16_1) { e_16 = { error: e_16_1 }; }
4477
+ catch (e_14_1) { e_14 = { error: e_14_1 }; }
4604
4478
  finally {
4605
4479
  try {
4606
- 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);
4607
4481
  }
4608
- finally { if (e_16) throw e_16.error; }
4482
+ finally { if (e_14) throw e_14.error; }
4609
4483
  }
4610
4484
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4611
4485
  case 1:
4612
- _h.sent();
4613
- _h.label = 2;
4486
+ _k.sent();
4487
+ _k.label = 2;
4614
4488
  case 2: return [2 /*return*/];
4615
4489
  }
4616
4490
  });
@@ -4619,9 +4493,9 @@
4619
4493
  BasicFormComponent.prototype.startTableRecordSelection = function (tableActionEvent) {
4620
4494
  return __awaiter(this, void 0, void 0, function () {
4621
4495
  var tableCode, actionDetail, tableObject, recordId, recordData, tableSelectionDetail, tableEventHandlers, clientActionPromises, tableEventHandlers_1, tableEventHandlers_1_1, tableSelectionMethod, clientActionPromise, clientActionResults, continueAction;
4622
- var e_17, _g;
4623
- return __generator(this, function (_h) {
4624
- switch (_h.label) {
4496
+ var e_15, _j;
4497
+ return __generator(this, function (_k) {
4498
+ switch (_k.label) {
4625
4499
  case 0:
4626
4500
  tableCode = tableActionEvent.tableCode, actionDetail = tableActionEvent.actionDetail;
4627
4501
  tableObject = this.getTable(tableCode);
@@ -4646,21 +4520,21 @@
4646
4520
  clientActionPromises.push(clientActionPromise);
4647
4521
  }
4648
4522
  }
4649
- catch (e_17_1) { e_17 = { error: e_17_1 }; }
4523
+ catch (e_15_1) { e_15 = { error: e_15_1 }; }
4650
4524
  finally {
4651
4525
  try {
4652
- 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);
4653
4527
  }
4654
- finally { if (e_17) throw e_17.error; }
4528
+ finally { if (e_15) throw e_15.error; }
4655
4529
  }
4656
4530
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4657
4531
  case 1:
4658
- clientActionResults = _h.sent();
4532
+ clientActionResults = _k.sent();
4659
4533
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4660
4534
  if (!continueAction) {
4661
4535
  return [2 /*return*/];
4662
4536
  }
4663
- _h.label = 2;
4537
+ _k.label = 2;
4664
4538
  case 2:
4665
4539
  this.startTableServerRecordSelection(tableSelectionDetail);
4666
4540
  return [2 /*return*/];
@@ -4671,8 +4545,8 @@
4671
4545
  BasicFormComponent.prototype.startTableServerRecordSelection = function (tableSelectionDetail) {
4672
4546
  return __awaiter(this, void 0, void 0, function () {
4673
4547
  var tableObject, tableCode, recordId, recordData, finish, actionResult, actionSubject;
4674
- return __generator(this, function (_g) {
4675
- switch (_g.label) {
4548
+ return __generator(this, function (_j) {
4549
+ switch (_j.label) {
4676
4550
  case 0:
4677
4551
  tableObject = tableSelectionDetail.tableObject, tableCode = tableSelectionDetail.tableCode, recordId = tableSelectionDetail.recordId, recordData = tableSelectionDetail.recordData;
4678
4552
  if (!tableObject) {
@@ -4684,17 +4558,17 @@
4684
4558
  if (!tableObject.selectionBackend) return [3 /*break*/, 2];
4685
4559
  actionSubject = {
4686
4560
  tableCode: tableCode,
4687
- actionType: componentConstants.FORMTABLEACTION_ROWSELECTION,
4561
+ actionType: this.formConfig.tableActions.rowSelection,
4688
4562
  actionCode: null,
4689
4563
  tableRecordId: recordId,
4690
4564
  tableRecordData: recordData
4691
4565
  };
4692
4566
  return [4 /*yield*/, this
4693
- .requestFormAction(componentConstants.FORMACTION_TABLEACTION, actionSubject)];
4567
+ .requestFormAction(formActions.tableAction, actionSubject)];
4694
4568
  case 1:
4695
- actionResult = _g.sent();
4569
+ actionResult = _j.sent();
4696
4570
  finish = !this.errorOccured();
4697
- _g.label = 2;
4571
+ _j.label = 2;
4698
4572
  case 2:
4699
4573
  if (finish) {
4700
4574
  this.finishTableRecordSelection(tableSelectionDetail, actionResult);
@@ -4711,9 +4585,9 @@
4711
4585
  BasicFormComponent.prototype.finishTableRecordSelection = function (tableSelectionDetail, actionResult) {
4712
4586
  return __awaiter(this, void 0, void 0, function () {
4713
4587
  var tableCode, tableEventHandlers, clientActionPromises, tableEventHandlers_2, tableEventHandlers_2_1, tableSelectionMethod;
4714
- var e_18, _g;
4715
- return __generator(this, function (_h) {
4716
- switch (_h.label) {
4588
+ var e_16, _j;
4589
+ return __generator(this, function (_k) {
4590
+ switch (_k.label) {
4717
4591
  case 0:
4718
4592
  tableCode = tableSelectionDetail.tableCode;
4719
4593
  tableEventHandlers = this.tableSelectionsFinish[tableCode];
@@ -4725,17 +4599,17 @@
4725
4599
  clientActionPromises.push(tableSelectionMethod(tableSelectionDetail, actionResult));
4726
4600
  }
4727
4601
  }
4728
- catch (e_18_1) { e_18 = { error: e_18_1 }; }
4602
+ catch (e_16_1) { e_16 = { error: e_16_1 }; }
4729
4603
  finally {
4730
4604
  try {
4731
- 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);
4732
4606
  }
4733
- finally { if (e_18) throw e_18.error; }
4607
+ finally { if (e_16) throw e_16.error; }
4734
4608
  }
4735
4609
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4736
4610
  case 1:
4737
- _h.sent();
4738
- _h.label = 2;
4611
+ _k.sent();
4612
+ _k.label = 2;
4739
4613
  case 2: return [2 /*return*/];
4740
4614
  }
4741
4615
  });
@@ -4744,9 +4618,9 @@
4744
4618
  BasicFormComponent.prototype.startTableSelectionAction = function (tableActionEvent) {
4745
4619
  return __awaiter(this, void 0, void 0, function () {
4746
4620
  var tableCode, actionCode, actionDetail, tableObject, selectedRecords, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_5, tableActionMethods_5_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
4747
- var e_19, _g;
4748
- return __generator(this, function (_h) {
4749
- switch (_h.label) {
4621
+ var e_17, _j;
4622
+ return __generator(this, function (_k) {
4623
+ switch (_k.label) {
4750
4624
  case 0:
4751
4625
  tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode, actionDetail = tableActionEvent.actionDetail;
4752
4626
  tableObject = this.getTable(tableCode);
@@ -4777,21 +4651,21 @@
4777
4651
  clientActionPromises.push(clientActionPromise);
4778
4652
  }
4779
4653
  }
4780
- catch (e_19_1) { e_19 = { error: e_19_1 }; }
4654
+ catch (e_17_1) { e_17 = { error: e_17_1 }; }
4781
4655
  finally {
4782
4656
  try {
4783
- 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);
4784
4658
  }
4785
- finally { if (e_19) throw e_19.error; }
4659
+ finally { if (e_17) throw e_17.error; }
4786
4660
  }
4787
4661
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4788
4662
  case 1:
4789
- clientActionResults = _h.sent();
4663
+ clientActionResults = _k.sent();
4790
4664
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4791
4665
  if (!continueAction) {
4792
4666
  return [2 /*return*/];
4793
4667
  }
4794
- _h.label = 2;
4668
+ _k.label = 2;
4795
4669
  case 2:
4796
4670
  this.startTableServerSelectionAction(tableActionDetail);
4797
4671
  return [2 /*return*/];
@@ -4802,8 +4676,8 @@
4802
4676
  BasicFormComponent.prototype.startTableServerSelectionAction = function (tableActionDetail) {
4803
4677
  return __awaiter(this, void 0, void 0, function () {
4804
4678
  var tableObject, action, tableCode, actionCode, selectedRecords, finish, actionResult, actionSubject;
4805
- return __generator(this, function (_g) {
4806
- switch (_g.label) {
4679
+ return __generator(this, function (_j) {
4680
+ switch (_j.label) {
4807
4681
  case 0:
4808
4682
  tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode, selectedRecords = tableActionDetail.selectedRecords;
4809
4683
  if (!tableObject || !action) {
@@ -4815,16 +4689,16 @@
4815
4689
  if (!action.backend) return [3 /*break*/, 2];
4816
4690
  actionSubject = {
4817
4691
  tableCode: tableCode,
4818
- actionType: componentConstants.FORMTABLEACTION_SELECTION,
4692
+ actionType: this.formConfig.tableActions.selection,
4819
4693
  actionCode: actionCode,
4820
4694
  selectedRecords: selectedRecords
4821
4695
  };
4822
4696
  return [4 /*yield*/, this
4823
- .requestFormAction(componentConstants.FORMACTION_TABLEACTION, actionSubject)];
4697
+ .requestFormAction(formActions.tableAction, actionSubject)];
4824
4698
  case 1:
4825
- actionResult = _g.sent();
4699
+ actionResult = _j.sent();
4826
4700
  finish = !this.errorOccured();
4827
- _g.label = 2;
4701
+ _j.label = 2;
4828
4702
  case 2:
4829
4703
  if (finish) {
4830
4704
  this.finishTableSelectionAction(tableActionDetail, actionResult);
@@ -4842,9 +4716,9 @@
4842
4716
  BasicFormComponent.prototype.finishTableSelectionAction = function (tableActionDetail, actionResult) {
4843
4717
  return __awaiter(this, void 0, void 0, function () {
4844
4718
  var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_6, tableActionMethods_6_1, tableActionMethod;
4845
- var e_20, _g;
4846
- return __generator(this, function (_h) {
4847
- switch (_h.label) {
4719
+ var e_18, _j;
4720
+ return __generator(this, function (_k) {
4721
+ switch (_k.label) {
4848
4722
  case 0:
4849
4723
  tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
4850
4724
  tableEventHandlers = this.tableActionsFinish[tableCode];
@@ -4857,17 +4731,17 @@
4857
4731
  clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
4858
4732
  }
4859
4733
  }
4860
- catch (e_20_1) { e_20 = { error: e_20_1 }; }
4734
+ catch (e_18_1) { e_18 = { error: e_18_1 }; }
4861
4735
  finally {
4862
4736
  try {
4863
- 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);
4864
4738
  }
4865
- finally { if (e_20) throw e_20.error; }
4739
+ finally { if (e_18) throw e_18.error; }
4866
4740
  }
4867
4741
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4868
4742
  case 1:
4869
- _h.sent();
4870
- _h.label = 2;
4743
+ _k.sent();
4744
+ _k.label = 2;
4871
4745
  case 2: return [2 /*return*/];
4872
4746
  }
4873
4747
  });
@@ -4876,9 +4750,9 @@
4876
4750
  BasicFormComponent.prototype.startTableGetData = function (tableActionEvent) {
4877
4751
  return __awaiter(this, void 0, void 0, function () {
4878
4752
  var tableCode, tableObject, tableActionDetail, tableEventHandlers, clientActionPromises, tableEventHandlers_3, tableEventHandlers_3_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
4879
- var e_21, _g;
4880
- return __generator(this, function (_h) {
4881
- switch (_h.label) {
4753
+ var e_19, _j;
4754
+ return __generator(this, function (_k) {
4755
+ switch (_k.label) {
4882
4756
  case 0:
4883
4757
  tableCode = tableActionEvent.tableCode;
4884
4758
  tableObject = this.getTable(tableCode);
@@ -4897,21 +4771,21 @@
4897
4771
  clientActionPromises.push(clientActionPromise);
4898
4772
  }
4899
4773
  }
4900
- catch (e_21_1) { e_21 = { error: e_21_1 }; }
4774
+ catch (e_19_1) { e_19 = { error: e_19_1 }; }
4901
4775
  finally {
4902
4776
  try {
4903
- 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);
4904
4778
  }
4905
- finally { if (e_21) throw e_21.error; }
4779
+ finally { if (e_19) throw e_19.error; }
4906
4780
  }
4907
4781
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4908
4782
  case 1:
4909
- clientActionResults = _h.sent();
4783
+ clientActionResults = _k.sent();
4910
4784
  continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
4911
4785
  if (!continueAction) {
4912
4786
  return [2 /*return*/];
4913
4787
  }
4914
- _h.label = 2;
4788
+ _k.label = 2;
4915
4789
  case 2:
4916
4790
  this.startTableServerGetData(tableActionDetail);
4917
4791
  return [2 /*return*/];
@@ -4922,16 +4796,16 @@
4922
4796
  BasicFormComponent.prototype.startTableServerGetData = function (tableActionDetail) {
4923
4797
  return __awaiter(this, void 0, void 0, function () {
4924
4798
  var tableObject, tableCode, actionSubject, actionResult;
4925
- return __generator(this, function (_g) {
4926
- switch (_g.label) {
4799
+ return __generator(this, function (_j) {
4800
+ switch (_j.label) {
4927
4801
  case 0:
4928
4802
  tableObject = tableActionDetail.tableObject, tableCode = tableActionDetail.tableCode;
4929
4803
  tableObject.putOnWait();
4930
4804
  actionSubject = { tableCode: tableCode };
4931
4805
  return [4 /*yield*/, this
4932
- .requestFormAction(componentConstants.FORMACTION_GETTABLEDATA, actionSubject)];
4806
+ .requestFormAction(formActions.getTableData, actionSubject)];
4933
4807
  case 1:
4934
- actionResult = _g.sent();
4808
+ actionResult = _j.sent();
4935
4809
  if (this.errorOccured()) {
4936
4810
  this.displayTableServerError();
4937
4811
  }
@@ -4947,9 +4821,9 @@
4947
4821
  BasicFormComponent.prototype.finishTableGetData = function (tableActionDetail, actionResult) {
4948
4822
  return __awaiter(this, void 0, void 0, function () {
4949
4823
  var tableCode, tableActionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_7, tableActionMethods_7_1, tableActionMethod;
4950
- var e_22, _g;
4951
- return __generator(this, function (_h) {
4952
- switch (_h.label) {
4824
+ var e_20, _j;
4825
+ return __generator(this, function (_k) {
4826
+ switch (_k.label) {
4953
4827
  case 0:
4954
4828
  tableCode = tableActionDetail.tableCode, tableActionCode = tableActionDetail.tableActionCode;
4955
4829
  tableEventHandlers = this.tableActionsFinish[tableCode];
@@ -4962,17 +4836,17 @@
4962
4836
  clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
4963
4837
  }
4964
4838
  }
4965
- catch (e_22_1) { e_22 = { error: e_22_1 }; }
4839
+ catch (e_20_1) { e_20 = { error: e_20_1 }; }
4966
4840
  finally {
4967
4841
  try {
4968
- 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);
4969
4843
  }
4970
- finally { if (e_22) throw e_22.error; }
4844
+ finally { if (e_20) throw e_20.error; }
4971
4845
  }
4972
4846
  return [4 /*yield*/, Promise.all(clientActionPromises)];
4973
4847
  case 1:
4974
- _h.sent();
4975
- _h.label = 2;
4848
+ _k.sent();
4849
+ _k.label = 2;
4976
4850
  case 2: return [2 /*return*/];
4977
4851
  }
4978
4852
  });
@@ -4980,24 +4854,24 @@
4980
4854
  };
4981
4855
  BasicFormComponent.prototype.checkSectionRequiredFields = function (sectionCode, reqFieldMessage) {
4982
4856
  this.cleanErrorFields(null, sectionCode);
4983
- var requiredFieldMessage = reqFieldMessage || REQUIRED_FIELD_MESSAGE;
4857
+ var requiredFieldMessage = reqFieldMessage !== null && reqFieldMessage !== void 0 ? reqFieldMessage : this.formConfig.formStandardErrors.requiredField;
4984
4858
  var numErrors = this.tagFieldsWithError(this.getRequiredEmptyFields(null, sectionCode), null, requiredFieldMessage);
4985
4859
  return (numErrors === 0);
4986
4860
  };
4987
4861
  BasicFormComponent.prototype.validateSectionConsistency = function (sectionCode, reqFieldMessage) {
4988
- var e_23, _g, e_24, _h;
4862
+ var e_21, _j, e_22, _k;
4989
4863
  this.resetError();
4990
4864
  var completeFields = this.checkSectionRequiredFields(sectionCode, reqFieldMessage);
4991
4865
  if (!completeFields) {
4992
- this.setError(componentConstants.FORMERROR_TYPE_WARNING, componentConstants.FORMERROR_VALIDATION_TITLE, componentConstants.FORMERROR_REQUIRED_FIELDS);
4866
+ this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.requiredFields);
4993
4867
  return;
4994
4868
  }
4995
4869
  var validationError = false;
4996
4870
  var requiredEmptyFields = this.getRequiredEmptyFields(null, sectionCode);
4997
4871
  if (requiredEmptyFields.length > 0) {
4998
4872
  validationError = true;
4999
- this.setError(componentConstants.FORMERROR_TYPE_WARNING, componentConstants.FORMERROR_VALIDATION_TITLE, componentConstants.FORMERROR_REQUIRED_FIELDS);
5000
- this.tagFieldsWithError(requiredEmptyFields, null, componentConstants.FIELD_REQUIRED_MESSAGE);
4873
+ this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.requiredFields);
4874
+ this.tagFieldsWithError(requiredEmptyFields, null, this.formConfig.formStandardErrors.requiredField);
5001
4875
  try {
5002
4876
  for (var requiredEmptyFields_1 = __values(requiredEmptyFields), requiredEmptyFields_1_1 = requiredEmptyFields_1.next(); !requiredEmptyFields_1_1.done; requiredEmptyFields_1_1 = requiredEmptyFields_1.next()) {
5003
4877
  var fieldCode = requiredEmptyFields_1_1.value;
@@ -5009,18 +4883,18 @@
5009
4883
  }
5010
4884
  }
5011
4885
  }
5012
- catch (e_23_1) { e_23 = { error: e_23_1 }; }
4886
+ catch (e_21_1) { e_21 = { error: e_21_1 }; }
5013
4887
  finally {
5014
4888
  try {
5015
- 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);
5016
4890
  }
5017
- finally { if (e_23) throw e_23.error; }
4891
+ finally { if (e_21) throw e_21.error; }
5018
4892
  }
5019
4893
  }
5020
4894
  var validationIssueFields = this.getFieldsWithValidationIssues(null, sectionCode);
5021
4895
  if (!validationError && validationIssueFields.length > 0) {
5022
4896
  validationError = true;
5023
- this.setError(componentConstants.FORMERROR_TYPE_WARNING, componentConstants.FORMERROR_VALIDATION_TITLE, componentConstants.FORMERROR_VALIDATION_FIELDS);
4897
+ this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.validationFields);
5024
4898
  try {
5025
4899
  for (var validationIssueFields_1 = __values(validationIssueFields), validationIssueFields_1_1 = validationIssueFields_1.next(); !validationIssueFields_1_1.done; validationIssueFields_1_1 = validationIssueFields_1.next()) {
5026
4900
  var fieldCode = validationIssueFields_1_1.value;
@@ -5032,18 +4906,18 @@
5032
4906
  }
5033
4907
  }
5034
4908
  }
5035
- catch (e_24_1) { e_24 = { error: e_24_1 }; }
4909
+ catch (e_22_1) { e_22 = { error: e_22_1 }; }
5036
4910
  finally {
5037
4911
  try {
5038
- 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);
5039
4913
  }
5040
- finally { if (e_24) throw e_24.error; }
4914
+ finally { if (e_22) throw e_22.error; }
5041
4915
  }
5042
4916
  }
5043
4917
  return validationError;
5044
4918
  };
5045
4919
  BasicFormComponent.prototype.copyTableRecordToFields = function (tableObj, mappingTable) {
5046
- var e_25, _g;
4920
+ var e_23, _j;
5047
4921
  if (mappingTable === void 0) { mappingTable = null; }
5048
4922
  var _a, _b;
5049
4923
  var tableObject = this.getTable(tableObj.tableCode);
@@ -5057,12 +4931,12 @@
5057
4931
  this.setFieldValue(fieldCode, columnValue);
5058
4932
  }
5059
4933
  }
5060
- catch (e_25_1) { e_25 = { error: e_25_1 }; }
4934
+ catch (e_23_1) { e_23 = { error: e_23_1 }; }
5061
4935
  finally {
5062
4936
  try {
5063
- 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);
5064
4938
  }
5065
- finally { if (e_25) throw e_25.error; }
4939
+ finally { if (e_23) throw e_23.error; }
5066
4940
  }
5067
4941
  return true;
5068
4942
  };
@@ -5070,7 +4944,7 @@
5070
4944
  * Soporte registros en tablas que se editan en campos del formulario
5071
4945
  */
5072
4946
  BasicFormComponent.prototype.defineEditionTable = function (tableEditionDef) {
5073
- var e_26, _g;
4947
+ var e_24, _j;
5074
4948
  var _this = this;
5075
4949
  var columnFieldMapping = tableEditionDef.columnFieldMapping, recordCaptureFields = tableEditionDef.recordCaptureFields, startCollapsed = tableEditionDef.startCollapsed;
5076
4950
  tableEditionDef.startCollapsed = (typeof startCollapsed !== 'undefined')
@@ -5080,17 +4954,17 @@
5080
4954
  try {
5081
4955
  for (var columnFieldMapping_1 = __values(columnFieldMapping), columnFieldMapping_1_1 = columnFieldMapping_1.next(); !columnFieldMapping_1_1.done; columnFieldMapping_1_1 = columnFieldMapping_1.next()) {
5082
4956
  var columnMap = columnFieldMapping_1_1.value;
5083
- var _h = __read(columnMap, 2), columnName = _h[0], formField = _h[1];
4957
+ var _k = __read(columnMap, 2), columnName = _k[0], formField = _k[1];
5084
4958
  fieldsMappingTable[columnName] = formField;
5085
4959
  fieldsToClear.push(formField);
5086
4960
  }
5087
4961
  }
5088
- catch (e_26_1) { e_26 = { error: e_26_1 }; }
4962
+ catch (e_24_1) { e_24 = { error: e_24_1 }; }
5089
4963
  finally {
5090
4964
  try {
5091
- 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);
5092
4966
  }
5093
- finally { if (e_26) throw e_26.error; }
4967
+ finally { if (e_24) throw e_24.error; }
5094
4968
  }
5095
4969
  tableEditionDef.fieldsMappingTable = fieldsMappingTable;
5096
4970
  tableEditionDef.fieldsToClear = fieldsToClear;
@@ -5141,7 +5015,7 @@
5141
5015
  }
5142
5016
  };
5143
5017
  BasicFormComponent.prototype.enableRecordEdition = function (tableEditionDef, tableActionObject) {
5144
- var e_27, _g;
5018
+ var e_25, _j;
5145
5019
  if (tableActionObject === void 0) { tableActionObject = null; }
5146
5020
  if (tableActionObject) {
5147
5021
  this.copyTableRecordToFields(tableActionObject, tableEditionDef.fieldsMappingTable);
@@ -5153,17 +5027,17 @@
5153
5027
  if (tableEditionDef.fieldsToTriggerValidation
5154
5028
  && tableEditionDef.fieldsToTriggerValidation.length > 0) {
5155
5029
  try {
5156
- for (var _h = __values(tableEditionDef.fieldsToTriggerValidation), _j = _h.next(); !_j.done; _j = _h.next()) {
5157
- var fieldName = _j.value;
5030
+ for (var _k = __values(tableEditionDef.fieldsToTriggerValidation), _l = _k.next(); !_l.done; _l = _k.next()) {
5031
+ var fieldName = _l.value;
5158
5032
  this.startFieldValidation(fieldName);
5159
5033
  }
5160
5034
  }
5161
- catch (e_27_1) { e_27 = { error: e_27_1 }; }
5035
+ catch (e_25_1) { e_25 = { error: e_25_1 }; }
5162
5036
  finally {
5163
5037
  try {
5164
- if (_j && !_j.done && (_g = _h.return)) _g.call(_h);
5038
+ if (_l && !_l.done && (_j = _k.return)) _j.call(_k);
5165
5039
  }
5166
- finally { if (e_27) throw e_27.error; }
5040
+ finally { if (e_25) throw e_25.error; }
5167
5041
  }
5168
5042
  }
5169
5043
  return true;
@@ -5182,13 +5056,13 @@
5182
5056
  var requiredEmptyFields = this.getRequiredEmptyFields(recordCaptureFields, null);
5183
5057
  if (requiredEmptyFields.length > 0) {
5184
5058
  validationOk = false;
5185
- this.setError(componentConstants.FORMERROR_TYPE_WARNING, componentConstants.FORMERROR_VALIDATION_TITLE, componentConstants.FORMERROR_REQUIRED_FIELDS);
5186
- this.tagFieldsWithError(requiredEmptyFields, null, componentConstants.FIELD_REQUIRED_MESSAGE);
5059
+ this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.requiredFields);
5060
+ this.tagFieldsWithError(requiredEmptyFields, null, this.formConfig.formStandardErrors.requiredField);
5187
5061
  }
5188
5062
  var validationIssueFields = this.getFieldsWithValidationIssues(recordCaptureFields, null);
5189
5063
  if (validationIssueFields.length > 0) {
5190
5064
  validationOk = false;
5191
- this.setError(componentConstants.FORMERROR_TYPE_WARNING, componentConstants.FORMERROR_VALIDATION_TITLE, componentConstants.FORMERROR_VALIDATION_FIELDS);
5065
+ this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.validationFields);
5192
5066
  }
5193
5067
  return validationOk;
5194
5068
  };