@progress/kendo-angular-buttons 6.4.1 → 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 +12 -9
- 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,14 +3,15 @@
|
|
|
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, Input, HostBinding, ContentChildren, QueryList, EventEmitter, Output, HostListener, Renderer2 } from '@angular/core';
|
|
6
|
+
import { Component, Input, HostBinding, ContentChildren, QueryList, EventEmitter, Output, HostListener, Renderer2, ElementRef } from '@angular/core';
|
|
7
7
|
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { ChipComponent } from './chip.component';
|
|
9
|
-
import { closest } from '../util';
|
|
9
|
+
import { closest, getStylingClasses } from '../util';
|
|
10
10
|
var ChipListComponent = /** @class */ (function () {
|
|
11
|
-
function ChipListComponent(localizationService, renderer) {
|
|
11
|
+
function ChipListComponent(localizationService, renderer, element) {
|
|
12
12
|
this.localizationService = localizationService;
|
|
13
13
|
this.renderer = renderer;
|
|
14
|
+
this.element = element;
|
|
14
15
|
this.hostClass = true;
|
|
15
16
|
/**
|
|
16
17
|
* Sets the selection mode of the ChipList.
|
|
@@ -30,8 +31,30 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
30
31
|
*/
|
|
31
32
|
this.remove = new EventEmitter();
|
|
32
33
|
this.role = 'listbox';
|
|
34
|
+
this._size = 'medium';
|
|
33
35
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
34
36
|
}
|
|
37
|
+
Object.defineProperty(ChipListComponent.prototype, "size", {
|
|
38
|
+
get: function () {
|
|
39
|
+
return this._size;
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* The size property specifies the gap between the Chips in the ChipList
|
|
43
|
+
* ([see example]({% slug appearance_chiplist %}#toc-size)).
|
|
44
|
+
*
|
|
45
|
+
* The possible values are:
|
|
46
|
+
* * `'small'`
|
|
47
|
+
* * `'medium'` (default)
|
|
48
|
+
* * `'large'`
|
|
49
|
+
* * `null`
|
|
50
|
+
*/
|
|
51
|
+
set: function (size) {
|
|
52
|
+
this.handleClasses(size, 'size');
|
|
53
|
+
this._size = size;
|
|
54
|
+
},
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true
|
|
57
|
+
});
|
|
35
58
|
Object.defineProperty(ChipListComponent.prototype, "single", {
|
|
36
59
|
get: function () {
|
|
37
60
|
return this.selection === 'single';
|
|
@@ -51,7 +74,7 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
51
74
|
*/
|
|
52
75
|
ChipListComponent.prototype.onClick = function ($event) {
|
|
53
76
|
var target = $event.target;
|
|
54
|
-
var isRemoveClicked = closest(target, '.k-remove-
|
|
77
|
+
var isRemoveClicked = closest(target, '.k-chip-remove-action');
|
|
55
78
|
var clickedChip = closest(target, '.k-chip');
|
|
56
79
|
var chip = this.chips.find(function (chip) { return clickedChip === chip.element.nativeElement; });
|
|
57
80
|
if (isRemoveClicked && clickedChip) {
|
|
@@ -70,6 +93,13 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
70
93
|
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
71
94
|
});
|
|
72
95
|
};
|
|
96
|
+
ChipListComponent.prototype.ngAfterViewInit = function () {
|
|
97
|
+
var _this = this;
|
|
98
|
+
var stylingInputs = ['size'];
|
|
99
|
+
stylingInputs.forEach(function (input) {
|
|
100
|
+
_this.handleClasses(_this[input], input);
|
|
101
|
+
});
|
|
102
|
+
};
|
|
73
103
|
ChipListComponent.prototype.ngAfterContentInit = function () {
|
|
74
104
|
var _this = this;
|
|
75
105
|
this.chips.forEach(function (chip) {
|
|
@@ -101,6 +131,16 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
101
131
|
}
|
|
102
132
|
});
|
|
103
133
|
};
|
|
134
|
+
ChipListComponent.prototype.handleClasses = function (value, input) {
|
|
135
|
+
var elem = this.element.nativeElement;
|
|
136
|
+
var classes = getStylingClasses('chip-list', input, this[input], value);
|
|
137
|
+
if (classes.toRemove) {
|
|
138
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
139
|
+
}
|
|
140
|
+
if (classes.toAdd) {
|
|
141
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
104
144
|
tslib_1.__decorate([
|
|
105
145
|
HostBinding('class.k-chip-list'),
|
|
106
146
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -113,6 +153,11 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
113
153
|
Input(),
|
|
114
154
|
tslib_1.__metadata("design:type", String)
|
|
115
155
|
], ChipListComponent.prototype, "selection", void 0);
|
|
156
|
+
tslib_1.__decorate([
|
|
157
|
+
Input(),
|
|
158
|
+
tslib_1.__metadata("design:type", String),
|
|
159
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
160
|
+
], ChipListComponent.prototype, "size", null);
|
|
116
161
|
tslib_1.__decorate([
|
|
117
162
|
Output(),
|
|
118
163
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -147,17 +192,19 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
147
192
|
], ChipListComponent.prototype, "onClick", null);
|
|
148
193
|
ChipListComponent = tslib_1.__decorate([
|
|
149
194
|
Component({
|
|
150
|
-
selector: 'kendo-
|
|
195
|
+
selector: 'kendo-chiplist, kendo-chip-list',
|
|
151
196
|
template: "\n <ng-content></ng-content>\n ",
|
|
152
197
|
providers: [
|
|
153
198
|
LocalizationService,
|
|
154
199
|
{
|
|
155
200
|
provide: L10N_PREFIX,
|
|
156
|
-
useValue: 'kendo.
|
|
201
|
+
useValue: 'kendo.chiplist'
|
|
157
202
|
}
|
|
158
203
|
]
|
|
159
204
|
}),
|
|
160
|
-
tslib_1.__metadata("design:paramtypes", [LocalizationService,
|
|
205
|
+
tslib_1.__metadata("design:paramtypes", [LocalizationService,
|
|
206
|
+
Renderer2,
|
|
207
|
+
ElementRef])
|
|
161
208
|
], ChipListComponent);
|
|
162
209
|
return ChipListComponent;
|
|
163
210
|
}());
|
|
@@ -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 @@ var ChipComponent = /** @class */ (function () {
|
|
|
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,34 +44,111 @@ var ChipComponent = /** @class */ (function () {
|
|
|
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
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
55
|
+
Object.defineProperty(ChipComponent.prototype, "size", {
|
|
70
56
|
get: function () {
|
|
71
|
-
return this.
|
|
57
|
+
return this._size;
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* The size property specifies the height, padding and line height of the Chip
|
|
61
|
+
* ([see example]({% slug appearance_chip %}#toc-size)).
|
|
62
|
+
*
|
|
63
|
+
* The possible values are:
|
|
64
|
+
* * `'small'`
|
|
65
|
+
* * `'medium'` (default)
|
|
66
|
+
* * `'large'`
|
|
67
|
+
* * `null`
|
|
68
|
+
*/
|
|
69
|
+
set: function (size) {
|
|
70
|
+
this.handleClasses(size, 'size');
|
|
71
|
+
this._size = size;
|
|
72
72
|
},
|
|
73
73
|
enumerable: true,
|
|
74
74
|
configurable: true
|
|
75
75
|
});
|
|
76
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
76
|
+
Object.defineProperty(ChipComponent.prototype, "rounded", {
|
|
77
77
|
get: function () {
|
|
78
|
-
return this.
|
|
78
|
+
return this._rounded;
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* The rounded property specifies the border radius of the Chip
|
|
82
|
+
* ([see example]({% slug appearance_chip %}#toc-rounded)).
|
|
83
|
+
*
|
|
84
|
+
* The possible values are:
|
|
85
|
+
* * `'small'`
|
|
86
|
+
* * `'medium'` (default)
|
|
87
|
+
* * `'large'`
|
|
88
|
+
* * `'full'`
|
|
89
|
+
* * `null`
|
|
90
|
+
*/
|
|
91
|
+
set: function (rounded) {
|
|
92
|
+
this.handleClasses(rounded, 'rounded');
|
|
93
|
+
this._rounded = rounded;
|
|
79
94
|
},
|
|
80
95
|
enumerable: true,
|
|
81
96
|
configurable: true
|
|
82
97
|
});
|
|
83
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
98
|
+
Object.defineProperty(ChipComponent.prototype, "fillMode", {
|
|
84
99
|
get: function () {
|
|
85
|
-
return this.
|
|
100
|
+
return this._fillMode;
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* The fillMode property specifies the background and border styles of the Chip
|
|
104
|
+
* ([see example]({% slug appearance_chip %}#toc-fillMode)).
|
|
105
|
+
*
|
|
106
|
+
* The possible values are:
|
|
107
|
+
* * `'solid'` (default)
|
|
108
|
+
* * `'outline'`
|
|
109
|
+
* * `null`
|
|
110
|
+
*/
|
|
111
|
+
set: function (fillMode) {
|
|
112
|
+
this.handleClasses(fillMode, 'fillMode');
|
|
113
|
+
this._fillMode = fillMode;
|
|
114
|
+
},
|
|
115
|
+
enumerable: true,
|
|
116
|
+
configurable: true
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(ChipComponent.prototype, "themeColor", {
|
|
119
|
+
get: function () {
|
|
120
|
+
return this._themeColor;
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* The Chip allows you to specify predefined theme colors.
|
|
124
|
+
* The theme color will be applied as a background and border color while also amending the text color accordingly
|
|
125
|
+
* ([see example]({% slug appearance_chip %}#toc-themeColor)).
|
|
126
|
+
*
|
|
127
|
+
* The possible values are:
|
|
128
|
+
* * `'base'` (default)
|
|
129
|
+
* * `'info'`
|
|
130
|
+
* * `'success'`
|
|
131
|
+
* * `'warning'`
|
|
132
|
+
* * `'error'`
|
|
133
|
+
* * `null`
|
|
134
|
+
*/
|
|
135
|
+
set: function (themeColor) {
|
|
136
|
+
this.handleThemeColor(themeColor);
|
|
137
|
+
this._themeColor = themeColor;
|
|
138
|
+
},
|
|
139
|
+
enumerable: true,
|
|
140
|
+
configurable: true
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(ChipComponent.prototype, "ariaChecked", {
|
|
143
|
+
get: function () {
|
|
144
|
+
return this.selected;
|
|
86
145
|
},
|
|
87
146
|
enumerable: true,
|
|
88
147
|
configurable: true
|
|
89
148
|
});
|
|
90
149
|
Object.defineProperty(ChipComponent.prototype, "hasIconClass", {
|
|
91
150
|
get: function () {
|
|
92
|
-
return this.icon || this.iconClass ? true : false;
|
|
151
|
+
return this.icon || this.iconClass || this.avatarClass ? true : false;
|
|
93
152
|
},
|
|
94
153
|
enumerable: true,
|
|
95
154
|
configurable: true
|
|
@@ -132,44 +191,48 @@ var ChipComponent = /** @class */ (function () {
|
|
|
132
191
|
}
|
|
133
192
|
};
|
|
134
193
|
ChipComponent.prototype.ngAfterViewInit = function () {
|
|
194
|
+
var _this = this;
|
|
135
195
|
var chip = this.element.nativeElement;
|
|
136
|
-
var
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
196
|
+
var stylingOptions = ['size', 'rounded', 'fillMode'];
|
|
197
|
+
stylingOptions.forEach(function (input) {
|
|
198
|
+
_this.handleClasses(_this[input], input);
|
|
199
|
+
});
|
|
140
200
|
this.attachElementEventHandlers(chip);
|
|
141
201
|
};
|
|
142
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
202
|
+
Object.defineProperty(ChipComponent.prototype, "kendoIconClass", {
|
|
143
203
|
/**
|
|
144
204
|
* @hidden
|
|
145
205
|
*/
|
|
146
206
|
get: function () {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
classes.push("" + this.iconClass);
|
|
150
|
-
}
|
|
151
|
-
if (this.icon) {
|
|
152
|
-
classes.push("k-icon k-i-" + this.icon);
|
|
153
|
-
}
|
|
154
|
-
return classes;
|
|
207
|
+
this.verifyIconSettings([this.iconClass, this.avatarClass]);
|
|
208
|
+
return "k-i-" + this.icon;
|
|
155
209
|
},
|
|
156
210
|
enumerable: true,
|
|
157
211
|
configurable: true
|
|
158
212
|
});
|
|
159
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
213
|
+
Object.defineProperty(ChipComponent.prototype, "customIconClass", {
|
|
160
214
|
/**
|
|
161
215
|
* @hidden
|
|
162
216
|
*/
|
|
163
217
|
get: function () {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
218
|
+
this.verifyIconSettings([this.icon, this.avatarClass]);
|
|
219
|
+
return "" + this.iconClass;
|
|
220
|
+
},
|
|
221
|
+
enumerable: true,
|
|
222
|
+
configurable: true
|
|
223
|
+
});
|
|
224
|
+
Object.defineProperty(ChipComponent.prototype, "chipAvatarClass", {
|
|
225
|
+
/**
|
|
226
|
+
* @hidden
|
|
227
|
+
*/
|
|
228
|
+
get: function () {
|
|
229
|
+
this.verifyIconSettings([this.icon, this.iconClass]);
|
|
230
|
+
return "" + this.avatarClass;
|
|
168
231
|
},
|
|
169
232
|
enumerable: true,
|
|
170
233
|
configurable: true
|
|
171
234
|
});
|
|
172
|
-
Object.defineProperty(ChipComponent.prototype, "
|
|
235
|
+
Object.defineProperty(ChipComponent.prototype, "removeIconClass", {
|
|
173
236
|
/**
|
|
174
237
|
* @hidden
|
|
175
238
|
*/
|
|
@@ -177,23 +240,11 @@ var ChipComponent = /** @class */ (function () {
|
|
|
177
240
|
if (this.removeIcon) {
|
|
178
241
|
return "" + this.removeIcon;
|
|
179
242
|
}
|
|
180
|
-
return "k-
|
|
243
|
+
return "k-i-close-circle";
|
|
181
244
|
},
|
|
182
245
|
enumerable: true,
|
|
183
246
|
configurable: true
|
|
184
247
|
});
|
|
185
|
-
/**
|
|
186
|
-
* @hidden
|
|
187
|
-
*/
|
|
188
|
-
ChipComponent.prototype.typeClass = function () {
|
|
189
|
-
return {
|
|
190
|
-
'none': '',
|
|
191
|
-
'success': 'k-chip-success',
|
|
192
|
-
'warning': 'k-chip-warning',
|
|
193
|
-
'error': 'k-chip-error',
|
|
194
|
-
'info': 'k-chip-info'
|
|
195
|
-
}[this.type];
|
|
196
|
-
};
|
|
197
248
|
/**
|
|
198
249
|
* Focuses the Chip component.
|
|
199
250
|
*/
|
|
@@ -228,7 +279,7 @@ var ChipComponent = /** @class */ (function () {
|
|
|
228
279
|
_this.renderer.removeClass(chip, 'k-focus');
|
|
229
280
|
});
|
|
230
281
|
var contentClickListener = _this.renderer.listen(chip, 'click', function (e) {
|
|
231
|
-
var isRemoveClicked = closest(e.target, '.k-remove-
|
|
282
|
+
var isRemoveClicked = closest(e.target, '.k-chip-remove-action');
|
|
232
283
|
if (!isRemoveClicked) {
|
|
233
284
|
_this.ngZone.run(function () {
|
|
234
285
|
_this.contentClick.emit({ sender: _this, originalEvent: e });
|
|
@@ -242,10 +293,42 @@ var ChipComponent = /** @class */ (function () {
|
|
|
242
293
|
};
|
|
243
294
|
});
|
|
244
295
|
};
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
296
|
+
/**
|
|
297
|
+
* @hidden
|
|
298
|
+
*/
|
|
299
|
+
ChipComponent.prototype.verifyIconSettings = function (iconsToCheck) {
|
|
300
|
+
if (isDevMode()) {
|
|
301
|
+
if (iconsToCheck.filter(function (icon) { return icon !== null && icon !== undefined; }).length > 0) {
|
|
302
|
+
this.renderer.removeClass(this.element.nativeElement, 'k-chip-has-icon');
|
|
303
|
+
throw new Error('Invalid configuration: Having multiple icons is not supported. Only a single icon on a chip can be displayed.');
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
ChipComponent.prototype.handleClasses = function (value, input) {
|
|
308
|
+
var elem = this.element.nativeElement;
|
|
309
|
+
var classes = getStylingClasses('chip', input, this[input], value);
|
|
310
|
+
if (input === 'fillMode') {
|
|
311
|
+
this.handleThemeColor(this.themeColor, this[input], value);
|
|
312
|
+
}
|
|
313
|
+
if (classes.toRemove) {
|
|
314
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
315
|
+
}
|
|
316
|
+
if (classes.toAdd) {
|
|
317
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
ChipComponent.prototype.handleThemeColor = function (value, prevFillMode, fillMode) {
|
|
321
|
+
var elem = this.element.nativeElement;
|
|
322
|
+
var removeFillMode = prevFillMode ? prevFillMode : this.fillMode;
|
|
323
|
+
var addFillMode = fillMode ? fillMode : this.fillMode;
|
|
324
|
+
var themeColorClass = getThemeColorClasses('chip', removeFillMode, addFillMode, this.themeColor, value);
|
|
325
|
+
this.renderer.removeClass(elem, themeColorClass.toRemove);
|
|
326
|
+
if (addFillMode !== null && fillMode !== null) {
|
|
327
|
+
if (themeColorClass.toAdd) {
|
|
328
|
+
this.renderer.addClass(elem, themeColorClass.toAdd);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
};
|
|
249
332
|
tslib_1.__decorate([
|
|
250
333
|
Input(),
|
|
251
334
|
tslib_1.__metadata("design:type", String)
|
|
@@ -260,12 +343,12 @@ var ChipComponent = /** @class */ (function () {
|
|
|
260
343
|
], ChipComponent.prototype, "iconClass", void 0);
|
|
261
344
|
tslib_1.__decorate([
|
|
262
345
|
Input(),
|
|
263
|
-
tslib_1.__metadata("design:type",
|
|
264
|
-
], ChipComponent.prototype, "
|
|
346
|
+
tslib_1.__metadata("design:type", String)
|
|
347
|
+
], ChipComponent.prototype, "avatarClass", void 0);
|
|
265
348
|
tslib_1.__decorate([
|
|
266
349
|
Input(),
|
|
267
|
-
tslib_1.__metadata("design:type",
|
|
268
|
-
], ChipComponent.prototype, "
|
|
350
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
351
|
+
], ChipComponent.prototype, "selected", void 0);
|
|
269
352
|
tslib_1.__decorate([
|
|
270
353
|
Input(),
|
|
271
354
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -274,14 +357,30 @@ var ChipComponent = /** @class */ (function () {
|
|
|
274
357
|
Input(),
|
|
275
358
|
tslib_1.__metadata("design:type", String)
|
|
276
359
|
], ChipComponent.prototype, "removeIcon", void 0);
|
|
277
|
-
tslib_1.__decorate([
|
|
278
|
-
Input(),
|
|
279
|
-
tslib_1.__metadata("design:type", String)
|
|
280
|
-
], ChipComponent.prototype, "type", void 0);
|
|
281
360
|
tslib_1.__decorate([
|
|
282
361
|
Input(),
|
|
283
362
|
tslib_1.__metadata("design:type", Boolean)
|
|
284
363
|
], ChipComponent.prototype, "disabled", void 0);
|
|
364
|
+
tslib_1.__decorate([
|
|
365
|
+
Input(),
|
|
366
|
+
tslib_1.__metadata("design:type", String),
|
|
367
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
368
|
+
], ChipComponent.prototype, "size", null);
|
|
369
|
+
tslib_1.__decorate([
|
|
370
|
+
Input(),
|
|
371
|
+
tslib_1.__metadata("design:type", String),
|
|
372
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
373
|
+
], ChipComponent.prototype, "rounded", null);
|
|
374
|
+
tslib_1.__decorate([
|
|
375
|
+
Input(),
|
|
376
|
+
tslib_1.__metadata("design:type", String),
|
|
377
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
378
|
+
], ChipComponent.prototype, "fillMode", null);
|
|
379
|
+
tslib_1.__decorate([
|
|
380
|
+
Input(),
|
|
381
|
+
tslib_1.__metadata("design:type", String),
|
|
382
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
383
|
+
], ChipComponent.prototype, "themeColor", null);
|
|
285
384
|
tslib_1.__decorate([
|
|
286
385
|
Output(),
|
|
287
386
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -303,16 +402,6 @@ var ChipComponent = /** @class */ (function () {
|
|
|
303
402
|
HostBinding('class.k-chip'),
|
|
304
403
|
tslib_1.__metadata("design:type", Boolean)
|
|
305
404
|
], ChipComponent.prototype, "hostClass", void 0);
|
|
306
|
-
tslib_1.__decorate([
|
|
307
|
-
HostBinding('class.k-chip-outline'),
|
|
308
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
309
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
310
|
-
], ChipComponent.prototype, "outlineClass", null);
|
|
311
|
-
tslib_1.__decorate([
|
|
312
|
-
HostBinding('class.k-chip-solid'),
|
|
313
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
314
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
315
|
-
], ChipComponent.prototype, "solidClass", null);
|
|
316
405
|
tslib_1.__decorate([
|
|
317
406
|
HostBinding('class.k-chip-has-icon'),
|
|
318
407
|
tslib_1.__metadata("design:type", Boolean),
|
|
@@ -341,7 +430,7 @@ var ChipComponent = /** @class */ (function () {
|
|
|
341
430
|
ChipComponent = tslib_1.__decorate([
|
|
342
431
|
Component({
|
|
343
432
|
selector: 'kendo-chip',
|
|
344
|
-
template: "\n <span
|
|
433
|
+
template: "\n <span\n *ngIf=\"icon\"\n class=\"k-chip-icon k-icon\"\n [ngClass]=\"kendoIconClass\"\n >\n </span>\n\n <span\n *ngIf=\"iconClass\"\n class=\"k-chip-icon\"\n [ngClass]=\"customIconClass\"\n >\n </span>\n\n <span\n *ngIf=\"avatarClass\"\n class=\"k-chip-avatar k-avatar k-rounded-full\"\n >\n <span class=\"k-avatar-image\" [ngClass]=\"chipAvatarClass\"></span>\n </span>\n\n <span class=\"k-chip-content\">\n <span class=\"k-chip-label\" *ngIf=\"label\">\n {{ label }}\n </span>\n <ng-content *ngIf=\"!label\"></ng-content>\n </span>\n\n <span class=\"k-chip-actions\">\n <span class=\"k-chip-action k-chip-remove-action\"\n *ngIf=\"removable\"\n (click)=\"onRemoveClick($event)\"\n >\n <span\n class=\"k-icon\"\n [ngClass]=\"removeIconClass\"\n >\n </span>\n </span>\n </span>\n ",
|
|
345
434
|
providers: [
|
|
346
435
|
LocalizationService,
|
|
347
436
|
{
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|