@smartbit4all/ng-client 3.3.125 → 3.3.126

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.
@@ -70,6 +70,7 @@ import { MatPaginatorModule } from '@angular/material/paginator';
70
70
  import { FlatTreeControl, NestedTreeControl } from '@angular/cdk/tree';
71
71
  import * as i10 from '@angular/material/tree';
72
72
  import { MatTreeFlattener, MatTreeFlatDataSource, MatTreeModule, MatTreeNestedDataSource } from '@angular/material/tree';
73
+ import structuredClone from '@ungap/structured-clone';
73
74
  import * as i1$5 from '@angular/material/toolbar';
74
75
  import { MatToolbarModule } from '@angular/material/toolbar';
75
76
  import { MatBadgeModule } from '@angular/material/badge';
@@ -12894,6 +12895,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12894
12895
  * Public API Surface of smart-grid
12895
12896
  */
12896
12897
 
12898
+ class SmartComponentLayoutUtility {
12899
+ static setParent(layout, parent) {
12900
+ layout.parentComponent = parent;
12901
+ layout.components?.forEach((l) => this.setParent(l, parent));
12902
+ }
12903
+ static equals(layout1, layout2) {
12904
+ if ((layout1 && !layout2) || (layout2 && !layout1)) {
12905
+ return false;
12906
+ }
12907
+ if (!layout1 && !layout2) {
12908
+ return true;
12909
+ }
12910
+ // both layout1 and layout2 exists
12911
+ let l1 = structuredClone(layout1);
12912
+ this.setParent(l1, null);
12913
+ let l2 = structuredClone(layout1);
12914
+ this.setParent(l2, null);
12915
+ return deepEqual(l1, l2);
12916
+ }
12917
+ static getForms(comp) {
12918
+ let result = [];
12919
+ if (comp.components) {
12920
+ const children = comp.components
12921
+ .map((c) => this.getForms(c))
12922
+ .reduce((acc, value) => acc.concat(value), []);
12923
+ result.push(...children);
12924
+ }
12925
+ const expandable = this.getExpandableComponent(comp);
12926
+ if (expandable) {
12927
+ result.push(...this.getForms(expandable));
12928
+ }
12929
+ if (comp.smartFormComponent) {
12930
+ result.push(comp.smartFormComponent);
12931
+ }
12932
+ return result;
12933
+ }
12934
+ static getGrids(comp) {
12935
+ let result = [];
12936
+ if (comp.components) {
12937
+ const children = comp.components
12938
+ .map((c) => this.getGrids(c))
12939
+ .reduce((acc, value) => acc.concat(value), []);
12940
+ result.push(...children);
12941
+ }
12942
+ const expandable = this.getExpandableComponent(comp);
12943
+ if (expandable) {
12944
+ result.push(...this.getGrids(expandable));
12945
+ }
12946
+ if (comp.smartGridComponent) {
12947
+ result.push(comp.smartGridComponent);
12948
+ }
12949
+ return result;
12950
+ }
12951
+ static getTrees(comp) {
12952
+ let result = [];
12953
+ if (comp.components) {
12954
+ const children = comp.components
12955
+ ?.map((c) => this.getTrees(c))
12956
+ .reduce((acc, value) => acc.concat(value), []);
12957
+ result.push(...children);
12958
+ }
12959
+ const expandable = this.getExpandableComponent(comp);
12960
+ if (expandable) {
12961
+ result.push(...this.getTrees(expandable));
12962
+ }
12963
+ if (comp.treeService) {
12964
+ result.push(comp.treeService);
12965
+ }
12966
+ return result;
12967
+ }
12968
+ static getToolbars(comp) {
12969
+ let result = [];
12970
+ if (comp.components) {
12971
+ const children = comp.components
12972
+ .map((c) => this.getToolbars(c))
12973
+ .reduce((acc, value) => acc.concat(value), []);
12974
+ result.push(...children);
12975
+ }
12976
+ const expandable = this.getExpandableComponent(comp);
12977
+ if (expandable) {
12978
+ result.push(...this.getToolbars(expandable));
12979
+ }
12980
+ if (comp.toolbar) {
12981
+ result.push(comp.toolbar);
12982
+ }
12983
+ return result;
12984
+ }
12985
+ static getExpandableComponent(comp) {
12986
+ return comp.expandableComponents?.first?.componentRef?.instance;
12987
+ }
12988
+ }
12989
+
12897
12990
  class SmartComponentLayoutComponent {
12898
12991
  constructor(layoutService) {
12899
12992
  this.layoutService = layoutService;
@@ -12941,7 +13034,12 @@ class SmartComponentLayoutComponent {
12941
13034
  this._destroy$.complete();
12942
13035
  }
12943
13036
  ngOnChanges(changes) {
12944
- this.smartComponentLayout = changes['smartComponentLayout'].currentValue;
13037
+ let newLayout = changes['smartComponentLayout'].currentValue;
13038
+ if (SmartComponentLayoutUtility.equals(this.smartComponentLayout, newLayout)) {
13039
+ // no change in layout, don't setup again
13040
+ return;
13041
+ }
13042
+ this.smartComponentLayout = newLayout;
12945
13043
  if (this.smartComponentLayout) {
12946
13044
  this.setUp();
12947
13045
  }
@@ -14451,84 +14549,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
14451
14549
  * Public API Surface of smarttree
14452
14550
  */
14453
14551
 
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
14552
  /*
14533
14553
  * Public API Surface of smart-component-layout
14534
14554
  */