@progress/kendo-angular-dropdowns 5.5.0 → 6.0.0-dev.202201171002
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-dropdowns.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/autocomplete/autocomplete.component.js +120 -5
- package/dist/es/comboboxes/combobox.component.js +141 -20
- package/dist/es/comboboxes/multicolumncombobox.component.js +30 -10
- package/dist/es/common/list.component.js +97 -5
- package/dist/es/common/models/fillmode.js +4 -0
- package/dist/es/common/models/list-type.js +4 -0
- package/dist/es/common/models/rounded.js +4 -0
- package/dist/es/common/models/size.js +4 -0
- package/dist/es/common/searchbar.component.js +1 -1
- package/dist/es/common/selection/selectable.directive.js +2 -2
- package/dist/es/common/taglist.component.js +58 -5
- package/dist/es/common/util.js +37 -0
- package/dist/es/dropdownlist/dropdownlist.component.js +338 -46
- package/dist/es/dropdowntrees/dropdowntree.component.js +276 -42
- package/dist/es/dropdowntrees/multiselecttree.component.js +307 -46
- package/dist/es/multiselect/multiselect.component.js +162 -35
- package/dist/es/package-metadata.js +1 -1
- package/dist/es2015/autocomplete/autocomplete.component.d.ts +42 -0
- package/dist/es2015/autocomplete/autocomplete.component.js +109 -7
- package/dist/es2015/comboboxes/combobox.component.d.ts +49 -4
- package/dist/es2015/comboboxes/combobox.component.js +207 -106
- package/dist/es2015/comboboxes/multicolumncombobox.component.d.ts +9 -1
- package/dist/es2015/comboboxes/multicolumncombobox.component.js +185 -166
- package/dist/es2015/common/list.component.d.ts +26 -1
- package/dist/es2015/common/list.component.js +129 -37
- package/dist/es2015/common/models/fillmode.d.ts +14 -0
- package/dist/es2015/common/models/fillmode.js +4 -0
- package/dist/es2015/common/models/list-type.d.ts +8 -0
- package/dist/es2015/common/models/list-type.js +4 -0
- package/dist/es2015/common/models/rounded.d.ts +15 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/size.d.ts +14 -0
- package/dist/es2015/common/models/size.js +4 -0
- package/dist/es2015/common/searchbar.component.js +1 -1
- package/dist/es2015/common/selection/selectable.directive.js +2 -2
- package/dist/es2015/common/taglist.component.d.ts +13 -1
- package/dist/es2015/common/taglist.component.js +102 -47
- package/dist/es2015/common/util.d.ts +17 -0
- package/dist/es2015/common/util.js +37 -0
- package/dist/es2015/dropdownlist/dropdownlist.component.d.ts +77 -13
- package/dist/es2015/dropdownlist/dropdownlist.component.js +390 -159
- package/dist/es2015/dropdowntrees/dropdowntree.component.d.ts +71 -13
- package/dist/es2015/dropdowntrees/dropdowntree.component.js +287 -99
- package/dist/es2015/dropdowntrees/multiselecttree.component.d.ts +72 -12
- package/dist/es2015/dropdowntrees/multiselecttree.component.js +319 -117
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/multiselect/multiselect.component.d.ts +53 -8
- package/dist/es2015/multiselect/multiselect.component.js +183 -70
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/fesm2015/index.js +1974 -834
- package/dist/fesm5/index.js +1577 -225
- package/dist/npm/autocomplete/autocomplete.component.js +119 -4
- package/dist/npm/comboboxes/combobox.component.js +140 -19
- package/dist/npm/comboboxes/multicolumncombobox.component.js +29 -9
- package/dist/npm/common/list.component.js +96 -4
- package/dist/npm/common/models/fillmode.js +6 -0
- package/dist/npm/common/models/list-type.js +6 -0
- package/dist/npm/common/models/rounded.js +6 -0
- package/dist/npm/common/models/size.js +6 -0
- package/dist/npm/common/searchbar.component.js +1 -1
- package/dist/npm/common/selection/selectable.directive.js +2 -2
- package/dist/npm/common/taglist.component.js +56 -3
- package/dist/npm/common/util.js +37 -0
- package/dist/npm/dropdownlist/dropdownlist.component.js +336 -44
- package/dist/npm/dropdowntrees/dropdowntree.component.js +274 -40
- package/dist/npm/dropdowntrees/multiselecttree.component.js +304 -43
- package/dist/npm/multiselect/multiselect.component.js +160 -33
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-angular-dropdowns.js +1 -1
- package/package.json +18 -14
|
@@ -9,7 +9,7 @@ import { ListItemDirective } from './list-item.directive';
|
|
|
9
9
|
import { ItemTemplateDirective } from './templates/item-template.directive';
|
|
10
10
|
import { GroupTemplateDirective } from './templates/group-template.directive';
|
|
11
11
|
import { FixedGroupTemplateDirective } from './templates/fixed-group-template.directive';
|
|
12
|
-
import { isPresent, getter, closest } from './util';
|
|
12
|
+
import { isPresent, getter, closest, getSizeClass, getRoundedClass } from './util';
|
|
13
13
|
import { SelectionService } from './selection/selection.service';
|
|
14
14
|
import { fromEvent, merge } from 'rxjs';
|
|
15
15
|
import { map, tap, auditTime, switchMap, take } from 'rxjs/operators';
|
|
@@ -33,8 +33,9 @@ var ListComponent = /** @class */ (function () {
|
|
|
33
33
|
this.focused = -1;
|
|
34
34
|
this.show = true;
|
|
35
35
|
this.multipleSelection = false;
|
|
36
|
-
this.
|
|
36
|
+
this.type = 'list';
|
|
37
37
|
this.checkboxes = { enabled: false };
|
|
38
|
+
this.rounded = 'medium';
|
|
38
39
|
this.onClick = new EventEmitter();
|
|
39
40
|
this.pageChange = new EventEmitter();
|
|
40
41
|
this.listResize = new EventEmitter();
|
|
@@ -42,11 +43,13 @@ var ListComponent = /** @class */ (function () {
|
|
|
42
43
|
this.lastLoaded = 0;
|
|
43
44
|
this.lastScrollTop = 0;
|
|
44
45
|
this.scrollToFocused = false;
|
|
46
|
+
this._size = 'medium';
|
|
45
47
|
this.selectSubscription = merge(this.selectionService.onSelect.pipe(map(function (args) { return args.indices[0]; })), this.selectionService.onFocus)
|
|
46
48
|
.pipe(
|
|
47
49
|
// handle only the very last onSelect/onFocus emission
|
|
48
50
|
switchMap(function (event) { return _this.zone.onStable.pipe(take(1), map(function () { return event; })); }))
|
|
49
51
|
.subscribe(this.scrollToItem.bind(this));
|
|
52
|
+
this.prepareClasses();
|
|
50
53
|
}
|
|
51
54
|
Object.defineProperty(ListComponent.prototype, "data", {
|
|
52
55
|
get: function () {
|
|
@@ -58,6 +61,22 @@ var ListComponent = /** @class */ (function () {
|
|
|
58
61
|
enumerable: true,
|
|
59
62
|
configurable: true
|
|
60
63
|
});
|
|
64
|
+
Object.defineProperty(ListComponent.prototype, "size", {
|
|
65
|
+
get: function () {
|
|
66
|
+
return this._size;
|
|
67
|
+
},
|
|
68
|
+
set: function (size) {
|
|
69
|
+
if (this.type === 'list') {
|
|
70
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('list', this.size));
|
|
71
|
+
if (size) {
|
|
72
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('list', size));
|
|
73
|
+
}
|
|
74
|
+
this._size = size;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
enumerable: true,
|
|
78
|
+
configurable: true
|
|
79
|
+
});
|
|
61
80
|
Object.defineProperty(ListComponent.prototype, "pageSize", {
|
|
62
81
|
get: function () {
|
|
63
82
|
if (this.virtual.pageSize) {
|
|
@@ -86,21 +105,40 @@ var ListComponent = /** @class */ (function () {
|
|
|
86
105
|
enumerable: true,
|
|
87
106
|
configurable: true
|
|
88
107
|
});
|
|
108
|
+
Object.defineProperty(ListComponent.prototype, "checkboxClasses", {
|
|
109
|
+
/**
|
|
110
|
+
* @hidden
|
|
111
|
+
*/
|
|
112
|
+
get: function () {
|
|
113
|
+
return (this.size ? getSizeClass('checkbox', this.size) : '') + " " + (this.rounded ? getRoundedClass(this.rounded) : '');
|
|
114
|
+
},
|
|
115
|
+
enumerable: true,
|
|
116
|
+
configurable: true
|
|
117
|
+
});
|
|
89
118
|
ListComponent.prototype.ngOnChanges = function (changes) {
|
|
90
119
|
if (isChanged('data', changes, false)) {
|
|
91
120
|
if (this.lastLoaded <= 0) {
|
|
92
121
|
this.lastLoaded = this.data.length - 1;
|
|
93
122
|
this.scrollToFocused = !changes.data.isFirstChange();
|
|
94
123
|
}
|
|
124
|
+
this.setOverflow();
|
|
125
|
+
}
|
|
126
|
+
if (isChanged('virtual', changes, false)) {
|
|
127
|
+
this.setOverflow();
|
|
128
|
+
}
|
|
129
|
+
if (isChanged('type', changes, false)) {
|
|
130
|
+
this.prepareClasses();
|
|
95
131
|
}
|
|
96
132
|
};
|
|
97
133
|
ListComponent.prototype.ngAfterViewInit = function () {
|
|
98
134
|
var _this = this;
|
|
135
|
+
this.setComponentClasses();
|
|
99
136
|
this.zone.runOutsideAngular(function () {
|
|
100
137
|
_this.scrollSubscription = fromEvent(_this.content.nativeElement, "scroll").pipe(auditTime(100), tap(_this.prefetchData.bind(_this)), tap(_this.findCurrentGroup.bind(_this))).subscribe(function () {
|
|
101
138
|
_this.lastScrollTop = _this.content.nativeElement.scrollTop;
|
|
102
139
|
});
|
|
103
140
|
});
|
|
141
|
+
this.setOverflow();
|
|
104
142
|
};
|
|
105
143
|
ListComponent.prototype.ngAfterViewChecked = function () {
|
|
106
144
|
if (this.virtual) {
|
|
@@ -130,6 +168,28 @@ var ListComponent = /** @class */ (function () {
|
|
|
130
168
|
this.selectionService.unselect(index);
|
|
131
169
|
}
|
|
132
170
|
};
|
|
171
|
+
ListComponent.prototype.prepareClasses = function () {
|
|
172
|
+
if (this.type === 'list') {
|
|
173
|
+
this.listContentClass = 'k-list-content';
|
|
174
|
+
this.listClass = 'k-list-ul';
|
|
175
|
+
this.listItemClass = 'k-list-item';
|
|
176
|
+
this.listVirtualClass = 'k-virtual-list';
|
|
177
|
+
this.listGroupStickyHeaderClass = 'k-list-group-sticky-header';
|
|
178
|
+
this.listGroupStickyHeaderTextClass = 'k-list-header-text';
|
|
179
|
+
this.listGroupItemClass = 'k-list-group-item';
|
|
180
|
+
this.listGroupItemTextClass = 'k-list-item-text';
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this.listContentClass = 'k-table-body k-table-scroller';
|
|
184
|
+
this.listClass = 'k-table k-table-list';
|
|
185
|
+
this.listItemClass = 'k-table-row';
|
|
186
|
+
this.listVirtualClass = 'k-virtual-table';
|
|
187
|
+
this.listGroupStickyHeaderClass = 'k-table-group-sticky-header';
|
|
188
|
+
this.listGroupStickyHeaderTextClass = 'k-table-th';
|
|
189
|
+
this.listGroupItemClass = 'k-table-group-row';
|
|
190
|
+
this.listGroupItemTextClass = 'k-table-th';
|
|
191
|
+
}
|
|
192
|
+
};
|
|
133
193
|
ListComponent.prototype.isChecked = function (index) {
|
|
134
194
|
var normalizedIndex = this.virtual ? index + this.virtual.skip : index;
|
|
135
195
|
return this.selectionService.isSelected(normalizedIndex);
|
|
@@ -139,7 +199,7 @@ var ListComponent = /** @class */ (function () {
|
|
|
139
199
|
var content = this.content.nativeElement;
|
|
140
200
|
var rect = content.getBoundingClientRect();
|
|
141
201
|
// IE9 hack
|
|
142
|
-
var disabled = Array.prototype.slice.call(content.querySelectorAll(".k-
|
|
202
|
+
var disabled = Array.prototype.slice.call(content.querySelectorAll(".k-disabled"));
|
|
143
203
|
// This is a workaround for finding elements with pointer-events: none;
|
|
144
204
|
disabled.forEach(function (el) { return _this.renderer.setStyle(el, "pointer-events", "auto"); });
|
|
145
205
|
var item = document.elementFromPoint(rect.left + 1, rect.top + 1);
|
|
@@ -218,6 +278,9 @@ var ListComponent = /** @class */ (function () {
|
|
|
218
278
|
}
|
|
219
279
|
return this.disabledItemsService.isIndexDisabled(index);
|
|
220
280
|
};
|
|
281
|
+
ListComponent.prototype.isAltRow = function (index) {
|
|
282
|
+
return this.type === 'dropdowngrid' && index % 2 !== 0;
|
|
283
|
+
};
|
|
221
284
|
ListComponent.prototype.scrollToItem = function (index) {
|
|
222
285
|
var flatIndex = index;
|
|
223
286
|
if (this.dataService.grouped) {
|
|
@@ -276,6 +339,15 @@ var ListComponent = /** @class */ (function () {
|
|
|
276
339
|
var hasVirtualScroll = isPresent(this.virtual) && this.hasVirtualScrollbar();
|
|
277
340
|
return hasVirtualScroll || this.list.nativeElement.scrollHeight > this.content.nativeElement.offsetHeight;
|
|
278
341
|
};
|
|
342
|
+
/**
|
|
343
|
+
* Sets the list's content overflow (hides/shows scrollbar)
|
|
344
|
+
*/
|
|
345
|
+
ListComponent.prototype.setOverflow = function () {
|
|
346
|
+
if (this.virtual) {
|
|
347
|
+
var overflow = this.hasVirtualScrollbar() ? 'scroll' : 'hidden';
|
|
348
|
+
this.renderer.setStyle(this.content.nativeElement, 'overflow-y', overflow);
|
|
349
|
+
}
|
|
350
|
+
};
|
|
279
351
|
/**
|
|
280
352
|
* Indicates whether the scrollbar should be visible in virtual mode.
|
|
281
353
|
*/
|
|
@@ -300,6 +372,17 @@ var ListComponent = /** @class */ (function () {
|
|
|
300
372
|
}
|
|
301
373
|
return this.virtual.skip === 0 && (this.virtual.pageSize > itemIndex);
|
|
302
374
|
};
|
|
375
|
+
ListComponent.prototype.setComponentClasses = function () {
|
|
376
|
+
if (this.type === 'list') {
|
|
377
|
+
this.renderer.addClass(this.wrapper.nativeElement, 'k-list');
|
|
378
|
+
if (this.size) {
|
|
379
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('list', this.size));
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (isPresent(this.virtual)) {
|
|
383
|
+
this.renderer.addClass(this.wrapper.nativeElement, this.listVirtualClass);
|
|
384
|
+
}
|
|
385
|
+
};
|
|
303
386
|
tslib_1.__decorate([
|
|
304
387
|
Input(),
|
|
305
388
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -355,7 +438,7 @@ var ListComponent = /** @class */ (function () {
|
|
|
355
438
|
tslib_1.__decorate([
|
|
356
439
|
Input(),
|
|
357
440
|
tslib_1.__metadata("design:type", String)
|
|
358
|
-
], ListComponent.prototype, "
|
|
441
|
+
], ListComponent.prototype, "type", void 0);
|
|
359
442
|
tslib_1.__decorate([
|
|
360
443
|
Input(),
|
|
361
444
|
tslib_1.__metadata("design:type", Object)
|
|
@@ -365,6 +448,15 @@ var ListComponent = /** @class */ (function () {
|
|
|
365
448
|
tslib_1.__metadata("design:type", Array),
|
|
366
449
|
tslib_1.__metadata("design:paramtypes", [Array])
|
|
367
450
|
], ListComponent.prototype, "data", null);
|
|
451
|
+
tslib_1.__decorate([
|
|
452
|
+
Input(),
|
|
453
|
+
tslib_1.__metadata("design:type", String),
|
|
454
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
455
|
+
], ListComponent.prototype, "size", null);
|
|
456
|
+
tslib_1.__decorate([
|
|
457
|
+
Input(),
|
|
458
|
+
tslib_1.__metadata("design:type", String)
|
|
459
|
+
], ListComponent.prototype, "rounded", void 0);
|
|
368
460
|
tslib_1.__decorate([
|
|
369
461
|
Output(),
|
|
370
462
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -396,7 +488,7 @@ var ListComponent = /** @class */ (function () {
|
|
|
396
488
|
ListComponent = tslib_1.__decorate([
|
|
397
489
|
Component({
|
|
398
490
|
selector: 'kendo-list',
|
|
399
|
-
template: "\n <div *ngIf=\"dataService.grouped\"\n class
|
|
491
|
+
template: "\n <div *ngIf=\"dataService.grouped\"\n [class]=\"listGroupStickyHeaderClass\"\n [ngStyle]=\"{\n 'height.px': virtual?.itemHeight,\n 'minHeight.px' : virtual?.itemHeight,\n 'boxSizing' : virtual ? 'border-box' : 'inherit'}\"\n >\n <ng-template *ngIf=\"fixedGroupTemplate\"\n [templateContext]=\"{\n templateRef: fixedGroupTemplate.templateRef,\n $implicit: currentGroup\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!fixedGroupTemplate\"><span [class]=\"listGroupStickyHeaderTextClass\">{{ currentGroup }}</span></ng-template>\n </div>\n <div #content\n [class]=\"listContentClass\"\n [style.overscrollBehavior]=\"'none'\"\n [style.maxHeight.px]=\"height\"\n unselectable=\"on\">\n <ul #list\n role=\"listbox\"\n [class]=\"listClass\"\n [attr.id]=\"id\"\n [attr.aria-hidden]=\"!show\">\n <ng-template *ngIf=\"!dataService.grouped && show\" ngFor let-dataItem let-itemIndex=\"index\" [ngForOf]=\"data\">\n <li\n role=\"option\"\n kendoDropDownsSelectable\n [checkboxes]=\"checkboxes\"\n [height]=\"virtual?.itemHeight\"\n [index]=\"itemIndex + startFrom\"\n [multipleSelection]=\"multipleSelection\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem)\"\n [attr.tabIndex]=\"-1\"\n [class]=\"listItemClass\"\n [ngClass]=\"{\n 'k-disabled': isDisabled(itemIndex),\n 'k-table-alt-row': isAltRow(itemIndex)\n }\"\n >\n <input\n *ngIf=\"checkboxes.enabled\"\n type=\"checkbox\"\n class=\"k-checkbox\"\n [ngClass]=\"checkboxClasses\"\n (change)=\"onCheckedChange($event, itemIndex)\"\n [checked]=\"isChecked(itemIndex)\"\n />\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\"><span class=\"k-list-item-text\">{{ getText(dataItem) }}</span></ng-template>\n </li>\n </ng-template>\n <ng-template *ngIf=\"dataService.grouped\" ngFor let-dataItem let-itemIndex=\"index\" [ngForOf]=\"data\">\n <li\n *ngIf=\"dataItem.header && dataItem.index > 0\"\n role=\"group\"\n [class]=\"listGroupItemClass\"\n [class.k-table-alt-row]=\"isAltRow(itemIndex - 1)\"\n [ngStyle]=\"{\n 'height.px': virtual?.itemHeight,\n 'minHeight.px' : virtual?.itemHeight,\n 'boxSizing' : virtual ? 'border-box' : 'inherit'}\"\n [attr.group-index]=\"dataItem.index\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem.value)\"\n [attr.tabIndex]=\"-1\">\n <span [class]=\"listGroupItemTextClass\">\n <ng-template *ngIf=\"groupTemplate\"\n [templateContext]=\"{\n templateRef: groupTemplate.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!groupTemplate\">{{ dataItem.value }}</ng-template>\n </span>\n </li>\n <li\n *ngIf=\"!dataItem.header\"\n role=\"option\"\n kendoDropDownsSelectable\n [height]=\"virtual?.itemHeight\"\n [index]=\"dataItem.offsetIndex\"\n [multipleSelection]=\"multipleSelection\"\n [attr.absolute-index]=\"dataItem.index\"\n [attr.id]=\"optionPrefix + '-' + getValue(dataItem.value)\"\n [attr.tabIndex]=\"-1\"\n [class]=\"listItemClass\"\n [ngClass]=\"{\n 'k-disabled': isDisabled(dataItem.offsetIndex),\n 'k-table-alt-row': isAltRow(itemIndex - 1)\n }\"\n >\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\"><span class=\"k-list-item-text\">{{ getText(dataItem.value) }}</span></ng-template>\n </li>\n </ng-template>\n <kendo-resize-sensor\n *ngIf=\"!virtual\"\n (resize)=\"listResize.emit()\"\n >\n </kendo-resize-sensor>\n </ul>\n <div *ngIf=\"virtual\" #virtualContainer class=\"k-height-container\" role=\"presentation\">\n <div [style.height.px]=\"scrollHeight\">\n <kendo-resize-sensor (resize)=\"listResize.emit()\"></kendo-resize-sensor>\n </div>\n </div>\n </div>\n "
|
|
400
492
|
}),
|
|
401
493
|
tslib_1.__metadata("design:paramtypes", [DataService,
|
|
402
494
|
ElementRef,
|
|
@@ -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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -236,7 +236,7 @@ var SearchBarComponent = /** @class */ (function () {
|
|
|
236
236
|
SearchBarComponent = tslib_1.__decorate([
|
|
237
237
|
Component({
|
|
238
238
|
selector: 'kendo-searchbar',
|
|
239
|
-
template: "\n <input #input\n autocomplete=\"off\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [placeholder]=\"placeholder\"\n [class]=\"'k-input'\"\n (input)=\"handleInput($event)\"\n (keydown)=\"handleKeydown($event)\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.dir]=\"direction\"\n [attr.role]=\"role\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-readonly]=\"readonly\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"popupOpen\"\n [attr.aria-owns]=\"listId\"\n [attr.aria-describedby]=\"tagListId\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-label]=\"noDataLabel\"\n />\n "
|
|
239
|
+
template: "\n <input #input\n autocomplete=\"off\"\n [id]=\"id\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [placeholder]=\"placeholder\"\n [class]=\"'k-input-inner'\"\n (input)=\"handleInput($event)\"\n (keydown)=\"handleKeydown($event)\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.dir]=\"direction\"\n [attr.role]=\"role\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-readonly]=\"readonly\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"popupOpen\"\n [attr.aria-owns]=\"listId\"\n [attr.aria-describedby]=\"tagListId\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.aria-label]=\"noDataLabel\"\n />\n "
|
|
240
240
|
}),
|
|
241
241
|
tslib_1.__metadata("design:paramtypes", [LocalizationService,
|
|
242
242
|
Renderer2])
|
|
@@ -67,12 +67,12 @@ var SelectableDirective = /** @class */ (function () {
|
|
|
67
67
|
tslib_1.__metadata("design:type", Boolean)
|
|
68
68
|
], SelectableDirective.prototype, "multipleSelection", void 0);
|
|
69
69
|
tslib_1.__decorate([
|
|
70
|
-
HostBinding('class.k-
|
|
70
|
+
HostBinding('class.k-focus'),
|
|
71
71
|
tslib_1.__metadata("design:type", Boolean),
|
|
72
72
|
tslib_1.__metadata("design:paramtypes", [])
|
|
73
73
|
], SelectableDirective.prototype, "focusedClassName", null);
|
|
74
74
|
tslib_1.__decorate([
|
|
75
|
-
HostBinding('class.k-
|
|
75
|
+
HostBinding('class.k-selected'),
|
|
76
76
|
tslib_1.__metadata("design:type", Boolean),
|
|
77
77
|
tslib_1.__metadata("design:paramtypes", [])
|
|
78
78
|
], SelectableDirective.prototype, "selectedClassName", null);
|
|
@@ -3,21 +3,48 @@
|
|
|
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, Output, EventEmitter } from '@angular/core';
|
|
6
|
+
import { Component, Input, Output, EventEmitter, HostBinding, Renderer2, ElementRef } from '@angular/core';
|
|
7
7
|
import { TagTemplateDirective } from '../common/templates/tag-template.directive';
|
|
8
8
|
import { GroupTagTemplateDirective } from '../common/templates/group-tag-template.directive';
|
|
9
|
-
import { getter, isPresent } from '../common/util';
|
|
9
|
+
import { getSizeClass, getter, isPresent } from '../common/util';
|
|
10
10
|
/**
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
13
13
|
var TagListComponent = /** @class */ (function () {
|
|
14
|
-
function TagListComponent() {
|
|
14
|
+
function TagListComponent(renderer, hostElement) {
|
|
15
|
+
this.renderer = renderer;
|
|
16
|
+
this.hostElement = hostElement;
|
|
17
|
+
this.rounded = 'medium';
|
|
18
|
+
this.fillMode = 'solid';
|
|
15
19
|
/**
|
|
16
20
|
* A collection with the disabled tags' indices.
|
|
17
21
|
*/
|
|
18
22
|
this.disabledIndices = new Set();
|
|
19
23
|
this.removeTag = new EventEmitter();
|
|
24
|
+
this.hostClasses = true;
|
|
25
|
+
this._size = 'medium';
|
|
20
26
|
}
|
|
27
|
+
Object.defineProperty(TagListComponent.prototype, "size", {
|
|
28
|
+
get: function () {
|
|
29
|
+
return this._size;
|
|
30
|
+
},
|
|
31
|
+
set: function (size) {
|
|
32
|
+
this.renderer.removeClass(this.hostElement.nativeElement, getSizeClass('chip-list', this.size));
|
|
33
|
+
if (size) {
|
|
34
|
+
this.renderer.addClass(this.hostElement.nativeElement, getSizeClass('chip-list', size));
|
|
35
|
+
}
|
|
36
|
+
this._size = size;
|
|
37
|
+
},
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(TagListComponent.prototype, "hostId", {
|
|
42
|
+
get: function () {
|
|
43
|
+
return this.id;
|
|
44
|
+
},
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true
|
|
47
|
+
});
|
|
21
48
|
TagListComponent.prototype.tagProp = function (tag, prop, index) {
|
|
22
49
|
var propField = prop && this.getPropField(tag, prop, index);
|
|
23
50
|
return getter(tag, propField);
|
|
@@ -107,6 +134,19 @@ var TagListComponent = /** @class */ (function () {
|
|
|
107
134
|
Input(),
|
|
108
135
|
tslib_1.__metadata("design:type", String)
|
|
109
136
|
], TagListComponent.prototype, "id", void 0);
|
|
137
|
+
tslib_1.__decorate([
|
|
138
|
+
Input(),
|
|
139
|
+
tslib_1.__metadata("design:type", String),
|
|
140
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
141
|
+
], TagListComponent.prototype, "size", null);
|
|
142
|
+
tslib_1.__decorate([
|
|
143
|
+
Input(),
|
|
144
|
+
tslib_1.__metadata("design:type", String)
|
|
145
|
+
], TagListComponent.prototype, "rounded", void 0);
|
|
146
|
+
tslib_1.__decorate([
|
|
147
|
+
Input(),
|
|
148
|
+
tslib_1.__metadata("design:type", String)
|
|
149
|
+
], TagListComponent.prototype, "fillMode", void 0);
|
|
110
150
|
tslib_1.__decorate([
|
|
111
151
|
Input(),
|
|
112
152
|
tslib_1.__metadata("design:type", Set)
|
|
@@ -115,11 +155,24 @@ var TagListComponent = /** @class */ (function () {
|
|
|
115
155
|
Output(),
|
|
116
156
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
117
157
|
], TagListComponent.prototype, "removeTag", void 0);
|
|
158
|
+
tslib_1.__decorate([
|
|
159
|
+
HostBinding('class.k-input-values'),
|
|
160
|
+
HostBinding('class.k-chip-list'),
|
|
161
|
+
HostBinding('class.k-selection-multiple'),
|
|
162
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
163
|
+
], TagListComponent.prototype, "hostClasses", void 0);
|
|
164
|
+
tslib_1.__decorate([
|
|
165
|
+
HostBinding('attr.id'),
|
|
166
|
+
tslib_1.__metadata("design:type", String),
|
|
167
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
168
|
+
], TagListComponent.prototype, "hostId", null);
|
|
118
169
|
TagListComponent = tslib_1.__decorate([
|
|
119
170
|
Component({
|
|
120
171
|
selector: 'kendo-taglist',
|
|
121
|
-
template: "\n <
|
|
122
|
-
})
|
|
172
|
+
template: "\n <div\n *ngFor=\"let tag of tags; let index = index;\"\n role=\"option\"\n [attr.id]=\"itemId(tag, index)\"\n [attr.aria-hidden]=\"tagAriaHidden(index)\"\n aria-selected=\"true\"\n [attr.aria-setsize]=\"tags?.length\"\n class=\"k-chip\"\n [ngClass]=\"{\n 'k-focus': index === focused,\n 'k-disabled': isTagDisabled(tag, index),\n 'k-chip-sm': size === 'small',\n 'k-chip-md': size === 'medium',\n 'k-chip-lg': size === 'large',\n 'k-rounded-sm': rounded === 'small',\n 'k-rounded-md': rounded === 'medium',\n 'k-rounded-lg': rounded === 'large',\n 'k-rounded-full': rounded === 'full',\n 'k-chip-solid k-chip-solid-base': fillMode === 'solid',\n 'k-chip-flat k-chip-flat-base': fillMode === 'flat',\n 'k-chip-outline k-chip-outline-base': fillMode === 'outline'\n }\"\n >\n <span class=\"k-chip-content\">\n <ng-template *ngIf=\"isGroupTag(tag); then groupTag else singleTag\"></ng-template>\n <ng-template #groupTag>\n <span class=\"k-chip-label k-text-ellipsis\">\n <ng-template *ngIf=\"groupTemplate\"\n [templateContext]=\"{\n templateRef: groupTemplate.templateRef,\n $implicit: tag\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!groupTemplate\">{{ tag.length }} {{ tag.length === 1 ? 'item' : 'items' }} selected</ng-template>\n </span>\n </ng-template>\n <ng-template #singleTag>\n <span class=\"k-chip-label k-text-ellipsis\">\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: tag\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\">{{ tagProp(tag, textField, index) }}</ng-template>\n </span>\n </ng-template>\n </span>\n\n <span class=\"k-chip-actions\">\n <span aria-label=\"delete\" [attr.aria-hidden]=\"index !== focused\" class=\"k-chip-action k-chip-remove-action\">\n <span class=\"k-icon k-i-x-circle\" (mousedown)=\"deleteTag($event, tag, index)\">\n </span>\n </span>\n </span>\n </div>\n <ng-content></ng-content>\n "
|
|
173
|
+
}),
|
|
174
|
+
tslib_1.__metadata("design:paramtypes", [Renderer2,
|
|
175
|
+
ElementRef])
|
|
123
176
|
], TagListComponent);
|
|
124
177
|
return TagListComponent;
|
|
125
178
|
}());
|
package/dist/es/common/util.js
CHANGED
|
@@ -297,4 +297,41 @@ export var valueFrom = function (_a, valueField) {
|
|
|
297
297
|
var field = fields[normalizedLevel];
|
|
298
298
|
return fieldAccessor(field)(dataItem);
|
|
299
299
|
};
|
|
300
|
+
/**
|
|
301
|
+
* @hidden
|
|
302
|
+
* Returns the size class based on the component and size input.
|
|
303
|
+
*/
|
|
304
|
+
export var getSizeClass = function (component, size) {
|
|
305
|
+
var SIZE_CLASSES = {
|
|
306
|
+
'small': "k-" + component + "-sm",
|
|
307
|
+
'medium': "k-" + component + "-md",
|
|
308
|
+
'large': "k-" + component + "-lg"
|
|
309
|
+
};
|
|
310
|
+
return SIZE_CLASSES[size];
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* @hidden
|
|
314
|
+
* Returns the rounded class based on the rounded input.
|
|
315
|
+
*/
|
|
316
|
+
export var getRoundedClass = function (rounded) {
|
|
317
|
+
var ROUNDED_CLASSES = {
|
|
318
|
+
'small': 'k-rounded-sm',
|
|
319
|
+
'medium': 'k-rounded-md',
|
|
320
|
+
'large': 'k-rounded-lg',
|
|
321
|
+
'full': 'k-rounded-full'
|
|
322
|
+
};
|
|
323
|
+
return ROUNDED_CLASSES[rounded];
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* @hidden
|
|
327
|
+
* Return the fillMode class based on the component and fillMode input.
|
|
328
|
+
*/
|
|
329
|
+
export var getFillModeClass = function (component, fillMode) {
|
|
330
|
+
var FILLMODE_CLASSES = {
|
|
331
|
+
'solid': "k-" + component + "-solid",
|
|
332
|
+
'flat': "k-" + component + "-flat",
|
|
333
|
+
'outline': "k-" + component + "-outline"
|
|
334
|
+
};
|
|
335
|
+
return FILLMODE_CLASSES[fillMode];
|
|
336
|
+
};
|
|
300
337
|
export { ɵ0 };
|