@smartbit4all/ng-client 3.3.129 → 3.3.131

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.
@@ -12932,24 +12932,27 @@ class SmartComponentLayoutComponent {
12932
12932
  .subscribe((list) => {
12933
12933
  this.setToolbarComponent(list.first);
12934
12934
  });
12935
- if (this.smartComponentLayout) {
12936
- this.setUp();
12937
- }
12935
+ this.setUp();
12938
12936
  }
12939
12937
  ngOnDestroy() {
12940
12938
  this._destroy$.next();
12941
12939
  this._destroy$.complete();
12942
12940
  }
12943
12941
  ngOnChanges(changes) {
12944
- this.smartComponentLayout = changes['smartComponentLayout'].currentValue;
12945
- if (this.smartComponentLayout) {
12946
- this.setUp();
12947
- }
12942
+ this.setUp();
12948
12943
  }
12949
12944
  setUp() {
12950
- this.parent = this.smartComponentLayout?.parentComponent;
12951
- this.uuid = this.parent.uuid;
12952
- this.treeService = this.parent.smartTreeService;
12945
+ if (!this.parentSmartComponent || !this.smartComponentLayout) {
12946
+ return;
12947
+ }
12948
+ if (deepEqual(this.smartComponentLayout, this.currentLayout)) {
12949
+ // no layout change, keep current state
12950
+ return;
12951
+ }
12952
+ // layout changed, render, but save current
12953
+ this.currentLayout = JSON.parse(JSON.stringify(this.smartComponentLayout));
12954
+ this.uuid = this.parentSmartComponent.uuid;
12955
+ this.treeService = this.parentSmartComponent.smartTreeService;
12953
12956
  this.smartComponentLayout?.direction;
12954
12957
  if (this.smartComponentLayout?.expandable) {
12955
12958
  this.constructExpandableSection();
@@ -12972,7 +12975,8 @@ class SmartComponentLayoutComponent {
12972
12975
  this.constructToolbar();
12973
12976
  }
12974
12977
  if (!this.parentLayoutComponent) {
12975
- this.parent.initActions();
12978
+ // only top level component should call init actions
12979
+ this.parentSmartComponent.initActions();
12976
12980
  }
12977
12981
  }
12978
12982
  }
@@ -12995,7 +12999,7 @@ class SmartComponentLayoutComponent {
12995
12999
  });
12996
13000
  this.smartForm = {
12997
13001
  direction: this.getFormLayout(),
12998
- componentModel: this.parent?.model,
13002
+ componentModel: this.parentSmartComponent?.model,
12999
13003
  widgets,
13000
13004
  };
13001
13005
  this.bindForm();
@@ -13015,11 +13019,11 @@ class SmartComponentLayoutComponent {
13015
13019
  }
13016
13020
  }
13017
13021
  bindForm() {
13018
- if (this.parent?.useQueryLists) {
13022
+ if (this.parentSmartComponent?.useQueryLists) {
13019
13023
  return;
13020
13024
  }
13021
13025
  if (this.smartForm && this.smartFormComponent) {
13022
- this.parent?.addForm(
13026
+ this.parentSmartComponent?.addForm(
13023
13027
  // unique identifier for the form
13024
13028
  `form_${this.makeid(5)}`, this.smartForm, this.smartFormComponent);
13025
13029
  }
@@ -13056,11 +13060,11 @@ class SmartComponentLayoutComponent {
13056
13060
  }
13057
13061
  }
13058
13062
  bindGrid() {
13059
- if (this.parent?.useQueryLists) {
13063
+ if (this.parentSmartComponent?.useQueryLists) {
13060
13064
  return;
13061
13065
  }
13062
13066
  if (this.smartGrid && this.smartGridComponent) {
13063
- this.smartGrid = this.parent?.addGrid(this.smartGrid, {
13067
+ this.smartGrid = this.parentSmartComponent?.addGrid(this.smartGrid, {
13064
13068
  rowUiActionType: GridUiActionType.POPUP_MENU,
13065
13069
  }, false, this.smartGridComponent);
13066
13070
  }
@@ -13081,10 +13085,10 @@ class SmartComponentLayoutComponent {
13081
13085
  // TODO
13082
13086
  }
13083
13087
  constructTree() {
13084
- if (this.parent?.useQueryLists) {
13088
+ if (this.parentSmartComponent?.useQueryLists) {
13085
13089
  return;
13086
13090
  }
13087
- this.parent.setUpDefaultTree(this.smartComponentLayout?.widget?.identifier);
13091
+ this.parentSmartComponent.setUpDefaultTree(this.smartComponentLayout?.widget?.identifier);
13088
13092
  this.treeService?.initialize();
13089
13093
  }
13090
13094
  constructToolbar() {
@@ -13095,14 +13099,16 @@ class SmartComponentLayoutComponent {
13095
13099
  }
13096
13100
  }
13097
13101
  SmartComponentLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
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"] }] });
13102
+ SmartComponentLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartComponentLayoutComponent, selector: "smart-component-layout", inputs: { smartComponentLayout: "smartComponentLayout", parentLayoutComponent: "parentLayoutComponent", parentSmartComponent: "parentSmartComponent" }, 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 [parentSmartComponent]=\"parentSmartComponent\"\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", "parentSmartComponent"] }, { 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"] }] });
13099
13103
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartComponentLayoutComponent, decorators: [{
13100
13104
  type: Component,
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"] }]
13105
+ 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 [parentSmartComponent]=\"parentSmartComponent\"\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"] }]
13102
13106
  }], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { smartComponentLayout: [{
13103
13107
  type: Input
13104
13108
  }], parentLayoutComponent: [{
13105
13109
  type: Input
13110
+ }], parentSmartComponent: [{
13111
+ type: Input
13106
13112
  }], smartFormList: [{
13107
13113
  type: ViewChildren,
13108
13114
  args: ['form']
@@ -14456,17 +14462,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
14456
14462
  */
14457
14463
 
14458
14464
  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
14465
  static getForms(comp) {
14471
14466
  let result = [];
14472
14467
  if (comp.components) {
@@ -15006,8 +15001,6 @@ class SmartComponentApiClient {
15006
15001
  else {
15007
15002
  this.handleQueryList(this.getSmartComponentLayoutsQL(), (comp) => {
15008
15003
  if (comp.smartComponentLayout) {
15009
- // TODO maybe we should set comp.parent, not comp.smartComponentLayout.parentComponent..
15010
- SmartComponentLayoutUtility.setParent(comp.smartComponentLayout, this);
15011
15004
  this.initActions();
15012
15005
  }
15013
15006
  if (this.uuid && this.uuid !== comp.uuid)