@smartbit4all/ng-client 3.3.127 → 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,98 +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 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
-
12989
12897
  class SmartComponentLayoutComponent {
12990
12898
  constructor(layoutService) {
12991
12899
  this.layoutService = layoutService;
@@ -13033,12 +12941,7 @@ class SmartComponentLayoutComponent {
13033
12941
  this._destroy$.complete();
13034
12942
  }
13035
12943
  ngOnChanges(changes) {
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;
12944
+ this.smartComponentLayout = changes['smartComponentLayout'].currentValue;
13042
12945
  if (this.smartComponentLayout) {
13043
12946
  this.setUp();
13044
12947
  }
@@ -13068,7 +12971,9 @@ class SmartComponentLayoutComponent {
13068
12971
  else if (this.smartComponentLayout.widget?.type === ComponentWidgetType.TOOLBAR) {
13069
12972
  this.constructToolbar();
13070
12973
  }
13071
- this.parent.initActions();
12974
+ if (!this.parentLayoutComponent) {
12975
+ this.parent.initActions();
12976
+ }
13072
12977
  }
13073
12978
  }
13074
12979
  type() {
@@ -13190,12 +13095,14 @@ class SmartComponentLayoutComponent {
13190
13095
  }
13191
13096
  }
13192
13097
  SmartComponentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
13193
- 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"] }] });
13194
13099
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
13195
13100
  type: Component,
13196
- 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"] }]
13197
13102
  }], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { smartComponentLayout: [{
13198
13103
  type: Input
13104
+ }], parentLayoutComponent: [{
13105
+ type: Input
13199
13106
  }], smartFormList: [{
13200
13107
  type: ViewChildren,
13201
13108
  args: ['form']
@@ -14548,6 +14455,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
14548
14455
  * Public API Surface of smarttree
14549
14456
  */
14550
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
+
14551
14543
  /*
14552
14544
  * Public API Surface of smart-component-layout
14553
14545
  */