@smartbit4all/ng-client 3.2.5 → 3.2.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 (90) hide show
  1. package/esm2020/lib/smart-client/smart-component-api-client.mjs +53 -25
  2. package/esm2020/lib/smart-filter-editor/api/api/filter.service.mjs +1 -1
  3. package/esm2020/lib/smart-filter-editor/api/configuration.mjs +1 -1
  4. package/esm2020/lib/smart-filter-editor/api/encoder.mjs +1 -1
  5. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBoolOperator.mjs +1 -1
  6. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderApiConfig.mjs +1 -1
  7. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderField.mjs +1 -1
  8. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderGroup.mjs +1 -1
  9. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderModel.mjs +1 -1
  10. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderUiModel.mjs +1 -1
  11. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionData.mjs +1 -1
  12. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionDataType.mjs +1 -1
  13. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionField.mjs +1 -1
  14. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldEditor.mjs +1 -1
  15. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldList.mjs +1 -1
  16. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldWidgetType.mjs +1 -1
  17. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionList.mjs +1 -1
  18. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionOperandData.mjs +1 -1
  19. package/esm2020/lib/smart-filter-editor/api/model/filterExpressionOperation.mjs +1 -1
  20. package/esm2020/lib/smart-filter-editor/api/param.mjs +1 -1
  21. package/esm2020/lib/smart-filter-editor/api/variables.mjs +1 -1
  22. package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.mjs +14 -9
  23. package/esm2020/lib/smart-form/api/model/models.mjs +1 -1
  24. package/esm2020/lib/smart-form/api/model/smartWidgetDefinition.mjs +1 -1
  25. package/esm2020/lib/smart-form/api/model/smartWidgetHint.mjs +1 -1
  26. package/esm2020/lib/smart-form/services/smartform.service.mjs +33 -30
  27. package/esm2020/lib/smart-grid/api/grid-api/api/api.mjs +1 -1
  28. package/esm2020/lib/smart-grid/api/grid-api/api/grid.service.mjs +1 -1
  29. package/esm2020/lib/smart-grid/api/grid-api/api.module.mjs +1 -1
  30. package/esm2020/lib/smart-grid/api/grid-api/configuration.mjs +1 -1
  31. package/esm2020/lib/smart-grid/api/grid-api/encoder.mjs +1 -1
  32. package/esm2020/lib/smart-grid/api/grid-api/index.mjs +1 -1
  33. package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnContentType.mjs +1 -1
  34. package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnMeta.mjs +1 -1
  35. package/esm2020/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.mjs +1 -1
  36. package/esm2020/lib/smart-grid/api/grid-api/model/gridModel.mjs +1 -1
  37. package/esm2020/lib/smart-grid/api/grid-api/model/gridPage.mjs +1 -1
  38. package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionMode.mjs +1 -1
  39. package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionType.mjs +1 -1
  40. package/esm2020/lib/smart-grid/api/grid-api/model/gridServerModel.mjs +1 -1
  41. package/esm2020/lib/smart-grid/api/grid-api/model/gridUpdateData.mjs +1 -1
  42. package/esm2020/lib/smart-grid/api/grid-api/model/gridView.mjs +1 -1
  43. package/esm2020/lib/smart-grid/api/grid-api/model/models.mjs +1 -1
  44. package/esm2020/lib/smart-grid/api/grid-api/param.mjs +1 -1
  45. package/esm2020/lib/smart-grid/api/grid-api/variables.mjs +1 -1
  46. package/esm2020/lib/smart-tree/tree-api/api/tree.service.mjs +1 -1
  47. package/esm2020/lib/smart-tree/tree-api/configuration.mjs +1 -1
  48. package/esm2020/lib/smart-tree/tree-api/encoder.mjs +1 -1
  49. package/esm2020/lib/smart-tree/tree-api/param.mjs +1 -1
  50. package/esm2020/lib/smart-tree/tree-api/variables.mjs +1 -1
  51. package/esm2020/lib/view-context/api/api/view.service.mjs +1 -1
  52. package/esm2020/lib/view-context/api/model/uploadedFile.mjs +1 -1
  53. package/esm2020/lib/view-context/api/model/viewContextChange.mjs +1 -1
  54. package/esm2020/lib/view-context/api/model/viewEventHandler.mjs +1 -1
  55. package/esm2020/lib/view-context/smart-view-context.model.mjs +1 -1
  56. package/esm2020/lib/view-context/smart-view-context.service.mjs +48 -24
  57. package/esm2020/lib/view-context/value-api/api/api.mjs +1 -1
  58. package/esm2020/lib/view-context/value-api/api/value.service.mjs +1 -1
  59. package/esm2020/lib/view-context/value-api/api.module.mjs +1 -1
  60. package/esm2020/lib/view-context/value-api/configuration.mjs +1 -1
  61. package/esm2020/lib/view-context/value-api/encoder.mjs +1 -1
  62. package/esm2020/lib/view-context/value-api/index.mjs +1 -1
  63. package/esm2020/lib/view-context/value-api/model/genericValue.mjs +1 -1
  64. package/esm2020/lib/view-context/value-api/model/models.mjs +1 -1
  65. package/esm2020/lib/view-context/value-api/model/value.mjs +1 -1
  66. package/esm2020/lib/view-context/value-api/model/valueSetData.mjs +1 -1
  67. package/esm2020/lib/view-context/value-api/model/valueSetDefinition.mjs +1 -1
  68. package/esm2020/lib/view-context/value-api/model/valueSetDefinitionData.mjs +1 -1
  69. package/esm2020/lib/view-context/value-api/model/valueSetDefinitionIdentifier.mjs +1 -1
  70. package/esm2020/lib/view-context/value-api/model/valueSetDefinitionKind.mjs +1 -1
  71. package/esm2020/lib/view-context/value-api/model/valueSetExpression.mjs +1 -1
  72. package/esm2020/lib/view-context/value-api/model/valueSetOperand.mjs +1 -1
  73. package/esm2020/lib/view-context/value-api/model/valueSetOperation.mjs +1 -1
  74. package/esm2020/lib/view-context/value-api/param.mjs +1 -1
  75. package/esm2020/lib/view-context/value-api/variables.mjs +1 -1
  76. package/fesm2015/smartbit4all-ng-client.mjs +151 -91
  77. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  78. package/fesm2020/smartbit4all-ng-client.mjs +143 -82
  79. package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
  80. package/lib/smart-client/smart-component-api-client.d.ts +4 -2
  81. package/lib/smart-form/services/smartform.service.d.ts +1 -0
  82. package/lib/view-context/smart-view-context.model.d.ts +5 -4
  83. package/lib/view-context/smart-view-context.service.d.ts +9 -3
  84. package/package.json +1 -1
  85. package/smartbit4all-ng-client-3.2.7.tgz +0 -0
  86. package/src/lib/smart-filter-editor/api/README.md +226 -226
  87. package/src/lib/smart-grid/api/grid-api/README.md +226 -226
  88. package/src/lib/smart-tree/tree-api/README.md +226 -226
  89. package/src/lib/view-context/value-api/README.md +226 -226
  90. package/smartbit4all-ng-client-3.2.5.tgz +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Optional, Inject, PLATFORM_ID, NgModule, SkipSelf, Component, Input, ViewChild, forwardRef, EventEmitter, Output, Directive, HostListener, ViewContainerRef, ViewEncapsulation, ViewChildren, Pipe, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
3
- import { __awaiter, __decorate, __param } from 'tslib';
3
+ import { __awaiter } from 'tslib';
4
4
  import { Subject, takeUntil, startWith, map, distinctUntilChanged, throwError, from, catchError as catchError$1, lastValueFrom } from 'rxjs';
5
5
  import * as i1 from '@angular/common/http';
6
6
  import { HttpHeaders, HttpContext, HttpParams, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
@@ -2467,8 +2467,10 @@ class SmartViewContextService {
2467
2467
  this.dialog = dialog;
2468
2468
  this.apiQueueService = apiQueueService;
2469
2469
  this.inject = inject;
2470
- this.tabIdName = 'viewContextUuid';
2471
- this.tabIdhttpHeaderName = 'viewContextUuid';
2470
+ this.viewContextUuidName = 'viewContextUuid';
2471
+ this.viewContextUuidHeaderName = 'viewContextUuid';
2472
+ this.pageNamePrefix = 'page.';
2473
+ this.componentNamePrefix = 'component.';
2472
2474
  this.viewHandlers = new Array();
2473
2475
  this.openedViewUuids = new Array();
2474
2476
  this.openedViewData = new Array();
@@ -2534,7 +2536,7 @@ class SmartViewContextService {
2534
2536
  getAndSyncViewContext(uuid) {
2535
2537
  return __awaiter(this, void 0, void 0, function* () {
2536
2538
  if (!uuid) {
2537
- uuid = this.getUuidOfPage(this.tabIdName);
2539
+ uuid = this.getViewContextUuid();
2538
2540
  }
2539
2541
  yield this.getViewContext(uuid).then(() => {
2540
2542
  this.syncView();
@@ -2554,11 +2556,7 @@ class SmartViewContextService {
2554
2556
  var _a;
2555
2557
  return __awaiter(this, void 0, void 0, function* () {
2556
2558
  if (!this.viewContext) {
2557
- let viewContextUuid = sessionStorage.getItem(this.tabIdName);
2558
- if (!viewContextUuid) {
2559
- throw new Error('View context is not initialized!');
2560
- }
2561
- yield this.getViewContext(viewContextUuid);
2559
+ yield this.getViewContext(this.getViewContextUuid());
2562
2560
  }
2563
2561
  let pageUuid = this.getUuidOfPage(pageName);
2564
2562
  let viewContextByPageName = (_a = this.viewContext) === null || _a === void 0 ? void 0 : _a.views.find((view) => view.uuid === pageUuid);
@@ -2579,13 +2577,6 @@ class SmartViewContextService {
2579
2577
  this.openedViewData = [];
2580
2578
  this.openedViewUuids = [];
2581
2579
  }
2582
- setTabId(tabId) {
2583
- sessionStorage.setItem(this.tabIdName, tabId);
2584
- this.session.addHeaderParam({
2585
- headerName: this.tabIdhttpHeaderName,
2586
- value: tabId,
2587
- });
2588
- }
2589
2580
  startViewContext() {
2590
2581
  return __awaiter(this, void 0, void 0, function* () {
2591
2582
  this.clearSessionStorage();
@@ -2596,7 +2587,7 @@ class SmartViewContextService {
2596
2587
  throw new Error('No ViewContext was created');
2597
2588
  }
2598
2589
  this.viewContext = newViewContext;
2599
- this.setTabId(newViewContext.uuid);
2590
+ this.setViewContextUuid(newViewContext.uuid);
2600
2591
  return this.viewContext;
2601
2592
  });
2602
2593
  }
@@ -2615,7 +2606,7 @@ class SmartViewContextService {
2615
2606
  throw new Error('The messageDialogName provided by the backend has not been set.');
2616
2607
  }
2617
2608
  if (uuid) {
2618
- this.setTabId(uuid);
2609
+ this.setViewContextUuid(uuid);
2619
2610
  try {
2620
2611
  yield this.getViewContext(uuid);
2621
2612
  }
@@ -2655,7 +2646,7 @@ class SmartViewContextService {
2655
2646
  try {
2656
2647
  this.openedViewUuids.push(view.uuid);
2657
2648
  this.openedViewData.push(view);
2658
- sessionStorage.setItem(view.viewName, view.uuid);
2649
+ this.setUuidOfPage(view.viewName, view.uuid, viewHandler.componentName);
2659
2650
  dialogRef = this.dialog.openComponentAsDialog(viewHandler.component, viewHandler.name);
2660
2651
  }
2661
2652
  finally {
@@ -2663,9 +2654,9 @@ class SmartViewContextService {
2663
2654
  if (index >= 0) {
2664
2655
  this.openedViewUuids.splice(index, 1);
2665
2656
  this.openedViewData.splice(index, 1);
2666
- sessionStorage.removeItem(view.viewName);
2657
+ this.clearUuidOfPage(view.viewName, viewHandler.componentName);
2667
2658
  }
2668
- sessionStorage.setItem(view.viewName, view.uuid);
2659
+ this.setUuidOfPage(view.viewName, view.uuid, viewHandler.componentName);
2669
2660
  }
2670
2661
  let dialogDisableClose = true;
2671
2662
  let isMessageDialog = view.viewName === this.messageDialogname;
@@ -2708,7 +2699,7 @@ class SmartViewContextService {
2708
2699
  view.state = ViewState.Opened;
2709
2700
  this.openedViewUuids.push(view.uuid);
2710
2701
  this.openedViewData.push(view);
2711
- sessionStorage.setItem(view.viewName, view.uuid);
2702
+ this.setUuidOfPage(view.viewName, view.uuid, viewHandler.componentName);
2712
2703
  this.uuidOfPageHasBeenChanged.next(view.viewName);
2713
2704
  this.updateViewContext({
2714
2705
  updates: [
@@ -2749,7 +2740,7 @@ class SmartViewContextService {
2749
2740
  if (index >= 0) {
2750
2741
  this.openedViewUuids.splice(index, 1);
2751
2742
  this.openedViewData.splice(index, 1);
2752
- sessionStorage.removeItem(view.viewName);
2743
+ this.clearUuidOfPage(view.viewName, viewHandler.componentName);
2753
2744
  }
2754
2745
  this.updateViewContext({
2755
2746
  updates: [
@@ -2838,13 +2829,46 @@ class SmartViewContextService {
2838
2829
  }));
2839
2830
  this.viewContextHasBeenSynced.next();
2840
2831
  }
2832
+ setViewContextUuid(uuid) {
2833
+ sessionStorage.setItem(this.viewContextUuidName, uuid);
2834
+ this.session.addHeaderParam({
2835
+ headerName: this.viewContextUuidHeaderName,
2836
+ value: uuid,
2837
+ });
2838
+ }
2839
+ getViewContextUuid() {
2840
+ let viewContextUuid = sessionStorage.getItem(this.viewContextUuidName);
2841
+ if (!viewContextUuid) {
2842
+ throw new Error('View context is not initialized!');
2843
+ }
2844
+ return viewContextUuid;
2845
+ }
2846
+ setUuidOfPage(pageName, uuid, componentName) {
2847
+ sessionStorage.setItem(this.pageNamePrefix + pageName, uuid);
2848
+ if (componentName) {
2849
+ sessionStorage.setItem(this.componentNamePrefix + componentName, pageName);
2850
+ }
2851
+ }
2852
+ clearUuidOfPage(pageName, componentName) {
2853
+ sessionStorage.removeItem(this.pageNamePrefix + pageName);
2854
+ if (componentName) {
2855
+ sessionStorage.removeItem(this.componentNamePrefix + componentName);
2856
+ }
2857
+ }
2841
2858
  getUuidOfPage(pageName) {
2842
- let uuid = sessionStorage.getItem(pageName);
2859
+ let uuid = sessionStorage.getItem(this.pageNamePrefix + pageName);
2843
2860
  if (!uuid) {
2844
2861
  throw new Error(`The uuid of ${pageName} is not available.`);
2845
2862
  }
2846
2863
  return uuid;
2847
2864
  }
2865
+ getPageNameOfComponent(componentName) {
2866
+ let pageName = sessionStorage.getItem(this.componentNamePrefix + componentName);
2867
+ if (!pageName) {
2868
+ throw new Error(`The pageName of ${componentName} is not available.`);
2869
+ }
2870
+ return pageName;
2871
+ }
2848
2872
  message(messageData, messageResult) {
2849
2873
  var _a;
2850
2874
  return __awaiter(this, void 0, void 0, function* () {
@@ -3814,11 +3838,12 @@ class SmartFormService {
3814
3838
  }
3815
3839
  toFormGroup() {
3816
3840
  this.createFormControls(this.smartForm.widgets);
3817
- // if (this.formGroup) {
3818
- // this.formGroup.controls = this.group;
3819
- // } else {
3820
- // }
3821
- this.formGroup = new FormGroup(this.group);
3841
+ if (this.formGroup) {
3842
+ this.formGroup.controls = this.group;
3843
+ }
3844
+ else {
3845
+ this.formGroup = new FormGroup(this.group);
3846
+ }
3822
3847
  if (this.smartForm.validators && this.smartForm.validators.length) {
3823
3848
  this.formGroup.setValidators(this.smartForm.validators.map((validator) => {
3824
3849
  return validator.validator;
@@ -3828,7 +3853,7 @@ class SmartFormService {
3828
3853
  }
3829
3854
  createFormControls(widgets, parentKey) {
3830
3855
  widgets.map((widget) => {
3831
- var _a, _b, _c;
3856
+ var _a, _b;
3832
3857
  if (widget.type !== SmartFormWidgetType.INDICATOR &&
3833
3858
  widget.type !== SmartFormWidgetType.LABEL &&
3834
3859
  widget.type !== SmartFormWidgetType.CONTAINER &&
@@ -3841,14 +3866,7 @@ class SmartFormService {
3841
3866
  widget.type !== SmartFormWidgetType.COMPONENT &&
3842
3867
  widget.type !== SmartFormWidgetType.MATRIX &&
3843
3868
  widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
3844
- // let formControl = this.group[`${widget.key}`];
3845
- let formControl = new FormControl(widget.value || '', (_a = widget.validators) === null || _a === void 0 ? void 0 : _a.map((validator) => {
3846
- return validator.validator;
3847
- }));
3848
- if (widget.isDisabled) {
3849
- formControl.disable();
3850
- }
3851
- this.group[`${widget.key}`] = formControl;
3869
+ this.createFormControl(`${widget.key}`, widget.value, widget.isDisabled, widget.validators);
3852
3870
  }
3853
3871
  if (widget.type === SmartFormWidgetType.MATRIX) {
3854
3872
  if (widget.isMultiple) {
@@ -3856,38 +3874,24 @@ class SmartFormService {
3856
3874
  let itemKeys = widget.value.columns.map((value) => value.code);
3857
3875
  dataKeys.forEach((key) => {
3858
3876
  itemKeys.forEach((item) => {
3859
- var _a;
3860
- let formControl = new FormControl(widget.value.data[key][item], (_a = widget.validators) === null || _a === void 0 ? void 0 : _a.map((validator) => {
3861
- return validator.validator;
3862
- }));
3863
- this.group[`${widget.key}.data.${key}.${item}`] = formControl;
3877
+ this.createFormControl(`${widget.key}.data.${key}.${item}`, widget.value.data[key][item], undefined, // TODO really we don't pass widget.isDisabled?
3878
+ widget.validators);
3864
3879
  });
3865
3880
  });
3866
3881
  }
3867
3882
  else {
3868
3883
  Object.keys(widget.value.data).map((key) => {
3869
- var _a;
3870
- let formControl = new FormControl(widget.isMultiple ? widget.value.data[key] : widget.value.data[key][0] || '', (_a = widget.validators) === null || _a === void 0 ? void 0 : _a.map((validator) => {
3871
- return validator.validator;
3872
- }));
3873
- if (widget.isDisabled) {
3874
- formControl.disable();
3875
- }
3876
- this.group[`${widget.key}.${key}`] = formControl;
3884
+ this.createFormControl(`${widget.key}.${key}`, widget.isMultiple ? widget.value.data[key] : widget.value.data[key][0], widget.isDisabled, widget.validators);
3877
3885
  });
3878
3886
  }
3879
3887
  }
3880
3888
  if (widget.type === SmartFormWidgetType.ITEM && parentKey) {
3881
- let formControl = new FormControl(widget.value);
3882
- if (widget.isDisabled) {
3883
- formControl.disable();
3884
- }
3885
- this.group[`${parentKey}.${widget.key}`] = formControl;
3889
+ this.createFormControl(`${parentKey}.${widget.key}`, widget.value, widget.isDisabled, undefined);
3886
3890
  }
3887
- if (widget.type === SmartFormWidgetType.CONTAINER && ((_b = widget.valueList) === null || _b === void 0 ? void 0 : _b.length)) {
3891
+ if (widget.type === SmartFormWidgetType.CONTAINER && ((_a = widget.valueList) === null || _a === void 0 ? void 0 : _a.length)) {
3888
3892
  this.createFormControls(widget.valueList);
3889
3893
  }
3890
- if (widget.type === SmartFormWidgetType.CHECK_BOX_2 && ((_c = widget.valueList) === null || _c === void 0 ? void 0 : _c.length)) {
3894
+ if (widget.type === SmartFormWidgetType.CHECK_BOX_2 && ((_b = widget.valueList) === null || _b === void 0 ? void 0 : _b.length)) {
3891
3895
  this.createFormControls(widget.valueList, widget.key);
3892
3896
  }
3893
3897
  });
@@ -3895,6 +3899,27 @@ class SmartFormService {
3895
3899
  isValidatorInList(validator, list) {
3896
3900
  return list !== undefined && list.length > 0 && list.some((v) => v === validator);
3897
3901
  }
3902
+ createFormControl(key, value, isDisabled, validators) {
3903
+ let formControl = this.group[key];
3904
+ if (!formControl) {
3905
+ formControl = new FormControl();
3906
+ this.group[key] = formControl;
3907
+ }
3908
+ formControl.setValue(value || '');
3909
+ formControl.clearValidators();
3910
+ validators === null || validators === void 0 ? void 0 : validators.map((validator) => {
3911
+ formControl.addValidators(validator.validator);
3912
+ });
3913
+ if (isDisabled !== undefined) {
3914
+ if (isDisabled) {
3915
+ formControl.disable();
3916
+ }
3917
+ else {
3918
+ formControl.enable();
3919
+ }
3920
+ }
3921
+ return formControl;
3922
+ }
3898
3923
  copyValueFromFormToWidgetBeans(widgets, group) {
3899
3924
  widgets.forEach((widget) => {
3900
3925
  var _a;
@@ -13399,42 +13424,45 @@ class SmartFilterEditorContentComponent {
13399
13424
  let key;
13400
13425
  let model = {};
13401
13426
  (_c = (_b = (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.workplaceList) === null || _c === void 0 ? void 0 : _c.filters.forEach((filterExpressionField, index) => {
13402
- var _a, _b, _c, _d, _e, _f, _g, _h;
13427
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
13403
13428
  model[index] = filterExpressionField;
13404
13429
  if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
13405
13430
  key = index + '.expressionData.operand2.selectedValues';
13406
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_a = filterExpressionField.widgetType) !== null && _a !== void 0 ? _a : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13431
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_a = filterExpressionField.widgetType) !== null && _a !== void 0 ? _a : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, (_d = (_c = (_b = filterExpressionField.expressionData) === null || _b === void 0 ? void 0 : _b.operand2) === null || _c === void 0 ? void 0 : _c.valueAsString) !== null && _d !== void 0 ? _d : ''));
13407
13432
  return;
13408
13433
  }
13409
- if (((_b = filterExpressionField.expressionData) === null || _b === void 0 ? void 0 : _b.currentOperation) === 'BETWEEN') {
13434
+ if (((_e = filterExpressionField.expressionData) === null || _e === void 0 ? void 0 : _e.currentOperation) === 'BETWEEN') {
13410
13435
  key = index + '.expressionData.operand2.valueAsString';
13411
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_c = filterExpressionField.widgetType) !== null && _c !== void 0 ? _c : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13436
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_f = filterExpressionField.widgetType) !== null && _f !== void 0 ? _f : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, (_j = (_h = (_g = filterExpressionField.expressionData) === null || _g === void 0 ? void 0 : _g.operand2) === null || _h === void 0 ? void 0 : _h.valueAsString) !== null && _j !== void 0 ? _j : ''));
13412
13437
  key = index + '.expressionData.operand3.valueAsString';
13413
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_d = filterExpressionField.widgetType) !== null && _d !== void 0 ? _d : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13438
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_k = filterExpressionField.widgetType) !== null && _k !== void 0 ? _k : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, (_o = (_m = (_l = filterExpressionField.expressionData) === null || _l === void 0 ? void 0 : _l.operand3) === null || _m === void 0 ? void 0 : _m.valueAsString) !== null && _o !== void 0 ? _o : ''));
13414
13439
  return;
13415
13440
  }
13416
- if ((_e = filterExpressionField.expressionData) === null || _e === void 0 ? void 0 : _e.operand2) {
13441
+ if ((_p = filterExpressionField.expressionData) === null || _p === void 0 ? void 0 : _p.operand2) {
13417
13442
  if (key !== index + '.expressionData.operand2.selectedValues') {
13418
13443
  key = index + '.expressionData.operand2.valueAsString';
13419
13444
  }
13420
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_f = filterExpressionField.widgetType) !== null && _f !== void 0 ? _f : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13445
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_q = filterExpressionField.widgetType) !== null && _q !== void 0 ? _q : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, (_t = (_s = (_r = filterExpressionField.expressionData) === null || _r === void 0 ? void 0 : _r.operand2) === null || _s === void 0 ? void 0 : _s.valueAsString) !== null && _t !== void 0 ? _t : ''));
13421
13446
  return;
13422
13447
  }
13423
- if ((_g = filterExpressionField === null || filterExpressionField === void 0 ? void 0 : filterExpressionField.expressionData) === null || _g === void 0 ? void 0 : _g.operand3) {
13448
+ if ((_u = filterExpressionField === null || filterExpressionField === void 0 ? void 0 : filterExpressionField.expressionData) === null || _u === void 0 ? void 0 : _u.operand3) {
13424
13449
  if (key !== index + '.selectedValues') {
13425
13450
  key = index + '.expressionData.operand3.valueAsString';
13426
13451
  }
13427
- widgets.push(this.constructFormWidget(key, filterExpressionField.label3, (_h = filterExpressionField.widgetType) !== null && _h !== void 0 ? _h : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13452
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label3, (_v = filterExpressionField.widgetType) !== null && _v !== void 0 ? _v : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, (_y = (_x = (_w = filterExpressionField.expressionData) === null || _w === void 0 ? void 0 : _w.operand3) === null || _x === void 0 ? void 0 : _x.valueAsString) !== null && _y !== void 0 ? _y : ''));
13428
13453
  return;
13429
13454
  }
13430
13455
  });
13431
- this.simpleFilterForm = {
13456
+ let smartForm = {
13432
13457
  direction: SmartFormWidgetDirection.ROW,
13433
13458
  componentModel: { data: model },
13434
13459
  useOnValueChangeEvent: true,
13435
13460
  useOnBlurEvent: true,
13436
13461
  widgets,
13437
13462
  };
13463
+ if (!deepEqual(smartForm, this.simpleFilterForm)) {
13464
+ this.simpleFilterForm = smartForm;
13465
+ }
13438
13466
  }
13439
13467
  extractFilterFieldFromFormModel() {
13440
13468
  var _a, _b;
@@ -13530,7 +13558,7 @@ class SmartFilterEditorContentComponent {
13530
13558
  });
13531
13559
  });
13532
13560
  }
13533
- constructFormWidget(key, label, widgetType, possibleValues) {
13561
+ constructFormWidget(key, label, widgetType, possibleValues, value) {
13534
13562
  let type = widgetType;
13535
13563
  if (type === FilterExpressionFieldWidgetType.Date) {
13536
13564
  type = SmartFormWidgetType.DATE_PICKER;
@@ -13539,10 +13567,11 @@ class SmartFilterEditorContentComponent {
13539
13567
  type = SmartFormWidgetType.DATE_TIME_PICKER;
13540
13568
  }
13541
13569
  let widget = {
13570
+ error: undefined,
13542
13571
  key,
13543
13572
  label,
13544
13573
  type,
13545
- value: '',
13574
+ value,
13546
13575
  showLabel: true,
13547
13576
  valueList: possibleValues.map((value) => {
13548
13577
  return {
@@ -14161,11 +14190,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
14161
14190
  type: Injectable
14162
14191
  }], ctorParameters: function () { return [{ type: FilterService }]; } });
14163
14192
 
14164
- let SmartComponentApiClient = class SmartComponentApiClient {
14165
- constructor(inject, auth, pageName) {
14193
+ class SmartComponentApiClient {
14194
+ constructor(inject, auth, pageName, _componentName) {
14166
14195
  this.inject = inject;
14167
14196
  this.auth = auth;
14168
14197
  this.pageName = pageName;
14198
+ this._componentName = _componentName;
14169
14199
  this._destroy$ = new Subject();
14170
14200
  this.detectChange = new SmartSubject(this._destroy$);
14171
14201
  this.uiActionModels = [];
@@ -14174,10 +14204,24 @@ let SmartComponentApiClient = class SmartComponentApiClient {
14174
14204
  this.widgets = new WidgetMap();
14175
14205
  this.formWidgets = new WidgetMap();
14176
14206
  this.useQueryLists = false;
14207
+ // check and calculate pageName
14208
+ if (!this.pageName && !this._componentName) {
14209
+ throw new Error('pageName or componentName must be specified!');
14210
+ }
14211
+ this.viewContext = inject.get(SmartViewContextService);
14212
+ if (this._componentName) {
14213
+ let pageNameForComponent = this.viewContext.getPageNameOfComponent(this._componentName);
14214
+ if (!this.pageName) {
14215
+ this.pageName = pageNameForComponent;
14216
+ }
14217
+ else if (this.pageName !== pageNameForComponent) {
14218
+ throw new Error(`pageName (${pageName}) and componentName (${_componentName}) doesn't match!`);
14219
+ }
14220
+ }
14221
+ // from this point we have this.pageName
14177
14222
  this.detectChange.subscribe((change) => {
14178
14223
  this.handleChanges(change);
14179
14224
  });
14180
- this.viewContext = inject.get(SmartViewContextService);
14181
14225
  this.uiActionService = inject.get(UiActionService);
14182
14226
  this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
14183
14227
  }
@@ -14251,23 +14295,42 @@ let SmartComponentApiClient = class SmartComponentApiClient {
14251
14295
  if (this.useQueryLists) {
14252
14296
  if (!this.getSmartComponentLayoutsQL()) {
14253
14297
  console.warn('SmartComponentLayoutsQL not available!');
14254
- return;
14255
14298
  }
14256
- // TODO maybe we should set comp.parent, not comp.smartComponentLayout.parentComponent..
14257
- this.getSmartComponentLayoutsQL().forEach((comp) => {
14258
- if (comp.smartComponentLayout) {
14259
- SmartComponentLayoutUtility.setParent(comp.smartComponentLayout, this);
14260
- }
14261
- });
14262
- this.getSmartComponentLayoutsQL()
14263
- .changes.pipe(takeUntil(this._destroy$))
14264
- .subscribe((list) => list.forEach((comp) => {
14265
- if (comp.smartComponentLayout) {
14266
- SmartComponentLayoutUtility.setParent(comp.smartComponentLayout, this);
14267
- }
14268
- }));
14299
+ else {
14300
+ this.handleQueryList(this.getSmartComponentLayoutsQL(), (comp) => {
14301
+ if (comp.smartComponentLayout) {
14302
+ // TODO maybe we should set comp.parent, not comp.smartComponentLayout.parentComponent..
14303
+ SmartComponentLayoutUtility.setParent(comp.smartComponentLayout, this);
14304
+ }
14305
+ if (this.uuid && this.uuid !== comp.uuid)
14306
+ comp.uuid = this.uuid;
14307
+ });
14308
+ }
14309
+ if (!this.getSmartGridsQL()) {
14310
+ console.warn('SmartGridsQL not available!');
14311
+ }
14312
+ else {
14313
+ this.handleQueryList(this.getSmartGridsQL(), (grid) => {
14314
+ if (grid) {
14315
+ if (grid.smartGrid) {
14316
+ grid.smartGrid.uiActionService = this.uiActionService;
14317
+ grid.smartGrid.uiActionDescriptorService = this.uiActionDescriptorService;
14318
+ grid.smartGrid.serviceToUse = this;
14319
+ grid.smartGrid.viewContextService = this.viewContext;
14320
+ }
14321
+ if (this.uuid && this.uuid !== grid.uuid)
14322
+ grid.uuid = this.uuid;
14323
+ }
14324
+ });
14325
+ }
14269
14326
  }
14270
14327
  }
14328
+ handleQueryList(ql, handler) {
14329
+ ql.forEach((el) => handler(el));
14330
+ this.getSmartComponentLayoutsQL()
14331
+ .changes.pipe(takeUntil(this._destroy$))
14332
+ .subscribe((list) => list.forEach((el) => handler(el)));
14333
+ }
14271
14334
  getWidgets() {
14272
14335
  if (this.useQueryLists) {
14273
14336
  let widgets = new WidgetMap();
@@ -14665,10 +14728,7 @@ let SmartComponentApiClient = class SmartComponentApiClient {
14665
14728
  handleConstraintChange(changes, changeKey) {
14666
14729
  this.model.constraints = changes[changeKey];
14667
14730
  }
14668
- };
14669
- SmartComponentApiClient = __decorate([
14670
- __param(2, Inject('pageName'))
14671
- ], SmartComponentApiClient);
14731
+ }
14672
14732
  class WidgetMap {
14673
14733
  constructor() {
14674
14734
  this._widgets = new Map();