tuain-ng-forms-lib 12.0.1 → 12.0.5
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 +214 -279
- package/bundles/tuain-ng-forms-lib.umd.js.map +1 -1
- package/esm2015/lib/classes/forms/field.js +7 -6
- package/esm2015/lib/classes/forms/form.constants.js +3 -1
- package/esm2015/lib/classes/forms/form.js +2 -3
- package/esm2015/lib/components/elements/field.component.js +12 -40
- package/esm2015/lib/components/forms/basic-form.js +10 -46
- package/esm2015/lib/services/form-manager.service.js +1 -3
- package/fesm2015/tuain-ng-forms-lib.js +29 -94
- package/fesm2015/tuain-ng-forms-lib.js.map +1 -1
- package/lib/classes/forms/field.d.ts +1 -0
- package/lib/classes/forms/form.constants.d.ts +2 -0
- package/lib/components/elements/field.component.d.ts +0 -1
- package/lib/components/forms/basic-form.d.ts +1 -13
- package/lib/services/form-manager.service.d.ts +0 -2
- package/package.json +1 -1
- package/tuain-ng-forms-lib.metadata.json +1 -1
|
@@ -54,230 +54,6 @@
|
|
|
54
54
|
showLabel: [{ type: core.Input }]
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
var MONITORED_ATTRIBUTES = {
|
|
58
|
-
_maxLength: 'maxLength',
|
|
59
|
-
_onValidation: 'onValidation',
|
|
60
|
-
_fieldValue: 'value',
|
|
61
|
-
captureType: 'captureType',
|
|
62
|
-
fieldTitle: 'title',
|
|
63
|
-
fieldType: 'type',
|
|
64
|
-
errorMessage: 'errorMessage',
|
|
65
|
-
errorType: 'errorType',
|
|
66
|
-
errorCode: 'errorCode',
|
|
67
|
-
visibleLabel: 'visibleLabel',
|
|
68
|
-
fieldRequired: 'required',
|
|
69
|
-
fieldOptions: 'options',
|
|
70
|
-
};
|
|
71
|
-
var FieldComponent = /** @class */ (function () {
|
|
72
|
-
function FieldComponent() {
|
|
73
|
-
}
|
|
74
|
-
FieldComponent.prototype.ngOnInit = function () {
|
|
75
|
-
var _this = this;
|
|
76
|
-
var _a;
|
|
77
|
-
if (this.fieldObject) {
|
|
78
|
-
this.formConfig = (_a = this.fieldObject) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
79
|
-
// Atributos estáticos
|
|
80
|
-
this.code = this.fieldObject.fieldCode;
|
|
81
|
-
this.fieldInfo = this.fieldObject.fieldInfo;
|
|
82
|
-
this.fieldAlignment = this.fieldObject.fieldAlignment;
|
|
83
|
-
this.tooltipText = this.fieldObject.tooltipText;
|
|
84
|
-
// Cargue inicial
|
|
85
|
-
this.maxLength = this.fieldObject._maxLength;
|
|
86
|
-
this.onValidation = this.fieldObject._onValidation;
|
|
87
|
-
this.value = this.fieldObject._fieldValue;
|
|
88
|
-
this.captureType = this.fieldObject.captureType;
|
|
89
|
-
this.title = this.fieldObject.fieldTitle;
|
|
90
|
-
this.type = this.fieldObject.fieldType;
|
|
91
|
-
this.errorMessage = this.fieldObject.errorMessage;
|
|
92
|
-
this.errorType = this.fieldObject.errorType;
|
|
93
|
-
this.errorCode = this.fieldObject.errorCode;
|
|
94
|
-
this.visibleLabel = this.fieldObject.visibleLabel;
|
|
95
|
-
this.required = this.fieldObject.fieldRequired;
|
|
96
|
-
this.options = this.fieldObject.fieldOptions;
|
|
97
|
-
this.fieldObject.widget = this;
|
|
98
|
-
// Atributos dinámicos
|
|
99
|
-
this.fieldObject.attributeChange.subscribe(function (event) {
|
|
100
|
-
var name = event.name, value = event.value;
|
|
101
|
-
if (_this[MONITORED_ATTRIBUTES[name]]) {
|
|
102
|
-
_this[MONITORED_ATTRIBUTES[name]] = value;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
this.start();
|
|
107
|
-
};
|
|
108
|
-
FieldComponent.prototype.start = function () { };
|
|
109
|
-
FieldComponent.prototype.focus = function () { };
|
|
110
|
-
FieldComponent.prototype.onInputChange = function () {
|
|
111
|
-
var _this = this;
|
|
112
|
-
setTimeout(function () { return _this.fieldObject.notifyEditionPartial(); }, 50);
|
|
113
|
-
};
|
|
114
|
-
FieldComponent.prototype.onChangeContent = function () {
|
|
115
|
-
var _this = this;
|
|
116
|
-
setTimeout(function () { return _this.fieldObject.notifyEditionFinish(); }, 50);
|
|
117
|
-
};
|
|
118
|
-
FieldComponent.prototype.onShowInfo = function () {
|
|
119
|
-
var _this = this;
|
|
120
|
-
setTimeout(function () { return _this.fieldObject.notifyEditionDetailRequest(); }, 50);
|
|
121
|
-
};
|
|
122
|
-
FieldComponent.prototype.numberInputValidation = function (event) {
|
|
123
|
-
var k = event.charCode;
|
|
124
|
-
return (k > 47 && k < 58);
|
|
125
|
-
};
|
|
126
|
-
return FieldComponent;
|
|
127
|
-
}());
|
|
128
|
-
FieldComponent.decorators = [
|
|
129
|
-
{ type: core.Component, args: [{
|
|
130
|
-
selector: 'lib-field',
|
|
131
|
-
template: "<ng-content></ng-content>"
|
|
132
|
-
},] }
|
|
133
|
-
];
|
|
134
|
-
FieldComponent.propDecorators = {
|
|
135
|
-
fieldObject: [{ type: core.Input }],
|
|
136
|
-
disabled: [{ type: core.Input }]
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
var ElementComponent = /** @class */ (function () {
|
|
140
|
-
function ElementComponent() {
|
|
141
|
-
}
|
|
142
|
-
ElementComponent.prototype.ngOnInit = function () {
|
|
143
|
-
var _a;
|
|
144
|
-
this.formConfig = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
145
|
-
this.start();
|
|
146
|
-
};
|
|
147
|
-
ElementComponent.prototype.start = function () { };
|
|
148
|
-
Object.defineProperty(ElementComponent.prototype, "visible", {
|
|
149
|
-
get: function () {
|
|
150
|
-
var _a, _b, _c, _d;
|
|
151
|
-
var visible = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : true;
|
|
152
|
-
return visible && ((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.viewOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
|
|
153
|
-
},
|
|
154
|
-
enumerable: false,
|
|
155
|
-
configurable: true
|
|
156
|
-
});
|
|
157
|
-
Object.defineProperty(ElementComponent.prototype, "disabled", {
|
|
158
|
-
get: function () {
|
|
159
|
-
var _a, _b, _c, _d;
|
|
160
|
-
var disabled = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : false;
|
|
161
|
-
return disabled || !((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.enabledOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
|
|
162
|
-
},
|
|
163
|
-
enumerable: false,
|
|
164
|
-
configurable: true
|
|
165
|
-
});
|
|
166
|
-
return ElementComponent;
|
|
167
|
-
}());
|
|
168
|
-
ElementComponent.decorators = [
|
|
169
|
-
{ type: core.Component, args: [{
|
|
170
|
-
selector: 'lib-element',
|
|
171
|
-
template: "<ng-content></ng-content>"
|
|
172
|
-
},] }
|
|
173
|
-
];
|
|
174
|
-
ElementComponent.propDecorators = {
|
|
175
|
-
formElement: [{ type: core.Input }],
|
|
176
|
-
formManager: [{ type: core.Input }]
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
var FormErrorComponent = /** @class */ (function () {
|
|
180
|
-
function FormErrorComponent() {
|
|
181
|
-
}
|
|
182
|
-
return FormErrorComponent;
|
|
183
|
-
}());
|
|
184
|
-
FormErrorComponent.decorators = [
|
|
185
|
-
{ type: core.Component, args: [{
|
|
186
|
-
selector: 'lib-form-error',
|
|
187
|
-
template: "<ng-content></ng-content>"
|
|
188
|
-
},] }
|
|
189
|
-
];
|
|
190
|
-
FormErrorComponent.propDecorators = {
|
|
191
|
-
errorTitle: [{ type: core.Input }],
|
|
192
|
-
errorMessage: [{ type: core.Input }],
|
|
193
|
-
errorType: [{ type: core.Input }]
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
var FormHeaderComponent = /** @class */ (function () {
|
|
197
|
-
function FormHeaderComponent() {
|
|
198
|
-
this.goBackEvent = new core.EventEmitter();
|
|
199
|
-
}
|
|
200
|
-
FormHeaderComponent.prototype.goBackForm = function () {
|
|
201
|
-
this.goBackEvent.emit();
|
|
202
|
-
};
|
|
203
|
-
return FormHeaderComponent;
|
|
204
|
-
}());
|
|
205
|
-
FormHeaderComponent.decorators = [
|
|
206
|
-
{ type: core.Component, args: [{
|
|
207
|
-
selector: 'lib-form-header',
|
|
208
|
-
template: "<ng-content></ng-content>"
|
|
209
|
-
},] }
|
|
210
|
-
];
|
|
211
|
-
FormHeaderComponent.propDecorators = {
|
|
212
|
-
formManager: [{ type: core.Input }],
|
|
213
|
-
goBackAction: [{ type: core.Input }],
|
|
214
|
-
showTitle: [{ type: core.Input }],
|
|
215
|
-
headerActions: [{ type: core.Input }],
|
|
216
|
-
goBackEvent: [{ type: core.Output }]
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
var SectionComponent = /** @class */ (function () {
|
|
220
|
-
function SectionComponent() {
|
|
221
|
-
}
|
|
222
|
-
SectionComponent.prototype.ngOnInit = function () {
|
|
223
|
-
this.start();
|
|
224
|
-
};
|
|
225
|
-
SectionComponent.prototype.start = function () { };
|
|
226
|
-
return SectionComponent;
|
|
227
|
-
}());
|
|
228
|
-
SectionComponent.decorators = [
|
|
229
|
-
{ type: core.Component, args: [{
|
|
230
|
-
selector: 'lib-section',
|
|
231
|
-
template: "<ng-content></ng-content>"
|
|
232
|
-
},] }
|
|
233
|
-
];
|
|
234
|
-
SectionComponent.propDecorators = {
|
|
235
|
-
sectionObject: [{ type: core.Input }],
|
|
236
|
-
formManager: [{ type: core.Input }]
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
var SubSectionComponent = /** @class */ (function () {
|
|
240
|
-
function SubSectionComponent() {
|
|
241
|
-
}
|
|
242
|
-
SubSectionComponent.prototype.ngOnInit = function () {
|
|
243
|
-
this.start();
|
|
244
|
-
};
|
|
245
|
-
SubSectionComponent.prototype.start = function () { };
|
|
246
|
-
return SubSectionComponent;
|
|
247
|
-
}());
|
|
248
|
-
SubSectionComponent.decorators = [
|
|
249
|
-
{ type: core.Component, args: [{
|
|
250
|
-
selector: 'lib-subsection',
|
|
251
|
-
template: "<ng-content></ng-content>"
|
|
252
|
-
},] }
|
|
253
|
-
];
|
|
254
|
-
SubSectionComponent.propDecorators = {
|
|
255
|
-
subSection: [{ type: core.Input }],
|
|
256
|
-
showHeader: [{ type: core.Input }],
|
|
257
|
-
formManager: [{ type: core.Input }]
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
var FieldSearch = /** @class */ (function () {
|
|
261
|
-
function FieldSearch(filterDefinition) {
|
|
262
|
-
this.fieldCode = filterDefinition.fieldCode;
|
|
263
|
-
this.fieldAlias = filterDefinition.fieldAlias || filterDefinition.fieldCode;
|
|
264
|
-
this.fieldTitle = filterDefinition.fieldTitle;
|
|
265
|
-
this.fieldTypeCode = filterDefinition.fieldTypeCode;
|
|
266
|
-
this.operators = filterDefinition.operators;
|
|
267
|
-
this.alignment = filterDefinition.alignment;
|
|
268
|
-
this.format = filterDefinition.format;
|
|
269
|
-
}
|
|
270
|
-
return FieldSearch;
|
|
271
|
-
}());
|
|
272
|
-
var Filter = /** @class */ (function () {
|
|
273
|
-
function Filter() {
|
|
274
|
-
this.filterModeSimple = true;
|
|
275
|
-
this.advancedFilter = [];
|
|
276
|
-
this.simpleFilterWords = [];
|
|
277
|
-
}
|
|
278
|
-
return Filter;
|
|
279
|
-
}());
|
|
280
|
-
|
|
281
57
|
/*! *****************************************************************************
|
|
282
58
|
Copyright (c) Microsoft Corporation.
|
|
283
59
|
|
|
@@ -596,6 +372,204 @@
|
|
|
596
372
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
597
373
|
}
|
|
598
374
|
|
|
375
|
+
var FieldComponent = /** @class */ (function () {
|
|
376
|
+
function FieldComponent() {
|
|
377
|
+
}
|
|
378
|
+
FieldComponent.prototype.ngOnInit = function () {
|
|
379
|
+
var _this = this;
|
|
380
|
+
var _a, _b;
|
|
381
|
+
if (this.fieldObject) {
|
|
382
|
+
this.formConfig = (_a = this.fieldObject) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
383
|
+
// Inicialización
|
|
384
|
+
var mapping = Object.entries(this.formConfig.componentFieldAttrMap);
|
|
385
|
+
for (var index = 0; index < mapping.length; index++) {
|
|
386
|
+
var _c = __read(mapping[index], 2), fieldAttr = _c[0], compAttr = _c[1];
|
|
387
|
+
this[compAttr.toString()] = (_b = this.fieldObject) === null || _b === void 0 ? void 0 : _b[fieldAttr.toString()];
|
|
388
|
+
}
|
|
389
|
+
// Subscripción a cambios en atributos
|
|
390
|
+
this.fieldObject.attributeChange.subscribe(function (event) {
|
|
391
|
+
var fieldAttr = event.name, value = event.value;
|
|
392
|
+
var compAttr = _this.formConfig.componentFieldAttrMap[fieldAttr];
|
|
393
|
+
_this.hasOwnProperty(compAttr) && (_this[compAttr] = value);
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
this.start();
|
|
397
|
+
};
|
|
398
|
+
FieldComponent.prototype.start = function () { };
|
|
399
|
+
FieldComponent.prototype.focus = function () { };
|
|
400
|
+
FieldComponent.prototype.onInputChange = function () {
|
|
401
|
+
var _this = this;
|
|
402
|
+
setTimeout(function () { return _this.fieldObject.notifyEditionPartial(); }, 50);
|
|
403
|
+
};
|
|
404
|
+
FieldComponent.prototype.onChangeContent = function () {
|
|
405
|
+
var _this = this;
|
|
406
|
+
setTimeout(function () { return _this.fieldObject.notifyEditionFinish(); }, 50);
|
|
407
|
+
};
|
|
408
|
+
FieldComponent.prototype.onShowInfo = function () {
|
|
409
|
+
var _this = this;
|
|
410
|
+
setTimeout(function () { return _this.fieldObject.notifyEditionDetailRequest(); }, 50);
|
|
411
|
+
};
|
|
412
|
+
FieldComponent.prototype.numberInputValidation = function (event) {
|
|
413
|
+
var k = event.charCode;
|
|
414
|
+
return (k > 47 && k < 58);
|
|
415
|
+
};
|
|
416
|
+
return FieldComponent;
|
|
417
|
+
}());
|
|
418
|
+
FieldComponent.decorators = [
|
|
419
|
+
{ type: core.Component, args: [{
|
|
420
|
+
selector: 'lib-field',
|
|
421
|
+
template: "<ng-content></ng-content>"
|
|
422
|
+
},] }
|
|
423
|
+
];
|
|
424
|
+
FieldComponent.propDecorators = {
|
|
425
|
+
fieldObject: [{ type: core.Input }],
|
|
426
|
+
disabled: [{ type: core.Input }]
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
var ElementComponent = /** @class */ (function () {
|
|
430
|
+
function ElementComponent() {
|
|
431
|
+
}
|
|
432
|
+
ElementComponent.prototype.ngOnInit = function () {
|
|
433
|
+
var _a;
|
|
434
|
+
this.formConfig = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
435
|
+
this.start();
|
|
436
|
+
};
|
|
437
|
+
ElementComponent.prototype.start = function () { };
|
|
438
|
+
Object.defineProperty(ElementComponent.prototype, "visible", {
|
|
439
|
+
get: function () {
|
|
440
|
+
var _a, _b, _c, _d;
|
|
441
|
+
var visible = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.visible) !== null && _b !== void 0 ? _b : true;
|
|
442
|
+
return visible && ((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.viewOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
|
|
443
|
+
},
|
|
444
|
+
enumerable: false,
|
|
445
|
+
configurable: true
|
|
446
|
+
});
|
|
447
|
+
Object.defineProperty(ElementComponent.prototype, "disabled", {
|
|
448
|
+
get: function () {
|
|
449
|
+
var _a, _b, _c, _d;
|
|
450
|
+
var disabled = (_b = (_a = this.formElement) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : false;
|
|
451
|
+
return disabled || !((_c = this.formElement) === null || _c === void 0 ? void 0 : _c.enabledOnState((_d = this.formManager) === null || _d === void 0 ? void 0 : _d.currentState));
|
|
452
|
+
},
|
|
453
|
+
enumerable: false,
|
|
454
|
+
configurable: true
|
|
455
|
+
});
|
|
456
|
+
return ElementComponent;
|
|
457
|
+
}());
|
|
458
|
+
ElementComponent.decorators = [
|
|
459
|
+
{ type: core.Component, args: [{
|
|
460
|
+
selector: 'lib-element',
|
|
461
|
+
template: "<ng-content></ng-content>"
|
|
462
|
+
},] }
|
|
463
|
+
];
|
|
464
|
+
ElementComponent.propDecorators = {
|
|
465
|
+
formElement: [{ type: core.Input }],
|
|
466
|
+
formManager: [{ type: core.Input }]
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
var FormErrorComponent = /** @class */ (function () {
|
|
470
|
+
function FormErrorComponent() {
|
|
471
|
+
}
|
|
472
|
+
return FormErrorComponent;
|
|
473
|
+
}());
|
|
474
|
+
FormErrorComponent.decorators = [
|
|
475
|
+
{ type: core.Component, args: [{
|
|
476
|
+
selector: 'lib-form-error',
|
|
477
|
+
template: "<ng-content></ng-content>"
|
|
478
|
+
},] }
|
|
479
|
+
];
|
|
480
|
+
FormErrorComponent.propDecorators = {
|
|
481
|
+
errorTitle: [{ type: core.Input }],
|
|
482
|
+
errorMessage: [{ type: core.Input }],
|
|
483
|
+
errorType: [{ type: core.Input }]
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
var FormHeaderComponent = /** @class */ (function () {
|
|
487
|
+
function FormHeaderComponent() {
|
|
488
|
+
this.goBackEvent = new core.EventEmitter();
|
|
489
|
+
}
|
|
490
|
+
FormHeaderComponent.prototype.goBackForm = function () {
|
|
491
|
+
this.goBackEvent.emit();
|
|
492
|
+
};
|
|
493
|
+
return FormHeaderComponent;
|
|
494
|
+
}());
|
|
495
|
+
FormHeaderComponent.decorators = [
|
|
496
|
+
{ type: core.Component, args: [{
|
|
497
|
+
selector: 'lib-form-header',
|
|
498
|
+
template: "<ng-content></ng-content>"
|
|
499
|
+
},] }
|
|
500
|
+
];
|
|
501
|
+
FormHeaderComponent.propDecorators = {
|
|
502
|
+
formManager: [{ type: core.Input }],
|
|
503
|
+
goBackAction: [{ type: core.Input }],
|
|
504
|
+
showTitle: [{ type: core.Input }],
|
|
505
|
+
headerActions: [{ type: core.Input }],
|
|
506
|
+
goBackEvent: [{ type: core.Output }]
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
var SectionComponent = /** @class */ (function () {
|
|
510
|
+
function SectionComponent() {
|
|
511
|
+
}
|
|
512
|
+
SectionComponent.prototype.ngOnInit = function () {
|
|
513
|
+
this.start();
|
|
514
|
+
};
|
|
515
|
+
SectionComponent.prototype.start = function () { };
|
|
516
|
+
return SectionComponent;
|
|
517
|
+
}());
|
|
518
|
+
SectionComponent.decorators = [
|
|
519
|
+
{ type: core.Component, args: [{
|
|
520
|
+
selector: 'lib-section',
|
|
521
|
+
template: "<ng-content></ng-content>"
|
|
522
|
+
},] }
|
|
523
|
+
];
|
|
524
|
+
SectionComponent.propDecorators = {
|
|
525
|
+
sectionObject: [{ type: core.Input }],
|
|
526
|
+
formManager: [{ type: core.Input }]
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
var SubSectionComponent = /** @class */ (function () {
|
|
530
|
+
function SubSectionComponent() {
|
|
531
|
+
}
|
|
532
|
+
SubSectionComponent.prototype.ngOnInit = function () {
|
|
533
|
+
this.start();
|
|
534
|
+
};
|
|
535
|
+
SubSectionComponent.prototype.start = function () { };
|
|
536
|
+
return SubSectionComponent;
|
|
537
|
+
}());
|
|
538
|
+
SubSectionComponent.decorators = [
|
|
539
|
+
{ type: core.Component, args: [{
|
|
540
|
+
selector: 'lib-subsection',
|
|
541
|
+
template: "<ng-content></ng-content>"
|
|
542
|
+
},] }
|
|
543
|
+
];
|
|
544
|
+
SubSectionComponent.propDecorators = {
|
|
545
|
+
subSection: [{ type: core.Input }],
|
|
546
|
+
showHeader: [{ type: core.Input }],
|
|
547
|
+
formManager: [{ type: core.Input }]
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
var FieldSearch = /** @class */ (function () {
|
|
551
|
+
function FieldSearch(filterDefinition) {
|
|
552
|
+
this.fieldCode = filterDefinition.fieldCode;
|
|
553
|
+
this.fieldAlias = filterDefinition.fieldAlias || filterDefinition.fieldCode;
|
|
554
|
+
this.fieldTitle = filterDefinition.fieldTitle;
|
|
555
|
+
this.fieldTypeCode = filterDefinition.fieldTypeCode;
|
|
556
|
+
this.operators = filterDefinition.operators;
|
|
557
|
+
this.alignment = filterDefinition.alignment;
|
|
558
|
+
this.format = filterDefinition.format;
|
|
559
|
+
}
|
|
560
|
+
return FieldSearch;
|
|
561
|
+
}());
|
|
562
|
+
var Filter = /** @class */ (function () {
|
|
563
|
+
function Filter() {
|
|
564
|
+
this.filterModeSimple = true;
|
|
565
|
+
this.advancedFilter = [];
|
|
566
|
+
this.simpleFilterWords = [];
|
|
567
|
+
}
|
|
568
|
+
return Filter;
|
|
569
|
+
}());
|
|
570
|
+
|
|
571
|
+
var NO_ERROR = '00';
|
|
572
|
+
var HEADER$1 = 'HEADER';
|
|
599
573
|
var elementTypes = {
|
|
600
574
|
action: 'ACTION',
|
|
601
575
|
field: 'FIELD',
|
|
@@ -1861,7 +1835,7 @@
|
|
|
1861
1835
|
return RecordFormSection;
|
|
1862
1836
|
}());
|
|
1863
1837
|
|
|
1864
|
-
var HEADER
|
|
1838
|
+
var HEADER = 'HEADER';
|
|
1865
1839
|
var FormAction = /** @class */ (function (_super) {
|
|
1866
1840
|
__extends(FormAction, _super);
|
|
1867
1841
|
function FormAction(actionDefinition, formConfig) {
|
|
@@ -1874,7 +1848,7 @@
|
|
|
1874
1848
|
_this.actionCode = actionDefinition.actionCode ? actionDefinition.actionCode.toString() : '';
|
|
1875
1849
|
_this.actionName = actionDefinition.actionTitle;
|
|
1876
1850
|
_this.iconName = actionDefinition.iconName || _this.actionCode;
|
|
1877
|
-
_this.location = actionDefinition.position || HEADER
|
|
1851
|
+
_this.location = actionDefinition.position || HEADER;
|
|
1878
1852
|
_this.backend = (_a = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.serverAction) !== null && _a !== void 0 ? _a : false;
|
|
1879
1853
|
_this.newState = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.newState;
|
|
1880
1854
|
_this.customAttributes = (_b = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.customAttributes) !== null && _b !== void 0 ? _b : null;
|
|
@@ -2097,11 +2071,12 @@
|
|
|
2097
2071
|
if (editable === void 0) { editable = true; }
|
|
2098
2072
|
(editable) ? this.enable() : this.disable();
|
|
2099
2073
|
};
|
|
2100
|
-
FieldDescriptor.prototype.hasError = function () { return this.errorCode !==
|
|
2074
|
+
FieldDescriptor.prototype.hasError = function () { return this.errorCode !== NO_ERROR; };
|
|
2075
|
+
FieldDescriptor.prototype.resetError = function () { (this.errorCode !== NO_ERROR) && this.setError(NO_ERROR, null); };
|
|
2101
2076
|
FieldDescriptor.prototype.setError = function (code, message, type) {
|
|
2102
2077
|
if (type === void 0) { type = DEFAULT_ERROR_TYPE; }
|
|
2103
|
-
this.setAttr(fldAttr.errorCode, code !== null && code !== void 0 ? code :
|
|
2104
|
-
this.setAttr(fldAttr.errorType, (this.errorCode ===
|
|
2078
|
+
this.setAttr(fldAttr.errorCode, code !== null && code !== void 0 ? code : NO_ERROR);
|
|
2079
|
+
this.setAttr(fldAttr.errorType, (this.errorCode === NO_ERROR) ? '' : type);
|
|
2105
2080
|
this.setAttr(fldAttr.errorMessage, message !== null && message !== void 0 ? message : '');
|
|
2106
2081
|
};
|
|
2107
2082
|
FieldDescriptor.prototype.getError = function () { return { type: this.errorType, code: this.errorCode, message: this.errorMessage }; };
|
|
@@ -2159,7 +2134,7 @@
|
|
|
2159
2134
|
(attrName === this._formConfig.apifieldattrs.info) && this.setAttr(fldAttr.info, fld.info);
|
|
2160
2135
|
(attrName === this._formConfig.apifieldattrs.editable) && this.setEditable(fld.editable);
|
|
2161
2136
|
(attrName === this._formConfig.apifieldattrs.title) && this.setLabel(fld.fieldTitle.toString());
|
|
2162
|
-
(attrName === this._formConfig.apifieldattrs.value) && (this.setValue(fld.
|
|
2137
|
+
(attrName === this._formConfig.apifieldattrs.value) && (this.setValue(fld.fieldValue) && this.setChanged(false));
|
|
2163
2138
|
(attrName === this._formConfig.apifieldattrs.options) && this.setFieldOptions(fld.fieldOptions);
|
|
2164
2139
|
(attrName === this._formConfig.apifieldattrs.captureType) && this.setAttr(fldAttr.captureType, fld.captureType || 'INPUT');
|
|
2165
2140
|
(attrName === this._formConfig.apifieldattrs.type) && this.setFieldType(fld.fieldTypeCode);
|
|
@@ -2301,8 +2276,6 @@
|
|
|
2301
2276
|
return FieldDescriptor;
|
|
2302
2277
|
}(FormElement));
|
|
2303
2278
|
|
|
2304
|
-
var HEADER = 'HEADER';
|
|
2305
|
-
var NO_ERROR = '00';
|
|
2306
2279
|
var FormStructureAndData = /** @class */ (function () {
|
|
2307
2280
|
function FormStructureAndData(definitionReceived, formConfig) {
|
|
2308
2281
|
var e_1, _d, e_2, _e, e_3, _f, e_4, _g;
|
|
@@ -2551,7 +2524,7 @@
|
|
|
2551
2524
|
return this._actions;
|
|
2552
2525
|
};
|
|
2553
2526
|
FormStructureAndData.prototype.getHeaderActions = function () {
|
|
2554
|
-
return this._actions.filter(function (actionItem) { return actionItem.location === HEADER; });
|
|
2527
|
+
return this._actions.filter(function (actionItem) { return actionItem.location === HEADER$1; });
|
|
2555
2528
|
};
|
|
2556
2529
|
FormStructureAndData.prototype.getFieldObject = function (elementId) {
|
|
2557
2530
|
return (this._fieldsObj && elementId && this._fieldsObj[elementId])
|
|
@@ -3085,8 +3058,6 @@
|
|
|
3085
3058
|
}
|
|
3086
3059
|
// Métodos virtuales para las aplicaciones
|
|
3087
3060
|
LibFormManagerService.prototype.getFormDefinition = function (formCode) { };
|
|
3088
|
-
LibFormManagerService.prototype.getFormRoute = function (formCode) { };
|
|
3089
|
-
LibFormManagerService.prototype.getRouteForm = function (path) { };
|
|
3090
3061
|
LibFormManagerService.prototype.execServerAction = function (actionDetail) { };
|
|
3091
3062
|
LibFormManagerService.prototype.goToForm = function (formCode, token, subject) { };
|
|
3092
3063
|
LibFormManagerService.prototype.loadStack = function () { };
|
|
@@ -3408,6 +3379,7 @@
|
|
|
3408
3379
|
this._eventEmiter.subscribe(eventName, callback);
|
|
3409
3380
|
};
|
|
3410
3381
|
BasicFormComponent.prototype.openForm = function (name, data, backData, cleanStack) {
|
|
3382
|
+
if (data === void 0) { data = null; }
|
|
3411
3383
|
if (backData === void 0) { backData = null; }
|
|
3412
3384
|
if (cleanStack === void 0) { cleanStack = false; }
|
|
3413
3385
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -3426,41 +3398,6 @@
|
|
|
3426
3398
|
target.extra = (_h = target === null || target === void 0 ? void 0 : target.extra) !== null && _h !== void 0 ? _h : {};
|
|
3427
3399
|
this.formManagerService.openForm(origin, target);
|
|
3428
3400
|
};
|
|
3429
|
-
/**
|
|
3430
|
-
* @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
|
|
3431
|
-
*/
|
|
3432
|
-
BasicFormComponent.prototype.goToPage = function (navigationArray, predefinedFields, options) {
|
|
3433
|
-
if (options === void 0) { options = null; }
|
|
3434
|
-
var _a;
|
|
3435
|
-
var origin = null;
|
|
3436
|
-
var cleanStack = (_a = options === null || options === void 0 ? void 0 : options.cleanStack) !== null && _a !== void 0 ? _a : false;
|
|
3437
|
-
if (!cleanStack) {
|
|
3438
|
-
origin = {
|
|
3439
|
-
name: this.name,
|
|
3440
|
-
url: this._formRoute,
|
|
3441
|
-
token: this.controlToken,
|
|
3442
|
-
fields: this.inputDataFields,
|
|
3443
|
-
extra: this.extraData
|
|
3444
|
-
};
|
|
3445
|
-
}
|
|
3446
|
-
var target = {
|
|
3447
|
-
name: this.formManagerService.getRouteForm(navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0]),
|
|
3448
|
-
url: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[0],
|
|
3449
|
-
state: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[1],
|
|
3450
|
-
subject: navigationArray === null || navigationArray === void 0 ? void 0 : navigationArray[2],
|
|
3451
|
-
fields: predefinedFields,
|
|
3452
|
-
extra: null,
|
|
3453
|
-
};
|
|
3454
|
-
this.formManagerService.openForm(origin, target);
|
|
3455
|
-
};
|
|
3456
|
-
/**
|
|
3457
|
-
* @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
|
|
3458
|
-
*/
|
|
3459
|
-
BasicFormComponent.prototype.goToNewPage = function (nav, flds) { return this.goToPage(nav, flds, { cleanStack: true }); };
|
|
3460
|
-
/**
|
|
3461
|
-
* @deprecated Este método ya no debería ser utilizado. Use openForm con el nombre del formulario
|
|
3462
|
-
*/
|
|
3463
|
-
BasicFormComponent.prototype.goToSubPage = function (nav, flds) { return this.goToPage(nav, flds, { cleanStack: false }); };
|
|
3464
3401
|
BasicFormComponent.prototype.canGoBack = function () { return this.originToken !== null; };
|
|
3465
3402
|
BasicFormComponent.prototype.goBack = function () { return this.formManagerService.backTo(); };
|
|
3466
3403
|
BasicFormComponent.prototype.goBackForm = function () { return this.goBack(); };
|
|
@@ -3502,13 +3439,13 @@
|
|
|
3502
3439
|
BasicFormComponent.prototype.getSubject = function () { return this.formSubject; };
|
|
3503
3440
|
BasicFormComponent.prototype.getformSubject = function () { return this.getSubject(); };
|
|
3504
3441
|
BasicFormComponent.prototype.preocessInputParams = function (params) {
|
|
3505
|
-
var _a, _b;
|
|
3506
|
-
this.controlToken = (_a = params === null || params === void 0 ? void 0 : params[TOKEN]
|
|
3442
|
+
var _a, _b, _c;
|
|
3443
|
+
this.controlToken = (_a = params === null || params === void 0 ? void 0 : params[TOKEN]) !== null && _a !== void 0 ? _a : null;
|
|
3507
3444
|
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;
|
|
3508
3445
|
if (!this.controlToken || this.controlToken !== token) {
|
|
3509
3446
|
console.log("No se obtuvo un token v\u00E1lido para abrir el formulario " + this.controlToken + "->" + token);
|
|
3510
3447
|
}
|
|
3511
|
-
this.formSubject = (_b = params === null || params === void 0 ? void 0 : params[SUBJECT]
|
|
3448
|
+
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;
|
|
3512
3449
|
this.inputDataFields = fields;
|
|
3513
3450
|
this.extraData = extra;
|
|
3514
3451
|
this.originToken = originToken;
|
|
@@ -3621,7 +3558,7 @@
|
|
|
3621
3558
|
this.errorDetail = recordResponse.errorDetail;
|
|
3622
3559
|
};
|
|
3623
3560
|
BasicFormComponent.prototype.errorOccured = function () {
|
|
3624
|
-
return (this.errorCode !==
|
|
3561
|
+
return (this.errorCode !== NO_ERROR);
|
|
3625
3562
|
};
|
|
3626
3563
|
BasicFormComponent.prototype.changeState = function (state) { return this.formStructure.changeState(state); };
|
|
3627
3564
|
BasicFormComponent.prototype.changeFormMode = function (state) { return this.changeState(state); };
|
|
@@ -3642,7 +3579,7 @@
|
|
|
3642
3579
|
formData: this.formStructure.getPayload(),
|
|
3643
3580
|
immutableData: this.formStructure.immutableData,
|
|
3644
3581
|
};
|
|
3645
|
-
this.errorCode =
|
|
3582
|
+
this.errorCode = NO_ERROR;
|
|
3646
3583
|
this.errorMessage = '';
|
|
3647
3584
|
this.errorDetail = '';
|
|
3648
3585
|
this.inServerProcess = true;
|
|
@@ -3993,8 +3930,7 @@
|
|
|
3993
3930
|
if (!fieldToValidate) {
|
|
3994
3931
|
return [2 /*return*/, false];
|
|
3995
3932
|
}
|
|
3996
|
-
fieldToValidate.
|
|
3997
|
-
fieldToValidate.setErrorCode('00');
|
|
3933
|
+
fieldToValidate.resetError();
|
|
3998
3934
|
validationCallbacks = this.fieldInputValidation[fieldCode];
|
|
3999
3935
|
if (!validationCallbacks) return [3 /*break*/, 2];
|
|
4000
3936
|
clientValidationPromises = [];
|
|
@@ -4033,8 +3969,7 @@
|
|
|
4033
3969
|
if (!fieldToValidate || !intrinsicValidation) {
|
|
4034
3970
|
return [2 /*return*/];
|
|
4035
3971
|
}
|
|
4036
|
-
fieldToValidate.
|
|
4037
|
-
fieldToValidate.setErrorCode('00');
|
|
3972
|
+
fieldToValidate.resetError();
|
|
4038
3973
|
validationCallbacks = this.fieldValidationsStart[fieldCode];
|
|
4039
3974
|
if (!validationCallbacks) return [3 /*break*/, 2];
|
|
4040
3975
|
clientValidationPromises = [];
|