@smartbit4all/ng-client 3.2.3 → 3.2.5
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-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 +64 -69
- package/esm2020/lib/smart-filter-editor/smart-filter-editor.service.mjs +1 -1
- 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/services/smartform.service.mjs +13 -18
- package/fesm2015/smartbit4all-ng-client.mjs +787 -848
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +718 -780
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- 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 +8 -16
- 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/package.json +1 -1
- package/smartbit4all-ng-client-3.2.5.tgz +0 -0
- package/smartbit4all-ng-client-3.2.3.tgz +0 -0
|
@@ -3877,12 +3877,11 @@ class SmartFormService {
|
|
|
3877
3877
|
}
|
|
3878
3878
|
toFormGroup() {
|
|
3879
3879
|
this.createFormControls(this.smartForm.widgets);
|
|
3880
|
-
if (this.formGroup) {
|
|
3881
|
-
|
|
3882
|
-
}
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
}
|
|
3880
|
+
// if (this.formGroup) {
|
|
3881
|
+
// this.formGroup.controls = this.group;
|
|
3882
|
+
// } else {
|
|
3883
|
+
// }
|
|
3884
|
+
this.formGroup = new FormGroup(this.group);
|
|
3886
3885
|
if (this.smartForm.validators && this.smartForm.validators.length) {
|
|
3887
3886
|
this.formGroup.setValidators(this.smartForm.validators.map((validator) => {
|
|
3888
3887
|
return validator.validator;
|
|
@@ -3904,18 +3903,14 @@ class SmartFormService {
|
|
|
3904
3903
|
widget.type !== SmartFormWidgetType.COMPONENT &&
|
|
3905
3904
|
widget.type !== SmartFormWidgetType.MATRIX &&
|
|
3906
3905
|
widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
|
|
3907
|
-
let formControl = this.group[`${widget.key}`];
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
}));
|
|
3914
|
-
if (widget.isDisabled) {
|
|
3915
|
-
formControl.disable();
|
|
3916
|
-
}
|
|
3917
|
-
this.group[`${widget.key}`] = formControl;
|
|
3906
|
+
// let formControl = this.group[`${widget.key}`];
|
|
3907
|
+
let formControl = new FormControl(widget.value || '', widget.validators?.map((validator) => {
|
|
3908
|
+
return validator.validator;
|
|
3909
|
+
}));
|
|
3910
|
+
if (widget.isDisabled) {
|
|
3911
|
+
formControl.disable();
|
|
3918
3912
|
}
|
|
3913
|
+
this.group[`${widget.key}`] = formControl;
|
|
3919
3914
|
}
|
|
3920
3915
|
if (widget.type === SmartFormWidgetType.MATRIX) {
|
|
3921
3916
|
if (widget.isMultiple) {
|
|
@@ -13027,821 +13022,419 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
13027
13022
|
}]
|
|
13028
13023
|
}] });
|
|
13029
13024
|
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
|
|
13025
|
+
class SmartFilterParamComponent {
|
|
13026
|
+
constructor() { }
|
|
13027
|
+
onItemClick(item) {
|
|
13028
|
+
this.data.serviceToUse.peformWidgetAction({
|
|
13029
|
+
code: 'ADD_FILTER_EXPRESSION',
|
|
13030
|
+
params: {
|
|
13031
|
+
model: item,
|
|
13032
|
+
},
|
|
13033
|
+
});
|
|
13037
13034
|
}
|
|
13038
|
-
|
|
13039
|
-
|
|
13035
|
+
}
|
|
13036
|
+
SmartFilterParamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13037
|
+
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"] }] });
|
|
13038
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
|
|
13039
|
+
type: Component,
|
|
13040
|
+
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"] }]
|
|
13041
|
+
}], ctorParameters: function () { return []; }, propDecorators: { data: [{
|
|
13042
|
+
type: Input
|
|
13043
|
+
}] } });
|
|
13044
|
+
|
|
13045
|
+
class SmartFilterParamsComponent {
|
|
13046
|
+
constructor() {
|
|
13047
|
+
this._destroy$ = new Subject();
|
|
13048
|
+
this.expandableSections = [];
|
|
13040
13049
|
}
|
|
13041
|
-
|
|
13042
|
-
|
|
13050
|
+
ngOnInit() {
|
|
13051
|
+
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13052
|
+
this.setUp(this.service.model);
|
|
13053
|
+
});
|
|
13054
|
+
this.setUp(this.service.model);
|
|
13043
13055
|
}
|
|
13044
|
-
|
|
13045
|
-
|
|
13056
|
+
ngOnDestroy() {
|
|
13057
|
+
this._destroy$.next();
|
|
13058
|
+
this._destroy$.complete();
|
|
13046
13059
|
}
|
|
13047
|
-
|
|
13060
|
+
setUp(model) {
|
|
13061
|
+
this.filterBuilder = model.model;
|
|
13062
|
+
this.constructExpandableSections();
|
|
13063
|
+
}
|
|
13064
|
+
constructExpandableSections() {
|
|
13065
|
+
if (this.filterBuilder.groups) {
|
|
13066
|
+
this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
|
|
13067
|
+
return {
|
|
13068
|
+
title: filterExpressionBuilderGroup.label,
|
|
13069
|
+
cssClass: 'filterExpressionBuilderGroup',
|
|
13070
|
+
customComponent: SmartFilterParamComponent,
|
|
13071
|
+
data: {
|
|
13072
|
+
group: filterExpressionBuilderGroup.fields,
|
|
13073
|
+
serviceToUse: this.service,
|
|
13074
|
+
},
|
|
13075
|
+
inputName: 'data',
|
|
13076
|
+
isExpanded: true,
|
|
13077
|
+
};
|
|
13078
|
+
});
|
|
13079
|
+
}
|
|
13080
|
+
}
|
|
13081
|
+
}
|
|
13082
|
+
SmartFilterParamsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13083
|
+
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"] }] });
|
|
13084
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
|
|
13085
|
+
type: Component,
|
|
13086
|
+
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"] }]
|
|
13087
|
+
}], ctorParameters: function () { return []; }, propDecorators: { service: [{
|
|
13088
|
+
type: Input
|
|
13089
|
+
}], filterVcRef: [{
|
|
13090
|
+
type: ViewChild,
|
|
13091
|
+
args: ['smartFilter', { read: ViewContainerRef }]
|
|
13092
|
+
}] } });
|
|
13048
13093
|
|
|
13049
|
-
|
|
13050
|
-
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
};
|
|
13094
|
+
var FilterExpressionBuilderUiModel;
|
|
13095
|
+
(function (FilterExpressionBuilderUiModel) {
|
|
13096
|
+
FilterExpressionBuilderUiModel.TypeEnum = {
|
|
13097
|
+
Simple: 'SIMPLE',
|
|
13098
|
+
Complex: 'COMPLEX'
|
|
13099
|
+
};
|
|
13100
|
+
})(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
|
|
13056
13101
|
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
|
|
13060
|
-
|
|
13061
|
-
|
|
13062
|
-
|
|
13063
|
-
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
|
|
13067
|
-
|
|
13068
|
-
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
else {
|
|
13076
|
-
this.credentials = {};
|
|
13077
|
-
}
|
|
13102
|
+
var FilterExpressionBuilderApiActions;
|
|
13103
|
+
(function (FilterExpressionBuilderApiActions) {
|
|
13104
|
+
FilterExpressionBuilderApiActions["OPEN_FILTER_GROUPS"] = "OPEN_FILTER_GROUPS";
|
|
13105
|
+
FilterExpressionBuilderApiActions["CLOSE_FILTER_GROUPS"] = "CLOSE_FILTER_GROUPS";
|
|
13106
|
+
FilterExpressionBuilderApiActions["ADD_BRACKET"] = "ADD_BRACKET";
|
|
13107
|
+
FilterExpressionBuilderApiActions["ADD_FILTER_EXPRESSION"] = "ADD_FILTER_EXPRESSION";
|
|
13108
|
+
FilterExpressionBuilderApiActions["REMOVE_FILTER_EXPRESSION"] = "REMOVE_FILTER_EXPRESSION";
|
|
13109
|
+
FilterExpressionBuilderApiActions["REDO"] = "REDO";
|
|
13110
|
+
FilterExpressionBuilderApiActions["FILTER_GROUPS"] = "AFILTER_GROUPS";
|
|
13111
|
+
FilterExpressionBuilderApiActions["SELECT_FIELD"] = "SELECT_FIELD";
|
|
13112
|
+
FilterExpressionBuilderApiActions["UPDATE_FILTER_EXPRESSION"] = "UPDATE_FILTER_EXPRESSION";
|
|
13113
|
+
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_DATA"] = "SAVE_EXPRESSION_DATA";
|
|
13114
|
+
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_FIELD_LIST"] = "SAVE_EXPRESSION_FIELD_LIST";
|
|
13115
|
+
})(FilterExpressionBuilderApiActions || (FilterExpressionBuilderApiActions = {}));
|
|
13116
|
+
|
|
13117
|
+
class SmartFilterExpressionItemComponent {
|
|
13118
|
+
constructor() {
|
|
13119
|
+
this.isSelected = false;
|
|
13078
13120
|
}
|
|
13079
|
-
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
* If no content type is found return the first found type if the contentTypes is not empty
|
|
13083
|
-
* @param contentTypes - the array of content types that are available for selection
|
|
13084
|
-
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
13085
|
-
*/
|
|
13086
|
-
selectHeaderContentType(contentTypes) {
|
|
13087
|
-
if (contentTypes.length === 0) {
|
|
13088
|
-
return undefined;
|
|
13089
|
-
}
|
|
13090
|
-
const type = contentTypes.find((x) => this.isJsonMime(x));
|
|
13091
|
-
if (type === undefined) {
|
|
13092
|
-
return contentTypes[0];
|
|
13093
|
-
}
|
|
13094
|
-
return type;
|
|
13121
|
+
ngOnInit() {
|
|
13122
|
+
this.isSelected =
|
|
13123
|
+
JSON.stringify(this.service.model?.selectedField) === JSON.stringify(this.item);
|
|
13095
13124
|
}
|
|
13096
|
-
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
|
|
13105
|
-
|
|
13125
|
+
setOperatorTo(event, operationType) {
|
|
13126
|
+
event?.stopPropagation();
|
|
13127
|
+
if (!this.service.model?.readOnly) {
|
|
13128
|
+
this.item.expressionData.boolOperator = operationType;
|
|
13129
|
+
this.service.peformWidgetAction({
|
|
13130
|
+
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13131
|
+
params: {
|
|
13132
|
+
model: this.item,
|
|
13133
|
+
},
|
|
13134
|
+
});
|
|
13106
13135
|
}
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13136
|
+
}
|
|
13137
|
+
select(event, item) {
|
|
13138
|
+
event?.stopPropagation();
|
|
13139
|
+
if (!this.service.model?.readOnly) {
|
|
13140
|
+
if (!this.isSelected) {
|
|
13141
|
+
this.service.peformWidgetAction({
|
|
13142
|
+
code: 'SELECT_FIELD',
|
|
13143
|
+
params: {
|
|
13144
|
+
model: this.item,
|
|
13145
|
+
},
|
|
13146
|
+
});
|
|
13147
|
+
}
|
|
13148
|
+
else {
|
|
13149
|
+
this.service.peformWidgetAction({
|
|
13150
|
+
code: 'SELECT_FIELD',
|
|
13151
|
+
params: {
|
|
13152
|
+
model: this.item,
|
|
13153
|
+
},
|
|
13154
|
+
});
|
|
13155
|
+
}
|
|
13110
13156
|
}
|
|
13111
|
-
return type;
|
|
13112
13157
|
}
|
|
13113
|
-
|
|
13114
|
-
|
|
13115
|
-
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
|
|
13124
|
-
|
|
13125
|
-
|
|
13158
|
+
}
|
|
13159
|
+
SmartFilterExpressionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13160
|
+
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"] }] });
|
|
13161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, decorators: [{
|
|
13162
|
+
type: Component,
|
|
13163
|
+
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"] }]
|
|
13164
|
+
}], ctorParameters: function () { return []; }, propDecorators: { item: [{
|
|
13165
|
+
type: Input
|
|
13166
|
+
}], hasNext: [{
|
|
13167
|
+
type: Input
|
|
13168
|
+
}], service: [{
|
|
13169
|
+
type: Input
|
|
13170
|
+
}] } });
|
|
13171
|
+
|
|
13172
|
+
class SmartFilterExpressionItemsComponent {
|
|
13173
|
+
constructor() {
|
|
13174
|
+
this._destroy$ = new Subject();
|
|
13175
|
+
this.isSelected = false;
|
|
13126
13176
|
}
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13177
|
+
ngOnInit() {
|
|
13178
|
+
this.service.modelChanged.subscribe(() => {
|
|
13179
|
+
console.log(this.service.model);
|
|
13180
|
+
this.isSelected = this.service.model?.selectedField === null;
|
|
13181
|
+
});
|
|
13182
|
+
this.isSelected = this.service.model?.selectedField === null;
|
|
13132
13183
|
}
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
// It only works for the 'simple' parameter style.
|
|
13137
|
-
// Date-handling only works for the 'date-time' format.
|
|
13138
|
-
// All other styles and Date-formats are probably handled incorrectly.
|
|
13139
|
-
//
|
|
13140
|
-
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
|
|
13141
|
-
const value = param.dataFormat === 'date-time' && param.value instanceof Date
|
|
13142
|
-
? param.value.toISOString()
|
|
13143
|
-
: param.value;
|
|
13144
|
-
return encodeURIComponent(String(value));
|
|
13184
|
+
ngOnDestroy() {
|
|
13185
|
+
this._destroy$.next();
|
|
13186
|
+
this._destroy$.complete();
|
|
13145
13187
|
}
|
|
13146
|
-
|
|
13147
|
-
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
*
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
*
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13188
|
+
select() {
|
|
13189
|
+
// this.service.selectFilterExpressionField(undefined);
|
|
13190
|
+
}
|
|
13191
|
+
drop(event) {
|
|
13192
|
+
moveItemInArray(this.items, event.previousIndex, event.currentIndex);
|
|
13193
|
+
}
|
|
13194
|
+
}
|
|
13195
|
+
SmartFilterExpressionItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13196
|
+
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"] }] });
|
|
13197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, decorators: [{
|
|
13198
|
+
type: Component,
|
|
13199
|
+
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"] }]
|
|
13200
|
+
}], ctorParameters: function () { return []; }, propDecorators: { items: [{
|
|
13201
|
+
type: Input
|
|
13202
|
+
}], service: [{
|
|
13203
|
+
type: Input
|
|
13204
|
+
}] } });
|
|
13205
|
+
|
|
13206
|
+
class SmartFilterEditorContentComponent {
|
|
13207
|
+
constructor(layoutService) {
|
|
13208
|
+
this.layoutService = layoutService;
|
|
13209
|
+
this._destroy$ = new Subject();
|
|
13210
|
+
this.uiActionModels = [];
|
|
13211
|
+
this.expressionUiActionModels = [];
|
|
13212
|
+
this.type = FilterExpressionBuilderUiModel.TypeEnum;
|
|
13213
|
+
}
|
|
13214
|
+
ngAfterViewInit() {
|
|
13215
|
+
if (this.simpleFilterFormChildren?.first) {
|
|
13216
|
+
this.subsrcibeSimpleFormChildrenEvents();
|
|
13167
13217
|
}
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
}
|
|
13172
|
-
if (typeof basePath !== 'string') {
|
|
13173
|
-
basePath = this.basePath;
|
|
13174
|
-
}
|
|
13175
|
-
this.configuration.basePath = basePath;
|
|
13218
|
+
else {
|
|
13219
|
+
this.simpleFilterFormChildren?.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13220
|
+
this.subsrcibeSimpleFormChildrenEvents();
|
|
13221
|
+
});
|
|
13176
13222
|
}
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
// @ts-ignore
|
|
13180
|
-
addToHttpParams(httpParams, value, key) {
|
|
13181
|
-
if (typeof value === "object" && value instanceof Date === false) {
|
|
13182
|
-
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
13223
|
+
if (this.formChildren?.first) {
|
|
13224
|
+
this.subscribeEditorFormChildrenEvents();
|
|
13183
13225
|
}
|
|
13184
13226
|
else {
|
|
13185
|
-
|
|
13227
|
+
this.formChildren?.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13228
|
+
this.subscribeEditorFormChildrenEvents();
|
|
13229
|
+
});
|
|
13186
13230
|
}
|
|
13187
|
-
return httpParams;
|
|
13188
13231
|
}
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
}
|
|
13201
|
-
else {
|
|
13202
|
-
throw Error("key may not be null if value is Date");
|
|
13203
|
-
}
|
|
13232
|
+
subsrcibeSimpleFormChildrenEvents() {
|
|
13233
|
+
this.simpleFilterFormChildren?.first.onBlurSubject
|
|
13234
|
+
?.pipe(takeUntil(this._destroy$))
|
|
13235
|
+
.subscribe(() => {
|
|
13236
|
+
this.saveFilter();
|
|
13237
|
+
});
|
|
13238
|
+
this.simpleFilterFormChildren?.first.sophisticatedValueChange
|
|
13239
|
+
?.pipe(takeUntil(this._destroy$))
|
|
13240
|
+
.subscribe((change) => {
|
|
13241
|
+
if (change.kind === 'selection') {
|
|
13242
|
+
this.saveFilter();
|
|
13204
13243
|
}
|
|
13205
|
-
|
|
13206
|
-
|
|
13244
|
+
});
|
|
13245
|
+
}
|
|
13246
|
+
subscribeEditorFormChildrenEvents() {
|
|
13247
|
+
this.formChildren?.first.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13248
|
+
this.save();
|
|
13249
|
+
});
|
|
13250
|
+
this.formChildren?.first.sophisticatedValueChange
|
|
13251
|
+
?.pipe(takeUntil(this._destroy$))
|
|
13252
|
+
.subscribe((change) => {
|
|
13253
|
+
if (change.key === 'expressionData.currentOperation') {
|
|
13254
|
+
this.save();
|
|
13207
13255
|
}
|
|
13208
|
-
}
|
|
13209
|
-
else if (key != null) {
|
|
13210
|
-
httpParams = httpParams.append(key, value);
|
|
13211
|
-
}
|
|
13212
|
-
else {
|
|
13213
|
-
throw Error("key may not be null if value is not object or array");
|
|
13214
|
-
}
|
|
13215
|
-
return httpParams;
|
|
13256
|
+
});
|
|
13216
13257
|
}
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
}
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
}
|
|
13240
|
-
let responseType_ = 'json';
|
|
13241
|
-
if (localVarHttpHeaderAcceptSelected) {
|
|
13242
|
-
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13243
|
-
responseType_ = 'text';
|
|
13258
|
+
// smartFilterChangeSubscription?: Subscription;
|
|
13259
|
+
// smartFilterSophisticatedChangeSubscription?: Subscription;
|
|
13260
|
+
// smartformChangeSubscription?: Subscription;
|
|
13261
|
+
// smartformSophisticatedChangeSubscription?: Subscription;
|
|
13262
|
+
ngOnInit() {
|
|
13263
|
+
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
|
|
13264
|
+
this.service.load();
|
|
13265
|
+
}
|
|
13266
|
+
ngOnDestroy() {
|
|
13267
|
+
this._destroy$.next();
|
|
13268
|
+
this._destroy$.complete();
|
|
13269
|
+
}
|
|
13270
|
+
setupSimpleFilter() {
|
|
13271
|
+
let widgets = [];
|
|
13272
|
+
let key;
|
|
13273
|
+
let model = {};
|
|
13274
|
+
this.service.model?.model?.workplaceList?.filters.forEach((filterExpressionField, index) => {
|
|
13275
|
+
model[index] = filterExpressionField;
|
|
13276
|
+
if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
|
|
13277
|
+
key = index + '.expressionData.operand2.selectedValues';
|
|
13278
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13279
|
+
return;
|
|
13244
13280
|
}
|
|
13245
|
-
|
|
13246
|
-
|
|
13281
|
+
if (filterExpressionField.expressionData?.currentOperation === 'BETWEEN') {
|
|
13282
|
+
key = index + '.expressionData.operand2.valueAsString';
|
|
13283
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13284
|
+
key = index + '.expressionData.operand3.valueAsString';
|
|
13285
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13286
|
+
return;
|
|
13247
13287
|
}
|
|
13248
|
-
|
|
13249
|
-
|
|
13288
|
+
if (filterExpressionField.expressionData?.operand2) {
|
|
13289
|
+
if (key !== index + '.expressionData.operand2.selectedValues') {
|
|
13290
|
+
key = index + '.expressionData.operand2.valueAsString';
|
|
13291
|
+
}
|
|
13292
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13293
|
+
return;
|
|
13294
|
+
}
|
|
13295
|
+
if (filterExpressionField?.expressionData?.operand3) {
|
|
13296
|
+
if (key !== index + '.selectedValues') {
|
|
13297
|
+
key = index + '.expressionData.operand3.valueAsString';
|
|
13298
|
+
}
|
|
13299
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13300
|
+
return;
|
|
13250
13301
|
}
|
|
13251
|
-
}
|
|
13252
|
-
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`;
|
|
13253
|
-
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
13254
|
-
context: localVarHttpContext,
|
|
13255
|
-
responseType: responseType_,
|
|
13256
|
-
withCredentials: this.configuration.withCredentials,
|
|
13257
|
-
headers: localVarHeaders,
|
|
13258
|
-
observe: observe,
|
|
13259
|
-
reportProgress: reportProgress
|
|
13260
13302
|
});
|
|
13303
|
+
this.simpleFilterForm = {
|
|
13304
|
+
direction: SmartFormWidgetDirection.ROW,
|
|
13305
|
+
componentModel: { data: model },
|
|
13306
|
+
useOnValueChangeEvent: true,
|
|
13307
|
+
useOnBlurEvent: true,
|
|
13308
|
+
widgets,
|
|
13309
|
+
};
|
|
13261
13310
|
}
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13274
|
-
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13275
|
-
// to determine the Accept header
|
|
13276
|
-
const httpHeaderAccepts = [
|
|
13277
|
-
'application/json'
|
|
13278
|
-
];
|
|
13279
|
-
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13280
|
-
}
|
|
13281
|
-
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13282
|
-
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13283
|
-
}
|
|
13284
|
-
let localVarHttpContext = options && options.context;
|
|
13285
|
-
if (localVarHttpContext === undefined) {
|
|
13286
|
-
localVarHttpContext = new HttpContext();
|
|
13287
|
-
}
|
|
13288
|
-
// to determine the Content-Type header
|
|
13289
|
-
const consumes = [
|
|
13290
|
-
'application/json'
|
|
13291
|
-
];
|
|
13292
|
-
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
13293
|
-
if (httpContentTypeSelected !== undefined) {
|
|
13294
|
-
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
13311
|
+
extractFilterFieldFromFormModel() {
|
|
13312
|
+
let simpleFilter = this.simpleFilterFormChildren?.first?.submitForm(false).componentModel.data;
|
|
13313
|
+
let result = [];
|
|
13314
|
+
Object.keys(simpleFilter).forEach((key) => {
|
|
13315
|
+
result.push(simpleFilter[key]);
|
|
13316
|
+
});
|
|
13317
|
+
this.service.model.model.workplaceList.filters = result;
|
|
13318
|
+
}
|
|
13319
|
+
setUp() {
|
|
13320
|
+
if (this.service.model?.type === this.type.Simple) {
|
|
13321
|
+
this.setupSimpleFilter();
|
|
13295
13322
|
}
|
|
13296
|
-
|
|
13297
|
-
|
|
13298
|
-
if (
|
|
13299
|
-
|
|
13300
|
-
}
|
|
13301
|
-
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13302
|
-
responseType_ = 'json';
|
|
13323
|
+
else {
|
|
13324
|
+
this.constructUiActionModels();
|
|
13325
|
+
if (this.service.model.selectedFieldEditor) {
|
|
13326
|
+
this.constructForm();
|
|
13303
13327
|
}
|
|
13304
13328
|
else {
|
|
13305
|
-
|
|
13329
|
+
this.smartForm = undefined;
|
|
13306
13330
|
}
|
|
13307
13331
|
}
|
|
13308
|
-
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`;
|
|
13309
|
-
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
13310
|
-
context: localVarHttpContext,
|
|
13311
|
-
body: body,
|
|
13312
|
-
responseType: responseType_,
|
|
13313
|
-
withCredentials: this.configuration.withCredentials,
|
|
13314
|
-
headers: localVarHeaders,
|
|
13315
|
-
observe: observe,
|
|
13316
|
-
reportProgress: reportProgress
|
|
13317
|
-
});
|
|
13318
13332
|
}
|
|
13319
|
-
|
|
13320
|
-
|
|
13321
|
-
|
|
13322
|
-
|
|
13323
|
-
|
|
13324
|
-
|
|
13325
|
-
|
|
13326
|
-
|
|
13327
|
-
}
|
|
13328
|
-
|
|
13329
|
-
|
|
13330
|
-
|
|
13331
|
-
|
|
13332
|
-
|
|
13333
|
-
|
|
13334
|
-
|
|
13335
|
-
|
|
13336
|
-
|
|
13337
|
-
|
|
13338
|
-
|
|
13339
|
-
|
|
13340
|
-
|
|
13341
|
-
|
|
13342
|
-
|
|
13343
|
-
async load() {
|
|
13344
|
-
this.model = await this.service.load(this.config.uuid, this.config.identifier).toPromise();
|
|
13345
|
-
this.modelChanged.next();
|
|
13346
|
-
}
|
|
13347
|
-
async peformWidgetAction(request) {
|
|
13348
|
-
this.model = await this.service
|
|
13349
|
-
.performWidgetAction(this.config.uuid, this.config.identifier, request)
|
|
13350
|
-
.toPromise();
|
|
13351
|
-
this.modelChanged.next();
|
|
13352
|
-
}
|
|
13353
|
-
getModel() {
|
|
13354
|
-
return this.model;
|
|
13355
|
-
}
|
|
13356
|
-
async performUiActionRequest(uiActionRequest, widgetId, nodeId) {
|
|
13357
|
-
await this.peformWidgetAction(uiActionRequest);
|
|
13333
|
+
constructUiActionModels() {
|
|
13334
|
+
if (this.service.model?.possibleActions) {
|
|
13335
|
+
this.uiActionModels = this.service.model.possibleActions.map((action) => {
|
|
13336
|
+
return {
|
|
13337
|
+
serviceToUse: this.service,
|
|
13338
|
+
uiAction: action,
|
|
13339
|
+
};
|
|
13340
|
+
});
|
|
13341
|
+
}
|
|
13342
|
+
if (this.service.model?.selectedFieldEditor?.possibleActions) {
|
|
13343
|
+
this.expressionUiActionModels = this.service.model?.selectedFieldEditor.possibleActions.map((uiAction) => {
|
|
13344
|
+
let copiedUiAction = {};
|
|
13345
|
+
Object.keys(uiAction).map((key) => {
|
|
13346
|
+
copiedUiAction[key] = uiAction[key];
|
|
13347
|
+
});
|
|
13348
|
+
copiedUiAction.params = {
|
|
13349
|
+
field: this.service.model?.selectedField,
|
|
13350
|
+
};
|
|
13351
|
+
return {
|
|
13352
|
+
serviceToUse: this.service,
|
|
13353
|
+
uiAction: copiedUiAction,
|
|
13354
|
+
};
|
|
13355
|
+
});
|
|
13356
|
+
}
|
|
13358
13357
|
}
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13358
|
+
constructForm() {
|
|
13359
|
+
let generatedWidgets = this.layoutService.render({
|
|
13360
|
+
layoutDefinitions: this.service.model?.selectedFieldEditor?.layoutDef?.widgets,
|
|
13361
|
+
});
|
|
13362
|
+
this.smartForm = {
|
|
13363
|
+
direction: SmartFormWidgetDirection.ROW,
|
|
13364
|
+
useOnBlurEvent: true,
|
|
13365
|
+
useOnValueChangeEvent: true,
|
|
13366
|
+
componentModel: { data: this.service.model?.selectedField },
|
|
13367
|
+
widgets: generatedWidgets,
|
|
13363
13368
|
};
|
|
13364
13369
|
}
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
SmartFilterEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, deps: [{ token: FilterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13370
|
-
SmartFilterEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService });
|
|
13371
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, decorators: [{
|
|
13372
|
-
type: Injectable
|
|
13373
|
-
}], ctorParameters: function () { return [{ type: FilterService }]; } });
|
|
13374
|
-
|
|
13375
|
-
class SmartFilterParamComponent {
|
|
13376
|
-
constructor(service) {
|
|
13377
|
-
this.service = service;
|
|
13378
|
-
}
|
|
13379
|
-
ngOnInit() { }
|
|
13380
|
-
onItemClick(item) {
|
|
13381
|
-
this.data.serviceToUse.peformWidgetAction({
|
|
13382
|
-
code: 'ADD_FILTER_EXPRESSION',
|
|
13370
|
+
save() {
|
|
13371
|
+
this.formChildren?.first?.submitForm(false);
|
|
13372
|
+
this.service.peformWidgetAction({
|
|
13373
|
+
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13383
13374
|
params: {
|
|
13384
|
-
model:
|
|
13375
|
+
model: this.service.model?.selectedField,
|
|
13385
13376
|
},
|
|
13386
13377
|
});
|
|
13387
13378
|
}
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
}], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { data: [{
|
|
13395
|
-
type: Input
|
|
13396
|
-
}] } });
|
|
13397
|
-
|
|
13398
|
-
class SmartFilterParamsComponent {
|
|
13399
|
-
// filterComponentRef?: ComponentRef<SmartFilterComponent>;
|
|
13400
|
-
// filter?: SmartFilter;
|
|
13401
|
-
constructor() {
|
|
13402
|
-
this._destroy$ = new Subject();
|
|
13403
|
-
this.expandableSections = [];
|
|
13404
|
-
}
|
|
13405
|
-
ngOnInit() {
|
|
13406
|
-
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13407
|
-
this.setUp(this.service.model);
|
|
13379
|
+
remove() {
|
|
13380
|
+
this.service.peformWidgetAction({
|
|
13381
|
+
code: 'REMOVE_FILTER_EXPRESSION',
|
|
13382
|
+
params: {
|
|
13383
|
+
model: this.service.model?.selectedField,
|
|
13384
|
+
},
|
|
13408
13385
|
});
|
|
13409
|
-
this.setUp(this.service.model);
|
|
13410
|
-
}
|
|
13411
|
-
ngOnDestroy() {
|
|
13412
|
-
this._destroy$.next();
|
|
13413
|
-
this._destroy$.complete();
|
|
13414
13386
|
}
|
|
13415
|
-
|
|
13416
|
-
this.
|
|
13417
|
-
|
|
13418
|
-
|
|
13387
|
+
async saveFilter() {
|
|
13388
|
+
this.extractFilterFieldFromFormModel();
|
|
13389
|
+
this.service.performUiActionRequest({
|
|
13390
|
+
code: FilterExpressionBuilderApiActions.SAVE_EXPRESSION_FIELD_LIST,
|
|
13391
|
+
params: {
|
|
13392
|
+
model: this.service.model,
|
|
13393
|
+
},
|
|
13394
|
+
});
|
|
13419
13395
|
}
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13396
|
+
constructFormWidget(key, label, widgetType, possibleValues) {
|
|
13397
|
+
let type = widgetType;
|
|
13398
|
+
if (type === FilterExpressionFieldWidgetType.Date) {
|
|
13399
|
+
type = SmartFormWidgetType.DATE_PICKER;
|
|
13400
|
+
}
|
|
13401
|
+
else if (type === FilterExpressionFieldWidgetType.DateTime) {
|
|
13402
|
+
type = SmartFormWidgetType.DATE_TIME_PICKER;
|
|
13403
|
+
}
|
|
13404
|
+
let widget = {
|
|
13405
|
+
key,
|
|
13406
|
+
label,
|
|
13407
|
+
type,
|
|
13408
|
+
value: '',
|
|
13409
|
+
showLabel: true,
|
|
13410
|
+
valueList: possibleValues.map((value) => {
|
|
13423
13411
|
return {
|
|
13424
|
-
|
|
13425
|
-
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
group: filterExpressionBuilderGroup.fields,
|
|
13429
|
-
serviceToUse: this.service,
|
|
13430
|
-
},
|
|
13431
|
-
inputName: 'data',
|
|
13432
|
-
isExpanded: true,
|
|
13412
|
+
key: value.objectUri ? value.objectUri : value.code,
|
|
13413
|
+
label: value.displayValue,
|
|
13414
|
+
type: SmartFormWidgetType.ITEM,
|
|
13415
|
+
value: value.objectUri ? value.objectUri : value.code,
|
|
13433
13416
|
};
|
|
13434
|
-
})
|
|
13435
|
-
}
|
|
13436
|
-
|
|
13437
|
-
// this.expandableSectionsFromExcel = {
|
|
13438
|
-
// title: this.service.model.externalFilterGroup.label!,
|
|
13439
|
-
// cssClass: 'filterExpressionBuilderGroup',
|
|
13440
|
-
// customComponent: SmartFilterParamComponent,
|
|
13441
|
-
// data: {
|
|
13442
|
-
// group: this.service.model.externalFilterGroup.fields,
|
|
13443
|
-
// },
|
|
13444
|
-
// inputName: 'data',
|
|
13445
|
-
// isExpanded: true,
|
|
13446
|
-
// };
|
|
13447
|
-
// }
|
|
13448
|
-
}
|
|
13449
|
-
// constructFilter(): void {
|
|
13450
|
-
// if (this.filter && this.filterComponentRef) {
|
|
13451
|
-
// return;
|
|
13452
|
-
// }
|
|
13453
|
-
// // this.filter = {
|
|
13454
|
-
// // data: this.service.model?.groupFilter?.filters! as FilterExpressionField[],
|
|
13455
|
-
// // type: SmartFilterType.Simple,
|
|
13456
|
-
// // showPossibleActions: false,
|
|
13457
|
-
// // };
|
|
13458
|
-
// this.filterVcRef?.clear();
|
|
13459
|
-
// this.filterComponentRef = this.cfService.createComponent(
|
|
13460
|
-
// this.filterVcRef!,
|
|
13461
|
-
// SmartFilterComponent,
|
|
13462
|
-
// new Map<string, any>([['filter', this.filter]])
|
|
13463
|
-
// );
|
|
13464
|
-
// this.filterComponentRef.instance?.service.change
|
|
13465
|
-
// .pipe(takeUntil(this._destroy$))
|
|
13466
|
-
// .subscribe(() => {
|
|
13467
|
-
// let uiAction: UiAction = this.service.model?.filterGroupsAction!;
|
|
13468
|
-
// uiAction.params = {
|
|
13469
|
-
// filter: {
|
|
13470
|
-
// filters: this.filterComponentRef?.instance.service.filter?.data,
|
|
13471
|
-
// },
|
|
13472
|
-
// };
|
|
13473
|
-
// // let uiActionModel: UiActionModel = {
|
|
13474
|
-
// // serviceToUse: this.service,
|
|
13475
|
-
// // uiAction,
|
|
13476
|
-
// // };
|
|
13477
|
-
// // this.uiActionService.uiActionModel = uiActionModel;
|
|
13478
|
-
// // this.uiActionService.execute(uiAction);
|
|
13479
|
-
// });
|
|
13480
|
-
// }
|
|
13481
|
-
addDataSource() {
|
|
13482
|
-
// this.service.addDataSource();
|
|
13417
|
+
}),
|
|
13418
|
+
};
|
|
13419
|
+
return widget;
|
|
13483
13420
|
}
|
|
13484
13421
|
}
|
|
13485
|
-
|
|
13486
|
-
|
|
13487
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type:
|
|
13422
|
+
SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13423
|
+
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"] }] });
|
|
13424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, decorators: [{
|
|
13488
13425
|
type: Component,
|
|
13489
|
-
args: [{ selector: 'smart-filter-
|
|
13490
|
-
}], ctorParameters: function () { return []; }, propDecorators: { service: [{
|
|
13426
|
+
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"] }]
|
|
13427
|
+
}], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { service: [{
|
|
13491
13428
|
type: Input
|
|
13492
|
-
}],
|
|
13493
|
-
type:
|
|
13494
|
-
args: ['
|
|
13429
|
+
}], formChildren: [{
|
|
13430
|
+
type: ViewChildren,
|
|
13431
|
+
args: ['form']
|
|
13432
|
+
}], simpleFilterFormChildren: [{
|
|
13433
|
+
type: ViewChildren,
|
|
13434
|
+
args: ['simpleFilterFromChild']
|
|
13495
13435
|
}] } });
|
|
13496
13436
|
|
|
13497
|
-
|
|
13498
|
-
(function (FilterExpressionBuilderUiModel) {
|
|
13499
|
-
FilterExpressionBuilderUiModel.TypeEnum = {
|
|
13500
|
-
Simple: 'SIMPLE',
|
|
13501
|
-
Complex: 'COMPLEX'
|
|
13502
|
-
};
|
|
13503
|
-
})(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
|
|
13504
|
-
|
|
13505
|
-
var FilterExpressionBuilderApiActions;
|
|
13506
|
-
(function (FilterExpressionBuilderApiActions) {
|
|
13507
|
-
FilterExpressionBuilderApiActions["OPEN_FILTER_GROUPS"] = "OPEN_FILTER_GROUPS";
|
|
13508
|
-
FilterExpressionBuilderApiActions["CLOSE_FILTER_GROUPS"] = "CLOSE_FILTER_GROUPS";
|
|
13509
|
-
FilterExpressionBuilderApiActions["ADD_BRACKET"] = "ADD_BRACKET";
|
|
13510
|
-
FilterExpressionBuilderApiActions["ADD_FILTER_EXPRESSION"] = "ADD_FILTER_EXPRESSION";
|
|
13511
|
-
FilterExpressionBuilderApiActions["REMOVE_FILTER_EXPRESSION"] = "REMOVE_FILTER_EXPRESSION";
|
|
13512
|
-
FilterExpressionBuilderApiActions["REDO"] = "REDO";
|
|
13513
|
-
FilterExpressionBuilderApiActions["FILTER_GROUPS"] = "AFILTER_GROUPS";
|
|
13514
|
-
FilterExpressionBuilderApiActions["SELECT_FIELD"] = "SELECT_FIELD";
|
|
13515
|
-
FilterExpressionBuilderApiActions["UPDATE_FILTER_EXPRESSION"] = "UPDATE_FILTER_EXPRESSION";
|
|
13516
|
-
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_DATA"] = "SAVE_EXPRESSION_DATA";
|
|
13517
|
-
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_FIELD_LIST"] = "SAVE_EXPRESSION_FIELD_LIST";
|
|
13518
|
-
})(FilterExpressionBuilderApiActions || (FilterExpressionBuilderApiActions = {}));
|
|
13519
|
-
|
|
13520
|
-
class SmartFilterExpressionItemComponent {
|
|
13521
|
-
constructor(service) {
|
|
13522
|
-
this.service = service;
|
|
13523
|
-
this.isSelected = false;
|
|
13524
|
-
}
|
|
13525
|
-
ngOnInit() {
|
|
13526
|
-
this.isSelected =
|
|
13527
|
-
JSON.stringify(this.service.model?.selectedField) === JSON.stringify(this.item);
|
|
13528
|
-
}
|
|
13529
|
-
setOperatorTo(event, operationType) {
|
|
13530
|
-
event?.stopPropagation();
|
|
13531
|
-
if (!this.service.model?.readOnly) {
|
|
13532
|
-
this.item.expressionData.boolOperator = operationType;
|
|
13533
|
-
this.service.peformWidgetAction({
|
|
13534
|
-
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13535
|
-
params: {
|
|
13536
|
-
model: this.item,
|
|
13537
|
-
},
|
|
13538
|
-
});
|
|
13539
|
-
}
|
|
13540
|
-
}
|
|
13541
|
-
select(event, item) {
|
|
13542
|
-
event?.stopPropagation();
|
|
13543
|
-
if (!this.service.model?.readOnly) {
|
|
13544
|
-
if (!this.isSelected) {
|
|
13545
|
-
this.service.peformWidgetAction({
|
|
13546
|
-
code: 'SELECT_FIELD',
|
|
13547
|
-
params: {
|
|
13548
|
-
model: this.item,
|
|
13549
|
-
},
|
|
13550
|
-
});
|
|
13551
|
-
}
|
|
13552
|
-
else {
|
|
13553
|
-
this.service.peformWidgetAction({
|
|
13554
|
-
code: 'SELECT_FIELD',
|
|
13555
|
-
params: {
|
|
13556
|
-
model: this.item,
|
|
13557
|
-
},
|
|
13558
|
-
});
|
|
13559
|
-
}
|
|
13560
|
-
}
|
|
13561
|
-
}
|
|
13562
|
-
}
|
|
13563
|
-
SmartFilterExpressionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13564
|
-
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"] }] });
|
|
13565
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, decorators: [{
|
|
13566
|
-
type: Component,
|
|
13567
|
-
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"] }]
|
|
13568
|
-
}], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { item: [{
|
|
13569
|
-
type: Input
|
|
13570
|
-
}], hasNext: [{
|
|
13571
|
-
type: Input
|
|
13572
|
-
}] } });
|
|
13573
|
-
|
|
13574
|
-
class SmartFilterExpressionItemsComponent {
|
|
13575
|
-
constructor(service) {
|
|
13576
|
-
this.service = service;
|
|
13577
|
-
this._destroy$ = new Subject();
|
|
13578
|
-
this.isSelected = false;
|
|
13579
|
-
this.service.modelChanged.subscribe(() => {
|
|
13580
|
-
console.log(this.service.model);
|
|
13581
|
-
this.isSelected = this.service.model?.selectedField === null;
|
|
13582
|
-
});
|
|
13583
|
-
this.isSelected = this.service.model?.selectedField === null;
|
|
13584
|
-
}
|
|
13585
|
-
ngOnChanges(changes) {
|
|
13586
|
-
console.log(changes);
|
|
13587
|
-
}
|
|
13588
|
-
ngOnInit() { }
|
|
13589
|
-
ngOnDestroy() {
|
|
13590
|
-
this._destroy$.next();
|
|
13591
|
-
this._destroy$.complete();
|
|
13592
|
-
}
|
|
13593
|
-
select() {
|
|
13594
|
-
// this.service.selectFilterExpressionField(undefined);
|
|
13595
|
-
}
|
|
13596
|
-
drop(event) {
|
|
13597
|
-
moveItemInArray(this.items, event.previousIndex, event.currentIndex);
|
|
13598
|
-
}
|
|
13599
|
-
}
|
|
13600
|
-
SmartFilterExpressionItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13601
|
-
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"] }] });
|
|
13602
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, decorators: [{
|
|
13603
|
-
type: Component,
|
|
13604
|
-
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"] }]
|
|
13605
|
-
}], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { items: [{
|
|
13606
|
-
type: Input
|
|
13607
|
-
}] } });
|
|
13608
|
-
|
|
13609
|
-
class SmartFilterEditorContentComponent {
|
|
13610
|
-
constructor(layoutService, cfService) {
|
|
13611
|
-
this.layoutService = layoutService;
|
|
13612
|
-
this.cfService = cfService;
|
|
13613
|
-
this._destroy$ = new Subject();
|
|
13614
|
-
this.uiActionModels = [];
|
|
13615
|
-
this.expressionUiActionModels = [];
|
|
13616
|
-
this.type = FilterExpressionBuilderUiModel.TypeEnum;
|
|
13617
|
-
}
|
|
13618
|
-
ngOnInit() {
|
|
13619
|
-
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
|
|
13620
|
-
this.service.load();
|
|
13621
|
-
}
|
|
13622
|
-
ngOnDestroy() {
|
|
13623
|
-
this._destroy$.next();
|
|
13624
|
-
this._destroy$.complete();
|
|
13625
|
-
}
|
|
13626
|
-
setupSimpleFilter() {
|
|
13627
|
-
if (this.simpleFilterFormChild) {
|
|
13628
|
-
return;
|
|
13629
|
-
}
|
|
13630
|
-
let widgets = [];
|
|
13631
|
-
let key;
|
|
13632
|
-
let model = {};
|
|
13633
|
-
this.service.model?.model?.workplaceList?.filters.forEach((filterExpressionField, index) => {
|
|
13634
|
-
model[index] = filterExpressionField;
|
|
13635
|
-
if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
|
|
13636
|
-
key = index + '.expressionData.operand2.selectedValues';
|
|
13637
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13638
|
-
return;
|
|
13639
|
-
}
|
|
13640
|
-
if (filterExpressionField.expressionData?.currentOperation === 'BETWEEN') {
|
|
13641
|
-
key = index + '.expressionData.operand2.valueAsString';
|
|
13642
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13643
|
-
key = index + '.expressionData.operand3.valueAsString';
|
|
13644
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13645
|
-
return;
|
|
13646
|
-
}
|
|
13647
|
-
if (filterExpressionField.expressionData?.operand2) {
|
|
13648
|
-
if (key !== index + '.expressionData.operand2.selectedValues') {
|
|
13649
|
-
key = index + '.expressionData.operand2.valueAsString';
|
|
13650
|
-
}
|
|
13651
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13652
|
-
return;
|
|
13653
|
-
}
|
|
13654
|
-
if (filterExpressionField?.expressionData?.operand3) {
|
|
13655
|
-
if (key !== index + '.selectedValues') {
|
|
13656
|
-
key = index + '.expressionData.operand3.valueAsString';
|
|
13657
|
-
}
|
|
13658
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13659
|
-
return;
|
|
13660
|
-
}
|
|
13661
|
-
});
|
|
13662
|
-
this.simpleFilterForm = {
|
|
13663
|
-
direction: SmartFormWidgetDirection.ROW,
|
|
13664
|
-
componentModel: { data: model },
|
|
13665
|
-
useOnValueChangeEvent: true,
|
|
13666
|
-
useOnBlurEvent: true,
|
|
13667
|
-
widgets,
|
|
13668
|
-
};
|
|
13669
|
-
this.simpleFilterFormChild = this.cfService.createComponent(this.simpleFilterFormVcRef, SmartformComponent, new Map([['smartForm', this.simpleFilterForm]]));
|
|
13670
|
-
if (this.smartFilterChangeSubscription) {
|
|
13671
|
-
this.smartFilterChangeSubscription.unsubscribe();
|
|
13672
|
-
}
|
|
13673
|
-
this.smartFilterChangeSubscription = this.simpleFilterFormChild.instance.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13674
|
-
this.saveFilter();
|
|
13675
|
-
});
|
|
13676
|
-
if (this.smartFilterSophisticatedChangeSubscription) {
|
|
13677
|
-
this.smartFilterSophisticatedChangeSubscription.unsubscribe();
|
|
13678
|
-
}
|
|
13679
|
-
this.smartFilterSophisticatedChangeSubscription =
|
|
13680
|
-
this.simpleFilterFormChild.instance.sophisticatedValueChange?.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13681
|
-
if (change.kind === 'selection') {
|
|
13682
|
-
this.saveFilter();
|
|
13683
|
-
}
|
|
13684
|
-
});
|
|
13685
|
-
}
|
|
13686
|
-
extractFilterFieldFromFormModel() {
|
|
13687
|
-
let simpleFilter = this.simpleFilterFormChild?.instance.submitForm(false).componentModel.data;
|
|
13688
|
-
let result = [];
|
|
13689
|
-
Object.keys(simpleFilter).forEach((key) => {
|
|
13690
|
-
result.push(simpleFilter[key]);
|
|
13691
|
-
});
|
|
13692
|
-
this.service.model.model.workplaceList.filters = result;
|
|
13693
|
-
}
|
|
13694
|
-
setUp() {
|
|
13695
|
-
if (this.service.model?.type === this.type.Simple) {
|
|
13696
|
-
this.setupSimpleFilter();
|
|
13697
|
-
}
|
|
13698
|
-
else {
|
|
13699
|
-
this.constructUiActionModels();
|
|
13700
|
-
if (this.service.model.selectedFieldEditor) {
|
|
13701
|
-
this.constructForm();
|
|
13702
|
-
}
|
|
13703
|
-
else {
|
|
13704
|
-
this.smartForm = undefined;
|
|
13705
|
-
}
|
|
13706
|
-
}
|
|
13707
|
-
}
|
|
13708
|
-
constructUiActionModels() {
|
|
13709
|
-
if (this.service.model?.possibleActions) {
|
|
13710
|
-
this.uiActionModels = this.service.model.possibleActions.map((action) => {
|
|
13711
|
-
return {
|
|
13712
|
-
serviceToUse: this.service,
|
|
13713
|
-
uiAction: action,
|
|
13714
|
-
};
|
|
13715
|
-
});
|
|
13716
|
-
}
|
|
13717
|
-
if (this.service.model?.selectedFieldEditor?.possibleActions) {
|
|
13718
|
-
this.expressionUiActionModels = this.service.model?.selectedFieldEditor.possibleActions.map((uiAction) => {
|
|
13719
|
-
let copiedUiAction = {};
|
|
13720
|
-
Object.keys(uiAction).map((key) => {
|
|
13721
|
-
copiedUiAction[key] = uiAction[key];
|
|
13722
|
-
});
|
|
13723
|
-
copiedUiAction.params = {
|
|
13724
|
-
field: this.service.model?.selectedField,
|
|
13725
|
-
};
|
|
13726
|
-
return {
|
|
13727
|
-
serviceToUse: this.service,
|
|
13728
|
-
uiAction: copiedUiAction,
|
|
13729
|
-
};
|
|
13730
|
-
});
|
|
13731
|
-
}
|
|
13732
|
-
}
|
|
13733
|
-
constructForm() {
|
|
13734
|
-
if (this.smartForm) {
|
|
13735
|
-
return;
|
|
13736
|
-
}
|
|
13737
|
-
let generatedWidgets = this.layoutService.render({
|
|
13738
|
-
layoutDefinitions: this.service.model?.selectedFieldEditor?.layoutDef?.widgets,
|
|
13739
|
-
});
|
|
13740
|
-
this.smartForm = {
|
|
13741
|
-
direction: SmartFormWidgetDirection.ROW,
|
|
13742
|
-
useOnBlurEvent: true,
|
|
13743
|
-
useOnValueChangeEvent: true,
|
|
13744
|
-
componentModel: { data: this.service.model?.selectedField },
|
|
13745
|
-
widgets: generatedWidgets,
|
|
13746
|
-
};
|
|
13747
|
-
this.formChild = this.cfService.createComponent(this.formChildVcRef, SmartformComponent, new Map([['smartForm', this.smartForm]]));
|
|
13748
|
-
if (this.smartformChangeSubscription) {
|
|
13749
|
-
this.smartformChangeSubscription.unsubscribe();
|
|
13750
|
-
}
|
|
13751
|
-
this.smartformChangeSubscription = this.formChild?.instance.onBlurSubject
|
|
13752
|
-
?.pipe(takeUntil(this._destroy$))
|
|
13753
|
-
.subscribe(() => {
|
|
13754
|
-
this.save();
|
|
13755
|
-
});
|
|
13756
|
-
if (this.smartformSophisticatedChangeSubscription) {
|
|
13757
|
-
this.smartformSophisticatedChangeSubscription.unsubscribe();
|
|
13758
|
-
}
|
|
13759
|
-
this.smartformSophisticatedChangeSubscription =
|
|
13760
|
-
this.formChild?.instance.sophisticatedValueChange
|
|
13761
|
-
?.pipe(takeUntil(this._destroy$))
|
|
13762
|
-
.subscribe((change) => {
|
|
13763
|
-
if (change.key === 'expressionData.currentOperation') {
|
|
13764
|
-
this.save();
|
|
13765
|
-
}
|
|
13766
|
-
});
|
|
13767
|
-
}
|
|
13768
|
-
save() {
|
|
13769
|
-
this.formChild?.instance.submitForm(false);
|
|
13770
|
-
this.service.peformWidgetAction({
|
|
13771
|
-
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13772
|
-
params: {
|
|
13773
|
-
model: this.service.model?.selectedField,
|
|
13774
|
-
},
|
|
13775
|
-
});
|
|
13776
|
-
}
|
|
13777
|
-
remove() {
|
|
13778
|
-
this.service.peformWidgetAction({
|
|
13779
|
-
code: 'REMOVE_FILTER_EXPRESSION',
|
|
13780
|
-
params: {
|
|
13781
|
-
model: this.service.model?.selectedField,
|
|
13782
|
-
},
|
|
13783
|
-
});
|
|
13784
|
-
}
|
|
13785
|
-
getFilteredUiActionModels(filterPredicate) {
|
|
13786
|
-
// return this.service.model!.possibleActions!.filter(filterPredicate).map((uiAction: UiAction) => {
|
|
13787
|
-
// return {
|
|
13788
|
-
// serviceToUse: this.service,
|
|
13789
|
-
// uiAction,
|
|
13790
|
-
// };
|
|
13791
|
-
// });
|
|
13792
|
-
return [];
|
|
13793
|
-
}
|
|
13794
|
-
async saveFilter() {
|
|
13795
|
-
this.extractFilterFieldFromFormModel();
|
|
13796
|
-
this.service.performUiActionRequest({
|
|
13797
|
-
code: FilterExpressionBuilderApiActions.SAVE_EXPRESSION_FIELD_LIST,
|
|
13798
|
-
params: {
|
|
13799
|
-
model: this.service.model,
|
|
13800
|
-
},
|
|
13801
|
-
});
|
|
13802
|
-
}
|
|
13803
|
-
constructFormWidget(key, label, widgetType, possibleValues) {
|
|
13804
|
-
let type = widgetType;
|
|
13805
|
-
if (type === FilterExpressionFieldWidgetType.Date) {
|
|
13806
|
-
type = SmartFormWidgetType.DATE_PICKER;
|
|
13807
|
-
}
|
|
13808
|
-
else if (type === FilterExpressionFieldWidgetType.DateTime) {
|
|
13809
|
-
type = SmartFormWidgetType.DATE_TIME_PICKER;
|
|
13810
|
-
}
|
|
13811
|
-
let widget = {
|
|
13812
|
-
key,
|
|
13813
|
-
label,
|
|
13814
|
-
type,
|
|
13815
|
-
value: '',
|
|
13816
|
-
showLabel: true,
|
|
13817
|
-
valueList: possibleValues.map((value) => {
|
|
13818
|
-
return {
|
|
13819
|
-
key: value.objectUri ? value.objectUri : value.code,
|
|
13820
|
-
label: value.displayValue,
|
|
13821
|
-
type: SmartFormWidgetType.ITEM,
|
|
13822
|
-
value: value.objectUri ? value.objectUri : value.code,
|
|
13823
|
-
};
|
|
13824
|
-
}),
|
|
13825
|
-
};
|
|
13826
|
-
return widget;
|
|
13827
|
-
}
|
|
13828
|
-
}
|
|
13829
|
-
SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }, { token: ComponentFactoryService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13830
|
-
SmartFilterEditorContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterEditorContentComponent, selector: "smart-filter-expression-editor", inputs: { service: "service" }, viewQueries: [{ propertyName: "formChildVcRef", first: true, predicate: ["form"], descendants: true, read: ViewContainerRef }, { propertyName: "simpleFilterFormVcRef", first: true, predicate: ["simpleFilterFromChild"], descendants: true, read: ViewContainerRef }], 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 <ng-template #simpleFilterFromChild></ng-template>\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 <ng-template #form></ng-template>\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: 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"] }] });
|
|
13831
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, decorators: [{
|
|
13832
|
-
type: Component,
|
|
13833
|
-
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 <ng-template #simpleFilterFromChild></ng-template>\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 <ng-template #form></ng-template>\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"] }]
|
|
13834
|
-
}], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }, { type: ComponentFactoryService }]; }, propDecorators: { service: [{
|
|
13835
|
-
type: Input
|
|
13836
|
-
}], formChildVcRef: [{
|
|
13837
|
-
type: ViewChild,
|
|
13838
|
-
args: ['form', { read: ViewContainerRef }]
|
|
13839
|
-
}], simpleFilterFormVcRef: [{
|
|
13840
|
-
type: ViewChild,
|
|
13841
|
-
args: ['simpleFilterFromChild', { read: ViewContainerRef }]
|
|
13842
|
-
}] } });
|
|
13843
|
-
|
|
13844
|
-
class SmartFilterEditorModule {
|
|
13437
|
+
class SmartFilterEditorModule {
|
|
13845
13438
|
}
|
|
13846
13439
|
SmartFilterEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
13847
13440
|
SmartFilterEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, declarations: [SmartFilterParamsComponent,
|
|
@@ -14076,6 +13669,351 @@ class SmartComponentLayoutUtility {
|
|
|
14076
13669
|
* Public API Surface of smart-component-layout
|
|
14077
13670
|
*/
|
|
14078
13671
|
|
|
13672
|
+
/**
|
|
13673
|
+
* Custom HttpParameterCodec
|
|
13674
|
+
* Workaround for https://github.com/angular/angular/issues/18261
|
|
13675
|
+
*/
|
|
13676
|
+
class CustomHttpParameterCodec {
|
|
13677
|
+
encodeKey(k) {
|
|
13678
|
+
return encodeURIComponent(k);
|
|
13679
|
+
}
|
|
13680
|
+
encodeValue(v) {
|
|
13681
|
+
return encodeURIComponent(v);
|
|
13682
|
+
}
|
|
13683
|
+
decodeKey(k) {
|
|
13684
|
+
return decodeURIComponent(k);
|
|
13685
|
+
}
|
|
13686
|
+
decodeValue(v) {
|
|
13687
|
+
return decodeURIComponent(v);
|
|
13688
|
+
}
|
|
13689
|
+
}
|
|
13690
|
+
|
|
13691
|
+
const BASE_PATH = new InjectionToken('basePath');
|
|
13692
|
+
const COLLECTION_FORMATS = {
|
|
13693
|
+
'csv': ',',
|
|
13694
|
+
'tsv': ' ',
|
|
13695
|
+
'ssv': ' ',
|
|
13696
|
+
'pipes': '|'
|
|
13697
|
+
};
|
|
13698
|
+
|
|
13699
|
+
class Configuration {
|
|
13700
|
+
constructor(configurationParameters = {}) {
|
|
13701
|
+
this.apiKeys = configurationParameters.apiKeys;
|
|
13702
|
+
this.username = configurationParameters.username;
|
|
13703
|
+
this.password = configurationParameters.password;
|
|
13704
|
+
this.accessToken = configurationParameters.accessToken;
|
|
13705
|
+
this.basePath = configurationParameters.basePath;
|
|
13706
|
+
this.withCredentials = configurationParameters.withCredentials;
|
|
13707
|
+
this.encoder = configurationParameters.encoder;
|
|
13708
|
+
if (configurationParameters.encodeParam) {
|
|
13709
|
+
this.encodeParam = configurationParameters.encodeParam;
|
|
13710
|
+
}
|
|
13711
|
+
else {
|
|
13712
|
+
this.encodeParam = param => this.defaultEncodeParam(param);
|
|
13713
|
+
}
|
|
13714
|
+
if (configurationParameters.credentials) {
|
|
13715
|
+
this.credentials = configurationParameters.credentials;
|
|
13716
|
+
}
|
|
13717
|
+
else {
|
|
13718
|
+
this.credentials = {};
|
|
13719
|
+
}
|
|
13720
|
+
}
|
|
13721
|
+
/**
|
|
13722
|
+
* Select the correct content-type to use for a request.
|
|
13723
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
|
13724
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
13725
|
+
* @param contentTypes - the array of content types that are available for selection
|
|
13726
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
13727
|
+
*/
|
|
13728
|
+
selectHeaderContentType(contentTypes) {
|
|
13729
|
+
if (contentTypes.length === 0) {
|
|
13730
|
+
return undefined;
|
|
13731
|
+
}
|
|
13732
|
+
const type = contentTypes.find((x) => this.isJsonMime(x));
|
|
13733
|
+
if (type === undefined) {
|
|
13734
|
+
return contentTypes[0];
|
|
13735
|
+
}
|
|
13736
|
+
return type;
|
|
13737
|
+
}
|
|
13738
|
+
/**
|
|
13739
|
+
* Select the correct accept content-type to use for a request.
|
|
13740
|
+
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
|
|
13741
|
+
* If no content type is found return the first found type if the contentTypes is not empty
|
|
13742
|
+
* @param accepts - the array of content types that are available for selection.
|
|
13743
|
+
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
13744
|
+
*/
|
|
13745
|
+
selectHeaderAccept(accepts) {
|
|
13746
|
+
if (accepts.length === 0) {
|
|
13747
|
+
return undefined;
|
|
13748
|
+
}
|
|
13749
|
+
const type = accepts.find((x) => this.isJsonMime(x));
|
|
13750
|
+
if (type === undefined) {
|
|
13751
|
+
return accepts[0];
|
|
13752
|
+
}
|
|
13753
|
+
return type;
|
|
13754
|
+
}
|
|
13755
|
+
/**
|
|
13756
|
+
* Check if the given MIME is a JSON MIME.
|
|
13757
|
+
* JSON MIME examples:
|
|
13758
|
+
* application/json
|
|
13759
|
+
* application/json; charset=UTF8
|
|
13760
|
+
* APPLICATION/JSON
|
|
13761
|
+
* application/vnd.company+json
|
|
13762
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
13763
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
13764
|
+
*/
|
|
13765
|
+
isJsonMime(mime) {
|
|
13766
|
+
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
13767
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
13768
|
+
}
|
|
13769
|
+
lookupCredential(key) {
|
|
13770
|
+
const value = this.credentials[key];
|
|
13771
|
+
return typeof value === 'function'
|
|
13772
|
+
? value()
|
|
13773
|
+
: value;
|
|
13774
|
+
}
|
|
13775
|
+
defaultEncodeParam(param) {
|
|
13776
|
+
// This implementation exists as fallback for missing configuration
|
|
13777
|
+
// and for backwards compatibility to older typescript-angular generator versions.
|
|
13778
|
+
// It only works for the 'simple' parameter style.
|
|
13779
|
+
// Date-handling only works for the 'date-time' format.
|
|
13780
|
+
// All other styles and Date-formats are probably handled incorrectly.
|
|
13781
|
+
//
|
|
13782
|
+
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
|
|
13783
|
+
const value = param.dataFormat === 'date-time' && param.value instanceof Date
|
|
13784
|
+
? param.value.toISOString()
|
|
13785
|
+
: param.value;
|
|
13786
|
+
return encodeURIComponent(String(value));
|
|
13787
|
+
}
|
|
13788
|
+
}
|
|
13789
|
+
|
|
13790
|
+
/**
|
|
13791
|
+
* Filter API 2
|
|
13792
|
+
* Filter API 2
|
|
13793
|
+
*
|
|
13794
|
+
* The version of the OpenAPI document: 1.0.0
|
|
13795
|
+
* Contact: info@it4all.hu
|
|
13796
|
+
*
|
|
13797
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
13798
|
+
* https://openapi-generator.tech
|
|
13799
|
+
* Do not edit the class manually.
|
|
13800
|
+
*/
|
|
13801
|
+
class FilterService {
|
|
13802
|
+
constructor(httpClient, basePath, configuration) {
|
|
13803
|
+
this.httpClient = httpClient;
|
|
13804
|
+
this.basePath = 'http://localhost';
|
|
13805
|
+
this.defaultHeaders = new HttpHeaders();
|
|
13806
|
+
this.configuration = new Configuration();
|
|
13807
|
+
if (configuration) {
|
|
13808
|
+
this.configuration = configuration;
|
|
13809
|
+
}
|
|
13810
|
+
if (typeof this.configuration.basePath !== 'string') {
|
|
13811
|
+
if (Array.isArray(basePath) && basePath.length > 0) {
|
|
13812
|
+
basePath = basePath[0];
|
|
13813
|
+
}
|
|
13814
|
+
if (typeof basePath !== 'string') {
|
|
13815
|
+
basePath = this.basePath;
|
|
13816
|
+
}
|
|
13817
|
+
this.configuration.basePath = basePath;
|
|
13818
|
+
}
|
|
13819
|
+
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
|
|
13820
|
+
}
|
|
13821
|
+
// @ts-ignore
|
|
13822
|
+
addToHttpParams(httpParams, value, key) {
|
|
13823
|
+
if (typeof value === "object" && value instanceof Date === false) {
|
|
13824
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
13825
|
+
}
|
|
13826
|
+
else {
|
|
13827
|
+
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
13828
|
+
}
|
|
13829
|
+
return httpParams;
|
|
13830
|
+
}
|
|
13831
|
+
addToHttpParamsRecursive(httpParams, value, key) {
|
|
13832
|
+
if (value == null) {
|
|
13833
|
+
return httpParams;
|
|
13834
|
+
}
|
|
13835
|
+
if (typeof value === "object") {
|
|
13836
|
+
if (Array.isArray(value)) {
|
|
13837
|
+
value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
|
|
13838
|
+
}
|
|
13839
|
+
else if (value instanceof Date) {
|
|
13840
|
+
if (key != null) {
|
|
13841
|
+
httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
|
|
13842
|
+
}
|
|
13843
|
+
else {
|
|
13844
|
+
throw Error("key may not be null if value is Date");
|
|
13845
|
+
}
|
|
13846
|
+
}
|
|
13847
|
+
else {
|
|
13848
|
+
Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
|
|
13849
|
+
}
|
|
13850
|
+
}
|
|
13851
|
+
else if (key != null) {
|
|
13852
|
+
httpParams = httpParams.append(key, value);
|
|
13853
|
+
}
|
|
13854
|
+
else {
|
|
13855
|
+
throw Error("key may not be null if value is not object or array");
|
|
13856
|
+
}
|
|
13857
|
+
return httpParams;
|
|
13858
|
+
}
|
|
13859
|
+
load(uuid, filterIdentifier, observe = 'body', reportProgress = false, options) {
|
|
13860
|
+
if (uuid === null || uuid === undefined) {
|
|
13861
|
+
throw new Error('Required parameter uuid was null or undefined when calling load.');
|
|
13862
|
+
}
|
|
13863
|
+
if (filterIdentifier === null || filterIdentifier === undefined) {
|
|
13864
|
+
throw new Error('Required parameter filterIdentifier was null or undefined when calling load.');
|
|
13865
|
+
}
|
|
13866
|
+
let localVarHeaders = this.defaultHeaders;
|
|
13867
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13868
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13869
|
+
// to determine the Accept header
|
|
13870
|
+
const httpHeaderAccepts = [
|
|
13871
|
+
'application/json'
|
|
13872
|
+
];
|
|
13873
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13874
|
+
}
|
|
13875
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13876
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13877
|
+
}
|
|
13878
|
+
let localVarHttpContext = options && options.context;
|
|
13879
|
+
if (localVarHttpContext === undefined) {
|
|
13880
|
+
localVarHttpContext = new HttpContext();
|
|
13881
|
+
}
|
|
13882
|
+
let responseType_ = 'json';
|
|
13883
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
13884
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13885
|
+
responseType_ = 'text';
|
|
13886
|
+
}
|
|
13887
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13888
|
+
responseType_ = 'json';
|
|
13889
|
+
}
|
|
13890
|
+
else {
|
|
13891
|
+
responseType_ = 'blob';
|
|
13892
|
+
}
|
|
13893
|
+
}
|
|
13894
|
+
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`;
|
|
13895
|
+
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
13896
|
+
context: localVarHttpContext,
|
|
13897
|
+
responseType: responseType_,
|
|
13898
|
+
withCredentials: this.configuration.withCredentials,
|
|
13899
|
+
headers: localVarHeaders,
|
|
13900
|
+
observe: observe,
|
|
13901
|
+
reportProgress: reportProgress
|
|
13902
|
+
});
|
|
13903
|
+
}
|
|
13904
|
+
performWidgetAction(uuid, filterIdentifier, body, observe = 'body', reportProgress = false, options) {
|
|
13905
|
+
if (uuid === null || uuid === undefined) {
|
|
13906
|
+
throw new Error('Required parameter uuid was null or undefined when calling performWidgetAction.');
|
|
13907
|
+
}
|
|
13908
|
+
if (filterIdentifier === null || filterIdentifier === undefined) {
|
|
13909
|
+
throw new Error('Required parameter filterIdentifier was null or undefined when calling performWidgetAction.');
|
|
13910
|
+
}
|
|
13911
|
+
if (body === null || body === undefined) {
|
|
13912
|
+
throw new Error('Required parameter body was null or undefined when calling performWidgetAction.');
|
|
13913
|
+
}
|
|
13914
|
+
let localVarHeaders = this.defaultHeaders;
|
|
13915
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13916
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13917
|
+
// to determine the Accept header
|
|
13918
|
+
const httpHeaderAccepts = [
|
|
13919
|
+
'application/json'
|
|
13920
|
+
];
|
|
13921
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13922
|
+
}
|
|
13923
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13924
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13925
|
+
}
|
|
13926
|
+
let localVarHttpContext = options && options.context;
|
|
13927
|
+
if (localVarHttpContext === undefined) {
|
|
13928
|
+
localVarHttpContext = new HttpContext();
|
|
13929
|
+
}
|
|
13930
|
+
// to determine the Content-Type header
|
|
13931
|
+
const consumes = [
|
|
13932
|
+
'application/json'
|
|
13933
|
+
];
|
|
13934
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
13935
|
+
if (httpContentTypeSelected !== undefined) {
|
|
13936
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
13937
|
+
}
|
|
13938
|
+
let responseType_ = 'json';
|
|
13939
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
13940
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13941
|
+
responseType_ = 'text';
|
|
13942
|
+
}
|
|
13943
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13944
|
+
responseType_ = 'json';
|
|
13945
|
+
}
|
|
13946
|
+
else {
|
|
13947
|
+
responseType_ = 'blob';
|
|
13948
|
+
}
|
|
13949
|
+
}
|
|
13950
|
+
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`;
|
|
13951
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
13952
|
+
context: localVarHttpContext,
|
|
13953
|
+
body: body,
|
|
13954
|
+
responseType: responseType_,
|
|
13955
|
+
withCredentials: this.configuration.withCredentials,
|
|
13956
|
+
headers: localVarHeaders,
|
|
13957
|
+
observe: observe,
|
|
13958
|
+
reportProgress: reportProgress
|
|
13959
|
+
});
|
|
13960
|
+
}
|
|
13961
|
+
}
|
|
13962
|
+
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 });
|
|
13963
|
+
FilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, providedIn: 'root' });
|
|
13964
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, decorators: [{
|
|
13965
|
+
type: Injectable,
|
|
13966
|
+
args: [{
|
|
13967
|
+
providedIn: 'root'
|
|
13968
|
+
}]
|
|
13969
|
+
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
13970
|
+
type: Optional
|
|
13971
|
+
}, {
|
|
13972
|
+
type: Inject,
|
|
13973
|
+
args: [BASE_PATH]
|
|
13974
|
+
}] }, { type: Configuration, decorators: [{
|
|
13975
|
+
type: Optional
|
|
13976
|
+
}] }]; } });
|
|
13977
|
+
|
|
13978
|
+
class SmartFilterEditorService {
|
|
13979
|
+
constructor(service) {
|
|
13980
|
+
this.service = service;
|
|
13981
|
+
this.modelChanged = new Subject();
|
|
13982
|
+
this.submit = new Subject();
|
|
13983
|
+
this.reSubscribeToChange = new Subject();
|
|
13984
|
+
}
|
|
13985
|
+
async load() {
|
|
13986
|
+
this.model = await this.service.load(this.config.uuid, this.config.identifier).toPromise();
|
|
13987
|
+
this.modelChanged.next();
|
|
13988
|
+
}
|
|
13989
|
+
async peformWidgetAction(request) {
|
|
13990
|
+
this.model = await this.service
|
|
13991
|
+
.performWidgetAction(this.config.uuid, this.config.identifier, request)
|
|
13992
|
+
.toPromise();
|
|
13993
|
+
this.modelChanged.next();
|
|
13994
|
+
}
|
|
13995
|
+
getModel() {
|
|
13996
|
+
return this.model;
|
|
13997
|
+
}
|
|
13998
|
+
async performUiActionRequest(uiActionRequest, widgetId, nodeId) {
|
|
13999
|
+
await this.peformWidgetAction(uiActionRequest);
|
|
14000
|
+
}
|
|
14001
|
+
async handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
|
|
14002
|
+
return {
|
|
14003
|
+
shouldPerformAction: true,
|
|
14004
|
+
uiActionRequest: uiActionRequest,
|
|
14005
|
+
};
|
|
14006
|
+
}
|
|
14007
|
+
getAdditionalParams(uiAction) {
|
|
14008
|
+
throw new Error('Method not implemented.');
|
|
14009
|
+
}
|
|
14010
|
+
}
|
|
14011
|
+
SmartFilterEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, deps: [{ token: FilterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
14012
|
+
SmartFilterEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService });
|
|
14013
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, decorators: [{
|
|
14014
|
+
type: Injectable
|
|
14015
|
+
}], ctorParameters: function () { return [{ type: FilterService }]; } });
|
|
14016
|
+
|
|
14079
14017
|
let SmartComponentApiClient = class SmartComponentApiClient {
|
|
14080
14018
|
constructor(inject, auth, pageName) {
|
|
14081
14019
|
this.inject = inject;
|