@smartbit4all/ng-client 3.2.4 → 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.
Files changed (17) hide show
  1. package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-item/smart-filter-expression-item.component.mjs +9 -9
  2. package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-items/smart-filter-expression-items.component.mjs +12 -14
  3. package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.mjs +43 -53
  4. package/esm2020/lib/smart-filter-editor/smart-filter-params/components/smart-filter-param/smart-filter-param.component.mjs +7 -11
  5. package/esm2020/lib/smart-filter-editor/smart-filter-params/smart-filter-params.component.mjs +5 -57
  6. package/fesm2015/smartbit4all-ng-client.mjs +918 -982
  7. package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
  8. package/fesm2020/smartbit4all-ng-client.mjs +705 -768
  9. package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
  10. package/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-item/smart-filter-expression-item.component.d.ts +4 -4
  11. package/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-items/smart-filter-expression-items.component.d.ts +6 -7
  12. package/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.d.ts +2 -7
  13. package/lib/smart-filter-editor/smart-filter-params/components/smart-filter-param/smart-filter-param.component.d.ts +2 -6
  14. package/lib/smart-filter-editor/smart-filter-params/smart-filter-params.component.d.ts +2 -3
  15. package/package.json +1 -1
  16. package/smartbit4all-ng-client-3.2.5.tgz +0 -0
  17. package/smartbit4all-ng-client-3.2.4.tgz +0 -0
@@ -13022,827 +13022,419 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
13022
13022
  }]
13023
13023
  }] });
13024
13024
 
13025
- /**
13026
- * Custom HttpParameterCodec
13027
- * Workaround for https://github.com/angular/angular/issues/18261
13028
- */
13029
- class CustomHttpParameterCodec {
13030
- encodeKey(k) {
13031
- return encodeURIComponent(k);
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
+ });
13032
13034
  }
13033
- encodeValue(v) {
13034
- return encodeURIComponent(v);
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 = [];
13035
13049
  }
13036
- decodeKey(k) {
13037
- return decodeURIComponent(k);
13050
+ ngOnInit() {
13051
+ this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
13052
+ this.setUp(this.service.model);
13053
+ });
13054
+ this.setUp(this.service.model);
13038
13055
  }
13039
- decodeValue(v) {
13040
- return decodeURIComponent(v);
13056
+ ngOnDestroy() {
13057
+ this._destroy$.next();
13058
+ this._destroy$.complete();
13041
13059
  }
13042
- }
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
+ }] } });
13043
13093
 
13044
- const BASE_PATH = new InjectionToken('basePath');
13045
- const COLLECTION_FORMATS = {
13046
- 'csv': ',',
13047
- 'tsv': ' ',
13048
- 'ssv': ' ',
13049
- 'pipes': '|'
13050
- };
13094
+ var FilterExpressionBuilderUiModel;
13095
+ (function (FilterExpressionBuilderUiModel) {
13096
+ FilterExpressionBuilderUiModel.TypeEnum = {
13097
+ Simple: 'SIMPLE',
13098
+ Complex: 'COMPLEX'
13099
+ };
13100
+ })(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
13051
13101
 
13052
- class Configuration {
13053
- constructor(configurationParameters = {}) {
13054
- this.apiKeys = configurationParameters.apiKeys;
13055
- this.username = configurationParameters.username;
13056
- this.password = configurationParameters.password;
13057
- this.accessToken = configurationParameters.accessToken;
13058
- this.basePath = configurationParameters.basePath;
13059
- this.withCredentials = configurationParameters.withCredentials;
13060
- this.encoder = configurationParameters.encoder;
13061
- if (configurationParameters.encodeParam) {
13062
- this.encodeParam = configurationParameters.encodeParam;
13063
- }
13064
- else {
13065
- this.encodeParam = param => this.defaultEncodeParam(param);
13066
- }
13067
- if (configurationParameters.credentials) {
13068
- this.credentials = configurationParameters.credentials;
13069
- }
13070
- else {
13071
- this.credentials = {};
13072
- }
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;
13073
13120
  }
13074
- /**
13075
- * Select the correct content-type to use for a request.
13076
- * Uses {@link Configuration#isJsonMime} to determine the correct content-type.
13077
- * If no content type is found return the first found type if the contentTypes is not empty
13078
- * @param contentTypes - the array of content types that are available for selection
13079
- * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13080
- */
13081
- selectHeaderContentType(contentTypes) {
13082
- if (contentTypes.length === 0) {
13083
- return undefined;
13084
- }
13085
- const type = contentTypes.find((x) => this.isJsonMime(x));
13086
- if (type === undefined) {
13087
- return contentTypes[0];
13088
- }
13089
- return type;
13121
+ ngOnInit() {
13122
+ this.isSelected =
13123
+ JSON.stringify(this.service.model?.selectedField) === JSON.stringify(this.item);
13090
13124
  }
13091
- /**
13092
- * Select the correct accept content-type to use for a request.
13093
- * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
13094
- * If no content type is found return the first found type if the contentTypes is not empty
13095
- * @param accepts - the array of content types that are available for selection.
13096
- * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13097
- */
13098
- selectHeaderAccept(accepts) {
13099
- if (accepts.length === 0) {
13100
- return undefined;
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
+ });
13101
13135
  }
13102
- const type = accepts.find((x) => this.isJsonMime(x));
13103
- if (type === undefined) {
13104
- return accepts[0];
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
+ }
13105
13156
  }
13106
- return type;
13107
13157
  }
13108
- /**
13109
- * Check if the given MIME is a JSON MIME.
13110
- * JSON MIME examples:
13111
- * application/json
13112
- * application/json; charset=UTF8
13113
- * APPLICATION/JSON
13114
- * application/vnd.company+json
13115
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
13116
- * @return True if the given MIME is JSON, false otherwise.
13117
- */
13118
- isJsonMime(mime) {
13119
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
13120
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
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;
13121
13176
  }
13122
- lookupCredential(key) {
13123
- const value = this.credentials[key];
13124
- return typeof value === 'function'
13125
- ? value()
13126
- : value;
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;
13127
13183
  }
13128
- defaultEncodeParam(param) {
13129
- // This implementation exists as fallback for missing configuration
13130
- // and for backwards compatibility to older typescript-angular generator versions.
13131
- // It only works for the 'simple' parameter style.
13132
- // Date-handling only works for the 'date-time' format.
13133
- // All other styles and Date-formats are probably handled incorrectly.
13134
- //
13135
- // But: if that's all you need (i.e.: the most common use-case): no need for customization!
13136
- const value = param.dataFormat === 'date-time' && param.value instanceof Date
13137
- ? param.value.toISOString()
13138
- : param.value;
13139
- return encodeURIComponent(String(value));
13184
+ ngOnDestroy() {
13185
+ this._destroy$.next();
13186
+ this._destroy$.complete();
13140
13187
  }
13141
- }
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
+ }] } });
13142
13205
 
13143
- /**
13144
- * Filter API 2
13145
- * Filter API 2
13146
- *
13147
- * The version of the OpenAPI document: 1.0.0
13148
- * Contact: info@it4all.hu
13149
- *
13150
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13151
- * https://openapi-generator.tech
13152
- * Do not edit the class manually.
13153
- */
13154
- class FilterService {
13155
- constructor(httpClient, basePath, configuration) {
13156
- this.httpClient = httpClient;
13157
- this.basePath = 'http://localhost';
13158
- this.defaultHeaders = new HttpHeaders();
13159
- this.configuration = new Configuration();
13160
- if (configuration) {
13161
- this.configuration = configuration;
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();
13162
13217
  }
13163
- if (typeof this.configuration.basePath !== 'string') {
13164
- if (Array.isArray(basePath) && basePath.length > 0) {
13165
- basePath = basePath[0];
13166
- }
13167
- if (typeof basePath !== 'string') {
13168
- basePath = this.basePath;
13169
- }
13170
- this.configuration.basePath = basePath;
13218
+ else {
13219
+ this.simpleFilterFormChildren?.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
13220
+ this.subsrcibeSimpleFormChildrenEvents();
13221
+ });
13171
13222
  }
13172
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
13173
- }
13174
- // @ts-ignore
13175
- addToHttpParams(httpParams, value, key) {
13176
- if (typeof value === "object" && value instanceof Date === false) {
13177
- httpParams = this.addToHttpParamsRecursive(httpParams, value);
13223
+ if (this.formChildren?.first) {
13224
+ this.subscribeEditorFormChildrenEvents();
13178
13225
  }
13179
13226
  else {
13180
- httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
13227
+ this.formChildren?.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
13228
+ this.subscribeEditorFormChildrenEvents();
13229
+ });
13181
13230
  }
13182
- return httpParams;
13183
13231
  }
13184
- addToHttpParamsRecursive(httpParams, value, key) {
13185
- if (value == null) {
13186
- return httpParams;
13187
- }
13188
- if (typeof value === "object") {
13189
- if (Array.isArray(value)) {
13190
- value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
13191
- }
13192
- else if (value instanceof Date) {
13193
- if (key != null) {
13194
- httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
13195
- }
13196
- else {
13197
- throw Error("key may not be null if value is Date");
13198
- }
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();
13199
13243
  }
13200
- else {
13201
- Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
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();
13202
13255
  }
13203
- }
13204
- else if (key != null) {
13205
- httpParams = httpParams.append(key, value);
13206
- }
13207
- else {
13208
- throw Error("key may not be null if value is not object or array");
13209
- }
13210
- return httpParams;
13256
+ });
13211
13257
  }
13212
- load(uuid, filterIdentifier, observe = 'body', reportProgress = false, options) {
13213
- if (uuid === null || uuid === undefined) {
13214
- throw new Error('Required parameter uuid was null or undefined when calling load.');
13215
- }
13216
- if (filterIdentifier === null || filterIdentifier === undefined) {
13217
- throw new Error('Required parameter filterIdentifier was null or undefined when calling load.');
13218
- }
13219
- let localVarHeaders = this.defaultHeaders;
13220
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
13221
- if (localVarHttpHeaderAcceptSelected === undefined) {
13222
- // to determine the Accept header
13223
- const httpHeaderAccepts = [
13224
- 'application/json'
13225
- ];
13226
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
13227
- }
13228
- if (localVarHttpHeaderAcceptSelected !== undefined) {
13229
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
13230
- }
13231
- let localVarHttpContext = options && options.context;
13232
- if (localVarHttpContext === undefined) {
13233
- localVarHttpContext = new HttpContext();
13234
- }
13235
- let responseType_ = 'json';
13236
- if (localVarHttpHeaderAcceptSelected) {
13237
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
13238
- responseType_ = 'text';
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;
13239
13280
  }
13240
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
13241
- responseType_ = 'json';
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;
13242
13287
  }
13243
- else {
13244
- responseType_ = 'blob';
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;
13245
13301
  }
13246
- }
13247
- let localVarPath = `/filter/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "filterIdentifier", value: filterIdentifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/load`;
13248
- return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
13249
- context: localVarHttpContext,
13250
- responseType: responseType_,
13251
- withCredentials: this.configuration.withCredentials,
13252
- headers: localVarHeaders,
13253
- observe: observe,
13254
- reportProgress: reportProgress
13255
13302
  });
13303
+ this.simpleFilterForm = {
13304
+ direction: SmartFormWidgetDirection.ROW,
13305
+ componentModel: { data: model },
13306
+ useOnValueChangeEvent: true,
13307
+ useOnBlurEvent: true,
13308
+ widgets,
13309
+ };
13256
13310
  }
13257
- performWidgetAction(uuid, filterIdentifier, body, observe = 'body', reportProgress = false, options) {
13258
- if (uuid === null || uuid === undefined) {
13259
- throw new Error('Required parameter uuid was null or undefined when calling performWidgetAction.');
13260
- }
13261
- if (filterIdentifier === null || filterIdentifier === undefined) {
13262
- throw new Error('Required parameter filterIdentifier was null or undefined when calling performWidgetAction.');
13263
- }
13264
- if (body === null || body === undefined) {
13265
- throw new Error('Required parameter body was null or undefined when calling performWidgetAction.');
13266
- }
13267
- let localVarHeaders = this.defaultHeaders;
13268
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
13269
- if (localVarHttpHeaderAcceptSelected === undefined) {
13270
- // to determine the Accept header
13271
- const httpHeaderAccepts = [
13272
- 'application/json'
13273
- ];
13274
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
13275
- }
13276
- if (localVarHttpHeaderAcceptSelected !== undefined) {
13277
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
13278
- }
13279
- let localVarHttpContext = options && options.context;
13280
- if (localVarHttpContext === undefined) {
13281
- localVarHttpContext = new HttpContext();
13282
- }
13283
- // to determine the Content-Type header
13284
- const consumes = [
13285
- 'application/json'
13286
- ];
13287
- const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
13288
- if (httpContentTypeSelected !== undefined) {
13289
- localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
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();
13290
13322
  }
13291
- let responseType_ = 'json';
13292
- if (localVarHttpHeaderAcceptSelected) {
13293
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
13294
- responseType_ = 'text';
13295
- }
13296
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
13297
- responseType_ = 'json';
13323
+ else {
13324
+ this.constructUiActionModels();
13325
+ if (this.service.model.selectedFieldEditor) {
13326
+ this.constructForm();
13298
13327
  }
13299
13328
  else {
13300
- responseType_ = 'blob';
13329
+ this.smartForm = undefined;
13301
13330
  }
13302
13331
  }
13303
- let localVarPath = `/filter/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "filterIdentifier", value: filterIdentifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/performWidgetAction`;
13304
- return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
13305
- context: localVarHttpContext,
13306
- body: body,
13307
- responseType: responseType_,
13308
- withCredentials: this.configuration.withCredentials,
13309
- headers: localVarHeaders,
13310
- observe: observe,
13311
- reportProgress: reportProgress
13312
- });
13313
13332
  }
13314
- }
13315
- FilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
13316
- FilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, providedIn: 'root' });
13317
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, decorators: [{
13318
- type: Injectable,
13319
- args: [{
13320
- providedIn: 'root'
13321
- }]
13322
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
13323
- type: Optional
13324
- }, {
13325
- type: Inject,
13326
- args: [BASE_PATH]
13327
- }] }, { type: Configuration, decorators: [{
13328
- type: Optional
13329
- }] }]; } });
13330
-
13331
- class SmartFilterEditorService {
13332
- constructor(service) {
13333
- this.service = service;
13334
- this.modelChanged = new Subject();
13335
- this.submit = new Subject();
13336
- this.reSubscribeToChange = new Subject();
13337
- }
13338
- async load() {
13339
- this.model = await this.service.load(this.config.uuid, this.config.identifier).toPromise();
13340
- this.modelChanged.next();
13341
- }
13342
- async peformWidgetAction(request) {
13343
- this.model = await this.service
13344
- .performWidgetAction(this.config.uuid, this.config.identifier, request)
13345
- .toPromise();
13346
- this.modelChanged.next();
13347
- }
13348
- getModel() {
13349
- return this.model;
13350
- }
13351
- async performUiActionRequest(uiActionRequest, widgetId, nodeId) {
13352
- await this.peformWidgetAction(uiActionRequest);
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
+ }
13353
13357
  }
13354
- async handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
13355
- return {
13356
- shouldPerformAction: true,
13357
- uiActionRequest: uiActionRequest,
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,
13358
13368
  };
13359
13369
  }
13360
- getAdditionalParams(uiAction) {
13361
- throw new Error('Method not implemented.');
13362
- }
13363
- }
13364
- SmartFilterEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, deps: [{ token: FilterService }], target: i0.ɵɵFactoryTarget.Injectable });
13365
- SmartFilterEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService });
13366
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, decorators: [{
13367
- type: Injectable
13368
- }], ctorParameters: function () { return [{ type: FilterService }]; } });
13369
-
13370
- class SmartFilterParamComponent {
13371
- constructor(service) {
13372
- this.service = service;
13373
- }
13374
- ngOnInit() { }
13375
- onItemClick(item) {
13376
- this.data.serviceToUse.peformWidgetAction({
13377
- code: 'ADD_FILTER_EXPRESSION',
13370
+ save() {
13371
+ this.formChildren?.first?.submitForm(false);
13372
+ this.service.peformWidgetAction({
13373
+ code: 'UPDATE_FILTER_EXPRESSION',
13378
13374
  params: {
13379
- model: item,
13375
+ model: this.service.model?.selectedField,
13380
13376
  },
13381
13377
  });
13382
13378
  }
13383
- }
13384
- SmartFilterParamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
13385
- SmartFilterParamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamComponent, selector: "app-target-group-filter-param", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"], components: [{ type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }], directives: [{ type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13386
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
13387
- type: Component,
13388
- args: [{ selector: 'app-target-group-filter-param', template: "<div class=\"targetGroupFilterParamContainer\">\r\n <div\r\n class=\"targetGroupFilterItem\"\r\n *ngFor=\"let data of data?.group\"\r\n (click)=\"onItemClick(data)\"\r\n >\r\n <smart-icon icon=\"Ic24_Chevron_Right\" color=\"gray\"></smart-icon>\r\n <div class=\"mat-caption\">\r\n {{ data.label }}\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamContainer{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterItem{padding:.75rem;border-radius:.25rem;display:flex;flex-direction:row;gap:.5rem;cursor:pointer}.targetGroupFilterItem .mat-caption{margin:auto 0}\n"] }]
13389
- }], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { data: [{
13390
- type: Input
13391
- }] } });
13392
-
13393
- class SmartFilterParamsComponent {
13394
- // filterComponentRef?: ComponentRef<SmartFilterComponent>;
13395
- // filter?: SmartFilter;
13396
- constructor() {
13397
- this._destroy$ = new Subject();
13398
- this.expandableSections = [];
13399
- }
13400
- ngOnInit() {
13401
- this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
13402
- this.setUp(this.service.model);
13379
+ remove() {
13380
+ this.service.peformWidgetAction({
13381
+ code: 'REMOVE_FILTER_EXPRESSION',
13382
+ params: {
13383
+ model: this.service.model?.selectedField,
13384
+ },
13403
13385
  });
13404
- this.setUp(this.service.model);
13405
- }
13406
- ngOnDestroy() {
13407
- this._destroy$.next();
13408
- this._destroy$.complete();
13409
13386
  }
13410
- setUp(model) {
13411
- this.filterBuilder = model.model;
13412
- // this.constructFilter();
13413
- this.constructExpandableSections();
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
+ });
13414
13395
  }
13415
- constructExpandableSections() {
13416
- if (this.filterBuilder.groups) {
13417
- this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
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) => {
13418
13411
  return {
13419
- title: filterExpressionBuilderGroup.label,
13420
- cssClass: 'filterExpressionBuilderGroup',
13421
- customComponent: SmartFilterParamComponent,
13422
- data: {
13423
- group: filterExpressionBuilderGroup.fields,
13424
- serviceToUse: this.service,
13425
- },
13426
- inputName: 'data',
13427
- isExpanded: true,
13412
+ key: value.objectUri ? value.objectUri : value.code,
13413
+ label: value.displayValue,
13414
+ type: SmartFormWidgetType.ITEM,
13415
+ value: value.objectUri ? value.objectUri : value.code,
13428
13416
  };
13429
- });
13430
- }
13431
- // if (this.service.model?.externalFilterGroup) {
13432
- // this.expandableSectionsFromExcel = {
13433
- // title: this.service.model.externalFilterGroup.label!,
13434
- // cssClass: 'filterExpressionBuilderGroup',
13435
- // customComponent: SmartFilterParamComponent,
13436
- // data: {
13437
- // group: this.service.model.externalFilterGroup.fields,
13438
- // },
13439
- // inputName: 'data',
13440
- // isExpanded: true,
13441
- // };
13442
- // }
13443
- }
13444
- // constructFilter(): void {
13445
- // if (this.filter && this.filterComponentRef) {
13446
- // return;
13447
- // }
13448
- // // this.filter = {
13449
- // // data: this.service.model?.groupFilter?.filters! as FilterExpressionField[],
13450
- // // type: SmartFilterType.Simple,
13451
- // // showPossibleActions: false,
13452
- // // };
13453
- // this.filterVcRef?.clear();
13454
- // this.filterComponentRef = this.cfService.createComponent(
13455
- // this.filterVcRef!,
13456
- // SmartFilterComponent,
13457
- // new Map<string, any>([['filter', this.filter]])
13458
- // );
13459
- // this.filterComponentRef.instance?.service.change
13460
- // .pipe(takeUntil(this._destroy$))
13461
- // .subscribe(() => {
13462
- // let uiAction: UiAction = this.service.model?.filterGroupsAction!;
13463
- // uiAction.params = {
13464
- // filter: {
13465
- // filters: this.filterComponentRef?.instance.service.filter?.data,
13466
- // },
13467
- // };
13468
- // // let uiActionModel: UiActionModel = {
13469
- // // serviceToUse: this.service,
13470
- // // uiAction,
13471
- // // };
13472
- // // this.uiActionService.uiActionModel = uiActionModel;
13473
- // // this.uiActionService.execute(uiAction);
13474
- // });
13475
- // }
13476
- addDataSource() {
13477
- // this.service.addDataSource();
13417
+ }),
13418
+ };
13419
+ return widget;
13478
13420
  }
13479
13421
  }
13480
- SmartFilterParamsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13481
- SmartFilterParamsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterParamsComponent, selector: "smart-filter-group-params", inputs: { service: "service" }, viewQueries: [{ propertyName: "filterVcRef", first: true, predicate: ["smartFilter"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <ng-template #smartFilter></ng-template>\r\n <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"], components: [{ type: SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: ExpandableSectionComponent, selector: "smart-expandable-section", inputs: ["data", "index"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13482
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
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: [{
13483
13425
  type: Component,
13484
- args: [{ selector: 'smart-filter-group-params', template: "<div\r\n class=\"targetGroupFilterParamsContainer\"\r\n *ngIf=\"service.model?.showGroups && !service.model?.readOnly\"\r\n>\r\n <ng-template #smartFilter></ng-template>\r\n <div class=\"dataSource-options\" *ngIf=\"service.model?.extarnalDatabase\">\r\n <div class=\"dataSource-btns\">\r\n <div class=\"dataSource-btn\">K\u00FCls\u0151 adatb\u00E1zis</div>\r\n <div class=\"dataSource-btn dataSource-btn-disabled\">Bels\u0151 adatb\u00E1zis</div>\r\n </div>\r\n <div class=\"dataSource-add-database\">\r\n <div class=\"dataSource-add-database-title\">\r\n <smart-icon icon=\"Ic24_View_Table\" color=\"sucess\"></smart-icon>\r\n Adatb\u00E1zis\r\n </div>\r\n <button title=\"add\" mat-icon-button (click)=\"addDataSource()\">\r\n <smart-icon icon=\"Ic24_Plus_Circle\" color=\"success\"></smart-icon>\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"sections\">\r\n <smart-expandable-section\r\n class=\"excel\"\r\n *ngIf=\"expandableSectionsFromExcel\"\r\n [data]=\"expandableSectionsFromExcel!\"\r\n ></smart-expandable-section>\r\n <smart-expandable-section\r\n [data]=\"data\"\r\n *ngFor=\"let data of expandableSections\"\r\n ></smart-expandable-section>\r\n </div>\r\n</div>\r\n", styles: [".targetGroupFilterParamsContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;border-right:2px solid var(--primary-dark-color)}.sections{display:flex;flex-direction:column;gap:.25rem}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-body{background-color:var(--success-lighter-color)}.targetGroupFilterParamsContainer .excel::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--success-color)!important}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-body{padding:0 0 0 1rem!important;background-color:var(--light-blue-color)}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header{background-color:var(--primary-light-color);padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header-title{color:var(--primary-lighter-color);font-weight:600}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded{background-color:var(--accent-color)!important;padding:.75rem;height:auto}.targetGroupFilterParamsContainer::ng-deep .mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title{color:#fff}.dataSource-btns{display:flex;flex-direction:row;justify-content:space-around;background-color:var(--success-lighter-color);height:44px;padding:8px 12px;align-items:center;border:1.5px solid var(--success-color);border-left:6px solid var(--success-color);border-radius:4px}.dataSource-btn{display:flex;padding:1rem 2rem;justify-content:center;align-items:center;background-color:var(--success-color);border-radius:4px;cursor:pointer}.dataSource-btn-disabled{background-color:var(--success-lighter-color);cursor:auto}.dataSource-add-database{display:flex;flex-direction:row;justify-content:space-between;background-color:var(--success-lighter-color);padding:8px;border-radius:4px}.dataSource-add-database-title{display:flex;flex-direction:row;gap:1rem;align-items:center}.dataSource-options{display:flex;flex-direction:column;gap:1rem}\n"] }]
13485
- }], ctorParameters: function () { return []; }, propDecorators: { service: [{
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: [{
13486
13428
  type: Input
13487
- }], filterVcRef: [{
13488
- type: ViewChild,
13489
- args: ['smartFilter', { read: ViewContainerRef }]
13429
+ }], formChildren: [{
13430
+ type: ViewChildren,
13431
+ args: ['form']
13432
+ }], simpleFilterFormChildren: [{
13433
+ type: ViewChildren,
13434
+ args: ['simpleFilterFromChild']
13490
13435
  }] } });
13491
13436
 
13492
- var FilterExpressionBuilderUiModel;
13493
- (function (FilterExpressionBuilderUiModel) {
13494
- FilterExpressionBuilderUiModel.TypeEnum = {
13495
- Simple: 'SIMPLE',
13496
- Complex: 'COMPLEX'
13497
- };
13498
- })(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
13499
-
13500
- var FilterExpressionBuilderApiActions;
13501
- (function (FilterExpressionBuilderApiActions) {
13502
- FilterExpressionBuilderApiActions["OPEN_FILTER_GROUPS"] = "OPEN_FILTER_GROUPS";
13503
- FilterExpressionBuilderApiActions["CLOSE_FILTER_GROUPS"] = "CLOSE_FILTER_GROUPS";
13504
- FilterExpressionBuilderApiActions["ADD_BRACKET"] = "ADD_BRACKET";
13505
- FilterExpressionBuilderApiActions["ADD_FILTER_EXPRESSION"] = "ADD_FILTER_EXPRESSION";
13506
- FilterExpressionBuilderApiActions["REMOVE_FILTER_EXPRESSION"] = "REMOVE_FILTER_EXPRESSION";
13507
- FilterExpressionBuilderApiActions["REDO"] = "REDO";
13508
- FilterExpressionBuilderApiActions["FILTER_GROUPS"] = "AFILTER_GROUPS";
13509
- FilterExpressionBuilderApiActions["SELECT_FIELD"] = "SELECT_FIELD";
13510
- FilterExpressionBuilderApiActions["UPDATE_FILTER_EXPRESSION"] = "UPDATE_FILTER_EXPRESSION";
13511
- FilterExpressionBuilderApiActions["SAVE_EXPRESSION_DATA"] = "SAVE_EXPRESSION_DATA";
13512
- FilterExpressionBuilderApiActions["SAVE_EXPRESSION_FIELD_LIST"] = "SAVE_EXPRESSION_FIELD_LIST";
13513
- })(FilterExpressionBuilderApiActions || (FilterExpressionBuilderApiActions = {}));
13514
-
13515
- class SmartFilterExpressionItemComponent {
13516
- constructor(service) {
13517
- this.service = service;
13518
- this.isSelected = false;
13519
- }
13520
- ngOnInit() {
13521
- this.isSelected =
13522
- JSON.stringify(this.service.model?.selectedField) === JSON.stringify(this.item);
13523
- }
13524
- setOperatorTo(event, operationType) {
13525
- event?.stopPropagation();
13526
- if (!this.service.model?.readOnly) {
13527
- this.item.expressionData.boolOperator = operationType;
13528
- this.service.peformWidgetAction({
13529
- code: 'UPDATE_FILTER_EXPRESSION',
13530
- params: {
13531
- model: this.item,
13532
- },
13533
- });
13534
- }
13535
- }
13536
- select(event, item) {
13537
- event?.stopPropagation();
13538
- if (!this.service.model?.readOnly) {
13539
- if (!this.isSelected) {
13540
- this.service.peformWidgetAction({
13541
- code: 'SELECT_FIELD',
13542
- params: {
13543
- model: this.item,
13544
- },
13545
- });
13546
- }
13547
- else {
13548
- this.service.peformWidgetAction({
13549
- code: 'SELECT_FIELD',
13550
- params: {
13551
- model: this.item,
13552
- },
13553
- });
13554
- }
13555
- }
13556
- }
13557
- }
13558
- SmartFilterExpressionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
13559
- SmartFilterExpressionItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterExpressionItemComponent, selector: "app-expression-item", inputs: { item: "item", hasNext: "hasNext" }, ngImport: i0, template: "<div class=\"expressionItemContainer\">\r\n <div\r\n class=\"expressionItemInnerContainer\"\r\n [ngClass]=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION'\r\n ? isSelected\r\n ? 'selectedExpressionContainer'\r\n : 'expressionContainer'\r\n : ''\r\n \"\r\n (click)=\"select($event, item)\"\r\n >\r\n <div\r\n *ngIf=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION';\r\n then expression;\r\n else simpleItem\r\n \"\r\n ></div>\r\n <ng-template #expression>\r\n <div class=\"expressionItemBubble expression\">[</div>\r\n <app-expression-item\r\n [item]=\"subItem\"\r\n [hasNext]=\"i < (item.subFieldList?.filters)!.length - 1\"\r\n *ngFor=\"let subItem of item.subFieldList?.filters; let i = index\"\r\n ></app-expression-item>\r\n <div class=\"expressionItemBubble expression\">]</div>\r\n </ng-template>\r\n <ng-template #simpleItem>\r\n <div\r\n class=\"expressionItemBubble simpleItem\"\r\n [ngClass]=\"isSelected ? 'selectedSimpleItem' : ''\"\r\n >\r\n {{ item.label\r\n }}{{ item.expressionData?.operand2?.valueAsString ? \": \" : \"\" }}\r\n <b>\r\n {{ item.expressionData?.operand2?.valueAsString }}\r\n </b>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"hasNext\" class=\"relationItemBubble\">\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'AND')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'AND' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n \u00C9S\r\n </button>\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'OR')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'OR' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n VAGY\r\n </button>\r\n </div>\r\n <!-- <button mat-mini-fab color=\"gray\">\r\n\t\t<smart-icon icon=\"X\" color=\"gray\"></smart-icon>\r\n\t</button> -->\r\n</div>\r\n", styles: [".expressionItemContainer{display:flex;flex-direction:row;gap:.75rem}.expressionItemInnerContainer{display:flex;flex-direction:row;grid-area:.75rem;padding:.25rem;border-radius:.25rem}.expressionContainer{border:1px dashed var(--primary-lighter-gray-color);cursor:pointer}.selectedExpressionContainer{border:2px dashed var(--primary-darker-color)}.expressionItemBubble,.relationItemBubble{display:flex;flex-direction:row;border-radius:1.5rem}.expressionItemBubble{padding:.75rem}.expression{background-color:var(--inner-container);font-weight:600;margin:auto 0}.simpleItem{background-color:#c6ddff;cursor:pointer}.selectedSimpleItem{border:2px solid var(--primary-color)}.relationItemBubble{border:1px solid #cdcdcd;padding:.25rem}.relationItemBubble .mat-button{border-radius:1.5rem;height:100%;margin:auto 0}\n"], components: [{ type: SmartFilterExpressionItemComponent, selector: "app-expression-item", inputs: ["item", "hasNext"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13560
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, decorators: [{
13561
- type: Component,
13562
- args: [{ selector: 'app-expression-item', template: "<div class=\"expressionItemContainer\">\r\n <div\r\n class=\"expressionItemInnerContainer\"\r\n [ngClass]=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION'\r\n ? isSelected\r\n ? 'selectedExpressionContainer'\r\n : 'expressionContainer'\r\n : ''\r\n \"\r\n (click)=\"select($event, item)\"\r\n >\r\n <div\r\n *ngIf=\"\r\n item.expressionData?.currentOperation === 'EXPRESSION';\r\n then expression;\r\n else simpleItem\r\n \"\r\n ></div>\r\n <ng-template #expression>\r\n <div class=\"expressionItemBubble expression\">[</div>\r\n <app-expression-item\r\n [item]=\"subItem\"\r\n [hasNext]=\"i < (item.subFieldList?.filters)!.length - 1\"\r\n *ngFor=\"let subItem of item.subFieldList?.filters; let i = index\"\r\n ></app-expression-item>\r\n <div class=\"expressionItemBubble expression\">]</div>\r\n </ng-template>\r\n <ng-template #simpleItem>\r\n <div\r\n class=\"expressionItemBubble simpleItem\"\r\n [ngClass]=\"isSelected ? 'selectedSimpleItem' : ''\"\r\n >\r\n {{ item.label\r\n }}{{ item.expressionData?.operand2?.valueAsString ? \": \" : \"\" }}\r\n <b>\r\n {{ item.expressionData?.operand2?.valueAsString }}\r\n </b>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"hasNext\" class=\"relationItemBubble\">\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'AND')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'AND' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n \u00C9S\r\n </button>\r\n <button\r\n mat-button\r\n (click)=\"setOperatorTo($event, 'OR')\"\r\n [ngClass]=\"\r\n item.expressionData?.boolOperator === 'OR' ? 'mat-raised-button' : ''\r\n \"\r\n color=\"black\"\r\n >\r\n VAGY\r\n </button>\r\n </div>\r\n <!-- <button mat-mini-fab color=\"gray\">\r\n\t\t<smart-icon icon=\"X\" color=\"gray\"></smart-icon>\r\n\t</button> -->\r\n</div>\r\n", styles: [".expressionItemContainer{display:flex;flex-direction:row;gap:.75rem}.expressionItemInnerContainer{display:flex;flex-direction:row;grid-area:.75rem;padding:.25rem;border-radius:.25rem}.expressionContainer{border:1px dashed var(--primary-lighter-gray-color);cursor:pointer}.selectedExpressionContainer{border:2px dashed var(--primary-darker-color)}.expressionItemBubble,.relationItemBubble{display:flex;flex-direction:row;border-radius:1.5rem}.expressionItemBubble{padding:.75rem}.expression{background-color:var(--inner-container);font-weight:600;margin:auto 0}.simpleItem{background-color:#c6ddff;cursor:pointer}.selectedSimpleItem{border:2px solid var(--primary-color)}.relationItemBubble{border:1px solid #cdcdcd;padding:.25rem}.relationItemBubble .mat-button{border-radius:1.5rem;height:100%;margin:auto 0}\n"] }]
13563
- }], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { item: [{
13564
- type: Input
13565
- }], hasNext: [{
13566
- type: Input
13567
- }] } });
13568
-
13569
- class SmartFilterExpressionItemsComponent {
13570
- constructor(service) {
13571
- this.service = service;
13572
- this._destroy$ = new Subject();
13573
- this.isSelected = false;
13574
- this.service.modelChanged.subscribe(() => {
13575
- console.log(this.service.model);
13576
- this.isSelected = this.service.model?.selectedField === null;
13577
- });
13578
- this.isSelected = this.service.model?.selectedField === null;
13579
- }
13580
- ngOnChanges(changes) {
13581
- console.log(changes);
13582
- }
13583
- ngOnInit() { }
13584
- ngOnDestroy() {
13585
- this._destroy$.next();
13586
- this._destroy$.complete();
13587
- }
13588
- select() {
13589
- // this.service.selectFilterExpressionField(undefined);
13590
- }
13591
- drop(event) {
13592
- moveItemInArray(this.items, event.previousIndex, event.currentIndex);
13593
- }
13594
- }
13595
- SmartFilterExpressionItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
13596
- SmartFilterExpressionItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterExpressionItemsComponent, selector: "app-expression-items", inputs: { items: "items" }, usesOnChanges: true, ngImport: i0, template: "<div\r\n cdkDropList\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"expressionsContainer example-list\"\r\n [ngClass]=\"isSelected ? 'selected' : ''\"\r\n>\r\n <div cdkDrag class=\"expressionItem\" *ngFor=\"let item of items; let i = index\">\r\n <app-expression-item\r\n [item]=\"item\"\r\n [hasNext]=\"i < items.length - 1\"\r\n ></app-expression-item>\r\n </div>\r\n</div>\r\n", styles: [".expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;border:1px dashed var(--primary-lighter-gray-color);padding:.25rem;border-radius:.25rem}.selected{border:2px dashed var(--primary-darker-color)}.expressionItem{margin:auto 0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.example-custom-placeholder{background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], components: [{ type: SmartFilterExpressionItemComponent, selector: "app-expression-item", inputs: ["item", "hasNext"] }], directives: [{ type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
13597
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, decorators: [{
13598
- type: Component,
13599
- args: [{ selector: 'app-expression-items', template: "<div\r\n cdkDropList\r\n cdkDropListOrientation=\"horizontal\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n class=\"expressionsContainer example-list\"\r\n [ngClass]=\"isSelected ? 'selected' : ''\"\r\n>\r\n <div cdkDrag class=\"expressionItem\" *ngFor=\"let item of items; let i = index\">\r\n <app-expression-item\r\n [item]=\"item\"\r\n [hasNext]=\"i < items.length - 1\"\r\n ></app-expression-item>\r\n </div>\r\n</div>\r\n", styles: [".expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;border:1px dashed var(--primary-lighter-gray-color);padding:.25rem;border-radius:.25rem}.selected{border:2px dashed var(--primary-darker-color)}.expressionItem{margin:auto 0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:none}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.example-custom-placeholder{background:#ccc;border:dotted 3px #999;min-height:60px;transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
13600
- }], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { items: [{
13601
- type: Input
13602
- }] } });
13603
-
13604
- class SmartFilterEditorContentComponent {
13605
- constructor(layoutService) {
13606
- this.layoutService = layoutService;
13607
- this._destroy$ = new Subject();
13608
- this.uiActionModels = [];
13609
- this.expressionUiActionModels = [];
13610
- this.type = FilterExpressionBuilderUiModel.TypeEnum;
13611
- }
13612
- ngAfterViewInit() {
13613
- if (this.simpleFilterFormChildren?.first) {
13614
- this.simpleFilterFormChildren.first.onBlurSubject
13615
- ?.pipe(takeUntil(this._destroy$))
13616
- .subscribe(() => {
13617
- this.saveFilter();
13618
- });
13619
- this.simpleFilterFormChildren.first.sophisticatedValueChange
13620
- ?.pipe(takeUntil(this._destroy$))
13621
- .subscribe((change) => {
13622
- if (change.kind === 'selection') {
13623
- this.saveFilter();
13624
- }
13625
- });
13626
- }
13627
- else {
13628
- this.simpleFilterFormChildren?.changes.subscribe(() => {
13629
- this.simpleFilterFormChildren.first.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
13630
- this.saveFilter();
13631
- });
13632
- this.simpleFilterFormChildren.first.sophisticatedValueChange?.pipe(takeUntil(this._destroy$)).subscribe((change) => {
13633
- if (change.kind === 'selection') {
13634
- this.saveFilter();
13635
- }
13636
- });
13637
- });
13638
- }
13639
- }
13640
- ngOnInit() {
13641
- this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
13642
- this.service.load();
13643
- }
13644
- ngOnDestroy() {
13645
- this._destroy$.next();
13646
- this._destroy$.complete();
13647
- }
13648
- setupSimpleFilter() {
13649
- let widgets = [];
13650
- let key;
13651
- let model = {};
13652
- this.service.model?.model?.workplaceList?.filters.forEach((filterExpressionField, index) => {
13653
- model[index] = filterExpressionField;
13654
- if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
13655
- key = index + '.expressionData.operand2.selectedValues';
13656
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13657
- return;
13658
- }
13659
- if (filterExpressionField.expressionData?.currentOperation === 'BETWEEN') {
13660
- key = index + '.expressionData.operand2.valueAsString';
13661
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13662
- key = index + '.expressionData.operand3.valueAsString';
13663
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13664
- return;
13665
- }
13666
- if (filterExpressionField.expressionData?.operand2) {
13667
- if (key !== index + '.expressionData.operand2.selectedValues') {
13668
- key = index + '.expressionData.operand2.valueAsString';
13669
- }
13670
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13671
- return;
13672
- }
13673
- if (filterExpressionField?.expressionData?.operand3) {
13674
- if (key !== index + '.selectedValues') {
13675
- key = index + '.expressionData.operand3.valueAsString';
13676
- }
13677
- widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13678
- return;
13679
- }
13680
- });
13681
- this.simpleFilterForm = {
13682
- direction: SmartFormWidgetDirection.ROW,
13683
- componentModel: { data: model },
13684
- useOnValueChangeEvent: true,
13685
- useOnBlurEvent: true,
13686
- widgets,
13687
- };
13688
- }
13689
- extractFilterFieldFromFormModel() {
13690
- let simpleFilter = this.simpleFilterFormChildren?.first?.submitForm(false).componentModel.data;
13691
- let result = [];
13692
- Object.keys(simpleFilter).forEach((key) => {
13693
- result.push(simpleFilter[key]);
13694
- });
13695
- this.service.model.model.workplaceList.filters = result;
13696
- }
13697
- setUp() {
13698
- if (this.service.model?.type === this.type.Simple) {
13699
- this.setupSimpleFilter();
13700
- }
13701
- else {
13702
- this.constructUiActionModels();
13703
- if (this.service.model.selectedFieldEditor) {
13704
- this.constructForm();
13705
- }
13706
- else {
13707
- this.smartForm = undefined;
13708
- }
13709
- }
13710
- }
13711
- constructUiActionModels() {
13712
- if (this.service.model?.possibleActions) {
13713
- this.uiActionModels = this.service.model.possibleActions.map((action) => {
13714
- return {
13715
- serviceToUse: this.service,
13716
- uiAction: action,
13717
- };
13718
- });
13719
- }
13720
- if (this.service.model?.selectedFieldEditor?.possibleActions) {
13721
- this.expressionUiActionModels = this.service.model?.selectedFieldEditor.possibleActions.map((uiAction) => {
13722
- let copiedUiAction = {};
13723
- Object.keys(uiAction).map((key) => {
13724
- copiedUiAction[key] = uiAction[key];
13725
- });
13726
- copiedUiAction.params = {
13727
- field: this.service.model?.selectedField,
13728
- };
13729
- return {
13730
- serviceToUse: this.service,
13731
- uiAction: copiedUiAction,
13732
- };
13733
- });
13734
- }
13735
- }
13736
- constructForm() {
13737
- if (this.smartForm) {
13738
- return;
13739
- }
13740
- let generatedWidgets = this.layoutService.render({
13741
- layoutDefinitions: this.service.model?.selectedFieldEditor?.layoutDef?.widgets,
13742
- });
13743
- this.smartForm = {
13744
- direction: SmartFormWidgetDirection.ROW,
13745
- useOnBlurEvent: true,
13746
- useOnValueChangeEvent: true,
13747
- componentModel: { data: this.service.model?.selectedField },
13748
- widgets: generatedWidgets,
13749
- };
13750
- if (this.smartformChangeSubscription) {
13751
- this.smartformChangeSubscription.unsubscribe();
13752
- }
13753
- // this.smartformChangeSubscription = this.formChild?.onBlurSubject
13754
- // ?.pipe(takeUntil(this._destroy$))
13755
- // .subscribe(() => {
13756
- // this.save();
13757
- // });
13758
- // if (this.smartformSophisticatedChangeSubscription) {
13759
- // this.smartformSophisticatedChangeSubscription.unsubscribe();
13760
- // }
13761
- // this.smartformSophisticatedChangeSubscription = this.formChild?.sophisticatedValueChange
13762
- // ?.pipe(takeUntil(this._destroy$))
13763
- // .subscribe((change: SophisticatedValueChange) => {
13764
- // if (change.key === 'expressionData.currentOperation') {
13765
- // this.save();
13766
- // }
13767
- // });
13768
- }
13769
- save() {
13770
- this.formChildren?.first?.submitForm(false);
13771
- this.service.peformWidgetAction({
13772
- code: 'UPDATE_FILTER_EXPRESSION',
13773
- params: {
13774
- model: this.service.model?.selectedField,
13775
- },
13776
- });
13777
- }
13778
- remove() {
13779
- this.service.peformWidgetAction({
13780
- code: 'REMOVE_FILTER_EXPRESSION',
13781
- params: {
13782
- model: this.service.model?.selectedField,
13783
- },
13784
- });
13785
- }
13786
- getFilteredUiActionModels(filterPredicate) {
13787
- // return this.service.model!.possibleActions!.filter(filterPredicate).map((uiAction: UiAction) => {
13788
- // return {
13789
- // serviceToUse: this.service,
13790
- // uiAction,
13791
- // };
13792
- // });
13793
- return [];
13794
- }
13795
- async saveFilter() {
13796
- this.extractFilterFieldFromFormModel();
13797
- this.service.performUiActionRequest({
13798
- code: FilterExpressionBuilderApiActions.SAVE_EXPRESSION_FIELD_LIST,
13799
- params: {
13800
- model: this.service.model,
13801
- },
13802
- });
13803
- }
13804
- constructFormWidget(key, label, widgetType, possibleValues) {
13805
- let type = widgetType;
13806
- if (type === FilterExpressionFieldWidgetType.Date) {
13807
- type = SmartFormWidgetType.DATE_PICKER;
13808
- }
13809
- else if (type === FilterExpressionFieldWidgetType.DateTime) {
13810
- type = SmartFormWidgetType.DATE_TIME_PICKER;
13811
- }
13812
- let widget = {
13813
- key,
13814
- label,
13815
- type,
13816
- value: '',
13817
- showLabel: true,
13818
- valueList: possibleValues.map((value) => {
13819
- return {
13820
- key: value.objectUri ? value.objectUri : value.code,
13821
- label: value.displayValue,
13822
- type: SmartFormWidgetType.ITEM,
13823
- value: value.objectUri ? value.objectUri : value.code,
13824
- };
13825
- }),
13826
- };
13827
- return widget;
13828
- }
13829
- }
13830
- SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
13831
- SmartFilterEditorContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterEditorContentComponent, selector: "smart-filter-expression-editor", inputs: { service: "service" }, viewQueries: [{ propertyName: "formChildren", predicate: ["form"], descendants: true }, { propertyName: "simpleFilterFormChildren", predicate: ["simpleFilterFromChild"], descendants: true }], ngImport: i0, template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <smartform #simpleFilterFromChild [smartForm]=\"simpleFilterForm\"></smartform>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"], components: [{ type: SmartformComponent, selector: "smartform", inputs: ["smartForm"] }, { type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService"] }, { type: SmartFilterExpressionItemsComponent, selector: "app-expression-items", inputs: ["items"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
13832
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, decorators: [{
13833
- type: Component,
13834
- args: [{ selector: 'smart-filter-expression-editor', template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <smartform #simpleFilterFromChild [smartForm]=\"simpleFilterForm\"></smartform>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <smartform #form [smartForm]=\"smartForm\"></smartform>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"] }]
13835
- }], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { service: [{
13836
- type: Input
13837
- }], formChildren: [{
13838
- type: ViewChildren,
13839
- args: ['form']
13840
- }], simpleFilterFormChildren: [{
13841
- type: ViewChildren,
13842
- args: ['simpleFilterFromChild']
13843
- }] } });
13844
-
13845
- class SmartFilterEditorModule {
13437
+ class SmartFilterEditorModule {
13846
13438
  }
13847
13439
  SmartFilterEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13848
13440
  SmartFilterEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, declarations: [SmartFilterParamsComponent,
@@ -14077,6 +13669,351 @@ class SmartComponentLayoutUtility {
14077
13669
  * Public API Surface of smart-component-layout
14078
13670
  */
14079
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
+
14080
14017
  let SmartComponentApiClient = class SmartComponentApiClient {
14081
14018
  constructor(inject, auth, pageName) {
14082
14019
  this.inject = inject;