@progress/kendo-angular-buttons 8.0.0-next.202204011456 → 8.0.0-next.202204131126

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 (35) hide show
  1. package/bundles/kendo-angular-buttons.umd.js +1 -1
  2. package/button/button.directive.d.ts +30 -43
  3. package/buttongroup/buttongroup.component.d.ts +1 -2
  4. package/chip/chip-list.component.d.ts +1 -1
  5. package/chip/chip.component.d.ts +19 -20
  6. package/common/models/fillmode.d.ts +2 -2
  7. package/common/models/rounded.d.ts +2 -2
  8. package/common/models/size.d.ts +2 -2
  9. package/common/models/theme-color.d.ts +2 -2
  10. package/common/models.d.ts +0 -1
  11. package/dropdownbutton/dropdownbutton.component.d.ts +14 -25
  12. package/esm2015/button/button.directive.js +55 -65
  13. package/esm2015/buttongroup/buttongroup.component.js +6 -5
  14. package/esm2015/chip/chip-list.component.js +4 -3
  15. package/esm2015/chip/chip.component.js +47 -47
  16. package/esm2015/common/models.js +0 -1
  17. package/esm2015/dropdownbutton/dropdownbutton.component.js +25 -36
  18. package/esm2015/floatingactionbutton/dial-item.component.js +1 -0
  19. package/esm2015/floatingactionbutton/dial-list.component.js +1 -0
  20. package/esm2015/floatingactionbutton/floatingactionbutton.component.js +55 -52
  21. package/esm2015/focusable/focusable.directive.js +5 -11
  22. package/esm2015/listbutton/list-button.js +15 -35
  23. package/esm2015/package-metadata.js +1 -1
  24. package/esm2015/splitbutton/localization/messages.js +1 -0
  25. package/esm2015/splitbutton/splitbutton.component.js +27 -19
  26. package/esm2015/util.js +4 -4
  27. package/fesm2015/kendo-angular-buttons.js +240 -276
  28. package/floatingactionbutton/floatingactionbutton.component.d.ts +22 -35
  29. package/focusable/focusable.directive.d.ts +1 -2
  30. package/listbutton/list-button.d.ts +1 -11
  31. package/main.d.ts +0 -1
  32. package/package.json +4 -4
  33. package/splitbutton/splitbutton.component.d.ts +11 -9
  34. package/common/models/shape.d.ts +0 -11
  35. package/esm2015/common/models/shape.js +0 -5
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { Component } from '@angular/core';
6
6
  /* eslint-disable import/no-deprecated */
7
- import { fromEvent, merge } from 'rxjs';
7
+ import { Subscription, fromEvent, merge } from 'rxjs';
8
8
  import { filter } from 'rxjs/operators';
9
9
  import { KeyEvents } from './../navigation/key-events';
10
10
  import { NavigationAction } from './../navigation/navigation-action';
@@ -32,11 +32,12 @@ export class ListButton {
32
32
  this._popupSettings = { animate: true, popupClass: '' };
33
33
  this.listId = guid();
34
34
  this._isFocused = false;
35
+ this.subs = new Subscription();
35
36
  validatePackage(packageMetadata);
36
37
  this.focusService = focusService;
37
38
  this.navigationService = navigationService;
38
39
  this.wrapper = wrapperRef.nativeElement;
39
- this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr'));
40
+ this.subs.add(localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr')));
40
41
  this.subscribeEvents();
41
42
  }
42
43
  get popupClasses() {
@@ -73,12 +74,9 @@ export class ListButton {
73
74
  }
74
75
  ngOnDestroy() {
75
76
  this.openState = false;
76
- this.unsubscribeEvents();
77
77
  clearTimeout(this.focusFirstTimeout);
78
78
  clearTimeout(this.blurTimeout);
79
- if (this.localizationChangeSubscription) {
80
- this.localizationChangeSubscription.unsubscribe();
81
- }
79
+ this.subs.unsubscribe();
82
80
  }
83
81
  subscribeEvents() {
84
82
  if (!isDocumentAvailable()) {
@@ -89,25 +87,25 @@ export class ListButton {
89
87
  this.subscribeNavigationEvents();
90
88
  }
91
89
  subscribeListItemFocusEvent() {
92
- this.focusSubscription = this.focusService.onFocus.subscribe(() => {
90
+ this.subs.add(this.focusService.onFocus.subscribe(() => {
93
91
  this._isFocused = true;
94
- });
92
+ }));
95
93
  }
96
94
  subscribeComponentBlurredEvent() {
97
95
  this._zone.runOutsideAngular(() => {
98
- this.tabSubscription = this.navigationService.tab.pipe(filter(() => this._isFocused)).subscribe(this.handleTab.bind(this));
99
- this.componentBlurredSubscription = fromEvent(document, 'click')
96
+ this.subs.add(this.navigationService.tab.pipe(filter(() => this._isFocused)).subscribe(this.handleTab.bind(this)));
97
+ this.subs.add(fromEvent(document, 'click')
100
98
  .pipe(filter((event) => !this.wrapperContains(event.target)), filter(() => this._isFocused))
101
- .subscribe(() => this._zone.run(() => this.blurWrapper()));
99
+ .subscribe(() => this._zone.run(() => this.blurWrapper())));
102
100
  });
103
101
  }
104
102
  subscribeNavigationEvents() {
105
- this.navigationSubscription = this.navigationService.navigate.subscribe(this.focusService.focus.bind(this.focusService));
106
- this.enterUpSubscription = this.navigationService.enterup.subscribe(() => {
103
+ this.subs.add(this.navigationService.navigate.subscribe(this.focusService.focus.bind(this.focusService)));
104
+ this.subs.add(this.navigationService.enterup.subscribe(() => {
107
105
  this.enterHandler();
108
106
  this.focusWrapper();
109
- });
110
- this.openSubscription = this.navigationService.open.subscribe(() => {
107
+ }));
108
+ this.subs.add(this.navigationService.open.subscribe(() => {
111
109
  if (!this._open) {
112
110
  this.togglePopupVisibility();
113
111
  this.focusFirstItem();
@@ -115,28 +113,10 @@ export class ListButton {
115
113
  else {
116
114
  this.focusWrapper();
117
115
  }
118
- });
119
- this.closeSubscription = merge(this.navigationService.close, this.navigationService.esc).subscribe(() => this.focusWrapper());
116
+ }));
117
+ this.subs.add(merge(this.navigationService.close, this.navigationService.esc).subscribe(() => this.focusWrapper()));
120
118
  }
121
119
  enterHandler() { } // eslint-disable-line
122
- unsubscribeEvents() {
123
- if (!isDocumentAvailable()) {
124
- return;
125
- }
126
- this.unsubscribe(this.componentBlurredSubscription);
127
- this.unsubscribe(this.focusSubscription);
128
- this.unsubscribe(this.navigationSubscription);
129
- this.unsubscribe(this.enterPressSubscription);
130
- this.unsubscribe(this.enterUpSubscription);
131
- this.unsubscribe(this.openSubscription);
132
- this.unsubscribe(this.closeSubscription);
133
- this.unsubscribe(this.tabSubscription);
134
- }
135
- unsubscribe(subscription) {
136
- if (subscription) {
137
- subscription.unsubscribe();
138
- }
139
- }
140
120
  /**
141
121
  * @hidden
142
122
  */
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-buttons',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1648824909,
12
+ publishDate: 1649849126,
13
13
  version: '',
14
14
  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'
15
15
  };
@@ -15,6 +15,7 @@ Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.
15
15
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, decorators: [{
16
16
  type: Directive,
17
17
  args: [{
18
+ // eslint-disable-next-line @angular-eslint/directive-selector
18
19
  selector: 'kendo-splitbutton-messages-base'
19
20
  }]
20
21
  }], propDecorators: { splitButtonLabel: [{
@@ -14,6 +14,7 @@ import { isPresent, tick } from './../util';
14
14
  import { PreventableEvent } from '../preventable-event';
15
15
  import { Keys } from '@progress/kendo-angular-common';
16
16
  import { replaceMessagePlaceholder, getStylingClasses } from '../util';
17
+ import { Subscription } from 'rxjs';
17
18
  import * as i0 from "@angular/core";
18
19
  import * as i1 from "./../focusable/focus.service";
19
20
  import * as i2 from "./../navigation/navigation.service";
@@ -30,6 +31,8 @@ const NAVIGATION_SETTINGS_PROVIDER = {
30
31
  provide: NAVIGATION_CONFIG,
31
32
  useValue: NAVIGATION_SETTINGS
32
33
  };
34
+ const DEFAULT_ROUNDED = 'medium';
35
+ const DEFAULT_FILL_MODE = 'solid';
33
36
  /**
34
37
  * Represents the Kendo UI SplitButton component for Angular.
35
38
  *
@@ -106,10 +109,10 @@ export class SplitButtonComponent extends ListButton {
106
109
  * ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-size)).
107
110
  *
108
111
  * The possible values are:
109
- * * `'small'`
110
- * * `'medium'` (default)
111
- * * `'large'`
112
- * * `null`
112
+ * * `small`
113
+ * * `medium` (default)
114
+ * * `large`
115
+ * * `none`
113
116
  */
114
117
  this.size = 'medium';
115
118
  /**
@@ -129,6 +132,7 @@ export class SplitButtonComponent extends ListButton {
129
132
  * * `dark`— Applies coloring based on the `dark` theme color.
130
133
  * * `light`— Applies coloring based on the `light` theme color.
131
134
  * * `inverse`— Applies coloring based on the `inverse` theme color.
135
+ * * `none`— Removes the built in theme color.
132
136
  */
133
137
  this.themeColor = 'base';
134
138
  /**
@@ -215,8 +219,9 @@ export class SplitButtonComponent extends ListButton {
215
219
  this.listId = guid();
216
220
  this.buttonText = '';
217
221
  this.lockFocus = false;
218
- this._rounded = 'medium';
219
- this._fillMode = "solid";
222
+ this._rounded = DEFAULT_ROUNDED;
223
+ this._fillMode = DEFAULT_FILL_MODE;
224
+ this.popupSubs = new Subscription();
220
225
  this._itemClick = this.itemClick;
221
226
  this._blur = this.onBlur;
222
227
  }
@@ -225,15 +230,16 @@ export class SplitButtonComponent extends ListButton {
225
230
  * ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
226
231
  *
227
232
  * The possible values are:
228
- * * `'small'`
229
- * * `'medium'` (default)
230
- * * `'large'`
231
- * * `'full'`
232
- * * `null`
233
+ * * `small`
234
+ * * `medium` (default)
235
+ * * `large`
236
+ * * `full`
237
+ * * `none`
233
238
  */
234
239
  set rounded(rounded) {
235
- this.handleClasses(rounded, 'rounded');
236
- this._rounded = rounded;
240
+ const newRounded = rounded ? rounded : DEFAULT_ROUNDED;
241
+ this.handleClasses(newRounded, 'rounded');
242
+ this._rounded = newRounded;
237
243
  }
238
244
  get rounded() {
239
245
  return this._rounded;
@@ -249,7 +255,8 @@ export class SplitButtonComponent extends ListButton {
249
255
  * * `link`
250
256
  */
251
257
  set fillMode(fillMode) {
252
- this._fillMode = fillMode === 'clear' ? 'flat' : fillMode;
258
+ const newFillMode = fillMode ? fillMode : DEFAULT_FILL_MODE;
259
+ this._fillMode = fillMode === 'clear' ? 'flat' : newFillMode;
253
260
  }
254
261
  get fillMode() {
255
262
  return this._fillMode;
@@ -564,11 +571,12 @@ export class SplitButtonComponent extends ListButton {
564
571
  popupAlign: this.popupAlign,
565
572
  popupClass: this.popupClasses
566
573
  });
567
- this.popupRef.popupAnchorViewportLeave.subscribe(() => (this.openState = false));
568
- this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this));
574
+ this.popupSubs.add(this.popupRef.popupAnchorViewportLeave.subscribe(() => (this.openState = false)));
575
+ this.popupSubs.add(this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this)));
569
576
  }
570
577
  destroyPopup() {
571
578
  if (this.popupRef) {
579
+ this.popupSubs.unsubscribe();
572
580
  this.popupRef.close();
573
581
  this.popupRef = null;
574
582
  }
@@ -639,7 +647,7 @@ SplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
639
647
  [size]="size"
640
648
  [rounded]="rounded"
641
649
  [fillMode]="fillMode"
642
- [themeColor]="fillMode ? themeColor : null"
650
+ [themeColor]="themeColor"
643
651
  [tabindex]="-1"
644
652
  (click)="onArrowButtonClick()"
645
653
  (mousedown)="toggleArrowButtonActiveState(true)"
@@ -661,7 +669,7 @@ SplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
661
669
  </kendo-button-list>
662
670
  </ng-template>
663
671
  <ng-container #container></ng-container>
664
- `, isInline: true, components: [{ type: i5.ListComponent, selector: "kendo-button-list", inputs: ["data", "textField", "itemTemplate", "size"], outputs: ["onItemClick", "onItemBlur"] }], directives: [{ type: i6.LocalizedSplitButtonMessagesDirective, selector: "[kendoSplitButtonLocalizedMessages]" }, { type: i7.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "shape", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
672
+ `, isInline: true, components: [{ type: i5.ListComponent, selector: "kendo-button-list", inputs: ["data", "textField", "itemTemplate", "size"], outputs: ["onItemClick", "onItemBlur"] }], directives: [{ type: i6.LocalizedSplitButtonMessagesDirective, selector: "[kendoSplitButtonLocalizedMessages]" }, { type: i7.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
665
673
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SplitButtonComponent, decorators: [{
666
674
  type: Component,
667
675
  args: [{
@@ -722,7 +730,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
722
730
  [size]="size"
723
731
  [rounded]="rounded"
724
732
  [fillMode]="fillMode"
725
- [themeColor]="fillMode ? themeColor : null"
733
+ [themeColor]="themeColor"
726
734
  [tabindex]="-1"
727
735
  (click)="onArrowButtonClick()"
728
736
  (mousedown)="toggleArrowButtonActiveState(true)"
package/esm2015/util.js CHANGED
@@ -67,17 +67,17 @@ export const getStylingClasses = (componentType, stylingOption, previousValue, n
67
67
  case 'size':
68
68
  return {
69
69
  toRemove: `k-${componentType}-${SIZES[previousValue]}`,
70
- toAdd: newValue ? `k-${componentType}-${SIZES[newValue]}` : null
70
+ toAdd: newValue !== 'none' ? `k-${componentType}-${SIZES[newValue]}` : ''
71
71
  };
72
72
  case 'rounded':
73
73
  return {
74
74
  toRemove: `k-rounded-${ROUNDNESS[previousValue]}`,
75
- toAdd: newValue ? `k-rounded-${ROUNDNESS[newValue]}` : null
75
+ toAdd: newValue !== 'none' ? `k-rounded-${ROUNDNESS[newValue]}` : ''
76
76
  };
77
77
  case 'fillMode':
78
78
  return {
79
79
  toRemove: `k-${componentType}-${previousValue}`,
80
- toAdd: newValue ? `k-${componentType}-${newValue}` : null
80
+ toAdd: newValue !== 'none' ? `k-${componentType}-${newValue}` : ''
81
81
  };
82
82
  default:
83
83
  break;
@@ -91,7 +91,7 @@ export const getStylingClasses = (componentType, stylingOption, previousValue, n
91
91
  export const getThemeColorClasses = (componentType, prevFillMode, fillMode, previousValue, newValue) => {
92
92
  return {
93
93
  toRemove: `k-${componentType}-${prevFillMode}-${previousValue}`,
94
- toAdd: newValue ? `k-${componentType}-${fillMode}-${newValue}` : null
94
+ toAdd: newValue !== 'none' ? `k-${componentType}-${fillMode}-${newValue}` : ''
95
95
  };
96
96
  };
97
97
  /**