@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
@@ -13146,1084 +13146,1020 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
13146
13146
  }]
13147
13147
  }] });
13148
13148
 
13149
- /**
13150
- * Custom HttpParameterCodec
13151
- * Workaround for https://github.com/angular/angular/issues/18261
13152
- */
13153
- class CustomHttpParameterCodec {
13154
- encodeKey(k) {
13155
- return encodeURIComponent(k);
13149
+ class SmartFilterParamComponent {
13150
+ constructor() { }
13151
+ onItemClick(item) {
13152
+ this.data.serviceToUse.peformWidgetAction({
13153
+ code: 'ADD_FILTER_EXPRESSION',
13154
+ params: {
13155
+ model: item,
13156
+ },
13157
+ });
13156
13158
  }
13157
- encodeValue(v) {
13158
- return encodeURIComponent(v);
13159
+ }
13160
+ SmartFilterParamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13161
+ 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"] }] });
13162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
13163
+ type: Component,
13164
+ 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"] }]
13165
+ }], ctorParameters: function () { return []; }, propDecorators: { data: [{
13166
+ type: Input
13167
+ }] } });
13168
+
13169
+ class SmartFilterParamsComponent {
13170
+ constructor() {
13171
+ this._destroy$ = new Subject();
13172
+ this.expandableSections = [];
13159
13173
  }
13160
- decodeKey(k) {
13161
- return decodeURIComponent(k);
13174
+ ngOnInit() {
13175
+ this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
13176
+ this.setUp(this.service.model);
13177
+ });
13178
+ this.setUp(this.service.model);
13162
13179
  }
13163
- decodeValue(v) {
13164
- return decodeURIComponent(v);
13180
+ ngOnDestroy() {
13181
+ this._destroy$.next();
13182
+ this._destroy$.complete();
13165
13183
  }
13166
- }
13184
+ setUp(model) {
13185
+ this.filterBuilder = model.model;
13186
+ this.constructExpandableSections();
13187
+ }
13188
+ constructExpandableSections() {
13189
+ if (this.filterBuilder.groups) {
13190
+ this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
13191
+ return {
13192
+ title: filterExpressionBuilderGroup.label,
13193
+ cssClass: 'filterExpressionBuilderGroup',
13194
+ customComponent: SmartFilterParamComponent,
13195
+ data: {
13196
+ group: filterExpressionBuilderGroup.fields,
13197
+ serviceToUse: this.service,
13198
+ },
13199
+ inputName: 'data',
13200
+ isExpanded: true,
13201
+ };
13202
+ });
13203
+ }
13204
+ }
13205
+ }
13206
+ SmartFilterParamsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13207
+ 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"] }] });
13208
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
13209
+ type: Component,
13210
+ 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"] }]
13211
+ }], ctorParameters: function () { return []; }, propDecorators: { service: [{
13212
+ type: Input
13213
+ }], filterVcRef: [{
13214
+ type: ViewChild,
13215
+ args: ['smartFilter', { read: ViewContainerRef }]
13216
+ }] } });
13167
13217
 
13168
- const BASE_PATH = new InjectionToken('basePath');
13169
- const COLLECTION_FORMATS = {
13170
- 'csv': ',',
13171
- 'tsv': ' ',
13172
- 'ssv': ' ',
13173
- 'pipes': '|'
13174
- };
13218
+ var FilterExpressionBuilderUiModel;
13219
+ (function (FilterExpressionBuilderUiModel) {
13220
+ FilterExpressionBuilderUiModel.TypeEnum = {
13221
+ Simple: 'SIMPLE',
13222
+ Complex: 'COMPLEX'
13223
+ };
13224
+ })(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
13175
13225
 
13176
- class Configuration {
13177
- constructor(configurationParameters = {}) {
13178
- this.apiKeys = configurationParameters.apiKeys;
13179
- this.username = configurationParameters.username;
13180
- this.password = configurationParameters.password;
13181
- this.accessToken = configurationParameters.accessToken;
13182
- this.basePath = configurationParameters.basePath;
13183
- this.withCredentials = configurationParameters.withCredentials;
13184
- this.encoder = configurationParameters.encoder;
13185
- if (configurationParameters.encodeParam) {
13186
- this.encodeParam = configurationParameters.encodeParam;
13226
+ var FilterExpressionBuilderApiActions;
13227
+ (function (FilterExpressionBuilderApiActions) {
13228
+ FilterExpressionBuilderApiActions["OPEN_FILTER_GROUPS"] = "OPEN_FILTER_GROUPS";
13229
+ FilterExpressionBuilderApiActions["CLOSE_FILTER_GROUPS"] = "CLOSE_FILTER_GROUPS";
13230
+ FilterExpressionBuilderApiActions["ADD_BRACKET"] = "ADD_BRACKET";
13231
+ FilterExpressionBuilderApiActions["ADD_FILTER_EXPRESSION"] = "ADD_FILTER_EXPRESSION";
13232
+ FilterExpressionBuilderApiActions["REMOVE_FILTER_EXPRESSION"] = "REMOVE_FILTER_EXPRESSION";
13233
+ FilterExpressionBuilderApiActions["REDO"] = "REDO";
13234
+ FilterExpressionBuilderApiActions["FILTER_GROUPS"] = "AFILTER_GROUPS";
13235
+ FilterExpressionBuilderApiActions["SELECT_FIELD"] = "SELECT_FIELD";
13236
+ FilterExpressionBuilderApiActions["UPDATE_FILTER_EXPRESSION"] = "UPDATE_FILTER_EXPRESSION";
13237
+ FilterExpressionBuilderApiActions["SAVE_EXPRESSION_DATA"] = "SAVE_EXPRESSION_DATA";
13238
+ FilterExpressionBuilderApiActions["SAVE_EXPRESSION_FIELD_LIST"] = "SAVE_EXPRESSION_FIELD_LIST";
13239
+ })(FilterExpressionBuilderApiActions || (FilterExpressionBuilderApiActions = {}));
13240
+
13241
+ class SmartFilterExpressionItemComponent {
13242
+ constructor() {
13243
+ this.isSelected = false;
13244
+ }
13245
+ ngOnInit() {
13246
+ var _a;
13247
+ this.isSelected =
13248
+ JSON.stringify((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField) === JSON.stringify(this.item);
13249
+ }
13250
+ setOperatorTo(event, operationType) {
13251
+ var _a;
13252
+ event === null || event === void 0 ? void 0 : event.stopPropagation();
13253
+ if (!((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.readOnly)) {
13254
+ this.item.expressionData.boolOperator = operationType;
13255
+ this.service.peformWidgetAction({
13256
+ code: 'UPDATE_FILTER_EXPRESSION',
13257
+ params: {
13258
+ model: this.item,
13259
+ },
13260
+ });
13187
13261
  }
13188
- else {
13189
- this.encodeParam = param => this.defaultEncodeParam(param);
13262
+ }
13263
+ select(event, item) {
13264
+ var _a;
13265
+ event === null || event === void 0 ? void 0 : event.stopPropagation();
13266
+ if (!((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.readOnly)) {
13267
+ if (!this.isSelected) {
13268
+ this.service.peformWidgetAction({
13269
+ code: 'SELECT_FIELD',
13270
+ params: {
13271
+ model: this.item,
13272
+ },
13273
+ });
13274
+ }
13275
+ else {
13276
+ this.service.peformWidgetAction({
13277
+ code: 'SELECT_FIELD',
13278
+ params: {
13279
+ model: this.item,
13280
+ },
13281
+ });
13282
+ }
13190
13283
  }
13191
- if (configurationParameters.credentials) {
13192
- this.credentials = configurationParameters.credentials;
13284
+ }
13285
+ }
13286
+ SmartFilterExpressionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13287
+ 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"] }] });
13288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, decorators: [{
13289
+ type: Component,
13290
+ 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"] }]
13291
+ }], ctorParameters: function () { return []; }, propDecorators: { item: [{
13292
+ type: Input
13293
+ }], hasNext: [{
13294
+ type: Input
13295
+ }], service: [{
13296
+ type: Input
13297
+ }] } });
13298
+
13299
+ class SmartFilterExpressionItemsComponent {
13300
+ constructor() {
13301
+ this._destroy$ = new Subject();
13302
+ this.isSelected = false;
13303
+ }
13304
+ ngOnInit() {
13305
+ var _a;
13306
+ this.service.modelChanged.subscribe(() => {
13307
+ var _a;
13308
+ console.log(this.service.model);
13309
+ this.isSelected = ((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField) === null;
13310
+ });
13311
+ this.isSelected = ((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField) === null;
13312
+ }
13313
+ ngOnDestroy() {
13314
+ this._destroy$.next();
13315
+ this._destroy$.complete();
13316
+ }
13317
+ select() {
13318
+ // this.service.selectFilterExpressionField(undefined);
13319
+ }
13320
+ drop(event) {
13321
+ moveItemInArray(this.items, event.previousIndex, event.currentIndex);
13322
+ }
13323
+ }
13324
+ SmartFilterExpressionItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13325
+ 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"] }] });
13326
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, decorators: [{
13327
+ type: Component,
13328
+ 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"] }]
13329
+ }], ctorParameters: function () { return []; }, propDecorators: { items: [{
13330
+ type: Input
13331
+ }], service: [{
13332
+ type: Input
13333
+ }] } });
13334
+
13335
+ class SmartFilterEditorContentComponent {
13336
+ constructor(layoutService) {
13337
+ this.layoutService = layoutService;
13338
+ this._destroy$ = new Subject();
13339
+ this.uiActionModels = [];
13340
+ this.expressionUiActionModels = [];
13341
+ this.type = FilterExpressionBuilderUiModel.TypeEnum;
13342
+ }
13343
+ ngAfterViewInit() {
13344
+ var _a, _b, _c, _d;
13345
+ if ((_a = this.simpleFilterFormChildren) === null || _a === void 0 ? void 0 : _a.first) {
13346
+ this.subsrcibeSimpleFormChildrenEvents();
13193
13347
  }
13194
13348
  else {
13195
- this.credentials = {};
13349
+ (_b = this.simpleFilterFormChildren) === null || _b === void 0 ? void 0 : _b.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
13350
+ this.subsrcibeSimpleFormChildrenEvents();
13351
+ });
13196
13352
  }
13197
- }
13198
- /**
13199
- * Select the correct content-type to use for a request.
13200
- * Uses {@link Configuration#isJsonMime} to determine the correct content-type.
13201
- * If no content type is found return the first found type if the contentTypes is not empty
13202
- * @param contentTypes - the array of content types that are available for selection
13203
- * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13204
- */
13205
- selectHeaderContentType(contentTypes) {
13206
- if (contentTypes.length === 0) {
13207
- return undefined;
13353
+ if ((_c = this.formChildren) === null || _c === void 0 ? void 0 : _c.first) {
13354
+ this.subscribeEditorFormChildrenEvents();
13208
13355
  }
13209
- const type = contentTypes.find((x) => this.isJsonMime(x));
13210
- if (type === undefined) {
13211
- return contentTypes[0];
13356
+ else {
13357
+ (_d = this.formChildren) === null || _d === void 0 ? void 0 : _d.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
13358
+ this.subscribeEditorFormChildrenEvents();
13359
+ });
13212
13360
  }
13213
- return type;
13214
13361
  }
13215
- /**
13216
- * Select the correct accept content-type to use for a request.
13217
- * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
13218
- * If no content type is found return the first found type if the contentTypes is not empty
13219
- * @param accepts - the array of content types that are available for selection.
13220
- * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13221
- */
13222
- selectHeaderAccept(accepts) {
13223
- if (accepts.length === 0) {
13224
- return undefined;
13225
- }
13226
- const type = accepts.find((x) => this.isJsonMime(x));
13227
- if (type === undefined) {
13228
- return accepts[0];
13229
- }
13230
- return type;
13362
+ subsrcibeSimpleFormChildrenEvents() {
13363
+ var _a, _b, _c, _d;
13364
+ (_b = (_a = this.simpleFilterFormChildren) === null || _a === void 0 ? void 0 : _a.first.onBlurSubject) === null || _b === void 0 ? void 0 : _b.pipe(takeUntil(this._destroy$)).subscribe(() => {
13365
+ this.saveFilter();
13366
+ });
13367
+ (_d = (_c = this.simpleFilterFormChildren) === null || _c === void 0 ? void 0 : _c.first.sophisticatedValueChange) === null || _d === void 0 ? void 0 : _d.pipe(takeUntil(this._destroy$)).subscribe((change) => {
13368
+ if (change.kind === 'selection') {
13369
+ this.saveFilter();
13370
+ }
13371
+ });
13231
13372
  }
13232
- /**
13233
- * Check if the given MIME is a JSON MIME.
13234
- * JSON MIME examples:
13235
- * application/json
13236
- * application/json; charset=UTF8
13237
- * APPLICATION/JSON
13238
- * application/vnd.company+json
13239
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
13240
- * @return True if the given MIME is JSON, false otherwise.
13241
- */
13242
- isJsonMime(mime) {
13243
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
13244
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
13373
+ subscribeEditorFormChildrenEvents() {
13374
+ var _a, _b, _c, _d;
13375
+ (_b = (_a = this.formChildren) === null || _a === void 0 ? void 0 : _a.first.onBlurSubject) === null || _b === void 0 ? void 0 : _b.pipe(takeUntil(this._destroy$)).subscribe(() => {
13376
+ this.save();
13377
+ });
13378
+ (_d = (_c = this.formChildren) === null || _c === void 0 ? void 0 : _c.first.sophisticatedValueChange) === null || _d === void 0 ? void 0 : _d.pipe(takeUntil(this._destroy$)).subscribe((change) => {
13379
+ if (change.key === 'expressionData.currentOperation') {
13380
+ this.save();
13381
+ }
13382
+ });
13245
13383
  }
13246
- lookupCredential(key) {
13247
- const value = this.credentials[key];
13248
- return typeof value === 'function'
13249
- ? value()
13250
- : value;
13384
+ // smartFilterChangeSubscription?: Subscription;
13385
+ // smartFilterSophisticatedChangeSubscription?: Subscription;
13386
+ // smartformChangeSubscription?: Subscription;
13387
+ // smartformSophisticatedChangeSubscription?: Subscription;
13388
+ ngOnInit() {
13389
+ this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
13390
+ this.service.load();
13251
13391
  }
13252
- defaultEncodeParam(param) {
13253
- // This implementation exists as fallback for missing configuration
13254
- // and for backwards compatibility to older typescript-angular generator versions.
13255
- // It only works for the 'simple' parameter style.
13256
- // Date-handling only works for the 'date-time' format.
13257
- // All other styles and Date-formats are probably handled incorrectly.
13258
- //
13259
- // But: if that's all you need (i.e.: the most common use-case): no need for customization!
13260
- const value = param.dataFormat === 'date-time' && param.value instanceof Date
13261
- ? param.value.toISOString()
13262
- : param.value;
13263
- return encodeURIComponent(String(value));
13392
+ ngOnDestroy() {
13393
+ this._destroy$.next();
13394
+ this._destroy$.complete();
13264
13395
  }
13265
- }
13266
-
13267
- /**
13268
- * Filter API 2
13269
- * Filter API 2
13270
- *
13271
- * The version of the OpenAPI document: 1.0.0
13272
- * Contact: info@it4all.hu
13273
- *
13274
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13275
- * https://openapi-generator.tech
13276
- * Do not edit the class manually.
13277
- */
13278
- class FilterService {
13279
- constructor(httpClient, basePath, configuration) {
13280
- this.httpClient = httpClient;
13281
- this.basePath = 'http://localhost';
13282
- this.defaultHeaders = new HttpHeaders();
13283
- this.configuration = new Configuration();
13284
- if (configuration) {
13285
- this.configuration = configuration;
13286
- }
13287
- if (typeof this.configuration.basePath !== 'string') {
13288
- if (Array.isArray(basePath) && basePath.length > 0) {
13289
- basePath = basePath[0];
13290
- }
13291
- if (typeof basePath !== 'string') {
13292
- basePath = this.basePath;
13396
+ setupSimpleFilter() {
13397
+ var _a, _b, _c;
13398
+ let widgets = [];
13399
+ let key;
13400
+ let model = {};
13401
+ (_c = (_b = (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.workplaceList) === null || _c === void 0 ? void 0 : _c.filters.forEach((filterExpressionField, index) => {
13402
+ var _a, _b, _c, _d, _e, _f, _g, _h;
13403
+ model[index] = filterExpressionField;
13404
+ if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
13405
+ key = index + '.expressionData.operand2.selectedValues';
13406
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_a = filterExpressionField.widgetType) !== null && _a !== void 0 ? _a : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13407
+ return;
13293
13408
  }
13294
- this.configuration.basePath = basePath;
13295
- }
13296
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
13297
- }
13298
- // @ts-ignore
13299
- addToHttpParams(httpParams, value, key) {
13300
- if (typeof value === "object" && value instanceof Date === false) {
13301
- httpParams = this.addToHttpParamsRecursive(httpParams, value);
13302
- }
13303
- else {
13304
- httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
13305
- }
13306
- return httpParams;
13307
- }
13308
- addToHttpParamsRecursive(httpParams, value, key) {
13309
- if (value == null) {
13310
- return httpParams;
13311
- }
13312
- if (typeof value === "object") {
13313
- if (Array.isArray(value)) {
13314
- value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
13409
+ if (((_b = filterExpressionField.expressionData) === null || _b === void 0 ? void 0 : _b.currentOperation) === 'BETWEEN') {
13410
+ key = index + '.expressionData.operand2.valueAsString';
13411
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_c = filterExpressionField.widgetType) !== null && _c !== void 0 ? _c : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13412
+ key = index + '.expressionData.operand3.valueAsString';
13413
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_d = filterExpressionField.widgetType) !== null && _d !== void 0 ? _d : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13414
+ return;
13315
13415
  }
13316
- else if (value instanceof Date) {
13317
- if (key != null) {
13318
- httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
13319
- }
13320
- else {
13321
- throw Error("key may not be null if value is Date");
13416
+ if ((_e = filterExpressionField.expressionData) === null || _e === void 0 ? void 0 : _e.operand2) {
13417
+ if (key !== index + '.expressionData.operand2.selectedValues') {
13418
+ key = index + '.expressionData.operand2.valueAsString';
13322
13419
  }
13420
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_f = filterExpressionField.widgetType) !== null && _f !== void 0 ? _f : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13421
+ return;
13323
13422
  }
13324
- else {
13325
- Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
13423
+ if ((_g = filterExpressionField === null || filterExpressionField === void 0 ? void 0 : filterExpressionField.expressionData) === null || _g === void 0 ? void 0 : _g.operand3) {
13424
+ if (key !== index + '.selectedValues') {
13425
+ key = index + '.expressionData.operand3.valueAsString';
13426
+ }
13427
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label3, (_h = filterExpressionField.widgetType) !== null && _h !== void 0 ? _h : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13428
+ return;
13326
13429
  }
13327
- }
13328
- else if (key != null) {
13329
- httpParams = httpParams.append(key, value);
13330
- }
13331
- else {
13332
- throw Error("key may not be null if value is not object or array");
13333
- }
13334
- return httpParams;
13430
+ });
13431
+ this.simpleFilterForm = {
13432
+ direction: SmartFormWidgetDirection.ROW,
13433
+ componentModel: { data: model },
13434
+ useOnValueChangeEvent: true,
13435
+ useOnBlurEvent: true,
13436
+ widgets,
13437
+ };
13335
13438
  }
13336
- load(uuid, filterIdentifier, observe = 'body', reportProgress = false, options) {
13337
- if (uuid === null || uuid === undefined) {
13338
- throw new Error('Required parameter uuid was null or undefined when calling load.');
13339
- }
13340
- if (filterIdentifier === null || filterIdentifier === undefined) {
13341
- throw new Error('Required parameter filterIdentifier was null or undefined when calling load.');
13342
- }
13343
- let localVarHeaders = this.defaultHeaders;
13344
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
13345
- if (localVarHttpHeaderAcceptSelected === undefined) {
13346
- // to determine the Accept header
13347
- const httpHeaderAccepts = [
13348
- 'application/json'
13349
- ];
13350
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
13351
- }
13352
- if (localVarHttpHeaderAcceptSelected !== undefined) {
13353
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
13354
- }
13355
- let localVarHttpContext = options && options.context;
13356
- if (localVarHttpContext === undefined) {
13357
- localVarHttpContext = new HttpContext();
13358
- }
13359
- let responseType_ = 'json';
13360
- if (localVarHttpHeaderAcceptSelected) {
13361
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
13362
- responseType_ = 'text';
13363
- }
13364
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
13365
- responseType_ = 'json';
13366
- }
13367
- else {
13368
- responseType_ = 'blob';
13369
- }
13370
- }
13371
- 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`;
13372
- return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
13373
- context: localVarHttpContext,
13374
- responseType: responseType_,
13375
- withCredentials: this.configuration.withCredentials,
13376
- headers: localVarHeaders,
13377
- observe: observe,
13378
- reportProgress: reportProgress
13439
+ extractFilterFieldFromFormModel() {
13440
+ var _a, _b;
13441
+ let simpleFilter = (_b = (_a = this.simpleFilterFormChildren) === null || _a === void 0 ? void 0 : _a.first) === null || _b === void 0 ? void 0 : _b.submitForm(false).componentModel.data;
13442
+ let result = [];
13443
+ Object.keys(simpleFilter).forEach((key) => {
13444
+ result.push(simpleFilter[key]);
13379
13445
  });
13446
+ this.service.model.model.workplaceList.filters = result;
13380
13447
  }
13381
- performWidgetAction(uuid, filterIdentifier, body, observe = 'body', reportProgress = false, options) {
13382
- if (uuid === null || uuid === undefined) {
13383
- throw new Error('Required parameter uuid was null or undefined when calling performWidgetAction.');
13384
- }
13385
- if (filterIdentifier === null || filterIdentifier === undefined) {
13386
- throw new Error('Required parameter filterIdentifier was null or undefined when calling performWidgetAction.');
13387
- }
13388
- if (body === null || body === undefined) {
13389
- throw new Error('Required parameter body was null or undefined when calling performWidgetAction.');
13390
- }
13391
- let localVarHeaders = this.defaultHeaders;
13392
- let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
13393
- if (localVarHttpHeaderAcceptSelected === undefined) {
13394
- // to determine the Accept header
13395
- const httpHeaderAccepts = [
13396
- 'application/json'
13397
- ];
13398
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
13399
- }
13400
- if (localVarHttpHeaderAcceptSelected !== undefined) {
13401
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
13402
- }
13403
- let localVarHttpContext = options && options.context;
13404
- if (localVarHttpContext === undefined) {
13405
- localVarHttpContext = new HttpContext();
13406
- }
13407
- // to determine the Content-Type header
13408
- const consumes = [
13409
- 'application/json'
13410
- ];
13411
- const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
13412
- if (httpContentTypeSelected !== undefined) {
13413
- localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
13448
+ setUp() {
13449
+ var _a;
13450
+ if (((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.type) === this.type.Simple) {
13451
+ this.setupSimpleFilter();
13414
13452
  }
13415
- let responseType_ = 'json';
13416
- if (localVarHttpHeaderAcceptSelected) {
13417
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
13418
- responseType_ = 'text';
13419
- }
13420
- else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
13421
- responseType_ = 'json';
13453
+ else {
13454
+ this.constructUiActionModels();
13455
+ if (this.service.model.selectedFieldEditor) {
13456
+ this.constructForm();
13422
13457
  }
13423
13458
  else {
13424
- responseType_ = 'blob';
13459
+ this.smartForm = undefined;
13425
13460
  }
13426
13461
  }
13427
- 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`;
13428
- return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
13429
- context: localVarHttpContext,
13430
- body: body,
13431
- responseType: responseType_,
13432
- withCredentials: this.configuration.withCredentials,
13433
- headers: localVarHeaders,
13434
- observe: observe,
13435
- reportProgress: reportProgress
13436
- });
13437
13462
  }
13438
- }
13439
- 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 });
13440
- FilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, providedIn: 'root' });
13441
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, decorators: [{
13442
- type: Injectable,
13443
- args: [{
13444
- providedIn: 'root'
13445
- }]
13446
- }], ctorParameters: function () {
13447
- return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
13448
- type: Optional
13449
- }, {
13450
- type: Inject,
13451
- args: [BASE_PATH]
13452
- }] }, { type: Configuration, decorators: [{
13453
- type: Optional
13454
- }] }];
13455
- } });
13456
-
13457
- class SmartFilterEditorService {
13458
- constructor(service) {
13459
- this.service = service;
13460
- this.modelChanged = new Subject();
13461
- this.submit = new Subject();
13462
- this.reSubscribeToChange = new Subject();
13463
- }
13464
- load() {
13465
- return __awaiter(this, void 0, void 0, function* () {
13466
- this.model = yield this.service.load(this.config.uuid, this.config.identifier).toPromise();
13467
- this.modelChanged.next();
13468
- });
13469
- }
13470
- peformWidgetAction(request) {
13471
- return __awaiter(this, void 0, void 0, function* () {
13472
- this.model = yield this.service
13473
- .performWidgetAction(this.config.uuid, this.config.identifier, request)
13474
- .toPromise();
13475
- this.modelChanged.next();
13476
- });
13477
- }
13478
- getModel() {
13479
- return this.model;
13463
+ constructUiActionModels() {
13464
+ var _a, _b, _c, _d;
13465
+ if ((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.possibleActions) {
13466
+ this.uiActionModels = this.service.model.possibleActions.map((action) => {
13467
+ return {
13468
+ serviceToUse: this.service,
13469
+ uiAction: action,
13470
+ };
13471
+ });
13472
+ }
13473
+ if ((_c = (_b = this.service.model) === null || _b === void 0 ? void 0 : _b.selectedFieldEditor) === null || _c === void 0 ? void 0 : _c.possibleActions) {
13474
+ this.expressionUiActionModels = (_d = this.service.model) === null || _d === void 0 ? void 0 : _d.selectedFieldEditor.possibleActions.map((uiAction) => {
13475
+ var _a;
13476
+ let copiedUiAction = {};
13477
+ Object.keys(uiAction).map((key) => {
13478
+ copiedUiAction[key] = uiAction[key];
13479
+ });
13480
+ copiedUiAction.params = {
13481
+ field: (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField,
13482
+ };
13483
+ return {
13484
+ serviceToUse: this.service,
13485
+ uiAction: copiedUiAction,
13486
+ };
13487
+ });
13488
+ }
13480
13489
  }
13481
- performUiActionRequest(uiActionRequest, widgetId, nodeId) {
13482
- return __awaiter(this, void 0, void 0, function* () {
13483
- yield this.peformWidgetAction(uiActionRequest);
13490
+ constructForm() {
13491
+ var _a, _b, _c, _d;
13492
+ let generatedWidgets = this.layoutService.render({
13493
+ layoutDefinitions: (_c = (_b = (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedFieldEditor) === null || _b === void 0 ? void 0 : _b.layoutDef) === null || _c === void 0 ? void 0 : _c.widgets,
13484
13494
  });
13495
+ this.smartForm = {
13496
+ direction: SmartFormWidgetDirection.ROW,
13497
+ useOnBlurEvent: true,
13498
+ useOnValueChangeEvent: true,
13499
+ componentModel: { data: (_d = this.service.model) === null || _d === void 0 ? void 0 : _d.selectedField },
13500
+ widgets: generatedWidgets,
13501
+ };
13485
13502
  }
13486
- handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
13487
- return __awaiter(this, void 0, void 0, function* () {
13488
- return {
13489
- shouldPerformAction: true,
13490
- uiActionRequest: uiActionRequest,
13491
- };
13503
+ save() {
13504
+ var _a, _b, _c;
13505
+ (_b = (_a = this.formChildren) === null || _a === void 0 ? void 0 : _a.first) === null || _b === void 0 ? void 0 : _b.submitForm(false);
13506
+ this.service.peformWidgetAction({
13507
+ code: 'UPDATE_FILTER_EXPRESSION',
13508
+ params: {
13509
+ model: (_c = this.service.model) === null || _c === void 0 ? void 0 : _c.selectedField,
13510
+ },
13492
13511
  });
13493
13512
  }
13494
- getAdditionalParams(uiAction) {
13495
- throw new Error('Method not implemented.');
13496
- }
13497
- }
13498
- SmartFilterEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, deps: [{ token: FilterService }], target: i0.ɵɵFactoryTarget.Injectable });
13499
- SmartFilterEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService });
13500
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, decorators: [{
13501
- type: Injectable
13502
- }], ctorParameters: function () { return [{ type: FilterService }]; } });
13503
-
13504
- class SmartFilterParamComponent {
13505
- constructor(service) {
13506
- this.service = service;
13507
- }
13508
- ngOnInit() { }
13509
- onItemClick(item) {
13510
- this.data.serviceToUse.peformWidgetAction({
13511
- code: 'ADD_FILTER_EXPRESSION',
13513
+ remove() {
13514
+ var _a;
13515
+ this.service.peformWidgetAction({
13516
+ code: 'REMOVE_FILTER_EXPRESSION',
13512
13517
  params: {
13513
- model: item,
13518
+ model: (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField,
13514
13519
  },
13515
13520
  });
13516
13521
  }
13517
- }
13518
- SmartFilterParamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
13519
- 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"] }] });
13520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamComponent, decorators: [{
13521
- type: Component,
13522
- 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"] }]
13523
- }], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { data: [{
13524
- type: Input
13525
- }] } });
13526
-
13527
- class SmartFilterParamsComponent {
13528
- // filterComponentRef?: ComponentRef<SmartFilterComponent>;
13529
- // filter?: SmartFilter;
13530
- constructor() {
13531
- this._destroy$ = new Subject();
13532
- this.expandableSections = [];
13533
- }
13534
- ngOnInit() {
13535
- this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
13536
- this.setUp(this.service.model);
13522
+ saveFilter() {
13523
+ return __awaiter(this, void 0, void 0, function* () {
13524
+ this.extractFilterFieldFromFormModel();
13525
+ this.service.performUiActionRequest({
13526
+ code: FilterExpressionBuilderApiActions.SAVE_EXPRESSION_FIELD_LIST,
13527
+ params: {
13528
+ model: this.service.model,
13529
+ },
13530
+ });
13537
13531
  });
13538
- this.setUp(this.service.model);
13539
- }
13540
- ngOnDestroy() {
13541
- this._destroy$.next();
13542
- this._destroy$.complete();
13543
- }
13544
- setUp(model) {
13545
- this.filterBuilder = model.model;
13546
- // this.constructFilter();
13547
- this.constructExpandableSections();
13548
13532
  }
13549
- constructExpandableSections() {
13550
- if (this.filterBuilder.groups) {
13551
- this.expandableSections = this.filterBuilder.groups.map((filterExpressionBuilderGroup) => {
13533
+ constructFormWidget(key, label, widgetType, possibleValues) {
13534
+ let type = widgetType;
13535
+ if (type === FilterExpressionFieldWidgetType.Date) {
13536
+ type = SmartFormWidgetType.DATE_PICKER;
13537
+ }
13538
+ else if (type === FilterExpressionFieldWidgetType.DateTime) {
13539
+ type = SmartFormWidgetType.DATE_TIME_PICKER;
13540
+ }
13541
+ let widget = {
13542
+ key,
13543
+ label,
13544
+ type,
13545
+ value: '',
13546
+ showLabel: true,
13547
+ valueList: possibleValues.map((value) => {
13552
13548
  return {
13553
- title: filterExpressionBuilderGroup.label,
13554
- cssClass: 'filterExpressionBuilderGroup',
13555
- customComponent: SmartFilterParamComponent,
13556
- data: {
13557
- group: filterExpressionBuilderGroup.fields,
13558
- serviceToUse: this.service,
13559
- },
13560
- inputName: 'data',
13561
- isExpanded: true,
13549
+ key: value.objectUri ? value.objectUri : value.code,
13550
+ label: value.displayValue,
13551
+ type: SmartFormWidgetType.ITEM,
13552
+ value: value.objectUri ? value.objectUri : value.code,
13562
13553
  };
13563
- });
13564
- }
13565
- // if (this.service.model?.externalFilterGroup) {
13566
- // this.expandableSectionsFromExcel = {
13567
- // title: this.service.model.externalFilterGroup.label!,
13568
- // cssClass: 'filterExpressionBuilderGroup',
13569
- // customComponent: SmartFilterParamComponent,
13570
- // data: {
13571
- // group: this.service.model.externalFilterGroup.fields,
13572
- // },
13573
- // inputName: 'data',
13574
- // isExpanded: true,
13575
- // };
13576
- // }
13577
- }
13578
- // constructFilter(): void {
13579
- // if (this.filter && this.filterComponentRef) {
13580
- // return;
13581
- // }
13582
- // // this.filter = {
13583
- // // data: this.service.model?.groupFilter?.filters! as FilterExpressionField[],
13584
- // // type: SmartFilterType.Simple,
13585
- // // showPossibleActions: false,
13586
- // // };
13587
- // this.filterVcRef?.clear();
13588
- // this.filterComponentRef = this.cfService.createComponent(
13589
- // this.filterVcRef!,
13590
- // SmartFilterComponent,
13591
- // new Map<string, any>([['filter', this.filter]])
13592
- // );
13593
- // this.filterComponentRef.instance?.service.change
13594
- // .pipe(takeUntil(this._destroy$))
13595
- // .subscribe(() => {
13596
- // let uiAction: UiAction = this.service.model?.filterGroupsAction!;
13597
- // uiAction.params = {
13598
- // filter: {
13599
- // filters: this.filterComponentRef?.instance.service.filter?.data,
13600
- // },
13601
- // };
13602
- // // let uiActionModel: UiActionModel = {
13603
- // // serviceToUse: this.service,
13604
- // // uiAction,
13605
- // // };
13606
- // // this.uiActionService.uiActionModel = uiActionModel;
13607
- // // this.uiActionService.execute(uiAction);
13608
- // });
13609
- // }
13610
- addDataSource() {
13611
- // this.service.addDataSource();
13554
+ }),
13555
+ };
13556
+ return widget;
13612
13557
  }
13613
13558
  }
13614
- SmartFilterParamsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13615
- 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"] }] });
13616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterParamsComponent, decorators: [{
13559
+ SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
13560
+ 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"] }] });
13561
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, decorators: [{
13617
13562
  type: Component,
13618
- 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"] }]
13619
- }], ctorParameters: function () { return []; }, propDecorators: { service: [{
13563
+ 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"] }]
13564
+ }], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { service: [{
13620
13565
  type: Input
13621
- }], filterVcRef: [{
13622
- type: ViewChild,
13623
- args: ['smartFilter', { read: ViewContainerRef }]
13566
+ }], formChildren: [{
13567
+ type: ViewChildren,
13568
+ args: ['form']
13569
+ }], simpleFilterFormChildren: [{
13570
+ type: ViewChildren,
13571
+ args: ['simpleFilterFromChild']
13624
13572
  }] } });
13625
13573
 
13626
- var FilterExpressionBuilderUiModel;
13627
- (function (FilterExpressionBuilderUiModel) {
13628
- FilterExpressionBuilderUiModel.TypeEnum = {
13629
- Simple: 'SIMPLE',
13630
- Complex: 'COMPLEX'
13631
- };
13632
- })(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
13633
-
13634
- var FilterExpressionBuilderApiActions;
13635
- (function (FilterExpressionBuilderApiActions) {
13636
- FilterExpressionBuilderApiActions["OPEN_FILTER_GROUPS"] = "OPEN_FILTER_GROUPS";
13637
- FilterExpressionBuilderApiActions["CLOSE_FILTER_GROUPS"] = "CLOSE_FILTER_GROUPS";
13638
- FilterExpressionBuilderApiActions["ADD_BRACKET"] = "ADD_BRACKET";
13639
- FilterExpressionBuilderApiActions["ADD_FILTER_EXPRESSION"] = "ADD_FILTER_EXPRESSION";
13640
- FilterExpressionBuilderApiActions["REMOVE_FILTER_EXPRESSION"] = "REMOVE_FILTER_EXPRESSION";
13641
- FilterExpressionBuilderApiActions["REDO"] = "REDO";
13642
- FilterExpressionBuilderApiActions["FILTER_GROUPS"] = "AFILTER_GROUPS";
13643
- FilterExpressionBuilderApiActions["SELECT_FIELD"] = "SELECT_FIELD";
13644
- FilterExpressionBuilderApiActions["UPDATE_FILTER_EXPRESSION"] = "UPDATE_FILTER_EXPRESSION";
13645
- FilterExpressionBuilderApiActions["SAVE_EXPRESSION_DATA"] = "SAVE_EXPRESSION_DATA";
13646
- FilterExpressionBuilderApiActions["SAVE_EXPRESSION_FIELD_LIST"] = "SAVE_EXPRESSION_FIELD_LIST";
13647
- })(FilterExpressionBuilderApiActions || (FilterExpressionBuilderApiActions = {}));
13648
-
13649
- class SmartFilterExpressionItemComponent {
13650
- constructor(service) {
13651
- this.service = service;
13652
- this.isSelected = false;
13653
- }
13654
- ngOnInit() {
13655
- var _a;
13656
- this.isSelected =
13657
- JSON.stringify((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField) === JSON.stringify(this.item);
13658
- }
13659
- setOperatorTo(event, operationType) {
13660
- var _a;
13661
- event === null || event === void 0 ? void 0 : event.stopPropagation();
13662
- if (!((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.readOnly)) {
13663
- this.item.expressionData.boolOperator = operationType;
13664
- this.service.peformWidgetAction({
13665
- code: 'UPDATE_FILTER_EXPRESSION',
13666
- params: {
13667
- model: this.item,
13668
- },
13669
- });
13670
- }
13671
- }
13672
- select(event, item) {
13673
- var _a;
13674
- event === null || event === void 0 ? void 0 : event.stopPropagation();
13675
- if (!((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.readOnly)) {
13676
- if (!this.isSelected) {
13677
- this.service.peformWidgetAction({
13678
- code: 'SELECT_FIELD',
13679
- params: {
13680
- model: this.item,
13681
- },
13682
- });
13683
- }
13684
- else {
13685
- this.service.peformWidgetAction({
13686
- code: 'SELECT_FIELD',
13687
- params: {
13688
- model: this.item,
13689
- },
13690
- });
13691
- }
13692
- }
13693
- }
13574
+ class SmartFilterEditorModule {
13694
13575
  }
13695
- SmartFilterExpressionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
13696
- 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"] }] });
13697
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, decorators: [{
13698
- type: Component,
13699
- 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"] }]
13700
- }], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { item: [{
13701
- type: Input
13702
- }], hasNext: [{
13703
- type: Input
13704
- }] } });
13576
+ SmartFilterEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13577
+ SmartFilterEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, declarations: [SmartFilterParamsComponent,
13578
+ SmartFilterParamComponent,
13579
+ SmartFilterEditorContentComponent,
13580
+ SmartFilterExpressionItemsComponent,
13581
+ SmartFilterExpressionItemComponent], imports: [CommonModule,
13582
+ SmartIconModule,
13583
+ SmartExpandableSectionModule,
13584
+ SmartViewContextModule,
13585
+ SmartformModule,
13586
+ MatButtonModule,
13587
+ SmartFilterModule,
13588
+ SmartformModule], exports: [SmartFilterParamsComponent,
13589
+ SmartFilterParamComponent,
13590
+ SmartFilterEditorContentComponent,
13591
+ SmartFilterExpressionItemsComponent,
13592
+ SmartFilterExpressionItemComponent] });
13593
+ SmartFilterEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, providers: [], imports: [[
13594
+ CommonModule,
13595
+ SmartIconModule,
13596
+ SmartExpandableSectionModule,
13597
+ SmartViewContextModule,
13598
+ SmartformModule,
13599
+ MatButtonModule,
13600
+ SmartFilterModule,
13601
+ SmartformModule,
13602
+ ]] });
13603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, decorators: [{
13604
+ type: NgModule,
13605
+ args: [{
13606
+ declarations: [
13607
+ SmartFilterParamsComponent,
13608
+ SmartFilterParamComponent,
13609
+ SmartFilterEditorContentComponent,
13610
+ SmartFilterExpressionItemsComponent,
13611
+ SmartFilterExpressionItemComponent,
13612
+ ],
13613
+ imports: [
13614
+ CommonModule,
13615
+ SmartIconModule,
13616
+ SmartExpandableSectionModule,
13617
+ SmartViewContextModule,
13618
+ SmartformModule,
13619
+ MatButtonModule,
13620
+ SmartFilterModule,
13621
+ SmartformModule,
13622
+ ],
13623
+ exports: [
13624
+ SmartFilterParamsComponent,
13625
+ SmartFilterParamComponent,
13626
+ SmartFilterEditorContentComponent,
13627
+ SmartFilterExpressionItemsComponent,
13628
+ SmartFilterExpressionItemComponent,
13629
+ ],
13630
+ providers: [],
13631
+ }]
13632
+ }] });
13705
13633
 
13706
- class SmartFilterExpressionItemsComponent {
13707
- constructor(service) {
13708
- var _a;
13709
- this.service = service;
13634
+ class SmartNgClientModule {
13635
+ }
13636
+ SmartNgClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13637
+ SmartNgClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, declarations: [SmartFileUploaderComponent], imports: [BrowserModule,
13638
+ MatCommonModule,
13639
+ ComponentFactoryServiceModule,
13640
+ SmartViewContextModule,
13641
+ SmartdialogModule,
13642
+ SmartFilterModule,
13643
+ SmartformModule,
13644
+ SmartGridModule,
13645
+ SmartIconModule,
13646
+ SmartNavbarModule,
13647
+ SmartSessionModule,
13648
+ SmartTabGroupModule,
13649
+ SmarttableModule,
13650
+ SmartExpandableSectionModule,
13651
+ SmartComponentLayoutModule,
13652
+ SmartFilterEditorModule], exports: [ComponentFactoryServiceModule,
13653
+ SmartComponentLayoutModule,
13654
+ SmartdialogModule,
13655
+ SmartExpandableSectionModule,
13656
+ SmartFilterModule,
13657
+ SmartformModule,
13658
+ SmartGridModule,
13659
+ SmartIconModule,
13660
+ SmartNavbarModule,
13661
+ SmartSessionModule,
13662
+ SmartTabGroupModule,
13663
+ SmarttableModule,
13664
+ SmartViewContextModule,
13665
+ SmartFileUploaderComponent,
13666
+ SmarttreeModule] });
13667
+ SmartNgClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, providers: [SmartNgClientService], imports: [[
13668
+ BrowserModule,
13669
+ MatCommonModule,
13670
+ ComponentFactoryServiceModule,
13671
+ SmartViewContextModule,
13672
+ SmartdialogModule,
13673
+ SmartFilterModule,
13674
+ SmartformModule,
13675
+ SmartGridModule,
13676
+ SmartIconModule,
13677
+ SmartNavbarModule,
13678
+ SmartSessionModule,
13679
+ SmartTabGroupModule,
13680
+ SmarttableModule,
13681
+ SmartExpandableSectionModule,
13682
+ SmartComponentLayoutModule,
13683
+ SmartFilterEditorModule,
13684
+ ], ComponentFactoryServiceModule,
13685
+ SmartComponentLayoutModule,
13686
+ SmartdialogModule,
13687
+ SmartExpandableSectionModule,
13688
+ SmartFilterModule,
13689
+ SmartformModule,
13690
+ SmartGridModule,
13691
+ SmartIconModule,
13692
+ SmartNavbarModule,
13693
+ SmartSessionModule,
13694
+ SmartTabGroupModule,
13695
+ SmarttableModule,
13696
+ SmartViewContextModule,
13697
+ SmarttreeModule] });
13698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, decorators: [{
13699
+ type: NgModule,
13700
+ args: [{
13701
+ declarations: [SmartFileUploaderComponent],
13702
+ imports: [
13703
+ BrowserModule,
13704
+ MatCommonModule,
13705
+ ComponentFactoryServiceModule,
13706
+ SmartViewContextModule,
13707
+ SmartdialogModule,
13708
+ SmartFilterModule,
13709
+ SmartformModule,
13710
+ SmartGridModule,
13711
+ SmartIconModule,
13712
+ SmartNavbarModule,
13713
+ SmartSessionModule,
13714
+ SmartTabGroupModule,
13715
+ SmarttableModule,
13716
+ SmartExpandableSectionModule,
13717
+ SmartComponentLayoutModule,
13718
+ SmartFilterEditorModule,
13719
+ ],
13720
+ exports: [
13721
+ ComponentFactoryServiceModule,
13722
+ SmartComponentLayoutModule,
13723
+ SmartdialogModule,
13724
+ SmartExpandableSectionModule,
13725
+ SmartFilterModule,
13726
+ SmartformModule,
13727
+ SmartGridModule,
13728
+ SmartIconModule,
13729
+ SmartNavbarModule,
13730
+ SmartSessionModule,
13731
+ SmartTabGroupModule,
13732
+ SmarttableModule,
13733
+ SmartViewContextModule,
13734
+ SmartFileUploaderComponent,
13735
+ SmarttreeModule,
13736
+ ],
13737
+ providers: [SmartNgClientService],
13738
+ }]
13739
+ }] });
13740
+
13741
+ class SmartAuthService {
13742
+ constructor() {
13743
+ this.bffApisHaveBeenSetUp = false;
13710
13744
  this._destroy$ = new Subject();
13711
- this.isSelected = false;
13712
- this.service.modelChanged.subscribe(() => {
13713
- var _a;
13714
- console.log(this.service.model);
13715
- this.isSelected = ((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField) === null;
13716
- });
13717
- this.isSelected = ((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField) === null;
13718
- }
13719
- ngOnChanges(changes) {
13720
- console.log(changes);
13745
+ this.headersUpdated = new SmartSubject(this._destroy$);
13721
13746
  }
13722
- ngOnInit() { }
13723
13747
  ngOnDestroy() {
13724
13748
  this._destroy$.next();
13725
13749
  this._destroy$.complete();
13726
13750
  }
13727
- select() {
13728
- // this.service.selectFilterExpressionField(undefined);
13729
- }
13730
- drop(event) {
13731
- moveItemInArray(this.items, event.previousIndex, event.currentIndex);
13732
- }
13733
13751
  }
13734
- SmartFilterExpressionItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
13735
- 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"] }] });
13736
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, decorators: [{
13737
- type: Component,
13738
- 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"] }]
13739
- }], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { items: [{
13740
- type: Input
13741
- }] } });
13752
+ SmartAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
13753
+ SmartAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService });
13754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, decorators: [{
13755
+ type: Injectable
13756
+ }] });
13742
13757
 
13743
- class SmartFilterEditorContentComponent {
13744
- constructor(layoutService) {
13745
- this.layoutService = layoutService;
13746
- this._destroy$ = new Subject();
13747
- this.uiActionModels = [];
13748
- this.expressionUiActionModels = [];
13749
- this.type = FilterExpressionBuilderUiModel.TypeEnum;
13758
+ /*
13759
+ * Public API Surface of smarttree
13760
+ */
13761
+
13762
+ class SmartComponentLayoutUtility {
13763
+ static setParent(layout, parent) {
13764
+ var _a;
13765
+ layout.parentComponent = parent;
13766
+ (_a = layout.components) === null || _a === void 0 ? void 0 : _a.forEach((l) => this.setParent(l, parent));
13750
13767
  }
13751
- ngAfterViewInit() {
13752
- var _a, _b, _c, _d;
13753
- if ((_a = this.simpleFilterFormChildren) === null || _a === void 0 ? void 0 : _a.first) {
13754
- (_b = this.simpleFilterFormChildren.first.onBlurSubject) === null || _b === void 0 ? void 0 : _b.pipe(takeUntil(this._destroy$)).subscribe(() => {
13755
- this.saveFilter();
13756
- });
13757
- (_c = this.simpleFilterFormChildren.first.sophisticatedValueChange) === null || _c === void 0 ? void 0 : _c.pipe(takeUntil(this._destroy$)).subscribe((change) => {
13758
- if (change.kind === 'selection') {
13759
- this.saveFilter();
13760
- }
13761
- });
13768
+ static getForms(comp) {
13769
+ let result = [];
13770
+ if (comp.components) {
13771
+ result = comp.components
13772
+ .map((c) => this.getForms(c))
13773
+ .reduce((acc, value) => acc.concat(value), []);
13762
13774
  }
13763
- else {
13764
- (_d = this.simpleFilterFormChildren) === null || _d === void 0 ? void 0 : _d.changes.subscribe(() => {
13765
- var _a, _b;
13766
- (_a = this.simpleFilterFormChildren.first.onBlurSubject) === null || _a === void 0 ? void 0 : _a.pipe(takeUntil(this._destroy$)).subscribe(() => {
13767
- this.saveFilter();
13768
- });
13769
- (_b = this.simpleFilterFormChildren.first.sophisticatedValueChange) === null || _b === void 0 ? void 0 : _b.pipe(takeUntil(this._destroy$)).subscribe((change) => {
13770
- if (change.kind === 'selection') {
13771
- this.saveFilter();
13772
- }
13773
- });
13774
- });
13775
+ if (comp.smartFormComponent) {
13776
+ result.push(comp.smartFormComponent);
13775
13777
  }
13778
+ return result;
13776
13779
  }
13777
- ngOnInit() {
13778
- this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
13779
- this.service.load();
13780
+ static getGrids(comp) {
13781
+ let result = [];
13782
+ if (comp.components) {
13783
+ result = comp.components
13784
+ .map((c) => this.getGrids(c))
13785
+ .reduce((acc, value) => acc.concat(value), []);
13786
+ }
13787
+ if (comp.smartGridComponent) {
13788
+ result.push(comp.smartGridComponent);
13789
+ }
13790
+ return result;
13780
13791
  }
13781
- ngOnDestroy() {
13782
- this._destroy$.next();
13783
- this._destroy$.complete();
13792
+ static getTrees(comp) {
13793
+ var _a;
13794
+ let result = [];
13795
+ if (comp.components) {
13796
+ result = (_a = comp.components) === null || _a === void 0 ? void 0 : _a.map((c) => this.getTrees(c)).reduce((acc, value) => acc.concat(value), []);
13797
+ }
13798
+ if (comp.treeService) {
13799
+ result.push(comp.treeService);
13800
+ }
13801
+ return result;
13784
13802
  }
13785
- setupSimpleFilter() {
13786
- var _a, _b, _c;
13787
- let widgets = [];
13788
- let key;
13789
- let model = {};
13790
- (_c = (_b = (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.workplaceList) === null || _c === void 0 ? void 0 : _c.filters.forEach((filterExpressionField, index) => {
13791
- var _a, _b, _c, _d, _e, _f, _g, _h;
13792
- model[index] = filterExpressionField;
13793
- if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
13794
- key = index + '.expressionData.operand2.selectedValues';
13795
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_a = filterExpressionField.widgetType) !== null && _a !== void 0 ? _a : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13796
- return;
13797
- }
13798
- if (((_b = filterExpressionField.expressionData) === null || _b === void 0 ? void 0 : _b.currentOperation) === 'BETWEEN') {
13799
- key = index + '.expressionData.operand2.valueAsString';
13800
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_c = filterExpressionField.widgetType) !== null && _c !== void 0 ? _c : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13801
- key = index + '.expressionData.operand3.valueAsString';
13802
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_d = filterExpressionField.widgetType) !== null && _d !== void 0 ? _d : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13803
- return;
13804
- }
13805
- if ((_e = filterExpressionField.expressionData) === null || _e === void 0 ? void 0 : _e.operand2) {
13806
- if (key !== index + '.expressionData.operand2.selectedValues') {
13807
- key = index + '.expressionData.operand2.valueAsString';
13808
- }
13809
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_f = filterExpressionField.widgetType) !== null && _f !== void 0 ? _f : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13810
- return;
13811
- }
13812
- if ((_g = filterExpressionField === null || filterExpressionField === void 0 ? void 0 : filterExpressionField.expressionData) === null || _g === void 0 ? void 0 : _g.operand3) {
13813
- if (key !== index + '.selectedValues') {
13814
- key = index + '.expressionData.operand3.valueAsString';
13815
- }
13816
- widgets.push(this.constructFormWidget(key, filterExpressionField.label3, (_h = filterExpressionField.widgetType) !== null && _h !== void 0 ? _h : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
13817
- return;
13818
- }
13819
- });
13820
- this.simpleFilterForm = {
13821
- direction: SmartFormWidgetDirection.ROW,
13822
- componentModel: { data: model },
13823
- useOnValueChangeEvent: true,
13824
- useOnBlurEvent: true,
13825
- widgets,
13826
- };
13803
+ }
13804
+
13805
+ /*
13806
+ * Public API Surface of smart-component-layout
13807
+ */
13808
+
13809
+ /**
13810
+ * Custom HttpParameterCodec
13811
+ * Workaround for https://github.com/angular/angular/issues/18261
13812
+ */
13813
+ class CustomHttpParameterCodec {
13814
+ encodeKey(k) {
13815
+ return encodeURIComponent(k);
13827
13816
  }
13828
- extractFilterFieldFromFormModel() {
13829
- var _a, _b;
13830
- let simpleFilter = (_b = (_a = this.simpleFilterFormChildren) === null || _a === void 0 ? void 0 : _a.first) === null || _b === void 0 ? void 0 : _b.submitForm(false).componentModel.data;
13831
- let result = [];
13832
- Object.keys(simpleFilter).forEach((key) => {
13833
- result.push(simpleFilter[key]);
13834
- });
13835
- this.service.model.model.workplaceList.filters = result;
13817
+ encodeValue(v) {
13818
+ return encodeURIComponent(v);
13836
13819
  }
13837
- setUp() {
13838
- var _a;
13839
- if (((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.type) === this.type.Simple) {
13840
- this.setupSimpleFilter();
13820
+ decodeKey(k) {
13821
+ return decodeURIComponent(k);
13822
+ }
13823
+ decodeValue(v) {
13824
+ return decodeURIComponent(v);
13825
+ }
13826
+ }
13827
+
13828
+ const BASE_PATH = new InjectionToken('basePath');
13829
+ const COLLECTION_FORMATS = {
13830
+ 'csv': ',',
13831
+ 'tsv': ' ',
13832
+ 'ssv': ' ',
13833
+ 'pipes': '|'
13834
+ };
13835
+
13836
+ class Configuration {
13837
+ constructor(configurationParameters = {}) {
13838
+ this.apiKeys = configurationParameters.apiKeys;
13839
+ this.username = configurationParameters.username;
13840
+ this.password = configurationParameters.password;
13841
+ this.accessToken = configurationParameters.accessToken;
13842
+ this.basePath = configurationParameters.basePath;
13843
+ this.withCredentials = configurationParameters.withCredentials;
13844
+ this.encoder = configurationParameters.encoder;
13845
+ if (configurationParameters.encodeParam) {
13846
+ this.encodeParam = configurationParameters.encodeParam;
13841
13847
  }
13842
13848
  else {
13843
- this.constructUiActionModels();
13844
- if (this.service.model.selectedFieldEditor) {
13845
- this.constructForm();
13846
- }
13847
- else {
13848
- this.smartForm = undefined;
13849
- }
13849
+ this.encodeParam = param => this.defaultEncodeParam(param);
13850
+ }
13851
+ if (configurationParameters.credentials) {
13852
+ this.credentials = configurationParameters.credentials;
13853
+ }
13854
+ else {
13855
+ this.credentials = {};
13850
13856
  }
13851
13857
  }
13852
- constructUiActionModels() {
13853
- var _a, _b, _c, _d;
13854
- if ((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.possibleActions) {
13855
- this.uiActionModels = this.service.model.possibleActions.map((action) => {
13856
- return {
13857
- serviceToUse: this.service,
13858
- uiAction: action,
13859
- };
13860
- });
13858
+ /**
13859
+ * Select the correct content-type to use for a request.
13860
+ * Uses {@link Configuration#isJsonMime} to determine the correct content-type.
13861
+ * If no content type is found return the first found type if the contentTypes is not empty
13862
+ * @param contentTypes - the array of content types that are available for selection
13863
+ * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13864
+ */
13865
+ selectHeaderContentType(contentTypes) {
13866
+ if (contentTypes.length === 0) {
13867
+ return undefined;
13861
13868
  }
13862
- if ((_c = (_b = this.service.model) === null || _b === void 0 ? void 0 : _b.selectedFieldEditor) === null || _c === void 0 ? void 0 : _c.possibleActions) {
13863
- this.expressionUiActionModels = (_d = this.service.model) === null || _d === void 0 ? void 0 : _d.selectedFieldEditor.possibleActions.map((uiAction) => {
13864
- var _a;
13865
- let copiedUiAction = {};
13866
- Object.keys(uiAction).map((key) => {
13867
- copiedUiAction[key] = uiAction[key];
13868
- });
13869
- copiedUiAction.params = {
13870
- field: (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField,
13871
- };
13872
- return {
13873
- serviceToUse: this.service,
13874
- uiAction: copiedUiAction,
13875
- };
13876
- });
13869
+ const type = contentTypes.find((x) => this.isJsonMime(x));
13870
+ if (type === undefined) {
13871
+ return contentTypes[0];
13877
13872
  }
13873
+ return type;
13878
13874
  }
13879
- constructForm() {
13880
- var _a, _b, _c, _d;
13881
- if (this.smartForm) {
13882
- return;
13875
+ /**
13876
+ * Select the correct accept content-type to use for a request.
13877
+ * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
13878
+ * If no content type is found return the first found type if the contentTypes is not empty
13879
+ * @param accepts - the array of content types that are available for selection.
13880
+ * @returns the selected content-type or <code>undefined</code> if no selection could be made.
13881
+ */
13882
+ selectHeaderAccept(accepts) {
13883
+ if (accepts.length === 0) {
13884
+ return undefined;
13883
13885
  }
13884
- let generatedWidgets = this.layoutService.render({
13885
- layoutDefinitions: (_c = (_b = (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedFieldEditor) === null || _b === void 0 ? void 0 : _b.layoutDef) === null || _c === void 0 ? void 0 : _c.widgets,
13886
- });
13887
- this.smartForm = {
13888
- direction: SmartFormWidgetDirection.ROW,
13889
- useOnBlurEvent: true,
13890
- useOnValueChangeEvent: true,
13891
- componentModel: { data: (_d = this.service.model) === null || _d === void 0 ? void 0 : _d.selectedField },
13892
- widgets: generatedWidgets,
13893
- };
13894
- if (this.smartformChangeSubscription) {
13895
- this.smartformChangeSubscription.unsubscribe();
13896
- }
13897
- // this.smartformChangeSubscription = this.formChild?.onBlurSubject
13898
- // ?.pipe(takeUntil(this._destroy$))
13899
- // .subscribe(() => {
13900
- // this.save();
13901
- // });
13902
- // if (this.smartformSophisticatedChangeSubscription) {
13903
- // this.smartformSophisticatedChangeSubscription.unsubscribe();
13904
- // }
13905
- // this.smartformSophisticatedChangeSubscription = this.formChild?.sophisticatedValueChange
13906
- // ?.pipe(takeUntil(this._destroy$))
13907
- // .subscribe((change: SophisticatedValueChange) => {
13908
- // if (change.key === 'expressionData.currentOperation') {
13909
- // this.save();
13910
- // }
13911
- // });
13886
+ const type = accepts.find((x) => this.isJsonMime(x));
13887
+ if (type === undefined) {
13888
+ return accepts[0];
13889
+ }
13890
+ return type;
13912
13891
  }
13913
- save() {
13914
- var _a, _b, _c;
13915
- (_b = (_a = this.formChildren) === null || _a === void 0 ? void 0 : _a.first) === null || _b === void 0 ? void 0 : _b.submitForm(false);
13916
- this.service.peformWidgetAction({
13917
- code: 'UPDATE_FILTER_EXPRESSION',
13918
- params: {
13919
- model: (_c = this.service.model) === null || _c === void 0 ? void 0 : _c.selectedField,
13920
- },
13921
- });
13892
+ /**
13893
+ * Check if the given MIME is a JSON MIME.
13894
+ * JSON MIME examples:
13895
+ * application/json
13896
+ * application/json; charset=UTF8
13897
+ * APPLICATION/JSON
13898
+ * application/vnd.company+json
13899
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
13900
+ * @return True if the given MIME is JSON, false otherwise.
13901
+ */
13902
+ isJsonMime(mime) {
13903
+ const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
13904
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
13922
13905
  }
13923
- remove() {
13924
- var _a;
13925
- this.service.peformWidgetAction({
13926
- code: 'REMOVE_FILTER_EXPRESSION',
13927
- params: {
13928
- model: (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField,
13929
- },
13930
- });
13906
+ lookupCredential(key) {
13907
+ const value = this.credentials[key];
13908
+ return typeof value === 'function'
13909
+ ? value()
13910
+ : value;
13931
13911
  }
13932
- getFilteredUiActionModels(filterPredicate) {
13933
- // return this.service.model!.possibleActions!.filter(filterPredicate).map((uiAction: UiAction) => {
13934
- // return {
13935
- // serviceToUse: this.service,
13936
- // uiAction,
13937
- // };
13938
- // });
13939
- return [];
13912
+ defaultEncodeParam(param) {
13913
+ // This implementation exists as fallback for missing configuration
13914
+ // and for backwards compatibility to older typescript-angular generator versions.
13915
+ // It only works for the 'simple' parameter style.
13916
+ // Date-handling only works for the 'date-time' format.
13917
+ // All other styles and Date-formats are probably handled incorrectly.
13918
+ //
13919
+ // But: if that's all you need (i.e.: the most common use-case): no need for customization!
13920
+ const value = param.dataFormat === 'date-time' && param.value instanceof Date
13921
+ ? param.value.toISOString()
13922
+ : param.value;
13923
+ return encodeURIComponent(String(value));
13940
13924
  }
13941
- saveFilter() {
13942
- return __awaiter(this, void 0, void 0, function* () {
13943
- this.extractFilterFieldFromFormModel();
13944
- this.service.performUiActionRequest({
13945
- code: FilterExpressionBuilderApiActions.SAVE_EXPRESSION_FIELD_LIST,
13946
- params: {
13947
- model: this.service.model,
13948
- },
13949
- });
13925
+ }
13926
+
13927
+ /**
13928
+ * Filter API 2
13929
+ * Filter API 2
13930
+ *
13931
+ * The version of the OpenAPI document: 1.0.0
13932
+ * Contact: info@it4all.hu
13933
+ *
13934
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
13935
+ * https://openapi-generator.tech
13936
+ * Do not edit the class manually.
13937
+ */
13938
+ class FilterService {
13939
+ constructor(httpClient, basePath, configuration) {
13940
+ this.httpClient = httpClient;
13941
+ this.basePath = 'http://localhost';
13942
+ this.defaultHeaders = new HttpHeaders();
13943
+ this.configuration = new Configuration();
13944
+ if (configuration) {
13945
+ this.configuration = configuration;
13946
+ }
13947
+ if (typeof this.configuration.basePath !== 'string') {
13948
+ if (Array.isArray(basePath) && basePath.length > 0) {
13949
+ basePath = basePath[0];
13950
+ }
13951
+ if (typeof basePath !== 'string') {
13952
+ basePath = this.basePath;
13953
+ }
13954
+ this.configuration.basePath = basePath;
13955
+ }
13956
+ this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
13957
+ }
13958
+ // @ts-ignore
13959
+ addToHttpParams(httpParams, value, key) {
13960
+ if (typeof value === "object" && value instanceof Date === false) {
13961
+ httpParams = this.addToHttpParamsRecursive(httpParams, value);
13962
+ }
13963
+ else {
13964
+ httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
13965
+ }
13966
+ return httpParams;
13967
+ }
13968
+ addToHttpParamsRecursive(httpParams, value, key) {
13969
+ if (value == null) {
13970
+ return httpParams;
13971
+ }
13972
+ if (typeof value === "object") {
13973
+ if (Array.isArray(value)) {
13974
+ value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
13975
+ }
13976
+ else if (value instanceof Date) {
13977
+ if (key != null) {
13978
+ httpParams = httpParams.append(key, value.toISOString().substr(0, 10));
13979
+ }
13980
+ else {
13981
+ throw Error("key may not be null if value is Date");
13982
+ }
13983
+ }
13984
+ else {
13985
+ Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k));
13986
+ }
13987
+ }
13988
+ else if (key != null) {
13989
+ httpParams = httpParams.append(key, value);
13990
+ }
13991
+ else {
13992
+ throw Error("key may not be null if value is not object or array");
13993
+ }
13994
+ return httpParams;
13995
+ }
13996
+ load(uuid, filterIdentifier, observe = 'body', reportProgress = false, options) {
13997
+ if (uuid === null || uuid === undefined) {
13998
+ throw new Error('Required parameter uuid was null or undefined when calling load.');
13999
+ }
14000
+ if (filterIdentifier === null || filterIdentifier === undefined) {
14001
+ throw new Error('Required parameter filterIdentifier was null or undefined when calling load.');
14002
+ }
14003
+ let localVarHeaders = this.defaultHeaders;
14004
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
14005
+ if (localVarHttpHeaderAcceptSelected === undefined) {
14006
+ // to determine the Accept header
14007
+ const httpHeaderAccepts = [
14008
+ 'application/json'
14009
+ ];
14010
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
14011
+ }
14012
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
14013
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
14014
+ }
14015
+ let localVarHttpContext = options && options.context;
14016
+ if (localVarHttpContext === undefined) {
14017
+ localVarHttpContext = new HttpContext();
14018
+ }
14019
+ let responseType_ = 'json';
14020
+ if (localVarHttpHeaderAcceptSelected) {
14021
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
14022
+ responseType_ = 'text';
14023
+ }
14024
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
14025
+ responseType_ = 'json';
14026
+ }
14027
+ else {
14028
+ responseType_ = 'blob';
14029
+ }
14030
+ }
14031
+ 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`;
14032
+ return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
14033
+ context: localVarHttpContext,
14034
+ responseType: responseType_,
14035
+ withCredentials: this.configuration.withCredentials,
14036
+ headers: localVarHeaders,
14037
+ observe: observe,
14038
+ reportProgress: reportProgress
13950
14039
  });
13951
14040
  }
13952
- constructFormWidget(key, label, widgetType, possibleValues) {
13953
- let type = widgetType;
13954
- if (type === FilterExpressionFieldWidgetType.Date) {
13955
- type = SmartFormWidgetType.DATE_PICKER;
14041
+ performWidgetAction(uuid, filterIdentifier, body, observe = 'body', reportProgress = false, options) {
14042
+ if (uuid === null || uuid === undefined) {
14043
+ throw new Error('Required parameter uuid was null or undefined when calling performWidgetAction.');
13956
14044
  }
13957
- else if (type === FilterExpressionFieldWidgetType.DateTime) {
13958
- type = SmartFormWidgetType.DATE_TIME_PICKER;
14045
+ if (filterIdentifier === null || filterIdentifier === undefined) {
14046
+ throw new Error('Required parameter filterIdentifier was null or undefined when calling performWidgetAction.');
13959
14047
  }
13960
- let widget = {
13961
- key,
13962
- label,
13963
- type,
13964
- value: '',
13965
- showLabel: true,
13966
- valueList: possibleValues.map((value) => {
13967
- return {
13968
- key: value.objectUri ? value.objectUri : value.code,
13969
- label: value.displayValue,
13970
- type: SmartFormWidgetType.ITEM,
13971
- value: value.objectUri ? value.objectUri : value.code,
13972
- };
13973
- }),
13974
- };
13975
- return widget;
14048
+ if (body === null || body === undefined) {
14049
+ throw new Error('Required parameter body was null or undefined when calling performWidgetAction.');
14050
+ }
14051
+ let localVarHeaders = this.defaultHeaders;
14052
+ let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
14053
+ if (localVarHttpHeaderAcceptSelected === undefined) {
14054
+ // to determine the Accept header
14055
+ const httpHeaderAccepts = [
14056
+ 'application/json'
14057
+ ];
14058
+ localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
14059
+ }
14060
+ if (localVarHttpHeaderAcceptSelected !== undefined) {
14061
+ localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
14062
+ }
14063
+ let localVarHttpContext = options && options.context;
14064
+ if (localVarHttpContext === undefined) {
14065
+ localVarHttpContext = new HttpContext();
14066
+ }
14067
+ // to determine the Content-Type header
14068
+ const consumes = [
14069
+ 'application/json'
14070
+ ];
14071
+ const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
14072
+ if (httpContentTypeSelected !== undefined) {
14073
+ localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
14074
+ }
14075
+ let responseType_ = 'json';
14076
+ if (localVarHttpHeaderAcceptSelected) {
14077
+ if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
14078
+ responseType_ = 'text';
14079
+ }
14080
+ else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
14081
+ responseType_ = 'json';
14082
+ }
14083
+ else {
14084
+ responseType_ = 'blob';
14085
+ }
14086
+ }
14087
+ 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`;
14088
+ return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
14089
+ context: localVarHttpContext,
14090
+ body: body,
14091
+ responseType: responseType_,
14092
+ withCredentials: this.configuration.withCredentials,
14093
+ headers: localVarHeaders,
14094
+ observe: observe,
14095
+ reportProgress: reportProgress
14096
+ });
13976
14097
  }
13977
14098
  }
13978
- SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }], target: i0.ɵɵFactoryTarget.Component });
13979
- 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"] }] });
13980
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, decorators: [{
13981
- type: Component,
13982
- 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"] }]
13983
- }], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }]; }, propDecorators: { service: [{
13984
- type: Input
13985
- }], formChildren: [{
13986
- type: ViewChildren,
13987
- args: ['form']
13988
- }], simpleFilterFormChildren: [{
13989
- type: ViewChildren,
13990
- args: ['simpleFilterFromChild']
13991
- }] } });
13992
-
13993
- class SmartFilterEditorModule {
13994
- }
13995
- SmartFilterEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
13996
- SmartFilterEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, declarations: [SmartFilterParamsComponent,
13997
- SmartFilterParamComponent,
13998
- SmartFilterEditorContentComponent,
13999
- SmartFilterExpressionItemsComponent,
14000
- SmartFilterExpressionItemComponent], imports: [CommonModule,
14001
- SmartIconModule,
14002
- SmartExpandableSectionModule,
14003
- SmartViewContextModule,
14004
- SmartformModule,
14005
- MatButtonModule,
14006
- SmartFilterModule,
14007
- SmartformModule], exports: [SmartFilterParamsComponent,
14008
- SmartFilterParamComponent,
14009
- SmartFilterEditorContentComponent,
14010
- SmartFilterExpressionItemsComponent,
14011
- SmartFilterExpressionItemComponent] });
14012
- SmartFilterEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, providers: [], imports: [[
14013
- CommonModule,
14014
- SmartIconModule,
14015
- SmartExpandableSectionModule,
14016
- SmartViewContextModule,
14017
- SmartformModule,
14018
- MatButtonModule,
14019
- SmartFilterModule,
14020
- SmartformModule,
14021
- ]] });
14022
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorModule, decorators: [{
14023
- type: NgModule,
14024
- args: [{
14025
- declarations: [
14026
- SmartFilterParamsComponent,
14027
- SmartFilterParamComponent,
14028
- SmartFilterEditorContentComponent,
14029
- SmartFilterExpressionItemsComponent,
14030
- SmartFilterExpressionItemComponent,
14031
- ],
14032
- imports: [
14033
- CommonModule,
14034
- SmartIconModule,
14035
- SmartExpandableSectionModule,
14036
- SmartViewContextModule,
14037
- SmartformModule,
14038
- MatButtonModule,
14039
- SmartFilterModule,
14040
- SmartformModule,
14041
- ],
14042
- exports: [
14043
- SmartFilterParamsComponent,
14044
- SmartFilterParamComponent,
14045
- SmartFilterEditorContentComponent,
14046
- SmartFilterExpressionItemsComponent,
14047
- SmartFilterExpressionItemComponent,
14048
- ],
14049
- providers: [],
14050
- }]
14051
- }] });
14052
-
14053
- class SmartNgClientModule {
14054
- }
14055
- SmartNgClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
14056
- SmartNgClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, declarations: [SmartFileUploaderComponent], imports: [BrowserModule,
14057
- MatCommonModule,
14058
- ComponentFactoryServiceModule,
14059
- SmartViewContextModule,
14060
- SmartdialogModule,
14061
- SmartFilterModule,
14062
- SmartformModule,
14063
- SmartGridModule,
14064
- SmartIconModule,
14065
- SmartNavbarModule,
14066
- SmartSessionModule,
14067
- SmartTabGroupModule,
14068
- SmarttableModule,
14069
- SmartExpandableSectionModule,
14070
- SmartComponentLayoutModule,
14071
- SmartFilterEditorModule], exports: [ComponentFactoryServiceModule,
14072
- SmartComponentLayoutModule,
14073
- SmartdialogModule,
14074
- SmartExpandableSectionModule,
14075
- SmartFilterModule,
14076
- SmartformModule,
14077
- SmartGridModule,
14078
- SmartIconModule,
14079
- SmartNavbarModule,
14080
- SmartSessionModule,
14081
- SmartTabGroupModule,
14082
- SmarttableModule,
14083
- SmartViewContextModule,
14084
- SmartFileUploaderComponent,
14085
- SmarttreeModule] });
14086
- SmartNgClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, providers: [SmartNgClientService], imports: [[
14087
- BrowserModule,
14088
- MatCommonModule,
14089
- ComponentFactoryServiceModule,
14090
- SmartViewContextModule,
14091
- SmartdialogModule,
14092
- SmartFilterModule,
14093
- SmartformModule,
14094
- SmartGridModule,
14095
- SmartIconModule,
14096
- SmartNavbarModule,
14097
- SmartSessionModule,
14098
- SmartTabGroupModule,
14099
- SmarttableModule,
14100
- SmartExpandableSectionModule,
14101
- SmartComponentLayoutModule,
14102
- SmartFilterEditorModule,
14103
- ], ComponentFactoryServiceModule,
14104
- SmartComponentLayoutModule,
14105
- SmartdialogModule,
14106
- SmartExpandableSectionModule,
14107
- SmartFilterModule,
14108
- SmartformModule,
14109
- SmartGridModule,
14110
- SmartIconModule,
14111
- SmartNavbarModule,
14112
- SmartSessionModule,
14113
- SmartTabGroupModule,
14114
- SmarttableModule,
14115
- SmartViewContextModule,
14116
- SmarttreeModule] });
14117
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartNgClientModule, decorators: [{
14118
- type: NgModule,
14099
+ 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 });
14100
+ FilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, providedIn: 'root' });
14101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, decorators: [{
14102
+ type: Injectable,
14119
14103
  args: [{
14120
- declarations: [SmartFileUploaderComponent],
14121
- imports: [
14122
- BrowserModule,
14123
- MatCommonModule,
14124
- ComponentFactoryServiceModule,
14125
- SmartViewContextModule,
14126
- SmartdialogModule,
14127
- SmartFilterModule,
14128
- SmartformModule,
14129
- SmartGridModule,
14130
- SmartIconModule,
14131
- SmartNavbarModule,
14132
- SmartSessionModule,
14133
- SmartTabGroupModule,
14134
- SmarttableModule,
14135
- SmartExpandableSectionModule,
14136
- SmartComponentLayoutModule,
14137
- SmartFilterEditorModule,
14138
- ],
14139
- exports: [
14140
- ComponentFactoryServiceModule,
14141
- SmartComponentLayoutModule,
14142
- SmartdialogModule,
14143
- SmartExpandableSectionModule,
14144
- SmartFilterModule,
14145
- SmartformModule,
14146
- SmartGridModule,
14147
- SmartIconModule,
14148
- SmartNavbarModule,
14149
- SmartSessionModule,
14150
- SmartTabGroupModule,
14151
- SmarttableModule,
14152
- SmartViewContextModule,
14153
- SmartFileUploaderComponent,
14154
- SmarttreeModule,
14155
- ],
14156
- providers: [SmartNgClientService],
14104
+ providedIn: 'root'
14157
14105
  }]
14158
- }] });
14106
+ }], ctorParameters: function () {
14107
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
14108
+ type: Optional
14109
+ }, {
14110
+ type: Inject,
14111
+ args: [BASE_PATH]
14112
+ }] }, { type: Configuration, decorators: [{
14113
+ type: Optional
14114
+ }] }];
14115
+ } });
14159
14116
 
14160
- class SmartAuthService {
14161
- constructor() {
14162
- this.bffApisHaveBeenSetUp = false;
14163
- this._destroy$ = new Subject();
14164
- this.headersUpdated = new SmartSubject(this._destroy$);
14117
+ class SmartFilterEditorService {
14118
+ constructor(service) {
14119
+ this.service = service;
14120
+ this.modelChanged = new Subject();
14121
+ this.submit = new Subject();
14122
+ this.reSubscribeToChange = new Subject();
14165
14123
  }
14166
- ngOnDestroy() {
14167
- this._destroy$.next();
14168
- this._destroy$.complete();
14124
+ load() {
14125
+ return __awaiter(this, void 0, void 0, function* () {
14126
+ this.model = yield this.service.load(this.config.uuid, this.config.identifier).toPromise();
14127
+ this.modelChanged.next();
14128
+ });
14169
14129
  }
14170
- }
14171
- SmartAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
14172
- SmartAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService });
14173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, decorators: [{
14174
- type: Injectable
14175
- }] });
14176
-
14177
- /*
14178
- * Public API Surface of smarttree
14179
- */
14180
-
14181
- class SmartComponentLayoutUtility {
14182
- static setParent(layout, parent) {
14183
- var _a;
14184
- layout.parentComponent = parent;
14185
- (_a = layout.components) === null || _a === void 0 ? void 0 : _a.forEach((l) => this.setParent(l, parent));
14130
+ peformWidgetAction(request) {
14131
+ return __awaiter(this, void 0, void 0, function* () {
14132
+ this.model = yield this.service
14133
+ .performWidgetAction(this.config.uuid, this.config.identifier, request)
14134
+ .toPromise();
14135
+ this.modelChanged.next();
14136
+ });
14186
14137
  }
14187
- static getForms(comp) {
14188
- let result = [];
14189
- if (comp.components) {
14190
- result = comp.components
14191
- .map((c) => this.getForms(c))
14192
- .reduce((acc, value) => acc.concat(value), []);
14193
- }
14194
- if (comp.smartFormComponent) {
14195
- result.push(comp.smartFormComponent);
14196
- }
14197
- return result;
14138
+ getModel() {
14139
+ return this.model;
14198
14140
  }
14199
- static getGrids(comp) {
14200
- let result = [];
14201
- if (comp.components) {
14202
- result = comp.components
14203
- .map((c) => this.getGrids(c))
14204
- .reduce((acc, value) => acc.concat(value), []);
14205
- }
14206
- if (comp.smartGridComponent) {
14207
- result.push(comp.smartGridComponent);
14208
- }
14209
- return result;
14141
+ performUiActionRequest(uiActionRequest, widgetId, nodeId) {
14142
+ return __awaiter(this, void 0, void 0, function* () {
14143
+ yield this.peformWidgetAction(uiActionRequest);
14144
+ });
14210
14145
  }
14211
- static getTrees(comp) {
14212
- var _a;
14213
- let result = [];
14214
- if (comp.components) {
14215
- result = (_a = comp.components) === null || _a === void 0 ? void 0 : _a.map((c) => this.getTrees(c)).reduce((acc, value) => acc.concat(value), []);
14216
- }
14217
- if (comp.treeService) {
14218
- result.push(comp.treeService);
14219
- }
14220
- return result;
14146
+ handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
14147
+ return __awaiter(this, void 0, void 0, function* () {
14148
+ return {
14149
+ shouldPerformAction: true,
14150
+ uiActionRequest: uiActionRequest,
14151
+ };
14152
+ });
14221
14153
  }
14222
- }
14223
-
14224
- /*
14225
- * Public API Surface of smart-component-layout
14226
- */
14154
+ getAdditionalParams(uiAction) {
14155
+ throw new Error('Method not implemented.');
14156
+ }
14157
+ }
14158
+ SmartFilterEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, deps: [{ token: FilterService }], target: i0.ɵɵFactoryTarget.Injectable });
14159
+ SmartFilterEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService });
14160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, decorators: [{
14161
+ type: Injectable
14162
+ }], ctorParameters: function () { return [{ type: FilterService }]; } });
14227
14163
 
14228
14164
  let SmartComponentApiClient = class SmartComponentApiClient {
14229
14165
  constructor(inject, auth, pageName) {