@smartbit4all/ng-client 3.1.71 → 3.1.72

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.
@@ -13032,30 +13032,40 @@ class SmartFilterEditorContentComponent {
13032
13032
  this.expressionUiActionModels = [];
13033
13033
  this.type = FilterExpressionBuilderUiModel.TypeEnum;
13034
13034
  }
13035
- ngAfterViewInit() {
13036
- if (this.smartFilterChild) {
13037
- this.smartFilterChild.service.change.pipe(takeUntil(this._destroy$)).subscribe(() => {
13038
- this.saveFilter();
13039
- });
13040
- }
13041
- if (this.formChild) {
13042
- this.formChild.onBlurSubject?.pipe(takeUntil(this._destroy$)).subscribe(() => {
13043
- this.save();
13044
- });
13045
- }
13046
- }
13047
13035
  ngOnInit() {
13048
13036
  this.service.load();
13037
+ this.initChildComponents();
13049
13038
  this.service.modelChanged.pipe(takeUntil(this._destroy$)).subscribe(() => {
13050
- this.setUp();
13039
+ this.bindChildComps();
13051
13040
  });
13052
13041
  }
13053
13042
  ngOnDestroy() {
13054
13043
  this._destroy$.next();
13055
13044
  this._destroy$.complete();
13056
13045
  }
13057
- setupSimpleFilter() { }
13058
- setUp() {
13046
+ initChildComponents() {
13047
+ if (this.service.model?.type === this.type.Simple) {
13048
+ this.simpleFilterModel = {
13049
+ data: [],
13050
+ type: SmartFilterType.SIMPLE,
13051
+ };
13052
+ this.smartFilterChild.service.change.pipe(takeUntil(this._destroy$)).subscribe(() => {
13053
+ this.saveFilter();
13054
+ });
13055
+ }
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
+ }
13068
+ bindChildComps() {
13059
13069
  if (this.service.model?.type === this.type.Simple) {
13060
13070
  this.simpleFilterModel = {
13061
13071
  data: this.service.model.model.workplaceList.filters,
@@ -13067,9 +13077,6 @@ class SmartFilterEditorContentComponent {
13067
13077
  if (this.service.model.selectedFieldEditor) {
13068
13078
  this.constructForm();
13069
13079
  }
13070
- else {
13071
- this.smartForm = undefined;
13072
- }
13073
13080
  }
13074
13081
  }
13075
13082
  constructUiActionModels() {