@progress/kendo-angular-buttons 6.4.1 → 7.0.0-dev.202201180832
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-buttons.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/button/button.directive.js +236 -89
- package/dist/es/button/button.service.js +1 -5
- package/dist/es/buttongroup/buttongroup.component.js +11 -60
- package/dist/es/chip/chip-list.component.js +57 -7
- package/dist/es/chip/chip.component.js +175 -86
- package/dist/es/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/es/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/{es2015/button-look.js → es/common/models/styling-classes.js} +0 -0
- package/dist/es/{button-look.js → common/models.js} +0 -0
- package/dist/es/dropdownbutton/dropdownbutton.component.js +89 -36
- package/dist/es/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/es/focusable/focusable.directive.js +4 -4
- package/dist/es/listbutton/list-button.js +4 -1
- package/dist/es/listbutton/list.component.js +20 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/splitbutton/splitbutton.component.js +107 -37
- package/dist/es/util.js +52 -0
- package/dist/es2015/button/button.directive.d.ts +85 -22
- package/dist/es2015/button/button.directive.js +219 -85
- package/dist/es2015/button/button.service.d.ts +1 -4
- package/dist/es2015/button/button.service.js +1 -5
- package/dist/es2015/buttongroup/buttongroup.component.d.ts +0 -15
- package/dist/es2015/buttongroup/buttongroup.component.js +11 -48
- package/dist/es2015/chip/chip-list.component.d.ts +19 -3
- package/dist/es2015/chip/chip-list.component.js +52 -7
- package/dist/es2015/chip/chip.component.d.ts +67 -32
- package/dist/es2015/chip/chip.component.js +186 -97
- package/dist/es2015/common/models/fillmode.d.ts +12 -0
- package/dist/es2015/{chip/models/type.js → common/models/fillmode.js} +0 -0
- package/dist/es2015/common/models/rounded.d.ts +12 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/shape.d.ts +2 -9
- package/dist/es2015/common/models/size.d.ts +9 -6
- package/dist/es2015/common/models/styling-classes.d.ts +11 -0
- package/dist/es2015/common/models/styling-classes.js +4 -0
- package/dist/es2015/common/models/theme-color.d.ts +15 -4
- package/dist/es2015/common/models.d.ts +10 -0
- package/dist/es2015/{chip/models/chip-look.js → common/models.js} +0 -0
- package/dist/es2015/dropdownbutton/dropdownbutton.component.d.ts +59 -7
- package/dist/es2015/dropdownbutton/dropdownbutton.component.js +92 -31
- package/dist/es2015/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.d.ts +28 -21
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.js +62 -42
- package/dist/es2015/focusable/focusable.directive.js +4 -4
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/listbutton/list-button.js +4 -1
- package/dist/es2015/listbutton/list.component.d.ts +3 -0
- package/dist/es2015/listbutton/list.component.js +37 -20
- package/dist/es2015/main.d.ts +4 -4
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/splitbutton/splitbutton.component.d.ts +59 -12
- package/dist/es2015/splitbutton/splitbutton.component.js +113 -33
- package/dist/es2015/util.d.ts +21 -0
- package/dist/es2015/util.js +52 -0
- package/dist/fesm2015/index.js +862 -409
- package/dist/fesm5/index.js +853 -405
- package/dist/npm/button/button.directive.js +236 -89
- package/dist/npm/button/button.service.js +0 -4
- package/dist/npm/buttongroup/buttongroup.component.js +11 -60
- package/dist/npm/chip/chip-list.component.js +55 -5
- package/dist/npm/chip/chip.component.js +173 -84
- package/dist/npm/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/npm/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/npm/common/models/styling-classes.js +6 -0
- package/dist/npm/{button-look.js → common/models.js} +0 -0
- package/dist/npm/dropdownbutton/dropdownbutton.component.js +89 -36
- package/dist/npm/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/npm/focusable/focusable.directive.js +4 -4
- package/dist/npm/listbutton/list-button.js +4 -1
- package/dist/npm/listbutton/list.component.js +20 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/splitbutton/splitbutton.component.js +105 -35
- package/dist/npm/util.js +52 -0
- package/dist/systemjs/kendo-angular-buttons.js +1 -1
- package/package.json +14 -11
- package/dist/es2015/button-look.d.ts +0 -21
- package/dist/es2015/chip/models/chip-look.d.ts +0 -20
- package/dist/es2015/chip/models/type.d.ts +0 -21
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: 1642494672,
|
|
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,37 @@ 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
|
+
default:
|
|
502
|
+
this.fillMode = value;
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
enumerable: true,
|
|
507
|
+
configurable: true
|
|
508
|
+
});
|
|
322
509
|
ButtonDirective.prototype.ngOnInit = function () {
|
|
323
510
|
var _this = this;
|
|
324
511
|
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
|
-
}
|
|
512
|
+
this.addTextSpan();
|
|
330
513
|
if (!this.element.hasAttribute('role') && this.togglable) {
|
|
331
514
|
this.toggleAriaPressed(this.toggleable);
|
|
332
515
|
}
|
|
@@ -336,7 +519,8 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
336
519
|
this.ngZone.runOutsideAngular(function () {
|
|
337
520
|
_this.domEvents.push(_this.renderer.listen(_this.element, 'click', _this._onButtonClick.bind(_this)));
|
|
338
521
|
_this.domEvents.push(_this.renderer.listen(_this.element, 'keydown', function (event) {
|
|
339
|
-
|
|
522
|
+
var isSpaceOrEnter = event.keyCode === Keys.Space || event.keyCode === Keys.Enter;
|
|
523
|
+
if (isSpan && isSpaceOrEnter) {
|
|
340
524
|
_this.click.emit(event);
|
|
341
525
|
_this._onButtonClick();
|
|
342
526
|
}
|
|
@@ -348,17 +532,22 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
348
532
|
this.toggleAriaPressed(this.toggleable);
|
|
349
533
|
}
|
|
350
534
|
};
|
|
535
|
+
ButtonDirective.prototype.ngAfterViewInit = function () {
|
|
536
|
+
var _this = this;
|
|
537
|
+
var stylingOptions = ['size', 'rounded', 'shape', 'fillMode'];
|
|
538
|
+
stylingOptions.forEach(function (input) {
|
|
539
|
+
_this.handleClasses(_this[input], input);
|
|
540
|
+
});
|
|
541
|
+
};
|
|
351
542
|
ButtonDirective.prototype.ngAfterViewChecked = function () {
|
|
352
543
|
this.setIconTextClasses();
|
|
353
544
|
};
|
|
354
545
|
ButtonDirective.prototype.ngOnDestroy = function () {
|
|
355
546
|
this.imageNode = null;
|
|
356
547
|
this.iconNode = null;
|
|
548
|
+
this.iconSpanNode = null;
|
|
357
549
|
this.renderer = null;
|
|
358
550
|
this.localizationChangeSubscription.unsubscribe();
|
|
359
|
-
if (this.service && this.buttonLookChangeSubscription) {
|
|
360
|
-
this.buttonLookChangeSubscription.unsubscribe();
|
|
361
|
-
}
|
|
362
551
|
clearTimeout(this.deferTimeout);
|
|
363
552
|
this.domEvents.forEach(function (unbindHandler) { return unbindHandler(); });
|
|
364
553
|
};
|
|
@@ -402,7 +591,7 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
402
591
|
var changed = this.selected !== value;
|
|
403
592
|
this.selected = value;
|
|
404
593
|
this.setAttribute('aria-pressed', this.selected.toString());
|
|
405
|
-
this.toggleClass('k-
|
|
594
|
+
this.toggleClass('k-selected', this.selected);
|
|
406
595
|
if (changed && hasObservers(this.selectedChange)) {
|
|
407
596
|
this.ngZone.run(function () {
|
|
408
597
|
_this.selectedChange.emit(value);
|
|
@@ -422,14 +611,25 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
422
611
|
};
|
|
423
612
|
ButtonDirective.prototype.hasText = function () {
|
|
424
613
|
if (isDocumentAvailable()) {
|
|
425
|
-
return
|
|
614
|
+
return this.element.textContent.trim().length > 0;
|
|
426
615
|
}
|
|
427
616
|
else {
|
|
428
617
|
return false;
|
|
429
618
|
}
|
|
430
619
|
};
|
|
620
|
+
Object.defineProperty(ButtonDirective.prototype, "text", {
|
|
621
|
+
get: function () {
|
|
622
|
+
if (isDocumentAvailable()) {
|
|
623
|
+
return this.element.innerHTML.trim();
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
enumerable: true,
|
|
627
|
+
configurable: true
|
|
628
|
+
});
|
|
431
629
|
ButtonDirective.prototype.addImgIcon = function (imageUrl) {
|
|
432
630
|
var renderer = this.renderer;
|
|
631
|
+
this.iconSpanNode = renderer.createElement('span');
|
|
632
|
+
renderer.setProperty(this.iconSpanNode, 'className', 'k-button-icon k-icon');
|
|
433
633
|
if (this.imageNode) {
|
|
434
634
|
renderer.setProperty(this.imageNode, 'src', imageUrl);
|
|
435
635
|
}
|
|
@@ -438,8 +638,9 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
438
638
|
renderer.setProperty(this.imageNode, 'src', imageUrl);
|
|
439
639
|
renderer.setProperty(this.imageNode, 'className', 'k-image');
|
|
440
640
|
renderer.setAttribute(this.imageNode, 'role', 'presentation');
|
|
441
|
-
this.prependChild(this.imageNode);
|
|
442
641
|
}
|
|
642
|
+
this.iconSpanNode.appendChild(this.imageNode);
|
|
643
|
+
this.prependChild(this.iconSpanNode);
|
|
443
644
|
};
|
|
444
645
|
ButtonDirective.prototype.addIcon = function (classNames) {
|
|
445
646
|
var renderer = this.renderer;
|
|
@@ -453,6 +654,11 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
453
654
|
this.prependChild(this.iconNode);
|
|
454
655
|
}
|
|
455
656
|
};
|
|
657
|
+
ButtonDirective.prototype.addTextSpan = function () {
|
|
658
|
+
if (isDocumentAvailable() && this.hasText()) {
|
|
659
|
+
this.element.innerHTML = "<span class='k-button-text'>" + this.text + "</span>";
|
|
660
|
+
}
|
|
661
|
+
};
|
|
456
662
|
ButtonDirective.prototype.prependChild = function (node) {
|
|
457
663
|
var _this = this;
|
|
458
664
|
this.defer(function () {
|
|
@@ -476,7 +682,9 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
476
682
|
ButtonDirective.prototype.removeImageNode = function () {
|
|
477
683
|
if (this.imageNode && this.renderer.parentNode(this.imageNode)) {
|
|
478
684
|
this.renderer.removeChild(this.element, this.imageNode);
|
|
685
|
+
this.renderer.removeChild(this.element, this.iconSpanNode);
|
|
479
686
|
this.imageNode = null;
|
|
687
|
+
this.iconSpanNode = null;
|
|
480
688
|
}
|
|
481
689
|
};
|
|
482
690
|
ButtonDirective.prototype.removeIconNode = function () {
|
|
@@ -484,6 +692,10 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
484
692
|
this.renderer.removeChild(this.element, this.iconNode);
|
|
485
693
|
this.iconNode = null;
|
|
486
694
|
}
|
|
695
|
+
if (this.iconSpanNode) {
|
|
696
|
+
this.renderer.removeChild(this.element, this.iconSpanNode);
|
|
697
|
+
this.iconSpanNode = null;
|
|
698
|
+
}
|
|
487
699
|
};
|
|
488
700
|
ButtonDirective.prototype.updateIconNode = function () {
|
|
489
701
|
if (!this.isIcon && !this.isIconClass) {
|
|
@@ -492,9 +704,7 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
492
704
|
};
|
|
493
705
|
ButtonDirective.prototype.setIconTextClasses = function () {
|
|
494
706
|
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);
|
|
707
|
+
this.toggleClass('k-icon-button', hasIcon && !this.hasText());
|
|
498
708
|
};
|
|
499
709
|
ButtonDirective.prototype.toggleClass = function (className, add) {
|
|
500
710
|
if (add) {
|
|
@@ -515,6 +725,31 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
515
725
|
this.setSelected(!this.selected);
|
|
516
726
|
}
|
|
517
727
|
};
|
|
728
|
+
ButtonDirective.prototype.handleClasses = function (value, input) {
|
|
729
|
+
var elem = this.element;
|
|
730
|
+
var classes = getStylingClasses('button', input, this[input], value);
|
|
731
|
+
if (input === 'fillMode') {
|
|
732
|
+
this.handleThemeColor(this.themeColor, this[input], value);
|
|
733
|
+
}
|
|
734
|
+
if (classes.toRemove) {
|
|
735
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
736
|
+
}
|
|
737
|
+
if (classes.toAdd) {
|
|
738
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
ButtonDirective.prototype.handleThemeColor = function (value, prevFillMode, fillMode) {
|
|
742
|
+
var elem = this.element;
|
|
743
|
+
var removeFillMode = prevFillMode ? prevFillMode : this.fillMode;
|
|
744
|
+
var addFillMode = fillMode ? fillMode : this.fillMode;
|
|
745
|
+
var themeColorClass = getThemeColorClasses('button', removeFillMode, addFillMode, this.themeColor, value);
|
|
746
|
+
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
747
|
+
if (addFillMode !== null && fillMode !== null) {
|
|
748
|
+
if (themeColorClass.toAdd) {
|
|
749
|
+
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
};
|
|
518
753
|
__decorate([
|
|
519
754
|
Input(),
|
|
520
755
|
__metadata("design:type", Boolean)
|
|
@@ -524,14 +759,6 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
524
759
|
__metadata("design:type", Boolean),
|
|
525
760
|
__metadata("design:paramtypes", [Boolean])
|
|
526
761
|
], 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
762
|
__decorate([
|
|
536
763
|
Input(),
|
|
537
764
|
__metadata("design:type", Boolean),
|
|
@@ -562,6 +789,31 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
562
789
|
__metadata("design:type", Boolean),
|
|
563
790
|
__metadata("design:paramtypes", [Boolean])
|
|
564
791
|
], ButtonDirective.prototype, "disabled", null);
|
|
792
|
+
__decorate([
|
|
793
|
+
Input(),
|
|
794
|
+
__metadata("design:type", String),
|
|
795
|
+
__metadata("design:paramtypes", [String])
|
|
796
|
+
], ButtonDirective.prototype, "size", null);
|
|
797
|
+
__decorate([
|
|
798
|
+
Input(),
|
|
799
|
+
__metadata("design:type", String),
|
|
800
|
+
__metadata("design:paramtypes", [String])
|
|
801
|
+
], ButtonDirective.prototype, "rounded", null);
|
|
802
|
+
__decorate([
|
|
803
|
+
Input(),
|
|
804
|
+
__metadata("design:type", String),
|
|
805
|
+
__metadata("design:paramtypes", [String])
|
|
806
|
+
], ButtonDirective.prototype, "fillMode", null);
|
|
807
|
+
__decorate([
|
|
808
|
+
Input(),
|
|
809
|
+
__metadata("design:type", String),
|
|
810
|
+
__metadata("design:paramtypes", [String])
|
|
811
|
+
], ButtonDirective.prototype, "themeColor", null);
|
|
812
|
+
__decorate([
|
|
813
|
+
Input(),
|
|
814
|
+
__metadata("design:type", String),
|
|
815
|
+
__metadata("design:paramtypes", [String])
|
|
816
|
+
], ButtonDirective.prototype, "shape", null);
|
|
565
817
|
__decorate([
|
|
566
818
|
Input(),
|
|
567
819
|
__metadata("design:type", String)
|
|
@@ -579,36 +831,11 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
579
831
|
__metadata("design:type", Boolean),
|
|
580
832
|
__metadata("design:paramtypes", [])
|
|
581
833
|
], 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
834
|
__decorate([
|
|
588
835
|
HostBinding('class.k-toggle-button'),
|
|
589
836
|
__metadata("design:type", Boolean),
|
|
590
837
|
__metadata("design:paramtypes", [])
|
|
591
838
|
], 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
839
|
__decorate([
|
|
613
840
|
HostBinding('attr.role'),
|
|
614
841
|
__metadata("design:type", String),
|
|
@@ -616,12 +843,12 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
616
843
|
], ButtonDirective.prototype, "roleSetter", null);
|
|
617
844
|
__decorate([
|
|
618
845
|
HostBinding('attr.aria-disabled'),
|
|
619
|
-
HostBinding('class.k-
|
|
846
|
+
HostBinding('class.k-disabled'),
|
|
620
847
|
__metadata("design:type", Boolean),
|
|
621
848
|
__metadata("design:paramtypes", [])
|
|
622
849
|
], ButtonDirective.prototype, "classDisabled", null);
|
|
623
850
|
__decorate([
|
|
624
|
-
HostBinding('class.k-
|
|
851
|
+
HostBinding('class.k-selected'),
|
|
625
852
|
__metadata("design:type", Boolean),
|
|
626
853
|
__metadata("design:paramtypes", [])
|
|
627
854
|
], ButtonDirective.prototype, "classActive", null);
|
|
@@ -642,6 +869,16 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
642
869
|
__metadata("design:paramtypes", []),
|
|
643
870
|
__metadata("design:returntype", void 0)
|
|
644
871
|
], ButtonDirective.prototype, "onBlur", null);
|
|
872
|
+
__decorate([
|
|
873
|
+
Input(),
|
|
874
|
+
__metadata("design:type", Boolean),
|
|
875
|
+
__metadata("design:paramtypes", [Boolean])
|
|
876
|
+
], ButtonDirective.prototype, "primary", null);
|
|
877
|
+
__decorate([
|
|
878
|
+
Input(),
|
|
879
|
+
__metadata("design:type", String),
|
|
880
|
+
__metadata("design:paramtypes", [String])
|
|
881
|
+
], ButtonDirective.prototype, "look", null);
|
|
645
882
|
ButtonDirective = __decorate([
|
|
646
883
|
Directive({
|
|
647
884
|
exportAs: 'kendoButton',
|
|
@@ -652,7 +889,7 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
652
889
|
useValue: 'kendo.button'
|
|
653
890
|
}
|
|
654
891
|
],
|
|
655
|
-
selector: 'button[kendoButton], span[kendoButton]'
|
|
892
|
+
selector: 'button[kendoButton], span[kendoButton]',
|
|
656
893
|
}),
|
|
657
894
|
__param(2, Optional()),
|
|
658
895
|
__metadata("design:paramtypes", [ElementRef,
|
|
@@ -664,48 +901,6 @@ var ButtonDirective = /** @class */ (function () {
|
|
|
664
901
|
return ButtonDirective;
|
|
665
902
|
}());
|
|
666
903
|
|
|
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
904
|
/**
|
|
710
905
|
* @hidden
|
|
711
906
|
*/
|
|
@@ -747,23 +942,13 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
747
942
|
* By default, the selection mode of the ButtonGroup is set to `multiple`.
|
|
748
943
|
*/
|
|
749
944
|
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
945
|
/**
|
|
762
946
|
* Fires every time keyboard navigation occurs.
|
|
763
947
|
*/
|
|
764
948
|
this.navigate = new EventEmitter();
|
|
765
949
|
this._tabIndex = 0;
|
|
766
950
|
this.currentTabIndex = 0;
|
|
951
|
+
validatePackage(packageMetadata);
|
|
767
952
|
this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
|
|
768
953
|
var rtl = _a.rtl;
|
|
769
954
|
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
@@ -804,27 +989,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
804
989
|
enumerable: true,
|
|
805
990
|
configurable: true
|
|
806
991
|
});
|
|
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
992
|
Object.defineProperty(ButtonGroupComponent.prototype, "getRole", {
|
|
829
993
|
get: function () {
|
|
830
994
|
return this.isSelectionSingle() ? 'radiogroup' : 'group';
|
|
@@ -890,7 +1054,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
890
1054
|
};
|
|
891
1055
|
ButtonGroupComponent.prototype.ngOnInit = function () {
|
|
892
1056
|
var _this = this;
|
|
893
|
-
this.service.setButtonLook(this.look);
|
|
894
1057
|
this.subscription = this.service.buttonClicked$.subscribe(function (button) {
|
|
895
1058
|
var newSelectionValue;
|
|
896
1059
|
if (_this.isSelectionSingle()) {
|
|
@@ -904,7 +1067,7 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
904
1067
|
if (button.togglable) {
|
|
905
1068
|
button.setSelected(newSelectionValue);
|
|
906
1069
|
}
|
|
907
|
-
button.setAttribute(tabindex,
|
|
1070
|
+
button.setAttribute(tabindex, '0');
|
|
908
1071
|
});
|
|
909
1072
|
};
|
|
910
1073
|
ButtonGroupComponent.prototype.ngOnChanges = function (change) {
|
|
@@ -920,10 +1083,10 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
920
1083
|
ButtonGroupComponent.prototype.ngAfterContentInit = function () {
|
|
921
1084
|
this.buttons.forEach(function (button) {
|
|
922
1085
|
if (button.selected) {
|
|
923
|
-
button.setAttribute(tabindex,
|
|
1086
|
+
button.setAttribute(tabindex, '0');
|
|
924
1087
|
}
|
|
925
1088
|
else {
|
|
926
|
-
button.setAttribute(tabindex,
|
|
1089
|
+
button.setAttribute(tabindex, '-1');
|
|
927
1090
|
}
|
|
928
1091
|
});
|
|
929
1092
|
};
|
|
@@ -967,24 +1130,24 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
967
1130
|
ButtonGroupComponent.prototype.deactivate = function (buttons) {
|
|
968
1131
|
buttons.forEach(function (button) {
|
|
969
1132
|
button.setSelected(false);
|
|
970
|
-
button.setAttribute(tabindex,
|
|
1133
|
+
button.setAttribute(tabindex, '-1');
|
|
971
1134
|
});
|
|
972
1135
|
};
|
|
973
1136
|
ButtonGroupComponent.prototype.activate = function (buttons) {
|
|
974
1137
|
buttons.forEach(function (button) {
|
|
975
1138
|
button.setSelected(true);
|
|
976
|
-
button.setAttribute(tabindex,
|
|
1139
|
+
button.setAttribute(tabindex, '0');
|
|
977
1140
|
button.focus();
|
|
978
1141
|
});
|
|
979
1142
|
};
|
|
980
1143
|
ButtonGroupComponent.prototype.defocus = function (buttons) {
|
|
981
1144
|
buttons.forEach(function (button) {
|
|
982
|
-
button.setAttribute(tabindex,
|
|
1145
|
+
button.setAttribute(tabindex, '-1');
|
|
983
1146
|
});
|
|
984
1147
|
};
|
|
985
1148
|
ButtonGroupComponent.prototype.focus = function (buttons) {
|
|
986
1149
|
buttons.forEach(function (button) {
|
|
987
|
-
button.setAttribute(tabindex,
|
|
1150
|
+
button.setAttribute(tabindex, '0');
|
|
988
1151
|
button.focus();
|
|
989
1152
|
});
|
|
990
1153
|
};
|
|
@@ -1010,10 +1173,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
1010
1173
|
Input('width'),
|
|
1011
1174
|
__metadata("design:type", String)
|
|
1012
1175
|
], ButtonGroupComponent.prototype, "width", void 0);
|
|
1013
|
-
__decorate([
|
|
1014
|
-
Input(),
|
|
1015
|
-
__metadata("design:type", String)
|
|
1016
|
-
], ButtonGroupComponent.prototype, "look", void 0);
|
|
1017
1176
|
__decorate([
|
|
1018
1177
|
Input(),
|
|
1019
1178
|
__metadata("design:type", Number),
|
|
@@ -1033,7 +1192,7 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
1033
1192
|
__metadata("design:paramtypes", [])
|
|
1034
1193
|
], ButtonGroupComponent.prototype, "wrapperClass", null);
|
|
1035
1194
|
__decorate([
|
|
1036
|
-
HostBinding('class.k-
|
|
1195
|
+
HostBinding('class.k-disabled'),
|
|
1037
1196
|
__metadata("design:type", Boolean),
|
|
1038
1197
|
__metadata("design:paramtypes", [])
|
|
1039
1198
|
], ButtonGroupComponent.prototype, "disabledClass", null);
|
|
@@ -1042,21 +1201,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
1042
1201
|
__metadata("design:type", Boolean),
|
|
1043
1202
|
__metadata("design:paramtypes", [])
|
|
1044
1203
|
], 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
1204
|
__decorate([
|
|
1061
1205
|
HostBinding('attr.role'),
|
|
1062
1206
|
__metadata("design:type", String),
|
|
@@ -1253,8 +1397,21 @@ var ListComponent = /** @class */ (function () {
|
|
|
1253
1397
|
function ListComponent() {
|
|
1254
1398
|
this.onItemClick = new EventEmitter();
|
|
1255
1399
|
this.onItemBlur = new EventEmitter();
|
|
1400
|
+
this.sizeClass = '';
|
|
1256
1401
|
validatePackage(packageMetadata);
|
|
1257
1402
|
}
|
|
1403
|
+
Object.defineProperty(ListComponent.prototype, "size", {
|
|
1404
|
+
set: function (size) {
|
|
1405
|
+
if (size) {
|
|
1406
|
+
this.sizeClass = "k-menu-group-" + SIZES[size];
|
|
1407
|
+
}
|
|
1408
|
+
else {
|
|
1409
|
+
this.sizeClass = '';
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
enumerable: true,
|
|
1413
|
+
configurable: true
|
|
1414
|
+
});
|
|
1258
1415
|
ListComponent.prototype.getText = function (dataItem) {
|
|
1259
1416
|
if (dataItem) {
|
|
1260
1417
|
return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
|
|
@@ -1293,10 +1450,15 @@ var ListComponent = /** @class */ (function () {
|
|
|
1293
1450
|
Output(),
|
|
1294
1451
|
__metadata("design:type", EventEmitter)
|
|
1295
1452
|
], ListComponent.prototype, "onItemBlur", void 0);
|
|
1453
|
+
__decorate([
|
|
1454
|
+
Input(),
|
|
1455
|
+
__metadata("design:type", String),
|
|
1456
|
+
__metadata("design:paramtypes", [String])
|
|
1457
|
+
], ListComponent.prototype, "size", null);
|
|
1296
1458
|
ListComponent = __decorate([
|
|
1297
1459
|
Component({
|
|
1298
1460
|
selector: 'kendo-button-list',
|
|
1299
|
-
template: "\n <ul class=\"k-
|
|
1461
|
+
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
1462
|
}),
|
|
1301
1463
|
__metadata("design:paramtypes", [])
|
|
1302
1464
|
], ListComponent);
|
|
@@ -1352,10 +1514,10 @@ var FocusableDirective = /** @class */ (function () {
|
|
|
1352
1514
|
}
|
|
1353
1515
|
FocusableDirective.prototype.ngOnInit = function () {
|
|
1354
1516
|
if (this.index === this.focusService.focused) {
|
|
1355
|
-
this.renderer.addClass(this.element, 'k-
|
|
1517
|
+
this.renderer.addClass(this.element, 'k-focus');
|
|
1356
1518
|
}
|
|
1357
1519
|
else {
|
|
1358
|
-
this.renderer.removeClass(this.element, 'k-
|
|
1520
|
+
this.renderer.removeClass(this.element, 'k-focus');
|
|
1359
1521
|
}
|
|
1360
1522
|
};
|
|
1361
1523
|
/**
|
|
@@ -1371,11 +1533,11 @@ var FocusableDirective = /** @class */ (function () {
|
|
|
1371
1533
|
}
|
|
1372
1534
|
this.focusSubscription = this.focusService.onFocus.subscribe(function (index) {
|
|
1373
1535
|
if (_this.index === index) {
|
|
1374
|
-
_this.renderer.addClass(_this.element, 'k-
|
|
1536
|
+
_this.renderer.addClass(_this.element, 'k-focus');
|
|
1375
1537
|
_this.element.focus();
|
|
1376
1538
|
}
|
|
1377
1539
|
else {
|
|
1378
|
-
_this.renderer.removeClass(_this.element, 'k-
|
|
1540
|
+
_this.renderer.removeClass(_this.element, 'k-focus');
|
|
1379
1541
|
}
|
|
1380
1542
|
});
|
|
1381
1543
|
};
|
|
@@ -1500,6 +1662,7 @@ var ListButton = /** @class */ (function () {
|
|
|
1500
1662
|
this._popupSettings = { animate: true, popupClass: '' };
|
|
1501
1663
|
this.listId = guid();
|
|
1502
1664
|
this._isFocused = false;
|
|
1665
|
+
validatePackage(packageMetadata);
|
|
1503
1666
|
this.focusService = focusService;
|
|
1504
1667
|
this.navigationService = navigationService;
|
|
1505
1668
|
this.wrapper = wrapperRef.nativeElement;
|
|
@@ -1511,7 +1674,7 @@ var ListButton = /** @class */ (function () {
|
|
|
1511
1674
|
}
|
|
1512
1675
|
Object.defineProperty(ListButton.prototype, "popupClasses", {
|
|
1513
1676
|
get: function () {
|
|
1514
|
-
var popupClasses = ['k-
|
|
1677
|
+
var popupClasses = ['k-menu-popup'];
|
|
1515
1678
|
if (this._popupSettings.popupClass) {
|
|
1516
1679
|
popupClasses.push(this._popupSettings.popupClass);
|
|
1517
1680
|
}
|
|
@@ -1871,11 +2034,12 @@ var NAVIGATION_SETTINGS_PROVIDER = {
|
|
|
1871
2034
|
*/
|
|
1872
2035
|
var SplitButtonComponent = /** @class */ (function (_super) {
|
|
1873
2036
|
__extends(SplitButtonComponent, _super);
|
|
1874
|
-
function SplitButtonComponent(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr) {
|
|
2037
|
+
function SplitButtonComponent(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, renderer) {
|
|
1875
2038
|
var _this = _super.call(this, focusService, navigationService, wrapperRef, zone, localization, cdr) || this;
|
|
1876
2039
|
_this.popupService = popupService;
|
|
1877
2040
|
_this.elRef = elRef;
|
|
1878
2041
|
_this.localization = localization;
|
|
2042
|
+
_this.renderer = renderer;
|
|
1879
2043
|
/**
|
|
1880
2044
|
* Sets the text of the SplitButton.
|
|
1881
2045
|
*/
|
|
@@ -1900,13 +2064,35 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
1900
2064
|
*/
|
|
1901
2065
|
_this.imageUrl = '';
|
|
1902
2066
|
/**
|
|
1903
|
-
*
|
|
2067
|
+
* The size property specifies the width and height of the SplitButton
|
|
2068
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-size)).
|
|
1904
2069
|
*
|
|
1905
|
-
* The
|
|
1906
|
-
* * `
|
|
1907
|
-
* * `
|
|
2070
|
+
* The possible values are:
|
|
2071
|
+
* * `'small'`
|
|
2072
|
+
* * `'medium'` (default)
|
|
2073
|
+
* * `'large'`
|
|
2074
|
+
* * `null`
|
|
2075
|
+
*/
|
|
2076
|
+
_this.size = 'medium';
|
|
2077
|
+
/**
|
|
2078
|
+
* The SplitButton allows you to specify predefined theme colors.
|
|
2079
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
2080
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-themeColor)).
|
|
2081
|
+
*
|
|
2082
|
+
* The possible values are:
|
|
2083
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
2084
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
2085
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
2086
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
2087
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
2088
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
2089
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
2090
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
2091
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
2092
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
2093
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
1908
2094
|
*/
|
|
1909
|
-
_this.
|
|
2095
|
+
_this.themeColor = 'base';
|
|
1910
2096
|
/**
|
|
1911
2097
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
1912
2098
|
*/
|
|
@@ -1984,17 +2170,62 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
1984
2170
|
* This event is preventable. If you cancel the event, the popup will remain open.
|
|
1985
2171
|
*/
|
|
1986
2172
|
_this.close = new EventEmitter();
|
|
1987
|
-
_this.listId = guid();
|
|
1988
2173
|
/**
|
|
1989
2174
|
* @hidden
|
|
1990
2175
|
*/
|
|
1991
2176
|
_this.activeArrow = false;
|
|
2177
|
+
_this.listId = guid();
|
|
1992
2178
|
_this.buttonText = '';
|
|
1993
2179
|
_this.lockFocus = false;
|
|
2180
|
+
_this._rounded = 'medium';
|
|
2181
|
+
_this._fillMode = "solid";
|
|
1994
2182
|
_this._itemClick = _this.itemClick;
|
|
1995
2183
|
_this._blur = _this.onBlur;
|
|
1996
2184
|
return _this;
|
|
1997
2185
|
}
|
|
2186
|
+
Object.defineProperty(SplitButtonComponent.prototype, "rounded", {
|
|
2187
|
+
get: function () {
|
|
2188
|
+
return this._rounded;
|
|
2189
|
+
},
|
|
2190
|
+
/**
|
|
2191
|
+
* The rounded property specifies the border radius of the SplitButton
|
|
2192
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
|
|
2193
|
+
*
|
|
2194
|
+
* The possible values are:
|
|
2195
|
+
* * `'small'`
|
|
2196
|
+
* * `'medium'` (default)
|
|
2197
|
+
* * `'large'`
|
|
2198
|
+
* * `'full'`
|
|
2199
|
+
* * `null`
|
|
2200
|
+
*/
|
|
2201
|
+
set: function (rounded) {
|
|
2202
|
+
this.handleClasses(rounded, 'rounded');
|
|
2203
|
+
this._rounded = rounded;
|
|
2204
|
+
},
|
|
2205
|
+
enumerable: true,
|
|
2206
|
+
configurable: true
|
|
2207
|
+
});
|
|
2208
|
+
Object.defineProperty(SplitButtonComponent.prototype, "fillMode", {
|
|
2209
|
+
get: function () {
|
|
2210
|
+
return this._fillMode;
|
|
2211
|
+
},
|
|
2212
|
+
/**
|
|
2213
|
+
* The fillMode property specifies the background and border styles of the SplitButton
|
|
2214
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-fillMode)).
|
|
2215
|
+
*
|
|
2216
|
+
* The available values are:
|
|
2217
|
+
* * `solid` (default)
|
|
2218
|
+
* * `flat`
|
|
2219
|
+
* * `outline`
|
|
2220
|
+
* * `link`
|
|
2221
|
+
*/
|
|
2222
|
+
set: function (fillMode) {
|
|
2223
|
+
// Temporary workaround for missing 'clear' styles
|
|
2224
|
+
this._fillMode = fillMode === 'clear' ? 'flat' : fillMode;
|
|
2225
|
+
},
|
|
2226
|
+
enumerable: true,
|
|
2227
|
+
configurable: true
|
|
2228
|
+
});
|
|
1998
2229
|
Object.defineProperty(SplitButtonComponent.prototype, "disabled", {
|
|
1999
2230
|
get: function () {
|
|
2000
2231
|
return this._disabled;
|
|
@@ -2108,20 +2339,6 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2108
2339
|
enumerable: true,
|
|
2109
2340
|
configurable: true
|
|
2110
2341
|
});
|
|
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';
|
|
2121
|
-
},
|
|
2122
|
-
enumerable: true,
|
|
2123
|
-
configurable: true
|
|
2124
|
-
});
|
|
2125
2342
|
Object.defineProperty(SplitButtonComponent.prototype, "widgetClasses", {
|
|
2126
2343
|
get: function () {
|
|
2127
2344
|
return true;
|
|
@@ -2220,6 +2437,7 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2220
2437
|
*/
|
|
2221
2438
|
SplitButtonComponent.prototype.ngAfterViewInit = function () {
|
|
2222
2439
|
this.updateButtonText();
|
|
2440
|
+
this.handleClasses(this.rounded, 'rounded');
|
|
2223
2441
|
};
|
|
2224
2442
|
/**
|
|
2225
2443
|
* @hidden
|
|
@@ -2386,6 +2604,16 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2386
2604
|
this.popupRef = null;
|
|
2387
2605
|
}
|
|
2388
2606
|
};
|
|
2607
|
+
SplitButtonComponent.prototype.handleClasses = function (value, input) {
|
|
2608
|
+
var elem = this.wrapperRef.nativeElement;
|
|
2609
|
+
var classes = getStylingClasses('button', input, this[input], value);
|
|
2610
|
+
if (classes.toRemove) {
|
|
2611
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
2612
|
+
}
|
|
2613
|
+
if (classes.toAdd) {
|
|
2614
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
2615
|
+
}
|
|
2616
|
+
};
|
|
2389
2617
|
__decorate([
|
|
2390
2618
|
Input(),
|
|
2391
2619
|
__metadata("design:type", String)
|
|
@@ -2409,7 +2637,21 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2409
2637
|
__decorate([
|
|
2410
2638
|
Input(),
|
|
2411
2639
|
__metadata("design:type", String)
|
|
2412
|
-
], SplitButtonComponent.prototype, "
|
|
2640
|
+
], SplitButtonComponent.prototype, "size", void 0);
|
|
2641
|
+
__decorate([
|
|
2642
|
+
Input(),
|
|
2643
|
+
__metadata("design:type", String),
|
|
2644
|
+
__metadata("design:paramtypes", [String])
|
|
2645
|
+
], SplitButtonComponent.prototype, "rounded", null);
|
|
2646
|
+
__decorate([
|
|
2647
|
+
Input(),
|
|
2648
|
+
__metadata("design:type", String),
|
|
2649
|
+
__metadata("design:paramtypes", [String])
|
|
2650
|
+
], SplitButtonComponent.prototype, "fillMode", null);
|
|
2651
|
+
__decorate([
|
|
2652
|
+
Input(),
|
|
2653
|
+
__metadata("design:type", String)
|
|
2654
|
+
], SplitButtonComponent.prototype, "themeColor", void 0);
|
|
2413
2655
|
__decorate([
|
|
2414
2656
|
Input(),
|
|
2415
2657
|
__metadata("design:type", Boolean),
|
|
@@ -2490,20 +2732,10 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2490
2732
|
__metadata("design:type", ViewContainerRef)
|
|
2491
2733
|
], SplitButtonComponent.prototype, "containerRef", void 0);
|
|
2492
2734
|
__decorate([
|
|
2493
|
-
HostBinding('class.k-
|
|
2735
|
+
HostBinding('class.k-focus'),
|
|
2494
2736
|
__metadata("design:type", Boolean),
|
|
2495
2737
|
__metadata("design:paramtypes", [Boolean])
|
|
2496
2738
|
], 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
2739
|
__decorate([
|
|
2508
2740
|
HostBinding('class.k-split-button'),
|
|
2509
2741
|
HostBinding('class.k-button-group'),
|
|
@@ -2547,7 +2779,7 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2547
2779
|
}
|
|
2548
2780
|
],
|
|
2549
2781
|
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 [
|
|
2782
|
+
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
2783
|
}),
|
|
2552
2784
|
__metadata("design:paramtypes", [FocusService,
|
|
2553
2785
|
NavigationService,
|
|
@@ -2556,7 +2788,8 @@ var SplitButtonComponent = /** @class */ (function (_super) {
|
|
|
2556
2788
|
PopupService,
|
|
2557
2789
|
ElementRef,
|
|
2558
2790
|
LocalizationService,
|
|
2559
|
-
ChangeDetectorRef
|
|
2791
|
+
ChangeDetectorRef,
|
|
2792
|
+
Renderer2])
|
|
2560
2793
|
], SplitButtonComponent);
|
|
2561
2794
|
return SplitButtonComponent;
|
|
2562
2795
|
}(ListButton));
|
|
@@ -2715,17 +2948,58 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
2715
2948
|
*/
|
|
2716
2949
|
_this.imageUrl = '';
|
|
2717
2950
|
/**
|
|
2718
|
-
*
|
|
2951
|
+
* The size property specifies the width and height of the DropDownButton
|
|
2952
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-size)).
|
|
2953
|
+
*
|
|
2954
|
+
* The possible values are:
|
|
2955
|
+
* * `'small'`
|
|
2956
|
+
* * `'medium'` (default)
|
|
2957
|
+
* * `'large'`
|
|
2958
|
+
* * `null`
|
|
2719
2959
|
*/
|
|
2720
|
-
_this.
|
|
2960
|
+
_this.size = 'medium';
|
|
2721
2961
|
/**
|
|
2722
|
-
*
|
|
2962
|
+
* The shape property specifies if the DropDownButton will be a square or rectangle.
|
|
2963
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-shape)).
|
|
2723
2964
|
*
|
|
2724
|
-
* The
|
|
2725
|
-
* * `
|
|
2726
|
-
* * `
|
|
2965
|
+
* The possible values are:
|
|
2966
|
+
* * `'rectangle'` (default)
|
|
2967
|
+
* * `'square'`
|
|
2968
|
+
* * `null`
|
|
2969
|
+
*/
|
|
2970
|
+
_this.shape = 'rectangle';
|
|
2971
|
+
/**
|
|
2972
|
+
* The rounded property specifies the border radius of the DropDownButton
|
|
2973
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-rounded)).
|
|
2974
|
+
*
|
|
2975
|
+
* The possible values are:
|
|
2976
|
+
* * `'small'`
|
|
2977
|
+
* * `'medium'` (default)
|
|
2978
|
+
* * `'large'`
|
|
2979
|
+
* * `'full'`
|
|
2980
|
+
* * `null`
|
|
2981
|
+
*/
|
|
2982
|
+
_this.rounded = 'medium';
|
|
2983
|
+
/**
|
|
2984
|
+
* The DropDownButton allows you to specify predefined theme colors.
|
|
2985
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
2986
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-themeColor)).
|
|
2987
|
+
*
|
|
2988
|
+
* The possible values are:
|
|
2989
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
2990
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
2991
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
2992
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
2993
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
2994
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
2995
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
2996
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
2997
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
2998
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
2999
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
3000
|
+
* * `null` —Removes the default CSS class (no class would be rendered).
|
|
2727
3001
|
*/
|
|
2728
|
-
_this.
|
|
3002
|
+
_this.themeColor = 'base';
|
|
2729
3003
|
/**
|
|
2730
3004
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
2731
3005
|
*/
|
|
@@ -2753,6 +3027,7 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
2753
3027
|
*/
|
|
2754
3028
|
_this.onBlur = new EventEmitter(); //tslint:disable-line:no-output-rename
|
|
2755
3029
|
_this.listId = guid();
|
|
3030
|
+
_this._fillMode = 'solid';
|
|
2756
3031
|
_this._itemClick = _this.itemClick;
|
|
2757
3032
|
_this._blur = _this.onBlur;
|
|
2758
3033
|
return _this;
|
|
@@ -2807,6 +3082,28 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
2807
3082
|
enumerable: true,
|
|
2808
3083
|
configurable: true
|
|
2809
3084
|
});
|
|
3085
|
+
Object.defineProperty(DropDownButtonComponent.prototype, "fillMode", {
|
|
3086
|
+
get: function () {
|
|
3087
|
+
return this._fillMode;
|
|
3088
|
+
},
|
|
3089
|
+
/**
|
|
3090
|
+
* The fillMode property specifies the background and border styles of the DropDownButton
|
|
3091
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-fillMode)).
|
|
3092
|
+
*
|
|
3093
|
+
* The available values are:
|
|
3094
|
+
* * `solid` (default)
|
|
3095
|
+
* * `flat`
|
|
3096
|
+
* * `outline`
|
|
3097
|
+
* * `link`
|
|
3098
|
+
* * `null`
|
|
3099
|
+
*/
|
|
3100
|
+
set: function (fillMode) {
|
|
3101
|
+
// Temporary workaround for missing 'clear' styles
|
|
3102
|
+
this._fillMode = fillMode === 'clear' ? 'flat' : fillMode;
|
|
3103
|
+
},
|
|
3104
|
+
enumerable: true,
|
|
3105
|
+
configurable: true
|
|
3106
|
+
});
|
|
2810
3107
|
Object.defineProperty(DropDownButtonComponent.prototype, "openState", {
|
|
2811
3108
|
/**
|
|
2812
3109
|
* @hidden
|
|
@@ -2864,20 +3161,6 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
2864
3161
|
enumerable: true,
|
|
2865
3162
|
configurable: true
|
|
2866
3163
|
});
|
|
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
3164
|
Object.defineProperty(DropDownButtonComponent.prototype, "widgetClasses", {
|
|
2882
3165
|
get: function () {
|
|
2883
3166
|
return true;
|
|
@@ -3155,12 +3438,25 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
3155
3438
|
], DropDownButtonComponent.prototype, "data", null);
|
|
3156
3439
|
__decorate([
|
|
3157
3440
|
Input(),
|
|
3158
|
-
__metadata("design:type",
|
|
3159
|
-
], DropDownButtonComponent.prototype, "
|
|
3441
|
+
__metadata("design:type", String)
|
|
3442
|
+
], DropDownButtonComponent.prototype, "size", void 0);
|
|
3443
|
+
__decorate([
|
|
3444
|
+
Input(),
|
|
3445
|
+
__metadata("design:type", String)
|
|
3446
|
+
], DropDownButtonComponent.prototype, "shape", void 0);
|
|
3447
|
+
__decorate([
|
|
3448
|
+
Input(),
|
|
3449
|
+
__metadata("design:type", String)
|
|
3450
|
+
], DropDownButtonComponent.prototype, "rounded", void 0);
|
|
3451
|
+
__decorate([
|
|
3452
|
+
Input(),
|
|
3453
|
+
__metadata("design:type", String),
|
|
3454
|
+
__metadata("design:paramtypes", [String])
|
|
3455
|
+
], DropDownButtonComponent.prototype, "fillMode", null);
|
|
3160
3456
|
__decorate([
|
|
3161
3457
|
Input(),
|
|
3162
3458
|
__metadata("design:type", String)
|
|
3163
|
-
], DropDownButtonComponent.prototype, "
|
|
3459
|
+
], DropDownButtonComponent.prototype, "themeColor", void 0);
|
|
3164
3460
|
__decorate([
|
|
3165
3461
|
Input(),
|
|
3166
3462
|
__metadata("design:type", Object)
|
|
@@ -3190,20 +3486,10 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
3190
3486
|
__metadata("design:type", EventEmitter)
|
|
3191
3487
|
], DropDownButtonComponent.prototype, "onBlur", void 0);
|
|
3192
3488
|
__decorate([
|
|
3193
|
-
HostBinding('class.k-
|
|
3489
|
+
HostBinding('class.k-focus'),
|
|
3194
3490
|
__metadata("design:type", Boolean),
|
|
3195
3491
|
__metadata("design:paramtypes", [])
|
|
3196
3492
|
], 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
3493
|
__decorate([
|
|
3208
3494
|
HostBinding('class.k-dropdown-button'),
|
|
3209
3495
|
__metadata("design:type", Boolean),
|
|
@@ -3278,7 +3564,7 @@ var DropDownButtonComponent = /** @class */ (function (_super) {
|
|
|
3278
3564
|
}
|
|
3279
3565
|
],
|
|
3280
3566
|
selector: 'kendo-dropdownbutton',
|
|
3281
|
-
template: "\n <button kendoButton #button\n role=\"menu\"\n type=\"button\"\n [tabindex]=\"componentTabIndex\"\n [class.k-
|
|
3567
|
+
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
3568
|
}),
|
|
3283
3569
|
__metadata("design:paramtypes", [FocusService,
|
|
3284
3570
|
NavigationService,
|
|
@@ -3322,38 +3608,20 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3322
3608
|
this.renderer = renderer;
|
|
3323
3609
|
this.ngZone = ngZone;
|
|
3324
3610
|
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
3611
|
/**
|
|
3336
3612
|
* Specifies the selected state of the Chip.
|
|
3613
|
+
* @default false
|
|
3337
3614
|
*/
|
|
3338
3615
|
this.selected = false;
|
|
3339
3616
|
/**
|
|
3340
3617
|
* Specifies if the Chip will be removable or not.
|
|
3341
3618
|
* If the property is set to `true`, the Chip renders a remove icon.
|
|
3619
|
+
* @default false
|
|
3342
3620
|
*/
|
|
3343
3621
|
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
3622
|
/**
|
|
3356
3623
|
* If set to `true`, the Chip will be disabled.
|
|
3624
|
+
* @default false
|
|
3357
3625
|
*/
|
|
3358
3626
|
this.disabled = false;
|
|
3359
3627
|
/**
|
|
@@ -3366,34 +3634,111 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3366
3634
|
this.contentClick = new EventEmitter();
|
|
3367
3635
|
this.tabIndex = 0;
|
|
3368
3636
|
this.hostClass = true;
|
|
3637
|
+
this._size = 'medium';
|
|
3638
|
+
this._rounded = 'medium';
|
|
3639
|
+
this._fillMode = 'solid';
|
|
3640
|
+
this._themeColor = 'base';
|
|
3369
3641
|
this.focused = false;
|
|
3370
3642
|
validatePackage(packageMetadata);
|
|
3371
3643
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
3372
3644
|
}
|
|
3373
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3645
|
+
Object.defineProperty(ChipComponent.prototype, "size", {
|
|
3374
3646
|
get: function () {
|
|
3375
|
-
return this.
|
|
3647
|
+
return this._size;
|
|
3648
|
+
},
|
|
3649
|
+
/**
|
|
3650
|
+
* The size property specifies the height, padding and line height of the Chip
|
|
3651
|
+
* ([see example]({% slug appearance_chip %}#toc-size)).
|
|
3652
|
+
*
|
|
3653
|
+
* The possible values are:
|
|
3654
|
+
* * `'small'`
|
|
3655
|
+
* * `'medium'` (default)
|
|
3656
|
+
* * `'large'`
|
|
3657
|
+
* * `null`
|
|
3658
|
+
*/
|
|
3659
|
+
set: function (size) {
|
|
3660
|
+
this.handleClasses(size, 'size');
|
|
3661
|
+
this._size = size;
|
|
3662
|
+
},
|
|
3663
|
+
enumerable: true,
|
|
3664
|
+
configurable: true
|
|
3665
|
+
});
|
|
3666
|
+
Object.defineProperty(ChipComponent.prototype, "rounded", {
|
|
3667
|
+
get: function () {
|
|
3668
|
+
return this._rounded;
|
|
3669
|
+
},
|
|
3670
|
+
/**
|
|
3671
|
+
* The rounded property specifies the border radius of the Chip
|
|
3672
|
+
* ([see example]({% slug appearance_chip %}#toc-rounded)).
|
|
3673
|
+
*
|
|
3674
|
+
* The possible values are:
|
|
3675
|
+
* * `'small'`
|
|
3676
|
+
* * `'medium'` (default)
|
|
3677
|
+
* * `'large'`
|
|
3678
|
+
* * `'full'`
|
|
3679
|
+
* * `null`
|
|
3680
|
+
*/
|
|
3681
|
+
set: function (rounded) {
|
|
3682
|
+
this.handleClasses(rounded, 'rounded');
|
|
3683
|
+
this._rounded = rounded;
|
|
3684
|
+
},
|
|
3685
|
+
enumerable: true,
|
|
3686
|
+
configurable: true
|
|
3687
|
+
});
|
|
3688
|
+
Object.defineProperty(ChipComponent.prototype, "fillMode", {
|
|
3689
|
+
get: function () {
|
|
3690
|
+
return this._fillMode;
|
|
3691
|
+
},
|
|
3692
|
+
/**
|
|
3693
|
+
* The fillMode property specifies the background and border styles of the Chip
|
|
3694
|
+
* ([see example]({% slug appearance_chip %}#toc-fillMode)).
|
|
3695
|
+
*
|
|
3696
|
+
* The possible values are:
|
|
3697
|
+
* * `'solid'` (default)
|
|
3698
|
+
* * `'outline'`
|
|
3699
|
+
* * `null`
|
|
3700
|
+
*/
|
|
3701
|
+
set: function (fillMode) {
|
|
3702
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
3703
|
+
this._fillMode = fillMode;
|
|
3376
3704
|
},
|
|
3377
3705
|
enumerable: true,
|
|
3378
3706
|
configurable: true
|
|
3379
3707
|
});
|
|
3380
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3708
|
+
Object.defineProperty(ChipComponent.prototype, "themeColor", {
|
|
3381
3709
|
get: function () {
|
|
3382
|
-
return this.
|
|
3710
|
+
return this._themeColor;
|
|
3711
|
+
},
|
|
3712
|
+
/**
|
|
3713
|
+
* The Chip allows you to specify predefined theme colors.
|
|
3714
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
3715
|
+
* ([see example]({% slug appearance_chip %}#toc-themeColor)).
|
|
3716
|
+
*
|
|
3717
|
+
* The possible values are:
|
|
3718
|
+
* * `'base'` (default)
|
|
3719
|
+
* * `'info'`
|
|
3720
|
+
* * `'success'`
|
|
3721
|
+
* * `'warning'`
|
|
3722
|
+
* * `'error'`
|
|
3723
|
+
* * `null`
|
|
3724
|
+
*/
|
|
3725
|
+
set: function (themeColor) {
|
|
3726
|
+
this.handleThemeColor(themeColor);
|
|
3727
|
+
this._themeColor = themeColor;
|
|
3383
3728
|
},
|
|
3384
3729
|
enumerable: true,
|
|
3385
3730
|
configurable: true
|
|
3386
3731
|
});
|
|
3387
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3732
|
+
Object.defineProperty(ChipComponent.prototype, "ariaChecked", {
|
|
3388
3733
|
get: function () {
|
|
3389
|
-
return this.
|
|
3734
|
+
return this.selected;
|
|
3390
3735
|
},
|
|
3391
3736
|
enumerable: true,
|
|
3392
3737
|
configurable: true
|
|
3393
3738
|
});
|
|
3394
3739
|
Object.defineProperty(ChipComponent.prototype, "hasIconClass", {
|
|
3395
3740
|
get: function () {
|
|
3396
|
-
return this.icon || this.iconClass ? true : false;
|
|
3741
|
+
return this.icon || this.iconClass || this.avatarClass ? true : false;
|
|
3397
3742
|
},
|
|
3398
3743
|
enumerable: true,
|
|
3399
3744
|
configurable: true
|
|
@@ -3436,44 +3781,48 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3436
3781
|
}
|
|
3437
3782
|
};
|
|
3438
3783
|
ChipComponent.prototype.ngAfterViewInit = function () {
|
|
3784
|
+
var _this = this;
|
|
3439
3785
|
var chip = this.element.nativeElement;
|
|
3440
|
-
var
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
}
|
|
3786
|
+
var stylingOptions = ['size', 'rounded', 'fillMode'];
|
|
3787
|
+
stylingOptions.forEach(function (input) {
|
|
3788
|
+
_this.handleClasses(_this[input], input);
|
|
3789
|
+
});
|
|
3444
3790
|
this.attachElementEventHandlers(chip);
|
|
3445
3791
|
};
|
|
3446
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3792
|
+
Object.defineProperty(ChipComponent.prototype, "kendoIconClass", {
|
|
3447
3793
|
/**
|
|
3448
3794
|
* @hidden
|
|
3449
3795
|
*/
|
|
3450
3796
|
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;
|
|
3797
|
+
this.verifyIconSettings([this.iconClass, this.avatarClass]);
|
|
3798
|
+
return "k-i-" + this.icon;
|
|
3459
3799
|
},
|
|
3460
3800
|
enumerable: true,
|
|
3461
3801
|
configurable: true
|
|
3462
3802
|
});
|
|
3463
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3803
|
+
Object.defineProperty(ChipComponent.prototype, "customIconClass", {
|
|
3464
3804
|
/**
|
|
3465
3805
|
* @hidden
|
|
3466
3806
|
*/
|
|
3467
3807
|
get: function () {
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3808
|
+
this.verifyIconSettings([this.icon, this.avatarClass]);
|
|
3809
|
+
return "" + this.iconClass;
|
|
3810
|
+
},
|
|
3811
|
+
enumerable: true,
|
|
3812
|
+
configurable: true
|
|
3813
|
+
});
|
|
3814
|
+
Object.defineProperty(ChipComponent.prototype, "chipAvatarClass", {
|
|
3815
|
+
/**
|
|
3816
|
+
* @hidden
|
|
3817
|
+
*/
|
|
3818
|
+
get: function () {
|
|
3819
|
+
this.verifyIconSettings([this.icon, this.iconClass]);
|
|
3820
|
+
return "" + this.avatarClass;
|
|
3472
3821
|
},
|
|
3473
3822
|
enumerable: true,
|
|
3474
3823
|
configurable: true
|
|
3475
3824
|
});
|
|
3476
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
3825
|
+
Object.defineProperty(ChipComponent.prototype, "removeIconClass", {
|
|
3477
3826
|
/**
|
|
3478
3827
|
* @hidden
|
|
3479
3828
|
*/
|
|
@@ -3481,23 +3830,11 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3481
3830
|
if (this.removeIcon) {
|
|
3482
3831
|
return "" + this.removeIcon;
|
|
3483
3832
|
}
|
|
3484
|
-
return "k-
|
|
3833
|
+
return "k-i-close-circle";
|
|
3485
3834
|
},
|
|
3486
3835
|
enumerable: true,
|
|
3487
3836
|
configurable: true
|
|
3488
3837
|
});
|
|
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
3838
|
/**
|
|
3502
3839
|
* Focuses the Chip component.
|
|
3503
3840
|
*/
|
|
@@ -3532,7 +3869,7 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3532
3869
|
_this.renderer.removeClass(chip, 'k-focus');
|
|
3533
3870
|
});
|
|
3534
3871
|
var contentClickListener = _this.renderer.listen(chip, 'click', function (e) {
|
|
3535
|
-
var isRemoveClicked = closest(e.target, '.k-remove-
|
|
3872
|
+
var isRemoveClicked = closest(e.target, '.k-chip-remove-action');
|
|
3536
3873
|
if (!isRemoveClicked) {
|
|
3537
3874
|
_this.ngZone.run(function () {
|
|
3538
3875
|
_this.contentClick.emit({ sender: _this, originalEvent: e });
|
|
@@ -3546,10 +3883,42 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3546
3883
|
};
|
|
3547
3884
|
});
|
|
3548
3885
|
};
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3886
|
+
/**
|
|
3887
|
+
* @hidden
|
|
3888
|
+
*/
|
|
3889
|
+
ChipComponent.prototype.verifyIconSettings = function (iconsToCheck) {
|
|
3890
|
+
if (isDevMode()) {
|
|
3891
|
+
if (iconsToCheck.filter(function (icon) { return icon !== null && icon !== undefined; }).length > 0) {
|
|
3892
|
+
this.renderer.removeClass(this.element.nativeElement, 'k-chip-has-icon');
|
|
3893
|
+
throw new Error('Invalid configuration: Having multiple icons is not supported. Only a single icon on a chip can be displayed.');
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
};
|
|
3897
|
+
ChipComponent.prototype.handleClasses = function (value, input) {
|
|
3898
|
+
var elem = this.element.nativeElement;
|
|
3899
|
+
var classes = getStylingClasses('chip', input, this[input], value);
|
|
3900
|
+
if (input === 'fillMode') {
|
|
3901
|
+
this.handleThemeColor(this.themeColor, this[input], value);
|
|
3902
|
+
}
|
|
3903
|
+
if (classes.toRemove) {
|
|
3904
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
3905
|
+
}
|
|
3906
|
+
if (classes.toAdd) {
|
|
3907
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
3908
|
+
}
|
|
3909
|
+
};
|
|
3910
|
+
ChipComponent.prototype.handleThemeColor = function (value, prevFillMode, fillMode) {
|
|
3911
|
+
var elem = this.element.nativeElement;
|
|
3912
|
+
var removeFillMode = prevFillMode ? prevFillMode : this.fillMode;
|
|
3913
|
+
var addFillMode = fillMode ? fillMode : this.fillMode;
|
|
3914
|
+
var themeColorClass = getThemeColorClasses('chip', removeFillMode, addFillMode, this.themeColor, value);
|
|
3915
|
+
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
3916
|
+
if (addFillMode !== null && fillMode !== null) {
|
|
3917
|
+
if (themeColorClass.toAdd) {
|
|
3918
|
+
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
3919
|
+
}
|
|
3920
|
+
}
|
|
3921
|
+
};
|
|
3553
3922
|
__decorate([
|
|
3554
3923
|
Input(),
|
|
3555
3924
|
__metadata("design:type", String)
|
|
@@ -3564,12 +3933,12 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3564
3933
|
], ChipComponent.prototype, "iconClass", void 0);
|
|
3565
3934
|
__decorate([
|
|
3566
3935
|
Input(),
|
|
3567
|
-
__metadata("design:type",
|
|
3568
|
-
], ChipComponent.prototype, "
|
|
3936
|
+
__metadata("design:type", String)
|
|
3937
|
+
], ChipComponent.prototype, "avatarClass", void 0);
|
|
3569
3938
|
__decorate([
|
|
3570
3939
|
Input(),
|
|
3571
|
-
__metadata("design:type",
|
|
3572
|
-
], ChipComponent.prototype, "
|
|
3940
|
+
__metadata("design:type", Boolean)
|
|
3941
|
+
], ChipComponent.prototype, "selected", void 0);
|
|
3573
3942
|
__decorate([
|
|
3574
3943
|
Input(),
|
|
3575
3944
|
__metadata("design:type", Boolean)
|
|
@@ -3578,14 +3947,30 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3578
3947
|
Input(),
|
|
3579
3948
|
__metadata("design:type", String)
|
|
3580
3949
|
], ChipComponent.prototype, "removeIcon", void 0);
|
|
3581
|
-
__decorate([
|
|
3582
|
-
Input(),
|
|
3583
|
-
__metadata("design:type", String)
|
|
3584
|
-
], ChipComponent.prototype, "type", void 0);
|
|
3585
3950
|
__decorate([
|
|
3586
3951
|
Input(),
|
|
3587
3952
|
__metadata("design:type", Boolean)
|
|
3588
3953
|
], ChipComponent.prototype, "disabled", void 0);
|
|
3954
|
+
__decorate([
|
|
3955
|
+
Input(),
|
|
3956
|
+
__metadata("design:type", String),
|
|
3957
|
+
__metadata("design:paramtypes", [String])
|
|
3958
|
+
], ChipComponent.prototype, "size", null);
|
|
3959
|
+
__decorate([
|
|
3960
|
+
Input(),
|
|
3961
|
+
__metadata("design:type", String),
|
|
3962
|
+
__metadata("design:paramtypes", [String])
|
|
3963
|
+
], ChipComponent.prototype, "rounded", null);
|
|
3964
|
+
__decorate([
|
|
3965
|
+
Input(),
|
|
3966
|
+
__metadata("design:type", String),
|
|
3967
|
+
__metadata("design:paramtypes", [String])
|
|
3968
|
+
], ChipComponent.prototype, "fillMode", null);
|
|
3969
|
+
__decorate([
|
|
3970
|
+
Input(),
|
|
3971
|
+
__metadata("design:type", String),
|
|
3972
|
+
__metadata("design:paramtypes", [String])
|
|
3973
|
+
], ChipComponent.prototype, "themeColor", null);
|
|
3589
3974
|
__decorate([
|
|
3590
3975
|
Output(),
|
|
3591
3976
|
__metadata("design:type", EventEmitter)
|
|
@@ -3607,16 +3992,6 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3607
3992
|
HostBinding('class.k-chip'),
|
|
3608
3993
|
__metadata("design:type", Boolean)
|
|
3609
3994
|
], 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
3995
|
__decorate([
|
|
3621
3996
|
HostBinding('class.k-chip-has-icon'),
|
|
3622
3997
|
__metadata("design:type", Boolean),
|
|
@@ -3645,7 +4020,7 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3645
4020
|
ChipComponent = __decorate([
|
|
3646
4021
|
Component({
|
|
3647
4022
|
selector: 'kendo-chip',
|
|
3648
|
-
template: "\n <span
|
|
4023
|
+
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
4024
|
providers: [
|
|
3650
4025
|
LocalizationService,
|
|
3651
4026
|
{
|
|
@@ -3663,9 +4038,10 @@ var ChipComponent = /** @class */ (function () {
|
|
|
3663
4038
|
}());
|
|
3664
4039
|
|
|
3665
4040
|
var ChipListComponent = /** @class */ (function () {
|
|
3666
|
-
function ChipListComponent(localizationService, renderer) {
|
|
4041
|
+
function ChipListComponent(localizationService, renderer, element) {
|
|
3667
4042
|
this.localizationService = localizationService;
|
|
3668
4043
|
this.renderer = renderer;
|
|
4044
|
+
this.element = element;
|
|
3669
4045
|
this.hostClass = true;
|
|
3670
4046
|
/**
|
|
3671
4047
|
* Sets the selection mode of the ChipList.
|
|
@@ -3685,8 +4061,31 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3685
4061
|
*/
|
|
3686
4062
|
this.remove = new EventEmitter();
|
|
3687
4063
|
this.role = 'listbox';
|
|
4064
|
+
this._size = 'medium';
|
|
4065
|
+
validatePackage(packageMetadata);
|
|
3688
4066
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
3689
4067
|
}
|
|
4068
|
+
Object.defineProperty(ChipListComponent.prototype, "size", {
|
|
4069
|
+
get: function () {
|
|
4070
|
+
return this._size;
|
|
4071
|
+
},
|
|
4072
|
+
/**
|
|
4073
|
+
* The size property specifies the gap between the Chips in the ChipList
|
|
4074
|
+
* ([see example]({% slug appearance_chiplist %}#toc-size)).
|
|
4075
|
+
*
|
|
4076
|
+
* The possible values are:
|
|
4077
|
+
* * `'small'`
|
|
4078
|
+
* * `'medium'` (default)
|
|
4079
|
+
* * `'large'`
|
|
4080
|
+
* * `null`
|
|
4081
|
+
*/
|
|
4082
|
+
set: function (size) {
|
|
4083
|
+
this.handleClasses(size, 'size');
|
|
4084
|
+
this._size = size;
|
|
4085
|
+
},
|
|
4086
|
+
enumerable: true,
|
|
4087
|
+
configurable: true
|
|
4088
|
+
});
|
|
3690
4089
|
Object.defineProperty(ChipListComponent.prototype, "single", {
|
|
3691
4090
|
get: function () {
|
|
3692
4091
|
return this.selection === 'single';
|
|
@@ -3706,7 +4105,7 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3706
4105
|
*/
|
|
3707
4106
|
ChipListComponent.prototype.onClick = function ($event) {
|
|
3708
4107
|
var target = $event.target;
|
|
3709
|
-
var isRemoveClicked = closest(target, '.k-remove-
|
|
4108
|
+
var isRemoveClicked = closest(target, '.k-chip-remove-action');
|
|
3710
4109
|
var clickedChip = closest(target, '.k-chip');
|
|
3711
4110
|
var chip = this.chips.find(function (chip) { return clickedChip === chip.element.nativeElement; });
|
|
3712
4111
|
if (isRemoveClicked && clickedChip) {
|
|
@@ -3725,6 +4124,13 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3725
4124
|
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
3726
4125
|
});
|
|
3727
4126
|
};
|
|
4127
|
+
ChipListComponent.prototype.ngAfterViewInit = function () {
|
|
4128
|
+
var _this = this;
|
|
4129
|
+
var stylingInputs = ['size'];
|
|
4130
|
+
stylingInputs.forEach(function (input) {
|
|
4131
|
+
_this.handleClasses(_this[input], input);
|
|
4132
|
+
});
|
|
4133
|
+
};
|
|
3728
4134
|
ChipListComponent.prototype.ngAfterContentInit = function () {
|
|
3729
4135
|
var _this = this;
|
|
3730
4136
|
this.chips.forEach(function (chip) {
|
|
@@ -3756,6 +4162,16 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3756
4162
|
}
|
|
3757
4163
|
});
|
|
3758
4164
|
};
|
|
4165
|
+
ChipListComponent.prototype.handleClasses = function (value, input) {
|
|
4166
|
+
var elem = this.element.nativeElement;
|
|
4167
|
+
var classes = getStylingClasses('chip-list', input, this[input], value);
|
|
4168
|
+
if (classes.toRemove) {
|
|
4169
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
4170
|
+
}
|
|
4171
|
+
if (classes.toAdd) {
|
|
4172
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
4173
|
+
}
|
|
4174
|
+
};
|
|
3759
4175
|
__decorate([
|
|
3760
4176
|
HostBinding('class.k-chip-list'),
|
|
3761
4177
|
__metadata("design:type", Boolean)
|
|
@@ -3768,6 +4184,11 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3768
4184
|
Input(),
|
|
3769
4185
|
__metadata("design:type", String)
|
|
3770
4186
|
], ChipListComponent.prototype, "selection", void 0);
|
|
4187
|
+
__decorate([
|
|
4188
|
+
Input(),
|
|
4189
|
+
__metadata("design:type", String),
|
|
4190
|
+
__metadata("design:paramtypes", [String])
|
|
4191
|
+
], ChipListComponent.prototype, "size", null);
|
|
3771
4192
|
__decorate([
|
|
3772
4193
|
Output(),
|
|
3773
4194
|
__metadata("design:type", EventEmitter)
|
|
@@ -3802,17 +4223,19 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
3802
4223
|
], ChipListComponent.prototype, "onClick", null);
|
|
3803
4224
|
ChipListComponent = __decorate([
|
|
3804
4225
|
Component({
|
|
3805
|
-
selector: 'kendo-
|
|
4226
|
+
selector: 'kendo-chiplist, kendo-chip-list',
|
|
3806
4227
|
template: "\n <ng-content></ng-content>\n ",
|
|
3807
4228
|
providers: [
|
|
3808
4229
|
LocalizationService,
|
|
3809
4230
|
{
|
|
3810
4231
|
provide: L10N_PREFIX,
|
|
3811
|
-
useValue: 'kendo.
|
|
4232
|
+
useValue: 'kendo.chiplist'
|
|
3812
4233
|
}
|
|
3813
4234
|
]
|
|
3814
4235
|
}),
|
|
3815
|
-
__metadata("design:paramtypes", [LocalizationService,
|
|
4236
|
+
__metadata("design:paramtypes", [LocalizationService,
|
|
4237
|
+
Renderer2,
|
|
4238
|
+
ElementRef])
|
|
3816
4239
|
], ChipListComponent);
|
|
3817
4240
|
return ChipListComponent;
|
|
3818
4241
|
}());
|
|
@@ -3981,12 +4404,16 @@ var SIZE_CLASSES = {
|
|
|
3981
4404
|
large: 'k-fab-lg'
|
|
3982
4405
|
};
|
|
3983
4406
|
var SHAPE_CLASSES = {
|
|
3984
|
-
pill: 'k-fab-pill',
|
|
3985
|
-
circle: 'k-fab-circle',
|
|
3986
4407
|
rectangle: 'k-fab-rectangle',
|
|
3987
|
-
square: 'k-fab-square'
|
|
3988
|
-
|
|
4408
|
+
square: 'k-fab-square'
|
|
4409
|
+
};
|
|
4410
|
+
var ROUNDED_CLASSES = {
|
|
4411
|
+
small: 'k-rounded-sm',
|
|
4412
|
+
medium: 'k-rounded-md',
|
|
4413
|
+
large: 'k-rounded-lg',
|
|
4414
|
+
full: 'k-rounded-full'
|
|
3989
4415
|
};
|
|
4416
|
+
var FILLMODE_CLASS = 'k-fab-solid';
|
|
3990
4417
|
var DEFAULT_DURATION = 180;
|
|
3991
4418
|
var DEFAULT_ITEM_GAP = 90;
|
|
3992
4419
|
var DEFAULT_OFFSET = '16px';
|
|
@@ -4067,13 +4494,15 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4067
4494
|
this.id = "k-" + guid();
|
|
4068
4495
|
this._themeColor = 'primary';
|
|
4069
4496
|
this._size = 'medium';
|
|
4070
|
-
this._shape = '
|
|
4497
|
+
this._shape = 'rectangle';
|
|
4071
4498
|
this._disabled = false;
|
|
4072
4499
|
this._align = { horizontal: 'end', vertical: 'bottom' };
|
|
4073
4500
|
this._offset = { x: DEFAULT_OFFSET, y: DEFAULT_OFFSET };
|
|
4501
|
+
this._rounded = 'full';
|
|
4074
4502
|
this.subscriptions = new Subscription();
|
|
4075
4503
|
this.rtl = false;
|
|
4076
4504
|
this.animationEnd = new EventEmitter();
|
|
4505
|
+
this.initialSetup = true;
|
|
4077
4506
|
validatePackage(packageMetadata);
|
|
4078
4507
|
this.subscribeNavigationEvents();
|
|
4079
4508
|
this.subscriptions.add(this.localizationService.changes.subscribe(function (_a) {
|
|
@@ -4106,18 +4535,16 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4106
4535
|
* The theme color will be applied as background color of the component.
|
|
4107
4536
|
*
|
|
4108
4537
|
* 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
|
-
*
|
|
4538
|
+
* * `'primary'` (Default)—Applies coloring based on the `primary` theme color.
|
|
4539
|
+
* * `'secondary'`—Applies coloring based on the `secondary` theme color.
|
|
4540
|
+
* * `'tertiary'`— Applies coloring based on the `tertiary` theme color.
|
|
4541
|
+
* * `'info'`—Applies coloring based on the `info` theme color.
|
|
4542
|
+
* * `'success'`— Applies coloring based on the `success` theme color.
|
|
4543
|
+
* * `'warning'`— Applies coloring based on the `warning` theme color.
|
|
4544
|
+
* * `'error'`— Applies coloring based on the `error` theme color.
|
|
4545
|
+
* * `'dark'`— Applies coloring based on the `dark` theme color.
|
|
4546
|
+
* * `'light'`— Applies coloring based on the `light` theme color.
|
|
4547
|
+
* * `'inverse'`— Applies coloring based on the `inverse` theme color.
|
|
4121
4548
|
*/
|
|
4122
4549
|
set: function (themeColor) {
|
|
4123
4550
|
this.handleClasses(themeColor, 'themeColor');
|
|
@@ -4135,10 +4562,9 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4135
4562
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-size)).
|
|
4136
4563
|
*
|
|
4137
4564
|
* The possible values are:
|
|
4138
|
-
* * `small`
|
|
4139
|
-
* * `medium` (Default)
|
|
4140
|
-
* * `large`
|
|
4141
|
-
*
|
|
4565
|
+
* * `'small'`
|
|
4566
|
+
* * `'medium'` (Default)
|
|
4567
|
+
* * `'large'`
|
|
4142
4568
|
*/
|
|
4143
4569
|
set: function (size) {
|
|
4144
4570
|
this.handleClasses(size, 'size');
|
|
@@ -4147,6 +4573,27 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4147
4573
|
enumerable: true,
|
|
4148
4574
|
configurable: true
|
|
4149
4575
|
});
|
|
4576
|
+
Object.defineProperty(FloatingActionButtonComponent.prototype, "rounded", {
|
|
4577
|
+
get: function () {
|
|
4578
|
+
return this._rounded;
|
|
4579
|
+
},
|
|
4580
|
+
/**
|
|
4581
|
+
* The rounded property specifies the border radius of the FloatingActionButton.
|
|
4582
|
+
*
|
|
4583
|
+
* The possible values are:
|
|
4584
|
+
* * `'small'`
|
|
4585
|
+
* * `'medium'`
|
|
4586
|
+
* * `'large'`
|
|
4587
|
+
* * `'full'` (default)
|
|
4588
|
+
* * `null`
|
|
4589
|
+
*/
|
|
4590
|
+
set: function (rounded) {
|
|
4591
|
+
this.handleClasses(rounded, 'rounded');
|
|
4592
|
+
this._rounded = rounded;
|
|
4593
|
+
},
|
|
4594
|
+
enumerable: true,
|
|
4595
|
+
configurable: true
|
|
4596
|
+
});
|
|
4150
4597
|
Object.defineProperty(FloatingActionButtonComponent.prototype, "shape", {
|
|
4151
4598
|
get: function () {
|
|
4152
4599
|
return this._shape;
|
|
@@ -4156,10 +4603,7 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4156
4603
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-shape)).
|
|
4157
4604
|
*
|
|
4158
4605
|
* 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.
|
|
4606
|
+
* * `rectangle` (Default)—Applies rectangular shape on the FloatingActionButton.
|
|
4163
4607
|
* * `square`—Applies square shape on the FloatingActionButton.
|
|
4164
4608
|
*
|
|
4165
4609
|
*/
|
|
@@ -4233,8 +4677,11 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4233
4677
|
configurable: true
|
|
4234
4678
|
});
|
|
4235
4679
|
FloatingActionButtonComponent.prototype.ngAfterViewInit = function () {
|
|
4236
|
-
this
|
|
4680
|
+
var _this = this;
|
|
4681
|
+
['shape', 'size', 'rounded', 'themeColor'].forEach(function (option) { return _this.handleClasses(_this[option], option); });
|
|
4682
|
+
this.renderer.addClass(this.element.nativeElement, this.alignClass());
|
|
4237
4683
|
this.offsetStyles();
|
|
4684
|
+
this.initialSetup = false;
|
|
4238
4685
|
};
|
|
4239
4686
|
FloatingActionButtonComponent.prototype.ngOnDestroy = function () {
|
|
4240
4687
|
this.subscriptions.unsubscribe();
|
|
@@ -4398,20 +4845,24 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4398
4845
|
this.toggleDialWithEvents(false);
|
|
4399
4846
|
};
|
|
4400
4847
|
FloatingActionButtonComponent.prototype.handleClasses = function (inputValue, input) {
|
|
4401
|
-
if (isPresent(this.button) && (this[input] !== inputValue)) {
|
|
4848
|
+
if (isPresent(this.button) && (this[input] !== inputValue || this.initialSetup)) {
|
|
4402
4849
|
var button = this.button.nativeElement;
|
|
4403
4850
|
var classesToRemove = {
|
|
4404
|
-
themeColor: "
|
|
4851
|
+
themeColor: FILLMODE_CLASS + "-" + this.themeColor,
|
|
4405
4852
|
size: SIZE_CLASSES[this.size],
|
|
4406
|
-
shape: SHAPE_CLASSES[this.shape]
|
|
4853
|
+
shape: SHAPE_CLASSES[this.shape],
|
|
4854
|
+
rounded: ROUNDED_CLASSES[this.rounded]
|
|
4407
4855
|
};
|
|
4408
4856
|
var classesToAdd = {
|
|
4409
|
-
themeColor: "
|
|
4857
|
+
themeColor: inputValue ? FILLMODE_CLASS + "-" + inputValue : null,
|
|
4410
4858
|
size: SIZE_CLASSES[inputValue],
|
|
4411
|
-
shape: SHAPE_CLASSES[inputValue]
|
|
4859
|
+
shape: SHAPE_CLASSES[inputValue],
|
|
4860
|
+
rounded: ROUNDED_CLASSES[inputValue]
|
|
4412
4861
|
};
|
|
4413
4862
|
this.renderer.removeClass(button, classesToRemove[input]);
|
|
4414
|
-
|
|
4863
|
+
if (classesToAdd[input]) {
|
|
4864
|
+
this.renderer.addClass(button, classesToAdd[input]);
|
|
4865
|
+
}
|
|
4415
4866
|
}
|
|
4416
4867
|
};
|
|
4417
4868
|
FloatingActionButtonComponent.prototype.onEnterPressed = function () {
|
|
@@ -4468,14 +4919,6 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4468
4919
|
FloatingActionButtonComponent.prototype.alignClass = function () {
|
|
4469
4920
|
return "k-pos-" + this.align.vertical + "-" + this.align.horizontal;
|
|
4470
4921
|
};
|
|
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
4922
|
FloatingActionButtonComponent.prototype.toggleDialWithEvents = function (open) {
|
|
4480
4923
|
if (open === this.isOpen) {
|
|
4481
4924
|
return;
|
|
@@ -4717,6 +5160,11 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4717
5160
|
__metadata("design:type", String),
|
|
4718
5161
|
__metadata("design:paramtypes", [String])
|
|
4719
5162
|
], FloatingActionButtonComponent.prototype, "size", null);
|
|
5163
|
+
__decorate([
|
|
5164
|
+
Input(),
|
|
5165
|
+
__metadata("design:type", String),
|
|
5166
|
+
__metadata("design:paramtypes", [String])
|
|
5167
|
+
], FloatingActionButtonComponent.prototype, "rounded", null);
|
|
4720
5168
|
__decorate([
|
|
4721
5169
|
Input(),
|
|
4722
5170
|
__metadata("design:type", String),
|
|
@@ -4806,7 +5254,7 @@ var FloatingActionButtonComponent = /** @class */ (function () {
|
|
|
4806
5254
|
useValue: 'kendo.floatingactionbutton'
|
|
4807
5255
|
}
|
|
4808
5256
|
],
|
|
4809
|
-
template: "\n <button\n #button\n [attr.id]=\"id\"\n [attr.role]=\"role\"\n [tabIndex]=\"componentTabIndex\"\n type=\"button\"\n
|
|
5257
|
+
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
5258
|
}),
|
|
4811
5259
|
__metadata("design:paramtypes", [Renderer2,
|
|
4812
5260
|
ElementRef,
|
|
@@ -4969,7 +5417,7 @@ var DialItemComponent = /** @class */ (function () {
|
|
|
4969
5417
|
], DialItemComponent.prototype, "role", void 0);
|
|
4970
5418
|
__decorate([
|
|
4971
5419
|
HostBinding('attr.aria-disabled'),
|
|
4972
|
-
HostBinding('class.k-
|
|
5420
|
+
HostBinding('class.k-disabled'),
|
|
4973
5421
|
__metadata("design:type", Boolean),
|
|
4974
5422
|
__metadata("design:paramtypes", [])
|
|
4975
5423
|
], DialItemComponent.prototype, "disabledClass", null);
|