@smartbit4all/ng-client 3.3.125 → 3.3.127

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.
@@ -12894,6 +12894,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12894
12894
  * Public API Surface of smart-grid
12895
12895
  */
12896
12896
 
12897
+ class SmartComponentLayoutUtility {
12898
+ static setParent(layout, parent) {
12899
+ layout.parentComponent = parent;
12900
+ layout.components?.forEach((l) => this.setParent(l, parent));
12901
+ }
12902
+ static equals(layout1, layout2) {
12903
+ if ((layout1 && !layout2) || (layout2 && !layout1)) {
12904
+ return false;
12905
+ }
12906
+ if (!layout1 && !layout2) {
12907
+ return true;
12908
+ }
12909
+ // both layout1 and layout2 exists
12910
+ let l1 = JSON.parse(JSON.stringify(layout1));
12911
+ this.setParent(l1, null);
12912
+ let l2 = JSON.parse(JSON.stringify(layout2));
12913
+ this.setParent(l2, null);
12914
+ return deepEqual(l1, l2);
12915
+ }
12916
+ static getForms(comp) {
12917
+ let result = [];
12918
+ if (comp.components) {
12919
+ const children = comp.components
12920
+ .map((c) => this.getForms(c))
12921
+ .reduce((acc, value) => acc.concat(value), []);
12922
+ result.push(...children);
12923
+ }
12924
+ const expandable = this.getExpandableComponent(comp);
12925
+ if (expandable) {
12926
+ result.push(...this.getForms(expandable));
12927
+ }
12928
+ if (comp.smartFormComponent) {
12929
+ result.push(comp.smartFormComponent);
12930
+ }
12931
+ return result;
12932
+ }
12933
+ static getGrids(comp) {
12934
+ let result = [];
12935
+ if (comp.components) {
12936
+ const children = comp.components
12937
+ .map((c) => this.getGrids(c))
12938
+ .reduce((acc, value) => acc.concat(value), []);
12939
+ result.push(...children);
12940
+ }
12941
+ const expandable = this.getExpandableComponent(comp);
12942
+ if (expandable) {
12943
+ result.push(...this.getGrids(expandable));
12944
+ }
12945
+ if (comp.smartGridComponent) {
12946
+ result.push(comp.smartGridComponent);
12947
+ }
12948
+ return result;
12949
+ }
12950
+ static getTrees(comp) {
12951
+ let result = [];
12952
+ if (comp.components) {
12953
+ const children = comp.components
12954
+ ?.map((c) => this.getTrees(c))
12955
+ .reduce((acc, value) => acc.concat(value), []);
12956
+ result.push(...children);
12957
+ }
12958
+ const expandable = this.getExpandableComponent(comp);
12959
+ if (expandable) {
12960
+ result.push(...this.getTrees(expandable));
12961
+ }
12962
+ if (comp.treeService) {
12963
+ result.push(comp.treeService);
12964
+ }
12965
+ return result;
12966
+ }
12967
+ static getToolbars(comp) {
12968
+ let result = [];
12969
+ if (comp.components) {
12970
+ const children = comp.components
12971
+ .map((c) => this.getToolbars(c))
12972
+ .reduce((acc, value) => acc.concat(value), []);
12973
+ result.push(...children);
12974
+ }
12975
+ const expandable = this.getExpandableComponent(comp);
12976
+ if (expandable) {
12977
+ result.push(...this.getToolbars(expandable));
12978
+ }
12979
+ if (comp.toolbar) {
12980
+ result.push(comp.toolbar);
12981
+ }
12982
+ return result;
12983
+ }
12984
+ static getExpandableComponent(comp) {
12985
+ return comp.expandableComponents?.first?.componentRef?.instance;
12986
+ }
12987
+ }
12988
+
12897
12989
  class SmartComponentLayoutComponent {
12898
12990
  constructor(layoutService) {
12899
12991
  this.layoutService = layoutService;
@@ -12941,7 +13033,12 @@ class SmartComponentLayoutComponent {
12941
13033
  this._destroy$.complete();
12942
13034
  }
12943
13035
  ngOnChanges(changes) {
12944
- this.smartComponentLayout = changes['smartComponentLayout'].currentValue;
13036
+ let newLayout = changes['smartComponentLayout'].currentValue;
13037
+ if (SmartComponentLayoutUtility.equals(this.smartComponentLayout, newLayout)) {
13038
+ // no change in layout, don't setup again
13039
+ return;
13040
+ }
13041
+ this.smartComponentLayout = newLayout;
12945
13042
  if (this.smartComponentLayout) {
12946
13043
  this.setUp();
12947
13044
  }
@@ -14451,84 +14548,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
14451
14548
  * Public API Surface of smarttree
14452
14549
  */
14453
14550
 
14454
- class SmartComponentLayoutUtility {
14455
- static setParent(layout, parent) {
14456
- layout.parentComponent = parent;
14457
- layout.components?.forEach((l) => this.setParent(l, parent));
14458
- }
14459
- static getForms(comp) {
14460
- let result = [];
14461
- if (comp.components) {
14462
- const children = comp.components
14463
- .map((c) => this.getForms(c))
14464
- .reduce((acc, value) => acc.concat(value), []);
14465
- result.push(...children);
14466
- }
14467
- const expandable = this.getExpandableComponent(comp);
14468
- if (expandable) {
14469
- result.push(...this.getForms(expandable));
14470
- }
14471
- if (comp.smartFormComponent) {
14472
- result.push(comp.smartFormComponent);
14473
- }
14474
- return result;
14475
- }
14476
- static getGrids(comp) {
14477
- let result = [];
14478
- if (comp.components) {
14479
- const children = comp.components
14480
- .map((c) => this.getGrids(c))
14481
- .reduce((acc, value) => acc.concat(value), []);
14482
- result.push(...children);
14483
- }
14484
- const expandable = this.getExpandableComponent(comp);
14485
- if (expandable) {
14486
- result.push(...this.getGrids(expandable));
14487
- }
14488
- if (comp.smartGridComponent) {
14489
- result.push(comp.smartGridComponent);
14490
- }
14491
- return result;
14492
- }
14493
- static getTrees(comp) {
14494
- let result = [];
14495
- if (comp.components) {
14496
- const children = comp.components
14497
- ?.map((c) => this.getTrees(c))
14498
- .reduce((acc, value) => acc.concat(value), []);
14499
- result.push(...children);
14500
- }
14501
- const expandable = this.getExpandableComponent(comp);
14502
- if (expandable) {
14503
- result.push(...this.getTrees(expandable));
14504
- }
14505
- if (comp.treeService) {
14506
- result.push(comp.treeService);
14507
- }
14508
- return result;
14509
- }
14510
- static getToolbars(comp) {
14511
- let result = [];
14512
- if (comp.components) {
14513
- const children = comp.components
14514
- .map((c) => this.getToolbars(c))
14515
- .reduce((acc, value) => acc.concat(value), []);
14516
- result.push(...children);
14517
- }
14518
- const expandable = this.getExpandableComponent(comp);
14519
- if (expandable) {
14520
- result.push(...this.getToolbars(expandable));
14521
- }
14522
- if (comp.toolbar) {
14523
- result.push(comp.toolbar);
14524
- }
14525
- return result;
14526
- }
14527
- static getExpandableComponent(comp) {
14528
- return comp.expandableComponents?.first?.componentRef?.instance;
14529
- }
14530
- }
14531
-
14532
14551
  /*
14533
14552
  * Public API Surface of smart-component-layout
14534
14553
  */