tuain-ng-forms-lib 15.1.7 → 15.1.9

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.
@@ -156,11 +156,13 @@ class FieldComponent extends ElementComponent {
156
156
  }
157
157
  // Subscripción a cambios en atributos
158
158
  this.field?.attributeChange.subscribe(event => {
159
+ console.log('FieldComponent attributeChange');
160
+ console.log(event);
159
161
  const { name: componentAttr, value = null } = event ?? {};
160
- if (componentAttr) {
161
- this.defaultProcessAttributeChange(componentAttr, value);
162
- this.customProcessAttributeChange(componentAttr, value);
163
- }
162
+ // if (componentAttr) {
163
+ this.defaultProcessAttributeChange(componentAttr, value);
164
+ this.customProcessAttributeChange(componentAttr, value);
165
+ // }
164
166
  });
165
167
  if (this.field) {
166
168
  this.field.widget = this;
@@ -262,11 +264,13 @@ class SectionComponent extends PieceComponent {
262
264
  }
263
265
  // Subscripción a cambios en atributos
264
266
  this.section?.attributeChange.subscribe(event => {
267
+ console.log('SectionComponent attributeChange');
268
+ console.log(event);
265
269
  const { name: attrName, value = null } = event ?? {};
266
- if (attrName) {
267
- this.defaultProcessAttributeChange(attrName, value);
268
- this.customProcessAttributeChange(attrName, value);
269
- }
270
+ // if (attrName) {
271
+ this.defaultProcessAttributeChange(attrName, value);
272
+ this.customProcessAttributeChange(attrName, value);
273
+ // }
270
274
  });
271
275
  this.start();
272
276
  }
@@ -298,11 +302,13 @@ class SubSectionComponent extends PieceComponent {
298
302
  }
299
303
  // Subscripción a cambios en atributos
300
304
  this.subSection?.attributeChange.subscribe(event => {
305
+ console.log('SubSectionComponent attributeChange');
306
+ console.log(event);
301
307
  const { name: attrName, value = null } = event ?? {};
302
- if (attrName) {
303
- this.defaultProcessAttributeChange(attrName, value);
304
- this.customProcessAttributeChange(attrName, value);
305
- }
308
+ // if (attrName) {
309
+ this.defaultProcessAttributeChange(attrName, value);
310
+ this.customProcessAttributeChange(attrName, value);
311
+ // }
306
312
  });
307
313
  this.start();
308
314
  }
@@ -448,11 +454,13 @@ class LibTableComponent extends ElementComponent {
448
454
  }
449
455
  // Subscripción a cambios en atributos
450
456
  this.table?.attributeChange.subscribe(event => {
457
+ console.log('LibTableComponent attributeChange');
458
+ console.log(event);
451
459
  const { name: attrName, value = null } = event ?? {};
452
- if (attrName) {
453
- this.defaultProcessAttributeChange(attrName, value);
454
- this.customProcessAttributeChange(attrName, value);
455
- }
460
+ // if (attrName) {
461
+ this.defaultProcessAttributeChange(attrName, value);
462
+ this.customProcessAttributeChange(attrName, value);
463
+ // }
456
464
  });
457
465
  this.start();
458
466
  }
@@ -662,27 +670,33 @@ class FormPiecePropagate extends FormPiece {
662
670
  }
663
671
  get attributeChange() { return this._attributeChange; }
664
672
  propagateAttribute(name, value) {
673
+ console.log(`Propagación ${name} : ${JSON.stringify(value)}`);
665
674
  this._attributeChange?.next({ name, value });
666
675
  }
667
676
  setCustomAttribute(name, value) {
668
677
  super.setCustomAttribute(name, value);
669
678
  if (this.propagationCustomAttributes?.includes(name)) {
670
679
  const fullName = `customAttributes.${name}`;
680
+ console.log('piece setCustomAttribute');
671
681
  this.propagateAttribute(fullName, value);
672
682
  }
673
683
  }
674
684
  setVisibility(visible, forced = null) {
675
685
  super.setVisibility(visible, forced);
686
+ console.log('piece setVisibility');
676
687
  this.propagateAttribute(VISIBLE, this._visible);
677
688
  }
678
689
  set enabled(enabled) {
679
690
  super.enabled = enabled;
691
+ console.log('piece enabled');
680
692
  this.propagateAttribute(DISABLED, this._disabled);
681
693
  }
682
694
  formStateChange(state) {
683
695
  super.formStateChange(state);
684
696
  if (state) {
697
+ console.log('piece 1 formStateChange');
685
698
  this.propagateAttribute(VISIBLE, this._visible);
699
+ console.log('piece 2 formStateChange');
686
700
  this.propagateAttribute(DISABLED, this._disabled);
687
701
  }
688
702
  }
@@ -697,6 +711,8 @@ class FormElement extends FormPiecePropagate {
697
711
  setAttr(attr, value) {
698
712
  const { name: attrName, propagate: name } = attr;
699
713
  this[attrName] = value;
714
+ console.log(`Element setAttr name: ${name}`);
715
+ console.log(value);
700
716
  name && this.propagateAttribute(name, value);
701
717
  }
702
718
  isField() { return this.elementType === elementTypes.field; }