@smartbit4all/ng-client 3.2.4 → 3.2.6
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.
- package/esm2020/lib/smart-client/smart-component-api-client.mjs +53 -25
- package/esm2020/lib/smart-filter-editor/api/api/filter.service.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/configuration.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/encoder.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBoolOperator.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderApiConfig.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderField.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderGroup.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderModel.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionBuilderUiModel.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionData.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionDataType.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionField.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldEditor.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldList.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionFieldWidgetType.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionList.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionOperandData.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/model/filterExpressionOperation.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/param.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/api/variables.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-item/smart-filter-expression-item.component.mjs +9 -9
- package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-items/smart-filter-expression-items.component.mjs +12 -14
- package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.mjs +56 -61
- package/esm2020/lib/smart-filter-editor/smart-filter-params/components/smart-filter-param/smart-filter-param.component.mjs +7 -11
- package/esm2020/lib/smart-filter-editor/smart-filter-params/smart-filter-params.component.mjs +5 -57
- package/esm2020/lib/smart-form/api/model/models.mjs +1 -1
- package/esm2020/lib/smart-form/api/model/smartWidgetDefinition.mjs +1 -1
- package/esm2020/lib/smart-form/api/model/smartWidgetHint.mjs +1 -1
- package/esm2020/lib/smart-form/services/smartform.service.mjs +33 -30
- package/esm2020/lib/smart-grid/api/grid-api/api/api.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/api/grid.service.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/api.module.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/configuration.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/encoder.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/index.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnContentType.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridColumnMeta.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridDataAccessConfig.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridModel.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridPage.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionMode.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridSelectionType.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridServerModel.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridUpdateData.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/gridView.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/model/models.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/param.mjs +1 -1
- package/esm2020/lib/smart-grid/api/grid-api/variables.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/api/tree.service.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/configuration.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/encoder.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/param.mjs +1 -1
- package/esm2020/lib/smart-tree/tree-api/variables.mjs +1 -1
- package/esm2020/lib/view-context/api/api/view.service.mjs +1 -1
- package/esm2020/lib/view-context/api/model/uploadedFile.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewContextChange.mjs +1 -1
- package/esm2020/lib/view-context/api/model/viewEventHandler.mjs +1 -1
- package/esm2020/lib/view-context/smart-view-context.model.mjs +1 -1
- package/esm2020/lib/view-context/smart-view-context.service.mjs +48 -24
- package/esm2020/lib/view-context/value-api/api/api.mjs +1 -1
- package/esm2020/lib/view-context/value-api/api/value.service.mjs +1 -1
- package/esm2020/lib/view-context/value-api/api.module.mjs +1 -1
- package/esm2020/lib/view-context/value-api/configuration.mjs +1 -1
- package/esm2020/lib/view-context/value-api/encoder.mjs +1 -1
- package/esm2020/lib/view-context/value-api/index.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/genericValue.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/models.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/value.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetData.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetDefinition.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetDefinitionData.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetDefinitionIdentifier.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetDefinitionKind.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetExpression.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetOperand.mjs +1 -1
- package/esm2020/lib/view-context/value-api/model/valueSetOperation.mjs +1 -1
- package/esm2020/lib/view-context/value-api/param.mjs +1 -1
- package/esm2020/lib/view-context/value-api/variables.mjs +1 -1
- package/fesm2015/smartbit4all-ng-client.mjs +760 -764
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +757 -759
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-client/smart-component-api-client.d.ts +4 -2
- package/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-item/smart-filter-expression-item.component.d.ts +4 -4
- package/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-items/smart-filter-expression-items.component.d.ts +6 -7
- package/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.d.ts +2 -7
- package/lib/smart-filter-editor/smart-filter-params/components/smart-filter-param/smart-filter-param.component.d.ts +2 -6
- package/lib/smart-filter-editor/smart-filter-params/smart-filter-params.component.d.ts +2 -3
- package/lib/smart-form/services/smartform.service.d.ts +1 -0
- package/lib/view-context/smart-view-context.model.d.ts +5 -4
- package/lib/view-context/smart-view-context.service.d.ts +9 -3
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.2.6.tgz +0 -0
- package/src/lib/smart-filter-editor/api/README.md +226 -226
- package/src/lib/smart-grid/api/grid-api/README.md +226 -226
- package/src/lib/smart-tree/tree-api/README.md +226 -226
- package/src/lib/view-context/value-api/README.md +226 -226
- package/smartbit4all-ng-client-3.2.4.tgz +0 -0
|
@@ -73,7 +73,6 @@ import { MatToolbarModule } from '@angular/material/toolbar';
|
|
|
73
73
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
74
74
|
import * as i3$4 from '@angular/material/tabs';
|
|
75
75
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
76
|
-
import { __decorate, __param } from 'tslib';
|
|
77
76
|
|
|
78
77
|
class SmartSubject extends Subject {
|
|
79
78
|
constructor(unsubscribe$) {
|
|
@@ -2592,8 +2591,10 @@ class SmartViewContextService {
|
|
|
2592
2591
|
this.dialog = dialog;
|
|
2593
2592
|
this.apiQueueService = apiQueueService;
|
|
2594
2593
|
this.inject = inject;
|
|
2595
|
-
this.
|
|
2596
|
-
this.
|
|
2594
|
+
this.viewContextUuidName = 'viewContextUuid';
|
|
2595
|
+
this.viewContextUuidHeaderName = 'viewContextUuid';
|
|
2596
|
+
this.pageNamePrefix = 'page.';
|
|
2597
|
+
this.componentNamePrefix = 'component.';
|
|
2597
2598
|
this.viewHandlers = new Array();
|
|
2598
2599
|
this.openedViewUuids = new Array();
|
|
2599
2600
|
this.openedViewData = new Array();
|
|
@@ -2658,7 +2659,7 @@ class SmartViewContextService {
|
|
|
2658
2659
|
}
|
|
2659
2660
|
async getAndSyncViewContext(uuid) {
|
|
2660
2661
|
if (!uuid) {
|
|
2661
|
-
uuid = this.
|
|
2662
|
+
uuid = this.getViewContextUuid();
|
|
2662
2663
|
}
|
|
2663
2664
|
await this.getViewContext(uuid).then(() => {
|
|
2664
2665
|
this.syncView();
|
|
@@ -2673,11 +2674,7 @@ class SmartViewContextService {
|
|
|
2673
2674
|
}
|
|
2674
2675
|
async getViewContextDataByPageName(pageName) {
|
|
2675
2676
|
if (!this.viewContext) {
|
|
2676
|
-
|
|
2677
|
-
if (!viewContextUuid) {
|
|
2678
|
-
throw new Error('View context is not initialized!');
|
|
2679
|
-
}
|
|
2680
|
-
await this.getViewContext(viewContextUuid);
|
|
2677
|
+
await this.getViewContext(this.getViewContextUuid());
|
|
2681
2678
|
}
|
|
2682
2679
|
let pageUuid = this.getUuidOfPage(pageName);
|
|
2683
2680
|
let viewContextByPageName = this.viewContext?.views.find((view) => view.uuid === pageUuid);
|
|
@@ -2695,13 +2692,6 @@ class SmartViewContextService {
|
|
|
2695
2692
|
this.openedViewData = [];
|
|
2696
2693
|
this.openedViewUuids = [];
|
|
2697
2694
|
}
|
|
2698
|
-
setTabId(tabId) {
|
|
2699
|
-
sessionStorage.setItem(this.tabIdName, tabId);
|
|
2700
|
-
this.session.addHeaderParam({
|
|
2701
|
-
headerName: this.tabIdhttpHeaderName,
|
|
2702
|
-
value: tabId,
|
|
2703
|
-
});
|
|
2704
|
-
}
|
|
2705
2695
|
async startViewContext() {
|
|
2706
2696
|
this.clearSessionStorage();
|
|
2707
2697
|
let newViewContext = await this.view
|
|
@@ -2711,7 +2701,7 @@ class SmartViewContextService {
|
|
|
2711
2701
|
throw new Error('No ViewContext was created');
|
|
2712
2702
|
}
|
|
2713
2703
|
this.viewContext = newViewContext;
|
|
2714
|
-
this.
|
|
2704
|
+
this.setViewContextUuid(newViewContext.uuid);
|
|
2715
2705
|
return this.viewContext;
|
|
2716
2706
|
}
|
|
2717
2707
|
async initialize(uuid) {
|
|
@@ -2728,7 +2718,7 @@ class SmartViewContextService {
|
|
|
2728
2718
|
throw new Error('The messageDialogName provided by the backend has not been set.');
|
|
2729
2719
|
}
|
|
2730
2720
|
if (uuid) {
|
|
2731
|
-
this.
|
|
2721
|
+
this.setViewContextUuid(uuid);
|
|
2732
2722
|
try {
|
|
2733
2723
|
await this.getViewContext(uuid);
|
|
2734
2724
|
}
|
|
@@ -2766,7 +2756,7 @@ class SmartViewContextService {
|
|
|
2766
2756
|
try {
|
|
2767
2757
|
this.openedViewUuids.push(view.uuid);
|
|
2768
2758
|
this.openedViewData.push(view);
|
|
2769
|
-
|
|
2759
|
+
this.setUuidOfPage(view.viewName, view.uuid, viewHandler.componentName);
|
|
2770
2760
|
dialogRef = this.dialog.openComponentAsDialog(viewHandler.component, viewHandler.name);
|
|
2771
2761
|
}
|
|
2772
2762
|
finally {
|
|
@@ -2774,9 +2764,9 @@ class SmartViewContextService {
|
|
|
2774
2764
|
if (index >= 0) {
|
|
2775
2765
|
this.openedViewUuids.splice(index, 1);
|
|
2776
2766
|
this.openedViewData.splice(index, 1);
|
|
2777
|
-
|
|
2767
|
+
this.clearUuidOfPage(view.viewName, viewHandler.componentName);
|
|
2778
2768
|
}
|
|
2779
|
-
|
|
2769
|
+
this.setUuidOfPage(view.viewName, view.uuid, viewHandler.componentName);
|
|
2780
2770
|
}
|
|
2781
2771
|
let dialogDisableClose = true;
|
|
2782
2772
|
let isMessageDialog = view.viewName === this.messageDialogname;
|
|
@@ -2819,7 +2809,7 @@ class SmartViewContextService {
|
|
|
2819
2809
|
view.state = ViewState.Opened;
|
|
2820
2810
|
this.openedViewUuids.push(view.uuid);
|
|
2821
2811
|
this.openedViewData.push(view);
|
|
2822
|
-
|
|
2812
|
+
this.setUuidOfPage(view.viewName, view.uuid, viewHandler.componentName);
|
|
2823
2813
|
this.uuidOfPageHasBeenChanged.next(view.viewName);
|
|
2824
2814
|
this.updateViewContext({
|
|
2825
2815
|
updates: [
|
|
@@ -2859,7 +2849,7 @@ class SmartViewContextService {
|
|
|
2859
2849
|
if (index >= 0) {
|
|
2860
2850
|
this.openedViewUuids.splice(index, 1);
|
|
2861
2851
|
this.openedViewData.splice(index, 1);
|
|
2862
|
-
|
|
2852
|
+
this.clearUuidOfPage(view.viewName, viewHandler.componentName);
|
|
2863
2853
|
}
|
|
2864
2854
|
this.updateViewContext({
|
|
2865
2855
|
updates: [
|
|
@@ -2943,13 +2933,46 @@ class SmartViewContextService {
|
|
|
2943
2933
|
});
|
|
2944
2934
|
this.viewContextHasBeenSynced.next();
|
|
2945
2935
|
}
|
|
2936
|
+
setViewContextUuid(uuid) {
|
|
2937
|
+
sessionStorage.setItem(this.viewContextUuidName, uuid);
|
|
2938
|
+
this.session.addHeaderParam({
|
|
2939
|
+
headerName: this.viewContextUuidHeaderName,
|
|
2940
|
+
value: uuid,
|
|
2941
|
+
});
|
|
2942
|
+
}
|
|
2943
|
+
getViewContextUuid() {
|
|
2944
|
+
let viewContextUuid = sessionStorage.getItem(this.viewContextUuidName);
|
|
2945
|
+
if (!viewContextUuid) {
|
|
2946
|
+
throw new Error('View context is not initialized!');
|
|
2947
|
+
}
|
|
2948
|
+
return viewContextUuid;
|
|
2949
|
+
}
|
|
2950
|
+
setUuidOfPage(pageName, uuid, componentName) {
|
|
2951
|
+
sessionStorage.setItem(this.pageNamePrefix + pageName, uuid);
|
|
2952
|
+
if (componentName) {
|
|
2953
|
+
sessionStorage.setItem(this.componentNamePrefix + componentName, pageName);
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
clearUuidOfPage(pageName, componentName) {
|
|
2957
|
+
sessionStorage.removeItem(this.pageNamePrefix + pageName);
|
|
2958
|
+
if (componentName) {
|
|
2959
|
+
sessionStorage.removeItem(this.componentNamePrefix + componentName);
|
|
2960
|
+
}
|
|
2961
|
+
}
|
|
2946
2962
|
getUuidOfPage(pageName) {
|
|
2947
|
-
let uuid = sessionStorage.getItem(pageName);
|
|
2963
|
+
let uuid = sessionStorage.getItem(this.pageNamePrefix + pageName);
|
|
2948
2964
|
if (!uuid) {
|
|
2949
2965
|
throw new Error(`The uuid of ${pageName} is not available.`);
|
|
2950
2966
|
}
|
|
2951
2967
|
return uuid;
|
|
2952
2968
|
}
|
|
2969
|
+
getPageNameOfComponent(componentName) {
|
|
2970
|
+
let pageName = sessionStorage.getItem(this.componentNamePrefix + componentName);
|
|
2971
|
+
if (!pageName) {
|
|
2972
|
+
throw new Error(`The pageName of ${componentName} is not available.`);
|
|
2973
|
+
}
|
|
2974
|
+
return pageName;
|
|
2975
|
+
}
|
|
2953
2976
|
async message(messageData, messageResult) {
|
|
2954
2977
|
return await this.handlePerformActionResponse(await this.view
|
|
2955
2978
|
.message(messageData.viewUuid ?? '', messageData.uuid, messageResult)
|
|
@@ -3877,11 +3900,12 @@ class SmartFormService {
|
|
|
3877
3900
|
}
|
|
3878
3901
|
toFormGroup() {
|
|
3879
3902
|
this.createFormControls(this.smartForm.widgets);
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3903
|
+
if (this.formGroup) {
|
|
3904
|
+
this.formGroup.controls = this.group;
|
|
3905
|
+
}
|
|
3906
|
+
else {
|
|
3907
|
+
this.formGroup = new FormGroup(this.group);
|
|
3908
|
+
}
|
|
3885
3909
|
if (this.smartForm.validators && this.smartForm.validators.length) {
|
|
3886
3910
|
this.formGroup.setValidators(this.smartForm.validators.map((validator) => {
|
|
3887
3911
|
return validator.validator;
|
|
@@ -3903,14 +3927,7 @@ class SmartFormService {
|
|
|
3903
3927
|
widget.type !== SmartFormWidgetType.COMPONENT &&
|
|
3904
3928
|
widget.type !== SmartFormWidgetType.MATRIX &&
|
|
3905
3929
|
widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
|
|
3906
|
-
|
|
3907
|
-
let formControl = new FormControl(widget.value || '', widget.validators?.map((validator) => {
|
|
3908
|
-
return validator.validator;
|
|
3909
|
-
}));
|
|
3910
|
-
if (widget.isDisabled) {
|
|
3911
|
-
formControl.disable();
|
|
3912
|
-
}
|
|
3913
|
-
this.group[`${widget.key}`] = formControl;
|
|
3930
|
+
this.createFormControl(`${widget.key}`, widget.value, widget.isDisabled, widget.validators);
|
|
3914
3931
|
}
|
|
3915
3932
|
if (widget.type === SmartFormWidgetType.MATRIX) {
|
|
3916
3933
|
if (widget.isMultiple) {
|
|
@@ -3918,31 +3935,19 @@ class SmartFormService {
|
|
|
3918
3935
|
let itemKeys = widget.value.columns.map((value) => value.code);
|
|
3919
3936
|
dataKeys.forEach((key) => {
|
|
3920
3937
|
itemKeys.forEach((item) => {
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
}));
|
|
3924
|
-
this.group[`${widget.key}.data.${key}.${item}`] = formControl;
|
|
3938
|
+
this.createFormControl(`${widget.key}.data.${key}.${item}`, widget.value.data[key][item], undefined, // TODO really we don't pass widget.isDisabled?
|
|
3939
|
+
widget.validators);
|
|
3925
3940
|
});
|
|
3926
3941
|
});
|
|
3927
3942
|
}
|
|
3928
3943
|
else {
|
|
3929
3944
|
Object.keys(widget.value.data).map((key) => {
|
|
3930
|
-
|
|
3931
|
-
return validator.validator;
|
|
3932
|
-
}));
|
|
3933
|
-
if (widget.isDisabled) {
|
|
3934
|
-
formControl.disable();
|
|
3935
|
-
}
|
|
3936
|
-
this.group[`${widget.key}.${key}`] = formControl;
|
|
3945
|
+
this.createFormControl(`${widget.key}.${key}`, widget.isMultiple ? widget.value.data[key] : widget.value.data[key][0], widget.isDisabled, widget.validators);
|
|
3937
3946
|
});
|
|
3938
3947
|
}
|
|
3939
3948
|
}
|
|
3940
3949
|
if (widget.type === SmartFormWidgetType.ITEM && parentKey) {
|
|
3941
|
-
|
|
3942
|
-
if (widget.isDisabled) {
|
|
3943
|
-
formControl.disable();
|
|
3944
|
-
}
|
|
3945
|
-
this.group[`${parentKey}.${widget.key}`] = formControl;
|
|
3950
|
+
this.createFormControl(`${parentKey}.${widget.key}`, widget.value, widget.isDisabled, undefined);
|
|
3946
3951
|
}
|
|
3947
3952
|
if (widget.type === SmartFormWidgetType.CONTAINER && widget.valueList?.length) {
|
|
3948
3953
|
this.createFormControls(widget.valueList);
|
|
@@ -3955,6 +3960,27 @@ class SmartFormService {
|
|
|
3955
3960
|
isValidatorInList(validator, list) {
|
|
3956
3961
|
return list !== undefined && list.length > 0 && list.some((v) => v === validator);
|
|
3957
3962
|
}
|
|
3963
|
+
createFormControl(key, value, isDisabled, validators) {
|
|
3964
|
+
let formControl = this.group[key];
|
|
3965
|
+
if (!formControl) {
|
|
3966
|
+
formControl = new FormControl();
|
|
3967
|
+
this.group[key] = formControl;
|
|
3968
|
+
}
|
|
3969
|
+
formControl.setValue(value || '');
|
|
3970
|
+
formControl.clearValidators();
|
|
3971
|
+
validators?.map((validator) => {
|
|
3972
|
+
formControl.addValidators(validator.validator);
|
|
3973
|
+
});
|
|
3974
|
+
if (isDisabled !== undefined) {
|
|
3975
|
+
if (isDisabled) {
|
|
3976
|
+
formControl.disable();
|
|
3977
|
+
}
|
|
3978
|
+
else {
|
|
3979
|
+
formControl.enable();
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
return formControl;
|
|
3983
|
+
}
|
|
3958
3984
|
copyValueFromFormToWidgetBeans(widgets, group) {
|
|
3959
3985
|
widgets.forEach((widget) => {
|
|
3960
3986
|
if (widget.type === SmartFormWidgetType.CONTAINER && widget.valueList?.length) {
|
|
@@ -13022,621 +13048,243 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
13022
13048
|
}]
|
|
13023
13049
|
}] });
|
|
13024
13050
|
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13051
|
+
class SmartFilterParamComponent {
|
|
13052
|
+
constructor() { }
|
|
13053
|
+
onItemClick(item) {
|
|
13054
|
+
this.data.serviceToUse.peformWidgetAction({
|
|
13055
|
+
code: 'ADD_FILTER_EXPRESSION',
|
|
13056
|
+
params: {
|
|
13057
|
+
model: item,
|
|
13058
|
+
},
|
|
13059
|
+
});
|
|
13032
13060
|
}
|
|
13033
|
-
|
|
13034
|
-
|
|
13061
|
+
}
|
|
13062
|
+
SmartFilterParamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13063
|
+
SmartFilterParamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamComponent, selector: "app-target-group-filter-param", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"], components: [{ type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }], directives: [{ type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
13064
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
|
|
13065
|
+
type: Component,
|
|
13066
|
+
args: [{ selector: 'app-target-group-filter-param', template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"] }]
|
|
13067
|
+
}], ctorParameters: function () { return []; }, propDecorators: { data: [{
|
|
13068
|
+
type: Input
|
|
13069
|
+
}] } });
|
|
13070
|
+
|
|
13071
|
+
class SmartFilterParamsComponent {
|
|
13072
|
+
constructor() {
|
|
13073
|
+
this._destroy$ = new Subject();
|
|
13074
|
+
this.expandableSections = [];
|
|
13035
13075
|
}
|
|
13036
|
-
|
|
13037
|
-
|
|
13076
|
+
ngOnInit() {
|
|
13077
|
+
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13078
|
+
this.setUp(this.service.model);
|
|
13079
|
+
});
|
|
13080
|
+
this.setUp(this.service.model);
|
|
13038
13081
|
}
|
|
13039
|
-
|
|
13040
|
-
|
|
13082
|
+
ngOnDestroy() {
|
|
13083
|
+
this._destroy$.next();
|
|
13084
|
+
this._destroy$.complete();
|
|
13041
13085
|
}
|
|
13042
|
-
|
|
13086
|
+
setUp(model) {
|
|
13087
|
+
this.filterBuilder = model.model;
|
|
13088
|
+
this.constructExpandableSections();
|
|
13089
|
+
}
|
|
13090
|
+
constructExpandableSections() {
|
|
13091
|
+
if (this.filterBuilder.groups) {
|
|
13092
|
+
this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
|
|
13093
|
+
return {
|
|
13094
|
+
title: filterExpressionBuilderGroup.label,
|
|
13095
|
+
cssClass: 'filterExpressionBuilderGroup',
|
|
13096
|
+
customComponent: SmartFilterParamComponent,
|
|
13097
|
+
data: {
|
|
13098
|
+
group: filterExpressionBuilderGroup.fields,
|
|
13099
|
+
serviceToUse: this.service,
|
|
13100
|
+
},
|
|
13101
|
+
inputName: 'data',
|
|
13102
|
+
isExpanded: true,
|
|
13103
|
+
};
|
|
13104
|
+
});
|
|
13105
|
+
}
|
|
13106
|
+
}
|
|
13107
|
+
}
|
|
13108
|
+
SmartFilterParamsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13109
|
+
SmartFilterParamsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamsComponent, selector: "smart-filter-group-params", inputs: { service: "service" }, viewQueries: [{ propertyName: "filterVcRef", first: true, predicate: ["smartFilter"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <!-- <ng-template #smartFilter></ng-template> -->\r\n <!-- <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div> -->\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"], components: [{ type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
13110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
|
|
13111
|
+
type: Component,
|
|
13112
|
+
args: [{ selector: 'smart-filter-group-params', template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <!-- <ng-template #smartFilter></ng-template> -->\r\n <!-- <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div> -->\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"] }]
|
|
13113
|
+
}], ctorParameters: function () { return []; }, propDecorators: { service: [{
|
|
13114
|
+
type: Input
|
|
13115
|
+
}], filterVcRef: [{
|
|
13116
|
+
type: ViewChild,
|
|
13117
|
+
args: ['smartFilter', { read: ViewContainerRef }]
|
|
13118
|
+
}] } });
|
|
13043
13119
|
|
|
13044
|
-
|
|
13045
|
-
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
|
|
13049
|
-
|
|
13050
|
-
};
|
|
13120
|
+
var FilterExpressionBuilderUiModel;
|
|
13121
|
+
(function (FilterExpressionBuilderUiModel) {
|
|
13122
|
+
FilterExpressionBuilderUiModel.TypeEnum = {
|
|
13123
|
+
Simple: 'SIMPLE',
|
|
13124
|
+
Complex: 'COMPLEX'
|
|
13125
|
+
};
|
|
13126
|
+
})(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
|
|
13051
13127
|
|
|
13052
|
-
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
|
|
13060
|
-
|
|
13061
|
-
|
|
13062
|
-
|
|
13128
|
+
var FilterExpressionBuilderApiActions;
|
|
13129
|
+
(function (FilterExpressionBuilderApiActions) {
|
|
13130
|
+
FilterExpressionBuilderApiActions["OPEN_FILTER_GROUPS"] = "OPEN_FILTER_GROUPS";
|
|
13131
|
+
FilterExpressionBuilderApiActions["CLOSE_FILTER_GROUPS"] = "CLOSE_FILTER_GROUPS";
|
|
13132
|
+
FilterExpressionBuilderApiActions["ADD_BRACKET"] = "ADD_BRACKET";
|
|
13133
|
+
FilterExpressionBuilderApiActions["ADD_FILTER_EXPRESSION"] = "ADD_FILTER_EXPRESSION";
|
|
13134
|
+
FilterExpressionBuilderApiActions["REMOVE_FILTER_EXPRESSION"] = "REMOVE_FILTER_EXPRESSION";
|
|
13135
|
+
FilterExpressionBuilderApiActions["REDO"] = "REDO";
|
|
13136
|
+
FilterExpressionBuilderApiActions["FILTER_GROUPS"] = "AFILTER_GROUPS";
|
|
13137
|
+
FilterExpressionBuilderApiActions["SELECT_FIELD"] = "SELECT_FIELD";
|
|
13138
|
+
FilterExpressionBuilderApiActions["UPDATE_FILTER_EXPRESSION"] = "UPDATE_FILTER_EXPRESSION";
|
|
13139
|
+
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_DATA"] = "SAVE_EXPRESSION_DATA";
|
|
13140
|
+
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_FIELD_LIST"] = "SAVE_EXPRESSION_FIELD_LIST";
|
|
13141
|
+
})(FilterExpressionBuilderApiActions || (FilterExpressionBuilderApiActions = {}));
|
|
13142
|
+
|
|
13143
|
+
class SmartFilterExpressionItemComponent {
|
|
13144
|
+
constructor() {
|
|
13145
|
+
this.isSelected = false;
|
|
13146
|
+
}
|
|
13147
|
+
ngOnInit() {
|
|
13148
|
+
this.isSelected =
|
|
13149
|
+
JSON.stringify(this.service.model?.selectedField) === JSON.stringify(this.item);
|
|
13150
|
+
}
|
|
13151
|
+
setOperatorTo(event, operationType) {
|
|
13152
|
+
event?.stopPropagation();
|
|
13153
|
+
if (!this.service.model?.readOnly) {
|
|
13154
|
+
this.item.expressionData.boolOperator = operationType;
|
|
13155
|
+
this.service.peformWidgetAction({
|
|
13156
|
+
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13157
|
+
params: {
|
|
13158
|
+
model: this.item,
|
|
13159
|
+
},
|
|
13160
|
+
});
|
|
13063
13161
|
}
|
|
13064
|
-
|
|
13065
|
-
|
|
13162
|
+
}
|
|
13163
|
+
select(event, item) {
|
|
13164
|
+
event?.stopPropagation();
|
|
13165
|
+
if (!this.service.model?.readOnly) {
|
|
13166
|
+
if (!this.isSelected) {
|
|
13167
|
+
this.service.peformWidgetAction({
|
|
13168
|
+
code: 'SELECT_FIELD',
|
|
13169
|
+
params: {
|
|
13170
|
+
model: this.item,
|
|
13171
|
+
},
|
|
13172
|
+
});
|
|
13173
|
+
}
|
|
13174
|
+
else {
|
|
13175
|
+
this.service.peformWidgetAction({
|
|
13176
|
+
code: 'SELECT_FIELD',
|
|
13177
|
+
params: {
|
|
13178
|
+
model: this.item,
|
|
13179
|
+
},
|
|
13180
|
+
});
|
|
13181
|
+
}
|
|
13066
13182
|
}
|
|
13067
|
-
|
|
13068
|
-
|
|
13183
|
+
}
|
|
13184
|
+
}
|
|
13185
|
+
SmartFilterExpressionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13186
|
+
SmartFilterExpressionItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterExpressionItemComponent, selector: "app-expression-item", inputs: { item: "item", hasNext: "hasNext", service: "service" }, ngImport: i0, template: "<div class=\"expressionItemContainer\">\r\n <div\r\n class=\"expressionItemInnerContainer\"\r\n [ngClass]=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION'\r\n ? isSelected\r\n ? 'selectedExpressionContainer'\r\n : 'expressionContainer'\r\n : ''\r\n \"\r\n (click)=\"select($event, item)\"\r\n >\r\n <div\r\n *ngIf=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION';\r\n then expression;\r\n else simpleItem\r\n \"\r\n ></div>\r\n <ng-template #expression>\r\n <div class=\"expressionItemBubble expression\">[</div>\r\n <app-expression-item\r\n [item]=\"subItem\"\r\n [hasNext]=\"i < (item.subFieldList?.filters)!.length - 1\"\r\n *ngFor=\"let subItem of item.subFieldList?.filters; let i = index\"\r\n ></app-expression-item>\r\n <div class=\"expressionItemBubble expression\">]</div>\r\n </ng-template>\r\n <ng-template #simpleItem>\r\n <div\r\n class=\"expressionItemBubble simpleItem\"\r\n [ngClass]=\"isSelected ? 'selectedSimpleItem' : ''\"\r\n >\r\n {{ item.label\r\n }}{{ item.expressionData?.operand2?.valueAsString ? \": \" : \"\" }}\r\n <b>\r\n {{ item.expressionData?.operand2?.valueAsString }}\r\n </b>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"hasNext\" class=\"relationItemBubble\">\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'AND')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'AND' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n \u00C9S\r\n </button>\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'OR')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'OR' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n VAGY\r\n </button>\r\n </div>\r\n <!-- <button mat-mini-fab color=\"gray\">\r\n\t\t<smart-icon icon=\"X\" color=\"gray\"></smart-icon>\r\n\t</button> -->\r\n</div>\r\n", styles: [".expressionItemContainer{display:flex;flex-direction:row;gap:.75rem}.expressionItemInnerContainer{display:flex;flex-direction:row;grid-area:.75rem;padding:.25rem;border-radius:.25rem}.expressionContainer{border:1px dashed var(--primary-lighter-gray-color);cursor:pointer}.selectedExpressionContainer{border:2px dashed var(--primary-darker-color)}.expressionItemBubble,.relationItemBubble{display:flex;flex-direction:row;border-radius:1.5rem}.expressionItemBubble{padding:.75rem}.expression{background-color:var(--inner-container);font-weight:600;margin:auto 0}.simpleItem{background-color:#c6ddff;cursor:pointer}.selectedSimpleItem{border:2px solid var(--primary-color)}.relationItemBubble{border:1px solid #cdcdcd;padding:.25rem}.relationItemBubble .mat-button{border-radius:1.5rem;height:100%;margin:auto 0}\n"], components: [{ type: SmartFilterExpressionItemComponent, selector: "app-expression-item", inputs: ["item", "hasNext", "service"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
13187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, decorators: [{
|
|
13188
|
+
type: Component,
|
|
13189
|
+
args: [{ selector: 'app-expression-item', template: "<div class=\"expressionItemContainer\">\r\n <div\r\n class=\"expressionItemInnerContainer\"\r\n [ngClass]=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION'\r\n ? isSelected\r\n ? 'selectedExpressionContainer'\r\n : 'expressionContainer'\r\n : ''\r\n \"\r\n (click)=\"select($event, item)\"\r\n >\r\n <div\r\n *ngIf=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION';\r\n then expression;\r\n else simpleItem\r\n \"\r\n ></div>\r\n <ng-template #expression>\r\n <div class=\"expressionItemBubble expression\">[</div>\r\n <app-expression-item\r\n [item]=\"subItem\"\r\n [hasNext]=\"i < (item.subFieldList?.filters)!.length - 1\"\r\n *ngFor=\"let subItem of item.subFieldList?.filters; let i = index\"\r\n ></app-expression-item>\r\n <div class=\"expressionItemBubble expression\">]</div>\r\n </ng-template>\r\n <ng-template #simpleItem>\r\n <div\r\n class=\"expressionItemBubble simpleItem\"\r\n [ngClass]=\"isSelected ? 'selectedSimpleItem' : ''\"\r\n >\r\n {{ item.label\r\n }}{{ item.expressionData?.operand2?.valueAsString ? \": \" : \"\" }}\r\n <b>\r\n {{ item.expressionData?.operand2?.valueAsString }}\r\n </b>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"hasNext\" class=\"relationItemBubble\">\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'AND')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'AND' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n \u00C9S\r\n </button>\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'OR')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'OR' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n VAGY\r\n </button>\r\n </div>\r\n <!-- <button mat-mini-fab color=\"gray\">\r\n\t\t<smart-icon icon=\"X\" color=\"gray\"></smart-icon>\r\n\t</button> -->\r\n</div>\r\n", styles: [".expressionItemContainer{display:flex;flex-direction:row;gap:.75rem}.expressionItemInnerContainer{display:flex;flex-direction:row;grid-area:.75rem;padding:.25rem;border-radius:.25rem}.expressionContainer{border:1px dashed var(--primary-lighter-gray-color);cursor:pointer}.selectedExpressionContainer{border:2px dashed var(--primary-darker-color)}.expressionItemBubble,.relationItemBubble{display:flex;flex-direction:row;border-radius:1.5rem}.expressionItemBubble{padding:.75rem}.expression{background-color:var(--inner-container);font-weight:600;margin:auto 0}.simpleItem{background-color:#c6ddff;cursor:pointer}.selectedSimpleItem{border:2px solid var(--primary-color)}.relationItemBubble{border:1px solid #cdcdcd;padding:.25rem}.relationItemBubble .mat-button{border-radius:1.5rem;height:100%;margin:auto 0}\n"] }]
|
|
13190
|
+
}], ctorParameters: function () { return []; }, propDecorators: { item: [{
|
|
13191
|
+
type: Input
|
|
13192
|
+
}], hasNext: [{
|
|
13193
|
+
type: Input
|
|
13194
|
+
}], service: [{
|
|
13195
|
+
type: Input
|
|
13196
|
+
}] } });
|
|
13197
|
+
|
|
13198
|
+
class SmartFilterExpressionItemsComponent {
|
|
13199
|
+
constructor() {
|
|
13200
|
+
this._destroy$ = new Subject();
|
|
13201
|
+
this.isSelected = false;
|
|
13202
|
+
}
|
|
13203
|
+
ngOnInit() {
|
|
13204
|
+
this.service.modelChanged.subscribe(() => {
|
|
13205
|
+
console.log(this.service.model);
|
|
13206
|
+
this.isSelected = this.service.model?.selectedField === null;
|
|
13207
|
+
});
|
|
13208
|
+
this.isSelected = this.service.model?.selectedField === null;
|
|
13209
|
+
}
|
|
13210
|
+
ngOnDestroy() {
|
|
13211
|
+
this._destroy$.next();
|
|
13212
|
+
this._destroy$.complete();
|
|
13213
|
+
}
|
|
13214
|
+
select() {
|
|
13215
|
+
// this.service.selectFilterExpressionField(undefined);
|
|
13216
|
+
}
|
|
13217
|
+
drop(event) {
|
|
13218
|
+
moveItemInArray(this.items, event.previousIndex, event.currentIndex);
|
|
13219
|
+
}
|
|
13220
|
+
}
|
|
13221
|
+
SmartFilterExpressionItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13222
|
+
SmartFilterExpressionItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterExpressionItemsComponent, selector: "app-expression-items", inputs: { items: "items", service: "service" }, ngImport: i0, template: "<div\r\n cdkDropList\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"expressionsContainer example-list\"\r\n [ngClass]=\"isSelected ? 'selected' : ''\"\r\n>\r\n <div cdkDrag class=\"expressionItem\" *ngFor=\"let item of items; let i = index\">\r\n <app-expression-item\r\n [item]=\"item\"\r\n [hasNext]=\"i < items.length - 1\"\r\n [service]=\"service\"\r\n ></app-expression-item>\r\n </div>\r\n</div>\r\n", styles: [".expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;border:1px dashed var(--primary-lighter-gray-color);padding:.25rem;border-radius:.25rem}.selected{border:2px dashed var(--primary-darker-color)}.expressionItem{margin:auto 0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.example-custom-placeholder{background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: SmartFilterExpressionItemComponent, selector: "app-expression-item", inputs: ["item", "hasNext", "service"] }], directives: [{ type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
13223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, decorators: [{
|
|
13224
|
+
type: Component,
|
|
13225
|
+
args: [{ selector: 'app-expression-items', template: "<div\r\n cdkDropList\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"expressionsContainer example-list\"\r\n [ngClass]=\"isSelected ? 'selected' : ''\"\r\n>\r\n <div cdkDrag class=\"expressionItem\" *ngFor=\"let item of items; let i = index\">\r\n <app-expression-item\r\n [item]=\"item\"\r\n [hasNext]=\"i < items.length - 1\"\r\n [service]=\"service\"\r\n ></app-expression-item>\r\n </div>\r\n</div>\r\n", styles: [".expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;border:1px dashed var(--primary-lighter-gray-color);padding:.25rem;border-radius:.25rem}.selected{border:2px dashed var(--primary-darker-color)}.expressionItem{margin:auto 0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.example-custom-placeholder{background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
13226
|
+
}], ctorParameters: function () { return []; }, propDecorators: { items: [{
|
|
13227
|
+
type: Input
|
|
13228
|
+
}], service: [{
|
|
13229
|
+
type: Input
|
|
13230
|
+
}] } });
|
|
13231
|
+
|
|
13232
|
+
class SmartFilterEditorContentComponent {
|
|
13233
|
+
constructor(layoutService) {
|
|
13234
|
+
this.layoutService = layoutService;
|
|
13235
|
+
this._destroy$ = new Subject();
|
|
13236
|
+
this.uiActionModels = [];
|
|
13237
|
+
this.expressionUiActionModels = [];
|
|
13238
|
+
this.type = FilterExpressionBuilderUiModel.TypeEnum;
|
|
13239
|
+
}
|
|
13240
|
+
ngAfterViewInit() {
|
|
13241
|
+
if (this.simpleFilterFormChildren?.first) {
|
|
13242
|
+
this.subsrcibeSimpleFormChildrenEvents();
|
|
13069
13243
|
}
|
|
13070
13244
|
else {
|
|
13071
|
-
this.
|
|
13245
|
+
this.simpleFilterFormChildren?.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13246
|
+
this.subsrcibeSimpleFormChildrenEvents();
|
|
13247
|
+
});
|
|
13072
13248
|
}
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
* Select the correct content-type to use for a request.
|
|
13076
|
-
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
|
13077
|
-
* If no content type is found return the first found type if the contentTypes is not empty
|
|
13078
|
-
* @param contentTypes - the array of content types that are available for selection
|
|
13079
|
-
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
13080
|
-
*/
|
|
13081
|
-
selectHeaderContentType(contentTypes) {
|
|
13082
|
-
if (contentTypes.length === 0) {
|
|
13083
|
-
return undefined;
|
|
13249
|
+
if (this.formChildren?.first) {
|
|
13250
|
+
this.subscribeEditorFormChildrenEvents();
|
|
13084
13251
|
}
|
|
13085
|
-
|
|
13086
|
-
|
|
13087
|
-
|
|
13252
|
+
else {
|
|
13253
|
+
this.formChildren?.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13254
|
+
this.subscribeEditorFormChildrenEvents();
|
|
13255
|
+
});
|
|
13088
13256
|
}
|
|
13089
|
-
return type;
|
|
13090
13257
|
}
|
|
13091
|
-
|
|
13092
|
-
|
|
13093
|
-
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
|
|
13100
|
-
|
|
13101
|
-
}
|
|
13102
|
-
const type = accepts.find((x) => this.isJsonMime(x));
|
|
13103
|
-
if (type === undefined) {
|
|
13104
|
-
return accepts[0];
|
|
13105
|
-
}
|
|
13106
|
-
return type;
|
|
13107
|
-
}
|
|
13108
|
-
/**
|
|
13109
|
-
* Check if the given MIME is a JSON MIME.
|
|
13110
|
-
* JSON MIME examples:
|
|
13111
|
-
* application/json
|
|
13112
|
-
* application/json; charset=UTF8
|
|
13113
|
-
* APPLICATION/JSON
|
|
13114
|
-
* application/vnd.company+json
|
|
13115
|
-
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
13116
|
-
* @return True if the given MIME is JSON, false otherwise.
|
|
13117
|
-
*/
|
|
13118
|
-
isJsonMime(mime) {
|
|
13119
|
-
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
13120
|
-
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
13121
|
-
}
|
|
13122
|
-
lookupCredential(key) {
|
|
13123
|
-
const value = this.credentials[key];
|
|
13124
|
-
return typeof value === 'function'
|
|
13125
|
-
? value()
|
|
13126
|
-
: value;
|
|
13127
|
-
}
|
|
13128
|
-
defaultEncodeParam(param) {
|
|
13129
|
-
// This implementation exists as fallback for missing configuration
|
|
13130
|
-
// and for backwards compatibility to older typescript-angular generator versions.
|
|
13131
|
-
// It only works for the 'simple' parameter style.
|
|
13132
|
-
// Date-handling only works for the 'date-time' format.
|
|
13133
|
-
// All other styles and Date-formats are probably handled incorrectly.
|
|
13134
|
-
//
|
|
13135
|
-
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
|
|
13136
|
-
const value = param.dataFormat === 'date-time' && param.value instanceof Date
|
|
13137
|
-
? param.value.toISOString()
|
|
13138
|
-
: param.value;
|
|
13139
|
-
return encodeURIComponent(String(value));
|
|
13140
|
-
}
|
|
13141
|
-
}
|
|
13142
|
-
|
|
13143
|
-
/**
|
|
13144
|
-
* Filter API 2
|
|
13145
|
-
* Filter API 2
|
|
13146
|
-
*
|
|
13147
|
-
* The version of the OpenAPI document: 1.0.0
|
|
13148
|
-
* Contact: info@it4all.hu
|
|
13149
|
-
*
|
|
13150
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
13151
|
-
* https://openapi-generator.tech
|
|
13152
|
-
* Do not edit the class manually.
|
|
13153
|
-
*/
|
|
13154
|
-
class FilterService {
|
|
13155
|
-
constructor(httpClient, basePath, configuration) {
|
|
13156
|
-
this.httpClient = httpClient;
|
|
13157
|
-
this.basePath = 'http://localhost';
|
|
13158
|
-
this.defaultHeaders = new HttpHeaders();
|
|
13159
|
-
this.configuration = new Configuration();
|
|
13160
|
-
if (configuration) {
|
|
13161
|
-
this.configuration = configuration;
|
|
13162
|
-
}
|
|
13163
|
-
if (typeof this.configuration.basePath !== 'string') {
|
|
13164
|
-
if (Array.isArray(basePath) && basePath.length > 0) {
|
|
13165
|
-
basePath = basePath[0];
|
|
13166
|
-
}
|
|
13167
|
-
if (typeof basePath !== 'string') {
|
|
13168
|
-
basePath = this.basePath;
|
|
13169
|
-
}
|
|
13170
|
-
this.configuration.basePath = basePath;
|
|
13171
|
-
}
|
|
13172
|
-
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
13173
|
-
}
|
|
13174
|
-
// @ts-ignore
|
|
13175
|
-
addToHttpParams(httpParams, value, key) {
|
|
13176
|
-
if (typeof value === "object" && value instanceof Date === false) {
|
|
13177
|
-
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
13178
|
-
}
|
|
13179
|
-
else {
|
|
13180
|
-
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
13181
|
-
}
|
|
13182
|
-
return httpParams;
|
|
13183
|
-
}
|
|
13184
|
-
addToHttpParamsRecursive(httpParams, value, key) {
|
|
13185
|
-
if (value == null) {
|
|
13186
|
-
return httpParams;
|
|
13187
|
-
}
|
|
13188
|
-
if (typeof value === "object") {
|
|
13189
|
-
if (Array.isArray(value)) {
|
|
13190
|
-
value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
|
|
13191
|
-
}
|
|
13192
|
-
else if (value instanceof Date) {
|
|
13193
|
-
if (key != null) {
|
|
13194
|
-
httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
|
|
13195
|
-
}
|
|
13196
|
-
else {
|
|
13197
|
-
throw Error("key may not be null if value is Date");
|
|
13198
|
-
}
|
|
13199
|
-
}
|
|
13200
|
-
else {
|
|
13201
|
-
Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
|
|
13202
|
-
}
|
|
13203
|
-
}
|
|
13204
|
-
else if (key != null) {
|
|
13205
|
-
httpParams = httpParams.append(key, value);
|
|
13206
|
-
}
|
|
13207
|
-
else {
|
|
13208
|
-
throw Error("key may not be null if value is not object or array");
|
|
13209
|
-
}
|
|
13210
|
-
return httpParams;
|
|
13211
|
-
}
|
|
13212
|
-
load(uuid, filterIdentifier, observe = 'body', reportProgress = false, options) {
|
|
13213
|
-
if (uuid === null || uuid === undefined) {
|
|
13214
|
-
throw new Error('Required parameter uuid was null or undefined when calling load.');
|
|
13215
|
-
}
|
|
13216
|
-
if (filterIdentifier === null || filterIdentifier === undefined) {
|
|
13217
|
-
throw new Error('Required parameter filterIdentifier was null or undefined when calling load.');
|
|
13218
|
-
}
|
|
13219
|
-
let localVarHeaders = this.defaultHeaders;
|
|
13220
|
-
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13221
|
-
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13222
|
-
// to determine the Accept header
|
|
13223
|
-
const httpHeaderAccepts = [
|
|
13224
|
-
'application/json'
|
|
13225
|
-
];
|
|
13226
|
-
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13227
|
-
}
|
|
13228
|
-
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13229
|
-
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13230
|
-
}
|
|
13231
|
-
let localVarHttpContext = options && options.context;
|
|
13232
|
-
if (localVarHttpContext === undefined) {
|
|
13233
|
-
localVarHttpContext = new HttpContext();
|
|
13234
|
-
}
|
|
13235
|
-
let responseType_ = 'json';
|
|
13236
|
-
if (localVarHttpHeaderAcceptSelected) {
|
|
13237
|
-
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13238
|
-
responseType_ = 'text';
|
|
13239
|
-
}
|
|
13240
|
-
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13241
|
-
responseType_ = 'json';
|
|
13242
|
-
}
|
|
13243
|
-
else {
|
|
13244
|
-
responseType_ = 'blob';
|
|
13245
|
-
}
|
|
13246
|
-
}
|
|
13247
|
-
let localVarPath = `/filter/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "filterIdentifier", value: filterIdentifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/load`;
|
|
13248
|
-
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
13249
|
-
context: localVarHttpContext,
|
|
13250
|
-
responseType: responseType_,
|
|
13251
|
-
withCredentials: this.configuration.withCredentials,
|
|
13252
|
-
headers: localVarHeaders,
|
|
13253
|
-
observe: observe,
|
|
13254
|
-
reportProgress: reportProgress
|
|
13255
|
-
});
|
|
13256
|
-
}
|
|
13257
|
-
performWidgetAction(uuid, filterIdentifier, body, observe = 'body', reportProgress = false, options) {
|
|
13258
|
-
if (uuid === null || uuid === undefined) {
|
|
13259
|
-
throw new Error('Required parameter uuid was null or undefined when calling performWidgetAction.');
|
|
13260
|
-
}
|
|
13261
|
-
if (filterIdentifier === null || filterIdentifier === undefined) {
|
|
13262
|
-
throw new Error('Required parameter filterIdentifier was null or undefined when calling performWidgetAction.');
|
|
13263
|
-
}
|
|
13264
|
-
if (body === null || body === undefined) {
|
|
13265
|
-
throw new Error('Required parameter body was null or undefined when calling performWidgetAction.');
|
|
13266
|
-
}
|
|
13267
|
-
let localVarHeaders = this.defaultHeaders;
|
|
13268
|
-
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13269
|
-
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13270
|
-
// to determine the Accept header
|
|
13271
|
-
const httpHeaderAccepts = [
|
|
13272
|
-
'application/json'
|
|
13273
|
-
];
|
|
13274
|
-
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13275
|
-
}
|
|
13276
|
-
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13277
|
-
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13278
|
-
}
|
|
13279
|
-
let localVarHttpContext = options && options.context;
|
|
13280
|
-
if (localVarHttpContext === undefined) {
|
|
13281
|
-
localVarHttpContext = new HttpContext();
|
|
13282
|
-
}
|
|
13283
|
-
// to determine the Content-Type header
|
|
13284
|
-
const consumes = [
|
|
13285
|
-
'application/json'
|
|
13286
|
-
];
|
|
13287
|
-
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
13288
|
-
if (httpContentTypeSelected !== undefined) {
|
|
13289
|
-
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
13290
|
-
}
|
|
13291
|
-
let responseType_ = 'json';
|
|
13292
|
-
if (localVarHttpHeaderAcceptSelected) {
|
|
13293
|
-
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13294
|
-
responseType_ = 'text';
|
|
13295
|
-
}
|
|
13296
|
-
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13297
|
-
responseType_ = 'json';
|
|
13298
|
-
}
|
|
13299
|
-
else {
|
|
13300
|
-
responseType_ = 'blob';
|
|
13301
|
-
}
|
|
13302
|
-
}
|
|
13303
|
-
let localVarPath = `/filter/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "filterIdentifier", value: filterIdentifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/performWidgetAction`;
|
|
13304
|
-
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
13305
|
-
context: localVarHttpContext,
|
|
13306
|
-
body: body,
|
|
13307
|
-
responseType: responseType_,
|
|
13308
|
-
withCredentials: this.configuration.withCredentials,
|
|
13309
|
-
headers: localVarHeaders,
|
|
13310
|
-
observe: observe,
|
|
13311
|
-
reportProgress: reportProgress
|
|
13312
|
-
});
|
|
13313
|
-
}
|
|
13314
|
-
}
|
|
13315
|
-
FilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13316
|
-
FilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, providedIn: 'root' });
|
|
13317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, decorators: [{
|
|
13318
|
-
type: Injectable,
|
|
13319
|
-
args: [{
|
|
13320
|
-
providedIn: 'root'
|
|
13321
|
-
}]
|
|
13322
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
13323
|
-
type: Optional
|
|
13324
|
-
}, {
|
|
13325
|
-
type: Inject,
|
|
13326
|
-
args: [BASE_PATH]
|
|
13327
|
-
}] }, { type: Configuration, decorators: [{
|
|
13328
|
-
type: Optional
|
|
13329
|
-
}] }]; } });
|
|
13330
|
-
|
|
13331
|
-
class SmartFilterEditorService {
|
|
13332
|
-
constructor(service) {
|
|
13333
|
-
this.service = service;
|
|
13334
|
-
this.modelChanged = new Subject();
|
|
13335
|
-
this.submit = new Subject();
|
|
13336
|
-
this.reSubscribeToChange = new Subject();
|
|
13337
|
-
}
|
|
13338
|
-
async load() {
|
|
13339
|
-
this.model = await this.service.load(this.config.uuid, this.config.identifier).toPromise();
|
|
13340
|
-
this.modelChanged.next();
|
|
13341
|
-
}
|
|
13342
|
-
async peformWidgetAction(request) {
|
|
13343
|
-
this.model = await this.service
|
|
13344
|
-
.performWidgetAction(this.config.uuid, this.config.identifier, request)
|
|
13345
|
-
.toPromise();
|
|
13346
|
-
this.modelChanged.next();
|
|
13347
|
-
}
|
|
13348
|
-
getModel() {
|
|
13349
|
-
return this.model;
|
|
13350
|
-
}
|
|
13351
|
-
async performUiActionRequest(uiActionRequest, widgetId, nodeId) {
|
|
13352
|
-
await this.peformWidgetAction(uiActionRequest);
|
|
13353
|
-
}
|
|
13354
|
-
async handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
|
|
13355
|
-
return {
|
|
13356
|
-
shouldPerformAction: true,
|
|
13357
|
-
uiActionRequest: uiActionRequest,
|
|
13358
|
-
};
|
|
13359
|
-
}
|
|
13360
|
-
getAdditionalParams(uiAction) {
|
|
13361
|
-
throw new Error('Method not implemented.');
|
|
13362
|
-
}
|
|
13363
|
-
}
|
|
13364
|
-
SmartFilterEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, deps: [{ token: FilterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13365
|
-
SmartFilterEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService });
|
|
13366
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, decorators: [{
|
|
13367
|
-
type: Injectable
|
|
13368
|
-
}], ctorParameters: function () { return [{ type: FilterService }]; } });
|
|
13369
|
-
|
|
13370
|
-
class SmartFilterParamComponent {
|
|
13371
|
-
constructor(service) {
|
|
13372
|
-
this.service = service;
|
|
13373
|
-
}
|
|
13374
|
-
ngOnInit() { }
|
|
13375
|
-
onItemClick(item) {
|
|
13376
|
-
this.data.serviceToUse.peformWidgetAction({
|
|
13377
|
-
code: 'ADD_FILTER_EXPRESSION',
|
|
13378
|
-
params: {
|
|
13379
|
-
model: item,
|
|
13380
|
-
},
|
|
13381
|
-
});
|
|
13382
|
-
}
|
|
13383
|
-
}
|
|
13384
|
-
SmartFilterParamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13385
|
-
SmartFilterParamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamComponent, selector: "app-target-group-filter-param", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"], components: [{ type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }], directives: [{ type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
13386
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
|
|
13387
|
-
type: Component,
|
|
13388
|
-
args: [{ selector: 'app-target-group-filter-param', template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"] }]
|
|
13389
|
-
}], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { data: [{
|
|
13390
|
-
type: Input
|
|
13391
|
-
}] } });
|
|
13392
|
-
|
|
13393
|
-
class SmartFilterParamsComponent {
|
|
13394
|
-
// filterComponentRef?: ComponentRef<SmartFilterComponent>;
|
|
13395
|
-
// filter?: SmartFilter;
|
|
13396
|
-
constructor() {
|
|
13397
|
-
this._destroy$ = new Subject();
|
|
13398
|
-
this.expandableSections = [];
|
|
13399
|
-
}
|
|
13400
|
-
ngOnInit() {
|
|
13401
|
-
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13402
|
-
this.setUp(this.service.model);
|
|
13403
|
-
});
|
|
13404
|
-
this.setUp(this.service.model);
|
|
13405
|
-
}
|
|
13406
|
-
ngOnDestroy() {
|
|
13407
|
-
this._destroy$.next();
|
|
13408
|
-
this._destroy$.complete();
|
|
13409
|
-
}
|
|
13410
|
-
setUp(model) {
|
|
13411
|
-
this.filterBuilder = model.model;
|
|
13412
|
-
// this.constructFilter();
|
|
13413
|
-
this.constructExpandableSections();
|
|
13414
|
-
}
|
|
13415
|
-
constructExpandableSections() {
|
|
13416
|
-
if (this.filterBuilder.groups) {
|
|
13417
|
-
this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
|
|
13418
|
-
return {
|
|
13419
|
-
title: filterExpressionBuilderGroup.label,
|
|
13420
|
-
cssClass: 'filterExpressionBuilderGroup',
|
|
13421
|
-
customComponent: SmartFilterParamComponent,
|
|
13422
|
-
data: {
|
|
13423
|
-
group: filterExpressionBuilderGroup.fields,
|
|
13424
|
-
serviceToUse: this.service,
|
|
13425
|
-
},
|
|
13426
|
-
inputName: 'data',
|
|
13427
|
-
isExpanded: true,
|
|
13428
|
-
};
|
|
13429
|
-
});
|
|
13430
|
-
}
|
|
13431
|
-
// if (this.service.model?.externalFilterGroup) {
|
|
13432
|
-
// this.expandableSectionsFromExcel = {
|
|
13433
|
-
// title: this.service.model.externalFilterGroup.label!,
|
|
13434
|
-
// cssClass: 'filterExpressionBuilderGroup',
|
|
13435
|
-
// customComponent: SmartFilterParamComponent,
|
|
13436
|
-
// data: {
|
|
13437
|
-
// group: this.service.model.externalFilterGroup.fields,
|
|
13438
|
-
// },
|
|
13439
|
-
// inputName: 'data',
|
|
13440
|
-
// isExpanded: true,
|
|
13441
|
-
// };
|
|
13442
|
-
// }
|
|
13443
|
-
}
|
|
13444
|
-
// constructFilter(): void {
|
|
13445
|
-
// if (this.filter && this.filterComponentRef) {
|
|
13446
|
-
// return;
|
|
13447
|
-
// }
|
|
13448
|
-
// // this.filter = {
|
|
13449
|
-
// // data: this.service.model?.groupFilter?.filters! as FilterExpressionField[],
|
|
13450
|
-
// // type: SmartFilterType.Simple,
|
|
13451
|
-
// // showPossibleActions: false,
|
|
13452
|
-
// // };
|
|
13453
|
-
// this.filterVcRef?.clear();
|
|
13454
|
-
// this.filterComponentRef = this.cfService.createComponent(
|
|
13455
|
-
// this.filterVcRef!,
|
|
13456
|
-
// SmartFilterComponent,
|
|
13457
|
-
// new Map<string, any>([['filter', this.filter]])
|
|
13458
|
-
// );
|
|
13459
|
-
// this.filterComponentRef.instance?.service.change
|
|
13460
|
-
// .pipe(takeUntil(this._destroy$))
|
|
13461
|
-
// .subscribe(() => {
|
|
13462
|
-
// let uiAction: UiAction = this.service.model?.filterGroupsAction!;
|
|
13463
|
-
// uiAction.params = {
|
|
13464
|
-
// filter: {
|
|
13465
|
-
// filters: this.filterComponentRef?.instance.service.filter?.data,
|
|
13466
|
-
// },
|
|
13467
|
-
// };
|
|
13468
|
-
// // let uiActionModel: UiActionModel = {
|
|
13469
|
-
// // serviceToUse: this.service,
|
|
13470
|
-
// // uiAction,
|
|
13471
|
-
// // };
|
|
13472
|
-
// // this.uiActionService.uiActionModel = uiActionModel;
|
|
13473
|
-
// // this.uiActionService.execute(uiAction);
|
|
13474
|
-
// });
|
|
13475
|
-
// }
|
|
13476
|
-
addDataSource() {
|
|
13477
|
-
// this.service.addDataSource();
|
|
13478
|
-
}
|
|
13479
|
-
}
|
|
13480
|
-
SmartFilterParamsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13481
|
-
SmartFilterParamsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamsComponent, selector: "smart-filter-group-params", inputs: { service: "service" }, viewQueries: [{ propertyName: "filterVcRef", first: true, predicate: ["smartFilter"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <ng-template #smartFilter></ng-template>\r\n <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"], components: [{ type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
13482
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
|
|
13483
|
-
type: Component,
|
|
13484
|
-
args: [{ selector: 'smart-filter-group-params', template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <ng-template #smartFilter></ng-template>\r\n <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"] }]
|
|
13485
|
-
}], ctorParameters: function () { return []; }, propDecorators: { service: [{
|
|
13486
|
-
type: Input
|
|
13487
|
-
}], filterVcRef: [{
|
|
13488
|
-
type: ViewChild,
|
|
13489
|
-
args: ['smartFilter', { read: ViewContainerRef }]
|
|
13490
|
-
}] } });
|
|
13491
|
-
|
|
13492
|
-
var FilterExpressionBuilderUiModel;
|
|
13493
|
-
(function (FilterExpressionBuilderUiModel) {
|
|
13494
|
-
FilterExpressionBuilderUiModel.TypeEnum = {
|
|
13495
|
-
Simple: 'SIMPLE',
|
|
13496
|
-
Complex: 'COMPLEX'
|
|
13497
|
-
};
|
|
13498
|
-
})(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
|
|
13499
|
-
|
|
13500
|
-
var FilterExpressionBuilderApiActions;
|
|
13501
|
-
(function (FilterExpressionBuilderApiActions) {
|
|
13502
|
-
FilterExpressionBuilderApiActions["OPEN_FILTER_GROUPS"] = "OPEN_FILTER_GROUPS";
|
|
13503
|
-
FilterExpressionBuilderApiActions["CLOSE_FILTER_GROUPS"] = "CLOSE_FILTER_GROUPS";
|
|
13504
|
-
FilterExpressionBuilderApiActions["ADD_BRACKET"] = "ADD_BRACKET";
|
|
13505
|
-
FilterExpressionBuilderApiActions["ADD_FILTER_EXPRESSION"] = "ADD_FILTER_EXPRESSION";
|
|
13506
|
-
FilterExpressionBuilderApiActions["REMOVE_FILTER_EXPRESSION"] = "REMOVE_FILTER_EXPRESSION";
|
|
13507
|
-
FilterExpressionBuilderApiActions["REDO"] = "REDO";
|
|
13508
|
-
FilterExpressionBuilderApiActions["FILTER_GROUPS"] = "AFILTER_GROUPS";
|
|
13509
|
-
FilterExpressionBuilderApiActions["SELECT_FIELD"] = "SELECT_FIELD";
|
|
13510
|
-
FilterExpressionBuilderApiActions["UPDATE_FILTER_EXPRESSION"] = "UPDATE_FILTER_EXPRESSION";
|
|
13511
|
-
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_DATA"] = "SAVE_EXPRESSION_DATA";
|
|
13512
|
-
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_FIELD_LIST"] = "SAVE_EXPRESSION_FIELD_LIST";
|
|
13513
|
-
})(FilterExpressionBuilderApiActions || (FilterExpressionBuilderApiActions = {}));
|
|
13514
|
-
|
|
13515
|
-
class SmartFilterExpressionItemComponent {
|
|
13516
|
-
constructor(service) {
|
|
13517
|
-
this.service = service;
|
|
13518
|
-
this.isSelected = false;
|
|
13519
|
-
}
|
|
13520
|
-
ngOnInit() {
|
|
13521
|
-
this.isSelected =
|
|
13522
|
-
JSON.stringify(this.service.model?.selectedField) === JSON.stringify(this.item);
|
|
13523
|
-
}
|
|
13524
|
-
setOperatorTo(event, operationType) {
|
|
13525
|
-
event?.stopPropagation();
|
|
13526
|
-
if (!this.service.model?.readOnly) {
|
|
13527
|
-
this.item.expressionData.boolOperator = operationType;
|
|
13528
|
-
this.service.peformWidgetAction({
|
|
13529
|
-
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13530
|
-
params: {
|
|
13531
|
-
model: this.item,
|
|
13532
|
-
},
|
|
13533
|
-
});
|
|
13534
|
-
}
|
|
13535
|
-
}
|
|
13536
|
-
select(event, item) {
|
|
13537
|
-
event?.stopPropagation();
|
|
13538
|
-
if (!this.service.model?.readOnly) {
|
|
13539
|
-
if (!this.isSelected) {
|
|
13540
|
-
this.service.peformWidgetAction({
|
|
13541
|
-
code: 'SELECT_FIELD',
|
|
13542
|
-
params: {
|
|
13543
|
-
model: this.item,
|
|
13544
|
-
},
|
|
13545
|
-
});
|
|
13546
|
-
}
|
|
13547
|
-
else {
|
|
13548
|
-
this.service.peformWidgetAction({
|
|
13549
|
-
code: 'SELECT_FIELD',
|
|
13550
|
-
params: {
|
|
13551
|
-
model: this.item,
|
|
13552
|
-
},
|
|
13553
|
-
});
|
|
13554
|
-
}
|
|
13555
|
-
}
|
|
13556
|
-
}
|
|
13557
|
-
}
|
|
13558
|
-
SmartFilterExpressionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13559
|
-
SmartFilterExpressionItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterExpressionItemComponent, selector: "app-expression-item", inputs: { item: "item", hasNext: "hasNext" }, ngImport: i0, template: "<div class=\"expressionItemContainer\">\r\n <div\r\n class=\"expressionItemInnerContainer\"\r\n [ngClass]=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION'\r\n ? isSelected\r\n ? 'selectedExpressionContainer'\r\n : 'expressionContainer'\r\n : ''\r\n \"\r\n (click)=\"select($event, item)\"\r\n >\r\n <div\r\n *ngIf=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION';\r\n then expression;\r\n else simpleItem\r\n \"\r\n ></div>\r\n <ng-template #expression>\r\n <div class=\"expressionItemBubble expression\">[</div>\r\n <app-expression-item\r\n [item]=\"subItem\"\r\n [hasNext]=\"i < (item.subFieldList?.filters)!.length - 1\"\r\n *ngFor=\"let subItem of item.subFieldList?.filters; let i = index\"\r\n ></app-expression-item>\r\n <div class=\"expressionItemBubble expression\">]</div>\r\n </ng-template>\r\n <ng-template #simpleItem>\r\n <div\r\n class=\"expressionItemBubble simpleItem\"\r\n [ngClass]=\"isSelected ? 'selectedSimpleItem' : ''\"\r\n >\r\n {{ item.label\r\n }}{{ item.expressionData?.operand2?.valueAsString ? \": \" : \"\" }}\r\n <b>\r\n {{ item.expressionData?.operand2?.valueAsString }}\r\n </b>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"hasNext\" class=\"relationItemBubble\">\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'AND')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'AND' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n \u00C9S\r\n </button>\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'OR')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'OR' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n VAGY\r\n </button>\r\n </div>\r\n <!-- <button mat-mini-fab color=\"gray\">\r\n\t\t<smart-icon icon=\"X\" color=\"gray\"></smart-icon>\r\n\t</button> -->\r\n</div>\r\n", styles: [".expressionItemContainer{display:flex;flex-direction:row;gap:.75rem}.expressionItemInnerContainer{display:flex;flex-direction:row;grid-area:.75rem;padding:.25rem;border-radius:.25rem}.expressionContainer{border:1px dashed var(--primary-lighter-gray-color);cursor:pointer}.selectedExpressionContainer{border:2px dashed var(--primary-darker-color)}.expressionItemBubble,.relationItemBubble{display:flex;flex-direction:row;border-radius:1.5rem}.expressionItemBubble{padding:.75rem}.expression{background-color:var(--inner-container);font-weight:600;margin:auto 0}.simpleItem{background-color:#c6ddff;cursor:pointer}.selectedSimpleItem{border:2px solid var(--primary-color)}.relationItemBubble{border:1px solid #cdcdcd;padding:.25rem}.relationItemBubble .mat-button{border-radius:1.5rem;height:100%;margin:auto 0}\n"], components: [{ type: SmartFilterExpressionItemComponent, selector: "app-expression-item", inputs: ["item", "hasNext"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
13560
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, decorators: [{
|
|
13561
|
-
type: Component,
|
|
13562
|
-
args: [{ selector: 'app-expression-item', template: "<div class=\"expressionItemContainer\">\r\n <div\r\n class=\"expressionItemInnerContainer\"\r\n [ngClass]=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION'\r\n ? isSelected\r\n ? 'selectedExpressionContainer'\r\n : 'expressionContainer'\r\n : ''\r\n \"\r\n (click)=\"select($event, item)\"\r\n >\r\n <div\r\n *ngIf=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION';\r\n then expression;\r\n else simpleItem\r\n \"\r\n ></div>\r\n <ng-template #expression>\r\n <div class=\"expressionItemBubble expression\">[</div>\r\n <app-expression-item\r\n [item]=\"subItem\"\r\n [hasNext]=\"i < (item.subFieldList?.filters)!.length - 1\"\r\n *ngFor=\"let subItem of item.subFieldList?.filters; let i = index\"\r\n ></app-expression-item>\r\n <div class=\"expressionItemBubble expression\">]</div>\r\n </ng-template>\r\n <ng-template #simpleItem>\r\n <div\r\n class=\"expressionItemBubble simpleItem\"\r\n [ngClass]=\"isSelected ? 'selectedSimpleItem' : ''\"\r\n >\r\n {{ item.label\r\n }}{{ item.expressionData?.operand2?.valueAsString ? \": \" : \"\" }}\r\n <b>\r\n {{ item.expressionData?.operand2?.valueAsString }}\r\n </b>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"hasNext\" class=\"relationItemBubble\">\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'AND')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'AND' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n \u00C9S\r\n </button>\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'OR')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'OR' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n VAGY\r\n </button>\r\n </div>\r\n <!-- <button mat-mini-fab color=\"gray\">\r\n\t\t<smart-icon icon=\"X\" color=\"gray\"></smart-icon>\r\n\t</button> -->\r\n</div>\r\n", styles: [".expressionItemContainer{display:flex;flex-direction:row;gap:.75rem}.expressionItemInnerContainer{display:flex;flex-direction:row;grid-area:.75rem;padding:.25rem;border-radius:.25rem}.expressionContainer{border:1px dashed var(--primary-lighter-gray-color);cursor:pointer}.selectedExpressionContainer{border:2px dashed var(--primary-darker-color)}.expressionItemBubble,.relationItemBubble{display:flex;flex-direction:row;border-radius:1.5rem}.expressionItemBubble{padding:.75rem}.expression{background-color:var(--inner-container);font-weight:600;margin:auto 0}.simpleItem{background-color:#c6ddff;cursor:pointer}.selectedSimpleItem{border:2px solid var(--primary-color)}.relationItemBubble{border:1px solid #cdcdcd;padding:.25rem}.relationItemBubble .mat-button{border-radius:1.5rem;height:100%;margin:auto 0}\n"] }]
|
|
13563
|
-
}], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { item: [{
|
|
13564
|
-
type: Input
|
|
13565
|
-
}], hasNext: [{
|
|
13566
|
-
type: Input
|
|
13567
|
-
}] } });
|
|
13568
|
-
|
|
13569
|
-
class SmartFilterExpressionItemsComponent {
|
|
13570
|
-
constructor(service) {
|
|
13571
|
-
this.service = service;
|
|
13572
|
-
this._destroy$ = new Subject();
|
|
13573
|
-
this.isSelected = false;
|
|
13574
|
-
this.service.modelChanged.subscribe(() => {
|
|
13575
|
-
console.log(this.service.model);
|
|
13576
|
-
this.isSelected = this.service.model?.selectedField === null;
|
|
13577
|
-
});
|
|
13578
|
-
this.isSelected = this.service.model?.selectedField === null;
|
|
13579
|
-
}
|
|
13580
|
-
ngOnChanges(changes) {
|
|
13581
|
-
console.log(changes);
|
|
13582
|
-
}
|
|
13583
|
-
ngOnInit() { }
|
|
13584
|
-
ngOnDestroy() {
|
|
13585
|
-
this._destroy$.next();
|
|
13586
|
-
this._destroy$.complete();
|
|
13587
|
-
}
|
|
13588
|
-
select() {
|
|
13589
|
-
// this.service.selectFilterExpressionField(undefined);
|
|
13590
|
-
}
|
|
13591
|
-
drop(event) {
|
|
13592
|
-
moveItemInArray(this.items, event.previousIndex, event.currentIndex);
|
|
13593
|
-
}
|
|
13594
|
-
}
|
|
13595
|
-
SmartFilterExpressionItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13596
|
-
SmartFilterExpressionItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterExpressionItemsComponent, selector: "app-expression-items", inputs: { items: "items" }, usesOnChanges: true, ngImport: i0, template: "<div\r\n cdkDropList\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"expressionsContainer example-list\"\r\n [ngClass]=\"isSelected ? 'selected' : ''\"\r\n>\r\n <div cdkDrag class=\"expressionItem\" *ngFor=\"let item of items; let i = index\">\r\n <app-expression-item\r\n [item]=\"item\"\r\n [hasNext]=\"i < items.length - 1\"\r\n ></app-expression-item>\r\n </div>\r\n</div>\r\n", styles: [".expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;border:1px dashed var(--primary-lighter-gray-color);padding:.25rem;border-radius:.25rem}.selected{border:2px dashed var(--primary-darker-color)}.expressionItem{margin:auto 0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.example-custom-placeholder{background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: SmartFilterExpressionItemComponent, selector: "app-expression-item", inputs: ["item", "hasNext"] }], directives: [{ type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
13597
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, decorators: [{
|
|
13598
|
-
type: Component,
|
|
13599
|
-
args: [{ selector: 'app-expression-items', template: "<div\r\n cdkDropList\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"expressionsContainer example-list\"\r\n [ngClass]=\"isSelected ? 'selected' : ''\"\r\n>\r\n <div cdkDrag class=\"expressionItem\" *ngFor=\"let item of items; let i = index\">\r\n <app-expression-item\r\n [item]=\"item\"\r\n [hasNext]=\"i < items.length - 1\"\r\n ></app-expression-item>\r\n </div>\r\n</div>\r\n", styles: [".expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;border:1px dashed var(--primary-lighter-gray-color);padding:.25rem;border-radius:.25rem}.selected{border:2px dashed var(--primary-darker-color)}.expressionItem{margin:auto 0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.example-custom-placeholder{background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
13600
|
-
}], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { items: [{
|
|
13601
|
-
type: Input
|
|
13602
|
-
}] } });
|
|
13603
|
-
|
|
13604
|
-
class SmartFilterEditorContentComponent {
|
|
13605
|
-
constructor(layoutService) {
|
|
13606
|
-
this.layoutService = layoutService;
|
|
13607
|
-
this._destroy$ = new Subject();
|
|
13608
|
-
this.uiActionModels = [];
|
|
13609
|
-
this.expressionUiActionModels = [];
|
|
13610
|
-
this.type = FilterExpressionBuilderUiModel.TypeEnum;
|
|
13611
|
-
}
|
|
13612
|
-
ngAfterViewInit() {
|
|
13613
|
-
if (this.simpleFilterFormChildren?.first) {
|
|
13614
|
-
this.simpleFilterFormChildren.first.onBlurSubject
|
|
13615
|
-
?.pipe(takeUntil(this._destroy$))
|
|
13616
|
-
.subscribe(() => {
|
|
13258
|
+
subsrcibeSimpleFormChildrenEvents() {
|
|
13259
|
+
this.simpleFilterFormChildren?.first.onBlurSubject
|
|
13260
|
+
?.pipe(takeUntil(this._destroy$))
|
|
13261
|
+
.subscribe(() => {
|
|
13262
|
+
this.saveFilter();
|
|
13263
|
+
});
|
|
13264
|
+
this.simpleFilterFormChildren?.first.sophisticatedValueChange
|
|
13265
|
+
?.pipe(takeUntil(this._destroy$))
|
|
13266
|
+
.subscribe((change) => {
|
|
13267
|
+
if (change.kind === 'selection') {
|
|
13617
13268
|
this.saveFilter();
|
|
13618
|
-
}
|
|
13619
|
-
|
|
13620
|
-
|
|
13621
|
-
|
|
13622
|
-
|
|
13623
|
-
|
|
13624
|
-
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
|
|
13628
|
-
|
|
13629
|
-
this.
|
|
13630
|
-
|
|
13631
|
-
|
|
13632
|
-
this.simpleFilterFormChildren.first.sophisticatedValueChange?.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13633
|
-
if (change.kind === 'selection') {
|
|
13634
|
-
this.saveFilter();
|
|
13635
|
-
}
|
|
13636
|
-
});
|
|
13637
|
-
});
|
|
13638
|
-
}
|
|
13269
|
+
}
|
|
13270
|
+
});
|
|
13271
|
+
}
|
|
13272
|
+
subscribeEditorFormChildrenEvents() {
|
|
13273
|
+
this.formChildren?.first.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13274
|
+
this.save();
|
|
13275
|
+
});
|
|
13276
|
+
this.formChildren?.first.sophisticatedValueChange
|
|
13277
|
+
?.pipe(takeUntil(this._destroy$))
|
|
13278
|
+
.subscribe((change) => {
|
|
13279
|
+
if (change.key === 'expressionData.currentOperation') {
|
|
13280
|
+
this.save();
|
|
13281
|
+
}
|
|
13282
|
+
});
|
|
13639
13283
|
}
|
|
13284
|
+
// smartFilterChangeSubscription?: Subscription;
|
|
13285
|
+
// smartFilterSophisticatedChangeSubscription?: Subscription;
|
|
13286
|
+
// smartformChangeSubscription?: Subscription;
|
|
13287
|
+
// smartformSophisticatedChangeSubscription?: Subscription;
|
|
13640
13288
|
ngOnInit() {
|
|
13641
13289
|
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
|
|
13642
13290
|
this.service.load();
|
|
@@ -13653,38 +13301,41 @@ class SmartFilterEditorContentComponent {
|
|
|
13653
13301
|
model[index] = filterExpressionField;
|
|
13654
13302
|
if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
|
|
13655
13303
|
key = index + '.expressionData.operand2.selectedValues';
|
|
13656
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13304
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? ''));
|
|
13657
13305
|
return;
|
|
13658
13306
|
}
|
|
13659
13307
|
if (filterExpressionField.expressionData?.currentOperation === 'BETWEEN') {
|
|
13660
13308
|
key = index + '.expressionData.operand2.valueAsString';
|
|
13661
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13309
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? ''));
|
|
13662
13310
|
key = index + '.expressionData.operand3.valueAsString';
|
|
13663
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13311
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand3?.valueAsString ?? ''));
|
|
13664
13312
|
return;
|
|
13665
13313
|
}
|
|
13666
13314
|
if (filterExpressionField.expressionData?.operand2) {
|
|
13667
13315
|
if (key !== index + '.expressionData.operand2.selectedValues') {
|
|
13668
13316
|
key = index + '.expressionData.operand2.valueAsString';
|
|
13669
13317
|
}
|
|
13670
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13318
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? ''));
|
|
13671
13319
|
return;
|
|
13672
13320
|
}
|
|
13673
13321
|
if (filterExpressionField?.expressionData?.operand3) {
|
|
13674
13322
|
if (key !== index + '.selectedValues') {
|
|
13675
13323
|
key = index + '.expressionData.operand3.valueAsString';
|
|
13676
13324
|
}
|
|
13677
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13325
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand3?.valueAsString ?? ''));
|
|
13678
13326
|
return;
|
|
13679
13327
|
}
|
|
13680
13328
|
});
|
|
13681
|
-
|
|
13329
|
+
let smartForm = {
|
|
13682
13330
|
direction: SmartFormWidgetDirection.ROW,
|
|
13683
13331
|
componentModel: { data: model },
|
|
13684
13332
|
useOnValueChangeEvent: true,
|
|
13685
13333
|
useOnBlurEvent: true,
|
|
13686
13334
|
widgets,
|
|
13687
13335
|
};
|
|
13336
|
+
if (!deepEqual(smartForm, this.simpleFilterForm)) {
|
|
13337
|
+
this.simpleFilterForm = smartForm;
|
|
13338
|
+
}
|
|
13688
13339
|
}
|
|
13689
13340
|
extractFilterFieldFromFormModel() {
|
|
13690
13341
|
let simpleFilter = this.simpleFilterFormChildren?.first?.submitForm(false).componentModel.data;
|
|
@@ -13734,9 +13385,6 @@ class SmartFilterEditorContentComponent {
|
|
|
13734
13385
|
}
|
|
13735
13386
|
}
|
|
13736
13387
|
constructForm() {
|
|
13737
|
-
if (this.smartForm) {
|
|
13738
|
-
return;
|
|
13739
|
-
}
|
|
13740
13388
|
let generatedWidgets = this.layoutService.render({
|
|
13741
13389
|
layoutDefinitions: this.service.model?.selectedFieldEditor?.layoutDef?.widgets,
|
|
13742
13390
|
});
|
|
@@ -13747,24 +13395,6 @@ class SmartFilterEditorContentComponent {
|
|
|
13747
13395
|
componentModel: { data: this.service.model?.selectedField },
|
|
13748
13396
|
widgets: generatedWidgets,
|
|
13749
13397
|
};
|
|
13750
|
-
if (this.smartformChangeSubscription) {
|
|
13751
|
-
this.smartformChangeSubscription.unsubscribe();
|
|
13752
|
-
}
|
|
13753
|
-
// this.smartformChangeSubscription = this.formChild?.onBlurSubject
|
|
13754
|
-
// ?.pipe(takeUntil(this._destroy$))
|
|
13755
|
-
// .subscribe(() => {
|
|
13756
|
-
// this.save();
|
|
13757
|
-
// });
|
|
13758
|
-
// if (this.smartformSophisticatedChangeSubscription) {
|
|
13759
|
-
// this.smartformSophisticatedChangeSubscription.unsubscribe();
|
|
13760
|
-
// }
|
|
13761
|
-
// this.smartformSophisticatedChangeSubscription = this.formChild?.sophisticatedValueChange
|
|
13762
|
-
// ?.pipe(takeUntil(this._destroy$))
|
|
13763
|
-
// .subscribe((change: SophisticatedValueChange) => {
|
|
13764
|
-
// if (change.key === 'expressionData.currentOperation') {
|
|
13765
|
-
// this.save();
|
|
13766
|
-
// }
|
|
13767
|
-
// });
|
|
13768
13398
|
}
|
|
13769
13399
|
save() {
|
|
13770
13400
|
this.formChildren?.first?.submitForm(false);
|
|
@@ -13783,15 +13413,6 @@ class SmartFilterEditorContentComponent {
|
|
|
13783
13413
|
},
|
|
13784
13414
|
});
|
|
13785
13415
|
}
|
|
13786
|
-
getFilteredUiActionModels(filterPredicate) {
|
|
13787
|
-
// return this.service.model!.possibleActions!.filter(filterPredicate).map((uiAction: UiAction) => {
|
|
13788
|
-
// return {
|
|
13789
|
-
// serviceToUse: this.service,
|
|
13790
|
-
// uiAction,
|
|
13791
|
-
// };
|
|
13792
|
-
// });
|
|
13793
|
-
return [];
|
|
13794
|
-
}
|
|
13795
13416
|
async saveFilter() {
|
|
13796
13417
|
this.extractFilterFieldFromFormModel();
|
|
13797
13418
|
this.service.performUiActionRequest({
|
|
@@ -13801,7 +13422,7 @@ class SmartFilterEditorContentComponent {
|
|
|
13801
13422
|
},
|
|
13802
13423
|
});
|
|
13803
13424
|
}
|
|
13804
|
-
constructFormWidget(key, label, widgetType, possibleValues) {
|
|
13425
|
+
constructFormWidget(key, label, widgetType, possibleValues, value) {
|
|
13805
13426
|
let type = widgetType;
|
|
13806
13427
|
if (type === FilterExpressionFieldWidgetType.Date) {
|
|
13807
13428
|
type = SmartFormWidgetType.DATE_PICKER;
|
|
@@ -13810,10 +13431,11 @@ class SmartFilterEditorContentComponent {
|
|
|
13810
13431
|
type = SmartFormWidgetType.DATE_TIME_PICKER;
|
|
13811
13432
|
}
|
|
13812
13433
|
let widget = {
|
|
13434
|
+
error: undefined,
|
|
13813
13435
|
key,
|
|
13814
13436
|
label,
|
|
13815
13437
|
type,
|
|
13816
|
-
value
|
|
13438
|
+
value,
|
|
13817
13439
|
showLabel: true,
|
|
13818
13440
|
valueList: possibleValues.map((value) => {
|
|
13819
13441
|
return {
|
|
@@ -13828,10 +13450,10 @@ class SmartFilterEditorContentComponent {
|
|
|
13828
13450
|
}
|
|
13829
13451
|
}
|
|
13830
13452
|
SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13831
|
-
SmartFilterEditorContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterEditorContentComponent, selector: "smart-filter-expression-editor", inputs: { service: "service" }, viewQueries: [{ propertyName: "formChildren", predicate: ["form"], descendants: true }, { propertyName: "simpleFilterFormChildren", predicate: ["simpleFilterFromChild"], descendants: true }], ngImport: i0, template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <smartform #simpleFilterFromChild [smartForm]=\"simpleFilterForm\"></smartform>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"], components: [{ type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService"] }, { type: SmartFilterExpressionItemsComponent, selector: "app-expression-items", inputs: ["items"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
13453
|
+
SmartFilterEditorContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterEditorContentComponent, selector: "smart-filter-expression-editor", inputs: { service: "service" }, viewQueries: [{ propertyName: "formChildren", predicate: ["form"], descendants: true }, { propertyName: "simpleFilterFormChildren", predicate: ["simpleFilterFromChild"], descendants: true }], ngImport: i0, template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <smartform #simpleFilterFromChild [smartForm]=\"simpleFilterForm\"></smartform>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n [service]=\"service\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"], components: [{ type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService"] }, { type: SmartFilterExpressionItemsComponent, selector: "app-expression-items", inputs: ["items", "service"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
13832
13454
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, decorators: [{
|
|
13833
13455
|
type: Component,
|
|
13834
|
-
args: [{ selector: 'smart-filter-expression-editor', template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <smartform #simpleFilterFromChild [smartForm]=\"simpleFilterForm\"></smartform>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"] }]
|
|
13456
|
+
args: [{ selector: 'smart-filter-expression-editor', template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <smartform #simpleFilterFromChild [smartForm]=\"simpleFilterForm\"></smartform>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n [service]=\"service\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"] }]
|
|
13835
13457
|
}], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { service: [{
|
|
13836
13458
|
type: Input
|
|
13837
13459
|
}], formChildren: [{
|
|
@@ -14019,69 +13641,415 @@ class SmartAuthService {
|
|
|
14019
13641
|
this._destroy$.next();
|
|
14020
13642
|
this._destroy$.complete();
|
|
14021
13643
|
}
|
|
14022
|
-
}
|
|
14023
|
-
SmartAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
14024
|
-
SmartAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService });
|
|
14025
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, decorators: [{
|
|
14026
|
-
type: Injectable
|
|
14027
|
-
}] });
|
|
14028
|
-
|
|
14029
|
-
/*
|
|
14030
|
-
* Public API Surface of smarttree
|
|
14031
|
-
*/
|
|
14032
|
-
|
|
14033
|
-
class SmartComponentLayoutUtility {
|
|
14034
|
-
static setParent(layout, parent) {
|
|
14035
|
-
layout.parentComponent = parent;
|
|
14036
|
-
layout.components?.forEach((l) => this.setParent(l, parent));
|
|
13644
|
+
}
|
|
13645
|
+
SmartAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13646
|
+
SmartAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService });
|
|
13647
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, decorators: [{
|
|
13648
|
+
type: Injectable
|
|
13649
|
+
}] });
|
|
13650
|
+
|
|
13651
|
+
/*
|
|
13652
|
+
* Public API Surface of smarttree
|
|
13653
|
+
*/
|
|
13654
|
+
|
|
13655
|
+
class SmartComponentLayoutUtility {
|
|
13656
|
+
static setParent(layout, parent) {
|
|
13657
|
+
layout.parentComponent = parent;
|
|
13658
|
+
layout.components?.forEach((l) => this.setParent(l, parent));
|
|
13659
|
+
}
|
|
13660
|
+
static getForms(comp) {
|
|
13661
|
+
let result = [];
|
|
13662
|
+
if (comp.components) {
|
|
13663
|
+
result = comp.components
|
|
13664
|
+
.map((c) => this.getForms(c))
|
|
13665
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
13666
|
+
}
|
|
13667
|
+
if (comp.smartFormComponent) {
|
|
13668
|
+
result.push(comp.smartFormComponent);
|
|
13669
|
+
}
|
|
13670
|
+
return result;
|
|
13671
|
+
}
|
|
13672
|
+
static getGrids(comp) {
|
|
13673
|
+
let result = [];
|
|
13674
|
+
if (comp.components) {
|
|
13675
|
+
result = comp.components
|
|
13676
|
+
.map((c) => this.getGrids(c))
|
|
13677
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
13678
|
+
}
|
|
13679
|
+
if (comp.smartGridComponent) {
|
|
13680
|
+
result.push(comp.smartGridComponent);
|
|
13681
|
+
}
|
|
13682
|
+
return result;
|
|
13683
|
+
}
|
|
13684
|
+
static getTrees(comp) {
|
|
13685
|
+
let result = [];
|
|
13686
|
+
if (comp.components) {
|
|
13687
|
+
result = comp.components
|
|
13688
|
+
?.map((c) => this.getTrees(c))
|
|
13689
|
+
.reduce((acc, value) => acc.concat(value), []);
|
|
13690
|
+
}
|
|
13691
|
+
if (comp.treeService) {
|
|
13692
|
+
result.push(comp.treeService);
|
|
13693
|
+
}
|
|
13694
|
+
return result;
|
|
13695
|
+
}
|
|
13696
|
+
}
|
|
13697
|
+
|
|
13698
|
+
/*
|
|
13699
|
+
* Public API Surface of smart-component-layout
|
|
13700
|
+
*/
|
|
13701
|
+
|
|
13702
|
+
/**
|
|
13703
|
+
* Custom HttpParameterCodec
|
|
13704
|
+
* Workaround for https://github.com/angular/angular/issues/18261
|
|
13705
|
+
*/
|
|
13706
|
+
class CustomHttpParameterCodec {
|
|
13707
|
+
encodeKey(k) {
|
|
13708
|
+
return encodeURIComponent(k);
|
|
13709
|
+
}
|
|
13710
|
+
encodeValue(v) {
|
|
13711
|
+
return encodeURIComponent(v);
|
|
13712
|
+
}
|
|
13713
|
+
decodeKey(k) {
|
|
13714
|
+
return decodeURIComponent(k);
|
|
13715
|
+
}
|
|
13716
|
+
decodeValue(v) {
|
|
13717
|
+
return decodeURIComponent(v);
|
|
13718
|
+
}
|
|
13719
|
+
}
|
|
13720
|
+
|
|
13721
|
+
const BASE_PATH = new InjectionToken('basePath');
|
|
13722
|
+
const COLLECTION_FORMATS = {
|
|
13723
|
+
'csv': ',',
|
|
13724
|
+
'tsv': ' ',
|
|
13725
|
+
'ssv': ' ',
|
|
13726
|
+
'pipes': '|'
|
|
13727
|
+
};
|
|
13728
|
+
|
|
13729
|
+
class Configuration {
|
|
13730
|
+
constructor(configurationParameters = {}) {
|
|
13731
|
+
this.apiKeys = configurationParameters.apiKeys;
|
|
13732
|
+
this.username = configurationParameters.username;
|
|
13733
|
+
this.password = configurationParameters.password;
|
|
13734
|
+
this.accessToken = configurationParameters.accessToken;
|
|
13735
|
+
this.basePath = configurationParameters.basePath;
|
|
13736
|
+
this.withCredentials = configurationParameters.withCredentials;
|
|
13737
|
+
this.encoder = configurationParameters.encoder;
|
|
13738
|
+
if (configurationParameters.encodeParam) {
|
|
13739
|
+
this.encodeParam = configurationParameters.encodeParam;
|
|
13740
|
+
}
|
|
13741
|
+
else {
|
|
13742
|
+
this.encodeParam = param => this.defaultEncodeParam(param);
|
|
13743
|
+
}
|
|
13744
|
+
if (configurationParameters.credentials) {
|
|
13745
|
+
this.credentials = configurationParameters.credentials;
|
|
13746
|
+
}
|
|
13747
|
+
else {
|
|
13748
|
+
this.credentials = {};
|
|
13749
|
+
}
|
|
13750
|
+
}
|
|
13751
|
+
/**
|
|
13752
|
+
* Select the correct content-type to use for a request.
|
|
13753
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
|
13754
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
13755
|
+
* @param contentTypes - the array of content types that are available for selection
|
|
13756
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
13757
|
+
*/
|
|
13758
|
+
selectHeaderContentType(contentTypes) {
|
|
13759
|
+
if (contentTypes.length === 0) {
|
|
13760
|
+
return undefined;
|
|
13761
|
+
}
|
|
13762
|
+
const type = contentTypes.find((x) => this.isJsonMime(x));
|
|
13763
|
+
if (type === undefined) {
|
|
13764
|
+
return contentTypes[0];
|
|
13765
|
+
}
|
|
13766
|
+
return type;
|
|
13767
|
+
}
|
|
13768
|
+
/**
|
|
13769
|
+
* Select the correct accept content-type to use for a request.
|
|
13770
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
|
|
13771
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
13772
|
+
* @param accepts - the array of content types that are available for selection.
|
|
13773
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
13774
|
+
*/
|
|
13775
|
+
selectHeaderAccept(accepts) {
|
|
13776
|
+
if (accepts.length === 0) {
|
|
13777
|
+
return undefined;
|
|
13778
|
+
}
|
|
13779
|
+
const type = accepts.find((x) => this.isJsonMime(x));
|
|
13780
|
+
if (type === undefined) {
|
|
13781
|
+
return accepts[0];
|
|
13782
|
+
}
|
|
13783
|
+
return type;
|
|
13784
|
+
}
|
|
13785
|
+
/**
|
|
13786
|
+
* Check if the given MIME is a JSON MIME.
|
|
13787
|
+
* JSON MIME examples:
|
|
13788
|
+
* application/json
|
|
13789
|
+
* application/json; charset=UTF8
|
|
13790
|
+
* APPLICATION/JSON
|
|
13791
|
+
* application/vnd.company+json
|
|
13792
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
13793
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
13794
|
+
*/
|
|
13795
|
+
isJsonMime(mime) {
|
|
13796
|
+
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
13797
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
13798
|
+
}
|
|
13799
|
+
lookupCredential(key) {
|
|
13800
|
+
const value = this.credentials[key];
|
|
13801
|
+
return typeof value === 'function'
|
|
13802
|
+
? value()
|
|
13803
|
+
: value;
|
|
13804
|
+
}
|
|
13805
|
+
defaultEncodeParam(param) {
|
|
13806
|
+
// This implementation exists as fallback for missing configuration
|
|
13807
|
+
// and for backwards compatibility to older typescript-angular generator versions.
|
|
13808
|
+
// It only works for the 'simple' parameter style.
|
|
13809
|
+
// Date-handling only works for the 'date-time' format.
|
|
13810
|
+
// All other styles and Date-formats are probably handled incorrectly.
|
|
13811
|
+
//
|
|
13812
|
+
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
|
|
13813
|
+
const value = param.dataFormat === 'date-time' && param.value instanceof Date
|
|
13814
|
+
? param.value.toISOString()
|
|
13815
|
+
: param.value;
|
|
13816
|
+
return encodeURIComponent(String(value));
|
|
13817
|
+
}
|
|
13818
|
+
}
|
|
13819
|
+
|
|
13820
|
+
/**
|
|
13821
|
+
* Filter API 2
|
|
13822
|
+
* Filter API 2
|
|
13823
|
+
*
|
|
13824
|
+
* The version of the OpenAPI document: 1.0.0
|
|
13825
|
+
* Contact: info@it4all.hu
|
|
13826
|
+
*
|
|
13827
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
13828
|
+
* https://openapi-generator.tech
|
|
13829
|
+
* Do not edit the class manually.
|
|
13830
|
+
*/
|
|
13831
|
+
class FilterService {
|
|
13832
|
+
constructor(httpClient, basePath, configuration) {
|
|
13833
|
+
this.httpClient = httpClient;
|
|
13834
|
+
this.basePath = 'http://localhost';
|
|
13835
|
+
this.defaultHeaders = new HttpHeaders();
|
|
13836
|
+
this.configuration = new Configuration();
|
|
13837
|
+
if (configuration) {
|
|
13838
|
+
this.configuration = configuration;
|
|
13839
|
+
}
|
|
13840
|
+
if (typeof this.configuration.basePath !== 'string') {
|
|
13841
|
+
if (Array.isArray(basePath) && basePath.length > 0) {
|
|
13842
|
+
basePath = basePath[0];
|
|
13843
|
+
}
|
|
13844
|
+
if (typeof basePath !== 'string') {
|
|
13845
|
+
basePath = this.basePath;
|
|
13846
|
+
}
|
|
13847
|
+
this.configuration.basePath = basePath;
|
|
13848
|
+
}
|
|
13849
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
13850
|
+
}
|
|
13851
|
+
// @ts-ignore
|
|
13852
|
+
addToHttpParams(httpParams, value, key) {
|
|
13853
|
+
if (typeof value === "object" && value instanceof Date === false) {
|
|
13854
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
13855
|
+
}
|
|
13856
|
+
else {
|
|
13857
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
13858
|
+
}
|
|
13859
|
+
return httpParams;
|
|
14037
13860
|
}
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
|
|
14041
|
-
result = comp.components
|
|
14042
|
-
.map((c) => this.getForms(c))
|
|
14043
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
13861
|
+
addToHttpParamsRecursive(httpParams, value, key) {
|
|
13862
|
+
if (value == null) {
|
|
13863
|
+
return httpParams;
|
|
14044
13864
|
}
|
|
14045
|
-
if (
|
|
14046
|
-
|
|
13865
|
+
if (typeof value === "object") {
|
|
13866
|
+
if (Array.isArray(value)) {
|
|
13867
|
+
value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
|
|
13868
|
+
}
|
|
13869
|
+
else if (value instanceof Date) {
|
|
13870
|
+
if (key != null) {
|
|
13871
|
+
httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
|
|
13872
|
+
}
|
|
13873
|
+
else {
|
|
13874
|
+
throw Error("key may not be null if value is Date");
|
|
13875
|
+
}
|
|
13876
|
+
}
|
|
13877
|
+
else {
|
|
13878
|
+
Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
|
|
13879
|
+
}
|
|
14047
13880
|
}
|
|
14048
|
-
|
|
13881
|
+
else if (key != null) {
|
|
13882
|
+
httpParams = httpParams.append(key, value);
|
|
13883
|
+
}
|
|
13884
|
+
else {
|
|
13885
|
+
throw Error("key may not be null if value is not object or array");
|
|
13886
|
+
}
|
|
13887
|
+
return httpParams;
|
|
14049
13888
|
}
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
result = comp.components
|
|
14054
|
-
.map((c) => this.getGrids(c))
|
|
14055
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
13889
|
+
load(uuid, filterIdentifier, observe = 'body', reportProgress = false, options) {
|
|
13890
|
+
if (uuid === null || uuid === undefined) {
|
|
13891
|
+
throw new Error('Required parameter uuid was null or undefined when calling load.');
|
|
14056
13892
|
}
|
|
14057
|
-
if (
|
|
14058
|
-
|
|
13893
|
+
if (filterIdentifier === null || filterIdentifier === undefined) {
|
|
13894
|
+
throw new Error('Required parameter filterIdentifier was null or undefined when calling load.');
|
|
14059
13895
|
}
|
|
14060
|
-
|
|
13896
|
+
let localVarHeaders = this.defaultHeaders;
|
|
13897
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13898
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13899
|
+
// to determine the Accept header
|
|
13900
|
+
const httpHeaderAccepts = [
|
|
13901
|
+
'application/json'
|
|
13902
|
+
];
|
|
13903
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13904
|
+
}
|
|
13905
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13906
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13907
|
+
}
|
|
13908
|
+
let localVarHttpContext = options && options.context;
|
|
13909
|
+
if (localVarHttpContext === undefined) {
|
|
13910
|
+
localVarHttpContext = new HttpContext();
|
|
13911
|
+
}
|
|
13912
|
+
let responseType_ = 'json';
|
|
13913
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
13914
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13915
|
+
responseType_ = 'text';
|
|
13916
|
+
}
|
|
13917
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13918
|
+
responseType_ = 'json';
|
|
13919
|
+
}
|
|
13920
|
+
else {
|
|
13921
|
+
responseType_ = 'blob';
|
|
13922
|
+
}
|
|
13923
|
+
}
|
|
13924
|
+
let localVarPath = `/filter/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "filterIdentifier", value: filterIdentifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/load`;
|
|
13925
|
+
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
13926
|
+
context: localVarHttpContext,
|
|
13927
|
+
responseType: responseType_,
|
|
13928
|
+
withCredentials: this.configuration.withCredentials,
|
|
13929
|
+
headers: localVarHeaders,
|
|
13930
|
+
observe: observe,
|
|
13931
|
+
reportProgress: reportProgress
|
|
13932
|
+
});
|
|
14061
13933
|
}
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
result = comp.components
|
|
14066
|
-
?.map((c) => this.getTrees(c))
|
|
14067
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
13934
|
+
performWidgetAction(uuid, filterIdentifier, body, observe = 'body', reportProgress = false, options) {
|
|
13935
|
+
if (uuid === null || uuid === undefined) {
|
|
13936
|
+
throw new Error('Required parameter uuid was null or undefined when calling performWidgetAction.');
|
|
14068
13937
|
}
|
|
14069
|
-
if (
|
|
14070
|
-
|
|
13938
|
+
if (filterIdentifier === null || filterIdentifier === undefined) {
|
|
13939
|
+
throw new Error('Required parameter filterIdentifier was null or undefined when calling performWidgetAction.');
|
|
14071
13940
|
}
|
|
14072
|
-
|
|
13941
|
+
if (body === null || body === undefined) {
|
|
13942
|
+
throw new Error('Required parameter body was null or undefined when calling performWidgetAction.');
|
|
13943
|
+
}
|
|
13944
|
+
let localVarHeaders = this.defaultHeaders;
|
|
13945
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13946
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13947
|
+
// to determine the Accept header
|
|
13948
|
+
const httpHeaderAccepts = [
|
|
13949
|
+
'application/json'
|
|
13950
|
+
];
|
|
13951
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13952
|
+
}
|
|
13953
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13954
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13955
|
+
}
|
|
13956
|
+
let localVarHttpContext = options && options.context;
|
|
13957
|
+
if (localVarHttpContext === undefined) {
|
|
13958
|
+
localVarHttpContext = new HttpContext();
|
|
13959
|
+
}
|
|
13960
|
+
// to determine the Content-Type header
|
|
13961
|
+
const consumes = [
|
|
13962
|
+
'application/json'
|
|
13963
|
+
];
|
|
13964
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
13965
|
+
if (httpContentTypeSelected !== undefined) {
|
|
13966
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
13967
|
+
}
|
|
13968
|
+
let responseType_ = 'json';
|
|
13969
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
13970
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13971
|
+
responseType_ = 'text';
|
|
13972
|
+
}
|
|
13973
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13974
|
+
responseType_ = 'json';
|
|
13975
|
+
}
|
|
13976
|
+
else {
|
|
13977
|
+
responseType_ = 'blob';
|
|
13978
|
+
}
|
|
13979
|
+
}
|
|
13980
|
+
let localVarPath = `/filter/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "filterIdentifier", value: filterIdentifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/performWidgetAction`;
|
|
13981
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
13982
|
+
context: localVarHttpContext,
|
|
13983
|
+
body: body,
|
|
13984
|
+
responseType: responseType_,
|
|
13985
|
+
withCredentials: this.configuration.withCredentials,
|
|
13986
|
+
headers: localVarHeaders,
|
|
13987
|
+
observe: observe,
|
|
13988
|
+
reportProgress: reportProgress
|
|
13989
|
+
});
|
|
14073
13990
|
}
|
|
14074
|
-
}
|
|
13991
|
+
}
|
|
13992
|
+
FilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13993
|
+
FilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, providedIn: 'root' });
|
|
13994
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, decorators: [{
|
|
13995
|
+
type: Injectable,
|
|
13996
|
+
args: [{
|
|
13997
|
+
providedIn: 'root'
|
|
13998
|
+
}]
|
|
13999
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
14000
|
+
type: Optional
|
|
14001
|
+
}, {
|
|
14002
|
+
type: Inject,
|
|
14003
|
+
args: [BASE_PATH]
|
|
14004
|
+
}] }, { type: Configuration, decorators: [{
|
|
14005
|
+
type: Optional
|
|
14006
|
+
}] }]; } });
|
|
14075
14007
|
|
|
14076
|
-
|
|
14077
|
-
|
|
14078
|
-
|
|
14008
|
+
class SmartFilterEditorService {
|
|
14009
|
+
constructor(service) {
|
|
14010
|
+
this.service = service;
|
|
14011
|
+
this.modelChanged = new Subject();
|
|
14012
|
+
this.submit = new Subject();
|
|
14013
|
+
this.reSubscribeToChange = new Subject();
|
|
14014
|
+
}
|
|
14015
|
+
async load() {
|
|
14016
|
+
this.model = await this.service.load(this.config.uuid, this.config.identifier).toPromise();
|
|
14017
|
+
this.modelChanged.next();
|
|
14018
|
+
}
|
|
14019
|
+
async peformWidgetAction(request) {
|
|
14020
|
+
this.model = await this.service
|
|
14021
|
+
.performWidgetAction(this.config.uuid, this.config.identifier, request)
|
|
14022
|
+
.toPromise();
|
|
14023
|
+
this.modelChanged.next();
|
|
14024
|
+
}
|
|
14025
|
+
getModel() {
|
|
14026
|
+
return this.model;
|
|
14027
|
+
}
|
|
14028
|
+
async performUiActionRequest(uiActionRequest, widgetId, nodeId) {
|
|
14029
|
+
await this.peformWidgetAction(uiActionRequest);
|
|
14030
|
+
}
|
|
14031
|
+
async handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
|
|
14032
|
+
return {
|
|
14033
|
+
shouldPerformAction: true,
|
|
14034
|
+
uiActionRequest: uiActionRequest,
|
|
14035
|
+
};
|
|
14036
|
+
}
|
|
14037
|
+
getAdditionalParams(uiAction) {
|
|
14038
|
+
throw new Error('Method not implemented.');
|
|
14039
|
+
}
|
|
14040
|
+
}
|
|
14041
|
+
SmartFilterEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, deps: [{ token: FilterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
14042
|
+
SmartFilterEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService });
|
|
14043
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, decorators: [{
|
|
14044
|
+
type: Injectable
|
|
14045
|
+
}], ctorParameters: function () { return [{ type: FilterService }]; } });
|
|
14079
14046
|
|
|
14080
|
-
|
|
14081
|
-
constructor(inject, auth, pageName) {
|
|
14047
|
+
class SmartComponentApiClient {
|
|
14048
|
+
constructor(inject, auth, pageName, componentName) {
|
|
14082
14049
|
this.inject = inject;
|
|
14083
14050
|
this.auth = auth;
|
|
14084
14051
|
this.pageName = pageName;
|
|
14052
|
+
this.componentName = componentName;
|
|
14085
14053
|
this._destroy$ = new Subject();
|
|
14086
14054
|
this.detectChange = new SmartSubject(this._destroy$);
|
|
14087
14055
|
this.uiActionModels = [];
|
|
@@ -14090,10 +14058,24 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
14090
14058
|
this.widgets = new WidgetMap();
|
|
14091
14059
|
this.formWidgets = new WidgetMap();
|
|
14092
14060
|
this.useQueryLists = false;
|
|
14061
|
+
// check and calculate pageName
|
|
14062
|
+
if (!this.pageName && !this.componentName) {
|
|
14063
|
+
throw new Error('pageName or componentName must be specified!');
|
|
14064
|
+
}
|
|
14065
|
+
this.viewContext = inject.get(SmartViewContextService);
|
|
14066
|
+
if (this.componentName) {
|
|
14067
|
+
let pageNameForComponent = this.viewContext.getPageNameOfComponent(this.componentName);
|
|
14068
|
+
if (!this.pageName) {
|
|
14069
|
+
this.pageName = pageNameForComponent;
|
|
14070
|
+
}
|
|
14071
|
+
else if (this.pageName !== pageNameForComponent) {
|
|
14072
|
+
throw new Error(`pageName (${pageName}) and componentName (${componentName}) doesn't match!`);
|
|
14073
|
+
}
|
|
14074
|
+
}
|
|
14075
|
+
// from this point we have this.pageName
|
|
14093
14076
|
this.detectChange.subscribe((change) => {
|
|
14094
14077
|
this.handleChanges(change);
|
|
14095
14078
|
});
|
|
14096
|
-
this.viewContext = inject.get(SmartViewContextService);
|
|
14097
14079
|
this.uiActionService = inject.get(UiActionService);
|
|
14098
14080
|
this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
|
|
14099
14081
|
}
|
|
@@ -14167,23 +14149,42 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
14167
14149
|
if (this.useQueryLists) {
|
|
14168
14150
|
if (!this.getSmartComponentLayoutsQL()) {
|
|
14169
14151
|
console.warn('SmartComponentLayoutsQL not available!');
|
|
14170
|
-
return;
|
|
14171
14152
|
}
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
}
|
|
14153
|
+
else {
|
|
14154
|
+
this.handleQueryList(this.getSmartComponentLayoutsQL(), (comp) => {
|
|
14155
|
+
if (comp.smartComponentLayout) {
|
|
14156
|
+
// TODO maybe we should set comp.parent, not comp.smartComponentLayout.parentComponent..
|
|
14157
|
+
SmartComponentLayoutUtility.setParent(comp.smartComponentLayout, this);
|
|
14158
|
+
}
|
|
14159
|
+
if (this.uuid && this.uuid !== comp.uuid)
|
|
14160
|
+
comp.uuid = this.uuid;
|
|
14161
|
+
});
|
|
14162
|
+
}
|
|
14163
|
+
if (!this.getSmartGridsQL()) {
|
|
14164
|
+
console.warn('SmartGridsQL not available!');
|
|
14165
|
+
}
|
|
14166
|
+
else {
|
|
14167
|
+
this.handleQueryList(this.getSmartGridsQL(), (grid) => {
|
|
14168
|
+
if (grid) {
|
|
14169
|
+
if (grid.smartGrid) {
|
|
14170
|
+
grid.smartGrid.uiActionService = this.uiActionService;
|
|
14171
|
+
grid.smartGrid.uiActionDescriptorService = this.uiActionDescriptorService;
|
|
14172
|
+
grid.smartGrid.serviceToUse = this;
|
|
14173
|
+
grid.smartGrid.viewContextService = this.viewContext;
|
|
14174
|
+
}
|
|
14175
|
+
if (this.uuid && this.uuid !== grid.uuid)
|
|
14176
|
+
grid.uuid = this.uuid;
|
|
14177
|
+
}
|
|
14178
|
+
});
|
|
14179
|
+
}
|
|
14185
14180
|
}
|
|
14186
14181
|
}
|
|
14182
|
+
handleQueryList(ql, handler) {
|
|
14183
|
+
ql.forEach((el) => handler(el));
|
|
14184
|
+
this.getSmartComponentLayoutsQL()
|
|
14185
|
+
.changes.pipe(takeUntil(this._destroy$))
|
|
14186
|
+
.subscribe((list) => list.forEach((el) => handler(el)));
|
|
14187
|
+
}
|
|
14187
14188
|
getWidgets() {
|
|
14188
14189
|
if (this.useQueryLists) {
|
|
14189
14190
|
let widgets = new WidgetMap();
|
|
@@ -14564,10 +14565,7 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
14564
14565
|
handleConstraintChange(changes, changeKey) {
|
|
14565
14566
|
this.model.constraints = changes[changeKey];
|
|
14566
14567
|
}
|
|
14567
|
-
}
|
|
14568
|
-
SmartComponentApiClient = __decorate([
|
|
14569
|
-
__param(2, Inject('pageName'))
|
|
14570
|
-
], SmartComponentApiClient);
|
|
14568
|
+
}
|
|
14571
14569
|
class WidgetMap {
|
|
14572
14570
|
constructor() {
|
|
14573
14571
|
this._widgets = new Map();
|