@progress/kendo-angular-buttons 6.4.1 → 7.0.0-dev.202201180832
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/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- 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 +14 -11
- 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
|
@@ -36,12 +36,16 @@ var SIZE_CLASSES = {
|
|
|
36
36
|
large: 'k-fab-lg'
|
|
37
37
|
};
|
|
38
38
|
var 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
|
+
var ROUNDED_CLASSES = {
|
|
43
|
+
small: 'k-rounded-sm',
|
|
44
|
+
medium: 'k-rounded-md',
|
|
45
|
+
large: 'k-rounded-lg',
|
|
46
|
+
full: 'k-rounded-full'
|
|
47
|
+
};
|
|
48
|
+
var FILLMODE_CLASS = 'k-fab-solid';
|
|
45
49
|
var DEFAULT_DURATION = 180;
|
|
46
50
|
var DEFAULT_ITEM_GAP = 90;
|
|
47
51
|
var DEFAULT_OFFSET = '16px';
|
|
@@ -122,13 +126,15 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
122
126
|
this.id = "k-" + guid();
|
|
123
127
|
this._themeColor = 'primary';
|
|
124
128
|
this._size = 'medium';
|
|
125
|
-
this._shape = '
|
|
129
|
+
this._shape = 'rectangle';
|
|
126
130
|
this._disabled = false;
|
|
127
131
|
this._align = { horizontal: 'end', vertical: 'bottom' };
|
|
128
132
|
this._offset = { x: DEFAULT_OFFSET, y: DEFAULT_OFFSET };
|
|
133
|
+
this._rounded = 'full';
|
|
129
134
|
this.subscriptions = new Subscription();
|
|
130
135
|
this.rtl = false;
|
|
131
136
|
this.animationEnd = new EventEmitter();
|
|
137
|
+
this.initialSetup = true;
|
|
132
138
|
validatePackage(packageMetadata);
|
|
133
139
|
this.subscribeNavigationEvents();
|
|
134
140
|
this.subscriptions.add(this.localizationService.changes.subscribe(function (_a) {
|
|
@@ -161,18 +167,16 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
161
167
|
* The theme color will be applied as background color of the component.
|
|
162
168
|
*
|
|
163
169
|
* The possible values are:
|
|
164
|
-
* * `primary` (Default)—Applies coloring based on the `primary` theme color.
|
|
165
|
-
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
166
|
-
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
167
|
-
* * `
|
|
168
|
-
* * `
|
|
169
|
-
* * `
|
|
170
|
-
* * `
|
|
171
|
-
* * `
|
|
172
|
-
* * `
|
|
173
|
-
* * `
|
|
174
|
-
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
175
|
-
*
|
|
170
|
+
* * `'primary'` (Default)—Applies coloring based on the `primary` theme color.
|
|
171
|
+
* * `'secondary'`—Applies coloring based on the `secondary` theme color.
|
|
172
|
+
* * `'tertiary'`— Applies coloring based on the `tertiary` theme color.
|
|
173
|
+
* * `'info'`—Applies coloring based on the `info` theme color.
|
|
174
|
+
* * `'success'`— Applies coloring based on the `success` theme color.
|
|
175
|
+
* * `'warning'`— Applies coloring based on the `warning` theme color.
|
|
176
|
+
* * `'error'`— Applies coloring based on the `error` theme color.
|
|
177
|
+
* * `'dark'`— Applies coloring based on the `dark` theme color.
|
|
178
|
+
* * `'light'`— Applies coloring based on the `light` theme color.
|
|
179
|
+
* * `'inverse'`— Applies coloring based on the `inverse` theme color.
|
|
176
180
|
*/
|
|
177
181
|
set: function (themeColor) {
|
|
178
182
|
this.handleClasses(themeColor, 'themeColor');
|
|
@@ -190,10 +194,9 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
190
194
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-size)).
|
|
191
195
|
*
|
|
192
196
|
* The possible values are:
|
|
193
|
-
* * `small`
|
|
194
|
-
* * `medium` (Default)
|
|
195
|
-
* * `large`
|
|
196
|
-
*
|
|
197
|
+
* * `'small'`
|
|
198
|
+
* * `'medium'` (Default)
|
|
199
|
+
* * `'large'`
|
|
197
200
|
*/
|
|
198
201
|
set: function (size) {
|
|
199
202
|
this.handleClasses(size, 'size');
|
|
@@ -202,6 +205,27 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
202
205
|
enumerable: true,
|
|
203
206
|
configurable: true
|
|
204
207
|
});
|
|
208
|
+
Object.defineProperty(FloatingActionButtonComponent.prototype, "rounded", {
|
|
209
|
+
get: function () {
|
|
210
|
+
return this._rounded;
|
|
211
|
+
},
|
|
212
|
+
/**
|
|
213
|
+
* The rounded property specifies the border radius of the FloatingActionButton.
|
|
214
|
+
*
|
|
215
|
+
* The possible values are:
|
|
216
|
+
* * `'small'`
|
|
217
|
+
* * `'medium'`
|
|
218
|
+
* * `'large'`
|
|
219
|
+
* * `'full'` (default)
|
|
220
|
+
* * `null`
|
|
221
|
+
*/
|
|
222
|
+
set: function (rounded) {
|
|
223
|
+
this.handleClasses(rounded, 'rounded');
|
|
224
|
+
this._rounded = rounded;
|
|
225
|
+
},
|
|
226
|
+
enumerable: true,
|
|
227
|
+
configurable: true
|
|
228
|
+
});
|
|
205
229
|
Object.defineProperty(FloatingActionButtonComponent.prototype, "shape", {
|
|
206
230
|
get: function () {
|
|
207
231
|
return this._shape;
|
|
@@ -211,10 +235,7 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
211
235
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-shape)).
|
|
212
236
|
*
|
|
213
237
|
* The possible values are:
|
|
214
|
-
* * `
|
|
215
|
-
* * `circle`—Applies circle shape on the FloatingActionButton.
|
|
216
|
-
* * `rectangle`—Applies rectangular shape on the FloatingActionButton.
|
|
217
|
-
* * `rounded`—Applies rounded shape on the FloatingActionButton.
|
|
238
|
+
* * `rectangle` (Default)—Applies rectangular shape on the FloatingActionButton.
|
|
218
239
|
* * `square`—Applies square shape on the FloatingActionButton.
|
|
219
240
|
*
|
|
220
241
|
*/
|
|
@@ -288,8 +309,11 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
288
309
|
configurable: true
|
|
289
310
|
});
|
|
290
311
|
FloatingActionButtonComponent.prototype.ngAfterViewInit = function () {
|
|
291
|
-
this
|
|
312
|
+
var _this = this;
|
|
313
|
+
['shape', 'size', 'rounded', 'themeColor'].forEach(function (option) { return _this.handleClasses(_this[option], option); });
|
|
314
|
+
this.renderer.addClass(this.element.nativeElement, this.alignClass());
|
|
292
315
|
this.offsetStyles();
|
|
316
|
+
this.initialSetup = false;
|
|
293
317
|
};
|
|
294
318
|
FloatingActionButtonComponent.prototype.ngOnDestroy = function () {
|
|
295
319
|
this.subscriptions.unsubscribe();
|
|
@@ -453,20 +477,24 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
453
477
|
this.toggleDialWithEvents(false);
|
|
454
478
|
};
|
|
455
479
|
FloatingActionButtonComponent.prototype.handleClasses = function (inputValue, input) {
|
|
456
|
-
if (isPresent(this.button) && (this[input] !== inputValue)) {
|
|
480
|
+
if (isPresent(this.button) && (this[input] !== inputValue || this.initialSetup)) {
|
|
457
481
|
var button = this.button.nativeElement;
|
|
458
482
|
var classesToRemove = {
|
|
459
|
-
themeColor: "
|
|
483
|
+
themeColor: FILLMODE_CLASS + "-" + this.themeColor,
|
|
460
484
|
size: SIZE_CLASSES[this.size],
|
|
461
|
-
shape: SHAPE_CLASSES[this.shape]
|
|
485
|
+
shape: SHAPE_CLASSES[this.shape],
|
|
486
|
+
rounded: ROUNDED_CLASSES[this.rounded]
|
|
462
487
|
};
|
|
463
488
|
var classesToAdd = {
|
|
464
|
-
themeColor: "
|
|
489
|
+
themeColor: inputValue ? FILLMODE_CLASS + "-" + inputValue : null,
|
|
465
490
|
size: SIZE_CLASSES[inputValue],
|
|
466
|
-
shape: SHAPE_CLASSES[inputValue]
|
|
491
|
+
shape: SHAPE_CLASSES[inputValue],
|
|
492
|
+
rounded: ROUNDED_CLASSES[inputValue]
|
|
467
493
|
};
|
|
468
494
|
this.renderer.removeClass(button, classesToRemove[input]);
|
|
469
|
-
|
|
495
|
+
if (classesToAdd[input]) {
|
|
496
|
+
this.renderer.addClass(button, classesToAdd[input]);
|
|
497
|
+
}
|
|
470
498
|
}
|
|
471
499
|
};
|
|
472
500
|
FloatingActionButtonComponent.prototype.onEnterPressed = function () {
|
|
@@ -523,14 +551,6 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
523
551
|
FloatingActionButtonComponent.prototype.alignClass = function () {
|
|
524
552
|
return "k-pos-" + this.align.vertical + "-" + this.align.horizontal;
|
|
525
553
|
};
|
|
526
|
-
FloatingActionButtonComponent.prototype.applyClasses = function () {
|
|
527
|
-
var hostElement = this.element.nativeElement;
|
|
528
|
-
var button = this.button.nativeElement;
|
|
529
|
-
this.renderer.addClass(button, SHAPE_CLASSES[this.shape]);
|
|
530
|
-
this.renderer.addClass(button, "k-fab-" + this.themeColor);
|
|
531
|
-
this.renderer.addClass(button, SIZE_CLASSES[this.size]);
|
|
532
|
-
this.renderer.addClass(hostElement, this.alignClass());
|
|
533
|
-
};
|
|
534
554
|
FloatingActionButtonComponent.prototype.toggleDialWithEvents = function (open) {
|
|
535
555
|
if (open === this.isOpen) {
|
|
536
556
|
return;
|
|
@@ -772,6 +792,11 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
772
792
|
tslib_1.__metadata("design:type", String),
|
|
773
793
|
tslib_1.__metadata("design:paramtypes", [String])
|
|
774
794
|
], FloatingActionButtonComponent.prototype, "size", null);
|
|
795
|
+
tslib_1.__decorate([
|
|
796
|
+
Input(),
|
|
797
|
+
tslib_1.__metadata("design:type", String),
|
|
798
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
799
|
+
], FloatingActionButtonComponent.prototype, "rounded", null);
|
|
775
800
|
tslib_1.__decorate([
|
|
776
801
|
Input(),
|
|
777
802
|
tslib_1.__metadata("design:type", String),
|
|
@@ -861,7 +886,7 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
861
886
|
useValue: 'kendo.floatingactionbutton'
|
|
862
887
|
}
|
|
863
888
|
],
|
|
864
|
-
template: "\n <button\n #button\n [attr.id]=\"id\"\n [attr.role]=\"role\"\n [tabIndex]=\"componentTabIndex\"\n type=\"button\"\n
|
|
889
|
+
template: "\n <button\n #button\n [attr.id]=\"id\"\n [attr.role]=\"role\"\n [tabIndex]=\"componentTabIndex\"\n type=\"button\"\n class=\"k-fab k-fab-solid\"\n [class.k-disabled]=\"disabled\"\n [ngClass]=\"buttonClass\"\n [disabled]=\"disabled\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-expanded]=\"ariaExpanded\"\n [attr.aria-haspopup]=\"ariaHasPopup\"\n (focus)=\"focusHandler()\"\n (blur)=\"blurHandler()\"\n [kendoEventsOutsideAngular]=\"{\n keydown: keyDownHandler,\n click: clickHandler\n }\"\n [scope]=\"this\"\n >\n <ng-template *ngIf=\"fabTemplate\"\n [ngTemplateOutlet]=\"fabTemplate?.templateRef\"\n >\n </ng-template>\n\n <ng-container *ngIf=\"!fabTemplate\">\n <span *ngIf=\"icon || iconClass\" [ngClass]=\"iconClasses\"></span>\n <span *ngIf=\"text\" class=\"k-fab-text\">{{ text }}</span>\n </ng-container>\n </button>\n\n <ng-template #popupTemplate>\n <ul\n kendoDialList\n [ngClass]=\"dialClass\"\n [dialItems]=\"dialItems\"\n [dialItemTemplate]='dialItemTemplate?.templateRef'\n [align]=\"align\"\n [attr.aria-labelledby]=\"id\"\n (click)=\"onItemClick($event)\"\n >\n </ul>\n </ng-template>\n "
|
|
865
890
|
}),
|
|
866
891
|
tslib_1.__metadata("design:paramtypes", [Renderer2,
|
|
867
892
|
ElementRef,
|
|
@@ -18,10 +18,10 @@ var FocusableDirective = /** @class */ (function () {
|
|
|
18
18
|
}
|
|
19
19
|
FocusableDirective.prototype.ngOnInit = function () {
|
|
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
|
/**
|
|
@@ -37,11 +37,11 @@ var FocusableDirective = /** @class */ (function () {
|
|
|
37
37
|
}
|
|
38
38
|
this.focusSubscription = this.focusService.onFocus.subscribe(function (index) {
|
|
39
39
|
if (_this.index === index) {
|
|
40
|
-
_this.renderer.addClass(_this.element, 'k-
|
|
40
|
+
_this.renderer.addClass(_this.element, 'k-focus');
|
|
41
41
|
_this.element.focus();
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
|
-
_this.renderer.removeClass(_this.element, 'k-
|
|
44
|
+
_this.renderer.removeClass(_this.element, 'k-focus');
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
};
|
|
@@ -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
|
*/
|
|
@@ -26,6 +28,7 @@ var ListButton = /** @class */ (function () {
|
|
|
26
28
|
this._popupSettings = { animate: true, popupClass: '' };
|
|
27
29
|
this.listId = guid();
|
|
28
30
|
this._isFocused = false;
|
|
31
|
+
validatePackage(packageMetadata);
|
|
29
32
|
this.focusService = focusService;
|
|
30
33
|
this.navigationService = navigationService;
|
|
31
34
|
this.wrapper = wrapperRef.nativeElement;
|
|
@@ -37,7 +40,7 @@ var ListButton = /** @class */ (function () {
|
|
|
37
40
|
}
|
|
38
41
|
Object.defineProperty(ListButton.prototype, "popupClasses", {
|
|
39
42
|
get: function () {
|
|
40
|
-
var popupClasses = ['k-
|
|
43
|
+
var popupClasses = ['k-menu-popup'];
|
|
41
44
|
if (this._popupSettings.popupClass) {
|
|
42
45
|
popupClasses.push(this._popupSettings.popupClass);
|
|
43
46
|
}
|
|
@@ -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,21 @@ var ListComponent = /** @class */ (function () {
|
|
|
14
15
|
function ListComponent() {
|
|
15
16
|
this.onItemClick = new EventEmitter();
|
|
16
17
|
this.onItemBlur = new EventEmitter();
|
|
18
|
+
this.sizeClass = '';
|
|
17
19
|
validatePackage(packageMetadata);
|
|
18
20
|
}
|
|
21
|
+
Object.defineProperty(ListComponent.prototype, "size", {
|
|
22
|
+
set: function (size) {
|
|
23
|
+
if (size) {
|
|
24
|
+
this.sizeClass = "k-menu-group-" + SIZES[size];
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
this.sizeClass = '';
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true
|
|
32
|
+
});
|
|
19
33
|
ListComponent.prototype.getText = function (dataItem) {
|
|
20
34
|
if (dataItem) {
|
|
21
35
|
return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
|
|
@@ -54,10 +68,15 @@ var ListComponent = /** @class */ (function () {
|
|
|
54
68
|
Output(),
|
|
55
69
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
56
70
|
], ListComponent.prototype, "onItemBlur", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
Input(),
|
|
73
|
+
tslib_1.__metadata("design:type", String),
|
|
74
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
75
|
+
], ListComponent.prototype, "size", null);
|
|
57
76
|
ListComponent = tslib_1.__decorate([
|
|
58
77
|
Component({
|
|
59
78
|
selector: 'kendo-button-list',
|
|
60
|
-
template: "\n <ul class=\"k-
|
|
79
|
+
template: "\n <ul class=\"k-group k-menu-group k-reset\" [ngClass]=\"sizeClass\" unselectable=\"on\" role=\"menu\">\n <li role=\"menuitem\" unselectable=\"on\"\n kendoButtonFocusable\n *ngFor=\"let dataItem of data; let index = index;\"\n class=\"k-item k-menu-item\"\n (click)=\"onClick(index)\"\n (blur)=\"onBlur()\"\n [attr.aria-disabled]=\"dataItem.disabled ? true : false\">\n <ng-template [ngIf]=\"itemTemplate?.templateRef\">\n <span kendoButtonFocusable [index]=\"index\" class=\"k-link k-menu-link\" [class.k-disabled]=\"dataItem.disabled\" tabindex=\"-1\">\n <ng-template [templateContext]=\"{templateRef: itemTemplate?.templateRef, $implicit: dataItem}\"></ng-template>\n </span>\n </ng-template>\n <ng-template [ngIf]=\"!itemTemplate?.templateRef\">\n <span kendoButtonFocusable [index]=\"index\" class=\"k-link k-menu-link\" [class.k-disabled]=\"dataItem.disabled\" tabindex=\"-1\">\n <span\n *ngIf=\"dataItem.icon || dataItem.iconClass\"\n [ngClass]=\"getIconClasses(dataItem)\"\n ></span>\n <img\n *ngIf=\"dataItem.imageUrl\"\n class=\"k-image\"\n [src]=\"dataItem.imageUrl\"\n alt=\"\"\n >\n <span *ngIf=\"getText(dataItem)\" class=\"k-menu-link-text\">\n {{ getText(dataItem) }}\n </span>\n </span>\n </ng-template>\n </li>\n </ul>\n "
|
|
61
80
|
}),
|
|
62
81
|
tslib_1.__metadata("design:paramtypes", [])
|
|
63
82
|
], ListComponent);
|
|
@@ -9,7 +9,7 @@ export var packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-buttons',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1642494672,
|
|
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
|
};
|
|
@@ -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
|
var NAVIGATION_SETTINGS = {
|
|
21
21
|
useLeftRightArrows: true
|
|
22
22
|
};
|
|
@@ -68,11 +68,12 @@ var NAVIGATION_SETTINGS_PROVIDER = {
|
|
|
68
68
|
*/
|
|
69
69
|
var SplitButtonComponent = /** @class */ (function (_super) {
|
|
70
70
|
tslib_1.__extends(SplitButtonComponent, _super);
|
|
71
|
-
function SplitButtonComponent(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr) {
|
|
71
|
+
function SplitButtonComponent(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, renderer) {
|
|
72
72
|
var _this = _super.call(this, focusService, navigationService, wrapperRef, zone, localization, cdr) || this;
|
|
73
73
|
_this.popupService = popupService;
|
|
74
74
|
_this.elRef = elRef;
|
|
75
75
|
_this.localization = localization;
|
|
76
|
+
_this.renderer = renderer;
|
|
76
77
|
/**
|
|
77
78
|
* Sets the text of the SplitButton.
|
|
78
79
|
*/
|
|
@@ -97,13 +98,35 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
97
98
|
*/
|
|
98
99
|
_this.imageUrl = '';
|
|
99
100
|
/**
|
|
100
|
-
*
|
|
101
|
+
* The size property specifies the width and height of the SplitButton
|
|
102
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-size)).
|
|
101
103
|
*
|
|
102
|
-
* The
|
|
103
|
-
* * `
|
|
104
|
-
* * `
|
|
104
|
+
* The possible values are:
|
|
105
|
+
* * `'small'`
|
|
106
|
+
* * `'medium'` (default)
|
|
107
|
+
* * `'large'`
|
|
108
|
+
* * `null`
|
|
109
|
+
*/
|
|
110
|
+
_this.size = 'medium';
|
|
111
|
+
/**
|
|
112
|
+
* The SplitButton allows you to specify predefined theme colors.
|
|
113
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
114
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-themeColor)).
|
|
115
|
+
*
|
|
116
|
+
* The possible values are:
|
|
117
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
118
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
119
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
120
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
121
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
122
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
123
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
124
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
125
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
126
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
127
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
105
128
|
*/
|
|
106
|
-
_this.
|
|
129
|
+
_this.themeColor = 'base';
|
|
107
130
|
/**
|
|
108
131
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
109
132
|
*/
|
|
@@ -181,17 +204,62 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
181
204
|
* This event is preventable. If you cancel the event, the popup will remain open.
|
|
182
205
|
*/
|
|
183
206
|
_this.close = new EventEmitter();
|
|
184
|
-
_this.listId = guid();
|
|
185
207
|
/**
|
|
186
208
|
* @hidden
|
|
187
209
|
*/
|
|
188
210
|
_this.activeArrow = false;
|
|
211
|
+
_this.listId = guid();
|
|
189
212
|
_this.buttonText = '';
|
|
190
213
|
_this.lockFocus = false;
|
|
214
|
+
_this._rounded = 'medium';
|
|
215
|
+
_this._fillMode = "solid";
|
|
191
216
|
_this._itemClick = _this.itemClick;
|
|
192
217
|
_this._blur = _this.onBlur;
|
|
193
218
|
return _this;
|
|
194
219
|
}
|
|
220
|
+
Object.defineProperty(SplitButtonComponent.prototype, "rounded", {
|
|
221
|
+
get: function () {
|
|
222
|
+
return this._rounded;
|
|
223
|
+
},
|
|
224
|
+
/**
|
|
225
|
+
* The rounded property specifies the border radius of the SplitButton
|
|
226
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
|
|
227
|
+
*
|
|
228
|
+
* The possible values are:
|
|
229
|
+
* * `'small'`
|
|
230
|
+
* * `'medium'` (default)
|
|
231
|
+
* * `'large'`
|
|
232
|
+
* * `'full'`
|
|
233
|
+
* * `null`
|
|
234
|
+
*/
|
|
235
|
+
set: function (rounded) {
|
|
236
|
+
this.handleClasses(rounded, 'rounded');
|
|
237
|
+
this._rounded = rounded;
|
|
238
|
+
},
|
|
239
|
+
enumerable: true,
|
|
240
|
+
configurable: true
|
|
241
|
+
});
|
|
242
|
+
Object.defineProperty(SplitButtonComponent.prototype, "fillMode", {
|
|
243
|
+
get: function () {
|
|
244
|
+
return this._fillMode;
|
|
245
|
+
},
|
|
246
|
+
/**
|
|
247
|
+
* The fillMode property specifies the background and border styles of the SplitButton
|
|
248
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-fillMode)).
|
|
249
|
+
*
|
|
250
|
+
* The available values are:
|
|
251
|
+
* * `solid` (default)
|
|
252
|
+
* * `flat`
|
|
253
|
+
* * `outline`
|
|
254
|
+
* * `link`
|
|
255
|
+
*/
|
|
256
|
+
set: function (fillMode) {
|
|
257
|
+
// Temporary workaround for missing 'clear' styles
|
|
258
|
+
this._fillMode = fillMode === 'clear' ? 'flat' : fillMode;
|
|
259
|
+
},
|
|
260
|
+
enumerable: true,
|
|
261
|
+
configurable: true
|
|
262
|
+
});
|
|
195
263
|
Object.defineProperty(SplitButtonComponent.prototype, "disabled", {
|
|
196
264
|
get: function () {
|
|
197
265
|
return this._disabled;
|
|
@@ -305,20 +373,6 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
305
373
|
enumerable: true,
|
|
306
374
|
configurable: true
|
|
307
375
|
});
|
|
308
|
-
Object.defineProperty(SplitButtonComponent.prototype, "isFlat", {
|
|
309
|
-
get: function () {
|
|
310
|
-
return this.look === 'flat';
|
|
311
|
-
},
|
|
312
|
-
enumerable: true,
|
|
313
|
-
configurable: true
|
|
314
|
-
});
|
|
315
|
-
Object.defineProperty(SplitButtonComponent.prototype, "isOutline", {
|
|
316
|
-
get: function () {
|
|
317
|
-
return this.look === 'outline';
|
|
318
|
-
},
|
|
319
|
-
enumerable: true,
|
|
320
|
-
configurable: true
|
|
321
|
-
});
|
|
322
376
|
Object.defineProperty(SplitButtonComponent.prototype, "widgetClasses", {
|
|
323
377
|
get: function () {
|
|
324
378
|
return true;
|
|
@@ -417,6 +471,7 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
417
471
|
*/
|
|
418
472
|
SplitButtonComponent.prototype.ngAfterViewInit = function () {
|
|
419
473
|
this.updateButtonText();
|
|
474
|
+
this.handleClasses(this.rounded, 'rounded');
|
|
420
475
|
};
|
|
421
476
|
/**
|
|
422
477
|
* @hidden
|
|
@@ -583,6 +638,16 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
583
638
|
this.popupRef = null;
|
|
584
639
|
}
|
|
585
640
|
};
|
|
641
|
+
SplitButtonComponent.prototype.handleClasses = function (value, input) {
|
|
642
|
+
var elem = this.wrapperRef.nativeElement;
|
|
643
|
+
var classes = getStylingClasses('button', input, this[input], value);
|
|
644
|
+
if (classes.toRemove) {
|
|
645
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
646
|
+
}
|
|
647
|
+
if (classes.toAdd) {
|
|
648
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
649
|
+
}
|
|
650
|
+
};
|
|
586
651
|
tslib_1.__decorate([
|
|
587
652
|
Input(),
|
|
588
653
|
tslib_1.__metadata("design:type", String)
|
|
@@ -606,7 +671,21 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
606
671
|
tslib_1.__decorate([
|
|
607
672
|
Input(),
|
|
608
673
|
tslib_1.__metadata("design:type", String)
|
|
609
|
-
], SplitButtonComponent.prototype, "
|
|
674
|
+
], SplitButtonComponent.prototype, "size", void 0);
|
|
675
|
+
tslib_1.__decorate([
|
|
676
|
+
Input(),
|
|
677
|
+
tslib_1.__metadata("design:type", String),
|
|
678
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
679
|
+
], SplitButtonComponent.prototype, "rounded", null);
|
|
680
|
+
tslib_1.__decorate([
|
|
681
|
+
Input(),
|
|
682
|
+
tslib_1.__metadata("design:type", String),
|
|
683
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
684
|
+
], SplitButtonComponent.prototype, "fillMode", null);
|
|
685
|
+
tslib_1.__decorate([
|
|
686
|
+
Input(),
|
|
687
|
+
tslib_1.__metadata("design:type", String)
|
|
688
|
+
], SplitButtonComponent.prototype, "themeColor", void 0);
|
|
610
689
|
tslib_1.__decorate([
|
|
611
690
|
Input(),
|
|
612
691
|
tslib_1.__metadata("design:type", Boolean),
|
|
@@ -687,20 +766,10 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
687
766
|
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
688
767
|
], SplitButtonComponent.prototype, "containerRef", void 0);
|
|
689
768
|
tslib_1.__decorate([
|
|
690
|
-
HostBinding('class.k-
|
|
769
|
+
HostBinding('class.k-focus'),
|
|
691
770
|
tslib_1.__metadata("design:type", Boolean),
|
|
692
771
|
tslib_1.__metadata("design:paramtypes", [Boolean])
|
|
693
772
|
], SplitButtonComponent.prototype, "isFocused", null);
|
|
694
|
-
tslib_1.__decorate([
|
|
695
|
-
HostBinding('class.k-flat'),
|
|
696
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
697
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
698
|
-
], SplitButtonComponent.prototype, "isFlat", null);
|
|
699
|
-
tslib_1.__decorate([
|
|
700
|
-
HostBinding('class.k-outline'),
|
|
701
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
702
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
703
|
-
], SplitButtonComponent.prototype, "isOutline", null);
|
|
704
773
|
tslib_1.__decorate([
|
|
705
774
|
HostBinding('class.k-split-button'),
|
|
706
775
|
HostBinding('class.k-button-group'),
|
|
@@ -744,7 +813,7 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
744
813
|
}
|
|
745
814
|
],
|
|
746
815
|
selector: 'kendo-splitbutton',
|
|
747
|
-
template: "\n <ng-container kendoSplitButtonLocalizedMessages\n i18n-splitButtonLabel=\"kendo.splitbutton.splitButtonLabel|The text for the SplitButton aria-label\"\n splitButtonLabel=\"{{ '{buttonText} splitbutton' }}\">\n </ng-container>\n <button\n kendoButton\n #button\n [type]=\"type\"\n [
|
|
816
|
+
template: "\n <ng-container kendoSplitButtonLocalizedMessages\n i18n-splitButtonLabel=\"kendo.splitbutton.splitButtonLabel|The text for the SplitButton aria-label\"\n splitButtonLabel=\"{{ '{buttonText} splitbutton' }}\">\n </ng-container>\n <button\n kendoButton\n #button\n [type]=\"type\"\n [tabindex]=\"componentTabIndex\"\n [disabled]=\"disabled\"\n [size]=\"size\"\n [rounded]=\"rounded\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"themeColor\"\n [icon]=\"icon\"\n [class.k-active]=\"active\"\n [class.k-icon-button]=\"!text && icon\"\n [iconClass]=\"iconClass\"\n [imageUrl]=\"imageUrl\"\n [ngClass]=\"buttonClass\"\n (focus)=\"onButtonFocus()\"\n (click)=\"onButtonClick()\"\n (blur)=\"onButtonBlur()\"\n (mousedown)=\"toggleButtonActiveState(true)\"\n (mouseup)=\"toggleButtonActiveState(false)\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-expanded]=\"openState\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-owns]=\"listId\"\n [attr.aria-label]=\"ariaLabel\"\n >\n <span *ngIf=\"text\" class=\"k-button-text\">\n {{ text }}\n </span><ng-content></ng-content>\n </button>\n <button\n kendoButton\n #arrowButton\n type=\"button\"\n [class.k-active]=\"activeArrow\"\n [disabled]=\"disabled\"\n [icon]=\"arrowButtonIcon\"\n [size]=\"size\"\n [rounded]=\"rounded\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n [tabindex]=\"-1\"\n [ngClass]=\"arrowButtonClass\"\n (click)=\"onArrowButtonClick()\"\n (mousedown)=\"toggleArrowButtonActiveState(true)\"\n (mouseup)=\"toggleArrowButtonActiveState(false)\"\n ></button>\n <ng-template #popupTemplate>\n <kendo-button-list\n [id]=\"listId\"\n [data]=\"data\"\n [textField]=\"textField\"\n [itemTemplate]=\"itemTemplate\"\n (onItemClick)=\"onItemClick($event)\"\n (keydown)=\"keyDownHandler($event)\"\n (keypress)=\"keyPressHandler($event)\"\n (keyup)=\"keyUpHandler($event)\"\n [attr.dir]=\"dir\"\n [size]=\"size\"\n >\n </kendo-button-list>\n </ng-template>\n <ng-container #container></ng-container>\n "
|
|
748
817
|
}),
|
|
749
818
|
tslib_1.__metadata("design:paramtypes", [FocusService,
|
|
750
819
|
NavigationService,
|
|
@@ -753,7 +822,8 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
753
822
|
PopupService,
|
|
754
823
|
ElementRef,
|
|
755
824
|
LocalizationService,
|
|
756
|
-
ChangeDetectorRef
|
|
825
|
+
ChangeDetectorRef,
|
|
826
|
+
Renderer2])
|
|
757
827
|
], SplitButtonComponent);
|
|
758
828
|
return SplitButtonComponent;
|
|
759
829
|
}(ListButton));
|
package/dist/es/util.js
CHANGED
|
@@ -43,3 +43,55 @@ export function closest(element, selector) {
|
|
|
43
43
|
export var replaceMessagePlaceholder = function (message, name, value) {
|
|
44
44
|
return message.replace(new RegExp("{\\s*" + name + "\\s*}", 'g'), value);
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
export var SIZES = {
|
|
50
|
+
small: 'sm',
|
|
51
|
+
medium: 'md',
|
|
52
|
+
large: 'lg'
|
|
53
|
+
};
|
|
54
|
+
var ROUNDNESS = {
|
|
55
|
+
small: 'sm',
|
|
56
|
+
medium: 'md',
|
|
57
|
+
large: 'lg',
|
|
58
|
+
full: 'full'
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @hidden
|
|
62
|
+
*
|
|
63
|
+
* Returns the styling classes to be added and removed
|
|
64
|
+
*/
|
|
65
|
+
export var getStylingClasses = function (componentType, stylingOption, previousValue, newValue) {
|
|
66
|
+
switch (stylingOption) {
|
|
67
|
+
case 'size':
|
|
68
|
+
return {
|
|
69
|
+
toRemove: "k-" + componentType + "-" + SIZES[previousValue],
|
|
70
|
+
toAdd: newValue ? "k-" + componentType + "-" + SIZES[newValue] : null
|
|
71
|
+
};
|
|
72
|
+
case 'rounded':
|
|
73
|
+
return {
|
|
74
|
+
toRemove: "k-rounded-" + ROUNDNESS[previousValue],
|
|
75
|
+
toAdd: newValue ? "k-rounded-" + ROUNDNESS[newValue] : null
|
|
76
|
+
};
|
|
77
|
+
case 'fillMode':
|
|
78
|
+
case 'shape':
|
|
79
|
+
return {
|
|
80
|
+
toRemove: "k-" + componentType + "-" + previousValue,
|
|
81
|
+
toAdd: newValue ? "k-" + componentType + "-" + newValue : null
|
|
82
|
+
};
|
|
83
|
+
default:
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* @hidden
|
|
89
|
+
*
|
|
90
|
+
* Returns the themeColor classes to be added and removed
|
|
91
|
+
*/
|
|
92
|
+
export var getThemeColorClasses = function (componentType, prevFillMode, fillMode, previousValue, newValue) {
|
|
93
|
+
return {
|
|
94
|
+
toRemove: "k-" + componentType + "-" + prevFillMode + "-" + previousValue,
|
|
95
|
+
toAdd: newValue ? "k-" + componentType + "-" + fillMode + "-" + newValue : null
|
|
96
|
+
};
|
|
97
|
+
};
|