@progress/kendo-angular-buttons 6.4.1-dev.202111011439 → 7.0.0-dev.202201121347
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/dist/cdn/js/kendo-angular-buttons.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/button/button.directive.js +236 -89
- package/dist/es/button/button.service.js +1 -5
- package/dist/es/buttongroup/buttongroup.component.js +11 -60
- package/dist/es/chip/chip-list.component.js +57 -7
- package/dist/es/chip/chip.component.js +175 -86
- package/dist/es/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/es/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/{es2015/button-look.js → es/common/models/styling-classes.js} +0 -0
- package/dist/es/{button-look.js → common/models.js} +0 -0
- package/dist/es/dropdownbutton/dropdownbutton.component.js +89 -36
- package/dist/es/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/es/focusable/focusable.directive.js +4 -4
- package/dist/es/listbutton/list-button.js +4 -1
- package/dist/es/listbutton/list.component.js +20 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/splitbutton/splitbutton.component.js +107 -37
- package/dist/es/util.js +52 -0
- package/dist/es2015/button/button.directive.d.ts +85 -22
- package/dist/es2015/button/button.directive.js +219 -85
- package/dist/es2015/button/button.service.d.ts +1 -4
- package/dist/es2015/button/button.service.js +1 -5
- package/dist/es2015/buttongroup/buttongroup.component.d.ts +0 -15
- package/dist/es2015/buttongroup/buttongroup.component.js +11 -48
- package/dist/es2015/chip/chip-list.component.d.ts +19 -3
- package/dist/es2015/chip/chip-list.component.js +52 -7
- package/dist/es2015/chip/chip.component.d.ts +67 -32
- package/dist/es2015/chip/chip.component.js +186 -97
- package/dist/es2015/common/models/fillmode.d.ts +12 -0
- package/dist/es2015/{chip/models/type.js → common/models/fillmode.js} +0 -0
- package/dist/es2015/common/models/rounded.d.ts +12 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/shape.d.ts +2 -9
- package/dist/es2015/common/models/size.d.ts +9 -6
- package/dist/es2015/common/models/styling-classes.d.ts +11 -0
- package/dist/es2015/common/models/styling-classes.js +4 -0
- package/dist/es2015/common/models/theme-color.d.ts +15 -4
- package/dist/es2015/common/models.d.ts +10 -0
- package/dist/es2015/{chip/models/chip-look.js → common/models.js} +0 -0
- package/dist/es2015/dropdownbutton/dropdownbutton.component.d.ts +59 -7
- package/dist/es2015/dropdownbutton/dropdownbutton.component.js +92 -31
- package/dist/es2015/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.d.ts +28 -21
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.js +62 -42
- package/dist/es2015/focusable/focusable.directive.js +4 -4
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/listbutton/list-button.js +4 -1
- package/dist/es2015/listbutton/list.component.d.ts +3 -0
- package/dist/es2015/listbutton/list.component.js +37 -20
- package/dist/es2015/main.d.ts +4 -4
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/splitbutton/splitbutton.component.d.ts +59 -12
- package/dist/es2015/splitbutton/splitbutton.component.js +113 -33
- package/dist/es2015/util.d.ts +21 -0
- package/dist/es2015/util.js +52 -0
- package/dist/fesm2015/index.js +862 -409
- package/dist/fesm5/index.js +853 -405
- package/dist/npm/button/button.directive.js +236 -89
- package/dist/npm/button/button.service.js +0 -4
- package/dist/npm/buttongroup/buttongroup.component.js +11 -60
- package/dist/npm/chip/chip-list.component.js +55 -5
- package/dist/npm/chip/chip.component.js +173 -84
- package/dist/npm/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/npm/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/npm/common/models/styling-classes.js +6 -0
- package/dist/npm/{button-look.js → common/models.js} +0 -0
- package/dist/npm/dropdownbutton/dropdownbutton.component.js +89 -36
- package/dist/npm/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/npm/focusable/focusable.directive.js +4 -4
- package/dist/npm/listbutton/list-button.js +4 -1
- package/dist/npm/listbutton/list.component.js +20 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/splitbutton/splitbutton.component.js +105 -35
- package/dist/npm/util.js +52 -0
- package/dist/systemjs/kendo-angular-buttons.js +1 -1
- package/package.json +13 -10
- package/dist/es2015/button-look.d.ts +0 -21
- package/dist/es2015/chip/models/chip-look.d.ts +0 -20
- package/dist/es2015/chip/models/type.d.ts +0 -21
|
@@ -9,6 +9,8 @@ import { KeyEvents } from './../navigation/key-events';
|
|
|
9
9
|
import { NavigationAction } from './../navigation/navigation-action';
|
|
10
10
|
import { isDocumentAvailable, guid, Keys } from '@progress/kendo-angular-common';
|
|
11
11
|
import { isPresent } from './../util';
|
|
12
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
|
+
import { packageMetadata } from '../package-metadata';
|
|
12
14
|
/**
|
|
13
15
|
* @hidden
|
|
14
16
|
*/
|
|
@@ -25,6 +27,7 @@ export class ListButton {
|
|
|
25
27
|
this._popupSettings = { animate: true, popupClass: '' };
|
|
26
28
|
this.listId = guid();
|
|
27
29
|
this._isFocused = false;
|
|
30
|
+
validatePackage(packageMetadata);
|
|
28
31
|
this.focusService = focusService;
|
|
29
32
|
this.navigationService = navigationService;
|
|
30
33
|
this.wrapper = wrapperRef.nativeElement;
|
|
@@ -32,7 +35,7 @@ export class ListButton {
|
|
|
32
35
|
this.subscribeEvents();
|
|
33
36
|
}
|
|
34
37
|
get popupClasses() {
|
|
35
|
-
const popupClasses = ['k-
|
|
38
|
+
const popupClasses = ['k-menu-popup'];
|
|
36
39
|
if (this._popupSettings.popupClass) {
|
|
37
40
|
popupClasses.push(this._popupSettings.popupClass);
|
|
38
41
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { EventEmitter } from '@angular/core';
|
|
6
6
|
import { ListItemModel } from './list-item-model';
|
|
7
7
|
import { ButtonItemTemplateDirective } from './button-item-template.directive';
|
|
8
|
+
import { ButtonSize } from '../common/models';
|
|
8
9
|
/**
|
|
9
10
|
* @hidden
|
|
10
11
|
*/
|
|
@@ -14,6 +15,8 @@ export declare class ListComponent {
|
|
|
14
15
|
itemTemplate: ButtonItemTemplateDirective;
|
|
15
16
|
onItemClick: EventEmitter<number>;
|
|
16
17
|
onItemBlur: EventEmitter<any>;
|
|
18
|
+
size: ButtonSize;
|
|
19
|
+
sizeClass: string;
|
|
17
20
|
constructor();
|
|
18
21
|
getText(dataItem: any): any;
|
|
19
22
|
getIconClasses(dataItem: ListItemModel): any;
|
|
@@ -7,6 +7,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
|
7
7
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
8
8
|
import { packageMetadata } from '../package-metadata';
|
|
9
9
|
import { ButtonItemTemplateDirective } from './button-item-template.directive';
|
|
10
|
+
import { SIZES } from '../util';
|
|
10
11
|
/**
|
|
11
12
|
* @hidden
|
|
12
13
|
*/
|
|
@@ -14,8 +15,17 @@ let ListComponent = class ListComponent {
|
|
|
14
15
|
constructor() {
|
|
15
16
|
this.onItemClick = new EventEmitter();
|
|
16
17
|
this.onItemBlur = new EventEmitter();
|
|
18
|
+
this.sizeClass = '';
|
|
17
19
|
validatePackage(packageMetadata);
|
|
18
20
|
}
|
|
21
|
+
set size(size) {
|
|
22
|
+
if (size) {
|
|
23
|
+
this.sizeClass = `k-menu-group-${SIZES[size]}`;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
this.sizeClass = '';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
19
29
|
getText(dataItem) {
|
|
20
30
|
if (dataItem) {
|
|
21
31
|
return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
|
|
@@ -55,37 +65,44 @@ tslib_1.__decorate([
|
|
|
55
65
|
Output(),
|
|
56
66
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
57
67
|
], ListComponent.prototype, "onItemBlur", void 0);
|
|
68
|
+
tslib_1.__decorate([
|
|
69
|
+
Input(),
|
|
70
|
+
tslib_1.__metadata("design:type", String),
|
|
71
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
72
|
+
], ListComponent.prototype, "size", null);
|
|
58
73
|
ListComponent = tslib_1.__decorate([
|
|
59
74
|
Component({
|
|
60
75
|
selector: 'kendo-button-list',
|
|
61
76
|
template: `
|
|
62
|
-
<ul class="k-
|
|
63
|
-
<li role="menuitem" unselectable="on"
|
|
77
|
+
<ul class="k-group k-menu-group k-reset" [ngClass]="sizeClass" unselectable="on" role="menu">
|
|
78
|
+
<li role="menuitem" unselectable="on"
|
|
64
79
|
kendoButtonFocusable
|
|
65
80
|
*ngFor="let dataItem of data; let index = index;"
|
|
66
|
-
|
|
67
|
-
[ngClass]="{'k-item': true, 'k-state-disabled': dataItem.disabled}"
|
|
81
|
+
class="k-item k-menu-item"
|
|
68
82
|
(click)="onClick(index)"
|
|
69
83
|
(blur)="onBlur()"
|
|
70
84
|
[attr.aria-disabled]="dataItem.disabled ? true : false">
|
|
71
|
-
<ng-template
|
|
72
|
-
[
|
|
73
|
-
templateRef: itemTemplate?.templateRef,
|
|
74
|
-
|
|
75
|
-
}">
|
|
85
|
+
<ng-template [ngIf]="itemTemplate?.templateRef">
|
|
86
|
+
<span kendoButtonFocusable [index]="index" class="k-link k-menu-link" [class.k-disabled]="dataItem.disabled" tabindex="-1">
|
|
87
|
+
<ng-template [templateContext]="{templateRef: itemTemplate?.templateRef, $implicit: dataItem}"></ng-template>
|
|
88
|
+
</span>
|
|
76
89
|
</ng-template>
|
|
77
90
|
<ng-template [ngIf]="!itemTemplate?.templateRef">
|
|
78
|
-
<span
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
<span kendoButtonFocusable [index]="index" class="k-link k-menu-link" [class.k-disabled]="dataItem.disabled" tabindex="-1">
|
|
92
|
+
<span
|
|
93
|
+
*ngIf="dataItem.icon || dataItem.iconClass"
|
|
94
|
+
[ngClass]="getIconClasses(dataItem)"
|
|
95
|
+
></span>
|
|
96
|
+
<img
|
|
97
|
+
*ngIf="dataItem.imageUrl"
|
|
98
|
+
class="k-image"
|
|
99
|
+
[src]="dataItem.imageUrl"
|
|
100
|
+
alt=""
|
|
101
|
+
>
|
|
102
|
+
<span *ngIf="getText(dataItem)" class="k-menu-link-text">
|
|
103
|
+
{{ getText(dataItem) }}
|
|
104
|
+
</span>
|
|
105
|
+
</span>
|
|
89
106
|
</ng-template>
|
|
90
107
|
</li>
|
|
91
108
|
</ul>
|
package/dist/es2015/main.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export { SplitButtonModule } from './splitbutton/splitbutton.module';
|
|
|
12
12
|
export { SplitButtonCustomMessagesComponent } from './splitbutton/localization/custom-messages.component';
|
|
13
13
|
export { DropDownButtonComponent, DropDownButtonComponent as DropDownButton } from './dropdownbutton/dropdownbutton.component';
|
|
14
14
|
export { DropDownButtonModule } from './dropdownbutton/dropdownbutton.module';
|
|
15
|
-
export { ButtonLook } from './button-look';
|
|
16
15
|
export { ListItemModel } from './listbutton/list-item-model';
|
|
17
16
|
export { PopupSettings } from './listbutton/popup-settings';
|
|
18
17
|
export { ChipComponent } from './chip/chip.component';
|
|
@@ -21,7 +20,6 @@ export { ChipModule } from './chip/chip.module';
|
|
|
21
20
|
export { ChipListSelection } from './chip/models/selection';
|
|
22
21
|
export { ChipRemoveEvent } from './chip/chip-remove-event-args.interface';
|
|
23
22
|
export { ChipListRemoveEvent } from './chip/chip-list-remove-event-args.interface';
|
|
24
|
-
export { ChipType } from './chip/models/type';
|
|
25
23
|
export { FloatingActionButtonModule } from './floatingactionbutton/floatingactionbutton.module';
|
|
26
24
|
export { FloatingActionButtonComponent } from './floatingactionbutton/floatingactionbutton.component';
|
|
27
25
|
export { FloatingActionButtonTemplateDirective } from './floatingactionbutton/templates/fab-template.directive';
|
|
@@ -32,6 +30,8 @@ export { DialItemAnimation } from './floatingactionbutton/models/item-animation.
|
|
|
32
30
|
export { FabAlign } from './floatingactionbutton/models/align';
|
|
33
31
|
export { FabPositionMode } from './floatingactionbutton/models/position-mode';
|
|
34
32
|
export { FabOffset } from './floatingactionbutton/models/offset';
|
|
35
|
-
export { ButtonSize } from './common/models/size';
|
|
36
|
-
export {
|
|
33
|
+
export { ButtonSize, ChipSize } from './common/models/size';
|
|
34
|
+
export { ButtonRounded, ChipRounded } from './common/models/rounded';
|
|
35
|
+
export { ButtonFillMode, ChipFillMode } from './common/models/fillmode';
|
|
36
|
+
export { ButtonThemeColor, ChipThemeColor } from './common/models/theme-color';
|
|
37
37
|
export { ButtonShape } from './common/models/shape';
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-buttons',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1641995114,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { ElementRef, TemplateRef, EventEmitter, ViewContainerRef, AfterViewInit, OnChanges, SimpleChanges, NgZone, ChangeDetectorRef } from '@angular/core';
|
|
5
|
+
import { ElementRef, TemplateRef, EventEmitter, ViewContainerRef, AfterViewInit, OnChanges, SimpleChanges, NgZone, ChangeDetectorRef, Renderer2 } from '@angular/core';
|
|
6
6
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
7
|
import { Align, PopupService, PopupRef } from '@progress/kendo-angular-popup';
|
|
8
8
|
import { ListButton } from './../listbutton/list-button';
|
|
@@ -11,7 +11,7 @@ import { ButtonItemTemplateDirective } from './../listbutton/button-item-templat
|
|
|
11
11
|
import { FocusService } from './../focusable/focus.service';
|
|
12
12
|
import { NavigationService } from './../navigation/navigation.service';
|
|
13
13
|
import { PreventableEvent } from '../preventable-event';
|
|
14
|
-
import {
|
|
14
|
+
import { ButtonFillMode, ButtonRounded, ButtonSize, ButtonThemeColor } from '../common/models';
|
|
15
15
|
/**
|
|
16
16
|
* Represents the Kendo UI SplitButton component for Angular.
|
|
17
17
|
*
|
|
@@ -57,6 +57,7 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
57
57
|
private popupService;
|
|
58
58
|
private elRef;
|
|
59
59
|
private localization;
|
|
60
|
+
private renderer;
|
|
60
61
|
/**
|
|
61
62
|
* Sets the text of the SplitButton.
|
|
62
63
|
*/
|
|
@@ -81,13 +82,58 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
81
82
|
*/
|
|
82
83
|
imageUrl: string;
|
|
83
84
|
/**
|
|
84
|
-
*
|
|
85
|
+
* The size property specifies the width and height of the SplitButton
|
|
86
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-size)).
|
|
87
|
+
*
|
|
88
|
+
* The possible values are:
|
|
89
|
+
* * `'small'`
|
|
90
|
+
* * `'medium'` (default)
|
|
91
|
+
* * `'large'`
|
|
92
|
+
* * `null`
|
|
93
|
+
*/
|
|
94
|
+
size: ButtonSize;
|
|
95
|
+
/**
|
|
96
|
+
* The rounded property specifies the border radius of the SplitButton
|
|
97
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
|
|
98
|
+
*
|
|
99
|
+
* The possible values are:
|
|
100
|
+
* * `'small'`
|
|
101
|
+
* * `'medium'` (default)
|
|
102
|
+
* * `'large'`
|
|
103
|
+
* * `'full'`
|
|
104
|
+
* * `null`
|
|
105
|
+
*/
|
|
106
|
+
rounded: ButtonRounded;
|
|
107
|
+
/**
|
|
108
|
+
* The fillMode property specifies the background and border styles of the SplitButton
|
|
109
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-fillMode)).
|
|
85
110
|
*
|
|
86
111
|
* The available values are:
|
|
112
|
+
* * `solid` (default)
|
|
87
113
|
* * `flat`
|
|
88
114
|
* * `outline`
|
|
115
|
+
* * `link`
|
|
89
116
|
*/
|
|
90
|
-
|
|
117
|
+
fillMode: ButtonFillMode;
|
|
118
|
+
/**
|
|
119
|
+
* The SplitButton allows you to specify predefined theme colors.
|
|
120
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
121
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-themeColor)).
|
|
122
|
+
*
|
|
123
|
+
* The possible values are:
|
|
124
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
125
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
126
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
127
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
128
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
129
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
130
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
131
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
132
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
133
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
134
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
135
|
+
*/
|
|
136
|
+
themeColor: ButtonThemeColor;
|
|
91
137
|
/**
|
|
92
138
|
* When set to `true`, disables a SplitButton item
|
|
93
139
|
* ([see example]({% slug databinding_splitbutton %}#toc-arrays-of-complex-data)).
|
|
@@ -208,7 +254,12 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
208
254
|
arrowButton: ElementRef<HTMLButtonElement>;
|
|
209
255
|
popupTemplate: TemplateRef<any>;
|
|
210
256
|
containerRef: ViewContainerRef;
|
|
257
|
+
/**
|
|
258
|
+
* @hidden
|
|
259
|
+
*/
|
|
260
|
+
activeArrow: boolean;
|
|
211
261
|
popupRef: PopupRef;
|
|
262
|
+
listId: string;
|
|
212
263
|
/**
|
|
213
264
|
* @hidden
|
|
214
265
|
*/
|
|
@@ -216,7 +267,6 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
216
267
|
* @hidden
|
|
217
268
|
*/
|
|
218
269
|
openState: boolean;
|
|
219
|
-
listId: string;
|
|
220
270
|
/**
|
|
221
271
|
* @hidden
|
|
222
272
|
*/
|
|
@@ -225,15 +275,11 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
225
275
|
* @hidden
|
|
226
276
|
*/
|
|
227
277
|
readonly componentTabIndex: number;
|
|
228
|
-
/**
|
|
229
|
-
* @hidden
|
|
230
|
-
*/
|
|
231
|
-
activeArrow: boolean;
|
|
232
278
|
private buttonText;
|
|
233
279
|
private lockFocus;
|
|
280
|
+
private _rounded;
|
|
281
|
+
private _fillMode;
|
|
234
282
|
isFocused: boolean;
|
|
235
|
-
readonly isFlat: boolean;
|
|
236
|
-
readonly isOutline: boolean;
|
|
237
283
|
readonly widgetClasses: boolean;
|
|
238
284
|
readonly dir: string;
|
|
239
285
|
/**
|
|
@@ -308,7 +354,7 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
308
354
|
* Blurs the SplitButton component.
|
|
309
355
|
*/
|
|
310
356
|
blur(): void;
|
|
311
|
-
constructor(focusService: FocusService, navigationService: NavigationService, wrapperRef: ElementRef, zone: NgZone, popupService: PopupService, elRef: ElementRef, localization: LocalizationService, cdr: ChangeDetectorRef);
|
|
357
|
+
constructor(focusService: FocusService, navigationService: NavigationService, wrapperRef: ElementRef, zone: NgZone, popupService: PopupService, elRef: ElementRef, localization: LocalizationService, cdr: ChangeDetectorRef, renderer: Renderer2);
|
|
312
358
|
ngOnDestroy(): void;
|
|
313
359
|
/**
|
|
314
360
|
* Toggles the visibility of the popup.
|
|
@@ -327,4 +373,5 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
327
373
|
private _toggle;
|
|
328
374
|
private createPopup;
|
|
329
375
|
private destroyPopup;
|
|
376
|
+
private handleClasses;
|
|
330
377
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
6
|
/* tslint:disable:no-access-missing-member */
|
|
7
|
-
import { Component, ElementRef, TemplateRef, Input, Output, HostBinding, HostListener, EventEmitter, ContentChild, ViewChild, ViewContainerRef, NgZone, ChangeDetectorRef } from '@angular/core';
|
|
7
|
+
import { Component, ElementRef, TemplateRef, Input, Output, HostBinding, HostListener, EventEmitter, ContentChild, ViewChild, ViewContainerRef, NgZone, ChangeDetectorRef, Renderer2 } from '@angular/core';
|
|
8
8
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
9
9
|
import { PopupService } from '@progress/kendo-angular-popup';
|
|
10
10
|
import { ListButton } from './../listbutton/list-button';
|
|
@@ -16,7 +16,7 @@ import { isDocumentAvailable, guid, isChanged } from '@progress/kendo-angular-co
|
|
|
16
16
|
import { isPresent, tick } from './../util';
|
|
17
17
|
import { PreventableEvent } from '../preventable-event';
|
|
18
18
|
import { Keys } from '@progress/kendo-angular-common';
|
|
19
|
-
import { replaceMessagePlaceholder } from '../util';
|
|
19
|
+
import { replaceMessagePlaceholder, getStylingClasses } from '../util';
|
|
20
20
|
const NAVIGATION_SETTINGS = {
|
|
21
21
|
useLeftRightArrows: true
|
|
22
22
|
};
|
|
@@ -67,11 +67,12 @@ const NAVIGATION_SETTINGS_PROVIDER = {
|
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
69
|
let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
70
|
-
constructor(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr) {
|
|
70
|
+
constructor(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, renderer) {
|
|
71
71
|
super(focusService, navigationService, wrapperRef, zone, localization, cdr);
|
|
72
72
|
this.popupService = popupService;
|
|
73
73
|
this.elRef = elRef;
|
|
74
74
|
this.localization = localization;
|
|
75
|
+
this.renderer = renderer;
|
|
75
76
|
/**
|
|
76
77
|
* Sets the text of the SplitButton.
|
|
77
78
|
*/
|
|
@@ -96,13 +97,35 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
96
97
|
*/
|
|
97
98
|
this.imageUrl = '';
|
|
98
99
|
/**
|
|
99
|
-
*
|
|
100
|
+
* The size property specifies the width and height of the SplitButton
|
|
101
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-size)).
|
|
100
102
|
*
|
|
101
|
-
* The
|
|
102
|
-
* * `
|
|
103
|
-
* * `
|
|
103
|
+
* The possible values are:
|
|
104
|
+
* * `'small'`
|
|
105
|
+
* * `'medium'` (default)
|
|
106
|
+
* * `'large'`
|
|
107
|
+
* * `null`
|
|
104
108
|
*/
|
|
105
|
-
this.
|
|
109
|
+
this.size = 'medium';
|
|
110
|
+
/**
|
|
111
|
+
* The SplitButton allows you to specify predefined theme colors.
|
|
112
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
113
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-themeColor)).
|
|
114
|
+
*
|
|
115
|
+
* The possible values are:
|
|
116
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
117
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
118
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
119
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
120
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
121
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
122
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
123
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
124
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
125
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
126
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
127
|
+
*/
|
|
128
|
+
this.themeColor = 'base';
|
|
106
129
|
/**
|
|
107
130
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
108
131
|
*/
|
|
@@ -180,16 +203,53 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
180
203
|
* This event is preventable. If you cancel the event, the popup will remain open.
|
|
181
204
|
*/
|
|
182
205
|
this.close = new EventEmitter();
|
|
183
|
-
this.listId = guid();
|
|
184
206
|
/**
|
|
185
207
|
* @hidden
|
|
186
208
|
*/
|
|
187
209
|
this.activeArrow = false;
|
|
210
|
+
this.listId = guid();
|
|
188
211
|
this.buttonText = '';
|
|
189
212
|
this.lockFocus = false;
|
|
213
|
+
this._rounded = 'medium';
|
|
214
|
+
this._fillMode = "solid";
|
|
190
215
|
this._itemClick = this.itemClick;
|
|
191
216
|
this._blur = this.onBlur;
|
|
192
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* The rounded property specifies the border radius of the SplitButton
|
|
220
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
|
|
221
|
+
*
|
|
222
|
+
* The possible values are:
|
|
223
|
+
* * `'small'`
|
|
224
|
+
* * `'medium'` (default)
|
|
225
|
+
* * `'large'`
|
|
226
|
+
* * `'full'`
|
|
227
|
+
* * `null`
|
|
228
|
+
*/
|
|
229
|
+
set rounded(rounded) {
|
|
230
|
+
this.handleClasses(rounded, 'rounded');
|
|
231
|
+
this._rounded = rounded;
|
|
232
|
+
}
|
|
233
|
+
get rounded() {
|
|
234
|
+
return this._rounded;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* The fillMode property specifies the background and border styles of the SplitButton
|
|
238
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-fillMode)).
|
|
239
|
+
*
|
|
240
|
+
* The available values are:
|
|
241
|
+
* * `solid` (default)
|
|
242
|
+
* * `flat`
|
|
243
|
+
* * `outline`
|
|
244
|
+
* * `link`
|
|
245
|
+
*/
|
|
246
|
+
set fillMode(fillMode) {
|
|
247
|
+
// Temporary workaround for missing 'clear' styles
|
|
248
|
+
this._fillMode = fillMode === 'clear' ? 'flat' : fillMode;
|
|
249
|
+
}
|
|
250
|
+
get fillMode() {
|
|
251
|
+
return this._fillMode;
|
|
252
|
+
}
|
|
193
253
|
/**
|
|
194
254
|
* When set to `true`, disables a SplitButton item
|
|
195
255
|
* ([see example]({% slug databinding_splitbutton %}#toc-arrays-of-complex-data)).
|
|
@@ -275,12 +335,6 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
275
335
|
get isFocused() {
|
|
276
336
|
return this._isFocused && !this._disabled;
|
|
277
337
|
}
|
|
278
|
-
get isFlat() {
|
|
279
|
-
return this.look === 'flat';
|
|
280
|
-
}
|
|
281
|
-
get isOutline() {
|
|
282
|
-
return this.look === 'outline';
|
|
283
|
-
}
|
|
284
338
|
get widgetClasses() {
|
|
285
339
|
return true;
|
|
286
340
|
}
|
|
@@ -367,6 +421,7 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
367
421
|
*/
|
|
368
422
|
ngAfterViewInit() {
|
|
369
423
|
this.updateButtonText();
|
|
424
|
+
this.handleClasses(this.rounded, 'rounded');
|
|
370
425
|
}
|
|
371
426
|
/**
|
|
372
427
|
* @hidden
|
|
@@ -514,6 +569,16 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
514
569
|
this.popupRef = null;
|
|
515
570
|
}
|
|
516
571
|
}
|
|
572
|
+
handleClasses(value, input) {
|
|
573
|
+
const elem = this.wrapperRef.nativeElement;
|
|
574
|
+
const classes = getStylingClasses('button', input, this[input], value);
|
|
575
|
+
if (classes.toRemove) {
|
|
576
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
577
|
+
}
|
|
578
|
+
if (classes.toAdd) {
|
|
579
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
517
582
|
};
|
|
518
583
|
tslib_1.__decorate([
|
|
519
584
|
Input(),
|
|
@@ -538,7 +603,21 @@ tslib_1.__decorate([
|
|
|
538
603
|
tslib_1.__decorate([
|
|
539
604
|
Input(),
|
|
540
605
|
tslib_1.__metadata("design:type", String)
|
|
541
|
-
], SplitButtonComponent.prototype, "
|
|
606
|
+
], SplitButtonComponent.prototype, "size", void 0);
|
|
607
|
+
tslib_1.__decorate([
|
|
608
|
+
Input(),
|
|
609
|
+
tslib_1.__metadata("design:type", String),
|
|
610
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
611
|
+
], SplitButtonComponent.prototype, "rounded", null);
|
|
612
|
+
tslib_1.__decorate([
|
|
613
|
+
Input(),
|
|
614
|
+
tslib_1.__metadata("design:type", String),
|
|
615
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
616
|
+
], SplitButtonComponent.prototype, "fillMode", null);
|
|
617
|
+
tslib_1.__decorate([
|
|
618
|
+
Input(),
|
|
619
|
+
tslib_1.__metadata("design:type", String)
|
|
620
|
+
], SplitButtonComponent.prototype, "themeColor", void 0);
|
|
542
621
|
tslib_1.__decorate([
|
|
543
622
|
Input(),
|
|
544
623
|
tslib_1.__metadata("design:type", Boolean),
|
|
@@ -619,20 +698,10 @@ tslib_1.__decorate([
|
|
|
619
698
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
620
699
|
], SplitButtonComponent.prototype, "containerRef", void 0);
|
|
621
700
|
tslib_1.__decorate([
|
|
622
|
-
HostBinding('class.k-
|
|
701
|
+
HostBinding('class.k-focus'),
|
|
623
702
|
tslib_1.__metadata("design:type", Boolean),
|
|
624
703
|
tslib_1.__metadata("design:paramtypes", [Boolean])
|
|
625
704
|
], SplitButtonComponent.prototype, "isFocused", null);
|
|
626
|
-
tslib_1.__decorate([
|
|
627
|
-
HostBinding('class.k-flat'),
|
|
628
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
629
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
630
|
-
], SplitButtonComponent.prototype, "isFlat", null);
|
|
631
|
-
tslib_1.__decorate([
|
|
632
|
-
HostBinding('class.k-outline'),
|
|
633
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
634
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
635
|
-
], SplitButtonComponent.prototype, "isOutline", null);
|
|
636
705
|
tslib_1.__decorate([
|
|
637
706
|
HostBinding('class.k-split-button'),
|
|
638
707
|
HostBinding('class.k-button-group'),
|
|
@@ -685,11 +754,15 @@ SplitButtonComponent = tslib_1.__decorate([
|
|
|
685
754
|
kendoButton
|
|
686
755
|
#button
|
|
687
756
|
[type]="type"
|
|
688
|
-
[look]="look"
|
|
689
757
|
[tabindex]="componentTabIndex"
|
|
690
758
|
[disabled]="disabled"
|
|
759
|
+
[size]="size"
|
|
760
|
+
[rounded]="rounded"
|
|
761
|
+
[fillMode]="fillMode"
|
|
762
|
+
[themeColor]="themeColor"
|
|
691
763
|
[icon]="icon"
|
|
692
|
-
[class.k-
|
|
764
|
+
[class.k-active]="active"
|
|
765
|
+
[class.k-icon-button]="!text && icon"
|
|
693
766
|
[iconClass]="iconClass"
|
|
694
767
|
[imageUrl]="imageUrl"
|
|
695
768
|
[ngClass]="buttonClass"
|
|
@@ -704,16 +777,21 @@ SplitButtonComponent = tslib_1.__decorate([
|
|
|
704
777
|
[attr.aria-owns]="listId"
|
|
705
778
|
[attr.aria-label]="ariaLabel"
|
|
706
779
|
>
|
|
707
|
-
|
|
780
|
+
<span *ngIf="text" class="k-button-text">
|
|
781
|
+
{{ text }}
|
|
782
|
+
</span><ng-content></ng-content>
|
|
708
783
|
</button>
|
|
709
784
|
<button
|
|
710
785
|
kendoButton
|
|
711
786
|
#arrowButton
|
|
712
787
|
type="button"
|
|
713
|
-
[class.k-
|
|
788
|
+
[class.k-active]="activeArrow"
|
|
714
789
|
[disabled]="disabled"
|
|
715
790
|
[icon]="arrowButtonIcon"
|
|
716
|
-
[
|
|
791
|
+
[size]="size"
|
|
792
|
+
[rounded]="rounded"
|
|
793
|
+
[fillMode]="fillMode"
|
|
794
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
717
795
|
[tabindex]="-1"
|
|
718
796
|
[ngClass]="arrowButtonClass"
|
|
719
797
|
(click)="onArrowButtonClick()"
|
|
@@ -731,6 +809,7 @@ SplitButtonComponent = tslib_1.__decorate([
|
|
|
731
809
|
(keypress)="keyPressHandler($event)"
|
|
732
810
|
(keyup)="keyUpHandler($event)"
|
|
733
811
|
[attr.dir]="dir"
|
|
812
|
+
[size]="size"
|
|
734
813
|
>
|
|
735
814
|
</kendo-button-list>
|
|
736
815
|
</ng-template>
|
|
@@ -744,7 +823,8 @@ SplitButtonComponent = tslib_1.__decorate([
|
|
|
744
823
|
PopupService,
|
|
745
824
|
ElementRef,
|
|
746
825
|
LocalizationService,
|
|
747
|
-
ChangeDetectorRef
|
|
826
|
+
ChangeDetectorRef,
|
|
827
|
+
Renderer2])
|
|
748
828
|
], SplitButtonComponent);
|
|
749
829
|
export { SplitButtonComponent };
|
|
750
830
|
export { ɵ0 };
|
package/dist/es2015/util.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ButtonStylingClasses } from "./common/models";
|
|
5
6
|
/**
|
|
6
7
|
* @hidden
|
|
7
8
|
*/
|
|
@@ -18,3 +19,23 @@ export declare function closest(element: any, selector: string): any;
|
|
|
18
19
|
* @hidden
|
|
19
20
|
*/
|
|
20
21
|
export declare const replaceMessagePlaceholder: (message: string, name: string, value: string) => string;
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
export declare const SIZES: {
|
|
26
|
+
small: string;
|
|
27
|
+
medium: string;
|
|
28
|
+
large: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*
|
|
33
|
+
* Returns the styling classes to be added and removed
|
|
34
|
+
*/
|
|
35
|
+
export declare const getStylingClasses: (componentType: any, stylingOption: string, previousValue: any, newValue: any) => ButtonStylingClasses;
|
|
36
|
+
/**
|
|
37
|
+
* @hidden
|
|
38
|
+
*
|
|
39
|
+
* Returns the themeColor classes to be added and removed
|
|
40
|
+
*/
|
|
41
|
+
export declare const getThemeColorClasses: (componentType: any, prevFillMode: any, fillMode: any, previousValue: any, newValue: any) => ButtonStylingClasses;
|
package/dist/es2015/util.js
CHANGED
|
@@ -41,3 +41,55 @@ export function closest(element, selector) {
|
|
|
41
41
|
* @hidden
|
|
42
42
|
*/
|
|
43
43
|
export const replaceMessagePlaceholder = (message, name, value) => message.replace(new RegExp(`\{\\s*${name}\\s*\}`, 'g'), value);
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
*/
|
|
47
|
+
export const SIZES = {
|
|
48
|
+
small: 'sm',
|
|
49
|
+
medium: 'md',
|
|
50
|
+
large: 'lg'
|
|
51
|
+
};
|
|
52
|
+
const ROUNDNESS = {
|
|
53
|
+
small: 'sm',
|
|
54
|
+
medium: 'md',
|
|
55
|
+
large: 'lg',
|
|
56
|
+
full: 'full'
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*
|
|
61
|
+
* Returns the styling classes to be added and removed
|
|
62
|
+
*/
|
|
63
|
+
export const getStylingClasses = (componentType, stylingOption, previousValue, newValue) => {
|
|
64
|
+
switch (stylingOption) {
|
|
65
|
+
case 'size':
|
|
66
|
+
return {
|
|
67
|
+
toRemove: `k-${componentType}-${SIZES[previousValue]}`,
|
|
68
|
+
toAdd: newValue ? `k-${componentType}-${SIZES[newValue]}` : null
|
|
69
|
+
};
|
|
70
|
+
case 'rounded':
|
|
71
|
+
return {
|
|
72
|
+
toRemove: `k-rounded-${ROUNDNESS[previousValue]}`,
|
|
73
|
+
toAdd: newValue ? `k-rounded-${ROUNDNESS[newValue]}` : null
|
|
74
|
+
};
|
|
75
|
+
case 'fillMode':
|
|
76
|
+
case 'shape':
|
|
77
|
+
return {
|
|
78
|
+
toRemove: `k-${componentType}-${previousValue}`,
|
|
79
|
+
toAdd: newValue ? `k-${componentType}-${newValue}` : null
|
|
80
|
+
};
|
|
81
|
+
default:
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* @hidden
|
|
87
|
+
*
|
|
88
|
+
* Returns the themeColor classes to be added and removed
|
|
89
|
+
*/
|
|
90
|
+
export const getThemeColorClasses = (componentType, prevFillMode, fillMode, previousValue, newValue) => {
|
|
91
|
+
return {
|
|
92
|
+
toRemove: `k-${componentType}-${prevFillMode}-${previousValue}`,
|
|
93
|
+
toAdd: newValue ? `k-${componentType}-${fillMode}-${newValue}` : null
|
|
94
|
+
};
|
|
95
|
+
};
|