@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
|
@@ -71,17 +71,58 @@ let DropDownButtonComponent = class DropDownButtonComponent extends ListButton {
|
|
|
71
71
|
*/
|
|
72
72
|
this.imageUrl = '';
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* The size property specifies the width and height of the DropDownButton
|
|
75
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-size)).
|
|
76
|
+
*
|
|
77
|
+
* The possible values are:
|
|
78
|
+
* * `'small'`
|
|
79
|
+
* * `'medium'` (default)
|
|
80
|
+
* * `'large'`
|
|
81
|
+
* * `null`
|
|
82
|
+
*/
|
|
83
|
+
this.size = 'medium';
|
|
84
|
+
/**
|
|
85
|
+
* The shape property specifies if the DropDownButton will be a square or rectangle.
|
|
86
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-shape)).
|
|
87
|
+
*
|
|
88
|
+
* The possible values are:
|
|
89
|
+
* * `'rectangle'` (default)
|
|
90
|
+
* * `'square'`
|
|
91
|
+
* * `null`
|
|
75
92
|
*/
|
|
76
|
-
this.
|
|
93
|
+
this.shape = 'rectangle';
|
|
77
94
|
/**
|
|
78
|
-
*
|
|
95
|
+
* The rounded property specifies the border radius of the DropDownButton
|
|
96
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-rounded)).
|
|
79
97
|
*
|
|
80
|
-
* The
|
|
81
|
-
* * `
|
|
82
|
-
* * `
|
|
98
|
+
* The possible values are:
|
|
99
|
+
* * `'small'`
|
|
100
|
+
* * `'medium'` (default)
|
|
101
|
+
* * `'large'`
|
|
102
|
+
* * `'full'`
|
|
103
|
+
* * `null`
|
|
83
104
|
*/
|
|
84
|
-
this.
|
|
105
|
+
this.rounded = 'medium';
|
|
106
|
+
/**
|
|
107
|
+
* The DropDownButton allows you to specify predefined theme colors.
|
|
108
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
109
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-themeColor)).
|
|
110
|
+
*
|
|
111
|
+
* The possible values are:
|
|
112
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
113
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
114
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
115
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
116
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
117
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
118
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
119
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
120
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
121
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
122
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
123
|
+
* * `null` —Removes the default CSS class (no class would be rendered).
|
|
124
|
+
*/
|
|
125
|
+
this.themeColor = 'base';
|
|
85
126
|
/**
|
|
86
127
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
87
128
|
*/
|
|
@@ -109,6 +150,7 @@ let DropDownButtonComponent = class DropDownButtonComponent extends ListButton {
|
|
|
109
150
|
*/
|
|
110
151
|
this.onBlur = new EventEmitter(); //tslint:disable-line:no-output-rename
|
|
111
152
|
this.listId = guid();
|
|
153
|
+
this._fillMode = 'solid';
|
|
112
154
|
this._itemClick = this.itemClick;
|
|
113
155
|
this._blur = this.onBlur;
|
|
114
156
|
}
|
|
@@ -150,6 +192,24 @@ let DropDownButtonComponent = class DropDownButtonComponent extends ListButton {
|
|
|
150
192
|
get data() {
|
|
151
193
|
return this._data;
|
|
152
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* The fillMode property specifies the background and border styles of the DropDownButton
|
|
197
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-fillMode)).
|
|
198
|
+
*
|
|
199
|
+
* The available values are:
|
|
200
|
+
* * `solid` (default)
|
|
201
|
+
* * `flat`
|
|
202
|
+
* * `outline`
|
|
203
|
+
* * `link`
|
|
204
|
+
* * `null`
|
|
205
|
+
*/
|
|
206
|
+
set fillMode(fillMode) {
|
|
207
|
+
// Temporary workaround for missing 'clear' styles
|
|
208
|
+
this._fillMode = fillMode === 'clear' ? 'flat' : fillMode;
|
|
209
|
+
}
|
|
210
|
+
get fillMode() {
|
|
211
|
+
return this._fillMode;
|
|
212
|
+
}
|
|
153
213
|
/**
|
|
154
214
|
* @hidden
|
|
155
215
|
*/
|
|
@@ -191,12 +251,6 @@ let DropDownButtonComponent = class DropDownButtonComponent extends ListButton {
|
|
|
191
251
|
get focused() {
|
|
192
252
|
return this._isFocused && !this._disabled;
|
|
193
253
|
}
|
|
194
|
-
get isFlat() {
|
|
195
|
-
return this.look === 'flat';
|
|
196
|
-
}
|
|
197
|
-
get isOutline() {
|
|
198
|
-
return this.look === 'outline';
|
|
199
|
-
}
|
|
200
254
|
get widgetClasses() {
|
|
201
255
|
return true;
|
|
202
256
|
}
|
|
@@ -449,12 +503,25 @@ tslib_1.__decorate([
|
|
|
449
503
|
], DropDownButtonComponent.prototype, "data", null);
|
|
450
504
|
tslib_1.__decorate([
|
|
451
505
|
Input(),
|
|
452
|
-
tslib_1.__metadata("design:type",
|
|
453
|
-
], DropDownButtonComponent.prototype, "
|
|
506
|
+
tslib_1.__metadata("design:type", String)
|
|
507
|
+
], DropDownButtonComponent.prototype, "size", void 0);
|
|
454
508
|
tslib_1.__decorate([
|
|
455
509
|
Input(),
|
|
456
510
|
tslib_1.__metadata("design:type", String)
|
|
457
|
-
], DropDownButtonComponent.prototype, "
|
|
511
|
+
], DropDownButtonComponent.prototype, "shape", void 0);
|
|
512
|
+
tslib_1.__decorate([
|
|
513
|
+
Input(),
|
|
514
|
+
tslib_1.__metadata("design:type", String)
|
|
515
|
+
], DropDownButtonComponent.prototype, "rounded", void 0);
|
|
516
|
+
tslib_1.__decorate([
|
|
517
|
+
Input(),
|
|
518
|
+
tslib_1.__metadata("design:type", String),
|
|
519
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
520
|
+
], DropDownButtonComponent.prototype, "fillMode", null);
|
|
521
|
+
tslib_1.__decorate([
|
|
522
|
+
Input(),
|
|
523
|
+
tslib_1.__metadata("design:type", String)
|
|
524
|
+
], DropDownButtonComponent.prototype, "themeColor", void 0);
|
|
458
525
|
tslib_1.__decorate([
|
|
459
526
|
Input(),
|
|
460
527
|
tslib_1.__metadata("design:type", Object)
|
|
@@ -484,20 +551,10 @@ tslib_1.__decorate([
|
|
|
484
551
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
485
552
|
], DropDownButtonComponent.prototype, "onBlur", void 0);
|
|
486
553
|
tslib_1.__decorate([
|
|
487
|
-
HostBinding('class.k-
|
|
554
|
+
HostBinding('class.k-focus'),
|
|
488
555
|
tslib_1.__metadata("design:type", Boolean),
|
|
489
556
|
tslib_1.__metadata("design:paramtypes", [])
|
|
490
557
|
], DropDownButtonComponent.prototype, "focused", null);
|
|
491
|
-
tslib_1.__decorate([
|
|
492
|
-
HostBinding('class.k-flat'),
|
|
493
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
494
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
495
|
-
], DropDownButtonComponent.prototype, "isFlat", null);
|
|
496
|
-
tslib_1.__decorate([
|
|
497
|
-
HostBinding('class.k-outline'),
|
|
498
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
499
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
500
|
-
], DropDownButtonComponent.prototype, "isOutline", null);
|
|
501
558
|
tslib_1.__decorate([
|
|
502
559
|
HostBinding('class.k-dropdown-button'),
|
|
503
560
|
tslib_1.__metadata("design:type", Boolean),
|
|
@@ -577,12 +634,17 @@ DropDownButtonComponent = tslib_1.__decorate([
|
|
|
577
634
|
role="menu"
|
|
578
635
|
type="button"
|
|
579
636
|
[tabindex]="componentTabIndex"
|
|
580
|
-
[class.k-
|
|
637
|
+
[class.k-active]="active"
|
|
581
638
|
[disabled]="disabled"
|
|
582
639
|
[icon]="icon"
|
|
583
640
|
[iconClass]="iconClass"
|
|
584
641
|
[imageUrl]="imageUrl"
|
|
585
642
|
[ngClass]="buttonClass"
|
|
643
|
+
[size]="size"
|
|
644
|
+
[shape]="shape"
|
|
645
|
+
[rounded]="rounded"
|
|
646
|
+
[fillMode]="fillMode"
|
|
647
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
586
648
|
(click)="openPopup()"
|
|
587
649
|
(focus)="handleFocus()"
|
|
588
650
|
(blur)="onButtonBlur()"
|
|
@@ -590,9 +652,7 @@ DropDownButtonComponent = tslib_1.__decorate([
|
|
|
590
652
|
[attr.aria-expanded]="openState"
|
|
591
653
|
[attr.aria-haspopup]="true"
|
|
592
654
|
[attr.aria-owns]="listId"
|
|
593
|
-
|
|
594
|
-
[primary]="primary"
|
|
595
|
-
>
|
|
655
|
+
>
|
|
596
656
|
<ng-content></ng-content>
|
|
597
657
|
</button>
|
|
598
658
|
<ng-template #popupTemplate>
|
|
@@ -607,6 +667,7 @@ DropDownButtonComponent = tslib_1.__decorate([
|
|
|
607
667
|
(keypress)="keyPressHandler($event)"
|
|
608
668
|
(keyup)="keyUpHandler($event)"
|
|
609
669
|
[attr.dir]="dir"
|
|
670
|
+
[size]="size"
|
|
610
671
|
>
|
|
611
672
|
</kendo-button-list>
|
|
612
673
|
</ng-template>
|
|
@@ -67,7 +67,7 @@ tslib_1.__decorate([
|
|
|
67
67
|
], DialItemComponent.prototype, "role", void 0);
|
|
68
68
|
tslib_1.__decorate([
|
|
69
69
|
HostBinding('attr.aria-disabled'),
|
|
70
|
-
HostBinding('class.k-
|
|
70
|
+
HostBinding('class.k-disabled'),
|
|
71
71
|
tslib_1.__metadata("design:type", Boolean),
|
|
72
72
|
tslib_1.__metadata("design:paramtypes", [])
|
|
73
73
|
], DialItemComponent.prototype, "disabledClass", null);
|
|
@@ -20,6 +20,7 @@ import { ButtonShape } from '../common/models/shape';
|
|
|
20
20
|
import { PreventableEvent } from '../preventable-event';
|
|
21
21
|
import { DialItemTemplateDirective } from './templates/dial-item-template.directive';
|
|
22
22
|
import { FloatingActionButtonTemplateDirective } from './templates/fab-template.directive';
|
|
23
|
+
import { ButtonRounded } from '../common/models';
|
|
23
24
|
/**
|
|
24
25
|
*
|
|
25
26
|
* Represents the [Kendo UI FloatingActionButton component for Angular]({% slug overview_floatingactionbutton %}).
|
|
@@ -48,18 +49,16 @@ export declare class FloatingActionButtonComponent implements AfterViewInit, OnD
|
|
|
48
49
|
* The theme color will be applied as background color of the component.
|
|
49
50
|
*
|
|
50
51
|
* The possible values are:
|
|
51
|
-
* * `primary` (Default)—Applies coloring based on the `primary` theme color.
|
|
52
|
-
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
53
|
-
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
54
|
-
* * `
|
|
55
|
-
* * `
|
|
56
|
-
* * `
|
|
57
|
-
* * `
|
|
58
|
-
* * `
|
|
59
|
-
* * `
|
|
60
|
-
* * `
|
|
61
|
-
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
62
|
-
*
|
|
52
|
+
* * `'primary'` (Default)—Applies coloring based on the `primary` theme color.
|
|
53
|
+
* * `'secondary'`—Applies coloring based on the `secondary` theme color.
|
|
54
|
+
* * `'tertiary'`— Applies coloring based on the `tertiary` theme color.
|
|
55
|
+
* * `'info'`—Applies coloring based on the `info` theme color.
|
|
56
|
+
* * `'success'`— Applies coloring based on the `success` theme color.
|
|
57
|
+
* * `'warning'`— Applies coloring based on the `warning` theme color.
|
|
58
|
+
* * `'error'`— Applies coloring based on the `error` theme color.
|
|
59
|
+
* * `'dark'`— Applies coloring based on the `dark` theme color.
|
|
60
|
+
* * `'light'`— Applies coloring based on the `light` theme color.
|
|
61
|
+
* * `'inverse'`— Applies coloring based on the `inverse` theme color.
|
|
63
62
|
*/
|
|
64
63
|
themeColor: ButtonThemeColor;
|
|
65
64
|
/**
|
|
@@ -67,21 +66,28 @@ export declare class FloatingActionButtonComponent implements AfterViewInit, OnD
|
|
|
67
66
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-size)).
|
|
68
67
|
*
|
|
69
68
|
* The possible values are:
|
|
70
|
-
* * `small`
|
|
71
|
-
* * `medium` (Default)
|
|
72
|
-
* * `large`
|
|
73
|
-
*
|
|
69
|
+
* * `'small'`
|
|
70
|
+
* * `'medium'` (Default)
|
|
71
|
+
* * `'large'`
|
|
74
72
|
*/
|
|
75
73
|
size: ButtonSize;
|
|
74
|
+
/**
|
|
75
|
+
* The rounded property specifies the border radius of the FloatingActionButton.
|
|
76
|
+
*
|
|
77
|
+
* The possible values are:
|
|
78
|
+
* * `'small'`
|
|
79
|
+
* * `'medium'`
|
|
80
|
+
* * `'large'`
|
|
81
|
+
* * `'full'` (default)
|
|
82
|
+
* * `null`
|
|
83
|
+
*/
|
|
84
|
+
rounded: ButtonRounded;
|
|
76
85
|
/**
|
|
77
86
|
* Specifies the shape of the FloatingActionButton
|
|
78
87
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-shape)).
|
|
79
88
|
*
|
|
80
89
|
* The possible values are:
|
|
81
|
-
* * `
|
|
82
|
-
* * `circle`—Applies circle shape on the FloatingActionButton.
|
|
83
|
-
* * `rectangle`—Applies rectangular shape on the FloatingActionButton.
|
|
84
|
-
* * `rounded`—Applies rounded shape on the FloatingActionButton.
|
|
90
|
+
* * `rectangle` (Default)—Applies rectangular shape on the FloatingActionButton.
|
|
85
91
|
* * `square`—Applies square shape on the FloatingActionButton.
|
|
86
92
|
*
|
|
87
93
|
*/
|
|
@@ -202,11 +208,13 @@ export declare class FloatingActionButtonComponent implements AfterViewInit, OnD
|
|
|
202
208
|
private _disabled;
|
|
203
209
|
private _align;
|
|
204
210
|
private _offset;
|
|
211
|
+
private _rounded;
|
|
205
212
|
private subscriptions;
|
|
206
213
|
private popupMouseDownListener;
|
|
207
214
|
private rtl;
|
|
208
215
|
private animationEnd;
|
|
209
216
|
private popupRef;
|
|
217
|
+
private initialSetup;
|
|
210
218
|
constructor(renderer: Renderer2, element: ElementRef, focusService: FocusService, navigationService: NavigationService, ngZone: NgZone, popupService: PopupService, builder: AnimationBuilder, localizationService: LocalizationService);
|
|
211
219
|
ngAfterViewInit(): void;
|
|
212
220
|
ngOnDestroy(): void;
|
|
@@ -279,7 +287,6 @@ export declare class FloatingActionButtonComponent implements AfterViewInit, OnD
|
|
|
279
287
|
private onNavigationEnterPress;
|
|
280
288
|
private onNavigationClose;
|
|
281
289
|
private alignClass;
|
|
282
|
-
private applyClasses;
|
|
283
290
|
private toggleDialWithEvents;
|
|
284
291
|
private openPopup;
|
|
285
292
|
private closePopup;
|
|
@@ -36,12 +36,16 @@ const SIZE_CLASSES = {
|
|
|
36
36
|
large: 'k-fab-lg'
|
|
37
37
|
};
|
|
38
38
|
const SHAPE_CLASSES = {
|
|
39
|
-
pill: 'k-fab-pill',
|
|
40
|
-
circle: 'k-fab-circle',
|
|
41
39
|
rectangle: 'k-fab-rectangle',
|
|
42
|
-
square: 'k-fab-square'
|
|
43
|
-
rounded: 'k-fab-rounded'
|
|
40
|
+
square: 'k-fab-square'
|
|
44
41
|
};
|
|
42
|
+
const ROUNDED_CLASSES = {
|
|
43
|
+
small: 'k-rounded-sm',
|
|
44
|
+
medium: 'k-rounded-md',
|
|
45
|
+
large: 'k-rounded-lg',
|
|
46
|
+
full: 'k-rounded-full'
|
|
47
|
+
};
|
|
48
|
+
const FILLMODE_CLASS = 'k-fab-solid';
|
|
45
49
|
const DEFAULT_DURATION = 180;
|
|
46
50
|
const DEFAULT_ITEM_GAP = 90;
|
|
47
51
|
const DEFAULT_OFFSET = '16px';
|
|
@@ -121,13 +125,15 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
121
125
|
this.id = `k-${guid()}`;
|
|
122
126
|
this._themeColor = 'primary';
|
|
123
127
|
this._size = 'medium';
|
|
124
|
-
this._shape = '
|
|
128
|
+
this._shape = 'rectangle';
|
|
125
129
|
this._disabled = false;
|
|
126
130
|
this._align = { horizontal: 'end', vertical: 'bottom' };
|
|
127
131
|
this._offset = { x: DEFAULT_OFFSET, y: DEFAULT_OFFSET };
|
|
132
|
+
this._rounded = 'full';
|
|
128
133
|
this.subscriptions = new Subscription();
|
|
129
134
|
this.rtl = false;
|
|
130
135
|
this.animationEnd = new EventEmitter();
|
|
136
|
+
this.initialSetup = true;
|
|
131
137
|
validatePackage(packageMetadata);
|
|
132
138
|
this.subscribeNavigationEvents();
|
|
133
139
|
this.subscriptions.add(this.localizationService.changes.subscribe(({ rtl }) => {
|
|
@@ -147,18 +153,16 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
147
153
|
* The theme color will be applied as background color of the component.
|
|
148
154
|
*
|
|
149
155
|
* The possible values are:
|
|
150
|
-
* * `primary` (Default)—Applies coloring based on the `primary` theme color.
|
|
151
|
-
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
152
|
-
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
153
|
-
* * `
|
|
154
|
-
* * `
|
|
155
|
-
* * `
|
|
156
|
-
* * `
|
|
157
|
-
* * `
|
|
158
|
-
* * `
|
|
159
|
-
* * `
|
|
160
|
-
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
161
|
-
*
|
|
156
|
+
* * `'primary'` (Default)—Applies coloring based on the `primary` theme color.
|
|
157
|
+
* * `'secondary'`—Applies coloring based on the `secondary` theme color.
|
|
158
|
+
* * `'tertiary'`— Applies coloring based on the `tertiary` theme color.
|
|
159
|
+
* * `'info'`—Applies coloring based on the `info` theme color.
|
|
160
|
+
* * `'success'`— Applies coloring based on the `success` theme color.
|
|
161
|
+
* * `'warning'`— Applies coloring based on the `warning` theme color.
|
|
162
|
+
* * `'error'`— Applies coloring based on the `error` theme color.
|
|
163
|
+
* * `'dark'`— Applies coloring based on the `dark` theme color.
|
|
164
|
+
* * `'light'`— Applies coloring based on the `light` theme color.
|
|
165
|
+
* * `'inverse'`— Applies coloring based on the `inverse` theme color.
|
|
162
166
|
*/
|
|
163
167
|
set themeColor(themeColor) {
|
|
164
168
|
this.handleClasses(themeColor, 'themeColor');
|
|
@@ -172,10 +176,9 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
172
176
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-size)).
|
|
173
177
|
*
|
|
174
178
|
* The possible values are:
|
|
175
|
-
* * `small`
|
|
176
|
-
* * `medium` (Default)
|
|
177
|
-
* * `large`
|
|
178
|
-
*
|
|
179
|
+
* * `'small'`
|
|
180
|
+
* * `'medium'` (Default)
|
|
181
|
+
* * `'large'`
|
|
179
182
|
*/
|
|
180
183
|
set size(size) {
|
|
181
184
|
this.handleClasses(size, 'size');
|
|
@@ -184,15 +187,29 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
184
187
|
get size() {
|
|
185
188
|
return this._size;
|
|
186
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* The rounded property specifies the border radius of the FloatingActionButton.
|
|
192
|
+
*
|
|
193
|
+
* The possible values are:
|
|
194
|
+
* * `'small'`
|
|
195
|
+
* * `'medium'`
|
|
196
|
+
* * `'large'`
|
|
197
|
+
* * `'full'` (default)
|
|
198
|
+
* * `null`
|
|
199
|
+
*/
|
|
200
|
+
set rounded(rounded) {
|
|
201
|
+
this.handleClasses(rounded, 'rounded');
|
|
202
|
+
this._rounded = rounded;
|
|
203
|
+
}
|
|
204
|
+
get rounded() {
|
|
205
|
+
return this._rounded;
|
|
206
|
+
}
|
|
187
207
|
/**
|
|
188
208
|
* Specifies the shape of the FloatingActionButton
|
|
189
209
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-shape)).
|
|
190
210
|
*
|
|
191
211
|
* The possible values are:
|
|
192
|
-
* * `
|
|
193
|
-
* * `circle`—Applies circle shape on the FloatingActionButton.
|
|
194
|
-
* * `rectangle`—Applies rectangular shape on the FloatingActionButton.
|
|
195
|
-
* * `rounded`—Applies rounded shape on the FloatingActionButton.
|
|
212
|
+
* * `rectangle` (Default)—Applies rectangular shape on the FloatingActionButton.
|
|
196
213
|
* * `square`—Applies square shape on the FloatingActionButton.
|
|
197
214
|
*
|
|
198
215
|
*/
|
|
@@ -250,8 +267,10 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
250
267
|
return this.disabled ? (-1) : this.tabIndex;
|
|
251
268
|
}
|
|
252
269
|
ngAfterViewInit() {
|
|
253
|
-
this.
|
|
270
|
+
['shape', 'size', 'rounded', 'themeColor'].forEach(option => this.handleClasses(this[option], option));
|
|
271
|
+
this.renderer.addClass(this.element.nativeElement, this.alignClass());
|
|
254
272
|
this.offsetStyles();
|
|
273
|
+
this.initialSetup = false;
|
|
255
274
|
}
|
|
256
275
|
ngOnDestroy() {
|
|
257
276
|
this.subscriptions.unsubscribe();
|
|
@@ -393,20 +412,24 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
393
412
|
this.toggleDialWithEvents(false);
|
|
394
413
|
}
|
|
395
414
|
handleClasses(inputValue, input) {
|
|
396
|
-
if (isPresent(this.button) && (this[input] !== inputValue)) {
|
|
415
|
+
if (isPresent(this.button) && (this[input] !== inputValue || this.initialSetup)) {
|
|
397
416
|
const button = this.button.nativeElement;
|
|
398
417
|
const classesToRemove = {
|
|
399
|
-
themeColor:
|
|
418
|
+
themeColor: `${FILLMODE_CLASS}-${this.themeColor}`,
|
|
400
419
|
size: SIZE_CLASSES[this.size],
|
|
401
|
-
shape: SHAPE_CLASSES[this.shape]
|
|
420
|
+
shape: SHAPE_CLASSES[this.shape],
|
|
421
|
+
rounded: ROUNDED_CLASSES[this.rounded]
|
|
402
422
|
};
|
|
403
423
|
const classesToAdd = {
|
|
404
|
-
themeColor:
|
|
424
|
+
themeColor: inputValue ? `${FILLMODE_CLASS}-${inputValue}` : null,
|
|
405
425
|
size: SIZE_CLASSES[inputValue],
|
|
406
|
-
shape: SHAPE_CLASSES[inputValue]
|
|
426
|
+
shape: SHAPE_CLASSES[inputValue],
|
|
427
|
+
rounded: ROUNDED_CLASSES[inputValue]
|
|
407
428
|
};
|
|
408
429
|
this.renderer.removeClass(button, classesToRemove[input]);
|
|
409
|
-
|
|
430
|
+
if (classesToAdd[input]) {
|
|
431
|
+
this.renderer.addClass(button, classesToAdd[input]);
|
|
432
|
+
}
|
|
410
433
|
}
|
|
411
434
|
}
|
|
412
435
|
onEnterPressed() {
|
|
@@ -461,14 +484,6 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
461
484
|
alignClass() {
|
|
462
485
|
return `k-pos-${this.align.vertical}-${this.align.horizontal}`;
|
|
463
486
|
}
|
|
464
|
-
applyClasses() {
|
|
465
|
-
const hostElement = this.element.nativeElement;
|
|
466
|
-
const button = this.button.nativeElement;
|
|
467
|
-
this.renderer.addClass(button, SHAPE_CLASSES[this.shape]);
|
|
468
|
-
this.renderer.addClass(button, `k-fab-${this.themeColor}`);
|
|
469
|
-
this.renderer.addClass(button, SIZE_CLASSES[this.size]);
|
|
470
|
-
this.renderer.addClass(hostElement, this.alignClass());
|
|
471
|
-
}
|
|
472
487
|
toggleDialWithEvents(open) {
|
|
473
488
|
if (open === this.isOpen) {
|
|
474
489
|
return;
|
|
@@ -688,6 +703,11 @@ tslib_1.__decorate([
|
|
|
688
703
|
tslib_1.__metadata("design:type", String),
|
|
689
704
|
tslib_1.__metadata("design:paramtypes", [String])
|
|
690
705
|
], FloatingActionButtonComponent.prototype, "size", null);
|
|
706
|
+
tslib_1.__decorate([
|
|
707
|
+
Input(),
|
|
708
|
+
tslib_1.__metadata("design:type", String),
|
|
709
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
710
|
+
], FloatingActionButtonComponent.prototype, "rounded", null);
|
|
691
711
|
tslib_1.__decorate([
|
|
692
712
|
Input(),
|
|
693
713
|
tslib_1.__metadata("design:type", String),
|
|
@@ -784,8 +804,8 @@ FloatingActionButtonComponent = tslib_1.__decorate([
|
|
|
784
804
|
[attr.role]="role"
|
|
785
805
|
[tabIndex]="componentTabIndex"
|
|
786
806
|
type="button"
|
|
787
|
-
|
|
788
|
-
[class.k-
|
|
807
|
+
class="k-fab k-fab-solid"
|
|
808
|
+
[class.k-disabled]="disabled"
|
|
789
809
|
[ngClass]="buttonClass"
|
|
790
810
|
[disabled]="disabled"
|
|
791
811
|
[attr.aria-disabled]="disabled"
|
|
@@ -18,10 +18,10 @@ let FocusableDirective = class FocusableDirective {
|
|
|
18
18
|
}
|
|
19
19
|
ngOnInit() {
|
|
20
20
|
if (this.index === this.focusService.focused) {
|
|
21
|
-
this.renderer.addClass(this.element, 'k-
|
|
21
|
+
this.renderer.addClass(this.element, 'k-focus');
|
|
22
22
|
}
|
|
23
23
|
else {
|
|
24
|
-
this.renderer.removeClass(this.element, 'k-
|
|
24
|
+
this.renderer.removeClass(this.element, 'k-focus');
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
@@ -36,11 +36,11 @@ let FocusableDirective = class FocusableDirective {
|
|
|
36
36
|
}
|
|
37
37
|
this.focusSubscription = this.focusService.onFocus.subscribe((index) => {
|
|
38
38
|
if (this.index === index) {
|
|
39
|
-
this.renderer.addClass(this.element, 'k-
|
|
39
|
+
this.renderer.addClass(this.element, 'k-focus');
|
|
40
40
|
this.element.focus();
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
this.renderer.removeClass(this.element, 'k-
|
|
43
|
+
this.renderer.removeClass(this.element, 'k-focus');
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|