@smartbit4all/ng-client 3.2.3 → 3.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-item/smart-filter-expression-item.component.mjs +9 -9
- package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-items/smart-filter-expression-items.component.mjs +12 -14
- package/esm2020/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.mjs +64 -69
- package/esm2020/lib/smart-filter-editor/smart-filter-editor.service.mjs +1 -1
- package/esm2020/lib/smart-filter-editor/smart-filter-params/components/smart-filter-param/smart-filter-param.component.mjs +7 -11
- package/esm2020/lib/smart-filter-editor/smart-filter-params/smart-filter-params.component.mjs +5 -57
- package/esm2020/lib/smart-form/services/smartform.service.mjs +13 -18
- package/fesm2015/smartbit4all-ng-client.mjs +787 -848
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +718 -780
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-item/smart-filter-expression-item.component.d.ts +4 -4
- package/lib/smart-filter-editor/smart-filter-editor-content/components/smart-filter-expression-items/smart-filter-expression-items.component.d.ts +6 -7
- package/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.d.ts +8 -16
- package/lib/smart-filter-editor/smart-filter-params/components/smart-filter-param/smart-filter-param.component.d.ts +2 -6
- package/lib/smart-filter-editor/smart-filter-params/smart-filter-params.component.d.ts +2 -3
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.2.5.tgz +0 -0
- package/smartbit4all-ng-client-3.2.3.tgz +0 -0
|
@@ -3814,12 +3814,11 @@ class SmartFormService {
|
|
|
3814
3814
|
}
|
|
3815
3815
|
toFormGroup() {
|
|
3816
3816
|
this.createFormControls(this.smartForm.widgets);
|
|
3817
|
-
if (this.formGroup) {
|
|
3818
|
-
|
|
3819
|
-
}
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
}
|
|
3817
|
+
// if (this.formGroup) {
|
|
3818
|
+
// this.formGroup.controls = this.group;
|
|
3819
|
+
// } else {
|
|
3820
|
+
// }
|
|
3821
|
+
this.formGroup = new FormGroup(this.group);
|
|
3823
3822
|
if (this.smartForm.validators && this.smartForm.validators.length) {
|
|
3824
3823
|
this.formGroup.setValidators(this.smartForm.validators.map((validator) => {
|
|
3825
3824
|
return validator.validator;
|
|
@@ -3842,18 +3841,14 @@ class SmartFormService {
|
|
|
3842
3841
|
widget.type !== SmartFormWidgetType.COMPONENT &&
|
|
3843
3842
|
widget.type !== SmartFormWidgetType.MATRIX &&
|
|
3844
3843
|
widget.type !== SmartFormWidgetType.YOUTUBE_PLAYER) {
|
|
3845
|
-
let formControl = this.group[`${widget.key}`];
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
}));
|
|
3852
|
-
if (widget.isDisabled) {
|
|
3853
|
-
formControl.disable();
|
|
3854
|
-
}
|
|
3855
|
-
this.group[`${widget.key}`] = formControl;
|
|
3844
|
+
// let formControl = this.group[`${widget.key}`];
|
|
3845
|
+
let formControl = new FormControl(widget.value || '', (_a = widget.validators) === null || _a === void 0 ? void 0 : _a.map((validator) => {
|
|
3846
|
+
return validator.validator;
|
|
3847
|
+
}));
|
|
3848
|
+
if (widget.isDisabled) {
|
|
3849
|
+
formControl.disable();
|
|
3856
3850
|
}
|
|
3851
|
+
this.group[`${widget.key}`] = formControl;
|
|
3857
3852
|
}
|
|
3858
3853
|
if (widget.type === SmartFormWidgetType.MATRIX) {
|
|
3859
3854
|
if (widget.isMultiple) {
|
|
@@ -13151,840 +13146,429 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
13151
13146
|
}]
|
|
13152
13147
|
}] });
|
|
13153
13148
|
|
|
13154
|
-
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
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
|
+
});
|
|
13161
13158
|
}
|
|
13162
|
-
|
|
13163
|
-
|
|
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 = [];
|
|
13164
13173
|
}
|
|
13165
|
-
|
|
13166
|
-
|
|
13174
|
+
ngOnInit() {
|
|
13175
|
+
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13176
|
+
this.setUp(this.service.model);
|
|
13177
|
+
});
|
|
13178
|
+
this.setUp(this.service.model);
|
|
13167
13179
|
}
|
|
13168
|
-
|
|
13169
|
-
|
|
13180
|
+
ngOnDestroy() {
|
|
13181
|
+
this._destroy$.next();
|
|
13182
|
+
this._destroy$.complete();
|
|
13170
13183
|
}
|
|
13171
|
-
|
|
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
|
+
}] } });
|
|
13172
13217
|
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
};
|
|
13218
|
+
var FilterExpressionBuilderUiModel;
|
|
13219
|
+
(function (FilterExpressionBuilderUiModel) {
|
|
13220
|
+
FilterExpressionBuilderUiModel.TypeEnum = {
|
|
13221
|
+
Simple: 'SIMPLE',
|
|
13222
|
+
Complex: 'COMPLEX'
|
|
13223
|
+
};
|
|
13224
|
+
})(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
|
|
13180
13225
|
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
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
|
+
});
|
|
13192
13261
|
}
|
|
13193
|
-
|
|
13194
|
-
|
|
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
|
+
}
|
|
13195
13283
|
}
|
|
13196
|
-
|
|
13197
|
-
|
|
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();
|
|
13198
13347
|
}
|
|
13199
13348
|
else {
|
|
13200
|
-
this.
|
|
13349
|
+
(_b = this.simpleFilterFormChildren) === null || _b === void 0 ? void 0 : _b.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13350
|
+
this.subsrcibeSimpleFormChildrenEvents();
|
|
13351
|
+
});
|
|
13201
13352
|
}
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
* Select the correct content-type to use for a request.
|
|
13205
|
-
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
|
13206
|
-
* If no content type is found return the first found type if the contentTypes is not empty
|
|
13207
|
-
* @param contentTypes - the array of content types that are available for selection
|
|
13208
|
-
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
|
13209
|
-
*/
|
|
13210
|
-
selectHeaderContentType(contentTypes) {
|
|
13211
|
-
if (contentTypes.length === 0) {
|
|
13212
|
-
return undefined;
|
|
13353
|
+
if ((_c = this.formChildren) === null || _c === void 0 ? void 0 : _c.first) {
|
|
13354
|
+
this.subscribeEditorFormChildrenEvents();
|
|
13213
13355
|
}
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13356
|
+
else {
|
|
13357
|
+
(_d = this.formChildren) === null || _d === void 0 ? void 0 : _d.changes.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13358
|
+
this.subscribeEditorFormChildrenEvents();
|
|
13359
|
+
});
|
|
13217
13360
|
}
|
|
13218
|
-
return type;
|
|
13219
13361
|
}
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
}
|
|
13231
|
-
const type = accepts.find((x) => this.isJsonMime(x));
|
|
13232
|
-
if (type === undefined) {
|
|
13233
|
-
return accepts[0];
|
|
13234
|
-
}
|
|
13235
|
-
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
|
+
});
|
|
13236
13372
|
}
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
isJsonMime(mime) {
|
|
13248
|
-
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
13249
|
-
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
|
+
});
|
|
13250
13383
|
}
|
|
13251
|
-
|
|
13252
|
-
|
|
13253
|
-
|
|
13254
|
-
|
|
13255
|
-
|
|
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();
|
|
13256
13391
|
}
|
|
13257
|
-
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
// It only works for the 'simple' parameter style.
|
|
13261
|
-
// Date-handling only works for the 'date-time' format.
|
|
13262
|
-
// All other styles and Date-formats are probably handled incorrectly.
|
|
13263
|
-
//
|
|
13264
|
-
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
|
|
13265
|
-
const value = param.dataFormat === 'date-time' && param.value instanceof Date
|
|
13266
|
-
? param.value.toISOString()
|
|
13267
|
-
: param.value;
|
|
13268
|
-
return encodeURIComponent(String(value));
|
|
13392
|
+
ngOnDestroy() {
|
|
13393
|
+
this._destroy$.next();
|
|
13394
|
+
this._destroy$.complete();
|
|
13269
13395
|
}
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13276
|
-
|
|
13277
|
-
|
|
13278
|
-
|
|
13279
|
-
|
|
13280
|
-
|
|
13281
|
-
|
|
13282
|
-
*/
|
|
13283
|
-
class FilterService {
|
|
13284
|
-
constructor(httpClient, basePath, configuration) {
|
|
13285
|
-
this.httpClient = httpClient;
|
|
13286
|
-
this.basePath = 'http://localhost';
|
|
13287
|
-
this.defaultHeaders = new HttpHeaders();
|
|
13288
|
-
this.configuration = new Configuration();
|
|
13289
|
-
if (configuration) {
|
|
13290
|
-
this.configuration = configuration;
|
|
13291
|
-
}
|
|
13292
|
-
if (typeof this.configuration.basePath !== 'string') {
|
|
13293
|
-
if (Array.isArray(basePath) && basePath.length > 0) {
|
|
13294
|
-
basePath = basePath[0];
|
|
13295
|
-
}
|
|
13296
|
-
if (typeof basePath !== 'string') {
|
|
13297
|
-
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;
|
|
13298
13408
|
}
|
|
13299
|
-
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
if (typeof value === "object" && value instanceof Date === false) {
|
|
13306
|
-
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
|
13307
|
-
}
|
|
13308
|
-
else {
|
|
13309
|
-
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
|
13310
|
-
}
|
|
13311
|
-
return httpParams;
|
|
13312
|
-
}
|
|
13313
|
-
addToHttpParamsRecursive(httpParams, value, key) {
|
|
13314
|
-
if (value == null) {
|
|
13315
|
-
return httpParams;
|
|
13316
|
-
}
|
|
13317
|
-
if (typeof value === "object") {
|
|
13318
|
-
if (Array.isArray(value)) {
|
|
13319
|
-
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;
|
|
13320
13415
|
}
|
|
13321
|
-
|
|
13322
|
-
if (key
|
|
13323
|
-
|
|
13324
|
-
}
|
|
13325
|
-
else {
|
|
13326
|
-
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';
|
|
13327
13419
|
}
|
|
13420
|
+
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_f = filterExpressionField.widgetType) !== null && _f !== void 0 ? _f : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13421
|
+
return;
|
|
13328
13422
|
}
|
|
13329
|
-
|
|
13330
|
-
|
|
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;
|
|
13331
13429
|
}
|
|
13332
|
-
}
|
|
13333
|
-
|
|
13334
|
-
|
|
13335
|
-
|
|
13336
|
-
|
|
13337
|
-
|
|
13338
|
-
|
|
13339
|
-
|
|
13430
|
+
});
|
|
13431
|
+
this.simpleFilterForm = {
|
|
13432
|
+
direction: SmartFormWidgetDirection.ROW,
|
|
13433
|
+
componentModel: { data: model },
|
|
13434
|
+
useOnValueChangeEvent: true,
|
|
13435
|
+
useOnBlurEvent: true,
|
|
13436
|
+
widgets,
|
|
13437
|
+
};
|
|
13340
13438
|
}
|
|
13341
|
-
|
|
13342
|
-
|
|
13343
|
-
|
|
13344
|
-
|
|
13345
|
-
|
|
13346
|
-
|
|
13347
|
-
}
|
|
13348
|
-
|
|
13349
|
-
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
];
|
|
13355
|
-
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13356
|
-
}
|
|
13357
|
-
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13358
|
-
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
13359
|
-
}
|
|
13360
|
-
let localVarHttpContext = options && options.context;
|
|
13361
|
-
if (localVarHttpContext === undefined) {
|
|
13362
|
-
localVarHttpContext = new HttpContext();
|
|
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]);
|
|
13445
|
+
});
|
|
13446
|
+
this.service.model.model.workplaceList.filters = result;
|
|
13447
|
+
}
|
|
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();
|
|
13363
13452
|
}
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
if (
|
|
13367
|
-
|
|
13368
|
-
}
|
|
13369
|
-
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13370
|
-
responseType_ = 'json';
|
|
13453
|
+
else {
|
|
13454
|
+
this.constructUiActionModels();
|
|
13455
|
+
if (this.service.model.selectedFieldEditor) {
|
|
13456
|
+
this.constructForm();
|
|
13371
13457
|
}
|
|
13372
13458
|
else {
|
|
13373
|
-
|
|
13459
|
+
this.smartForm = undefined;
|
|
13374
13460
|
}
|
|
13375
13461
|
}
|
|
13376
|
-
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`;
|
|
13377
|
-
return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, {
|
|
13378
|
-
context: localVarHttpContext,
|
|
13379
|
-
responseType: responseType_,
|
|
13380
|
-
withCredentials: this.configuration.withCredentials,
|
|
13381
|
-
headers: localVarHeaders,
|
|
13382
|
-
observe: observe,
|
|
13383
|
-
reportProgress: reportProgress
|
|
13384
|
-
});
|
|
13385
13462
|
}
|
|
13386
|
-
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13395
|
-
}
|
|
13396
|
-
let localVarHeaders = this.defaultHeaders;
|
|
13397
|
-
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
13398
|
-
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
13399
|
-
// to determine the Accept header
|
|
13400
|
-
const httpHeaderAccepts = [
|
|
13401
|
-
'application/json'
|
|
13402
|
-
];
|
|
13403
|
-
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
13404
|
-
}
|
|
13405
|
-
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
13406
|
-
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
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
|
+
});
|
|
13407
13472
|
}
|
|
13408
|
-
|
|
13409
|
-
|
|
13410
|
-
|
|
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
|
+
});
|
|
13411
13488
|
}
|
|
13412
|
-
// to determine the Content-Type header
|
|
13413
|
-
const consumes = [
|
|
13414
|
-
'application/json'
|
|
13415
|
-
];
|
|
13416
|
-
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
13417
|
-
if (httpContentTypeSelected !== undefined) {
|
|
13418
|
-
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
13419
|
-
}
|
|
13420
|
-
let responseType_ = 'json';
|
|
13421
|
-
if (localVarHttpHeaderAcceptSelected) {
|
|
13422
|
-
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
13423
|
-
responseType_ = 'text';
|
|
13424
|
-
}
|
|
13425
|
-
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
13426
|
-
responseType_ = 'json';
|
|
13427
|
-
}
|
|
13428
|
-
else {
|
|
13429
|
-
responseType_ = 'blob';
|
|
13430
|
-
}
|
|
13431
|
-
}
|
|
13432
|
-
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`;
|
|
13433
|
-
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
13434
|
-
context: localVarHttpContext,
|
|
13435
|
-
body: body,
|
|
13436
|
-
responseType: responseType_,
|
|
13437
|
-
withCredentials: this.configuration.withCredentials,
|
|
13438
|
-
headers: localVarHeaders,
|
|
13439
|
-
observe: observe,
|
|
13440
|
-
reportProgress: reportProgress
|
|
13441
|
-
});
|
|
13442
|
-
}
|
|
13443
|
-
}
|
|
13444
|
-
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 });
|
|
13445
|
-
FilterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, providedIn: 'root' });
|
|
13446
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FilterService, decorators: [{
|
|
13447
|
-
type: Injectable,
|
|
13448
|
-
args: [{
|
|
13449
|
-
providedIn: 'root'
|
|
13450
|
-
}]
|
|
13451
|
-
}], ctorParameters: function () {
|
|
13452
|
-
return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
13453
|
-
type: Optional
|
|
13454
|
-
}, {
|
|
13455
|
-
type: Inject,
|
|
13456
|
-
args: [BASE_PATH]
|
|
13457
|
-
}] }, { type: Configuration, decorators: [{
|
|
13458
|
-
type: Optional
|
|
13459
|
-
}] }];
|
|
13460
|
-
} });
|
|
13461
|
-
|
|
13462
|
-
class SmartFilterEditorService {
|
|
13463
|
-
constructor(service) {
|
|
13464
|
-
this.service = service;
|
|
13465
|
-
this.modelChanged = new Subject();
|
|
13466
|
-
this.submit = new Subject();
|
|
13467
|
-
this.reSubscribeToChange = new Subject();
|
|
13468
|
-
}
|
|
13469
|
-
load() {
|
|
13470
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
13471
|
-
this.model = yield this.service.load(this.config.uuid, this.config.identifier).toPromise();
|
|
13472
|
-
this.modelChanged.next();
|
|
13473
|
-
});
|
|
13474
|
-
}
|
|
13475
|
-
peformWidgetAction(request) {
|
|
13476
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
13477
|
-
this.model = yield this.service
|
|
13478
|
-
.performWidgetAction(this.config.uuid, this.config.identifier, request)
|
|
13479
|
-
.toPromise();
|
|
13480
|
-
this.modelChanged.next();
|
|
13481
|
-
});
|
|
13482
|
-
}
|
|
13483
|
-
getModel() {
|
|
13484
|
-
return this.model;
|
|
13485
13489
|
}
|
|
13486
|
-
|
|
13487
|
-
|
|
13488
|
-
|
|
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,
|
|
13489
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
|
+
};
|
|
13490
13502
|
}
|
|
13491
|
-
|
|
13492
|
-
|
|
13493
|
-
|
|
13494
|
-
|
|
13495
|
-
|
|
13496
|
-
|
|
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
|
+
},
|
|
13497
13511
|
});
|
|
13498
13512
|
}
|
|
13499
|
-
|
|
13500
|
-
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
SmartFilterEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, deps: [{ token: FilterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
13504
|
-
SmartFilterEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService });
|
|
13505
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorService, decorators: [{
|
|
13506
|
-
type: Injectable
|
|
13507
|
-
}], ctorParameters: function () { return [{ type: FilterService }]; } });
|
|
13508
|
-
|
|
13509
|
-
class SmartFilterParamComponent {
|
|
13510
|
-
constructor(service) {
|
|
13511
|
-
this.service = service;
|
|
13512
|
-
}
|
|
13513
|
-
ngOnInit() { }
|
|
13514
|
-
onItemClick(item) {
|
|
13515
|
-
this.data.serviceToUse.peformWidgetAction({
|
|
13516
|
-
code: 'ADD_FILTER_EXPRESSION',
|
|
13513
|
+
remove() {
|
|
13514
|
+
var _a;
|
|
13515
|
+
this.service.peformWidgetAction({
|
|
13516
|
+
code: 'REMOVE_FILTER_EXPRESSION',
|
|
13517
13517
|
params: {
|
|
13518
|
-
model:
|
|
13518
|
+
model: (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField,
|
|
13519
13519
|
},
|
|
13520
13520
|
});
|
|
13521
13521
|
}
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
|
|
13528
|
-
|
|
13529
|
-
|
|
13530
|
-
}
|
|
13531
|
-
|
|
13532
|
-
class SmartFilterParamsComponent {
|
|
13533
|
-
// filterComponentRef?: ComponentRef<SmartFilterComponent>;
|
|
13534
|
-
// filter?: SmartFilter;
|
|
13535
|
-
constructor() {
|
|
13536
|
-
this._destroy$ = new Subject();
|
|
13537
|
-
this.expandableSections = [];
|
|
13538
|
-
}
|
|
13539
|
-
ngOnInit() {
|
|
13540
|
-
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13541
|
-
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
|
+
});
|
|
13542
13531
|
});
|
|
13543
|
-
this.setUp(this.service.model);
|
|
13544
|
-
}
|
|
13545
|
-
ngOnDestroy() {
|
|
13546
|
-
this._destroy$.next();
|
|
13547
|
-
this._destroy$.complete();
|
|
13548
|
-
}
|
|
13549
|
-
setUp(model) {
|
|
13550
|
-
this.filterBuilder = model.model;
|
|
13551
|
-
// this.constructFilter();
|
|
13552
|
-
this.constructExpandableSections();
|
|
13553
13532
|
}
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
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) => {
|
|
13557
13548
|
return {
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
group: filterExpressionBuilderGroup.fields,
|
|
13563
|
-
serviceToUse: this.service,
|
|
13564
|
-
},
|
|
13565
|
-
inputName: 'data',
|
|
13566
|
-
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,
|
|
13567
13553
|
};
|
|
13568
|
-
})
|
|
13569
|
-
}
|
|
13570
|
-
|
|
13571
|
-
// this.expandableSectionsFromExcel = {
|
|
13572
|
-
// title: this.service.model.externalFilterGroup.label!,
|
|
13573
|
-
// cssClass: 'filterExpressionBuilderGroup',
|
|
13574
|
-
// customComponent: SmartFilterParamComponent,
|
|
13575
|
-
// data: {
|
|
13576
|
-
// group: this.service.model.externalFilterGroup.fields,
|
|
13577
|
-
// },
|
|
13578
|
-
// inputName: 'data',
|
|
13579
|
-
// isExpanded: true,
|
|
13580
|
-
// };
|
|
13581
|
-
// }
|
|
13582
|
-
}
|
|
13583
|
-
// constructFilter(): void {
|
|
13584
|
-
// if (this.filter && this.filterComponentRef) {
|
|
13585
|
-
// return;
|
|
13586
|
-
// }
|
|
13587
|
-
// // this.filter = {
|
|
13588
|
-
// // data: this.service.model?.groupFilter?.filters! as FilterExpressionField[],
|
|
13589
|
-
// // type: SmartFilterType.Simple,
|
|
13590
|
-
// // showPossibleActions: false,
|
|
13591
|
-
// // };
|
|
13592
|
-
// this.filterVcRef?.clear();
|
|
13593
|
-
// this.filterComponentRef = this.cfService.createComponent(
|
|
13594
|
-
// this.filterVcRef!,
|
|
13595
|
-
// SmartFilterComponent,
|
|
13596
|
-
// new Map<string, any>([['filter', this.filter]])
|
|
13597
|
-
// );
|
|
13598
|
-
// this.filterComponentRef.instance?.service.change
|
|
13599
|
-
// .pipe(takeUntil(this._destroy$))
|
|
13600
|
-
// .subscribe(() => {
|
|
13601
|
-
// let uiAction: UiAction = this.service.model?.filterGroupsAction!;
|
|
13602
|
-
// uiAction.params = {
|
|
13603
|
-
// filter: {
|
|
13604
|
-
// filters: this.filterComponentRef?.instance.service.filter?.data,
|
|
13605
|
-
// },
|
|
13606
|
-
// };
|
|
13607
|
-
// // let uiActionModel: UiActionModel = {
|
|
13608
|
-
// // serviceToUse: this.service,
|
|
13609
|
-
// // uiAction,
|
|
13610
|
-
// // };
|
|
13611
|
-
// // this.uiActionService.uiActionModel = uiActionModel;
|
|
13612
|
-
// // this.uiActionService.execute(uiAction);
|
|
13613
|
-
// });
|
|
13614
|
-
// }
|
|
13615
|
-
addDataSource() {
|
|
13616
|
-
// this.service.addDataSource();
|
|
13554
|
+
}),
|
|
13555
|
+
};
|
|
13556
|
+
return widget;
|
|
13617
13557
|
}
|
|
13618
13558
|
}
|
|
13619
|
-
|
|
13620
|
-
|
|
13621
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type:
|
|
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: [{
|
|
13622
13562
|
type: Component,
|
|
13623
|
-
args: [{ selector: 'smart-filter-
|
|
13624
|
-
}], 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: [{
|
|
13625
13565
|
type: Input
|
|
13626
|
-
}],
|
|
13627
|
-
type:
|
|
13628
|
-
args: ['
|
|
13629
|
-
}]
|
|
13630
|
-
|
|
13631
|
-
|
|
13632
|
-
(function (FilterExpressionBuilderUiModel) {
|
|
13633
|
-
FilterExpressionBuilderUiModel.TypeEnum = {
|
|
13634
|
-
Simple: 'SIMPLE',
|
|
13635
|
-
Complex: 'COMPLEX'
|
|
13636
|
-
};
|
|
13637
|
-
})(FilterExpressionBuilderUiModel || (FilterExpressionBuilderUiModel = {}));
|
|
13638
|
-
|
|
13639
|
-
var FilterExpressionBuilderApiActions;
|
|
13640
|
-
(function (FilterExpressionBuilderApiActions) {
|
|
13641
|
-
FilterExpressionBuilderApiActions["OPEN_FILTER_GROUPS"] = "OPEN_FILTER_GROUPS";
|
|
13642
|
-
FilterExpressionBuilderApiActions["CLOSE_FILTER_GROUPS"] = "CLOSE_FILTER_GROUPS";
|
|
13643
|
-
FilterExpressionBuilderApiActions["ADD_BRACKET"] = "ADD_BRACKET";
|
|
13644
|
-
FilterExpressionBuilderApiActions["ADD_FILTER_EXPRESSION"] = "ADD_FILTER_EXPRESSION";
|
|
13645
|
-
FilterExpressionBuilderApiActions["REMOVE_FILTER_EXPRESSION"] = "REMOVE_FILTER_EXPRESSION";
|
|
13646
|
-
FilterExpressionBuilderApiActions["REDO"] = "REDO";
|
|
13647
|
-
FilterExpressionBuilderApiActions["FILTER_GROUPS"] = "AFILTER_GROUPS";
|
|
13648
|
-
FilterExpressionBuilderApiActions["SELECT_FIELD"] = "SELECT_FIELD";
|
|
13649
|
-
FilterExpressionBuilderApiActions["UPDATE_FILTER_EXPRESSION"] = "UPDATE_FILTER_EXPRESSION";
|
|
13650
|
-
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_DATA"] = "SAVE_EXPRESSION_DATA";
|
|
13651
|
-
FilterExpressionBuilderApiActions["SAVE_EXPRESSION_FIELD_LIST"] = "SAVE_EXPRESSION_FIELD_LIST";
|
|
13652
|
-
})(FilterExpressionBuilderApiActions || (FilterExpressionBuilderApiActions = {}));
|
|
13653
|
-
|
|
13654
|
-
class SmartFilterExpressionItemComponent {
|
|
13655
|
-
constructor(service) {
|
|
13656
|
-
this.service = service;
|
|
13657
|
-
this.isSelected = false;
|
|
13658
|
-
}
|
|
13659
|
-
ngOnInit() {
|
|
13660
|
-
var _a;
|
|
13661
|
-
this.isSelected =
|
|
13662
|
-
JSON.stringify((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField) === JSON.stringify(this.item);
|
|
13663
|
-
}
|
|
13664
|
-
setOperatorTo(event, operationType) {
|
|
13665
|
-
var _a;
|
|
13666
|
-
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
13667
|
-
if (!((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.readOnly)) {
|
|
13668
|
-
this.item.expressionData.boolOperator = operationType;
|
|
13669
|
-
this.service.peformWidgetAction({
|
|
13670
|
-
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13671
|
-
params: {
|
|
13672
|
-
model: this.item,
|
|
13673
|
-
},
|
|
13674
|
-
});
|
|
13675
|
-
}
|
|
13676
|
-
}
|
|
13677
|
-
select(event, item) {
|
|
13678
|
-
var _a;
|
|
13679
|
-
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
13680
|
-
if (!((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.readOnly)) {
|
|
13681
|
-
if (!this.isSelected) {
|
|
13682
|
-
this.service.peformWidgetAction({
|
|
13683
|
-
code: 'SELECT_FIELD',
|
|
13684
|
-
params: {
|
|
13685
|
-
model: this.item,
|
|
13686
|
-
},
|
|
13687
|
-
});
|
|
13688
|
-
}
|
|
13689
|
-
else {
|
|
13690
|
-
this.service.peformWidgetAction({
|
|
13691
|
-
code: 'SELECT_FIELD',
|
|
13692
|
-
params: {
|
|
13693
|
-
model: this.item,
|
|
13694
|
-
},
|
|
13695
|
-
});
|
|
13696
|
-
}
|
|
13697
|
-
}
|
|
13698
|
-
}
|
|
13699
|
-
}
|
|
13700
|
-
SmartFilterExpressionItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13701
|
-
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"] }] });
|
|
13702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemComponent, decorators: [{
|
|
13703
|
-
type: Component,
|
|
13704
|
-
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"] }]
|
|
13705
|
-
}], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { item: [{
|
|
13706
|
-
type: Input
|
|
13707
|
-
}], hasNext: [{
|
|
13708
|
-
type: Input
|
|
13709
|
-
}] } });
|
|
13710
|
-
|
|
13711
|
-
class SmartFilterExpressionItemsComponent {
|
|
13712
|
-
constructor(service) {
|
|
13713
|
-
var _a;
|
|
13714
|
-
this.service = service;
|
|
13715
|
-
this._destroy$ = new Subject();
|
|
13716
|
-
this.isSelected = false;
|
|
13717
|
-
this.service.modelChanged.subscribe(() => {
|
|
13718
|
-
var _a;
|
|
13719
|
-
console.log(this.service.model);
|
|
13720
|
-
this.isSelected = ((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField) === null;
|
|
13721
|
-
});
|
|
13722
|
-
this.isSelected = ((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField) === null;
|
|
13723
|
-
}
|
|
13724
|
-
ngOnChanges(changes) {
|
|
13725
|
-
console.log(changes);
|
|
13726
|
-
}
|
|
13727
|
-
ngOnInit() { }
|
|
13728
|
-
ngOnDestroy() {
|
|
13729
|
-
this._destroy$.next();
|
|
13730
|
-
this._destroy$.complete();
|
|
13731
|
-
}
|
|
13732
|
-
select() {
|
|
13733
|
-
// this.service.selectFilterExpressionField(undefined);
|
|
13734
|
-
}
|
|
13735
|
-
drop(event) {
|
|
13736
|
-
moveItemInArray(this.items, event.previousIndex, event.currentIndex);
|
|
13737
|
-
}
|
|
13738
|
-
}
|
|
13739
|
-
SmartFilterExpressionItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, deps: [{ token: SmartFilterEditorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13740
|
-
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"] }] });
|
|
13741
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterExpressionItemsComponent, decorators: [{
|
|
13742
|
-
type: Component,
|
|
13743
|
-
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"] }]
|
|
13744
|
-
}], ctorParameters: function () { return [{ type: SmartFilterEditorService }]; }, propDecorators: { items: [{
|
|
13745
|
-
type: Input
|
|
13746
|
-
}] } });
|
|
13747
|
-
|
|
13748
|
-
class SmartFilterEditorContentComponent {
|
|
13749
|
-
constructor(layoutService, cfService) {
|
|
13750
|
-
this.layoutService = layoutService;
|
|
13751
|
-
this.cfService = cfService;
|
|
13752
|
-
this._destroy$ = new Subject();
|
|
13753
|
-
this.uiActionModels = [];
|
|
13754
|
-
this.expressionUiActionModels = [];
|
|
13755
|
-
this.type = FilterExpressionBuilderUiModel.TypeEnum;
|
|
13756
|
-
}
|
|
13757
|
-
ngOnInit() {
|
|
13758
|
-
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => this.setUp());
|
|
13759
|
-
this.service.load();
|
|
13760
|
-
}
|
|
13761
|
-
ngOnDestroy() {
|
|
13762
|
-
this._destroy$.next();
|
|
13763
|
-
this._destroy$.complete();
|
|
13764
|
-
}
|
|
13765
|
-
setupSimpleFilter() {
|
|
13766
|
-
var _a, _b, _c, _d, _e;
|
|
13767
|
-
if (this.simpleFilterFormChild) {
|
|
13768
|
-
return;
|
|
13769
|
-
}
|
|
13770
|
-
let widgets = [];
|
|
13771
|
-
let key;
|
|
13772
|
-
let model = {};
|
|
13773
|
-
(_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) => {
|
|
13774
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
13775
|
-
model[index] = filterExpressionField;
|
|
13776
|
-
if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
|
|
13777
|
-
key = index + '.expressionData.operand2.selectedValues';
|
|
13778
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_a = filterExpressionField.widgetType) !== null && _a !== void 0 ? _a : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13779
|
-
return;
|
|
13780
|
-
}
|
|
13781
|
-
if (((_b = filterExpressionField.expressionData) === null || _b === void 0 ? void 0 : _b.currentOperation) === 'BETWEEN') {
|
|
13782
|
-
key = index + '.expressionData.operand2.valueAsString';
|
|
13783
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_c = filterExpressionField.widgetType) !== null && _c !== void 0 ? _c : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13784
|
-
key = index + '.expressionData.operand3.valueAsString';
|
|
13785
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_d = filterExpressionField.widgetType) !== null && _d !== void 0 ? _d : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13786
|
-
return;
|
|
13787
|
-
}
|
|
13788
|
-
if ((_e = filterExpressionField.expressionData) === null || _e === void 0 ? void 0 : _e.operand2) {
|
|
13789
|
-
if (key !== index + '.expressionData.operand2.selectedValues') {
|
|
13790
|
-
key = index + '.expressionData.operand2.valueAsString';
|
|
13791
|
-
}
|
|
13792
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label2, (_f = filterExpressionField.widgetType) !== null && _f !== void 0 ? _f : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13793
|
-
return;
|
|
13794
|
-
}
|
|
13795
|
-
if ((_g = filterExpressionField === null || filterExpressionField === void 0 ? void 0 : filterExpressionField.expressionData) === null || _g === void 0 ? void 0 : _g.operand3) {
|
|
13796
|
-
if (key !== index + '.selectedValues') {
|
|
13797
|
-
key = index + '.expressionData.operand3.valueAsString';
|
|
13798
|
-
}
|
|
13799
|
-
widgets.push(this.constructFormWidget(key, filterExpressionField.label3, (_h = filterExpressionField.widgetType) !== null && _h !== void 0 ? _h : FilterExpressionFieldWidgetType.TextField, filterExpressionField.possibleValues));
|
|
13800
|
-
return;
|
|
13801
|
-
}
|
|
13802
|
-
});
|
|
13803
|
-
this.simpleFilterForm = {
|
|
13804
|
-
direction: SmartFormWidgetDirection.ROW,
|
|
13805
|
-
componentModel: { data: model },
|
|
13806
|
-
useOnValueChangeEvent: true,
|
|
13807
|
-
useOnBlurEvent: true,
|
|
13808
|
-
widgets,
|
|
13809
|
-
};
|
|
13810
|
-
this.simpleFilterFormChild = this.cfService.createComponent(this.simpleFilterFormVcRef, SmartformComponent, new Map([['smartForm', this.simpleFilterForm]]));
|
|
13811
|
-
if (this.smartFilterChangeSubscription) {
|
|
13812
|
-
this.smartFilterChangeSubscription.unsubscribe();
|
|
13813
|
-
}
|
|
13814
|
-
this.smartFilterChangeSubscription = (_d = this.simpleFilterFormChild.instance.onBlurSubject) === null || _d === void 0 ? void 0 : _d.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13815
|
-
this.saveFilter();
|
|
13816
|
-
});
|
|
13817
|
-
if (this.smartFilterSophisticatedChangeSubscription) {
|
|
13818
|
-
this.smartFilterSophisticatedChangeSubscription.unsubscribe();
|
|
13819
|
-
}
|
|
13820
|
-
this.smartFilterSophisticatedChangeSubscription =
|
|
13821
|
-
(_e = this.simpleFilterFormChild.instance.sophisticatedValueChange) === null || _e === void 0 ? void 0 : _e.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13822
|
-
if (change.kind === 'selection') {
|
|
13823
|
-
this.saveFilter();
|
|
13824
|
-
}
|
|
13825
|
-
});
|
|
13826
|
-
}
|
|
13827
|
-
extractFilterFieldFromFormModel() {
|
|
13828
|
-
var _a;
|
|
13829
|
-
let simpleFilter = (_a = this.simpleFilterFormChild) === null || _a === void 0 ? void 0 : _a.instance.submitForm(false).componentModel.data;
|
|
13830
|
-
let result = [];
|
|
13831
|
-
Object.keys(simpleFilter).forEach((key) => {
|
|
13832
|
-
result.push(simpleFilter[key]);
|
|
13833
|
-
});
|
|
13834
|
-
this.service.model.model.workplaceList.filters = result;
|
|
13835
|
-
}
|
|
13836
|
-
setUp() {
|
|
13837
|
-
var _a;
|
|
13838
|
-
if (((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.type) === this.type.Simple) {
|
|
13839
|
-
this.setupSimpleFilter();
|
|
13840
|
-
}
|
|
13841
|
-
else {
|
|
13842
|
-
this.constructUiActionModels();
|
|
13843
|
-
if (this.service.model.selectedFieldEditor) {
|
|
13844
|
-
this.constructForm();
|
|
13845
|
-
}
|
|
13846
|
-
else {
|
|
13847
|
-
this.smartForm = undefined;
|
|
13848
|
-
}
|
|
13849
|
-
}
|
|
13850
|
-
}
|
|
13851
|
-
constructUiActionModels() {
|
|
13852
|
-
var _a, _b, _c, _d;
|
|
13853
|
-
if ((_a = this.service.model) === null || _a === void 0 ? void 0 : _a.possibleActions) {
|
|
13854
|
-
this.uiActionModels = this.service.model.possibleActions.map((action) => {
|
|
13855
|
-
return {
|
|
13856
|
-
serviceToUse: this.service,
|
|
13857
|
-
uiAction: action,
|
|
13858
|
-
};
|
|
13859
|
-
});
|
|
13860
|
-
}
|
|
13861
|
-
if ((_c = (_b = this.service.model) === null || _b === void 0 ? void 0 : _b.selectedFieldEditor) === null || _c === void 0 ? void 0 : _c.possibleActions) {
|
|
13862
|
-
this.expressionUiActionModels = (_d = this.service.model) === null || _d === void 0 ? void 0 : _d.selectedFieldEditor.possibleActions.map((uiAction) => {
|
|
13863
|
-
var _a;
|
|
13864
|
-
let copiedUiAction = {};
|
|
13865
|
-
Object.keys(uiAction).map((key) => {
|
|
13866
|
-
copiedUiAction[key] = uiAction[key];
|
|
13867
|
-
});
|
|
13868
|
-
copiedUiAction.params = {
|
|
13869
|
-
field: (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField,
|
|
13870
|
-
};
|
|
13871
|
-
return {
|
|
13872
|
-
serviceToUse: this.service,
|
|
13873
|
-
uiAction: copiedUiAction,
|
|
13874
|
-
};
|
|
13875
|
-
});
|
|
13876
|
-
}
|
|
13877
|
-
}
|
|
13878
|
-
constructForm() {
|
|
13879
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
13880
|
-
if (this.smartForm) {
|
|
13881
|
-
return;
|
|
13882
|
-
}
|
|
13883
|
-
let generatedWidgets = this.layoutService.render({
|
|
13884
|
-
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,
|
|
13885
|
-
});
|
|
13886
|
-
this.smartForm = {
|
|
13887
|
-
direction: SmartFormWidgetDirection.ROW,
|
|
13888
|
-
useOnBlurEvent: true,
|
|
13889
|
-
useOnValueChangeEvent: true,
|
|
13890
|
-
componentModel: { data: (_d = this.service.model) === null || _d === void 0 ? void 0 : _d.selectedField },
|
|
13891
|
-
widgets: generatedWidgets,
|
|
13892
|
-
};
|
|
13893
|
-
this.formChild = this.cfService.createComponent(this.formChildVcRef, SmartformComponent, new Map([['smartForm', this.smartForm]]));
|
|
13894
|
-
if (this.smartformChangeSubscription) {
|
|
13895
|
-
this.smartformChangeSubscription.unsubscribe();
|
|
13896
|
-
}
|
|
13897
|
-
this.smartformChangeSubscription = (_f = (_e = this.formChild) === null || _e === void 0 ? void 0 : _e.instance.onBlurSubject) === null || _f === void 0 ? void 0 : _f.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13898
|
-
this.save();
|
|
13899
|
-
});
|
|
13900
|
-
if (this.smartformSophisticatedChangeSubscription) {
|
|
13901
|
-
this.smartformSophisticatedChangeSubscription.unsubscribe();
|
|
13902
|
-
}
|
|
13903
|
-
this.smartformSophisticatedChangeSubscription =
|
|
13904
|
-
(_h = (_g = this.formChild) === null || _g === void 0 ? void 0 : _g.instance.sophisticatedValueChange) === null || _h === void 0 ? void 0 : _h.pipe(takeUntil(this._destroy$)).subscribe((change) => {
|
|
13905
|
-
if (change.key === 'expressionData.currentOperation') {
|
|
13906
|
-
this.save();
|
|
13907
|
-
}
|
|
13908
|
-
});
|
|
13909
|
-
}
|
|
13910
|
-
save() {
|
|
13911
|
-
var _a, _b;
|
|
13912
|
-
(_a = this.formChild) === null || _a === void 0 ? void 0 : _a.instance.submitForm(false);
|
|
13913
|
-
this.service.peformWidgetAction({
|
|
13914
|
-
code: 'UPDATE_FILTER_EXPRESSION',
|
|
13915
|
-
params: {
|
|
13916
|
-
model: (_b = this.service.model) === null || _b === void 0 ? void 0 : _b.selectedField,
|
|
13917
|
-
},
|
|
13918
|
-
});
|
|
13919
|
-
}
|
|
13920
|
-
remove() {
|
|
13921
|
-
var _a;
|
|
13922
|
-
this.service.peformWidgetAction({
|
|
13923
|
-
code: 'REMOVE_FILTER_EXPRESSION',
|
|
13924
|
-
params: {
|
|
13925
|
-
model: (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.selectedField,
|
|
13926
|
-
},
|
|
13927
|
-
});
|
|
13928
|
-
}
|
|
13929
|
-
getFilteredUiActionModels(filterPredicate) {
|
|
13930
|
-
// return this.service.model!.possibleActions!.filter(filterPredicate).map((uiAction: UiAction) => {
|
|
13931
|
-
// return {
|
|
13932
|
-
// serviceToUse: this.service,
|
|
13933
|
-
// uiAction,
|
|
13934
|
-
// };
|
|
13935
|
-
// });
|
|
13936
|
-
return [];
|
|
13937
|
-
}
|
|
13938
|
-
saveFilter() {
|
|
13939
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
13940
|
-
this.extractFilterFieldFromFormModel();
|
|
13941
|
-
this.service.performUiActionRequest({
|
|
13942
|
-
code: FilterExpressionBuilderApiActions.SAVE_EXPRESSION_FIELD_LIST,
|
|
13943
|
-
params: {
|
|
13944
|
-
model: this.service.model,
|
|
13945
|
-
},
|
|
13946
|
-
});
|
|
13947
|
-
});
|
|
13948
|
-
}
|
|
13949
|
-
constructFormWidget(key, label, widgetType, possibleValues) {
|
|
13950
|
-
let type = widgetType;
|
|
13951
|
-
if (type === FilterExpressionFieldWidgetType.Date) {
|
|
13952
|
-
type = SmartFormWidgetType.DATE_PICKER;
|
|
13953
|
-
}
|
|
13954
|
-
else if (type === FilterExpressionFieldWidgetType.DateTime) {
|
|
13955
|
-
type = SmartFormWidgetType.DATE_TIME_PICKER;
|
|
13956
|
-
}
|
|
13957
|
-
let widget = {
|
|
13958
|
-
key,
|
|
13959
|
-
label,
|
|
13960
|
-
type,
|
|
13961
|
-
value: '',
|
|
13962
|
-
showLabel: true,
|
|
13963
|
-
valueList: possibleValues.map((value) => {
|
|
13964
|
-
return {
|
|
13965
|
-
key: value.objectUri ? value.objectUri : value.code,
|
|
13966
|
-
label: value.displayValue,
|
|
13967
|
-
type: SmartFormWidgetType.ITEM,
|
|
13968
|
-
value: value.objectUri ? value.objectUri : value.code,
|
|
13969
|
-
};
|
|
13970
|
-
}),
|
|
13971
|
-
};
|
|
13972
|
-
return widget;
|
|
13973
|
-
}
|
|
13974
|
-
}
|
|
13975
|
-
SmartFilterEditorContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, deps: [{ token: SmartformLayoutDefinitionService }, { token: ComponentFactoryService }], target: i0.ɵɵFactoryTarget.Component });
|
|
13976
|
-
SmartFilterEditorContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SmartFilterEditorContentComponent, selector: "smart-filter-expression-editor", inputs: { service: "service" }, viewQueries: [{ propertyName: "formChildVcRef", first: true, predicate: ["form"], descendants: true, read: ViewContainerRef }, { propertyName: "simpleFilterFormVcRef", first: true, predicate: ["simpleFilterFromChild"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <ng-template #simpleFilterFromChild></ng-template>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <ng-template #form></ng-template>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"], components: [{ type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: ["uiActionModels", "uiActionDescriptorService"] }, { type: SmartFilterExpressionItemsComponent, selector: "app-expression-items", inputs: ["items"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
13977
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartFilterEditorContentComponent, decorators: [{
|
|
13978
|
-
type: Component,
|
|
13979
|
-
args: [{ selector: 'smart-filter-expression-editor', template: "<div class=\"targetGroupContentContainer\">\r\n <h3>{{ service.model?.model?.label }}</h3>\r\n\r\n <div *ngIf=\"service.model?.type === type.Simple; then simpleFilter; else complexFilter\"></div>\r\n\r\n <ng-template #simpleFilter>\r\n <div class=\"expressionsContainer\">\r\n <ng-template #simpleFilterFromChild></ng-template>\r\n </div>\r\n </ng-template>\r\n <ng-template #complexFilter>\r\n <div class=\"uiActionsBar\" *ngIf=\"!service.model?.readOnly\">\r\n <div class=\"uiActionsInsideOfBar\">\r\n <smart-ui-action-toolbar [uiActionModels]=\"uiActionModels\"></smart-ui-action-toolbar>\r\n </div>\r\n </div>\r\n <div\r\n *ngIf=\"\r\n service?.model?.model?.workplaceList?.filters?.length;\r\n then withParameters;\r\n else withoutParameters\r\n \"\r\n ></div>\r\n <ng-template #withoutParameters>\r\n <div class=\"withoutParametersContainer\">\r\n <span class=\"mat-body\"> M\u00E9g nincs megadva param\u00E9ter </span>\r\n </div>\r\n </ng-template>\r\n <ng-template #withParameters>\r\n <div class=\"withParametersContainer\">\r\n <div\r\n class=\"expressionsContainer\"\r\n *ngIf=\"service?.model?.model?.workplaceList?.filters?.length\"\r\n >\r\n <app-expression-items\r\n [items]=\"(service.model?.model?.workplaceList)!.filters\"\r\n ></app-expression-items>\r\n </div>\r\n <div class=\"expressionEditorContainer\">\r\n <ng-template #form></ng-template>\r\n <div *ngIf=\"smartForm\">\r\n <button (click)=\"remove()\" mat-raised-button color=\"primary\">T\u00F6rl\u00E9s</button>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".targetGroupContentContainer{padding:1.5rem;display:flex;flex-direction:column;gap:2.5rem;height:calc(100% - 3rem);overflow:auto;position:relative}.targetGroupContentContainer h3{margin:0;font-weight:600}.uiActionsBar{padding:1.5rem;border-radius:.25rem;background-color:var(--container-color)}.uiActionsBar,.uiActionsInsideOfBar{display:flex;flex-direction:row;gap:1rem}.uiActionsInsideOfBar{position:relative;left:-3rem}.section,.notSection{display:flex;flex-direction:row;gap:1rem}.section:before{content:\"\";border:1px solid #d9d9d9;align-self:stretch}.withoutParametersContainer{display:flex;flex-direction:column;padding:2rem;background-color:var(--container-color);border-radius:.25rem}.withoutParametersContainer .mat-body{font-weight:600;text-align:center}.withParametersContainer{display:flex;flex-direction:column;padding:1.5rem;background-color:var(--container-color);border-radius:.25rem;gap:.75rem}.expressionsContainer{display:flex;flex-direction:row;flex-wrap:wrap;gap:.75rem;margin-bottom:1px solid #cdcdcd}.expressionEditorContainer{display:flex;flex-direction:column;gap:.75rem}\n"] }]
|
|
13980
|
-
}], ctorParameters: function () { return [{ type: SmartformLayoutDefinitionService }, { type: ComponentFactoryService }]; }, propDecorators: { service: [{
|
|
13981
|
-
type: Input
|
|
13982
|
-
}], formChildVcRef: [{
|
|
13983
|
-
type: ViewChild,
|
|
13984
|
-
args: ['form', { read: ViewContainerRef }]
|
|
13985
|
-
}], simpleFilterFormVcRef: [{
|
|
13986
|
-
type: ViewChild,
|
|
13987
|
-
args: ['simpleFilterFromChild', { read: ViewContainerRef }]
|
|
13566
|
+
}], formChildren: [{
|
|
13567
|
+
type: ViewChildren,
|
|
13568
|
+
args: ['form']
|
|
13569
|
+
}], simpleFilterFormChildren: [{
|
|
13570
|
+
type: ViewChildren,
|
|
13571
|
+
args: ['simpleFilterFromChild']
|
|
13988
13572
|
}] } });
|
|
13989
13573
|
|
|
13990
13574
|
class SmartFilterEditorModule {
|
|
@@ -14164,63 +13748,418 @@ class SmartAuthService {
|
|
|
14164
13748
|
this._destroy$.next();
|
|
14165
13749
|
this._destroy$.complete();
|
|
14166
13750
|
}
|
|
14167
|
-
}
|
|
14168
|
-
SmartAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
14169
|
-
SmartAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService });
|
|
14170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SmartAuthService, decorators: [{
|
|
14171
|
-
type: Injectable
|
|
14172
|
-
}] });
|
|
14173
|
-
|
|
14174
|
-
/*
|
|
14175
|
-
* Public API Surface of smarttree
|
|
14176
|
-
*/
|
|
14177
|
-
|
|
14178
|
-
class SmartComponentLayoutUtility {
|
|
14179
|
-
static setParent(layout, parent) {
|
|
14180
|
-
var _a;
|
|
14181
|
-
layout.parentComponent = parent;
|
|
14182
|
-
(_a = layout.components) === null || _a === void 0 ? void 0 : _a.forEach((l) => this.setParent(l, parent));
|
|
13751
|
+
}
|
|
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
|
+
}] });
|
|
13757
|
+
|
|
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));
|
|
13767
|
+
}
|
|
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), []);
|
|
13774
|
+
}
|
|
13775
|
+
if (comp.smartFormComponent) {
|
|
13776
|
+
result.push(comp.smartFormComponent);
|
|
13777
|
+
}
|
|
13778
|
+
return result;
|
|
13779
|
+
}
|
|
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;
|
|
13791
|
+
}
|
|
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;
|
|
13802
|
+
}
|
|
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);
|
|
13816
|
+
}
|
|
13817
|
+
encodeValue(v) {
|
|
13818
|
+
return encodeURIComponent(v);
|
|
13819
|
+
}
|
|
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;
|
|
13847
|
+
}
|
|
13848
|
+
else {
|
|
13849
|
+
this.encodeParam = param => this.defaultEncodeParam(param);
|
|
13850
|
+
}
|
|
13851
|
+
if (configurationParameters.credentials) {
|
|
13852
|
+
this.credentials = configurationParameters.credentials;
|
|
13853
|
+
}
|
|
13854
|
+
else {
|
|
13855
|
+
this.credentials = {};
|
|
13856
|
+
}
|
|
13857
|
+
}
|
|
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;
|
|
13868
|
+
}
|
|
13869
|
+
const type = contentTypes.find((x) => this.isJsonMime(x));
|
|
13870
|
+
if (type === undefined) {
|
|
13871
|
+
return contentTypes[0];
|
|
13872
|
+
}
|
|
13873
|
+
return type;
|
|
13874
|
+
}
|
|
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;
|
|
13885
|
+
}
|
|
13886
|
+
const type = accepts.find((x) => this.isJsonMime(x));
|
|
13887
|
+
if (type === undefined) {
|
|
13888
|
+
return accepts[0];
|
|
13889
|
+
}
|
|
13890
|
+
return type;
|
|
13891
|
+
}
|
|
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');
|
|
13905
|
+
}
|
|
13906
|
+
lookupCredential(key) {
|
|
13907
|
+
const value = this.credentials[key];
|
|
13908
|
+
return typeof value === 'function'
|
|
13909
|
+
? value()
|
|
13910
|
+
: value;
|
|
13911
|
+
}
|
|
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));
|
|
13924
|
+
}
|
|
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;
|
|
14183
13967
|
}
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
result = comp.components
|
|
14188
|
-
.map((c) => this.getForms(c))
|
|
14189
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
13968
|
+
addToHttpParamsRecursive(httpParams, value, key) {
|
|
13969
|
+
if (value == null) {
|
|
13970
|
+
return httpParams;
|
|
14190
13971
|
}
|
|
14191
|
-
if (
|
|
14192
|
-
|
|
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
|
+
}
|
|
14193
13987
|
}
|
|
14194
|
-
|
|
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;
|
|
14195
13995
|
}
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
|
|
14199
|
-
result = comp.components
|
|
14200
|
-
.map((c) => this.getGrids(c))
|
|
14201
|
-
.reduce((acc, value) => acc.concat(value), []);
|
|
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.');
|
|
14202
13999
|
}
|
|
14203
|
-
if (
|
|
14204
|
-
|
|
14000
|
+
if (filterIdentifier === null || filterIdentifier === undefined) {
|
|
14001
|
+
throw new Error('Required parameter filterIdentifier was null or undefined when calling load.');
|
|
14205
14002
|
}
|
|
14206
|
-
|
|
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
|
|
14039
|
+
});
|
|
14207
14040
|
}
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
14211
|
-
if (comp.components) {
|
|
14212
|
-
result = (_a = comp.components) === null || _a === void 0 ? void 0 : _a.map((c) => this.getTrees(c)).reduce((acc, value) => acc.concat(value), []);
|
|
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.');
|
|
14213
14044
|
}
|
|
14214
|
-
if (
|
|
14215
|
-
|
|
14045
|
+
if (filterIdentifier === null || filterIdentifier === undefined) {
|
|
14046
|
+
throw new Error('Required parameter filterIdentifier was null or undefined when calling performWidgetAction.');
|
|
14216
14047
|
}
|
|
14217
|
-
|
|
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
|
+
});
|
|
14218
14097
|
}
|
|
14219
|
-
}
|
|
14098
|
+
}
|
|
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,
|
|
14103
|
+
args: [{
|
|
14104
|
+
providedIn: 'root'
|
|
14105
|
+
}]
|
|
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
|
+
} });
|
|
14220
14116
|
|
|
14221
|
-
|
|
14222
|
-
|
|
14223
|
-
|
|
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();
|
|
14123
|
+
}
|
|
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
|
+
});
|
|
14129
|
+
}
|
|
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
|
+
});
|
|
14137
|
+
}
|
|
14138
|
+
getModel() {
|
|
14139
|
+
return this.model;
|
|
14140
|
+
}
|
|
14141
|
+
performUiActionRequest(uiActionRequest, widgetId, nodeId) {
|
|
14142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14143
|
+
yield this.peformWidgetAction(uiActionRequest);
|
|
14144
|
+
});
|
|
14145
|
+
}
|
|
14146
|
+
handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
|
|
14147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14148
|
+
return {
|
|
14149
|
+
shouldPerformAction: true,
|
|
14150
|
+
uiActionRequest: uiActionRequest,
|
|
14151
|
+
};
|
|
14152
|
+
});
|
|
14153
|
+
}
|
|
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 }]; } });
|
|
14224
14163
|
|
|
14225
14164
|
let SmartComponentApiClient = class SmartComponentApiClient {
|
|
14226
14165
|
constructor(inject, auth, pageName) {
|