@elderbyte/ngx-starter 20.9.0 → 20.9.1

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.
@@ -16816,14 +16816,7 @@ class ElderTableRowDirective {
16816
16816
  this.entity$ = toObservable(this.entity);
16817
16817
  if (activationModel) {
16818
16818
  this.enableRowFocus(true);
16819
- this.activationModel.itemActivationEvents.subscribe({
16820
- next: (event) => this.handleActivationEvent(event),
16821
- });
16822
16819
  }
16823
- effect(() => {
16824
- const entity = this.entity();
16825
- this.updateRowActivation();
16826
- });
16827
16820
  }
16828
16821
  /***************************************************************************
16829
16822
  * *
@@ -16832,6 +16825,18 @@ class ElderTableRowDirective {
16832
16825
  **************************************************************************/
16833
16826
  ngOnInit() {
16834
16827
  this.bindHighlightSelection();
16828
+ if (this.activationModel) {
16829
+ // Delay subscription to ngOnInit to ensure that the entity input is available.
16830
+ this.activationModel.itemActivationEvents
16831
+ .pipe(takeUntilDestroyed(this.destroyRef))
16832
+ .subscribe({
16833
+ next: (event) => this.handleActivationEvent(event, this.entity()),
16834
+ });
16835
+ }
16836
+ // Delay subscription to ngOnInit to ensure that the entity input is available.
16837
+ this.entity$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({
16838
+ next: (entity) => this.updateRowActivation(entity),
16839
+ });
16835
16840
  }
16836
16841
  bindHighlightSelection() {
16837
16842
  this.highlightSelection$
@@ -16904,34 +16909,33 @@ class ElderTableRowDirective {
16904
16909
  * Private methods *
16905
16910
  * *
16906
16911
  **************************************************************************/
16907
- handleActivationEvent(event) {
16908
- const activated = this.updateRowActivation();
16912
+ handleActivationEvent(event, entity) {
16913
+ const activated = this.updateRowActivation(entity);
16909
16914
  if (activated) {
16910
16915
  if (!this.hasFocus) {
16911
16916
  this.bringToView();
16912
16917
  }
16913
16918
  }
16914
16919
  if (event.focus) {
16915
- if (this.isItemActive()) {
16920
+ if (this.isItemActive(entity)) {
16916
16921
  this.focus();
16917
16922
  }
16918
16923
  }
16919
16924
  }
16920
- isItemActive() {
16925
+ isItemActive(entity) {
16921
16926
  if (this.activationModel) {
16922
- const entity = untracked(this.entity);
16923
16927
  if (entity) {
16924
16928
  return this.activationModel.isItemActive(entity);
16925
16929
  }
16926
16930
  }
16927
16931
  return false;
16928
16932
  }
16929
- updateRowActivation() {
16930
- if (this.isItemActive()) {
16933
+ updateRowActivation(entity) {
16934
+ if (this.isItemActive(entity)) {
16931
16935
  if (!this.activated) {
16932
16936
  this.activated = true;
16933
16937
  this.logger.debug('Activated row: ', {
16934
- entity: untracked(this.entity),
16938
+ entity: entity,
16935
16939
  activeItem: this.activationModel.activeItem,
16936
16940
  row: this,
16937
16941
  });