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