@progress/kendo-angular-buttons 6.4.0 → 7.0.0-dev.202201101733

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 (82) 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 +239 -89
  4. package/dist/es/button/button.service.js +1 -5
  5. package/dist/es/buttongroup/buttongroup.component.js +1 -53
  6. package/dist/es/chip/chip-list.component.js +54 -7
  7. package/dist/es/chip/chip.component.js +175 -86
  8. package/dist/es/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
  9. package/dist/es/{chip/models/type.js → common/models/rounded.js} +0 -0
  10. package/dist/{es2015/button-look.js → es/common/models/styling-classes.js} +0 -0
  11. package/dist/es/{button-look.js → common/models.js} +0 -0
  12. package/dist/es/dropdownbutton/dropdownbutton.component.js +74 -33
  13. package/dist/es/floatingactionbutton/dial-item.component.js +1 -1
  14. package/dist/es/floatingactionbutton/floatingactionbutton.component.js +66 -41
  15. package/dist/es/focusable/focusable.directive.js +4 -4
  16. package/dist/es/listbutton/list-button.js +1 -1
  17. package/dist/es/listbutton/list.component.js +20 -1
  18. package/dist/es/package-metadata.js +1 -1
  19. package/dist/es/splitbutton/splitbutton.component.js +91 -33
  20. package/dist/es/util.js +52 -0
  21. package/dist/es2015/button/button.directive.d.ts +85 -22
  22. package/dist/es2015/button/button.directive.js +222 -85
  23. package/dist/es2015/button/button.service.d.ts +1 -4
  24. package/dist/es2015/button/button.service.js +1 -5
  25. package/dist/es2015/buttongroup/buttongroup.component.d.ts +0 -15
  26. package/dist/es2015/buttongroup/buttongroup.component.js +1 -41
  27. package/dist/es2015/chip/chip-list.component.d.ts +19 -3
  28. package/dist/es2015/chip/chip-list.component.js +49 -7
  29. package/dist/es2015/chip/chip.component.d.ts +67 -32
  30. package/dist/es2015/chip/chip.component.js +186 -97
  31. package/dist/es2015/common/models/fillmode.d.ts +12 -0
  32. package/dist/es2015/{chip/models/type.js → common/models/fillmode.js} +0 -0
  33. package/dist/es2015/common/models/rounded.d.ts +12 -0
  34. package/dist/es2015/common/models/rounded.js +4 -0
  35. package/dist/es2015/common/models/shape.d.ts +2 -9
  36. package/dist/es2015/common/models/size.d.ts +9 -6
  37. package/dist/es2015/common/models/styling-classes.d.ts +11 -0
  38. package/dist/es2015/common/models/styling-classes.js +4 -0
  39. package/dist/es2015/common/models/theme-color.d.ts +15 -4
  40. package/dist/es2015/common/models.d.ts +10 -0
  41. package/dist/es2015/{chip/models/chip-look.js → common/models.js} +0 -0
  42. package/dist/es2015/dropdownbutton/dropdownbutton.component.d.ts +58 -7
  43. package/dist/es2015/dropdownbutton/dropdownbutton.component.js +81 -28
  44. package/dist/es2015/floatingactionbutton/dial-item.component.js +1 -1
  45. package/dist/es2015/floatingactionbutton/floatingactionbutton.component.d.ts +28 -21
  46. package/dist/es2015/floatingactionbutton/floatingactionbutton.component.js +62 -42
  47. package/dist/es2015/focusable/focusable.directive.js +4 -4
  48. package/dist/es2015/index.metadata.json +1 -1
  49. package/dist/es2015/listbutton/list-button.js +1 -1
  50. package/dist/es2015/listbutton/list.component.d.ts +3 -0
  51. package/dist/es2015/listbutton/list.component.js +37 -20
  52. package/dist/es2015/main.d.ts +4 -4
  53. package/dist/es2015/package-metadata.js +1 -1
  54. package/dist/es2015/splitbutton/splitbutton.component.d.ts +53 -7
  55. package/dist/es2015/splitbutton/splitbutton.component.js +101 -29
  56. package/dist/es2015/util.d.ts +21 -0
  57. package/dist/es2015/util.js +52 -0
  58. package/dist/fesm2015/index.js +832 -395
  59. package/dist/fesm5/index.js +817 -393
  60. package/dist/npm/button/button.directive.js +239 -89
  61. package/dist/npm/button/button.service.js +0 -4
  62. package/dist/npm/buttongroup/buttongroup.component.js +1 -53
  63. package/dist/npm/chip/chip-list.component.js +52 -5
  64. package/dist/npm/chip/chip.component.js +173 -84
  65. package/dist/npm/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
  66. package/dist/npm/{chip/models/type.js → common/models/rounded.js} +0 -0
  67. package/dist/npm/common/models/styling-classes.js +6 -0
  68. package/dist/npm/{button-look.js → common/models.js} +0 -0
  69. package/dist/npm/dropdownbutton/dropdownbutton.component.js +74 -33
  70. package/dist/npm/floatingactionbutton/dial-item.component.js +1 -1
  71. package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +66 -41
  72. package/dist/npm/focusable/focusable.directive.js +4 -4
  73. package/dist/npm/listbutton/list-button.js +1 -1
  74. package/dist/npm/listbutton/list.component.js +20 -1
  75. package/dist/npm/package-metadata.js +1 -1
  76. package/dist/npm/splitbutton/splitbutton.component.js +89 -31
  77. package/dist/npm/util.js +52 -0
  78. package/dist/systemjs/kendo-angular-buttons.js +1 -1
  79. package/package.json +18 -15
  80. package/dist/es2015/button-look.d.ts +0 -21
  81. package/dist/es2015/chip/models/chip-look.d.ts +0 -20
  82. package/dist/es2015/chip/models/type.d.ts +0 -21
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
6
  /* tslint:disable:no-access-missing-member */
7
- import { Component, ElementRef, TemplateRef, Input, Output, HostBinding, HostListener, EventEmitter, ContentChild, ViewChild, ViewContainerRef, NgZone, ChangeDetectorRef } from '@angular/core';
7
+ import { Component, ElementRef, TemplateRef, Input, Output, HostBinding, HostListener, EventEmitter, ContentChild, ViewChild, ViewContainerRef, NgZone, ChangeDetectorRef, Renderer2 } from '@angular/core';
8
8
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
9
9
  import { PopupService } from '@progress/kendo-angular-popup';
10
10
  import { ListButton } from './../listbutton/list-button';
@@ -16,7 +16,7 @@ import { isDocumentAvailable, guid, isChanged } from '@progress/kendo-angular-co
16
16
  import { isPresent, tick } from './../util';
17
17
  import { PreventableEvent } from '../preventable-event';
18
18
  import { Keys } from '@progress/kendo-angular-common';
19
- import { replaceMessagePlaceholder } from '../util';
19
+ import { replaceMessagePlaceholder, getStylingClasses } from '../util';
20
20
  var NAVIGATION_SETTINGS = {
21
21
  useLeftRightArrows: true
22
22
  };
@@ -68,11 +68,12 @@ var NAVIGATION_SETTINGS_PROVIDER = {
68
68
  */
69
69
  var SplitButtonComponent = /** @class */ (function (_super) {
70
70
  tslib_1.__extends(SplitButtonComponent, _super);
71
- function SplitButtonComponent(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr) {
71
+ function SplitButtonComponent(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, renderer) {
72
72
  var _this = _super.call(this, focusService, navigationService, wrapperRef, zone, localization, cdr) || this;
73
73
  _this.popupService = popupService;
74
74
  _this.elRef = elRef;
75
75
  _this.localization = localization;
76
+ _this.renderer = renderer;
76
77
  /**
77
78
  * Sets the text of the SplitButton.
78
79
  */
@@ -97,13 +98,46 @@ var SplitButtonComponent = /** @class */ (function (_super) {
97
98
  */
98
99
  _this.imageUrl = '';
99
100
  /**
100
- * Changes the visual appearance by using alternative styling options.
101
+ * The size property specifies the width and height of the SplitButton
102
+ * ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-size)).
103
+ *
104
+ * The possible values are:
105
+ * * `'small'`
106
+ * * `'medium'` (default)
107
+ * * `'large'`
108
+ * * `null`
109
+ */
110
+ _this.size = 'medium';
111
+ /**
112
+ * The fillMode property specifies the background and border styles of the SplitButton
113
+ * ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-fillMode)).
101
114
  *
102
115
  * The available values are:
116
+ * * `solid` (default)
103
117
  * * `flat`
104
118
  * * `outline`
119
+ * * `link`
120
+ */
121
+ _this.fillMode = 'solid';
122
+ /**
123
+ * The SplitButton allows you to specify predefined theme colors.
124
+ * The theme color will be applied as a background and border color while also amending the text color accordingly
125
+ * ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-themeColor)).
126
+ *
127
+ * The possible values are:
128
+ * * `base` —Applies coloring based on the `base` theme color. (default)
129
+ * * `primary` —Applies coloring based on the `primary` theme color.
130
+ * * `secondary`—Applies coloring based on the `secondary` theme color.
131
+ * * `tertiary`— Applies coloring based on the `tertiary` theme color.
132
+ * * `info`—Applies coloring based on the `info` theme color.
133
+ * * `success`— Applies coloring based on the `success` theme color.
134
+ * * `warning`— Applies coloring based on the `warning` theme color.
135
+ * * `error`— Applies coloring based on the `error` theme color.
136
+ * * `dark`— Applies coloring based on the `dark` theme color.
137
+ * * `light`— Applies coloring based on the `light` theme color.
138
+ * * `inverse`— Applies coloring based on the `inverse` theme color.
105
139
  */
106
- _this.look = 'default';
140
+ _this.themeColor = 'base';
107
141
  /**
108
142
  * Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
109
143
  */
@@ -188,10 +222,33 @@ var SplitButtonComponent = /** @class */ (function (_super) {
188
222
  _this.activeArrow = false;
189
223
  _this.buttonText = '';
190
224
  _this.lockFocus = false;
225
+ _this._rounded = 'medium';
191
226
  _this._itemClick = _this.itemClick;
192
227
  _this._blur = _this.onBlur;
193
228
  return _this;
194
229
  }
230
+ Object.defineProperty(SplitButtonComponent.prototype, "rounded", {
231
+ get: function () {
232
+ return this._rounded;
233
+ },
234
+ /**
235
+ * The rounded property specifies the border radius of the SplitButton
236
+ * ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
237
+ *
238
+ * The possible values are:
239
+ * * `'small'`
240
+ * * `'medium'` (default)
241
+ * * `'large'`
242
+ * * `'full'`
243
+ * * `null`
244
+ */
245
+ set: function (rounded) {
246
+ this.handleClasses(rounded, 'rounded');
247
+ this._rounded = rounded;
248
+ },
249
+ enumerable: true,
250
+ configurable: true
251
+ });
195
252
  Object.defineProperty(SplitButtonComponent.prototype, "disabled", {
196
253
  get: function () {
197
254
  return this._disabled;
@@ -305,20 +362,6 @@ var SplitButtonComponent = /** @class */ (function (_super) {
305
362
  enumerable: true,
306
363
  configurable: true
307
364
  });
308
- Object.defineProperty(SplitButtonComponent.prototype, "isFlat", {
309
- get: function () {
310
- return this.look === 'flat';
311
- },
312
- enumerable: true,
313
- configurable: true
314
- });
315
- Object.defineProperty(SplitButtonComponent.prototype, "isOutline", {
316
- get: function () {
317
- return this.look === 'outline';
318
- },
319
- enumerable: true,
320
- configurable: true
321
- });
322
365
  Object.defineProperty(SplitButtonComponent.prototype, "widgetClasses", {
323
366
  get: function () {
324
367
  return true;
@@ -417,6 +460,7 @@ var SplitButtonComponent = /** @class */ (function (_super) {
417
460
  */
418
461
  SplitButtonComponent.prototype.ngAfterViewInit = function () {
419
462
  this.updateButtonText();
463
+ this.handleClasses(this.rounded, 'rounded');
420
464
  };
421
465
  /**
422
466
  * @hidden
@@ -583,6 +627,16 @@ var SplitButtonComponent = /** @class */ (function (_super) {
583
627
  this.popupRef = null;
584
628
  }
585
629
  };
630
+ SplitButtonComponent.prototype.handleClasses = function (value, input) {
631
+ var elem = this.wrapperRef.nativeElement;
632
+ var classes = getStylingClasses('button', input, this[input], value);
633
+ if (classes.toRemove) {
634
+ this.renderer.removeClass(elem, classes.toRemove);
635
+ }
636
+ if (classes.toAdd) {
637
+ this.renderer.addClass(elem, classes.toAdd);
638
+ }
639
+ };
586
640
  tslib_1.__decorate([
587
641
  Input(),
588
642
  tslib_1.__metadata("design:type", String)
@@ -606,7 +660,20 @@ var SplitButtonComponent = /** @class */ (function (_super) {
606
660
  tslib_1.__decorate([
607
661
  Input(),
608
662
  tslib_1.__metadata("design:type", String)
609
- ], SplitButtonComponent.prototype, "look", void 0);
663
+ ], SplitButtonComponent.prototype, "size", void 0);
664
+ tslib_1.__decorate([
665
+ Input(),
666
+ tslib_1.__metadata("design:type", String),
667
+ tslib_1.__metadata("design:paramtypes", [String])
668
+ ], SplitButtonComponent.prototype, "rounded", null);
669
+ tslib_1.__decorate([
670
+ Input(),
671
+ tslib_1.__metadata("design:type", String)
672
+ ], SplitButtonComponent.prototype, "fillMode", void 0);
673
+ tslib_1.__decorate([
674
+ Input(),
675
+ tslib_1.__metadata("design:type", String)
676
+ ], SplitButtonComponent.prototype, "themeColor", void 0);
610
677
  tslib_1.__decorate([
611
678
  Input(),
612
679
  tslib_1.__metadata("design:type", Boolean),
@@ -687,20 +754,10 @@ var SplitButtonComponent = /** @class */ (function (_super) {
687
754
  tslib_1.__metadata("design:type", ViewContainerRef)
688
755
  ], SplitButtonComponent.prototype, "containerRef", void 0);
689
756
  tslib_1.__decorate([
690
- HostBinding('class.k-state-focused'),
757
+ HostBinding('class.k-focus'),
691
758
  tslib_1.__metadata("design:type", Boolean),
692
759
  tslib_1.__metadata("design:paramtypes", [Boolean])
693
760
  ], SplitButtonComponent.prototype, "isFocused", null);
694
- tslib_1.__decorate([
695
- HostBinding('class.k-flat'),
696
- tslib_1.__metadata("design:type", Boolean),
697
- tslib_1.__metadata("design:paramtypes", [])
698
- ], SplitButtonComponent.prototype, "isFlat", null);
699
- tslib_1.__decorate([
700
- HostBinding('class.k-outline'),
701
- tslib_1.__metadata("design:type", Boolean),
702
- tslib_1.__metadata("design:paramtypes", [])
703
- ], SplitButtonComponent.prototype, "isOutline", null);
704
761
  tslib_1.__decorate([
705
762
  HostBinding('class.k-split-button'),
706
763
  HostBinding('class.k-button-group'),
@@ -744,7 +801,7 @@ var SplitButtonComponent = /** @class */ (function (_super) {
744
801
  }
745
802
  ],
746
803
  selector: 'kendo-splitbutton',
747
- template: "\n <ng-container kendoSplitButtonLocalizedMessages\n i18n-splitButtonLabel=\"kendo.splitbutton.splitButtonLabel|The text for the SplitButton aria-label\"\n splitButtonLabel=\"{{ '{buttonText} splitbutton' }}\">\n </ng-container>\n <button\n kendoButton\n #button\n [type]=\"type\"\n [look]=\"look\"\n [tabindex]=\"componentTabIndex\"\n [disabled]=\"disabled\"\n [icon]=\"icon\"\n [class.k-state-active]=\"active\"\n [iconClass]=\"iconClass\"\n [imageUrl]=\"imageUrl\"\n [ngClass]=\"buttonClass\"\n (focus)=\"onButtonFocus()\"\n (click)=\"onButtonClick()\"\n (blur)=\"onButtonBlur()\"\n (mousedown)=\"toggleButtonActiveState(true)\"\n (mouseup)=\"toggleButtonActiveState(false)\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-expanded]=\"openState\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-owns]=\"listId\"\n [attr.aria-label]=\"ariaLabel\"\n >\n {{ text }}<ng-content></ng-content>\n </button>\n <button\n kendoButton\n #arrowButton\n type=\"button\"\n [class.k-state-active]=\"activeArrow\"\n [disabled]=\"disabled\"\n [icon]=\"arrowButtonIcon\"\n [look]=\"look\"\n [tabindex]=\"-1\"\n [ngClass]=\"arrowButtonClass\"\n (click)=\"onArrowButtonClick()\"\n (mousedown)=\"toggleArrowButtonActiveState(true)\"\n (mouseup)=\"toggleArrowButtonActiveState(false)\"\n ></button>\n <ng-template #popupTemplate>\n <kendo-button-list\n [id]=\"listId\"\n [data]=\"data\"\n [textField]=\"textField\"\n [itemTemplate]=\"itemTemplate\"\n (onItemClick)=\"onItemClick($event)\"\n (keydown)=\"keyDownHandler($event)\"\n (keypress)=\"keyPressHandler($event)\"\n (keyup)=\"keyUpHandler($event)\"\n [attr.dir]=\"dir\"\n >\n </kendo-button-list>\n </ng-template>\n <ng-container #container></ng-container>\n "
804
+ template: "\n <ng-container kendoSplitButtonLocalizedMessages\n i18n-splitButtonLabel=\"kendo.splitbutton.splitButtonLabel|The text for the SplitButton aria-label\"\n splitButtonLabel=\"{{ '{buttonText} splitbutton' }}\">\n </ng-container>\n <button\n kendoButton\n #button\n [type]=\"type\"\n [tabindex]=\"componentTabIndex\"\n [disabled]=\"disabled\"\n [size]=\"size\"\n [rounded]=\"rounded\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"themeColor\"\n [icon]=\"icon\"\n [class.k-active]=\"active\"\n [class.k-icon-button]=\"!text && icon\"\n [iconClass]=\"iconClass\"\n [imageUrl]=\"imageUrl\"\n [ngClass]=\"buttonClass\"\n (focus)=\"onButtonFocus()\"\n (click)=\"onButtonClick()\"\n (blur)=\"onButtonBlur()\"\n (mousedown)=\"toggleButtonActiveState(true)\"\n (mouseup)=\"toggleButtonActiveState(false)\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-expanded]=\"openState\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-owns]=\"listId\"\n [attr.aria-label]=\"ariaLabel\"\n >\n <span *ngIf=\"text\" class=\"k-button-text\">\n {{ text }}\n </span><ng-content></ng-content>\n </button>\n <button\n kendoButton\n #arrowButton\n type=\"button\"\n [class.k-active]=\"activeArrow\"\n [disabled]=\"disabled\"\n [icon]=\"arrowButtonIcon\"\n [size]=\"size\"\n [rounded]=\"rounded\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n [tabindex]=\"-1\"\n [ngClass]=\"arrowButtonClass\"\n (click)=\"onArrowButtonClick()\"\n (mousedown)=\"toggleArrowButtonActiveState(true)\"\n (mouseup)=\"toggleArrowButtonActiveState(false)\"\n ></button>\n <ng-template #popupTemplate>\n <kendo-button-list\n [id]=\"listId\"\n [data]=\"data\"\n [textField]=\"textField\"\n [itemTemplate]=\"itemTemplate\"\n (onItemClick)=\"onItemClick($event)\"\n (keydown)=\"keyDownHandler($event)\"\n (keypress)=\"keyPressHandler($event)\"\n (keyup)=\"keyUpHandler($event)\"\n [attr.dir]=\"dir\"\n [size]=\"size\"\n >\n </kendo-button-list>\n </ng-template>\n <ng-container #container></ng-container>\n "
748
805
  }),
749
806
  tslib_1.__metadata("design:paramtypes", [FocusService,
750
807
  NavigationService,
@@ -753,7 +810,8 @@ var SplitButtonComponent = /** @class */ (function (_super) {
753
810
  PopupService,
754
811
  ElementRef,
755
812
  LocalizationService,
756
- ChangeDetectorRef])
813
+ ChangeDetectorRef,
814
+ Renderer2])
757
815
  ], SplitButtonComponent);
758
816
  return SplitButtonComponent;
759
817
  }(ListButton));
package/dist/es/util.js CHANGED
@@ -43,3 +43,55 @@ export function closest(element, selector) {
43
43
  export var replaceMessagePlaceholder = function (message, name, value) {
44
44
  return message.replace(new RegExp("{\\s*" + name + "\\s*}", 'g'), value);
45
45
  };
46
+ /**
47
+ * @hidden
48
+ */
49
+ export var SIZES = {
50
+ small: 'sm',
51
+ medium: 'md',
52
+ large: 'lg'
53
+ };
54
+ var ROUNDNESS = {
55
+ small: 'sm',
56
+ medium: 'md',
57
+ large: 'lg',
58
+ full: 'full'
59
+ };
60
+ /**
61
+ * @hidden
62
+ *
63
+ * Returns the styling classes to be added and removed
64
+ */
65
+ export var getStylingClasses = function (componentType, stylingOption, previousValue, newValue) {
66
+ switch (stylingOption) {
67
+ case 'size':
68
+ return {
69
+ toRemove: "k-" + componentType + "-" + SIZES[previousValue],
70
+ toAdd: newValue ? "k-" + componentType + "-" + SIZES[newValue] : null
71
+ };
72
+ case 'rounded':
73
+ return {
74
+ toRemove: "k-rounded-" + ROUNDNESS[previousValue],
75
+ toAdd: newValue ? "k-rounded-" + ROUNDNESS[newValue] : null
76
+ };
77
+ case 'fillMode':
78
+ case 'shape':
79
+ return {
80
+ toRemove: "k-" + componentType + "-" + previousValue,
81
+ toAdd: newValue ? "k-" + componentType + "-" + newValue : null
82
+ };
83
+ default:
84
+ break;
85
+ }
86
+ };
87
+ /**
88
+ * @hidden
89
+ *
90
+ * Returns the themeColor classes to be added and removed
91
+ */
92
+ export var getThemeColorClasses = function (componentType, prevFillMode, fillMode, previousValue, newValue) {
93
+ return {
94
+ toRemove: "k-" + componentType + "-" + prevFillMode + "-" + previousValue,
95
+ toAdd: newValue ? "k-" + componentType + "-" + fillMode + "-" + newValue : null
96
+ };
97
+ };
@@ -2,14 +2,14 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { SimpleChanges, ElementRef, EventEmitter, Renderer2 as Renderer, OnDestroy, NgZone } from '@angular/core';
5
+ import { SimpleChanges, ElementRef, EventEmitter, Renderer2 as Renderer, OnDestroy, NgZone, AfterViewInit } from '@angular/core';
6
6
  import { KendoButtonService } from './button.service';
7
- import { ButtonLook } from '../button-look';
8
7
  import { LocalizationService } from '@progress/kendo-angular-l10n';
8
+ import { ButtonFillMode, ButtonRounded, ButtonShape, ButtonSize, ButtonThemeColor } from '../common/models';
9
9
  /**
10
10
  * Represents the Kendo UI Button component for Angular.
11
11
  */
12
- export declare class ButtonDirective implements OnDestroy {
12
+ export declare class ButtonDirective implements OnDestroy, AfterViewInit {
13
13
  private service;
14
14
  private ngZone;
15
15
  /**
@@ -26,19 +26,6 @@ export declare class ButtonDirective implements OnDestroy {
26
26
  * @hidden
27
27
  */
28
28
  togglable: boolean;
29
- /**
30
- * Adds visual weight to the Button and makes it primary.
31
- */
32
- primary: boolean;
33
- /**
34
- * Changes the visual appearance by using alternative styling options
35
- * ([more information and examples]({% slug appearance_button %})).
36
- *
37
- * The available values are:
38
- * * [`ButtonLook`]({% slug api_buttons_buttonlook %}) = `flat` | `outline`
39
- * * `clear`
40
- */
41
- look: ButtonLook | 'clear';
42
29
  /**
43
30
  * Sets the selected state of the Button.
44
31
  */
@@ -66,6 +53,69 @@ export declare class ButtonDirective implements OnDestroy {
66
53
  * If set to `true`, it disables the Button.
67
54
  */
68
55
  disabled: boolean;
56
+ /**
57
+ * The size property specifies the width and height of the Button
58
+ * ([see example]({% slug appearance_buttondirective %}#toc-size)).
59
+ *
60
+ * The possible values are:
61
+ * * `'small'`
62
+ * * `'medium'` (default)
63
+ * * `'large'`
64
+ * * `null`
65
+ */
66
+ size: ButtonSize;
67
+ /**
68
+ * The rounded property specifies the border radius of the Button
69
+ * ([see example]({% slug appearance_buttondirective %}#toc-rounded)).
70
+ *
71
+ * The possible values are:
72
+ * * `'small'`
73
+ * * `'medium'` (default)
74
+ * * `'large'`
75
+ * * `'full'`
76
+ * * `null`
77
+ */
78
+ rounded: ButtonRounded;
79
+ /**
80
+ * The fillMode property specifies the background and border styles of the Button
81
+ * ([see example]({% slug appearance_buttondirective %}#toc-fillMode)).
82
+ *
83
+ * The possible values are:
84
+ * * `'flat'`
85
+ * * `'solid'` (default)
86
+ * * `'outline'`
87
+ * * `'link'`
88
+ * * `null`
89
+ */
90
+ fillMode: ButtonFillMode;
91
+ /**
92
+ * The Button allows you to specify predefined theme colors.
93
+ * The theme color will be applied as a background and border color while also amending the text color accordingly
94
+ * ([see example]({% slug appearance_buttondirective %}#toc-themeColor)).
95
+ *
96
+ * The possible values are:
97
+ * * `'base'` (default)
98
+ * * `'primary'`
99
+ * * `'secondary'`
100
+ * * `'tertiary'`
101
+ * * `'info'`
102
+ * * `'success'`
103
+ * * `'warning'`
104
+ * * `'error'`
105
+ * * `'dark'`
106
+ * * `'light`'
107
+ * * `'inverse'`
108
+ */
109
+ themeColor: ButtonThemeColor;
110
+ /**
111
+ * The shape property specifies if the Button will form a rectangle or square.
112
+ * ([see example]({% slug appearance_buttondirective %}#toc-shape)).
113
+ *
114
+ * The possible values are:
115
+ * * `'square'`
116
+ * * `'rectangle'` (default)
117
+ */
118
+ shape: ButtonShape;
69
119
  /**
70
120
  * @hidden
71
121
  */
@@ -87,8 +137,13 @@ export declare class ButtonDirective implements OnDestroy {
87
137
  isIconClass: boolean;
88
138
  imageNode: HTMLImageElement;
89
139
  iconNode: HTMLElement;
140
+ iconSpanNode: HTMLElement;
141
+ private _size;
142
+ private _rounded;
143
+ private _shape;
144
+ private _fillMode;
145
+ private _themeColor;
90
146
  private localizationChangeSubscription;
91
- private buttonLookChangeSubscription;
92
147
  private _focused;
93
148
  private direction;
94
149
  private _selected;
@@ -96,12 +151,7 @@ export declare class ButtonDirective implements OnDestroy {
96
151
  private domEvents;
97
152
  isFocused: boolean;
98
153
  readonly classButton: boolean;
99
- readonly classPrimary: boolean;
100
154
  readonly isToggleable: boolean;
101
- readonly isFlat: boolean;
102
- readonly isBare: boolean;
103
- readonly isOutline: boolean;
104
- readonly isClear: boolean;
105
155
  readonly roleSetter: string;
106
156
  readonly classDisabled: boolean;
107
157
  readonly classActive: boolean;
@@ -114,9 +164,18 @@ export declare class ButtonDirective implements OnDestroy {
114
164
  * @hidden
115
165
  */
116
166
  onBlur(): void;
167
+ /**
168
+ * @hidden
169
+ */
170
+ primary: boolean;
171
+ /**
172
+ * @hidden
173
+ */
174
+ look: 'flat' | 'outline' | 'clear' | 'default';
117
175
  constructor(element: ElementRef, renderer: Renderer, service: KendoButtonService, localization: LocalizationService, ngZone: NgZone);
118
176
  ngOnInit(): void;
119
177
  ngOnChanges(change: SimpleChanges): void;
178
+ ngAfterViewInit(): void;
120
179
  ngAfterViewChecked(): void;
121
180
  ngOnDestroy(): void;
122
181
  /**
@@ -143,8 +202,10 @@ export declare class ButtonDirective implements OnDestroy {
143
202
  setSelected(value: boolean): void;
144
203
  private toggleAriaPressed;
145
204
  private hasText;
205
+ private readonly text;
146
206
  private addImgIcon;
147
207
  private addIcon;
208
+ private addTextSpan;
148
209
  private prependChild;
149
210
  private defer;
150
211
  private iconSetter;
@@ -154,4 +215,6 @@ export declare class ButtonDirective implements OnDestroy {
154
215
  private setIconTextClasses;
155
216
  private toggleClass;
156
217
  private _onButtonClick;
218
+ private handleClasses;
219
+ private handleThemeColor;
157
220
  }