@ng-formworks/core 20.6.7 → 20.6.8

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.
@@ -8901,6 +8901,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
8901
8901
  class TabsComponent {
8902
8902
  constructor() {
8903
8903
  this.jsf = inject(JsonSchemaFormService);
8904
+ this.cdr = inject(ChangeDetectorRef);
8904
8905
  this.selectedItem = 0;
8905
8906
  this.showAddTab = true;
8906
8907
  this.layoutNode = input(undefined, ...(ngDevMode ? [{ debugName: "layoutNode" }] : []));
@@ -8914,6 +8915,12 @@ class TabsComponent {
8914
8915
  }
8915
8916
  this.itemCount = this.layoutNode().items.length - 1;
8916
8917
  this.updateControl();
8918
+ //TODO review/test-introduced to fix dynamic titles not updating
8919
+ //when their conditional linked field is destroyed
8920
+ //-forces change detection!
8921
+ this.jsf.dataChanges.subscribe((val) => {
8922
+ this.cdr.detectChanges();
8923
+ });
8917
8924
  }
8918
8925
  select(index) {
8919
8926
  const layoutNode = this.layoutNode();
@@ -8938,6 +8945,9 @@ class TabsComponent {
8938
8945
  setTabTitle(item, index) {
8939
8946
  return this.jsf.setArrayItemTitle(this, item, index);
8940
8947
  }
8948
+ ngOnDestroy() {
8949
+ this.dataChangesSubs?.unsubscribe();
8950
+ }
8941
8951
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8942
8952
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: TabsComponent, isStandalone: false, selector: "tabs-widget", inputs: { layoutNode: { classPropertyName: "layoutNode", publicName: "layoutNode", isSignal: true, isRequired: false, transformFunction: null }, layoutIndex: { classPropertyName: "layoutIndex", publicName: "layoutIndex", isSignal: true, isRequired: false, transformFunction: null }, dataIndex: { classPropertyName: "dataIndex", publicName: "dataIndex", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
8943
8953
  <ul
@@ -8961,6 +8971,7 @@ class TabsComponent {
8961
8971
  />
8962
8972
  {{setTabTitle(item, i)}}
8963
8973
  </a>
8974
+
8964
8975
  </li>
8965
8976
  </ul>
8966
8977
 
@@ -9015,6 +9026,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
9015
9026
  />
9016
9027
  {{setTabTitle(item, i)}}
9017
9028
  </a>
9029
+
9018
9030
  </li>
9019
9031
  </ul>
9020
9032
 
@@ -9309,6 +9321,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
9309
9321
  class RootComponent {
9310
9322
  constructor() {
9311
9323
  this.jsf = inject(JsonSchemaFormService);
9324
+ this.cdr = inject(ChangeDetectorRef);
9312
9325
  this.dataIndex = input(undefined, ...(ngDevMode ? [{ debugName: "dataIndex" }] : []));
9313
9326
  this.layoutIndex = input(undefined, ...(ngDevMode ? [{ debugName: "layoutIndex" }] : []));
9314
9327
  this.layout = input(undefined, ...(ngDevMode ? [{ debugName: "layout" }] : []));
@@ -9431,6 +9444,7 @@ class RootComponent {
9431
9444
  if (changes['layout'] || changes['dataIndex'] || changes['layoutIndex']) {
9432
9445
  // Clear the entire cache of the memoized function
9433
9446
  this._getSelectFrameworkInputsMemoized.cache.clear();
9447
+ this.cdr.markForCheck();
9434
9448
  }
9435
9449
  }
9436
9450
  showWidget(layoutNode) {
@@ -9441,6 +9455,10 @@ class RootComponent {
9441
9455
  this.jsf.dataChanges.subscribe((val) => {
9442
9456
  //this.selectframeworkInputCache?.clear();
9443
9457
  this._getSelectFrameworkInputsMemoized.cache.clear();
9458
+ //TODO-fix for now changed to detectChanges-
9459
+ //used to updated the dynamic titles in tab compnents
9460
+ this.cdr.markForCheck();
9461
+ // this.cdr.detectChanges();-breaks oneOf/ matdatepicker
9444
9462
  });
9445
9463
  }
9446
9464
  }