@ts-core/angular 15.0.45 → 15.0.47

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