@progress/kendo-angular-buttons 6.4.1 → 7.0.0-dev.202201061631

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 +62 -29
  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 +48 -5
  55. package/dist/es2015/splitbutton/splitbutton.component.js +76 -25
  56. package/dist/es2015/util.d.ts +21 -0
  57. package/dist/es2015/util.js +52 -0
  58. package/dist/fesm2015/index.js +809 -393
  59. package/dist/fesm5/index.js +795 -396
  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 +62 -29
  77. package/dist/npm/util.js +52 -0
  78. package/dist/systemjs/kendo-angular-buttons.js +1 -1
  79. package/package.json +12 -9
  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
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
  }