@progress/kendo-angular-dropdowns 5.5.1 → 6.0.1-dev.202201201129

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.
Files changed (75) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +119 -79
  3. package/README.md +1 -1
  4. package/dist/cdn/js/kendo-angular-dropdowns.js +2 -2
  5. package/dist/cdn/main.js +1 -1
  6. package/dist/es/autocomplete/autocomplete.component.js +120 -5
  7. package/dist/es/comboboxes/combobox.component.js +141 -20
  8. package/dist/es/comboboxes/multicolumncombobox.component.js +30 -10
  9. package/dist/es/common/list.component.js +83 -5
  10. package/dist/es/common/models/fillmode.js +4 -0
  11. package/dist/es/common/models/list-type.js +4 -0
  12. package/dist/es/common/models/rounded.js +4 -0
  13. package/dist/es/common/models/size.js +4 -0
  14. package/dist/es/common/searchbar.component.js +1 -1
  15. package/dist/es/common/selection/selectable.directive.js +2 -2
  16. package/dist/es/common/taglist.component.js +58 -5
  17. package/dist/es/common/util.js +37 -0
  18. package/dist/es/dropdownlist/dropdownlist.component.js +335 -54
  19. package/dist/es/dropdowntrees/dropdowntree.component.js +276 -42
  20. package/dist/es/dropdowntrees/multiselecttree.component.js +307 -46
  21. package/dist/es/multiselect/multiselect.component.js +162 -35
  22. package/dist/es/package-metadata.js +1 -1
  23. package/dist/es2015/autocomplete/autocomplete.component.d.ts +42 -0
  24. package/dist/es2015/autocomplete/autocomplete.component.js +109 -7
  25. package/dist/es2015/comboboxes/combobox.component.d.ts +49 -4
  26. package/dist/es2015/comboboxes/combobox.component.js +207 -106
  27. package/dist/es2015/comboboxes/multicolumncombobox.component.d.ts +9 -1
  28. package/dist/es2015/comboboxes/multicolumncombobox.component.js +185 -166
  29. package/dist/es2015/common/list.component.d.ts +22 -1
  30. package/dist/es2015/common/list.component.js +115 -37
  31. package/dist/es2015/common/models/fillmode.d.ts +14 -0
  32. package/dist/es2015/common/models/fillmode.js +4 -0
  33. package/dist/es2015/common/models/list-type.d.ts +8 -0
  34. package/dist/es2015/common/models/list-type.js +4 -0
  35. package/dist/es2015/common/models/rounded.d.ts +15 -0
  36. package/dist/es2015/common/models/rounded.js +4 -0
  37. package/dist/es2015/common/models/size.d.ts +14 -0
  38. package/dist/es2015/common/models/size.js +4 -0
  39. package/dist/es2015/common/searchbar.component.js +1 -1
  40. package/dist/es2015/common/selection/selectable.directive.js +2 -2
  41. package/dist/es2015/common/taglist.component.d.ts +13 -1
  42. package/dist/es2015/common/taglist.component.js +102 -47
  43. package/dist/es2015/common/util.d.ts +17 -0
  44. package/dist/es2015/common/util.js +37 -0
  45. package/dist/es2015/dropdownlist/dropdownlist.component.d.ts +80 -17
  46. package/dist/es2015/dropdownlist/dropdownlist.component.js +391 -167
  47. package/dist/es2015/dropdowntrees/dropdowntree.component.d.ts +71 -13
  48. package/dist/es2015/dropdowntrees/dropdowntree.component.js +287 -99
  49. package/dist/es2015/dropdowntrees/multiselecttree.component.d.ts +72 -12
  50. package/dist/es2015/dropdowntrees/multiselecttree.component.js +319 -117
  51. package/dist/es2015/index.metadata.json +1 -1
  52. package/dist/es2015/multiselect/multiselect.component.d.ts +53 -8
  53. package/dist/es2015/multiselect/multiselect.component.js +183 -70
  54. package/dist/es2015/package-metadata.js +1 -1
  55. package/dist/fesm2015/index.js +1956 -837
  56. package/dist/fesm5/index.js +1558 -231
  57. package/dist/npm/autocomplete/autocomplete.component.js +119 -4
  58. package/dist/npm/comboboxes/combobox.component.js +140 -19
  59. package/dist/npm/comboboxes/multicolumncombobox.component.js +29 -9
  60. package/dist/npm/common/list.component.js +82 -4
  61. package/dist/npm/common/models/fillmode.js +6 -0
  62. package/dist/npm/common/models/list-type.js +6 -0
  63. package/dist/npm/common/models/rounded.js +6 -0
  64. package/dist/npm/common/models/size.js +6 -0
  65. package/dist/npm/common/searchbar.component.js +1 -1
  66. package/dist/npm/common/selection/selectable.directive.js +2 -2
  67. package/dist/npm/common/taglist.component.js +56 -3
  68. package/dist/npm/common/util.js +37 -0
  69. package/dist/npm/dropdownlist/dropdownlist.component.js +333 -52
  70. package/dist/npm/dropdowntrees/dropdowntree.component.js +274 -40
  71. package/dist/npm/dropdowntrees/multiselecttree.component.js +304 -43
  72. package/dist/npm/multiselect/multiselect.component.js +160 -33
  73. package/dist/npm/package-metadata.js +1 -1
  74. package/dist/systemjs/kendo-angular-dropdowns.js +1 -1
  75. package/package.json +21 -17
@@ -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.listClass = 'k-list k-reset';
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,6 +105,16 @@ 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) {
@@ -97,9 +126,13 @@ var ListComponent = /** @class */ (function () {
97
126
  if (isChanged('virtual', changes, false)) {
98
127
  this.setOverflow();
99
128
  }
129
+ if (isChanged('type', changes, false)) {
130
+ this.prepareClasses();
131
+ }
100
132
  };
101
133
  ListComponent.prototype.ngAfterViewInit = function () {
102
134
  var _this = this;
135
+ this.setComponentClasses();
103
136
  this.zone.runOutsideAngular(function () {
104
137
  _this.scrollSubscription = fromEvent(_this.content.nativeElement, "scroll").pipe(auditTime(100), tap(_this.prefetchData.bind(_this)), tap(_this.findCurrentGroup.bind(_this))).subscribe(function () {
105
138
  _this.lastScrollTop = _this.content.nativeElement.scrollTop;
@@ -135,6 +168,28 @@ var ListComponent = /** @class */ (function () {
135
168
  this.selectionService.unselect(index);
136
169
  }
137
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
+ };
138
193
  ListComponent.prototype.isChecked = function (index) {
139
194
  var normalizedIndex = this.virtual ? index + this.virtual.skip : index;
140
195
  return this.selectionService.isSelected(normalizedIndex);
@@ -144,7 +199,7 @@ var ListComponent = /** @class */ (function () {
144
199
  var content = this.content.nativeElement;
145
200
  var rect = content.getBoundingClientRect();
146
201
  // IE9 hack
147
- var disabled = Array.prototype.slice.call(content.querySelectorAll(".k-state-disabled"));
202
+ var disabled = Array.prototype.slice.call(content.querySelectorAll(".k-disabled"));
148
203
  // This is a workaround for finding elements with pointer-events: none;
149
204
  disabled.forEach(function (el) { return _this.renderer.setStyle(el, "pointer-events", "auto"); });
150
205
  var item = document.elementFromPoint(rect.left + 1, rect.top + 1);
@@ -223,6 +278,9 @@ var ListComponent = /** @class */ (function () {
223
278
  }
224
279
  return this.disabledItemsService.isIndexDisabled(index);
225
280
  };
281
+ ListComponent.prototype.isAltRow = function (index) {
282
+ return this.type === 'dropdowngrid' && index % 2 !== 0;
283
+ };
226
284
  ListComponent.prototype.scrollToItem = function (index) {
227
285
  var flatIndex = index;
228
286
  if (this.dataService.grouped) {
@@ -314,6 +372,17 @@ var ListComponent = /** @class */ (function () {
314
372
  }
315
373
  return this.virtual.skip === 0 && (this.virtual.pageSize > itemIndex);
316
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
+ };
317
386
  tslib_1.__decorate([
318
387
  Input(),
319
388
  tslib_1.__metadata("design:type", Array)
@@ -369,7 +438,7 @@ var ListComponent = /** @class */ (function () {
369
438
  tslib_1.__decorate([
370
439
  Input(),
371
440
  tslib_1.__metadata("design:type", String)
372
- ], ListComponent.prototype, "listClass", void 0);
441
+ ], ListComponent.prototype, "type", void 0);
373
442
  tslib_1.__decorate([
374
443
  Input(),
375
444
  tslib_1.__metadata("design:type", Object)
@@ -379,6 +448,15 @@ var ListComponent = /** @class */ (function () {
379
448
  tslib_1.__metadata("design:type", Array),
380
449
  tslib_1.__metadata("design:paramtypes", [Array])
381
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);
382
460
  tslib_1.__decorate([
383
461
  Output(),
384
462
  tslib_1.__metadata("design:type", EventEmitter)
@@ -410,7 +488,7 @@ var ListComponent = /** @class */ (function () {
410
488
  ListComponent = tslib_1.__decorate([
411
489
  Component({
412
490
  selector: 'kendo-list',
413
- template: "\n <div *ngIf=\"dataService.grouped\"\n class='k-outer-group-header k-first'\n [ngClass]=\"{'k-virtual-item': virtual}\"\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\"><strong>{{ currentGroup }}</strong> </ng-template>\n </div>\n <div #content\n [ngClass]=\"{ 'k-virtual-content': virtual, 'k-list-scroller': !virtual }\"\n [style.overscrollBehavior]=\"'none'\"\n [style.maxHeight.px]=\"height\"\n unselectable=\"on\">\n <ul #list\n role=\"listbox\"\n [class]=\"listClass\"\n [ngClass]=\"{ 'k-virtual-list': virtual }\"\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=\"k-item\"\n [ngClass]=\"{ 'k-virtual-item': virtual, 'k-state-disabled': isDisabled(itemIndex) }\">\n <label *ngIf=\"checkboxes.enabled\"\n class=\"k-checkbox-label\">\n <input type=\"checkbox\"\n class=\"k-checkbox\"\n (change)=\"onCheckedChange($event, itemIndex)\"\n [checked]=\"isChecked(itemIndex)\"\n />\n </label>\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\">{{ getText(dataItem) }}</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='k-outer-group-header'\n [ngClass]=\"{ 'k-virtual-item': virtual }\"\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 <ng-template *ngIf=\"groupTemplate\"\n [templateContext]=\"{\n templateRef: groupTemplate.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!groupTemplate\"><strong> {{ dataItem.value }}</strong> </ng-template>\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=\"k-item\"\n [ngClass]=\"{ 'k-virtual-item': virtual, 'k-state-disabled': isDisabled(dataItem.offsetIndex) }\">\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: dataItem.value\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\">{{ getText(dataItem.value) }}</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 "
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 "
414
492
  }),
415
493
  tslib_1.__metadata("design:paramtypes", [DataService,
416
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-state-focused'),
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-state-selected'),
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 <ul [attr.id]=\"id\" class=\"k-reset\">\n <li\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-button\"\n [ngClass]=\"{\n 'k-state-focused': index === focused,\n 'k-state-disabled': isTagDisabled(tag, index)\n }\"\n >\n <ng-template *ngIf=\"isGroupTag(tag); then groupTag else singleTag\"></ng-template>\n <ng-template #groupTag>\n <span>\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>\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\n <span aria-label=\"delete\" [attr.aria-hidden]=\"index !== focused\" class=\"k-select\">\n <span class=\"k-icon k-i-close\" (mousedown)=\"deleteTag($event, tag, index)\">\n </span>\n </span>\n </li>\n </ul>\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
  }());
@@ -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 };