@progress/kendo-angular-buttons 6.4.0 → 7.0.0-dev.202201101733
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 +239 -89
- package/dist/es/button/button.service.js +1 -5
- package/dist/es/buttongroup/buttongroup.component.js +1 -53
- package/dist/es/chip/chip-list.component.js +54 -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 +74 -33
- 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 +1 -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 +91 -33
- package/dist/es/util.js +52 -0
- package/dist/es2015/button/button.directive.d.ts +85 -22
- package/dist/es2015/button/button.directive.js +222 -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 +1 -41
- package/dist/es2015/chip/chip-list.component.d.ts +19 -3
- package/dist/es2015/chip/chip-list.component.js +49 -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 +58 -7
- package/dist/es2015/dropdownbutton/dropdownbutton.component.js +81 -28
- 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 +1 -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 +53 -7
- package/dist/es2015/splitbutton/splitbutton.component.js +101 -29
- package/dist/es2015/util.d.ts +21 -0
- package/dist/es2015/util.js +52 -0
- package/dist/fesm2015/index.js +832 -395
- package/dist/fesm5/index.js +817 -393
- package/dist/npm/button/button.directive.js +239 -89
- package/dist/npm/button/button.service.js +0 -4
- package/dist/npm/buttongroup/buttongroup.component.js +1 -53
- package/dist/npm/chip/chip-list.component.js +52 -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 +74 -33
- 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 +1 -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 +89 -31
- package/dist/npm/util.js +52 -0
- package/dist/systemjs/kendo-angular-buttons.js +1 -1
- package/package.json +18 -15
- 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
|
@@ -32,7 +32,7 @@ export class ListButton {
|
|
|
32
32
|
this.subscribeEvents();
|
|
33
33
|
}
|
|
34
34
|
get popupClasses() {
|
|
35
|
-
const popupClasses = ['k-
|
|
35
|
+
const popupClasses = ['k-menu-popup'];
|
|
36
36
|
if (this._popupSettings.popupClass) {
|
|
37
37
|
popupClasses.push(this._popupSettings.popupClass);
|
|
38
38
|
}
|
|
@@ -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: 1641835943,
|
|
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)).
|
|
@@ -231,9 +277,8 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
231
277
|
activeArrow: boolean;
|
|
232
278
|
private buttonText;
|
|
233
279
|
private lockFocus;
|
|
280
|
+
private _rounded;
|
|
234
281
|
isFocused: boolean;
|
|
235
|
-
readonly isFlat: boolean;
|
|
236
|
-
readonly isOutline: boolean;
|
|
237
282
|
readonly widgetClasses: boolean;
|
|
238
283
|
readonly dir: string;
|
|
239
284
|
/**
|
|
@@ -308,7 +353,7 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
308
353
|
* Blurs the SplitButton component.
|
|
309
354
|
*/
|
|
310
355
|
blur(): void;
|
|
311
|
-
constructor(focusService: FocusService, navigationService: NavigationService, wrapperRef: ElementRef, zone: NgZone, popupService: PopupService, elRef: ElementRef, localization: LocalizationService, cdr: ChangeDetectorRef);
|
|
356
|
+
constructor(focusService: FocusService, navigationService: NavigationService, wrapperRef: ElementRef, zone: NgZone, popupService: PopupService, elRef: ElementRef, localization: LocalizationService, cdr: ChangeDetectorRef, renderer: Renderer2);
|
|
312
357
|
ngOnDestroy(): void;
|
|
313
358
|
/**
|
|
314
359
|
* Toggles the visibility of the popup.
|
|
@@ -327,4 +372,5 @@ export declare class SplitButtonComponent extends ListButton implements AfterVie
|
|
|
327
372
|
private _toggle;
|
|
328
373
|
private createPopup;
|
|
329
374
|
private destroyPopup;
|
|
375
|
+
private handleClasses;
|
|
330
376
|
}
|
|
@@ -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,46 @@ 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)).
|
|
102
|
+
*
|
|
103
|
+
* The possible values are:
|
|
104
|
+
* * `'small'`
|
|
105
|
+
* * `'medium'` (default)
|
|
106
|
+
* * `'large'`
|
|
107
|
+
* * `null`
|
|
108
|
+
*/
|
|
109
|
+
this.size = 'medium';
|
|
110
|
+
/**
|
|
111
|
+
* The fillMode property specifies the background and border styles of the SplitButton
|
|
112
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-fillMode)).
|
|
100
113
|
*
|
|
101
114
|
* The available values are:
|
|
115
|
+
* * `solid` (default)
|
|
102
116
|
* * `flat`
|
|
103
117
|
* * `outline`
|
|
118
|
+
* * `link`
|
|
119
|
+
*/
|
|
120
|
+
this.fillMode = 'solid';
|
|
121
|
+
/**
|
|
122
|
+
* The SplitButton allows you to specify predefined theme colors.
|
|
123
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
124
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-themeColor)).
|
|
125
|
+
*
|
|
126
|
+
* The possible values are:
|
|
127
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
128
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
129
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
130
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
131
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
132
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
133
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
134
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
135
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
136
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
137
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
104
138
|
*/
|
|
105
|
-
this.
|
|
139
|
+
this.themeColor = 'base';
|
|
106
140
|
/**
|
|
107
141
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
108
142
|
*/
|
|
@@ -187,9 +221,28 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
187
221
|
this.activeArrow = false;
|
|
188
222
|
this.buttonText = '';
|
|
189
223
|
this.lockFocus = false;
|
|
224
|
+
this._rounded = 'medium';
|
|
190
225
|
this._itemClick = this.itemClick;
|
|
191
226
|
this._blur = this.onBlur;
|
|
192
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* The rounded property specifies the border radius of the SplitButton
|
|
230
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
|
|
231
|
+
*
|
|
232
|
+
* The possible values are:
|
|
233
|
+
* * `'small'`
|
|
234
|
+
* * `'medium'` (default)
|
|
235
|
+
* * `'large'`
|
|
236
|
+
* * `'full'`
|
|
237
|
+
* * `null`
|
|
238
|
+
*/
|
|
239
|
+
set rounded(rounded) {
|
|
240
|
+
this.handleClasses(rounded, 'rounded');
|
|
241
|
+
this._rounded = rounded;
|
|
242
|
+
}
|
|
243
|
+
get rounded() {
|
|
244
|
+
return this._rounded;
|
|
245
|
+
}
|
|
193
246
|
/**
|
|
194
247
|
* When set to `true`, disables a SplitButton item
|
|
195
248
|
* ([see example]({% slug databinding_splitbutton %}#toc-arrays-of-complex-data)).
|
|
@@ -275,12 +328,6 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
275
328
|
get isFocused() {
|
|
276
329
|
return this._isFocused && !this._disabled;
|
|
277
330
|
}
|
|
278
|
-
get isFlat() {
|
|
279
|
-
return this.look === 'flat';
|
|
280
|
-
}
|
|
281
|
-
get isOutline() {
|
|
282
|
-
return this.look === 'outline';
|
|
283
|
-
}
|
|
284
331
|
get widgetClasses() {
|
|
285
332
|
return true;
|
|
286
333
|
}
|
|
@@ -367,6 +414,7 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
367
414
|
*/
|
|
368
415
|
ngAfterViewInit() {
|
|
369
416
|
this.updateButtonText();
|
|
417
|
+
this.handleClasses(this.rounded, 'rounded');
|
|
370
418
|
}
|
|
371
419
|
/**
|
|
372
420
|
* @hidden
|
|
@@ -514,6 +562,16 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
514
562
|
this.popupRef = null;
|
|
515
563
|
}
|
|
516
564
|
}
|
|
565
|
+
handleClasses(value, input) {
|
|
566
|
+
const elem = this.wrapperRef.nativeElement;
|
|
567
|
+
const classes = getStylingClasses('button', input, this[input], value);
|
|
568
|
+
if (classes.toRemove) {
|
|
569
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
570
|
+
}
|
|
571
|
+
if (classes.toAdd) {
|
|
572
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
517
575
|
};
|
|
518
576
|
tslib_1.__decorate([
|
|
519
577
|
Input(),
|
|
@@ -538,7 +596,20 @@ tslib_1.__decorate([
|
|
|
538
596
|
tslib_1.__decorate([
|
|
539
597
|
Input(),
|
|
540
598
|
tslib_1.__metadata("design:type", String)
|
|
541
|
-
], SplitButtonComponent.prototype, "
|
|
599
|
+
], SplitButtonComponent.prototype, "size", void 0);
|
|
600
|
+
tslib_1.__decorate([
|
|
601
|
+
Input(),
|
|
602
|
+
tslib_1.__metadata("design:type", String),
|
|
603
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
604
|
+
], SplitButtonComponent.prototype, "rounded", null);
|
|
605
|
+
tslib_1.__decorate([
|
|
606
|
+
Input(),
|
|
607
|
+
tslib_1.__metadata("design:type", String)
|
|
608
|
+
], SplitButtonComponent.prototype, "fillMode", void 0);
|
|
609
|
+
tslib_1.__decorate([
|
|
610
|
+
Input(),
|
|
611
|
+
tslib_1.__metadata("design:type", String)
|
|
612
|
+
], SplitButtonComponent.prototype, "themeColor", void 0);
|
|
542
613
|
tslib_1.__decorate([
|
|
543
614
|
Input(),
|
|
544
615
|
tslib_1.__metadata("design:type", Boolean),
|
|
@@ -619,20 +690,10 @@ tslib_1.__decorate([
|
|
|
619
690
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
620
691
|
], SplitButtonComponent.prototype, "containerRef", void 0);
|
|
621
692
|
tslib_1.__decorate([
|
|
622
|
-
HostBinding('class.k-
|
|
693
|
+
HostBinding('class.k-focus'),
|
|
623
694
|
tslib_1.__metadata("design:type", Boolean),
|
|
624
695
|
tslib_1.__metadata("design:paramtypes", [Boolean])
|
|
625
696
|
], 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
697
|
tslib_1.__decorate([
|
|
637
698
|
HostBinding('class.k-split-button'),
|
|
638
699
|
HostBinding('class.k-button-group'),
|
|
@@ -685,11 +746,15 @@ SplitButtonComponent = tslib_1.__decorate([
|
|
|
685
746
|
kendoButton
|
|
686
747
|
#button
|
|
687
748
|
[type]="type"
|
|
688
|
-
[look]="look"
|
|
689
749
|
[tabindex]="componentTabIndex"
|
|
690
750
|
[disabled]="disabled"
|
|
751
|
+
[size]="size"
|
|
752
|
+
[rounded]="rounded"
|
|
753
|
+
[fillMode]="fillMode"
|
|
754
|
+
[themeColor]="themeColor"
|
|
691
755
|
[icon]="icon"
|
|
692
|
-
[class.k-
|
|
756
|
+
[class.k-active]="active"
|
|
757
|
+
[class.k-icon-button]="!text && icon"
|
|
693
758
|
[iconClass]="iconClass"
|
|
694
759
|
[imageUrl]="imageUrl"
|
|
695
760
|
[ngClass]="buttonClass"
|
|
@@ -704,16 +769,21 @@ SplitButtonComponent = tslib_1.__decorate([
|
|
|
704
769
|
[attr.aria-owns]="listId"
|
|
705
770
|
[attr.aria-label]="ariaLabel"
|
|
706
771
|
>
|
|
707
|
-
|
|
772
|
+
<span *ngIf="text" class="k-button-text">
|
|
773
|
+
{{ text }}
|
|
774
|
+
</span><ng-content></ng-content>
|
|
708
775
|
</button>
|
|
709
776
|
<button
|
|
710
777
|
kendoButton
|
|
711
778
|
#arrowButton
|
|
712
779
|
type="button"
|
|
713
|
-
[class.k-
|
|
780
|
+
[class.k-active]="activeArrow"
|
|
714
781
|
[disabled]="disabled"
|
|
715
782
|
[icon]="arrowButtonIcon"
|
|
716
|
-
[
|
|
783
|
+
[size]="size"
|
|
784
|
+
[rounded]="rounded"
|
|
785
|
+
[fillMode]="fillMode"
|
|
786
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
717
787
|
[tabindex]="-1"
|
|
718
788
|
[ngClass]="arrowButtonClass"
|
|
719
789
|
(click)="onArrowButtonClick()"
|
|
@@ -731,6 +801,7 @@ SplitButtonComponent = tslib_1.__decorate([
|
|
|
731
801
|
(keypress)="keyPressHandler($event)"
|
|
732
802
|
(keyup)="keyUpHandler($event)"
|
|
733
803
|
[attr.dir]="dir"
|
|
804
|
+
[size]="size"
|
|
734
805
|
>
|
|
735
806
|
</kendo-button-list>
|
|
736
807
|
</ng-template>
|
|
@@ -744,7 +815,8 @@ SplitButtonComponent = tslib_1.__decorate([
|
|
|
744
815
|
PopupService,
|
|
745
816
|
ElementRef,
|
|
746
817
|
LocalizationService,
|
|
747
|
-
ChangeDetectorRef
|
|
818
|
+
ChangeDetectorRef,
|
|
819
|
+
Renderer2])
|
|
748
820
|
], SplitButtonComponent);
|
|
749
821
|
export { SplitButtonComponent };
|
|
750
822
|
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
|
+
};
|