@ts-core/angular 15.0.45 → 15.0.46

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.
@@ -4011,17 +4011,21 @@ class RouterSelectListItems extends SelectListItems {
4011
4011
  //
4012
4012
  //--------------------------------------------------------------------------
4013
4013
  this.setData = () => {
4014
- this.selectedData = this.getRouterSelectedData();
4014
+ this.selectedItem = this.getRouterSelectedItem();
4015
4015
  };
4016
4016
  this.setFragment = (item) => {
4017
- this.router.setFragment(item.data.toString());
4017
+ let index = _.indexOf(this.collection, item);
4018
+ this.router.setFragment(index > 0 ? item.data.toString() : null);
4018
4019
  };
4019
- this.changed.pipe(takeUntil(this.destroyed)).subscribe(this.setFragment);
4020
- this.router.completed.pipe(takeUntil(this.destroyed)).subscribe(this.setData);
4020
+ this.changed
4021
+ .pipe(filter(() => !this.isDisabled), takeUntil(this.destroyed))
4022
+ .subscribe(this.setFragment);
4023
+ this.router.completed
4024
+ .pipe(filter(() => !this.isDisabled), takeUntil(this.destroyed))
4025
+ .subscribe(this.setData);
4021
4026
  }
4022
- getRouterSelectedData() {
4023
- let item = _.find(this.collection, { data: this.router.getFragment() });
4024
- return !_.isNil(item) ? item.data : null;
4027
+ getRouterSelectedItem() {
4028
+ return _.find(this.collection, { data: this.router.getFragment() });
4025
4029
  }
4026
4030
  //--------------------------------------------------------------------------
4027
4031
  //
@@ -4029,8 +4033,8 @@ class RouterSelectListItems extends SelectListItems {
4029
4033
  //
4030
4034
  //--------------------------------------------------------------------------
4031
4035
  complete() {
4032
- let item = this.getRouterSelectedData();
4033
- super.complete(_.isNil(item) ? 0 : item);
4036
+ let item = this.getRouterSelectedItem();
4037
+ super.complete(!_.isNil(item) ? item.data : 0);
4034
4038
  }
4035
4039
  destroy() {
4036
4040
  if (this.isDestroyed) {