@progress/kendo-angular-buttons 17.0.0-develop.3 → 17.0.0-develop.31
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 +27 -106
- package/button/button.component.d.ts +3 -9
- package/button/selection-settings.d.ts +1 -1
- package/buttongroup/buttongroup.component.d.ts +2 -2
- package/chip/chip-list.component.d.ts +4 -4
- package/chip/chip.component.d.ts +4 -7
- package/chip/models/avatar-settings.interface.d.ts +33 -0
- package/chip/models/selection.d.ts +1 -1
- package/common/models/fillmode.d.ts +2 -2
- package/common/models/rounded.d.ts +2 -2
- package/common/models/size.d.ts +3 -3
- package/common/models/theme-color.d.ts +2 -2
- package/direction.d.ts +1 -1
- package/dropdownbutton/dropdownbutton.component.d.ts +7 -10
- package/{esm2020 → esm2022}/button/button.component.mjs +80 -108
- package/{esm2020 → esm2022}/button/button.module.mjs +4 -4
- package/{esm2020 → esm2022}/button/button.service.mjs +5 -7
- package/{esm2020 → esm2022}/buttongroup/buttongroup.component.mjs +79 -56
- package/{esm2020 → esm2022}/buttongroup/buttongroup.module.mjs +4 -4
- package/{esm2020 → esm2022}/buttons.module.mjs +4 -4
- package/{esm2020 → esm2022}/chip/chip-list.component.mjs +58 -48
- package/{esm2020 → esm2022}/chip/chip.component.mjs +155 -93
- package/{esm2020 → esm2022}/chip/chip.module.mjs +4 -4
- package/{esm2020 → esm2022}/dropdownbutton/dropdownbutton.component.mjs +130 -118
- package/{esm2020 → esm2022}/dropdownbutton/dropdownbutton.module.mjs +4 -4
- package/{esm2020 → esm2022}/floatingactionbutton/dial-item.component.mjs +21 -11
- package/{esm2020 → esm2022}/floatingactionbutton/dial-list.component.mjs +16 -11
- package/{esm2020 → esm2022}/floatingactionbutton/floatingactionbutton.component.mjs +145 -102
- package/{esm2020 → esm2022}/floatingactionbutton/floatingactionbutton.module.mjs +4 -4
- package/{esm2020 → esm2022}/floatingactionbutton/templates/dial-item-template.directive.mjs +4 -3
- package/{esm2020 → esm2022}/floatingactionbutton/templates/fab-template.directive.mjs +4 -3
- package/{esm2020 → esm2022}/focusable/focus.service.mjs +5 -6
- package/{esm2020 → esm2022}/focusable/focusable.directive.mjs +8 -4
- package/{esm2020 → esm2022}/listbutton/button-item-template.directive.mjs +4 -3
- package/{esm2020 → esm2022}/listbutton/container.service.mjs +5 -3
- package/{esm2020 → esm2022}/listbutton/list-button.mjs +88 -51
- package/{esm2020 → esm2022}/listbutton/list.component.mjs +13 -10
- package/{esm2020 → esm2022}/listbutton/list.module.mjs +8 -8
- package/esm2022/listbutton/popup-settings.mjs +5 -0
- package/{esm2020 → esm2022}/navigation/navigation.service.mjs +12 -11
- package/{esm2020 → esm2022}/package-metadata.mjs +2 -2
- package/{esm2020 → esm2022}/preventable-event.mjs +1 -3
- package/{esm2020 → esm2022}/splitbutton/localization/custom-messages.component.mjs +7 -6
- package/{esm2020 → esm2022}/splitbutton/localization/localized-messages.directive.mjs +9 -8
- package/esm2022/splitbutton/localization/messages.mjs +45 -0
- package/{esm2020 → esm2022}/splitbutton/splitbutton.component.mjs +213 -189
- package/{esm2020 → esm2022}/splitbutton/splitbutton.module.mjs +4 -4
- package/{esm2020 → esm2022}/util.mjs +6 -0
- package/{fesm2020 → fesm2022}/progress-kendo-angular-buttons.mjs +1324 -1089
- package/floatingactionbutton/dial-item.component.d.ts +1 -1
- package/floatingactionbutton/dial-list.component.d.ts +1 -1
- package/floatingactionbutton/floatingactionbutton.component.d.ts +1 -1
- package/floatingactionbutton/models/position-mode.d.ts +1 -1
- package/focusable/focusable.directive.d.ts +1 -1
- package/index.d.ts +1 -0
- package/listbutton/list-button.d.ts +9 -4
- package/listbutton/list.component.d.ts +1 -1
- package/package.json +15 -21
- package/splitbutton/localization/messages.d.ts +1 -1
- package/splitbutton/splitbutton.component.d.ts +8 -16
- package/util.d.ts +6 -0
- package/esm2020/splitbutton/localization/messages.mjs +0 -23
- package/fesm2015/progress-kendo-angular-buttons.mjs +0 -5589
- /package/{esm2020 → esm2022}/button/selection-settings.mjs +0 -0
- /package/{esm2020 → esm2022}/chip/chip-content-click-event-args.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/chip/chip-list-remove-event-args.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/chip/chip-remove-event-args.interface.mjs +0 -0
- /package/{esm2020/chip/models/selection.mjs → esm2022/chip/models/avatar-settings.interface.mjs} +0 -0
- /package/{esm2020/common/models/arrow-settings.mjs → esm2022/chip/models/selection.mjs} +0 -0
- /package/{esm2020/common/models/fillmode.mjs → esm2022/common/models/arrow-settings.mjs} +0 -0
- /package/{esm2020/common/models/rounded.mjs → esm2022/common/models/fillmode.mjs} +0 -0
- /package/{esm2020/common/models/size.mjs → esm2022/common/models/rounded.mjs} +0 -0
- /package/{esm2020/common/models/styling-classes.mjs → esm2022/common/models/size.mjs} +0 -0
- /package/{esm2020/common/models/theme-color.mjs → esm2022/common/models/styling-classes.mjs} +0 -0
- /package/{esm2020/direction.mjs → esm2022/common/models/theme-color.mjs} +0 -0
- /package/{esm2020 → esm2022}/common/models.mjs +0 -0
- /package/{esm2020/floatingactionbutton/models/align.mjs → esm2022/direction.mjs} +0 -0
- /package/{esm2020 → esm2022}/directives.mjs +0 -0
- /package/{esm2020 → esm2022}/floatingactionbutton/animations/animations.mjs +0 -0
- /package/{esm2020/floatingactionbutton/models/item-animation.interface.mjs → esm2022/floatingactionbutton/models/align.mjs} +0 -0
- /package/{esm2020/floatingactionbutton/models/item-click.event.mjs → esm2022/floatingactionbutton/models/item-animation.interface.mjs} +0 -0
- /package/{esm2020/floatingactionbutton/models/item.interface.mjs → esm2022/floatingactionbutton/models/item-click.event.mjs} +0 -0
- /package/{esm2020/floatingactionbutton/models/offset.mjs → esm2022/floatingactionbutton/models/item.interface.mjs} +0 -0
- /package/{esm2020/floatingactionbutton/models/position-mode.mjs → esm2022/floatingactionbutton/models/offset.mjs} +0 -0
- /package/{esm2020/listbutton/list-item-model.mjs → esm2022/floatingactionbutton/models/position-mode.mjs} +0 -0
- /package/{esm2020 → esm2022}/floatingactionbutton/utils.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020/listbutton/popup-settings.mjs → esm2022/listbutton/list-item-model.mjs} +0 -0
- /package/{esm2020 → esm2022}/navigation/key-events.mjs +0 -0
- /package/{esm2020 → esm2022}/navigation/navigation-action.mjs +0 -0
- /package/{esm2020 → esm2022}/navigation/navigation-config.mjs +0 -0
- /package/{esm2020 → esm2022}/progress-kendo-angular-buttons.mjs +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, Renderer2, Output, Optional, NgZone, isDevMode } from '@angular/core';
|
|
6
6
|
import { KendoButtonService } from './button.service';
|
|
7
|
-
import { isDocumentAvailable, isChanged, hasObservers,
|
|
7
|
+
import { isDocumentAvailable, isChanged, hasObservers, isSafari, isFirefox } from '@progress/kendo-angular-common';
|
|
8
8
|
import { caretAltDownIcon } from '@progress/kendo-svg-icons';
|
|
9
9
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
10
10
|
import { Subscription } from 'rxjs';
|
|
@@ -16,9 +16,6 @@ import { NgIf, NgClass } from '@angular/common';
|
|
|
16
16
|
import * as i0 from "@angular/core";
|
|
17
17
|
import * as i1 from "./button.service";
|
|
18
18
|
import * as i2 from "@progress/kendo-angular-l10n";
|
|
19
|
-
const SPAN_TAG_NAME = 'SPAN';
|
|
20
|
-
const BUTTON_TAG_NAME = 'BUTTON';
|
|
21
|
-
const KENDO_BUTTON_TAG_NAME = 'KENDO-BUTTON';
|
|
22
19
|
const DEFAULT_ROUNDED = 'medium';
|
|
23
20
|
const DEFAULT_SIZE = 'medium';
|
|
24
21
|
const DEFAULT_THEME_COLOR = 'base';
|
|
@@ -26,54 +23,25 @@ const DEFAULT_FILL_MODE = 'solid';
|
|
|
26
23
|
/**
|
|
27
24
|
* Represents the Kendo UI Button component for Angular.
|
|
28
25
|
*
|
|
29
|
-
* As of package
|
|
30
|
-
*
|
|
31
|
-
* to avoid discrepancies between the behavior of the `ButtonComponent` and the native HTML Button element.
|
|
26
|
+
* As of package v17, the `span[kendoButton]` and `kendo-button` selectors are removed.
|
|
27
|
+
* Please use the `button[kendoButton]` selector only.
|
|
32
28
|
*/
|
|
33
29
|
export class ButtonComponent {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.toggleable = false;
|
|
50
|
-
/**
|
|
51
|
-
* @hidden
|
|
52
|
-
*/
|
|
53
|
-
this.role = 'button';
|
|
54
|
-
/**
|
|
55
|
-
* Fires each time the selected state of a toggleable button is changed.
|
|
56
|
-
*
|
|
57
|
-
* The event argument is the new selected state (boolean).
|
|
58
|
-
*/
|
|
59
|
-
this.selectedChange = new EventEmitter();
|
|
60
|
-
/**
|
|
61
|
-
* Fires each time the user clicks the button.
|
|
62
|
-
*/
|
|
63
|
-
this.click = new EventEmitter();
|
|
64
|
-
this.isDisabled = false;
|
|
65
|
-
this.caretAltDownIcon = caretAltDownIcon;
|
|
66
|
-
this._size = DEFAULT_SIZE;
|
|
67
|
-
this._rounded = DEFAULT_ROUNDED;
|
|
68
|
-
this._fillMode = DEFAULT_FILL_MODE;
|
|
69
|
-
this._themeColor = DEFAULT_THEME_COLOR;
|
|
70
|
-
this._focused = false;
|
|
71
|
-
this.subs = new Subscription();
|
|
72
|
-
validatePackage(packageMetadata);
|
|
73
|
-
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
74
|
-
this.subs.add(localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr')));
|
|
75
|
-
this.element = element.nativeElement;
|
|
76
|
-
}
|
|
30
|
+
renderer;
|
|
31
|
+
service;
|
|
32
|
+
ngZone;
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
* @default false
|
|
36
|
+
* required for DropDownButton arrow icon.
|
|
37
|
+
*/
|
|
38
|
+
arrowIcon = false;
|
|
39
|
+
/**
|
|
40
|
+
* Provides visual styling that indicates if the Button is active.
|
|
41
|
+
*
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
toggleable = false;
|
|
77
45
|
/**
|
|
78
46
|
* Backwards-compatible alias
|
|
79
47
|
*
|
|
@@ -108,6 +76,11 @@ export class ButtonComponent {
|
|
|
108
76
|
get tabIndex() {
|
|
109
77
|
return this.element.tabIndex;
|
|
110
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Defines a URL which is used for an `img` element inside the Button.
|
|
81
|
+
* The URL can be relative or absolute. If relative, it is evaluated with relation to the web page URL.
|
|
82
|
+
*/
|
|
83
|
+
imageUrl;
|
|
111
84
|
/**
|
|
112
85
|
* Defines a CSS class—or multiple classes separated by spaces—
|
|
113
86
|
* which are applied to a `span` element inside the Button. Allows the usage of custom icons.
|
|
@@ -218,6 +191,30 @@ export class ButtonComponent {
|
|
|
218
191
|
get svgIcon() {
|
|
219
192
|
return this._svgIcon;
|
|
220
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Fires each time the selected state of a toggleable button is changed.
|
|
196
|
+
*
|
|
197
|
+
* The event argument is the new selected state (boolean).
|
|
198
|
+
*/
|
|
199
|
+
selectedChange = new EventEmitter();
|
|
200
|
+
/**
|
|
201
|
+
* Fires each time the user clicks the button.
|
|
202
|
+
*/
|
|
203
|
+
click = new EventEmitter();
|
|
204
|
+
element;
|
|
205
|
+
isDisabled = false;
|
|
206
|
+
caretAltDownIcon = caretAltDownIcon;
|
|
207
|
+
_size = DEFAULT_SIZE;
|
|
208
|
+
_rounded = DEFAULT_ROUNDED;
|
|
209
|
+
_fillMode = DEFAULT_FILL_MODE;
|
|
210
|
+
_themeColor = DEFAULT_THEME_COLOR;
|
|
211
|
+
_focused = false;
|
|
212
|
+
direction;
|
|
213
|
+
_selected;
|
|
214
|
+
subs = new Subscription();
|
|
215
|
+
_iconClass;
|
|
216
|
+
_icon;
|
|
217
|
+
_svgIcon;
|
|
221
218
|
set isFocused(isFocused) {
|
|
222
219
|
this.toggleClass('k-focus', isFocused);
|
|
223
220
|
this._focused = isFocused;
|
|
@@ -235,10 +232,6 @@ export class ButtonComponent {
|
|
|
235
232
|
const hasIcon = this.icon || this.iconClass || this.imageUrl || this.svgIcon;
|
|
236
233
|
return hasIcon && !this.hasText;
|
|
237
234
|
}
|
|
238
|
-
get roleSetter() {
|
|
239
|
-
const isButtonElementAndRole = this.element.tagName === BUTTON_TAG_NAME && this.role === 'button';
|
|
240
|
-
return isButtonElementAndRole ? undefined : this.role;
|
|
241
|
-
}
|
|
242
235
|
get classDisabled() {
|
|
243
236
|
return this.isDisabled;
|
|
244
237
|
}
|
|
@@ -288,42 +281,24 @@ export class ButtonComponent {
|
|
|
288
281
|
get nativeElement() {
|
|
289
282
|
return this.element;
|
|
290
283
|
}
|
|
284
|
+
constructor(element, renderer, service, localization, ngZone) {
|
|
285
|
+
this.renderer = renderer;
|
|
286
|
+
this.service = service;
|
|
287
|
+
this.ngZone = ngZone;
|
|
288
|
+
validatePackage(packageMetadata);
|
|
289
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
290
|
+
this.subs.add(localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr')));
|
|
291
|
+
this.element = element.nativeElement;
|
|
292
|
+
}
|
|
291
293
|
ngOnInit() {
|
|
292
|
-
const elementTagName = this.element.tagName;
|
|
293
|
-
const isSpanOrKendoButton = elementTagName === SPAN_TAG_NAME || elementTagName === KENDO_BUTTON_TAG_NAME;
|
|
294
294
|
if (!this.element.hasAttribute('role') && this.togglable) {
|
|
295
295
|
this.toggleAriaPressed(this.toggleable);
|
|
296
296
|
}
|
|
297
|
-
if (this.role) {
|
|
298
|
-
const isButtonElementAndRole = elementTagName === BUTTON_TAG_NAME && this.role === 'button';
|
|
299
|
-
if (!isButtonElementAndRole) {
|
|
300
|
-
this.setAttribute('role', this.role);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
if (isSpanOrKendoButton && !this.isDisabled) {
|
|
304
|
-
this.tabIndex = 0;
|
|
305
|
-
}
|
|
306
|
-
if (isDevMode() && isSpanOrKendoButton) {
|
|
307
|
-
console.warn(`As of package v16, the "span[kendoButton]" and "kendo-button" selectors are deprecated and can
|
|
308
|
-
be removed in a future major version. We recommend using the "button[kendoButton]" selector
|
|
309
|
-
to avoid discrepancies between the behavior of the "ButtonComponent" and the native HTML Button element.`);
|
|
310
|
-
}
|
|
311
297
|
this.ngZone.runOutsideAngular(() => {
|
|
312
298
|
this.subs.add(this.renderer.listen(this.element, 'click', this._onButtonClick.bind(this)));
|
|
313
|
-
this.subs.add(this.renderer.listen(this.element, 'keydown', (event) => {
|
|
314
|
-
const isSpaceOrEnter = event.keyCode === Keys.Space || event.keyCode === Keys.Enter;
|
|
315
|
-
if (isSpanOrKendoButton && isSpaceOrEnter) {
|
|
316
|
-
this.ngZone.run(() => {
|
|
317
|
-
this.click.emit(event);
|
|
318
|
-
});
|
|
319
|
-
this._onButtonClick();
|
|
320
|
-
}
|
|
321
|
-
}));
|
|
322
299
|
this.subs.add(this.renderer.listen(this.element, 'mousedown', (event) => {
|
|
323
|
-
const elementTagName = this.element.tagName;
|
|
324
|
-
const isButton = elementTagName === BUTTON_TAG_NAME;
|
|
325
300
|
const isBrowserSafari = isDocumentAvailable() && isSafari(navigator.userAgent);
|
|
326
|
-
if (!this.isDisabled &&
|
|
301
|
+
if (!this.isDisabled && isBrowserSafari) {
|
|
327
302
|
event.preventDefault();
|
|
328
303
|
this.element.focus();
|
|
329
304
|
}
|
|
@@ -450,15 +425,14 @@ export class ButtonComponent {
|
|
|
450
425
|
}
|
|
451
426
|
}
|
|
452
427
|
}
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
], exportAs: ["kendoButton"], usesOnChanges: true, ngImport: i0, template: `
|
|
428
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.KendoButtonService, optional: true }, { token: i2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
429
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ButtonComponent, isStandalone: true, selector: "button[kendoButton]", inputs: { arrowIcon: "arrowIcon", toggleable: "toggleable", togglable: "togglable", selected: "selected", tabIndex: "tabIndex", imageUrl: "imageUrl", iconClass: "iconClass", icon: "icon", disabled: "disabled", size: "size", rounded: "rounded", fillMode: "fillMode", themeColor: "themeColor", svgIcon: "svgIcon", 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", "class.k-icon-button": "this.iconButtonClass", "attr.aria-disabled": "this.classDisabled", "class.k-disabled": "this.classDisabled", "class.k-selected": "this.classActive", "attr.dir": "this.getDirection" } }, providers: [
|
|
430
|
+
LocalizationService,
|
|
431
|
+
{
|
|
432
|
+
provide: L10N_PREFIX,
|
|
433
|
+
useValue: 'kendo.button'
|
|
434
|
+
}
|
|
435
|
+
], exportAs: ["kendoButton"], usesOnChanges: true, ngImport: i0, template: `
|
|
462
436
|
<kendo-icon-wrapper
|
|
463
437
|
*ngIf="icon || svgIcon"
|
|
464
438
|
innerCssClass="k-button-icon"
|
|
@@ -470,13 +444,15 @@ ButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", versio
|
|
|
470
444
|
<span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
|
|
471
445
|
<span class="k-button-text"><ng-content></ng-content></span>
|
|
472
446
|
<span *ngIf="$any(arrowIcon).iconClass" class="k-button-icon" [ngClass]="$any(arrowIcon).iconClass"></span>
|
|
473
|
-
<
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
447
|
+
<span *ngIf="arrowIcon && !$any(arrowIcon).iconClass" class="k-button-arrow">
|
|
448
|
+
<kendo-icon-wrapper
|
|
449
|
+
[name]="$any(arrowIcon).icon || 'caret-alt-down'"
|
|
450
|
+
[svgIcon]="$any(arrowIcon).svgIcon || caretAltDownIcon"></kendo-icon-wrapper>
|
|
451
|
+
</span>
|
|
452
|
+
|
|
478
453
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
479
|
-
|
|
454
|
+
}
|
|
455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
480
456
|
type: Component,
|
|
481
457
|
args: [{
|
|
482
458
|
exportAs: 'kendoButton',
|
|
@@ -487,7 +463,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
487
463
|
useValue: 'kendo.button'
|
|
488
464
|
}
|
|
489
465
|
],
|
|
490
|
-
selector: 'button[kendoButton]
|
|
466
|
+
selector: 'button[kendoButton]',
|
|
491
467
|
template: `
|
|
492
468
|
<kendo-icon-wrapper
|
|
493
469
|
*ngIf="icon || svgIcon"
|
|
@@ -500,11 +476,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
500
476
|
<span *ngIf="iconClass" class="k-button-icon" [ngClass]="iconClass"></span>
|
|
501
477
|
<span class="k-button-text"><ng-content></ng-content></span>
|
|
502
478
|
<span *ngIf="$any(arrowIcon).iconClass" class="k-button-icon" [ngClass]="$any(arrowIcon).iconClass"></span>
|
|
503
|
-
<
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
479
|
+
<span *ngIf="arrowIcon && !$any(arrowIcon).iconClass" class="k-button-arrow">
|
|
480
|
+
<kendo-icon-wrapper
|
|
481
|
+
[name]="$any(arrowIcon).icon || 'caret-alt-down'"
|
|
482
|
+
[svgIcon]="$any(arrowIcon).svgIcon || caretAltDownIcon"></kendo-icon-wrapper>
|
|
483
|
+
</span>
|
|
484
|
+
|
|
508
485
|
`,
|
|
509
486
|
standalone: true,
|
|
510
487
|
imports: [NgIf, IconWrapperComponent, NgClass]
|
|
@@ -539,8 +516,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
539
516
|
type: Input
|
|
540
517
|
}], svgIcon: [{
|
|
541
518
|
type: Input
|
|
542
|
-
}], role: [{
|
|
543
|
-
type: Input
|
|
544
519
|
}], selectedChange: [{
|
|
545
520
|
type: Output
|
|
546
521
|
}], click: [{
|
|
@@ -554,9 +529,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
554
529
|
}], iconButtonClass: [{
|
|
555
530
|
type: HostBinding,
|
|
556
531
|
args: ['class.k-icon-button']
|
|
557
|
-
}], roleSetter: [{
|
|
558
|
-
type: HostBinding,
|
|
559
|
-
args: ['attr.role']
|
|
560
532
|
}], classDisabled: [{
|
|
561
533
|
type: HostBinding,
|
|
562
534
|
args: ['attr.aria-disabled']
|
|
@@ -39,11 +39,11 @@ import * as i0 from "@angular/core";
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
export class ButtonModule {
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
43
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: ButtonModule, imports: [ButtonComponent], exports: [ButtonComponent] });
|
|
44
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonModule, providers: [IconsService], imports: [ButtonComponent] });
|
|
42
45
|
}
|
|
43
|
-
|
|
44
|
-
ButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: ButtonModule, imports: [ButtonComponent], exports: [ButtonComponent] });
|
|
45
|
-
ButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ButtonModule, providers: [IconsService], imports: [ButtonComponent] });
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ButtonModule, decorators: [{
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonModule, decorators: [{
|
|
47
47
|
type: NgModule,
|
|
48
48
|
args: [{
|
|
49
49
|
imports: [ButtonComponent],
|
|
@@ -9,16 +9,14 @@ import * as i0 from "@angular/core";
|
|
|
9
9
|
* @hidden
|
|
10
10
|
*/
|
|
11
11
|
export class KendoButtonService {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
this.buttonClicked$ = this.buttonClicked.asObservable();
|
|
15
|
-
}
|
|
12
|
+
buttonClicked = new Subject();
|
|
13
|
+
buttonClicked$ = this.buttonClicked.asObservable();
|
|
16
14
|
click(button) {
|
|
17
15
|
this.buttonClicked.next(button);
|
|
18
16
|
}
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: KendoButtonService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
18
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: KendoButtonService });
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
KendoButtonService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: KendoButtonService });
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: KendoButtonService, decorators: [{
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: KendoButtonService, decorators: [{
|
|
23
21
|
type: Injectable
|
|
24
22
|
}] });
|
|
@@ -24,45 +24,34 @@ const tabindex = 'tabindex';
|
|
|
24
24
|
* Represents the Kendo UI ButtonGroup component for Angular.
|
|
25
25
|
*/
|
|
26
26
|
export class ButtonGroupComponent {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this.currentTabIndex = -1;
|
|
56
|
-
this.defocus(this.buttons.toArray());
|
|
57
|
-
const firstFocusableIndex = this.buttons.toArray().findIndex(current => !current.disabled);
|
|
58
|
-
const index = this.lastFocusedIndex === -1 ? firstFocusableIndex : this.lastFocusedIndex;
|
|
59
|
-
this.focus(this.buttons.filter((_current, i) => {
|
|
60
|
-
return i === index;
|
|
61
|
-
}));
|
|
62
|
-
};
|
|
63
|
-
validatePackage(packageMetadata);
|
|
64
|
-
this.subs.add(localization.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
|
|
65
|
-
}
|
|
27
|
+
service;
|
|
28
|
+
renderer;
|
|
29
|
+
element;
|
|
30
|
+
/**
|
|
31
|
+
* By default, the ButtonGroup is enabled.
|
|
32
|
+
* To disable the whole group of buttons, set its `disabled` attribute to `true`.
|
|
33
|
+
*
|
|
34
|
+
* To disable a specific button, set its own `disabled` attribute to `true`
|
|
35
|
+
* and leave the `disabled` attribute of the ButtonGroup undefined.
|
|
36
|
+
* If you define the `disabled` attribute of the ButtonGroup, it will take
|
|
37
|
+
* precedence over the `disabled` attributes of the underlying buttons and they will be ignored.
|
|
38
|
+
*
|
|
39
|
+
* For more information on how to configure the Button, refer to
|
|
40
|
+
* its [API documentation]({% slug api_buttons_buttoncomponent %}).
|
|
41
|
+
*/
|
|
42
|
+
disabled;
|
|
43
|
+
/**
|
|
44
|
+
* The selection mode of the ButtonGroup.
|
|
45
|
+
* @default 'multiple'
|
|
46
|
+
*/
|
|
47
|
+
selection = 'multiple';
|
|
48
|
+
/**
|
|
49
|
+
* Sets the width of the ButtonGroup.
|
|
50
|
+
* If the width of the ButtonGroup is set:
|
|
51
|
+
* - The buttons resize automatically to fill the full width of the group wrapper.
|
|
52
|
+
* - The buttons acquire the same width.
|
|
53
|
+
*/
|
|
54
|
+
width;
|
|
66
55
|
/**
|
|
67
56
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
68
57
|
*/
|
|
@@ -73,15 +62,33 @@ export class ButtonGroupComponent {
|
|
|
73
62
|
get tabIndex() {
|
|
74
63
|
return this._tabIndex;
|
|
75
64
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
/**
|
|
66
|
+
* When this option is set to `true` (default), the component is a single tab-stop,
|
|
67
|
+
* and focus is moved through the inner buttons via the arrow keys.
|
|
68
|
+
*
|
|
69
|
+
* When the option is set to `false`, the inner buttons are part of the natural tab sequence of the page.
|
|
70
|
+
*
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
navigable = true;
|
|
74
|
+
/**
|
|
75
|
+
* Fires every time keyboard navigation occurs.
|
|
76
|
+
*/
|
|
77
|
+
navigate = new EventEmitter();
|
|
78
|
+
buttons;
|
|
79
|
+
_tabIndex = 0;
|
|
80
|
+
currentTabIndex = 0;
|
|
81
|
+
lastFocusedIndex = -1;
|
|
82
|
+
direction;
|
|
83
|
+
subs = new Subscription();
|
|
84
|
+
wrapperClasses = true;
|
|
79
85
|
get disabledClass() {
|
|
80
86
|
return this.disabled;
|
|
81
87
|
}
|
|
82
88
|
get stretchedClass() {
|
|
83
89
|
return !!this.width;
|
|
84
90
|
}
|
|
91
|
+
role = 'group';
|
|
85
92
|
get dir() {
|
|
86
93
|
return this.direction;
|
|
87
94
|
}
|
|
@@ -94,6 +101,13 @@ export class ButtonGroupComponent {
|
|
|
94
101
|
get wrapperTabIndex() {
|
|
95
102
|
return this.disabled ? undefined : this.navigable ? this.currentTabIndex : undefined;
|
|
96
103
|
}
|
|
104
|
+
constructor(service, localization, renderer, element) {
|
|
105
|
+
this.service = service;
|
|
106
|
+
this.renderer = renderer;
|
|
107
|
+
this.element = element;
|
|
108
|
+
validatePackage(packageMetadata);
|
|
109
|
+
this.subs.add(localization.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
|
|
110
|
+
}
|
|
97
111
|
ngOnInit() {
|
|
98
112
|
this.subs.add(this.service.buttonClicked$.subscribe((button) => {
|
|
99
113
|
let newSelectionValue;
|
|
@@ -234,19 +248,28 @@ export class ButtonGroupComponent {
|
|
|
234
248
|
.pipe(filter(predicate))
|
|
235
249
|
.subscribe(handler));
|
|
236
250
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
251
|
+
focusHandler = () => {
|
|
252
|
+
this.currentTabIndex = -1;
|
|
253
|
+
this.defocus(this.buttons.toArray());
|
|
254
|
+
const firstFocusableIndex = this.buttons.toArray().findIndex(current => !current.disabled);
|
|
255
|
+
const index = this.lastFocusedIndex === -1 ? firstFocusableIndex : this.lastFocusedIndex;
|
|
256
|
+
this.focus(this.buttons.filter((_current, i) => {
|
|
257
|
+
return i === index;
|
|
258
|
+
}));
|
|
259
|
+
};
|
|
260
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonGroupComponent, deps: [{ token: i1.KendoButtonService }, { token: i2.LocalizationService }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
261
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ButtonGroupComponent, isStandalone: true, selector: "kendo-buttongroup", inputs: { disabled: "disabled", selection: "selection", width: "width", tabIndex: "tabIndex", navigable: "navigable" }, outputs: { navigate: "navigate" }, host: { properties: { "class.k-button-group": "this.wrapperClasses", "class.k-disabled": "this.disabledClass", "class.k-button-group-stretched": "this.stretchedClass", "attr.role": "this.role", "attr.dir": "this.dir", "attr.aria-disabled": "this.ariaDisabled", "style.width": "this.wrapperWidth", "attr.tabindex": "this.wrapperTabIndex" } }, providers: [
|
|
262
|
+
KendoButtonService,
|
|
263
|
+
LocalizationService,
|
|
264
|
+
{
|
|
265
|
+
provide: L10N_PREFIX,
|
|
266
|
+
useValue: 'kendo.buttongroup'
|
|
267
|
+
}
|
|
268
|
+
], queries: [{ propertyName: "buttons", predicate: ButtonComponent }], exportAs: ["kendoButtonGroup"], usesOnChanges: true, ngImport: i0, template: `
|
|
269
|
+
<ng-content select="[kendoButton]"></ng-content>
|
|
248
270
|
`, isInline: true });
|
|
249
|
-
|
|
271
|
+
}
|
|
272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonGroupComponent, decorators: [{
|
|
250
273
|
type: Component,
|
|
251
274
|
args: [{
|
|
252
275
|
exportAs: 'kendoButtonGroup',
|
|
@@ -260,7 +283,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
260
283
|
],
|
|
261
284
|
selector: 'kendo-buttongroup',
|
|
262
285
|
template: `
|
|
263
|
-
<ng-content select="[kendoButton]
|
|
286
|
+
<ng-content select="[kendoButton]"></ng-content>
|
|
264
287
|
`,
|
|
265
288
|
standalone: true
|
|
266
289
|
}]
|
|
@@ -282,7 +305,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
282
305
|
}], buttons: [{
|
|
283
306
|
type: ContentChildren,
|
|
284
307
|
args: [ButtonComponent]
|
|
285
|
-
}],
|
|
308
|
+
}], wrapperClasses: [{
|
|
286
309
|
type: HostBinding,
|
|
287
310
|
args: ['class.k-button-group']
|
|
288
311
|
}], disabledClass: [{
|
|
@@ -18,11 +18,11 @@ import * as i2 from "./buttongroup.component";
|
|
|
18
18
|
* - `ButtonComponent`—The Button component class.
|
|
19
19
|
*/
|
|
20
20
|
export class ButtonGroupModule {
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonGroupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
22
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: ButtonGroupModule, imports: [i1.ButtonComponent, i2.ButtonGroupComponent], exports: [i1.ButtonComponent, i2.ButtonGroupComponent] });
|
|
23
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonGroupModule, providers: [IconsService], imports: [i1.ButtonComponent] });
|
|
21
24
|
}
|
|
22
|
-
|
|
23
|
-
ButtonGroupModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: ButtonGroupModule, imports: [i1.ButtonComponent, i2.ButtonGroupComponent], exports: [i1.ButtonComponent, i2.ButtonGroupComponent] });
|
|
24
|
-
ButtonGroupModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ButtonGroupModule, providers: [IconsService], imports: [KENDO_BUTTONGROUP] });
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ButtonGroupModule, decorators: [{
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonGroupModule, decorators: [{
|
|
26
26
|
type: NgModule,
|
|
27
27
|
args: [{
|
|
28
28
|
exports: [...KENDO_BUTTONGROUP],
|
|
@@ -52,11 +52,11 @@ import * as i11 from "./splitbutton/localization/custom-messages.component";
|
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
54
|
export class ButtonsModule {
|
|
55
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
56
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: ButtonsModule, imports: [i1.ButtonComponent, i1.ButtonComponent, i2.ButtonGroupComponent, i3.DropDownButtonComponent, i4.ButtonItemTemplateDirective, i5.ChipComponent, i5.ChipComponent, i6.ChipListComponent, i7.FloatingActionButtonComponent, i8.DialItemTemplateDirective, i9.FloatingActionButtonTemplateDirective, i10.SplitButtonComponent, i11.SplitButtonCustomMessagesComponent], exports: [i1.ButtonComponent, i1.ButtonComponent, i2.ButtonGroupComponent, i3.DropDownButtonComponent, i4.ButtonItemTemplateDirective, i5.ChipComponent, i5.ChipComponent, i6.ChipListComponent, i7.FloatingActionButtonComponent, i8.DialItemTemplateDirective, i9.FloatingActionButtonTemplateDirective, i10.SplitButtonComponent, i11.SplitButtonCustomMessagesComponent] });
|
|
57
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonsModule, providers: [IconsService, PopupService, ResizeBatchService], imports: [i1.ButtonComponent, i1.ButtonComponent, i3.DropDownButtonComponent, i5.ChipComponent, i5.ChipComponent, i7.FloatingActionButtonComponent, i10.SplitButtonComponent] });
|
|
55
58
|
}
|
|
56
|
-
|
|
57
|
-
ButtonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: ButtonsModule, imports: [i1.ButtonComponent, i1.ButtonComponent, i2.ButtonGroupComponent, i3.DropDownButtonComponent, i4.ButtonItemTemplateDirective, i5.ChipComponent, i5.ChipComponent, i6.ChipListComponent, i7.FloatingActionButtonComponent, i8.DialItemTemplateDirective, i9.FloatingActionButtonTemplateDirective, i10.SplitButtonComponent, i11.SplitButtonCustomMessagesComponent], exports: [i1.ButtonComponent, i1.ButtonComponent, i2.ButtonGroupComponent, i3.DropDownButtonComponent, i4.ButtonItemTemplateDirective, i5.ChipComponent, i5.ChipComponent, i6.ChipListComponent, i7.FloatingActionButtonComponent, i8.DialItemTemplateDirective, i9.FloatingActionButtonTemplateDirective, i10.SplitButtonComponent, i11.SplitButtonCustomMessagesComponent] });
|
|
58
|
-
ButtonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ButtonsModule, providers: [IconsService, PopupService, ResizeBatchService], imports: [i1.ButtonComponent, i1.ButtonComponent, i2.ButtonGroupComponent, i3.DropDownButtonComponent, i5.ChipComponent, i5.ChipComponent, i6.ChipListComponent, i7.FloatingActionButtonComponent, i10.SplitButtonComponent, i11.SplitButtonCustomMessagesComponent] });
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ButtonsModule, decorators: [{
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonsModule, decorators: [{
|
|
60
60
|
type: NgModule,
|
|
61
61
|
args: [{
|
|
62
62
|
imports: [...KENDO_BUTTONS],
|