tuain-ng-forms-lib 14.4.96 → 14.5.25
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/esm2020/lib/classes/forms/action.mjs +40 -4
- package/esm2020/lib/classes/forms/element.mjs +1 -9
- package/esm2020/lib/classes/forms/field.mjs +19 -28
- package/esm2020/lib/classes/forms/form.mjs +2 -2
- package/esm2020/lib/classes/forms/piece-propagate.mjs +3 -2
- package/esm2020/lib/classes/forms/piece.mjs +6 -4
- package/esm2020/lib/classes/forms/section.mjs +3 -3
- package/esm2020/lib/classes/forms/table/action.mjs +9 -4
- package/esm2020/lib/classes/forms/table/table.mjs +4 -4
- package/esm2020/lib/components/elements/action.component.mjs +2 -24
- package/esm2020/lib/components/elements/field.component.mjs +14 -1
- package/esm2020/lib/components/elements/layout/element.component.mjs +5 -5
- package/esm2020/lib/components/elements/layout/form-header.component.mjs +2 -9
- package/esm2020/lib/components/elements/layout/piece.component.mjs +2 -1
- package/esm2020/lib/components/elements/layout/section.component.mjs +5 -5
- package/esm2020/lib/components/elements/layout/sub-section.component.mjs +5 -5
- package/esm2020/lib/components/elements/tables/table-record-action.component.mjs +17 -9
- package/esm2020/lib/components/forms/basic-form.mjs +12 -8
- package/esm2020/lib/services/file-manager.service.mjs +2 -1
- package/fesm2015/tuain-ng-forms-lib.mjs +148 -118
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +134 -109
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/classes/forms/action.d.ts +9 -6
- package/lib/classes/forms/element.d.ts +0 -8
- package/lib/classes/forms/field.d.ts +2 -11
- package/lib/classes/forms/piece.d.ts +3 -2
- package/lib/classes/forms/section.d.ts +1 -1
- package/lib/classes/forms/table/action.d.ts +4 -4
- package/lib/classes/forms/table/table.d.ts +1 -1
- package/lib/components/elements/action.component.d.ts +1 -6
- package/lib/components/elements/layout/element.component.d.ts +1 -2
- package/lib/components/elements/layout/form-header.component.d.ts +1 -4
- package/lib/components/elements/layout/piece.component.d.ts +2 -0
- package/lib/components/elements/layout/section.component.d.ts +1 -2
- package/lib/components/elements/layout/sub-section.component.d.ts +1 -2
- package/lib/components/elements/tables/table-record-action.component.d.ts +3 -1
- package/lib/components/forms/basic-form.d.ts +2 -2
- package/lib/services/file-manager.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2,5 +2,6 @@ export class LibFileManagementService {
|
|
|
2
2
|
openFile(fileBase64Data, fileName, fileType) { }
|
|
3
3
|
saveFileFromURL(fileUrl, fullFileName = null) { }
|
|
4
4
|
saveFile(fileBase64Data, fileName, fileType) { }
|
|
5
|
+
printPdfFile(pdfBufferData) { }
|
|
5
6
|
}
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZS1tYW5hZ2VyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dWFpbi1uZy1mb3Jtcy1saWIvc3JjL2xpYi9zZXJ2aWNlcy9maWxlLW1hbmFnZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLE9BQU8sd0JBQXdCO0lBQ25DLFFBQVEsQ0FBQyxjQUFjLEVBQUUsUUFBUSxFQUFFLFFBQVEsSUFBSSxDQUFDO0lBQ2hELGVBQWUsQ0FBQyxPQUFPLEVBQUUsWUFBWSxHQUFHLElBQUksSUFBSSxDQUFDO0lBQ2pELFFBQVEsQ0FBQyxjQUFjLEVBQUUsUUFBUSxFQUFFLFFBQVEsSUFBSSxDQUFDO0lBQ2hELFlBQVksQ0FBQyxhQUFhLElBQUksQ0FBQztDQUNoQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjbGFzcyBMaWJGaWxlTWFuYWdlbWVudFNlcnZpY2Uge1xuICBvcGVuRmlsZShmaWxlQmFzZTY0RGF0YSwgZmlsZU5hbWUsIGZpbGVUeXBlKSB7IH1cbiAgc2F2ZUZpbGVGcm9tVVJMKGZpbGVVcmwsIGZ1bGxGaWxlTmFtZSA9IG51bGwpIHsgfVxuICBzYXZlRmlsZShmaWxlQmFzZTY0RGF0YSwgZmlsZU5hbWUsIGZpbGVUeXBlKSB7IH1cbiAgcHJpbnRQZGZGaWxlKHBkZkJ1ZmZlckRhdGEpIHsgfVxufVxuXG4iXX0=
|
|
@@ -15,6 +15,7 @@ class PieceComponent {
|
|
|
15
15
|
this.disabled = false;
|
|
16
16
|
this.customAttributes = {};
|
|
17
17
|
}
|
|
18
|
+
setForm(form) { this.form = form; }
|
|
18
19
|
defaultProcessAttributeChange(attribute, value) {
|
|
19
20
|
if (!attribute || attribute.trim() === '') {
|
|
20
21
|
return false;
|
|
@@ -46,10 +47,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
46
47
|
}] });
|
|
47
48
|
|
|
48
49
|
class ElementComponent extends PieceComponent {
|
|
49
|
-
start() {
|
|
50
|
+
start() {
|
|
51
|
+
var _a;
|
|
52
|
+
this.setForm((_a = this.element) === null || _a === void 0 ? void 0 : _a._form);
|
|
53
|
+
}
|
|
50
54
|
}
|
|
51
55
|
ElementComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ElementComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
52
|
-
ElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: ElementComponent, selector: "lib-element", inputs: { element: "element"
|
|
56
|
+
ElementComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: ElementComponent, selector: "lib-element", inputs: { element: "element" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
53
57
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ElementComponent, decorators: [{
|
|
54
58
|
type: Component,
|
|
55
59
|
args: [{
|
|
@@ -58,8 +62,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
58
62
|
}]
|
|
59
63
|
}], propDecorators: { element: [{
|
|
60
64
|
type: Input
|
|
61
|
-
}], form: [{
|
|
62
|
-
type: Input
|
|
63
65
|
}] } });
|
|
64
66
|
|
|
65
67
|
class ActionComponent extends ElementComponent {
|
|
@@ -67,8 +69,6 @@ class ActionComponent extends ElementComponent {
|
|
|
67
69
|
super(...arguments);
|
|
68
70
|
this.inProgress = false;
|
|
69
71
|
this.action = null;
|
|
70
|
-
this.style = 'primary';
|
|
71
|
-
this.showLabel = true;
|
|
72
72
|
}
|
|
73
73
|
ngOnInit() {
|
|
74
74
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -99,22 +99,9 @@ class ActionComponent extends ElementComponent {
|
|
|
99
99
|
this.action.notifyActivation();
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
visibleOnRestriction() {
|
|
103
|
-
var _a, _b, _c, _d, _e;
|
|
104
|
-
if (!((_a = this.action) === null || _a === void 0 ? void 0 : _a.restrictedOnField)) {
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
if ((((_b = this.action) === null || _b === void 0 ? void 0 : _b.restrictedOnOperator) === '=='
|
|
108
|
-
&& this.relatedField === ((_c = this.action) === null || _c === void 0 ? void 0 : _c.restrictedOnValue))
|
|
109
|
-
|| (((_d = this.action) === null || _d === void 0 ? void 0 : _d.restrictedOnOperator) === '!='
|
|
110
|
-
&& this.relatedField !== ((_e = this.action) === null || _e === void 0 ? void 0 : _e.restrictedOnValue))) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
102
|
}
|
|
116
103
|
ActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ActionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
117
|
-
ActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: ActionComponent, selector: "lib-action", inputs: { action: "action"
|
|
104
|
+
ActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: ActionComponent, selector: "lib-action", inputs: { action: "action" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
118
105
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ActionComponent, decorators: [{
|
|
119
106
|
type: Component,
|
|
120
107
|
args: [{
|
|
@@ -123,14 +110,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
123
110
|
}]
|
|
124
111
|
}], propDecorators: { action: [{
|
|
125
112
|
type: Input
|
|
126
|
-
}], busy: [{
|
|
127
|
-
type: Input
|
|
128
|
-
}], relatedField: [{
|
|
129
|
-
type: Input
|
|
130
|
-
}], style: [{
|
|
131
|
-
type: Input
|
|
132
|
-
}], showLabel: [{
|
|
133
|
-
type: Input
|
|
134
113
|
}] } });
|
|
135
114
|
|
|
136
115
|
const VALUE = 'value';
|
|
@@ -146,23 +125,36 @@ class FieldComponent extends ElementComponent {
|
|
|
146
125
|
this.field = null;
|
|
147
126
|
}
|
|
148
127
|
ngOnInit() {
|
|
149
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
128
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
150
129
|
if (!this.field) {
|
|
151
130
|
return;
|
|
152
131
|
}
|
|
153
132
|
this.formConfig = (_a = this.field) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
154
133
|
const mapping = Object.entries((_b = this.formConfig) === null || _b === void 0 ? void 0 : _b.fieldPropagateAttributes);
|
|
134
|
+
const customAttributesMapping = (_d = (_c = this.formConfig) === null || _c === void 0 ? void 0 : _c.propagationCustomAttributes.fields) !== null && _d !== void 0 ? _d : [];
|
|
155
135
|
for (let index = 0; index < mapping.length; index++) {
|
|
156
|
-
const fieldAttr = (
|
|
157
|
-
const componentAttr = (
|
|
136
|
+
const fieldAttr = (_e = mapping[index]) === null || _e === void 0 ? void 0 : _e[0];
|
|
137
|
+
const componentAttr = (_h = (_g = (_f = mapping[index]) === null || _f === void 0 ? void 0 : _f[1]) === null || _g === void 0 ? void 0 : _g.toString()) !== null && _h !== void 0 ? _h : '';
|
|
158
138
|
if (componentAttr) {
|
|
159
|
-
const value = (
|
|
139
|
+
const value = (_j = this.field) === null || _j === void 0 ? void 0 : _j[fieldAttr];
|
|
160
140
|
this.defaultProcessAttributeChange(componentAttr, value);
|
|
161
141
|
this.customProcessAttributeChange(componentAttr, value);
|
|
162
142
|
}
|
|
163
143
|
}
|
|
144
|
+
// Atributos personalizados
|
|
145
|
+
for (let index = 0; index < customAttributesMapping.length; index++) {
|
|
146
|
+
const customAttribute = customAttributesMapping[index];
|
|
147
|
+
if (customAttribute) {
|
|
148
|
+
const value = (_k = this.field) === null || _k === void 0 ? void 0 : _k.getCustomAttribute(customAttribute);
|
|
149
|
+
const fullName = `customAttributes.${customAttribute}`;
|
|
150
|
+
if (value) {
|
|
151
|
+
this.defaultProcessAttributeChange(fullName, value);
|
|
152
|
+
this.customProcessAttributeChange(fullName, value);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
164
156
|
// Subscripción a cambios en atributos
|
|
165
|
-
(
|
|
157
|
+
(_l = this.field) === null || _l === void 0 ? void 0 : _l.attributeChange.subscribe(event => {
|
|
166
158
|
const { name: componentAttr, value } = event;
|
|
167
159
|
this.defaultProcessAttributeChange(componentAttr, value);
|
|
168
160
|
this.customProcessAttributeChange(componentAttr, value);
|
|
@@ -233,7 +225,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
233
225
|
|
|
234
226
|
class FormHeaderComponent {
|
|
235
227
|
constructor() {
|
|
236
|
-
this.canGoBack = false;
|
|
237
228
|
this.goBackEvent = new EventEmitter();
|
|
238
229
|
}
|
|
239
230
|
goBackForm() {
|
|
@@ -241,7 +232,7 @@ class FormHeaderComponent {
|
|
|
241
232
|
}
|
|
242
233
|
}
|
|
243
234
|
FormHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FormHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
244
|
-
FormHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: FormHeaderComponent, selector: "lib-form-header", inputs: { form: "form"
|
|
235
|
+
FormHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: FormHeaderComponent, selector: "lib-form-header", inputs: { form: "form" }, outputs: { goBackEvent: "goBackEvent" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
245
236
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FormHeaderComponent, decorators: [{
|
|
246
237
|
type: Component,
|
|
247
238
|
args: [{
|
|
@@ -250,12 +241,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
250
241
|
}]
|
|
251
242
|
}], propDecorators: { form: [{
|
|
252
243
|
type: Input
|
|
253
|
-
}], canGoBack: [{
|
|
254
|
-
type: Input
|
|
255
|
-
}], showTitle: [{
|
|
256
|
-
type: Input
|
|
257
|
-
}], headerActions: [{
|
|
258
|
-
type: Input
|
|
259
244
|
}], goBackEvent: [{
|
|
260
245
|
type: Output
|
|
261
246
|
}] } });
|
|
@@ -279,10 +264,13 @@ class SectionComponent extends PieceComponent {
|
|
|
279
264
|
});
|
|
280
265
|
this.start();
|
|
281
266
|
}
|
|
282
|
-
start() {
|
|
267
|
+
start() {
|
|
268
|
+
var _a;
|
|
269
|
+
this.setForm((_a = this.section) === null || _a === void 0 ? void 0 : _a._form);
|
|
270
|
+
}
|
|
283
271
|
}
|
|
284
272
|
SectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: SectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
285
|
-
SectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: SectionComponent, selector: "lib-section", inputs: { section: "section"
|
|
273
|
+
SectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: SectionComponent, selector: "lib-section", inputs: { section: "section" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
286
274
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: SectionComponent, decorators: [{
|
|
287
275
|
type: Component,
|
|
288
276
|
args: [{
|
|
@@ -291,8 +279,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
291
279
|
}]
|
|
292
280
|
}], propDecorators: { section: [{
|
|
293
281
|
type: Input
|
|
294
|
-
}], form: [{
|
|
295
|
-
type: Input
|
|
296
282
|
}] } });
|
|
297
283
|
|
|
298
284
|
class SubSectionComponent extends PieceComponent {
|
|
@@ -314,10 +300,13 @@ class SubSectionComponent extends PieceComponent {
|
|
|
314
300
|
});
|
|
315
301
|
this.start();
|
|
316
302
|
}
|
|
317
|
-
start() {
|
|
303
|
+
start() {
|
|
304
|
+
var _a;
|
|
305
|
+
this.setForm((_a = this.subSection) === null || _a === void 0 ? void 0 : _a._form);
|
|
306
|
+
}
|
|
318
307
|
}
|
|
319
308
|
SubSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: SubSectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
320
|
-
SubSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: SubSectionComponent, selector: "lib-subsection", inputs: { subSection: "subSection"
|
|
309
|
+
SubSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: SubSectionComponent, selector: "lib-subsection", inputs: { subSection: "subSection" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
321
310
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: SubSectionComponent, decorators: [{
|
|
322
311
|
type: Component,
|
|
323
312
|
args: [{
|
|
@@ -326,18 +315,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
326
315
|
}]
|
|
327
316
|
}], propDecorators: { subSection: [{
|
|
328
317
|
type: Input
|
|
329
|
-
}], form: [{
|
|
330
|
-
type: Input
|
|
331
318
|
}] } });
|
|
332
319
|
|
|
333
320
|
const INLINE_ACTION$1 = 'INLINE';
|
|
334
321
|
class LibTableRecordActionComponent extends PieceComponent {
|
|
335
322
|
constructor() {
|
|
336
323
|
super(...arguments);
|
|
324
|
+
this.isVisible = true;
|
|
337
325
|
this.actionSelected = new EventEmitter();
|
|
338
326
|
}
|
|
339
327
|
ngOnInit() {
|
|
340
|
-
var _a, _b, _c
|
|
328
|
+
var _a, _b, _c;
|
|
341
329
|
this.formConfig = (_a = this.action) === null || _a === void 0 ? void 0 : _a._formConfig;
|
|
342
330
|
const mapping = (_b = this.formConfig) === null || _b === void 0 ? void 0 : _b.actionPropagateAttributes;
|
|
343
331
|
for (let index = 0; index < mapping.length; index++) {
|
|
@@ -346,18 +334,26 @@ class LibTableRecordActionComponent extends PieceComponent {
|
|
|
346
334
|
this.defaultProcessAttributeChange(attrName, attributeValue);
|
|
347
335
|
this.customProcessAttributeChange(attrName, attributeValue);
|
|
348
336
|
}
|
|
349
|
-
// Subscripción a cambios en atributos
|
|
350
|
-
(_d = this.action) === null || _d === void 0 ? void 0 : _d.attributeChange.subscribe(event => {
|
|
351
|
-
const { name: attrName, value } = event;
|
|
352
|
-
this.defaultProcessAttributeChange(attrName, value);
|
|
353
|
-
this.customProcessAttributeChange(attrName, value);
|
|
354
|
-
});
|
|
355
337
|
this.start();
|
|
356
338
|
}
|
|
357
|
-
start() {
|
|
339
|
+
start() {
|
|
340
|
+
if (this.action && this.action.restrictedOnField && this.recordData) {
|
|
341
|
+
const relatedField = this.recordData[this.action.restrictedOnField];
|
|
342
|
+
if (relatedField) {
|
|
343
|
+
const fieldValue = relatedField;
|
|
344
|
+
const restrictionOper = this.action.restrictedOnOperator;
|
|
345
|
+
const restrictionValue = this.action.restrictedOnValue;
|
|
346
|
+
if ((restrictionOper === '==' && fieldValue !== restrictionValue)
|
|
347
|
+
|| (restrictionOper === '!=' && fieldValue === restrictionValue)) {
|
|
348
|
+
this.isVisible = false;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
358
353
|
onActivate() {
|
|
354
|
+
var _a, _b;
|
|
359
355
|
const tableEvent = {
|
|
360
|
-
actionCode: this.action.actionCode,
|
|
356
|
+
actionCode: (_b = (_a = this.action) === null || _a === void 0 ? void 0 : _a.actionCode) !== null && _b !== void 0 ? _b : '',
|
|
361
357
|
recordId: this.recordId,
|
|
362
358
|
recordData: this.recordData,
|
|
363
359
|
};
|
|
@@ -534,6 +530,7 @@ class FormPiece {
|
|
|
534
530
|
this._absoluteDisabled = false;
|
|
535
531
|
this.visibleStates = null;
|
|
536
532
|
this.enabledStates = null;
|
|
533
|
+
this._form = null;
|
|
537
534
|
this._visible = true;
|
|
538
535
|
this._disabled = false;
|
|
539
536
|
this.customAttributes = {};
|
|
@@ -609,7 +606,7 @@ class FormPiece {
|
|
|
609
606
|
set disabled(disabled) { this.enabled = !disabled; }
|
|
610
607
|
enable() { this.enabled = true; }
|
|
611
608
|
disable() { this.enabled = false; }
|
|
612
|
-
formStateChangeCustomSubscribe(formChangeSubject) { }
|
|
609
|
+
formStateChangeCustomSubscribe(form, formChangeSubject) { }
|
|
613
610
|
formStateChange(state) {
|
|
614
611
|
if (state) {
|
|
615
612
|
this._formState = state;
|
|
@@ -617,8 +614,9 @@ class FormPiece {
|
|
|
617
614
|
this._disabled = this._absoluteDisabled || !this.enabledOnState(state);
|
|
618
615
|
}
|
|
619
616
|
}
|
|
620
|
-
|
|
621
|
-
this.
|
|
617
|
+
connectWithParentForm(form, formChangeSubject) {
|
|
618
|
+
this._form = form;
|
|
619
|
+
this.formStateChangeCustomSubscribe(form, formChangeSubject);
|
|
622
620
|
formChangeSubject.subscribe(event => this.formStateChange(event === null || event === void 0 ? void 0 : event.state));
|
|
623
621
|
}
|
|
624
622
|
}
|
|
@@ -640,7 +638,8 @@ class FormPiecePropagate extends FormPiece {
|
|
|
640
638
|
var _a;
|
|
641
639
|
super.setCustomAttribute(name, value);
|
|
642
640
|
if ((_a = this.propagationCustomAttributes) === null || _a === void 0 ? void 0 : _a.includes(name)) {
|
|
643
|
-
|
|
641
|
+
const fullName = `customAttributes.${name}`;
|
|
642
|
+
this.propagateAttribute(fullName, value);
|
|
644
643
|
}
|
|
645
644
|
}
|
|
646
645
|
setVisibility(visible, forced = null) {
|
|
@@ -674,23 +673,18 @@ class FormElement extends FormPiecePropagate {
|
|
|
674
673
|
isField() { return this.elementType === elementTypes.field; }
|
|
675
674
|
isAction() { return this.elementType === elementTypes.action; }
|
|
676
675
|
isTable() { return this.elementType === elementTypes.table; }
|
|
677
|
-
/**
|
|
678
|
-
* @deprecated Utilizar viewOnState
|
|
679
|
-
*/
|
|
680
|
-
supportState(state) { return this.viewOnState(state); }
|
|
681
|
-
/**
|
|
682
|
-
* @deprecated Utilizar viewOnState
|
|
683
|
-
*/
|
|
684
|
-
supportMode(state) { return this.viewOnState(state); }
|
|
685
676
|
}
|
|
686
677
|
|
|
687
678
|
const HEADER = 'HEADER';
|
|
688
679
|
class FormAction extends FormElement {
|
|
689
680
|
constructor(actionDefinition, formConfig) {
|
|
690
|
-
var _a, _b, _c, _d, _e;
|
|
681
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
691
682
|
super(actionDefinition, formConfig);
|
|
692
683
|
this._actionActivated = new Subject();
|
|
693
684
|
this.inProgress = false;
|
|
685
|
+
this.restrictedOnField = null;
|
|
686
|
+
this.restrictedOnOperator = null;
|
|
687
|
+
this.restrictedOnValue = null;
|
|
694
688
|
this.propagationCustomAttributes = (_c = (_b = (_a = this._formConfig) === null || _a === void 0 ? void 0 : _a.propagationCustomAttributes) === null || _b === void 0 ? void 0 : _b.actions) !== null && _c !== void 0 ? _c : [];
|
|
695
689
|
this.elementType = elementTypes.action;
|
|
696
690
|
this.actionCode = actionDefinition.actionCode ? actionDefinition.actionCode.toString() : '';
|
|
@@ -699,11 +693,46 @@ class FormAction extends FormElement {
|
|
|
699
693
|
this.setCustomAttribute('location', actionDefinition.position || HEADER);
|
|
700
694
|
this.backend = (_d = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.serverAction) !== null && _d !== void 0 ? _d : false;
|
|
701
695
|
this.newState = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.newState;
|
|
702
|
-
this.restrictedOnField = actionDefinition.fieldRestrictedCode ?
|
|
703
|
-
this.
|
|
704
|
-
|
|
696
|
+
this.restrictedOnField = (_f = (_e = actionDefinition.fieldRestrictedCode) === null || _e === void 0 ? void 0 : _e.toString()) !== null && _f !== void 0 ? _f : null;
|
|
697
|
+
if (this.restrictedOnField) {
|
|
698
|
+
this.restrictedOnOperator = actionDefinition.operatorRestricted || '';
|
|
699
|
+
this.restrictedOnValue = (_g = actionDefinition.valueRestricted) !== null && _g !== void 0 ? _g : '';
|
|
700
|
+
}
|
|
705
701
|
this.customValidation = () => true;
|
|
706
702
|
}
|
|
703
|
+
connectWithParentForm(form, formChangeSubject) {
|
|
704
|
+
var _a;
|
|
705
|
+
super.connectWithParentForm(form, formChangeSubject);
|
|
706
|
+
if (this.restrictedOnField) {
|
|
707
|
+
const relatedField = (_a = this._form.fields) === null || _a === void 0 ? void 0 : _a[this.restrictedOnField];
|
|
708
|
+
if (relatedField) {
|
|
709
|
+
relatedField.editionFinish.subscribe(event => this.updateRestrictedVisibility());
|
|
710
|
+
relatedField.editionPartial.subscribe(event => this.updateRestrictedVisibility());
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
updateRestrictedVisibility() {
|
|
715
|
+
const lastVisible = this._visible;
|
|
716
|
+
const newVisible = this._absoluteVisible && this.viewOnState(this._formState);
|
|
717
|
+
if (lastVisible !== newVisible) {
|
|
718
|
+
this.setVisibility(newVisible);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
viewOnState(state) {
|
|
722
|
+
var _a;
|
|
723
|
+
const actionVisible = (this.visibleStates && state) ? this.visibleStates.includes(state) : false;
|
|
724
|
+
if (actionVisible && this._form && this.restrictedOnField) {
|
|
725
|
+
const relatedField = (_a = this._form.fields) === null || _a === void 0 ? void 0 : _a[this.restrictedOnField];
|
|
726
|
+
if (relatedField) {
|
|
727
|
+
const fieldValue = relatedField.value;
|
|
728
|
+
if ((this.restrictedOnOperator === '==' && fieldValue !== this.restrictedOnValue)
|
|
729
|
+
|| (this.restrictedOnOperator === '!=' && fieldValue === this.restrictedOnValue)) {
|
|
730
|
+
return false;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
return actionVisible;
|
|
735
|
+
}
|
|
707
736
|
get actionActivated() { return this._actionActivated; }
|
|
708
737
|
start() { this.inProgress = true; }
|
|
709
738
|
stop() { this.inProgress = false; }
|
|
@@ -738,13 +767,13 @@ const attrs$1 = {
|
|
|
738
767
|
_defaultValue: { name: '_defaultValue', propagate: 'defaultValue' },
|
|
739
768
|
_defaultEditable: { name: '_defaultEditable', propagate: 'defaultEditable' },
|
|
740
769
|
_fieldAlignment: { name: '_fieldAlignment', propagate: 'alignment' },
|
|
741
|
-
|
|
770
|
+
fieldCode: { name: 'fieldCode', propagate: 'code' },
|
|
742
771
|
_fieldInfo: { name: '_fieldInfo', propagate: 'info' },
|
|
743
772
|
_fieldRequired: { name: '_fieldRequired', propagate: 'required' },
|
|
744
773
|
_fieldTitle: { name: '_fieldTitle', propagate: 'title' },
|
|
745
774
|
_fieldType: { name: '_fieldType', propagate: 'type' },
|
|
746
775
|
_fieldFormat: { name: '_fieldFormat', propagate: 'format' },
|
|
747
|
-
|
|
776
|
+
fieldOptions: { name: 'fieldOptions', propagate: 'options' },
|
|
748
777
|
_focus: { name: '_focus', propagate: 'focus' },
|
|
749
778
|
_hasChanged: { name: '_hasChanged', propagate: 'hasChanged' },
|
|
750
779
|
_intrinsicErrorMessage: { name: '_intrinsicErrorMessage', propagate: null },
|
|
@@ -769,7 +798,6 @@ class FieldDescriptor extends FormElement {
|
|
|
769
798
|
this._errorType = '';
|
|
770
799
|
this._errorCode = '';
|
|
771
800
|
this._errorMessage = '';
|
|
772
|
-
this._fieldCode = '';
|
|
773
801
|
this._intrinsicErrorMessage = '';
|
|
774
802
|
this._maxLength = 0;
|
|
775
803
|
this._minLength = 0;
|
|
@@ -786,15 +814,16 @@ class FieldDescriptor extends FormElement {
|
|
|
786
814
|
this._fieldTitle = '';
|
|
787
815
|
this._fieldType = '';
|
|
788
816
|
this._fieldFormat = null;
|
|
789
|
-
this._fieldOptions = null;
|
|
790
817
|
this._hasChanged = false;
|
|
791
818
|
this._outputOnly = false;
|
|
792
819
|
this._tooltipText = '';
|
|
820
|
+
this.fieldCode = '';
|
|
821
|
+
this.fieldOptions = null;
|
|
793
822
|
this.propagationCustomAttributes = (_c = (_b = (_a = this._formConfig) === null || _a === void 0 ? void 0 : _a.propagationCustomAttributes) === null || _b === void 0 ? void 0 : _b.fields) !== null && _c !== void 0 ? _c : [];
|
|
794
823
|
this.elementType = elementTypes.field;
|
|
795
824
|
const fld = (inputFieldReceived) ? inputFieldReceived : {};
|
|
796
|
-
this.setAttr(attrs$1.
|
|
797
|
-
this.title = (_d = fld.fieldTitle) !== null && _d !== void 0 ? _d : this.
|
|
825
|
+
this.setAttr(attrs$1.fieldCode, fld.fieldCode);
|
|
826
|
+
this.title = (_d = fld.fieldTitle) !== null && _d !== void 0 ? _d : this.fieldCode;
|
|
798
827
|
this.type = fld.fieldTypeCode;
|
|
799
828
|
this.captureType = (_e = fld.captureType) !== null && _e !== void 0 ? _e : DEFAULT_CAPTURE_TYPE;
|
|
800
829
|
const defaultValue = (_f = fld.defaultValue) !== null && _f !== void 0 ? _f : null;
|
|
@@ -836,8 +865,7 @@ class FieldDescriptor extends FormElement {
|
|
|
836
865
|
get backend() { return this._validateOnServer; }
|
|
837
866
|
get captureType() { return this._captureType; }
|
|
838
867
|
set captureType(captureType) { this.setAttr(attrs$1._captureType, captureType); }
|
|
839
|
-
get code() { return this.
|
|
840
|
-
get fieldCode() { return this._fieldCode; }
|
|
868
|
+
get code() { return this.fieldCode; }
|
|
841
869
|
get defaultValue() { return this._defaultValue; }
|
|
842
870
|
set defaultValue(defaultValue) { this.setAttr(attrs$1._defaultValue, defaultValue); }
|
|
843
871
|
get defaultEditable() { return this._defaultEditable; }
|
|
@@ -902,10 +930,10 @@ class FieldDescriptor extends FormElement {
|
|
|
902
930
|
}
|
|
903
931
|
this.setAttr(attrs$1._minValue, minValue);
|
|
904
932
|
}
|
|
905
|
-
get name() { return this.
|
|
933
|
+
get name() { return this.fieldCode; }
|
|
906
934
|
get options() {
|
|
907
935
|
var _a, _b;
|
|
908
|
-
return (_b = (_a = this.
|
|
936
|
+
return (_b = (_a = this.fieldOptions) === null || _a === void 0 ? void 0 : _a.map(option => {
|
|
909
937
|
const optionCopy = Object.assign({}, option);
|
|
910
938
|
return optionCopy;
|
|
911
939
|
})) !== null && _b !== void 0 ? _b : null;
|
|
@@ -926,25 +954,25 @@ class FieldDescriptor extends FormElement {
|
|
|
926
954
|
});
|
|
927
955
|
fieldOptions = (fieldOptions && Array.isArray(fieldOptions)
|
|
928
956
|
&& fieldOptions.length > 0) ? fieldOptions : [];
|
|
929
|
-
this.setAttr(attrs$1.
|
|
957
|
+
this.setAttr(attrs$1.fieldOptions, fieldOptions);
|
|
930
958
|
if (this._value) {
|
|
931
959
|
if (this._fieldType === this._formConfig.fieldTypes.array && Array.isArray(this._value)) {
|
|
932
|
-
const fieldValue = (_a = this._value) === null || _a === void 0 ? void 0 : _a.filter(item => { var _a; return (_a = this.
|
|
960
|
+
const fieldValue = (_a = this._value) === null || _a === void 0 ? void 0 : _a.filter(item => { var _a; return (_a = this.fieldOptions) === null || _a === void 0 ? void 0 : _a.find(opt => opt.fieldOptionId === item); });
|
|
933
961
|
this.setAttr(attrs$1._value, fieldValue);
|
|
934
962
|
}
|
|
935
963
|
else {
|
|
936
|
-
const valInOptions = (_b = this.
|
|
964
|
+
const valInOptions = (_b = this.fieldOptions) === null || _b === void 0 ? void 0 : _b.find(item => item.fieldOptionId === this._value);
|
|
937
965
|
if (!valInOptions) {
|
|
938
966
|
this._setValue('');
|
|
939
967
|
}
|
|
940
968
|
}
|
|
941
969
|
}
|
|
942
|
-
if (this._fieldRequired && ((_c = this.
|
|
943
|
-
this._setValue((_e = this.
|
|
970
|
+
if (this._fieldRequired && ((_c = this.fieldOptions) === null || _c === void 0 ? void 0 : _c.length) === 1 && this._value !== ((_d = this.fieldOptions) === null || _d === void 0 ? void 0 : _d[0].fieldOptionId)) {
|
|
971
|
+
this._setValue((_e = this.fieldOptions) === null || _e === void 0 ? void 0 : _e[0].fieldOptionId);
|
|
944
972
|
this.notifyEditionFinish();
|
|
945
973
|
}
|
|
946
974
|
}
|
|
947
|
-
get optionText() { var _a, _b, _c; return (_c = (_b = (_a = this.
|
|
975
|
+
get optionText() { var _a, _b, _c; return (_c = (_b = (_a = this.fieldOptions) === null || _a === void 0 ? void 0 : _a.find(item => item.fieldOptionId === this._value)) === null || _b === void 0 ? void 0 : _b.fieldOptionValue) !== null && _c !== void 0 ? _c : null; }
|
|
948
976
|
get outputOnly() { return this._outputOnly; }
|
|
949
977
|
set outputOnly(outputOnly) { this.setAttr(attrs$1._outputOnly, outputOnly); }
|
|
950
978
|
get required() { return this._fieldRequired; }
|
|
@@ -968,14 +996,6 @@ class FieldDescriptor extends FormElement {
|
|
|
968
996
|
set value(newValue) { this._setValue(newValue); }
|
|
969
997
|
get visibleLabel() { return this._visibleLabel; }
|
|
970
998
|
set visibleLabel(visibleLabel) { this.setAttr(attrs$1._visibleLabel, visibleLabel); }
|
|
971
|
-
/**
|
|
972
|
-
* @deprecated Use options
|
|
973
|
-
*/
|
|
974
|
-
get fieldOptions() { return this._fieldOptions; }
|
|
975
|
-
/**
|
|
976
|
-
* @deprecated Use options
|
|
977
|
-
*/
|
|
978
|
-
set fieldOptions(options) { this.options = options; }
|
|
979
999
|
/**
|
|
980
1000
|
* @deprecated Use value
|
|
981
1001
|
*/
|
|
@@ -1051,7 +1071,7 @@ class FieldDescriptor extends FormElement {
|
|
|
1051
1071
|
setVisibleLabel(visibleLabel) { this.visibleLabel = visibleLabel; }
|
|
1052
1072
|
notifyEditionPartial() {
|
|
1053
1073
|
this.resetError();
|
|
1054
|
-
this._editionPartial.next({ code: this.
|
|
1074
|
+
this._editionPartial.next({ code: this.fieldCode, intrinsicValidation: true });
|
|
1055
1075
|
}
|
|
1056
1076
|
notifyEditionFinish() {
|
|
1057
1077
|
var _a, _b, _c, _d, _e;
|
|
@@ -1088,10 +1108,10 @@ class FieldDescriptor extends FormElement {
|
|
|
1088
1108
|
intrinsicValidation = false;
|
|
1089
1109
|
this.setError('99', `Longitud de ${this._fieldTitle} debe ser de al menos ${this._minLength}`);
|
|
1090
1110
|
}
|
|
1091
|
-
this._editionFinish.next({ code: this.
|
|
1111
|
+
this._editionFinish.next({ code: this.fieldCode, intrinsicValidation });
|
|
1092
1112
|
}
|
|
1093
1113
|
notifyEditionDetailRequest(detail) {
|
|
1094
|
-
const detailEvent = { code: this.
|
|
1114
|
+
const detailEvent = { code: this.fieldCode, detail };
|
|
1095
1115
|
this._detailRequest.next(detailEvent);
|
|
1096
1116
|
}
|
|
1097
1117
|
setError(code, message, type = DEFAULT_ERROR_TYPE) {
|
|
@@ -1242,8 +1262,11 @@ class RecordTableColumn extends FormPiece {
|
|
|
1242
1262
|
|
|
1243
1263
|
class TableAction extends FormPiece {
|
|
1244
1264
|
constructor(actionDefinition, formConfig) {
|
|
1245
|
-
var _a, _b;
|
|
1265
|
+
var _a, _b, _c;
|
|
1246
1266
|
super(actionDefinition, formConfig);
|
|
1267
|
+
this.restrictedOnField = null;
|
|
1268
|
+
this.restrictedOnValue = null;
|
|
1269
|
+
this.restrictedOnOperator = null;
|
|
1247
1270
|
this.actionCode = actionDefinition.actionCode;
|
|
1248
1271
|
this.actionTitle = actionDefinition.actionTitle;
|
|
1249
1272
|
this.iconName = actionDefinition.iconName || this.actionCode;
|
|
@@ -1252,9 +1275,11 @@ class TableAction extends FormPiece {
|
|
|
1252
1275
|
this.newState = actionDefinition.newState;
|
|
1253
1276
|
this.stateField = actionDefinition.stateField || '';
|
|
1254
1277
|
this.backend = (_a = actionDefinition === null || actionDefinition === void 0 ? void 0 : actionDefinition.serverAction) !== null && _a !== void 0 ? _a : false;
|
|
1255
|
-
this.restrictedOnField = actionDefinition.fieldRestrictedCode
|
|
1256
|
-
|
|
1257
|
-
|
|
1278
|
+
this.restrictedOnField = (_b = actionDefinition.fieldRestrictedCode) !== null && _b !== void 0 ? _b : null;
|
|
1279
|
+
if (this.restrictedOnField) {
|
|
1280
|
+
this.restrictedOnValue = (_c = actionDefinition.valueRestricted) !== null && _c !== void 0 ? _c : null;
|
|
1281
|
+
this.restrictedOnOperator = actionDefinition.operatorRestricted || null;
|
|
1282
|
+
}
|
|
1258
1283
|
}
|
|
1259
1284
|
}
|
|
1260
1285
|
|
|
@@ -1774,13 +1799,13 @@ class RecordTable extends FormElement {
|
|
|
1774
1799
|
}
|
|
1775
1800
|
return direction === TABLE_SORT_ASCENDING ? result : -result;
|
|
1776
1801
|
}
|
|
1777
|
-
formStateChangeCustomSubscribe(formChangeSubject) {
|
|
1802
|
+
formStateChangeCustomSubscribe(form, formChangeSubject) {
|
|
1778
1803
|
var _a, _b;
|
|
1779
1804
|
(_a = this.columns) === null || _a === void 0 ? void 0 : _a.forEach(column => {
|
|
1780
|
-
column === null || column === void 0 ? void 0 : column.
|
|
1805
|
+
column === null || column === void 0 ? void 0 : column.connectWithParentForm(form, formChangeSubject);
|
|
1781
1806
|
});
|
|
1782
1807
|
(_b = this._actions) === null || _b === void 0 ? void 0 : _b.forEach(action => {
|
|
1783
|
-
action === null || action === void 0 ? void 0 : action.
|
|
1808
|
+
action === null || action === void 0 ? void 0 : action.connectWithParentForm(form, formChangeSubject);
|
|
1784
1809
|
});
|
|
1785
1810
|
}
|
|
1786
1811
|
}
|
|
@@ -1997,10 +2022,10 @@ class RecordFormSection extends FormPiecePropagate {
|
|
|
1997
2022
|
}
|
|
1998
2023
|
return null;
|
|
1999
2024
|
}
|
|
2000
|
-
formStateChangeCustomSubscribe(formChangeSubject) {
|
|
2025
|
+
formStateChangeCustomSubscribe(form, formChangeSubject) {
|
|
2001
2026
|
var _a;
|
|
2002
2027
|
(_a = this.subSections) === null || _a === void 0 ? void 0 : _a.forEach(subsection => {
|
|
2003
|
-
subsection === null || subsection === void 0 ? void 0 : subsection.
|
|
2028
|
+
subsection === null || subsection === void 0 ? void 0 : subsection.connectWithParentForm(form, formChangeSubject);
|
|
2004
2029
|
});
|
|
2005
2030
|
}
|
|
2006
2031
|
}
|
|
@@ -2291,7 +2316,7 @@ class FormStructureAndData {
|
|
|
2291
2316
|
return this.getFieldSet(fld => (fld === null || fld === void 0 ? void 0 : fld.required) && (fld === null || fld === void 0 ? void 0 : fld.empty), codes !== null && codes !== void 0 ? codes : null, secCode, subCode);
|
|
2292
2317
|
}
|
|
2293
2318
|
getChangedFields(codes, secCode, subCode) {
|
|
2294
|
-
return this.getFieldSet(fld => !(fld === null || fld === void 0 ? void 0 : fld.outputOnly) && (fld === null || fld === void 0 ? void 0 : fld.hasChanged
|
|
2319
|
+
return this.getFieldSet(fld => !(fld === null || fld === void 0 ? void 0 : fld.outputOnly) && (fld === null || fld === void 0 ? void 0 : fld.hasChanged), codes !== null && codes !== void 0 ? codes : null, secCode, subCode);
|
|
2295
2320
|
}
|
|
2296
2321
|
getFieldsWithValidationIssues(codes, secCode, subCode) {
|
|
2297
2322
|
return this.getFieldSet(fld => fld === null || fld === void 0 ? void 0 : fld.hasError(), codes !== null && codes !== void 0 ? codes : null, secCode, subCode);
|
|
@@ -2546,6 +2571,7 @@ class LibFileManagementService {
|
|
|
2546
2571
|
openFile(fileBase64Data, fileName, fileType) { }
|
|
2547
2572
|
saveFileFromURL(fileUrl, fullFileName = null) { }
|
|
2548
2573
|
saveFile(fileBase64Data, fileName, fileType) { }
|
|
2574
|
+
printPdfFile(pdfBufferData) { }
|
|
2549
2575
|
}
|
|
2550
2576
|
|
|
2551
2577
|
const PAYLOAD_VERSION = 'TUAINEXCHANGE_1.0';
|
|
@@ -2891,11 +2917,11 @@ class BasicFormComponent {
|
|
|
2891
2917
|
this.onTableServerError(() => this.displayTableServerError());
|
|
2892
2918
|
}
|
|
2893
2919
|
get formVisible() { return this.visible; }
|
|
2894
|
-
get
|
|
2920
|
+
get form() { return this; }
|
|
2895
2921
|
get formCode() { var _a; return (_a = this.name) !== null && _a !== void 0 ? _a : ''; }
|
|
2896
2922
|
set formCode(name) { this.name = name; }
|
|
2897
2923
|
get inServerProcess() { return this.busy; }
|
|
2898
|
-
get
|
|
2924
|
+
get formStructure() { return this._formStructure; }
|
|
2899
2925
|
get state() { var _a, _b; return (_b = (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : null; }
|
|
2900
2926
|
get currentState() { var _a, _b; return (_b = (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : ''; }
|
|
2901
2927
|
set currentState(state) { this === null || this === void 0 ? void 0 : this.changeState(state); }
|
|
@@ -3023,7 +3049,7 @@ class BasicFormComponent {
|
|
|
3023
3049
|
section.activation.subscribe((code) => this.launchSectionActivation(code));
|
|
3024
3050
|
section.inactivation.subscribe((code) => this.launchSectionInactivation(code));
|
|
3025
3051
|
// Adicionalmente se le pide a la sección se subscriba al cambio de estado del formulario
|
|
3026
|
-
section.
|
|
3052
|
+
section.connectWithParentForm(this, (_b = this._formStructure) === null || _b === void 0 ? void 0 : _b.stateChange);
|
|
3027
3053
|
}
|
|
3028
3054
|
}
|
|
3029
3055
|
subscribeFieldsSubjects() {
|
|
@@ -3042,7 +3068,7 @@ class BasicFormComponent {
|
|
|
3042
3068
|
});
|
|
3043
3069
|
field.detailRequest.subscribe(event => this.showFieldInfo(event.code, event.detail));
|
|
3044
3070
|
// Adicionalmente se le pide al campo se subscriba al cambio de estado del formulario
|
|
3045
|
-
field.
|
|
3071
|
+
field.connectWithParentForm(this, (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.stateChange);
|
|
3046
3072
|
});
|
|
3047
3073
|
}
|
|
3048
3074
|
}
|
|
@@ -3054,7 +3080,7 @@ class BasicFormComponent {
|
|
|
3054
3080
|
var _a;
|
|
3055
3081
|
action.actionActivated.subscribe(code => this.startAction(code));
|
|
3056
3082
|
// Adicionalmente se le pide a la acción se subscriba al cambio de estado del formulario
|
|
3057
|
-
action.
|
|
3083
|
+
action.connectWithParentForm(this, (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.stateChange);
|
|
3058
3084
|
});
|
|
3059
3085
|
}
|
|
3060
3086
|
}
|
|
@@ -3070,7 +3096,7 @@ class BasicFormComponent {
|
|
|
3070
3096
|
table.selectionActionTrigger.subscribe(event => this.startTableSelectionAction(event));
|
|
3071
3097
|
table.getDataTrigger.subscribe(event => this.startTableGetData(event));
|
|
3072
3098
|
// Adicionalmente se le pide a la tabla se subscriba al cambio de estado del formulario
|
|
3073
|
-
table.
|
|
3099
|
+
table.connectWithParentForm(this, (_a = this._formStructure) === null || _a === void 0 ? void 0 : _a.stateChange);
|
|
3074
3100
|
});
|
|
3075
3101
|
}
|
|
3076
3102
|
}
|
|
@@ -4111,7 +4137,11 @@ class BasicFormComponent {
|
|
|
4111
4137
|
for (const columnName of columnNames) {
|
|
4112
4138
|
const columnValue = (_a = tableRecord.getFieldValue(columnName)) !== null && _a !== void 0 ? _a : '';
|
|
4113
4139
|
const code = (_b = mappingTable === null || mappingTable === void 0 ? void 0 : mappingTable[columnName]) !== null && _b !== void 0 ? _b : columnName;
|
|
4114
|
-
this.
|
|
4140
|
+
const field = code ? this.getField(code) : null;
|
|
4141
|
+
if (field) {
|
|
4142
|
+
field.setValue(columnValue);
|
|
4143
|
+
field.hasChanged = false;
|
|
4144
|
+
}
|
|
4115
4145
|
}
|
|
4116
4146
|
return true;
|
|
4117
4147
|
}
|