@smartbit4all/ng-client 3.0.5 → 3.0.7

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.
Files changed (56) hide show
  1. package/esm2020/lib/session/dev-tool/smart-dev-tool-dialog/smart-dev-tool-dialog.service.mjs +2 -2
  2. package/esm2020/lib/smart-grid/api/grid-api/api/api.mjs +1 -1
  3. package/esm2020/lib/smart-grid/api/grid-api/api/grid.service.mjs +49 -27
  4. package/esm2020/lib/smart-grid/api/grid-api/api.module.mjs +1 -1
  5. package/esm2020/lib/smart-grid/api/grid-api/configuration.mjs +20 -1
  6. package/esm2020/lib/smart-grid/api/grid-api/encoder.mjs +1 -1
  7. package/esm2020/lib/smart-grid/api/grid-api/index.mjs +2 -1
  8. package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnMeta.mjs +1 -1
  9. package/esm2020/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.mjs +1 -1
  10. package/esm2020/lib/smart-grid/api/grid-api/model/gridModel.mjs +1 -1
  11. package/esm2020/lib/smart-grid/api/grid-api/model/gridPage.mjs +1 -1
  12. package/esm2020/lib/smart-grid/api/grid-api/model/gridRow.mjs +1 -1
  13. package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionMode.mjs +1 -1
  14. package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionType.mjs +1 -1
  15. package/esm2020/lib/smart-grid/api/grid-api/model/gridServerModel.mjs +1 -1
  16. package/esm2020/lib/smart-grid/api/grid-api/model/gridUpdateData.mjs +1 -1
  17. package/esm2020/lib/smart-grid/api/grid-api/model/gridView.mjs +1 -1
  18. package/esm2020/lib/smart-grid/api/grid-api/model/gridViewDescriptor.mjs +1 -1
  19. package/esm2020/lib/smart-grid/api/grid-api/model/models.mjs +1 -1
  20. package/esm2020/lib/smart-grid/api/grid-api/param.mjs +2 -0
  21. package/esm2020/lib/smart-grid/api/grid-api/variables.mjs +1 -1
  22. package/esm2020/lib/smart-grid/smart-grid.component.mjs +25 -11
  23. package/esm2020/lib/smart-grid/smart-grid.service.mjs +16 -15
  24. package/esm2020/lib/view-context/api/model/componentModel.mjs +1 -1
  25. package/esm2020/lib/view-context/api/model/uiAction.mjs +1 -1
  26. package/esm2020/lib/view-context/api/model/view.mjs +1 -1
  27. package/esm2020/lib/view-context/projects.mjs +14 -14
  28. package/esm2020/lib/view-context/smart-view-context-error-dialog/smart-view-context-error-dialog.service.mjs +2 -2
  29. package/esm2020/lib/view-context/smart-view-context.module.mjs +4 -2
  30. package/esm2020/lib/view-context/smart-view-context.service.mjs +15 -6
  31. package/esm2020/lib/view-context/value-api/model/genericValue.mjs +13 -0
  32. package/esm2020/lib/view-context/value-api/model/models.mjs +3 -1
  33. package/esm2020/lib/view-context/value-api/model/valueSetData.mjs +1 -12
  34. package/esm2020/lib/view-context/value-api/model/valueSetDefinitionIdentifier.mjs +13 -0
  35. package/fesm2015/smartbit4all-ng-client.mjs +122 -55
  36. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  37. package/fesm2020/smartbit4all-ng-client.mjs +121 -54
  38. package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
  39. package/lib/session/dev-tool/smart-dev-tool-dialog/smart-dev-tool-dialog.service.d.ts +1 -1
  40. package/lib/smart-grid/api/grid-api/api/grid.service.d.ts +1 -1
  41. package/lib/smart-grid/api/grid-api/configuration.d.ts +24 -0
  42. package/lib/smart-grid/api/grid-api/index.d.ts +1 -0
  43. package/lib/smart-grid/api/grid-api/model/gridViewDescriptor.d.ts +1 -0
  44. package/lib/smart-grid/api/grid-api/param.d.ts +37 -0
  45. package/lib/smart-grid/smart-grid.component.d.ts +2 -0
  46. package/lib/smart-grid/smart-grid.service.d.ts +1 -2
  47. package/lib/view-context/projects.d.ts +13 -13
  48. package/lib/view-context/smart-view-context-error-dialog/smart-view-context-error-dialog.service.d.ts +1 -1
  49. package/lib/view-context/smart-view-context.service.d.ts +4 -2
  50. package/lib/view-context/value-api/model/genericValue.d.ts +33 -0
  51. package/lib/view-context/value-api/model/models.d.ts +2 -0
  52. package/lib/view-context/value-api/model/valueSetDefinitionIdentifier.d.ts +21 -0
  53. package/package.json +1 -1
  54. package/smartbit4all-ng-client-3.0.7.tgz +0 -0
  55. package/src/lib/smart-grid/api/grid-api/README.md +226 -203
  56. package/smartbit4all-ng-client-3.0.5.tgz +0 -0
@@ -5899,13 +5899,15 @@ var SmartActionType;
5899
5899
  const SmartViewContextErrorDialogButtonLabel = 'SmartViewContextErrorDialogButtonLabel';
5900
5900
  const SmartViewContextErrorDialogTitle = 'SmartViewContextErrorDialogTitle';
5901
5901
  const SmartViewContextErrorDialogMessage = 'SmartViewContextErrorDialogMessage';
5902
+ const DIALOG_DISABLE_CLOSE = new InjectionToken('dialogDisableClose');
5902
5903
  class SmartViewContextService {
5903
- constructor(view, session, navigation, dialog, apiQueueService) {
5904
+ constructor(view, session, navigation, dialog, apiQueueService, inject) {
5904
5905
  this.view = view;
5905
5906
  this.session = session;
5906
5907
  this.navigation = navigation;
5907
5908
  this.dialog = dialog;
5908
5909
  this.apiQueueService = apiQueueService;
5910
+ this.inject = inject;
5909
5911
  this.tabIdName = 'viewContextUuid';
5910
5912
  this.tabIdhttpHeaderName = 'viewContextUuid';
5911
5913
  this.viewHandlers = new Array();
@@ -6072,7 +6074,14 @@ class SmartViewContextService {
6072
6074
  throw new Error(`Component is undefined in SmartViewHandlerModel with name: ${view.viewName}`);
6073
6075
  }
6074
6076
  let dialogRef = this.dialog.openComponentAsDialog(viewHandler.component, viewHandler.name);
6075
- dialogRef.disableClose = true;
6077
+ let dialogDisableClose = true;
6078
+ try {
6079
+ dialogDisableClose = this.inject.get(DIALOG_DISABLE_CLOSE);
6080
+ }
6081
+ catch {
6082
+ console.error('Error during reading DIALOG_DISABLE_CLOSE');
6083
+ }
6084
+ dialogRef.disableClose = dialogDisableClose;
6076
6085
  // if (view.viewName === this.messageDialogname) {
6077
6086
  // if (view.message?.options && view.message.options.length) {
6078
6087
  // }
@@ -6371,14 +6380,14 @@ class SmartViewContextService {
6371
6380
  return await this.view.getComponentModel2(uuid).toPromise();
6372
6381
  }
6373
6382
  }
6374
- SmartViewContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartViewContextService, deps: [{ token: ViewService }, { token: SmartSessionService }, { token: SmartNavigationService }, { token: SmartdialogService }, { token: ApiQueueService }], target: i0.ɵɵFactoryTarget.Injectable });
6383
+ SmartViewContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartViewContextService, deps: [{ token: ViewService }, { token: SmartSessionService }, { token: SmartNavigationService }, { token: SmartdialogService }, { token: ApiQueueService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
6375
6384
  SmartViewContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartViewContextService, providedIn: 'root' });
6376
6385
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartViewContextService, decorators: [{
6377
6386
  type: Injectable,
6378
6387
  args: [{
6379
6388
  providedIn: 'root',
6380
6389
  }]
6381
- }], ctorParameters: function () { return [{ type: ViewService }, { type: SmartSessionService }, { type: SmartNavigationService }, { type: SmartdialogService }, { type: ApiQueueService }]; } });
6390
+ }], ctorParameters: function () { return [{ type: ViewService }, { type: SmartSessionService }, { type: SmartNavigationService }, { type: SmartdialogService }, { type: ApiQueueService }, { type: i0.Injector }]; } });
6382
6391
  const IS_ASYNC_PARAM_NAME = 'isAsync';
6383
6392
  class ApiQueueService {
6384
6393
  constructor() {
@@ -7990,6 +7999,7 @@ SmartViewContextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
7990
7999
  useClass: SmartViewContextInterceptor,
7991
8000
  multi: true,
7992
8001
  },
8002
+ { provide: DIALOG_DISABLE_CLOSE, useValue: true },
7993
8003
  ], imports: [[
7994
8004
  CommonModule,
7995
8005
  HttpClientModule,
@@ -8030,6 +8040,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
8030
8040
  useClass: SmartViewContextInterceptor,
8031
8041
  multi: true,
8032
8042
  },
8043
+ { provide: DIALOG_DISABLE_CLOSE, useValue: true },
8033
8044
  ],
8034
8045
  }]
8035
8046
  }] });
@@ -9640,6 +9651,12 @@ class Configuration$1 {
9640
9651
  this.basePath = configurationParameters.basePath;
9641
9652
  this.withCredentials = configurationParameters.withCredentials;
9642
9653
  this.encoder = configurationParameters.encoder;
9654
+ if (configurationParameters.encodeParam) {
9655
+ this.encodeParam = configurationParameters.encodeParam;
9656
+ }
9657
+ else {
9658
+ this.encodeParam = param => this.defaultEncodeParam(param);
9659
+ }
9643
9660
  if (configurationParameters.credentials) {
9644
9661
  this.credentials = configurationParameters.credentials;
9645
9662
  }
@@ -9701,6 +9718,19 @@ class Configuration$1 {
9701
9718
  ? value()
9702
9719
  : value;
9703
9720
  }
9721
+ defaultEncodeParam(param) {
9722
+ // This implementation exists as fallback for missing configuration
9723
+ // and for backwards compatibility to older typescript-angular generator versions.
9724
+ // It only works for the 'simple' parameter style.
9725
+ // Date-handling only works for the 'date-time' format.
9726
+ // All other styles and Date-formats are probably handled incorrectly.
9727
+ //
9728
+ // But: if that's all you need (i.e.: the most common use-case): no need for customization!
9729
+ const value = param.dataFormat === 'date-time' && param.value instanceof Date
9730
+ ? param.value.toISOString()
9731
+ : param.value;
9732
+ return encodeURIComponent(String(value));
9733
+ }
9704
9734
  }
9705
9735
 
9706
9736
  /**
@@ -9724,6 +9754,9 @@ class GridService {
9724
9754
  this.configuration = configuration;
9725
9755
  }
9726
9756
  if (typeof this.configuration.basePath !== 'string') {
9757
+ if (Array.isArray(basePath) && basePath.length > 0) {
9758
+ basePath = basePath[0];
9759
+ }
9727
9760
  if (typeof basePath !== 'string') {
9728
9761
  basePath = this.basePath;
9729
9762
  }
@@ -9733,7 +9766,7 @@ class GridService {
9733
9766
  }
9734
9767
  // @ts-ignore
9735
9768
  addToHttpParams(httpParams, value, key) {
9736
- if (typeof value === 'object' && value instanceof Date === false) {
9769
+ if (typeof value === "object" && value instanceof Date === false) {
9737
9770
  httpParams = this.addToHttpParamsRecursive(httpParams, value);
9738
9771
  }
9739
9772
  else {
@@ -9745,27 +9778,27 @@ class GridService {
9745
9778
  if (value == null) {
9746
9779
  return httpParams;
9747
9780
  }
9748
- if (typeof value === 'object') {
9781
+ if (typeof value === "object") {
9749
9782
  if (Array.isArray(value)) {
9750
- value.forEach((elem) => (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)));
9783
+ value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
9751
9784
  }
9752
9785
  else if (value instanceof Date) {
9753
9786
  if (key != null) {
9754
9787
  httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
9755
9788
  }
9756
9789
  else {
9757
- throw Error('key may not be null if value is Date');
9790
+ throw Error("key may not be null if value is Date");
9758
9791
  }
9759
9792
  }
9760
9793
  else {
9761
- Object.keys(value).forEach((k) => (httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k)));
9794
+ Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
9762
9795
  }
9763
9796
  }
9764
9797
  else if (key != null) {
9765
9798
  httpParams = httpParams.append(key, value);
9766
9799
  }
9767
9800
  else {
9768
- throw Error('key may not be null if value is not object or array');
9801
+ throw Error("key may not be null if value is not object or array");
9769
9802
  }
9770
9803
  return httpParams;
9771
9804
  }
@@ -9783,7 +9816,9 @@ class GridService {
9783
9816
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
9784
9817
  if (localVarHttpHeaderAcceptSelected === undefined) {
9785
9818
  // to determine the Accept header
9786
- const httpHeaderAccepts = ['application/json'];
9819
+ const httpHeaderAccepts = [
9820
+ 'application/json'
9821
+ ];
9787
9822
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
9788
9823
  }
9789
9824
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -9805,13 +9840,14 @@ class GridService {
9805
9840
  responseType_ = 'blob';
9806
9841
  }
9807
9842
  }
9808
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridId))}/${encodeURIComponent(String(rowId))}/expand`, null, {
9843
+ let localVarPath = `/grid/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "gridId", value: gridId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/${this.configuration.encodeParam({ name: "rowId", value: rowId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/expand`;
9844
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
9809
9845
  context: localVarHttpContext,
9810
9846
  responseType: responseType_,
9811
9847
  withCredentials: this.configuration.withCredentials,
9812
9848
  headers: localVarHeaders,
9813
9849
  observe: observe,
9814
- reportProgress: reportProgress,
9850
+ reportProgress: reportProgress
9815
9851
  });
9816
9852
  }
9817
9853
  load(uuid, gridIdentifier, observe = 'body', reportProgress = false, options) {
@@ -9825,7 +9861,9 @@ class GridService {
9825
9861
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
9826
9862
  if (localVarHttpHeaderAcceptSelected === undefined) {
9827
9863
  // to determine the Accept header
9828
- const httpHeaderAccepts = ['application/json'];
9864
+ const httpHeaderAccepts = [
9865
+ 'application/json'
9866
+ ];
9829
9867
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
9830
9868
  }
9831
9869
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -9847,13 +9885,14 @@ class GridService {
9847
9885
  responseType_ = 'blob';
9848
9886
  }
9849
9887
  }
9850
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridIdentifier))}/load`, null, {
9888
+ let localVarPath = `/grid/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "gridIdentifier", value: gridIdentifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/load`;
9889
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
9851
9890
  context: localVarHttpContext,
9852
9891
  responseType: responseType_,
9853
9892
  withCredentials: this.configuration.withCredentials,
9854
9893
  headers: localVarHeaders,
9855
9894
  observe: observe,
9856
- reportProgress: reportProgress,
9895
+ reportProgress: reportProgress
9857
9896
  });
9858
9897
  }
9859
9898
  select(uuid, gridId, rowId, selected, observe = 'body', reportProgress = false, options) {
@@ -9873,7 +9912,9 @@ class GridService {
9873
9912
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
9874
9913
  if (localVarHttpHeaderAcceptSelected === undefined) {
9875
9914
  // to determine the Accept header
9876
- const httpHeaderAccepts = ['application/json'];
9915
+ const httpHeaderAccepts = [
9916
+ 'application/json'
9917
+ ];
9877
9918
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
9878
9919
  }
9879
9920
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -9895,13 +9936,14 @@ class GridService {
9895
9936
  responseType_ = 'blob';
9896
9937
  }
9897
9938
  }
9898
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridId))}/${encodeURIComponent(String(rowId))}/select`, null, {
9939
+ let localVarPath = `/grid/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "gridId", value: gridId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/${this.configuration.encodeParam({ name: "rowId", value: rowId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/select`;
9940
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
9899
9941
  context: localVarHttpContext,
9900
9942
  responseType: responseType_,
9901
9943
  withCredentials: this.configuration.withCredentials,
9902
9944
  headers: localVarHeaders,
9903
9945
  observe: observe,
9904
- reportProgress: reportProgress,
9946
+ reportProgress: reportProgress
9905
9947
  });
9906
9948
  }
9907
9949
  selectAll(uuid, gridId, selected, observe = 'body', reportProgress = false, options) {
@@ -9918,7 +9960,9 @@ class GridService {
9918
9960
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
9919
9961
  if (localVarHttpHeaderAcceptSelected === undefined) {
9920
9962
  // to determine the Accept header
9921
- const httpHeaderAccepts = ['application/json'];
9963
+ const httpHeaderAccepts = [
9964
+ 'application/json'
9965
+ ];
9922
9966
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
9923
9967
  }
9924
9968
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -9940,13 +9984,14 @@ class GridService {
9940
9984
  responseType_ = 'blob';
9941
9985
  }
9942
9986
  }
9943
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridId))}/select`, null, {
9987
+ let localVarPath = `/grid/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "gridId", value: gridId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/select`;
9988
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
9944
9989
  context: localVarHttpContext,
9945
9990
  responseType: responseType_,
9946
9991
  withCredentials: this.configuration.withCredentials,
9947
9992
  headers: localVarHeaders,
9948
9993
  observe: observe,
9949
- reportProgress: reportProgress,
9994
+ reportProgress: reportProgress
9950
9995
  });
9951
9996
  }
9952
9997
  setPage(uuid, gridIdentifier, offset, limit, observe = 'body', reportProgress = false, options) {
@@ -9988,13 +10033,14 @@ class GridService {
9988
10033
  responseType_ = 'blob';
9989
10034
  }
9990
10035
  }
9991
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridIdentifier))}/page/${encodeURIComponent(String(offset))}/${encodeURIComponent(String(limit))}`, null, {
10036
+ let localVarPath = `/grid/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "gridIdentifier", value: gridIdentifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/page/${this.configuration.encodeParam({ name: "offset", value: offset, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/${this.configuration.encodeParam({ name: "limit", value: limit, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`;
10037
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
9992
10038
  context: localVarHttpContext,
9993
10039
  responseType: responseType_,
9994
10040
  withCredentials: this.configuration.withCredentials,
9995
10041
  headers: localVarHeaders,
9996
10042
  observe: observe,
9997
- reportProgress: reportProgress,
10043
+ reportProgress: reportProgress
9998
10044
  });
9999
10045
  }
10000
10046
  update(uuid, gridIdentifier, gridUpdateData, observe = 'body', reportProgress = false, options) {
@@ -10011,7 +10057,9 @@ class GridService {
10011
10057
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
10012
10058
  if (localVarHttpHeaderAcceptSelected === undefined) {
10013
10059
  // to determine the Accept header
10014
- const httpHeaderAccepts = ['application/json'];
10060
+ const httpHeaderAccepts = [
10061
+ 'application/json'
10062
+ ];
10015
10063
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
10016
10064
  }
10017
10065
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -10022,7 +10070,9 @@ class GridService {
10022
10070
  localVarHttpContext = new HttpContext();
10023
10071
  }
10024
10072
  // to determine the Content-Type header
10025
- const consumes = ['application/json'];
10073
+ const consumes = [
10074
+ 'application/json'
10075
+ ];
10026
10076
  const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
10027
10077
  if (httpContentTypeSelected !== undefined) {
10028
10078
  localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
@@ -10039,13 +10089,15 @@ class GridService {
10039
10089
  responseType_ = 'blob';
10040
10090
  }
10041
10091
  }
10042
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridIdentifier))}/update`, gridUpdateData, {
10092
+ let localVarPath = `/grid/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "gridIdentifier", value: gridIdentifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/update`;
10093
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
10043
10094
  context: localVarHttpContext,
10095
+ body: gridUpdateData,
10044
10096
  responseType: responseType_,
10045
10097
  withCredentials: this.configuration.withCredentials,
10046
10098
  headers: localVarHeaders,
10047
10099
  observe: observe,
10048
- reportProgress: reportProgress,
10100
+ reportProgress: reportProgress
10049
10101
  });
10050
10102
  }
10051
10103
  }
@@ -10054,7 +10106,7 @@ GridService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version:
10054
10106
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: GridService, decorators: [{
10055
10107
  type: Injectable,
10056
10108
  args: [{
10057
- providedIn: 'root',
10109
+ providedIn: 'root'
10058
10110
  }]
10059
10111
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
10060
10112
  type: Optional
@@ -10184,23 +10236,18 @@ class SmartGridService extends SmartdialogService {
10184
10236
  this.gridModelChanged = new Subject();
10185
10237
  }
10186
10238
  async load(uuid, gridIdentifier) {
10187
- this.gridModel = await lastValueFrom(this.api.load(uuid, gridIdentifier));
10188
- this.length = this.gridModel.totalRowCount;
10189
- this.pageSize = this.gridModel.pageSize;
10190
- this.gridModelChanged.next();
10239
+ let gridModelResult = await lastValueFrom(this.api.load(uuid, gridIdentifier));
10240
+ this.updateGrid(gridModelResult, 'load');
10191
10241
  }
10192
10242
  async setPage(uuid, gridIdentifier, offset, limit) {
10193
10243
  await lastValueFrom(this.api.setPage(uuid, gridIdentifier, offset, limit));
10194
10244
  await this.load(uuid, gridIdentifier);
10195
10245
  }
10196
10246
  async sort(smartGrid, gridUpdateData) {
10197
- let gridModel = await this.api
10247
+ let gridModelResult = await this.api
10198
10248
  .update(smartGrid.gridModel.viewUuid, smartGrid.gridIdentifier, gridUpdateData)
10199
10249
  .toPromise();
10200
- if (gridModel) {
10201
- this.gridModel = gridModel;
10202
- this.gridModelChanged.next();
10203
- }
10250
+ this.updateGrid(gridModelResult, 'sort');
10204
10251
  }
10205
10252
  async expand(smartGrid, rowId) {
10206
10253
  return await this.api
@@ -10219,11 +10266,8 @@ class SmartGridService extends SmartdialogService {
10219
10266
  .toPromise();
10220
10267
  }
10221
10268
  async update(uuid, identifier, updateData) {
10222
- let res = await this.api.update(uuid, identifier, updateData).toPromise();
10223
- if (res) {
10224
- this.gridModel = res;
10225
- this.gridModelChanged.next();
10226
- }
10269
+ let gridModelResult = await this.api.update(uuid, identifier, updateData).toPromise();
10270
+ this.updateGrid(gridModelResult, 'update');
10227
10271
  }
10228
10272
  async closeDialog() {
10229
10273
  this.dialog.closeAll();
@@ -10231,6 +10275,15 @@ class SmartGridService extends SmartdialogService {
10231
10275
  handleAfterClosed() {
10232
10276
  this.gridModelChanged.next();
10233
10277
  }
10278
+ updateGrid(gridModel, method) {
10279
+ if (gridModel) {
10280
+ this.gridModel = gridModel;
10281
+ this.gridModelChanged.next();
10282
+ }
10283
+ else {
10284
+ console.error(`GridModel is undefined in service after ${method}!`);
10285
+ }
10286
+ }
10234
10287
  }
10235
10288
  SmartGridService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartGridService, deps: [{ token: GridService }, { token: i1$2.MatDialog }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
10236
10289
  SmartGridService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartGridService, providedIn: 'root' });
@@ -10825,18 +10878,18 @@ class SmartGridComponent {
10825
10878
  constructor(service, cfService) {
10826
10879
  this.service = service;
10827
10880
  this.cfService = cfService;
10881
+ this.defaultPageSize = 10;
10882
+ this.defaultPageSizeOptions = [5, 10, 25, 50];
10828
10883
  this._destroy$ = new Subject();
10829
10884
  this.dev = false;
10830
- this.pageSizeOptions = [2, 3, 4, 10];
10885
+ this.pageSizeOptions = this.defaultPageSizeOptions;
10831
10886
  this.selectionChanges = new Subject();
10832
10887
  this.uiActionDescriptors = new Map();
10833
10888
  this.afterViewInitExecuted = false;
10834
10889
  this.isBlocked = true;
10835
10890
  this.service.gridModelChanged.subscribe(() => {
10891
+ // called after every service call (load, save, refresh, etc.)
10836
10892
  this.smartGrid.gridModel = this.service.gridModel;
10837
- if (this.service.gridModel.pageSizeOptions) {
10838
- this.pageSizeOptions = this.service.gridModel.pageSizeOptions;
10839
- }
10840
10893
  this.render();
10841
10894
  });
10842
10895
  }
@@ -10857,6 +10910,8 @@ class SmartGridComponent {
10857
10910
  }
10858
10911
  ngAfterViewInit() {
10859
10912
  if (this.dev) {
10913
+ // for dev purposes
10914
+ this.service.gridModel = this.smartGrid.gridModel;
10860
10915
  this.render();
10861
10916
  }
10862
10917
  if (this.uuid && this.smartGrid && !this.dev) {
@@ -10878,15 +10933,27 @@ class SmartGridComponent {
10878
10933
  * grid with the newest one.
10879
10934
  */
10880
10935
  async refresh() {
10936
+ // will cause this.service.gridModelChanged to fire
10881
10937
  await this.service.load(this.uuid, this.smartGrid.gridIdentifier);
10882
- this.length = this.service.gridModel.totalRowCount;
10883
- this.pageSize = this.service.gridModel.pageSize ?? 5;
10884
10938
  }
10885
10939
  async render() {
10886
- this.length = this.service.length;
10887
- this.pageSize = this.service.pageSize;
10888
- // this.smartGrid!.gridModel = this.service.gridModel;
10889
- this.service.gridModel = this.smartGrid.gridModel;
10940
+ const gridModel = this.smartGrid?.gridModel;
10941
+ if (gridModel) {
10942
+ this.length = gridModel.totalRowCount;
10943
+ this.pageSize = gridModel.pageSize ?? this.defaultPageSize;
10944
+ if (gridModel.pageSizeOptions && gridModel.pageSizeOptions.length > 0) {
10945
+ this.pageSizeOptions = gridModel.pageSizeOptions;
10946
+ }
10947
+ else {
10948
+ this.pageSizeOptions = this.defaultPageSizeOptions;
10949
+ }
10950
+ if (gridModel?.view?.descriptor?.showEditColumns) {
10951
+ this.smartGrid.showEditColumns = gridModel?.view?.descriptor?.showEditColumns;
10952
+ }
10953
+ }
10954
+ else {
10955
+ console.error('GridModel is undefined in component!');
10956
+ }
10890
10957
  if (this.smartGrid.layoutDef === SmartLayoutDef.TABLE) {
10891
10958
  this.renderTable();
10892
10959
  }
@@ -12669,5 +12736,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12669
12736
  * Generated bundle index. Do not edit.
12670
12737
  */
12671
12738
 
12672
- export { APIS$3 as APIS, ApiModule$3 as ApiModule, ApiQueueService, BASE_PATH$4 as BASE_PATH, COLLECTION_FORMATS$4 as COLLECTION_FORMATS, CloseResult, ComponentFactoryService, ComponentFactoryServiceModule, ComponentType, ComponentWidgetType, Configuration$4 as Configuration, DataChangeKind, ExpandableSectionButtonIconPosition, ExpandableSectionButtonType, ExpandableSectionComponent, FilterExpressionBoolOperator, FilterExpressionBuilderGroup, FilterExpressionDataType, FilterExpressionFieldWidgetType, FilterExpressionOperation, FilterExpressionOrderBy, GridDataAccessConfig, GridSelectionMode, GridSelectionType, GridUiActionType, GridViewDescriptor, IS_ASYNC_PARAM_NAME, LayoutDirection, MessageOptionType, MessageType, SelectionDefinition, SessionAPIS, SessionErrorBehaviour, SessionService, SimplifiedTabGroupComponent, SmartActionType, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartComponentLayoutComponent, SmartComponentLayoutModule, SmartComponentLayoutUtility, SmartDatePipe, SmartDateTimePipe, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartDialog, SmartExpandableSectionModule, SmartExpandableSectionService, SmartFileUploaderComponent, SmartFilterComponent, SmartFilterModule, SmartFilterPosition, SmartFilterType, SmartFormTextFieldButtonIconPosition, SmartFormWidgetDirection, SmartFormWidgetType, SmartFormWidgetWidth, SmartGridButtonType, SmartGridComponent, SmartGridDataLayout, SmartGridModule, SmartGridService, SmartGridType, SmartIconComponent, SmartIconModule, SmartIconService, SmartLayoutDef, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNavbarComponent, SmartNavbarModule, SmartNavbarService, SmartNavigationModule, SmartNavigationService, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartSubject, SmartTabGroupModule, SmartTabGroupService, SmartTable, SmartTableButtonType, SmartTableHeaderPropertyType, SmartTableInterfaceTypeEnum, SmartTableOptionButtonDirection, SmartTableOrder, SmartTableType, SmartTimePipe, SmartTreeComponent, SmartTreeNodeButtonType, SmartUserSettinsIconPosition, SmartValidatorName, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, SmartWidgetHintPosition, SmartWidgetSettings, SmartdialogModule, SmartdialogService, SmartfileuploaderComponent, SmartformComponent, SmartformLayoutDefinitionService, SmartformModule, SmartformwidgetComponent, SmarttableComponent, SmarttableModule, SmarttableService, SmarttreeGenericService, SmarttreeModule, SmarttreeService, TabGroupComponent, ToggleLabelPosition, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewEventHandler, ViewService, ViewState, ViewType, WidgetMap };
12739
+ export { APIS$3 as APIS, ApiModule$3 as ApiModule, ApiQueueService, BASE_PATH$4 as BASE_PATH, COLLECTION_FORMATS$4 as COLLECTION_FORMATS, CloseResult, ComponentFactoryService, ComponentFactoryServiceModule, ComponentType, ComponentWidgetType, Configuration$4 as Configuration, DIALOG_DISABLE_CLOSE, DataChangeKind, ExpandableSectionButtonIconPosition, ExpandableSectionButtonType, ExpandableSectionComponent, FilterExpressionBoolOperator, FilterExpressionBuilderGroup, FilterExpressionDataType, FilterExpressionFieldWidgetType, FilterExpressionOperation, FilterExpressionOrderBy, GridDataAccessConfig, GridSelectionMode, GridSelectionType, GridUiActionType, GridViewDescriptor, IS_ASYNC_PARAM_NAME, LayoutDirection, MessageOptionType, MessageType, SelectionDefinition, SessionAPIS, SessionErrorBehaviour, SessionService, SimplifiedTabGroupComponent, SmartActionType, SmartAuthService, SmartComponent, SmartComponentApiClient, SmartComponentLayoutComponent, SmartComponentLayoutModule, SmartComponentLayoutUtility, SmartDatePipe, SmartDateTimePipe, SmartDevToolDatePipe, SmartDevToolFloatingButtonComponent, SmartDevToolService, SmartDialog, SmartExpandableSectionModule, SmartExpandableSectionService, SmartFileUploaderComponent, SmartFilterComponent, SmartFilterModule, SmartFilterPosition, SmartFilterType, SmartFormTextFieldButtonIconPosition, SmartFormWidgetDirection, SmartFormWidgetType, SmartFormWidgetWidth, SmartGridButtonType, SmartGridComponent, SmartGridDataLayout, SmartGridModule, SmartGridService, SmartGridType, SmartIconComponent, SmartIconModule, SmartIconService, SmartLayoutDef, SmartLinkChannelVariableInPath, SmartLinkUuidVariableInPath, SmartNavbarComponent, SmartNavbarModule, SmartNavbarService, SmartNavigationModule, SmartNavigationService, SmartNgClientModule, SmartNgClientService, SmartService, SmartSessionModule, SmartSessionService, SmartSessionTimerComponent, SmartSessionTimerService, SmartSubject, SmartTabGroupModule, SmartTabGroupService, SmartTable, SmartTableButtonType, SmartTableHeaderPropertyType, SmartTableInterfaceTypeEnum, SmartTableOptionButtonDirection, SmartTableOrder, SmartTableType, SmartTimePipe, SmartTreeComponent, SmartTreeNodeButtonType, SmartUserSettinsIconPosition, SmartValidatorName, SmartViewContextErrorDialogButtonLabel, SmartViewContextErrorDialogMessage, SmartViewContextErrorDialogTitle, SmartViewContextModule, SmartViewContextService, SmartViewRedirect, SmartWidgetHintPosition, SmartWidgetSettings, SmartdialogModule, SmartdialogService, SmartfileuploaderComponent, SmartformComponent, SmartformLayoutDefinitionService, SmartformModule, SmartformwidgetComponent, SmarttableComponent, SmarttableModule, SmarttableService, SmarttreeGenericService, SmarttreeModule, SmarttreeService, TabGroupComponent, ToggleLabelPosition, UiActionButtonIconPos, UiActionButtonType, UiActionConfirmDialogComponent, UiActionConfirmDialogService, UiActionDescriptorService, UiActionDialogType, UiActionFeedbackType, UiActionInputDialogComponent, UiActionInputDialogService, UiActionInputType, UiActionService, UiActionToolbarComponent, ViewEventHandler, ViewService, ViewState, ViewType, WidgetMap };
12673
12740
  //# sourceMappingURL=smartbit4all-ng-client.mjs.map