tuain-ng-forms-lib 15.1.3 → 15.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/classes/forms/field.mjs +2 -2
- package/esm2020/lib/classes/forms/form.mjs +2 -1
- package/esm2020/lib/classes/forms/piece.mjs +2 -1
- package/esm2020/lib/components/elements/field.component.mjs +6 -4
- package/esm2020/lib/components/elements/layout/section.component.mjs +6 -4
- package/esm2020/lib/components/elements/layout/sub-section.component.mjs +6 -4
- package/esm2020/lib/components/elements/tables/table.component.mjs +6 -4
- package/fesm2015/tuain-ng-forms-lib.mjs +23 -13
- package/fesm2015/tuain-ng-forms-lib.mjs.map +1 -1
- package/fesm2020/tuain-ng-forms-lib.mjs +23 -13
- package/fesm2020/tuain-ng-forms-lib.mjs.map +1 -1
- package/lib/classes/forms/form.d.ts +1 -1
- package/lib/classes/forms/piece.d.ts +1 -1
- package/package.json +1 -1
|
@@ -156,9 +156,11 @@ class FieldComponent extends ElementComponent {
|
|
|
156
156
|
}
|
|
157
157
|
// Subscripción a cambios en atributos
|
|
158
158
|
this.field?.attributeChange.subscribe(event => {
|
|
159
|
-
const { name: componentAttr, value } = event;
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
const { name: componentAttr, value = null } = event ?? {};
|
|
160
|
+
if (componentAttr) {
|
|
161
|
+
this.defaultProcessAttributeChange(componentAttr, value);
|
|
162
|
+
this.customProcessAttributeChange(componentAttr, value);
|
|
163
|
+
}
|
|
162
164
|
});
|
|
163
165
|
if (this.field) {
|
|
164
166
|
this.field.widget = this;
|
|
@@ -260,9 +262,11 @@ class SectionComponent extends PieceComponent {
|
|
|
260
262
|
}
|
|
261
263
|
// Subscripción a cambios en atributos
|
|
262
264
|
this.section?.attributeChange.subscribe(event => {
|
|
263
|
-
const { name: attrName, value } = event;
|
|
264
|
-
|
|
265
|
-
|
|
265
|
+
const { name: attrName, value = null } = event ?? {};
|
|
266
|
+
if (attrName) {
|
|
267
|
+
this.defaultProcessAttributeChange(attrName, value);
|
|
268
|
+
this.customProcessAttributeChange(attrName, value);
|
|
269
|
+
}
|
|
266
270
|
});
|
|
267
271
|
this.start();
|
|
268
272
|
}
|
|
@@ -294,9 +298,11 @@ class SubSectionComponent extends PieceComponent {
|
|
|
294
298
|
}
|
|
295
299
|
// Subscripción a cambios en atributos
|
|
296
300
|
this.subSection?.attributeChange.subscribe(event => {
|
|
297
|
-
const { name: attrName, value } = event;
|
|
298
|
-
|
|
299
|
-
|
|
301
|
+
const { name: attrName, value = null } = event ?? {};
|
|
302
|
+
if (attrName) {
|
|
303
|
+
this.defaultProcessAttributeChange(attrName, value);
|
|
304
|
+
this.customProcessAttributeChange(attrName, value);
|
|
305
|
+
}
|
|
300
306
|
});
|
|
301
307
|
this.start();
|
|
302
308
|
}
|
|
@@ -442,9 +448,11 @@ class LibTableComponent extends ElementComponent {
|
|
|
442
448
|
}
|
|
443
449
|
// Subscripción a cambios en atributos
|
|
444
450
|
this.table?.attributeChange.subscribe(event => {
|
|
445
|
-
const { name: attrName, value } = event;
|
|
446
|
-
|
|
447
|
-
|
|
451
|
+
const { name: attrName, value = null } = event ?? {};
|
|
452
|
+
if (attrName) {
|
|
453
|
+
this.defaultProcessAttributeChange(attrName, value);
|
|
454
|
+
this.customProcessAttributeChange(attrName, value);
|
|
455
|
+
}
|
|
448
456
|
});
|
|
449
457
|
this.start();
|
|
450
458
|
}
|
|
@@ -554,6 +562,7 @@ class FormPiece {
|
|
|
554
562
|
Object.entries(attributes).forEach(([name, value]) => {
|
|
555
563
|
this.setCustomAttribute(name, value);
|
|
556
564
|
});
|
|
565
|
+
return this;
|
|
557
566
|
}
|
|
558
567
|
matchAttribute(name, value) { return this.customAttributes?.[name] === value; }
|
|
559
568
|
setVisibleStates(newStates) {
|
|
@@ -774,7 +783,7 @@ const directChanges = [
|
|
|
774
783
|
'defaultEditable', 'defaultValue', 'alignment', 'required', 'errorCode', 'errorMessage', 'errorType',
|
|
775
784
|
'tooltip', 'info', 'format', 'intrinsicErrorMessage', 'outputOnly', 'captureType', 'title', 'type',
|
|
776
785
|
'maxLength', 'maxValue', 'minLength', 'minValue', 'validateOnServer', 'serverAction', 'visibleLabel',
|
|
777
|
-
'options',
|
|
786
|
+
'options', 'placeholder'
|
|
778
787
|
];
|
|
779
788
|
const attrs$1 = {
|
|
780
789
|
_captureType: { name: '_captureType', propagate: 'captureType' },
|
|
@@ -2299,6 +2308,7 @@ class FormStructureAndData {
|
|
|
2299
2308
|
this.setCustomAttribute(name, value);
|
|
2300
2309
|
});
|
|
2301
2310
|
}
|
|
2311
|
+
return this;
|
|
2302
2312
|
}
|
|
2303
2313
|
// Fields
|
|
2304
2314
|
get fieldNames() { return this.getFieldNames(); }
|