@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
package/dist/fesm5/index.js
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { __decorate, __metadata, __param, __extends } from 'tslib';
|
|
6
6
|
import { Injectable, Input, Output, EventEmitter, HostBinding, HostListener, Directive, Optional, ElementRef, Renderer2, NgZone, isDevMode, ContentChildren, QueryList, Component, NgModule, TemplateRef, ViewContainerRef, InjectionToken, Inject, ContentChild, ViewChild, ChangeDetectorRef, forwardRef } from '@angular/core';
|
|
7
|
-
import {
|
|
7
|
+
import { Subject, fromEvent, merge, Subscription } from 'rxjs';
|
|
8
8
|
import { Keys, isChanged, isDocumentAvailable, hasObservers, guid, EventsModule } from '@progress/kendo-angular-common';
|
|
9
9
|
import { LocalizationService, L10N_PREFIX, ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
10
|
-
import { filter, take } from 'rxjs/operators';
|
|
11
10
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
11
|
import { CommonModule } from '@angular/common';
|
|
13
12
|
import { PopupService, PopupModule } from '@progress/kendo-angular-popup';
|
|
13
|
+
import { filter, take } from 'rxjs/operators';
|
|
14
14
|
import { sequence, query, style, stagger, animate, AnimationBuilder } from '@angular/animations';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -18,16 +18,12 @@ import { sequence, query, style, stagger, animate, AnimationBuilder } from '@ang
|
|
|
18
18
|
*/
|
|
19
19
|
var KendoButtonService = /** @class */ (function () {
|
|
20
20
|
function KendoButtonService() {
|
|
21
|
-
this.buttonLookChange = new BehaviorSubject('default');
|
|
22
21
|
this.buttonClicked = new Subject();
|
|
23
22
|
this.buttonClicked$ = this.buttonClicked.asObservable();
|
|
24
23
|
}
|
|
25
24
|
KendoButtonService.prototype.click = function (button) {
|
|
26
25
|
this.buttonClicked.next(button);
|
|
27
26
|
};
|
|
28
|
-
KendoButtonService.prototype.setButtonLook = function (look) {
|
|
29
|
-
this.buttonLookChange.next(look);
|
|
30
|
-
};
|
|
31
27
|
KendoButtonService = __decorate([
|
|
32
28
|
Injectable()
|
|
33
29
|
], KendoButtonService);
|
|
@@ -41,11 +37,105 @@ var packageMetadata = {
|
|
|
41
37
|
name: '@progress/kendo-angular-buttons',
|
|
42
38
|
productName: 'Kendo UI for Angular',
|
|
43
39
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
44
|
-
publishDate:
|
|
40
|
+
publishDate: 1641835943,
|
|
45
41
|
version: '',
|
|
46
42
|
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'
|
|
47
43
|
};
|
|
48
44
|
|
|
45
|
+
/* tslint:disable:no-null-keyword */
|
|
46
|
+
/* tslint:disable:no-bitwise */
|
|
47
|
+
var resolvedPromise = Promise.resolve(null);
|
|
48
|
+
/**
|
|
49
|
+
* @hidden
|
|
50
|
+
*/
|
|
51
|
+
var isPresent = function (value) { return value !== null && value !== undefined; };
|
|
52
|
+
/**
|
|
53
|
+
* @hidden
|
|
54
|
+
*/
|
|
55
|
+
var tick = function (f) { return (resolvedPromise.then(f)); };
|
|
56
|
+
/**
|
|
57
|
+
* @hidden
|
|
58
|
+
*/
|
|
59
|
+
function isDocumentNode(container) {
|
|
60
|
+
return container.nodeType === 9;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @hidden
|
|
64
|
+
*/
|
|
65
|
+
function closest(element, selector) {
|
|
66
|
+
if (element.closest) {
|
|
67
|
+
return element.closest(selector);
|
|
68
|
+
}
|
|
69
|
+
var matches = Element.prototype.matches ?
|
|
70
|
+
function (el, sel) { return el.matches(sel); }
|
|
71
|
+
: function (el, sel) { return el.msMatchesSelector(sel); };
|
|
72
|
+
var node = element;
|
|
73
|
+
while (node && !isDocumentNode(node)) {
|
|
74
|
+
if (matches(node, selector)) {
|
|
75
|
+
return node;
|
|
76
|
+
}
|
|
77
|
+
node = node.parentNode;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @hidden
|
|
82
|
+
*/
|
|
83
|
+
var replaceMessagePlaceholder = function (message, name, value) {
|
|
84
|
+
return message.replace(new RegExp("{\\s*" + name + "\\s*}", 'g'), value);
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* @hidden
|
|
88
|
+
*/
|
|
89
|
+
var SIZES = {
|
|
90
|
+
small: 'sm',
|
|
91
|
+
medium: 'md',
|
|
92
|
+
large: 'lg'
|
|
93
|
+
};
|
|
94
|
+
var ROUNDNESS = {
|
|
95
|
+
small: 'sm',
|
|
96
|
+
medium: 'md',
|
|
97
|
+
large: 'lg',
|
|
98
|
+
full: 'full'
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* @hidden
|
|
102
|
+
*
|
|
103
|
+
* Returns the styling classes to be added and removed
|
|
104
|
+
*/
|
|
105
|
+
var getStylingClasses = function (componentType, stylingOption, previousValue, newValue) {
|
|
106
|
+
switch (stylingOption) {
|
|
107
|
+
case 'size':
|
|
108
|
+
return {
|
|
109
|
+
toRemove: "k-" + componentType + "-" + SIZES[previousValue],
|
|
110
|
+
toAdd: newValue ? "k-" + componentType + "-" + SIZES[newValue] : null
|
|
111
|
+
};
|
|
112
|
+
case 'rounded':
|
|
113
|
+
return {
|
|
114
|
+
toRemove: "k-rounded-" + ROUNDNESS[previousValue],
|
|
115
|
+
toAdd: newValue ? "k-rounded-" + ROUNDNESS[newValue] : null
|
|
116
|
+
};
|
|
117
|
+
case 'fillMode':
|
|
118
|
+
case 'shape':
|
|
119
|
+
return {
|
|
120
|
+
toRemove: "k-" + componentType + "-" + previousValue,
|
|
121
|
+
toAdd: newValue ? "k-" + componentType + "-" + newValue : null
|
|
122
|
+
};
|
|
123
|
+
default:
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* @hidden
|
|
129
|
+
*
|
|
130
|
+
* Returns the themeColor classes to be added and removed
|
|
131
|
+
*/
|
|
132
|
+
var getThemeColorClasses = function (componentType, prevFillMode, fillMode, previousValue, newValue) {
|
|
133
|
+
return {
|
|
134
|
+
toRemove: "k-" + componentType + "-" + prevFillMode + "-" + previousValue,
|
|
135
|
+
toAdd: newValue ? "k-" + componentType + "-" + fillMode + "-" + newValue : null
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
|
|
49
139
|
var SPAN_TAG_NAME = 'SPAN';
|
|
50
140
|
/**
|
|
51
141
|
* Represents the Kendo UI Button component for Angular.
|
|
@@ -60,19 +150,6 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
60
150
|
* By default, `toggleable` is set to `false`.
|
|
61
151
|
*/
|
|
62
152
|
this.toggleable = false;
|
|
63
|
-
/**
|
|
64
|
-
* Adds visual weight to the Button and makes it primary.
|
|
65
|
-
*/
|
|
66
|
-
this.primary = false;
|
|
67
|
-
/**
|
|
68
|
-
* Changes the visual appearance by using alternative styling options
|
|
69
|
-
* ([more information and examples]({% slug appearance_button %})).
|
|
70
|
-
*
|
|
71
|
-
* The available values are:
|
|
72
|
-
* * [`ButtonLook`]({% slug api_buttons_buttonlook %}) = `flat` | `outline`
|
|
73
|
-
* * `clear`
|
|
74
|
-
*/
|
|
75
|
-
this.look = 'default';
|
|
76
153
|
/**
|
|
77
154
|
* @hidden
|
|
78
155
|
*/
|
|
@@ -90,14 +167,18 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
90
167
|
this.isDisabled = false;
|
|
91
168
|
this.isIcon = false;
|
|
92
169
|
this.isIconClass = false;
|
|
170
|
+
this._size = 'medium';
|
|
171
|
+
this._rounded = 'medium';
|
|
172
|
+
this._shape = 'rectangle';
|
|
173
|
+
this._fillMode = 'solid';
|
|
174
|
+
this._themeColor = 'base';
|
|
93
175
|
this._focused = false;
|
|
94
176
|
this.domEvents = [];
|
|
95
177
|
validatePackage(packageMetadata);
|
|
96
178
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
97
|
-
this.localizationChangeSubscription = localization.changes
|
|
98
|
-
.subscribe(function (_a) {
|
|
179
|
+
this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
|
|
99
180
|
var rtl = _a.rtl;
|
|
100
|
-
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
181
|
+
return (_this.direction = rtl ? 'rtl' : 'ltr');
|
|
101
182
|
});
|
|
102
183
|
this.element = element.nativeElement;
|
|
103
184
|
this.renderer = renderer;
|
|
@@ -156,7 +237,7 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
156
237
|
if (icon) {
|
|
157
238
|
this.iconSetter(icon, function () {
|
|
158
239
|
_this.isIcon = true;
|
|
159
|
-
var classes = 'k-icon k-i-' + icon;
|
|
240
|
+
var classes = 'k-button-icon k-icon k-i-' + icon;
|
|
160
241
|
_this.addIcon(classes);
|
|
161
242
|
});
|
|
162
243
|
}
|
|
@@ -178,7 +259,8 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
178
259
|
if (iconClassName) {
|
|
179
260
|
this.iconSetter(iconClassName, function () {
|
|
180
261
|
_this.isIconClass = true;
|
|
181
|
-
|
|
262
|
+
var classes = 'k-button-icon k-icon ' + iconClassName;
|
|
263
|
+
_this.addIcon(classes);
|
|
182
264
|
});
|
|
183
265
|
}
|
|
184
266
|
else {
|
|
@@ -219,62 +301,140 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
219
301
|
enumerable: true,
|
|
220
302
|
configurable: true
|
|
221
303
|
});
|
|
222
|
-
Object.defineProperty(ButtonDirective.prototype, "
|
|
304
|
+
Object.defineProperty(ButtonDirective.prototype, "size", {
|
|
223
305
|
get: function () {
|
|
224
|
-
return this.
|
|
306
|
+
return this._size;
|
|
225
307
|
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
308
|
+
/**
|
|
309
|
+
* The size property specifies the width and height of the Button
|
|
310
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-size)).
|
|
311
|
+
*
|
|
312
|
+
* The possible values are:
|
|
313
|
+
* * `'small'`
|
|
314
|
+
* * `'medium'` (default)
|
|
315
|
+
* * `'large'`
|
|
316
|
+
* * `null`
|
|
317
|
+
*/
|
|
318
|
+
set: function (size) {
|
|
319
|
+
this.handleClasses(size, 'size');
|
|
320
|
+
this._size = size;
|
|
229
321
|
},
|
|
230
322
|
enumerable: true,
|
|
231
323
|
configurable: true
|
|
232
324
|
});
|
|
233
|
-
Object.defineProperty(ButtonDirective.prototype, "
|
|
325
|
+
Object.defineProperty(ButtonDirective.prototype, "rounded", {
|
|
234
326
|
get: function () {
|
|
235
|
-
return
|
|
327
|
+
return this._rounded;
|
|
328
|
+
},
|
|
329
|
+
/**
|
|
330
|
+
* The rounded property specifies the border radius of the Button
|
|
331
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-rounded)).
|
|
332
|
+
*
|
|
333
|
+
* The possible values are:
|
|
334
|
+
* * `'small'`
|
|
335
|
+
* * `'medium'` (default)
|
|
336
|
+
* * `'large'`
|
|
337
|
+
* * `'full'`
|
|
338
|
+
* * `null`
|
|
339
|
+
*/
|
|
340
|
+
set: function (rounded) {
|
|
341
|
+
this.handleClasses(rounded, 'rounded');
|
|
342
|
+
this._rounded = rounded;
|
|
236
343
|
},
|
|
237
344
|
enumerable: true,
|
|
238
345
|
configurable: true
|
|
239
346
|
});
|
|
240
|
-
Object.defineProperty(ButtonDirective.prototype, "
|
|
347
|
+
Object.defineProperty(ButtonDirective.prototype, "fillMode", {
|
|
241
348
|
get: function () {
|
|
242
|
-
return this.
|
|
349
|
+
return this._fillMode;
|
|
350
|
+
},
|
|
351
|
+
/**
|
|
352
|
+
* The fillMode property specifies the background and border styles of the Button
|
|
353
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-fillMode)).
|
|
354
|
+
*
|
|
355
|
+
* The possible values are:
|
|
356
|
+
* * `'flat'`
|
|
357
|
+
* * `'solid'` (default)
|
|
358
|
+
* * `'outline'`
|
|
359
|
+
* * `'link'`
|
|
360
|
+
* * `null`
|
|
361
|
+
*/
|
|
362
|
+
set: function (fillMode) {
|
|
363
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
364
|
+
this._fillMode = fillMode;
|
|
243
365
|
},
|
|
244
366
|
enumerable: true,
|
|
245
367
|
configurable: true
|
|
246
368
|
});
|
|
247
|
-
Object.defineProperty(ButtonDirective.prototype, "
|
|
369
|
+
Object.defineProperty(ButtonDirective.prototype, "themeColor", {
|
|
248
370
|
get: function () {
|
|
249
|
-
return this.
|
|
371
|
+
return this._themeColor;
|
|
372
|
+
},
|
|
373
|
+
/**
|
|
374
|
+
* The Button allows you to specify predefined theme colors.
|
|
375
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
376
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-themeColor)).
|
|
377
|
+
*
|
|
378
|
+
* The possible values are:
|
|
379
|
+
* * `'base'` (default)
|
|
380
|
+
* * `'primary'`
|
|
381
|
+
* * `'secondary'`
|
|
382
|
+
* * `'tertiary'`
|
|
383
|
+
* * `'info'`
|
|
384
|
+
* * `'success'`
|
|
385
|
+
* * `'warning'`
|
|
386
|
+
* * `'error'`
|
|
387
|
+
* * `'dark'`
|
|
388
|
+
* * `'light`'
|
|
389
|
+
* * `'inverse'`
|
|
390
|
+
*/
|
|
391
|
+
set: function (themeColor) {
|
|
392
|
+
this.handleThemeColor(themeColor);
|
|
393
|
+
this._themeColor = themeColor;
|
|
250
394
|
},
|
|
251
395
|
enumerable: true,
|
|
252
396
|
configurable: true
|
|
253
397
|
});
|
|
254
|
-
Object.defineProperty(ButtonDirective.prototype, "
|
|
398
|
+
Object.defineProperty(ButtonDirective.prototype, "shape", {
|
|
255
399
|
get: function () {
|
|
256
|
-
return this.
|
|
400
|
+
return this._shape;
|
|
401
|
+
},
|
|
402
|
+
/**
|
|
403
|
+
* The shape property specifies if the Button will form a rectangle or square.
|
|
404
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-shape)).
|
|
405
|
+
*
|
|
406
|
+
* The possible values are:
|
|
407
|
+
* * `'square'`
|
|
408
|
+
* * `'rectangle'` (default)
|
|
409
|
+
*/
|
|
410
|
+
set: function (shape) {
|
|
411
|
+
this.handleClasses(shape, 'shape');
|
|
412
|
+
this._shape = shape;
|
|
257
413
|
},
|
|
258
414
|
enumerable: true,
|
|
259
415
|
configurable: true
|
|
260
416
|
});
|
|
261
|
-
Object.defineProperty(ButtonDirective.prototype, "
|
|
417
|
+
Object.defineProperty(ButtonDirective.prototype, "isFocused", {
|
|
262
418
|
get: function () {
|
|
263
|
-
return this.
|
|
419
|
+
return this._focused;
|
|
420
|
+
},
|
|
421
|
+
set: function (isFocused) {
|
|
422
|
+
this.toggleClass('k-focus', isFocused);
|
|
423
|
+
this._focused = isFocused;
|
|
264
424
|
},
|
|
265
425
|
enumerable: true,
|
|
266
426
|
configurable: true
|
|
267
427
|
});
|
|
268
|
-
Object.defineProperty(ButtonDirective.prototype, "
|
|
428
|
+
Object.defineProperty(ButtonDirective.prototype, "classButton", {
|
|
269
429
|
get: function () {
|
|
270
|
-
return
|
|
430
|
+
return true;
|
|
271
431
|
},
|
|
272
432
|
enumerable: true,
|
|
273
433
|
configurable: true
|
|
274
434
|
});
|
|
275
|
-
Object.defineProperty(ButtonDirective.prototype, "
|
|
435
|
+
Object.defineProperty(ButtonDirective.prototype, "isToggleable", {
|
|
276
436
|
get: function () {
|
|
277
|
-
return this.
|
|
437
|
+
return this.toggleable;
|
|
278
438
|
},
|
|
279
439
|
enumerable: true,
|
|
280
440
|
configurable: true
|
|
@@ -319,14 +479,40 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
319
479
|
ButtonDirective.prototype.onBlur = function () {
|
|
320
480
|
this.isFocused = false;
|
|
321
481
|
};
|
|
482
|
+
Object.defineProperty(ButtonDirective.prototype, "primary", {
|
|
483
|
+
/**
|
|
484
|
+
* @hidden
|
|
485
|
+
*/
|
|
486
|
+
set: function (value) {
|
|
487
|
+
this.themeColor = value ? 'primary' : 'base';
|
|
488
|
+
},
|
|
489
|
+
enumerable: true,
|
|
490
|
+
configurable: true
|
|
491
|
+
});
|
|
492
|
+
Object.defineProperty(ButtonDirective.prototype, "look", {
|
|
493
|
+
/**
|
|
494
|
+
* @hidden
|
|
495
|
+
*/
|
|
496
|
+
set: function (value) {
|
|
497
|
+
switch (value) {
|
|
498
|
+
case 'default':
|
|
499
|
+
this.fillMode = 'solid';
|
|
500
|
+
break;
|
|
501
|
+
case 'clear':
|
|
502
|
+
this.fillMode = 'flat';
|
|
503
|
+
break;
|
|
504
|
+
default:
|
|
505
|
+
this.fillMode = value;
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
enumerable: true,
|
|
510
|
+
configurable: true
|
|
511
|
+
});
|
|
322
512
|
ButtonDirective.prototype.ngOnInit = function () {
|
|
323
513
|
var _this = this;
|
|
324
514
|
var isSpan = this.element.tagName === SPAN_TAG_NAME;
|
|
325
|
-
|
|
326
|
-
this.buttonLookChangeSubscription = this.service.buttonLookChange
|
|
327
|
-
.pipe(filter(function (look) { return look !== 'default'; }))
|
|
328
|
-
.subscribe(function (look) { return _this.look = look; });
|
|
329
|
-
}
|
|
515
|
+
this.addTextSpan();
|
|
330
516
|
if (!this.element.hasAttribute('role') && this.togglable) {
|
|
331
517
|
this.toggleAriaPressed(this.toggleable);
|
|
332
518
|
}
|
|
@@ -336,7 +522,8 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
336
522
|
this.ngZone.runOutsideAngular(function () {
|
|
337
523
|
_this.domEvents.push(_this.renderer.listen(_this.element, 'click', _this._onButtonClick.bind(_this)));
|
|
338
524
|
_this.domEvents.push(_this.renderer.listen(_this.element, 'keydown', function (event) {
|
|
339
|
-
|
|
525
|
+
var isSpaceOrEnter = event.keyCode === Keys.Space || event.keyCode === Keys.Enter;
|
|
526
|
+
if (isSpan && isSpaceOrEnter) {
|
|
340
527
|
_this.click.emit(event);
|
|
341
528
|
_this._onButtonClick();
|
|
342
529
|
}
|
|
@@ -348,17 +535,22 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
348
535
|
this.toggleAriaPressed(this.toggleable);
|
|
349
536
|
}
|
|
350
537
|
};
|
|
538
|
+
ButtonDirective.prototype.ngAfterViewInit = function () {
|
|
539
|
+
var _this = this;
|
|
540
|
+
var stylingOptions = ['size', 'rounded', 'shape', 'fillMode'];
|
|
541
|
+
stylingOptions.forEach(function (input) {
|
|
542
|
+
_this.handleClasses(_this[input], input);
|
|
543
|
+
});
|
|
544
|
+
};
|
|
351
545
|
ButtonDirective.prototype.ngAfterViewChecked = function () {
|
|
352
546
|
this.setIconTextClasses();
|
|
353
547
|
};
|
|
354
548
|
ButtonDirective.prototype.ngOnDestroy = function () {
|
|
355
549
|
this.imageNode = null;
|
|
356
550
|
this.iconNode = null;
|
|
551
|
+
this.iconSpanNode = null;
|
|
357
552
|
this.renderer = null;
|
|
358
553
|
this.localizationChangeSubscription.unsubscribe();
|
|
359
|
-
if (this.service && this.buttonLookChangeSubscription) {
|
|
360
|
-
this.buttonLookChangeSubscription.unsubscribe();
|
|
361
|
-
}
|
|
362
554
|
clearTimeout(this.deferTimeout);
|
|
363
555
|
this.domEvents.forEach(function (unbindHandler) { return unbindHandler(); });
|
|
364
556
|
};
|
|
@@ -402,7 +594,7 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
402
594
|
var changed = this.selected !== value;
|
|
403
595
|
this.selected = value;
|
|
404
596
|
this.setAttribute('aria-pressed', this.selected.toString());
|
|
405
|
-
this.toggleClass('k-
|
|
597
|
+
this.toggleClass('k-selected', this.selected);
|
|
406
598
|
if (changed && hasObservers(this.selectedChange)) {
|
|
407
599
|
this.ngZone.run(function () {
|
|
408
600
|
_this.selectedChange.emit(value);
|
|
@@ -422,14 +614,25 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
422
614
|
};
|
|
423
615
|
ButtonDirective.prototype.hasText = function () {
|
|
424
616
|
if (isDocumentAvailable()) {
|
|
425
|
-
return
|
|
617
|
+
return this.element.textContent.trim().length > 0;
|
|
426
618
|
}
|
|
427
619
|
else {
|
|
428
620
|
return false;
|
|
429
621
|
}
|
|
430
622
|
};
|
|
623
|
+
Object.defineProperty(ButtonDirective.prototype, "text", {
|
|
624
|
+
get: function () {
|
|
625
|
+
if (isDocumentAvailable()) {
|
|
626
|
+
return this.element.innerHTML.trim();
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
enumerable: true,
|
|
630
|
+
configurable: true
|
|
631
|
+
});
|
|
431
632
|
ButtonDirective.prototype.addImgIcon = function (imageUrl) {
|
|
432
633
|
var renderer = this.renderer;
|
|
634
|
+
this.iconSpanNode = renderer.createElement('span');
|
|
635
|
+
renderer.setProperty(this.iconSpanNode, 'className', 'k-button-icon k-icon');
|
|
433
636
|
if (this.imageNode) {
|
|
434
637
|
renderer.setProperty(this.imageNode, 'src', imageUrl);
|
|
435
638
|
}
|
|
@@ -438,8 +641,9 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
438
641
|
renderer.setProperty(this.imageNode, 'src', imageUrl);
|
|
439
642
|
renderer.setProperty(this.imageNode, 'className', 'k-image');
|
|
440
643
|
renderer.setAttribute(this.imageNode, 'role', 'presentation');
|
|
441
|
-
this.prependChild(this.imageNode);
|
|
442
644
|
}
|
|
645
|
+
this.iconSpanNode.appendChild(this.imageNode);
|
|
646
|
+
this.prependChild(this.iconSpanNode);
|
|
443
647
|
};
|
|
444
648
|
ButtonDirective.prototype.addIcon = function (classNames) {
|
|
445
649
|
var renderer = this.renderer;
|
|
@@ -453,6 +657,11 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
453
657
|
this.prependChild(this.iconNode);
|
|
454
658
|
}
|
|
455
659
|
};
|
|
660
|
+
ButtonDirective.prototype.addTextSpan = function () {
|
|
661
|
+
if (isDocumentAvailable() && this.hasText()) {
|
|
662
|
+
this.element.innerHTML = "<span class='k-button-text'>" + this.text + "</span>";
|
|
663
|
+
}
|
|
664
|
+
};
|
|
456
665
|
ButtonDirective.prototype.prependChild = function (node) {
|
|
457
666
|
var _this = this;
|
|
458
667
|
this.defer(function () {
|
|
@@ -476,7 +685,9 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
476
685
|
ButtonDirective.prototype.removeImageNode = function () {
|
|
477
686
|
if (this.imageNode && this.renderer.parentNode(this.imageNode)) {
|
|
478
687
|
this.renderer.removeChild(this.element, this.imageNode);
|
|
688
|
+
this.renderer.removeChild(this.element, this.iconSpanNode);
|
|
479
689
|
this.imageNode = null;
|
|
690
|
+
this.iconSpanNode = null;
|
|
480
691
|
}
|
|
481
692
|
};
|
|
482
693
|
ButtonDirective.prototype.removeIconNode = function () {
|
|
@@ -484,6 +695,10 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
484
695
|
this.renderer.removeChild(this.element, this.iconNode);
|
|
485
696
|
this.iconNode = null;
|
|
486
697
|
}
|
|
698
|
+
if (this.iconSpanNode) {
|
|
699
|
+
this.renderer.removeChild(this.element, this.iconSpanNode);
|
|
700
|
+
this.iconSpanNode = null;
|
|
701
|
+
}
|
|
487
702
|
};
|
|
488
703
|
ButtonDirective.prototype.updateIconNode = function () {
|
|
489
704
|
if (!this.isIcon && !this.isIconClass) {
|
|
@@ -492,9 +707,7 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
492
707
|
};
|
|
493
708
|
ButtonDirective.prototype.setIconTextClasses = function () {
|
|
494
709
|
var hasIcon = this.isIcon || this.isIconClass || this.imageNode;
|
|
495
|
-
|
|
496
|
-
this.toggleClass('k-button-icon', hasIcon && !hasText);
|
|
497
|
-
this.toggleClass('k-button-icontext', hasIcon && hasText);
|
|
710
|
+
this.toggleClass('k-icon-button', hasIcon && !this.hasText());
|
|
498
711
|
};
|
|
499
712
|
ButtonDirective.prototype.toggleClass = function (className, add) {
|
|
500
713
|
if (add) {
|
|
@@ -515,6 +728,31 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
515
728
|
this.setSelected(!this.selected);
|
|
516
729
|
}
|
|
517
730
|
};
|
|
731
|
+
ButtonDirective.prototype.handleClasses = function (value, input) {
|
|
732
|
+
var elem = this.element;
|
|
733
|
+
var classes = getStylingClasses('button', input, this[input], value);
|
|
734
|
+
if (input === 'fillMode') {
|
|
735
|
+
this.handleThemeColor(this.themeColor, this[input], value);
|
|
736
|
+
}
|
|
737
|
+
if (classes.toRemove) {
|
|
738
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
739
|
+
}
|
|
740
|
+
if (classes.toAdd) {
|
|
741
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
ButtonDirective.prototype.handleThemeColor = function (value, prevFillMode, fillMode) {
|
|
745
|
+
var elem = this.element;
|
|
746
|
+
var removeFillMode = prevFillMode ? prevFillMode : this.fillMode;
|
|
747
|
+
var addFillMode = fillMode ? fillMode : this.fillMode;
|
|
748
|
+
var themeColorClass = getThemeColorClasses('button', removeFillMode, addFillMode, this.themeColor, value);
|
|
749
|
+
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
750
|
+
if (addFillMode !== null && fillMode !== null) {
|
|
751
|
+
if (themeColorClass.toAdd) {
|
|
752
|
+
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
};
|
|
518
756
|
__decorate([
|
|
519
757
|
Input(),
|
|
520
758
|
__metadata("design:type", Boolean)
|
|
@@ -524,14 +762,6 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
524
762
|
__metadata("design:type", Boolean),
|
|
525
763
|
__metadata("design:paramtypes", [Boolean])
|
|
526
764
|
], ButtonDirective.prototype, "togglable", null);
|
|
527
|
-
__decorate([
|
|
528
|
-
Input(),
|
|
529
|
-
__metadata("design:type", Boolean)
|
|
530
|
-
], ButtonDirective.prototype, "primary", void 0);
|
|
531
|
-
__decorate([
|
|
532
|
-
Input(),
|
|
533
|
-
__metadata("design:type", String)
|
|
534
|
-
], ButtonDirective.prototype, "look", void 0);
|
|
535
765
|
__decorate([
|
|
536
766
|
Input(),
|
|
537
767
|
__metadata("design:type", Boolean),
|
|
@@ -562,6 +792,31 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
562
792
|
__metadata("design:type", Boolean),
|
|
563
793
|
__metadata("design:paramtypes", [Boolean])
|
|
564
794
|
], ButtonDirective.prototype, "disabled", null);
|
|
795
|
+
__decorate([
|
|
796
|
+
Input(),
|
|
797
|
+
__metadata("design:type", String),
|
|
798
|
+
__metadata("design:paramtypes", [String])
|
|
799
|
+
], ButtonDirective.prototype, "size", null);
|
|
800
|
+
__decorate([
|
|
801
|
+
Input(),
|
|
802
|
+
__metadata("design:type", String),
|
|
803
|
+
__metadata("design:paramtypes", [String])
|
|
804
|
+
], ButtonDirective.prototype, "rounded", null);
|
|
805
|
+
__decorate([
|
|
806
|
+
Input(),
|
|
807
|
+
__metadata("design:type", String),
|
|
808
|
+
__metadata("design:paramtypes", [String])
|
|
809
|
+
], ButtonDirective.prototype, "fillMode", null);
|
|
810
|
+
__decorate([
|
|
811
|
+
Input(),
|
|
812
|
+
__metadata("design:type", String),
|
|
813
|
+
__metadata("design:paramtypes", [String])
|
|
814
|
+
], ButtonDirective.prototype, "themeColor", null);
|
|
815
|
+
__decorate([
|
|
816
|
+
Input(),
|
|
817
|
+
__metadata("design:type", String),
|
|
818
|
+
__metadata("design:paramtypes", [String])
|
|
819
|
+
], ButtonDirective.prototype, "shape", null);
|
|
565
820
|
__decorate([
|
|
566
821
|
Input(),
|
|
567
822
|
__metadata("design:type", String)
|
|
@@ -579,36 +834,11 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
579
834
|
__metadata("design:type", Boolean),
|
|
580
835
|
__metadata("design:paramtypes", [])
|
|
581
836
|
], ButtonDirective.prototype, "classButton", null);
|
|
582
|
-
__decorate([
|
|
583
|
-
HostBinding('class.k-primary'),
|
|
584
|
-
__metadata("design:type", Boolean),
|
|
585
|
-
__metadata("design:paramtypes", [])
|
|
586
|
-
], ButtonDirective.prototype, "classPrimary", null);
|
|
587
837
|
__decorate([
|
|
588
838
|
HostBinding('class.k-toggle-button'),
|
|
589
839
|
__metadata("design:type", Boolean),
|
|
590
840
|
__metadata("design:paramtypes", [])
|
|
591
841
|
], ButtonDirective.prototype, "isToggleable", null);
|
|
592
|
-
__decorate([
|
|
593
|
-
HostBinding('class.k-flat'),
|
|
594
|
-
__metadata("design:type", Boolean),
|
|
595
|
-
__metadata("design:paramtypes", [])
|
|
596
|
-
], ButtonDirective.prototype, "isFlat", null);
|
|
597
|
-
__decorate([
|
|
598
|
-
HostBinding('class.k-bare'),
|
|
599
|
-
__metadata("design:type", Boolean),
|
|
600
|
-
__metadata("design:paramtypes", [])
|
|
601
|
-
], ButtonDirective.prototype, "isBare", null);
|
|
602
|
-
__decorate([
|
|
603
|
-
HostBinding('class.k-outline'),
|
|
604
|
-
__metadata("design:type", Boolean),
|
|
605
|
-
__metadata("design:paramtypes", [])
|
|
606
|
-
], ButtonDirective.prototype, "isOutline", null);
|
|
607
|
-
__decorate([
|
|
608
|
-
HostBinding('class.k-button-clear'),
|
|
609
|
-
__metadata("design:type", Boolean),
|
|
610
|
-
__metadata("design:paramtypes", [])
|
|
611
|
-
], ButtonDirective.prototype, "isClear", null);
|
|
612
842
|
__decorate([
|
|
613
843
|
HostBinding('attr.role'),
|
|
614
844
|
__metadata("design:type", String),
|
|
@@ -616,12 +846,12 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
616
846
|
], ButtonDirective.prototype, "roleSetter", null);
|
|
617
847
|
__decorate([
|
|
618
848
|
HostBinding('attr.aria-disabled'),
|
|
619
|
-
HostBinding('class.k-
|
|
849
|
+
HostBinding('class.k-disabled'),
|
|
620
850
|
__metadata("design:type", Boolean),
|
|
621
851
|
__metadata("design:paramtypes", [])
|
|
622
852
|
], ButtonDirective.prototype, "classDisabled", null);
|
|
623
853
|
__decorate([
|
|
624
|
-
HostBinding('class.k-
|
|
854
|
+
HostBinding('class.k-selected'),
|
|
625
855
|
__metadata("design:type", Boolean),
|
|
626
856
|
__metadata("design:paramtypes", [])
|
|
627
857
|
], ButtonDirective.prototype, "classActive", null);
|
|
@@ -642,6 +872,16 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
642
872
|
__metadata("design:paramtypes", []),
|
|
643
873
|
__metadata("design:returntype", void 0)
|
|
644
874
|
], ButtonDirective.prototype, "onBlur", null);
|
|
875
|
+
__decorate([
|
|
876
|
+
Input(),
|
|
877
|
+
__metadata("design:type", Boolean),
|
|
878
|
+
__metadata("design:paramtypes", [Boolean])
|
|
879
|
+
], ButtonDirective.prototype, "primary", null);
|
|
880
|
+
__decorate([
|
|
881
|
+
Input(),
|
|
882
|
+
__metadata("design:type", String),
|
|
883
|
+
__metadata("design:paramtypes", [String])
|
|
884
|
+
], ButtonDirective.prototype, "look", null);
|
|
645
885
|
ButtonDirective = __decorate([
|
|
646
886
|
Directive({
|
|
647
887
|
exportAs: 'kendoButton',
|
|
@@ -652,7 +892,7 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
652
892
|
useValue: 'kendo.button'
|
|
653
893
|
}
|
|
654
894
|
],
|
|
655
|
-
selector: 'button[kendoButton], span[kendoButton]'
|
|
895
|
+
selector: 'button[kendoButton], span[kendoButton]',
|
|
656
896
|
}),
|
|
657
897
|
__param(2, Optional()),
|
|
658
898
|
__metadata("design:paramtypes", [ElementRef,
|
|
@@ -664,48 +904,6 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
664
904
|
return ButtonDirective;
|
|
665
905
|
}());
|
|
666
906
|
|
|
667
|
-
/* tslint:disable:no-null-keyword */
|
|
668
|
-
/* tslint:disable:no-bitwise */
|
|
669
|
-
var resolvedPromise = Promise.resolve(null);
|
|
670
|
-
/**
|
|
671
|
-
* @hidden
|
|
672
|
-
*/
|
|
673
|
-
var isPresent = function (value) { return value !== null && value !== undefined; };
|
|
674
|
-
/**
|
|
675
|
-
* @hidden
|
|
676
|
-
*/
|
|
677
|
-
var tick = function (f) { return (resolvedPromise.then(f)); };
|
|
678
|
-
/**
|
|
679
|
-
* @hidden
|
|
680
|
-
*/
|
|
681
|
-
function isDocumentNode(container) {
|
|
682
|
-
return container.nodeType === 9;
|
|
683
|
-
}
|
|
684
|
-
/**
|
|
685
|
-
* @hidden
|
|
686
|
-
*/
|
|
687
|
-
function closest(element, selector) {
|
|
688
|
-
if (element.closest) {
|
|
689
|
-
return element.closest(selector);
|
|
690
|
-
}
|
|
691
|
-
var matches = Element.prototype.matches ?
|
|
692
|
-
function (el, sel) { return el.matches(sel); }
|
|
693
|
-
: function (el, sel) { return el.msMatchesSelector(sel); };
|
|
694
|
-
var node = element;
|
|
695
|
-
while (node && !isDocumentNode(node)) {
|
|
696
|
-
if (matches(node, selector)) {
|
|
697
|
-
return node;
|
|
698
|
-
}
|
|
699
|
-
node = node.parentNode;
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
/**
|
|
703
|
-
* @hidden
|
|
704
|
-
*/
|
|
705
|
-
var replaceMessagePlaceholder = function (message, name, value) {
|
|
706
|
-
return message.replace(new RegExp("{\\s*" + name + "\\s*}", 'g'), value);
|
|
707
|
-
};
|
|
708
|
-
|
|
709
907
|
/**
|
|
710
908
|
* @hidden
|
|
711
909
|
*/
|
|
@@ -747,17 +945,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
747
945
|
* By default, the selection mode of the ButtonGroup is set to `multiple`.
|
|
748
946
|
*/
|
|
749
947
|
this.selection = 'multiple';
|
|
750
|
-
/**
|
|
751
|
-
* Changes the visual appearance by using alternative styling options
|
|
752
|
-
* ([more information and examples]({% slug styling_buttongroup %})).
|
|
753
|
-
* The `look` property of the ButtonGroup takes precedence over the `look` property
|
|
754
|
-
* of the individual buttons that are part of the group.
|
|
755
|
-
*
|
|
756
|
-
* The available values are:
|
|
757
|
-
* * `flat`
|
|
758
|
-
* * `outline`
|
|
759
|
-
*/
|
|
760
|
-
this.look = 'default';
|
|
761
948
|
/**
|
|
762
949
|
* Fires every time keyboard navigation occurs.
|
|
763
950
|
*/
|
|
@@ -804,27 +991,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
804
991
|
enumerable: true,
|
|
805
992
|
configurable: true
|
|
806
993
|
});
|
|
807
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "isFlat", {
|
|
808
|
-
get: function () {
|
|
809
|
-
return this.look === 'flat';
|
|
810
|
-
},
|
|
811
|
-
enumerable: true,
|
|
812
|
-
configurable: true
|
|
813
|
-
});
|
|
814
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "isBare", {
|
|
815
|
-
get: function () {
|
|
816
|
-
return this.look === 'bare';
|
|
817
|
-
},
|
|
818
|
-
enumerable: true,
|
|
819
|
-
configurable: true
|
|
820
|
-
});
|
|
821
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "isOutline", {
|
|
822
|
-
get: function () {
|
|
823
|
-
return this.look === 'outline';
|
|
824
|
-
},
|
|
825
|
-
enumerable: true,
|
|
826
|
-
configurable: true
|
|
827
|
-
});
|
|
828
994
|
Object.defineProperty(ButtonGroupComponent.prototype, "getRole", {
|
|
829
995
|
get: function () {
|
|
830
996
|
return this.isSelectionSingle() ? 'radiogroup' : 'group';
|
|
@@ -890,7 +1056,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
890
1056
|
};
|
|
891
1057
|
ButtonGroupComponent.prototype.ngOnInit = function () {
|
|
892
1058
|
var _this = this;
|
|
893
|
-
this.service.setButtonLook(this.look);
|
|
894
1059
|
this.subscription = this.service.buttonClicked$.subscribe(function (button) {
|
|
895
1060
|
var newSelectionValue;
|
|
896
1061
|
if (_this.isSelectionSingle()) {
|
|
@@ -1010,10 +1175,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
1010
1175
|
Input('width'),
|
|
1011
1176
|
__metadata("design:type", String)
|
|
1012
1177
|
], ButtonGroupComponent.prototype, "width", void 0);
|
|
1013
|
-
__decorate([
|
|
1014
|
-
Input(),
|
|
1015
|
-
__metadata("design:type", String)
|
|
1016
|
-
], ButtonGroupComponent.prototype, "look", void 0);
|
|
1017
1178
|
__decorate([
|
|
1018
1179
|
Input(),
|
|
1019
1180
|
__metadata("design:type", Number),
|
|
@@ -1033,7 +1194,7 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
1033
1194
|
__metadata("design:paramtypes", [])
|
|
1034
1195
|
], ButtonGroupComponent.prototype, "wrapperClass", null);
|
|
1035
1196
|
__decorate([
|
|
1036
|
-
HostBinding('class.k-
|
|
1197
|
+
HostBinding('class.k-disabled'),
|
|
1037
1198
|
__metadata("design:type", Boolean),
|
|
1038
1199
|
__metadata("design:paramtypes", [])
|
|
1039
1200
|
], ButtonGroupComponent.prototype, "disabledClass", null);
|
|
@@ -1042,21 +1203,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
1042
1203
|
__metadata("design:type", Boolean),
|
|
1043
1204
|
__metadata("design:paramtypes", [])
|
|
1044
1205
|
], ButtonGroupComponent.prototype, "stretchedClass", null);
|
|
1045
|
-
__decorate([
|
|
1046
|
-
HostBinding('class.k-button-group-flat'),
|
|
1047
|
-
__metadata("design:type", Boolean),
|
|
1048
|
-
__metadata("design:paramtypes", [])
|
|
1049
|
-
], ButtonGroupComponent.prototype, "isFlat", null);
|
|
1050
|
-
__decorate([
|
|
1051
|
-
HostBinding('class.k-button-group-bare'),
|
|
1052
|
-
__metadata("design:type", Boolean),
|
|
1053
|
-
__metadata("design:paramtypes", [])
|
|
1054
|
-
], ButtonGroupComponent.prototype, "isBare", null);
|
|
1055
|
-
__decorate([
|
|
1056
|
-
HostBinding('class.k-button-group-outline'),
|
|
1057
|
-
__metadata("design:type", Boolean),
|
|
1058
|
-
__metadata("design:paramtypes", [])
|
|
1059
|
-
], ButtonGroupComponent.prototype, "isOutline", null);
|
|
1060
1206
|
__decorate([
|
|
1061
1207
|
HostBinding('attr.role'),
|
|
1062
1208
|
__metadata("design:type", String),
|
|
@@ -1253,8 +1399,21 @@ var ListComponent = /** @class */ (function () {
|
|
|
1253
1399
|
function ListComponent() {
|
|
1254
1400
|
this.onItemClick = new EventEmitter();
|
|
1255
1401
|
this.onItemBlur = new EventEmitter();
|
|
1402
|
+
this.sizeClass = '';
|
|
1256
1403
|
validatePackage(packageMetadata);
|
|
1257
1404
|
}
|
|
1405
|
+
Object.defineProperty(ListComponent.prototype, "size", {
|
|
1406
|
+
set: function (size) {
|
|
1407
|
+
if (size) {
|
|
1408
|
+
this.sizeClass = "k-menu-group-" + SIZES[size];
|
|
1409
|
+
}
|
|
1410
|
+
else {
|
|
1411
|
+
this.sizeClass = '';
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
enumerable: true,
|
|
1415
|
+
configurable: true
|
|
1416
|
+
});
|
|
1258
1417
|
ListComponent.prototype.getText = function (dataItem) {
|
|
1259
1418
|
if (dataItem) {
|
|
1260
1419
|
return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
|
|
@@ -1293,10 +1452,15 @@ var ListComponent = /** @class */ (function () {
|
|
|
1293
1452
|
Output(),
|
|
1294
1453
|
__metadata("design:type", EventEmitter)
|
|
1295
1454
|
], ListComponent.prototype, "onItemBlur", void 0);
|
|
1455
|
+
__decorate([
|
|
1456
|
+
Input(),
|
|
1457
|
+
__metadata("design:type", String),
|
|
1458
|
+
__metadata("design:paramtypes", [String])
|
|
1459
|
+
], ListComponent.prototype, "size", null);
|
|
1296
1460
|
ListComponent = __decorate([
|
|
1297
1461
|
Component({
|
|
1298
1462
|
selector: 'kendo-button-list',
|
|
1299
|
-
template: "\n <ul class=\"k-
|
|
1463
|
+
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 "
|
|
1300
1464
|
}),
|
|
1301
1465
|
__metadata("design:paramtypes", [])
|
|
1302
1466
|
], ListComponent);
|
|
@@ -1352,10 +1516,10 @@ var FocusableDirective = /** @class */ (function () {
|
|
|
1352
1516
|
}
|
|
1353
1517
|
FocusableDirective.prototype.ngOnInit = function () {
|
|
1354
1518
|
if (this.index === this.focusService.focused) {
|
|
1355
|
-
this.renderer.addClass(this.element, 'k-
|
|
1519
|
+
this.renderer.addClass(this.element, 'k-focus');
|
|
1356
1520
|
}
|
|
1357
1521
|
else {
|
|
1358
|
-
this.renderer.removeClass(this.element, 'k-
|
|
1522
|
+
this.renderer.removeClass(this.element, 'k-focus');
|
|
1359
1523
|
}
|
|
1360
1524
|
};
|
|
1361
1525
|
/**
|
|
@@ -1371,11 +1535,11 @@ var FocusableDirective = /** @class */ (function () {
|
|
|
1371
1535
|
}
|
|
1372
1536
|
this.focusSubscription = this.focusService.onFocus.subscribe(function (index) {
|
|
1373
1537
|
if (_this.index === index) {
|
|
1374
|
-
_this.renderer.addClass(_this.element, 'k-
|
|
1538
|
+
_this.renderer.addClass(_this.element, 'k-focus');
|
|
1375
1539
|
_this.element.focus();
|
|
1376
1540
|
}
|
|
1377
1541
|
else {
|
|
1378
|
-
_this.renderer.removeClass(_this.element, 'k-
|
|
1542
|
+
_this.renderer.removeClass(_this.element, 'k-focus');
|
|
1379
1543
|
}
|
|
1380
1544
|
});
|
|
1381
1545
|
};
|
|
@@ -1511,7 +1675,7 @@ var ListButton = /** @class */ (function () {
|
|
|
1511
1675
|
}
|
|
1512
1676
|
Object.defineProperty(ListButton.prototype, "popupClasses", {
|
|
1513
1677
|
get: function () {
|
|
1514
|
-
var popupClasses = ['k-
|
|
1678
|
+
var popupClasses = ['k-menu-popup'];
|
|
1515
1679
|
if (this._popupSettings.popupClass) {
|
|
1516
1680
|
popupClasses.push(this._popupSettings.popupClass);
|
|
1517
1681
|
}
|
|
@@ -1871,11 +2035,12 @@ var NAVIGATION_SETTINGS_PROVIDER = {
|
|
|
1871
2035
|
*/
|
|
1872
2036
|
var SplitButtonComponent = /** @class */ (function (_super) {
|
|
1873
2037
|
__extends(SplitButtonComponent, _super);
|
|
1874
|
-
function SplitButtonComponent(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr) {
|
|
2038
|
+
function SplitButtonComponent(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, renderer) {
|
|
1875
2039
|
var _this = _super.call(this, focusService, navigationService, wrapperRef, zone, localization, cdr) || this;
|
|
1876
2040
|
_this.popupService = popupService;
|
|
1877
2041
|
_this.elRef = elRef;
|
|
1878
2042
|
_this.localization = localization;
|
|
2043
|
+
_this.renderer = renderer;
|
|
1879
2044
|
/**
|
|
1880
2045
|
* Sets the text of the SplitButton.
|
|
1881
2046
|
*/
|
|
@@ -1900,13 +2065,46 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
1900
2065
|
*/
|
|
1901
2066
|
_this.imageUrl = '';
|
|
1902
2067
|
/**
|
|
1903
|
-
*
|
|
2068
|
+
* The size property specifies the width and height of the SplitButton
|
|
2069
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-size)).
|
|
2070
|
+
*
|
|
2071
|
+
* The possible values are:
|
|
2072
|
+
* * `'small'`
|
|
2073
|
+
* * `'medium'` (default)
|
|
2074
|
+
* * `'large'`
|
|
2075
|
+
* * `null`
|
|
2076
|
+
*/
|
|
2077
|
+
_this.size = 'medium';
|
|
2078
|
+
/**
|
|
2079
|
+
* The fillMode property specifies the background and border styles of the SplitButton
|
|
2080
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-fillMode)).
|
|
1904
2081
|
*
|
|
1905
2082
|
* The available values are:
|
|
2083
|
+
* * `solid` (default)
|
|
1906
2084
|
* * `flat`
|
|
1907
2085
|
* * `outline`
|
|
2086
|
+
* * `link`
|
|
2087
|
+
*/
|
|
2088
|
+
_this.fillMode = 'solid';
|
|
2089
|
+
/**
|
|
2090
|
+
* The SplitButton allows you to specify predefined theme colors.
|
|
2091
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
2092
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-themeColor)).
|
|
2093
|
+
*
|
|
2094
|
+
* The possible values are:
|
|
2095
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
2096
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
2097
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
2098
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
2099
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
2100
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
2101
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
2102
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
2103
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
2104
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
2105
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
1908
2106
|
*/
|
|
1909
|
-
_this.
|
|
2107
|
+
_this.themeColor = 'base';
|
|
1910
2108
|
/**
|
|
1911
2109
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
1912
2110
|
*/
|
|
@@ -1991,10 +2189,33 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
1991
2189
|
_this.activeArrow = false;
|
|
1992
2190
|
_this.buttonText = '';
|
|
1993
2191
|
_this.lockFocus = false;
|
|
2192
|
+
_this._rounded = 'medium';
|
|
1994
2193
|
_this._itemClick = _this.itemClick;
|
|
1995
2194
|
_this._blur = _this.onBlur;
|
|
1996
2195
|
return _this;
|
|
1997
2196
|
}
|
|
2197
|
+
Object.defineProperty(SplitButtonComponent.prototype, "rounded", {
|
|
2198
|
+
get: function () {
|
|
2199
|
+
return this._rounded;
|
|
2200
|
+
},
|
|
2201
|
+
/**
|
|
2202
|
+
* The rounded property specifies the border radius of the SplitButton
|
|
2203
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
|
|
2204
|
+
*
|
|
2205
|
+
* The possible values are:
|
|
2206
|
+
* * `'small'`
|
|
2207
|
+
* * `'medium'` (default)
|
|
2208
|
+
* * `'large'`
|
|
2209
|
+
* * `'full'`
|
|
2210
|
+
* * `null`
|
|
2211
|
+
*/
|
|
2212
|
+
set: function (rounded) {
|
|
2213
|
+
this.handleClasses(rounded, 'rounded');
|
|
2214
|
+
this._rounded = rounded;
|
|
2215
|
+
},
|
|
2216
|
+
enumerable: true,
|
|
2217
|
+
configurable: true
|
|
2218
|
+
});
|
|
1998
2219
|
Object.defineProperty(SplitButtonComponent.prototype, "disabled", {
|
|
1999
2220
|
get: function () {
|
|
2000
2221
|
return this._disabled;
|
|
@@ -2102,22 +2323,8 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2102
2323
|
get: function () {
|
|
2103
2324
|
return this._isFocused && !this._disabled;
|
|
2104
2325
|
},
|
|
2105
|
-
set: function (value) {
|
|
2106
|
-
this._isFocused = value;
|
|
2107
|
-
},
|
|
2108
|
-
enumerable: true,
|
|
2109
|
-
configurable: true
|
|
2110
|
-
});
|
|
2111
|
-
Object.defineProperty(SplitButtonComponent.prototype, "isFlat", {
|
|
2112
|
-
get: function () {
|
|
2113
|
-
return this.look === 'flat';
|
|
2114
|
-
},
|
|
2115
|
-
enumerable: true,
|
|
2116
|
-
configurable: true
|
|
2117
|
-
});
|
|
2118
|
-
Object.defineProperty(SplitButtonComponent.prototype, "isOutline", {
|
|
2119
|
-
get: function () {
|
|
2120
|
-
return this.look === 'outline';
|
|
2326
|
+
set: function (value) {
|
|
2327
|
+
this._isFocused = value;
|
|
2121
2328
|
},
|
|
2122
2329
|
enumerable: true,
|
|
2123
2330
|
configurable: true
|
|
@@ -2220,6 +2427,7 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2220
2427
|
*/
|
|
2221
2428
|
SplitButtonComponent.prototype.ngAfterViewInit = function () {
|
|
2222
2429
|
this.updateButtonText();
|
|
2430
|
+
this.handleClasses(this.rounded, 'rounded');
|
|
2223
2431
|
};
|
|
2224
2432
|
/**
|
|
2225
2433
|
* @hidden
|
|
@@ -2386,6 +2594,16 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2386
2594
|
this.popupRef = null;
|
|
2387
2595
|
}
|
|
2388
2596
|
};
|
|
2597
|
+
SplitButtonComponent.prototype.handleClasses = function (value, input) {
|
|
2598
|
+
var elem = this.wrapperRef.nativeElement;
|
|
2599
|
+
var classes = getStylingClasses('button', input, this[input], value);
|
|
2600
|
+
if (classes.toRemove) {
|
|
2601
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
2602
|
+
}
|
|
2603
|
+
if (classes.toAdd) {
|
|
2604
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
2605
|
+
}
|
|
2606
|
+
};
|
|
2389
2607
|
__decorate([
|
|
2390
2608
|
Input(),
|
|
2391
2609
|
__metadata("design:type", String)
|
|
@@ -2409,7 +2627,20 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2409
2627
|
__decorate([
|
|
2410
2628
|
Input(),
|
|
2411
2629
|
__metadata("design:type", String)
|
|
2412
|
-
], SplitButtonComponent.prototype, "
|
|
2630
|
+
], SplitButtonComponent.prototype, "size", void 0);
|
|
2631
|
+
__decorate([
|
|
2632
|
+
Input(),
|
|
2633
|
+
__metadata("design:type", String),
|
|
2634
|
+
__metadata("design:paramtypes", [String])
|
|
2635
|
+
], SplitButtonComponent.prototype, "rounded", null);
|
|
2636
|
+
__decorate([
|
|
2637
|
+
Input(),
|
|
2638
|
+
__metadata("design:type", String)
|
|
2639
|
+
], SplitButtonComponent.prototype, "fillMode", void 0);
|
|
2640
|
+
__decorate([
|
|
2641
|
+
Input(),
|
|
2642
|
+
__metadata("design:type", String)
|
|
2643
|
+
], SplitButtonComponent.prototype, "themeColor", void 0);
|
|
2413
2644
|
__decorate([
|
|
2414
2645
|
Input(),
|
|
2415
2646
|
__metadata("design:type", Boolean),
|
|
@@ -2490,20 +2721,10 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2490
2721
|
__metadata("design:type", ViewContainerRef)
|
|
2491
2722
|
], SplitButtonComponent.prototype, "containerRef", void 0);
|
|
2492
2723
|
__decorate([
|
|
2493
|
-
HostBinding('class.k-
|
|
2724
|
+
HostBinding('class.k-focus'),
|
|
2494
2725
|
__metadata("design:type", Boolean),
|
|
2495
2726
|
__metadata("design:paramtypes", [Boolean])
|
|
2496
2727
|
], SplitButtonComponent.prototype, "isFocused", null);
|
|
2497
|
-
__decorate([
|
|
2498
|
-
HostBinding('class.k-flat'),
|
|
2499
|
-
__metadata("design:type", Boolean),
|
|
2500
|
-
__metadata("design:paramtypes", [])
|
|
2501
|
-
], SplitButtonComponent.prototype, "isFlat", null);
|
|
2502
|
-
__decorate([
|
|
2503
|
-
HostBinding('class.k-outline'),
|
|
2504
|
-
__metadata("design:type", Boolean),
|
|
2505
|
-
__metadata("design:paramtypes", [])
|
|
2506
|
-
], SplitButtonComponent.prototype, "isOutline", null);
|
|
2507
2728
|
__decorate([
|
|
2508
2729
|
HostBinding('class.k-split-button'),
|
|
2509
2730
|
HostBinding('class.k-button-group'),
|
|
@@ -2547,7 +2768,7 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2547
2768
|
}
|
|
2548
2769
|
],
|
|
2549
2770
|
selector: 'kendo-splitbutton',
|
|
2550
|
-
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 [
|
|
2771
|
+
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 "
|
|
2551
2772
|
}),
|
|
2552
2773
|
__metadata("design:paramtypes", [FocusService,
|
|
2553
2774
|
NavigationService,
|
|
@@ -2556,7 +2777,8 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2556
2777
|
PopupService,
|
|
2557
2778
|
ElementRef,
|
|
2558
2779
|
LocalizationService,
|
|
2559
|
-
ChangeDetectorRef
|
|
2780
|
+
ChangeDetectorRef,
|
|
2781
|
+
Renderer2])
|
|
2560
2782
|
], SplitButtonComponent);
|
|
2561
2783
|
return SplitButtonComponent;
|
|
2562
2784
|
}(ListButton));
|
|
@@ -2715,17 +2937,70 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
2715
2937
|
*/
|
|
2716
2938
|
_this.imageUrl = '';
|
|
2717
2939
|
/**
|
|
2718
|
-
*
|
|
2940
|
+
* The size property specifies the width and height of the DropDownButton
|
|
2941
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-size)).
|
|
2942
|
+
*
|
|
2943
|
+
* The possible values are:
|
|
2944
|
+
* * `'small'`
|
|
2945
|
+
* * `'medium'` (default)
|
|
2946
|
+
* * `'large'`
|
|
2947
|
+
* * `null`
|
|
2948
|
+
*/
|
|
2949
|
+
_this.size = 'medium';
|
|
2950
|
+
/**
|
|
2951
|
+
* The shape property specifies if the DropDownButton will be a square or rectangle.
|
|
2952
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-shape)).
|
|
2953
|
+
*
|
|
2954
|
+
* The possible values are:
|
|
2955
|
+
* * `'rectangle'` (default)
|
|
2956
|
+
* * `'square'`
|
|
2957
|
+
* * `null`
|
|
2958
|
+
*/
|
|
2959
|
+
_this.shape = 'rectangle';
|
|
2960
|
+
/**
|
|
2961
|
+
* The rounded property specifies the border radius of the DropDownButton
|
|
2962
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-rounded)).
|
|
2963
|
+
*
|
|
2964
|
+
* The possible values are:
|
|
2965
|
+
* * `'small'`
|
|
2966
|
+
* * `'medium'` (default)
|
|
2967
|
+
* * `'large'`
|
|
2968
|
+
* * `'full'`
|
|
2969
|
+
* * `null`
|
|
2719
2970
|
*/
|
|
2720
|
-
_this.
|
|
2971
|
+
_this.rounded = 'medium';
|
|
2721
2972
|
/**
|
|
2722
|
-
*
|
|
2973
|
+
* The fillMode property specifies the background and border styles of the DropDownButton
|
|
2974
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-fillMode)).
|
|
2723
2975
|
*
|
|
2724
2976
|
* The available values are:
|
|
2977
|
+
* * `solid` (default)
|
|
2725
2978
|
* * `flat`
|
|
2726
2979
|
* * `outline`
|
|
2980
|
+
* * `link`
|
|
2981
|
+
* * `null`
|
|
2982
|
+
*/
|
|
2983
|
+
_this.fillMode = 'solid';
|
|
2984
|
+
/**
|
|
2985
|
+
* The DropDownButton allows you to specify predefined theme colors.
|
|
2986
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
2987
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-themeColor)).
|
|
2988
|
+
*
|
|
2989
|
+
* The possible values are:
|
|
2990
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
2991
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
2992
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
2993
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
2994
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
2995
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
2996
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
2997
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
2998
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
2999
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
3000
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
3001
|
+
* * `null` —Removes the default CSS class (no class would be rendered).
|
|
2727
3002
|
*/
|
|
2728
|
-
_this.
|
|
3003
|
+
_this.themeColor = 'base';
|
|
2729
3004
|
/**
|
|
2730
3005
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
2731
3006
|
*/
|
|
@@ -2864,20 +3139,6 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
2864
3139
|
enumerable: true,
|
|
2865
3140
|
configurable: true
|
|
2866
3141
|
});
|
|
2867
|
-
Object.defineProperty(DropDownButtonComponent.prototype, "isFlat", {
|
|
2868
|
-
get: function () {
|
|
2869
|
-
return this.look === 'flat';
|
|
2870
|
-
},
|
|
2871
|
-
enumerable: true,
|
|
2872
|
-
configurable: true
|
|
2873
|
-
});
|
|
2874
|
-
Object.defineProperty(DropDownButtonComponent.prototype, "isOutline", {
|
|
2875
|
-
get: function () {
|
|
2876
|
-
return this.look === 'outline';
|
|
2877
|
-
},
|
|
2878
|
-
enumerable: true,
|
|
2879
|
-
configurable: true
|
|
2880
|
-
});
|
|
2881
3142
|
Object.defineProperty(DropDownButtonComponent.prototype, "widgetClasses", {
|
|
2882
3143
|
get: function () {
|
|
2883
3144
|
return true;
|
|
@@ -3155,12 +3416,24 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
3155
3416
|
], DropDownButtonComponent.prototype, "data", null);
|
|
3156
3417
|
__decorate([
|
|
3157
3418
|
Input(),
|
|
3158
|
-
__metadata("design:type",
|
|
3159
|
-
], DropDownButtonComponent.prototype, "
|
|
3419
|
+
__metadata("design:type", String)
|
|
3420
|
+
], DropDownButtonComponent.prototype, "size", void 0);
|
|
3421
|
+
__decorate([
|
|
3422
|
+
Input(),
|
|
3423
|
+
__metadata("design:type", String)
|
|
3424
|
+
], DropDownButtonComponent.prototype, "shape", void 0);
|
|
3425
|
+
__decorate([
|
|
3426
|
+
Input(),
|
|
3427
|
+
__metadata("design:type", String)
|
|
3428
|
+
], DropDownButtonComponent.prototype, "rounded", void 0);
|
|
3160
3429
|
__decorate([
|
|
3161
3430
|
Input(),
|
|
3162
3431
|
__metadata("design:type", String)
|
|
3163
|
-
], DropDownButtonComponent.prototype, "
|
|
3432
|
+
], DropDownButtonComponent.prototype, "fillMode", void 0);
|
|
3433
|
+
__decorate([
|
|
3434
|
+
Input(),
|
|
3435
|
+
__metadata("design:type", String)
|
|
3436
|
+
], DropDownButtonComponent.prototype, "themeColor", void 0);
|
|
3164
3437
|
__decorate([
|
|
3165
3438
|
Input(),
|
|
3166
3439
|
__metadata("design:type", Object)
|
|
@@ -3190,20 +3463,10 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
3190
3463
|
__metadata("design:type", EventEmitter)
|
|
3191
3464
|
], DropDownButtonComponent.prototype, "onBlur", void 0);
|
|
3192
3465
|
__decorate([
|
|
3193
|
-
HostBinding('class.k-
|
|
3466
|
+
HostBinding('class.k-focus'),
|
|
3194
3467
|
__metadata("design:type", Boolean),
|
|
3195
3468
|
__metadata("design:paramtypes", [])
|
|
3196
3469
|
], DropDownButtonComponent.prototype, "focused", null);
|
|
3197
|
-
__decorate([
|
|
3198
|
-
HostBinding('class.k-flat'),
|
|
3199
|
-
__metadata("design:type", Boolean),
|
|
3200
|
-
__metadata("design:paramtypes", [])
|
|
3201
|
-
], DropDownButtonComponent.prototype, "isFlat", null);
|
|
3202
|
-
__decorate([
|
|
3203
|
-
HostBinding('class.k-outline'),
|
|
3204
|
-
__metadata("design:type", Boolean),
|
|
3205
|
-
__metadata("design:paramtypes", [])
|
|
3206
|
-
], DropDownButtonComponent.prototype, "isOutline", null);
|
|
3207
3470
|
__decorate([
|
|
3208
3471
|
HostBinding('class.k-dropdown-button'),
|
|
3209
3472
|
__metadata("design:type", Boolean),
|
|
@@ -3278,7 +3541,7 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
3278
3541
|
}
|
|
3279
3542
|
],
|
|
3280
3543
|
selector: 'kendo-dropdownbutton',
|
|
3281
|
-
template: "\n <button kendoButton #button\n role=\"menu\"\n type=\"button\"\n [tabindex]=\"componentTabIndex\"\n [class.k-
|
|
3544
|
+
template: "\n <button kendoButton #button\n role=\"menu\"\n type=\"button\"\n [tabindex]=\"componentTabIndex\"\n [class.k-active]=\"active\"\n [disabled]=\"disabled\"\n [icon]=\"icon\"\n [iconClass]=\"iconClass\"\n [imageUrl]=\"imageUrl\"\n [ngClass]=\"buttonClass\"\n [size]=\"size\"\n [shape]=\"shape\"\n [rounded]=\"rounded\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n (click)=\"openPopup()\"\n (focus)=\"handleFocus()\"\n (blur)=\"onButtonBlur()\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-expanded]=\"openState\"\n [attr.aria-haspopup]=\"true\"\n [attr.aria-owns]=\"listId\"\n >\n <ng-content></ng-content>\n </button>\n <ng-template #popupTemplate>\n <kendo-button-list\n #buttonList\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 "
|
|
3282
3545
|
}),
|
|
3283
3546
|
__metadata("design:paramtypes", [FocusService,
|
|
3284
3547
|
NavigationService,
|
|
@@ -3322,38 +3585,20 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3322
3585
|
this.renderer = renderer;
|
|
3323
3586
|
this.ngZone = ngZone;
|
|
3324
3587
|
this.localizationService = localizationService;
|
|
3325
|
-
/**
|
|
3326
|
-
* Changes the visual appearance by using alternative styling options.
|
|
3327
|
-
*
|
|
3328
|
-
* The available values are:
|
|
3329
|
-
* * `solid`
|
|
3330
|
-
* * `outline`
|
|
3331
|
-
* * `filled` (The `filled` option will be deprecated. To apply identical styling, use `solid` instead).
|
|
3332
|
-
* * `outlined` (The `outlined` option will be deprecated. To apply identical styling, use `outline` instead).
|
|
3333
|
-
*/
|
|
3334
|
-
this.look = 'solid';
|
|
3335
3588
|
/**
|
|
3336
3589
|
* Specifies the selected state of the Chip.
|
|
3590
|
+
* @default false
|
|
3337
3591
|
*/
|
|
3338
3592
|
this.selected = false;
|
|
3339
3593
|
/**
|
|
3340
3594
|
* Specifies if the Chip will be removable or not.
|
|
3341
3595
|
* If the property is set to `true`, the Chip renders a remove icon.
|
|
3596
|
+
* @default false
|
|
3342
3597
|
*/
|
|
3343
3598
|
this.removable = false;
|
|
3344
|
-
/**
|
|
3345
|
-
* Specifies the Chip type.
|
|
3346
|
-
*
|
|
3347
|
-
* The possible values are:
|
|
3348
|
-
* - `none` (default)
|
|
3349
|
-
* - `success`
|
|
3350
|
-
* - `error`
|
|
3351
|
-
* - `warning`
|
|
3352
|
-
* - `info`
|
|
3353
|
-
*/
|
|
3354
|
-
this.type = 'none';
|
|
3355
3599
|
/**
|
|
3356
3600
|
* If set to `true`, the Chip will be disabled.
|
|
3601
|
+
* @default false
|
|
3357
3602
|
*/
|
|
3358
3603
|
this.disabled = false;
|
|
3359
3604
|
/**
|
|
@@ -3366,34 +3611,111 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3366
3611
|
this.contentClick = new EventEmitter();
|
|
3367
3612
|
this.tabIndex = 0;
|
|
3368
3613
|
this.hostClass = true;
|
|
3614
|
+
this._size = 'medium';
|
|
3615
|
+
this._rounded = 'medium';
|
|
3616
|
+
this._fillMode = 'solid';
|
|
3617
|
+
this._themeColor = 'base';
|
|
3369
3618
|
this.focused = false;
|
|
3370
3619
|
validatePackage(packageMetadata);
|
|
3371
3620
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
3372
3621
|
}
|
|
3373
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3622
|
+
Object.defineProperty(ChipComponent.prototype, "size", {
|
|
3374
3623
|
get: function () {
|
|
3375
|
-
return this.
|
|
3624
|
+
return this._size;
|
|
3625
|
+
},
|
|
3626
|
+
/**
|
|
3627
|
+
* The size property specifies the height, padding and line height of the Chip
|
|
3628
|
+
* ([see example]({% slug appearance_chip %}#toc-size)).
|
|
3629
|
+
*
|
|
3630
|
+
* The possible values are:
|
|
3631
|
+
* * `'small'`
|
|
3632
|
+
* * `'medium'` (default)
|
|
3633
|
+
* * `'large'`
|
|
3634
|
+
* * `null`
|
|
3635
|
+
*/
|
|
3636
|
+
set: function (size) {
|
|
3637
|
+
this.handleClasses(size, 'size');
|
|
3638
|
+
this._size = size;
|
|
3639
|
+
},
|
|
3640
|
+
enumerable: true,
|
|
3641
|
+
configurable: true
|
|
3642
|
+
});
|
|
3643
|
+
Object.defineProperty(ChipComponent.prototype, "rounded", {
|
|
3644
|
+
get: function () {
|
|
3645
|
+
return this._rounded;
|
|
3646
|
+
},
|
|
3647
|
+
/**
|
|
3648
|
+
* The rounded property specifies the border radius of the Chip
|
|
3649
|
+
* ([see example]({% slug appearance_chip %}#toc-rounded)).
|
|
3650
|
+
*
|
|
3651
|
+
* The possible values are:
|
|
3652
|
+
* * `'small'`
|
|
3653
|
+
* * `'medium'` (default)
|
|
3654
|
+
* * `'large'`
|
|
3655
|
+
* * `'full'`
|
|
3656
|
+
* * `null`
|
|
3657
|
+
*/
|
|
3658
|
+
set: function (rounded) {
|
|
3659
|
+
this.handleClasses(rounded, 'rounded');
|
|
3660
|
+
this._rounded = rounded;
|
|
3661
|
+
},
|
|
3662
|
+
enumerable: true,
|
|
3663
|
+
configurable: true
|
|
3664
|
+
});
|
|
3665
|
+
Object.defineProperty(ChipComponent.prototype, "fillMode", {
|
|
3666
|
+
get: function () {
|
|
3667
|
+
return this._fillMode;
|
|
3668
|
+
},
|
|
3669
|
+
/**
|
|
3670
|
+
* The fillMode property specifies the background and border styles of the Chip
|
|
3671
|
+
* ([see example]({% slug appearance_chip %}#toc-fillMode)).
|
|
3672
|
+
*
|
|
3673
|
+
* The possible values are:
|
|
3674
|
+
* * `'solid'` (default)
|
|
3675
|
+
* * `'outline'`
|
|
3676
|
+
* * `null`
|
|
3677
|
+
*/
|
|
3678
|
+
set: function (fillMode) {
|
|
3679
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
3680
|
+
this._fillMode = fillMode;
|
|
3376
3681
|
},
|
|
3377
3682
|
enumerable: true,
|
|
3378
3683
|
configurable: true
|
|
3379
3684
|
});
|
|
3380
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3685
|
+
Object.defineProperty(ChipComponent.prototype, "themeColor", {
|
|
3381
3686
|
get: function () {
|
|
3382
|
-
return this.
|
|
3687
|
+
return this._themeColor;
|
|
3688
|
+
},
|
|
3689
|
+
/**
|
|
3690
|
+
* The Chip allows you to specify predefined theme colors.
|
|
3691
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
3692
|
+
* ([see example]({% slug appearance_chip %}#toc-themeColor)).
|
|
3693
|
+
*
|
|
3694
|
+
* The possible values are:
|
|
3695
|
+
* * `'base'` (default)
|
|
3696
|
+
* * `'info'`
|
|
3697
|
+
* * `'success'`
|
|
3698
|
+
* * `'warning'`
|
|
3699
|
+
* * `'error'`
|
|
3700
|
+
* * `null`
|
|
3701
|
+
*/
|
|
3702
|
+
set: function (themeColor) {
|
|
3703
|
+
this.handleThemeColor(themeColor);
|
|
3704
|
+
this._themeColor = themeColor;
|
|
3383
3705
|
},
|
|
3384
3706
|
enumerable: true,
|
|
3385
3707
|
configurable: true
|
|
3386
3708
|
});
|
|
3387
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3709
|
+
Object.defineProperty(ChipComponent.prototype, "ariaChecked", {
|
|
3388
3710
|
get: function () {
|
|
3389
|
-
return this.
|
|
3711
|
+
return this.selected;
|
|
3390
3712
|
},
|
|
3391
3713
|
enumerable: true,
|
|
3392
3714
|
configurable: true
|
|
3393
3715
|
});
|
|
3394
3716
|
Object.defineProperty(ChipComponent.prototype, "hasIconClass", {
|
|
3395
3717
|
get: function () {
|
|
3396
|
-
return this.icon || this.iconClass ? true : false;
|
|
3718
|
+
return this.icon || this.iconClass || this.avatarClass ? true : false;
|
|
3397
3719
|
},
|
|
3398
3720
|
enumerable: true,
|
|
3399
3721
|
configurable: true
|
|
@@ -3436,44 +3758,48 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3436
3758
|
}
|
|
3437
3759
|
};
|
|
3438
3760
|
ChipComponent.prototype.ngAfterViewInit = function () {
|
|
3761
|
+
var _this = this;
|
|
3439
3762
|
var chip = this.element.nativeElement;
|
|
3440
|
-
var
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
}
|
|
3763
|
+
var stylingOptions = ['size', 'rounded', 'fillMode'];
|
|
3764
|
+
stylingOptions.forEach(function (input) {
|
|
3765
|
+
_this.handleClasses(_this[input], input);
|
|
3766
|
+
});
|
|
3444
3767
|
this.attachElementEventHandlers(chip);
|
|
3445
3768
|
};
|
|
3446
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3769
|
+
Object.defineProperty(ChipComponent.prototype, "kendoIconClass", {
|
|
3447
3770
|
/**
|
|
3448
3771
|
* @hidden
|
|
3449
3772
|
*/
|
|
3450
3773
|
get: function () {
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
classes.push("" + this.iconClass);
|
|
3454
|
-
}
|
|
3455
|
-
if (this.icon) {
|
|
3456
|
-
classes.push("k-icon k-i-" + this.icon);
|
|
3457
|
-
}
|
|
3458
|
-
return classes;
|
|
3774
|
+
this.verifyIconSettings([this.iconClass, this.avatarClass]);
|
|
3775
|
+
return "k-i-" + this.icon;
|
|
3459
3776
|
},
|
|
3460
3777
|
enumerable: true,
|
|
3461
3778
|
configurable: true
|
|
3462
3779
|
});
|
|
3463
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3780
|
+
Object.defineProperty(ChipComponent.prototype, "customIconClass", {
|
|
3464
3781
|
/**
|
|
3465
3782
|
* @hidden
|
|
3466
3783
|
*/
|
|
3467
3784
|
get: function () {
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3785
|
+
this.verifyIconSettings([this.icon, this.avatarClass]);
|
|
3786
|
+
return "" + this.iconClass;
|
|
3787
|
+
},
|
|
3788
|
+
enumerable: true,
|
|
3789
|
+
configurable: true
|
|
3790
|
+
});
|
|
3791
|
+
Object.defineProperty(ChipComponent.prototype, "chipAvatarClass", {
|
|
3792
|
+
/**
|
|
3793
|
+
* @hidden
|
|
3794
|
+
*/
|
|
3795
|
+
get: function () {
|
|
3796
|
+
this.verifyIconSettings([this.icon, this.iconClass]);
|
|
3797
|
+
return "" + this.avatarClass;
|
|
3472
3798
|
},
|
|
3473
3799
|
enumerable: true,
|
|
3474
3800
|
configurable: true
|
|
3475
3801
|
});
|
|
3476
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3802
|
+
Object.defineProperty(ChipComponent.prototype, "removeIconClass", {
|
|
3477
3803
|
/**
|
|
3478
3804
|
* @hidden
|
|
3479
3805
|
*/
|
|
@@ -3481,23 +3807,11 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3481
3807
|
if (this.removeIcon) {
|
|
3482
3808
|
return "" + this.removeIcon;
|
|
3483
3809
|
}
|
|
3484
|
-
return "k-
|
|
3810
|
+
return "k-i-close-circle";
|
|
3485
3811
|
},
|
|
3486
3812
|
enumerable: true,
|
|
3487
3813
|
configurable: true
|
|
3488
3814
|
});
|
|
3489
|
-
/**
|
|
3490
|
-
* @hidden
|
|
3491
|
-
*/
|
|
3492
|
-
ChipComponent.prototype.typeClass = function () {
|
|
3493
|
-
return {
|
|
3494
|
-
'none': '',
|
|
3495
|
-
'success': 'k-chip-success',
|
|
3496
|
-
'warning': 'k-chip-warning',
|
|
3497
|
-
'error': 'k-chip-error',
|
|
3498
|
-
'info': 'k-chip-info'
|
|
3499
|
-
}[this.type];
|
|
3500
|
-
};
|
|
3501
3815
|
/**
|
|
3502
3816
|
* Focuses the Chip component.
|
|
3503
3817
|
*/
|
|
@@ -3532,7 +3846,7 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3532
3846
|
_this.renderer.removeClass(chip, 'k-focus');
|
|
3533
3847
|
});
|
|
3534
3848
|
var contentClickListener = _this.renderer.listen(chip, 'click', function (e) {
|
|
3535
|
-
var isRemoveClicked = closest(e.target, '.k-remove-
|
|
3849
|
+
var isRemoveClicked = closest(e.target, '.k-chip-remove-action');
|
|
3536
3850
|
if (!isRemoveClicked) {
|
|
3537
3851
|
_this.ngZone.run(function () {
|
|
3538
3852
|
_this.contentClick.emit({ sender: _this, originalEvent: e });
|
|
@@ -3546,10 +3860,42 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3546
3860
|
};
|
|
3547
3861
|
});
|
|
3548
3862
|
};
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3863
|
+
/**
|
|
3864
|
+
* @hidden
|
|
3865
|
+
*/
|
|
3866
|
+
ChipComponent.prototype.verifyIconSettings = function (iconsToCheck) {
|
|
3867
|
+
if (isDevMode()) {
|
|
3868
|
+
if (iconsToCheck.filter(function (icon) { return icon !== null && icon !== undefined; }).length > 0) {
|
|
3869
|
+
this.renderer.removeClass(this.element.nativeElement, 'k-chip-has-icon');
|
|
3870
|
+
throw new Error('Invalid configuration: Having multiple icons is not supported. Only a single icon on a chip can be displayed.');
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3873
|
+
};
|
|
3874
|
+
ChipComponent.prototype.handleClasses = function (value, input) {
|
|
3875
|
+
var elem = this.element.nativeElement;
|
|
3876
|
+
var classes = getStylingClasses('chip', input, this[input], value);
|
|
3877
|
+
if (input === 'fillMode') {
|
|
3878
|
+
this.handleThemeColor(this.themeColor, this[input], value);
|
|
3879
|
+
}
|
|
3880
|
+
if (classes.toRemove) {
|
|
3881
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
3882
|
+
}
|
|
3883
|
+
if (classes.toAdd) {
|
|
3884
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
3885
|
+
}
|
|
3886
|
+
};
|
|
3887
|
+
ChipComponent.prototype.handleThemeColor = function (value, prevFillMode, fillMode) {
|
|
3888
|
+
var elem = this.element.nativeElement;
|
|
3889
|
+
var removeFillMode = prevFillMode ? prevFillMode : this.fillMode;
|
|
3890
|
+
var addFillMode = fillMode ? fillMode : this.fillMode;
|
|
3891
|
+
var themeColorClass = getThemeColorClasses('chip', removeFillMode, addFillMode, this.themeColor, value);
|
|
3892
|
+
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
3893
|
+
if (addFillMode !== null && fillMode !== null) {
|
|
3894
|
+
if (themeColorClass.toAdd) {
|
|
3895
|
+
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
3896
|
+
}
|
|
3897
|
+
}
|
|
3898
|
+
};
|
|
3553
3899
|
__decorate([
|
|
3554
3900
|
Input(),
|
|
3555
3901
|
__metadata("design:type", String)
|
|
@@ -3564,12 +3910,12 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3564
3910
|
], ChipComponent.prototype, "iconClass", void 0);
|
|
3565
3911
|
__decorate([
|
|
3566
3912
|
Input(),
|
|
3567
|
-
__metadata("design:type",
|
|
3568
|
-
], ChipComponent.prototype, "
|
|
3913
|
+
__metadata("design:type", String)
|
|
3914
|
+
], ChipComponent.prototype, "avatarClass", void 0);
|
|
3569
3915
|
__decorate([
|
|
3570
3916
|
Input(),
|
|
3571
|
-
__metadata("design:type",
|
|
3572
|
-
], ChipComponent.prototype, "
|
|
3917
|
+
__metadata("design:type", Boolean)
|
|
3918
|
+
], ChipComponent.prototype, "selected", void 0);
|
|
3573
3919
|
__decorate([
|
|
3574
3920
|
Input(),
|
|
3575
3921
|
__metadata("design:type", Boolean)
|
|
@@ -3578,14 +3924,30 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3578
3924
|
Input(),
|
|
3579
3925
|
__metadata("design:type", String)
|
|
3580
3926
|
], ChipComponent.prototype, "removeIcon", void 0);
|
|
3581
|
-
__decorate([
|
|
3582
|
-
Input(),
|
|
3583
|
-
__metadata("design:type", String)
|
|
3584
|
-
], ChipComponent.prototype, "type", void 0);
|
|
3585
3927
|
__decorate([
|
|
3586
3928
|
Input(),
|
|
3587
3929
|
__metadata("design:type", Boolean)
|
|
3588
3930
|
], ChipComponent.prototype, "disabled", void 0);
|
|
3931
|
+
__decorate([
|
|
3932
|
+
Input(),
|
|
3933
|
+
__metadata("design:type", String),
|
|
3934
|
+
__metadata("design:paramtypes", [String])
|
|
3935
|
+
], ChipComponent.prototype, "size", null);
|
|
3936
|
+
__decorate([
|
|
3937
|
+
Input(),
|
|
3938
|
+
__metadata("design:type", String),
|
|
3939
|
+
__metadata("design:paramtypes", [String])
|
|
3940
|
+
], ChipComponent.prototype, "rounded", null);
|
|
3941
|
+
__decorate([
|
|
3942
|
+
Input(),
|
|
3943
|
+
__metadata("design:type", String),
|
|
3944
|
+
__metadata("design:paramtypes", [String])
|
|
3945
|
+
], ChipComponent.prototype, "fillMode", null);
|
|
3946
|
+
__decorate([
|
|
3947
|
+
Input(),
|
|
3948
|
+
__metadata("design:type", String),
|
|
3949
|
+
__metadata("design:paramtypes", [String])
|
|
3950
|
+
], ChipComponent.prototype, "themeColor", null);
|
|
3589
3951
|
__decorate([
|
|
3590
3952
|
Output(),
|
|
3591
3953
|
__metadata("design:type", EventEmitter)
|
|
@@ -3607,16 +3969,6 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3607
3969
|
HostBinding('class.k-chip'),
|
|
3608
3970
|
__metadata("design:type", Boolean)
|
|
3609
3971
|
], ChipComponent.prototype, "hostClass", void 0);
|
|
3610
|
-
__decorate([
|
|
3611
|
-
HostBinding('class.k-chip-outline'),
|
|
3612
|
-
__metadata("design:type", Boolean),
|
|
3613
|
-
__metadata("design:paramtypes", [])
|
|
3614
|
-
], ChipComponent.prototype, "outlineClass", null);
|
|
3615
|
-
__decorate([
|
|
3616
|
-
HostBinding('class.k-chip-solid'),
|
|
3617
|
-
__metadata("design:type", Boolean),
|
|
3618
|
-
__metadata("design:paramtypes", [])
|
|
3619
|
-
], ChipComponent.prototype, "solidClass", null);
|
|
3620
3972
|
__decorate([
|
|
3621
3973
|
HostBinding('class.k-chip-has-icon'),
|
|
3622
3974
|
__metadata("design:type", Boolean),
|
|
@@ -3645,7 +3997,7 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3645
3997
|
ChipComponent = __decorate([
|
|
3646
3998
|
Component({
|
|
3647
3999
|
selector: 'kendo-chip',
|
|
3648
|
-
template: "\n <span
|
|
4000
|
+
template: "\n <span\n *ngIf=\"icon\"\n class=\"k-chip-icon k-icon\"\n [ngClass]=\"kendoIconClass\"\n >\n </span>\n\n <span\n *ngIf=\"iconClass\"\n class=\"k-chip-icon\"\n [ngClass]=\"customIconClass\"\n >\n </span>\n\n <span\n *ngIf=\"avatarClass\"\n class=\"k-chip-avatar k-avatar k-rounded-full\"\n >\n <span class=\"k-avatar-image\" [ngClass]=\"chipAvatarClass\"></span>\n </span>\n\n <span class=\"k-chip-content\">\n <span class=\"k-chip-label\" *ngIf=\"label\">\n {{ label }}\n </span>\n <ng-content *ngIf=\"!label\"></ng-content>\n </span>\n\n <span class=\"k-chip-actions\">\n <span class=\"k-chip-action k-chip-remove-action\"\n *ngIf=\"removable\"\n (click)=\"onRemoveClick($event)\"\n >\n <span\n class=\"k-icon\"\n [ngClass]=\"removeIconClass\"\n >\n </span>\n </span>\n </span>\n ",
|
|
3649
4001
|
providers: [
|
|
3650
4002
|
LocalizationService,
|
|
3651
4003
|
{
|
|
@@ -3663,9 +4015,10 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3663
4015
|
}());
|
|
3664
4016
|
|
|
3665
4017
|
var ChipListComponent = /** @class */ (function () {
|
|
3666
|
-
function ChipListComponent(localizationService, renderer) {
|
|
4018
|
+
function ChipListComponent(localizationService, renderer, element) {
|
|
3667
4019
|
this.localizationService = localizationService;
|
|
3668
4020
|
this.renderer = renderer;
|
|
4021
|
+
this.element = element;
|
|
3669
4022
|
this.hostClass = true;
|
|
3670
4023
|
/**
|
|
3671
4024
|
* Sets the selection mode of the ChipList.
|
|
@@ -3685,8 +4038,30 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3685
4038
|
*/
|
|
3686
4039
|
this.remove = new EventEmitter();
|
|
3687
4040
|
this.role = 'listbox';
|
|
4041
|
+
this._size = 'medium';
|
|
3688
4042
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
3689
4043
|
}
|
|
4044
|
+
Object.defineProperty(ChipListComponent.prototype, "size", {
|
|
4045
|
+
get: function () {
|
|
4046
|
+
return this._size;
|
|
4047
|
+
},
|
|
4048
|
+
/**
|
|
4049
|
+
* The size property specifies the gap between the Chips in the ChipList
|
|
4050
|
+
* ([see example]({% slug appearance_chiplist %}#toc-size)).
|
|
4051
|
+
*
|
|
4052
|
+
* The possible values are:
|
|
4053
|
+
* * `'small'`
|
|
4054
|
+
* * `'medium'` (default)
|
|
4055
|
+
* * `'large'`
|
|
4056
|
+
* * `null`
|
|
4057
|
+
*/
|
|
4058
|
+
set: function (size) {
|
|
4059
|
+
this.handleClasses(size, 'size');
|
|
4060
|
+
this._size = size;
|
|
4061
|
+
},
|
|
4062
|
+
enumerable: true,
|
|
4063
|
+
configurable: true
|
|
4064
|
+
});
|
|
3690
4065
|
Object.defineProperty(ChipListComponent.prototype, "single", {
|
|
3691
4066
|
get: function () {
|
|
3692
4067
|
return this.selection === 'single';
|
|
@@ -3706,7 +4081,7 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3706
4081
|
*/
|
|
3707
4082
|
ChipListComponent.prototype.onClick = function ($event) {
|
|
3708
4083
|
var target = $event.target;
|
|
3709
|
-
var isRemoveClicked = closest(target, '.k-remove-
|
|
4084
|
+
var isRemoveClicked = closest(target, '.k-chip-remove-action');
|
|
3710
4085
|
var clickedChip = closest(target, '.k-chip');
|
|
3711
4086
|
var chip = this.chips.find(function (chip) { return clickedChip === chip.element.nativeElement; });
|
|
3712
4087
|
if (isRemoveClicked && clickedChip) {
|
|
@@ -3725,6 +4100,13 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3725
4100
|
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
3726
4101
|
});
|
|
3727
4102
|
};
|
|
4103
|
+
ChipListComponent.prototype.ngAfterViewInit = function () {
|
|
4104
|
+
var _this = this;
|
|
4105
|
+
var stylingInputs = ['size'];
|
|
4106
|
+
stylingInputs.forEach(function (input) {
|
|
4107
|
+
_this.handleClasses(_this[input], input);
|
|
4108
|
+
});
|
|
4109
|
+
};
|
|
3728
4110
|
ChipListComponent.prototype.ngAfterContentInit = function () {
|
|
3729
4111
|
var _this = this;
|
|
3730
4112
|
this.chips.forEach(function (chip) {
|
|
@@ -3756,6 +4138,16 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3756
4138
|
}
|
|
3757
4139
|
});
|
|
3758
4140
|
};
|
|
4141
|
+
ChipListComponent.prototype.handleClasses = function (value, input) {
|
|
4142
|
+
var elem = this.element.nativeElement;
|
|
4143
|
+
var classes = getStylingClasses('chip-list', input, this[input], value);
|
|
4144
|
+
if (classes.toRemove) {
|
|
4145
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
4146
|
+
}
|
|
4147
|
+
if (classes.toAdd) {
|
|
4148
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
4149
|
+
}
|
|
4150
|
+
};
|
|
3759
4151
|
__decorate([
|
|
3760
4152
|
HostBinding('class.k-chip-list'),
|
|
3761
4153
|
__metadata("design:type", Boolean)
|
|
@@ -3768,6 +4160,11 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3768
4160
|
Input(),
|
|
3769
4161
|
__metadata("design:type", String)
|
|
3770
4162
|
], ChipListComponent.prototype, "selection", void 0);
|
|
4163
|
+
__decorate([
|
|
4164
|
+
Input(),
|
|
4165
|
+
__metadata("design:type", String),
|
|
4166
|
+
__metadata("design:paramtypes", [String])
|
|
4167
|
+
], ChipListComponent.prototype, "size", null);
|
|
3771
4168
|
__decorate([
|
|
3772
4169
|
Output(),
|
|
3773
4170
|
__metadata("design:type", EventEmitter)
|
|
@@ -3802,17 +4199,19 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3802
4199
|
], ChipListComponent.prototype, "onClick", null);
|
|
3803
4200
|
ChipListComponent = __decorate([
|
|
3804
4201
|
Component({
|
|
3805
|
-
selector: 'kendo-
|
|
4202
|
+
selector: 'kendo-chiplist, kendo-chip-list',
|
|
3806
4203
|
template: "\n <ng-content></ng-content>\n ",
|
|
3807
4204
|
providers: [
|
|
3808
4205
|
LocalizationService,
|
|
3809
4206
|
{
|
|
3810
4207
|
provide: L10N_PREFIX,
|
|
3811
|
-
useValue: 'kendo.
|
|
4208
|
+
useValue: 'kendo.chiplist'
|
|
3812
4209
|
}
|
|
3813
4210
|
]
|
|
3814
4211
|
}),
|
|
3815
|
-
__metadata("design:paramtypes", [LocalizationService,
|
|
4212
|
+
__metadata("design:paramtypes", [LocalizationService,
|
|
4213
|
+
Renderer2,
|
|
4214
|
+
ElementRef])
|
|
3816
4215
|
], ChipListComponent);
|
|
3817
4216
|
return ChipListComponent;
|
|
3818
4217
|
}());
|
|
@@ -3981,12 +4380,16 @@ var SIZE_CLASSES = {
|
|
|
3981
4380
|
large: 'k-fab-lg'
|
|
3982
4381
|
};
|
|
3983
4382
|
var SHAPE_CLASSES = {
|
|
3984
|
-
pill: 'k-fab-pill',
|
|
3985
|
-
circle: 'k-fab-circle',
|
|
3986
4383
|
rectangle: 'k-fab-rectangle',
|
|
3987
|
-
square: 'k-fab-square'
|
|
3988
|
-
|
|
4384
|
+
square: 'k-fab-square'
|
|
4385
|
+
};
|
|
4386
|
+
var ROUNDED_CLASSES = {
|
|
4387
|
+
small: 'k-rounded-sm',
|
|
4388
|
+
medium: 'k-rounded-md',
|
|
4389
|
+
large: 'k-rounded-lg',
|
|
4390
|
+
full: 'k-rounded-full'
|
|
3989
4391
|
};
|
|
4392
|
+
var FILLMODE_CLASS = 'k-fab-solid';
|
|
3990
4393
|
var DEFAULT_DURATION = 180;
|
|
3991
4394
|
var DEFAULT_ITEM_GAP = 90;
|
|
3992
4395
|
var DEFAULT_OFFSET = '16px';
|
|
@@ -4067,13 +4470,15 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4067
4470
|
this.id = "k-" + guid();
|
|
4068
4471
|
this._themeColor = 'primary';
|
|
4069
4472
|
this._size = 'medium';
|
|
4070
|
-
this._shape = '
|
|
4473
|
+
this._shape = 'rectangle';
|
|
4071
4474
|
this._disabled = false;
|
|
4072
4475
|
this._align = { horizontal: 'end', vertical: 'bottom' };
|
|
4073
4476
|
this._offset = { x: DEFAULT_OFFSET, y: DEFAULT_OFFSET };
|
|
4477
|
+
this._rounded = 'full';
|
|
4074
4478
|
this.subscriptions = new Subscription();
|
|
4075
4479
|
this.rtl = false;
|
|
4076
4480
|
this.animationEnd = new EventEmitter();
|
|
4481
|
+
this.initialSetup = true;
|
|
4077
4482
|
validatePackage(packageMetadata);
|
|
4078
4483
|
this.subscribeNavigationEvents();
|
|
4079
4484
|
this.subscriptions.add(this.localizationService.changes.subscribe(function (_a) {
|
|
@@ -4106,18 +4511,16 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4106
4511
|
* The theme color will be applied as background color of the component.
|
|
4107
4512
|
*
|
|
4108
4513
|
* The possible values are:
|
|
4109
|
-
* * `primary` (Default)—Applies coloring based on the `primary` theme color.
|
|
4110
|
-
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
4111
|
-
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
4112
|
-
* * `
|
|
4113
|
-
* * `
|
|
4114
|
-
* * `
|
|
4115
|
-
* * `
|
|
4116
|
-
* * `
|
|
4117
|
-
* * `
|
|
4118
|
-
* * `
|
|
4119
|
-
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
4120
|
-
*
|
|
4514
|
+
* * `'primary'` (Default)—Applies coloring based on the `primary` theme color.
|
|
4515
|
+
* * `'secondary'`—Applies coloring based on the `secondary` theme color.
|
|
4516
|
+
* * `'tertiary'`— Applies coloring based on the `tertiary` theme color.
|
|
4517
|
+
* * `'info'`—Applies coloring based on the `info` theme color.
|
|
4518
|
+
* * `'success'`— Applies coloring based on the `success` theme color.
|
|
4519
|
+
* * `'warning'`— Applies coloring based on the `warning` theme color.
|
|
4520
|
+
* * `'error'`— Applies coloring based on the `error` theme color.
|
|
4521
|
+
* * `'dark'`— Applies coloring based on the `dark` theme color.
|
|
4522
|
+
* * `'light'`— Applies coloring based on the `light` theme color.
|
|
4523
|
+
* * `'inverse'`— Applies coloring based on the `inverse` theme color.
|
|
4121
4524
|
*/
|
|
4122
4525
|
set: function (themeColor) {
|
|
4123
4526
|
this.handleClasses(themeColor, 'themeColor');
|
|
@@ -4135,10 +4538,9 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4135
4538
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-size)).
|
|
4136
4539
|
*
|
|
4137
4540
|
* The possible values are:
|
|
4138
|
-
* * `small`
|
|
4139
|
-
* * `medium` (Default)
|
|
4140
|
-
* * `large`
|
|
4141
|
-
*
|
|
4541
|
+
* * `'small'`
|
|
4542
|
+
* * `'medium'` (Default)
|
|
4543
|
+
* * `'large'`
|
|
4142
4544
|
*/
|
|
4143
4545
|
set: function (size) {
|
|
4144
4546
|
this.handleClasses(size, 'size');
|
|
@@ -4147,6 +4549,27 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4147
4549
|
enumerable: true,
|
|
4148
4550
|
configurable: true
|
|
4149
4551
|
});
|
|
4552
|
+
Object.defineProperty(FloatingActionButtonComponent.prototype, "rounded", {
|
|
4553
|
+
get: function () {
|
|
4554
|
+
return this._rounded;
|
|
4555
|
+
},
|
|
4556
|
+
/**
|
|
4557
|
+
* The rounded property specifies the border radius of the FloatingActionButton.
|
|
4558
|
+
*
|
|
4559
|
+
* The possible values are:
|
|
4560
|
+
* * `'small'`
|
|
4561
|
+
* * `'medium'`
|
|
4562
|
+
* * `'large'`
|
|
4563
|
+
* * `'full'` (default)
|
|
4564
|
+
* * `null`
|
|
4565
|
+
*/
|
|
4566
|
+
set: function (rounded) {
|
|
4567
|
+
this.handleClasses(rounded, 'rounded');
|
|
4568
|
+
this._rounded = rounded;
|
|
4569
|
+
},
|
|
4570
|
+
enumerable: true,
|
|
4571
|
+
configurable: true
|
|
4572
|
+
});
|
|
4150
4573
|
Object.defineProperty(FloatingActionButtonComponent.prototype, "shape", {
|
|
4151
4574
|
get: function () {
|
|
4152
4575
|
return this._shape;
|
|
@@ -4156,10 +4579,7 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4156
4579
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-shape)).
|
|
4157
4580
|
*
|
|
4158
4581
|
* The possible values are:
|
|
4159
|
-
* * `
|
|
4160
|
-
* * `circle`—Applies circle shape on the FloatingActionButton.
|
|
4161
|
-
* * `rectangle`—Applies rectangular shape on the FloatingActionButton.
|
|
4162
|
-
* * `rounded`—Applies rounded shape on the FloatingActionButton.
|
|
4582
|
+
* * `rectangle` (Default)—Applies rectangular shape on the FloatingActionButton.
|
|
4163
4583
|
* * `square`—Applies square shape on the FloatingActionButton.
|
|
4164
4584
|
*
|
|
4165
4585
|
*/
|
|
@@ -4233,8 +4653,11 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4233
4653
|
configurable: true
|
|
4234
4654
|
});
|
|
4235
4655
|
FloatingActionButtonComponent.prototype.ngAfterViewInit = function () {
|
|
4236
|
-
this
|
|
4656
|
+
var _this = this;
|
|
4657
|
+
['shape', 'size', 'rounded', 'themeColor'].forEach(function (option) { return _this.handleClasses(_this[option], option); });
|
|
4658
|
+
this.renderer.addClass(this.element.nativeElement, this.alignClass());
|
|
4237
4659
|
this.offsetStyles();
|
|
4660
|
+
this.initialSetup = false;
|
|
4238
4661
|
};
|
|
4239
4662
|
FloatingActionButtonComponent.prototype.ngOnDestroy = function () {
|
|
4240
4663
|
this.subscriptions.unsubscribe();
|
|
@@ -4398,20 +4821,24 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4398
4821
|
this.toggleDialWithEvents(false);
|
|
4399
4822
|
};
|
|
4400
4823
|
FloatingActionButtonComponent.prototype.handleClasses = function (inputValue, input) {
|
|
4401
|
-
if (isPresent(this.button) && (this[input] !== inputValue)) {
|
|
4824
|
+
if (isPresent(this.button) && (this[input] !== inputValue || this.initialSetup)) {
|
|
4402
4825
|
var button = this.button.nativeElement;
|
|
4403
4826
|
var classesToRemove = {
|
|
4404
|
-
themeColor: "
|
|
4827
|
+
themeColor: FILLMODE_CLASS + "-" + this.themeColor,
|
|
4405
4828
|
size: SIZE_CLASSES[this.size],
|
|
4406
|
-
shape: SHAPE_CLASSES[this.shape]
|
|
4829
|
+
shape: SHAPE_CLASSES[this.shape],
|
|
4830
|
+
rounded: ROUNDED_CLASSES[this.rounded]
|
|
4407
4831
|
};
|
|
4408
4832
|
var classesToAdd = {
|
|
4409
|
-
themeColor: "
|
|
4833
|
+
themeColor: inputValue ? FILLMODE_CLASS + "-" + inputValue : null,
|
|
4410
4834
|
size: SIZE_CLASSES[inputValue],
|
|
4411
|
-
shape: SHAPE_CLASSES[inputValue]
|
|
4835
|
+
shape: SHAPE_CLASSES[inputValue],
|
|
4836
|
+
rounded: ROUNDED_CLASSES[inputValue]
|
|
4412
4837
|
};
|
|
4413
4838
|
this.renderer.removeClass(button, classesToRemove[input]);
|
|
4414
|
-
|
|
4839
|
+
if (classesToAdd[input]) {
|
|
4840
|
+
this.renderer.addClass(button, classesToAdd[input]);
|
|
4841
|
+
}
|
|
4415
4842
|
}
|
|
4416
4843
|
};
|
|
4417
4844
|
FloatingActionButtonComponent.prototype.onEnterPressed = function () {
|
|
@@ -4468,14 +4895,6 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4468
4895
|
FloatingActionButtonComponent.prototype.alignClass = function () {
|
|
4469
4896
|
return "k-pos-" + this.align.vertical + "-" + this.align.horizontal;
|
|
4470
4897
|
};
|
|
4471
|
-
FloatingActionButtonComponent.prototype.applyClasses = function () {
|
|
4472
|
-
var hostElement = this.element.nativeElement;
|
|
4473
|
-
var button = this.button.nativeElement;
|
|
4474
|
-
this.renderer.addClass(button, SHAPE_CLASSES[this.shape]);
|
|
4475
|
-
this.renderer.addClass(button, "k-fab-" + this.themeColor);
|
|
4476
|
-
this.renderer.addClass(button, SIZE_CLASSES[this.size]);
|
|
4477
|
-
this.renderer.addClass(hostElement, this.alignClass());
|
|
4478
|
-
};
|
|
4479
4898
|
FloatingActionButtonComponent.prototype.toggleDialWithEvents = function (open) {
|
|
4480
4899
|
if (open === this.isOpen) {
|
|
4481
4900
|
return;
|
|
@@ -4717,6 +5136,11 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4717
5136
|
__metadata("design:type", String),
|
|
4718
5137
|
__metadata("design:paramtypes", [String])
|
|
4719
5138
|
], FloatingActionButtonComponent.prototype, "size", null);
|
|
5139
|
+
__decorate([
|
|
5140
|
+
Input(),
|
|
5141
|
+
__metadata("design:type", String),
|
|
5142
|
+
__metadata("design:paramtypes", [String])
|
|
5143
|
+
], FloatingActionButtonComponent.prototype, "rounded", null);
|
|
4720
5144
|
__decorate([
|
|
4721
5145
|
Input(),
|
|
4722
5146
|
__metadata("design:type", String),
|
|
@@ -4806,7 +5230,7 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4806
5230
|
useValue: 'kendo.floatingactionbutton'
|
|
4807
5231
|
}
|
|
4808
5232
|
],
|
|
4809
|
-
template: "\n <button\n #button\n [attr.id]=\"id\"\n [attr.role]=\"role\"\n [tabIndex]=\"componentTabIndex\"\n type=\"button\"\n
|
|
5233
|
+
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 "
|
|
4810
5234
|
}),
|
|
4811
5235
|
__metadata("design:paramtypes", [Renderer2,
|
|
4812
5236
|
ElementRef,
|
|
@@ -4969,7 +5393,7 @@ var DialItemComponent = /** @class */ (function () {
|
|
|
4969
5393
|
], DialItemComponent.prototype, "role", void 0);
|
|
4970
5394
|
__decorate([
|
|
4971
5395
|
HostBinding('attr.aria-disabled'),
|
|
4972
|
-
HostBinding('class.k-
|
|
5396
|
+
HostBinding('class.k-disabled'),
|
|
4973
5397
|
__metadata("design:type", Boolean),
|
|
4974
5398
|
__metadata("design:paramtypes", [])
|
|
4975
5399
|
], DialItemComponent.prototype, "disabledClass", null);
|