@smartbit4all/ng-client 1.0.18 → 1.0.20

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.
@@ -27,6 +27,7 @@ import { Validators } from '@angular/forms';
27
27
  import * as i5$1 from '@smartbit4all/form';
28
28
  import { SmartFormWidgetType, SmartValidatorName, SmartFormWidgetDirection, SmartformModule } from '@smartbit4all/form';
29
29
  import { __decorate, __param } from 'tslib';
30
+ import { SmarttreeGenericService } from '@smartbit4all/tree';
30
31
 
31
32
  /**
32
33
  * Custom HttpParameterCodec
@@ -2088,7 +2089,9 @@ class SmartViewContextService {
2088
2089
  }
2089
2090
  async startViewContext() {
2090
2091
  this.clearSessionStorage();
2091
- let newViewContext = await this.view.createViewContext().toPromise();
2092
+ let newViewContext = await this.view
2093
+ .createViewContext()
2094
+ .toPromise();
2092
2095
  if (!newViewContext) {
2093
2096
  throw new Error('No ViewContext was created');
2094
2097
  }
@@ -2229,7 +2232,9 @@ class SmartViewContextService {
2229
2232
  return uuid;
2230
2233
  }
2231
2234
  async message(messageData, messageResult) {
2232
- await this.view.message(messageData.viewUuid ?? '', messageData.uuid, messageResult).toPromise();
2235
+ await this.view
2236
+ .message(messageData.viewUuid ?? '', messageData.uuid, messageResult)
2237
+ .toPromise();
2233
2238
  await this.getAndSyncViewContext();
2234
2239
  }
2235
2240
  getSmartViewContextApiErrorByCode(code) {
@@ -3741,6 +3746,7 @@ class SmartSubject extends Subject {
3741
3746
 
3742
3747
  let SmartComponentApiClient = class SmartComponentApiClient {
3743
3748
  constructor(inject, auth, pageName) {
3749
+ this.inject = inject;
3744
3750
  this.auth = auth;
3745
3751
  this.pageName = pageName;
3746
3752
  this._destroy$ = new Subject();
@@ -3782,6 +3788,15 @@ let SmartComponentApiClient = class SmartComponentApiClient {
3782
3788
  this._data = model;
3783
3789
  this.dataChanged.next();
3784
3790
  }
3791
+ get smartTreeService() {
3792
+ return this._smartTreeService;
3793
+ }
3794
+ set smartTreeService(smartTreeService) {
3795
+ if (this._smartTreeService !== undefined) {
3796
+ throw Error('The default tree has already set up!');
3797
+ }
3798
+ this._smartTreeService = smartTreeService;
3799
+ }
3785
3800
  _ngOnInit() {
3786
3801
  this.run();
3787
3802
  }
@@ -3854,12 +3869,19 @@ let SmartComponentApiClient = class SmartComponentApiClient {
3854
3869
  smartGrid.uiActionService = this.uiActionService;
3855
3870
  smartGrid.uiActionDescriptorService = this.uiActionDescriptorService;
3856
3871
  smartGrid.serviceToUse = this;
3872
+ smartGrid.viewContextService = this.viewContext;
3857
3873
  if (useAsDefaultGrid) {
3858
3874
  this.smartGrid = smartGrid;
3859
3875
  return this.smartGrid;
3860
3876
  }
3861
3877
  return smartGrid;
3862
3878
  }
3879
+ setUpDefaultTree(treeId) {
3880
+ this.smartTreeService = new SmarttreeGenericService(this.inject, this.pageName, treeId);
3881
+ }
3882
+ createTreeService(treeId) {
3883
+ return new SmarttreeGenericService(this.inject, this.pageName, treeId);
3884
+ }
3863
3885
  };
3864
3886
  SmartComponentApiClient = __decorate([
3865
3887
  __param(2, Inject('pageName'))