@progress/kendo-angular-buttons 6.4.0 → 7.0.0-dev.202201101733
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-buttons.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/button/button.directive.js +239 -89
- package/dist/es/button/button.service.js +1 -5
- package/dist/es/buttongroup/buttongroup.component.js +1 -53
- package/dist/es/chip/chip-list.component.js +54 -7
- package/dist/es/chip/chip.component.js +175 -86
- package/dist/es/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/es/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/{es2015/button-look.js → es/common/models/styling-classes.js} +0 -0
- package/dist/es/{button-look.js → common/models.js} +0 -0
- package/dist/es/dropdownbutton/dropdownbutton.component.js +74 -33
- package/dist/es/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/es/focusable/focusable.directive.js +4 -4
- package/dist/es/listbutton/list-button.js +1 -1
- package/dist/es/listbutton/list.component.js +20 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/splitbutton/splitbutton.component.js +91 -33
- package/dist/es/util.js +52 -0
- package/dist/es2015/button/button.directive.d.ts +85 -22
- package/dist/es2015/button/button.directive.js +222 -85
- package/dist/es2015/button/button.service.d.ts +1 -4
- package/dist/es2015/button/button.service.js +1 -5
- package/dist/es2015/buttongroup/buttongroup.component.d.ts +0 -15
- package/dist/es2015/buttongroup/buttongroup.component.js +1 -41
- package/dist/es2015/chip/chip-list.component.d.ts +19 -3
- package/dist/es2015/chip/chip-list.component.js +49 -7
- package/dist/es2015/chip/chip.component.d.ts +67 -32
- package/dist/es2015/chip/chip.component.js +186 -97
- package/dist/es2015/common/models/fillmode.d.ts +12 -0
- package/dist/es2015/{chip/models/type.js → common/models/fillmode.js} +0 -0
- package/dist/es2015/common/models/rounded.d.ts +12 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/shape.d.ts +2 -9
- package/dist/es2015/common/models/size.d.ts +9 -6
- package/dist/es2015/common/models/styling-classes.d.ts +11 -0
- package/dist/es2015/common/models/styling-classes.js +4 -0
- package/dist/es2015/common/models/theme-color.d.ts +15 -4
- package/dist/es2015/common/models.d.ts +10 -0
- package/dist/es2015/{chip/models/chip-look.js → common/models.js} +0 -0
- package/dist/es2015/dropdownbutton/dropdownbutton.component.d.ts +58 -7
- package/dist/es2015/dropdownbutton/dropdownbutton.component.js +81 -28
- package/dist/es2015/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.d.ts +28 -21
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.js +62 -42
- package/dist/es2015/focusable/focusable.directive.js +4 -4
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/listbutton/list-button.js +1 -1
- package/dist/es2015/listbutton/list.component.d.ts +3 -0
- package/dist/es2015/listbutton/list.component.js +37 -20
- package/dist/es2015/main.d.ts +4 -4
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/splitbutton/splitbutton.component.d.ts +53 -7
- package/dist/es2015/splitbutton/splitbutton.component.js +101 -29
- package/dist/es2015/util.d.ts +21 -0
- package/dist/es2015/util.js +52 -0
- package/dist/fesm2015/index.js +832 -395
- package/dist/fesm5/index.js +817 -393
- package/dist/npm/button/button.directive.js +239 -89
- package/dist/npm/button/button.service.js +0 -4
- package/dist/npm/buttongroup/buttongroup.component.js +1 -53
- package/dist/npm/chip/chip-list.component.js +52 -5
- package/dist/npm/chip/chip.component.js +173 -84
- package/dist/npm/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/npm/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/npm/common/models/styling-classes.js +6 -0
- package/dist/npm/{button-look.js → common/models.js} +0 -0
- package/dist/npm/dropdownbutton/dropdownbutton.component.js +74 -33
- package/dist/npm/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/npm/focusable/focusable.directive.js +4 -4
- package/dist/npm/listbutton/list-button.js +1 -1
- package/dist/npm/listbutton/list.component.js +20 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/splitbutton/splitbutton.component.js +89 -31
- package/dist/npm/util.js +52 -0
- package/dist/systemjs/kendo-angular-buttons.js +1 -1
- package/package.json +18 -15
- package/dist/es2015/button-look.d.ts +0 -21
- package/dist/es2015/chip/models/chip-look.d.ts +0 -20
- package/dist/es2015/chip/models/type.d.ts +0 -21
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Component, HostBinding, Input, Output, EventEmitter, ElementRef, Renderer2, NgZone } from '@angular/core';
|
|
6
|
+
import { Component, HostBinding, Input, Output, EventEmitter, ElementRef, Renderer2, NgZone, isDevMode } from '@angular/core';
|
|
7
7
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
8
8
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
9
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
10
|
import { packageMetadata } from '../package-metadata';
|
|
11
|
-
import { closest } from '../util';
|
|
11
|
+
import { closest, getStylingClasses, getThemeColorClasses } from '../util';
|
|
12
12
|
/**
|
|
13
13
|
* Displays a Chip that represents an input, attribute or an action.
|
|
14
14
|
*/
|
|
@@ -18,38 +18,20 @@ let ChipComponent = class ChipComponent {
|
|
|
18
18
|
this.renderer = renderer;
|
|
19
19
|
this.ngZone = ngZone;
|
|
20
20
|
this.localizationService = localizationService;
|
|
21
|
-
/**
|
|
22
|
-
* Changes the visual appearance by using alternative styling options.
|
|
23
|
-
*
|
|
24
|
-
* The available values are:
|
|
25
|
-
* * `solid`
|
|
26
|
-
* * `outline`
|
|
27
|
-
* * `filled` (The `filled` option will be deprecated. To apply identical styling, use `solid` instead).
|
|
28
|
-
* * `outlined` (The `outlined` option will be deprecated. To apply identical styling, use `outline` instead).
|
|
29
|
-
*/
|
|
30
|
-
this.look = 'solid';
|
|
31
21
|
/**
|
|
32
22
|
* Specifies the selected state of the Chip.
|
|
23
|
+
* @default false
|
|
33
24
|
*/
|
|
34
25
|
this.selected = false;
|
|
35
26
|
/**
|
|
36
27
|
* Specifies if the Chip will be removable or not.
|
|
37
28
|
* If the property is set to `true`, the Chip renders a remove icon.
|
|
29
|
+
* @default false
|
|
38
30
|
*/
|
|
39
31
|
this.removable = false;
|
|
40
|
-
/**
|
|
41
|
-
* Specifies the Chip type.
|
|
42
|
-
*
|
|
43
|
-
* The possible values are:
|
|
44
|
-
* - `none` (default)
|
|
45
|
-
* - `success`
|
|
46
|
-
* - `error`
|
|
47
|
-
* - `warning`
|
|
48
|
-
* - `info`
|
|
49
|
-
*/
|
|
50
|
-
this.type = 'none';
|
|
51
32
|
/**
|
|
52
33
|
* If set to `true`, the Chip will be disabled.
|
|
34
|
+
* @default false
|
|
53
35
|
*/
|
|
54
36
|
this.disabled = false;
|
|
55
37
|
/**
|
|
@@ -62,21 +44,90 @@ let ChipComponent = class ChipComponent {
|
|
|
62
44
|
this.contentClick = new EventEmitter();
|
|
63
45
|
this.tabIndex = 0;
|
|
64
46
|
this.hostClass = true;
|
|
47
|
+
this._size = 'medium';
|
|
48
|
+
this._rounded = 'medium';
|
|
49
|
+
this._fillMode = 'solid';
|
|
50
|
+
this._themeColor = 'base';
|
|
65
51
|
this.focused = false;
|
|
66
52
|
validatePackage(packageMetadata);
|
|
67
53
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
68
54
|
}
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
/**
|
|
56
|
+
* The size property specifies the height, padding and line height of the Chip
|
|
57
|
+
* ([see example]({% slug appearance_chip %}#toc-size)).
|
|
58
|
+
*
|
|
59
|
+
* The possible values are:
|
|
60
|
+
* * `'small'`
|
|
61
|
+
* * `'medium'` (default)
|
|
62
|
+
* * `'large'`
|
|
63
|
+
* * `null`
|
|
64
|
+
*/
|
|
65
|
+
set size(size) {
|
|
66
|
+
this.handleClasses(size, 'size');
|
|
67
|
+
this._size = size;
|
|
68
|
+
}
|
|
69
|
+
get size() {
|
|
70
|
+
return this._size;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The rounded property specifies the border radius of the Chip
|
|
74
|
+
* ([see example]({% slug appearance_chip %}#toc-rounded)).
|
|
75
|
+
*
|
|
76
|
+
* The possible values are:
|
|
77
|
+
* * `'small'`
|
|
78
|
+
* * `'medium'` (default)
|
|
79
|
+
* * `'large'`
|
|
80
|
+
* * `'full'`
|
|
81
|
+
* * `null`
|
|
82
|
+
*/
|
|
83
|
+
set rounded(rounded) {
|
|
84
|
+
this.handleClasses(rounded, 'rounded');
|
|
85
|
+
this._rounded = rounded;
|
|
86
|
+
}
|
|
87
|
+
get rounded() {
|
|
88
|
+
return this._rounded;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The fillMode property specifies the background and border styles of the Chip
|
|
92
|
+
* ([see example]({% slug appearance_chip %}#toc-fillMode)).
|
|
93
|
+
*
|
|
94
|
+
* The possible values are:
|
|
95
|
+
* * `'solid'` (default)
|
|
96
|
+
* * `'outline'`
|
|
97
|
+
* * `null`
|
|
98
|
+
*/
|
|
99
|
+
set fillMode(fillMode) {
|
|
100
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
101
|
+
this._fillMode = fillMode;
|
|
102
|
+
}
|
|
103
|
+
get fillMode() {
|
|
104
|
+
return this._fillMode;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The Chip allows you to specify predefined theme colors.
|
|
108
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
109
|
+
* ([see example]({% slug appearance_chip %}#toc-themeColor)).
|
|
110
|
+
*
|
|
111
|
+
* The possible values are:
|
|
112
|
+
* * `'base'` (default)
|
|
113
|
+
* * `'info'`
|
|
114
|
+
* * `'success'`
|
|
115
|
+
* * `'warning'`
|
|
116
|
+
* * `'error'`
|
|
117
|
+
* * `null`
|
|
118
|
+
*/
|
|
119
|
+
set themeColor(themeColor) {
|
|
120
|
+
this.handleThemeColor(themeColor);
|
|
121
|
+
this._themeColor = themeColor;
|
|
71
122
|
}
|
|
72
|
-
get
|
|
73
|
-
return this.
|
|
123
|
+
get themeColor() {
|
|
124
|
+
return this._themeColor;
|
|
74
125
|
}
|
|
75
|
-
get
|
|
76
|
-
return this.
|
|
126
|
+
get ariaChecked() {
|
|
127
|
+
return this.selected;
|
|
77
128
|
}
|
|
78
129
|
get hasIconClass() {
|
|
79
|
-
return this.icon || this.iconClass ? true : false;
|
|
130
|
+
return this.icon || this.iconClass || this.avatarClass ? true : false;
|
|
80
131
|
}
|
|
81
132
|
get disabledClass() {
|
|
82
133
|
return this.disabled;
|
|
@@ -101,54 +152,41 @@ let ChipComponent = class ChipComponent {
|
|
|
101
152
|
}
|
|
102
153
|
ngAfterViewInit() {
|
|
103
154
|
const chip = this.element.nativeElement;
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
this.
|
|
107
|
-
}
|
|
155
|
+
const stylingOptions = ['size', 'rounded', 'fillMode'];
|
|
156
|
+
stylingOptions.forEach(input => {
|
|
157
|
+
this.handleClasses(this[input], input);
|
|
158
|
+
});
|
|
108
159
|
this.attachElementEventHandlers(chip);
|
|
109
160
|
}
|
|
110
161
|
/**
|
|
111
162
|
* @hidden
|
|
112
163
|
*/
|
|
113
|
-
get
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
classes.push(`${this.iconClass}`);
|
|
117
|
-
}
|
|
118
|
-
if (this.icon) {
|
|
119
|
-
classes.push(`k-icon k-i-${this.icon}`);
|
|
120
|
-
}
|
|
121
|
-
return classes;
|
|
164
|
+
get kendoIconClass() {
|
|
165
|
+
this.verifyIconSettings([this.iconClass, this.avatarClass]);
|
|
166
|
+
return `k-i-${this.icon}`;
|
|
122
167
|
}
|
|
123
168
|
/**
|
|
124
169
|
* @hidden
|
|
125
170
|
*/
|
|
126
|
-
get
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
return `k-icon k-i-check`;
|
|
171
|
+
get customIconClass() {
|
|
172
|
+
this.verifyIconSettings([this.icon, this.avatarClass]);
|
|
173
|
+
return `${this.iconClass}`;
|
|
131
174
|
}
|
|
132
175
|
/**
|
|
133
176
|
* @hidden
|
|
134
177
|
*/
|
|
135
|
-
get
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
return `k-icon k-i-close-circle`;
|
|
178
|
+
get chipAvatarClass() {
|
|
179
|
+
this.verifyIconSettings([this.icon, this.iconClass]);
|
|
180
|
+
return `${this.avatarClass}`;
|
|
140
181
|
}
|
|
141
182
|
/**
|
|
142
183
|
* @hidden
|
|
143
184
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
'error': 'k-chip-error',
|
|
150
|
-
'info': 'k-chip-info'
|
|
151
|
-
}[this.type];
|
|
185
|
+
get removeIconClass() {
|
|
186
|
+
if (this.removeIcon) {
|
|
187
|
+
return `${this.removeIcon}`;
|
|
188
|
+
}
|
|
189
|
+
return `k-i-close-circle`;
|
|
152
190
|
}
|
|
153
191
|
/**
|
|
154
192
|
* Focuses the Chip component.
|
|
@@ -183,7 +221,7 @@ let ChipComponent = class ChipComponent {
|
|
|
183
221
|
this.renderer.removeClass(chip, 'k-focus');
|
|
184
222
|
});
|
|
185
223
|
const contentClickListener = this.renderer.listen(chip, 'click', (e) => {
|
|
186
|
-
const isRemoveClicked = closest(e.target, '.k-remove-
|
|
224
|
+
const isRemoveClicked = closest(e.target, '.k-chip-remove-action');
|
|
187
225
|
if (!isRemoveClicked) {
|
|
188
226
|
this.ngZone.run(() => {
|
|
189
227
|
this.contentClick.emit({ sender: this, originalEvent: e });
|
|
@@ -197,11 +235,43 @@ let ChipComponent = class ChipComponent {
|
|
|
197
235
|
};
|
|
198
236
|
});
|
|
199
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* @hidden
|
|
240
|
+
*/
|
|
241
|
+
verifyIconSettings(iconsToCheck) {
|
|
242
|
+
if (isDevMode()) {
|
|
243
|
+
if (iconsToCheck.filter(icon => icon !== null && icon !== undefined).length > 0) {
|
|
244
|
+
this.renderer.removeClass(this.element.nativeElement, 'k-chip-has-icon');
|
|
245
|
+
throw new Error('Invalid configuration: Having multiple icons is not supported. Only a single icon on a chip can be displayed.');
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
handleClasses(value, input) {
|
|
250
|
+
const elem = this.element.nativeElement;
|
|
251
|
+
const classes = getStylingClasses('chip', input, this[input], value);
|
|
252
|
+
if (input === 'fillMode') {
|
|
253
|
+
this.handleThemeColor(this.themeColor, this[input], value);
|
|
254
|
+
}
|
|
255
|
+
if (classes.toRemove) {
|
|
256
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
257
|
+
}
|
|
258
|
+
if (classes.toAdd) {
|
|
259
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
handleThemeColor(value, prevFillMode, fillMode) {
|
|
263
|
+
const elem = this.element.nativeElement;
|
|
264
|
+
const removeFillMode = prevFillMode ? prevFillMode : this.fillMode;
|
|
265
|
+
const addFillMode = fillMode ? fillMode : this.fillMode;
|
|
266
|
+
const themeColorClass = getThemeColorClasses('chip', removeFillMode, addFillMode, this.themeColor, value);
|
|
267
|
+
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
268
|
+
if (addFillMode !== null && fillMode !== null) {
|
|
269
|
+
if (themeColorClass.toAdd) {
|
|
270
|
+
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
200
274
|
};
|
|
201
|
-
tslib_1.__decorate([
|
|
202
|
-
Input(),
|
|
203
|
-
tslib_1.__metadata("design:type", String)
|
|
204
|
-
], ChipComponent.prototype, "look", void 0);
|
|
205
275
|
tslib_1.__decorate([
|
|
206
276
|
Input(),
|
|
207
277
|
tslib_1.__metadata("design:type", String)
|
|
@@ -216,12 +286,12 @@ tslib_1.__decorate([
|
|
|
216
286
|
], ChipComponent.prototype, "iconClass", void 0);
|
|
217
287
|
tslib_1.__decorate([
|
|
218
288
|
Input(),
|
|
219
|
-
tslib_1.__metadata("design:type",
|
|
220
|
-
], ChipComponent.prototype, "
|
|
289
|
+
tslib_1.__metadata("design:type", String)
|
|
290
|
+
], ChipComponent.prototype, "avatarClass", void 0);
|
|
221
291
|
tslib_1.__decorate([
|
|
222
292
|
Input(),
|
|
223
|
-
tslib_1.__metadata("design:type",
|
|
224
|
-
], ChipComponent.prototype, "
|
|
293
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
294
|
+
], ChipComponent.prototype, "selected", void 0);
|
|
225
295
|
tslib_1.__decorate([
|
|
226
296
|
Input(),
|
|
227
297
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -230,14 +300,30 @@ tslib_1.__decorate([
|
|
|
230
300
|
Input(),
|
|
231
301
|
tslib_1.__metadata("design:type", String)
|
|
232
302
|
], ChipComponent.prototype, "removeIcon", void 0);
|
|
233
|
-
tslib_1.__decorate([
|
|
234
|
-
Input(),
|
|
235
|
-
tslib_1.__metadata("design:type", String)
|
|
236
|
-
], ChipComponent.prototype, "type", void 0);
|
|
237
303
|
tslib_1.__decorate([
|
|
238
304
|
Input(),
|
|
239
305
|
tslib_1.__metadata("design:type", Boolean)
|
|
240
306
|
], ChipComponent.prototype, "disabled", void 0);
|
|
307
|
+
tslib_1.__decorate([
|
|
308
|
+
Input(),
|
|
309
|
+
tslib_1.__metadata("design:type", String),
|
|
310
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
311
|
+
], ChipComponent.prototype, "size", null);
|
|
312
|
+
tslib_1.__decorate([
|
|
313
|
+
Input(),
|
|
314
|
+
tslib_1.__metadata("design:type", String),
|
|
315
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
316
|
+
], ChipComponent.prototype, "rounded", null);
|
|
317
|
+
tslib_1.__decorate([
|
|
318
|
+
Input(),
|
|
319
|
+
tslib_1.__metadata("design:type", String),
|
|
320
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
321
|
+
], ChipComponent.prototype, "fillMode", null);
|
|
322
|
+
tslib_1.__decorate([
|
|
323
|
+
Input(),
|
|
324
|
+
tslib_1.__metadata("design:type", String),
|
|
325
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
326
|
+
], ChipComponent.prototype, "themeColor", null);
|
|
241
327
|
tslib_1.__decorate([
|
|
242
328
|
Output(),
|
|
243
329
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -259,16 +345,6 @@ tslib_1.__decorate([
|
|
|
259
345
|
HostBinding('class.k-chip'),
|
|
260
346
|
tslib_1.__metadata("design:type", Boolean)
|
|
261
347
|
], ChipComponent.prototype, "hostClass", void 0);
|
|
262
|
-
tslib_1.__decorate([
|
|
263
|
-
HostBinding('class.k-chip-outline'),
|
|
264
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
265
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
266
|
-
], ChipComponent.prototype, "outlineClass", null);
|
|
267
|
-
tslib_1.__decorate([
|
|
268
|
-
HostBinding('class.k-chip-solid'),
|
|
269
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
270
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
271
|
-
], ChipComponent.prototype, "solidClass", null);
|
|
272
348
|
tslib_1.__decorate([
|
|
273
349
|
HostBinding('class.k-chip-has-icon'),
|
|
274
350
|
tslib_1.__metadata("design:type", Boolean),
|
|
@@ -298,20 +374,27 @@ ChipComponent = tslib_1.__decorate([
|
|
|
298
374
|
Component({
|
|
299
375
|
selector: 'kendo-chip',
|
|
300
376
|
template: `
|
|
301
|
-
<span
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
</span>
|
|
377
|
+
<span
|
|
378
|
+
*ngIf="icon"
|
|
379
|
+
class="k-chip-icon k-icon"
|
|
380
|
+
[ngClass]="kendoIconClass"
|
|
381
|
+
>
|
|
307
382
|
</span>
|
|
308
383
|
|
|
309
|
-
<span
|
|
384
|
+
<span
|
|
385
|
+
*ngIf="iconClass"
|
|
310
386
|
class="k-chip-icon"
|
|
311
|
-
[ngClass]="
|
|
387
|
+
[ngClass]="customIconClass"
|
|
312
388
|
>
|
|
313
389
|
</span>
|
|
314
390
|
|
|
391
|
+
<span
|
|
392
|
+
*ngIf="avatarClass"
|
|
393
|
+
class="k-chip-avatar k-avatar k-rounded-full"
|
|
394
|
+
>
|
|
395
|
+
<span class="k-avatar-image" [ngClass]="chipAvatarClass"></span>
|
|
396
|
+
</span>
|
|
397
|
+
|
|
315
398
|
<span class="k-chip-content">
|
|
316
399
|
<span class="k-chip-label" *ngIf="label">
|
|
317
400
|
{{ label }}
|
|
@@ -319,11 +402,17 @@ ChipComponent = tslib_1.__decorate([
|
|
|
319
402
|
<ng-content *ngIf="!label"></ng-content>
|
|
320
403
|
</span>
|
|
321
404
|
|
|
322
|
-
<span
|
|
323
|
-
class="k-remove-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
405
|
+
<span class="k-chip-actions">
|
|
406
|
+
<span class="k-chip-action k-chip-remove-action"
|
|
407
|
+
*ngIf="removable"
|
|
408
|
+
(click)="onRemoveClick($event)"
|
|
409
|
+
>
|
|
410
|
+
<span
|
|
411
|
+
class="k-icon"
|
|
412
|
+
[ngClass]="removeIconClass"
|
|
413
|
+
>
|
|
414
|
+
</span>
|
|
415
|
+
</span>
|
|
327
416
|
</span>
|
|
328
417
|
`,
|
|
329
418
|
providers: [
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents the possible fillMode options of the buttons.
|
|
7
|
+
*/
|
|
8
|
+
export declare type ButtonFillMode = 'solid' | 'flat' | 'outline' | 'link';
|
|
9
|
+
/**
|
|
10
|
+
* Represents the possible fillMode options of the Chip.
|
|
11
|
+
*/
|
|
12
|
+
export declare type ChipFillMode = 'solid' | 'outline';
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents the possible rounded options of the buttons.
|
|
7
|
+
*/
|
|
8
|
+
export declare type ButtonRounded = 'small' | 'medium' | 'large' | 'full';
|
|
9
|
+
/**
|
|
10
|
+
* Represents the possible rounded options of the Chip.
|
|
11
|
+
*/
|
|
12
|
+
export declare type ChipRounded = 'small' | 'medium' | 'large' | 'full';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -3,14 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The possible values are:
|
|
9
|
-
* * `pill`
|
|
10
|
-
* * `circle`
|
|
11
|
-
* * `rounded`
|
|
12
|
-
* * `rectangle`
|
|
13
|
-
* * `square`
|
|
6
|
+
* Represents the possible shapes of the buttons.
|
|
14
7
|
*
|
|
15
8
|
*/
|
|
16
|
-
export declare type ButtonShape = '
|
|
9
|
+
export declare type ButtonShape = 'rectangle' | 'square';
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Specifies the
|
|
7
|
-
*
|
|
8
|
-
* The possible values are:
|
|
9
|
-
* * `small`
|
|
10
|
-
* * `medium`
|
|
11
|
-
* * `large`
|
|
6
|
+
* Specifies the possible sizes of the buttons.
|
|
12
7
|
*
|
|
13
8
|
*/
|
|
14
9
|
export declare type ButtonSize = 'small' | 'medium' | 'large';
|
|
10
|
+
/**
|
|
11
|
+
* Specifies the possible sizes of the Chip.
|
|
12
|
+
*/
|
|
13
|
+
export declare type ChipSize = 'small' | 'medium' | 'large';
|
|
14
|
+
/**
|
|
15
|
+
* Specifies the possible gap between Chips in a ChipList.
|
|
16
|
+
*/
|
|
17
|
+
export declare type ChipListSize = 'small' | 'medium' | 'large';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export interface ButtonStylingClasses {
|
|
9
|
+
toRemove?: string;
|
|
10
|
+
toAdd?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Specifies the theme
|
|
6
|
+
* Specifies the possible theme colors of the buttons.
|
|
7
7
|
*
|
|
8
8
|
* The possible values are:
|
|
9
|
-
* * `
|
|
9
|
+
* * `base` —Applies coloring based on the `base` theme color.
|
|
10
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
10
11
|
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
11
12
|
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
12
|
-
* * `inherit`— Applies inherited coloring value.
|
|
13
13
|
* * `info`—Applies coloring based on the `info` theme color.
|
|
14
14
|
* * `success`— Applies coloring based on the `success` theme color.
|
|
15
15
|
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
@@ -19,4 +19,15 @@
|
|
|
19
19
|
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
|
-
export declare type ButtonThemeColor = '
|
|
22
|
+
export declare type ButtonThemeColor = 'base' | 'primary' | 'secondary' | 'tertiary' | 'info' | 'success' | 'warning' | 'error' | 'dark' | 'light' | 'inverse';
|
|
23
|
+
/**
|
|
24
|
+
* Specifies the possible theme colors of the Chip.
|
|
25
|
+
*
|
|
26
|
+
* The possible values are:
|
|
27
|
+
* * `base` —Applies coloring based on the `base` theme color.
|
|
28
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
29
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
30
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
31
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
32
|
+
*/
|
|
33
|
+
export declare type ChipThemeColor = 'base' | 'info' | 'success' | 'warning' | 'error';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export * from './models/shape';
|
|
6
|
+
export * from './models/size';
|
|
7
|
+
export * from './models/theme-color';
|
|
8
|
+
export * from './models/fillmode';
|
|
9
|
+
export * from './models/rounded';
|
|
10
|
+
export * from './models/styling-classes';
|
|
File without changes
|
|
@@ -13,7 +13,7 @@ import { ListComponent } from '../listbutton/list.component';
|
|
|
13
13
|
import { FocusService } from '../focusable/focus.service';
|
|
14
14
|
import { NavigationService } from '../navigation/navigation.service';
|
|
15
15
|
import { PreventableEvent } from '../preventable-event';
|
|
16
|
-
import {
|
|
16
|
+
import { ButtonFillMode, ButtonRounded, ButtonSize, ButtonThemeColor, ButtonShape } from '../common/models';
|
|
17
17
|
/**
|
|
18
18
|
* Represents the Kendo UI DropDownButton component for Angular.
|
|
19
19
|
*
|
|
@@ -83,17 +83,70 @@ export declare class DropDownButtonComponent extends ListButton implements OnCha
|
|
|
83
83
|
*/
|
|
84
84
|
data: any;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* The size property specifies the width and height of the DropDownButton
|
|
87
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-size)).
|
|
88
|
+
*
|
|
89
|
+
* The possible values are:
|
|
90
|
+
* * `'small'`
|
|
91
|
+
* * `'medium'` (default)
|
|
92
|
+
* * `'large'`
|
|
93
|
+
* * `null`
|
|
87
94
|
*/
|
|
88
|
-
|
|
95
|
+
size: ButtonSize;
|
|
89
96
|
/**
|
|
90
|
-
*
|
|
97
|
+
* The shape property specifies if the DropDownButton will be a square or rectangle.
|
|
98
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-shape)).
|
|
99
|
+
*
|
|
100
|
+
* The possible values are:
|
|
101
|
+
* * `'rectangle'` (default)
|
|
102
|
+
* * `'square'`
|
|
103
|
+
* * `null`
|
|
104
|
+
*/
|
|
105
|
+
shape: ButtonShape;
|
|
106
|
+
/**
|
|
107
|
+
* The rounded property specifies the border radius of the DropDownButton
|
|
108
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-rounded)).
|
|
109
|
+
*
|
|
110
|
+
* The possible values are:
|
|
111
|
+
* * `'small'`
|
|
112
|
+
* * `'medium'` (default)
|
|
113
|
+
* * `'large'`
|
|
114
|
+
* * `'full'`
|
|
115
|
+
* * `null`
|
|
116
|
+
*/
|
|
117
|
+
rounded: ButtonRounded;
|
|
118
|
+
/**
|
|
119
|
+
* The fillMode property specifies the background and border styles of the DropDownButton
|
|
120
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-fillMode)).
|
|
91
121
|
*
|
|
92
122
|
* The available values are:
|
|
123
|
+
* * `solid` (default)
|
|
93
124
|
* * `flat`
|
|
94
125
|
* * `outline`
|
|
126
|
+
* * `link`
|
|
127
|
+
* * `null`
|
|
95
128
|
*/
|
|
96
|
-
|
|
129
|
+
fillMode: ButtonFillMode;
|
|
130
|
+
/**
|
|
131
|
+
* The DropDownButton allows you to specify predefined theme colors.
|
|
132
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
133
|
+
* ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-themeColor)).
|
|
134
|
+
*
|
|
135
|
+
* The possible values are:
|
|
136
|
+
* * `base` —Applies coloring based on the `base` theme color. (default)
|
|
137
|
+
* * `primary` —Applies coloring based on the `primary` theme color.
|
|
138
|
+
* * `secondary`—Applies coloring based on the `secondary` theme color.
|
|
139
|
+
* * `tertiary`— Applies coloring based on the `tertiary` theme color.
|
|
140
|
+
* * `info`—Applies coloring based on the `info` theme color.
|
|
141
|
+
* * `success`— Applies coloring based on the `success` theme color.
|
|
142
|
+
* * `warning`— Applies coloring based on the `warning` theme color.
|
|
143
|
+
* * `error`— Applies coloring based on the `error` theme color.
|
|
144
|
+
* * `dark`— Applies coloring based on the `dark` theme color.
|
|
145
|
+
* * `light`— Applies coloring based on the `light` theme color.
|
|
146
|
+
* * `inverse`— Applies coloring based on the `inverse` theme color.
|
|
147
|
+
* * `null` —Removes the default CSS class (no class would be rendered).
|
|
148
|
+
*/
|
|
149
|
+
themeColor: ButtonThemeColor;
|
|
97
150
|
/**
|
|
98
151
|
* The CSS classes that will be rendered on the main button.
|
|
99
152
|
* Supports the type of values that are supported by [`ngClass`]({{ site.data.urls.angular['ngclassapi'] }}).
|
|
@@ -138,8 +191,6 @@ export declare class DropDownButtonComponent extends ListButton implements OnCha
|
|
|
138
191
|
*/
|
|
139
192
|
onBlur: EventEmitter<any>;
|
|
140
193
|
readonly focused: boolean;
|
|
141
|
-
readonly isFlat: boolean;
|
|
142
|
-
readonly isOutline: boolean;
|
|
143
194
|
readonly widgetClasses: boolean;
|
|
144
195
|
readonly dir: Direction;
|
|
145
196
|
/**
|