@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
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Component, HostBinding, Input, Output, EventEmitter, isDevMode } from '@angular/core';
|
|
6
|
+
import { Subscription } from 'rxjs';
|
|
6
7
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
7
8
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
8
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
9
10
|
import { packageMetadata } from '../package-metadata';
|
|
10
|
-
import { closest, getStylingClasses, getThemeColorClasses } from '../util';
|
|
11
|
+
import { closest, getStylingClasses, getThemeColorClasses, isPresent } from '../util';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
12
13
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
13
14
|
import * as i2 from "@angular/common";
|
|
@@ -51,6 +52,7 @@ export class ChipComponent {
|
|
|
51
52
|
this._fillMode = 'solid';
|
|
52
53
|
this._themeColor = 'base';
|
|
53
54
|
this.focused = false;
|
|
55
|
+
this.subs = new Subscription();
|
|
54
56
|
validatePackage(packageMetadata);
|
|
55
57
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
56
58
|
}
|
|
@@ -59,14 +61,16 @@ export class ChipComponent {
|
|
|
59
61
|
* ([see example]({% slug appearance_chip %}#toc-size)).
|
|
60
62
|
*
|
|
61
63
|
* The possible values are:
|
|
62
|
-
* * `
|
|
63
|
-
* * `
|
|
64
|
-
* * `
|
|
65
|
-
* * `
|
|
64
|
+
* * `small`
|
|
65
|
+
* * `medium` (default)
|
|
66
|
+
* * `large`
|
|
67
|
+
* * `none`
|
|
66
68
|
*/
|
|
67
69
|
set size(size) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
if (isPresent(size)) {
|
|
71
|
+
this._size = size;
|
|
72
|
+
}
|
|
73
|
+
this.handleClasses(this._size, 'size');
|
|
70
74
|
}
|
|
71
75
|
get size() {
|
|
72
76
|
return this._size;
|
|
@@ -76,15 +80,17 @@ export class ChipComponent {
|
|
|
76
80
|
* ([see example]({% slug appearance_chip %}#toc-rounded)).
|
|
77
81
|
*
|
|
78
82
|
* The possible values are:
|
|
79
|
-
* * `
|
|
80
|
-
* * `
|
|
81
|
-
* * `
|
|
82
|
-
* * `
|
|
83
|
-
* * `
|
|
83
|
+
* * `small`
|
|
84
|
+
* * `medium` (default)
|
|
85
|
+
* * `large`
|
|
86
|
+
* * `full`
|
|
87
|
+
* * `none`
|
|
84
88
|
*/
|
|
85
89
|
set rounded(rounded) {
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
if (isPresent(rounded)) {
|
|
91
|
+
this._rounded = rounded;
|
|
92
|
+
}
|
|
93
|
+
this.handleClasses(this._rounded, 'rounded');
|
|
88
94
|
}
|
|
89
95
|
get rounded() {
|
|
90
96
|
return this._rounded;
|
|
@@ -94,13 +100,15 @@ export class ChipComponent {
|
|
|
94
100
|
* ([see example]({% slug appearance_chip %}#toc-fillMode)).
|
|
95
101
|
*
|
|
96
102
|
* The possible values are:
|
|
97
|
-
* * `
|
|
98
|
-
* * `
|
|
99
|
-
* * `
|
|
103
|
+
* * `solid` (default)
|
|
104
|
+
* * `outline`
|
|
105
|
+
* * `none`
|
|
100
106
|
*/
|
|
101
107
|
set fillMode(fillMode) {
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
if (isPresent(fillMode)) {
|
|
109
|
+
this._fillMode = fillMode;
|
|
110
|
+
}
|
|
111
|
+
this.handleClasses(this._fillMode, 'fillMode');
|
|
104
112
|
}
|
|
105
113
|
get fillMode() {
|
|
106
114
|
return this._fillMode;
|
|
@@ -111,16 +119,18 @@ export class ChipComponent {
|
|
|
111
119
|
* ([see example]({% slug appearance_chip %}#toc-themeColor)).
|
|
112
120
|
*
|
|
113
121
|
* The possible values are:
|
|
114
|
-
* * `
|
|
115
|
-
* * `
|
|
116
|
-
* * `
|
|
117
|
-
* * `
|
|
118
|
-
* * `
|
|
119
|
-
* * `
|
|
122
|
+
* * `base` (default)
|
|
123
|
+
* * `info`
|
|
124
|
+
* * `success`
|
|
125
|
+
* * `warning`
|
|
126
|
+
* * `error`
|
|
127
|
+
* * `none`
|
|
120
128
|
*/
|
|
121
129
|
set themeColor(themeColor) {
|
|
122
|
-
|
|
123
|
-
|
|
130
|
+
if (isPresent(themeColor)) {
|
|
131
|
+
this._themeColor = themeColor;
|
|
132
|
+
}
|
|
133
|
+
this.handleThemeColor(this._themeColor);
|
|
124
134
|
}
|
|
125
135
|
get themeColor() {
|
|
126
136
|
return this._themeColor;
|
|
@@ -141,16 +151,11 @@ export class ChipComponent {
|
|
|
141
151
|
return this.focused;
|
|
142
152
|
}
|
|
143
153
|
ngOnInit() {
|
|
144
|
-
this.
|
|
145
|
-
.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr');
|
|
154
|
+
this.subs.add(this.localizationService.changes
|
|
155
|
+
.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
|
|
146
156
|
}
|
|
147
157
|
ngOnDestroy() {
|
|
148
|
-
|
|
149
|
-
this.dynamicRTLSubscription.unsubscribe();
|
|
150
|
-
}
|
|
151
|
-
if (this.detachDomEvents) {
|
|
152
|
-
this.detachDomEvents();
|
|
153
|
-
}
|
|
158
|
+
this.subs.unsubscribe();
|
|
154
159
|
}
|
|
155
160
|
ngAfterViewInit() {
|
|
156
161
|
const chip = this.element.nativeElement;
|
|
@@ -216,25 +221,20 @@ export class ChipComponent {
|
|
|
216
221
|
}
|
|
217
222
|
attachElementEventHandlers(chip) {
|
|
218
223
|
this.ngZone.runOutsideAngular(() => {
|
|
219
|
-
|
|
224
|
+
this.subs.add(this.renderer.listen(chip, 'focus', () => {
|
|
220
225
|
this.renderer.addClass(chip, 'k-focus');
|
|
221
|
-
});
|
|
222
|
-
|
|
226
|
+
}));
|
|
227
|
+
this.subs.add(this.renderer.listen(chip, 'blur', () => {
|
|
223
228
|
this.renderer.removeClass(chip, 'k-focus');
|
|
224
|
-
});
|
|
225
|
-
|
|
229
|
+
}));
|
|
230
|
+
this.subs.add(this.renderer.listen(chip, 'click', (e) => {
|
|
226
231
|
const isRemoveClicked = closest(e.target, '.k-chip-remove-action');
|
|
227
232
|
if (!isRemoveClicked) {
|
|
228
233
|
this.ngZone.run(() => {
|
|
229
234
|
this.contentClick.emit({ sender: this, originalEvent: e });
|
|
230
235
|
});
|
|
231
236
|
}
|
|
232
|
-
});
|
|
233
|
-
this.detachDomEvents = () => {
|
|
234
|
-
focusListener();
|
|
235
|
-
blurListener();
|
|
236
|
-
contentClickListener();
|
|
237
|
-
};
|
|
237
|
+
}));
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
/**
|
|
@@ -267,7 +267,7 @@ export class ChipComponent {
|
|
|
267
267
|
const addFillMode = fillMode ? fillMode : this.fillMode;
|
|
268
268
|
const themeColorClass = getThemeColorClasses('chip', removeFillMode, addFillMode, this.themeColor, value);
|
|
269
269
|
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
270
|
-
if (addFillMode !==
|
|
270
|
+
if (addFillMode !== 'none' && fillMode !== 'none') {
|
|
271
271
|
if (themeColorClass.toAdd) {
|
|
272
272
|
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
273
273
|
}
|
package/esm2015/common/models.js
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';
|
|
@@ -12,7 +12,7 @@ import { FocusService } from '../focusable/focus.service';
|
|
|
12
12
|
import { NavigationService } from '../navigation/navigation.service';
|
|
13
13
|
import { NAVIGATION_CONFIG } from '../navigation/navigation-config';
|
|
14
14
|
import { PreventableEvent } from '../preventable-event';
|
|
15
|
-
import { merge } from 'rxjs';
|
|
15
|
+
import { merge, Subscription } from 'rxjs';
|
|
16
16
|
import * as i0 from "@angular/core";
|
|
17
17
|
import * as i1 from "../focusable/focus.service";
|
|
18
18
|
import * as i2 from "../navigation/navigation.service";
|
|
@@ -28,6 +28,7 @@ const NAVIGATION_SETTINGS_PROVIDER = {
|
|
|
28
28
|
provide: NAVIGATION_CONFIG,
|
|
29
29
|
useValue: NAVIGATION_SETTINGS
|
|
30
30
|
};
|
|
31
|
+
const DEFAULT_FILL_MODE = 'solid';
|
|
31
32
|
/**
|
|
32
33
|
* Represents the Kendo UI DropDownButton component for Angular.
|
|
33
34
|
*
|
|
@@ -78,34 +79,22 @@ export class DropDownButtonComponent extends ListButton {
|
|
|
78
79
|
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-size)).
|
|
79
80
|
*
|
|
80
81
|
* The possible values are:
|
|
81
|
-
* * `
|
|
82
|
-
* * `
|
|
83
|
-
* * `
|
|
84
|
-
* * `
|
|
82
|
+
* * `small`
|
|
83
|
+
* * `medium` (default)
|
|
84
|
+
* * `large`
|
|
85
|
+
* * `none`
|
|
85
86
|
*/
|
|
86
87
|
this.size = 'medium';
|
|
87
|
-
/**
|
|
88
|
-
* @hidden
|
|
89
|
-
*
|
|
90
|
-
* The shape property specifies if the DropDownButton will be a square or rectangle.
|
|
91
|
-
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-shape)).
|
|
92
|
-
*
|
|
93
|
-
* The possible values are:
|
|
94
|
-
* * `'rectangle'` (default)
|
|
95
|
-
* * `'square'`
|
|
96
|
-
* * `null`
|
|
97
|
-
*/
|
|
98
|
-
this.shape = 'rectangle';
|
|
99
88
|
/**
|
|
100
89
|
* The rounded property specifies the border radius of the DropDownButton
|
|
101
90
|
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-rounded)).
|
|
102
91
|
*
|
|
103
92
|
* The possible values are:
|
|
104
|
-
* * `
|
|
105
|
-
* * `
|
|
106
|
-
* * `
|
|
107
|
-
* * `
|
|
108
|
-
* * `
|
|
93
|
+
* * `small`
|
|
94
|
+
* * `medium` (default)
|
|
95
|
+
* * `large`
|
|
96
|
+
* * `full`
|
|
97
|
+
* * `none`
|
|
109
98
|
*/
|
|
110
99
|
this.rounded = 'medium';
|
|
111
100
|
/**
|
|
@@ -125,7 +114,7 @@ export class DropDownButtonComponent extends ListButton {
|
|
|
125
114
|
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
126
115
|
* * `light`— Applies coloring based on the `light` theme color.
|
|
127
116
|
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
128
|
-
* * `
|
|
117
|
+
* * `none` —Removes the default CSS class (no class would be rendered).
|
|
129
118
|
*/
|
|
130
119
|
this.themeColor = 'base';
|
|
131
120
|
/**
|
|
@@ -155,7 +144,8 @@ export class DropDownButtonComponent extends ListButton {
|
|
|
155
144
|
*/
|
|
156
145
|
this.onBlur = new EventEmitter();
|
|
157
146
|
this.listId = guid();
|
|
158
|
-
this._fillMode =
|
|
147
|
+
this._fillMode = DEFAULT_FILL_MODE;
|
|
148
|
+
this.popupSubs = new Subscription();
|
|
159
149
|
this._itemClick = this.itemClick;
|
|
160
150
|
this._blur = this.onBlur;
|
|
161
151
|
}
|
|
@@ -206,7 +196,7 @@ export class DropDownButtonComponent extends ListButton {
|
|
|
206
196
|
* * `flat`
|
|
207
197
|
* * `outline`
|
|
208
198
|
* * `link`
|
|
209
|
-
* * `
|
|
199
|
+
* * `none`
|
|
210
200
|
*/
|
|
211
201
|
set fillMode(fillMode) {
|
|
212
202
|
this._fillMode = fillMode === 'clear' ? 'flat' : fillMode;
|
|
@@ -407,11 +397,11 @@ export class DropDownButtonComponent extends ListButton {
|
|
|
407
397
|
|| (this.popupRef && this.popupRef.popupElement.contains(element));
|
|
408
398
|
}
|
|
409
399
|
subscribeNavigationEvents() {
|
|
410
|
-
this.
|
|
411
|
-
.subscribe(this.onArrowKeyNavigate.bind(this));
|
|
412
|
-
this.
|
|
413
|
-
this.
|
|
414
|
-
this.
|
|
400
|
+
this.subs.add(this.navigationService.navigate
|
|
401
|
+
.subscribe(this.onArrowKeyNavigate.bind(this)));
|
|
402
|
+
this.subs.add(this.navigationService.enterup.subscribe(this.onNavigationEnterUp.bind(this)));
|
|
403
|
+
this.subs.add(this.navigationService.open.subscribe(this.onNavigationOpen.bind(this)));
|
|
404
|
+
this.subs.add(merge(this.navigationService.close, this.navigationService.esc).subscribe(this.onNavigationClose.bind(this)));
|
|
415
405
|
}
|
|
416
406
|
onNavigationEnterUp() {
|
|
417
407
|
if (!this._disabled && !this.openState) {
|
|
@@ -464,18 +454,19 @@ export class DropDownButtonComponent extends ListButton {
|
|
|
464
454
|
popupAlign: this.popupAlign,
|
|
465
455
|
popupClass: this.popupClasses
|
|
466
456
|
});
|
|
467
|
-
this.popupRef.popupAnchorViewportLeave.subscribe(() => this.openState = false);
|
|
468
|
-
this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this));
|
|
457
|
+
this.popupSubs.add(this.popupRef.popupAnchorViewportLeave.subscribe(() => this.openState = false));
|
|
458
|
+
this.popupSubs.add(this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this)));
|
|
469
459
|
}
|
|
470
460
|
destroyPopup() {
|
|
471
461
|
if (this.popupRef) {
|
|
472
462
|
this.popupRef.close();
|
|
473
463
|
this.popupRef = null;
|
|
464
|
+
this.popupSubs.unsubscribe();
|
|
474
465
|
}
|
|
475
466
|
}
|
|
476
467
|
}
|
|
477
468
|
DropDownButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropDownButtonComponent, deps: [{ token: i1.FocusService }, { token: i2.NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.PopupService }, { token: i0.ElementRef }, { token: i4.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
478
|
-
DropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: { icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", popupSettings: "popupSettings", textField: "textField", disabled: "disabled", data: "data", size: "size",
|
|
469
|
+
DropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: { 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" }, outputs: { itemClick: "itemClick", open: "open", close: "close", onFocus: "focus", onBlur: "blur" }, host: { listeners: { "keydown": "keydown($event)", "keypress": "keypress($event)", "keyup": "keyup($event)", "mousedown": "mousedown($event)", "mouseup": "mouseup($event)" }, properties: { "class.k-focus": "this.focused", "class.k-dropdown-button": "this.widgetClasses", "attr.dir": "this.dir" } }, providers: [
|
|
479
470
|
FocusService,
|
|
480
471
|
NavigationService,
|
|
481
472
|
NAVIGATION_SETTINGS_PROVIDER,
|
|
@@ -526,7 +517,7 @@ DropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
|
|
|
526
517
|
</kendo-button-list>
|
|
527
518
|
</ng-template>
|
|
528
519
|
<ng-container #container></ng-container>
|
|
529
|
-
`, isInline: true, components: [{ type: i5.ListComponent, selector: "kendo-button-list", inputs: ["data", "textField", "itemTemplate", "size"], outputs: ["onItemClick", "onItemBlur"] }], directives: [{ type: i6.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "
|
|
520
|
+
`, isInline: true, components: [{ type: i5.ListComponent, selector: "kendo-button-list", inputs: ["data", "textField", "itemTemplate", "size"], outputs: ["onItemClick", "onItemBlur"] }], directives: [{ type: i6.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
530
521
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropDownButtonComponent, decorators: [{
|
|
531
522
|
type: Component,
|
|
532
523
|
args: [{
|
|
@@ -602,8 +593,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
602
593
|
type: Input
|
|
603
594
|
}], size: [{
|
|
604
595
|
type: Input
|
|
605
|
-
}], shape: [{
|
|
606
|
-
type: Input
|
|
607
596
|
}], rounded: [{
|
|
608
597
|
type: Input
|
|
609
598
|
}], fillMode: [{
|
|
@@ -74,6 +74,7 @@ DialItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
|
|
|
74
74
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DialItemComponent, decorators: [{
|
|
75
75
|
type: Component,
|
|
76
76
|
args: [{
|
|
77
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
77
78
|
selector: '[kendoDialItem]',
|
|
78
79
|
template: `
|
|
79
80
|
<ng-template *ngIf="dialItemTemplate"
|
|
@@ -53,6 +53,7 @@ DialListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", vers
|
|
|
53
53
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DialListComponent, decorators: [{
|
|
54
54
|
type: Component,
|
|
55
55
|
args: [{
|
|
56
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
56
57
|
selector: '[kendoDialList]',
|
|
57
58
|
template: `
|
|
58
59
|
<ng-container *ngFor='let item of dialItems; let idx = index'>
|
|
@@ -50,6 +50,9 @@ const FILLMODE_CLASS = 'k-fab-solid';
|
|
|
50
50
|
const DEFAULT_DURATION = 180;
|
|
51
51
|
const DEFAULT_ITEM_GAP = 90;
|
|
52
52
|
const DEFAULT_OFFSET = '16px';
|
|
53
|
+
const DEFAULT_ROUNDED = 'full';
|
|
54
|
+
const DEFAULT_SIZE = 'medium';
|
|
55
|
+
const DEFAULT_THEME_COLOR = 'primary';
|
|
53
56
|
/**
|
|
54
57
|
*
|
|
55
58
|
* Represents the [Kendo UI FloatingActionButton component for Angular]({% slug overview_floatingactionbutton %}).
|
|
@@ -124,13 +127,12 @@ export class FloatingActionButtonComponent {
|
|
|
124
127
|
* @hidden
|
|
125
128
|
*/
|
|
126
129
|
this.id = `k-${guid()}`;
|
|
127
|
-
this._themeColor =
|
|
128
|
-
this._size =
|
|
129
|
-
this.
|
|
130
|
+
this._themeColor = DEFAULT_THEME_COLOR;
|
|
131
|
+
this._size = DEFAULT_SIZE;
|
|
132
|
+
this._rounded = DEFAULT_ROUNDED;
|
|
130
133
|
this._disabled = false;
|
|
131
134
|
this._align = { horizontal: 'end', vertical: 'bottom' };
|
|
132
135
|
this._offset = { x: DEFAULT_OFFSET, y: DEFAULT_OFFSET };
|
|
133
|
-
this._rounded = 'full';
|
|
134
136
|
this.subscriptions = new Subscription();
|
|
135
137
|
this.rtl = false;
|
|
136
138
|
this.animationEnd = new EventEmitter();
|
|
@@ -154,20 +156,22 @@ export class FloatingActionButtonComponent {
|
|
|
154
156
|
* The theme color will be applied as background color of the component.
|
|
155
157
|
*
|
|
156
158
|
* The possible values are:
|
|
157
|
-
* * `
|
|
158
|
-
* * `
|
|
159
|
-
* * `
|
|
160
|
-
* * `
|
|
161
|
-
* * `
|
|
162
|
-
* * `
|
|
163
|
-
* * `
|
|
164
|
-
* * `
|
|
165
|
-
* * `
|
|
166
|
-
* * `
|
|
159
|
+
* * `primary` (Default)—Applies coloring based on the `primary` theme color.
|
|
160
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
161
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
162
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
163
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
164
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
165
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
166
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
167
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
168
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
169
|
+
* * `none`— Removes the built in theme color.
|
|
167
170
|
*/
|
|
168
171
|
set themeColor(themeColor) {
|
|
169
|
-
|
|
170
|
-
this.
|
|
172
|
+
const newThemeColor = themeColor ? themeColor : DEFAULT_THEME_COLOR;
|
|
173
|
+
this.handleClasses(newThemeColor, 'themeColor');
|
|
174
|
+
this._themeColor = newThemeColor;
|
|
171
175
|
}
|
|
172
176
|
get themeColor() {
|
|
173
177
|
return this._themeColor;
|
|
@@ -177,13 +181,15 @@ export class FloatingActionButtonComponent {
|
|
|
177
181
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-size)).
|
|
178
182
|
*
|
|
179
183
|
* The possible values are:
|
|
180
|
-
* * `
|
|
181
|
-
* * `
|
|
182
|
-
* * `
|
|
184
|
+
* * `small`
|
|
185
|
+
* * `medium` (Default)
|
|
186
|
+
* * `large`
|
|
187
|
+
* * `none`
|
|
183
188
|
*/
|
|
184
189
|
set size(size) {
|
|
185
|
-
|
|
186
|
-
this.
|
|
190
|
+
const newSize = size ? size : DEFAULT_SIZE;
|
|
191
|
+
this.handleClasses(newSize, 'size');
|
|
192
|
+
this._size = newSize;
|
|
187
193
|
}
|
|
188
194
|
get size() {
|
|
189
195
|
return this._size;
|
|
@@ -192,36 +198,20 @@ export class FloatingActionButtonComponent {
|
|
|
192
198
|
* The rounded property specifies the border radius of the FloatingActionButton.
|
|
193
199
|
*
|
|
194
200
|
* The possible values are:
|
|
195
|
-
* * `
|
|
196
|
-
* * `
|
|
197
|
-
* * `
|
|
198
|
-
* * `
|
|
199
|
-
* * `
|
|
201
|
+
* * `small`
|
|
202
|
+
* * `medium`
|
|
203
|
+
* * `large`
|
|
204
|
+
* * `full` (default)
|
|
205
|
+
* * `none`
|
|
200
206
|
*/
|
|
201
207
|
set rounded(rounded) {
|
|
202
|
-
|
|
203
|
-
this.
|
|
208
|
+
const newRounded = rounded ? rounded : DEFAULT_ROUNDED;
|
|
209
|
+
this.handleClasses(newRounded, 'rounded');
|
|
210
|
+
this._rounded = newRounded;
|
|
204
211
|
}
|
|
205
212
|
get rounded() {
|
|
206
213
|
return this._rounded;
|
|
207
214
|
}
|
|
208
|
-
/**
|
|
209
|
-
* @hidden
|
|
210
|
-
*
|
|
211
|
-
* Specifies the shape of the FloatingActionButton
|
|
212
|
-
* ([see example]({% slug appearance_floatingactionbutton %}#toc-shape)).
|
|
213
|
-
*
|
|
214
|
-
* The possible values are:
|
|
215
|
-
* * `rectangle` (Default)—Applies rectangular shape on the FloatingActionButton.
|
|
216
|
-
* * `square`—Applies square shape on the FloatingActionButton.
|
|
217
|
-
*
|
|
218
|
-
*/
|
|
219
|
-
set shape(shape) {
|
|
220
|
-
this._shape = shape;
|
|
221
|
-
}
|
|
222
|
-
get shape() {
|
|
223
|
-
return this._shape;
|
|
224
|
-
}
|
|
225
215
|
/**
|
|
226
216
|
* Specifies whether the FloatingActionButton is disabled.
|
|
227
217
|
*/
|
|
@@ -313,7 +303,12 @@ export class FloatingActionButtonComponent {
|
|
|
313
303
|
if (this.disabled || shouldOpen === this.isOpen) {
|
|
314
304
|
return;
|
|
315
305
|
}
|
|
316
|
-
|
|
306
|
+
if (shouldOpen) {
|
|
307
|
+
setTimeout(() => this.openDial());
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
this.closeDial();
|
|
311
|
+
}
|
|
317
312
|
}
|
|
318
313
|
/**
|
|
319
314
|
* @hidden
|
|
@@ -422,7 +417,7 @@ export class FloatingActionButtonComponent {
|
|
|
422
417
|
rounded: ROUNDED_CLASSES[this.rounded]
|
|
423
418
|
};
|
|
424
419
|
const classesToAdd = {
|
|
425
|
-
themeColor: inputValue ? `${FILLMODE_CLASS}-${inputValue}` :
|
|
420
|
+
themeColor: inputValue !== 'none' ? `${FILLMODE_CLASS}-${inputValue}` : '',
|
|
426
421
|
size: SIZE_CLASSES[inputValue],
|
|
427
422
|
rounded: ROUNDED_CLASSES[inputValue]
|
|
428
423
|
};
|
|
@@ -489,11 +484,21 @@ export class FloatingActionButtonComponent {
|
|
|
489
484
|
return;
|
|
490
485
|
}
|
|
491
486
|
const event = new PreventableEvent();
|
|
492
|
-
|
|
487
|
+
if (open) {
|
|
488
|
+
this.open.emit(event);
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
this.close.emit(event);
|
|
492
|
+
}
|
|
493
493
|
if (event.isDefaultPrevented()) {
|
|
494
494
|
return;
|
|
495
495
|
}
|
|
496
|
-
|
|
496
|
+
if (open) {
|
|
497
|
+
this.openDial();
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
this.closeDial();
|
|
501
|
+
}
|
|
497
502
|
}
|
|
498
503
|
openPopup() {
|
|
499
504
|
if (this.isOpen) {
|
|
@@ -664,7 +669,7 @@ export class FloatingActionButtonComponent {
|
|
|
664
669
|
}
|
|
665
670
|
}
|
|
666
671
|
FloatingActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FloatingActionButtonComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i1.FocusService }, { token: i2.NavigationService }, { token: i0.NgZone }, { token: i3.PopupService }, { token: i4.AnimationBuilder }, { token: i5.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
667
|
-
FloatingActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FloatingActionButtonComponent, selector: "kendo-floatingactionbutton", inputs: { themeColor: "themeColor", size: "size", rounded: "rounded",
|
|
672
|
+
FloatingActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FloatingActionButtonComponent, selector: "kendo-floatingactionbutton", inputs: { themeColor: "themeColor", size: "size", rounded: "rounded", disabled: "disabled", align: "align", offset: "offset", positionMode: "positionMode", icon: "icon", iconClass: "iconClass", buttonClass: "buttonClass", dialClass: "dialClass", text: "text", dialItemAnimation: "dialItemAnimation", tabIndex: "tabIndex", dialItems: "dialItems" }, outputs: { onBlur: "blur", onFocus: "focus", dialItemClick: "dialItemClick", open: "open", close: "close" }, host: { properties: { "class.k-pos-fixed": "this.fixedClass", "class.k-pos-absolute": "this.absoluteClass", "attr.dir": "this.direction" } }, providers: [
|
|
668
673
|
FocusService,
|
|
669
674
|
NavigationService,
|
|
670
675
|
NAVIGATION_SETTINGS_PROVIDER,
|
|
@@ -807,8 +812,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
807
812
|
type: Input
|
|
808
813
|
}], rounded: [{
|
|
809
814
|
type: Input
|
|
810
|
-
}], shape: [{
|
|
811
|
-
type: Input
|
|
812
815
|
}], disabled: [{
|
|
813
816
|
type: Input
|
|
814
817
|
}], align: [{
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Directive, Input } from '@angular/core';
|
|
6
|
+
import { Subscription } from 'rxjs';
|
|
6
7
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
import * as i1 from "./focus.service";
|
|
@@ -13,6 +14,7 @@ export class FocusableDirective {
|
|
|
13
14
|
constructor(focusService, elementRef, renderer) {
|
|
14
15
|
this.focusService = focusService;
|
|
15
16
|
this.renderer = renderer;
|
|
17
|
+
this.subs = new Subscription();
|
|
16
18
|
this.element = elementRef.nativeElement;
|
|
17
19
|
this.subscribeEvents();
|
|
18
20
|
}
|
|
@@ -28,13 +30,13 @@ export class FocusableDirective {
|
|
|
28
30
|
* @hidden
|
|
29
31
|
*/
|
|
30
32
|
ngOnDestroy() {
|
|
31
|
-
this.
|
|
33
|
+
this.subs.unsubscribe();
|
|
32
34
|
}
|
|
33
35
|
subscribeEvents() {
|
|
34
36
|
if (!isDocumentAvailable()) {
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
37
|
-
this.
|
|
39
|
+
this.subs.add(this.focusService.onFocus.subscribe((index) => {
|
|
38
40
|
if (this.index === index) {
|
|
39
41
|
this.renderer.addClass(this.element, 'k-focus');
|
|
40
42
|
this.element.focus();
|
|
@@ -42,15 +44,7 @@ export class FocusableDirective {
|
|
|
42
44
|
else {
|
|
43
45
|
this.renderer.removeClass(this.element, 'k-focus');
|
|
44
46
|
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
unsubscribeEvents() {
|
|
48
|
-
if (!isDocumentAvailable()) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (this.focusSubscription) {
|
|
52
|
-
this.focusSubscription.unsubscribe();
|
|
53
|
-
}
|
|
47
|
+
}));
|
|
54
48
|
}
|
|
55
49
|
}
|
|
56
50
|
FocusableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusableDirective, deps: [{ token: i1.FocusService }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|