@smartbit4all/ng-client 3.0.6 → 3.0.8

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 (57) 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/link.mjs +21 -0
  26. package/esm2020/lib/view-context/api/model/models.mjs +2 -1
  27. package/esm2020/lib/view-context/api/model/uiAction.mjs +1 -1
  28. package/esm2020/lib/view-context/api/model/view.mjs +1 -1
  29. package/esm2020/lib/view-context/api/model/viewContext.mjs +1 -1
  30. package/esm2020/lib/view-context/api/model/viewContextData.mjs +1 -1
  31. package/esm2020/lib/view-context/projects.mjs +14 -14
  32. package/esm2020/lib/view-context/smart-view-context-error-dialog/smart-view-context-error-dialog.service.mjs +2 -2
  33. package/esm2020/lib/view-context/smart-view-context.module.mjs +4 -2
  34. package/esm2020/lib/view-context/smart-view-context.service.mjs +43 -7
  35. package/fesm2015/smartbit4all-ng-client.mjs +172 -56
  36. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  37. package/fesm2020/smartbit4all-ng-client.mjs +169 -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/api/model/link.d.ts +38 -0
  48. package/lib/view-context/api/model/models.d.ts +1 -0
  49. package/lib/view-context/api/model/viewContext.d.ts +2 -0
  50. package/lib/view-context/api/model/viewContextData.d.ts +2 -0
  51. package/lib/view-context/projects.d.ts +13 -13
  52. package/lib/view-context/smart-view-context-error-dialog/smart-view-context-error-dialog.service.d.ts +1 -1
  53. package/lib/view-context/smart-view-context.service.d.ts +6 -3
  54. package/package.json +1 -1
  55. package/smartbit4all-ng-client-3.0.8.tgz +0 -0
  56. package/src/lib/smart-grid/api/grid-api/README.md +226 -203
  57. package/smartbit4all-ng-client-3.0.6.tgz +0 -0
@@ -2021,6 +2021,27 @@ const DataChangeKind = {
2021
2021
  Lookup: 'LOOKUP'
2022
2022
  };
2023
2023
 
2024
+ /**
2025
+ * View API
2026
+ * View API
2027
+ *
2028
+ * The version of the OpenAPI document: 1.0.0
2029
+ * Contact: info@it4all.hu
2030
+ *
2031
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
2032
+ * https://openapi-generator.tech
2033
+ * Do not edit the class manually.
2034
+ */
2035
+ var Link;
2036
+ (function (Link) {
2037
+ Link.TargetEnum = {
2038
+ Self: 'SELF',
2039
+ Blank: 'BLANK',
2040
+ Parent: 'PARENT',
2041
+ Top: 'TOP'
2042
+ };
2043
+ })(Link || (Link = {}));
2044
+
2024
2045
  /**
2025
2046
  * View API
2026
2047
  * View API
@@ -5825,13 +5846,15 @@ var SmartActionType;
5825
5846
  const SmartViewContextErrorDialogButtonLabel = 'SmartViewContextErrorDialogButtonLabel';
5826
5847
  const SmartViewContextErrorDialogTitle = 'SmartViewContextErrorDialogTitle';
5827
5848
  const SmartViewContextErrorDialogMessage = 'SmartViewContextErrorDialogMessage';
5849
+ const DIALOG_DISABLE_CLOSE = new InjectionToken('dialogDisableClose');
5828
5850
  class SmartViewContextService {
5829
- constructor(view, session, navigation, dialog, apiQueueService) {
5851
+ constructor(view, session, navigation, dialog, apiQueueService, inject) {
5830
5852
  this.view = view;
5831
5853
  this.session = session;
5832
5854
  this.navigation = navigation;
5833
5855
  this.dialog = dialog;
5834
5856
  this.apiQueueService = apiQueueService;
5857
+ this.inject = inject;
5835
5858
  this.tabIdName = 'viewContextUuid';
5836
5859
  this.tabIdhttpHeaderName = 'viewContextUuid';
5837
5860
  this.viewHandlers = new Array();
@@ -6012,7 +6035,14 @@ class SmartViewContextService {
6012
6035
  throw new Error(`Component is undefined in SmartViewHandlerModel with name: ${view.viewName}`);
6013
6036
  }
6014
6037
  let dialogRef = this.dialog.openComponentAsDialog(viewHandler.component, viewHandler.name);
6015
- dialogRef.disableClose = true;
6038
+ let dialogDisableClose = true;
6039
+ try {
6040
+ dialogDisableClose = this.inject.get(DIALOG_DISABLE_CLOSE);
6041
+ }
6042
+ catch (_b) {
6043
+ console.error('Error during reading DIALOG_DISABLE_CLOSE');
6044
+ }
6045
+ dialogRef.disableClose = dialogDisableClose;
6016
6046
  // if (view.viewName === this.messageDialogname) {
6017
6047
  // if (view.message?.options && view.message.options.length) {
6018
6048
  // }
@@ -6098,7 +6128,7 @@ class SmartViewContextService {
6098
6128
  });
6099
6129
  }
6100
6130
  syncView() {
6101
- var _a;
6131
+ var _a, _b, _c;
6102
6132
  (_a = this.viewContext) === null || _a === void 0 ? void 0 : _a.views.map((view) => {
6103
6133
  switch (view.state) {
6104
6134
  case ViewState.ToOpen:
@@ -6118,8 +6148,36 @@ class SmartViewContextService {
6118
6148
  this.closeView(viewData);
6119
6149
  });
6120
6150
  }
6151
+ (_c = (_b = this.viewContext) === null || _b === void 0 ? void 0 : _b.links) === null || _c === void 0 ? void 0 : _c.map((data) => {
6152
+ var _a, _b;
6153
+ const link = document.createElement('a');
6154
+ let target = '_blank'; // default
6155
+ switch ((_a = data.target) !== null && _a !== void 0 ? _a : Link.TargetEnum.Blank) {
6156
+ case 'SELF':
6157
+ target = '_self';
6158
+ break;
6159
+ case 'BLANK':
6160
+ target = '_blank';
6161
+ break;
6162
+ case 'PARENT':
6163
+ target = '_parent';
6164
+ break;
6165
+ case 'TOP':
6166
+ target = '_top';
6167
+ break;
6168
+ }
6169
+ link.setAttribute('target', target);
6170
+ link.setAttribute('href', data.url);
6171
+ if (data.download) {
6172
+ link.setAttribute('download', (_b = data.filename) !== null && _b !== void 0 ? _b : '');
6173
+ }
6174
+ document.body.appendChild(link);
6175
+ link.click();
6176
+ link.remove();
6177
+ });
6121
6178
  this.viewContextHasBeenSynced.next();
6122
6179
  }
6180
+ createLink(linkData) { }
6123
6181
  getUuidOfPage(pageName) {
6124
6182
  let uuid = sessionStorage.getItem(pageName);
6125
6183
  if (!uuid) {
@@ -6357,14 +6415,14 @@ class SmartViewContextService {
6357
6415
  });
6358
6416
  }
6359
6417
  }
6360
- 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 });
6418
+ 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 });
6361
6419
  SmartViewContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartViewContextService, providedIn: 'root' });
6362
6420
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartViewContextService, decorators: [{
6363
6421
  type: Injectable,
6364
6422
  args: [{
6365
6423
  providedIn: 'root',
6366
6424
  }]
6367
- }], ctorParameters: function () { return [{ type: ViewService }, { type: SmartSessionService }, { type: SmartNavigationService }, { type: SmartdialogService }, { type: ApiQueueService }]; } });
6425
+ }], ctorParameters: function () { return [{ type: ViewService }, { type: SmartSessionService }, { type: SmartNavigationService }, { type: SmartdialogService }, { type: ApiQueueService }, { type: i0.Injector }]; } });
6368
6426
  const IS_ASYNC_PARAM_NAME = 'isAsync';
6369
6427
  class ApiQueueService {
6370
6428
  constructor() {
@@ -8025,6 +8083,7 @@ SmartViewContextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
8025
8083
  useClass: SmartViewContextInterceptor,
8026
8084
  multi: true,
8027
8085
  },
8086
+ { provide: DIALOG_DISABLE_CLOSE, useValue: true },
8028
8087
  ], imports: [[
8029
8088
  CommonModule,
8030
8089
  HttpClientModule,
@@ -8065,6 +8124,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
8065
8124
  useClass: SmartViewContextInterceptor,
8066
8125
  multi: true,
8067
8126
  },
8127
+ { provide: DIALOG_DISABLE_CLOSE, useValue: true },
8068
8128
  ],
8069
8129
  }]
8070
8130
  }] });
@@ -9712,6 +9772,12 @@ class Configuration$1 {
9712
9772
  this.basePath = configurationParameters.basePath;
9713
9773
  this.withCredentials = configurationParameters.withCredentials;
9714
9774
  this.encoder = configurationParameters.encoder;
9775
+ if (configurationParameters.encodeParam) {
9776
+ this.encodeParam = configurationParameters.encodeParam;
9777
+ }
9778
+ else {
9779
+ this.encodeParam = param => this.defaultEncodeParam(param);
9780
+ }
9715
9781
  if (configurationParameters.credentials) {
9716
9782
  this.credentials = configurationParameters.credentials;
9717
9783
  }
@@ -9773,6 +9839,19 @@ class Configuration$1 {
9773
9839
  ? value()
9774
9840
  : value;
9775
9841
  }
9842
+ defaultEncodeParam(param) {
9843
+ // This implementation exists as fallback for missing configuration
9844
+ // and for backwards compatibility to older typescript-angular generator versions.
9845
+ // It only works for the 'simple' parameter style.
9846
+ // Date-handling only works for the 'date-time' format.
9847
+ // All other styles and Date-formats are probably handled incorrectly.
9848
+ //
9849
+ // But: if that's all you need (i.e.: the most common use-case): no need for customization!
9850
+ const value = param.dataFormat === 'date-time' && param.value instanceof Date
9851
+ ? param.value.toISOString()
9852
+ : param.value;
9853
+ return encodeURIComponent(String(value));
9854
+ }
9776
9855
  }
9777
9856
 
9778
9857
  /**
@@ -9796,6 +9875,9 @@ class GridService {
9796
9875
  this.configuration = configuration;
9797
9876
  }
9798
9877
  if (typeof this.configuration.basePath !== 'string') {
9878
+ if (Array.isArray(basePath) && basePath.length > 0) {
9879
+ basePath = basePath[0];
9880
+ }
9799
9881
  if (typeof basePath !== 'string') {
9800
9882
  basePath = this.basePath;
9801
9883
  }
@@ -9805,7 +9887,7 @@ class GridService {
9805
9887
  }
9806
9888
  // @ts-ignore
9807
9889
  addToHttpParams(httpParams, value, key) {
9808
- if (typeof value === 'object' && value instanceof Date === false) {
9890
+ if (typeof value === "object" && value instanceof Date === false) {
9809
9891
  httpParams = this.addToHttpParamsRecursive(httpParams, value);
9810
9892
  }
9811
9893
  else {
@@ -9817,27 +9899,27 @@ class GridService {
9817
9899
  if (value == null) {
9818
9900
  return httpParams;
9819
9901
  }
9820
- if (typeof value === 'object') {
9902
+ if (typeof value === "object") {
9821
9903
  if (Array.isArray(value)) {
9822
- value.forEach((elem) => (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)));
9904
+ value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
9823
9905
  }
9824
9906
  else if (value instanceof Date) {
9825
9907
  if (key != null) {
9826
9908
  httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
9827
9909
  }
9828
9910
  else {
9829
- throw Error('key may not be null if value is Date');
9911
+ throw Error("key may not be null if value is Date");
9830
9912
  }
9831
9913
  }
9832
9914
  else {
9833
- Object.keys(value).forEach((k) => (httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k)));
9915
+ Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
9834
9916
  }
9835
9917
  }
9836
9918
  else if (key != null) {
9837
9919
  httpParams = httpParams.append(key, value);
9838
9920
  }
9839
9921
  else {
9840
- throw Error('key may not be null if value is not object or array');
9922
+ throw Error("key may not be null if value is not object or array");
9841
9923
  }
9842
9924
  return httpParams;
9843
9925
  }
@@ -9855,7 +9937,9 @@ class GridService {
9855
9937
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
9856
9938
  if (localVarHttpHeaderAcceptSelected === undefined) {
9857
9939
  // to determine the Accept header
9858
- const httpHeaderAccepts = ['application/json'];
9940
+ const httpHeaderAccepts = [
9941
+ 'application/json'
9942
+ ];
9859
9943
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
9860
9944
  }
9861
9945
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -9877,13 +9961,14 @@ class GridService {
9877
9961
  responseType_ = 'blob';
9878
9962
  }
9879
9963
  }
9880
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridId))}/${encodeURIComponent(String(rowId))}/expand`, null, {
9964
+ 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`;
9965
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
9881
9966
  context: localVarHttpContext,
9882
9967
  responseType: responseType_,
9883
9968
  withCredentials: this.configuration.withCredentials,
9884
9969
  headers: localVarHeaders,
9885
9970
  observe: observe,
9886
- reportProgress: reportProgress,
9971
+ reportProgress: reportProgress
9887
9972
  });
9888
9973
  }
9889
9974
  load(uuid, gridIdentifier, observe = 'body', reportProgress = false, options) {
@@ -9897,7 +9982,9 @@ class GridService {
9897
9982
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
9898
9983
  if (localVarHttpHeaderAcceptSelected === undefined) {
9899
9984
  // to determine the Accept header
9900
- const httpHeaderAccepts = ['application/json'];
9985
+ const httpHeaderAccepts = [
9986
+ 'application/json'
9987
+ ];
9901
9988
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
9902
9989
  }
9903
9990
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -9919,13 +10006,14 @@ class GridService {
9919
10006
  responseType_ = 'blob';
9920
10007
  }
9921
10008
  }
9922
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridIdentifier))}/load`, null, {
10009
+ 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`;
10010
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
9923
10011
  context: localVarHttpContext,
9924
10012
  responseType: responseType_,
9925
10013
  withCredentials: this.configuration.withCredentials,
9926
10014
  headers: localVarHeaders,
9927
10015
  observe: observe,
9928
- reportProgress: reportProgress,
10016
+ reportProgress: reportProgress
9929
10017
  });
9930
10018
  }
9931
10019
  select(uuid, gridId, rowId, selected, observe = 'body', reportProgress = false, options) {
@@ -9945,7 +10033,9 @@ class GridService {
9945
10033
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
9946
10034
  if (localVarHttpHeaderAcceptSelected === undefined) {
9947
10035
  // to determine the Accept header
9948
- const httpHeaderAccepts = ['application/json'];
10036
+ const httpHeaderAccepts = [
10037
+ 'application/json'
10038
+ ];
9949
10039
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
9950
10040
  }
9951
10041
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -9967,13 +10057,14 @@ class GridService {
9967
10057
  responseType_ = 'blob';
9968
10058
  }
9969
10059
  }
9970
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridId))}/${encodeURIComponent(String(rowId))}/select`, null, {
10060
+ 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`;
10061
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
9971
10062
  context: localVarHttpContext,
9972
10063
  responseType: responseType_,
9973
10064
  withCredentials: this.configuration.withCredentials,
9974
10065
  headers: localVarHeaders,
9975
10066
  observe: observe,
9976
- reportProgress: reportProgress,
10067
+ reportProgress: reportProgress
9977
10068
  });
9978
10069
  }
9979
10070
  selectAll(uuid, gridId, selected, observe = 'body', reportProgress = false, options) {
@@ -9990,7 +10081,9 @@ class GridService {
9990
10081
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
9991
10082
  if (localVarHttpHeaderAcceptSelected === undefined) {
9992
10083
  // to determine the Accept header
9993
- const httpHeaderAccepts = ['application/json'];
10084
+ const httpHeaderAccepts = [
10085
+ 'application/json'
10086
+ ];
9994
10087
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
9995
10088
  }
9996
10089
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -10012,13 +10105,14 @@ class GridService {
10012
10105
  responseType_ = 'blob';
10013
10106
  }
10014
10107
  }
10015
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridId))}/select`, null, {
10108
+ 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`;
10109
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
10016
10110
  context: localVarHttpContext,
10017
10111
  responseType: responseType_,
10018
10112
  withCredentials: this.configuration.withCredentials,
10019
10113
  headers: localVarHeaders,
10020
10114
  observe: observe,
10021
- reportProgress: reportProgress,
10115
+ reportProgress: reportProgress
10022
10116
  });
10023
10117
  }
10024
10118
  setPage(uuid, gridIdentifier, offset, limit, observe = 'body', reportProgress = false, options) {
@@ -10060,13 +10154,14 @@ class GridService {
10060
10154
  responseType_ = 'blob';
10061
10155
  }
10062
10156
  }
10063
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridIdentifier))}/page/${encodeURIComponent(String(offset))}/${encodeURIComponent(String(limit))}`, null, {
10157
+ 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 })}`;
10158
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
10064
10159
  context: localVarHttpContext,
10065
10160
  responseType: responseType_,
10066
10161
  withCredentials: this.configuration.withCredentials,
10067
10162
  headers: localVarHeaders,
10068
10163
  observe: observe,
10069
- reportProgress: reportProgress,
10164
+ reportProgress: reportProgress
10070
10165
  });
10071
10166
  }
10072
10167
  update(uuid, gridIdentifier, gridUpdateData, observe = 'body', reportProgress = false, options) {
@@ -10083,7 +10178,9 @@ class GridService {
10083
10178
  let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
10084
10179
  if (localVarHttpHeaderAcceptSelected === undefined) {
10085
10180
  // to determine the Accept header
10086
- const httpHeaderAccepts = ['application/json'];
10181
+ const httpHeaderAccepts = [
10182
+ 'application/json'
10183
+ ];
10087
10184
  localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
10088
10185
  }
10089
10186
  if (localVarHttpHeaderAcceptSelected !== undefined) {
@@ -10094,7 +10191,9 @@ class GridService {
10094
10191
  localVarHttpContext = new HttpContext();
10095
10192
  }
10096
10193
  // to determine the Content-Type header
10097
- const consumes = ['application/json'];
10194
+ const consumes = [
10195
+ 'application/json'
10196
+ ];
10098
10197
  const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
10099
10198
  if (httpContentTypeSelected !== undefined) {
10100
10199
  localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
@@ -10111,13 +10210,15 @@ class GridService {
10111
10210
  responseType_ = 'blob';
10112
10211
  }
10113
10212
  }
10114
- return this.httpClient.post(`${this.configuration.basePath}/grid/${encodeURIComponent(String(uuid))}/${encodeURIComponent(String(gridIdentifier))}/update`, gridUpdateData, {
10213
+ 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`;
10214
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
10115
10215
  context: localVarHttpContext,
10216
+ body: gridUpdateData,
10116
10217
  responseType: responseType_,
10117
10218
  withCredentials: this.configuration.withCredentials,
10118
10219
  headers: localVarHeaders,
10119
10220
  observe: observe,
10120
- reportProgress: reportProgress,
10221
+ reportProgress: reportProgress
10121
10222
  });
10122
10223
  }
10123
10224
  }
@@ -10126,7 +10227,7 @@ GridService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version:
10126
10227
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: GridService, decorators: [{
10127
10228
  type: Injectable,
10128
10229
  args: [{
10129
- providedIn: 'root',
10230
+ providedIn: 'root'
10130
10231
  }]
10131
10232
  }], ctorParameters: function () {
10132
10233
  return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
@@ -10249,10 +10350,8 @@ class SmartGridService extends SmartdialogService {
10249
10350
  }
10250
10351
  load(uuid, gridIdentifier) {
10251
10352
  return __awaiter(this, void 0, void 0, function* () {
10252
- this.gridModel = yield lastValueFrom(this.api.load(uuid, gridIdentifier));
10253
- this.length = this.gridModel.totalRowCount;
10254
- this.pageSize = this.gridModel.pageSize;
10255
- this.gridModelChanged.next();
10353
+ let gridModelResult = yield lastValueFrom(this.api.load(uuid, gridIdentifier));
10354
+ this.updateGrid(gridModelResult, 'load');
10256
10355
  });
10257
10356
  }
10258
10357
  setPage(uuid, gridIdentifier, offset, limit) {
@@ -10263,13 +10362,10 @@ class SmartGridService extends SmartdialogService {
10263
10362
  }
10264
10363
  sort(smartGrid, gridUpdateData) {
10265
10364
  return __awaiter(this, void 0, void 0, function* () {
10266
- let gridModel = yield this.api
10365
+ let gridModelResult = yield this.api
10267
10366
  .update(smartGrid.gridModel.viewUuid, smartGrid.gridIdentifier, gridUpdateData)
10268
10367
  .toPromise();
10269
- if (gridModel) {
10270
- this.gridModel = gridModel;
10271
- this.gridModelChanged.next();
10272
- }
10368
+ this.updateGrid(gridModelResult, 'sort');
10273
10369
  });
10274
10370
  }
10275
10371
  expand(smartGrid, rowId) {
@@ -10296,11 +10392,8 @@ class SmartGridService extends SmartdialogService {
10296
10392
  }
10297
10393
  update(uuid, identifier, updateData) {
10298
10394
  return __awaiter(this, void 0, void 0, function* () {
10299
- let res = yield this.api.update(uuid, identifier, updateData).toPromise();
10300
- if (res) {
10301
- this.gridModel = res;
10302
- this.gridModelChanged.next();
10303
- }
10395
+ let gridModelResult = yield this.api.update(uuid, identifier, updateData).toPromise();
10396
+ this.updateGrid(gridModelResult, 'update');
10304
10397
  });
10305
10398
  }
10306
10399
  closeDialog() {
@@ -10311,6 +10404,15 @@ class SmartGridService extends SmartdialogService {
10311
10404
  handleAfterClosed() {
10312
10405
  this.gridModelChanged.next();
10313
10406
  }
10407
+ updateGrid(gridModel, method) {
10408
+ if (gridModel) {
10409
+ this.gridModel = gridModel;
10410
+ this.gridModelChanged.next();
10411
+ }
10412
+ else {
10413
+ console.error(`GridModel is undefined in service after ${method}!`);
10414
+ }
10415
+ }
10314
10416
  }
10315
10417
  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 });
10316
10418
  SmartGridService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartGridService, providedIn: 'root' });
@@ -10912,18 +11014,18 @@ class SmartGridComponent {
10912
11014
  constructor(service, cfService) {
10913
11015
  this.service = service;
10914
11016
  this.cfService = cfService;
11017
+ this.defaultPageSize = 10;
11018
+ this.defaultPageSizeOptions = [5, 10, 25, 50];
10915
11019
  this._destroy$ = new Subject();
10916
11020
  this.dev = false;
10917
- this.pageSizeOptions = [2, 3, 4, 10];
11021
+ this.pageSizeOptions = this.defaultPageSizeOptions;
10918
11022
  this.selectionChanges = new Subject();
10919
11023
  this.uiActionDescriptors = new Map();
10920
11024
  this.afterViewInitExecuted = false;
10921
11025
  this.isBlocked = true;
10922
11026
  this.service.gridModelChanged.subscribe(() => {
11027
+ // called after every service call (load, save, refresh, etc.)
10923
11028
  this.smartGrid.gridModel = this.service.gridModel;
10924
- if (this.service.gridModel.pageSizeOptions) {
10925
- this.pageSizeOptions = this.service.gridModel.pageSizeOptions;
10926
- }
10927
11029
  this.render();
10928
11030
  });
10929
11031
  }
@@ -10944,6 +11046,8 @@ class SmartGridComponent {
10944
11046
  }
10945
11047
  ngAfterViewInit() {
10946
11048
  if (this.dev) {
11049
+ // for dev purposes
11050
+ this.service.gridModel = this.smartGrid.gridModel;
10947
11051
  this.render();
10948
11052
  }
10949
11053
  if (this.uuid && this.smartGrid && !this.dev) {
@@ -10965,19 +11069,31 @@ class SmartGridComponent {
10965
11069
  * grid with the newest one.
10966
11070
  */
10967
11071
  refresh() {
10968
- var _a;
10969
11072
  return __awaiter(this, void 0, void 0, function* () {
11073
+ // will cause this.service.gridModelChanged to fire
10970
11074
  yield this.service.load(this.uuid, this.smartGrid.gridIdentifier);
10971
- this.length = this.service.gridModel.totalRowCount;
10972
- this.pageSize = (_a = this.service.gridModel.pageSize) !== null && _a !== void 0 ? _a : 5;
10973
11075
  });
10974
11076
  }
10975
11077
  render() {
11078
+ var _a, _b, _c, _d, _e, _f;
10976
11079
  return __awaiter(this, void 0, void 0, function* () {
10977
- this.length = this.service.length;
10978
- this.pageSize = this.service.pageSize;
10979
- // this.smartGrid!.gridModel = this.service.gridModel;
10980
- this.service.gridModel = this.smartGrid.gridModel;
11080
+ const gridModel = (_a = this.smartGrid) === null || _a === void 0 ? void 0 : _a.gridModel;
11081
+ if (gridModel) {
11082
+ this.length = gridModel.totalRowCount;
11083
+ this.pageSize = (_b = gridModel.pageSize) !== null && _b !== void 0 ? _b : this.defaultPageSize;
11084
+ if (gridModel.pageSizeOptions && gridModel.pageSizeOptions.length > 0) {
11085
+ this.pageSizeOptions = gridModel.pageSizeOptions;
11086
+ }
11087
+ else {
11088
+ this.pageSizeOptions = this.defaultPageSizeOptions;
11089
+ }
11090
+ if ((_d = (_c = gridModel === null || gridModel === void 0 ? void 0 : gridModel.view) === null || _c === void 0 ? void 0 : _c.descriptor) === null || _d === void 0 ? void 0 : _d.showEditColumns) {
11091
+ this.smartGrid.showEditColumns = (_f = (_e = gridModel === null || gridModel === void 0 ? void 0 : gridModel.view) === null || _e === void 0 ? void 0 : _e.descriptor) === null || _f === void 0 ? void 0 : _f.showEditColumns;
11092
+ }
11093
+ }
11094
+ else {
11095
+ console.error('GridModel is undefined in component!');
11096
+ }
10981
11097
  if (this.smartGrid.layoutDef === SmartLayoutDef.TABLE) {
10982
11098
  this.renderTable();
10983
11099
  }
@@ -12794,5 +12910,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
12794
12910
  * Generated bundle index. Do not edit.
12795
12911
  */
12796
12912
 
12797
- 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 };
12913
+ 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, Link, 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 };
12798
12914
  //# sourceMappingURL=smartbit4all-ng-client.mjs.map