@smartbit4all/ng-client 3.1.73 → 3.1.74
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/smart-filter-editor-content.component.mjs +26 -28
- package/fesm2015/smartbit4all-ng-client.mjs +22 -28
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +24 -26
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-filter-editor/smart-filter-editor-content/smart-filter-editor-content.component.d.ts +10 -7
- package/package.json +1 -1
- package/smartbit4all-ng-client-3.1.74.tgz +0 -0
- package/smartbit4all-ng-client-3.1.73.tgz +0 -0
|
@@ -13034,49 +13034,39 @@ class SmartFilterEditorContentComponent {
|
|
|
13034
13034
|
}
|
|
13035
13035
|
ngOnInit() {
|
|
13036
13036
|
this.service.load();
|
|
13037
|
-
this.initChildComponents();
|
|
13038
13037
|
this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13039
|
-
this.
|
|
13038
|
+
this.setUp();
|
|
13040
13039
|
});
|
|
13041
13040
|
}
|
|
13042
13041
|
ngOnDestroy() {
|
|
13043
13042
|
this._destroy$.next();
|
|
13044
13043
|
this._destroy$.complete();
|
|
13045
13044
|
}
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
this.
|
|
13049
|
-
|
|
13050
|
-
|
|
13051
|
-
|
|
13052
|
-
this.smartFilterChild
|
|
13045
|
+
setupSimpleFilter() {
|
|
13046
|
+
this.simpleFilterModel = {
|
|
13047
|
+
data: this.service.model.model.workplaceList.filters,
|
|
13048
|
+
type: SmartFilterType.SIMPLE,
|
|
13049
|
+
};
|
|
13050
|
+
if (!this.smartFilterChangeSubscription) {
|
|
13051
|
+
this.smartFilterChangeSubscription = this.smartFilterChild?.service.change
|
|
13052
|
+
.pipe(takeUntil(this._destroy$))
|
|
13053
|
+
.subscribe(() => {
|
|
13053
13054
|
this.saveFilter();
|
|
13054
13055
|
});
|
|
13055
13056
|
}
|
|
13056
|
-
else {
|
|
13057
|
-
this.smartForm = {
|
|
13058
|
-
direction: SmartFormWidgetDirection.ROW,
|
|
13059
|
-
useOnBlurEvent: true,
|
|
13060
|
-
componentModel: { data: this.service.model?.selectedField },
|
|
13061
|
-
widgets: [],
|
|
13062
|
-
};
|
|
13063
|
-
this.formChild.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
|
|
13064
|
-
this.save();
|
|
13065
|
-
});
|
|
13066
|
-
}
|
|
13067
13057
|
}
|
|
13068
|
-
|
|
13058
|
+
setUp() {
|
|
13069
13059
|
if (this.service.model?.type === this.type.Simple) {
|
|
13070
|
-
this.
|
|
13071
|
-
data: this.service.model.model.workplaceList.filters,
|
|
13072
|
-
type: SmartFilterType.SIMPLE,
|
|
13073
|
-
};
|
|
13060
|
+
this.setupSimpleFilter();
|
|
13074
13061
|
}
|
|
13075
13062
|
else {
|
|
13076
13063
|
this.constructUiActionModels();
|
|
13077
13064
|
if (this.service.model.selectedFieldEditor) {
|
|
13078
13065
|
this.constructForm();
|
|
13079
13066
|
}
|
|
13067
|
+
else {
|
|
13068
|
+
this.smartForm = undefined;
|
|
13069
|
+
}
|
|
13080
13070
|
}
|
|
13081
13071
|
}
|
|
13082
13072
|
constructUiActionModels() {
|
|
@@ -13108,12 +13098,20 @@ class SmartFilterEditorContentComponent {
|
|
|
13108
13098
|
let generatedWidgets = this.layoutService.render({
|
|
13109
13099
|
layoutDefinitions: this.service.model?.selectedFieldEditor?.layoutDef?.widgets,
|
|
13110
13100
|
});
|
|
13111
|
-
this.
|
|
13101
|
+
this.smartForm = {
|
|
13112
13102
|
direction: SmartFormWidgetDirection.ROW,
|
|
13113
13103
|
useOnBlurEvent: true,
|
|
13114
13104
|
componentModel: { data: this.service.model?.selectedField },
|
|
13115
13105
|
widgets: generatedWidgets,
|
|
13116
13106
|
};
|
|
13107
|
+
if (this.smartformChangeSubscription) {
|
|
13108
|
+
this.smartformChangeSubscription.unsubscribe();
|
|
13109
|
+
}
|
|
13110
|
+
this.smartformChangeSubscription = this.formChild?.onBlurSubject
|
|
13111
|
+
?.pipe(takeUntil(this._destroy$))
|
|
13112
|
+
.subscribe(() => {
|
|
13113
|
+
this.save();
|
|
13114
|
+
});
|
|
13117
13115
|
}
|
|
13118
13116
|
save() {
|
|
13119
13117
|
this.formChild?.submitForm(false);
|