@trudb/tru-common-lib 0.0.420 → 0.0.422

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.
@@ -460,6 +460,7 @@ class TruSearchViewBase {
460
460
  this.isSearching = false;
461
461
  this.entities = [];
462
462
  this.hasDetailView = true;
463
+ this.subs = [];
463
464
  this.searchPanelConfig = {
464
465
  side: 'right',
465
466
  active: true,
@@ -468,8 +469,6 @@ class TruSearchViewBase {
468
469
  size: 500,
469
470
  pinned: false
470
471
  };
471
- this.setWindowTitle = () => {
472
- };
473
472
  this.onPkeyCellDoubleClicked = (gridConfig) => {
474
473
  if (this.hasDetailView) {
475
474
  var truWindowAddViewEventArgs = new TruWindowAddViewEventArgs();
@@ -484,10 +483,6 @@ class TruSearchViewBase {
484
483
  alert(this.tablePluralLabel + ' does not have a detail view.');
485
484
  }
486
485
  };
487
- this.view.onActive().subscribe((active) => {
488
- if (active)
489
- this.windowConfig.title = this.desktopManager.getUniqueTitle(this.tablePluralLabel);
490
- });
491
486
  }
492
487
  ngOnInit() {
493
488
  this.tableName = this.view.window.tableName;
@@ -497,7 +492,13 @@ class TruSearchViewBase {
497
492
  this.windowTitle = this.desktopManager.getUniqueTitle(this.tablePluralLabel);
498
493
  this.windowConfig = this.view.window;
499
494
  this.contextFilters = this.view.window.globals;
500
- this.setWindowTitle();
495
+ this.subs.push(this.view.onActive().subscribe((active) => {
496
+ if (active)
497
+ this.view.window.title = this.desktopManager.getUniqueTitle(this.tablePluralLabel);
498
+ }));
499
+ }
500
+ ngOnDestroy() {
501
+ this.subs.forEach(s => s.unsubscribe());
501
502
  }
502
503
  }
503
504
  TruSearchViewBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.1", ngImport: i0, type: TruSearchViewBase, deps: [{ token: TruDesktopManager }, { token: TruWindowEventHandler }], target: i0.ɵɵFactoryTarget.Component });
@@ -2809,7 +2810,7 @@ class WindowConfig {
2809
2810
  */
2810
2811
  class ViewConfig {
2811
2812
  constructor() {
2812
- this.active$ = new Subject();
2813
+ this.active$ = new BehaviorSubject(true);
2813
2814
  this.entities = undefined;
2814
2815
  this.entityIndex = 0;
2815
2816
  this.isDirty = false;
@@ -3103,7 +3104,7 @@ class TruDesktopWindow {
3103
3104
  return;
3104
3105
  var length = this.window.views.length;
3105
3106
  this.disablePrevious = !!(this.window.views[0].active$.getValue() || length === 1);
3106
- this.disableNext = !!(this.window.views[length - 1].onActive.getValue() || length === 1);
3107
+ this.disableNext = !!(this.window.views[length - 1].active$.getValue() || length === 1);
3107
3108
  };
3108
3109
  /**
3109
3110
  * @tru.doc function