@progress/kendo-angular-buttons 7.0.5 → 7.0.7-dev.202204111624

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.
Files changed (38) hide show
  1. package/dist/cdn/js/kendo-angular-buttons.js +2 -2
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/button/button.directive.js +8 -8
  4. package/dist/es/buttongroup/buttongroup.component.js +7 -6
  5. package/dist/es/chip/chip.component.js +11 -19
  6. package/dist/es/dropdownbutton/dropdownbutton.component.js +10 -8
  7. package/dist/es/focusable/focusable.directive.js +5 -11
  8. package/dist/es/listbutton/list-button.js +16 -36
  9. package/dist/es/package-metadata.js +1 -1
  10. package/dist/es/splitbutton/splitbutton.component.js +5 -2
  11. package/dist/es2015/button/button.directive.d.ts +1 -2
  12. package/dist/es2015/button/button.directive.js +7 -7
  13. package/dist/es2015/buttongroup/buttongroup.component.d.ts +1 -2
  14. package/dist/es2015/buttongroup/buttongroup.component.js +6 -5
  15. package/dist/es2015/chip/chip.component.d.ts +1 -2
  16. package/dist/es2015/chip/chip.component.js +11 -19
  17. package/dist/es2015/dropdownbutton/dropdownbutton.component.d.ts +1 -0
  18. package/dist/es2015/dropdownbutton/dropdownbutton.component.js +10 -8
  19. package/dist/es2015/focusable/focusable.directive.d.ts +1 -2
  20. package/dist/es2015/focusable/focusable.directive.js +5 -11
  21. package/dist/es2015/index.metadata.json +1 -1
  22. package/dist/es2015/listbutton/list-button.d.ts +1 -11
  23. package/dist/es2015/listbutton/list-button.js +15 -35
  24. package/dist/es2015/package-metadata.js +1 -1
  25. package/dist/es2015/splitbutton/splitbutton.component.d.ts +1 -0
  26. package/dist/es2015/splitbutton/splitbutton.component.js +5 -2
  27. package/dist/fesm2015/index.js +55 -88
  28. package/dist/fesm5/index.js +58 -91
  29. package/dist/npm/button/button.directive.js +8 -8
  30. package/dist/npm/buttongroup/buttongroup.component.js +7 -6
  31. package/dist/npm/chip/chip.component.js +11 -19
  32. package/dist/npm/dropdownbutton/dropdownbutton.component.js +9 -7
  33. package/dist/npm/focusable/focusable.directive.js +5 -11
  34. package/dist/npm/listbutton/list-button.js +15 -35
  35. package/dist/npm/package-metadata.js +1 -1
  36. package/dist/npm/splitbutton/splitbutton.component.js +5 -2
  37. package/dist/systemjs/kendo-angular-buttons.js +1 -1
  38. package/package.json +1 -1
@@ -16,7 +16,7 @@ import { FocusService } from '../focusable/focus.service';
16
16
  import { NavigationService } from '../navigation/navigation.service';
17
17
  import { NAVIGATION_CONFIG } from '../navigation/navigation-config';
18
18
  import { PreventableEvent } from '../preventable-event';
19
- import { merge } from 'rxjs';
19
+ import { merge, Subscription } from 'rxjs';
20
20
  const NAVIGATION_SETTINGS = {
21
21
  useLeftRightArrows: true
22
22
  };
@@ -151,6 +151,7 @@ let DropDownButtonComponent = class DropDownButtonComponent extends ListButton {
151
151
  this.onBlur = new EventEmitter(); //tslint:disable-line:no-output-rename
152
152
  this.listId = guid();
153
153
  this._fillMode = 'solid';
154
+ this.popupSubs = new Subscription();
154
155
  this._itemClick = this.itemClick;
155
156
  this._blur = this.onBlur;
156
157
  }
@@ -402,11 +403,11 @@ let DropDownButtonComponent = class DropDownButtonComponent extends ListButton {
402
403
  || (this.popupRef && this.popupRef.popupElement.contains(element));
403
404
  }
404
405
  subscribeNavigationEvents() {
405
- this.navigationSubscription = this.navigationService.navigate
406
- .subscribe(this.onArrowKeyNavigate.bind(this));
407
- this.enterUpSubscription = this.navigationService.enterup.subscribe(this.onNavigationEnterUp.bind(this));
408
- this.openSubscription = this.navigationService.open.subscribe(this.onNavigationOpen.bind(this));
409
- this.closeSubscription = merge(this.navigationService.close, this.navigationService.esc).subscribe(this.onNavigationClose.bind(this));
406
+ this.subs.add(this.navigationService.navigate
407
+ .subscribe(this.onArrowKeyNavigate.bind(this)));
408
+ this.subs.add(this.navigationService.enterup.subscribe(this.onNavigationEnterUp.bind(this)));
409
+ this.subs.add(this.navigationService.open.subscribe(this.onNavigationOpen.bind(this)));
410
+ this.subs.add(merge(this.navigationService.close, this.navigationService.esc).subscribe(this.onNavigationClose.bind(this)));
410
411
  }
411
412
  onNavigationEnterUp() {
412
413
  if (!this._disabled && !this.openState) {
@@ -459,13 +460,14 @@ let DropDownButtonComponent = class DropDownButtonComponent extends ListButton {
459
460
  popupAlign: this.popupAlign,
460
461
  popupClass: this.popupClasses
461
462
  });
462
- this.popupRef.popupAnchorViewportLeave.subscribe(() => this.openState = false);
463
- this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this));
463
+ this.popupSubs.add(this.popupRef.popupAnchorViewportLeave.subscribe(() => this.openState = false));
464
+ this.popupSubs.add(this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this)));
464
465
  }
465
466
  destroyPopup() {
466
467
  if (this.popupRef) {
467
468
  this.popupRef.close();
468
469
  this.popupRef = null;
470
+ this.popupSubs.unsubscribe();
469
471
  }
470
472
  }
471
473
  };
@@ -12,7 +12,7 @@ export declare class FocusableDirective implements OnInit, OnDestroy {
12
12
  private renderer;
13
13
  index: number;
14
14
  private element;
15
- private focusSubscription;
15
+ private subs;
16
16
  constructor(focusService: FocusService, elementRef: ElementRef, renderer: Renderer2);
17
17
  ngOnInit(): void;
18
18
  /**
@@ -20,5 +20,4 @@ export declare class FocusableDirective implements OnInit, OnDestroy {
20
20
  */
21
21
  ngOnDestroy(): void;
22
22
  private subscribeEvents;
23
- private unsubscribeEvents;
24
23
  }
@@ -5,6 +5,7 @@
5
5
  import * as tslib_1 from "tslib";
6
6
  import { Directive, Input, ElementRef, Renderer2 } from '@angular/core';
7
7
  import { FocusService } from './focus.service';
8
+ import { Subscription } from 'rxjs';
8
9
  import { isDocumentAvailable } from '@progress/kendo-angular-common';
9
10
  /**
10
11
  * @hidden
@@ -13,6 +14,7 @@ let FocusableDirective = class FocusableDirective {
13
14
  constructor(focusService, elementRef, renderer) {
14
15
  this.focusService = focusService;
15
16
  this.renderer = renderer;
17
+ this.subs = new Subscription();
16
18
  this.element = elementRef.nativeElement;
17
19
  this.subscribeEvents();
18
20
  }
@@ -28,13 +30,13 @@ let FocusableDirective = class FocusableDirective {
28
30
  * @hidden
29
31
  */
30
32
  ngOnDestroy() {
31
- this.unsubscribeEvents();
33
+ this.subs.unsubscribe();
32
34
  }
33
35
  subscribeEvents() {
34
36
  if (!isDocumentAvailable()) {
35
37
  return;
36
38
  }
37
- this.focusSubscription = this.focusService.onFocus.subscribe((index) => {
39
+ this.subs.add(this.focusService.onFocus.subscribe((index) => {
38
40
  if (this.index === index) {
39
41
  this.renderer.addClass(this.element, 'k-focus');
40
42
  this.element.focus();
@@ -42,15 +44,7 @@ let FocusableDirective = class FocusableDirective {
42
44
  else {
43
45
  this.renderer.removeClass(this.element, 'k-focus');
44
46
  }
45
- });
46
- }
47
- unsubscribeEvents() {
48
- if (!isDocumentAvailable()) {
49
- return;
50
- }
51
- if (this.focusSubscription) {
52
- this.focusSubscription.unsubscribe();
53
- }
47
+ }));
54
48
  }
55
49
  };
56
50
  tslib_1.__decorate([