@smartbit4all/ng-client 3.3.128 → 3.3.129

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,101 +12894,6 @@ 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 parent1 = layout1.parentComponent;
12911
- let parent2 = layout1.parentComponent;
12912
- this.setParent(layout1, null);
12913
- this.setParent(layout2, null);
12914
- const result = deepEqual(layout1, layout2);
12915
- this.setParent(layout1, parent1);
12916
- this.setParent(layout2, parent2);
12917
- return result;
12918
- }
12919
- static getForms(comp) {
12920
- let result = [];
12921
- if (comp.components) {
12922
- const children = comp.components
12923
- .map((c) => this.getForms(c))
12924
- .reduce((acc, value) => acc.concat(value), []);
12925
- result.push(...children);
12926
- }
12927
- const expandable = this.getExpandableComponent(comp);
12928
- if (expandable) {
12929
- result.push(...this.getForms(expandable));
12930
- }
12931
- if (comp.smartFormComponent) {
12932
- result.push(comp.smartFormComponent);
12933
- }
12934
- return result;
12935
- }
12936
- static getGrids(comp) {
12937
- let result = [];
12938
- if (comp.components) {
12939
- const children = comp.components
12940
- .map((c) => this.getGrids(c))
12941
- .reduce((acc, value) => acc.concat(value), []);
12942
- result.push(...children);
12943
- }
12944
- const expandable = this.getExpandableComponent(comp);
12945
- if (expandable) {
12946
- result.push(...this.getGrids(expandable));
12947
- }
12948
- if (comp.smartGridComponent) {
12949
- result.push(comp.smartGridComponent);
12950
- }
12951
- return result;
12952
- }
12953
- static getTrees(comp) {
12954
- let result = [];
12955
- if (comp.components) {
12956
- const children = comp.components
12957
- ?.map((c) => this.getTrees(c))
12958
- .reduce((acc, value) => acc.concat(value), []);
12959
- result.push(...children);
12960
- }
12961
- const expandable = this.getExpandableComponent(comp);
12962
- if (expandable) {
12963
- result.push(...this.getTrees(expandable));
12964
- }
12965
- if (comp.treeService) {
12966
- result.push(comp.treeService);
12967
- }
12968
- return result;
12969
- }
12970
- static getToolbars(comp) {
12971
- let result = [];
12972
- if (comp.components) {
12973
- const children = comp.components
12974
- .map((c) => this.getToolbars(c))
12975
- .reduce((acc, value) => acc.concat(value), []);
12976
- result.push(...children);
12977
- }
12978
- const expandable = this.getExpandableComponent(comp);
12979
- if (expandable) {
12980
- result.push(...this.getToolbars(expandable));
12981
- }
12982
- if (comp.toolbar) {
12983
- result.push(comp.toolbar);
12984
- }
12985
- return result;
12986
- }
12987
- static getExpandableComponent(comp) {
12988
- return comp.expandableComponents?.first?.componentRef?.instance;
12989
- }
12990
- }
12991
-
12992
12897
  class SmartComponentLayoutComponent {
12993
12898
  constructor(layoutService) {
12994
12899
  this.layoutService = layoutService;
@@ -13036,12 +12941,7 @@ class SmartComponentLayoutComponent {
13036
12941
  this._destroy$.complete();
13037
12942
  }
13038
12943
  ngOnChanges(changes) {
13039
- let newLayout = changes['smartComponentLayout'].currentValue;
13040
- if (SmartComponentLayoutUtility.equals(this.smartComponentLayout, newLayout)) {
13041
- // no change in layout, don't setup again
13042
- return;
13043
- }
13044
- this.smartComponentLayout = newLayout;
12944
+ this.smartComponentLayout = changes['smartComponentLayout'].currentValue;
13045
12945
  if (this.smartComponentLayout) {
13046
12946
  this.setUp();
13047
12947
  }
@@ -13071,7 +12971,9 @@ class SmartComponentLayoutComponent {
13071
12971
  else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TOOLBAR) {
13072
12972
  this.constructToolbar();
13073
12973
  }
13074
- this.parent.initActions();
12974
+ if (!this.parentLayoutComponent) {
12975
+ this.parent.initActions();
12976
+ }
13075
12977
  }
13076
12978
  }
13077
12979
  type() {
@@ -13193,12 +13095,14 @@ class SmartComponentLayoutComponent {
13193
13095
  }
13194
13096
  }
13195
13097
  SmartComponentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
13196
- SmartComponentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout" }, viewQueries: [{ propertyName: "smartFormList", predicate: ["form"], descendants: true }, { propertyName: "smartGridList", predicate: ["grid"], descendants: true }, { propertyName: "smartFilterList", predicate: ["filter"], descendants: true }, { propertyName: "toolbarList", predicate: ["toolbar"], descendants: true }, { propertyName: "expandableComponents", predicate: ExpandableSectionComponent, descendants: true }, { propertyName: "components", predicate: SmartComponentLayoutComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n <div\r\n *ngIf=\"smartComponentLayout?.type === type().CONTAINER\"\r\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\r\n >\r\n <smart-component-layout\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n <smart-ui-action-toolbar *ngIf=\"!!toolbarId\" #toolbar [id]=\"toolbarId\"></smart-ui-action-toolbar>\r\n</ng-template>\r\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"], components: [{ type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout"] }, { type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { type: SmartGridComponent, selector: "smart-grid", inputs: ["smartGrid", "uuid", "dev"] }, { type: SmartTreeComponent, selector: "smart-tree", inputs: ["treeStyle", "treeService"] }, { type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13098
+ SmartComponentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout", parentLayoutComponent: "parentLayoutComponent" }, viewQueries: [{ propertyName: "smartFormList", predicate: ["form"], descendants: true }, { propertyName: "smartGridList", predicate: ["grid"], descendants: true }, { propertyName: "smartFilterList", predicate: ["filter"], descendants: true }, { propertyName: "toolbarList", predicate: ["toolbar"], descendants: true }, { propertyName: "expandableComponents", predicate: ExpandableSectionComponent, descendants: true }, { propertyName: "components", predicate: SmartComponentLayoutComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n <div\r\n *ngIf=\"smartComponentLayout?.type === type().CONTAINER\"\r\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\r\n >\r\n <smart-component-layout\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n [parentLayoutComponent]=\"this\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n <smart-ui-action-toolbar *ngIf=\"!!toolbarId\" #toolbar [id]=\"toolbarId\"></smart-ui-action-toolbar>\r\n</ng-template>\r\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"], components: [{ type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }, { type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: ["smartComponentLayout", "parentLayoutComponent"] }, { type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { type: SmartGridComponent, selector: "smart-grid", inputs: ["smartGrid", "uuid", "dev"] }, { type: SmartTreeComponent, selector: "smart-tree", inputs: ["treeStyle", "treeService"] }, { type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService", "id"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13197
13099
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
13198
13100
  type: Component,
13199
- args: [{ selector: 'smart-component-layout', template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n <div\r\n *ngIf=\"smartComponentLayout?.type === type().CONTAINER\"\r\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\r\n >\r\n <smart-component-layout\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n <smart-ui-action-toolbar *ngIf=\"!!toolbarId\" #toolbar [id]=\"toolbarId\"></smart-ui-action-toolbar>\r\n</ng-template>\r\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"] }]
13101
+ args: [{ selector: 'smart-component-layout', template: "<div *ngIf=\"smartComponentLayout?.expandable; then expandable; else normal\"> </div>\r\n\r\n<ng-template #expandable>\r\n <smart-expandable-section\r\n *ngIf=\"expandableSection\"\r\n [data]=\"expandableSection\"\r\n ></smart-expandable-section>\r\n</ng-template>\r\n\r\n<ng-template #normal>\r\n <div\r\n *ngIf=\"smartComponentLayout?.type === type().CONTAINER\"\r\n [ngClass]=\"smartComponentLayout?.direction ?? 'vertical'\"\r\n >\r\n <smart-component-layout\r\n *ngFor=\"let layout of smartComponentLayout?.components\"\r\n [parentLayoutComponent]=\"this\"\r\n [smartComponentLayout]=\"layout\"\r\n ></smart-component-layout>\r\n </div>\r\n <smartform *ngIf=\"smartForm\" #form [smartForm]=\"smartForm\"></smartform>\r\n <smart-grid *ngIf=\"smartGrid\" #grid [smartGrid]=\"smartGrid\" [uuid]=\"uuid!\"></smart-grid>\r\n <!-- <smart-filter #filter [filter]=\"smartFilter\"></smart-filter> -->\r\n <smart-tree *ngIf=\"treeService\" [treeService]=\"treeService!\"></smart-tree>\r\n <smart-ui-action-toolbar *ngIf=\"!!toolbarId\" #toolbar [id]=\"toolbarId\"></smart-ui-action-toolbar>\r\n</ng-template>\r\n", styles: [".horizontal{display:flex;flex-direction:row}.vertical{display:flex;flex-direction:column}\n"] }]
13200
13102
  }], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { smartComponentLayout: [{
13201
13103
  type: Input
13104
+ }], parentLayoutComponent: [{
13105
+ type: Input
13202
13106
  }], smartFormList: [{
13203
13107
  type: ViewChildren,
13204
13108
  args: ['form']
@@ -14551,6 +14455,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
14551
14455
  * Public API Surface of smarttree
14552
14456
  */
14553
14457
 
14458
+ class SmartComponentLayoutUtility {
14459
+ static setParent(layout, parent) {
14460
+ layout.parentComponent = parent;
14461
+ layout.components?.forEach((l) => this.setParent(l, parent));
14462
+ }
14463
+ static compare(layout1, layout2) {
14464
+ let l1 = { ...layout1 };
14465
+ this.setParent(l1, null);
14466
+ let l2 = { ...layout2 };
14467
+ this.setParent(l2, null);
14468
+ return deepEqual(l1, l2);
14469
+ }
14470
+ static getForms(comp) {
14471
+ let result = [];
14472
+ if (comp.components) {
14473
+ const children = comp.components
14474
+ .map((c) => this.getForms(c))
14475
+ .reduce((acc, value) => acc.concat(value), []);
14476
+ result.push(...children);
14477
+ }
14478
+ const expandable = this.getExpandableComponent(comp);
14479
+ if (expandable) {
14480
+ result.push(...this.getForms(expandable));
14481
+ }
14482
+ if (comp.smartFormComponent) {
14483
+ result.push(comp.smartFormComponent);
14484
+ }
14485
+ return result;
14486
+ }
14487
+ static getGrids(comp) {
14488
+ let result = [];
14489
+ if (comp.components) {
14490
+ const children = comp.components
14491
+ .map((c) => this.getGrids(c))
14492
+ .reduce((acc, value) => acc.concat(value), []);
14493
+ result.push(...children);
14494
+ }
14495
+ const expandable = this.getExpandableComponent(comp);
14496
+ if (expandable) {
14497
+ result.push(...this.getGrids(expandable));
14498
+ }
14499
+ if (comp.smartGridComponent) {
14500
+ result.push(comp.smartGridComponent);
14501
+ }
14502
+ return result;
14503
+ }
14504
+ static getTrees(comp) {
14505
+ let result = [];
14506
+ if (comp.components) {
14507
+ const children = comp.components
14508
+ ?.map((c) => this.getTrees(c))
14509
+ .reduce((acc, value) => acc.concat(value), []);
14510
+ result.push(...children);
14511
+ }
14512
+ const expandable = this.getExpandableComponent(comp);
14513
+ if (expandable) {
14514
+ result.push(...this.getTrees(expandable));
14515
+ }
14516
+ if (comp.treeService) {
14517
+ result.push(comp.treeService);
14518
+ }
14519
+ return result;
14520
+ }
14521
+ static getToolbars(comp) {
14522
+ let result = [];
14523
+ if (comp.components) {
14524
+ const children = comp.components
14525
+ .map((c) => this.getToolbars(c))
14526
+ .reduce((acc, value) => acc.concat(value), []);
14527
+ result.push(...children);
14528
+ }
14529
+ const expandable = this.getExpandableComponent(comp);
14530
+ if (expandable) {
14531
+ result.push(...this.getToolbars(expandable));
14532
+ }
14533
+ if (comp.toolbar) {
14534
+ result.push(comp.toolbar);
14535
+ }
14536
+ return result;
14537
+ }
14538
+ static getExpandableComponent(comp) {
14539
+ return comp.expandableComponents?.first?.componentRef?.instance;
14540
+ }
14541
+ }
14542
+
14554
14543
  /*
14555
14544
  * Public API Surface of smart-component-layout
14556
14545
  */