@progress/kendo-angular-buttons 8.0.0-next.202204060705 → 8.0.0
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/README.md +1 -0
- package/bundles/kendo-angular-buttons.umd.js +1 -1
- package/button/button.directive.d.ts +27 -40
- package/buttongroup/buttongroup.component.d.ts +1 -2
- package/chip/chip.component.d.ts +15 -16
- package/common/models/size.d.ts +1 -1
- package/common/models/theme-color.d.ts +1 -1
- package/common/models.d.ts +0 -1
- package/dropdownbutton/dropdownbutton.component.d.ts +10 -21
- package/esm2015/button/button.directive.js +51 -65
- package/esm2015/buttongroup/buttongroup.component.js +6 -5
- package/esm2015/chip/chip.component.js +42 -46
- package/esm2015/common/models.js +0 -1
- package/esm2015/dropdownbutton/dropdownbutton.component.js +21 -32
- package/esm2015/floatingactionbutton/floatingactionbutton.component.js +35 -50
- 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/splitbutton.component.js +25 -29
- package/fesm2015/kendo-angular-buttons.js +194 -272
- package/floatingactionbutton/floatingactionbutton.component.d.ts +21 -34
- 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 +10 -12
- package/splitbutton/splitbutton.component.d.ts +9 -7
- 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,9 +63,9 @@ 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
|
-
* * `
|
|
66
|
+
* * `small`
|
|
67
|
+
* * `medium` (default)
|
|
68
|
+
* * `large`
|
|
69
69
|
* * `none`
|
|
70
70
|
*/
|
|
71
71
|
set size(size: ButtonSize);
|
|
@@ -75,10 +75,10 @@ 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
|
-
* * `
|
|
78
|
+
* * `small`
|
|
79
|
+
* * `medium` (default)
|
|
80
|
+
* * `large`
|
|
81
|
+
* * `full`
|
|
82
82
|
* * `none`
|
|
83
83
|
*/
|
|
84
84
|
set rounded(rounded: ButtonRounded);
|
|
@@ -88,11 +88,11 @@ 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
|
-
* * `
|
|
91
|
+
* * `flat`
|
|
92
|
+
* * `solid` (default)
|
|
93
|
+
* * `outline`
|
|
94
|
+
* * `clear`
|
|
95
|
+
* * `link`
|
|
96
96
|
* * `none`
|
|
97
97
|
*/
|
|
98
98
|
set fillMode(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,9 +61,9 @@ 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
|
-
* * `
|
|
64
|
+
* * `small`
|
|
65
|
+
* * `medium` (default)
|
|
66
|
+
* * `large`
|
|
67
67
|
* * `none`
|
|
68
68
|
*/
|
|
69
69
|
set size(size: ChipSize);
|
|
@@ -73,10 +73,10 @@ 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
|
-
* * `
|
|
76
|
+
* * `small`
|
|
77
|
+
* * `medium` (default)
|
|
78
|
+
* * `large`
|
|
79
|
+
* * `full`
|
|
80
80
|
* * `none`
|
|
81
81
|
*/
|
|
82
82
|
set rounded(rounded: ChipRounded);
|
|
@@ -86,8 +86,8 @@ 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
|
-
* * `
|
|
89
|
+
* * `solid` (default)
|
|
90
|
+
* * `outline`
|
|
91
91
|
* * `none`
|
|
92
92
|
*/
|
|
93
93
|
set fillMode(fillMode: ChipFillMode);
|
|
@@ -98,11 +98,11 @@ 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
|
-
* * `
|
|
101
|
+
* * `base` (default)
|
|
102
|
+
* * `info`
|
|
103
|
+
* * `success`
|
|
104
|
+
* * `warning`
|
|
105
|
+
* * `error`
|
|
106
106
|
* * `none`
|
|
107
107
|
*/
|
|
108
108
|
set themeColor(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;
|
package/common/models/size.d.ts
CHANGED
|
@@ -14,4 +14,4 @@ export declare type ChipSize = 'small' | 'medium' | 'large' | 'none';
|
|
|
14
14
|
/**
|
|
15
15
|
* Specifies the possible gap between Chips in a ChipList.
|
|
16
16
|
*/
|
|
17
|
-
export declare type ChipListSize = 'small' | 'medium' | 'large';
|
|
17
|
+
export declare type ChipListSize = 'small' | 'medium' | 'large' | 'none';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Specifies the possible theme colors of the buttons.
|
|
6
|
+
* Specifies the possible theme colors of the buttons([see examples]({% slug appearance_button %}#toc-theme-colors)).
|
|
7
7
|
*
|
|
8
8
|
* The possible values are:
|
|
9
9
|
* * `base` —Applies coloring based on the `base` theme color.
|
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,33 +91,21 @@ 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
|
-
* * `
|
|
94
|
+
* * `small`
|
|
95
|
+
* * `medium` (default)
|
|
96
|
+
* * `large`
|
|
97
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
|
-
* * `none`
|
|
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
|
-
* * `
|
|
105
|
+
* * `small`
|
|
106
|
+
* * `medium` (default)
|
|
107
|
+
* * `large`
|
|
108
|
+
* * `full`
|
|
121
109
|
* * `none`
|
|
122
110
|
*/
|
|
123
111
|
rounded: ButtonRounded;
|
|
@@ -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,15 +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
|
-
* * `
|
|
158
|
+
* * `small`
|
|
159
|
+
* * `medium` (default)
|
|
160
|
+
* * `large`
|
|
157
161
|
* * `none`
|
|
158
162
|
*/
|
|
159
163
|
set size(size) {
|
|
160
|
-
const
|
|
161
|
-
this.handleClasses(
|
|
162
|
-
this._size =
|
|
164
|
+
const newSize = size ? size : DEFAULT_SIZE;
|
|
165
|
+
this.handleClasses(newSize, 'size');
|
|
166
|
+
this._size = newSize;
|
|
163
167
|
}
|
|
164
168
|
get size() {
|
|
165
169
|
return this._size;
|
|
@@ -169,16 +173,16 @@ export class ButtonDirective {
|
|
|
169
173
|
* ([see example]({% slug appearance_button %}#toc-rounded)).
|
|
170
174
|
*
|
|
171
175
|
* The possible values are:
|
|
172
|
-
* * `
|
|
173
|
-
* * `
|
|
174
|
-
* * `
|
|
175
|
-
* * `
|
|
176
|
+
* * `small`
|
|
177
|
+
* * `medium` (default)
|
|
178
|
+
* * `large`
|
|
179
|
+
* * `full`
|
|
176
180
|
* * `none`
|
|
177
181
|
*/
|
|
178
182
|
set rounded(rounded) {
|
|
179
|
-
const
|
|
180
|
-
this.handleClasses(
|
|
181
|
-
this._rounded =
|
|
183
|
+
const newRounded = rounded ? rounded : DEFAULT_ROUNDED;
|
|
184
|
+
this.handleClasses(newRounded, 'rounded');
|
|
185
|
+
this._rounded = newRounded;
|
|
182
186
|
}
|
|
183
187
|
get rounded() {
|
|
184
188
|
return this._rounded;
|
|
@@ -188,17 +192,17 @@ export class ButtonDirective {
|
|
|
188
192
|
* ([see example]({% slug appearance_button %}#toc-fillMode)).
|
|
189
193
|
*
|
|
190
194
|
* The possible values are:
|
|
191
|
-
* * `
|
|
192
|
-
* * `
|
|
193
|
-
* * `
|
|
194
|
-
* * `
|
|
195
|
-
* * `
|
|
195
|
+
* * `flat`
|
|
196
|
+
* * `solid` (default)
|
|
197
|
+
* * `outline`
|
|
198
|
+
* * `clear`
|
|
199
|
+
* * `link`
|
|
196
200
|
* * `none`
|
|
197
201
|
*/
|
|
198
202
|
set fillMode(fillMode) {
|
|
199
|
-
const
|
|
200
|
-
this.handleClasses(
|
|
201
|
-
this._fillMode =
|
|
203
|
+
const newFillMode = fillMode ? fillMode : DEFAULT_FILL_MODE;
|
|
204
|
+
this.handleClasses(newFillMode, 'fillMode');
|
|
205
|
+
this._fillMode = newFillMode;
|
|
202
206
|
}
|
|
203
207
|
get fillMode() {
|
|
204
208
|
return this._fillMode;
|
|
@@ -209,42 +213,27 @@ export class ButtonDirective {
|
|
|
209
213
|
* ([see example]({% slug appearance_button %}#toc-themeColor)).
|
|
210
214
|
*
|
|
211
215
|
* The possible values are:
|
|
212
|
-
* * `
|
|
213
|
-
* * `
|
|
214
|
-
* * `
|
|
215
|
-
* * `
|
|
216
|
-
* * `
|
|
217
|
-
* * `
|
|
218
|
-
* * `
|
|
219
|
-
* * `
|
|
220
|
-
* * `
|
|
221
|
-
* * `
|
|
222
|
-
* * `
|
|
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`
|
|
223
228
|
*/
|
|
224
229
|
set themeColor(themeColor) {
|
|
225
|
-
const
|
|
226
|
-
this.handleThemeColor(
|
|
227
|
-
this._themeColor =
|
|
230
|
+
const newThemeColor = themeColor ? themeColor : DEFAULT_THEME_COLOR;
|
|
231
|
+
this.handleThemeColor(newThemeColor);
|
|
232
|
+
this._themeColor = newThemeColor;
|
|
228
233
|
}
|
|
229
234
|
get themeColor() {
|
|
230
235
|
return this._themeColor;
|
|
231
236
|
}
|
|
232
|
-
/**
|
|
233
|
-
* @hidden
|
|
234
|
-
*
|
|
235
|
-
* The shape property specifies if the Button will form a rectangle or square.
|
|
236
|
-
* ([see example]({% slug appearance_button %}#toc-shape)).
|
|
237
|
-
*
|
|
238
|
-
* The possible values are:
|
|
239
|
-
* * `'square'`
|
|
240
|
-
* * `'rectangle'` (default)
|
|
241
|
-
*/
|
|
242
|
-
set shape(shape) {
|
|
243
|
-
this._shape = shape;
|
|
244
|
-
}
|
|
245
|
-
get shape() {
|
|
246
|
-
return this._shape;
|
|
247
|
-
}
|
|
248
237
|
set isFocused(isFocused) {
|
|
249
238
|
this.toggleClass('k-focus', isFocused);
|
|
250
239
|
this._focused = isFocused;
|
|
@@ -311,8 +300,8 @@ export class ButtonDirective {
|
|
|
311
300
|
this.setAttribute('role', this.role);
|
|
312
301
|
}
|
|
313
302
|
this.ngZone.runOutsideAngular(() => {
|
|
314
|
-
this.
|
|
315
|
-
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) => {
|
|
316
305
|
const isSpaceOrEnter = event.keyCode === Keys.Space || event.keyCode === Keys.Enter;
|
|
317
306
|
if (isSpan && isSpaceOrEnter) {
|
|
318
307
|
this.click.emit(event);
|
|
@@ -340,9 +329,8 @@ export class ButtonDirective {
|
|
|
340
329
|
this.iconNode = null;
|
|
341
330
|
this.iconSpanNode = null;
|
|
342
331
|
this.renderer = null;
|
|
343
|
-
this.
|
|
332
|
+
this.subs.unsubscribe();
|
|
344
333
|
clearTimeout(this.deferTimeout);
|
|
345
|
-
this.domEvents.forEach(unbindHandler => unbindHandler());
|
|
346
334
|
}
|
|
347
335
|
/**
|
|
348
336
|
* Focuses the Button component.
|
|
@@ -533,7 +521,7 @@ export class ButtonDirective {
|
|
|
533
521
|
}
|
|
534
522
|
}
|
|
535
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 });
|
|
536
|
-
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: [
|
|
537
525
|
LocalizationService,
|
|
538
526
|
{
|
|
539
527
|
provide: L10N_PREFIX,
|
|
@@ -579,8 +567,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
579
567
|
type: Input
|
|
580
568
|
}], themeColor: [{
|
|
581
569
|
type: Input
|
|
582
|
-
}], shape: [{
|
|
583
|
-
type: Input
|
|
584
570
|
}], role: [{
|
|
585
571
|
type: Input
|
|
586
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();
|