tuain-ng-forms-lib 0.12.30 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/tuain-ng-forms-lib.umd.js +500 -597
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/action.js +5 -5
- package/esm2015/lib/classes/forms/element.js +7 -6
- package/esm2015/lib/classes/forms/field.js +48 -92
- package/esm2015/lib/classes/forms/form.constants.js +11 -82
- package/esm2015/lib/classes/forms/form.js +8 -8
- package/esm2015/lib/classes/forms/subsection.js +5 -5
- package/esm2015/lib/classes/forms/table/column.js +5 -5
- package/esm2015/lib/classes/forms/table/row-data.js +6 -4
- package/esm2015/lib/classes/forms/table/table.js +15 -13
- package/esm2015/lib/components/elements/action.component.js +3 -1
- package/esm2015/lib/components/elements/field.component.js +22 -12
- package/esm2015/lib/components/elements/layout/element.component.js +3 -6
- package/esm2015/lib/components/elements/layout/form-error.component.js +1 -1
- package/esm2015/lib/components/elements/tables/table.component.js +7 -7
- package/esm2015/lib/components/forms/basic-form.js +89 -85
- package/esm2015/lib/services/form-manager.service.js +60 -54
- package/fesm2015/tuain-ng-forms-lib.js +289 -374
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/action.d.ts +1 -1
- package/lib/classes/forms/element.d.ts +2 -1
- package/lib/classes/forms/field.d.ts +2 -1
- package/lib/classes/forms/form.constants.d.ts +10 -74
- package/lib/classes/forms/form.d.ts +2 -1
- package/lib/classes/forms/table/column.d.ts +2 -1
- package/lib/classes/forms/table/table.d.ts +1 -1
- package/lib/components/elements/action.component.d.ts +1 -0
- package/lib/components/elements/field.component.d.ts +2 -3
- package/lib/components/elements/layout/element.component.d.ts +1 -2
- package/lib/components/elements/layout/form-error.component.d.ts +0 -1
- package/lib/components/elements/tables/table.component.d.ts +1 -0
- package/lib/components/forms/basic-form.d.ts +23 -4
- package/lib/services/form-manager.service.d.ts +22 -15
- package/package.json +1 -1
- 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,132 +54,52 @@
|
|
|
52
54
|
showLabel: [{ type: core.Input }]
|
|
53
55
|
};
|
|
54
56
|
|
|
55
|
-
var
|
|
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 = {
|
|
57
|
+
var MONITORED_ATTRIBUTES = {
|
|
150
58
|
_maxLength: 'maxLength',
|
|
151
|
-
_onValidation: '
|
|
59
|
+
_onValidation: 'onValidation',
|
|
152
60
|
_fieldValue: 'value',
|
|
153
61
|
captureType: 'captureType',
|
|
154
|
-
fieldTitle: '
|
|
155
|
-
fieldType: '
|
|
62
|
+
fieldTitle: 'title',
|
|
63
|
+
fieldType: 'type',
|
|
156
64
|
errorMessage: 'errorMessage',
|
|
157
65
|
errorType: 'errorType',
|
|
158
66
|
errorCode: 'errorCode',
|
|
159
67
|
visibleLabel: 'visibleLabel',
|
|
160
|
-
fieldRequired: '
|
|
161
|
-
fieldOptions: '
|
|
68
|
+
fieldRequired: 'required',
|
|
69
|
+
fieldOptions: 'options',
|
|
162
70
|
};
|
|
163
71
|
var FieldComponent = /** @class */ (function () {
|
|
164
72
|
function FieldComponent() {
|
|
165
|
-
this.componentConstants = Object.assign({}, componentConstants);
|
|
166
73
|
}
|
|
167
74
|
FieldComponent.prototype.ngOnInit = function () {
|
|
168
75
|
var _this = this;
|
|
76
|
+
var _a;
|
|
169
77
|
if (this.fieldObject) {
|
|
78
|
+
this.formConfig = (_a = this.fieldObject) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
170
79
|
// Atributos estáticos
|
|
171
|
-
this.
|
|
80
|
+
this.code = this.fieldObject.fieldCode;
|
|
172
81
|
this.fieldInfo = this.fieldObject.fieldInfo;
|
|
173
82
|
this.fieldAlignment = this.fieldObject.fieldAlignment;
|
|
174
83
|
this.tooltipText = this.fieldObject.tooltipText;
|
|
84
|
+
// Cargue inicial
|
|
85
|
+
this.maxLength = this.fieldObject._maxLength;
|
|
86
|
+
this.onValidation = this.fieldObject._onValidation;
|
|
87
|
+
this.value = this.fieldObject._fieldValue;
|
|
88
|
+
this.captureType = this.fieldObject.captureType;
|
|
89
|
+
this.title = this.fieldObject.fieldTitle;
|
|
90
|
+
this.type = this.fieldObject.fieldType;
|
|
91
|
+
this.errorMessage = this.fieldObject.errorMessage;
|
|
92
|
+
this.errorType = this.fieldObject.errorType;
|
|
93
|
+
this.errorCode = this.fieldObject.errorCode;
|
|
94
|
+
this.visibleLabel = this.fieldObject.visibleLabel;
|
|
95
|
+
this.required = this.fieldObject.fieldRequired;
|
|
96
|
+
this.options = this.fieldObject.fieldOptions;
|
|
175
97
|
this.fieldObject.widget = this;
|
|
176
98
|
// Atributos dinámicos
|
|
177
99
|
this.fieldObject.attributeChange.subscribe(function (event) {
|
|
178
100
|
var name = event.name, value = event.value;
|
|
179
|
-
if (_this[MONITORED_ATTRIBUTES
|
|
180
|
-
_this[MONITORED_ATTRIBUTES
|
|
101
|
+
if (_this[MONITORED_ATTRIBUTES[name]]) {
|
|
102
|
+
_this[MONITORED_ATTRIBUTES[name]] = value;
|
|
181
103
|
}
|
|
182
104
|
});
|
|
183
105
|
}
|
|
@@ -209,7 +131,6 @@
|
|
|
209
131
|
template: "<ng-content></ng-content>"
|
|
210
132
|
},] }
|
|
211
133
|
];
|
|
212
|
-
FieldComponent.ctorParameters = function () { return []; };
|
|
213
134
|
FieldComponent.propDecorators = {
|
|
214
135
|
fieldObject: [{ type: core.Input }],
|
|
215
136
|
disabled: [{ type: core.Input }]
|
|
@@ -217,9 +138,10 @@
|
|
|
217
138
|
|
|
218
139
|
var ElementComponent = /** @class */ (function () {
|
|
219
140
|
function ElementComponent() {
|
|
220
|
-
this.componentConstants = Object.assign({}, componentConstants);
|
|
221
141
|
}
|
|
222
142
|
ElementComponent.prototype.ngOnInit = function () {
|
|
143
|
+
var _a;
|
|
144
|
+
this.formConfig = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
223
145
|
this.start();
|
|
224
146
|
};
|
|
225
147
|
ElementComponent.prototype.start = function () { };
|
|
@@ -249,7 +171,6 @@
|
|
|
249
171
|
template: "<ng-content></ng-content>"
|
|
250
172
|
},] }
|
|
251
173
|
];
|
|
252
|
-
ElementComponent.ctorParameters = function () { return []; };
|
|
253
174
|
ElementComponent.propDecorators = {
|
|
254
175
|
formElement: [{ type: core.Input }],
|
|
255
176
|
formManager: [{ type: core.Input }]
|
|
@@ -675,9 +596,33 @@
|
|
|
675
596
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
676
597
|
}
|
|
677
598
|
|
|
599
|
+
var elementTypes = {
|
|
600
|
+
action: 'ACTION',
|
|
601
|
+
field: 'FIELD',
|
|
602
|
+
table: 'TABLE',
|
|
603
|
+
};
|
|
604
|
+
var formActions = {
|
|
605
|
+
tableAction: 'TABLEACTION',
|
|
606
|
+
getData: 'GETDATA',
|
|
607
|
+
getTableData: 'GETTABLEDATA',
|
|
608
|
+
validate: 'VALIDATE',
|
|
609
|
+
};
|
|
610
|
+
var operators = {
|
|
611
|
+
G: '>',
|
|
612
|
+
L: '<',
|
|
613
|
+
GE: '>=',
|
|
614
|
+
LE: '<=',
|
|
615
|
+
EQ: '==',
|
|
616
|
+
NOT_EQ: '!=',
|
|
617
|
+
CONTENT: 'Contiene',
|
|
618
|
+
NOT_CONTENT: 'No Contiene',
|
|
619
|
+
BETWEEN: 'Entre',
|
|
620
|
+
};
|
|
621
|
+
|
|
678
622
|
var FormElement = /** @class */ (function () {
|
|
679
|
-
function FormElement(elementDefinition) {
|
|
623
|
+
function FormElement(elementDefinition, formConfig) {
|
|
680
624
|
var _a, _b;
|
|
625
|
+
this._formConfig = formConfig;
|
|
681
626
|
this._isForced = false;
|
|
682
627
|
this.setVisibleStates(elementDefinition.visibleStates);
|
|
683
628
|
this.setEnabledStates(elementDefinition.enabledStates);
|
|
@@ -686,9 +631,9 @@
|
|
|
686
631
|
this.setVisibility((_b = elementDefinition === null || elementDefinition === void 0 ? void 0 : elementDefinition.visible) !== null && _b !== void 0 ? _b : true);
|
|
687
632
|
this.widget = null;
|
|
688
633
|
}
|
|
689
|
-
FormElement.prototype.isField = function () { return this.elementType ===
|
|
690
|
-
FormElement.prototype.isAction = function () { return this.elementType ===
|
|
691
|
-
FormElement.prototype.isTable = function () { return this.elementType ===
|
|
634
|
+
FormElement.prototype.isField = function () { return this.elementType === elementTypes.field; };
|
|
635
|
+
FormElement.prototype.isAction = function () { return this.elementType === elementTypes.action; };
|
|
636
|
+
FormElement.prototype.isTable = function () { return this.elementType === elementTypes.table; };
|
|
692
637
|
FormElement.prototype.setVisibleStates = function (newStates) {
|
|
693
638
|
var visibleStates = (!Array.isArray(newStates) && typeof newStates === 'string')
|
|
694
639
|
? newStates.split(',').map(function (state) { return state.trim(); }).filter(function (state) { return state.length > 0; })
|
|
@@ -748,13 +693,14 @@
|
|
|
748
693
|
}());
|
|
749
694
|
|
|
750
695
|
var RecordTableColumn = /** @class */ (function () {
|
|
751
|
-
function RecordTableColumn(recTableColReceived) {
|
|
696
|
+
function RecordTableColumn(recTableColReceived, formConfig) {
|
|
752
697
|
var _a, _b, _c;
|
|
698
|
+
this._formConfig = formConfig;
|
|
753
699
|
if (recTableColReceived) {
|
|
754
700
|
this.fieldCode = recTableColReceived.fieldCode;
|
|
755
701
|
this.fieldTitle = recTableColReceived.fieldTitle;
|
|
756
|
-
this.fieldType = recTableColReceived.fieldTypeCode ||
|
|
757
|
-
var defaultTypeAlignment = (tableFieldStyles[this.fieldType] != null) ? tableFieldStyles[this.fieldType]['text-align'] : 'left';
|
|
702
|
+
this.fieldType = recTableColReceived.fieldTypeCode || this._formConfig.fieldTypes.text;
|
|
703
|
+
var defaultTypeAlignment = (this._formConfig.tableFieldStyles[this.fieldType] != null) ? this._formConfig.tableFieldStyles[this.fieldType]['text-align'] : 'left';
|
|
758
704
|
this.fieldAlignment = (recTableColReceived.alignment != null) ? recTableColReceived.alignment.toLowerCase() : defaultTypeAlignment;
|
|
759
705
|
this.visible = (_a = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.visible) !== null && _a !== void 0 ? _a : true;
|
|
760
706
|
this.sortable = (_b = recTableColReceived === null || recTableColReceived === void 0 ? void 0 : recTableColReceived.sortable) !== null && _b !== void 0 ? _b : false;
|
|
@@ -843,6 +789,8 @@
|
|
|
843
789
|
return outputValue;
|
|
844
790
|
}
|
|
845
791
|
|
|
792
|
+
var DATE_TYPE = 'DATE';
|
|
793
|
+
var CURRENCY_TYPE = 'CURRENCY';
|
|
846
794
|
var TableRecordData = /** @class */ (function () {
|
|
847
795
|
function TableRecordData(recordReceived, recordDefinition, selectionFieldName) {
|
|
848
796
|
var _this = this;
|
|
@@ -879,10 +827,10 @@
|
|
|
879
827
|
}
|
|
880
828
|
}
|
|
881
829
|
TableRecordData.prototype.formatFieldValue = function (fieldType, fieldValue) {
|
|
882
|
-
if (fieldType ===
|
|
830
|
+
if (fieldType === CURRENCY_TYPE) {
|
|
883
831
|
return formatCurrency(fieldValue);
|
|
884
832
|
}
|
|
885
|
-
else if (fieldType ===
|
|
833
|
+
else if (fieldType === DATE_TYPE && fieldValue) {
|
|
886
834
|
return new Date(fieldValue).toISOString().split('T')[0];
|
|
887
835
|
}
|
|
888
836
|
return fieldValue || '';
|
|
@@ -993,6 +941,8 @@
|
|
|
993
941
|
return TableRecordData;
|
|
994
942
|
}());
|
|
995
943
|
|
|
944
|
+
var TABLE_SORT_ASCENDING = 'asc';
|
|
945
|
+
var TABLE_SORT_DESCENDING = 'desc';
|
|
996
946
|
var TABLE_FILTER_TYPES = {
|
|
997
947
|
simpleFilterChange: 'SIMPLE_CHANGE',
|
|
998
948
|
simpleFilterFinish: 'SIMPLE_FINISH',
|
|
@@ -1001,11 +951,11 @@
|
|
|
1001
951
|
};
|
|
1002
952
|
var RecordTable = /** @class */ (function (_super) {
|
|
1003
953
|
__extends(RecordTable, _super);
|
|
1004
|
-
function RecordTable(tableReceived) {
|
|
954
|
+
function RecordTable(tableReceived, formConfig) {
|
|
1005
955
|
var e_1, _h, e_2, _j, e_3, _k;
|
|
1006
956
|
var _this = this;
|
|
1007
957
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
1008
|
-
_this = _super.call(this, tableReceived) || this;
|
|
958
|
+
_this = _super.call(this, tableReceived, formConfig) || this;
|
|
1009
959
|
_this._inlineActionTrigger = new rxjs.Subject();
|
|
1010
960
|
_this._globalActionTrigger = new rxjs.Subject();
|
|
1011
961
|
_this._recordSelectionTrigger = new rxjs.Subject();
|
|
@@ -1015,7 +965,7 @@
|
|
|
1015
965
|
_this._tableColumnObj = {};
|
|
1016
966
|
_this._actionsObj = {};
|
|
1017
967
|
_this.allSelected = false;
|
|
1018
|
-
_this.elementType =
|
|
968
|
+
_this.elementType = elementTypes.table;
|
|
1019
969
|
_this.waiting = false;
|
|
1020
970
|
_this.complexFilter = false;
|
|
1021
971
|
_this.currentPage = 1;
|
|
@@ -1038,12 +988,12 @@
|
|
|
1038
988
|
_this.customAttributes = (_f = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.customAttributes) !== null && _f !== void 0 ? _f : {};
|
|
1039
989
|
_this.sortable = (_g = tableReceived === null || tableReceived === void 0 ? void 0 : tableReceived.sortable) !== null && _g !== void 0 ? _g : false;
|
|
1040
990
|
_this.sorting = { columnName: '', direction: '' };
|
|
1041
|
-
_this.recordsPerPage =
|
|
991
|
+
_this.recordsPerPage = formConfig.defaultRecordsPerPage;
|
|
1042
992
|
if (tableReceived.fields) {
|
|
1043
993
|
try {
|
|
1044
994
|
for (var _l = __values(tableReceived.fields), _m = _l.next(); !_m.done; _m = _l.next()) {
|
|
1045
995
|
var columnReceived = _m.value;
|
|
1046
|
-
var columnDefinition = new RecordTableColumn(columnReceived);
|
|
996
|
+
var columnDefinition = new RecordTableColumn(columnReceived, _this._formConfig);
|
|
1047
997
|
_this.columns.push(columnDefinition);
|
|
1048
998
|
_this._tableColumnObj[columnDefinition.fieldCode] = columnDefinition;
|
|
1049
999
|
}
|
|
@@ -1303,7 +1253,7 @@
|
|
|
1303
1253
|
? this._actionsObj[actionCode] : null;
|
|
1304
1254
|
};
|
|
1305
1255
|
RecordTable.prototype.getActions = function (actionClass, actionTypes) {
|
|
1306
|
-
if (actionClass === void 0) { actionClass =
|
|
1256
|
+
if (actionClass === void 0) { actionClass = this._formConfig.tableActions.inline; }
|
|
1307
1257
|
if (actionTypes === void 0) { actionTypes = null; }
|
|
1308
1258
|
return this._actions.filter(function (actionDef) {
|
|
1309
1259
|
var typeIncluded = (actionTypes) ? actionTypes.includes(actionDef.actionType) : true;
|
|
@@ -1378,14 +1328,14 @@
|
|
|
1378
1328
|
RecordTable.prototype.setRequiredOrder = function (columnField) {
|
|
1379
1329
|
if (columnField !== this.sorting.columnName) {
|
|
1380
1330
|
this.sorting.columnName = columnField;
|
|
1381
|
-
this.sorting.direction =
|
|
1331
|
+
this.sorting.direction = TABLE_SORT_ASCENDING;
|
|
1382
1332
|
}
|
|
1383
1333
|
else {
|
|
1384
|
-
if (this.sorting.direction ===
|
|
1385
|
-
this.sorting.direction =
|
|
1334
|
+
if (this.sorting.direction === TABLE_SORT_ASCENDING) {
|
|
1335
|
+
this.sorting.direction = TABLE_SORT_DESCENDING;
|
|
1386
1336
|
}
|
|
1387
1337
|
else {
|
|
1388
|
-
this.sorting.direction =
|
|
1338
|
+
this.sorting.direction = TABLE_SORT_ASCENDING;
|
|
1389
1339
|
}
|
|
1390
1340
|
}
|
|
1391
1341
|
};
|
|
@@ -1407,7 +1357,7 @@
|
|
|
1407
1357
|
else if (recordAColumn > recordBColumn) {
|
|
1408
1358
|
result = 1;
|
|
1409
1359
|
}
|
|
1410
|
-
return direction ===
|
|
1360
|
+
return direction === TABLE_SORT_ASCENDING ? result : -result;
|
|
1411
1361
|
};
|
|
1412
1362
|
return RecordTable;
|
|
1413
1363
|
}(FormElement));
|
|
@@ -1570,13 +1520,15 @@
|
|
|
1570
1520
|
this.hasActions = false;
|
|
1571
1521
|
}
|
|
1572
1522
|
LibTableComponent.prototype.ngOnInit = function () {
|
|
1573
|
-
|
|
1523
|
+
var _a;
|
|
1524
|
+
this.formConfig = (_a = this.tableObject) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
1525
|
+
this.tableFieldStyles = this.formConfig.tableFieldStyles;
|
|
1574
1526
|
this.selectable = this.tableObject.selectable;
|
|
1575
1527
|
this.hasActions = this.tableObject.hasActions;
|
|
1576
1528
|
this.tableObject.widget = this;
|
|
1577
|
-
this.inlineActions = this.tableObject.getActions(
|
|
1578
|
-
this.globalActions = this.tableObject.getActions(
|
|
1579
|
-
this.selectionActions = this.tableObject.getActions(
|
|
1529
|
+
this.inlineActions = this.tableObject.getActions(this.formConfig.tableActions.inline);
|
|
1530
|
+
this.globalActions = this.tableObject.getActions(this.formConfig.tableActions.global);
|
|
1531
|
+
this.selectionActions = this.tableObject.getActions(this.formConfig.tableActions.selection);
|
|
1580
1532
|
this.start();
|
|
1581
1533
|
};
|
|
1582
1534
|
LibTableComponent.prototype.start = function () { };
|
|
@@ -1694,15 +1646,15 @@
|
|
|
1694
1646
|
var arrayToAdd = null;
|
|
1695
1647
|
var type = receivedElement.type, code = receivedElement.code;
|
|
1696
1648
|
switch (type) {
|
|
1697
|
-
case
|
|
1649
|
+
case elementTypes.field:
|
|
1698
1650
|
elementObject = formObject.getFieldObject(code);
|
|
1699
1651
|
arrayToAdd = this.subSectionFields;
|
|
1700
1652
|
break;
|
|
1701
|
-
case
|
|
1653
|
+
case elementTypes.table:
|
|
1702
1654
|
elementObject = formObject.getTableObject(code);
|
|
1703
1655
|
arrayToAdd = this.subSectionTables;
|
|
1704
1656
|
break;
|
|
1705
|
-
case
|
|
1657
|
+
case elementTypes.action:
|
|
1706
1658
|
elementObject = formObject.getActionObject(code);
|
|
1707
1659
|
arrayToAdd = this.subSectionActions;
|
|
1708
1660
|
break;
|
|
@@ -1912,13 +1864,13 @@
|
|
|
1912
1864
|
var HEADER$1 = 'HEADER';
|
|
1913
1865
|
var FormAction = /** @class */ (function (_super) {
|
|
1914
1866
|
__extends(FormAction, _super);
|
|
1915
|
-
function FormAction(actionDefinition) {
|
|
1867
|
+
function FormAction(actionDefinition, formConfig) {
|
|
1916
1868
|
var _this = this;
|
|
1917
1869
|
var _a, _b;
|
|
1918
|
-
_this = _super.call(this, actionDefinition) || this;
|
|
1870
|
+
_this = _super.call(this, actionDefinition, formConfig) || this;
|
|
1919
1871
|
_this._actionActivated = new rxjs.Subject();
|
|
1920
1872
|
_this.inProgress = false;
|
|
1921
|
-
_this.elementType =
|
|
1873
|
+
_this.elementType = elementTypes.action;
|
|
1922
1874
|
_this.actionCode = actionDefinition.actionCode ? actionDefinition.actionCode.toString() : '';
|
|
1923
1875
|
_this.actionName = actionDefinition.actionTitle;
|
|
1924
1876
|
_this.iconName = actionDefinition.iconName || _this.actionCode;
|
|
@@ -1952,58 +1904,9 @@
|
|
|
1952
1904
|
}(FormElement));
|
|
1953
1905
|
|
|
1954
1906
|
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
1907
|
var DEFAULT_ERROR_TYPE = 'error';
|
|
2003
1908
|
var DEFAULT_CAPTURE_TYPE = 'INPUT';
|
|
2004
1909
|
var DEFAULT_ALIGNMENT = 'left';
|
|
2005
|
-
var MONITORED_ATTRIBUTES = ['_maxLength', '_onValidation', 'captureType', 'fieldTitle', 'fieldType',
|
|
2006
|
-
'errorMessage', 'errorType', 'errorCode', 'visibleLabel', 'fieldRequired', 'fieldOptions', '_fieldValue'];
|
|
2007
1910
|
var STD_MAX_LENGTH = 50;
|
|
2008
1911
|
var BIG_MAX_LENGTH = 500;
|
|
2009
1912
|
var fldAttr = {
|
|
@@ -2037,22 +1940,22 @@
|
|
|
2037
1940
|
};
|
|
2038
1941
|
var FieldDescriptor = /** @class */ (function (_super) {
|
|
2039
1942
|
__extends(FieldDescriptor, _super);
|
|
2040
|
-
function FieldDescriptor(inputFieldReceived) {
|
|
1943
|
+
function FieldDescriptor(inputFieldReceived, formConfig) {
|
|
2041
1944
|
var _this = this;
|
|
2042
1945
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2043
|
-
_this = _super.call(this, inputFieldReceived) || this;
|
|
1946
|
+
_this = _super.call(this, inputFieldReceived, formConfig) || this;
|
|
2044
1947
|
_this._editionFinish = new rxjs.Subject();
|
|
2045
1948
|
_this._editionPartial = new rxjs.Subject();
|
|
2046
1949
|
_this._detailRequest = new rxjs.Subject();
|
|
2047
1950
|
_this._attributeChange = new rxjs.Subject();
|
|
2048
|
-
_this.elementType =
|
|
1951
|
+
_this.elementType = elementTypes.field;
|
|
2049
1952
|
var fld = (inputFieldReceived) ? inputFieldReceived : {};
|
|
2050
1953
|
_this.setAttr(fldAttr.code, fld.fieldCode);
|
|
2051
1954
|
_this.setAttr(fldAttr.title, (_a = fld.fieldTitle) !== null && _a !== void 0 ? _a : _this.fieldCode);
|
|
2052
1955
|
_this.setAttr(fldAttr.captureType, (_b = fld.captureType) !== null && _b !== void 0 ? _b : DEFAULT_CAPTURE_TYPE);
|
|
2053
1956
|
_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;
|
|
1957
|
+
var defaultTypeAlignment = (_this._formConfig.tableFieldStyles[_this.fieldType] != null)
|
|
1958
|
+
? _this._formConfig.tableFieldStyles[_this.fieldType]['text-align'] : DEFAULT_ALIGNMENT;
|
|
2056
1959
|
var fieldAlignment = (fld.alignment != null) ? fld.alignment.toLowerCase() : defaultTypeAlignment;
|
|
2057
1960
|
_this.setAttr(fldAttr.alignment, fieldAlignment);
|
|
2058
1961
|
_this.setAttr(fldAttr.info, fld.info || '');
|
|
@@ -2073,7 +1976,7 @@
|
|
|
2073
1976
|
_this.setAttr(fldAttr.outputOnly, (_h = fld.outputOnly) !== null && _h !== void 0 ? _h : false);
|
|
2074
1977
|
var maxLength = (_j = fld.maxLength) !== null && _j !== void 0 ? _j : (_this.captureType === 'TEXTAREA' ? BIG_MAX_LENGTH : STD_MAX_LENGTH);
|
|
2075
1978
|
_this.setAttr(fldAttr.maxLength, maxLength);
|
|
2076
|
-
_this.setAttr(fldAttr.intrinsicErrorMessage, (_k =
|
|
1979
|
+
_this.setAttr(fldAttr.intrinsicErrorMessage, (_k = _this._formConfig.fieldTypeErrMsg[_this.fieldType]) !== null && _k !== void 0 ? _k : _this._formConfig.fieldTypeErrMsg.DEFAULT);
|
|
2077
1980
|
_this.setFieldType(fld.fieldTypeCode);
|
|
2078
1981
|
_this.setEditable((_l = fld.editable) !== null && _l !== void 0 ? _l : true);
|
|
2079
1982
|
_this.setVisibleLabel((_m = fld.visibleLabel) !== null && _m !== void 0 ? _m : true);
|
|
@@ -2154,13 +2057,13 @@
|
|
|
2154
2057
|
this._editionPartial.next({ code: this.fieldCode, intrinsicValidation: intrinsicValidation });
|
|
2155
2058
|
};
|
|
2156
2059
|
FieldDescriptor.prototype.notifyEditionFinish = function () {
|
|
2157
|
-
var _a, _b, _c, _d;
|
|
2060
|
+
var _a, _b, _c, _d, _e;
|
|
2158
2061
|
var intrinsicValidation = true;
|
|
2159
|
-
var fieldDefaultFormat = (_a =
|
|
2062
|
+
var fieldDefaultFormat = (_b = (_a = this._formConfig.fieldTypesPatterns) === null || _a === void 0 ? void 0 : _a[this.fieldType]) !== null && _b !== void 0 ? _b : null;
|
|
2160
2063
|
var fieldValue = this.getValue();
|
|
2161
2064
|
if (fieldValue && (fieldDefaultFormat || this.fieldFormat)) {
|
|
2162
|
-
intrinsicValidation = ((
|
|
2163
|
-
&& ((
|
|
2065
|
+
intrinsicValidation = ((_c = fieldDefaultFormat === null || fieldDefaultFormat === void 0 ? void 0 : fieldDefaultFormat.test(fieldValue)) !== null && _c !== void 0 ? _c : true)
|
|
2066
|
+
&& ((_e = (_d = this.fieldFormat) === null || _d === void 0 ? void 0 : _d.test(fieldValue)) !== null && _e !== void 0 ? _e : true);
|
|
2164
2067
|
if (!intrinsicValidation) {
|
|
2165
2068
|
this.setError('99', this._intrinsicErrorMessage);
|
|
2166
2069
|
}
|
|
@@ -2168,16 +2071,15 @@
|
|
|
2168
2071
|
this._editionFinish.next({ code: this.fieldCode, intrinsicValidation: intrinsicValidation });
|
|
2169
2072
|
};
|
|
2170
2073
|
FieldDescriptor.prototype.setAttr = function (name, value) {
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
}
|
|
2174
|
-
if (MONITORED_ATTRIBUTES.includes(name)) {
|
|
2074
|
+
this[name] = value;
|
|
2075
|
+
if (this._formConfig.monitoredFieldAttributes.includes(name)) {
|
|
2175
2076
|
this._attributeChange.next({ name: name, value: value });
|
|
2176
2077
|
}
|
|
2177
2078
|
};
|
|
2178
2079
|
FieldDescriptor.prototype.notifyEditionDetailRequest = function () {
|
|
2179
2080
|
this._detailRequest.next(this.fieldCode);
|
|
2180
2081
|
};
|
|
2082
|
+
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
2083
|
FieldDescriptor.prototype.setVisibleLabel = function (visibleLabel) { this.setAttr(fldAttr.visibleLabel, visibleLabel); };
|
|
2182
2084
|
FieldDescriptor.prototype.showLabel = function () { this.setVisibleLabel(true); };
|
|
2183
2085
|
FieldDescriptor.prototype.hideLabel = function () { this.setVisibleLabel(false); };
|
|
@@ -2218,7 +2120,7 @@
|
|
|
2218
2120
|
if (fieldCurrentValue === undefined || fieldCurrentValue === null) {
|
|
2219
2121
|
return true;
|
|
2220
2122
|
}
|
|
2221
|
-
if ((this.fieldType ===
|
|
2123
|
+
if ((this.fieldType === this._formConfig.fieldTypes.array || this.fieldType === this._formConfig.fieldTypes.phone)
|
|
2222
2124
|
&& Array.isArray(fieldCurrentValue) && fieldCurrentValue.length === 0) {
|
|
2223
2125
|
return true;
|
|
2224
2126
|
}
|
|
@@ -2226,12 +2128,15 @@
|
|
|
2226
2128
|
return fieldCurrentValue === '';
|
|
2227
2129
|
};
|
|
2228
2130
|
FieldDescriptor.prototype.getValue = function () {
|
|
2229
|
-
var _a;
|
|
2131
|
+
var _a, _b;
|
|
2230
2132
|
switch (this.fieldType) {
|
|
2231
|
-
case
|
|
2133
|
+
case this._formConfig.fieldTypes.boolean:
|
|
2232
2134
|
return (_a = this._fieldValue) !== null && _a !== void 0 ? _a : false;
|
|
2233
2135
|
break;
|
|
2234
|
-
case
|
|
2136
|
+
case this._formConfig.fieldTypes.check:
|
|
2137
|
+
return (_b = this._fieldValue) !== null && _b !== void 0 ? _b : false;
|
|
2138
|
+
break;
|
|
2139
|
+
case this._formConfig.fieldTypes.currency:
|
|
2235
2140
|
return this._fieldValue.replace(',', '');
|
|
2236
2141
|
break;
|
|
2237
2142
|
default:
|
|
@@ -2245,33 +2150,33 @@
|
|
|
2245
2150
|
for (var index = 0; index < fieldKeys.length; index++) {
|
|
2246
2151
|
var attrName = fieldKeys[index];
|
|
2247
2152
|
var attrValue = fld[attrName];
|
|
2248
|
-
(attrName ===
|
|
2249
|
-
(attrName ===
|
|
2250
|
-
(attrName ===
|
|
2251
|
-
(attrName ===
|
|
2252
|
-
(attrName ===
|
|
2253
|
-
(attrName ===
|
|
2254
|
-
(attrName ===
|
|
2255
|
-
(attrName ===
|
|
2256
|
-
(attrName ===
|
|
2257
|
-
(attrName ===
|
|
2258
|
-
(attrName ===
|
|
2259
|
-
(attrName ===
|
|
2260
|
-
(attrName ===
|
|
2261
|
-
(attrName ===
|
|
2153
|
+
(attrName === this._formConfig.apifieldattrs.visible) && this.setVisibility(attrValue);
|
|
2154
|
+
(attrName === this._formConfig.apifieldattrs.labelVisible) && this.setVisibleLabel(fld.visibleLabel);
|
|
2155
|
+
(attrName === this._formConfig.apifieldattrs.required) && this.setAttr(fldAttr.required, (_a = fld.required) !== null && _a !== void 0 ? _a : false);
|
|
2156
|
+
(attrName === this._formConfig.apifieldattrs.errorCode) && this.setAttr(fldAttr.errorCode, fld.errorCode);
|
|
2157
|
+
(attrName === this._formConfig.apifieldattrs.errorMessage) && this.setAttr(fldAttr.errorMessage, fld.errorMessage);
|
|
2158
|
+
(attrName === this._formConfig.apifieldattrs.tooltip) && this.setAttr(fldAttr.tooltipText, fld.tooltip);
|
|
2159
|
+
(attrName === this._formConfig.apifieldattrs.info) && this.setAttr(fldAttr.info, fld.info);
|
|
2160
|
+
(attrName === this._formConfig.apifieldattrs.editable) && this.setEditable(fld.editable);
|
|
2161
|
+
(attrName === this._formConfig.apifieldattrs.title) && this.setLabel(fld.fieldTitle.toString());
|
|
2162
|
+
(attrName === this._formConfig.apifieldattrs.value) && (this.setValue(fld._fieldValue) && this.setChanged(false));
|
|
2163
|
+
(attrName === this._formConfig.apifieldattrs.options) && this.setFieldOptions(fld.fieldOptions);
|
|
2164
|
+
(attrName === this._formConfig.apifieldattrs.captureType) && this.setAttr(fldAttr.captureType, fld.captureType || 'INPUT');
|
|
2165
|
+
(attrName === this._formConfig.apifieldattrs.type) && this.setFieldType(fld.fieldTypeCode);
|
|
2166
|
+
(attrName === this._formConfig.apifieldattrs.maxLength) && this.setAttr(fldAttr.maxLength, fld.maxLength);
|
|
2262
2167
|
}
|
|
2263
2168
|
};
|
|
2264
2169
|
FieldDescriptor.prototype.setFieldType = function (inputFieldType) {
|
|
2265
2170
|
this.setAttr(fldAttr.type, inputFieldType);
|
|
2266
2171
|
};
|
|
2267
2172
|
FieldDescriptor.prototype.format = function () {
|
|
2268
|
-
if (this.fieldType ===
|
|
2173
|
+
if (this.fieldType === this._formConfig.fieldTypes.currency) {
|
|
2269
2174
|
this.setAttr(fldAttr.value, formatCurrency(this._fieldValue));
|
|
2270
2175
|
}
|
|
2271
2176
|
};
|
|
2272
2177
|
FieldDescriptor.prototype.setMinValue = function (minValue) {
|
|
2273
2178
|
var _a, _b, _c;
|
|
2274
|
-
if (this.fieldType ===
|
|
2179
|
+
if (this.fieldType === this._formConfig.fieldTypes.date
|
|
2275
2180
|
&& ((_a = this.widget) === null || _a === void 0 ? void 0 : _a.setMinValue)) {
|
|
2276
2181
|
this.setAttr(fldAttr.minValue, minValue);
|
|
2277
2182
|
if (!minValue) {
|
|
@@ -2285,7 +2190,7 @@
|
|
|
2285
2190
|
};
|
|
2286
2191
|
FieldDescriptor.prototype.setMaxValue = function (maxValue) {
|
|
2287
2192
|
var _a, _b, _c;
|
|
2288
|
-
if (this.fieldType ===
|
|
2193
|
+
if (this.fieldType === this._formConfig.fieldTypes.date
|
|
2289
2194
|
&& ((_a = this.widget) === null || _a === void 0 ? void 0 : _a.setMaxValue)) {
|
|
2290
2195
|
this.setAttr(fldAttr.maxValue, maxValue);
|
|
2291
2196
|
if (!maxValue) {
|
|
@@ -2318,11 +2223,11 @@
|
|
|
2318
2223
|
fieldOptions = (fieldOptions && Array.isArray(fieldOptions)
|
|
2319
2224
|
&& fieldOptions.length > 0) ? fieldOptions : [];
|
|
2320
2225
|
this.setAttr(fldAttr.options, fieldOptions);
|
|
2321
|
-
if (this.fieldType ===
|
|
2226
|
+
if (this.fieldType === this._formConfig.fieldTypes.array && this.widget) {
|
|
2322
2227
|
return (_a = this.widget) === null || _a === void 0 ? void 0 : _a.refereshContent();
|
|
2323
2228
|
}
|
|
2324
2229
|
if (this._fieldValue) {
|
|
2325
|
-
if (this.fieldType ===
|
|
2230
|
+
if (this.fieldType === this._formConfig.fieldTypes.array && Array.isArray(this._fieldValue)) {
|
|
2326
2231
|
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
2232
|
this.setAttr(fldAttr.value, fieldValue);
|
|
2328
2233
|
}
|
|
@@ -2352,10 +2257,13 @@
|
|
|
2352
2257
|
case 'BOOLEAN':
|
|
2353
2258
|
newFinalValue = !!newValue;
|
|
2354
2259
|
break;
|
|
2355
|
-
case
|
|
2260
|
+
case this._formConfig.fieldTypes.boolean:
|
|
2261
|
+
newFinalValue = !!newValue;
|
|
2262
|
+
break;
|
|
2263
|
+
case this._formConfig.fieldTypes.check:
|
|
2356
2264
|
newFinalValue = !!newValue;
|
|
2357
2265
|
break;
|
|
2358
|
-
case
|
|
2266
|
+
case this._formConfig.fieldTypes.array:
|
|
2359
2267
|
if (newValue === null || newValue === '') {
|
|
2360
2268
|
newFinalValue = [];
|
|
2361
2269
|
}
|
|
@@ -2369,7 +2277,7 @@
|
|
|
2369
2277
|
newFinalValue = newValue;
|
|
2370
2278
|
}
|
|
2371
2279
|
break;
|
|
2372
|
-
case
|
|
2280
|
+
case this._formConfig.fieldTypes.map:
|
|
2373
2281
|
newFinalValue = newValue;
|
|
2374
2282
|
if (newFinalValue && this.widget && widgetUpdate) {
|
|
2375
2283
|
var latitude = parseFloat(newFinalValue[0]);
|
|
@@ -2377,7 +2285,7 @@
|
|
|
2377
2285
|
(_a = this.widget) === null || _a === void 0 ? void 0 : _a.setLocation(latitude, longitude);
|
|
2378
2286
|
}
|
|
2379
2287
|
break;
|
|
2380
|
-
case
|
|
2288
|
+
case this._formConfig.fieldTypes.currency:
|
|
2381
2289
|
newFinalValue = formatCurrency(this._fieldValue);
|
|
2382
2290
|
break;
|
|
2383
2291
|
default:
|
|
@@ -2396,14 +2304,16 @@
|
|
|
2396
2304
|
var HEADER = 'HEADER';
|
|
2397
2305
|
var NO_ERROR = '00';
|
|
2398
2306
|
var FormStructureAndData = /** @class */ (function () {
|
|
2399
|
-
function FormStructureAndData(definitionReceived) {
|
|
2307
|
+
function FormStructureAndData(definitionReceived, formConfig) {
|
|
2400
2308
|
var e_1, _d, e_2, _e, e_3, _f, e_4, _g;
|
|
2309
|
+
var _this = this;
|
|
2401
2310
|
this._fieldsObj = {};
|
|
2402
2311
|
this._actionsObj = {};
|
|
2403
2312
|
this._tableObj = {};
|
|
2404
2313
|
this._sectionsObj = {};
|
|
2405
2314
|
this._immutableData = {};
|
|
2406
2315
|
this._extraInfo = {};
|
|
2316
|
+
this._formConfig = formConfig;
|
|
2407
2317
|
this.state = '';
|
|
2408
2318
|
this._actions = [];
|
|
2409
2319
|
this._fields = [];
|
|
@@ -2439,7 +2349,7 @@
|
|
|
2439
2349
|
try {
|
|
2440
2350
|
for (var formActions_1 = __values(formActions), formActions_1_1 = formActions_1.next(); !formActions_1_1.done; formActions_1_1 = formActions_1.next()) {
|
|
2441
2351
|
var actionReceived = formActions_1_1.value;
|
|
2442
|
-
var globalAction = new FormAction(actionReceived);
|
|
2352
|
+
var globalAction = new FormAction(actionReceived, this._formConfig);
|
|
2443
2353
|
var globalActionCode = globalAction.actionCode;
|
|
2444
2354
|
if (globalActionCode) {
|
|
2445
2355
|
this._actions.push(globalAction);
|
|
@@ -2470,7 +2380,7 @@
|
|
|
2470
2380
|
try {
|
|
2471
2381
|
for (var formFields_1 = __values(formFields), formFields_1_1 = formFields_1.next(); !formFields_1_1.done; formFields_1_1 = formFields_1.next()) {
|
|
2472
2382
|
var fieldReceived = formFields_1_1.value;
|
|
2473
|
-
var fieldToAdd = new FieldDescriptor(fieldReceived);
|
|
2383
|
+
var fieldToAdd = new FieldDescriptor(fieldReceived, this._formConfig);
|
|
2474
2384
|
var fieldCode = fieldToAdd.fieldCode;
|
|
2475
2385
|
if (fieldCode) {
|
|
2476
2386
|
this._fields.push(fieldToAdd);
|
|
@@ -2497,14 +2407,14 @@
|
|
|
2497
2407
|
enabledStates = __spreadArray([], __read(visibleStates));
|
|
2498
2408
|
}
|
|
2499
2409
|
if (!visibleStates || visibleStates.length === 0) {
|
|
2500
|
-
visibleStates =
|
|
2410
|
+
visibleStates = _this._formConfig.defaultStateFlow.states;
|
|
2501
2411
|
}
|
|
2502
2412
|
return Object.assign(Object.assign({}, objDef), { visibleStates: visibleStates, enabledStates: enabledStates });
|
|
2503
2413
|
});
|
|
2504
2414
|
try {
|
|
2505
2415
|
for (var tables_1 = __values(tables), tables_1_1 = tables_1.next(); !tables_1_1.done; tables_1_1 = tables_1.next()) {
|
|
2506
2416
|
var tableReceived = tables_1_1.value;
|
|
2507
|
-
var tableToAdd = new RecordTable(tableReceived);
|
|
2417
|
+
var tableToAdd = new RecordTable(tableReceived, this._formConfig);
|
|
2508
2418
|
var tableCode = tableToAdd.tableCode;
|
|
2509
2419
|
if (tableCode) {
|
|
2510
2420
|
this._tables.push(tableToAdd);
|
|
@@ -2614,7 +2524,7 @@
|
|
|
2614
2524
|
FormStructureAndData.prototype.setStateFlow = function (states, transitions, defaultState) {
|
|
2615
2525
|
var _this = this;
|
|
2616
2526
|
if (!states || !transitions) {
|
|
2617
|
-
this._stateFlow = JSON.parse(JSON.stringify(
|
|
2527
|
+
this._stateFlow = JSON.parse(JSON.stringify(this._formConfig.defaultStateFlow));
|
|
2618
2528
|
return;
|
|
2619
2529
|
}
|
|
2620
2530
|
this._stateFlow.states = states;
|
|
@@ -3173,71 +3083,79 @@
|
|
|
3173
3083
|
function LibFormManagerService() {
|
|
3174
3084
|
this.cleanStack();
|
|
3175
3085
|
}
|
|
3176
|
-
|
|
3177
|
-
* Métodos virtuales de manejo de formularios
|
|
3178
|
-
*/
|
|
3086
|
+
// Métodos virtuales para las aplicaciones
|
|
3179
3087
|
LibFormManagerService.prototype.getFormDefinition = function (formCode) { };
|
|
3088
|
+
LibFormManagerService.prototype.getFormRoute = function (formCode) { };
|
|
3089
|
+
LibFormManagerService.prototype.getRouteForm = function (path) { };
|
|
3180
3090
|
LibFormManagerService.prototype.execServerAction = function (actionDetail) { };
|
|
3181
|
-
LibFormManagerService.prototype.
|
|
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
|
-
};
|
|
3091
|
+
LibFormManagerService.prototype.goToForm = function (formCode, token, subject) { };
|
|
3189
3092
|
LibFormManagerService.prototype.loadStack = function () { };
|
|
3190
3093
|
LibFormManagerService.prototype.saveStack = function () { };
|
|
3191
|
-
LibFormManagerService.prototype.
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
this.
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3094
|
+
LibFormManagerService.prototype.cleanStack = function () { this.pageStack = []; };
|
|
3095
|
+
LibFormManagerService.prototype.resetPageStack = function () { this.cleanStack(); };
|
|
3096
|
+
LibFormManagerService.prototype.findFormInStack = function (token) {
|
|
3097
|
+
var index = this.pageStack.findIndex(function (item) { return (item === null || item === void 0 ? void 0 : item.token) === token; });
|
|
3098
|
+
var data = (index >= 0) ? this.pageStack[index] : null;
|
|
3099
|
+
return { index: index, data: data };
|
|
3100
|
+
};
|
|
3101
|
+
LibFormManagerService.prototype.replaceItem = function (token, formInfo) {
|
|
3102
|
+
var _a, _b;
|
|
3103
|
+
if (!token || !formInfo) {
|
|
3104
|
+
return;
|
|
3105
|
+
}
|
|
3106
|
+
var _c = this.findFormInStack(token), index = _c.index, storedForm = _c.data;
|
|
3107
|
+
var updatedForm = null;
|
|
3108
|
+
if (index >= 0) {
|
|
3109
|
+
updatedForm = Object.assign({}, storedForm);
|
|
3110
|
+
updatedForm.subject = (_a = formInfo === null || formInfo === void 0 ? void 0 : formInfo.subject) !== null && _a !== void 0 ? _a : storedForm.subject;
|
|
3111
|
+
updatedForm.state = (_b = formInfo === null || formInfo === void 0 ? void 0 : formInfo.state) !== null && _b !== void 0 ? _b : storedForm.state;
|
|
3112
|
+
Object.assign(updatedForm.fields, formInfo.fields);
|
|
3113
|
+
Object.assign(updatedForm.extra, formInfo.extra);
|
|
3114
|
+
this.pageStack[index] = updatedForm;
|
|
3203
3115
|
this.saveStack();
|
|
3204
|
-
return formData;
|
|
3205
3116
|
}
|
|
3206
3117
|
};
|
|
3207
|
-
LibFormManagerService.prototype.
|
|
3208
|
-
var
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3118
|
+
LibFormManagerService.prototype.stack = function (origin, target) {
|
|
3119
|
+
var token = nanoid.nanoid(6);
|
|
3120
|
+
this.replaceItem(target.originToken, origin);
|
|
3121
|
+
this.pageStack.push(Object.assign({ token: token }, target));
|
|
3122
|
+
this.saveStack();
|
|
3123
|
+
return token;
|
|
3124
|
+
};
|
|
3125
|
+
LibFormManagerService.prototype.unstack = function (token) {
|
|
3126
|
+
if (token === void 0) { token = null; }
|
|
3127
|
+
var index = (token) ? this.findFormInStack(token).index : this.pageStack.length - 2;
|
|
3128
|
+
var formInfo = null;
|
|
3129
|
+
if (index >= 0) {
|
|
3130
|
+
formInfo = this.pageStack[index];
|
|
3131
|
+
this.pageStack.splice(index + 1);
|
|
3132
|
+
this.saveStack();
|
|
3212
3133
|
}
|
|
3213
|
-
return
|
|
3134
|
+
return formInfo;
|
|
3214
3135
|
};
|
|
3215
|
-
LibFormManagerService.prototype.
|
|
3216
|
-
var
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3136
|
+
LibFormManagerService.prototype.getFormInfo = function (token) {
|
|
3137
|
+
var _a, _b;
|
|
3138
|
+
var data = this.findFormInStack(token).data;
|
|
3139
|
+
return {
|
|
3140
|
+
token: data === null || data === void 0 ? void 0 : data.token,
|
|
3141
|
+
subject: data === null || data === void 0 ? void 0 : data.subject,
|
|
3142
|
+
state: data === null || data === void 0 ? void 0 : data.state,
|
|
3143
|
+
originToken: data === null || data === void 0 ? void 0 : data.originToken,
|
|
3144
|
+
fields: (_a = data === null || data === void 0 ? void 0 : data.fields) !== null && _a !== void 0 ? _a : {},
|
|
3145
|
+
extra: (_b = data === null || data === void 0 ? void 0 : data.extra) !== null && _b !== void 0 ? _b : {}
|
|
3146
|
+
};
|
|
3222
3147
|
};
|
|
3223
|
-
LibFormManagerService.prototype.
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
var
|
|
3228
|
-
|
|
3229
|
-
var navigationArray = __spreadArray(__spreadArray([url], __read(params)), [newToken]);
|
|
3230
|
-
this.goToRoute(navigationArray);
|
|
3148
|
+
LibFormManagerService.prototype.openForm = function (origin, target) {
|
|
3149
|
+
var _a;
|
|
3150
|
+
(!origin) && this.cleanStack();
|
|
3151
|
+
target.originToken = (_a = origin === null || origin === void 0 ? void 0 : origin.token) !== null && _a !== void 0 ? _a : null;
|
|
3152
|
+
var token = this.stack(origin, target);
|
|
3153
|
+
this.goToForm(target.name, token, target.subject);
|
|
3231
3154
|
};
|
|
3232
|
-
LibFormManagerService.prototype.
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
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);
|
|
3155
|
+
LibFormManagerService.prototype.backTo = function (targetToken) {
|
|
3156
|
+
if (targetToken === void 0) { targetToken = null; }
|
|
3157
|
+
var formInfo = this.unstack(targetToken);
|
|
3158
|
+
formInfo && formInfo.name && this.goToForm(formInfo.name, formInfo.token, formInfo.subject);
|
|
3241
3159
|
};
|
|
3242
3160
|
return LibFormManagerService;
|
|
3243
3161
|
}());
|
|
@@ -3276,11 +3194,8 @@
|
|
|
3276
3194
|
var INLINE_ACTION = 'INLINE';
|
|
3277
3195
|
var GLOBAL_ACTION = 'GLOBAL';
|
|
3278
3196
|
var GET_DATA_ACTION = 'GETDATA';
|
|
3279
|
-
var
|
|
3280
|
-
var
|
|
3281
|
-
var ORIGIN_PARAM = 'origin';
|
|
3282
|
-
var STATE_PARAM = 'mode';
|
|
3283
|
-
var REQUIRED_FIELD_MESSAGE = 'Campo requerido';
|
|
3197
|
+
var SUBJECT = 'subject';
|
|
3198
|
+
var TOKEN = 'token';
|
|
3284
3199
|
var BasicFormComponent = /** @class */ (function () {
|
|
3285
3200
|
function BasicFormComponent(formManagerService, _eventManager, fileMgmtServices) {
|
|
3286
3201
|
this.formManagerService = formManagerService;
|
|
@@ -3290,10 +3205,9 @@
|
|
|
3290
3205
|
this.errorMessage = '';
|
|
3291
3206
|
this.errorDetail = '';
|
|
3292
3207
|
this.formStructure = null;
|
|
3293
|
-
this.
|
|
3294
|
-
this.inputDataFields =
|
|
3295
|
-
this.extraData =
|
|
3296
|
-
this.componentConstants = componentConstants;
|
|
3208
|
+
this.controlToken = null;
|
|
3209
|
+
this.inputDataFields = {};
|
|
3210
|
+
this.extraData = {};
|
|
3297
3211
|
this.definitionObtained = false;
|
|
3298
3212
|
this.formVisible = false;
|
|
3299
3213
|
this.inServerProcess = false;
|
|
@@ -3315,14 +3229,17 @@
|
|
|
3315
3229
|
this.cleanStart();
|
|
3316
3230
|
this.customPreProcessing();
|
|
3317
3231
|
}
|
|
3232
|
+
BasicFormComponent.prototype.setConfig = function (formConfig) {
|
|
3233
|
+
this.formConfig = formConfig;
|
|
3234
|
+
};
|
|
3318
3235
|
BasicFormComponent.prototype.cleanStart = function () {
|
|
3319
3236
|
this._errorType = '';
|
|
3320
3237
|
this.errorCode = '';
|
|
3321
3238
|
this.errorMessage = '';
|
|
3322
3239
|
this.errorDetail = '';
|
|
3323
3240
|
this.formStructure = null;
|
|
3324
|
-
this.
|
|
3325
|
-
this.inputDataFields =
|
|
3241
|
+
this.controlToken = null;
|
|
3242
|
+
this.inputDataFields = {};
|
|
3326
3243
|
this.definitionObtained = false;
|
|
3327
3244
|
// Se limpian los manejadores de eventos
|
|
3328
3245
|
this.formVisible = false;
|
|
@@ -3490,36 +3407,65 @@
|
|
|
3490
3407
|
BasicFormComponent.prototype.subscribeAppEvent = function (eventName, callback) {
|
|
3491
3408
|
this._eventEmiter.subscribe(eventName, callback);
|
|
3492
3409
|
};
|
|
3410
|
+
BasicFormComponent.prototype.openForm = function (name, data, backData, cleanStack) {
|
|
3411
|
+
if (data === void 0) { data = null; }
|
|
3412
|
+
if (backData === void 0) { backData = null; }
|
|
3413
|
+
if (cleanStack === void 0) { cleanStack = false; }
|
|
3414
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3415
|
+
var origin = null;
|
|
3416
|
+
if (!cleanStack) {
|
|
3417
|
+
origin = Object.assign(Object.assign({}, backData), { name: this.name, url: this._formRoute, token: this.controlToken });
|
|
3418
|
+
origin.subject = (_a = origin === null || origin === void 0 ? void 0 : origin.subject) !== null && _a !== void 0 ? _a : this.formSubject;
|
|
3419
|
+
origin.state = (_b = origin === null || origin === void 0 ? void 0 : origin.state) !== null && _b !== void 0 ? _b : this.currentState;
|
|
3420
|
+
origin.fields = (_c = origin === null || origin === void 0 ? void 0 : origin.fields) !== null && _c !== void 0 ? _c : {};
|
|
3421
|
+
origin.extra = (_d = origin === null || origin === void 0 ? void 0 : origin.extra) !== null && _d !== void 0 ? _d : {};
|
|
3422
|
+
}
|
|
3423
|
+
var target = Object.assign(Object.assign({}, data), { name: name });
|
|
3424
|
+
target.subject = (_e = target === null || target === void 0 ? void 0 : target.subject) !== null && _e !== void 0 ? _e : null;
|
|
3425
|
+
target.state = (_f = target === null || target === void 0 ? void 0 : target.state) !== null && _f !== void 0 ? _f : null;
|
|
3426
|
+
target.fields = (_g = target === null || target === void 0 ? void 0 : target.fields) !== null && _g !== void 0 ? _g : {};
|
|
3427
|
+
target.extra = (_h = target === null || target === void 0 ? void 0 : target.extra) !== null && _h !== void 0 ? _h : {};
|
|
3428
|
+
this.formManagerService.openForm(origin, target);
|
|
3429
|
+
};
|
|
3430
|
+
/**
|
|
3431
|
+
* @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
|
|
3432
|
+
*/
|
|
3493
3433
|
BasicFormComponent.prototype.goToPage = function (navigationArray, predefinedFields, options) {
|
|
3494
3434
|
if (options === void 0) { options = null; }
|
|
3495
|
-
var _a
|
|
3435
|
+
var _a;
|
|
3496
3436
|
var origin = null;
|
|
3497
3437
|
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
3438
|
if (!cleanStack) {
|
|
3502
3439
|
origin = {
|
|
3503
|
-
|
|
3440
|
+
name: this.name,
|
|
3504
3441
|
url: this._formRoute,
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3442
|
+
token: this.controlToken,
|
|
3443
|
+
fields: this.inputDataFields,
|
|
3444
|
+
extra: this.extraData
|
|
3508
3445
|
};
|
|
3509
3446
|
}
|
|
3510
3447
|
var target = {
|
|
3448
|
+
name: this.formManagerService.getRouteForm(navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0]),
|
|
3511
3449
|
url: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0],
|
|
3512
|
-
|
|
3513
|
-
|
|
3450
|
+
state: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[1],
|
|
3451
|
+
subject: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[2],
|
|
3452
|
+
fields: predefinedFields,
|
|
3453
|
+
extra: null,
|
|
3514
3454
|
};
|
|
3515
|
-
this.formManagerService.
|
|
3455
|
+
this.formManagerService.openForm(origin, target);
|
|
3516
3456
|
};
|
|
3457
|
+
/**
|
|
3458
|
+
* @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
|
|
3459
|
+
*/
|
|
3517
3460
|
BasicFormComponent.prototype.goToNewPage = function (nav, flds) { return this.goToPage(nav, flds, { cleanStack: true }); };
|
|
3461
|
+
/**
|
|
3462
|
+
* @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
|
|
3463
|
+
*/
|
|
3518
3464
|
BasicFormComponent.prototype.goToSubPage = function (nav, flds) { return this.goToPage(nav, flds, { cleanStack: false }); };
|
|
3519
|
-
BasicFormComponent.prototype.canGoBack = function () { return this.
|
|
3520
|
-
BasicFormComponent.prototype.goBack = function () { return this.formManagerService.
|
|
3465
|
+
BasicFormComponent.prototype.canGoBack = function () { return this.originToken !== null; };
|
|
3466
|
+
BasicFormComponent.prototype.goBack = function () { return this.formManagerService.backTo(); };
|
|
3521
3467
|
BasicFormComponent.prototype.goBackForm = function () { return this.goBack(); };
|
|
3522
|
-
BasicFormComponent.prototype.getOriginDetail = function () { return this.formManagerService.
|
|
3468
|
+
BasicFormComponent.prototype.getOriginDetail = function () { return this.formManagerService.getFormInfo(this.originToken); };
|
|
3523
3469
|
BasicFormComponent.prototype.setError = function (errorType, errorMessage, errorDetail) {
|
|
3524
3470
|
this._errorType = errorType || '';
|
|
3525
3471
|
this.errorMessage = errorMessage || '';
|
|
@@ -3551,44 +3497,23 @@
|
|
|
3551
3497
|
configurable: true
|
|
3552
3498
|
});
|
|
3553
3499
|
BasicFormComponent.prototype.getFormParameter = function (name) {
|
|
3554
|
-
|
|
3500
|
+
var _a, _b;
|
|
3501
|
+
return (name) ? ((_b = (_a = this.extraData) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : null) : null;
|
|
3555
3502
|
};
|
|
3556
3503
|
BasicFormComponent.prototype.getSubject = function () { return this.formSubject; };
|
|
3557
3504
|
BasicFormComponent.prototype.getformSubject = function () { return this.getSubject(); };
|
|
3558
3505
|
BasicFormComponent.prototype.preocessInputParams = function (params) {
|
|
3559
|
-
var
|
|
3560
|
-
|
|
3561
|
-
var
|
|
3562
|
-
if (!
|
|
3563
|
-
|
|
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();
|
|
3506
|
+
var _a, _b, _c;
|
|
3507
|
+
this.controlToken = (_a = params === null || params === void 0 ? void 0 : params[TOKEN]) !== null && _a !== void 0 ? _a : null;
|
|
3508
|
+
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;
|
|
3509
|
+
if (!this.controlToken || this.controlToken !== token) {
|
|
3510
|
+
console.log("No se obtuvo un token v\u00E1lido para abrir el formulario " + this.controlToken + "->" + token);
|
|
3590
3511
|
}
|
|
3591
|
-
|
|
3512
|
+
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;
|
|
3513
|
+
this.inputDataFields = fields;
|
|
3514
|
+
this.extraData = extra;
|
|
3515
|
+
this.originToken = originToken;
|
|
3516
|
+
return state;
|
|
3592
3517
|
};
|
|
3593
3518
|
BasicFormComponent.prototype.subscribeSectionActivation = function () {
|
|
3594
3519
|
var _this = this;
|
|
@@ -3640,12 +3565,10 @@
|
|
|
3640
3565
|
}
|
|
3641
3566
|
};
|
|
3642
3567
|
BasicFormComponent.prototype.formInit = function (params) {
|
|
3643
|
-
var _a;
|
|
3644
3568
|
return __awaiter(this, void 0, void 0, function () {
|
|
3645
|
-
var initialState, formDefinition,
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
switch (_k.label) {
|
|
3569
|
+
var initialState, formDefinition, inputFieldNames, index, fieldCode, fieldValue, recordResponse;
|
|
3570
|
+
return __generator(this, function (_j) {
|
|
3571
|
+
switch (_j.label) {
|
|
3649
3572
|
case 0:
|
|
3650
3573
|
initialState = this.preocessInputParams(params);
|
|
3651
3574
|
if (!this.name) {
|
|
@@ -3655,48 +3578,28 @@
|
|
|
3655
3578
|
this.inServerProcess = true;
|
|
3656
3579
|
return [4 /*yield*/, this.formManagerService.getFormDefinition(this.name)];
|
|
3657
3580
|
case 1:
|
|
3658
|
-
formDefinition =
|
|
3581
|
+
formDefinition = _j.sent();
|
|
3659
3582
|
this.inServerProcess = false;
|
|
3660
|
-
this.formStructure = new FormStructureAndData(formDefinition);
|
|
3583
|
+
this.formStructure = new FormStructureAndData(formDefinition, this.formConfig);
|
|
3661
3584
|
this.definitionObtained = true;
|
|
3662
3585
|
return [3 /*break*/, 3];
|
|
3663
3586
|
case 2:
|
|
3664
3587
|
this.cleanData();
|
|
3665
|
-
|
|
3588
|
+
_j.label = 3;
|
|
3666
3589
|
case 3:
|
|
3667
3590
|
if (!this.supportState(initialState)) {
|
|
3668
3591
|
initialState = this.formStructure.defaultState;
|
|
3669
3592
|
}
|
|
3670
3593
|
this.formStructure.changeState(initialState || this.formStructure.defaultState);
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
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
|
-
}
|
|
3594
|
+
inputFieldNames = Object.keys(this.inputDataFields);
|
|
3595
|
+
for (index = 0; index < inputFieldNames.length; index++) {
|
|
3596
|
+
fieldCode = inputFieldNames[index];
|
|
3597
|
+
fieldValue = this.inputDataFields[fieldCode];
|
|
3598
|
+
this.setFieldValue(fieldCode, fieldValue);
|
|
3688
3599
|
}
|
|
3689
|
-
|
|
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
|
-
}
|
|
3696
|
-
}
|
|
3697
|
-
return [4 /*yield*/, this.requestFormAction(componentConstants.FORMACTION_GETDATA)];
|
|
3600
|
+
return [4 /*yield*/, this.requestFormAction(formActions.getData)];
|
|
3698
3601
|
case 4:
|
|
3699
|
-
recordResponse =
|
|
3602
|
+
recordResponse = _j.sent();
|
|
3700
3603
|
this.checkErrorRecordReceived(recordResponse);
|
|
3701
3604
|
this.formVisible = true;
|
|
3702
3605
|
this.subscribeSectionActivation();
|
|
@@ -3719,7 +3622,7 @@
|
|
|
3719
3622
|
this.errorDetail = recordResponse.errorDetail;
|
|
3720
3623
|
};
|
|
3721
3624
|
BasicFormComponent.prototype.errorOccured = function () {
|
|
3722
|
-
return (this.errorCode !==
|
|
3625
|
+
return (this.errorCode !== '00');
|
|
3723
3626
|
};
|
|
3724
3627
|
BasicFormComponent.prototype.changeState = function (state) { return this.formStructure.changeState(state); };
|
|
3725
3628
|
BasicFormComponent.prototype.changeFormMode = function (state) { return this.changeState(state); };
|
|
@@ -3727,8 +3630,8 @@
|
|
|
3727
3630
|
if (actionSubject === void 0) { actionSubject = {}; }
|
|
3728
3631
|
return __awaiter(this, void 0, void 0, function () {
|
|
3729
3632
|
var actionDetail, formActionResponse, error, formResponseData;
|
|
3730
|
-
return __generator(this, function (
|
|
3731
|
-
switch (
|
|
3633
|
+
return __generator(this, function (_j) {
|
|
3634
|
+
switch (_j.label) {
|
|
3732
3635
|
case 0:
|
|
3733
3636
|
actionDetail = {
|
|
3734
3637
|
formCode: this.name,
|
|
@@ -3746,7 +3649,7 @@
|
|
|
3746
3649
|
this.inServerProcess = true;
|
|
3747
3650
|
return [4 /*yield*/, this.formManagerService.execServerAction(actionDetail)];
|
|
3748
3651
|
case 1:
|
|
3749
|
-
formActionResponse =
|
|
3652
|
+
formActionResponse = _j.sent();
|
|
3750
3653
|
this.inServerProcess = false;
|
|
3751
3654
|
if (formActionResponse && formActionResponse.error.errorType) {
|
|
3752
3655
|
console.log('Excepción no soportada');
|
|
@@ -3765,7 +3668,7 @@
|
|
|
3765
3668
|
});
|
|
3766
3669
|
};
|
|
3767
3670
|
BasicFormComponent.prototype.updateFormWithServerData = function (formContent) {
|
|
3768
|
-
var
|
|
3671
|
+
var e_1, _j, e_2, _k, e_3, _l;
|
|
3769
3672
|
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
3673
|
this.changeState(currentMode !== null && currentMode !== void 0 ? currentMode : this.formStructure.state);
|
|
3771
3674
|
if (formSubject) {
|
|
@@ -3781,12 +3684,12 @@
|
|
|
3781
3684
|
}
|
|
3782
3685
|
}
|
|
3783
3686
|
}
|
|
3784
|
-
catch (
|
|
3687
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3785
3688
|
finally {
|
|
3786
3689
|
try {
|
|
3787
|
-
if (actions_1_1 && !actions_1_1.done && (
|
|
3690
|
+
if (actions_1_1 && !actions_1_1.done && (_j = actions_1.return)) _j.call(actions_1);
|
|
3788
3691
|
}
|
|
3789
|
-
finally { if (
|
|
3692
|
+
finally { if (e_1) throw e_1.error; }
|
|
3790
3693
|
}
|
|
3791
3694
|
}
|
|
3792
3695
|
if (fields && fields.length > 0) {
|
|
@@ -3799,12 +3702,12 @@
|
|
|
3799
3702
|
}
|
|
3800
3703
|
}
|
|
3801
3704
|
}
|
|
3802
|
-
catch (
|
|
3705
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
3803
3706
|
finally {
|
|
3804
3707
|
try {
|
|
3805
|
-
if (fields_1_1 && !fields_1_1.done && (
|
|
3708
|
+
if (fields_1_1 && !fields_1_1.done && (_k = fields_1.return)) _k.call(fields_1);
|
|
3806
3709
|
}
|
|
3807
|
-
finally { if (
|
|
3710
|
+
finally { if (e_2) throw e_2.error; }
|
|
3808
3711
|
}
|
|
3809
3712
|
}
|
|
3810
3713
|
if (recordTables && recordTables.length > 0) {
|
|
@@ -3817,12 +3720,12 @@
|
|
|
3817
3720
|
}
|
|
3818
3721
|
}
|
|
3819
3722
|
}
|
|
3820
|
-
catch (
|
|
3723
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
3821
3724
|
finally {
|
|
3822
3725
|
try {
|
|
3823
|
-
if (recordTables_1_1 && !recordTables_1_1.done && (
|
|
3726
|
+
if (recordTables_1_1 && !recordTables_1_1.done && (_l = recordTables_1.return)) _l.call(recordTables_1);
|
|
3824
3727
|
}
|
|
3825
|
-
finally { if (
|
|
3728
|
+
finally { if (e_3) throw e_3.error; }
|
|
3826
3729
|
}
|
|
3827
3730
|
}
|
|
3828
3731
|
if (returnedFile && returnedFile.file) {
|
|
@@ -3877,8 +3780,8 @@
|
|
|
3877
3780
|
BasicFormComponent.prototype.launchSectionActivation = function (sectionCode) {
|
|
3878
3781
|
return __awaiter(this, void 0, void 0, function () {
|
|
3879
3782
|
var sectionObject, clientSectionMethods, clientSectionMethods_1, clientSectionMethods_1_1, clientSectionMethod;
|
|
3880
|
-
var
|
|
3881
|
-
return __generator(this, function (
|
|
3783
|
+
var e_4, _j;
|
|
3784
|
+
return __generator(this, function (_k) {
|
|
3882
3785
|
sectionObject = this.formStructure.getSectionObject(sectionCode);
|
|
3883
3786
|
if (!sectionObject) {
|
|
3884
3787
|
return [2 /*return*/];
|
|
@@ -3891,12 +3794,12 @@
|
|
|
3891
3794
|
clientSectionMethod(sectionObject);
|
|
3892
3795
|
}
|
|
3893
3796
|
}
|
|
3894
|
-
catch (
|
|
3797
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
3895
3798
|
finally {
|
|
3896
3799
|
try {
|
|
3897
|
-
if (clientSectionMethods_1_1 && !clientSectionMethods_1_1.done && (
|
|
3800
|
+
if (clientSectionMethods_1_1 && !clientSectionMethods_1_1.done && (_j = clientSectionMethods_1.return)) _j.call(clientSectionMethods_1);
|
|
3898
3801
|
}
|
|
3899
|
-
finally { if (
|
|
3802
|
+
finally { if (e_4) throw e_4.error; }
|
|
3900
3803
|
}
|
|
3901
3804
|
}
|
|
3902
3805
|
return [2 /*return*/];
|
|
@@ -3906,8 +3809,8 @@
|
|
|
3906
3809
|
BasicFormComponent.prototype.launchSectionInactivation = function (sectionCode) {
|
|
3907
3810
|
return __awaiter(this, void 0, void 0, function () {
|
|
3908
3811
|
var sectionObject, clientSectionMethods, clientSectionMethods_2, clientSectionMethods_2_1, clientSectionMethod;
|
|
3909
|
-
var
|
|
3910
|
-
return __generator(this, function (
|
|
3812
|
+
var e_5, _j;
|
|
3813
|
+
return __generator(this, function (_k) {
|
|
3911
3814
|
sectionObject = this.formStructure.getSectionObject(sectionCode);
|
|
3912
3815
|
if (!sectionObject) {
|
|
3913
3816
|
return [2 /*return*/];
|
|
@@ -3920,12 +3823,12 @@
|
|
|
3920
3823
|
clientSectionMethod(sectionObject);
|
|
3921
3824
|
}
|
|
3922
3825
|
}
|
|
3923
|
-
catch (
|
|
3826
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
3924
3827
|
finally {
|
|
3925
3828
|
try {
|
|
3926
|
-
if (clientSectionMethods_2_1 && !clientSectionMethods_2_1.done && (
|
|
3829
|
+
if (clientSectionMethods_2_1 && !clientSectionMethods_2_1.done && (_j = clientSectionMethods_2.return)) _j.call(clientSectionMethods_2);
|
|
3927
3830
|
}
|
|
3928
|
-
finally { if (
|
|
3831
|
+
finally { if (e_5) throw e_5.error; }
|
|
3929
3832
|
}
|
|
3930
3833
|
}
|
|
3931
3834
|
return [2 /*return*/];
|
|
@@ -3935,9 +3838,9 @@
|
|
|
3935
3838
|
BasicFormComponent.prototype.startAction = function (actionCode) {
|
|
3936
3839
|
return __awaiter(this, void 0, void 0, function () {
|
|
3937
3840
|
var actionObject, clientActionMethods, clientActionPromises, clientActionMethods_1, clientActionMethods_1_1, clientActionMethod, continueActionPromise, clientActionResults, continueAction;
|
|
3938
|
-
var
|
|
3939
|
-
return __generator(this, function (
|
|
3940
|
-
switch (
|
|
3841
|
+
var e_6, _j;
|
|
3842
|
+
return __generator(this, function (_k) {
|
|
3843
|
+
switch (_k.label) {
|
|
3941
3844
|
case 0:
|
|
3942
3845
|
actionObject = this.getAction(actionCode);
|
|
3943
3846
|
if (!actionObject) {
|
|
@@ -3955,22 +3858,22 @@
|
|
|
3955
3858
|
clientActionPromises.push(continueActionPromise);
|
|
3956
3859
|
}
|
|
3957
3860
|
}
|
|
3958
|
-
catch (
|
|
3861
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
3959
3862
|
finally {
|
|
3960
3863
|
try {
|
|
3961
|
-
if (clientActionMethods_1_1 && !clientActionMethods_1_1.done && (
|
|
3864
|
+
if (clientActionMethods_1_1 && !clientActionMethods_1_1.done && (_j = clientActionMethods_1.return)) _j.call(clientActionMethods_1);
|
|
3962
3865
|
}
|
|
3963
|
-
finally { if (
|
|
3866
|
+
finally { if (e_6) throw e_6.error; }
|
|
3964
3867
|
}
|
|
3965
3868
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
3966
3869
|
case 1:
|
|
3967
|
-
clientActionResults =
|
|
3870
|
+
clientActionResults = _k.sent();
|
|
3968
3871
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
3969
3872
|
if (!continueAction) {
|
|
3970
3873
|
actionObject.stop();
|
|
3971
3874
|
return [2 /*return*/];
|
|
3972
3875
|
}
|
|
3973
|
-
|
|
3876
|
+
_k.label = 2;
|
|
3974
3877
|
case 2:
|
|
3975
3878
|
this.startServerAction(actionObject);
|
|
3976
3879
|
return [2 /*return*/];
|
|
@@ -3981,8 +3884,8 @@
|
|
|
3981
3884
|
BasicFormComponent.prototype.startServerAction = function (actionInput) {
|
|
3982
3885
|
return __awaiter(this, void 0, void 0, function () {
|
|
3983
3886
|
var action, finish, actionResult;
|
|
3984
|
-
return __generator(this, function (
|
|
3985
|
-
switch (
|
|
3887
|
+
return __generator(this, function (_j) {
|
|
3888
|
+
switch (_j.label) {
|
|
3986
3889
|
case 0:
|
|
3987
3890
|
action = (typeof actionInput === 'string')
|
|
3988
3891
|
? this.getAction(actionInput) : actionInput;
|
|
@@ -3991,19 +3894,19 @@
|
|
|
3991
3894
|
if (!action.backend) return [3 /*break*/, 2];
|
|
3992
3895
|
return [4 /*yield*/, this.requestFormAction(action.actionCode)];
|
|
3993
3896
|
case 1:
|
|
3994
|
-
actionResult =
|
|
3897
|
+
actionResult = _j.sent();
|
|
3995
3898
|
finish = !this.errorOccured();
|
|
3996
|
-
|
|
3899
|
+
_j.label = 2;
|
|
3997
3900
|
case 2:
|
|
3998
3901
|
if (!finish) return [3 /*break*/, 4];
|
|
3999
3902
|
return [4 /*yield*/, this.finishAction(action, actionResult)];
|
|
4000
3903
|
case 3:
|
|
4001
|
-
|
|
3904
|
+
_j.sent();
|
|
4002
3905
|
this.changeState(action.newState);
|
|
4003
3906
|
return [3 /*break*/, 5];
|
|
4004
3907
|
case 4:
|
|
4005
3908
|
this.displayActionServerError();
|
|
4006
|
-
|
|
3909
|
+
_j.label = 5;
|
|
4007
3910
|
case 5:
|
|
4008
3911
|
action.stop();
|
|
4009
3912
|
return [2 /*return*/];
|
|
@@ -4014,9 +3917,9 @@
|
|
|
4014
3917
|
BasicFormComponent.prototype.finishAction = function (actionObject, actionResult) {
|
|
4015
3918
|
return __awaiter(this, void 0, void 0, function () {
|
|
4016
3919
|
var finishActionMethods, clientActionPromises, finishActionMethods_1, finishActionMethods_1_1, clientActionMethod;
|
|
4017
|
-
var
|
|
4018
|
-
return __generator(this, function (
|
|
4019
|
-
switch (
|
|
3920
|
+
var e_7, _j;
|
|
3921
|
+
return __generator(this, function (_k) {
|
|
3922
|
+
switch (_k.label) {
|
|
4020
3923
|
case 0:
|
|
4021
3924
|
finishActionMethods = this.formActionsFinish[actionObject.actionCode];
|
|
4022
3925
|
if (!finishActionMethods) return [3 /*break*/, 2];
|
|
@@ -4027,17 +3930,17 @@
|
|
|
4027
3930
|
clientActionPromises.push(clientActionMethod(actionObject, actionResult));
|
|
4028
3931
|
}
|
|
4029
3932
|
}
|
|
4030
|
-
catch (
|
|
3933
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
4031
3934
|
finally {
|
|
4032
3935
|
try {
|
|
4033
|
-
if (finishActionMethods_1_1 && !finishActionMethods_1_1.done && (
|
|
3936
|
+
if (finishActionMethods_1_1 && !finishActionMethods_1_1.done && (_j = finishActionMethods_1.return)) _j.call(finishActionMethods_1);
|
|
4034
3937
|
}
|
|
4035
|
-
finally { if (
|
|
3938
|
+
finally { if (e_7) throw e_7.error; }
|
|
4036
3939
|
}
|
|
4037
3940
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4038
3941
|
case 1:
|
|
4039
|
-
|
|
4040
|
-
|
|
3942
|
+
_k.sent();
|
|
3943
|
+
_k.label = 2;
|
|
4041
3944
|
case 2: return [2 /*return*/];
|
|
4042
3945
|
}
|
|
4043
3946
|
});
|
|
@@ -4083,9 +3986,9 @@
|
|
|
4083
3986
|
if (intrinsicValidation === void 0) { intrinsicValidation = true; }
|
|
4084
3987
|
return __awaiter(this, void 0, void 0, function () {
|
|
4085
3988
|
var fieldToValidate, validationCallbacks, clientValidationPromises, validationCallbacks_1, validationCallbacks_1_1, validationMethod, continueValidationPromise;
|
|
4086
|
-
var
|
|
4087
|
-
return __generator(this, function (
|
|
4088
|
-
switch (
|
|
3989
|
+
var e_8, _j;
|
|
3990
|
+
return __generator(this, function (_k) {
|
|
3991
|
+
switch (_k.label) {
|
|
4089
3992
|
case 0:
|
|
4090
3993
|
fieldToValidate = this.getFieldObject(fieldCode);
|
|
4091
3994
|
if (!fieldToValidate) {
|
|
@@ -4103,17 +4006,17 @@
|
|
|
4103
4006
|
clientValidationPromises.push(continueValidationPromise);
|
|
4104
4007
|
}
|
|
4105
4008
|
}
|
|
4106
|
-
catch (
|
|
4009
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
4107
4010
|
finally {
|
|
4108
4011
|
try {
|
|
4109
|
-
if (validationCallbacks_1_1 && !validationCallbacks_1_1.done && (
|
|
4012
|
+
if (validationCallbacks_1_1 && !validationCallbacks_1_1.done && (_j = validationCallbacks_1.return)) _j.call(validationCallbacks_1);
|
|
4110
4013
|
}
|
|
4111
|
-
finally { if (
|
|
4014
|
+
finally { if (e_8) throw e_8.error; }
|
|
4112
4015
|
}
|
|
4113
4016
|
return [4 /*yield*/, Promise.all(clientValidationPromises)];
|
|
4114
4017
|
case 1:
|
|
4115
|
-
|
|
4116
|
-
|
|
4018
|
+
_k.sent();
|
|
4019
|
+
_k.label = 2;
|
|
4117
4020
|
case 2: return [2 /*return*/];
|
|
4118
4021
|
}
|
|
4119
4022
|
});
|
|
@@ -4123,9 +4026,9 @@
|
|
|
4123
4026
|
if (intrinsicValidation === void 0) { intrinsicValidation = true; }
|
|
4124
4027
|
return __awaiter(this, void 0, void 0, function () {
|
|
4125
4028
|
var fieldToValidate, validationCallbacks, clientValidationPromises, validationCallbacks_2, validationCallbacks_2_1, validationMethod, clientValidationPromise, clientValidationResults, continueValidation;
|
|
4126
|
-
var
|
|
4127
|
-
return __generator(this, function (
|
|
4128
|
-
switch (
|
|
4029
|
+
var e_9, _j;
|
|
4030
|
+
return __generator(this, function (_k) {
|
|
4031
|
+
switch (_k.label) {
|
|
4129
4032
|
case 0:
|
|
4130
4033
|
fieldToValidate = this.getField(fieldCode);
|
|
4131
4034
|
if (!fieldToValidate || !intrinsicValidation) {
|
|
@@ -4143,21 +4046,21 @@
|
|
|
4143
4046
|
clientValidationPromises.push(clientValidationPromise);
|
|
4144
4047
|
}
|
|
4145
4048
|
}
|
|
4146
|
-
catch (
|
|
4049
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
4147
4050
|
finally {
|
|
4148
4051
|
try {
|
|
4149
|
-
if (validationCallbacks_2_1 && !validationCallbacks_2_1.done && (
|
|
4052
|
+
if (validationCallbacks_2_1 && !validationCallbacks_2_1.done && (_j = validationCallbacks_2.return)) _j.call(validationCallbacks_2);
|
|
4150
4053
|
}
|
|
4151
|
-
finally { if (
|
|
4054
|
+
finally { if (e_9) throw e_9.error; }
|
|
4152
4055
|
}
|
|
4153
4056
|
return [4 /*yield*/, Promise.all(clientValidationPromises)];
|
|
4154
4057
|
case 1:
|
|
4155
|
-
clientValidationResults =
|
|
4058
|
+
clientValidationResults = _k.sent();
|
|
4156
4059
|
continueValidation = clientValidationResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4157
4060
|
if (!continueValidation) {
|
|
4158
4061
|
return [2 /*return*/];
|
|
4159
4062
|
}
|
|
4160
|
-
|
|
4063
|
+
_k.label = 2;
|
|
4161
4064
|
case 2:
|
|
4162
4065
|
this.startServerFieldValidation(fieldToValidate);
|
|
4163
4066
|
return [2 /*return*/];
|
|
@@ -4168,8 +4071,8 @@
|
|
|
4168
4071
|
BasicFormComponent.prototype.startServerFieldValidation = function (inputField) {
|
|
4169
4072
|
return __awaiter(this, void 0, void 0, function () {
|
|
4170
4073
|
var fieldObj, finish, validationResult;
|
|
4171
|
-
return __generator(this, function (
|
|
4172
|
-
switch (
|
|
4074
|
+
return __generator(this, function (_j) {
|
|
4075
|
+
switch (_j.label) {
|
|
4173
4076
|
case 0:
|
|
4174
4077
|
fieldObj = (typeof inputField === 'string')
|
|
4175
4078
|
? this.getField(inputField) : inputField;
|
|
@@ -4178,22 +4081,22 @@
|
|
|
4178
4081
|
if (!fieldObj.backend) return [3 /*break*/, 2];
|
|
4179
4082
|
fieldObj.validating = true;
|
|
4180
4083
|
return [4 /*yield*/, this
|
|
4181
|
-
.requestFormAction(
|
|
4084
|
+
.requestFormAction(formActions.validate, fieldObj.fieldCode)];
|
|
4182
4085
|
case 1:
|
|
4183
|
-
validationResult =
|
|
4086
|
+
validationResult = _j.sent();
|
|
4184
4087
|
finish = !this.errorOccured();
|
|
4185
|
-
|
|
4088
|
+
_j.label = 2;
|
|
4186
4089
|
case 2:
|
|
4187
4090
|
if (!finish) return [3 /*break*/, 4];
|
|
4188
4091
|
return [4 /*yield*/, this.finishFieldValidation(fieldObj, validationResult)];
|
|
4189
4092
|
case 3:
|
|
4190
|
-
|
|
4093
|
+
_j.sent();
|
|
4191
4094
|
return [3 /*break*/, 5];
|
|
4192
4095
|
case 4:
|
|
4193
4096
|
fieldObj.setErrorCode(this.errorCode);
|
|
4194
4097
|
fieldObj.setErrorMessage(this.errorMessage);
|
|
4195
4098
|
this.displayValidationServerError();
|
|
4196
|
-
|
|
4099
|
+
_j.label = 5;
|
|
4197
4100
|
case 5:
|
|
4198
4101
|
fieldObj.validating = false;
|
|
4199
4102
|
return [2 /*return*/];
|
|
@@ -4204,9 +4107,9 @@
|
|
|
4204
4107
|
BasicFormComponent.prototype.finishFieldValidation = function (fieldObject, validationResult) {
|
|
4205
4108
|
return __awaiter(this, void 0, void 0, function () {
|
|
4206
4109
|
var validationCallbacks, clientActionPromises, validationCallbacks_3, validationCallbacks_3_1, validationMethod;
|
|
4207
|
-
var
|
|
4208
|
-
return __generator(this, function (
|
|
4209
|
-
switch (
|
|
4110
|
+
var e_10, _j;
|
|
4111
|
+
return __generator(this, function (_k) {
|
|
4112
|
+
switch (_k.label) {
|
|
4210
4113
|
case 0:
|
|
4211
4114
|
validationCallbacks = this.fieldValidationsFinish[fieldObject.fieldCode];
|
|
4212
4115
|
if (!validationCallbacks) return [3 /*break*/, 2];
|
|
@@ -4217,17 +4120,17 @@
|
|
|
4217
4120
|
clientActionPromises.push(validationMethod(fieldObject, validationResult));
|
|
4218
4121
|
}
|
|
4219
4122
|
}
|
|
4220
|
-
catch (
|
|
4123
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
4221
4124
|
finally {
|
|
4222
4125
|
try {
|
|
4223
|
-
if (validationCallbacks_3_1 && !validationCallbacks_3_1.done && (
|
|
4126
|
+
if (validationCallbacks_3_1 && !validationCallbacks_3_1.done && (_j = validationCallbacks_3.return)) _j.call(validationCallbacks_3);
|
|
4224
4127
|
}
|
|
4225
|
-
finally { if (
|
|
4128
|
+
finally { if (e_10) throw e_10.error; }
|
|
4226
4129
|
}
|
|
4227
4130
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4228
4131
|
case 1:
|
|
4229
|
-
|
|
4230
|
-
|
|
4132
|
+
_k.sent();
|
|
4133
|
+
_k.label = 2;
|
|
4231
4134
|
case 2: return [2 /*return*/];
|
|
4232
4135
|
}
|
|
4233
4136
|
});
|
|
@@ -4235,7 +4138,7 @@
|
|
|
4235
4138
|
};
|
|
4236
4139
|
BasicFormComponent.prototype.continueFieldValidation = function (fieldCode) {
|
|
4237
4140
|
return __awaiter(this, void 0, void 0, function () {
|
|
4238
|
-
return __generator(this, function (
|
|
4141
|
+
return __generator(this, function (_j) {
|
|
4239
4142
|
return [2 /*return*/, this.startServerFieldValidation(fieldCode)];
|
|
4240
4143
|
});
|
|
4241
4144
|
});
|
|
@@ -4350,9 +4253,9 @@
|
|
|
4350
4253
|
BasicFormComponent.prototype.startTableGlobalAction = function (tableActionEvent) {
|
|
4351
4254
|
return __awaiter(this, void 0, void 0, function () {
|
|
4352
4255
|
var tableCode, actionCode, tableObject, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_1, tableActionMethods_1_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4353
|
-
var
|
|
4354
|
-
return __generator(this, function (
|
|
4355
|
-
switch (
|
|
4256
|
+
var e_11, _j;
|
|
4257
|
+
return __generator(this, function (_k) {
|
|
4258
|
+
switch (_k.label) {
|
|
4356
4259
|
case 0:
|
|
4357
4260
|
tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode;
|
|
4358
4261
|
tableObject = this.getTable(tableCode);
|
|
@@ -4381,21 +4284,21 @@
|
|
|
4381
4284
|
clientActionPromises.push(clientActionPromise);
|
|
4382
4285
|
}
|
|
4383
4286
|
}
|
|
4384
|
-
catch (
|
|
4287
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
4385
4288
|
finally {
|
|
4386
4289
|
try {
|
|
4387
|
-
if (tableActionMethods_1_1 && !tableActionMethods_1_1.done && (
|
|
4290
|
+
if (tableActionMethods_1_1 && !tableActionMethods_1_1.done && (_j = tableActionMethods_1.return)) _j.call(tableActionMethods_1);
|
|
4388
4291
|
}
|
|
4389
|
-
finally { if (
|
|
4292
|
+
finally { if (e_11) throw e_11.error; }
|
|
4390
4293
|
}
|
|
4391
4294
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4392
4295
|
case 1:
|
|
4393
|
-
clientActionResults =
|
|
4296
|
+
clientActionResults = _k.sent();
|
|
4394
4297
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4395
4298
|
if (!continueAction) {
|
|
4396
4299
|
return [2 /*return*/];
|
|
4397
4300
|
}
|
|
4398
|
-
|
|
4301
|
+
_k.label = 2;
|
|
4399
4302
|
case 2:
|
|
4400
4303
|
this.startTableServerGlobalAction(tableActionDetail);
|
|
4401
4304
|
return [2 /*return*/];
|
|
@@ -4406,8 +4309,8 @@
|
|
|
4406
4309
|
BasicFormComponent.prototype.startTableServerGlobalAction = function (tableActionDetail) {
|
|
4407
4310
|
return __awaiter(this, void 0, void 0, function () {
|
|
4408
4311
|
var tableObject, action, tableCode, actionCode, finish, actionResult, actionSubject;
|
|
4409
|
-
return __generator(this, function (
|
|
4410
|
-
switch (
|
|
4312
|
+
return __generator(this, function (_j) {
|
|
4313
|
+
switch (_j.label) {
|
|
4411
4314
|
case 0:
|
|
4412
4315
|
tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
|
|
4413
4316
|
if (!tableObject || !action) {
|
|
@@ -4423,21 +4326,21 @@
|
|
|
4423
4326
|
actionCode: actionCode
|
|
4424
4327
|
};
|
|
4425
4328
|
return [4 /*yield*/, this
|
|
4426
|
-
.requestFormAction(
|
|
4329
|
+
.requestFormAction(formActions.tableAction, actionSubject)];
|
|
4427
4330
|
case 1:
|
|
4428
|
-
actionResult =
|
|
4331
|
+
actionResult = _j.sent();
|
|
4429
4332
|
finish = !this.errorOccured();
|
|
4430
|
-
|
|
4333
|
+
_j.label = 2;
|
|
4431
4334
|
case 2:
|
|
4432
4335
|
if (!finish) return [3 /*break*/, 4];
|
|
4433
4336
|
return [4 /*yield*/, this.finishTableGlobalAction(tableActionDetail, actionResult)];
|
|
4434
4337
|
case 3:
|
|
4435
|
-
|
|
4338
|
+
_j.sent();
|
|
4436
4339
|
this.changeState(action.newState);
|
|
4437
4340
|
return [3 /*break*/, 5];
|
|
4438
4341
|
case 4:
|
|
4439
4342
|
this.displayTableServerError();
|
|
4440
|
-
|
|
4343
|
+
_j.label = 5;
|
|
4441
4344
|
case 5:
|
|
4442
4345
|
tableObject.freeWaiting();
|
|
4443
4346
|
return [2 /*return*/];
|
|
@@ -4448,9 +4351,9 @@
|
|
|
4448
4351
|
BasicFormComponent.prototype.finishTableGlobalAction = function (tableActionDetail, actionResult) {
|
|
4449
4352
|
return __awaiter(this, void 0, void 0, function () {
|
|
4450
4353
|
var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_2, tableActionMethods_2_1, tableActionMethod;
|
|
4451
|
-
var
|
|
4452
|
-
return __generator(this, function (
|
|
4453
|
-
switch (
|
|
4354
|
+
var e_12, _j;
|
|
4355
|
+
return __generator(this, function (_k) {
|
|
4356
|
+
switch (_k.label) {
|
|
4454
4357
|
case 0:
|
|
4455
4358
|
tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
|
|
4456
4359
|
tableEventHandlers = this.tableActionsFinish[tableCode];
|
|
@@ -4463,17 +4366,17 @@
|
|
|
4463
4366
|
clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
|
|
4464
4367
|
}
|
|
4465
4368
|
}
|
|
4466
|
-
catch (
|
|
4369
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
4467
4370
|
finally {
|
|
4468
4371
|
try {
|
|
4469
|
-
if (tableActionMethods_2_1 && !tableActionMethods_2_1.done && (
|
|
4372
|
+
if (tableActionMethods_2_1 && !tableActionMethods_2_1.done && (_j = tableActionMethods_2.return)) _j.call(tableActionMethods_2);
|
|
4470
4373
|
}
|
|
4471
|
-
finally { if (
|
|
4374
|
+
finally { if (e_12) throw e_12.error; }
|
|
4472
4375
|
}
|
|
4473
4376
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4474
4377
|
case 1:
|
|
4475
|
-
|
|
4476
|
-
|
|
4378
|
+
_k.sent();
|
|
4379
|
+
_k.label = 2;
|
|
4477
4380
|
case 2: return [2 /*return*/];
|
|
4478
4381
|
}
|
|
4479
4382
|
});
|
|
@@ -4482,9 +4385,9 @@
|
|
|
4482
4385
|
BasicFormComponent.prototype.startTableAction = function (tableActionEvent) {
|
|
4483
4386
|
return __awaiter(this, void 0, void 0, function () {
|
|
4484
4387
|
var tableCode, actionCode, actionDetail, tableObject, recordId, recordData, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_3, tableActionMethods_3_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4485
|
-
var
|
|
4486
|
-
return __generator(this, function (
|
|
4487
|
-
switch (
|
|
4388
|
+
var e_13, _j;
|
|
4389
|
+
return __generator(this, function (_k) {
|
|
4390
|
+
switch (_k.label) {
|
|
4488
4391
|
case 0:
|
|
4489
4392
|
tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode, actionDetail = tableActionEvent.actionDetail;
|
|
4490
4393
|
tableObject = this.getTable(tableCode);
|
|
@@ -4516,21 +4419,21 @@
|
|
|
4516
4419
|
clientActionPromises.push(clientActionPromise);
|
|
4517
4420
|
}
|
|
4518
4421
|
}
|
|
4519
|
-
catch (
|
|
4422
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
4520
4423
|
finally {
|
|
4521
4424
|
try {
|
|
4522
|
-
if (tableActionMethods_3_1 && !tableActionMethods_3_1.done && (
|
|
4425
|
+
if (tableActionMethods_3_1 && !tableActionMethods_3_1.done && (_j = tableActionMethods_3.return)) _j.call(tableActionMethods_3);
|
|
4523
4426
|
}
|
|
4524
|
-
finally { if (
|
|
4427
|
+
finally { if (e_13) throw e_13.error; }
|
|
4525
4428
|
}
|
|
4526
4429
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4527
4430
|
case 1:
|
|
4528
|
-
clientActionResults =
|
|
4431
|
+
clientActionResults = _k.sent();
|
|
4529
4432
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4530
4433
|
if (!continueAction) {
|
|
4531
4434
|
return [2 /*return*/];
|
|
4532
4435
|
}
|
|
4533
|
-
|
|
4436
|
+
_k.label = 2;
|
|
4534
4437
|
case 2:
|
|
4535
4438
|
this.startTableServerAction(tableActionDetail);
|
|
4536
4439
|
return [2 /*return*/];
|
|
@@ -4541,8 +4444,8 @@
|
|
|
4541
4444
|
BasicFormComponent.prototype.startTableServerAction = function (tableActionDetail) {
|
|
4542
4445
|
return __awaiter(this, void 0, void 0, function () {
|
|
4543
4446
|
var tableObject, action, tableCode, actionCode, recordId, recordData, finish, actionResult, actionSubject;
|
|
4544
|
-
return __generator(this, function (
|
|
4545
|
-
switch (
|
|
4447
|
+
return __generator(this, function (_j) {
|
|
4448
|
+
switch (_j.label) {
|
|
4546
4449
|
case 0:
|
|
4547
4450
|
tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode, recordId = tableActionDetail.recordId, recordData = tableActionDetail.recordData;
|
|
4548
4451
|
if (!tableObject || !action) {
|
|
@@ -4554,17 +4457,17 @@
|
|
|
4554
4457
|
if (!action.backend) return [3 /*break*/, 2];
|
|
4555
4458
|
actionSubject = {
|
|
4556
4459
|
tableCode: tableCode,
|
|
4557
|
-
actionType:
|
|
4460
|
+
actionType: this.formConfig.tableActions.inline,
|
|
4558
4461
|
actionCode: actionCode,
|
|
4559
4462
|
tableRecordId: recordId,
|
|
4560
4463
|
tableRecordData: recordData
|
|
4561
4464
|
};
|
|
4562
4465
|
return [4 /*yield*/, this
|
|
4563
|
-
.requestFormAction(
|
|
4466
|
+
.requestFormAction(formActions.tableAction, actionSubject)];
|
|
4564
4467
|
case 1:
|
|
4565
|
-
actionResult =
|
|
4468
|
+
actionResult = _j.sent();
|
|
4566
4469
|
finish = !this.errorOccured();
|
|
4567
|
-
|
|
4470
|
+
_j.label = 2;
|
|
4568
4471
|
case 2:
|
|
4569
4472
|
if (finish) {
|
|
4570
4473
|
this.finishTableAction(tableActionDetail, actionResult);
|
|
@@ -4585,9 +4488,9 @@
|
|
|
4585
4488
|
BasicFormComponent.prototype.finishTableAction = function (tableActionDetail, actionResult) {
|
|
4586
4489
|
return __awaiter(this, void 0, void 0, function () {
|
|
4587
4490
|
var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_4, tableActionMethods_4_1, tableActionMethod;
|
|
4588
|
-
var
|
|
4589
|
-
return __generator(this, function (
|
|
4590
|
-
switch (
|
|
4491
|
+
var e_14, _j;
|
|
4492
|
+
return __generator(this, function (_k) {
|
|
4493
|
+
switch (_k.label) {
|
|
4591
4494
|
case 0:
|
|
4592
4495
|
tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
|
|
4593
4496
|
tableEventHandlers = this.tableActionsFinish[tableCode];
|
|
@@ -4600,17 +4503,17 @@
|
|
|
4600
4503
|
clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
|
|
4601
4504
|
}
|
|
4602
4505
|
}
|
|
4603
|
-
catch (
|
|
4506
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
4604
4507
|
finally {
|
|
4605
4508
|
try {
|
|
4606
|
-
if (tableActionMethods_4_1 && !tableActionMethods_4_1.done && (
|
|
4509
|
+
if (tableActionMethods_4_1 && !tableActionMethods_4_1.done && (_j = tableActionMethods_4.return)) _j.call(tableActionMethods_4);
|
|
4607
4510
|
}
|
|
4608
|
-
finally { if (
|
|
4511
|
+
finally { if (e_14) throw e_14.error; }
|
|
4609
4512
|
}
|
|
4610
4513
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4611
4514
|
case 1:
|
|
4612
|
-
|
|
4613
|
-
|
|
4515
|
+
_k.sent();
|
|
4516
|
+
_k.label = 2;
|
|
4614
4517
|
case 2: return [2 /*return*/];
|
|
4615
4518
|
}
|
|
4616
4519
|
});
|
|
@@ -4619,9 +4522,9 @@
|
|
|
4619
4522
|
BasicFormComponent.prototype.startTableRecordSelection = function (tableActionEvent) {
|
|
4620
4523
|
return __awaiter(this, void 0, void 0, function () {
|
|
4621
4524
|
var tableCode, actionDetail, tableObject, recordId, recordData, tableSelectionDetail, tableEventHandlers, clientActionPromises, tableEventHandlers_1, tableEventHandlers_1_1, tableSelectionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4622
|
-
var
|
|
4623
|
-
return __generator(this, function (
|
|
4624
|
-
switch (
|
|
4525
|
+
var e_15, _j;
|
|
4526
|
+
return __generator(this, function (_k) {
|
|
4527
|
+
switch (_k.label) {
|
|
4625
4528
|
case 0:
|
|
4626
4529
|
tableCode = tableActionEvent.tableCode, actionDetail = tableActionEvent.actionDetail;
|
|
4627
4530
|
tableObject = this.getTable(tableCode);
|
|
@@ -4646,21 +4549,21 @@
|
|
|
4646
4549
|
clientActionPromises.push(clientActionPromise);
|
|
4647
4550
|
}
|
|
4648
4551
|
}
|
|
4649
|
-
catch (
|
|
4552
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
4650
4553
|
finally {
|
|
4651
4554
|
try {
|
|
4652
|
-
if (tableEventHandlers_1_1 && !tableEventHandlers_1_1.done && (
|
|
4555
|
+
if (tableEventHandlers_1_1 && !tableEventHandlers_1_1.done && (_j = tableEventHandlers_1.return)) _j.call(tableEventHandlers_1);
|
|
4653
4556
|
}
|
|
4654
|
-
finally { if (
|
|
4557
|
+
finally { if (e_15) throw e_15.error; }
|
|
4655
4558
|
}
|
|
4656
4559
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4657
4560
|
case 1:
|
|
4658
|
-
clientActionResults =
|
|
4561
|
+
clientActionResults = _k.sent();
|
|
4659
4562
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4660
4563
|
if (!continueAction) {
|
|
4661
4564
|
return [2 /*return*/];
|
|
4662
4565
|
}
|
|
4663
|
-
|
|
4566
|
+
_k.label = 2;
|
|
4664
4567
|
case 2:
|
|
4665
4568
|
this.startTableServerRecordSelection(tableSelectionDetail);
|
|
4666
4569
|
return [2 /*return*/];
|
|
@@ -4671,8 +4574,8 @@
|
|
|
4671
4574
|
BasicFormComponent.prototype.startTableServerRecordSelection = function (tableSelectionDetail) {
|
|
4672
4575
|
return __awaiter(this, void 0, void 0, function () {
|
|
4673
4576
|
var tableObject, tableCode, recordId, recordData, finish, actionResult, actionSubject;
|
|
4674
|
-
return __generator(this, function (
|
|
4675
|
-
switch (
|
|
4577
|
+
return __generator(this, function (_j) {
|
|
4578
|
+
switch (_j.label) {
|
|
4676
4579
|
case 0:
|
|
4677
4580
|
tableObject = tableSelectionDetail.tableObject, tableCode = tableSelectionDetail.tableCode, recordId = tableSelectionDetail.recordId, recordData = tableSelectionDetail.recordData;
|
|
4678
4581
|
if (!tableObject) {
|
|
@@ -4684,17 +4587,17 @@
|
|
|
4684
4587
|
if (!tableObject.selectionBackend) return [3 /*break*/, 2];
|
|
4685
4588
|
actionSubject = {
|
|
4686
4589
|
tableCode: tableCode,
|
|
4687
|
-
actionType:
|
|
4590
|
+
actionType: this.formConfig.tableActions.rowSelection,
|
|
4688
4591
|
actionCode: null,
|
|
4689
4592
|
tableRecordId: recordId,
|
|
4690
4593
|
tableRecordData: recordData
|
|
4691
4594
|
};
|
|
4692
4595
|
return [4 /*yield*/, this
|
|
4693
|
-
.requestFormAction(
|
|
4596
|
+
.requestFormAction(formActions.tableAction, actionSubject)];
|
|
4694
4597
|
case 1:
|
|
4695
|
-
actionResult =
|
|
4598
|
+
actionResult = _j.sent();
|
|
4696
4599
|
finish = !this.errorOccured();
|
|
4697
|
-
|
|
4600
|
+
_j.label = 2;
|
|
4698
4601
|
case 2:
|
|
4699
4602
|
if (finish) {
|
|
4700
4603
|
this.finishTableRecordSelection(tableSelectionDetail, actionResult);
|
|
@@ -4711,9 +4614,9 @@
|
|
|
4711
4614
|
BasicFormComponent.prototype.finishTableRecordSelection = function (tableSelectionDetail, actionResult) {
|
|
4712
4615
|
return __awaiter(this, void 0, void 0, function () {
|
|
4713
4616
|
var tableCode, tableEventHandlers, clientActionPromises, tableEventHandlers_2, tableEventHandlers_2_1, tableSelectionMethod;
|
|
4714
|
-
var
|
|
4715
|
-
return __generator(this, function (
|
|
4716
|
-
switch (
|
|
4617
|
+
var e_16, _j;
|
|
4618
|
+
return __generator(this, function (_k) {
|
|
4619
|
+
switch (_k.label) {
|
|
4717
4620
|
case 0:
|
|
4718
4621
|
tableCode = tableSelectionDetail.tableCode;
|
|
4719
4622
|
tableEventHandlers = this.tableSelectionsFinish[tableCode];
|
|
@@ -4725,17 +4628,17 @@
|
|
|
4725
4628
|
clientActionPromises.push(tableSelectionMethod(tableSelectionDetail, actionResult));
|
|
4726
4629
|
}
|
|
4727
4630
|
}
|
|
4728
|
-
catch (
|
|
4631
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
4729
4632
|
finally {
|
|
4730
4633
|
try {
|
|
4731
|
-
if (tableEventHandlers_2_1 && !tableEventHandlers_2_1.done && (
|
|
4634
|
+
if (tableEventHandlers_2_1 && !tableEventHandlers_2_1.done && (_j = tableEventHandlers_2.return)) _j.call(tableEventHandlers_2);
|
|
4732
4635
|
}
|
|
4733
|
-
finally { if (
|
|
4636
|
+
finally { if (e_16) throw e_16.error; }
|
|
4734
4637
|
}
|
|
4735
4638
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4736
4639
|
case 1:
|
|
4737
|
-
|
|
4738
|
-
|
|
4640
|
+
_k.sent();
|
|
4641
|
+
_k.label = 2;
|
|
4739
4642
|
case 2: return [2 /*return*/];
|
|
4740
4643
|
}
|
|
4741
4644
|
});
|
|
@@ -4744,9 +4647,9 @@
|
|
|
4744
4647
|
BasicFormComponent.prototype.startTableSelectionAction = function (tableActionEvent) {
|
|
4745
4648
|
return __awaiter(this, void 0, void 0, function () {
|
|
4746
4649
|
var tableCode, actionCode, actionDetail, tableObject, selectedRecords, action, tableActionDetail, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_5, tableActionMethods_5_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4747
|
-
var
|
|
4748
|
-
return __generator(this, function (
|
|
4749
|
-
switch (
|
|
4650
|
+
var e_17, _j;
|
|
4651
|
+
return __generator(this, function (_k) {
|
|
4652
|
+
switch (_k.label) {
|
|
4750
4653
|
case 0:
|
|
4751
4654
|
tableCode = tableActionEvent.tableCode, actionCode = tableActionEvent.actionCode, actionDetail = tableActionEvent.actionDetail;
|
|
4752
4655
|
tableObject = this.getTable(tableCode);
|
|
@@ -4777,21 +4680,21 @@
|
|
|
4777
4680
|
clientActionPromises.push(clientActionPromise);
|
|
4778
4681
|
}
|
|
4779
4682
|
}
|
|
4780
|
-
catch (
|
|
4683
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
4781
4684
|
finally {
|
|
4782
4685
|
try {
|
|
4783
|
-
if (tableActionMethods_5_1 && !tableActionMethods_5_1.done && (
|
|
4686
|
+
if (tableActionMethods_5_1 && !tableActionMethods_5_1.done && (_j = tableActionMethods_5.return)) _j.call(tableActionMethods_5);
|
|
4784
4687
|
}
|
|
4785
|
-
finally { if (
|
|
4688
|
+
finally { if (e_17) throw e_17.error; }
|
|
4786
4689
|
}
|
|
4787
4690
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4788
4691
|
case 1:
|
|
4789
|
-
clientActionResults =
|
|
4692
|
+
clientActionResults = _k.sent();
|
|
4790
4693
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4791
4694
|
if (!continueAction) {
|
|
4792
4695
|
return [2 /*return*/];
|
|
4793
4696
|
}
|
|
4794
|
-
|
|
4697
|
+
_k.label = 2;
|
|
4795
4698
|
case 2:
|
|
4796
4699
|
this.startTableServerSelectionAction(tableActionDetail);
|
|
4797
4700
|
return [2 /*return*/];
|
|
@@ -4802,8 +4705,8 @@
|
|
|
4802
4705
|
BasicFormComponent.prototype.startTableServerSelectionAction = function (tableActionDetail) {
|
|
4803
4706
|
return __awaiter(this, void 0, void 0, function () {
|
|
4804
4707
|
var tableObject, action, tableCode, actionCode, selectedRecords, finish, actionResult, actionSubject;
|
|
4805
|
-
return __generator(this, function (
|
|
4806
|
-
switch (
|
|
4708
|
+
return __generator(this, function (_j) {
|
|
4709
|
+
switch (_j.label) {
|
|
4807
4710
|
case 0:
|
|
4808
4711
|
tableObject = tableActionDetail.tableObject, action = tableActionDetail.action, tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode, selectedRecords = tableActionDetail.selectedRecords;
|
|
4809
4712
|
if (!tableObject || !action) {
|
|
@@ -4815,16 +4718,16 @@
|
|
|
4815
4718
|
if (!action.backend) return [3 /*break*/, 2];
|
|
4816
4719
|
actionSubject = {
|
|
4817
4720
|
tableCode: tableCode,
|
|
4818
|
-
actionType:
|
|
4721
|
+
actionType: this.formConfig.tableActions.selection,
|
|
4819
4722
|
actionCode: actionCode,
|
|
4820
4723
|
selectedRecords: selectedRecords
|
|
4821
4724
|
};
|
|
4822
4725
|
return [4 /*yield*/, this
|
|
4823
|
-
.requestFormAction(
|
|
4726
|
+
.requestFormAction(formActions.tableAction, actionSubject)];
|
|
4824
4727
|
case 1:
|
|
4825
|
-
actionResult =
|
|
4728
|
+
actionResult = _j.sent();
|
|
4826
4729
|
finish = !this.errorOccured();
|
|
4827
|
-
|
|
4730
|
+
_j.label = 2;
|
|
4828
4731
|
case 2:
|
|
4829
4732
|
if (finish) {
|
|
4830
4733
|
this.finishTableSelectionAction(tableActionDetail, actionResult);
|
|
@@ -4842,9 +4745,9 @@
|
|
|
4842
4745
|
BasicFormComponent.prototype.finishTableSelectionAction = function (tableActionDetail, actionResult) {
|
|
4843
4746
|
return __awaiter(this, void 0, void 0, function () {
|
|
4844
4747
|
var tableCode, actionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_6, tableActionMethods_6_1, tableActionMethod;
|
|
4845
|
-
var
|
|
4846
|
-
return __generator(this, function (
|
|
4847
|
-
switch (
|
|
4748
|
+
var e_18, _j;
|
|
4749
|
+
return __generator(this, function (_k) {
|
|
4750
|
+
switch (_k.label) {
|
|
4848
4751
|
case 0:
|
|
4849
4752
|
tableCode = tableActionDetail.tableCode, actionCode = tableActionDetail.actionCode;
|
|
4850
4753
|
tableEventHandlers = this.tableActionsFinish[tableCode];
|
|
@@ -4857,17 +4760,17 @@
|
|
|
4857
4760
|
clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
|
|
4858
4761
|
}
|
|
4859
4762
|
}
|
|
4860
|
-
catch (
|
|
4763
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
4861
4764
|
finally {
|
|
4862
4765
|
try {
|
|
4863
|
-
if (tableActionMethods_6_1 && !tableActionMethods_6_1.done && (
|
|
4766
|
+
if (tableActionMethods_6_1 && !tableActionMethods_6_1.done && (_j = tableActionMethods_6.return)) _j.call(tableActionMethods_6);
|
|
4864
4767
|
}
|
|
4865
|
-
finally { if (
|
|
4768
|
+
finally { if (e_18) throw e_18.error; }
|
|
4866
4769
|
}
|
|
4867
4770
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4868
4771
|
case 1:
|
|
4869
|
-
|
|
4870
|
-
|
|
4772
|
+
_k.sent();
|
|
4773
|
+
_k.label = 2;
|
|
4871
4774
|
case 2: return [2 /*return*/];
|
|
4872
4775
|
}
|
|
4873
4776
|
});
|
|
@@ -4876,9 +4779,9 @@
|
|
|
4876
4779
|
BasicFormComponent.prototype.startTableGetData = function (tableActionEvent) {
|
|
4877
4780
|
return __awaiter(this, void 0, void 0, function () {
|
|
4878
4781
|
var tableCode, tableObject, tableActionDetail, tableEventHandlers, clientActionPromises, tableEventHandlers_3, tableEventHandlers_3_1, tableActionMethod, clientActionPromise, clientActionResults, continueAction;
|
|
4879
|
-
var
|
|
4880
|
-
return __generator(this, function (
|
|
4881
|
-
switch (
|
|
4782
|
+
var e_19, _j;
|
|
4783
|
+
return __generator(this, function (_k) {
|
|
4784
|
+
switch (_k.label) {
|
|
4882
4785
|
case 0:
|
|
4883
4786
|
tableCode = tableActionEvent.tableCode;
|
|
4884
4787
|
tableObject = this.getTable(tableCode);
|
|
@@ -4897,21 +4800,21 @@
|
|
|
4897
4800
|
clientActionPromises.push(clientActionPromise);
|
|
4898
4801
|
}
|
|
4899
4802
|
}
|
|
4900
|
-
catch (
|
|
4803
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
4901
4804
|
finally {
|
|
4902
4805
|
try {
|
|
4903
|
-
if (tableEventHandlers_3_1 && !tableEventHandlers_3_1.done && (
|
|
4806
|
+
if (tableEventHandlers_3_1 && !tableEventHandlers_3_1.done && (_j = tableEventHandlers_3.return)) _j.call(tableEventHandlers_3);
|
|
4904
4807
|
}
|
|
4905
|
-
finally { if (
|
|
4808
|
+
finally { if (e_19) throw e_19.error; }
|
|
4906
4809
|
}
|
|
4907
4810
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4908
4811
|
case 1:
|
|
4909
|
-
clientActionResults =
|
|
4812
|
+
clientActionResults = _k.sent();
|
|
4910
4813
|
continueAction = clientActionResults.reduce(function (total, curr) { return (total && curr); }, true);
|
|
4911
4814
|
if (!continueAction) {
|
|
4912
4815
|
return [2 /*return*/];
|
|
4913
4816
|
}
|
|
4914
|
-
|
|
4817
|
+
_k.label = 2;
|
|
4915
4818
|
case 2:
|
|
4916
4819
|
this.startTableServerGetData(tableActionDetail);
|
|
4917
4820
|
return [2 /*return*/];
|
|
@@ -4922,16 +4825,16 @@
|
|
|
4922
4825
|
BasicFormComponent.prototype.startTableServerGetData = function (tableActionDetail) {
|
|
4923
4826
|
return __awaiter(this, void 0, void 0, function () {
|
|
4924
4827
|
var tableObject, tableCode, actionSubject, actionResult;
|
|
4925
|
-
return __generator(this, function (
|
|
4926
|
-
switch (
|
|
4828
|
+
return __generator(this, function (_j) {
|
|
4829
|
+
switch (_j.label) {
|
|
4927
4830
|
case 0:
|
|
4928
4831
|
tableObject = tableActionDetail.tableObject, tableCode = tableActionDetail.tableCode;
|
|
4929
4832
|
tableObject.putOnWait();
|
|
4930
4833
|
actionSubject = { tableCode: tableCode };
|
|
4931
4834
|
return [4 /*yield*/, this
|
|
4932
|
-
.requestFormAction(
|
|
4835
|
+
.requestFormAction(formActions.getTableData, actionSubject)];
|
|
4933
4836
|
case 1:
|
|
4934
|
-
actionResult =
|
|
4837
|
+
actionResult = _j.sent();
|
|
4935
4838
|
if (this.errorOccured()) {
|
|
4936
4839
|
this.displayTableServerError();
|
|
4937
4840
|
}
|
|
@@ -4947,9 +4850,9 @@
|
|
|
4947
4850
|
BasicFormComponent.prototype.finishTableGetData = function (tableActionDetail, actionResult) {
|
|
4948
4851
|
return __awaiter(this, void 0, void 0, function () {
|
|
4949
4852
|
var tableCode, tableActionCode, tableEventHandlers, tableActionMethods, clientActionPromises, tableActionMethods_7, tableActionMethods_7_1, tableActionMethod;
|
|
4950
|
-
var
|
|
4951
|
-
return __generator(this, function (
|
|
4952
|
-
switch (
|
|
4853
|
+
var e_20, _j;
|
|
4854
|
+
return __generator(this, function (_k) {
|
|
4855
|
+
switch (_k.label) {
|
|
4953
4856
|
case 0:
|
|
4954
4857
|
tableCode = tableActionDetail.tableCode, tableActionCode = tableActionDetail.tableActionCode;
|
|
4955
4858
|
tableEventHandlers = this.tableActionsFinish[tableCode];
|
|
@@ -4962,17 +4865,17 @@
|
|
|
4962
4865
|
clientActionPromises.push(tableActionMethod(tableActionDetail, actionResult));
|
|
4963
4866
|
}
|
|
4964
4867
|
}
|
|
4965
|
-
catch (
|
|
4868
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
4966
4869
|
finally {
|
|
4967
4870
|
try {
|
|
4968
|
-
if (tableActionMethods_7_1 && !tableActionMethods_7_1.done && (
|
|
4871
|
+
if (tableActionMethods_7_1 && !tableActionMethods_7_1.done && (_j = tableActionMethods_7.return)) _j.call(tableActionMethods_7);
|
|
4969
4872
|
}
|
|
4970
|
-
finally { if (
|
|
4873
|
+
finally { if (e_20) throw e_20.error; }
|
|
4971
4874
|
}
|
|
4972
4875
|
return [4 /*yield*/, Promise.all(clientActionPromises)];
|
|
4973
4876
|
case 1:
|
|
4974
|
-
|
|
4975
|
-
|
|
4877
|
+
_k.sent();
|
|
4878
|
+
_k.label = 2;
|
|
4976
4879
|
case 2: return [2 /*return*/];
|
|
4977
4880
|
}
|
|
4978
4881
|
});
|
|
@@ -4980,24 +4883,24 @@
|
|
|
4980
4883
|
};
|
|
4981
4884
|
BasicFormComponent.prototype.checkSectionRequiredFields = function (sectionCode, reqFieldMessage) {
|
|
4982
4885
|
this.cleanErrorFields(null, sectionCode);
|
|
4983
|
-
var requiredFieldMessage = reqFieldMessage
|
|
4886
|
+
var requiredFieldMessage = reqFieldMessage !== null && reqFieldMessage !== void 0 ? reqFieldMessage : this.formConfig.formStandardErrors.requiredField;
|
|
4984
4887
|
var numErrors = this.tagFieldsWithError(this.getRequiredEmptyFields(null, sectionCode), null, requiredFieldMessage);
|
|
4985
4888
|
return (numErrors === 0);
|
|
4986
4889
|
};
|
|
4987
4890
|
BasicFormComponent.prototype.validateSectionConsistency = function (sectionCode, reqFieldMessage) {
|
|
4988
|
-
var
|
|
4891
|
+
var e_21, _j, e_22, _k;
|
|
4989
4892
|
this.resetError();
|
|
4990
4893
|
var completeFields = this.checkSectionRequiredFields(sectionCode, reqFieldMessage);
|
|
4991
4894
|
if (!completeFields) {
|
|
4992
|
-
this.setError(
|
|
4895
|
+
this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.requiredFields);
|
|
4993
4896
|
return;
|
|
4994
4897
|
}
|
|
4995
4898
|
var validationError = false;
|
|
4996
4899
|
var requiredEmptyFields = this.getRequiredEmptyFields(null, sectionCode);
|
|
4997
4900
|
if (requiredEmptyFields.length > 0) {
|
|
4998
4901
|
validationError = true;
|
|
4999
|
-
this.setError(
|
|
5000
|
-
this.tagFieldsWithError(requiredEmptyFields, null,
|
|
4902
|
+
this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.requiredFields);
|
|
4903
|
+
this.tagFieldsWithError(requiredEmptyFields, null, this.formConfig.formStandardErrors.requiredField);
|
|
5001
4904
|
try {
|
|
5002
4905
|
for (var requiredEmptyFields_1 = __values(requiredEmptyFields), requiredEmptyFields_1_1 = requiredEmptyFields_1.next(); !requiredEmptyFields_1_1.done; requiredEmptyFields_1_1 = requiredEmptyFields_1.next()) {
|
|
5003
4906
|
var fieldCode = requiredEmptyFields_1_1.value;
|
|
@@ -5009,18 +4912,18 @@
|
|
|
5009
4912
|
}
|
|
5010
4913
|
}
|
|
5011
4914
|
}
|
|
5012
|
-
catch (
|
|
4915
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
5013
4916
|
finally {
|
|
5014
4917
|
try {
|
|
5015
|
-
if (requiredEmptyFields_1_1 && !requiredEmptyFields_1_1.done && (
|
|
4918
|
+
if (requiredEmptyFields_1_1 && !requiredEmptyFields_1_1.done && (_j = requiredEmptyFields_1.return)) _j.call(requiredEmptyFields_1);
|
|
5016
4919
|
}
|
|
5017
|
-
finally { if (
|
|
4920
|
+
finally { if (e_21) throw e_21.error; }
|
|
5018
4921
|
}
|
|
5019
4922
|
}
|
|
5020
4923
|
var validationIssueFields = this.getFieldsWithValidationIssues(null, sectionCode);
|
|
5021
4924
|
if (!validationError && validationIssueFields.length > 0) {
|
|
5022
4925
|
validationError = true;
|
|
5023
|
-
this.setError(
|
|
4926
|
+
this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.validationFields);
|
|
5024
4927
|
try {
|
|
5025
4928
|
for (var validationIssueFields_1 = __values(validationIssueFields), validationIssueFields_1_1 = validationIssueFields_1.next(); !validationIssueFields_1_1.done; validationIssueFields_1_1 = validationIssueFields_1.next()) {
|
|
5026
4929
|
var fieldCode = validationIssueFields_1_1.value;
|
|
@@ -5032,18 +4935,18 @@
|
|
|
5032
4935
|
}
|
|
5033
4936
|
}
|
|
5034
4937
|
}
|
|
5035
|
-
catch (
|
|
4938
|
+
catch (e_22_1) { e_22 = { error: e_22_1 }; }
|
|
5036
4939
|
finally {
|
|
5037
4940
|
try {
|
|
5038
|
-
if (validationIssueFields_1_1 && !validationIssueFields_1_1.done && (
|
|
4941
|
+
if (validationIssueFields_1_1 && !validationIssueFields_1_1.done && (_k = validationIssueFields_1.return)) _k.call(validationIssueFields_1);
|
|
5039
4942
|
}
|
|
5040
|
-
finally { if (
|
|
4943
|
+
finally { if (e_22) throw e_22.error; }
|
|
5041
4944
|
}
|
|
5042
4945
|
}
|
|
5043
4946
|
return validationError;
|
|
5044
4947
|
};
|
|
5045
4948
|
BasicFormComponent.prototype.copyTableRecordToFields = function (tableObj, mappingTable) {
|
|
5046
|
-
var
|
|
4949
|
+
var e_23, _j;
|
|
5047
4950
|
if (mappingTable === void 0) { mappingTable = null; }
|
|
5048
4951
|
var _a, _b;
|
|
5049
4952
|
var tableObject = this.getTable(tableObj.tableCode);
|
|
@@ -5057,12 +4960,12 @@
|
|
|
5057
4960
|
this.setFieldValue(fieldCode, columnValue);
|
|
5058
4961
|
}
|
|
5059
4962
|
}
|
|
5060
|
-
catch (
|
|
4963
|
+
catch (e_23_1) { e_23 = { error: e_23_1 }; }
|
|
5061
4964
|
finally {
|
|
5062
4965
|
try {
|
|
5063
|
-
if (columnNames_1_1 && !columnNames_1_1.done && (
|
|
4966
|
+
if (columnNames_1_1 && !columnNames_1_1.done && (_j = columnNames_1.return)) _j.call(columnNames_1);
|
|
5064
4967
|
}
|
|
5065
|
-
finally { if (
|
|
4968
|
+
finally { if (e_23) throw e_23.error; }
|
|
5066
4969
|
}
|
|
5067
4970
|
return true;
|
|
5068
4971
|
};
|
|
@@ -5070,7 +4973,7 @@
|
|
|
5070
4973
|
* Soporte registros en tablas que se editan en campos del formulario
|
|
5071
4974
|
*/
|
|
5072
4975
|
BasicFormComponent.prototype.defineEditionTable = function (tableEditionDef) {
|
|
5073
|
-
var
|
|
4976
|
+
var e_24, _j;
|
|
5074
4977
|
var _this = this;
|
|
5075
4978
|
var columnFieldMapping = tableEditionDef.columnFieldMapping, recordCaptureFields = tableEditionDef.recordCaptureFields, startCollapsed = tableEditionDef.startCollapsed;
|
|
5076
4979
|
tableEditionDef.startCollapsed = (typeof startCollapsed !== 'undefined')
|
|
@@ -5080,17 +4983,17 @@
|
|
|
5080
4983
|
try {
|
|
5081
4984
|
for (var columnFieldMapping_1 = __values(columnFieldMapping), columnFieldMapping_1_1 = columnFieldMapping_1.next(); !columnFieldMapping_1_1.done; columnFieldMapping_1_1 = columnFieldMapping_1.next()) {
|
|
5082
4985
|
var columnMap = columnFieldMapping_1_1.value;
|
|
5083
|
-
var
|
|
4986
|
+
var _k = __read(columnMap, 2), columnName = _k[0], formField = _k[1];
|
|
5084
4987
|
fieldsMappingTable[columnName] = formField;
|
|
5085
4988
|
fieldsToClear.push(formField);
|
|
5086
4989
|
}
|
|
5087
4990
|
}
|
|
5088
|
-
catch (
|
|
4991
|
+
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
5089
4992
|
finally {
|
|
5090
4993
|
try {
|
|
5091
|
-
if (columnFieldMapping_1_1 && !columnFieldMapping_1_1.done && (
|
|
4994
|
+
if (columnFieldMapping_1_1 && !columnFieldMapping_1_1.done && (_j = columnFieldMapping_1.return)) _j.call(columnFieldMapping_1);
|
|
5092
4995
|
}
|
|
5093
|
-
finally { if (
|
|
4996
|
+
finally { if (e_24) throw e_24.error; }
|
|
5094
4997
|
}
|
|
5095
4998
|
tableEditionDef.fieldsMappingTable = fieldsMappingTable;
|
|
5096
4999
|
tableEditionDef.fieldsToClear = fieldsToClear;
|
|
@@ -5141,7 +5044,7 @@
|
|
|
5141
5044
|
}
|
|
5142
5045
|
};
|
|
5143
5046
|
BasicFormComponent.prototype.enableRecordEdition = function (tableEditionDef, tableActionObject) {
|
|
5144
|
-
var
|
|
5047
|
+
var e_25, _j;
|
|
5145
5048
|
if (tableActionObject === void 0) { tableActionObject = null; }
|
|
5146
5049
|
if (tableActionObject) {
|
|
5147
5050
|
this.copyTableRecordToFields(tableActionObject, tableEditionDef.fieldsMappingTable);
|
|
@@ -5153,17 +5056,17 @@
|
|
|
5153
5056
|
if (tableEditionDef.fieldsToTriggerValidation
|
|
5154
5057
|
&& tableEditionDef.fieldsToTriggerValidation.length > 0) {
|
|
5155
5058
|
try {
|
|
5156
|
-
for (var
|
|
5157
|
-
var fieldName =
|
|
5059
|
+
for (var _k = __values(tableEditionDef.fieldsToTriggerValidation), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
5060
|
+
var fieldName = _l.value;
|
|
5158
5061
|
this.startFieldValidation(fieldName);
|
|
5159
5062
|
}
|
|
5160
5063
|
}
|
|
5161
|
-
catch (
|
|
5064
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
5162
5065
|
finally {
|
|
5163
5066
|
try {
|
|
5164
|
-
if (
|
|
5067
|
+
if (_l && !_l.done && (_j = _k.return)) _j.call(_k);
|
|
5165
5068
|
}
|
|
5166
|
-
finally { if (
|
|
5069
|
+
finally { if (e_25) throw e_25.error; }
|
|
5167
5070
|
}
|
|
5168
5071
|
}
|
|
5169
5072
|
return true;
|
|
@@ -5182,13 +5085,13 @@
|
|
|
5182
5085
|
var requiredEmptyFields = this.getRequiredEmptyFields(recordCaptureFields, null);
|
|
5183
5086
|
if (requiredEmptyFields.length > 0) {
|
|
5184
5087
|
validationOk = false;
|
|
5185
|
-
this.setError(
|
|
5186
|
-
this.tagFieldsWithError(requiredEmptyFields, null,
|
|
5088
|
+
this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.requiredFields);
|
|
5089
|
+
this.tagFieldsWithError(requiredEmptyFields, null, this.formConfig.formStandardErrors.requiredField);
|
|
5187
5090
|
}
|
|
5188
5091
|
var validationIssueFields = this.getFieldsWithValidationIssues(recordCaptureFields, null);
|
|
5189
5092
|
if (validationIssueFields.length > 0) {
|
|
5190
5093
|
validationOk = false;
|
|
5191
|
-
this.setError(
|
|
5094
|
+
this.setError(this.formConfig.formStandardErrors.typeWarning, this.formConfig.formStandardErrors.validationTitle, this.formConfig.formStandardErrors.validationFields);
|
|
5192
5095
|
}
|
|
5193
5096
|
return validationOk;
|
|
5194
5097
|
};
|