@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
@@ -30,14 +30,15 @@ var ListButton = /** @class */ (function () {
30
30
  this._popupSettings = { animate: true, popupClass: '' };
31
31
  this.listId = kendo_angular_common_1.guid();
32
32
  this._isFocused = false;
33
+ this.subs = new rxjs_1.Subscription();
33
34
  kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
34
35
  this.focusService = focusService;
35
36
  this.navigationService = navigationService;
36
37
  this.wrapper = wrapperRef.nativeElement;
37
- this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
38
+ this.subs.add(localization.changes.subscribe(function (_a) {
38
39
  var rtl = _a.rtl;
39
40
  return (_this.direction = rtl ? 'rtl' : 'ltr');
40
- });
41
+ }));
41
42
  this.subscribeEvents();
42
43
  }
43
44
  Object.defineProperty(ListButton.prototype, "popupClasses", {
@@ -83,12 +84,9 @@ var ListButton = /** @class */ (function () {
83
84
  };
84
85
  ListButton.prototype.ngOnDestroy = function () {
85
86
  this.openState = false;
86
- this.unsubscribeEvents();
87
87
  clearTimeout(this.focusFirstTimeout);
88
88
  clearTimeout(this.blurTimeout);
89
- if (this.localizationChangeSubscription) {
90
- this.localizationChangeSubscription.unsubscribe();
91
- }
89
+ this.subs.unsubscribe();
92
90
  };
93
91
  ListButton.prototype.subscribeEvents = function () {
94
92
  if (!kendo_angular_common_1.isDocumentAvailable()) {
@@ -100,27 +98,27 @@ var ListButton = /** @class */ (function () {
100
98
  };
101
99
  ListButton.prototype.subscribeListItemFocusEvent = function () {
102
100
  var _this = this;
103
- this.focusSubscription = this.focusService.onFocus.subscribe(function () {
101
+ this.subs.add(this.focusService.onFocus.subscribe(function () {
104
102
  _this._isFocused = true;
105
- });
103
+ }));
106
104
  };
107
105
  ListButton.prototype.subscribeComponentBlurredEvent = function () {
108
106
  var _this = this;
109
107
  this._zone.runOutsideAngular(function () {
110
- _this.tabSubscription = _this.navigationService.tab.pipe(operators_1.filter(function () { return _this._isFocused; })).subscribe(_this.handleTab.bind(_this));
111
- _this.componentBlurredSubscription = rxjs_1.fromEvent(document, 'click')
108
+ _this.subs.add(_this.navigationService.tab.pipe(operators_1.filter(function () { return _this._isFocused; })).subscribe(_this.handleTab.bind(_this)));
109
+ _this.subs.add(rxjs_1.fromEvent(document, 'click')
112
110
  .pipe(operators_1.filter(function (event) { return !_this.wrapperContains(event.target); }), operators_1.filter(function () { return _this._isFocused; }))
113
- .subscribe(function () { return _this._zone.run(function () { return _this.blurWrapper(); }); });
111
+ .subscribe(function () { return _this._zone.run(function () { return _this.blurWrapper(); }); }));
114
112
  });
115
113
  };
116
114
  ListButton.prototype.subscribeNavigationEvents = function () {
117
115
  var _this = this;
118
- this.navigationSubscription = this.navigationService.navigate.subscribe(this.focusService.focus.bind(this.focusService));
119
- this.enterUpSubscription = this.navigationService.enterup.subscribe(function () {
116
+ this.subs.add(this.navigationService.navigate.subscribe(this.focusService.focus.bind(this.focusService)));
117
+ this.subs.add(this.navigationService.enterup.subscribe(function () {
120
118
  _this.enterHandler();
121
119
  _this.focusWrapper();
122
- });
123
- this.openSubscription = this.navigationService.open.subscribe(function () {
120
+ }));
121
+ this.subs.add(this.navigationService.open.subscribe(function () {
124
122
  if (!_this._open) {
125
123
  _this.togglePopupVisibility();
126
124
  _this.focusFirstItem();
@@ -128,28 +126,10 @@ var ListButton = /** @class */ (function () {
128
126
  else {
129
127
  _this.focusWrapper();
130
128
  }
131
- });
132
- this.closeSubscription = rxjs_1.merge(this.navigationService.close, this.navigationService.esc).subscribe(function () { return _this.focusWrapper(); });
129
+ }));
130
+ this.subs.add(rxjs_1.merge(this.navigationService.close, this.navigationService.esc).subscribe(function () { return _this.focusWrapper(); }));
133
131
  };
134
132
  ListButton.prototype.enterHandler = function () { }; // tslint:disable-line
135
- ListButton.prototype.unsubscribeEvents = function () {
136
- if (!kendo_angular_common_1.isDocumentAvailable()) {
137
- return;
138
- }
139
- this.unsubscribe(this.componentBlurredSubscription);
140
- this.unsubscribe(this.focusSubscription);
141
- this.unsubscribe(this.navigationSubscription);
142
- this.unsubscribe(this.enterPressSubscription);
143
- this.unsubscribe(this.enterUpSubscription);
144
- this.unsubscribe(this.openSubscription);
145
- this.unsubscribe(this.closeSubscription);
146
- this.unsubscribe(this.tabSubscription);
147
- };
148
- ListButton.prototype.unsubscribe = function (subscription) {
149
- if (subscription) {
150
- subscription.unsubscribe();
151
- }
152
- };
153
133
  /**
154
134
  * @hidden
155
135
  */
@@ -11,7 +11,7 @@ exports.packageMetadata = {
11
11
  name: '@progress/kendo-angular-buttons',
12
12
  productName: 'Kendo UI for Angular',
13
13
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
14
- publishDate: 1648131806,
14
+ publishDate: 1649694226,
15
15
  version: '',
16
16
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
17
17
  };
@@ -19,6 +19,7 @@ var util_1 = require("./../util");
19
19
  var preventable_event_1 = require("../preventable-event");
20
20
  var kendo_angular_common_2 = require("@progress/kendo-angular-common");
21
21
  var util_2 = require("../util");
22
+ var rxjs_1 = require("rxjs");
22
23
  var NAVIGATION_SETTINGS = {
23
24
  useLeftRightArrows: true
24
25
  };
@@ -216,6 +217,7 @@ var SplitButtonComponent = /** @class */ (function (_super) {
216
217
  _this.lockFocus = false;
217
218
  _this._rounded = 'medium';
218
219
  _this._fillMode = "solid";
220
+ _this.popupSubs = new rxjs_1.Subscription();
219
221
  _this._itemClick = _this.itemClick;
220
222
  _this._blur = _this.onBlur;
221
223
  return _this;
@@ -631,11 +633,12 @@ var SplitButtonComponent = /** @class */ (function (_super) {
631
633
  popupAlign: this.popupAlign,
632
634
  popupClass: this.popupClasses
633
635
  });
634
- this.popupRef.popupAnchorViewportLeave.subscribe(function () { return (_this.openState = false); });
635
- this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this));
636
+ this.popupSubs.add(this.popupRef.popupAnchorViewportLeave.subscribe(function () { return (_this.openState = false); }));
637
+ this.popupSubs.add(this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this)));
636
638
  };
637
639
  SplitButtonComponent.prototype.destroyPopup = function () {
638
640
  if (this.popupRef) {
641
+ this.popupSubs.unsubscribe();
639
642
  this.popupRef.close();
640
643
  this.popupRef = null;
641
644
  }