@progress/kendo-angular-buttons 6.4.1 → 7.0.0-dev.202201180832
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-buttons.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/button/button.directive.js +236 -89
- package/dist/es/button/button.service.js +1 -5
- package/dist/es/buttongroup/buttongroup.component.js +11 -60
- package/dist/es/chip/chip-list.component.js +57 -7
- package/dist/es/chip/chip.component.js +175 -86
- package/dist/es/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/es/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/{es2015/button-look.js → es/common/models/styling-classes.js} +0 -0
- package/dist/es/{button-look.js → common/models.js} +0 -0
- package/dist/es/dropdownbutton/dropdownbutton.component.js +89 -36
- package/dist/es/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/es/focusable/focusable.directive.js +4 -4
- package/dist/es/listbutton/list-button.js +4 -1
- package/dist/es/listbutton/list.component.js +20 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/splitbutton/splitbutton.component.js +107 -37
- package/dist/es/util.js +52 -0
- package/dist/es2015/button/button.directive.d.ts +85 -22
- package/dist/es2015/button/button.directive.js +219 -85
- package/dist/es2015/button/button.service.d.ts +1 -4
- package/dist/es2015/button/button.service.js +1 -5
- package/dist/es2015/buttongroup/buttongroup.component.d.ts +0 -15
- package/dist/es2015/buttongroup/buttongroup.component.js +11 -48
- package/dist/es2015/chip/chip-list.component.d.ts +19 -3
- package/dist/es2015/chip/chip-list.component.js +52 -7
- package/dist/es2015/chip/chip.component.d.ts +67 -32
- package/dist/es2015/chip/chip.component.js +186 -97
- package/dist/es2015/common/models/fillmode.d.ts +12 -0
- package/dist/es2015/{chip/models/type.js → common/models/fillmode.js} +0 -0
- package/dist/es2015/common/models/rounded.d.ts +12 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/shape.d.ts +2 -9
- package/dist/es2015/common/models/size.d.ts +9 -6
- package/dist/es2015/common/models/styling-classes.d.ts +11 -0
- package/dist/es2015/common/models/styling-classes.js +4 -0
- package/dist/es2015/common/models/theme-color.d.ts +15 -4
- package/dist/es2015/common/models.d.ts +10 -0
- package/dist/es2015/{chip/models/chip-look.js → common/models.js} +0 -0
- package/dist/es2015/dropdownbutton/dropdownbutton.component.d.ts +59 -7
- package/dist/es2015/dropdownbutton/dropdownbutton.component.js +92 -31
- package/dist/es2015/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.d.ts +28 -21
- package/dist/es2015/floatingactionbutton/floatingactionbutton.component.js +62 -42
- package/dist/es2015/focusable/focusable.directive.js +4 -4
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/listbutton/list-button.js +4 -1
- package/dist/es2015/listbutton/list.component.d.ts +3 -0
- package/dist/es2015/listbutton/list.component.js +37 -20
- package/dist/es2015/main.d.ts +4 -4
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/splitbutton/splitbutton.component.d.ts +59 -12
- package/dist/es2015/splitbutton/splitbutton.component.js +113 -33
- package/dist/es2015/util.d.ts +21 -0
- package/dist/es2015/util.js +52 -0
- package/dist/fesm2015/index.js +862 -409
- package/dist/fesm5/index.js +853 -405
- package/dist/npm/button/button.directive.js +236 -89
- package/dist/npm/button/button.service.js +0 -4
- package/dist/npm/buttongroup/buttongroup.component.js +11 -60
- package/dist/npm/chip/chip-list.component.js +55 -5
- package/dist/npm/chip/chip.component.js +173 -84
- package/dist/npm/{chip/models/chip-look.js → common/models/fillmode.js} +0 -0
- package/dist/npm/{chip/models/type.js → common/models/rounded.js} +0 -0
- package/dist/npm/common/models/styling-classes.js +6 -0
- package/dist/npm/{button-look.js → common/models.js} +0 -0
- package/dist/npm/dropdownbutton/dropdownbutton.component.js +89 -36
- package/dist/npm/floatingactionbutton/dial-item.component.js +1 -1
- package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +66 -41
- package/dist/npm/focusable/focusable.directive.js +4 -4
- package/dist/npm/listbutton/list-button.js +4 -1
- package/dist/npm/listbutton/list.component.js +20 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/splitbutton/splitbutton.component.js +105 -35
- package/dist/npm/util.js +52 -0
- package/dist/systemjs/kendo-angular-buttons.js +1 -1
- package/package.json +14 -11
- package/dist/es2015/button-look.d.ts +0 -21
- package/dist/es2015/chip/models/chip-look.d.ts +0 -20
- package/dist/es2015/chip/models/type.d.ts +0 -21
|
@@ -10,6 +10,8 @@ import { isChanged, Keys } from '@progress/kendo-angular-common';
|
|
|
10
10
|
import { KendoButtonService } from '../button/button.service';
|
|
11
11
|
import { isPresent } from '../util';
|
|
12
12
|
import { PreventableEvent } from '../preventable-event';
|
|
13
|
+
import { packageMetadata } from '../package-metadata';
|
|
14
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
15
|
/**
|
|
14
16
|
* @hidden
|
|
15
17
|
*/
|
|
@@ -26,23 +28,13 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
26
28
|
* By default, the selection mode of the ButtonGroup is set to `multiple`.
|
|
27
29
|
*/
|
|
28
30
|
this.selection = 'multiple';
|
|
29
|
-
/**
|
|
30
|
-
* Changes the visual appearance by using alternative styling options
|
|
31
|
-
* ([more information and examples]({% slug styling_buttongroup %})).
|
|
32
|
-
* The `look` property of the ButtonGroup takes precedence over the `look` property
|
|
33
|
-
* of the individual buttons that are part of the group.
|
|
34
|
-
*
|
|
35
|
-
* The available values are:
|
|
36
|
-
* * `flat`
|
|
37
|
-
* * `outline`
|
|
38
|
-
*/
|
|
39
|
-
this.look = 'default';
|
|
40
31
|
/**
|
|
41
32
|
* Fires every time keyboard navigation occurs.
|
|
42
33
|
*/
|
|
43
34
|
this.navigate = new EventEmitter();
|
|
44
35
|
this._tabIndex = 0;
|
|
45
36
|
this.currentTabIndex = 0;
|
|
37
|
+
validatePackage(packageMetadata);
|
|
46
38
|
this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
|
|
47
39
|
var rtl = _a.rtl;
|
|
48
40
|
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
@@ -83,27 +75,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
83
75
|
enumerable: true,
|
|
84
76
|
configurable: true
|
|
85
77
|
});
|
|
86
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "isFlat", {
|
|
87
|
-
get: function () {
|
|
88
|
-
return this.look === 'flat';
|
|
89
|
-
},
|
|
90
|
-
enumerable: true,
|
|
91
|
-
configurable: true
|
|
92
|
-
});
|
|
93
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "isBare", {
|
|
94
|
-
get: function () {
|
|
95
|
-
return this.look === 'bare';
|
|
96
|
-
},
|
|
97
|
-
enumerable: true,
|
|
98
|
-
configurable: true
|
|
99
|
-
});
|
|
100
|
-
Object.defineProperty(ButtonGroupComponent.prototype, "isOutline", {
|
|
101
|
-
get: function () {
|
|
102
|
-
return this.look === 'outline';
|
|
103
|
-
},
|
|
104
|
-
enumerable: true,
|
|
105
|
-
configurable: true
|
|
106
|
-
});
|
|
107
78
|
Object.defineProperty(ButtonGroupComponent.prototype, "getRole", {
|
|
108
79
|
get: function () {
|
|
109
80
|
return this.isSelectionSingle() ? 'radiogroup' : 'group';
|
|
@@ -169,7 +140,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
169
140
|
};
|
|
170
141
|
ButtonGroupComponent.prototype.ngOnInit = function () {
|
|
171
142
|
var _this = this;
|
|
172
|
-
this.service.setButtonLook(this.look);
|
|
173
143
|
this.subscription = this.service.buttonClicked$.subscribe(function (button) {
|
|
174
144
|
var newSelectionValue;
|
|
175
145
|
if (_this.isSelectionSingle()) {
|
|
@@ -183,7 +153,7 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
183
153
|
if (button.togglable) {
|
|
184
154
|
button.setSelected(newSelectionValue);
|
|
185
155
|
}
|
|
186
|
-
button.setAttribute(tabindex,
|
|
156
|
+
button.setAttribute(tabindex, '0');
|
|
187
157
|
});
|
|
188
158
|
};
|
|
189
159
|
ButtonGroupComponent.prototype.ngOnChanges = function (change) {
|
|
@@ -199,10 +169,10 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
199
169
|
ButtonGroupComponent.prototype.ngAfterContentInit = function () {
|
|
200
170
|
this.buttons.forEach(function (button) {
|
|
201
171
|
if (button.selected) {
|
|
202
|
-
button.setAttribute(tabindex,
|
|
172
|
+
button.setAttribute(tabindex, '0');
|
|
203
173
|
}
|
|
204
174
|
else {
|
|
205
|
-
button.setAttribute(tabindex,
|
|
175
|
+
button.setAttribute(tabindex, '-1');
|
|
206
176
|
}
|
|
207
177
|
});
|
|
208
178
|
};
|
|
@@ -246,24 +216,24 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
246
216
|
ButtonGroupComponent.prototype.deactivate = function (buttons) {
|
|
247
217
|
buttons.forEach(function (button) {
|
|
248
218
|
button.setSelected(false);
|
|
249
|
-
button.setAttribute(tabindex,
|
|
219
|
+
button.setAttribute(tabindex, '-1');
|
|
250
220
|
});
|
|
251
221
|
};
|
|
252
222
|
ButtonGroupComponent.prototype.activate = function (buttons) {
|
|
253
223
|
buttons.forEach(function (button) {
|
|
254
224
|
button.setSelected(true);
|
|
255
|
-
button.setAttribute(tabindex,
|
|
225
|
+
button.setAttribute(tabindex, '0');
|
|
256
226
|
button.focus();
|
|
257
227
|
});
|
|
258
228
|
};
|
|
259
229
|
ButtonGroupComponent.prototype.defocus = function (buttons) {
|
|
260
230
|
buttons.forEach(function (button) {
|
|
261
|
-
button.setAttribute(tabindex,
|
|
231
|
+
button.setAttribute(tabindex, '-1');
|
|
262
232
|
});
|
|
263
233
|
};
|
|
264
234
|
ButtonGroupComponent.prototype.focus = function (buttons) {
|
|
265
235
|
buttons.forEach(function (button) {
|
|
266
|
-
button.setAttribute(tabindex,
|
|
236
|
+
button.setAttribute(tabindex, '0');
|
|
267
237
|
button.focus();
|
|
268
238
|
});
|
|
269
239
|
};
|
|
@@ -289,10 +259,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
289
259
|
Input('width'),
|
|
290
260
|
tslib_1.__metadata("design:type", String)
|
|
291
261
|
], ButtonGroupComponent.prototype, "width", void 0);
|
|
292
|
-
tslib_1.__decorate([
|
|
293
|
-
Input(),
|
|
294
|
-
tslib_1.__metadata("design:type", String)
|
|
295
|
-
], ButtonGroupComponent.prototype, "look", void 0);
|
|
296
262
|
tslib_1.__decorate([
|
|
297
263
|
Input(),
|
|
298
264
|
tslib_1.__metadata("design:type", Number),
|
|
@@ -312,7 +278,7 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
312
278
|
tslib_1.__metadata("design:paramtypes", [])
|
|
313
279
|
], ButtonGroupComponent.prototype, "wrapperClass", null);
|
|
314
280
|
tslib_1.__decorate([
|
|
315
|
-
HostBinding('class.k-
|
|
281
|
+
HostBinding('class.k-disabled'),
|
|
316
282
|
tslib_1.__metadata("design:type", Boolean),
|
|
317
283
|
tslib_1.__metadata("design:paramtypes", [])
|
|
318
284
|
], ButtonGroupComponent.prototype, "disabledClass", null);
|
|
@@ -321,21 +287,6 @@ var ButtonGroupComponent = /** @class */ (function () {
|
|
|
321
287
|
tslib_1.__metadata("design:type", Boolean),
|
|
322
288
|
tslib_1.__metadata("design:paramtypes", [])
|
|
323
289
|
], ButtonGroupComponent.prototype, "stretchedClass", null);
|
|
324
|
-
tslib_1.__decorate([
|
|
325
|
-
HostBinding('class.k-button-group-flat'),
|
|
326
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
327
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
328
|
-
], ButtonGroupComponent.prototype, "isFlat", null);
|
|
329
|
-
tslib_1.__decorate([
|
|
330
|
-
HostBinding('class.k-button-group-bare'),
|
|
331
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
332
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
333
|
-
], ButtonGroupComponent.prototype, "isBare", null);
|
|
334
|
-
tslib_1.__decorate([
|
|
335
|
-
HostBinding('class.k-button-group-outline'),
|
|
336
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
337
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
338
|
-
], ButtonGroupComponent.prototype, "isOutline", null);
|
|
339
290
|
tslib_1.__decorate([
|
|
340
291
|
HostBinding('attr.role'),
|
|
341
292
|
tslib_1.__metadata("design:type", String),
|
|
@@ -3,14 +3,17 @@
|
|
|
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
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
|
+
import { packageMetadata } from '../package-metadata';
|
|
10
12
|
var ChipListComponent = /** @class */ (function () {
|
|
11
|
-
function ChipListComponent(localizationService, renderer) {
|
|
13
|
+
function ChipListComponent(localizationService, renderer, element) {
|
|
12
14
|
this.localizationService = localizationService;
|
|
13
15
|
this.renderer = renderer;
|
|
16
|
+
this.element = element;
|
|
14
17
|
this.hostClass = true;
|
|
15
18
|
/**
|
|
16
19
|
* Sets the selection mode of the ChipList.
|
|
@@ -30,8 +33,31 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
30
33
|
*/
|
|
31
34
|
this.remove = new EventEmitter();
|
|
32
35
|
this.role = 'listbox';
|
|
36
|
+
this._size = 'medium';
|
|
37
|
+
validatePackage(packageMetadata);
|
|
33
38
|
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
34
39
|
}
|
|
40
|
+
Object.defineProperty(ChipListComponent.prototype, "size", {
|
|
41
|
+
get: function () {
|
|
42
|
+
return this._size;
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* The size property specifies the gap between the Chips in the ChipList
|
|
46
|
+
* ([see example]({% slug appearance_chiplist %}#toc-size)).
|
|
47
|
+
*
|
|
48
|
+
* The possible values are:
|
|
49
|
+
* * `'small'`
|
|
50
|
+
* * `'medium'` (default)
|
|
51
|
+
* * `'large'`
|
|
52
|
+
* * `null`
|
|
53
|
+
*/
|
|
54
|
+
set: function (size) {
|
|
55
|
+
this.handleClasses(size, 'size');
|
|
56
|
+
this._size = size;
|
|
57
|
+
},
|
|
58
|
+
enumerable: true,
|
|
59
|
+
configurable: true
|
|
60
|
+
});
|
|
35
61
|
Object.defineProperty(ChipListComponent.prototype, "single", {
|
|
36
62
|
get: function () {
|
|
37
63
|
return this.selection === 'single';
|
|
@@ -51,7 +77,7 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
51
77
|
*/
|
|
52
78
|
ChipListComponent.prototype.onClick = function ($event) {
|
|
53
79
|
var target = $event.target;
|
|
54
|
-
var isRemoveClicked = closest(target, '.k-remove-
|
|
80
|
+
var isRemoveClicked = closest(target, '.k-chip-remove-action');
|
|
55
81
|
var clickedChip = closest(target, '.k-chip');
|
|
56
82
|
var chip = this.chips.find(function (chip) { return clickedChip === chip.element.nativeElement; });
|
|
57
83
|
if (isRemoveClicked && clickedChip) {
|
|
@@ -70,6 +96,13 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
70
96
|
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
71
97
|
});
|
|
72
98
|
};
|
|
99
|
+
ChipListComponent.prototype.ngAfterViewInit = function () {
|
|
100
|
+
var _this = this;
|
|
101
|
+
var stylingInputs = ['size'];
|
|
102
|
+
stylingInputs.forEach(function (input) {
|
|
103
|
+
_this.handleClasses(_this[input], input);
|
|
104
|
+
});
|
|
105
|
+
};
|
|
73
106
|
ChipListComponent.prototype.ngAfterContentInit = function () {
|
|
74
107
|
var _this = this;
|
|
75
108
|
this.chips.forEach(function (chip) {
|
|
@@ -101,6 +134,16 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
101
134
|
}
|
|
102
135
|
});
|
|
103
136
|
};
|
|
137
|
+
ChipListComponent.prototype.handleClasses = function (value, input) {
|
|
138
|
+
var elem = this.element.nativeElement;
|
|
139
|
+
var classes = getStylingClasses('chip-list', input, this[input], value);
|
|
140
|
+
if (classes.toRemove) {
|
|
141
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
142
|
+
}
|
|
143
|
+
if (classes.toAdd) {
|
|
144
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
104
147
|
tslib_1.__decorate([
|
|
105
148
|
HostBinding('class.k-chip-list'),
|
|
106
149
|
tslib_1.__metadata("design:type", Boolean)
|
|
@@ -113,6 +156,11 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
113
156
|
Input(),
|
|
114
157
|
tslib_1.__metadata("design:type", String)
|
|
115
158
|
], ChipListComponent.prototype, "selection", void 0);
|
|
159
|
+
tslib_1.__decorate([
|
|
160
|
+
Input(),
|
|
161
|
+
tslib_1.__metadata("design:type", String),
|
|
162
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
163
|
+
], ChipListComponent.prototype, "size", null);
|
|
116
164
|
tslib_1.__decorate([
|
|
117
165
|
Output(),
|
|
118
166
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -147,17 +195,19 @@ var ChipListComponent = /** @class */ (function () {
|
|
|
147
195
|
], ChipListComponent.prototype, "onClick", null);
|
|
148
196
|
ChipListComponent = tslib_1.__decorate([
|
|
149
197
|
Component({
|
|
150
|
-
selector: 'kendo-
|
|
198
|
+
selector: 'kendo-chiplist, kendo-chip-list',
|
|
151
199
|
template: "\n <ng-content></ng-content>\n ",
|
|
152
200
|
providers: [
|
|
153
201
|
LocalizationService,
|
|
154
202
|
{
|
|
155
203
|
provide: L10N_PREFIX,
|
|
156
|
-
useValue: 'kendo.
|
|
204
|
+
useValue: 'kendo.chiplist'
|
|
157
205
|
}
|
|
158
206
|
]
|
|
159
207
|
}),
|
|
160
|
-
tslib_1.__metadata("design:paramtypes", [LocalizationService,
|
|
208
|
+
tslib_1.__metadata("design:paramtypes", [LocalizationService,
|
|
209
|
+
Renderer2,
|
|
210
|
+
ElementRef])
|
|
161
211
|
], ChipListComponent);
|
|
162
212
|
return ChipListComponent;
|
|
163
213
|
}());
|