@smartbit4all/ng-client 3.3.130 → 3.3.132

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.
@@ -9819,12 +9819,18 @@ class ExpandableSectionComponent {
9819
9819
  ['sectionIndex', this.index],
9820
9820
  ]));
9821
9821
  }
9822
- this.componentRef = this.cfService.createComponent(this.vcRef, this.data.customComponent, new Map([
9823
- [this.data.inputName ?? '', this.data.data],
9822
+ let inputs = new Map([
9824
9823
  ['stateChange', this.stateChange],
9825
9824
  ['index', this.data.index],
9826
9825
  ['sectionIndex', this.index],
9827
- ]));
9826
+ ]);
9827
+ if (this.data.inputName) {
9828
+ inputs.set(this.data.inputName, this.data.data);
9829
+ }
9830
+ if (this.data.inputs) {
9831
+ this.data.inputs.forEach((v, k) => inputs.set(k, v));
9832
+ }
9833
+ this.componentRef = this.cfService.createComponent(this.vcRef, this.data.customComponent, inputs);
9828
9834
  }
9829
9835
  action(button, event) {
9830
9836
  event.stopPropagation();
@@ -12932,27 +12938,25 @@ class SmartComponentLayoutComponent {
12932
12938
  .subscribe((list) => {
12933
12939
  this.setToolbarComponent(list.first);
12934
12940
  });
12935
- if (this.smartComponentLayout) {
12936
- this.setUp();
12937
- }
12941
+ this.setUp();
12938
12942
  }
12939
12943
  ngOnDestroy() {
12940
12944
  this._destroy$.next();
12941
12945
  this._destroy$.complete();
12942
12946
  }
12943
12947
  ngOnChanges(changes) {
12948
+ this.setUp();
12949
+ }
12950
+ setUp() {
12951
+ if (!this.parentSmartComponent || !this.smartComponentLayout) {
12952
+ return;
12953
+ }
12944
12954
  if (deepEqual(this.smartComponentLayout, this.currentLayout)) {
12945
12955
  // no layout change, keep current state
12956
+ return;
12946
12957
  }
12947
- else {
12948
- // layout changed, render
12949
- this.currentLayout = JSON.parse(JSON.stringify(this.smartComponentLayout));
12950
- if (this.smartComponentLayout) {
12951
- this.setUp();
12952
- }
12953
- }
12954
- }
12955
- setUp() {
12958
+ // layout changed, render, but save current
12959
+ this.currentLayout = JSON.parse(JSON.stringify(this.smartComponentLayout));
12956
12960
  this.uuid = this.parentSmartComponent.uuid;
12957
12961
  this.treeService = this.parentSmartComponent.smartTreeService;
12958
12962
  this.smartComponentLayout?.direction;
@@ -12990,8 +12994,11 @@ class SmartComponentLayoutComponent {
12990
12994
  data.expandable = false;
12991
12995
  this.expandableSection = {
12992
12996
  title: this.smartComponentLayout?.expandableSectionLabel ?? '',
12993
- data,
12994
- inputName: 'smartComponentLayout',
12997
+ inputs: new Map([
12998
+ ['smartComponentLayout', data],
12999
+ ['parentSmartComponent', this.parentSmartComponent],
13000
+ ['parentLayoutComponent', this.parentLayoutComponent],
13001
+ ]),
12995
13002
  customComponent: SmartComponentLayoutComponent,
12996
13003
  };
12997
13004
  }