tuain-ng-forms-lib 15.2.12 → 17.1.0
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/esm2022/lib/classes/forms/action.mjs +104 -0
- package/esm2022/lib/classes/forms/element.mjs +23 -0
- package/esm2022/lib/classes/forms/field.mjs +468 -0
- package/esm2022/lib/classes/forms/form.mjs +581 -0
- package/esm2022/lib/classes/forms/piece-propagate.mjs +39 -0
- package/esm2022/lib/classes/forms/piece.mjs +126 -0
- package/esm2022/lib/classes/forms/section.mjs +151 -0
- package/esm2022/lib/classes/forms/subsection.mjs +99 -0
- package/esm2022/lib/classes/forms/table/action.mjs +38 -0
- package/esm2022/lib/classes/forms/table/column.mjs +74 -0
- package/esm2022/lib/classes/forms/table/row-data.mjs +116 -0
- package/esm2022/lib/classes/forms/table/table.mjs +523 -0
- package/esm2022/lib/components/elements/action.component.mjs +62 -0
- package/esm2022/lib/components/elements/field.component.mjs +99 -0
- package/esm2022/lib/components/elements/layout/element.component.mjs +21 -0
- package/esm2022/lib/components/elements/layout/form-error.component.mjs +23 -0
- package/esm2022/lib/components/elements/layout/form-header.component.mjs +23 -0
- package/esm2022/lib/components/elements/layout/piece.component.mjs +64 -0
- package/esm2022/lib/components/elements/layout/section.component.mjs +48 -0
- package/esm2022/lib/components/elements/layout/sub-section.component.mjs +48 -0
- package/esm2022/lib/components/elements/tables/table-record-action.component.mjs +72 -0
- package/esm2022/lib/components/elements/tables/table-record-field.component.mjs +31 -0
- package/esm2022/lib/components/elements/tables/table.component.mjs +98 -0
- package/esm2022/lib/components/forms/basic-form.mjs +1314 -0
- package/esm2022/lib/services/event-manager.service.mjs +43 -0
- package/esm2022/lib/services/form-manager.service.mjs +81 -0
- package/{esm2020 → esm2022}/lib/tuain-ng-forms-lib.module.mjs +29 -29
- package/{fesm2020 → fesm2022}/tuain-ng-forms-lib.mjs +832 -603
- package/fesm2022/tuain-ng-forms-lib.mjs.map +1 -0
- package/lib/classes/forms/action.d.ts +30 -14
- package/lib/classes/forms/field.d.ts +9 -4
- package/lib/classes/forms/section.d.ts +18 -6
- package/lib/classes/forms/subsection.d.ts +28 -10
- package/lib/classes/forms/table/table.d.ts +63 -21
- package/lib/components/elements/action.component.d.ts +9 -2
- package/lib/components/elements/field.component.d.ts +22 -16
- package/lib/components/elements/layout/element.component.d.ts +1 -1
- package/lib/components/elements/layout/form-error.component.d.ts +1 -1
- package/lib/components/elements/layout/form-header.component.d.ts +1 -1
- package/lib/components/elements/layout/piece.component.d.ts +9 -5
- package/lib/components/elements/layout/section.component.d.ts +2 -1
- package/lib/components/elements/layout/sub-section.component.d.ts +2 -1
- package/lib/components/elements/tables/table-record-action.component.d.ts +2 -1
- package/lib/components/elements/tables/table-record-field.component.d.ts +1 -1
- package/lib/components/elements/tables/table.component.d.ts +12 -5
- package/lib/components/forms/basic-form.d.ts +1 -1
- package/package.json +7 -13
- package/esm2020/lib/classes/forms/action.mjs +0 -72
- package/esm2020/lib/classes/forms/element.mjs +0 -18
- package/esm2020/lib/classes/forms/field.mjs +0 -454
- package/esm2020/lib/classes/forms/form.mjs +0 -574
- package/esm2020/lib/classes/forms/piece-propagate.mjs +0 -38
- package/esm2020/lib/classes/forms/piece.mjs +0 -123
- package/esm2020/lib/classes/forms/section.mjs +0 -138
- package/esm2020/lib/classes/forms/subsection.mjs +0 -81
- package/esm2020/lib/classes/forms/table/action.mjs +0 -30
- package/esm2020/lib/classes/forms/table/column.mjs +0 -74
- package/esm2020/lib/classes/forms/table/row-data.mjs +0 -116
- package/esm2020/lib/classes/forms/table/table.mjs +0 -464
- package/esm2020/lib/components/elements/action.component.mjs +0 -55
- package/esm2020/lib/components/elements/field.component.mjs +0 -99
- package/esm2020/lib/components/elements/layout/element.component.mjs +0 -20
- package/esm2020/lib/components/elements/layout/form-error.component.mjs +0 -20
- package/esm2020/lib/components/elements/layout/form-header.component.mjs +0 -24
- package/esm2020/lib/components/elements/layout/piece.component.mjs +0 -40
- package/esm2020/lib/components/elements/layout/section.component.mjs +0 -39
- package/esm2020/lib/components/elements/layout/sub-section.component.mjs +0 -39
- package/esm2020/lib/components/elements/tables/table-record-action.component.mjs +0 -67
- package/esm2020/lib/components/elements/tables/table-record-field.component.mjs +0 -30
- package/esm2020/lib/components/elements/tables/table.component.mjs +0 -92
- package/esm2020/lib/components/forms/basic-form.mjs +0 -1310
- package/esm2020/lib/services/event-manager.service.mjs +0 -43
- package/esm2020/lib/services/form-manager.service.mjs +0 -80
- package/fesm2015/tuain-ng-forms-lib.mjs +0 -4305
- package/fesm2015/tuain-ng-forms-lib.mjs.map +0 -1
- package/fesm2020/tuain-ng-forms-lib.mjs.map +0 -1
- /package/{esm2020 → esm2022}/lib/classes/forms/form.constants.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/services/file-manager.service.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/tuain-ng-forms-lib.mjs +0 -0
- /package/{tuain-ng-forms-lib.d.ts → index.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, EventEmitter, Output, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
2
|
+
import { signal, computed, Component, Input, EventEmitter, Output, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
3
|
import { BehaviorSubject, Subject, ReplaySubject } from 'rxjs';
|
|
4
4
|
import yn from 'yn';
|
|
5
5
|
import { nanoid } from 'nanoid';
|
|
@@ -7,37 +7,61 @@ import { CommonModule } from '@angular/common';
|
|
|
7
7
|
import { RouterModule } from '@angular/router';
|
|
8
8
|
import { FormsModule } from '@angular/forms';
|
|
9
9
|
|
|
10
|
-
const CUSTOM_ATTRIBUTES = 'customAttributes';
|
|
10
|
+
const CUSTOM_ATTRIBUTES$6 = 'customAttributes';
|
|
11
11
|
class PieceComponent {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
form;
|
|
13
|
+
formConfig;
|
|
14
|
+
visible = signal(false);
|
|
15
|
+
disabled = signal(false);
|
|
16
|
+
enabled = computed(() => !this.disabled());
|
|
17
|
+
customAttributes = signal({});
|
|
17
18
|
setForm(form) { this.form = form; }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
propagatedAttributeChange(attribute, value) { }
|
|
20
|
+
updatePieceAttribute(signaledAttributes, signaledAttribute, value) {
|
|
21
|
+
if (!signaledAttributes.includes(signaledAttribute)) {
|
|
22
|
+
return;
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
24
|
+
this[signaledAttribute]?.set(value);
|
|
25
|
+
this.propagatedAttributeChange(signaledAttribute, value);
|
|
26
|
+
}
|
|
27
|
+
updatePieceAttributes(piece, signaledAttributes) {
|
|
28
|
+
if (!piece) {
|
|
29
|
+
return;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
// Se recore el conjunto de los atributos propagados desde el piece y se asigna el valor respectivo
|
|
32
|
+
for (let index = 0; index < signaledAttributes.length; index++) {
|
|
33
|
+
const signaledAttribute = signaledAttributes[index];
|
|
34
|
+
try {
|
|
35
|
+
this[signaledAttribute]?.set(piece?.[signaledAttribute]);
|
|
36
|
+
this.propagatedAttributeChange(signaledAttribute, piece?.[signaledAttribute]);
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
console.log(`Señal ${signaledAttribute} invalida en el componente. ${e}`);
|
|
40
|
+
}
|
|
32
41
|
}
|
|
33
|
-
return true;
|
|
34
42
|
}
|
|
35
|
-
|
|
43
|
+
// Función que las subclases pueden sobrecargar para manejar un comportamiento específico
|
|
36
44
|
customAttributeChange(subAttribute, value) { }
|
|
45
|
+
updateCustomAttribute(attrName, attrValue) {
|
|
46
|
+
this.customAttributes.update(oldCustomAttr => {
|
|
47
|
+
oldCustomAttr[attrName] = attrValue;
|
|
48
|
+
return oldCustomAttr;
|
|
49
|
+
});
|
|
50
|
+
// Ejecución de función personalizada ante un cambio de atributo personalizado
|
|
51
|
+
this.customAttributeChange(attrName, attrValue);
|
|
52
|
+
}
|
|
53
|
+
replaceCustomAttributes(customAttributes) {
|
|
54
|
+
this.customAttributes.set(customAttributes ?? {});
|
|
55
|
+
Object.keys(customAttributes).forEach(attrName => {
|
|
56
|
+
const attrValue = customAttributes[attrName];
|
|
57
|
+
// Ejecución de función personalizada ante un cambio de atributo personalizado
|
|
58
|
+
this.customAttributeChange(attrName, attrValue);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PieceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
62
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PieceComponent, selector: "lib-piece", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
37
63
|
}
|
|
38
|
-
|
|
39
|
-
PieceComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: PieceComponent, selector: "lib-piece", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: PieceComponent, decorators: [{
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PieceComponent, decorators: [{
|
|
41
65
|
type: Component,
|
|
42
66
|
args: [{
|
|
43
67
|
selector: 'lib-piece',
|
|
@@ -46,13 +70,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
46
70
|
}] });
|
|
47
71
|
|
|
48
72
|
class ElementComponent extends PieceComponent {
|
|
73
|
+
element;
|
|
49
74
|
start() {
|
|
50
75
|
this.setForm(this.element?._form);
|
|
51
76
|
}
|
|
77
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ElementComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
78
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ElementComponent, selector: "lib-element", inputs: { element: "element" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
52
79
|
}
|
|
53
|
-
|
|
54
|
-
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 });
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ElementComponent, decorators: [{
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ElementComponent, decorators: [{
|
|
56
81
|
type: Component,
|
|
57
82
|
args: [{
|
|
58
83
|
selector: 'lib-element',
|
|
@@ -62,35 +87,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
62
87
|
type: Input
|
|
63
88
|
}] } });
|
|
64
89
|
|
|
90
|
+
const CUSTOM_ATTRIBUTES$5 = 'customAttributes';
|
|
91
|
+
const signaledAttributes$5 = [
|
|
92
|
+
'actionCode', 'actionName', 'iconName', 'inProgress', 'restrictedOnField', 'restrictedOnOperator',
|
|
93
|
+
'restrictedOnValue', 'visible', 'disabled',
|
|
94
|
+
];
|
|
65
95
|
class ActionComponent extends ElementComponent {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
96
|
+
actionCode = signal(null);
|
|
97
|
+
actionName = signal(null);
|
|
98
|
+
iconName = signal(null);
|
|
99
|
+
inProgress = signal(false);
|
|
100
|
+
restrictedOnField = signal(null);
|
|
101
|
+
restrictedOnOperator = signal(null);
|
|
102
|
+
restrictedOnValue = signal(null);
|
|
103
|
+
action = null;
|
|
104
|
+
updatePropagatedAttributes() {
|
|
105
|
+
this.updatePieceAttributes(this.action, signaledAttributes$5);
|
|
70
106
|
}
|
|
71
107
|
ngOnInit() {
|
|
72
108
|
if (!this.action) {
|
|
73
109
|
return;
|
|
74
110
|
}
|
|
111
|
+
this.action.widget = this;
|
|
75
112
|
this.formConfig = this.action?._formConfig;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.
|
|
83
|
-
|
|
113
|
+
this.updatePropagatedAttributes();
|
|
114
|
+
this.replaceCustomAttributes(this.action?.customAttributes);
|
|
115
|
+
this.action?.attributeChange.subscribe(event => {
|
|
116
|
+
const { name: attribute, value = null } = event ?? {};
|
|
117
|
+
const attributeParts = attribute?.split('.') ?? [];
|
|
118
|
+
if (signaledAttributes$5.includes(attribute)) {
|
|
119
|
+
this.updatePieceAttribute(signaledAttributes$5, attribute, value);
|
|
120
|
+
}
|
|
121
|
+
else if (attributeParts?.length > 1 && attributeParts?.[0] === CUSTOM_ATTRIBUTES$5) {
|
|
122
|
+
const subAttribute = attributeParts?.[1] ?? null;
|
|
123
|
+
this.updateCustomAttribute(subAttribute, value);
|
|
84
124
|
}
|
|
85
|
-
}
|
|
86
|
-
this.action?.attributeChange?.subscribe(event => {
|
|
87
|
-
const { name: componentAttr, value } = event;
|
|
88
|
-
this.defaultProcessAttributeChange(componentAttr, value);
|
|
89
|
-
this.customProcessAttributeChange(componentAttr, value);
|
|
90
125
|
});
|
|
91
|
-
if (this.action) {
|
|
92
|
-
this.action.widget = this;
|
|
93
|
-
}
|
|
94
126
|
this.start();
|
|
95
127
|
}
|
|
96
128
|
start() {
|
|
@@ -101,10 +133,10 @@ class ActionComponent extends ElementComponent {
|
|
|
101
133
|
this.action.notifyActivation();
|
|
102
134
|
}
|
|
103
135
|
}
|
|
136
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ActionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
137
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ActionComponent, selector: "lib-action", inputs: { action: "action" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
104
138
|
}
|
|
105
|
-
|
|
106
|
-
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 });
|
|
107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: ActionComponent, decorators: [{
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ActionComponent, decorators: [{
|
|
108
140
|
type: Component,
|
|
109
141
|
args: [{
|
|
110
142
|
selector: 'lib-action',
|
|
@@ -114,72 +146,76 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
114
146
|
type: Input
|
|
115
147
|
}] } });
|
|
116
148
|
|
|
149
|
+
const CUSTOM_ATTRIBUTES$4 = 'customAttributes';
|
|
150
|
+
const signaledAttributes$4 = ['captureType', 'errorCode', 'errorMessage', 'errorType', 'defaultValue',
|
|
151
|
+
'defaultEditable', 'alignment', 'code', 'info', 'required', 'title', 'type', 'format', 'options',
|
|
152
|
+
'hasChanged', 'maxLength', 'maxValue', 'minLength', 'minValue', 'onValidation', 'outputOnly',
|
|
153
|
+
'placeholder', 'tooltip', 'validateOnServer', 'visibleLabel', 'visible', 'disabled',
|
|
154
|
+
];
|
|
117
155
|
const VALUE = 'value';
|
|
118
156
|
const FOCUS = 'focus';
|
|
119
157
|
class FieldComponent extends ElementComponent {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
158
|
+
// Atributos propagados desde el campo
|
|
159
|
+
captureType = signal('');
|
|
160
|
+
errorCode = signal('');
|
|
161
|
+
errorMessage = signal('');
|
|
162
|
+
errorType = signal('');
|
|
163
|
+
defaultValue = signal(null);
|
|
164
|
+
defaultEditable = signal(false);
|
|
165
|
+
alignment = signal('');
|
|
166
|
+
code = signal('');
|
|
167
|
+
info = signal(null);
|
|
168
|
+
required = signal(false);
|
|
169
|
+
title = signal('');
|
|
170
|
+
type = signal('');
|
|
171
|
+
format = signal(null);
|
|
172
|
+
options = signal(null);
|
|
173
|
+
hasChanged = signal(false);
|
|
174
|
+
minLength = signal(0);
|
|
175
|
+
maxLength = signal(0);
|
|
176
|
+
minValue = signal(null);
|
|
177
|
+
maxValue = signal(null);
|
|
178
|
+
onValidation = signal(false);
|
|
179
|
+
outputOnly = signal(false);
|
|
180
|
+
placeholder = signal('');
|
|
181
|
+
tooltip = signal('');
|
|
182
|
+
validateOnServer = signal(false);
|
|
183
|
+
visibleLabel = signal(true);
|
|
184
|
+
value; // Valor del componente relacionado con el campo (pueden diferir en formato y tipo)
|
|
185
|
+
field = null;
|
|
186
|
+
updatePropagatedAttributes() {
|
|
187
|
+
this.updatePieceAttributes(this.field, signaledAttributes$4);
|
|
128
188
|
}
|
|
129
189
|
ngOnInit() {
|
|
130
190
|
if (!this.field) {
|
|
131
191
|
return;
|
|
132
192
|
}
|
|
193
|
+
this.field.widget = this;
|
|
133
194
|
this.formConfig = this.field?._formConfig;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
this.defaultProcessAttributeChange(componentAttr, value);
|
|
142
|
-
this.customProcessAttributeChange(componentAttr, value);
|
|
195
|
+
this.updatePropagatedAttributes();
|
|
196
|
+
this.replaceCustomAttributes(this.field?.customAttributes);
|
|
197
|
+
this.field?.attributeChange.subscribe(event => {
|
|
198
|
+
const { name: attribute, value = null } = event ?? {};
|
|
199
|
+
const attributeParts = attribute?.split('.') ?? [];
|
|
200
|
+
if (attribute === VALUE) {
|
|
201
|
+
this.updateValue();
|
|
143
202
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
for (let index = 0; index < customAttributesMapping.length; index++) {
|
|
147
|
-
const customAttribute = customAttributesMapping[index];
|
|
148
|
-
if (customAttribute) {
|
|
149
|
-
const value = this.field?.getCustomAttribute(customAttribute);
|
|
150
|
-
const fullName = `customAttributes.${customAttribute}`;
|
|
151
|
-
if (value) {
|
|
152
|
-
this.defaultProcessAttributeChange(fullName, value);
|
|
153
|
-
this.customProcessAttributeChange(fullName, value);
|
|
154
|
-
}
|
|
203
|
+
else if (attribute === FOCUS) {
|
|
204
|
+
this.focus();
|
|
155
205
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.
|
|
162
|
-
this.customProcessAttributeChange(componentAttr, value);
|
|
206
|
+
else if (signaledAttributes$4.includes(attribute)) {
|
|
207
|
+
this.updatePieceAttribute(signaledAttributes$4, attribute, value);
|
|
208
|
+
}
|
|
209
|
+
else if (attributeParts?.length > 1 && attributeParts?.[0] === CUSTOM_ATTRIBUTES$4) {
|
|
210
|
+
const subAttribute = attributeParts?.[1] ?? null;
|
|
211
|
+
this.updateCustomAttribute(subAttribute, value);
|
|
163
212
|
}
|
|
164
213
|
});
|
|
165
|
-
if (this.field) {
|
|
166
|
-
this.field.widget = this;
|
|
167
|
-
}
|
|
168
214
|
this.start();
|
|
169
215
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
this.updateValue();
|
|
173
|
-
}
|
|
174
|
-
else if (attribute === FOCUS) {
|
|
175
|
-
this.focus();
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
return super.defaultProcessAttributeChange(attribute, value);
|
|
179
|
-
}
|
|
180
|
-
return true;
|
|
216
|
+
updateValue() {
|
|
217
|
+
this.value = this.field?.value;
|
|
181
218
|
}
|
|
182
|
-
updateValue() { this.value = this.field?.value; }
|
|
183
219
|
onInputChange() { setTimeout(() => this.field?.notifyEditionPartial(), 50); }
|
|
184
220
|
onChangeContent() { setTimeout(() => this.field?.notifyEditionFinish(), 50); }
|
|
185
221
|
onShowInfo(detail = null) { setTimeout(() => this.field?.notifyEditionDetailRequest(detail), 50); }
|
|
@@ -193,14 +229,10 @@ class FieldComponent extends ElementComponent {
|
|
|
193
229
|
this.updateObject(false);
|
|
194
230
|
this.onInputChange();
|
|
195
231
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return (k > 47 && k < 58);
|
|
199
|
-
}
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
233
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FieldComponent, selector: "lib-field", inputs: { field: "field" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
200
234
|
}
|
|
201
|
-
|
|
202
|
-
FieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: FieldComponent, selector: "lib-field", inputs: { field: "field" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FieldComponent, decorators: [{
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FieldComponent, decorators: [{
|
|
204
236
|
type: Component,
|
|
205
237
|
args: [{
|
|
206
238
|
selector: 'lib-field',
|
|
@@ -211,10 +243,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
211
243
|
}] } });
|
|
212
244
|
|
|
213
245
|
class FormErrorComponent {
|
|
246
|
+
errorTitle;
|
|
247
|
+
errorMessage;
|
|
248
|
+
errorType;
|
|
249
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
250
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FormErrorComponent, selector: "lib-form-error", inputs: { errorTitle: "errorTitle", errorMessage: "errorMessage", errorType: "errorType" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
214
251
|
}
|
|
215
|
-
|
|
216
|
-
FormErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: FormErrorComponent, selector: "lib-form-error", inputs: { errorTitle: "errorTitle", errorMessage: "errorMessage", errorType: "errorType" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
217
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FormErrorComponent, decorators: [{
|
|
252
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormErrorComponent, decorators: [{
|
|
218
253
|
type: Component,
|
|
219
254
|
args: [{
|
|
220
255
|
selector: 'lib-form-error',
|
|
@@ -229,16 +264,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
229
264
|
}] } });
|
|
230
265
|
|
|
231
266
|
class FormHeaderComponent {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
267
|
+
form;
|
|
268
|
+
goBackEvent = new EventEmitter();
|
|
235
269
|
goBackForm() {
|
|
236
270
|
this.goBackEvent.emit();
|
|
237
271
|
}
|
|
272
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
273
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: FormHeaderComponent, selector: "lib-form-header", inputs: { form: "form" }, outputs: { goBackEvent: "goBackEvent" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
238
274
|
}
|
|
239
|
-
|
|
240
|
-
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 });
|
|
241
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: FormHeaderComponent, decorators: [{
|
|
275
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FormHeaderComponent, decorators: [{
|
|
242
276
|
type: Component,
|
|
243
277
|
args: [{
|
|
244
278
|
selector: 'lib-form-header',
|
|
@@ -250,22 +284,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
250
284
|
type: Output
|
|
251
285
|
}] } });
|
|
252
286
|
|
|
287
|
+
const CUSTOM_ATTRIBUTES$3 = 'customAttributes';
|
|
288
|
+
const signaledAttributes$3 = [
|
|
289
|
+
'visible', 'disabled',
|
|
290
|
+
];
|
|
253
291
|
class SectionComponent extends PieceComponent {
|
|
292
|
+
section;
|
|
293
|
+
updatePropagatedAttributes() {
|
|
294
|
+
this.updatePieceAttributes(this.section, signaledAttributes$3);
|
|
295
|
+
}
|
|
254
296
|
ngOnInit() {
|
|
297
|
+
if (!this.section) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
255
300
|
this.formConfig = this.section?._formConfig;
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const attrName = mapping[index].toString();
|
|
259
|
-
const attributeValue = this.section?.[attrName];
|
|
260
|
-
this.defaultProcessAttributeChange(attrName, attributeValue);
|
|
261
|
-
this.customProcessAttributeChange(attrName, attributeValue);
|
|
262
|
-
}
|
|
263
|
-
// Subscripción a cambios en atributos
|
|
301
|
+
this.updatePropagatedAttributes();
|
|
302
|
+
this.replaceCustomAttributes(this.section?.customAttributes);
|
|
264
303
|
this.section?.attributeChange.subscribe(event => {
|
|
265
|
-
const { name:
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
this.
|
|
304
|
+
const { name: attribute, value = null } = event ?? {};
|
|
305
|
+
const attributeParts = attribute?.split('.') ?? [];
|
|
306
|
+
if (signaledAttributes$3.includes(attribute)) {
|
|
307
|
+
this.updatePieceAttribute(signaledAttributes$3, attribute, value);
|
|
308
|
+
}
|
|
309
|
+
else if (attributeParts?.length > 1 && attributeParts?.[0] === CUSTOM_ATTRIBUTES$3) {
|
|
310
|
+
const subAttribute = attributeParts?.[1] ?? null;
|
|
311
|
+
this.updateCustomAttribute(subAttribute, value);
|
|
269
312
|
}
|
|
270
313
|
});
|
|
271
314
|
this.start();
|
|
@@ -273,10 +316,10 @@ class SectionComponent extends PieceComponent {
|
|
|
273
316
|
start() {
|
|
274
317
|
this.setForm(this.section?._form);
|
|
275
318
|
}
|
|
319
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
320
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SectionComponent, selector: "lib-section", inputs: { section: "section" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
276
321
|
}
|
|
277
|
-
|
|
278
|
-
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 });
|
|
279
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: SectionComponent, decorators: [{
|
|
322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SectionComponent, decorators: [{
|
|
280
323
|
type: Component,
|
|
281
324
|
args: [{
|
|
282
325
|
selector: 'lib-section',
|
|
@@ -286,22 +329,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
286
329
|
type: Input
|
|
287
330
|
}] } });
|
|
288
331
|
|
|
332
|
+
const CUSTOM_ATTRIBUTES$2 = 'customAttributes';
|
|
333
|
+
const signaledAttributes$2 = [
|
|
334
|
+
'visible', 'disabled',
|
|
335
|
+
];
|
|
289
336
|
class SubSectionComponent extends PieceComponent {
|
|
337
|
+
subSection;
|
|
338
|
+
updatePropagatedAttributes() {
|
|
339
|
+
this.updatePieceAttributes(this.subSection, signaledAttributes$2);
|
|
340
|
+
}
|
|
290
341
|
ngOnInit() {
|
|
342
|
+
if (!this.subSection) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
291
345
|
this.formConfig = this.subSection?._formConfig;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
const attrName = mapping[index].toString();
|
|
295
|
-
const attributeValue = this.subSection?.[attrName];
|
|
296
|
-
this.defaultProcessAttributeChange(attrName, attributeValue);
|
|
297
|
-
this.customProcessAttributeChange(attrName, attributeValue);
|
|
298
|
-
}
|
|
299
|
-
// Subscripción a cambios en atributos
|
|
346
|
+
this.updatePropagatedAttributes();
|
|
347
|
+
this.replaceCustomAttributes(this.subSection?.customAttributes);
|
|
300
348
|
this.subSection?.attributeChange.subscribe(event => {
|
|
301
|
-
const { name:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
this.
|
|
349
|
+
const { name: attribute, value = null } = event ?? {};
|
|
350
|
+
const attributeParts = attribute?.split('.') ?? [];
|
|
351
|
+
if (signaledAttributes$2.includes(attribute)) {
|
|
352
|
+
this.updatePieceAttribute(signaledAttributes$2, attribute, value);
|
|
353
|
+
}
|
|
354
|
+
else if (attributeParts?.length > 1 && attributeParts?.[0] === CUSTOM_ATTRIBUTES$2) {
|
|
355
|
+
const subAttribute = attributeParts?.[1] ?? null;
|
|
356
|
+
this.updateCustomAttribute(subAttribute, value);
|
|
305
357
|
}
|
|
306
358
|
});
|
|
307
359
|
this.start();
|
|
@@ -309,10 +361,10 @@ class SubSectionComponent extends PieceComponent {
|
|
|
309
361
|
start() {
|
|
310
362
|
this.setForm(this.subSection?._form);
|
|
311
363
|
}
|
|
364
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SubSectionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
365
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SubSectionComponent, selector: "lib-subsection", inputs: { subSection: "subSection" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
312
366
|
}
|
|
313
|
-
|
|
314
|
-
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 });
|
|
315
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: SubSectionComponent, decorators: [{
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SubSectionComponent, decorators: [{
|
|
316
368
|
type: Component,
|
|
317
369
|
args: [{
|
|
318
370
|
selector: 'lib-subsection',
|
|
@@ -323,21 +375,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
323
375
|
}] } });
|
|
324
376
|
|
|
325
377
|
const INLINE_ACTION$1 = 'INLINE';
|
|
378
|
+
const CUSTOM_ATTRIBUTES$1 = 'customAttributes';
|
|
379
|
+
const signaledAttributes$1 = [
|
|
380
|
+
'visible', 'disabled',
|
|
381
|
+
];
|
|
326
382
|
class LibTableRecordActionComponent extends PieceComponent {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
383
|
+
isVisible = true;
|
|
384
|
+
recordId;
|
|
385
|
+
recordData;
|
|
386
|
+
action;
|
|
387
|
+
actionSelected = new EventEmitter();
|
|
388
|
+
updatePropagatedAttributes() {
|
|
389
|
+
this.updatePieceAttributes(this.action, signaledAttributes$1);
|
|
331
390
|
}
|
|
332
391
|
ngOnInit() {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
for (let index = 0; index < mapping.length; index++) {
|
|
336
|
-
const attrName = mapping[index].toString();
|
|
337
|
-
const attributeValue = this.action?.[attrName];
|
|
338
|
-
this.defaultProcessAttributeChange(attrName, attributeValue);
|
|
339
|
-
this.customProcessAttributeChange(attrName, attributeValue);
|
|
392
|
+
if (!this.action) {
|
|
393
|
+
return;
|
|
340
394
|
}
|
|
395
|
+
this.formConfig = this.action?._formConfig;
|
|
396
|
+
this.updatePropagatedAttributes();
|
|
397
|
+
this.replaceCustomAttributes(this.action?.customAttributes);
|
|
341
398
|
this.start();
|
|
342
399
|
}
|
|
343
400
|
start() {
|
|
@@ -366,10 +423,10 @@ class LibTableRecordActionComponent extends PieceComponent {
|
|
|
366
423
|
this.actionSelected.emit(tableEvent);
|
|
367
424
|
}
|
|
368
425
|
class() { }
|
|
426
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableRecordActionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
427
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibTableRecordActionComponent, selector: "lib-table-record-action", inputs: { recordId: "recordId", recordData: "recordData", action: "action" }, outputs: { actionSelected: "actionSelected" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
369
428
|
}
|
|
370
|
-
|
|
371
|
-
LibTableRecordActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: LibTableRecordActionComponent, selector: "lib-table-record-action", inputs: { recordId: "recordId", recordData: "recordData", action: "action" }, outputs: { actionSelected: "actionSelected" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
372
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: LibTableRecordActionComponent, decorators: [{
|
|
429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableRecordActionComponent, decorators: [{
|
|
373
430
|
type: Component,
|
|
374
431
|
args: [{
|
|
375
432
|
selector: 'lib-table-record-action',
|
|
@@ -387,17 +444,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
387
444
|
}] } });
|
|
388
445
|
|
|
389
446
|
class LibTableRecordFieldComponent {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
447
|
+
fieldCode;
|
|
448
|
+
fieldType;
|
|
449
|
+
fieldValue;
|
|
450
|
+
column = null;
|
|
393
451
|
ngOnInit() {
|
|
394
452
|
this.start();
|
|
395
453
|
}
|
|
396
454
|
start() { }
|
|
455
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableRecordFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
456
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibTableRecordFieldComponent, selector: "lib-table-record-field", inputs: { fieldCode: "fieldCode", fieldType: "fieldType", fieldValue: "fieldValue", column: "column" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
397
457
|
}
|
|
398
|
-
|
|
399
|
-
LibTableRecordFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: LibTableRecordFieldComponent, selector: "lib-table-record-field", inputs: { fieldCode: "fieldCode", fieldType: "fieldType", fieldValue: "fieldValue", column: "column" }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
400
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: LibTableRecordFieldComponent, decorators: [{
|
|
458
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableRecordFieldComponent, decorators: [{
|
|
401
459
|
type: Component,
|
|
402
460
|
args: [{
|
|
403
461
|
selector: 'lib-table-record-field',
|
|
@@ -414,17 +472,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
414
472
|
type: Input
|
|
415
473
|
}] } });
|
|
416
474
|
|
|
475
|
+
const CUSTOM_ATTRIBUTES = 'customAttributes';
|
|
476
|
+
const signaledAttributes = [
|
|
477
|
+
'allSelected', 'code', 'globalSearch', 'globalFilterString', 'recordsPerPage', 'layout',
|
|
478
|
+
'columns', 'selectedRecords', 'currentPage', 'totalRecordsNumber', 'visibleRecords',
|
|
479
|
+
'visible', 'disabled',
|
|
480
|
+
];
|
|
417
481
|
class LibTableComponent extends ElementComponent {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
482
|
+
// Atributos sincronizados del objeto
|
|
483
|
+
allSelected = signal(null);
|
|
484
|
+
code = signal('');
|
|
485
|
+
globalSearch = signal(null);
|
|
486
|
+
globalFilterString = signal('');
|
|
487
|
+
recordsPerPage = signal(null);
|
|
488
|
+
layout = signal(null);
|
|
489
|
+
columns = signal(null);
|
|
490
|
+
selectedRecords = signal(null);
|
|
491
|
+
currentPage = signal(null);
|
|
492
|
+
totalRecordsNumber = signal(null);
|
|
493
|
+
visibleRecords = signal(null);
|
|
494
|
+
tableFieldStyles;
|
|
495
|
+
loaded = false;
|
|
496
|
+
selectable = false;
|
|
497
|
+
hasActions = false;
|
|
498
|
+
inlineActions;
|
|
499
|
+
globalActions;
|
|
500
|
+
selectionActions;
|
|
501
|
+
table = null;
|
|
502
|
+
waiting = false;
|
|
428
503
|
ngOnInit() {
|
|
429
504
|
if (!this.table) {
|
|
430
505
|
return;
|
|
@@ -432,51 +507,42 @@ class LibTableComponent extends ElementComponent {
|
|
|
432
507
|
this.table.setWidget(this);
|
|
433
508
|
this.formConfig = this.table?._formConfig;
|
|
434
509
|
this.tableFieldStyles = this.formConfig?.tableFieldStyles;
|
|
435
|
-
this.selectable = this.table?.
|
|
510
|
+
this.selectable = this.table?._selectable;
|
|
436
511
|
this.hasActions = this.table?.hasActions();
|
|
437
512
|
this.inlineActions = this.table?.getActions(this.formConfig?.tableActions.inline);
|
|
438
513
|
this.globalActions = this.table?.getActions(this.formConfig?.tableActions.global);
|
|
439
514
|
this.selectionActions = this.table?.getActions(this.formConfig?.tableActions.selection);
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
for (let index = 0; index < mapping.length; index++) {
|
|
443
|
-
const tableAttr = mapping[index]?.[0];
|
|
444
|
-
const componentAttr = mapping[index]?.[1]?.toString() ?? '';
|
|
445
|
-
const attributeValue = this.table?.[tableAttr];
|
|
446
|
-
this.defaultProcessAttributeChange(componentAttr, attributeValue);
|
|
447
|
-
this.customProcessAttributeChange(componentAttr, attributeValue);
|
|
448
|
-
}
|
|
449
|
-
// Subscripción a cambios en atributos
|
|
515
|
+
this.updatePropagatedAttributes();
|
|
516
|
+
this.replaceCustomAttributes(this.table?.customAttributes);
|
|
450
517
|
this.table?.attributeChange.subscribe(event => {
|
|
451
|
-
const { name:
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
this.
|
|
518
|
+
const { name: attribute, value = null } = event ?? {};
|
|
519
|
+
const attributeParts = attribute?.split('.') ?? [];
|
|
520
|
+
if (attribute === 'visibleRecords') {
|
|
521
|
+
this.updateTableData();
|
|
522
|
+
}
|
|
523
|
+
else if (signaledAttributes.includes(attribute)) {
|
|
524
|
+
this.updatePieceAttribute(signaledAttributes, attribute, value);
|
|
525
|
+
}
|
|
526
|
+
else if (attributeParts?.length > 1 && attributeParts?.[0] === CUSTOM_ATTRIBUTES) {
|
|
527
|
+
const subAttribute = attributeParts?.[1] ?? null;
|
|
528
|
+
this.updateCustomAttribute(subAttribute, value);
|
|
455
529
|
}
|
|
456
530
|
});
|
|
457
531
|
this.start();
|
|
458
532
|
}
|
|
533
|
+
updatePropagatedAttributes() {
|
|
534
|
+
this.updatePieceAttributes(this.table, signaledAttributes);
|
|
535
|
+
}
|
|
459
536
|
updateTableData() { }
|
|
460
537
|
tableGlobalAction(actionCode) { this.table?.notifyGlobalAction(actionCode); }
|
|
461
538
|
tableSelectionAction(actionCode) { this.table?.notifySelectionAction(actionCode); }
|
|
462
539
|
tableActionSelected(actionEvent) { this.table?.notifyInlineAction(actionEvent); }
|
|
463
540
|
tableSelectionToggle(recordId) { this.table?.notifyRecordSelection(recordId); }
|
|
464
|
-
toggleSelectAll() { return (this.table?.
|
|
541
|
+
toggleSelectAll() { return (this.table?._allSelected) ? this.table?.unSelectAll() : this.table?.selectAll(); }
|
|
465
542
|
globalFilterCompleted() { this.changePage(1); }
|
|
466
543
|
changePage(requestedPage) { this.table?.changePage(requestedPage); }
|
|
467
544
|
tableColumnSort(columnName, direction = null) { this.table?.sort(columnName, direction ?? 'ascend'); }
|
|
468
545
|
globalFilterChanged() { this.table?.setGlobalFilterString(this.globalFilterString?.trim() ?? '', false); }
|
|
469
|
-
defaultProcessAttributeChange(attribute, value) {
|
|
470
|
-
try {
|
|
471
|
-
if (attribute === 'visibleRecords') {
|
|
472
|
-
this.updateTableData();
|
|
473
|
-
}
|
|
474
|
-
return super.defaultProcessAttributeChange(attribute, value);
|
|
475
|
-
}
|
|
476
|
-
catch {
|
|
477
|
-
return false;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
546
|
filterHasChanged(column, values) {
|
|
481
547
|
if (!values || values.length === 0) {
|
|
482
548
|
this.table?.removeColumnFilter(column.fieldCode);
|
|
@@ -485,10 +551,10 @@ class LibTableComponent extends ElementComponent {
|
|
|
485
551
|
this.table?.addColumnFilter(column.fieldCode, values);
|
|
486
552
|
}
|
|
487
553
|
}
|
|
554
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
555
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibTableComponent, selector: "lib-table", inputs: { table: "table", waiting: "waiting" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
488
556
|
}
|
|
489
|
-
|
|
490
|
-
LibTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: LibTableComponent, selector: "lib-table", inputs: { table: "table", visibleRecords: "visibleRecords", waiting: "waiting" }, usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
491
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: LibTableComponent, decorators: [{
|
|
557
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTableComponent, decorators: [{
|
|
492
558
|
type: Component,
|
|
493
559
|
args: [{
|
|
494
560
|
selector: 'lib-table',
|
|
@@ -497,8 +563,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
|
|
|
497
563
|
}]
|
|
498
564
|
}], propDecorators: { table: [{
|
|
499
565
|
type: Input
|
|
500
|
-
}], visibleRecords: [{
|
|
501
|
-
type: Input
|
|
502
566
|
}], waiting: [{
|
|
503
567
|
type: Input
|
|
504
568
|
}] } });
|
|
@@ -530,17 +594,20 @@ const operators = {
|
|
|
530
594
|
};
|
|
531
595
|
|
|
532
596
|
class FormPiece {
|
|
597
|
+
_formState = '';
|
|
598
|
+
_visibleForced;
|
|
599
|
+
_isForced;
|
|
600
|
+
_absoluteVisible = true;
|
|
601
|
+
_absoluteDisabled = false;
|
|
602
|
+
_widget = null;
|
|
603
|
+
visibleStates = [];
|
|
604
|
+
enabledStates = [];
|
|
605
|
+
_form = null;
|
|
606
|
+
_formConfig;
|
|
607
|
+
_visible = true;
|
|
608
|
+
_disabled = false;
|
|
609
|
+
customAttributes = {};
|
|
533
610
|
constructor(pieceDefinition, formConfig) {
|
|
534
|
-
this._formState = '';
|
|
535
|
-
this._absoluteVisible = true;
|
|
536
|
-
this._absoluteDisabled = false;
|
|
537
|
-
this._widget = null;
|
|
538
|
-
this.visibleStates = [];
|
|
539
|
-
this.enabledStates = [];
|
|
540
|
-
this._form = null;
|
|
541
|
-
this._visible = true;
|
|
542
|
-
this._disabled = false;
|
|
543
|
-
this.customAttributes = {};
|
|
544
611
|
this._formConfig = formConfig;
|
|
545
612
|
this._isForced = false;
|
|
546
613
|
this._visibleForced = false;
|
|
@@ -655,9 +722,10 @@ class FormPiece {
|
|
|
655
722
|
const VISIBLE = 'visible';
|
|
656
723
|
const DISABLED = 'disabled';
|
|
657
724
|
class FormPiecePropagate extends FormPiece {
|
|
725
|
+
propagationCustomAttributes = [];
|
|
726
|
+
_attributeChange;
|
|
658
727
|
constructor(pieceDefinition, formConfig) {
|
|
659
728
|
super(pieceDefinition, formConfig);
|
|
660
|
-
this.propagationCustomAttributes = [];
|
|
661
729
|
this._attributeChange = new BehaviorSubject(null);
|
|
662
730
|
}
|
|
663
731
|
get attributeChange() { return this._attributeChange; }
|
|
@@ -689,15 +757,20 @@ class FormPiecePropagate extends FormPiece {
|
|
|
689
757
|
}
|
|
690
758
|
|
|
691
759
|
class FormElement extends FormPiecePropagate {
|
|
760
|
+
elementType = null;
|
|
761
|
+
;
|
|
692
762
|
constructor(elementDefinition, formConfig) {
|
|
693
763
|
super(elementDefinition, formConfig);
|
|
694
|
-
this.elementType = null;
|
|
695
764
|
}
|
|
696
|
-
;
|
|
697
765
|
setAttr(attr, value) {
|
|
698
766
|
const { name: attrName, propagate: name } = attr;
|
|
699
|
-
|
|
700
|
-
|
|
767
|
+
try {
|
|
768
|
+
this[attrName] = value;
|
|
769
|
+
name && this.propagateAttribute(name, value);
|
|
770
|
+
}
|
|
771
|
+
catch (e) {
|
|
772
|
+
console.log(`Atributo ${attrName} no presente o valor ${value} inconsistente. ${e}`);
|
|
773
|
+
}
|
|
701
774
|
}
|
|
702
775
|
isField() { return this.elementType === elementTypes.field; }
|
|
703
776
|
isAction() { return this.elementType === elementTypes.action; }
|
|
@@ -705,54 +778,84 @@ class FormElement extends FormPiecePropagate {
|
|
|
705
778
|
}
|
|
706
779
|
|
|
707
780
|
const HEADER = 'HEADER';
|
|
781
|
+
const attrs$2 = {
|
|
782
|
+
actionCode: { name: '_actionCode', propagate: 'actionCode' },
|
|
783
|
+
actionName: { name: '_actionName', propagate: 'actionName' },
|
|
784
|
+
iconName: { name: '_iconName', propagate: 'iconName' },
|
|
785
|
+
inProgress: { name: '_inProgress', propagate: 'inProgress' },
|
|
786
|
+
restrictedOnField: { name: '_restrictedOnField', propagate: 'restrictedOnField' },
|
|
787
|
+
restrictedOnOperator: { name: '_restrictedOnOperator', propagate: 'restrictedOnOperator' },
|
|
788
|
+
restrictedOnValue: { name: '_restrictedOnValue', propagate: 'restrictedOnValue' },
|
|
789
|
+
};
|
|
708
790
|
class FormAction extends FormElement {
|
|
791
|
+
_actionActivated = new Subject();
|
|
792
|
+
_actionCode = '';
|
|
793
|
+
_actionName = '';
|
|
794
|
+
_iconName = '';
|
|
795
|
+
_inProgress = false;
|
|
796
|
+
_newState;
|
|
797
|
+
_backend;
|
|
798
|
+
_restrictedOnField = null;
|
|
799
|
+
_restrictedOnOperator = null;
|
|
800
|
+
_restrictedOnValue = null;
|
|
709
801
|
constructor(actionDefinition, formConfig) {
|
|
710
802
|
super(actionDefinition, formConfig);
|
|
711
|
-
this._actionActivated = new Subject();
|
|
712
|
-
this.inProgress = false;
|
|
713
|
-
this.restrictedOnField = null;
|
|
714
|
-
this.restrictedOnOperator = null;
|
|
715
|
-
this.restrictedOnValue = null;
|
|
716
803
|
this.propagationCustomAttributes = this._formConfig?.propagationCustomAttributes?.actions ?? [];
|
|
717
804
|
this.elementType = elementTypes.action;
|
|
718
|
-
this.actionCode
|
|
719
|
-
this.actionName
|
|
720
|
-
this.iconName
|
|
805
|
+
this.setAttr(attrs$2.actionCode, actionDefinition.actionCode ? actionDefinition.actionCode.toString() : '');
|
|
806
|
+
this.setAttr(attrs$2.actionName, actionDefinition.actionTitle);
|
|
807
|
+
this.setAttr(attrs$2.iconName, actionDefinition.iconName || this._actionCode);
|
|
808
|
+
this.setAttr(attrs$2.restrictedOnField, actionDefinition.fieldRestrictedCode?.toString() ?? null);
|
|
809
|
+
if (this._restrictedOnField) {
|
|
810
|
+
this.setAttr(attrs$2.restrictedOnOperator, actionDefinition.operatorRestricted || '');
|
|
811
|
+
this.setAttr(attrs$2.restrictedOnValue, actionDefinition.valueRestricted ?? '');
|
|
812
|
+
}
|
|
813
|
+
this._backend = actionDefinition?.serverAction ?? false;
|
|
814
|
+
this._newState = actionDefinition?.newState;
|
|
721
815
|
this.setCustomAttribute('location', actionDefinition.position || HEADER);
|
|
722
|
-
this.backend = actionDefinition?.serverAction ?? false;
|
|
723
|
-
this.newState = actionDefinition?.newState;
|
|
724
|
-
this.restrictedOnField = actionDefinition.fieldRestrictedCode?.toString() ?? null;
|
|
725
|
-
if (this.restrictedOnField) {
|
|
726
|
-
this.restrictedOnOperator = actionDefinition.operatorRestricted || '';
|
|
727
|
-
this.restrictedOnValue = actionDefinition.valueRestricted ?? '';
|
|
728
|
-
}
|
|
729
|
-
this.customValidation = () => true;
|
|
730
816
|
}
|
|
817
|
+
get actionCode() { return this._actionCode; }
|
|
818
|
+
get actionName() { return this._actionName; }
|
|
819
|
+
get iconName() { return this._iconName; }
|
|
820
|
+
get inProgress() { return this._inProgress; }
|
|
821
|
+
get newState() { return this._newState; }
|
|
822
|
+
get backend() { return this._backend; }
|
|
823
|
+
get restrictedOnField() { return this._restrictedOnField; }
|
|
824
|
+
get restrictedOnOperator() { return this._restrictedOnOperator; }
|
|
825
|
+
get restrictedOnValue() { return this._restrictedOnValue; }
|
|
826
|
+
set actionCode(actionCode) { this.setAttr(attrs$2.actionCode, actionCode); }
|
|
827
|
+
set actionName(actionName) { this.setAttr(attrs$2.actionName, actionName); }
|
|
828
|
+
set iconName(iconName) { this.setAttr(attrs$2.iconName, iconName); }
|
|
829
|
+
set inProgress(inProgress) { this.setAttr(attrs$2.inProgress, inProgress); }
|
|
830
|
+
set newState(newState) { this._newState, newState; }
|
|
831
|
+
set backend(backend) { this._backend, backend; }
|
|
832
|
+
set restrictedOnField(restrictedOnField) { this.setAttr(attrs$2.restrictedOnField, restrictedOnField); }
|
|
833
|
+
set restrictedOnOperator(restrictedOnOperator) { this.setAttr(attrs$2.restrictedOnOperator, restrictedOnOperator); }
|
|
834
|
+
set restrictedOnValue(restrictedOnValue) { this.setAttr(attrs$2.restrictedOnValue, restrictedOnValue); }
|
|
835
|
+
start() { this.inProgress = true; }
|
|
836
|
+
stop() { this.inProgress = false; }
|
|
731
837
|
connectWithParentForm(form, formChangeSubject) {
|
|
732
838
|
super.connectWithParentForm(form, formChangeSubject);
|
|
733
|
-
if (this.
|
|
734
|
-
const relatedField = this._form.fields?.[this.
|
|
839
|
+
if (this._restrictedOnField) {
|
|
840
|
+
const relatedField = this._form.fields?.[this._restrictedOnField];
|
|
735
841
|
if (relatedField) {
|
|
736
|
-
relatedField.editionFinish.subscribe(event => this.updateRestrictedVisibility());
|
|
737
|
-
relatedField.editionPartial.subscribe(event => this.updateRestrictedVisibility());
|
|
842
|
+
relatedField.editionFinish.subscribe(event => this.updateRestrictedVisibility(event));
|
|
843
|
+
relatedField.editionPartial.subscribe(event => this.updateRestrictedVisibility(event));
|
|
738
844
|
}
|
|
739
845
|
}
|
|
740
846
|
}
|
|
741
|
-
updateRestrictedVisibility() {
|
|
742
|
-
const lastVisible = this._visible;
|
|
847
|
+
updateRestrictedVisibility(event) {
|
|
743
848
|
const newVisible = this._absoluteVisible && this.viewOnState(this._formState);
|
|
744
|
-
|
|
745
|
-
this.setVisibility(newVisible);
|
|
746
|
-
}
|
|
849
|
+
(this._visible !== newVisible) && this.setVisibility(newVisible);
|
|
747
850
|
}
|
|
748
851
|
viewOnState(state) {
|
|
749
852
|
const actionVisible = (this.visibleStates && state) ? this.visibleStates.includes(state) : false;
|
|
750
|
-
if (actionVisible && this._form && this.
|
|
751
|
-
const relatedField = this._form.fields?.[this.
|
|
853
|
+
if (actionVisible && this._form && this._restrictedOnField) {
|
|
854
|
+
const relatedField = this._form.fields?.[this._restrictedOnField];
|
|
752
855
|
if (relatedField) {
|
|
753
856
|
const fieldValue = relatedField.value;
|
|
754
|
-
if ((this.
|
|
755
|
-
|| (this.
|
|
857
|
+
if ((this._restrictedOnOperator === '==' && fieldValue !== this._restrictedOnValue)
|
|
858
|
+
|| (this._restrictedOnOperator === '!=' && fieldValue === this._restrictedOnValue)) {
|
|
756
859
|
return false;
|
|
757
860
|
}
|
|
758
861
|
}
|
|
@@ -760,17 +863,19 @@ class FormAction extends FormElement {
|
|
|
760
863
|
return actionVisible;
|
|
761
864
|
}
|
|
762
865
|
get actionActivated() { return this._actionActivated; }
|
|
763
|
-
|
|
764
|
-
stop() { this.inProgress = false; }
|
|
765
|
-
notifyActivation() { this._actionActivated.next(this.actionCode); }
|
|
866
|
+
notifyActivation() { this._actionActivated.next(this._actionCode); }
|
|
766
867
|
updateFromServer(receivedAction) {
|
|
767
868
|
for (const propertyName in receivedAction) {
|
|
768
869
|
if (propertyName !== 'actionCode' && propertyName !== 'actionId') {
|
|
769
|
-
|
|
870
|
+
try {
|
|
871
|
+
this[propertyName] = receivedAction[propertyName];
|
|
872
|
+
}
|
|
873
|
+
catch (e) {
|
|
874
|
+
console.log(`Error actualizando la propiedad ${propertyName} de la acción ${this.actionCode}. ${e}`);
|
|
875
|
+
}
|
|
770
876
|
}
|
|
771
877
|
}
|
|
772
878
|
}
|
|
773
|
-
setCustomValidation(callback) { this.customValidation = () => callback(); }
|
|
774
879
|
}
|
|
775
880
|
|
|
776
881
|
const UNDEFINED = 'undefined';
|
|
@@ -786,71 +891,75 @@ const directChanges = [
|
|
|
786
891
|
'options', 'placeholder',
|
|
787
892
|
];
|
|
788
893
|
const attrs$1 = {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
fieldCode: { name: '
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
fieldOptions: { name: '
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
894
|
+
captureType: { name: '_captureType', propagate: 'captureType' },
|
|
895
|
+
errorCode: { name: '_errorCode', propagate: 'errorCode' },
|
|
896
|
+
errorMessage: { name: '_errorMessage', propagate: 'errorMessage' },
|
|
897
|
+
errorType: { name: '_errorType', propagate: 'errorType' },
|
|
898
|
+
defaultValue: { name: '_defaultValue', propagate: 'defaultValue' },
|
|
899
|
+
defaultEditable: { name: '_defaultEditable', propagate: 'defaultEditable' },
|
|
900
|
+
fieldAlignment: { name: '_fieldAlignment', propagate: 'alignment' },
|
|
901
|
+
fieldCode: { name: '_fieldCode', propagate: 'code' },
|
|
902
|
+
fieldInfo: { name: '_fieldInfo', propagate: 'info' },
|
|
903
|
+
fieldRequired: { name: '_fieldRequired', propagate: 'required' },
|
|
904
|
+
fieldTitle: { name: '_fieldTitle', propagate: 'title' },
|
|
905
|
+
fieldType: { name: '_fieldType', propagate: 'type' },
|
|
906
|
+
fieldFormat: { name: '_fieldFormat', propagate: 'format' },
|
|
907
|
+
fieldOptions: { name: '_fieldOptions', propagate: 'options' },
|
|
908
|
+
focus: { name: '_focus', propagate: 'focus' },
|
|
909
|
+
hasChanged: { name: '_hasChanged', propagate: 'hasChanged' },
|
|
910
|
+
intrinsicErrorMessage: { name: '_intrinsicErrorMessage', propagate: null },
|
|
911
|
+
maxLength: { name: '_maxLength', propagate: 'maxLength' },
|
|
912
|
+
maxValue: { name: '_maxValue', propagate: 'maxValue' },
|
|
913
|
+
minLength: { name: '_minLength', propagate: 'minLength' },
|
|
914
|
+
minValue: { name: '_minValue', propagate: 'minValue' },
|
|
915
|
+
onValidation: { name: '_onValidation', propagate: 'onValidation' },
|
|
916
|
+
outputOnly: { name: '_outputOnly', propagate: 'outputOnly' },
|
|
917
|
+
placeholder: { name: '_placeholder', propagate: 'placeholder' },
|
|
918
|
+
tooltipText: { name: '_tooltipText', propagate: 'tooltip' },
|
|
919
|
+
validateOnServer: { name: '_validateOnServer', propagate: 'validateOnServer' },
|
|
920
|
+
value: { name: '_value', propagate: 'value' },
|
|
921
|
+
visibleLabel: { name: '_visibleLabel', propagate: 'visibleLabel' },
|
|
817
922
|
};
|
|
818
923
|
class FieldDescriptor extends FormElement {
|
|
924
|
+
_editionFinish = new Subject();
|
|
925
|
+
_editionPartial = new Subject();
|
|
926
|
+
_detailRequest = new Subject();
|
|
927
|
+
_errorType = '';
|
|
928
|
+
_errorCode = '';
|
|
929
|
+
_errorMessage = '';
|
|
930
|
+
_intrinsicErrorMessage = '';
|
|
931
|
+
_minValue;
|
|
932
|
+
_maxValue;
|
|
933
|
+
_maxLength = 0;
|
|
934
|
+
_minLength = 0;
|
|
935
|
+
_focus = false;
|
|
936
|
+
_onValidation = false;
|
|
937
|
+
_validateOnServer = false;
|
|
938
|
+
_value;
|
|
939
|
+
_visibleLabel = false;
|
|
940
|
+
_captureType = '';
|
|
941
|
+
_defaultValue = '';
|
|
942
|
+
_defaultEditable = false;
|
|
943
|
+
_externalValue;
|
|
944
|
+
_fieldAlignment = '';
|
|
945
|
+
_fieldInfo = '';
|
|
946
|
+
_fieldRequired = false;
|
|
947
|
+
_fieldTitle = '';
|
|
948
|
+
_fieldType = '';
|
|
949
|
+
_fieldFormat = null;
|
|
950
|
+
_hasChanged = false;
|
|
951
|
+
_outputOnly = false;
|
|
952
|
+
_tooltipText = '';
|
|
953
|
+
_placeholder = '';
|
|
954
|
+
_fieldCode = '';
|
|
955
|
+
_fieldOptions = null;
|
|
819
956
|
constructor(inputFieldReceived, formConfig) {
|
|
820
957
|
super(inputFieldReceived, formConfig);
|
|
821
|
-
this._editionFinish = new Subject();
|
|
822
|
-
this._editionPartial = new Subject();
|
|
823
|
-
this._detailRequest = new Subject();
|
|
824
|
-
this._errorType = '';
|
|
825
|
-
this._errorCode = '';
|
|
826
|
-
this._errorMessage = '';
|
|
827
|
-
this._intrinsicErrorMessage = '';
|
|
828
|
-
this._maxLength = 0;
|
|
829
|
-
this._minLength = 0;
|
|
830
|
-
this._focus = false;
|
|
831
|
-
this._onValidation = false;
|
|
832
|
-
this._validateOnServer = false;
|
|
833
|
-
this._visibleLabel = false;
|
|
834
|
-
this._captureType = '';
|
|
835
|
-
this._defaultValue = '';
|
|
836
|
-
this._defaultEditable = false;
|
|
837
|
-
this._fieldAlignment = '';
|
|
838
|
-
this._fieldInfo = '';
|
|
839
|
-
this._fieldRequired = false;
|
|
840
|
-
this._fieldTitle = '';
|
|
841
|
-
this._fieldType = '';
|
|
842
|
-
this._fieldFormat = null;
|
|
843
|
-
this._hasChanged = false;
|
|
844
|
-
this._outputOnly = false;
|
|
845
|
-
this._tooltipText = '';
|
|
846
|
-
this._placeholder = '';
|
|
847
|
-
this.fieldCode = '';
|
|
848
|
-
this.fieldOptions = null;
|
|
849
958
|
this.propagationCustomAttributes = this._formConfig?.propagationCustomAttributes?.fields ?? [];
|
|
850
959
|
this.elementType = elementTypes.field;
|
|
851
960
|
const fld = (inputFieldReceived) ? inputFieldReceived : {};
|
|
852
961
|
this.setAttr(attrs$1.fieldCode, fld.fieldCode);
|
|
853
|
-
this.title = fld.fieldTitle ?? this.
|
|
962
|
+
this.title = fld.fieldTitle ?? this._fieldCode;
|
|
854
963
|
this.placeholder = fld.placeholder ?? this.title;
|
|
855
964
|
this.type = fld.fieldTypeCode;
|
|
856
965
|
this.captureType = fld.captureType ?? DEFAULT_CAPTURE_TYPE;
|
|
@@ -868,7 +977,12 @@ class FieldDescriptor extends FormElement {
|
|
|
868
977
|
this.info = fld.info || '';
|
|
869
978
|
let fieldFormat;
|
|
870
979
|
try {
|
|
871
|
-
|
|
980
|
+
if (fld.format && typeof fld.format === 'string') {
|
|
981
|
+
fieldFormat = new RegExp(fld.format);
|
|
982
|
+
}
|
|
983
|
+
else if (fld.format?.regExp) {
|
|
984
|
+
fieldFormat = new RegExp(fld.format?.regExp);
|
|
985
|
+
}
|
|
872
986
|
}
|
|
873
987
|
catch (e) {
|
|
874
988
|
fieldFormat = null;
|
|
@@ -891,17 +1005,17 @@ class FieldDescriptor extends FormElement {
|
|
|
891
1005
|
this._setValue(fld.fieldValue ?? this._defaultValue ?? '');
|
|
892
1006
|
}
|
|
893
1007
|
get alignment() { return this._fieldAlignment; }
|
|
894
|
-
set alignment(alignment) { this.setAttr(attrs$1.
|
|
1008
|
+
set alignment(alignment) { this.setAttr(attrs$1.fieldAlignment, alignment); }
|
|
895
1009
|
get backend() { return this._validateOnServer; }
|
|
896
1010
|
get captureType() { return this._captureType; }
|
|
897
|
-
set captureType(captureType) { this.setAttr(attrs$1.
|
|
1011
|
+
set captureType(captureType) { this.setAttr(attrs$1.captureType, captureType); }
|
|
898
1012
|
get placeholder() { return this._placeholder; }
|
|
899
|
-
set placeholder(placeholder) { this.setAttr(attrs$1.
|
|
900
|
-
get code() { return this.
|
|
1013
|
+
set placeholder(placeholder) { this.setAttr(attrs$1.placeholder, placeholder); }
|
|
1014
|
+
get code() { return this._fieldCode; }
|
|
901
1015
|
get defaultValue() { return this._defaultValue; }
|
|
902
|
-
set defaultValue(defaultValue) { this.setAttr(attrs$1.
|
|
1016
|
+
set defaultValue(defaultValue) { this.setAttr(attrs$1.defaultValue, defaultValue); }
|
|
903
1017
|
get defaultEditable() { return this._defaultEditable; }
|
|
904
|
-
set defaultEditable(editable) { this.setAttr(attrs$1.
|
|
1018
|
+
set defaultEditable(editable) { this.setAttr(attrs$1.defaultEditable, editable); }
|
|
905
1019
|
get detailRequest() { return this._detailRequest; }
|
|
906
1020
|
get editionFinish() { return this._editionFinish; }
|
|
907
1021
|
get editionPartial() { return this._editionPartial; }
|
|
@@ -946,25 +1060,25 @@ class FieldDescriptor extends FormElement {
|
|
|
946
1060
|
get errorType() { return this._errorType; }
|
|
947
1061
|
get externalValue() { return this._externalValue; }
|
|
948
1062
|
get format() { return this._fieldFormat; }
|
|
949
|
-
set format(format) { this.setAttr(attrs$1.
|
|
1063
|
+
set format(format) { this.setAttr(attrs$1.fieldFormat, format); }
|
|
950
1064
|
get hasChanged() { return this._hasChanged; }
|
|
951
|
-
set hasChanged(hasChanged) { this.setAttr(attrs$1.
|
|
1065
|
+
set hasChanged(hasChanged) { this.setAttr(attrs$1.hasChanged, hasChanged); }
|
|
952
1066
|
get info() { return this._fieldInfo; }
|
|
953
|
-
set info(newInfo) { this.setAttr(attrs$1.
|
|
954
|
-
set intrinsicErrorMessage(message) { this.setAttr(attrs$1.
|
|
1067
|
+
set info(newInfo) { this.setAttr(attrs$1.fieldInfo, newInfo); }
|
|
1068
|
+
set intrinsicErrorMessage(message) { this.setAttr(attrs$1.intrinsicErrorMessage, message); }
|
|
955
1069
|
get maxLength() { return (this._maxLength > 0) ? this._maxLength.toString() : ''; }
|
|
956
|
-
set maxLength(requiredMaxLength) { this.setAttr(attrs$1.
|
|
1070
|
+
set maxLength(requiredMaxLength) { this.setAttr(attrs$1.maxLength, requiredMaxLength ? +requiredMaxLength : null); }
|
|
957
1071
|
get maxValue() { return this._maxValue; }
|
|
958
1072
|
set maxValue(inputMaxValue) {
|
|
959
1073
|
let maxValue = inputMaxValue;
|
|
960
1074
|
if (this._fieldType === this._formConfig.fieldTypes.date) {
|
|
961
1075
|
maxValue = new Date(maxValue);
|
|
962
1076
|
}
|
|
963
|
-
this.setAttr(attrs$1.
|
|
1077
|
+
this.setAttr(attrs$1.maxValue, maxValue);
|
|
964
1078
|
}
|
|
965
1079
|
get minLength() { return this._minLength; }
|
|
966
1080
|
set minLength(requiredMinLength) {
|
|
967
|
-
this.setAttr(attrs$1.
|
|
1081
|
+
this.setAttr(attrs$1.minLength, requiredMinLength ? +requiredMinLength : null);
|
|
968
1082
|
}
|
|
969
1083
|
get minValue() { return this._minValue; }
|
|
970
1084
|
set minValue(inputMinValue) {
|
|
@@ -972,11 +1086,11 @@ class FieldDescriptor extends FormElement {
|
|
|
972
1086
|
if (this._fieldType === this._formConfig.fieldTypes.date) {
|
|
973
1087
|
minValue = new Date(minValue);
|
|
974
1088
|
}
|
|
975
|
-
this.setAttr(attrs$1.
|
|
1089
|
+
this.setAttr(attrs$1.minValue, minValue);
|
|
976
1090
|
}
|
|
977
|
-
get name() { return this.
|
|
1091
|
+
get name() { return this._fieldCode; }
|
|
978
1092
|
get options() {
|
|
979
|
-
return this.
|
|
1093
|
+
return this._fieldOptions?.map(option => {
|
|
980
1094
|
const optionCopy = { ...option };
|
|
981
1095
|
return optionCopy;
|
|
982
1096
|
}) ?? null;
|
|
@@ -999,45 +1113,46 @@ class FieldDescriptor extends FormElement {
|
|
|
999
1113
|
this.setAttr(attrs$1.fieldOptions, fieldOptions);
|
|
1000
1114
|
if (this._value) {
|
|
1001
1115
|
if (this._fieldType === this._formConfig.fieldTypes.array && Array.isArray(this._value)) {
|
|
1002
|
-
const fieldValue = this._value?.filter(item => this.
|
|
1003
|
-
this.setAttr(attrs$1.
|
|
1116
|
+
const fieldValue = this._value?.filter(item => this._fieldOptions?.find(opt => opt.fieldOptionId === item));
|
|
1117
|
+
this.setAttr(attrs$1.value, fieldValue);
|
|
1004
1118
|
}
|
|
1005
1119
|
else {
|
|
1006
|
-
const valInOptions = this.
|
|
1120
|
+
const valInOptions = this._fieldOptions?.find(item => item.fieldOptionId === this._value);
|
|
1007
1121
|
if (!valInOptions) {
|
|
1008
1122
|
this._setValue('');
|
|
1009
1123
|
}
|
|
1010
1124
|
}
|
|
1011
1125
|
}
|
|
1012
|
-
if (this._fieldRequired && this.
|
|
1013
|
-
this._setValue(this.
|
|
1126
|
+
if (this._fieldRequired && this._fieldOptions?.length === 1 && this._value !== this._fieldOptions?.[0].fieldOptionId) {
|
|
1127
|
+
this._setValue(this._fieldOptions?.[0].fieldOptionId);
|
|
1014
1128
|
this.notifyEditionFinish();
|
|
1015
1129
|
}
|
|
1016
1130
|
}
|
|
1017
|
-
get optionText() { return this.
|
|
1131
|
+
get optionText() { return this._fieldOptions?.find(item => item.fieldOptionId === this._value)?.fieldOptionValue ?? null; }
|
|
1018
1132
|
get outputOnly() { return this._outputOnly; }
|
|
1019
|
-
set outputOnly(outputOnly) { this.setAttr(attrs$1.
|
|
1133
|
+
set outputOnly(outputOnly) { this.setAttr(attrs$1.outputOnly, outputOnly); }
|
|
1020
1134
|
get required() { return this._fieldRequired; }
|
|
1021
|
-
set required(required) { this.setAttr(attrs$1.
|
|
1135
|
+
set required(required) { this.setAttr(attrs$1.fieldRequired, required ?? false); }
|
|
1022
1136
|
get title() { return this._fieldTitle; }
|
|
1023
|
-
set title(title) { this.setAttr(attrs$1.
|
|
1137
|
+
set title(title) { this.setAttr(attrs$1.fieldTitle, title?.toString() ?? ''); }
|
|
1024
1138
|
get tooltip() { return this._tooltipText; }
|
|
1025
|
-
set tooltip(tooltip) { this.setAttr(attrs$1.
|
|
1139
|
+
set tooltip(tooltip) { this.setAttr(attrs$1.tooltipText, tooltip); }
|
|
1026
1140
|
get type() { return this._fieldType; }
|
|
1027
|
-
set type(fieldType) { this.setAttr(attrs$1.
|
|
1141
|
+
set type(fieldType) { this.setAttr(attrs$1.fieldType, fieldType); }
|
|
1142
|
+
get onValidation() { return this._onValidation; }
|
|
1028
1143
|
get validating() { return this._onValidation; }
|
|
1029
|
-
set validating(isValidating) { this.setAttr(attrs$1.
|
|
1144
|
+
set validating(isValidating) { this.setAttr(attrs$1.onValidation, isValidating); }
|
|
1030
1145
|
get value() {
|
|
1031
1146
|
return (this._fieldType === this._formConfig.fieldTypes.boolean
|
|
1032
1147
|
|| this._fieldType === this._formConfig.fieldTypes.check) ? yn(this._value) : this._value;
|
|
1033
1148
|
}
|
|
1034
1149
|
get validateOnServer() { return this._validateOnServer; }
|
|
1035
|
-
set validateOnServer(validateOnServer) { this.setAttr(attrs$1.
|
|
1150
|
+
set validateOnServer(validateOnServer) { this.setAttr(attrs$1.validateOnServer, validateOnServer); }
|
|
1036
1151
|
get serverAction() { return this._validateOnServer; }
|
|
1037
1152
|
set serverAction(validateOnServer) { this.validateOnServer = validateOnServer; }
|
|
1038
1153
|
set value(newValue) { this._setValue(newValue); }
|
|
1039
1154
|
get visibleLabel() { return this._visibleLabel; }
|
|
1040
|
-
set visibleLabel(visibleLabel) { this.setAttr(attrs$1.
|
|
1155
|
+
set visibleLabel(visibleLabel) { this.setAttr(attrs$1.visibleLabel, visibleLabel); }
|
|
1041
1156
|
/**
|
|
1042
1157
|
* @deprecated Use value
|
|
1043
1158
|
*/
|
|
@@ -1047,7 +1162,7 @@ class FieldDescriptor extends FormElement {
|
|
|
1047
1162
|
*/
|
|
1048
1163
|
changed(hasChanged = true) { this.hasChanged = hasChanged; }
|
|
1049
1164
|
clean() { this._setValue(this._defaultValue || ''); this.resetError(); }
|
|
1050
|
-
focus() { this.setAttr(attrs$1.
|
|
1165
|
+
focus() { this.setAttr(attrs$1.focus, true); }
|
|
1051
1166
|
getErrorCode() { return this.error.code; }
|
|
1052
1167
|
setErrorCode(code) { this.setError(code, this._errorMessage); }
|
|
1053
1168
|
getErrorMessage() { return this.error.message; }
|
|
@@ -1059,6 +1174,10 @@ class FieldDescriptor extends FormElement {
|
|
|
1059
1174
|
setEditable(editable = true) { (editable) ? this.enable() : this.disable(); }
|
|
1060
1175
|
setValue(newValue, widgetUpdate = true) { this._setValue(newValue, widgetUpdate); }
|
|
1061
1176
|
showLabel() { this.visibleLabel = true; }
|
|
1177
|
+
/**
|
|
1178
|
+
* @deprecated Use code
|
|
1179
|
+
*/
|
|
1180
|
+
get fieldCode() { return this._fieldCode; }
|
|
1062
1181
|
/**
|
|
1063
1182
|
* @deprecated Use title
|
|
1064
1183
|
*/
|
|
@@ -1113,7 +1232,7 @@ class FieldDescriptor extends FormElement {
|
|
|
1113
1232
|
setVisibleLabel(visibleLabel) { this.visibleLabel = visibleLabel; }
|
|
1114
1233
|
notifyEditionPartial() {
|
|
1115
1234
|
this.resetError();
|
|
1116
|
-
this._editionPartial.next({ code: this.
|
|
1235
|
+
this._editionPartial.next({ code: this._fieldCode, intrinsicValidation: true });
|
|
1117
1236
|
}
|
|
1118
1237
|
notifyEditionFinish() {
|
|
1119
1238
|
const fieldValue = this.value;
|
|
@@ -1149,16 +1268,16 @@ class FieldDescriptor extends FormElement {
|
|
|
1149
1268
|
intrinsicValidation = false;
|
|
1150
1269
|
this.setError('99', `Longitud de ${this._fieldTitle} debe ser de al menos ${this._minLength}`);
|
|
1151
1270
|
}
|
|
1152
|
-
this._editionFinish.next({ code: this.
|
|
1271
|
+
this._editionFinish.next({ code: this._fieldCode, intrinsicValidation });
|
|
1153
1272
|
}
|
|
1154
1273
|
notifyEditionDetailRequest(detail) {
|
|
1155
|
-
const detailEvent = { code: this.
|
|
1274
|
+
const detailEvent = { code: this._fieldCode, detail };
|
|
1156
1275
|
this._detailRequest.next(detailEvent);
|
|
1157
1276
|
}
|
|
1158
1277
|
setError(code, message, type = DEFAULT_ERROR_TYPE) {
|
|
1159
|
-
this.setAttr(attrs$1.
|
|
1160
|
-
this.setAttr(attrs$1.
|
|
1161
|
-
this.setAttr(attrs$1.
|
|
1278
|
+
this.setAttr(attrs$1.errorCode, code ?? NO_ERROR);
|
|
1279
|
+
this.setAttr(attrs$1.errorType, (this._errorCode === NO_ERROR) ? '' : type);
|
|
1280
|
+
this.setAttr(attrs$1.errorMessage, message ?? '');
|
|
1162
1281
|
}
|
|
1163
1282
|
updateFromServer(fld) {
|
|
1164
1283
|
const fieldKeys = Object.keys(fld);
|
|
@@ -1213,7 +1332,7 @@ class FieldDescriptor extends FormElement {
|
|
|
1213
1332
|
if (this._value !== newFinalValue) {
|
|
1214
1333
|
this.hasChanged = true;
|
|
1215
1334
|
if (widgetUpdate) {
|
|
1216
|
-
this.setAttr(attrs$1.
|
|
1335
|
+
this.setAttr(attrs$1.value, newFinalValue);
|
|
1217
1336
|
}
|
|
1218
1337
|
else {
|
|
1219
1338
|
this._value = newFinalValue;
|
|
@@ -1224,20 +1343,20 @@ class FieldDescriptor extends FormElement {
|
|
|
1224
1343
|
}
|
|
1225
1344
|
|
|
1226
1345
|
class RecordTableColumn extends FormPiece {
|
|
1346
|
+
fieldCode = '';
|
|
1347
|
+
fieldTitle = '';
|
|
1348
|
+
fieldType = '';
|
|
1349
|
+
fieldAlignment = '';
|
|
1350
|
+
fieldFormat = '';
|
|
1351
|
+
sortable = true;
|
|
1352
|
+
searchable = true;
|
|
1353
|
+
sortDirections = [];
|
|
1354
|
+
// Filtros
|
|
1355
|
+
filterVisible = false;
|
|
1356
|
+
filterDef = null;
|
|
1357
|
+
filterSetup = null;
|
|
1227
1358
|
constructor(recTableColReceived, formConfig) {
|
|
1228
1359
|
super(recTableColReceived, formConfig);
|
|
1229
|
-
this.fieldCode = '';
|
|
1230
|
-
this.fieldTitle = '';
|
|
1231
|
-
this.fieldType = '';
|
|
1232
|
-
this.fieldAlignment = '';
|
|
1233
|
-
this.fieldFormat = '';
|
|
1234
|
-
this.sortable = true;
|
|
1235
|
-
this.searchable = true;
|
|
1236
|
-
this.sortDirections = [];
|
|
1237
|
-
// Filtros
|
|
1238
|
-
this.filterVisible = false;
|
|
1239
|
-
this.filterDef = null;
|
|
1240
|
-
this.filterSetup = null;
|
|
1241
1360
|
this.filterDef = null;
|
|
1242
1361
|
if (recTableColReceived) {
|
|
1243
1362
|
this.fieldCode = recTableColReceived.fieldCode;
|
|
@@ -1297,11 +1416,19 @@ class RecordTableColumn extends FormPiece {
|
|
|
1297
1416
|
}
|
|
1298
1417
|
|
|
1299
1418
|
class TableAction extends FormPiece {
|
|
1419
|
+
actionCode;
|
|
1420
|
+
actionTitle;
|
|
1421
|
+
iconName;
|
|
1422
|
+
actionType;
|
|
1423
|
+
actionClass;
|
|
1424
|
+
stateField;
|
|
1425
|
+
newState;
|
|
1426
|
+
backend;
|
|
1427
|
+
restrictedOnField = null;
|
|
1428
|
+
restrictedOnValue = null;
|
|
1429
|
+
restrictedOnOperator = null;
|
|
1300
1430
|
constructor(actionDefinition, formConfig) {
|
|
1301
1431
|
super(actionDefinition, formConfig);
|
|
1302
|
-
this.restrictedOnField = null;
|
|
1303
|
-
this.restrictedOnValue = null;
|
|
1304
|
-
this.restrictedOnOperator = null;
|
|
1305
1432
|
this.actionCode = actionDefinition.actionCode;
|
|
1306
1433
|
this.actionTitle = actionDefinition.actionTitle;
|
|
1307
1434
|
this.iconName = actionDefinition.iconName || this.actionCode;
|
|
@@ -1326,10 +1453,10 @@ class TableAction extends FormPiece {
|
|
|
1326
1453
|
}
|
|
1327
1454
|
|
|
1328
1455
|
class TableRecordData {
|
|
1456
|
+
recordId = null;
|
|
1457
|
+
selected = false;
|
|
1458
|
+
recordData = {};
|
|
1329
1459
|
constructor(recordReceived, recordDefinition, selectionFieldName = null) {
|
|
1330
|
-
this.recordId = null;
|
|
1331
|
-
this.selected = false;
|
|
1332
|
-
this.recordData = {};
|
|
1333
1460
|
const { tableRecordId, recordData } = recordReceived;
|
|
1334
1461
|
this.recordId = tableRecordId;
|
|
1335
1462
|
if (!recordDefinition || recordDefinition.length === 0 || !recordData || recordData.length === 0) {
|
|
@@ -1458,45 +1585,62 @@ const attrs = {
|
|
|
1458
1585
|
visibleRecords: { name: 'visibleRecords', propagate: 'visibleRecords' },
|
|
1459
1586
|
};
|
|
1460
1587
|
class RecordTable extends FormElement {
|
|
1588
|
+
_inlineActionTrigger = new Subject();
|
|
1589
|
+
_globalActionTrigger = new Subject();
|
|
1590
|
+
_recordSelectionTrigger = new Subject();
|
|
1591
|
+
_selectionActionTrigger = new Subject();
|
|
1592
|
+
_getDataTrigger = new Subject();
|
|
1593
|
+
_tableColumnObj = {};
|
|
1594
|
+
_appendPages;
|
|
1595
|
+
_actions;
|
|
1596
|
+
_actionsObj = {};
|
|
1597
|
+
// Mecanismos de filtrado nueva versión
|
|
1598
|
+
globalFilterString = '';
|
|
1599
|
+
globalFilterStrings = [];
|
|
1600
|
+
selectedRecords;
|
|
1601
|
+
restrictedId;
|
|
1602
|
+
layout = null;
|
|
1603
|
+
_globalSearch;
|
|
1604
|
+
_tableRecords;
|
|
1605
|
+
_tableRecordObj = {};
|
|
1606
|
+
_visibleRecords = null;
|
|
1607
|
+
_columns;
|
|
1608
|
+
_selectable;
|
|
1609
|
+
_selectionBackend;
|
|
1610
|
+
_selectionField;
|
|
1611
|
+
_allSelected = false;
|
|
1612
|
+
_tableCode = '';
|
|
1613
|
+
_tableTitle;
|
|
1614
|
+
_currentPage;
|
|
1615
|
+
_totalPages;
|
|
1616
|
+
_requestedPage;
|
|
1617
|
+
_recordsPerPage = 10;
|
|
1618
|
+
_totalRecordsNumber = 0;
|
|
1619
|
+
_recordsNumber = 0;
|
|
1620
|
+
_sorting;
|
|
1621
|
+
_waiting;
|
|
1622
|
+
_clientPaging = true;
|
|
1623
|
+
_sortable;
|
|
1461
1624
|
constructor(tableReceived, formConfig) {
|
|
1462
1625
|
super(tableReceived, formConfig);
|
|
1463
|
-
this._inlineActionTrigger = new Subject();
|
|
1464
|
-
this._globalActionTrigger = new Subject();
|
|
1465
|
-
this._recordSelectionTrigger = new Subject();
|
|
1466
|
-
this._selectionActionTrigger = new Subject();
|
|
1467
|
-
this._getDataTrigger = new Subject();
|
|
1468
|
-
this._tableColumnObj = {};
|
|
1469
|
-
this._actionsObj = {};
|
|
1470
|
-
// Mecanismos de filtrado nueva versión
|
|
1471
|
-
this.globalFilterString = '';
|
|
1472
|
-
this.globalFilterStrings = [];
|
|
1473
|
-
this.layout = null;
|
|
1474
|
-
this.tableRecordObj = {};
|
|
1475
|
-
this.visibleRecords = null;
|
|
1476
|
-
this.allSelected = false;
|
|
1477
|
-
this.tableCode = '';
|
|
1478
|
-
this.recordsPerPage = 10;
|
|
1479
|
-
this.totalRecordsNumber = 0;
|
|
1480
|
-
this.recordsNumber = 0;
|
|
1481
|
-
this.clientPaging = true;
|
|
1482
1626
|
this.propagationCustomAttributes = this._formConfig?.propagationCustomAttributes?.tables ?? [];
|
|
1483
1627
|
this.elementType = elementTypes.table;
|
|
1484
|
-
this.
|
|
1485
|
-
this.
|
|
1486
|
-
this.
|
|
1487
|
-
this.
|
|
1488
|
-
this.
|
|
1628
|
+
this._waiting = false;
|
|
1629
|
+
this._currentPage = 1;
|
|
1630
|
+
this._totalPages = 1;
|
|
1631
|
+
this._requestedPage = 1;
|
|
1632
|
+
this._columns = [];
|
|
1489
1633
|
this._tableColumnObj = {};
|
|
1490
1634
|
this._actions = [];
|
|
1491
1635
|
this._actionsObj = {};
|
|
1492
|
-
this.
|
|
1493
|
-
this.
|
|
1636
|
+
this._tableRecords = [];
|
|
1637
|
+
this._globalSearch = false;
|
|
1494
1638
|
this.restrictedId = null;
|
|
1495
|
-
this.
|
|
1639
|
+
this._tableTitle = tableReceived.tableTitle;
|
|
1496
1640
|
this._appendPages = tableReceived?.append ?? false;
|
|
1497
|
-
this.
|
|
1498
|
-
this.
|
|
1499
|
-
this.
|
|
1641
|
+
this._selectable = tableReceived?.selectable ?? false;
|
|
1642
|
+
this._selectionBackend = tableReceived?.selectionBackend ?? false;
|
|
1643
|
+
this._sortable = tableReceived?.sortable ?? false;
|
|
1500
1644
|
this.setAttr(attrs.allSelected, false);
|
|
1501
1645
|
this.setAttr(attrs.tableCode, tableReceived.tableCode);
|
|
1502
1646
|
this.setAttr(attrs.clientPaging, tableReceived?.clientPaging ?? true);
|
|
@@ -1539,7 +1683,7 @@ class RecordTable extends FormElement {
|
|
|
1539
1683
|
this._actionsObj[inlineAction.actionCode] = inlineAction;
|
|
1540
1684
|
}
|
|
1541
1685
|
}
|
|
1542
|
-
this.
|
|
1686
|
+
this._selectionField = (this._selectable) ? tableReceived?.selectionField : null;
|
|
1543
1687
|
// Filtros predefinidos en el formulario
|
|
1544
1688
|
if (tableReceived.filters) {
|
|
1545
1689
|
for (let index = 0; index < tableReceived.filters.length; index++) {
|
|
@@ -1553,19 +1697,61 @@ class RecordTable extends FormElement {
|
|
|
1553
1697
|
get selectionActionTrigger() { return this._selectionActionTrigger; }
|
|
1554
1698
|
get recordSelectionTrigger() { return this._recordSelectionTrigger; }
|
|
1555
1699
|
get getDataTrigger() { return this._getDataTrigger; }
|
|
1700
|
+
get globalSearch() { return this._globalSearch; }
|
|
1701
|
+
get tableRecords() { return this._tableRecords; }
|
|
1702
|
+
get tableRecordObj() { return this._tableRecordObj; }
|
|
1703
|
+
get visibleRecords() { return this._visibleRecords; }
|
|
1704
|
+
get columns() { return this._columns; }
|
|
1705
|
+
get selectable() { return this._selectable; }
|
|
1706
|
+
get selectionBackend() { return this._selectionBackend; }
|
|
1707
|
+
get selectionField() { return this._selectionField; }
|
|
1708
|
+
get allSelected() { return this._allSelected; }
|
|
1709
|
+
get tableCode() { return this._tableCode; }
|
|
1710
|
+
get tableTitle() { return this._tableTitle; }
|
|
1711
|
+
get currentPage() { return this._currentPage; }
|
|
1712
|
+
get totalPages() { return this._totalPages; }
|
|
1713
|
+
get requestedPage() { return this._requestedPage; }
|
|
1714
|
+
get recordsPerPage() { return this._recordsPerPage; }
|
|
1715
|
+
get totalRecordsNumber() { return this._totalRecordsNumber; }
|
|
1716
|
+
get recordsNumber() { return this._recordsNumber; }
|
|
1717
|
+
get sorting() { return this._sorting; }
|
|
1718
|
+
get waiting() { return this._waiting; }
|
|
1719
|
+
get clientPaging() { return this._clientPaging; }
|
|
1720
|
+
get sortable() { return this._sortable; }
|
|
1721
|
+
set globalSearch(globalSearch) { this._globalSearch = globalSearch; }
|
|
1722
|
+
set tableRecords(tableRecords) { this._tableRecords = tableRecords; }
|
|
1723
|
+
set tableRecordObj(tableRecordObj) { this._tableRecordObj = tableRecordObj; }
|
|
1724
|
+
set visibleRecords(visibleRecords) { this._visibleRecords = visibleRecords; }
|
|
1725
|
+
set columns(columns) { this._columns = columns; }
|
|
1726
|
+
set selectable(selectable) { this._selectable = selectable; }
|
|
1727
|
+
set selectionBackend(selectionBackend) { this._selectionBackend = selectionBackend; }
|
|
1728
|
+
set selectionField(selectionField) { this._selectionField = selectionField; }
|
|
1729
|
+
set allSelected(allSelected) { this._allSelected = allSelected; }
|
|
1730
|
+
set tableCode(tableCode) { this._tableCode = tableCode; }
|
|
1731
|
+
set tableTitle(tableTitle) { this._tableTitle = tableTitle; }
|
|
1732
|
+
set currentPage(currentPage) { this._currentPage = currentPage; }
|
|
1733
|
+
set totalPages(totalPages) { this._totalPages = totalPages; }
|
|
1734
|
+
set requestedPage(requestedPage) { this._requestedPage = requestedPage; }
|
|
1735
|
+
set recordsPerPage(recordsPerPage) { this._recordsPerPage = recordsPerPage; }
|
|
1736
|
+
set totalRecordsNumber(totalRecordsNumber) { this._totalRecordsNumber = totalRecordsNumber; }
|
|
1737
|
+
set recordsNumber(recordsNumber) { this._recordsNumber = recordsNumber; }
|
|
1738
|
+
set sorting(sorting) { this._sorting = sorting; }
|
|
1739
|
+
set waiting(waiting) { this._waiting = waiting; }
|
|
1740
|
+
set clientPaging(clientPaging) { this._clientPaging = clientPaging; }
|
|
1741
|
+
set sortable(sortable) { this._sortable = sortable; }
|
|
1556
1742
|
getLayout() { return this.layout; }
|
|
1557
1743
|
setLayout(layout) { this.setAttr(attrs.layout, layout); }
|
|
1558
1744
|
hasActions() { return (this._actions.length > 0); }
|
|
1559
|
-
getSelectedRecords() { return this.
|
|
1560
|
-
activateGlobalSearch() { this.
|
|
1561
|
-
inactivateGlobalSearch() { this.
|
|
1745
|
+
getSelectedRecords() { return this._tableRecords.filter(rec => rec.selected).map(rec => rec.recordId); }
|
|
1746
|
+
activateGlobalSearch() { this._globalSearch = true; }
|
|
1747
|
+
inactivateGlobalSearch() { this._globalSearch = false; }
|
|
1562
1748
|
columnDefinition(fieldCode) { return this._tableColumnObj[fieldCode]; }
|
|
1563
|
-
putOnWait() { this.
|
|
1564
|
-
freeWaiting() { this.
|
|
1749
|
+
putOnWait() { this._waiting = true; }
|
|
1750
|
+
freeWaiting() { this._waiting = false; }
|
|
1565
1751
|
setWidget(widget) { this.widget = widget; }
|
|
1566
1752
|
notifyGlobalAction(actionCode) {
|
|
1567
1753
|
const tableEvent = {
|
|
1568
|
-
tableCode: this.
|
|
1754
|
+
tableCode: this._tableCode,
|
|
1569
1755
|
actionCode,
|
|
1570
1756
|
actionDetail: null
|
|
1571
1757
|
};
|
|
@@ -1573,7 +1759,7 @@ class RecordTable extends FormElement {
|
|
|
1573
1759
|
}
|
|
1574
1760
|
notifyInlineAction(tableActionEvent) {
|
|
1575
1761
|
const tableEvent = {
|
|
1576
|
-
tableCode: this.
|
|
1762
|
+
tableCode: this._tableCode,
|
|
1577
1763
|
actionCode: tableActionEvent.actionCode,
|
|
1578
1764
|
actionDetail: {
|
|
1579
1765
|
recordId: tableActionEvent.recordId,
|
|
@@ -1588,9 +1774,9 @@ class RecordTable extends FormElement {
|
|
|
1588
1774
|
return;
|
|
1589
1775
|
}
|
|
1590
1776
|
record.toggleSelect();
|
|
1591
|
-
this.
|
|
1777
|
+
this._requestedPage = this._currentPage ?? 1;
|
|
1592
1778
|
const tableEvent = {
|
|
1593
|
-
tableCode: this.
|
|
1779
|
+
tableCode: this._tableCode,
|
|
1594
1780
|
actionCode: null,
|
|
1595
1781
|
actionDetail: {
|
|
1596
1782
|
recordId: record.recordId,
|
|
@@ -1601,7 +1787,7 @@ class RecordTable extends FormElement {
|
|
|
1601
1787
|
}
|
|
1602
1788
|
notifySelectionAction(actionCode) {
|
|
1603
1789
|
const tableEvent = {
|
|
1604
|
-
tableCode: this.
|
|
1790
|
+
tableCode: this._tableCode,
|
|
1605
1791
|
actionCode,
|
|
1606
1792
|
actionDetail: {
|
|
1607
1793
|
selectedRecords: this.selectedRecords
|
|
@@ -1611,9 +1797,9 @@ class RecordTable extends FormElement {
|
|
|
1611
1797
|
}
|
|
1612
1798
|
notifyGetDataAction(requestedPage = null) {
|
|
1613
1799
|
this.updateVisibleRecords();
|
|
1614
|
-
this.
|
|
1800
|
+
this._requestedPage = requestedPage || this._currentPage || 1;
|
|
1615
1801
|
const tableEvent = {
|
|
1616
|
-
tableCode: this.
|
|
1802
|
+
tableCode: this._tableCode,
|
|
1617
1803
|
actionCode: null,
|
|
1618
1804
|
actionDetail: null,
|
|
1619
1805
|
};
|
|
@@ -1621,49 +1807,49 @@ class RecordTable extends FormElement {
|
|
|
1621
1807
|
return null;
|
|
1622
1808
|
}
|
|
1623
1809
|
clean() {
|
|
1624
|
-
this.
|
|
1810
|
+
this._tableRecords = [];
|
|
1625
1811
|
this.unSelectAll();
|
|
1626
|
-
this.
|
|
1812
|
+
this._tableRecordObj = {};
|
|
1627
1813
|
this.updateVisibleRecords();
|
|
1628
1814
|
}
|
|
1629
1815
|
selectAll() {
|
|
1630
1816
|
this.setAttr(attrs.allSelected, true);
|
|
1631
|
-
this.
|
|
1817
|
+
this._tableRecords.forEach(record => record.select());
|
|
1632
1818
|
this.setAttr(attrs.selectedRecords, this.getSelectedRecords());
|
|
1633
1819
|
return true;
|
|
1634
1820
|
}
|
|
1635
1821
|
unSelectAll() {
|
|
1636
1822
|
this.setAttr(attrs.allSelected, false);
|
|
1637
|
-
this.
|
|
1823
|
+
this._tableRecords.forEach(record => record.unselect());
|
|
1638
1824
|
this.setAttr(attrs.selectedRecords, this.getSelectedRecords());
|
|
1639
1825
|
return true;
|
|
1640
1826
|
}
|
|
1641
1827
|
setTableRecords(tableRecords, append) {
|
|
1642
1828
|
if (!append) {
|
|
1643
|
-
this.
|
|
1829
|
+
this._tableRecords = [];
|
|
1644
1830
|
this.setAttr(attrs.allSelected, false);
|
|
1645
|
-
this.
|
|
1831
|
+
this._tableRecords.forEach(record => record.unselect());
|
|
1646
1832
|
this.setAttr(attrs.selectedRecords, []);
|
|
1647
|
-
this.
|
|
1833
|
+
this._tableRecordObj = {};
|
|
1648
1834
|
}
|
|
1649
|
-
const newRecordsObj = { ...this.
|
|
1650
|
-
const newRecords = [...this.
|
|
1835
|
+
const newRecordsObj = { ...this._tableRecordObj };
|
|
1836
|
+
const newRecords = [...this._tableRecords];
|
|
1651
1837
|
for (const tableRecord of tableRecords) {
|
|
1652
|
-
const recordReceived = new TableRecordData(tableRecord, this.
|
|
1838
|
+
const recordReceived = new TableRecordData(tableRecord, this._columns, this._selectionField);
|
|
1653
1839
|
const recordIdKey = recordReceived.recordIdKey;
|
|
1654
1840
|
newRecords.push(recordReceived);
|
|
1655
1841
|
newRecordsObj[recordIdKey] = recordReceived;
|
|
1656
1842
|
}
|
|
1657
|
-
this.
|
|
1843
|
+
this._tableRecords = newRecords;
|
|
1658
1844
|
this.setAttr(attrs.selectedRecords, this.getSelectedRecords());
|
|
1659
|
-
this.
|
|
1845
|
+
this._tableRecordObj = newRecordsObj;
|
|
1660
1846
|
this.updateVisibleRecords();
|
|
1661
1847
|
}
|
|
1662
1848
|
appendRecords(records) { this.setTableRecords(records, true); }
|
|
1663
1849
|
replaceRecords(records) { this.setTableRecords(records, false); }
|
|
1664
1850
|
setTableAppend(append) { this._appendPages = append; }
|
|
1665
1851
|
changePage(requestedPage) {
|
|
1666
|
-
if (this.
|
|
1852
|
+
if (this._clientPaging) {
|
|
1667
1853
|
this.setAttr(attrs.currentPage, requestedPage);
|
|
1668
1854
|
this.updateVisibleRecords();
|
|
1669
1855
|
}
|
|
@@ -1673,25 +1859,25 @@ class RecordTable extends FormElement {
|
|
|
1673
1859
|
}
|
|
1674
1860
|
updateVisibleRecords() {
|
|
1675
1861
|
let visibleRecords;
|
|
1676
|
-
if (this.
|
|
1862
|
+
if (this._clientPaging) {
|
|
1677
1863
|
let filteredRecords = this.getFilteredRecords();
|
|
1678
1864
|
this.setAttr(attrs.totalRecordsNumber, filteredRecords.length);
|
|
1679
|
-
const sliceNumber1 = (this.
|
|
1680
|
-
const sliceNumber2 = (this.
|
|
1865
|
+
const sliceNumber1 = (this._currentPage - 1) * this._recordsPerPage;
|
|
1866
|
+
const sliceNumber2 = (this._currentPage - 1) * this._recordsPerPage + this._recordsPerPage;
|
|
1681
1867
|
visibleRecords = filteredRecords.slice(sliceNumber1, sliceNumber2);
|
|
1682
|
-
const recordsLastPage = this.
|
|
1683
|
-
const totalPages = Math.trunc(this.
|
|
1684
|
-
if (this.
|
|
1685
|
-
this.
|
|
1868
|
+
const recordsLastPage = this._totalRecordsNumber % this._recordsPerPage;
|
|
1869
|
+
const totalPages = Math.trunc(this._totalRecordsNumber / this._recordsPerPage + (recordsLastPage ? 1 : 0));
|
|
1870
|
+
if (this._currentPage > totalPages) {
|
|
1871
|
+
this._currentPage = totalPages || 1;
|
|
1686
1872
|
}
|
|
1687
1873
|
}
|
|
1688
1874
|
else {
|
|
1689
|
-
visibleRecords = this.
|
|
1875
|
+
visibleRecords = this._tableRecords;
|
|
1690
1876
|
}
|
|
1691
1877
|
this.setAttr(attrs.visibleRecords, visibleRecords);
|
|
1692
1878
|
}
|
|
1693
1879
|
updateFromServer(tableReceived) {
|
|
1694
|
-
this.
|
|
1880
|
+
this._requestedPage = 1;
|
|
1695
1881
|
const { visible = true, totalPages = 1, recordsNumber, currentPage = 1, recordsPerPage, totalRecordsNumber, sortingColumn, sortingDirection, tableRecords, actions, fields, } = tableReceived;
|
|
1696
1882
|
this.visible = visible;
|
|
1697
1883
|
if (actions) {
|
|
@@ -1739,11 +1925,11 @@ class RecordTable extends FormElement {
|
|
|
1739
1925
|
});
|
|
1740
1926
|
}
|
|
1741
1927
|
if (tableRecords) {
|
|
1742
|
-
this.
|
|
1743
|
-
this.
|
|
1928
|
+
this._totalPages = totalPages;
|
|
1929
|
+
this._recordsNumber = recordsNumber;
|
|
1744
1930
|
this.setAttr(attrs.currentPage, +currentPage);
|
|
1745
1931
|
this.setAttr(attrs.recordsPerPage, +recordsPerPage);
|
|
1746
|
-
this.setAttr(attrs.totalRecordsNumber, (this.
|
|
1932
|
+
this.setAttr(attrs.totalRecordsNumber, (this._clientPaging) ? tableRecords.length : +totalRecordsNumber);
|
|
1747
1933
|
this.setAttr(attrs.sorting, {
|
|
1748
1934
|
columnName: sortingColumn || '',
|
|
1749
1935
|
direction: sortingDirection || ''
|
|
@@ -1755,13 +1941,13 @@ class RecordTable extends FormElement {
|
|
|
1755
1941
|
this.appendRecords(tableRecords);
|
|
1756
1942
|
}
|
|
1757
1943
|
}
|
|
1758
|
-
this.
|
|
1944
|
+
this._waiting = false;
|
|
1759
1945
|
this.updateVisibleRecords();
|
|
1760
1946
|
}
|
|
1761
1947
|
getTableRecord(recordId) {
|
|
1762
1948
|
const recordIdKey = (typeof recordId === 'object') ? JSON.stringify(recordId) : recordId;
|
|
1763
|
-
return (this.
|
|
1764
|
-
? this.
|
|
1949
|
+
return (this._tableRecordObj && recordId && this._tableRecordObj[recordId])
|
|
1950
|
+
? this._tableRecordObj[recordId] : null;
|
|
1765
1951
|
}
|
|
1766
1952
|
getAction(actionCode) {
|
|
1767
1953
|
return (this._actionsObj && actionCode && this._actionsObj[actionCode])
|
|
@@ -1790,7 +1976,7 @@ class RecordTable extends FormElement {
|
|
|
1790
1976
|
}
|
|
1791
1977
|
setGlobalFilterString(text, notifyComponent = true) {
|
|
1792
1978
|
this.globalFilterStrings = text.split(' ').filter(t => t && t.trim().length > 0).map(t => t.trim()) ?? [];
|
|
1793
|
-
if (this.
|
|
1979
|
+
if (this._clientPaging) {
|
|
1794
1980
|
this.changePage(1);
|
|
1795
1981
|
}
|
|
1796
1982
|
if (notifyComponent) {
|
|
@@ -1802,14 +1988,14 @@ class RecordTable extends FormElement {
|
|
|
1802
1988
|
tableColumn && tableColumn.addFilterDefinition(filterDefinition);
|
|
1803
1989
|
}
|
|
1804
1990
|
getFilteredRecords() {
|
|
1805
|
-
let filteredRecords = this.
|
|
1991
|
+
let filteredRecords = this._tableRecords;
|
|
1806
1992
|
if (this.restrictedId) {
|
|
1807
1993
|
filteredRecords = filteredRecords.filter(record => record.recordId === this.restrictedId);
|
|
1808
1994
|
}
|
|
1809
1995
|
if (this.globalFilterStrings.length > 0) {
|
|
1810
1996
|
filteredRecords = filteredRecords.filter(record => record.hasPattern(this.globalFilterStrings, this._tableColumnObj));
|
|
1811
1997
|
}
|
|
1812
|
-
const columnFilters = this.
|
|
1998
|
+
const columnFilters = this._columns.filter(column => column.filter).map(column => column.filter);
|
|
1813
1999
|
if (columnFilters.length > 0) {
|
|
1814
2000
|
filteredRecords = filteredRecords.filter(record => record.hasCondition(columnFilters));
|
|
1815
2001
|
}
|
|
@@ -1838,7 +2024,7 @@ class RecordTable extends FormElement {
|
|
|
1838
2024
|
simpleFilterWords: this.globalFilterStrings,
|
|
1839
2025
|
advancedFilter: [],
|
|
1840
2026
|
};
|
|
1841
|
-
const columnFilters = this.
|
|
2027
|
+
const columnFilters = this._columns.filter(column => column.filter).map(column => column.filter);
|
|
1842
2028
|
for (let index = 0; index < columnFilters.length; index++) {
|
|
1843
2029
|
const columnFilter = columnFilters[index];
|
|
1844
2030
|
compactFilter.advancedFilter.push({
|
|
@@ -1853,7 +2039,7 @@ class RecordTable extends FormElement {
|
|
|
1853
2039
|
// Ordenamiento de registros local
|
|
1854
2040
|
sort(columnName, direction) {
|
|
1855
2041
|
this.setRequiredOrder(columnName, direction);
|
|
1856
|
-
if (this.
|
|
2042
|
+
if (this._clientPaging) {
|
|
1857
2043
|
this.localSortData();
|
|
1858
2044
|
}
|
|
1859
2045
|
else {
|
|
@@ -1867,10 +2053,10 @@ class RecordTable extends FormElement {
|
|
|
1867
2053
|
});
|
|
1868
2054
|
}
|
|
1869
2055
|
localSortData() {
|
|
1870
|
-
if (!this.
|
|
2056
|
+
if (!this._sorting.columnName || !this._sorting.direction) {
|
|
1871
2057
|
return;
|
|
1872
2058
|
}
|
|
1873
|
-
this.
|
|
2059
|
+
this._tableRecords.sort((a, b) => this.recordCompare(a, b, this._sorting.columnName, this._sorting.direction));
|
|
1874
2060
|
//this.unSelectAll();
|
|
1875
2061
|
this.updateVisibleRecords();
|
|
1876
2062
|
}
|
|
@@ -1889,7 +2075,7 @@ class RecordTable extends FormElement {
|
|
|
1889
2075
|
return direction === TABLE_SORT_ASCENDING ? result : -result;
|
|
1890
2076
|
}
|
|
1891
2077
|
formStateChangeCustomSubscribe(form, formChangeSubject) {
|
|
1892
|
-
this.
|
|
2078
|
+
this._columns?.forEach(column => {
|
|
1893
2079
|
column?.connectWithParentForm(form, formChangeSubject);
|
|
1894
2080
|
});
|
|
1895
2081
|
this._actions?.forEach(action => {
|
|
@@ -1899,25 +2085,25 @@ class RecordTable extends FormElement {
|
|
|
1899
2085
|
}
|
|
1900
2086
|
|
|
1901
2087
|
class RecordFormSubSection extends FormPiecePropagate {
|
|
2088
|
+
_customRender = null;
|
|
2089
|
+
_subsectionId = null;
|
|
2090
|
+
_subsectionCode = null;
|
|
2091
|
+
_subsectionTitle = null;
|
|
2092
|
+
_subSectionElements = [];
|
|
2093
|
+
_subSectionFields = [];
|
|
2094
|
+
_subSectionTables = [];
|
|
2095
|
+
_subSectionActions = [];
|
|
2096
|
+
_elementsArray = {};
|
|
2097
|
+
_active = false;
|
|
1902
2098
|
constructor(subsectionReceived, formObject, formConfig) {
|
|
1903
2099
|
super(subsectionReceived, formConfig);
|
|
1904
|
-
this._customRender = null;
|
|
1905
|
-
this.subsectionId = null;
|
|
1906
|
-
this.subsectionCode = null;
|
|
1907
|
-
this.subsectionTitle = null;
|
|
1908
|
-
this.subSectionElements = [];
|
|
1909
|
-
this.subSectionFields = [];
|
|
1910
|
-
this.subSectionTables = [];
|
|
1911
|
-
this.subSectionActions = [];
|
|
1912
|
-
this.elementsArray = {};
|
|
1913
|
-
this.active = false;
|
|
1914
2100
|
this.propagationCustomAttributes = this._formConfig?.propagationCustomAttributes?.subsections ?? [];
|
|
1915
2101
|
if (!subsectionReceived) {
|
|
1916
2102
|
return;
|
|
1917
2103
|
}
|
|
1918
|
-
this.
|
|
1919
|
-
this.
|
|
1920
|
-
this.
|
|
2104
|
+
this._subsectionId = (subsectionReceived.subsectionId) ? subsectionReceived.subsectionId.toString() : '';
|
|
2105
|
+
this._subsectionCode = (subsectionReceived.subsectionCode) ? subsectionReceived.subsectionCode : '';
|
|
2106
|
+
this._subsectionTitle = (subsectionReceived.subsectionTitle) ? subsectionReceived.subsectionTitle : '';
|
|
1921
2107
|
if (subsectionReceived.elements) {
|
|
1922
2108
|
for (const receivedElement of subsectionReceived.elements) {
|
|
1923
2109
|
let elementObject = null;
|
|
@@ -1926,52 +2112,70 @@ class RecordFormSubSection extends FormPiecePropagate {
|
|
|
1926
2112
|
switch (type) {
|
|
1927
2113
|
case elementTypes.field:
|
|
1928
2114
|
elementObject = formObject.getField(code);
|
|
1929
|
-
arrayToAdd = this.
|
|
2115
|
+
arrayToAdd = this._subSectionFields;
|
|
1930
2116
|
break;
|
|
1931
2117
|
case elementTypes.table:
|
|
1932
2118
|
elementObject = formObject.getTable(code);
|
|
1933
|
-
arrayToAdd = this.
|
|
2119
|
+
arrayToAdd = this._subSectionTables;
|
|
1934
2120
|
break;
|
|
1935
2121
|
case elementTypes.action:
|
|
1936
2122
|
elementObject = formObject.getAction(code);
|
|
1937
|
-
arrayToAdd = this.
|
|
2123
|
+
arrayToAdd = this._subSectionActions;
|
|
1938
2124
|
break;
|
|
1939
2125
|
}
|
|
1940
2126
|
if (elementObject) {
|
|
1941
2127
|
elementObject.elementType = type;
|
|
1942
2128
|
arrayToAdd.push(elementObject);
|
|
1943
|
-
this.
|
|
1944
|
-
this.
|
|
2129
|
+
this._subSectionElements.push(elementObject);
|
|
2130
|
+
this._elementsArray[code] = elementObject;
|
|
1945
2131
|
}
|
|
1946
2132
|
}
|
|
1947
2133
|
}
|
|
1948
2134
|
}
|
|
1949
2135
|
get customRender() { return this._customRender; }
|
|
1950
2136
|
set customRender(customRenderName) { this._customRender = customRenderName; }
|
|
2137
|
+
get subsectionId() { return this._subsectionId; }
|
|
2138
|
+
get subsectionCode() { return this._subsectionCode; }
|
|
2139
|
+
get subsectionTitle() { return this._subsectionTitle; }
|
|
2140
|
+
get subSectionElements() { return this._subSectionElements; }
|
|
2141
|
+
get subSectionFields() { return this._subSectionFields; }
|
|
2142
|
+
get subSectionTables() { return this._subSectionTables; }
|
|
2143
|
+
get subSectionActions() { return this._subSectionActions; }
|
|
2144
|
+
get elementsArray() { return this._elementsArray; }
|
|
2145
|
+
get active() { return this._active; }
|
|
2146
|
+
set subsectionId(subsectionId) { this._subsectionId = subsectionId; }
|
|
2147
|
+
set subsectionCode(subsectionCode) { this._subsectionCode = subsectionCode; }
|
|
2148
|
+
set subsectionTitle(subsectionTitle) { this._subsectionTitle = subsectionTitle; }
|
|
2149
|
+
set subSectionElements(subSectionElements) { this._subSectionElements = subSectionElements; }
|
|
2150
|
+
set subSectionFields(subSectionFields) { this._subSectionFields = subSectionFields; }
|
|
2151
|
+
set subSectionTables(subSectionTables) { this._subSectionTables = subSectionTables; }
|
|
2152
|
+
set subSectionActions(subSectionActions) { this._subSectionActions = subSectionActions; }
|
|
2153
|
+
set elementsArray(elementsArray) { this._elementsArray = elementsArray; }
|
|
2154
|
+
set active(active) { this._active = active; }
|
|
1951
2155
|
getField(name) {
|
|
1952
|
-
return this.
|
|
2156
|
+
return this._subSectionFields.find(fld => fld.name === name);
|
|
1953
2157
|
}
|
|
1954
2158
|
getFields() {
|
|
1955
|
-
return this.
|
|
2159
|
+
return this._subSectionFields;
|
|
1956
2160
|
}
|
|
1957
2161
|
getFieldNames() {
|
|
1958
|
-
return this.
|
|
2162
|
+
return this._subSectionFields.map(field => field.code);
|
|
1959
2163
|
}
|
|
1960
2164
|
getActions() {
|
|
1961
|
-
return this.
|
|
2165
|
+
return this._subSectionActions;
|
|
1962
2166
|
}
|
|
1963
2167
|
getActionNames() {
|
|
1964
|
-
return this.
|
|
2168
|
+
return this._subSectionActions.map(action => action.actionCode);
|
|
1965
2169
|
}
|
|
1966
2170
|
activate() {
|
|
1967
|
-
if (!this.
|
|
1968
|
-
this.
|
|
2171
|
+
if (!this._active) {
|
|
2172
|
+
this._active = true;
|
|
1969
2173
|
// this.subsectionCode && this._activation.next(this.subsectionCode);
|
|
1970
2174
|
}
|
|
1971
2175
|
}
|
|
1972
2176
|
inactivate() {
|
|
1973
|
-
if (this.
|
|
1974
|
-
this.
|
|
2177
|
+
if (this._active) {
|
|
2178
|
+
this._active = false;
|
|
1975
2179
|
// this.subsectionCode && this._inactivation.next(this.subsectionCode);
|
|
1976
2180
|
}
|
|
1977
2181
|
}
|
|
@@ -1979,25 +2183,26 @@ class RecordFormSubSection extends FormPiecePropagate {
|
|
|
1979
2183
|
|
|
1980
2184
|
const ACTIVE$1 = 'active';
|
|
1981
2185
|
class RecordFormSection extends FormPiecePropagate {
|
|
2186
|
+
_activation = new Subject();
|
|
2187
|
+
_inactivation = new Subject();
|
|
2188
|
+
_active = false;
|
|
2189
|
+
_sectionId = null;
|
|
2190
|
+
_sectionCode = null;
|
|
2191
|
+
_sectionTitle = null;
|
|
2192
|
+
_subSections = [];
|
|
2193
|
+
_subSectionsObj;
|
|
2194
|
+
_exclusiveSubSectionsByAttr = {};
|
|
1982
2195
|
constructor(sectionReceived, formObject, formConfig) {
|
|
1983
2196
|
super(sectionReceived, formConfig);
|
|
1984
|
-
this._activation = new Subject();
|
|
1985
|
-
this._inactivation = new Subject();
|
|
1986
|
-
this.active = false;
|
|
1987
|
-
this.sectionId = null;
|
|
1988
|
-
this.sectionCode = null;
|
|
1989
|
-
this.sectionTitle = null;
|
|
1990
|
-
this.subSections = [];
|
|
1991
|
-
this._exclusiveSubSectionsByAttr = {};
|
|
1992
2197
|
this.propagationCustomAttributes = this._formConfig?.propagationCustomAttributes?.sections ?? [];
|
|
1993
2198
|
if (!sectionReceived) {
|
|
1994
2199
|
return;
|
|
1995
2200
|
}
|
|
1996
|
-
this.
|
|
1997
|
-
this.
|
|
1998
|
-
this.
|
|
1999
|
-
this.
|
|
2000
|
-
this.
|
|
2201
|
+
this._sectionId = (sectionReceived.sectionId) ? sectionReceived.sectionId.toString() : '';
|
|
2202
|
+
this._sectionCode = (sectionReceived.sectionCode) ? sectionReceived.sectionCode : '';
|
|
2203
|
+
this._sectionTitle = (sectionReceived.sectionTitle) ? sectionReceived.sectionTitle : '';
|
|
2204
|
+
this._subSections = [];
|
|
2205
|
+
this._subSectionsObj = {};
|
|
2001
2206
|
if (sectionReceived.subsections) {
|
|
2002
2207
|
const subsections = sectionReceived.subsections.map(subSecDef => {
|
|
2003
2208
|
const visibleStates = subSecDef.visibleStates ?? [];
|
|
@@ -2010,42 +2215,54 @@ class RecordFormSection extends FormPiecePropagate {
|
|
|
2010
2215
|
const subSectionToAdd = new RecordFormSubSection(subsectionReceived, formObject, formConfig);
|
|
2011
2216
|
const subsectionCode = subSectionToAdd.subsectionCode;
|
|
2012
2217
|
if (subsectionCode) {
|
|
2013
|
-
this.
|
|
2014
|
-
this.
|
|
2218
|
+
this._subSections.push(subSectionToAdd);
|
|
2219
|
+
this._subSectionsObj[subsectionCode] = subSectionToAdd;
|
|
2015
2220
|
}
|
|
2016
2221
|
}
|
|
2017
2222
|
}
|
|
2018
2223
|
}
|
|
2019
|
-
get code() { return this.
|
|
2224
|
+
get code() { return this._sectionCode; }
|
|
2020
2225
|
get activation() { return this._activation; }
|
|
2021
2226
|
get inactivation() { return this._inactivation; }
|
|
2227
|
+
get active() { return this._active; }
|
|
2228
|
+
get sectionId() { return this._sectionId; }
|
|
2229
|
+
get sectionCode() { return this._sectionCode; }
|
|
2230
|
+
get sectionTitle() { return this._sectionTitle; }
|
|
2231
|
+
get subSections() { return this._subSections; }
|
|
2232
|
+
get subSectionsObj() { return this._subSectionsObj; }
|
|
2233
|
+
set active(active) { this._active = active; }
|
|
2234
|
+
set sectionId(sectionId) { this._sectionId = sectionId; }
|
|
2235
|
+
set sectionCode(sectionCode) { this._sectionCode = sectionCode; }
|
|
2236
|
+
set sectionTitle(sectionTitle) { this._sectionTitle = sectionTitle; }
|
|
2237
|
+
set subSections(subSections) { this._subSections = subSections; }
|
|
2238
|
+
set subSectionsObj(subSectionsObj) { this._subSectionsObj = subSectionsObj; }
|
|
2022
2239
|
activate() {
|
|
2023
|
-
if (!this.
|
|
2024
|
-
this.
|
|
2025
|
-
this.
|
|
2240
|
+
if (!this._active) {
|
|
2241
|
+
this._active = true;
|
|
2242
|
+
this._sectionCode && this._activation.next(this._sectionCode);
|
|
2026
2243
|
}
|
|
2027
2244
|
}
|
|
2028
2245
|
inactivate() {
|
|
2029
|
-
if (this.
|
|
2030
|
-
this.
|
|
2031
|
-
this.
|
|
2246
|
+
if (this._active) {
|
|
2247
|
+
this._active = false;
|
|
2248
|
+
this._sectionCode && this._inactivation.next(this._sectionCode);
|
|
2032
2249
|
}
|
|
2033
2250
|
}
|
|
2034
|
-
get title() { return this.
|
|
2035
|
-
set title(title) { this.
|
|
2251
|
+
get title() { return this._sectionTitle; }
|
|
2252
|
+
set title(title) { this._sectionTitle = title; }
|
|
2036
2253
|
getVisibleSubsections(state) {
|
|
2037
|
-
return this.
|
|
2254
|
+
return this._subSections.filter(subSection => subSection.visible);
|
|
2038
2255
|
}
|
|
2039
2256
|
getSubsection(subSectionCode) {
|
|
2040
|
-
return (this.
|
|
2041
|
-
? this.
|
|
2257
|
+
return (this._subSectionsObj && this._subSectionsObj[subSectionCode])
|
|
2258
|
+
? this._subSectionsObj[subSectionCode] : null;
|
|
2042
2259
|
}
|
|
2043
2260
|
activateSubSection(subSectionCode) {
|
|
2044
2261
|
if (subSectionCode === this._exclusiveSubSectionsByAttr[ACTIVE$1]) {
|
|
2045
2262
|
return;
|
|
2046
2263
|
}
|
|
2047
|
-
const subSection = (this.
|
|
2048
|
-
? this.
|
|
2264
|
+
const subSection = (this._subSectionsObj && this._subSectionsObj[subSectionCode])
|
|
2265
|
+
? this._subSectionsObj[subSectionCode] : null;
|
|
2049
2266
|
if (subSection) {
|
|
2050
2267
|
subSection?.activate();
|
|
2051
2268
|
this._exclusiveSubSectionsByAttr[ACTIVE$1] = subSectionCode;
|
|
@@ -2053,8 +2270,8 @@ class RecordFormSection extends FormPiecePropagate {
|
|
|
2053
2270
|
}
|
|
2054
2271
|
getFields() {
|
|
2055
2272
|
let fieldsArray = [];
|
|
2056
|
-
if (this.
|
|
2057
|
-
for (const subSection of this.
|
|
2273
|
+
if (this._subSections && this._subSections.length > 0) {
|
|
2274
|
+
for (const subSection of this._subSections) {
|
|
2058
2275
|
const subsectionFields = subSection.getFields() ?? [];
|
|
2059
2276
|
if (subsectionFields?.length > 0) {
|
|
2060
2277
|
fieldsArray = fieldsArray.concat(subsectionFields);
|
|
@@ -2065,8 +2282,8 @@ class RecordFormSection extends FormPiecePropagate {
|
|
|
2065
2282
|
}
|
|
2066
2283
|
getActions() {
|
|
2067
2284
|
let actionArray = [];
|
|
2068
|
-
if (this.
|
|
2069
|
-
for (const subSection of this.
|
|
2285
|
+
if (this._subSections && this._subSections.length > 0) {
|
|
2286
|
+
for (const subSection of this._subSections) {
|
|
2070
2287
|
const subSectionActions = subSection.getActions() ?? [];
|
|
2071
2288
|
if (subSectionActions?.length > 0) {
|
|
2072
2289
|
actionArray = actionArray.concat(subSectionActions);
|
|
@@ -2077,8 +2294,8 @@ class RecordFormSection extends FormPiecePropagate {
|
|
|
2077
2294
|
}
|
|
2078
2295
|
getActionNames() {
|
|
2079
2296
|
let actionArray = [];
|
|
2080
|
-
if (this.
|
|
2081
|
-
for (const subSection of this.
|
|
2297
|
+
if (this._subSections && this._subSections.length > 0) {
|
|
2298
|
+
for (const subSection of this._subSections) {
|
|
2082
2299
|
actionArray = actionArray.concat(subSection.getActionNames());
|
|
2083
2300
|
}
|
|
2084
2301
|
}
|
|
@@ -2086,8 +2303,8 @@ class RecordFormSection extends FormPiecePropagate {
|
|
|
2086
2303
|
}
|
|
2087
2304
|
getFieldNames() {
|
|
2088
2305
|
let fieldsArray = [];
|
|
2089
|
-
if (this.
|
|
2090
|
-
for (const subSection of this.
|
|
2306
|
+
if (this._subSections && this._subSections.length > 0) {
|
|
2307
|
+
for (const subSection of this._subSections) {
|
|
2091
2308
|
fieldsArray = fieldsArray.concat(subSection.getFieldNames());
|
|
2092
2309
|
}
|
|
2093
2310
|
}
|
|
@@ -2095,8 +2312,8 @@ class RecordFormSection extends FormPiecePropagate {
|
|
|
2095
2312
|
}
|
|
2096
2313
|
getField(name) {
|
|
2097
2314
|
let field = null;
|
|
2098
|
-
if (this.
|
|
2099
|
-
for (const subSection of this.
|
|
2315
|
+
if (this._subSections && this._subSections.length > 0) {
|
|
2316
|
+
for (const subSection of this._subSections) {
|
|
2100
2317
|
field = subSection.getField(name);
|
|
2101
2318
|
if (field) {
|
|
2102
2319
|
return field;
|
|
@@ -2106,7 +2323,7 @@ class RecordFormSection extends FormPiecePropagate {
|
|
|
2106
2323
|
return null;
|
|
2107
2324
|
}
|
|
2108
2325
|
formStateChangeCustomSubscribe(form, formChangeSubject) {
|
|
2109
|
-
this.
|
|
2326
|
+
this._subSections?.forEach(subsection => {
|
|
2110
2327
|
subsection?.connectWithParentForm(form, formChangeSubject);
|
|
2111
2328
|
});
|
|
2112
2329
|
}
|
|
@@ -2122,19 +2339,26 @@ const alwaysVisible = 'ALWAYS';
|
|
|
2122
2339
|
const neverVisible = 'NONE';
|
|
2123
2340
|
const onStatesVisible = 'ONSTATES';
|
|
2124
2341
|
class FormStructureAndData {
|
|
2342
|
+
_stateChange = new Subject();
|
|
2343
|
+
formConfig;
|
|
2344
|
+
state;
|
|
2345
|
+
name = '';
|
|
2346
|
+
title = '';
|
|
2347
|
+
subject = null;
|
|
2348
|
+
stateFlow;
|
|
2349
|
+
fields = {};
|
|
2350
|
+
actions = {};
|
|
2351
|
+
tables = {};
|
|
2352
|
+
sections = {};
|
|
2353
|
+
fieldArray;
|
|
2354
|
+
actionArray;
|
|
2355
|
+
tableArray;
|
|
2356
|
+
sectionArray;
|
|
2357
|
+
_immutableData = {};
|
|
2358
|
+
_extraInfo = {};
|
|
2359
|
+
_exclusiveSectionsByAttr = {};
|
|
2360
|
+
customAttributes = {};
|
|
2125
2361
|
constructor() {
|
|
2126
|
-
this._stateChange = new Subject();
|
|
2127
|
-
this.name = '';
|
|
2128
|
-
this.title = '';
|
|
2129
|
-
this.subject = null;
|
|
2130
|
-
this.fields = {};
|
|
2131
|
-
this.actions = {};
|
|
2132
|
-
this.tables = {};
|
|
2133
|
-
this.sections = {};
|
|
2134
|
-
this._immutableData = {};
|
|
2135
|
-
this._extraInfo = {};
|
|
2136
|
-
this._exclusiveSectionsByAttr = {};
|
|
2137
|
-
this.customAttributes = {};
|
|
2138
2362
|
this.state = '';
|
|
2139
2363
|
this.actionArray = [];
|
|
2140
2364
|
this.fieldArray = [];
|
|
@@ -2681,6 +2905,7 @@ class FormStructureAndData {
|
|
|
2681
2905
|
}
|
|
2682
2906
|
|
|
2683
2907
|
class LibFormManagerService {
|
|
2908
|
+
pageStack;
|
|
2684
2909
|
constructor() {
|
|
2685
2910
|
this.cleanStack();
|
|
2686
2911
|
}
|
|
@@ -2760,9 +2985,9 @@ class LibFormManagerService {
|
|
|
2760
2985
|
}
|
|
2761
2986
|
|
|
2762
2987
|
class LibEventManagerService {
|
|
2988
|
+
eventSubjects = {};
|
|
2989
|
+
eventSubjectParams = {};
|
|
2763
2990
|
constructor(eventSet) {
|
|
2764
|
-
this.eventSubjects = {};
|
|
2765
|
-
this.eventSubjectParams = {};
|
|
2766
2991
|
eventSet.forEach((event) => { this.addEventName(event); });
|
|
2767
2992
|
}
|
|
2768
2993
|
addEventName(event, rebuild = false) {
|
|
@@ -2815,51 +3040,55 @@ const GET_DATA_ACTION = 'GETDATA';
|
|
|
2815
3040
|
const SUBJECT = 'subject';
|
|
2816
3041
|
const TOKEN = 'token';
|
|
2817
3042
|
class BasicFormComponent extends FormStructureAndData {
|
|
3043
|
+
formManagerService;
|
|
3044
|
+
_eventManager;
|
|
3045
|
+
fileMgmtServices;
|
|
3046
|
+
_controlToken = null;
|
|
3047
|
+
_originToken = null;
|
|
3048
|
+
_formRoute = null;
|
|
3049
|
+
_definitionObtained = false;
|
|
3050
|
+
_notifyFormActivity = true;
|
|
3051
|
+
// Eventos de acciones y campos
|
|
3052
|
+
_formChangeState = [];
|
|
3053
|
+
_formSectionsCanDeactivate = {};
|
|
3054
|
+
_formSectionsActivate = {};
|
|
3055
|
+
_formSectionsInactivate = {};
|
|
3056
|
+
_formActionsStart = {};
|
|
3057
|
+
_formActionsFinish = {};
|
|
3058
|
+
_fieldInputValidation = {};
|
|
3059
|
+
_fieldValidationsStart = {};
|
|
3060
|
+
_fieldValidationsFinish = {};
|
|
3061
|
+
// Callback de acciones de tablas
|
|
3062
|
+
_tableSelectionsStart = {};
|
|
3063
|
+
_tableSelectionsFinish = {};
|
|
3064
|
+
_tableActionsStart = {};
|
|
3065
|
+
_tableActionsFinish = {};
|
|
3066
|
+
_tableGetDataStart = {};
|
|
3067
|
+
_tableGetDataFinish = {};
|
|
3068
|
+
// Errores en procesos
|
|
3069
|
+
_actionServerError = [];
|
|
3070
|
+
_fieldServerError = [];
|
|
3071
|
+
_tableServerError = [];
|
|
3072
|
+
// Datos complementarios del formulario
|
|
3073
|
+
inputDataFields = {};
|
|
3074
|
+
extraData = {};
|
|
3075
|
+
_eventEmiter;
|
|
3076
|
+
enabledSections = [];
|
|
3077
|
+
// Gestión de error
|
|
3078
|
+
_errorType = '';
|
|
3079
|
+
errorCode = '';
|
|
3080
|
+
errorFullCode = '';
|
|
3081
|
+
errorName = '';
|
|
3082
|
+
errorMessage = '';
|
|
3083
|
+
errorDetail = '';
|
|
3084
|
+
// Control de estado
|
|
3085
|
+
visible = false;
|
|
3086
|
+
busy = false;
|
|
2818
3087
|
constructor(formManagerService, _eventManager, fileMgmtServices) {
|
|
2819
3088
|
super();
|
|
2820
3089
|
this.formManagerService = formManagerService;
|
|
2821
3090
|
this._eventManager = _eventManager;
|
|
2822
3091
|
this.fileMgmtServices = fileMgmtServices;
|
|
2823
|
-
this._controlToken = null;
|
|
2824
|
-
this._originToken = null;
|
|
2825
|
-
this._formRoute = null;
|
|
2826
|
-
this._definitionObtained = false;
|
|
2827
|
-
this._notifyFormActivity = true;
|
|
2828
|
-
// Eventos de acciones y campos
|
|
2829
|
-
this._formChangeState = [];
|
|
2830
|
-
this._formSectionsCanDeactivate = {};
|
|
2831
|
-
this._formSectionsActivate = {};
|
|
2832
|
-
this._formSectionsInactivate = {};
|
|
2833
|
-
this._formActionsStart = {};
|
|
2834
|
-
this._formActionsFinish = {};
|
|
2835
|
-
this._fieldInputValidation = {};
|
|
2836
|
-
this._fieldValidationsStart = {};
|
|
2837
|
-
this._fieldValidationsFinish = {};
|
|
2838
|
-
// Callback de acciones de tablas
|
|
2839
|
-
this._tableSelectionsStart = {};
|
|
2840
|
-
this._tableSelectionsFinish = {};
|
|
2841
|
-
this._tableActionsStart = {};
|
|
2842
|
-
this._tableActionsFinish = {};
|
|
2843
|
-
this._tableGetDataStart = {};
|
|
2844
|
-
this._tableGetDataFinish = {};
|
|
2845
|
-
// Errores en procesos
|
|
2846
|
-
this._actionServerError = [];
|
|
2847
|
-
this._fieldServerError = [];
|
|
2848
|
-
this._tableServerError = [];
|
|
2849
|
-
// Datos complementarios del formulario
|
|
2850
|
-
this.inputDataFields = {};
|
|
2851
|
-
this.extraData = {};
|
|
2852
|
-
this.enabledSections = [];
|
|
2853
|
-
// Gestión de error
|
|
2854
|
-
this._errorType = '';
|
|
2855
|
-
this.errorCode = '';
|
|
2856
|
-
this.errorFullCode = '';
|
|
2857
|
-
this.errorName = '';
|
|
2858
|
-
this.errorMessage = '';
|
|
2859
|
-
this.errorDetail = '';
|
|
2860
|
-
// Control de estado
|
|
2861
|
-
this.visible = false;
|
|
2862
|
-
this.busy = false;
|
|
2863
3092
|
this._eventEmiter = this._eventManager;
|
|
2864
3093
|
this.cleanStart();
|
|
2865
3094
|
this.customPreProcessing();
|
|
@@ -4101,15 +4330,15 @@ class BasicFormComponent extends FormStructureAndData {
|
|
|
4101
4330
|
addTableGetDataFinish(code, callback, properties = null) {
|
|
4102
4331
|
return this.onTableGetDataFinish(code, callback, properties);
|
|
4103
4332
|
}
|
|
4333
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BasicFormComponent, deps: [{ token: LibFormManagerService }, { token: LibEventManagerService }, { token: LibFileManagementService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4334
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: BasicFormComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
4104
4335
|
}
|
|
4105
|
-
|
|
4106
|
-
BasicFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: BasicFormComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
4107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: BasicFormComponent, decorators: [{
|
|
4336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BasicFormComponent, decorators: [{
|
|
4108
4337
|
type: Component,
|
|
4109
4338
|
args: [{
|
|
4110
4339
|
template: `<ng-content></ng-content>`
|
|
4111
4340
|
}]
|
|
4112
|
-
}], ctorParameters:
|
|
4341
|
+
}], ctorParameters: () => [{ type: LibFormManagerService }, { type: LibEventManagerService }, { type: LibFileManagementService }] });
|
|
4113
4342
|
|
|
4114
4343
|
const COMPONENTS = [
|
|
4115
4344
|
BasicFormComponent,
|
|
@@ -4125,35 +4354,35 @@ const COMPONENTS = [
|
|
|
4125
4354
|
LibTableComponent
|
|
4126
4355
|
];
|
|
4127
4356
|
class TuainNgFormsLibModule {
|
|
4357
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TuainNgFormsLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4358
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: TuainNgFormsLibModule, declarations: [BasicFormComponent,
|
|
4359
|
+
ActionComponent,
|
|
4360
|
+
FieldComponent,
|
|
4361
|
+
ElementComponent,
|
|
4362
|
+
FormErrorComponent,
|
|
4363
|
+
FormHeaderComponent,
|
|
4364
|
+
SectionComponent,
|
|
4365
|
+
SubSectionComponent,
|
|
4366
|
+
LibTableRecordActionComponent,
|
|
4367
|
+
LibTableRecordFieldComponent,
|
|
4368
|
+
LibTableComponent], imports: [CommonModule,
|
|
4369
|
+
RouterModule,
|
|
4370
|
+
FormsModule], exports: [BasicFormComponent,
|
|
4371
|
+
ActionComponent,
|
|
4372
|
+
FieldComponent,
|
|
4373
|
+
ElementComponent,
|
|
4374
|
+
FormErrorComponent,
|
|
4375
|
+
FormHeaderComponent,
|
|
4376
|
+
SectionComponent,
|
|
4377
|
+
SubSectionComponent,
|
|
4378
|
+
LibTableRecordActionComponent,
|
|
4379
|
+
LibTableRecordFieldComponent,
|
|
4380
|
+
LibTableComponent] });
|
|
4381
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TuainNgFormsLibModule, imports: [CommonModule,
|
|
4382
|
+
RouterModule,
|
|
4383
|
+
FormsModule] });
|
|
4128
4384
|
}
|
|
4129
|
-
|
|
4130
|
-
TuainNgFormsLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: TuainNgFormsLibModule, declarations: [BasicFormComponent,
|
|
4131
|
-
ActionComponent,
|
|
4132
|
-
FieldComponent,
|
|
4133
|
-
ElementComponent,
|
|
4134
|
-
FormErrorComponent,
|
|
4135
|
-
FormHeaderComponent,
|
|
4136
|
-
SectionComponent,
|
|
4137
|
-
SubSectionComponent,
|
|
4138
|
-
LibTableRecordActionComponent,
|
|
4139
|
-
LibTableRecordFieldComponent,
|
|
4140
|
-
LibTableComponent], imports: [CommonModule,
|
|
4141
|
-
RouterModule,
|
|
4142
|
-
FormsModule], exports: [BasicFormComponent,
|
|
4143
|
-
ActionComponent,
|
|
4144
|
-
FieldComponent,
|
|
4145
|
-
ElementComponent,
|
|
4146
|
-
FormErrorComponent,
|
|
4147
|
-
FormHeaderComponent,
|
|
4148
|
-
SectionComponent,
|
|
4149
|
-
SubSectionComponent,
|
|
4150
|
-
LibTableRecordActionComponent,
|
|
4151
|
-
LibTableRecordFieldComponent,
|
|
4152
|
-
LibTableComponent] });
|
|
4153
|
-
TuainNgFormsLibModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: TuainNgFormsLibModule, imports: [CommonModule,
|
|
4154
|
-
RouterModule,
|
|
4155
|
-
FormsModule] });
|
|
4156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: TuainNgFormsLibModule, decorators: [{
|
|
4385
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TuainNgFormsLibModule, decorators: [{
|
|
4157
4386
|
type: NgModule,
|
|
4158
4387
|
args: [{
|
|
4159
4388
|
declarations: COMPONENTS,
|