@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.
- package/bundles/kendo-angular-buttons.umd.js +1 -1
- package/button/button.directive.d.ts +30 -43
- package/buttongroup/buttongroup.component.d.ts +1 -2
- package/chip/chip-list.component.d.ts +1 -1
- package/chip/chip.component.d.ts +19 -20
- package/common/models/fillmode.d.ts +2 -2
- package/common/models/rounded.d.ts +2 -2
- package/common/models/size.d.ts +2 -2
- package/common/models/theme-color.d.ts +2 -2
- package/common/models.d.ts +0 -1
- package/dropdownbutton/dropdownbutton.component.d.ts +14 -25
- package/esm2015/button/button.directive.js +55 -65
- package/esm2015/buttongroup/buttongroup.component.js +6 -5
- package/esm2015/chip/chip-list.component.js +4 -3
- package/esm2015/chip/chip.component.js +47 -47
- package/esm2015/common/models.js +0 -1
- package/esm2015/dropdownbutton/dropdownbutton.component.js +25 -36
- package/esm2015/floatingactionbutton/dial-item.component.js +1 -0
- package/esm2015/floatingactionbutton/dial-list.component.js +1 -0
- package/esm2015/floatingactionbutton/floatingactionbutton.component.js +55 -52
- package/esm2015/focusable/focusable.directive.js +5 -11
- package/esm2015/listbutton/list-button.js +15 -35
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/splitbutton/localization/messages.js +1 -0
- package/esm2015/splitbutton/splitbutton.component.js +27 -19
- package/esm2015/util.js +4 -4
- package/fesm2015/kendo-angular-buttons.js +240 -276
- package/floatingactionbutton/floatingactionbutton.component.d.ts +22 -35
- package/focusable/focusable.directive.d.ts +1 -2
- package/listbutton/list-button.d.ts +1 -11
- package/main.d.ts +0 -1
- package/package.json +4 -4
- package/splitbutton/splitbutton.component.d.ts +11 -9
- package/common/models/shape.d.ts +0 -11
- package/esm2015/common/models/shape.js +0 -5
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { SimpleChanges, ElementRef, EventEmitter, Renderer2 as Renderer, OnDestroy, NgZone, AfterViewInit } from '@angular/core';
|
|
6
6
|
import { KendoButtonService } from './button.service';
|
|
7
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
-
import { ButtonFillMode, ButtonRounded,
|
|
8
|
+
import { ButtonFillMode, ButtonRounded, ButtonSize, ButtonThemeColor } from '../common/models';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
11
|
* Represents the Kendo UI Button component for Angular.
|
|
@@ -63,10 +63,10 @@ export declare class ButtonDirective implements OnDestroy, AfterViewInit {
|
|
|
63
63
|
* ([see example]({% slug appearance_button %}#toc-size)).
|
|
64
64
|
*
|
|
65
65
|
* The possible values are:
|
|
66
|
-
* * `
|
|
67
|
-
* * `
|
|
68
|
-
* * `
|
|
69
|
-
* * `
|
|
66
|
+
* * `small`
|
|
67
|
+
* * `medium` (default)
|
|
68
|
+
* * `large`
|
|
69
|
+
* * `none`
|
|
70
70
|
*/
|
|
71
71
|
set size(size: ButtonSize);
|
|
72
72
|
get size(): ButtonSize;
|
|
@@ -75,11 +75,11 @@ export declare class ButtonDirective implements OnDestroy, AfterViewInit {
|
|
|
75
75
|
* ([see example]({% slug appearance_button %}#toc-rounded)).
|
|
76
76
|
*
|
|
77
77
|
* The possible values are:
|
|
78
|
-
* * `
|
|
79
|
-
* * `
|
|
80
|
-
* * `
|
|
81
|
-
* * `
|
|
82
|
-
* * `
|
|
78
|
+
* * `small`
|
|
79
|
+
* * `medium` (default)
|
|
80
|
+
* * `large`
|
|
81
|
+
* * `full`
|
|
82
|
+
* * `none`
|
|
83
83
|
*/
|
|
84
84
|
set rounded(rounded: ButtonRounded);
|
|
85
85
|
get rounded(): ButtonRounded;
|
|
@@ -88,12 +88,12 @@ export declare class ButtonDirective implements OnDestroy, AfterViewInit {
|
|
|
88
88
|
* ([see example]({% slug appearance_button %}#toc-fillMode)).
|
|
89
89
|
*
|
|
90
90
|
* The possible values are:
|
|
91
|
-
* * `
|
|
92
|
-
* * `
|
|
93
|
-
* * `
|
|
94
|
-
* * `
|
|
95
|
-
* * `
|
|
96
|
-
* * `
|
|
91
|
+
* * `flat`
|
|
92
|
+
* * `solid` (default)
|
|
93
|
+
* * `outline`
|
|
94
|
+
* * `clear`
|
|
95
|
+
* * `link`
|
|
96
|
+
* * `none`
|
|
97
97
|
*/
|
|
98
98
|
set fillMode(fillMode: ButtonFillMode);
|
|
99
99
|
get fillMode(): ButtonFillMode;
|
|
@@ -103,32 +103,21 @@ export declare class ButtonDirective implements OnDestroy, AfterViewInit {
|
|
|
103
103
|
* ([see example]({% slug appearance_button %}#toc-themeColor)).
|
|
104
104
|
*
|
|
105
105
|
* The possible values are:
|
|
106
|
-
* * `
|
|
107
|
-
* * `
|
|
108
|
-
* * `
|
|
109
|
-
* * `
|
|
110
|
-
* * `
|
|
111
|
-
* * `
|
|
112
|
-
* * `
|
|
113
|
-
* * `
|
|
114
|
-
* * `
|
|
115
|
-
* * `
|
|
116
|
-
* * `
|
|
106
|
+
* * `base` (default)
|
|
107
|
+
* * `primary`
|
|
108
|
+
* * `secondary`
|
|
109
|
+
* * `tertiary`
|
|
110
|
+
* * `info`
|
|
111
|
+
* * `success`
|
|
112
|
+
* * `warning`
|
|
113
|
+
* * `error`
|
|
114
|
+
* * `dark`
|
|
115
|
+
* * `light`
|
|
116
|
+
* * `inverse`
|
|
117
|
+
* * `none`
|
|
117
118
|
*/
|
|
118
119
|
set themeColor(themeColor: ButtonThemeColor);
|
|
119
120
|
get themeColor(): ButtonThemeColor;
|
|
120
|
-
/**
|
|
121
|
-
* @hidden
|
|
122
|
-
*
|
|
123
|
-
* The shape property specifies if the Button will form a rectangle or square.
|
|
124
|
-
* ([see example]({% slug appearance_button %}#toc-shape)).
|
|
125
|
-
*
|
|
126
|
-
* The possible values are:
|
|
127
|
-
* * `'square'`
|
|
128
|
-
* * `'rectangle'` (default)
|
|
129
|
-
*/
|
|
130
|
-
set shape(shape: ButtonShape);
|
|
131
|
-
get shape(): ButtonShape;
|
|
132
121
|
/**
|
|
133
122
|
* @hidden
|
|
134
123
|
*/
|
|
@@ -153,15 +142,13 @@ export declare class ButtonDirective implements OnDestroy, AfterViewInit {
|
|
|
153
142
|
iconSpanNode: HTMLElement;
|
|
154
143
|
private _size;
|
|
155
144
|
private _rounded;
|
|
156
|
-
private _shape;
|
|
157
145
|
private _fillMode;
|
|
158
146
|
private _themeColor;
|
|
159
|
-
private localizationChangeSubscription;
|
|
160
147
|
private _focused;
|
|
161
148
|
private direction;
|
|
162
149
|
private _selected;
|
|
163
150
|
private deferTimeout;
|
|
164
|
-
private
|
|
151
|
+
private subs;
|
|
165
152
|
set isFocused(isFocused: boolean);
|
|
166
153
|
get isFocused(): boolean;
|
|
167
154
|
get classButton(): boolean;
|
|
@@ -231,5 +218,5 @@ export declare class ButtonDirective implements OnDestroy, AfterViewInit {
|
|
|
231
218
|
private handleClasses;
|
|
232
219
|
private handleThemeColor;
|
|
233
220
|
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonDirective, [null, null, { optional: true; }, null, null]>;
|
|
234
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonDirective, "button[kendoButton], span[kendoButton]", ["kendoButton"], { "toggleable": "toggleable"; "togglable": "togglable"; "selected": "selected"; "tabIndex": "tabIndex"; "icon": "icon"; "iconClass": "iconClass"; "imageUrl": "imageUrl"; "disabled": "disabled"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; "themeColor": "themeColor"; "
|
|
221
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonDirective, "button[kendoButton], span[kendoButton]", ["kendoButton"], { "toggleable": "toggleable"; "togglable": "togglable"; "selected": "selected"; "tabIndex": "tabIndex"; "icon": "icon"; "iconClass": "iconClass"; "imageUrl": "imageUrl"; "disabled": "disabled"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; "themeColor": "themeColor"; "role": "role"; "primary": "primary"; "look": "look"; }, { "selectedChange": "selectedChange"; "click": "click"; }, never>;
|
|
235
222
|
}
|
|
@@ -52,8 +52,7 @@ export declare class ButtonGroupComponent implements OnInit, OnDestroy, AfterCon
|
|
|
52
52
|
private _tabIndex;
|
|
53
53
|
private currentTabIndex;
|
|
54
54
|
private direction;
|
|
55
|
-
private
|
|
56
|
-
private localizationChangeSubscription;
|
|
55
|
+
private subs;
|
|
57
56
|
get wrapperClass(): boolean;
|
|
58
57
|
get disabledClass(): boolean;
|
|
59
58
|
get stretchedClass(): boolean;
|
package/chip/chip.component.d.ts
CHANGED
|
@@ -61,10 +61,10 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
|
|
|
61
61
|
* ([see example]({% slug appearance_chip %}#toc-size)).
|
|
62
62
|
*
|
|
63
63
|
* The possible values are:
|
|
64
|
-
* * `
|
|
65
|
-
* * `
|
|
66
|
-
* * `
|
|
67
|
-
* * `
|
|
64
|
+
* * `small`
|
|
65
|
+
* * `medium` (default)
|
|
66
|
+
* * `large`
|
|
67
|
+
* * `none`
|
|
68
68
|
*/
|
|
69
69
|
set size(size: ChipSize);
|
|
70
70
|
get size(): ChipSize;
|
|
@@ -73,11 +73,11 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
|
|
|
73
73
|
* ([see example]({% slug appearance_chip %}#toc-rounded)).
|
|
74
74
|
*
|
|
75
75
|
* The possible values are:
|
|
76
|
-
* * `
|
|
77
|
-
* * `
|
|
78
|
-
* * `
|
|
79
|
-
* * `
|
|
80
|
-
* * `
|
|
76
|
+
* * `small`
|
|
77
|
+
* * `medium` (default)
|
|
78
|
+
* * `large`
|
|
79
|
+
* * `full`
|
|
80
|
+
* * `none`
|
|
81
81
|
*/
|
|
82
82
|
set rounded(rounded: ChipRounded);
|
|
83
83
|
get rounded(): ChipRounded;
|
|
@@ -86,9 +86,9 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
|
|
|
86
86
|
* ([see example]({% slug appearance_chip %}#toc-fillMode)).
|
|
87
87
|
*
|
|
88
88
|
* The possible values are:
|
|
89
|
-
* * `
|
|
90
|
-
* * `
|
|
91
|
-
* * `
|
|
89
|
+
* * `solid` (default)
|
|
90
|
+
* * `outline`
|
|
91
|
+
* * `none`
|
|
92
92
|
*/
|
|
93
93
|
set fillMode(fillMode: ChipFillMode);
|
|
94
94
|
get fillMode(): ChipFillMode;
|
|
@@ -98,12 +98,12 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
|
|
|
98
98
|
* ([see example]({% slug appearance_chip %}#toc-themeColor)).
|
|
99
99
|
*
|
|
100
100
|
* The possible values are:
|
|
101
|
-
* * `
|
|
102
|
-
* * `
|
|
103
|
-
* * `
|
|
104
|
-
* * `
|
|
105
|
-
* * `
|
|
106
|
-
* * `
|
|
101
|
+
* * `base` (default)
|
|
102
|
+
* * `info`
|
|
103
|
+
* * `success`
|
|
104
|
+
* * `warning`
|
|
105
|
+
* * `error`
|
|
106
|
+
* * `none`
|
|
107
107
|
*/
|
|
108
108
|
set themeColor(themeColor: ChipThemeColor);
|
|
109
109
|
get themeColor(): ChipThemeColor;
|
|
@@ -131,8 +131,7 @@ export declare class ChipComponent implements OnInit, AfterViewInit {
|
|
|
131
131
|
private _fillMode;
|
|
132
132
|
private _themeColor;
|
|
133
133
|
private focused;
|
|
134
|
-
private
|
|
135
|
-
private detachDomEvents;
|
|
134
|
+
private subs;
|
|
136
135
|
constructor(element: ElementRef, renderer: Renderer2, ngZone: NgZone, localizationService: LocalizationService);
|
|
137
136
|
ngOnInit(): void;
|
|
138
137
|
ngOnDestroy(): void;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents the possible fillMode options of the buttons.
|
|
7
7
|
*/
|
|
8
|
-
export declare type ButtonFillMode = 'solid' | 'flat' | 'outline' | 'link' | 'clear';
|
|
8
|
+
export declare type ButtonFillMode = 'solid' | 'flat' | 'outline' | 'link' | 'clear' | 'none';
|
|
9
9
|
/**
|
|
10
10
|
* Represents the possible fillMode options of the Chip.
|
|
11
11
|
*/
|
|
12
|
-
export declare type ChipFillMode = 'solid' | 'outline';
|
|
12
|
+
export declare type ChipFillMode = 'solid' | 'outline' | 'none';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents the possible rounded options of the buttons.
|
|
7
7
|
*/
|
|
8
|
-
export declare type ButtonRounded = 'small' | 'medium' | 'large' | 'full';
|
|
8
|
+
export declare type ButtonRounded = 'small' | 'medium' | 'large' | 'full' | 'none';
|
|
9
9
|
/**
|
|
10
10
|
* Represents the possible rounded options of the Chip.
|
|
11
11
|
*/
|
|
12
|
-
export declare type ChipRounded = 'small' | 'medium' | 'large' | 'full';
|
|
12
|
+
export declare type ChipRounded = 'small' | 'medium' | 'large' | 'full' | 'none';
|
package/common/models/size.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* Specifies the possible sizes of the buttons.
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
|
-
export declare type ButtonSize = 'small' | 'medium' | 'large';
|
|
9
|
+
export declare type ButtonSize = 'small' | 'medium' | 'large' | 'none';
|
|
10
10
|
/**
|
|
11
11
|
* Specifies the possible sizes of the Chip.
|
|
12
12
|
*/
|
|
13
|
-
export declare type ChipSize = 'small' | 'medium' | 'large';
|
|
13
|
+
export declare type ChipSize = 'small' | 'medium' | 'large' | 'none';
|
|
14
14
|
/**
|
|
15
15
|
* Specifies the possible gap between Chips in a ChipList.
|
|
16
16
|
*/
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
|
-
export declare type ButtonThemeColor = 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'dark' | 'light' | 'inverse';
|
|
22
|
+
export declare type ButtonThemeColor = 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'dark' | 'light' | 'inverse' | 'none';
|
|
23
23
|
/**
|
|
24
24
|
* Specifies the possible theme colors of the Chip.
|
|
25
25
|
*
|
|
@@ -30,4 +30,4 @@ export declare type ButtonThemeColor = 'base' | 'primary' | 'secondary' | 'terti
|
|
|
30
30
|
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
31
31
|
* * `error`— Applies coloring based on the `error` theme color.
|
|
32
32
|
*/
|
|
33
|
-
export declare type ChipThemeColor = 'base' | 'info' | 'success' | 'warning' | 'error';
|
|
33
|
+
export declare type ChipThemeColor = 'base' | 'info' | 'success' | 'warning' | 'error' | 'none';
|
package/common/models.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
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
|
-
export * from './models/shape';
|
|
6
5
|
export * from './models/size';
|
|
7
6
|
export * from './models/theme-color';
|
|
8
7
|
export * from './models/fillmode';
|
|
@@ -13,7 +13,7 @@ import { ListComponent } from '../listbutton/list.component';
|
|
|
13
13
|
import { FocusService } from '../focusable/focus.service';
|
|
14
14
|
import { NavigationService } from '../navigation/navigation.service';
|
|
15
15
|
import { PreventableEvent } from '../preventable-event';
|
|
16
|
-
import { ButtonFillMode, ButtonRounded, ButtonSize, ButtonThemeColor
|
|
16
|
+
import { ButtonFillMode, ButtonRounded, ButtonSize, ButtonThemeColor } from '../common/models';
|
|
17
17
|
import * as i0 from "@angular/core";
|
|
18
18
|
/**
|
|
19
19
|
* Represents the Kendo UI DropDownButton component for Angular.
|
|
@@ -91,34 +91,22 @@ export declare class DropDownButtonComponent extends ListButton implements OnCha
|
|
|
91
91
|
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-size)).
|
|
92
92
|
*
|
|
93
93
|
* The possible values are:
|
|
94
|
-
* * `
|
|
95
|
-
* * `
|
|
96
|
-
* * `
|
|
97
|
-
* * `
|
|
94
|
+
* * `small`
|
|
95
|
+
* * `medium` (default)
|
|
96
|
+
* * `large`
|
|
97
|
+
* * `none`
|
|
98
98
|
*/
|
|
99
99
|
size: ButtonSize;
|
|
100
|
-
/**
|
|
101
|
-
* @hidden
|
|
102
|
-
*
|
|
103
|
-
* The shape property specifies if the DropDownButton will be a square or rectangle.
|
|
104
|
-
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-shape)).
|
|
105
|
-
*
|
|
106
|
-
* The possible values are:
|
|
107
|
-
* * `'rectangle'` (default)
|
|
108
|
-
* * `'square'`
|
|
109
|
-
* * `null`
|
|
110
|
-
*/
|
|
111
|
-
shape: ButtonShape;
|
|
112
100
|
/**
|
|
113
101
|
* The rounded property specifies the border radius of the DropDownButton
|
|
114
102
|
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-rounded)).
|
|
115
103
|
*
|
|
116
104
|
* The possible values are:
|
|
117
|
-
* * `
|
|
118
|
-
* * `
|
|
119
|
-
* * `
|
|
120
|
-
* * `
|
|
121
|
-
* * `
|
|
105
|
+
* * `small`
|
|
106
|
+
* * `medium` (default)
|
|
107
|
+
* * `large`
|
|
108
|
+
* * `full`
|
|
109
|
+
* * `none`
|
|
122
110
|
*/
|
|
123
111
|
rounded: ButtonRounded;
|
|
124
112
|
/**
|
|
@@ -130,7 +118,7 @@ export declare class DropDownButtonComponent extends ListButton implements OnCha
|
|
|
130
118
|
* * `flat`
|
|
131
119
|
* * `outline`
|
|
132
120
|
* * `link`
|
|
133
|
-
* * `
|
|
121
|
+
* * `none`
|
|
134
122
|
*/
|
|
135
123
|
set fillMode(fillMode: ButtonFillMode);
|
|
136
124
|
get fillMode(): ButtonFillMode;
|
|
@@ -151,7 +139,7 @@ export declare class DropDownButtonComponent extends ListButton implements OnCha
|
|
|
151
139
|
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
152
140
|
* * `light`— Applies coloring based on the `light` theme color.
|
|
153
141
|
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
154
|
-
* * `
|
|
142
|
+
* * `none` —Removes the default CSS class (no class would be rendered).
|
|
155
143
|
*/
|
|
156
144
|
themeColor: ButtonThemeColor;
|
|
157
145
|
/**
|
|
@@ -213,6 +201,7 @@ export declare class DropDownButtonComponent extends ListButton implements OnCha
|
|
|
213
201
|
popupRef: PopupRef;
|
|
214
202
|
listId: string;
|
|
215
203
|
private _fillMode;
|
|
204
|
+
private popupSubs;
|
|
216
205
|
/**
|
|
217
206
|
* @hidden
|
|
218
207
|
*/
|
|
@@ -288,5 +277,5 @@ export declare class DropDownButtonComponent extends ListButton implements OnCha
|
|
|
288
277
|
private createPopup;
|
|
289
278
|
private destroyPopup;
|
|
290
279
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropDownButtonComponent, never>;
|
|
291
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropDownButtonComponent, "kendo-dropdownbutton", ["kendoDropDownButton"], { "icon": "icon"; "iconClass": "iconClass"; "imageUrl": "imageUrl"; "popupSettings": "popupSettings"; "textField": "textField"; "disabled": "disabled"; "data": "data"; "size": "size"; "
|
|
280
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropDownButtonComponent, "kendo-dropdownbutton", ["kendoDropDownButton"], { "icon": "icon"; "iconClass": "iconClass"; "imageUrl": "imageUrl"; "popupSettings": "popupSettings"; "textField": "textField"; "disabled": "disabled"; "data": "data"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; "themeColor": "themeColor"; "buttonClass": "buttonClass"; "tabIndex": "tabIndex"; }, { "itemClick": "itemClick"; "open": "open"; "close": "close"; "onFocus": "focus"; "onBlur": "blur"; }, ["itemTemplate"], ["*"]>;
|
|
292
281
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { Directive, EventEmitter, HostBinding, HostListener, Input, Output, Optional } from '@angular/core';
|
|
6
6
|
import { isDocumentAvailable, isChanged, hasObservers, Keys } from '@progress/kendo-angular-common';
|
|
7
7
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { Subscription } from 'rxjs';
|
|
8
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
9
10
|
import { packageMetadata } from '../package-metadata';
|
|
10
11
|
import { getStylingClasses, getThemeColorClasses, isFirefox } from '../util';
|
|
@@ -12,6 +13,10 @@ import * as i0 from "@angular/core";
|
|
|
12
13
|
import * as i1 from "./button.service";
|
|
13
14
|
import * as i2 from "@progress/kendo-angular-l10n";
|
|
14
15
|
const SPAN_TAG_NAME = 'SPAN';
|
|
16
|
+
const DEFAULT_ROUNDED = 'medium';
|
|
17
|
+
const DEFAULT_SIZE = 'medium';
|
|
18
|
+
const DEFAULT_THEME_COLOR = 'base';
|
|
19
|
+
const DEFAULT_FILL_MODE = 'solid';
|
|
15
20
|
/**
|
|
16
21
|
* Represents the Kendo UI Button component for Angular.
|
|
17
22
|
*/
|
|
@@ -41,16 +46,15 @@ export class ButtonDirective {
|
|
|
41
46
|
this.isDisabled = false;
|
|
42
47
|
this.isIcon = false;
|
|
43
48
|
this.isIconClass = false;
|
|
44
|
-
this._size =
|
|
45
|
-
this._rounded =
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this._themeColor = 'base';
|
|
49
|
+
this._size = DEFAULT_SIZE;
|
|
50
|
+
this._rounded = DEFAULT_ROUNDED;
|
|
51
|
+
this._fillMode = DEFAULT_FILL_MODE;
|
|
52
|
+
this._themeColor = DEFAULT_THEME_COLOR;
|
|
49
53
|
this._focused = false;
|
|
50
|
-
this.
|
|
54
|
+
this.subs = new Subscription();
|
|
51
55
|
validatePackage(packageMetadata);
|
|
52
56
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
53
|
-
this.
|
|
57
|
+
this.subs.add(localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr')));
|
|
54
58
|
this.element = element.nativeElement;
|
|
55
59
|
this.renderer = renderer;
|
|
56
60
|
}
|
|
@@ -151,14 +155,15 @@ export class ButtonDirective {
|
|
|
151
155
|
* ([see example]({% slug appearance_button %}#toc-size)).
|
|
152
156
|
*
|
|
153
157
|
* The possible values are:
|
|
154
|
-
* * `
|
|
155
|
-
* * `
|
|
156
|
-
* * `
|
|
157
|
-
* * `
|
|
158
|
+
* * `small`
|
|
159
|
+
* * `medium` (default)
|
|
160
|
+
* * `large`
|
|
161
|
+
* * `none`
|
|
158
162
|
*/
|
|
159
163
|
set size(size) {
|
|
160
|
-
|
|
161
|
-
this.
|
|
164
|
+
const newSize = size ? size : DEFAULT_SIZE;
|
|
165
|
+
this.handleClasses(newSize, 'size');
|
|
166
|
+
this._size = newSize;
|
|
162
167
|
}
|
|
163
168
|
get size() {
|
|
164
169
|
return this._size;
|
|
@@ -168,15 +173,16 @@ export class ButtonDirective {
|
|
|
168
173
|
* ([see example]({% slug appearance_button %}#toc-rounded)).
|
|
169
174
|
*
|
|
170
175
|
* The possible values are:
|
|
171
|
-
* * `
|
|
172
|
-
* * `
|
|
173
|
-
* * `
|
|
174
|
-
* * `
|
|
175
|
-
* * `
|
|
176
|
+
* * `small`
|
|
177
|
+
* * `medium` (default)
|
|
178
|
+
* * `large`
|
|
179
|
+
* * `full`
|
|
180
|
+
* * `none`
|
|
176
181
|
*/
|
|
177
182
|
set rounded(rounded) {
|
|
178
|
-
|
|
179
|
-
this.
|
|
183
|
+
const newRounded = rounded ? rounded : DEFAULT_ROUNDED;
|
|
184
|
+
this.handleClasses(newRounded, 'rounded');
|
|
185
|
+
this._rounded = newRounded;
|
|
180
186
|
}
|
|
181
187
|
get rounded() {
|
|
182
188
|
return this._rounded;
|
|
@@ -186,16 +192,17 @@ export class ButtonDirective {
|
|
|
186
192
|
* ([see example]({% slug appearance_button %}#toc-fillMode)).
|
|
187
193
|
*
|
|
188
194
|
* The possible values are:
|
|
189
|
-
* * `
|
|
190
|
-
* * `
|
|
191
|
-
* * `
|
|
192
|
-
* * `
|
|
193
|
-
* * `
|
|
194
|
-
* * `
|
|
195
|
+
* * `flat`
|
|
196
|
+
* * `solid` (default)
|
|
197
|
+
* * `outline`
|
|
198
|
+
* * `clear`
|
|
199
|
+
* * `link`
|
|
200
|
+
* * `none`
|
|
195
201
|
*/
|
|
196
202
|
set fillMode(fillMode) {
|
|
197
|
-
|
|
198
|
-
this.
|
|
203
|
+
const newFillMode = fillMode ? fillMode : DEFAULT_FILL_MODE;
|
|
204
|
+
this.handleClasses(newFillMode, 'fillMode');
|
|
205
|
+
this._fillMode = newFillMode;
|
|
199
206
|
}
|
|
200
207
|
get fillMode() {
|
|
201
208
|
return this._fillMode;
|
|
@@ -206,41 +213,27 @@ export class ButtonDirective {
|
|
|
206
213
|
* ([see example]({% slug appearance_button %}#toc-themeColor)).
|
|
207
214
|
*
|
|
208
215
|
* The possible values are:
|
|
209
|
-
* * `
|
|
210
|
-
* * `
|
|
211
|
-
* * `
|
|
212
|
-
* * `
|
|
213
|
-
* * `
|
|
214
|
-
* * `
|
|
215
|
-
* * `
|
|
216
|
-
* * `
|
|
217
|
-
* * `
|
|
218
|
-
* * `
|
|
219
|
-
* * `
|
|
216
|
+
* * `base` (default)
|
|
217
|
+
* * `primary`
|
|
218
|
+
* * `secondary`
|
|
219
|
+
* * `tertiary`
|
|
220
|
+
* * `info`
|
|
221
|
+
* * `success`
|
|
222
|
+
* * `warning`
|
|
223
|
+
* * `error`
|
|
224
|
+
* * `dark`
|
|
225
|
+
* * `light`
|
|
226
|
+
* * `inverse`
|
|
227
|
+
* * `none`
|
|
220
228
|
*/
|
|
221
229
|
set themeColor(themeColor) {
|
|
222
|
-
|
|
223
|
-
this.
|
|
230
|
+
const newThemeColor = themeColor ? themeColor : DEFAULT_THEME_COLOR;
|
|
231
|
+
this.handleThemeColor(newThemeColor);
|
|
232
|
+
this._themeColor = newThemeColor;
|
|
224
233
|
}
|
|
225
234
|
get themeColor() {
|
|
226
235
|
return this._themeColor;
|
|
227
236
|
}
|
|
228
|
-
/**
|
|
229
|
-
* @hidden
|
|
230
|
-
*
|
|
231
|
-
* The shape property specifies if the Button will form a rectangle or square.
|
|
232
|
-
* ([see example]({% slug appearance_button %}#toc-shape)).
|
|
233
|
-
*
|
|
234
|
-
* The possible values are:
|
|
235
|
-
* * `'square'`
|
|
236
|
-
* * `'rectangle'` (default)
|
|
237
|
-
*/
|
|
238
|
-
set shape(shape) {
|
|
239
|
-
this._shape = shape;
|
|
240
|
-
}
|
|
241
|
-
get shape() {
|
|
242
|
-
return this._shape;
|
|
243
|
-
}
|
|
244
237
|
set isFocused(isFocused) {
|
|
245
238
|
this.toggleClass('k-focus', isFocused);
|
|
246
239
|
this._focused = isFocused;
|
|
@@ -307,8 +300,8 @@ export class ButtonDirective {
|
|
|
307
300
|
this.setAttribute('role', this.role);
|
|
308
301
|
}
|
|
309
302
|
this.ngZone.runOutsideAngular(() => {
|
|
310
|
-
this.
|
|
311
|
-
this.
|
|
303
|
+
this.subs.add(this.renderer.listen(this.element, 'click', this._onButtonClick.bind(this)));
|
|
304
|
+
this.subs.add(this.renderer.listen(this.element, 'keydown', (event) => {
|
|
312
305
|
const isSpaceOrEnter = event.keyCode === Keys.Space || event.keyCode === Keys.Enter;
|
|
313
306
|
if (isSpan && isSpaceOrEnter) {
|
|
314
307
|
this.click.emit(event);
|
|
@@ -336,9 +329,8 @@ export class ButtonDirective {
|
|
|
336
329
|
this.iconNode = null;
|
|
337
330
|
this.iconSpanNode = null;
|
|
338
331
|
this.renderer = null;
|
|
339
|
-
this.
|
|
332
|
+
this.subs.unsubscribe();
|
|
340
333
|
clearTimeout(this.deferTimeout);
|
|
341
|
-
this.domEvents.forEach(unbindHandler => unbindHandler());
|
|
342
334
|
}
|
|
343
335
|
/**
|
|
344
336
|
* Focuses the Button component.
|
|
@@ -521,7 +513,7 @@ export class ButtonDirective {
|
|
|
521
513
|
const addFillMode = fillMode ? fillMode : this.fillMode;
|
|
522
514
|
const themeColorClass = getThemeColorClasses('button', removeFillMode, addFillMode, this.themeColor, value);
|
|
523
515
|
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
524
|
-
if (addFillMode !==
|
|
516
|
+
if (addFillMode !== 'none' && fillMode !== 'none') {
|
|
525
517
|
if (themeColorClass.toAdd) {
|
|
526
518
|
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
527
519
|
}
|
|
@@ -529,7 +521,7 @@ export class ButtonDirective {
|
|
|
529
521
|
}
|
|
530
522
|
}
|
|
531
523
|
ButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ButtonDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.KendoButtonService, optional: true }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
532
|
-
ButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: { toggleable: "toggleable", togglable: "togglable", selected: "selected", tabIndex: "tabIndex", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", disabled: "disabled", size: "size", rounded: "rounded", fillMode: "fillMode", themeColor: "themeColor",
|
|
524
|
+
ButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: { toggleable: "toggleable", togglable: "togglable", selected: "selected", tabIndex: "tabIndex", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", disabled: "disabled", size: "size", rounded: "rounded", fillMode: "fillMode", themeColor: "themeColor", role: "role", primary: "primary", look: "look" }, outputs: { selectedChange: "selectedChange", click: "click" }, host: { listeners: { "focus": "onFocus()", "blur": "onBlur()" }, properties: { "class.k-button": "this.classButton", "class.k-toggle-button": "this.isToggleable", "attr.role": "this.roleSetter", "attr.aria-disabled": "this.classDisabled", "class.k-disabled": "this.classDisabled", "class.k-selected": "this.classActive", "attr.dir": "this.getDirection" } }, providers: [
|
|
533
525
|
LocalizationService,
|
|
534
526
|
{
|
|
535
527
|
provide: L10N_PREFIX,
|
|
@@ -575,8 +567,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
575
567
|
type: Input
|
|
576
568
|
}], themeColor: [{
|
|
577
569
|
type: Input
|
|
578
|
-
}], shape: [{
|
|
579
|
-
type: Input
|
|
580
570
|
}], role: [{
|
|
581
571
|
type: Input
|
|
582
572
|
}], selectedChange: [{
|
|
@@ -7,6 +7,7 @@ import { Component, EventEmitter, Output, Input, ContentChildren, HostBinding, H
|
|
|
7
7
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { isChanged, Keys } from '@progress/kendo-angular-common';
|
|
9
9
|
import { KendoButtonService } from '../button/button.service';
|
|
10
|
+
import { Subscription } from 'rxjs';
|
|
10
11
|
import { isPresent } from '../util';
|
|
11
12
|
import { PreventableEvent } from '../preventable-event';
|
|
12
13
|
import { packageMetadata } from '../package-metadata';
|
|
@@ -35,8 +36,9 @@ export class ButtonGroupComponent {
|
|
|
35
36
|
this.navigate = new EventEmitter();
|
|
36
37
|
this._tabIndex = 0;
|
|
37
38
|
this.currentTabIndex = 0;
|
|
39
|
+
this.subs = new Subscription();
|
|
38
40
|
validatePackage(packageMetadata);
|
|
39
|
-
this.
|
|
41
|
+
this.subs.add(localization.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
|
|
40
42
|
}
|
|
41
43
|
/**
|
|
42
44
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
@@ -101,7 +103,7 @@ export class ButtonGroupComponent {
|
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
ngOnInit() {
|
|
104
|
-
this.
|
|
106
|
+
this.subs.add(this.service.buttonClicked$.subscribe((button) => {
|
|
105
107
|
let newSelectionValue;
|
|
106
108
|
if (this.isSelectionSingle()) {
|
|
107
109
|
newSelectionValue = true;
|
|
@@ -115,7 +117,7 @@ export class ButtonGroupComponent {
|
|
|
115
117
|
button.setSelected(newSelectionValue);
|
|
116
118
|
}
|
|
117
119
|
button.setAttribute(tabindex, '0');
|
|
118
|
-
});
|
|
120
|
+
}));
|
|
119
121
|
}
|
|
120
122
|
ngOnChanges(change) {
|
|
121
123
|
if (isChanged('disabled', change)) {
|
|
@@ -143,8 +145,7 @@ export class ButtonGroupComponent {
|
|
|
143
145
|
}
|
|
144
146
|
}
|
|
145
147
|
ngOnDestroy() {
|
|
146
|
-
this.
|
|
147
|
-
this.localizationChangeSubscription.unsubscribe();
|
|
148
|
+
this.subs.unsubscribe();
|
|
148
149
|
}
|
|
149
150
|
ngAfterContentChecked() {
|
|
150
151
|
this.verifySettings();
|
|
@@ -46,11 +46,12 @@ export class ChipListComponent {
|
|
|
46
46
|
* * `'small'`
|
|
47
47
|
* * `'medium'` (default)
|
|
48
48
|
* * `'large'`
|
|
49
|
-
* * `
|
|
49
|
+
* * `none`
|
|
50
50
|
*/
|
|
51
51
|
set size(size) {
|
|
52
|
-
|
|
53
|
-
this.
|
|
52
|
+
const sizeValue = size ? size : 'medium';
|
|
53
|
+
this.handleClasses(sizeValue, 'size');
|
|
54
|
+
this._size = sizeValue;
|
|
54
55
|
}
|
|
55
56
|
get size() {
|
|
56
57
|
return this._size;
|