@progress/kendo-angular-buttons 6.4.0-dev.202110280659 → 7.0.0-dev.202201061631
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-buttons.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/button/button.directive.js +239 -89
- package/dist/es/button/button.service.js +1 -5
- package/dist/es/buttongroup/buttongroup.component.js +1 -53
- package/dist/es/chip/chip-list.component.js +54 -7
- package/dist/es/chip/chip.component.js +175 -86
- package/dist/es/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/es/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/{es2015/button-look.js → es/common/models/styling-classes.js} +0 -0
- package/dist/es/{button-look.js → common/models.js} +0 -0
- package/dist/es/dropdownbutton/dropdownbutton.component.js +74 -33
- package/dist/es/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/es/focusable/focusable.directive.js +4 -4
- package/dist/es/listbutton/list-button.js +1 -1
- package/dist/es/listbutton/list.component.js +20 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/splitbutton/splitbutton.component.js +62 -29
- package/dist/es/util.js +52 -0
- package/dist/es2015/button/button.directive.d.ts +85 -22
- package/dist/es2015/button/button.directive.js +222 -85
- package/dist/es2015/button/button.service.d.ts +1 -4
- package/dist/es2015/button/button.service.js +1 -5
- package/dist/es2015/buttongroup/buttongroup.component.d.ts +0 -15
- package/dist/es2015/buttongroup/buttongroup.component.js +1 -41
- package/dist/es2015/chip/chip-list.component.d.ts +19 -3
- package/dist/es2015/chip/chip-list.component.js +49 -7
- package/dist/es2015/chip/chip.component.d.ts +67 -32
- package/dist/es2015/chip/chip.component.js +186 -97
- package/dist/es2015/common/models/fillmode.d.ts +12 -0
- package/dist/es2015/{chip/models/type.js → common/models/fillmode.js} +0 -0
- package/dist/es2015/common/models/rounded.d.ts +12 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/shape.d.ts +2 -9
- package/dist/es2015/common/models/size.d.ts +9 -6
- package/dist/es2015/common/models/styling-classes.d.ts +11 -0
- package/dist/es2015/common/models/styling-classes.js +4 -0
- package/dist/es2015/common/models/theme-color.d.ts +15 -4
- package/dist/es2015/common/models.d.ts +10 -0
- package/dist/es2015/{chip/models/chip-look.js → common/models.js} +0 -0
- package/dist/es2015/dropdownbutton/dropdownbutton.component.d.ts +58 -7
- package/dist/es2015/dropdownbutton/dropdownbutton.component.js +81 -28
- package/dist/es2015/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.d.ts +28 -21
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.js +62 -42
- package/dist/es2015/focusable/focusable.directive.js +4 -4
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/listbutton/list-button.js +1 -1
- package/dist/es2015/listbutton/list.component.d.ts +3 -0
- package/dist/es2015/listbutton/list.component.js +37 -20
- package/dist/es2015/main.d.ts +4 -4
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/splitbutton/splitbutton.component.d.ts +48 -5
- package/dist/es2015/splitbutton/splitbutton.component.js +76 -25
- package/dist/es2015/util.d.ts +21 -0
- package/dist/es2015/util.js +52 -0
- package/dist/fesm2015/index.js +809 -393
- package/dist/fesm5/index.js +795 -396
- package/dist/npm/button/button.directive.js +239 -89
- package/dist/npm/button/button.service.js +0 -4
- package/dist/npm/buttongroup/buttongroup.component.js +1 -53
- package/dist/npm/chip/chip-list.component.js +52 -5
- package/dist/npm/chip/chip.component.js +173 -84
- package/dist/npm/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/npm/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/npm/common/models/styling-classes.js +6 -0
- package/dist/npm/{button-look.js → common/models.js} +0 -0
- package/dist/npm/dropdownbutton/dropdownbutton.component.js +74 -33
- package/dist/npm/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/npm/focusable/focusable.directive.js +4 -4
- package/dist/npm/listbutton/list-button.js +1 -1
- package/dist/npm/listbutton/list.component.js +20 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/splitbutton/splitbutton.component.js +62 -29
- package/dist/npm/util.js +52 -0
- package/dist/systemjs/kendo-angular-buttons.js +1 -1
- package/package.json +17 -14
- 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/fesm2015/index.js
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { __decorate, __metadata, __param } from 'tslib';
|
|
6
6
|
import { Injectable, EventEmitter, Input, Output, 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
|
/**
|
|
@@ -21,16 +21,12 @@ let KendoButtonService = class KendoButtonService {
|
|
|
21
21
|
* @hidden
|
|
22
22
|
*/
|
|
23
23
|
constructor() {
|
|
24
|
-
this.buttonLookChange = new BehaviorSubject('default');
|
|
25
24
|
this.buttonClicked = new Subject();
|
|
26
25
|
this.buttonClicked$ = this.buttonClicked.asObservable();
|
|
27
26
|
}
|
|
28
27
|
click(button) {
|
|
29
28
|
this.buttonClicked.next(button);
|
|
30
29
|
}
|
|
31
|
-
setButtonLook(look) {
|
|
32
|
-
this.buttonLookChange.next(look);
|
|
33
|
-
}
|
|
34
30
|
};
|
|
35
31
|
KendoButtonService = __decorate([
|
|
36
32
|
Injectable()
|
|
@@ -43,11 +39,103 @@ const packageMetadata = {
|
|
|
43
39
|
name: '@progress/kendo-angular-buttons',
|
|
44
40
|
productName: 'Kendo UI for Angular',
|
|
45
41
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
46
|
-
publishDate:
|
|
42
|
+
publishDate: 1641486598,
|
|
47
43
|
version: '',
|
|
48
44
|
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'
|
|
49
45
|
};
|
|
50
46
|
|
|
47
|
+
/* tslint:disable:no-null-keyword */
|
|
48
|
+
/* tslint:disable:no-bitwise */
|
|
49
|
+
const resolvedPromise = Promise.resolve(null);
|
|
50
|
+
/**
|
|
51
|
+
* @hidden
|
|
52
|
+
*/
|
|
53
|
+
const isPresent = (value) => value !== null && value !== undefined;
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
const tick = (f) => (resolvedPromise.then(f));
|
|
58
|
+
/**
|
|
59
|
+
* @hidden
|
|
60
|
+
*/
|
|
61
|
+
function isDocumentNode(container) {
|
|
62
|
+
return container.nodeType === 9;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @hidden
|
|
66
|
+
*/
|
|
67
|
+
function closest(element, selector) {
|
|
68
|
+
if (element.closest) {
|
|
69
|
+
return element.closest(selector);
|
|
70
|
+
}
|
|
71
|
+
const matches = Element.prototype.matches ?
|
|
72
|
+
(el, sel) => el.matches(sel)
|
|
73
|
+
: (el, sel) => el.msMatchesSelector(sel);
|
|
74
|
+
let node = element;
|
|
75
|
+
while (node && !isDocumentNode(node)) {
|
|
76
|
+
if (matches(node, selector)) {
|
|
77
|
+
return node;
|
|
78
|
+
}
|
|
79
|
+
node = node.parentNode;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @hidden
|
|
84
|
+
*/
|
|
85
|
+
const replaceMessagePlaceholder = (message, name, value) => message.replace(new RegExp(`\{\\s*${name}\\s*\}`, 'g'), value);
|
|
86
|
+
/**
|
|
87
|
+
* @hidden
|
|
88
|
+
*/
|
|
89
|
+
const SIZES = {
|
|
90
|
+
small: 'sm',
|
|
91
|
+
medium: 'md',
|
|
92
|
+
large: 'lg'
|
|
93
|
+
};
|
|
94
|
+
const 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
|
+
const getStylingClasses = (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
|
+
const getThemeColorClasses = (componentType, prevFillMode, fillMode, previousValue, newValue) => {
|
|
133
|
+
return {
|
|
134
|
+
toRemove: `k-${componentType}-${prevFillMode}-${previousValue}`,
|
|
135
|
+
toAdd: newValue ? `k-${componentType}-${fillMode}-${newValue}` : null
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
|
|
51
139
|
const SPAN_TAG_NAME = 'SPAN';
|
|
52
140
|
/**
|
|
53
141
|
* Represents the Kendo UI Button component for Angular.
|
|
@@ -61,19 +149,6 @@ let ButtonDirective = class ButtonDirective {
|
|
|
61
149
|
* By default, `toggleable` is set to `false`.
|
|
62
150
|
*/
|
|
63
151
|
this.toggleable = false;
|
|
64
|
-
/**
|
|
65
|
-
* Adds visual weight to the Button and makes it primary.
|
|
66
|
-
*/
|
|
67
|
-
this.primary = false;
|
|
68
|
-
/**
|
|
69
|
-
* Changes the visual appearance by using alternative styling options
|
|
70
|
-
* ([more information and examples]({% slug appearance_button %})).
|
|
71
|
-
*
|
|
72
|
-
* The available values are:
|
|
73
|
-
* * [`ButtonLook`]({% slug api_buttons_buttonlook %}) = `flat` | `outline`
|
|
74
|
-
* * `clear`
|
|
75
|
-
*/
|
|
76
|
-
this.look = 'default';
|
|
77
152
|
/**
|
|
78
153
|
* @hidden
|
|
79
154
|
*/
|
|
@@ -91,12 +166,16 @@ let ButtonDirective = class ButtonDirective {
|
|
|
91
166
|
this.isDisabled = false;
|
|
92
167
|
this.isIcon = false;
|
|
93
168
|
this.isIconClass = false;
|
|
169
|
+
this._size = 'medium';
|
|
170
|
+
this._rounded = 'medium';
|
|
171
|
+
this._shape = 'rectangle';
|
|
172
|
+
this._fillMode = 'solid';
|
|
173
|
+
this._themeColor = 'base';
|
|
94
174
|
this._focused = false;
|
|
95
175
|
this.domEvents = [];
|
|
96
176
|
validatePackage(packageMetadata);
|
|
97
177
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
98
|
-
this.localizationChangeSubscription = localization.changes
|
|
99
|
-
.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr');
|
|
178
|
+
this.localizationChangeSubscription = localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr'));
|
|
100
179
|
this.element = element.nativeElement;
|
|
101
180
|
this.renderer = renderer;
|
|
102
181
|
}
|
|
@@ -140,7 +219,7 @@ let ButtonDirective = class ButtonDirective {
|
|
|
140
219
|
if (icon) {
|
|
141
220
|
this.iconSetter(icon, () => {
|
|
142
221
|
this.isIcon = true;
|
|
143
|
-
const classes = 'k-icon k-i-' + icon;
|
|
222
|
+
const classes = 'k-button-icon k-icon k-i-' + icon;
|
|
144
223
|
this.addIcon(classes);
|
|
145
224
|
});
|
|
146
225
|
}
|
|
@@ -157,7 +236,8 @@ let ButtonDirective = class ButtonDirective {
|
|
|
157
236
|
if (iconClassName) {
|
|
158
237
|
this.iconSetter(iconClassName, () => {
|
|
159
238
|
this.isIconClass = true;
|
|
160
|
-
|
|
239
|
+
const classes = 'k-button-icon k-icon ' + iconClassName;
|
|
240
|
+
this.addIcon(classes);
|
|
161
241
|
});
|
|
162
242
|
}
|
|
163
243
|
else {
|
|
@@ -187,8 +267,101 @@ let ButtonDirective = class ButtonDirective {
|
|
|
187
267
|
get disabled() {
|
|
188
268
|
return this.isDisabled;
|
|
189
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* The size property specifies the width and height of the Button
|
|
272
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-size)).
|
|
273
|
+
*
|
|
274
|
+
* The possible values are:
|
|
275
|
+
* * `'small'`
|
|
276
|
+
* * `'medium'` (default)
|
|
277
|
+
* * `'large'`
|
|
278
|
+
* * `null`
|
|
279
|
+
*/
|
|
280
|
+
set size(size) {
|
|
281
|
+
this.handleClasses(size, 'size');
|
|
282
|
+
this._size = size;
|
|
283
|
+
}
|
|
284
|
+
get size() {
|
|
285
|
+
return this._size;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* The rounded property specifies the border radius of the Button
|
|
289
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-rounded)).
|
|
290
|
+
*
|
|
291
|
+
* The possible values are:
|
|
292
|
+
* * `'small'`
|
|
293
|
+
* * `'medium'` (default)
|
|
294
|
+
* * `'large'`
|
|
295
|
+
* * `'full'`
|
|
296
|
+
* * `null`
|
|
297
|
+
*/
|
|
298
|
+
set rounded(rounded) {
|
|
299
|
+
this.handleClasses(rounded, 'rounded');
|
|
300
|
+
this._rounded = rounded;
|
|
301
|
+
}
|
|
302
|
+
get rounded() {
|
|
303
|
+
return this._rounded;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* The fillMode property specifies the background and border styles of the Button
|
|
307
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-fillMode)).
|
|
308
|
+
*
|
|
309
|
+
* The possible values are:
|
|
310
|
+
* * `'flat'`
|
|
311
|
+
* * `'solid'` (default)
|
|
312
|
+
* * `'outline'`
|
|
313
|
+
* * `'link'`
|
|
314
|
+
* * `null`
|
|
315
|
+
*/
|
|
316
|
+
set fillMode(fillMode) {
|
|
317
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
318
|
+
this._fillMode = fillMode;
|
|
319
|
+
}
|
|
320
|
+
get fillMode() {
|
|
321
|
+
return this._fillMode;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* The Button allows you to specify predefined theme colors.
|
|
325
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
326
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-themeColor)).
|
|
327
|
+
*
|
|
328
|
+
* The possible values are:
|
|
329
|
+
* * `'base'` (default)
|
|
330
|
+
* * `'primary'`
|
|
331
|
+
* * `'secondary'`
|
|
332
|
+
* * `'tertiary'`
|
|
333
|
+
* * `'info'`
|
|
334
|
+
* * `'success'`
|
|
335
|
+
* * `'warning'`
|
|
336
|
+
* * `'error'`
|
|
337
|
+
* * `'dark'`
|
|
338
|
+
* * `'light`'
|
|
339
|
+
* * `'inverse'`
|
|
340
|
+
*/
|
|
341
|
+
set themeColor(themeColor) {
|
|
342
|
+
this.handleThemeColor(themeColor);
|
|
343
|
+
this._themeColor = themeColor;
|
|
344
|
+
}
|
|
345
|
+
get themeColor() {
|
|
346
|
+
return this._themeColor;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* The shape property specifies if the Button will form a rectangle or square.
|
|
350
|
+
* ([see example]({% slug appearance_buttondirective %}#toc-shape)).
|
|
351
|
+
*
|
|
352
|
+
* The possible values are:
|
|
353
|
+
* * `'square'`
|
|
354
|
+
* * `'rectangle'` (default)
|
|
355
|
+
*/
|
|
356
|
+
set shape(shape) {
|
|
357
|
+
this.handleClasses(shape, 'shape');
|
|
358
|
+
this._shape = shape;
|
|
359
|
+
}
|
|
360
|
+
get shape() {
|
|
361
|
+
return this._shape;
|
|
362
|
+
}
|
|
190
363
|
set isFocused(isFocused) {
|
|
191
|
-
this.toggleClass('k-
|
|
364
|
+
this.toggleClass('k-focus', isFocused);
|
|
192
365
|
this._focused = isFocused;
|
|
193
366
|
}
|
|
194
367
|
get isFocused() {
|
|
@@ -197,24 +370,9 @@ let ButtonDirective = class ButtonDirective {
|
|
|
197
370
|
get classButton() {
|
|
198
371
|
return true;
|
|
199
372
|
}
|
|
200
|
-
get classPrimary() {
|
|
201
|
-
return this.primary;
|
|
202
|
-
}
|
|
203
373
|
get isToggleable() {
|
|
204
374
|
return this.toggleable;
|
|
205
375
|
}
|
|
206
|
-
get isFlat() {
|
|
207
|
-
return this.look === 'flat';
|
|
208
|
-
}
|
|
209
|
-
get isBare() {
|
|
210
|
-
return this.look === 'bare';
|
|
211
|
-
}
|
|
212
|
-
get isOutline() {
|
|
213
|
-
return this.look === 'outline';
|
|
214
|
-
}
|
|
215
|
-
get isClear() {
|
|
216
|
-
return this.look === 'clear';
|
|
217
|
-
}
|
|
218
376
|
get roleSetter() {
|
|
219
377
|
return this.role;
|
|
220
378
|
}
|
|
@@ -239,13 +397,31 @@ let ButtonDirective = class ButtonDirective {
|
|
|
239
397
|
onBlur() {
|
|
240
398
|
this.isFocused = false;
|
|
241
399
|
}
|
|
400
|
+
/**
|
|
401
|
+
* @hidden
|
|
402
|
+
*/
|
|
403
|
+
set primary(value) {
|
|
404
|
+
this.themeColor = value ? 'primary' : 'base';
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* @hidden
|
|
408
|
+
*/
|
|
409
|
+
set look(value) {
|
|
410
|
+
switch (value) {
|
|
411
|
+
case 'default':
|
|
412
|
+
this.fillMode = 'solid';
|
|
413
|
+
break;
|
|
414
|
+
case 'clear':
|
|
415
|
+
this.fillMode = 'link';
|
|
416
|
+
break;
|
|
417
|
+
default:
|
|
418
|
+
this.fillMode = value;
|
|
419
|
+
break;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
242
422
|
ngOnInit() {
|
|
243
423
|
const isSpan = this.element.tagName === SPAN_TAG_NAME;
|
|
244
|
-
|
|
245
|
-
this.buttonLookChangeSubscription = this.service.buttonLookChange
|
|
246
|
-
.pipe(filter((look) => look !== 'default'))
|
|
247
|
-
.subscribe((look) => this.look = look);
|
|
248
|
-
}
|
|
424
|
+
this.addTextSpan();
|
|
249
425
|
if (!this.element.hasAttribute('role') && this.togglable) {
|
|
250
426
|
this.toggleAriaPressed(this.toggleable);
|
|
251
427
|
}
|
|
@@ -255,7 +431,8 @@ let ButtonDirective = class ButtonDirective {
|
|
|
255
431
|
this.ngZone.runOutsideAngular(() => {
|
|
256
432
|
this.domEvents.push(this.renderer.listen(this.element, 'click', this._onButtonClick.bind(this)));
|
|
257
433
|
this.domEvents.push(this.renderer.listen(this.element, 'keydown', (event) => {
|
|
258
|
-
|
|
434
|
+
const isSpaceOrEnter = event.keyCode === Keys.Space || event.keyCode === Keys.Enter;
|
|
435
|
+
if (isSpan && isSpaceOrEnter) {
|
|
259
436
|
this.click.emit(event);
|
|
260
437
|
this._onButtonClick();
|
|
261
438
|
}
|
|
@@ -267,17 +444,21 @@ let ButtonDirective = class ButtonDirective {
|
|
|
267
444
|
this.toggleAriaPressed(this.toggleable);
|
|
268
445
|
}
|
|
269
446
|
}
|
|
447
|
+
ngAfterViewInit() {
|
|
448
|
+
const stylingOptions = ['size', 'rounded', 'shape', 'fillMode'];
|
|
449
|
+
stylingOptions.forEach(input => {
|
|
450
|
+
this.handleClasses(this[input], input);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
270
453
|
ngAfterViewChecked() {
|
|
271
454
|
this.setIconTextClasses();
|
|
272
455
|
}
|
|
273
456
|
ngOnDestroy() {
|
|
274
457
|
this.imageNode = null;
|
|
275
458
|
this.iconNode = null;
|
|
459
|
+
this.iconSpanNode = null;
|
|
276
460
|
this.renderer = null;
|
|
277
461
|
this.localizationChangeSubscription.unsubscribe();
|
|
278
|
-
if (this.service && this.buttonLookChangeSubscription) {
|
|
279
|
-
this.buttonLookChangeSubscription.unsubscribe();
|
|
280
|
-
}
|
|
281
462
|
clearTimeout(this.deferTimeout);
|
|
282
463
|
this.domEvents.forEach(unbindHandler => unbindHandler());
|
|
283
464
|
}
|
|
@@ -320,7 +501,7 @@ let ButtonDirective = class ButtonDirective {
|
|
|
320
501
|
const changed = this.selected !== value;
|
|
321
502
|
this.selected = value;
|
|
322
503
|
this.setAttribute('aria-pressed', this.selected.toString());
|
|
323
|
-
this.toggleClass('k-
|
|
504
|
+
this.toggleClass('k-selected', this.selected);
|
|
324
505
|
if (changed && hasObservers(this.selectedChange)) {
|
|
325
506
|
this.ngZone.run(() => {
|
|
326
507
|
this.selectedChange.emit(value);
|
|
@@ -340,14 +521,21 @@ let ButtonDirective = class ButtonDirective {
|
|
|
340
521
|
}
|
|
341
522
|
hasText() {
|
|
342
523
|
if (isDocumentAvailable()) {
|
|
343
|
-
return
|
|
524
|
+
return this.element.textContent.trim().length > 0;
|
|
344
525
|
}
|
|
345
526
|
else {
|
|
346
527
|
return false;
|
|
347
528
|
}
|
|
348
529
|
}
|
|
530
|
+
get text() {
|
|
531
|
+
if (isDocumentAvailable()) {
|
|
532
|
+
return this.element.innerHTML.trim();
|
|
533
|
+
}
|
|
534
|
+
}
|
|
349
535
|
addImgIcon(imageUrl) {
|
|
350
536
|
let renderer = this.renderer;
|
|
537
|
+
this.iconSpanNode = renderer.createElement('span');
|
|
538
|
+
renderer.setProperty(this.iconSpanNode, 'className', 'k-button-icon k-icon');
|
|
351
539
|
if (this.imageNode) {
|
|
352
540
|
renderer.setProperty(this.imageNode, 'src', imageUrl);
|
|
353
541
|
}
|
|
@@ -356,8 +544,9 @@ let ButtonDirective = class ButtonDirective {
|
|
|
356
544
|
renderer.setProperty(this.imageNode, 'src', imageUrl);
|
|
357
545
|
renderer.setProperty(this.imageNode, 'className', 'k-image');
|
|
358
546
|
renderer.setAttribute(this.imageNode, 'role', 'presentation');
|
|
359
|
-
this.prependChild(this.imageNode);
|
|
360
547
|
}
|
|
548
|
+
this.iconSpanNode.appendChild(this.imageNode);
|
|
549
|
+
this.prependChild(this.iconSpanNode);
|
|
361
550
|
}
|
|
362
551
|
addIcon(classNames) {
|
|
363
552
|
let renderer = this.renderer;
|
|
@@ -371,6 +560,11 @@ let ButtonDirective = class ButtonDirective {
|
|
|
371
560
|
this.prependChild(this.iconNode);
|
|
372
561
|
}
|
|
373
562
|
}
|
|
563
|
+
addTextSpan() {
|
|
564
|
+
if (isDocumentAvailable() && this.hasText()) {
|
|
565
|
+
this.element.innerHTML = `<span class='k-button-text'>${this.text}</span>`;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
374
568
|
prependChild(node) {
|
|
375
569
|
this.defer(() => {
|
|
376
570
|
if (this.renderer && node !== this.element.firstChild) {
|
|
@@ -392,7 +586,9 @@ let ButtonDirective = class ButtonDirective {
|
|
|
392
586
|
removeImageNode() {
|
|
393
587
|
if (this.imageNode && this.renderer.parentNode(this.imageNode)) {
|
|
394
588
|
this.renderer.removeChild(this.element, this.imageNode);
|
|
589
|
+
this.renderer.removeChild(this.element, this.iconSpanNode);
|
|
395
590
|
this.imageNode = null;
|
|
591
|
+
this.iconSpanNode = null;
|
|
396
592
|
}
|
|
397
593
|
}
|
|
398
594
|
removeIconNode() {
|
|
@@ -400,6 +596,10 @@ let ButtonDirective = class ButtonDirective {
|
|
|
400
596
|
this.renderer.removeChild(this.element, this.iconNode);
|
|
401
597
|
this.iconNode = null;
|
|
402
598
|
}
|
|
599
|
+
if (this.iconSpanNode) {
|
|
600
|
+
this.renderer.removeChild(this.element, this.iconSpanNode);
|
|
601
|
+
this.iconSpanNode = null;
|
|
602
|
+
}
|
|
403
603
|
}
|
|
404
604
|
updateIconNode() {
|
|
405
605
|
if (!this.isIcon && !this.isIconClass) {
|
|
@@ -408,9 +608,7 @@ let ButtonDirective = class ButtonDirective {
|
|
|
408
608
|
}
|
|
409
609
|
setIconTextClasses() {
|
|
410
610
|
const hasIcon = this.isIcon || this.isIconClass || this.imageNode;
|
|
411
|
-
|
|
412
|
-
this.toggleClass('k-button-icon', hasIcon && !hasText);
|
|
413
|
-
this.toggleClass('k-button-icontext', hasIcon && hasText);
|
|
611
|
+
this.toggleClass('k-icon-button', hasIcon && !this.hasText());
|
|
414
612
|
}
|
|
415
613
|
toggleClass(className, add) {
|
|
416
614
|
if (add) {
|
|
@@ -430,6 +628,31 @@ let ButtonDirective = class ButtonDirective {
|
|
|
430
628
|
this.setSelected(!this.selected);
|
|
431
629
|
}
|
|
432
630
|
}
|
|
631
|
+
handleClasses(value, input) {
|
|
632
|
+
const elem = this.element;
|
|
633
|
+
const classes = getStylingClasses('button', input, this[input], value);
|
|
634
|
+
if (input === 'fillMode') {
|
|
635
|
+
this.handleThemeColor(this.themeColor, this[input], value);
|
|
636
|
+
}
|
|
637
|
+
if (classes.toRemove) {
|
|
638
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
639
|
+
}
|
|
640
|
+
if (classes.toAdd) {
|
|
641
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
handleThemeColor(value, prevFillMode, fillMode) {
|
|
645
|
+
const elem = this.element;
|
|
646
|
+
const removeFillMode = prevFillMode ? prevFillMode : this.fillMode;
|
|
647
|
+
const addFillMode = fillMode ? fillMode : this.fillMode;
|
|
648
|
+
const themeColorClass = getThemeColorClasses('button', removeFillMode, addFillMode, this.themeColor, value);
|
|
649
|
+
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
650
|
+
if (addFillMode !== null && fillMode !== null) {
|
|
651
|
+
if (themeColorClass.toAdd) {
|
|
652
|
+
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
433
656
|
};
|
|
434
657
|
__decorate([
|
|
435
658
|
Input(),
|
|
@@ -440,14 +663,6 @@ __decorate([
|
|
|
440
663
|
__metadata("design:type", Boolean),
|
|
441
664
|
__metadata("design:paramtypes", [Boolean])
|
|
442
665
|
], ButtonDirective.prototype, "togglable", null);
|
|
443
|
-
__decorate([
|
|
444
|
-
Input(),
|
|
445
|
-
__metadata("design:type", Boolean)
|
|
446
|
-
], ButtonDirective.prototype, "primary", void 0);
|
|
447
|
-
__decorate([
|
|
448
|
-
Input(),
|
|
449
|
-
__metadata("design:type", String)
|
|
450
|
-
], ButtonDirective.prototype, "look", void 0);
|
|
451
666
|
__decorate([
|
|
452
667
|
Input(),
|
|
453
668
|
__metadata("design:type", Boolean),
|
|
@@ -478,6 +693,31 @@ __decorate([
|
|
|
478
693
|
__metadata("design:type", Boolean),
|
|
479
694
|
__metadata("design:paramtypes", [Boolean])
|
|
480
695
|
], ButtonDirective.prototype, "disabled", null);
|
|
696
|
+
__decorate([
|
|
697
|
+
Input(),
|
|
698
|
+
__metadata("design:type", String),
|
|
699
|
+
__metadata("design:paramtypes", [String])
|
|
700
|
+
], ButtonDirective.prototype, "size", null);
|
|
701
|
+
__decorate([
|
|
702
|
+
Input(),
|
|
703
|
+
__metadata("design:type", String),
|
|
704
|
+
__metadata("design:paramtypes", [String])
|
|
705
|
+
], ButtonDirective.prototype, "rounded", null);
|
|
706
|
+
__decorate([
|
|
707
|
+
Input(),
|
|
708
|
+
__metadata("design:type", String),
|
|
709
|
+
__metadata("design:paramtypes", [String])
|
|
710
|
+
], ButtonDirective.prototype, "fillMode", null);
|
|
711
|
+
__decorate([
|
|
712
|
+
Input(),
|
|
713
|
+
__metadata("design:type", String),
|
|
714
|
+
__metadata("design:paramtypes", [String])
|
|
715
|
+
], ButtonDirective.prototype, "themeColor", null);
|
|
716
|
+
__decorate([
|
|
717
|
+
Input(),
|
|
718
|
+
__metadata("design:type", String),
|
|
719
|
+
__metadata("design:paramtypes", [String])
|
|
720
|
+
], ButtonDirective.prototype, "shape", null);
|
|
481
721
|
__decorate([
|
|
482
722
|
Input(),
|
|
483
723
|
__metadata("design:type", String)
|
|
@@ -495,36 +735,11 @@ __decorate([
|
|
|
495
735
|
__metadata("design:type", Boolean),
|
|
496
736
|
__metadata("design:paramtypes", [])
|
|
497
737
|
], ButtonDirective.prototype, "classButton", null);
|
|
498
|
-
__decorate([
|
|
499
|
-
HostBinding('class.k-primary'),
|
|
500
|
-
__metadata("design:type", Boolean),
|
|
501
|
-
__metadata("design:paramtypes", [])
|
|
502
|
-
], ButtonDirective.prototype, "classPrimary", null);
|
|
503
738
|
__decorate([
|
|
504
739
|
HostBinding('class.k-toggle-button'),
|
|
505
740
|
__metadata("design:type", Boolean),
|
|
506
741
|
__metadata("design:paramtypes", [])
|
|
507
742
|
], ButtonDirective.prototype, "isToggleable", null);
|
|
508
|
-
__decorate([
|
|
509
|
-
HostBinding('class.k-flat'),
|
|
510
|
-
__metadata("design:type", Boolean),
|
|
511
|
-
__metadata("design:paramtypes", [])
|
|
512
|
-
], ButtonDirective.prototype, "isFlat", null);
|
|
513
|
-
__decorate([
|
|
514
|
-
HostBinding('class.k-bare'),
|
|
515
|
-
__metadata("design:type", Boolean),
|
|
516
|
-
__metadata("design:paramtypes", [])
|
|
517
|
-
], ButtonDirective.prototype, "isBare", null);
|
|
518
|
-
__decorate([
|
|
519
|
-
HostBinding('class.k-outline'),
|
|
520
|
-
__metadata("design:type", Boolean),
|
|
521
|
-
__metadata("design:paramtypes", [])
|
|
522
|
-
], ButtonDirective.prototype, "isOutline", null);
|
|
523
|
-
__decorate([
|
|
524
|
-
HostBinding('class.k-button-clear'),
|
|
525
|
-
__metadata("design:type", Boolean),
|
|
526
|
-
__metadata("design:paramtypes", [])
|
|
527
|
-
], ButtonDirective.prototype, "isClear", null);
|
|
528
743
|
__decorate([
|
|
529
744
|
HostBinding('attr.role'),
|
|
530
745
|
__metadata("design:type", String),
|
|
@@ -532,12 +747,12 @@ __decorate([
|
|
|
532
747
|
], ButtonDirective.prototype, "roleSetter", null);
|
|
533
748
|
__decorate([
|
|
534
749
|
HostBinding('attr.aria-disabled'),
|
|
535
|
-
HostBinding('class.k-
|
|
750
|
+
HostBinding('class.k-disabled'),
|
|
536
751
|
__metadata("design:type", Boolean),
|
|
537
752
|
__metadata("design:paramtypes", [])
|
|
538
753
|
], ButtonDirective.prototype, "classDisabled", null);
|
|
539
754
|
__decorate([
|
|
540
|
-
HostBinding('class.k-
|
|
755
|
+
HostBinding('class.k-selected'),
|
|
541
756
|
__metadata("design:type", Boolean),
|
|
542
757
|
__metadata("design:paramtypes", [])
|
|
543
758
|
], ButtonDirective.prototype, "classActive", null);
|
|
@@ -558,6 +773,16 @@ __decorate([
|
|
|
558
773
|
__metadata("design:paramtypes", []),
|
|
559
774
|
__metadata("design:returntype", void 0)
|
|
560
775
|
], ButtonDirective.prototype, "onBlur", null);
|
|
776
|
+
__decorate([
|
|
777
|
+
Input(),
|
|
778
|
+
__metadata("design:type", Boolean),
|
|
779
|
+
__metadata("design:paramtypes", [Boolean])
|
|
780
|
+
], ButtonDirective.prototype, "primary", null);
|
|
781
|
+
__decorate([
|
|
782
|
+
Input(),
|
|
783
|
+
__metadata("design:type", String),
|
|
784
|
+
__metadata("design:paramtypes", [String])
|
|
785
|
+
], ButtonDirective.prototype, "look", null);
|
|
561
786
|
ButtonDirective = __decorate([
|
|
562
787
|
Directive({
|
|
563
788
|
exportAs: 'kendoButton',
|
|
@@ -568,7 +793,7 @@ ButtonDirective = __decorate([
|
|
|
568
793
|
useValue: 'kendo.button'
|
|
569
794
|
}
|
|
570
795
|
],
|
|
571
|
-
selector: 'button[kendoButton], span[kendoButton]'
|
|
796
|
+
selector: 'button[kendoButton], span[kendoButton]',
|
|
572
797
|
}),
|
|
573
798
|
__param(2, Optional()),
|
|
574
799
|
__metadata("design:paramtypes", [ElementRef,
|
|
@@ -578,46 +803,6 @@ ButtonDirective = __decorate([
|
|
|
578
803
|
NgZone])
|
|
579
804
|
], ButtonDirective);
|
|
580
805
|
|
|
581
|
-
/* tslint:disable:no-null-keyword */
|
|
582
|
-
/* tslint:disable:no-bitwise */
|
|
583
|
-
const resolvedPromise = Promise.resolve(null);
|
|
584
|
-
/**
|
|
585
|
-
* @hidden
|
|
586
|
-
*/
|
|
587
|
-
const isPresent = (value) => value !== null && value !== undefined;
|
|
588
|
-
/**
|
|
589
|
-
* @hidden
|
|
590
|
-
*/
|
|
591
|
-
const tick = (f) => (resolvedPromise.then(f));
|
|
592
|
-
/**
|
|
593
|
-
* @hidden
|
|
594
|
-
*/
|
|
595
|
-
function isDocumentNode(container) {
|
|
596
|
-
return container.nodeType === 9;
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* @hidden
|
|
600
|
-
*/
|
|
601
|
-
function closest(element, selector) {
|
|
602
|
-
if (element.closest) {
|
|
603
|
-
return element.closest(selector);
|
|
604
|
-
}
|
|
605
|
-
const matches = Element.prototype.matches ?
|
|
606
|
-
(el, sel) => el.matches(sel)
|
|
607
|
-
: (el, sel) => el.msMatchesSelector(sel);
|
|
608
|
-
let node = element;
|
|
609
|
-
while (node && !isDocumentNode(node)) {
|
|
610
|
-
if (matches(node, selector)) {
|
|
611
|
-
return node;
|
|
612
|
-
}
|
|
613
|
-
node = node.parentNode;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
/**
|
|
617
|
-
* @hidden
|
|
618
|
-
*/
|
|
619
|
-
const replaceMessagePlaceholder = (message, name, value) => message.replace(new RegExp(`\{\\s*${name}\\s*\}`, 'g'), value);
|
|
620
|
-
|
|
621
806
|
/**
|
|
622
807
|
* @hidden
|
|
623
808
|
*/
|
|
@@ -657,17 +842,6 @@ let ButtonGroupComponent = class ButtonGroupComponent {
|
|
|
657
842
|
* By default, the selection mode of the ButtonGroup is set to `multiple`.
|
|
658
843
|
*/
|
|
659
844
|
this.selection = 'multiple';
|
|
660
|
-
/**
|
|
661
|
-
* Changes the visual appearance by using alternative styling options
|
|
662
|
-
* ([more information and examples]({% slug styling_buttongroup %})).
|
|
663
|
-
* The `look` property of the ButtonGroup takes precedence over the `look` property
|
|
664
|
-
* of the individual buttons that are part of the group.
|
|
665
|
-
*
|
|
666
|
-
* The available values are:
|
|
667
|
-
* * `flat`
|
|
668
|
-
* * `outline`
|
|
669
|
-
*/
|
|
670
|
-
this.look = 'default';
|
|
671
845
|
/**
|
|
672
846
|
* Fires every time keyboard navigation occurs.
|
|
673
847
|
*/
|
|
@@ -695,15 +869,6 @@ let ButtonGroupComponent = class ButtonGroupComponent {
|
|
|
695
869
|
get stretchedClass() {
|
|
696
870
|
return !!this.width;
|
|
697
871
|
}
|
|
698
|
-
get isFlat() {
|
|
699
|
-
return this.look === 'flat';
|
|
700
|
-
}
|
|
701
|
-
get isBare() {
|
|
702
|
-
return this.look === 'bare';
|
|
703
|
-
}
|
|
704
|
-
get isOutline() {
|
|
705
|
-
return this.look === 'outline';
|
|
706
|
-
}
|
|
707
872
|
get getRole() {
|
|
708
873
|
return this.isSelectionSingle() ? 'radiogroup' : 'group';
|
|
709
874
|
}
|
|
@@ -748,7 +913,6 @@ let ButtonGroupComponent = class ButtonGroupComponent {
|
|
|
748
913
|
}
|
|
749
914
|
}
|
|
750
915
|
ngOnInit() {
|
|
751
|
-
this.service.setButtonLook(this.look);
|
|
752
916
|
this.subscription = this.service.buttonClicked$.subscribe((button) => {
|
|
753
917
|
let newSelectionValue;
|
|
754
918
|
if (this.isSelectionSingle()) {
|
|
@@ -868,10 +1032,6 @@ __decorate([
|
|
|
868
1032
|
Input('width'),
|
|
869
1033
|
__metadata("design:type", String)
|
|
870
1034
|
], ButtonGroupComponent.prototype, "width", void 0);
|
|
871
|
-
__decorate([
|
|
872
|
-
Input(),
|
|
873
|
-
__metadata("design:type", String)
|
|
874
|
-
], ButtonGroupComponent.prototype, "look", void 0);
|
|
875
1035
|
__decorate([
|
|
876
1036
|
Input(),
|
|
877
1037
|
__metadata("design:type", Number),
|
|
@@ -891,7 +1051,7 @@ __decorate([
|
|
|
891
1051
|
__metadata("design:paramtypes", [])
|
|
892
1052
|
], ButtonGroupComponent.prototype, "wrapperClass", null);
|
|
893
1053
|
__decorate([
|
|
894
|
-
HostBinding('class.k-
|
|
1054
|
+
HostBinding('class.k-disabled'),
|
|
895
1055
|
__metadata("design:type", Boolean),
|
|
896
1056
|
__metadata("design:paramtypes", [])
|
|
897
1057
|
], ButtonGroupComponent.prototype, "disabledClass", null);
|
|
@@ -900,21 +1060,6 @@ __decorate([
|
|
|
900
1060
|
__metadata("design:type", Boolean),
|
|
901
1061
|
__metadata("design:paramtypes", [])
|
|
902
1062
|
], ButtonGroupComponent.prototype, "stretchedClass", null);
|
|
903
|
-
__decorate([
|
|
904
|
-
HostBinding('class.k-button-group-flat'),
|
|
905
|
-
__metadata("design:type", Boolean),
|
|
906
|
-
__metadata("design:paramtypes", [])
|
|
907
|
-
], ButtonGroupComponent.prototype, "isFlat", null);
|
|
908
|
-
__decorate([
|
|
909
|
-
HostBinding('class.k-button-group-bare'),
|
|
910
|
-
__metadata("design:type", Boolean),
|
|
911
|
-
__metadata("design:paramtypes", [])
|
|
912
|
-
], ButtonGroupComponent.prototype, "isBare", null);
|
|
913
|
-
__decorate([
|
|
914
|
-
HostBinding('class.k-button-group-outline'),
|
|
915
|
-
__metadata("design:type", Boolean),
|
|
916
|
-
__metadata("design:paramtypes", [])
|
|
917
|
-
], ButtonGroupComponent.prototype, "isOutline", null);
|
|
918
1063
|
__decorate([
|
|
919
1064
|
HostBinding('attr.role'),
|
|
920
1065
|
__metadata("design:type", String),
|
|
@@ -1104,8 +1249,17 @@ let ListComponent = class ListComponent {
|
|
|
1104
1249
|
constructor() {
|
|
1105
1250
|
this.onItemClick = new EventEmitter();
|
|
1106
1251
|
this.onItemBlur = new EventEmitter();
|
|
1252
|
+
this.sizeClass = '';
|
|
1107
1253
|
validatePackage(packageMetadata);
|
|
1108
1254
|
}
|
|
1255
|
+
set size(size) {
|
|
1256
|
+
if (size) {
|
|
1257
|
+
this.sizeClass = `k-menu-group-${SIZES[size]}`;
|
|
1258
|
+
}
|
|
1259
|
+
else {
|
|
1260
|
+
this.sizeClass = '';
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1109
1263
|
getText(dataItem) {
|
|
1110
1264
|
if (dataItem) {
|
|
1111
1265
|
return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
|
|
@@ -1145,37 +1299,44 @@ __decorate([
|
|
|
1145
1299
|
Output(),
|
|
1146
1300
|
__metadata("design:type", EventEmitter)
|
|
1147
1301
|
], ListComponent.prototype, "onItemBlur", void 0);
|
|
1302
|
+
__decorate([
|
|
1303
|
+
Input(),
|
|
1304
|
+
__metadata("design:type", String),
|
|
1305
|
+
__metadata("design:paramtypes", [String])
|
|
1306
|
+
], ListComponent.prototype, "size", null);
|
|
1148
1307
|
ListComponent = __decorate([
|
|
1149
1308
|
Component({
|
|
1150
1309
|
selector: 'kendo-button-list',
|
|
1151
1310
|
template: `
|
|
1152
|
-
<ul class="k-
|
|
1153
|
-
<li role="menuitem" unselectable="on"
|
|
1311
|
+
<ul class="k-group k-menu-group k-reset" [ngClass]="sizeClass" unselectable="on" role="menu">
|
|
1312
|
+
<li role="menuitem" unselectable="on"
|
|
1154
1313
|
kendoButtonFocusable
|
|
1155
1314
|
*ngFor="let dataItem of data; let index = index;"
|
|
1156
|
-
|
|
1157
|
-
[ngClass]="{'k-item': true, 'k-state-disabled': dataItem.disabled}"
|
|
1315
|
+
class="k-item k-menu-item"
|
|
1158
1316
|
(click)="onClick(index)"
|
|
1159
1317
|
(blur)="onBlur()"
|
|
1160
1318
|
[attr.aria-disabled]="dataItem.disabled ? true : false">
|
|
1161
|
-
<ng-template
|
|
1162
|
-
[
|
|
1163
|
-
templateRef: itemTemplate?.templateRef,
|
|
1164
|
-
|
|
1165
|
-
}">
|
|
1319
|
+
<ng-template [ngIf]="itemTemplate?.templateRef">
|
|
1320
|
+
<span kendoButtonFocusable [index]="index" class="k-link k-menu-link" [class.k-disabled]="dataItem.disabled" tabindex="-1">
|
|
1321
|
+
<ng-template [templateContext]="{templateRef: itemTemplate?.templateRef, $implicit: dataItem}"></ng-template>
|
|
1322
|
+
</span>
|
|
1166
1323
|
</ng-template>
|
|
1167
1324
|
<ng-template [ngIf]="!itemTemplate?.templateRef">
|
|
1168
|
-
<span
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1325
|
+
<span kendoButtonFocusable [index]="index" class="k-link k-menu-link" [class.k-disabled]="dataItem.disabled" tabindex="-1">
|
|
1326
|
+
<span
|
|
1327
|
+
*ngIf="dataItem.icon || dataItem.iconClass"
|
|
1328
|
+
[ngClass]="getIconClasses(dataItem)"
|
|
1329
|
+
></span>
|
|
1330
|
+
<img
|
|
1331
|
+
*ngIf="dataItem.imageUrl"
|
|
1332
|
+
class="k-image"
|
|
1333
|
+
[src]="dataItem.imageUrl"
|
|
1334
|
+
alt=""
|
|
1335
|
+
>
|
|
1336
|
+
<span *ngIf="getText(dataItem)" class="k-menu-link-text">
|
|
1337
|
+
{{ getText(dataItem) }}
|
|
1338
|
+
</span>
|
|
1339
|
+
</span>
|
|
1179
1340
|
</ng-template>
|
|
1180
1341
|
</li>
|
|
1181
1342
|
</ul>
|
|
@@ -1231,10 +1392,10 @@ let FocusableDirective = class FocusableDirective {
|
|
|
1231
1392
|
}
|
|
1232
1393
|
ngOnInit() {
|
|
1233
1394
|
if (this.index === this.focusService.focused) {
|
|
1234
|
-
this.renderer.addClass(this.element, 'k-
|
|
1395
|
+
this.renderer.addClass(this.element, 'k-focus');
|
|
1235
1396
|
}
|
|
1236
1397
|
else {
|
|
1237
|
-
this.renderer.removeClass(this.element, 'k-
|
|
1398
|
+
this.renderer.removeClass(this.element, 'k-focus');
|
|
1238
1399
|
}
|
|
1239
1400
|
}
|
|
1240
1401
|
/**
|
|
@@ -1249,11 +1410,11 @@ let FocusableDirective = class FocusableDirective {
|
|
|
1249
1410
|
}
|
|
1250
1411
|
this.focusSubscription = this.focusService.onFocus.subscribe((index) => {
|
|
1251
1412
|
if (this.index === index) {
|
|
1252
|
-
this.renderer.addClass(this.element, 'k-
|
|
1413
|
+
this.renderer.addClass(this.element, 'k-focus');
|
|
1253
1414
|
this.element.focus();
|
|
1254
1415
|
}
|
|
1255
1416
|
else {
|
|
1256
|
-
this.renderer.removeClass(this.element, 'k-
|
|
1417
|
+
this.renderer.removeClass(this.element, 'k-focus');
|
|
1257
1418
|
}
|
|
1258
1419
|
});
|
|
1259
1420
|
}
|
|
@@ -1375,7 +1536,7 @@ class ListButton {
|
|
|
1375
1536
|
this.subscribeEvents();
|
|
1376
1537
|
}
|
|
1377
1538
|
get popupClasses() {
|
|
1378
|
-
const popupClasses = ['k-
|
|
1539
|
+
const popupClasses = ['k-menu-popup'];
|
|
1379
1540
|
if (this._popupSettings.popupClass) {
|
|
1380
1541
|
popupClasses.push(this._popupSettings.popupClass);
|
|
1381
1542
|
}
|
|
@@ -1748,13 +1909,58 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
1748
1909
|
*/
|
|
1749
1910
|
this.imageUrl = '';
|
|
1750
1911
|
/**
|
|
1751
|
-
*
|
|
1912
|
+
* The size property specifies the width and height of the SplitButton
|
|
1913
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-size)).
|
|
1914
|
+
*
|
|
1915
|
+
* The possible values are:
|
|
1916
|
+
* * `'small'`
|
|
1917
|
+
* * `'medium'` (default)
|
|
1918
|
+
* * `'large'`
|
|
1919
|
+
* * `null`
|
|
1920
|
+
*/
|
|
1921
|
+
this.size = 'medium';
|
|
1922
|
+
/**
|
|
1923
|
+
* The rounded property specifies the border radius of the SplitButton
|
|
1924
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-rounded)).
|
|
1925
|
+
*
|
|
1926
|
+
* The possible values are:
|
|
1927
|
+
* * `'small'`
|
|
1928
|
+
* * `'medium'` (default)
|
|
1929
|
+
* * `'large'`
|
|
1930
|
+
* * `'full'`
|
|
1931
|
+
* * `null`
|
|
1932
|
+
*/
|
|
1933
|
+
this.rounded = 'medium';
|
|
1934
|
+
/**
|
|
1935
|
+
* The fillMode property specifies the background and border styles of the SplitButton
|
|
1936
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-fillMode)).
|
|
1752
1937
|
*
|
|
1753
1938
|
* The available values are:
|
|
1939
|
+
* * `solid` (default)
|
|
1754
1940
|
* * `flat`
|
|
1755
1941
|
* * `outline`
|
|
1942
|
+
* * `link`
|
|
1943
|
+
*/
|
|
1944
|
+
this.fillMode = 'solid';
|
|
1945
|
+
/**
|
|
1946
|
+
* The SplitButton allows you to specify predefined theme colors.
|
|
1947
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
1948
|
+
* ([see example]({% slug api_buttons_splitbuttoncomponent %}#toc-themeColor)).
|
|
1949
|
+
*
|
|
1950
|
+
* The possible values are:
|
|
1951
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
1952
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
1953
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
1954
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
1955
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
1956
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
1957
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
1958
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
1959
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
1960
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
1961
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
1756
1962
|
*/
|
|
1757
|
-
this.
|
|
1963
|
+
this.themeColor = 'base';
|
|
1758
1964
|
/**
|
|
1759
1965
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
1760
1966
|
*/
|
|
@@ -1927,12 +2133,6 @@ let SplitButtonComponent = class SplitButtonComponent extends ListButton {
|
|
|
1927
2133
|
get isFocused() {
|
|
1928
2134
|
return this._isFocused && !this._disabled;
|
|
1929
2135
|
}
|
|
1930
|
-
get isFlat() {
|
|
1931
|
-
return this.look === 'flat';
|
|
1932
|
-
}
|
|
1933
|
-
get isOutline() {
|
|
1934
|
-
return this.look === 'outline';
|
|
1935
|
-
}
|
|
1936
2136
|
get widgetClasses() {
|
|
1937
2137
|
return true;
|
|
1938
2138
|
}
|
|
@@ -2190,7 +2390,19 @@ __decorate([
|
|
|
2190
2390
|
__decorate([
|
|
2191
2391
|
Input(),
|
|
2192
2392
|
__metadata("design:type", String)
|
|
2193
|
-
], SplitButtonComponent.prototype, "
|
|
2393
|
+
], SplitButtonComponent.prototype, "size", void 0);
|
|
2394
|
+
__decorate([
|
|
2395
|
+
Input(),
|
|
2396
|
+
__metadata("design:type", String)
|
|
2397
|
+
], SplitButtonComponent.prototype, "rounded", void 0);
|
|
2398
|
+
__decorate([
|
|
2399
|
+
Input(),
|
|
2400
|
+
__metadata("design:type", String)
|
|
2401
|
+
], SplitButtonComponent.prototype, "fillMode", void 0);
|
|
2402
|
+
__decorate([
|
|
2403
|
+
Input(),
|
|
2404
|
+
__metadata("design:type", String)
|
|
2405
|
+
], SplitButtonComponent.prototype, "themeColor", void 0);
|
|
2194
2406
|
__decorate([
|
|
2195
2407
|
Input(),
|
|
2196
2408
|
__metadata("design:type", Boolean),
|
|
@@ -2271,20 +2483,10 @@ __decorate([
|
|
|
2271
2483
|
__metadata("design:type", ViewContainerRef)
|
|
2272
2484
|
], SplitButtonComponent.prototype, "containerRef", void 0);
|
|
2273
2485
|
__decorate([
|
|
2274
|
-
HostBinding('class.k-
|
|
2486
|
+
HostBinding('class.k-focus'),
|
|
2275
2487
|
__metadata("design:type", Boolean),
|
|
2276
2488
|
__metadata("design:paramtypes", [Boolean])
|
|
2277
2489
|
], SplitButtonComponent.prototype, "isFocused", null);
|
|
2278
|
-
__decorate([
|
|
2279
|
-
HostBinding('class.k-flat'),
|
|
2280
|
-
__metadata("design:type", Boolean),
|
|
2281
|
-
__metadata("design:paramtypes", [])
|
|
2282
|
-
], SplitButtonComponent.prototype, "isFlat", null);
|
|
2283
|
-
__decorate([
|
|
2284
|
-
HostBinding('class.k-outline'),
|
|
2285
|
-
__metadata("design:type", Boolean),
|
|
2286
|
-
__metadata("design:paramtypes", [])
|
|
2287
|
-
], SplitButtonComponent.prototype, "isOutline", null);
|
|
2288
2490
|
__decorate([
|
|
2289
2491
|
HostBinding('class.k-split-button'),
|
|
2290
2492
|
HostBinding('class.k-button-group'),
|
|
@@ -2337,11 +2539,15 @@ SplitButtonComponent = __decorate([
|
|
|
2337
2539
|
kendoButton
|
|
2338
2540
|
#button
|
|
2339
2541
|
[type]="type"
|
|
2340
|
-
[look]="look"
|
|
2341
2542
|
[tabindex]="componentTabIndex"
|
|
2342
2543
|
[disabled]="disabled"
|
|
2544
|
+
[size]="size"
|
|
2545
|
+
[rounded]="rounded"
|
|
2546
|
+
[fillMode]="fillMode"
|
|
2547
|
+
[themeColor]="themeColor"
|
|
2343
2548
|
[icon]="icon"
|
|
2344
|
-
[class.k-
|
|
2549
|
+
[class.k-active]="active"
|
|
2550
|
+
[class.k-icon-button]="!text && icon"
|
|
2345
2551
|
[iconClass]="iconClass"
|
|
2346
2552
|
[imageUrl]="imageUrl"
|
|
2347
2553
|
[ngClass]="buttonClass"
|
|
@@ -2356,16 +2562,21 @@ SplitButtonComponent = __decorate([
|
|
|
2356
2562
|
[attr.aria-owns]="listId"
|
|
2357
2563
|
[attr.aria-label]="ariaLabel"
|
|
2358
2564
|
>
|
|
2359
|
-
|
|
2565
|
+
<span *ngIf="text" class="k-button-text">
|
|
2566
|
+
{{ text }}
|
|
2567
|
+
</span><ng-content></ng-content>
|
|
2360
2568
|
</button>
|
|
2361
2569
|
<button
|
|
2362
2570
|
kendoButton
|
|
2363
2571
|
#arrowButton
|
|
2364
2572
|
type="button"
|
|
2365
|
-
[class.k-
|
|
2573
|
+
[class.k-active]="activeArrow"
|
|
2366
2574
|
[disabled]="disabled"
|
|
2367
2575
|
[icon]="arrowButtonIcon"
|
|
2368
|
-
[
|
|
2576
|
+
[size]="size"
|
|
2577
|
+
[rounded]="rounded"
|
|
2578
|
+
[fillMode]="fillMode"
|
|
2579
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
2369
2580
|
[tabindex]="-1"
|
|
2370
2581
|
[ngClass]="arrowButtonClass"
|
|
2371
2582
|
(click)="onArrowButtonClick()"
|
|
@@ -2383,6 +2594,7 @@ SplitButtonComponent = __decorate([
|
|
|
2383
2594
|
(keypress)="keyPressHandler($event)"
|
|
2384
2595
|
(keyup)="keyUpHandler($event)"
|
|
2385
2596
|
[attr.dir]="dir"
|
|
2597
|
+
[size]="size"
|
|
2386
2598
|
>
|
|
2387
2599
|
</kendo-button-list>
|
|
2388
2600
|
</ng-template>
|
|
@@ -2532,17 +2744,70 @@ let DropDownButtonComponent = class DropDownButtonComponent extends ListButton {
|
|
|
2532
2744
|
*/
|
|
2533
2745
|
this.imageUrl = '';
|
|
2534
2746
|
/**
|
|
2535
|
-
*
|
|
2747
|
+
* The size property specifies the width and height of the DropDownButton
|
|
2748
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-size)).
|
|
2749
|
+
*
|
|
2750
|
+
* The possible values are:
|
|
2751
|
+
* * `'small'`
|
|
2752
|
+
* * `'medium'` (default)
|
|
2753
|
+
* * `'large'`
|
|
2754
|
+
* * `null`
|
|
2536
2755
|
*/
|
|
2537
|
-
this.
|
|
2756
|
+
this.size = 'medium';
|
|
2538
2757
|
/**
|
|
2539
|
-
*
|
|
2758
|
+
* The shape property specifies if the DropDownButton will be a square or rectangle.
|
|
2759
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-shape)).
|
|
2760
|
+
*
|
|
2761
|
+
* The possible values are:
|
|
2762
|
+
* * `'rectangle'` (default)
|
|
2763
|
+
* * `'square'`
|
|
2764
|
+
* * `null`
|
|
2765
|
+
*/
|
|
2766
|
+
this.shape = 'rectangle';
|
|
2767
|
+
/**
|
|
2768
|
+
* The rounded property specifies the border radius of the DropDownButton
|
|
2769
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-rounded)).
|
|
2770
|
+
*
|
|
2771
|
+
* The possible values are:
|
|
2772
|
+
* * `'small'`
|
|
2773
|
+
* * `'medium'` (default)
|
|
2774
|
+
* * `'large'`
|
|
2775
|
+
* * `'full'`
|
|
2776
|
+
* * `null`
|
|
2777
|
+
*/
|
|
2778
|
+
this.rounded = 'medium';
|
|
2779
|
+
/**
|
|
2780
|
+
* The fillMode property specifies the background and border styles of the DropDownButton
|
|
2781
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-fillMode)).
|
|
2540
2782
|
*
|
|
2541
2783
|
* The available values are:
|
|
2784
|
+
* * `solid` (default)
|
|
2542
2785
|
* * `flat`
|
|
2543
2786
|
* * `outline`
|
|
2787
|
+
* * `link`
|
|
2788
|
+
* * `null`
|
|
2789
|
+
*/
|
|
2790
|
+
this.fillMode = 'solid';
|
|
2791
|
+
/**
|
|
2792
|
+
* The DropDownButton allows you to specify predefined theme colors.
|
|
2793
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
2794
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-themeColor)).
|
|
2795
|
+
*
|
|
2796
|
+
* The possible values are:
|
|
2797
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
2798
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
2799
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
2800
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
2801
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
2802
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
2803
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
2804
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
2805
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
2806
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
2807
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
2808
|
+
* * `null` —Removes the default CSS class (no class would be rendered).
|
|
2544
2809
|
*/
|
|
2545
|
-
this.
|
|
2810
|
+
this.themeColor = 'base';
|
|
2546
2811
|
/**
|
|
2547
2812
|
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
2548
2813
|
*/
|
|
@@ -2652,12 +2917,6 @@ let DropDownButtonComponent = class DropDownButtonComponent extends ListButton {
|
|
|
2652
2917
|
get focused() {
|
|
2653
2918
|
return this._isFocused && !this._disabled;
|
|
2654
2919
|
}
|
|
2655
|
-
get isFlat() {
|
|
2656
|
-
return this.look === 'flat';
|
|
2657
|
-
}
|
|
2658
|
-
get isOutline() {
|
|
2659
|
-
return this.look === 'outline';
|
|
2660
|
-
}
|
|
2661
2920
|
get widgetClasses() {
|
|
2662
2921
|
return true;
|
|
2663
2922
|
}
|
|
@@ -2910,12 +3169,24 @@ __decorate([
|
|
|
2910
3169
|
], DropDownButtonComponent.prototype, "data", null);
|
|
2911
3170
|
__decorate([
|
|
2912
3171
|
Input(),
|
|
2913
|
-
__metadata("design:type",
|
|
2914
|
-
], DropDownButtonComponent.prototype, "
|
|
3172
|
+
__metadata("design:type", String)
|
|
3173
|
+
], DropDownButtonComponent.prototype, "size", void 0);
|
|
3174
|
+
__decorate([
|
|
3175
|
+
Input(),
|
|
3176
|
+
__metadata("design:type", String)
|
|
3177
|
+
], DropDownButtonComponent.prototype, "shape", void 0);
|
|
3178
|
+
__decorate([
|
|
3179
|
+
Input(),
|
|
3180
|
+
__metadata("design:type", String)
|
|
3181
|
+
], DropDownButtonComponent.prototype, "rounded", void 0);
|
|
3182
|
+
__decorate([
|
|
3183
|
+
Input(),
|
|
3184
|
+
__metadata("design:type", String)
|
|
3185
|
+
], DropDownButtonComponent.prototype, "fillMode", void 0);
|
|
2915
3186
|
__decorate([
|
|
2916
3187
|
Input(),
|
|
2917
3188
|
__metadata("design:type", String)
|
|
2918
|
-
], DropDownButtonComponent.prototype, "
|
|
3189
|
+
], DropDownButtonComponent.prototype, "themeColor", void 0);
|
|
2919
3190
|
__decorate([
|
|
2920
3191
|
Input(),
|
|
2921
3192
|
__metadata("design:type", Object)
|
|
@@ -2945,20 +3216,10 @@ __decorate([
|
|
|
2945
3216
|
__metadata("design:type", EventEmitter)
|
|
2946
3217
|
], DropDownButtonComponent.prototype, "onBlur", void 0);
|
|
2947
3218
|
__decorate([
|
|
2948
|
-
HostBinding('class.k-
|
|
3219
|
+
HostBinding('class.k-focus'),
|
|
2949
3220
|
__metadata("design:type", Boolean),
|
|
2950
3221
|
__metadata("design:paramtypes", [])
|
|
2951
3222
|
], DropDownButtonComponent.prototype, "focused", null);
|
|
2952
|
-
__decorate([
|
|
2953
|
-
HostBinding('class.k-flat'),
|
|
2954
|
-
__metadata("design:type", Boolean),
|
|
2955
|
-
__metadata("design:paramtypes", [])
|
|
2956
|
-
], DropDownButtonComponent.prototype, "isFlat", null);
|
|
2957
|
-
__decorate([
|
|
2958
|
-
HostBinding('class.k-outline'),
|
|
2959
|
-
__metadata("design:type", Boolean),
|
|
2960
|
-
__metadata("design:paramtypes", [])
|
|
2961
|
-
], DropDownButtonComponent.prototype, "isOutline", null);
|
|
2962
3223
|
__decorate([
|
|
2963
3224
|
HostBinding('class.k-dropdown-button'),
|
|
2964
3225
|
__metadata("design:type", Boolean),
|
|
@@ -3038,12 +3299,17 @@ DropDownButtonComponent = __decorate([
|
|
|
3038
3299
|
role="menu"
|
|
3039
3300
|
type="button"
|
|
3040
3301
|
[tabindex]="componentTabIndex"
|
|
3041
|
-
[class.k-
|
|
3302
|
+
[class.k-active]="active"
|
|
3042
3303
|
[disabled]="disabled"
|
|
3043
3304
|
[icon]="icon"
|
|
3044
3305
|
[iconClass]="iconClass"
|
|
3045
3306
|
[imageUrl]="imageUrl"
|
|
3046
3307
|
[ngClass]="buttonClass"
|
|
3308
|
+
[size]="size"
|
|
3309
|
+
[shape]="shape"
|
|
3310
|
+
[rounded]="rounded"
|
|
3311
|
+
[fillMode]="fillMode"
|
|
3312
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
3047
3313
|
(click)="openPopup()"
|
|
3048
3314
|
(focus)="handleFocus()"
|
|
3049
3315
|
(blur)="onButtonBlur()"
|
|
@@ -3051,9 +3317,7 @@ DropDownButtonComponent = __decorate([
|
|
|
3051
3317
|
[attr.aria-expanded]="openState"
|
|
3052
3318
|
[attr.aria-haspopup]="true"
|
|
3053
3319
|
[attr.aria-owns]="listId"
|
|
3054
|
-
|
|
3055
|
-
[primary]="primary"
|
|
3056
|
-
>
|
|
3320
|
+
>
|
|
3057
3321
|
<ng-content></ng-content>
|
|
3058
3322
|
</button>
|
|
3059
3323
|
<ng-template #popupTemplate>
|
|
@@ -3068,6 +3332,7 @@ DropDownButtonComponent = __decorate([
|
|
|
3068
3332
|
(keypress)="keyPressHandler($event)"
|
|
3069
3333
|
(keyup)="keyUpHandler($event)"
|
|
3070
3334
|
[attr.dir]="dir"
|
|
3335
|
+
[size]="size"
|
|
3071
3336
|
>
|
|
3072
3337
|
</kendo-button-list>
|
|
3073
3338
|
</ng-template>
|
|
@@ -3111,38 +3376,20 @@ let ChipComponent = class ChipComponent {
|
|
|
3111
3376
|
this.renderer = renderer;
|
|
3112
3377
|
this.ngZone = ngZone;
|
|
3113
3378
|
this.localizationService = localizationService;
|
|
3114
|
-
/**
|
|
3115
|
-
* Changes the visual appearance by using alternative styling options.
|
|
3116
|
-
*
|
|
3117
|
-
* The available values are:
|
|
3118
|
-
* * `solid`
|
|
3119
|
-
* * `outline`
|
|
3120
|
-
* * `filled` (The `filled` option will be deprecated. To apply identical styling, use `solid` instead).
|
|
3121
|
-
* * `outlined` (The `outlined` option will be deprecated. To apply identical styling, use `outline` instead).
|
|
3122
|
-
*/
|
|
3123
|
-
this.look = 'solid';
|
|
3124
3379
|
/**
|
|
3125
3380
|
* Specifies the selected state of the Chip.
|
|
3381
|
+
* @default false
|
|
3126
3382
|
*/
|
|
3127
3383
|
this.selected = false;
|
|
3128
3384
|
/**
|
|
3129
3385
|
* Specifies if the Chip will be removable or not.
|
|
3130
3386
|
* If the property is set to `true`, the Chip renders a remove icon.
|
|
3387
|
+
* @default false
|
|
3131
3388
|
*/
|
|
3132
3389
|
this.removable = false;
|
|
3133
|
-
/**
|
|
3134
|
-
* Specifies the Chip type.
|
|
3135
|
-
*
|
|
3136
|
-
* The possible values are:
|
|
3137
|
-
* - `none` (default)
|
|
3138
|
-
* - `success`
|
|
3139
|
-
* - `error`
|
|
3140
|
-
* - `warning`
|
|
3141
|
-
* - `info`
|
|
3142
|
-
*/
|
|
3143
|
-
this.type = 'none';
|
|
3144
3390
|
/**
|
|
3145
3391
|
* If set to `true`, the Chip will be disabled.
|
|
3392
|
+
* @default false
|
|
3146
3393
|
*/
|
|
3147
3394
|
this.disabled = false;
|
|
3148
3395
|
/**
|
|
@@ -3155,21 +3402,90 @@ let ChipComponent = class ChipComponent {
|
|
|
3155
3402
|
this.contentClick = new EventEmitter();
|
|
3156
3403
|
this.tabIndex = 0;
|
|
3157
3404
|
this.hostClass = true;
|
|
3405
|
+
this._size = 'medium';
|
|
3406
|
+
this._rounded = 'medium';
|
|
3407
|
+
this._fillMode = 'solid';
|
|
3408
|
+
this._themeColor = 'base';
|
|
3158
3409
|
this.focused = false;
|
|
3159
3410
|
validatePackage(packageMetadata);
|
|
3160
3411
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
3161
3412
|
}
|
|
3162
|
-
|
|
3163
|
-
|
|
3413
|
+
/**
|
|
3414
|
+
* The size property specifies the height, padding and line height of the Chip
|
|
3415
|
+
* ([see example]({% slug appearance_chip %}#toc-size)).
|
|
3416
|
+
*
|
|
3417
|
+
* The possible values are:
|
|
3418
|
+
* * `'small'`
|
|
3419
|
+
* * `'medium'` (default)
|
|
3420
|
+
* * `'large'`
|
|
3421
|
+
* * `null`
|
|
3422
|
+
*/
|
|
3423
|
+
set size(size) {
|
|
3424
|
+
this.handleClasses(size, 'size');
|
|
3425
|
+
this._size = size;
|
|
3426
|
+
}
|
|
3427
|
+
get size() {
|
|
3428
|
+
return this._size;
|
|
3429
|
+
}
|
|
3430
|
+
/**
|
|
3431
|
+
* The rounded property specifies the border radius of the Chip
|
|
3432
|
+
* ([see example]({% slug appearance_chip %}#toc-rounded)).
|
|
3433
|
+
*
|
|
3434
|
+
* The possible values are:
|
|
3435
|
+
* * `'small'`
|
|
3436
|
+
* * `'medium'` (default)
|
|
3437
|
+
* * `'large'`
|
|
3438
|
+
* * `'full'`
|
|
3439
|
+
* * `null`
|
|
3440
|
+
*/
|
|
3441
|
+
set rounded(rounded) {
|
|
3442
|
+
this.handleClasses(rounded, 'rounded');
|
|
3443
|
+
this._rounded = rounded;
|
|
3444
|
+
}
|
|
3445
|
+
get rounded() {
|
|
3446
|
+
return this._rounded;
|
|
3447
|
+
}
|
|
3448
|
+
/**
|
|
3449
|
+
* The fillMode property specifies the background and border styles of the Chip
|
|
3450
|
+
* ([see example]({% slug appearance_chip %}#toc-fillMode)).
|
|
3451
|
+
*
|
|
3452
|
+
* The possible values are:
|
|
3453
|
+
* * `'solid'` (default)
|
|
3454
|
+
* * `'outline'`
|
|
3455
|
+
* * `null`
|
|
3456
|
+
*/
|
|
3457
|
+
set fillMode(fillMode) {
|
|
3458
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
3459
|
+
this._fillMode = fillMode;
|
|
3460
|
+
}
|
|
3461
|
+
get fillMode() {
|
|
3462
|
+
return this._fillMode;
|
|
3463
|
+
}
|
|
3464
|
+
/**
|
|
3465
|
+
* The Chip allows you to specify predefined theme colors.
|
|
3466
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
3467
|
+
* ([see example]({% slug appearance_chip %}#toc-themeColor)).
|
|
3468
|
+
*
|
|
3469
|
+
* The possible values are:
|
|
3470
|
+
* * `'base'` (default)
|
|
3471
|
+
* * `'info'`
|
|
3472
|
+
* * `'success'`
|
|
3473
|
+
* * `'warning'`
|
|
3474
|
+
* * `'error'`
|
|
3475
|
+
* * `null`
|
|
3476
|
+
*/
|
|
3477
|
+
set themeColor(themeColor) {
|
|
3478
|
+
this.handleThemeColor(themeColor);
|
|
3479
|
+
this._themeColor = themeColor;
|
|
3164
3480
|
}
|
|
3165
|
-
get
|
|
3166
|
-
return this.
|
|
3481
|
+
get themeColor() {
|
|
3482
|
+
return this._themeColor;
|
|
3167
3483
|
}
|
|
3168
|
-
get
|
|
3169
|
-
return this.
|
|
3484
|
+
get ariaChecked() {
|
|
3485
|
+
return this.selected;
|
|
3170
3486
|
}
|
|
3171
3487
|
get hasIconClass() {
|
|
3172
|
-
return this.icon || this.iconClass ? true : false;
|
|
3488
|
+
return this.icon || this.iconClass || this.avatarClass ? true : false;
|
|
3173
3489
|
}
|
|
3174
3490
|
get disabledClass() {
|
|
3175
3491
|
return this.disabled;
|
|
@@ -3194,54 +3510,41 @@ let ChipComponent = class ChipComponent {
|
|
|
3194
3510
|
}
|
|
3195
3511
|
ngAfterViewInit() {
|
|
3196
3512
|
const chip = this.element.nativeElement;
|
|
3197
|
-
const
|
|
3198
|
-
|
|
3199
|
-
this.
|
|
3200
|
-
}
|
|
3513
|
+
const stylingOptions = ['size', 'rounded', 'fillMode'];
|
|
3514
|
+
stylingOptions.forEach(input => {
|
|
3515
|
+
this.handleClasses(this[input], input);
|
|
3516
|
+
});
|
|
3201
3517
|
this.attachElementEventHandlers(chip);
|
|
3202
3518
|
}
|
|
3203
3519
|
/**
|
|
3204
3520
|
* @hidden
|
|
3205
3521
|
*/
|
|
3206
|
-
get
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
classes.push(`${this.iconClass}`);
|
|
3210
|
-
}
|
|
3211
|
-
if (this.icon) {
|
|
3212
|
-
classes.push(`k-icon k-i-${this.icon}`);
|
|
3213
|
-
}
|
|
3214
|
-
return classes;
|
|
3522
|
+
get kendoIconClass() {
|
|
3523
|
+
this.verifyIconSettings([this.iconClass, this.avatarClass]);
|
|
3524
|
+
return `k-i-${this.icon}`;
|
|
3215
3525
|
}
|
|
3216
3526
|
/**
|
|
3217
3527
|
* @hidden
|
|
3218
3528
|
*/
|
|
3219
|
-
get
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
}
|
|
3223
|
-
return `k-icon k-i-check`;
|
|
3529
|
+
get customIconClass() {
|
|
3530
|
+
this.verifyIconSettings([this.icon, this.avatarClass]);
|
|
3531
|
+
return `${this.iconClass}`;
|
|
3224
3532
|
}
|
|
3225
3533
|
/**
|
|
3226
3534
|
* @hidden
|
|
3227
3535
|
*/
|
|
3228
|
-
get
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
}
|
|
3232
|
-
return `k-icon k-i-close-circle`;
|
|
3536
|
+
get chipAvatarClass() {
|
|
3537
|
+
this.verifyIconSettings([this.icon, this.iconClass]);
|
|
3538
|
+
return `${this.avatarClass}`;
|
|
3233
3539
|
}
|
|
3234
3540
|
/**
|
|
3235
3541
|
* @hidden
|
|
3236
3542
|
*/
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
'error': 'k-chip-error',
|
|
3243
|
-
'info': 'k-chip-info'
|
|
3244
|
-
}[this.type];
|
|
3543
|
+
get removeIconClass() {
|
|
3544
|
+
if (this.removeIcon) {
|
|
3545
|
+
return `${this.removeIcon}`;
|
|
3546
|
+
}
|
|
3547
|
+
return `k-i-close-circle`;
|
|
3245
3548
|
}
|
|
3246
3549
|
/**
|
|
3247
3550
|
* Focuses the Chip component.
|
|
@@ -3276,7 +3579,7 @@ let ChipComponent = class ChipComponent {
|
|
|
3276
3579
|
this.renderer.removeClass(chip, 'k-focus');
|
|
3277
3580
|
});
|
|
3278
3581
|
const contentClickListener = this.renderer.listen(chip, 'click', (e) => {
|
|
3279
|
-
const isRemoveClicked = closest(e.target, '.k-remove-
|
|
3582
|
+
const isRemoveClicked = closest(e.target, '.k-chip-remove-action');
|
|
3280
3583
|
if (!isRemoveClicked) {
|
|
3281
3584
|
this.ngZone.run(() => {
|
|
3282
3585
|
this.contentClick.emit({ sender: this, originalEvent: e });
|
|
@@ -3290,11 +3593,43 @@ let ChipComponent = class ChipComponent {
|
|
|
3290
3593
|
};
|
|
3291
3594
|
});
|
|
3292
3595
|
}
|
|
3596
|
+
/**
|
|
3597
|
+
* @hidden
|
|
3598
|
+
*/
|
|
3599
|
+
verifyIconSettings(iconsToCheck) {
|
|
3600
|
+
if (isDevMode()) {
|
|
3601
|
+
if (iconsToCheck.filter(icon => icon !== null && icon !== undefined).length > 0) {
|
|
3602
|
+
this.renderer.removeClass(this.element.nativeElement, 'k-chip-has-icon');
|
|
3603
|
+
throw new Error('Invalid configuration: Having multiple icons is not supported. Only a single icon on a chip can be displayed.');
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
handleClasses(value, input) {
|
|
3608
|
+
const elem = this.element.nativeElement;
|
|
3609
|
+
const classes = getStylingClasses('chip', input, this[input], value);
|
|
3610
|
+
if (input === 'fillMode') {
|
|
3611
|
+
this.handleThemeColor(this.themeColor, this[input], value);
|
|
3612
|
+
}
|
|
3613
|
+
if (classes.toRemove) {
|
|
3614
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
3615
|
+
}
|
|
3616
|
+
if (classes.toAdd) {
|
|
3617
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
handleThemeColor(value, prevFillMode, fillMode) {
|
|
3621
|
+
const elem = this.element.nativeElement;
|
|
3622
|
+
const removeFillMode = prevFillMode ? prevFillMode : this.fillMode;
|
|
3623
|
+
const addFillMode = fillMode ? fillMode : this.fillMode;
|
|
3624
|
+
const themeColorClass = getThemeColorClasses('chip', removeFillMode, addFillMode, this.themeColor, value);
|
|
3625
|
+
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
3626
|
+
if (addFillMode !== null && fillMode !== null) {
|
|
3627
|
+
if (themeColorClass.toAdd) {
|
|
3628
|
+
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
}
|
|
3293
3632
|
};
|
|
3294
|
-
__decorate([
|
|
3295
|
-
Input(),
|
|
3296
|
-
__metadata("design:type", String)
|
|
3297
|
-
], ChipComponent.prototype, "look", void 0);
|
|
3298
3633
|
__decorate([
|
|
3299
3634
|
Input(),
|
|
3300
3635
|
__metadata("design:type", String)
|
|
@@ -3309,12 +3644,12 @@ __decorate([
|
|
|
3309
3644
|
], ChipComponent.prototype, "iconClass", void 0);
|
|
3310
3645
|
__decorate([
|
|
3311
3646
|
Input(),
|
|
3312
|
-
__metadata("design:type",
|
|
3313
|
-
], ChipComponent.prototype, "
|
|
3647
|
+
__metadata("design:type", String)
|
|
3648
|
+
], ChipComponent.prototype, "avatarClass", void 0);
|
|
3314
3649
|
__decorate([
|
|
3315
3650
|
Input(),
|
|
3316
|
-
__metadata("design:type",
|
|
3317
|
-
], ChipComponent.prototype, "
|
|
3651
|
+
__metadata("design:type", Boolean)
|
|
3652
|
+
], ChipComponent.prototype, "selected", void 0);
|
|
3318
3653
|
__decorate([
|
|
3319
3654
|
Input(),
|
|
3320
3655
|
__metadata("design:type", Boolean)
|
|
@@ -3323,14 +3658,30 @@ __decorate([
|
|
|
3323
3658
|
Input(),
|
|
3324
3659
|
__metadata("design:type", String)
|
|
3325
3660
|
], ChipComponent.prototype, "removeIcon", void 0);
|
|
3326
|
-
__decorate([
|
|
3327
|
-
Input(),
|
|
3328
|
-
__metadata("design:type", String)
|
|
3329
|
-
], ChipComponent.prototype, "type", void 0);
|
|
3330
3661
|
__decorate([
|
|
3331
3662
|
Input(),
|
|
3332
3663
|
__metadata("design:type", Boolean)
|
|
3333
3664
|
], ChipComponent.prototype, "disabled", void 0);
|
|
3665
|
+
__decorate([
|
|
3666
|
+
Input(),
|
|
3667
|
+
__metadata("design:type", String),
|
|
3668
|
+
__metadata("design:paramtypes", [String])
|
|
3669
|
+
], ChipComponent.prototype, "size", null);
|
|
3670
|
+
__decorate([
|
|
3671
|
+
Input(),
|
|
3672
|
+
__metadata("design:type", String),
|
|
3673
|
+
__metadata("design:paramtypes", [String])
|
|
3674
|
+
], ChipComponent.prototype, "rounded", null);
|
|
3675
|
+
__decorate([
|
|
3676
|
+
Input(),
|
|
3677
|
+
__metadata("design:type", String),
|
|
3678
|
+
__metadata("design:paramtypes", [String])
|
|
3679
|
+
], ChipComponent.prototype, "fillMode", null);
|
|
3680
|
+
__decorate([
|
|
3681
|
+
Input(),
|
|
3682
|
+
__metadata("design:type", String),
|
|
3683
|
+
__metadata("design:paramtypes", [String])
|
|
3684
|
+
], ChipComponent.prototype, "themeColor", null);
|
|
3334
3685
|
__decorate([
|
|
3335
3686
|
Output(),
|
|
3336
3687
|
__metadata("design:type", EventEmitter)
|
|
@@ -3352,16 +3703,6 @@ __decorate([
|
|
|
3352
3703
|
HostBinding('class.k-chip'),
|
|
3353
3704
|
__metadata("design:type", Boolean)
|
|
3354
3705
|
], ChipComponent.prototype, "hostClass", void 0);
|
|
3355
|
-
__decorate([
|
|
3356
|
-
HostBinding('class.k-chip-outline'),
|
|
3357
|
-
__metadata("design:type", Boolean),
|
|
3358
|
-
__metadata("design:paramtypes", [])
|
|
3359
|
-
], ChipComponent.prototype, "outlineClass", null);
|
|
3360
|
-
__decorate([
|
|
3361
|
-
HostBinding('class.k-chip-solid'),
|
|
3362
|
-
__metadata("design:type", Boolean),
|
|
3363
|
-
__metadata("design:paramtypes", [])
|
|
3364
|
-
], ChipComponent.prototype, "solidClass", null);
|
|
3365
3706
|
__decorate([
|
|
3366
3707
|
HostBinding('class.k-chip-has-icon'),
|
|
3367
3708
|
__metadata("design:type", Boolean),
|
|
@@ -3391,20 +3732,27 @@ ChipComponent = __decorate([
|
|
|
3391
3732
|
Component({
|
|
3392
3733
|
selector: 'kendo-chip',
|
|
3393
3734
|
template: `
|
|
3394
|
-
<span
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
</span>
|
|
3735
|
+
<span
|
|
3736
|
+
*ngIf="icon"
|
|
3737
|
+
class="k-chip-icon k-icon"
|
|
3738
|
+
[ngClass]="kendoIconClass"
|
|
3739
|
+
>
|
|
3400
3740
|
</span>
|
|
3401
3741
|
|
|
3402
|
-
<span
|
|
3742
|
+
<span
|
|
3743
|
+
*ngIf="iconClass"
|
|
3403
3744
|
class="k-chip-icon"
|
|
3404
|
-
[ngClass]="
|
|
3745
|
+
[ngClass]="customIconClass"
|
|
3405
3746
|
>
|
|
3406
3747
|
</span>
|
|
3407
3748
|
|
|
3749
|
+
<span
|
|
3750
|
+
*ngIf="avatarClass"
|
|
3751
|
+
class="k-chip-avatar k-avatar k-rounded-full"
|
|
3752
|
+
>
|
|
3753
|
+
<span class="k-avatar-image" [ngClass]="chipAvatarClass"></span>
|
|
3754
|
+
</span>
|
|
3755
|
+
|
|
3408
3756
|
<span class="k-chip-content">
|
|
3409
3757
|
<span class="k-chip-label" *ngIf="label">
|
|
3410
3758
|
{{ label }}
|
|
@@ -3412,11 +3760,17 @@ ChipComponent = __decorate([
|
|
|
3412
3760
|
<ng-content *ngIf="!label"></ng-content>
|
|
3413
3761
|
</span>
|
|
3414
3762
|
|
|
3415
|
-
<span
|
|
3416
|
-
class="k-remove-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3763
|
+
<span class="k-chip-actions">
|
|
3764
|
+
<span class="k-chip-action k-chip-remove-action"
|
|
3765
|
+
*ngIf="removable"
|
|
3766
|
+
(click)="onRemoveClick($event)"
|
|
3767
|
+
>
|
|
3768
|
+
<span
|
|
3769
|
+
class="k-icon"
|
|
3770
|
+
[ngClass]="removeIconClass"
|
|
3771
|
+
>
|
|
3772
|
+
</span>
|
|
3773
|
+
</span>
|
|
3420
3774
|
</span>
|
|
3421
3775
|
`,
|
|
3422
3776
|
providers: [
|
|
@@ -3434,9 +3788,10 @@ ChipComponent = __decorate([
|
|
|
3434
3788
|
], ChipComponent);
|
|
3435
3789
|
|
|
3436
3790
|
let ChipListComponent = class ChipListComponent {
|
|
3437
|
-
constructor(localizationService, renderer) {
|
|
3791
|
+
constructor(localizationService, renderer, element) {
|
|
3438
3792
|
this.localizationService = localizationService;
|
|
3439
3793
|
this.renderer = renderer;
|
|
3794
|
+
this.element = element;
|
|
3440
3795
|
this.hostClass = true;
|
|
3441
3796
|
/**
|
|
3442
3797
|
* Sets the selection mode of the ChipList.
|
|
@@ -3456,8 +3811,26 @@ let ChipListComponent = class ChipListComponent {
|
|
|
3456
3811
|
*/
|
|
3457
3812
|
this.remove = new EventEmitter();
|
|
3458
3813
|
this.role = 'listbox';
|
|
3814
|
+
this._size = 'medium';
|
|
3459
3815
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
3460
3816
|
}
|
|
3817
|
+
/**
|
|
3818
|
+
* The size property specifies the gap between the Chips in the ChipList
|
|
3819
|
+
* ([see example]({% slug appearance_chiplist %}#toc-size)).
|
|
3820
|
+
*
|
|
3821
|
+
* The possible values are:
|
|
3822
|
+
* * `'small'`
|
|
3823
|
+
* * `'medium'` (default)
|
|
3824
|
+
* * `'large'`
|
|
3825
|
+
* * `null`
|
|
3826
|
+
*/
|
|
3827
|
+
set size(size) {
|
|
3828
|
+
this.handleClasses(size, 'size');
|
|
3829
|
+
this._size = size;
|
|
3830
|
+
}
|
|
3831
|
+
get size() {
|
|
3832
|
+
return this._size;
|
|
3833
|
+
}
|
|
3461
3834
|
get single() {
|
|
3462
3835
|
return this.selection === 'single';
|
|
3463
3836
|
}
|
|
@@ -3469,7 +3842,7 @@ let ChipListComponent = class ChipListComponent {
|
|
|
3469
3842
|
*/
|
|
3470
3843
|
onClick($event) {
|
|
3471
3844
|
const target = $event.target;
|
|
3472
|
-
const isRemoveClicked = closest(target, '.k-remove-
|
|
3845
|
+
const isRemoveClicked = closest(target, '.k-chip-remove-action');
|
|
3473
3846
|
const clickedChip = closest(target, '.k-chip');
|
|
3474
3847
|
const chip = this.chips.find((chip) => clickedChip === chip.element.nativeElement);
|
|
3475
3848
|
if (isRemoveClicked && clickedChip) {
|
|
@@ -3484,6 +3857,12 @@ let ChipListComponent = class ChipListComponent {
|
|
|
3484
3857
|
this.dynamicRTLSubscription = this.localizationService.changes
|
|
3485
3858
|
.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr');
|
|
3486
3859
|
}
|
|
3860
|
+
ngAfterViewInit() {
|
|
3861
|
+
const stylingInputs = ['size'];
|
|
3862
|
+
stylingInputs.forEach(input => {
|
|
3863
|
+
this.handleClasses(this[input], input);
|
|
3864
|
+
});
|
|
3865
|
+
}
|
|
3487
3866
|
ngAfterContentInit() {
|
|
3488
3867
|
this.chips.forEach((chip) => {
|
|
3489
3868
|
this.renderer.setAttribute(chip.element.nativeElement, 'role', 'option');
|
|
@@ -3514,6 +3893,16 @@ let ChipListComponent = class ChipListComponent {
|
|
|
3514
3893
|
}
|
|
3515
3894
|
});
|
|
3516
3895
|
}
|
|
3896
|
+
handleClasses(value, input) {
|
|
3897
|
+
const elem = this.element.nativeElement;
|
|
3898
|
+
const classes = getStylingClasses('chip-list', input, this[input], value);
|
|
3899
|
+
if (classes.toRemove) {
|
|
3900
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
3901
|
+
}
|
|
3902
|
+
if (classes.toAdd) {
|
|
3903
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
3904
|
+
}
|
|
3905
|
+
}
|
|
3517
3906
|
};
|
|
3518
3907
|
__decorate([
|
|
3519
3908
|
HostBinding('class.k-chip-list'),
|
|
@@ -3527,6 +3916,11 @@ __decorate([
|
|
|
3527
3916
|
Input(),
|
|
3528
3917
|
__metadata("design:type", String)
|
|
3529
3918
|
], ChipListComponent.prototype, "selection", void 0);
|
|
3919
|
+
__decorate([
|
|
3920
|
+
Input(),
|
|
3921
|
+
__metadata("design:type", String),
|
|
3922
|
+
__metadata("design:paramtypes", [String])
|
|
3923
|
+
], ChipListComponent.prototype, "size", null);
|
|
3530
3924
|
__decorate([
|
|
3531
3925
|
Output(),
|
|
3532
3926
|
__metadata("design:type", EventEmitter)
|
|
@@ -3561,7 +3955,7 @@ __decorate([
|
|
|
3561
3955
|
], ChipListComponent.prototype, "onClick", null);
|
|
3562
3956
|
ChipListComponent = __decorate([
|
|
3563
3957
|
Component({
|
|
3564
|
-
selector: 'kendo-
|
|
3958
|
+
selector: 'kendo-chiplist, kendo-chip-list',
|
|
3565
3959
|
template: `
|
|
3566
3960
|
<ng-content></ng-content>
|
|
3567
3961
|
`,
|
|
@@ -3569,11 +3963,13 @@ ChipListComponent = __decorate([
|
|
|
3569
3963
|
LocalizationService,
|
|
3570
3964
|
{
|
|
3571
3965
|
provide: L10N_PREFIX,
|
|
3572
|
-
useValue: 'kendo.
|
|
3966
|
+
useValue: 'kendo.chiplist'
|
|
3573
3967
|
}
|
|
3574
3968
|
]
|
|
3575
3969
|
}),
|
|
3576
|
-
__metadata("design:paramtypes", [LocalizationService,
|
|
3970
|
+
__metadata("design:paramtypes", [LocalizationService,
|
|
3971
|
+
Renderer2,
|
|
3972
|
+
ElementRef])
|
|
3577
3973
|
], ChipListComponent);
|
|
3578
3974
|
|
|
3579
3975
|
const exportedModules = [
|
|
@@ -3737,12 +4133,16 @@ const SIZE_CLASSES = {
|
|
|
3737
4133
|
large: 'k-fab-lg'
|
|
3738
4134
|
};
|
|
3739
4135
|
const SHAPE_CLASSES = {
|
|
3740
|
-
pill: 'k-fab-pill',
|
|
3741
|
-
circle: 'k-fab-circle',
|
|
3742
4136
|
rectangle: 'k-fab-rectangle',
|
|
3743
|
-
square: 'k-fab-square'
|
|
3744
|
-
rounded: 'k-fab-rounded'
|
|
4137
|
+
square: 'k-fab-square'
|
|
3745
4138
|
};
|
|
4139
|
+
const ROUNDED_CLASSES = {
|
|
4140
|
+
small: 'k-rounded-sm',
|
|
4141
|
+
medium: 'k-rounded-md',
|
|
4142
|
+
large: 'k-rounded-lg',
|
|
4143
|
+
full: 'k-rounded-full'
|
|
4144
|
+
};
|
|
4145
|
+
const FILLMODE_CLASS = 'k-fab-solid';
|
|
3746
4146
|
const DEFAULT_DURATION = 180;
|
|
3747
4147
|
const DEFAULT_ITEM_GAP = 90;
|
|
3748
4148
|
const DEFAULT_OFFSET = '16px';
|
|
@@ -3822,13 +4222,15 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
3822
4222
|
this.id = `k-${guid()}`;
|
|
3823
4223
|
this._themeColor = 'primary';
|
|
3824
4224
|
this._size = 'medium';
|
|
3825
|
-
this._shape = '
|
|
4225
|
+
this._shape = 'rectangle';
|
|
3826
4226
|
this._disabled = false;
|
|
3827
4227
|
this._align = { horizontal: 'end', vertical: 'bottom' };
|
|
3828
4228
|
this._offset = { x: DEFAULT_OFFSET, y: DEFAULT_OFFSET };
|
|
4229
|
+
this._rounded = 'full';
|
|
3829
4230
|
this.subscriptions = new Subscription();
|
|
3830
4231
|
this.rtl = false;
|
|
3831
4232
|
this.animationEnd = new EventEmitter();
|
|
4233
|
+
this.initialSetup = true;
|
|
3832
4234
|
validatePackage(packageMetadata);
|
|
3833
4235
|
this.subscribeNavigationEvents();
|
|
3834
4236
|
this.subscriptions.add(this.localizationService.changes.subscribe(({ rtl }) => {
|
|
@@ -3848,18 +4250,16 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
3848
4250
|
* The theme color will be applied as background color of the component.
|
|
3849
4251
|
*
|
|
3850
4252
|
* The possible values are:
|
|
3851
|
-
* * `primary` (Default)—Applies coloring based on the `primary` theme color.
|
|
3852
|
-
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
3853
|
-
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
3854
|
-
* * `
|
|
3855
|
-
* * `
|
|
3856
|
-
* * `
|
|
3857
|
-
* * `
|
|
3858
|
-
* * `
|
|
3859
|
-
* * `
|
|
3860
|
-
* * `
|
|
3861
|
-
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
3862
|
-
*
|
|
4253
|
+
* * `'primary'` (Default)—Applies coloring based on the `primary` theme color.
|
|
4254
|
+
* * `'secondary'`—Applies coloring based on the `secondary` theme color.
|
|
4255
|
+
* * `'tertiary'`— Applies coloring based on the `tertiary` theme color.
|
|
4256
|
+
* * `'info'`—Applies coloring based on the `info` theme color.
|
|
4257
|
+
* * `'success'`— Applies coloring based on the `success` theme color.
|
|
4258
|
+
* * `'warning'`— Applies coloring based on the `warning` theme color.
|
|
4259
|
+
* * `'error'`— Applies coloring based on the `error` theme color.
|
|
4260
|
+
* * `'dark'`— Applies coloring based on the `dark` theme color.
|
|
4261
|
+
* * `'light'`— Applies coloring based on the `light` theme color.
|
|
4262
|
+
* * `'inverse'`— Applies coloring based on the `inverse` theme color.
|
|
3863
4263
|
*/
|
|
3864
4264
|
set themeColor(themeColor) {
|
|
3865
4265
|
this.handleClasses(themeColor, 'themeColor');
|
|
@@ -3873,10 +4273,9 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
3873
4273
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-size)).
|
|
3874
4274
|
*
|
|
3875
4275
|
* The possible values are:
|
|
3876
|
-
* * `small`
|
|
3877
|
-
* * `medium` (Default)
|
|
3878
|
-
* * `large`
|
|
3879
|
-
*
|
|
4276
|
+
* * `'small'`
|
|
4277
|
+
* * `'medium'` (Default)
|
|
4278
|
+
* * `'large'`
|
|
3880
4279
|
*/
|
|
3881
4280
|
set size(size) {
|
|
3882
4281
|
this.handleClasses(size, 'size');
|
|
@@ -3885,15 +4284,29 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
3885
4284
|
get size() {
|
|
3886
4285
|
return this._size;
|
|
3887
4286
|
}
|
|
4287
|
+
/**
|
|
4288
|
+
* The rounded property specifies the border radius of the FloatingActionButton.
|
|
4289
|
+
*
|
|
4290
|
+
* The possible values are:
|
|
4291
|
+
* * `'small'`
|
|
4292
|
+
* * `'medium'`
|
|
4293
|
+
* * `'large'`
|
|
4294
|
+
* * `'full'` (default)
|
|
4295
|
+
* * `null`
|
|
4296
|
+
*/
|
|
4297
|
+
set rounded(rounded) {
|
|
4298
|
+
this.handleClasses(rounded, 'rounded');
|
|
4299
|
+
this._rounded = rounded;
|
|
4300
|
+
}
|
|
4301
|
+
get rounded() {
|
|
4302
|
+
return this._rounded;
|
|
4303
|
+
}
|
|
3888
4304
|
/**
|
|
3889
4305
|
* Specifies the shape of the FloatingActionButton
|
|
3890
4306
|
* ([see example]({% slug appearance_floatingactionbutton %}#toc-shape)).
|
|
3891
4307
|
*
|
|
3892
4308
|
* The possible values are:
|
|
3893
|
-
* * `
|
|
3894
|
-
* * `circle`—Applies circle shape on the FloatingActionButton.
|
|
3895
|
-
* * `rectangle`—Applies rectangular shape on the FloatingActionButton.
|
|
3896
|
-
* * `rounded`—Applies rounded shape on the FloatingActionButton.
|
|
4309
|
+
* * `rectangle` (Default)—Applies rectangular shape on the FloatingActionButton.
|
|
3897
4310
|
* * `square`—Applies square shape on the FloatingActionButton.
|
|
3898
4311
|
*
|
|
3899
4312
|
*/
|
|
@@ -3951,8 +4364,10 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
3951
4364
|
return this.disabled ? (-1) : this.tabIndex;
|
|
3952
4365
|
}
|
|
3953
4366
|
ngAfterViewInit() {
|
|
3954
|
-
this.
|
|
4367
|
+
['shape', 'size', 'rounded', 'themeColor'].forEach(option => this.handleClasses(this[option], option));
|
|
4368
|
+
this.renderer.addClass(this.element.nativeElement, this.alignClass());
|
|
3955
4369
|
this.offsetStyles();
|
|
4370
|
+
this.initialSetup = false;
|
|
3956
4371
|
}
|
|
3957
4372
|
ngOnDestroy() {
|
|
3958
4373
|
this.subscriptions.unsubscribe();
|
|
@@ -4094,20 +4509,24 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
4094
4509
|
this.toggleDialWithEvents(false);
|
|
4095
4510
|
}
|
|
4096
4511
|
handleClasses(inputValue, input) {
|
|
4097
|
-
if (isPresent(this.button) && (this[input] !== inputValue)) {
|
|
4512
|
+
if (isPresent(this.button) && (this[input] !== inputValue || this.initialSetup)) {
|
|
4098
4513
|
const button = this.button.nativeElement;
|
|
4099
4514
|
const classesToRemove = {
|
|
4100
|
-
themeColor:
|
|
4515
|
+
themeColor: `${FILLMODE_CLASS}-${this.themeColor}`,
|
|
4101
4516
|
size: SIZE_CLASSES[this.size],
|
|
4102
|
-
shape: SHAPE_CLASSES[this.shape]
|
|
4517
|
+
shape: SHAPE_CLASSES[this.shape],
|
|
4518
|
+
rounded: ROUNDED_CLASSES[this.rounded]
|
|
4103
4519
|
};
|
|
4104
4520
|
const classesToAdd = {
|
|
4105
|
-
themeColor:
|
|
4521
|
+
themeColor: inputValue ? `${FILLMODE_CLASS}-${inputValue}` : null,
|
|
4106
4522
|
size: SIZE_CLASSES[inputValue],
|
|
4107
|
-
shape: SHAPE_CLASSES[inputValue]
|
|
4523
|
+
shape: SHAPE_CLASSES[inputValue],
|
|
4524
|
+
rounded: ROUNDED_CLASSES[inputValue]
|
|
4108
4525
|
};
|
|
4109
4526
|
this.renderer.removeClass(button, classesToRemove[input]);
|
|
4110
|
-
|
|
4527
|
+
if (classesToAdd[input]) {
|
|
4528
|
+
this.renderer.addClass(button, classesToAdd[input]);
|
|
4529
|
+
}
|
|
4111
4530
|
}
|
|
4112
4531
|
}
|
|
4113
4532
|
onEnterPressed() {
|
|
@@ -4162,14 +4581,6 @@ let FloatingActionButtonComponent = class FloatingActionButtonComponent {
|
|
|
4162
4581
|
alignClass() {
|
|
4163
4582
|
return `k-pos-${this.align.vertical}-${this.align.horizontal}`;
|
|
4164
4583
|
}
|
|
4165
|
-
applyClasses() {
|
|
4166
|
-
const hostElement = this.element.nativeElement;
|
|
4167
|
-
const button = this.button.nativeElement;
|
|
4168
|
-
this.renderer.addClass(button, SHAPE_CLASSES[this.shape]);
|
|
4169
|
-
this.renderer.addClass(button, `k-fab-${this.themeColor}`);
|
|
4170
|
-
this.renderer.addClass(button, SIZE_CLASSES[this.size]);
|
|
4171
|
-
this.renderer.addClass(hostElement, this.alignClass());
|
|
4172
|
-
}
|
|
4173
4584
|
toggleDialWithEvents(open) {
|
|
4174
4585
|
if (open === this.isOpen) {
|
|
4175
4586
|
return;
|
|
@@ -4389,6 +4800,11 @@ __decorate([
|
|
|
4389
4800
|
__metadata("design:type", String),
|
|
4390
4801
|
__metadata("design:paramtypes", [String])
|
|
4391
4802
|
], FloatingActionButtonComponent.prototype, "size", null);
|
|
4803
|
+
__decorate([
|
|
4804
|
+
Input(),
|
|
4805
|
+
__metadata("design:type", String),
|
|
4806
|
+
__metadata("design:paramtypes", [String])
|
|
4807
|
+
], FloatingActionButtonComponent.prototype, "rounded", null);
|
|
4392
4808
|
__decorate([
|
|
4393
4809
|
Input(),
|
|
4394
4810
|
__metadata("design:type", String),
|
|
@@ -4485,8 +4901,8 @@ FloatingActionButtonComponent = __decorate([
|
|
|
4485
4901
|
[attr.role]="role"
|
|
4486
4902
|
[tabIndex]="componentTabIndex"
|
|
4487
4903
|
type="button"
|
|
4488
|
-
|
|
4489
|
-
[class.k-
|
|
4904
|
+
class="k-fab k-fab-solid"
|
|
4905
|
+
[class.k-disabled]="disabled"
|
|
4490
4906
|
[ngClass]="buttonClass"
|
|
4491
4907
|
[disabled]="disabled"
|
|
4492
4908
|
[attr.aria-disabled]="disabled"
|
|
@@ -4670,7 +5086,7 @@ __decorate([
|
|
|
4670
5086
|
], DialItemComponent.prototype, "role", void 0);
|
|
4671
5087
|
__decorate([
|
|
4672
5088
|
HostBinding('attr.aria-disabled'),
|
|
4673
|
-
HostBinding('class.k-
|
|
5089
|
+
HostBinding('class.k-disabled'),
|
|
4674
5090
|
__metadata("design:type", Boolean),
|
|
4675
5091
|
__metadata("design:paramtypes", [])
|
|
4676
5092
|
], DialItemComponent.prototype, "disabledClass", null);
|