@progress/kendo-angular-dropdowns 5.5.1-dev.202111181325 → 6.0.0-dev.202201190829

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 +338 -46
  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 -36
  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 +77 -13
  46. package/dist/es2015/dropdownlist/dropdownlist.component.js +390 -159
  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 +1928 -801
  56. package/dist/fesm5/index.js +1569 -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 +336 -44
  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';
@@ -32,8 +32,9 @@ let ListComponent = class ListComponent {
32
32
  this.focused = -1;
33
33
  this.show = true;
34
34
  this.multipleSelection = false;
35
- this.listClass = 'k-list k-reset';
35
+ this.type = 'list';
36
36
  this.checkboxes = { enabled: false };
37
+ this.rounded = 'medium';
37
38
  this.onClick = new EventEmitter();
38
39
  this.pageChange = new EventEmitter();
39
40
  this.listResize = new EventEmitter();
@@ -41,11 +42,13 @@ let ListComponent = class ListComponent {
41
42
  this.lastLoaded = 0;
42
43
  this.lastScrollTop = 0;
43
44
  this.scrollToFocused = false;
45
+ this._size = 'medium';
44
46
  this.selectSubscription = merge(this.selectionService.onSelect.pipe(map((args) => args.indices[0])), this.selectionService.onFocus)
45
47
  .pipe(
46
48
  // handle only the very last onSelect/onFocus emission
47
49
  switchMap(event => this.zone.onStable.pipe(take(1), map(() => event))))
48
50
  .subscribe(this.scrollToItem.bind(this));
51
+ this.prepareClasses();
49
52
  }
50
53
  set data(data) {
51
54
  this._data = data[0] && data[0].header ? data.slice(0) : data;
@@ -53,6 +56,18 @@ let ListComponent = class ListComponent {
53
56
  get data() {
54
57
  return this._data;
55
58
  }
59
+ set size(size) {
60
+ if (this.type === 'list') {
61
+ this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('list', this.size));
62
+ if (size) {
63
+ this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('list', size));
64
+ }
65
+ this._size = size;
66
+ }
67
+ }
68
+ get size() {
69
+ return this._size;
70
+ }
56
71
  get pageSize() {
57
72
  if (this.virtual.pageSize) {
58
73
  return this.virtual.pageSize;
@@ -69,6 +84,12 @@ let ListComponent = class ListComponent {
69
84
  return overflow;
70
85
  }
71
86
  }
87
+ /**
88
+ * @hidden
89
+ */
90
+ get checkboxClasses() {
91
+ return `${this.size ? getSizeClass('checkbox', this.size) : ''} ${this.rounded ? getRoundedClass(this.rounded) : ''}`;
92
+ }
72
93
  ngOnChanges(changes) {
73
94
  if (isChanged('data', changes, false)) {
74
95
  if (this.lastLoaded <= 0) {
@@ -80,8 +101,12 @@ let ListComponent = class ListComponent {
80
101
  if (isChanged('virtual', changes, false)) {
81
102
  this.setOverflow();
82
103
  }
104
+ if (isChanged('type', changes, false)) {
105
+ this.prepareClasses();
106
+ }
83
107
  }
84
108
  ngAfterViewInit() {
109
+ this.setComponentClasses();
85
110
  this.zone.runOutsideAngular(() => {
86
111
  this.scrollSubscription = fromEvent(this.content.nativeElement, "scroll").pipe(auditTime(100), tap(this.prefetchData.bind(this)), tap(this.findCurrentGroup.bind(this))).subscribe(() => {
87
112
  this.lastScrollTop = this.content.nativeElement.scrollTop;
@@ -117,6 +142,28 @@ let ListComponent = class ListComponent {
117
142
  this.selectionService.unselect(index);
118
143
  }
119
144
  }
145
+ prepareClasses() {
146
+ if (this.type === 'list') {
147
+ this.listContentClass = 'k-list-content';
148
+ this.listClass = 'k-list-ul';
149
+ this.listItemClass = 'k-list-item';
150
+ this.listVirtualClass = 'k-virtual-list';
151
+ this.listGroupStickyHeaderClass = 'k-list-group-sticky-header';
152
+ this.listGroupStickyHeaderTextClass = 'k-list-header-text';
153
+ this.listGroupItemClass = 'k-list-group-item';
154
+ this.listGroupItemTextClass = 'k-list-item-text';
155
+ }
156
+ else {
157
+ this.listContentClass = 'k-table-body k-table-scroller';
158
+ this.listClass = 'k-table k-table-list';
159
+ this.listItemClass = 'k-table-row';
160
+ this.listVirtualClass = 'k-virtual-table';
161
+ this.listGroupStickyHeaderClass = 'k-table-group-sticky-header';
162
+ this.listGroupStickyHeaderTextClass = 'k-table-th';
163
+ this.listGroupItemClass = 'k-table-group-row';
164
+ this.listGroupItemTextClass = 'k-table-th';
165
+ }
166
+ }
120
167
  isChecked(index) {
121
168
  const normalizedIndex = this.virtual ? index + this.virtual.skip : index;
122
169
  return this.selectionService.isSelected(normalizedIndex);
@@ -125,7 +172,7 @@ let ListComponent = class ListComponent {
125
172
  const content = this.content.nativeElement;
126
173
  const rect = content.getBoundingClientRect();
127
174
  // IE9 hack
128
- const disabled = Array.prototype.slice.call(content.querySelectorAll(".k-state-disabled"));
175
+ const disabled = Array.prototype.slice.call(content.querySelectorAll(".k-disabled"));
129
176
  // This is a workaround for finding elements with pointer-events: none;
130
177
  disabled.forEach((el) => this.renderer.setStyle(el, "pointer-events", "auto"));
131
178
  const item = document.elementFromPoint(rect.left + 1, rect.top + 1);
@@ -203,6 +250,9 @@ let ListComponent = class ListComponent {
203
250
  }
204
251
  return this.disabledItemsService.isIndexDisabled(index);
205
252
  }
253
+ isAltRow(index) {
254
+ return this.type === 'dropdowngrid' && index % 2 !== 0;
255
+ }
206
256
  scrollToItem(index) {
207
257
  let flatIndex = index;
208
258
  if (this.dataService.grouped) {
@@ -293,6 +343,17 @@ let ListComponent = class ListComponent {
293
343
  }
294
344
  return this.virtual.skip === 0 && (this.virtual.pageSize > itemIndex);
295
345
  }
346
+ setComponentClasses() {
347
+ if (this.type === 'list') {
348
+ this.renderer.addClass(this.wrapper.nativeElement, 'k-list');
349
+ if (this.size) {
350
+ this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('list', this.size));
351
+ }
352
+ }
353
+ if (isPresent(this.virtual)) {
354
+ this.renderer.addClass(this.wrapper.nativeElement, this.listVirtualClass);
355
+ }
356
+ }
296
357
  };
297
358
  tslib_1.__decorate([
298
359
  Input(),
@@ -349,7 +410,7 @@ tslib_1.__decorate([
349
410
  tslib_1.__decorate([
350
411
  Input(),
351
412
  tslib_1.__metadata("design:type", String)
352
- ], ListComponent.prototype, "listClass", void 0);
413
+ ], ListComponent.prototype, "type", void 0);
353
414
  tslib_1.__decorate([
354
415
  Input(),
355
416
  tslib_1.__metadata("design:type", Object)
@@ -359,6 +420,15 @@ tslib_1.__decorate([
359
420
  tslib_1.__metadata("design:type", Array),
360
421
  tslib_1.__metadata("design:paramtypes", [Array])
361
422
  ], ListComponent.prototype, "data", null);
423
+ tslib_1.__decorate([
424
+ Input(),
425
+ tslib_1.__metadata("design:type", String),
426
+ tslib_1.__metadata("design:paramtypes", [String])
427
+ ], ListComponent.prototype, "size", null);
428
+ tslib_1.__decorate([
429
+ Input(),
430
+ tslib_1.__metadata("design:type", String)
431
+ ], ListComponent.prototype, "rounded", void 0);
362
432
  tslib_1.__decorate([
363
433
  Output(),
364
434
  tslib_1.__metadata("design:type", EventEmitter)
@@ -392,8 +462,7 @@ ListComponent = tslib_1.__decorate([
392
462
  selector: 'kendo-list',
393
463
  template: `
394
464
  <div *ngIf="dataService.grouped"
395
- class='k-outer-group-header k-first'
396
- [ngClass]="{'k-virtual-item': virtual}"
465
+ [class]="listGroupStickyHeaderClass"
397
466
  [ngStyle]="{
398
467
  'height.px': virtual?.itemHeight,
399
468
  'minHeight.px' : virtual?.itemHeight,
@@ -405,16 +474,16 @@ ListComponent = tslib_1.__decorate([
405
474
  $implicit: currentGroup
406
475
  }">
407
476
  </ng-template>
408
- <ng-template [ngIf]="!fixedGroupTemplate"><strong>{{ currentGroup }}</strong> </ng-template>
477
+ <ng-template [ngIf]="!fixedGroupTemplate"><span [class]="listGroupStickyHeaderTextClass">{{ currentGroup }}</span></ng-template>
409
478
  </div>
410
479
  <div #content
411
- [ngClass]="{ 'k-virtual-content': virtual, 'k-list-scroller': !virtual }"
412
- [style.maxHeight.px]="height"
413
- unselectable="on">
480
+ [class]="listContentClass"
481
+ [style.overscrollBehavior]="'none'"
482
+ [style.maxHeight.px]="height"
483
+ unselectable="on">
414
484
  <ul #list
415
485
  role="listbox"
416
486
  [class]="listClass"
417
- [ngClass]="{ 'k-virtual-list': virtual }"
418
487
  [attr.id]="id"
419
488
  [attr.aria-hidden]="!show">
420
489
  <ng-template *ngIf="!dataService.grouped && show" ngFor let-dataItem let-itemIndex="index" [ngForOf]="data">
@@ -427,31 +496,35 @@ ListComponent = tslib_1.__decorate([
427
496
  [multipleSelection]="multipleSelection"
428
497
  [attr.id]="optionPrefix + '-' + getValue(dataItem)"
429
498
  [attr.tabIndex]="-1"
430
- class="k-item"
431
- [ngClass]="{ 'k-virtual-item': virtual, 'k-state-disabled': isDisabled(itemIndex) }">
432
- <label *ngIf="checkboxes.enabled"
433
- class="k-checkbox-label">
434
- <input type="checkbox"
435
- class="k-checkbox"
436
- (change)="onCheckedChange($event, itemIndex)"
437
- [checked]="isChecked(itemIndex)"
438
- />
439
- </label>
499
+ [class]="listItemClass"
500
+ [ngClass]="{
501
+ 'k-disabled': isDisabled(itemIndex),
502
+ 'k-table-alt-row': isAltRow(itemIndex)
503
+ }"
504
+ >
505
+ <input
506
+ *ngIf="checkboxes.enabled"
507
+ type="checkbox"
508
+ class="k-checkbox"
509
+ [ngClass]="checkboxClasses"
510
+ (change)="onCheckedChange($event, itemIndex)"
511
+ [checked]="isChecked(itemIndex)"
512
+ />
440
513
  <ng-template *ngIf="template"
441
514
  [templateContext]="{
442
515
  templateRef: template.templateRef,
443
516
  $implicit: dataItem
444
517
  }">
445
518
  </ng-template>
446
- <ng-template [ngIf]="!template">{{ getText(dataItem) }}</ng-template>
519
+ <ng-template [ngIf]="!template"><span class="k-list-item-text">{{ getText(dataItem) }}</span></ng-template>
447
520
  </li>
448
521
  </ng-template>
449
522
  <ng-template *ngIf="dataService.grouped" ngFor let-dataItem let-itemIndex="index" [ngForOf]="data">
450
523
  <li
451
524
  *ngIf="dataItem.header && dataItem.index > 0"
452
525
  role="group"
453
- class='k-outer-group-header'
454
- [ngClass]="{ 'k-virtual-item': virtual }"
526
+ [class]="listGroupItemClass"
527
+ [class.k-table-alt-row]="isAltRow(itemIndex - 1)"
455
528
  [ngStyle]="{
456
529
  'height.px': virtual?.itemHeight,
457
530
  'minHeight.px' : virtual?.itemHeight,
@@ -459,15 +532,17 @@ ListComponent = tslib_1.__decorate([
459
532
  [attr.group-index]="dataItem.index"
460
533
  [attr.id]="optionPrefix + '-' + getValue(dataItem.value)"
461
534
  [attr.tabIndex]="-1">
462
- <ng-template *ngIf="groupTemplate"
463
- [templateContext]="{
464
- templateRef: groupTemplate.templateRef,
465
- $implicit: dataItem.value
466
- }">
467
- </ng-template>
468
- <ng-template [ngIf]="!groupTemplate"><strong> {{ dataItem.value }}</strong> </ng-template>
469
- </li>
470
- <li
535
+ <span [class]="listGroupItemTextClass">
536
+ <ng-template *ngIf="groupTemplate"
537
+ [templateContext]="{
538
+ templateRef: groupTemplate.templateRef,
539
+ $implicit: dataItem.value
540
+ }">
541
+ </ng-template>
542
+ <ng-template [ngIf]="!groupTemplate">{{ dataItem.value }}</ng-template>
543
+ </span>
544
+ </li>
545
+ <li
471
546
  *ngIf="!dataItem.header"
472
547
  role="option"
473
548
  kendoDropDownsSelectable
@@ -477,15 +552,19 @@ ListComponent = tslib_1.__decorate([
477
552
  [attr.absolute-index]="dataItem.index"
478
553
  [attr.id]="optionPrefix + '-' + getValue(dataItem.value)"
479
554
  [attr.tabIndex]="-1"
480
- class="k-item"
481
- [ngClass]="{ 'k-virtual-item': virtual, 'k-state-disabled': isDisabled(dataItem.offsetIndex) }">
555
+ [class]="listItemClass"
556
+ [ngClass]="{
557
+ 'k-disabled': isDisabled(dataItem.offsetIndex),
558
+ 'k-table-alt-row': isAltRow(itemIndex - 1)
559
+ }"
560
+ >
482
561
  <ng-template *ngIf="template"
483
562
  [templateContext]="{
484
563
  templateRef: template.templateRef,
485
564
  $implicit: dataItem.value
486
565
  }">
487
566
  </ng-template>
488
- <ng-template [ngIf]="!template">{{ getText(dataItem.value) }}</ng-template>
567
+ <ng-template [ngIf]="!template"><span class="k-list-item-text">{{ getText(dataItem.value) }}</span></ng-template>
489
568
  </li>
490
569
  </ng-template>
491
570
  <kendo-resize-sensor
@@ -0,0 +1,14 @@
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
+ /**
6
+ * Represents the possible fillMode options of the dropdowns.
7
+ *
8
+ * The possible values are:
9
+ * - `'solid'`
10
+ * - `'flat'`
11
+ * - `'outline'`
12
+ * - `null`
13
+ */
14
+ export declare type DropDownFillMode = 'solid' | 'flat' | 'outline';
@@ -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,8 @@
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
+ /**
6
+ * @hidden
7
+ */
8
+ export declare type ListType = 'list' | 'dropdowngrid';
@@ -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,15 @@
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
+ /**
6
+ * Represents the possible rounded options of the dropdowns.
7
+ *
8
+ * The possible values are:
9
+ * - `'small'`
10
+ * - `'medium'`
11
+ * - `'large'`
12
+ * - `'full'`
13
+ * - `null`
14
+ */
15
+ export declare type DropDownRounded = 'small' | 'medium' | 'large' | 'full';
@@ -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,14 @@
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
+ /**
6
+ * Represents the possible size options of the dropdowns.
7
+ *
8
+ * The possible values are:
9
+ * - `'small'`
10
+ * - `'medium'`
11
+ * - `'large'`
12
+ * - `null`
13
+ */
14
+ export declare type DropDownSize = 'small' | 'medium' | 'large';
@@ -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
+ *-------------------------------------------------------------------------------------------*/
@@ -228,7 +228,7 @@ SearchBarComponent = tslib_1.__decorate([
228
228
  [disabled]="disabled"
229
229
  [readonly]="readonly"
230
230
  [placeholder]="placeholder"
231
- [class]="'k-input'"
231
+ [class]="'k-input-inner'"
232
232
  (input)="handleInput($event)"
233
233
  (keydown)="handleKeydown($event)"
234
234
  [kendoEventsOutsideAngular]="{
@@ -60,12 +60,12 @@ tslib_1.__decorate([
60
60
  tslib_1.__metadata("design:type", Boolean)
61
61
  ], SelectableDirective.prototype, "multipleSelection", void 0);
62
62
  tslib_1.__decorate([
63
- HostBinding('class.k-state-focused'),
63
+ HostBinding('class.k-focus'),
64
64
  tslib_1.__metadata("design:type", Boolean),
65
65
  tslib_1.__metadata("design:paramtypes", [])
66
66
  ], SelectableDirective.prototype, "focusedClassName", null);
67
67
  tslib_1.__decorate([
68
- HostBinding('class.k-state-selected'),
68
+ HostBinding('class.k-selected'),
69
69
  tslib_1.__metadata("design:type", Boolean),
70
70
  tslib_1.__metadata("design:paramtypes", [])
71
71
  ], SelectableDirective.prototype, "selectedClassName", null);
@@ -2,13 +2,18 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { EventEmitter } from '@angular/core';
5
+ import { EventEmitter, Renderer2, ElementRef } from '@angular/core';
6
6
  import { TagTemplateDirective } from '../common/templates/tag-template.directive';
7
7
  import { GroupTagTemplateDirective } from '../common/templates/group-tag-template.directive';
8
+ import { DropDownSize } from './models/size';
9
+ import { DropDownRounded } from './models/rounded';
10
+ import { DropDownFillMode } from './models/fillmode';
8
11
  /**
9
12
  * @hidden
10
13
  */
11
14
  export declare class TagListComponent {
15
+ private renderer;
16
+ private hostElement;
12
17
  tags: any[];
13
18
  textField: string | string[];
14
19
  valueField: string;
@@ -19,11 +24,18 @@ export declare class TagListComponent {
19
24
  disabled: boolean;
20
25
  tagPrefix: string;
21
26
  id: string;
27
+ size: DropDownSize;
28
+ rounded: DropDownRounded;
29
+ fillMode: DropDownFillMode;
22
30
  /**
23
31
  * A collection with the disabled tags' indices.
24
32
  */
25
33
  disabledIndices: Set<number>;
26
34
  removeTag: EventEmitter<any>;
35
+ hostClasses: boolean;
36
+ readonly hostId: string;
37
+ private _size;
38
+ constructor(renderer: Renderer2, hostElement: ElementRef<HTMLElement>);
27
39
  tagProp(tag: any, prop: string | string[], index: number): string;
28
40
  isTagDisabled(tag: any, positionIndex: number): boolean;
29
41
  deleteTag(event: any, tag: any, index: number): void;
@@ -3,23 +3,39 @@
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
  let TagListComponent = class TagListComponent {
14
- /**
15
- * @hidden
16
- */
17
- constructor() {
14
+ constructor(renderer, hostElement) {
15
+ this.renderer = renderer;
16
+ this.hostElement = hostElement;
17
+ this.rounded = 'medium';
18
+ this.fillMode = 'solid';
18
19
  /**
19
20
  * A collection with the disabled tags' indices.
20
21
  */
21
22
  this.disabledIndices = new Set();
22
23
  this.removeTag = new EventEmitter();
24
+ this.hostClasses = true;
25
+ this._size = 'medium';
26
+ }
27
+ set size(size) {
28
+ this.renderer.removeClass(this.hostElement.nativeElement, getSizeClass('chip-list', this.size));
29
+ if (size) {
30
+ this.renderer.addClass(this.hostElement.nativeElement, getSizeClass('chip-list', size));
31
+ }
32
+ this._size = size;
33
+ }
34
+ get size() {
35
+ return this._size;
36
+ }
37
+ get hostId() {
38
+ return this.id;
23
39
  }
24
40
  tagProp(tag, prop, index) {
25
41
  const propField = prop && this.getPropField(tag, prop, index);
@@ -110,6 +126,19 @@ tslib_1.__decorate([
110
126
  Input(),
111
127
  tslib_1.__metadata("design:type", String)
112
128
  ], TagListComponent.prototype, "id", void 0);
129
+ tslib_1.__decorate([
130
+ Input(),
131
+ tslib_1.__metadata("design:type", String),
132
+ tslib_1.__metadata("design:paramtypes", [String])
133
+ ], TagListComponent.prototype, "size", null);
134
+ tslib_1.__decorate([
135
+ Input(),
136
+ tslib_1.__metadata("design:type", String)
137
+ ], TagListComponent.prototype, "rounded", void 0);
138
+ tslib_1.__decorate([
139
+ Input(),
140
+ tslib_1.__metadata("design:type", String)
141
+ ], TagListComponent.prototype, "fillMode", void 0);
113
142
  tslib_1.__decorate([
114
143
  Input(),
115
144
  tslib_1.__metadata("design:type", Set)
@@ -118,55 +147,81 @@ tslib_1.__decorate([
118
147
  Output(),
119
148
  tslib_1.__metadata("design:type", EventEmitter)
120
149
  ], TagListComponent.prototype, "removeTag", void 0);
150
+ tslib_1.__decorate([
151
+ HostBinding('class.k-input-values'),
152
+ HostBinding('class.k-chip-list'),
153
+ HostBinding('class.k-selection-multiple'),
154
+ tslib_1.__metadata("design:type", Boolean)
155
+ ], TagListComponent.prototype, "hostClasses", void 0);
156
+ tslib_1.__decorate([
157
+ HostBinding('attr.id'),
158
+ tslib_1.__metadata("design:type", String),
159
+ tslib_1.__metadata("design:paramtypes", [])
160
+ ], TagListComponent.prototype, "hostId", null);
121
161
  TagListComponent = tslib_1.__decorate([
122
162
  Component({
123
163
  selector: 'kendo-taglist',
124
164
  template: `
125
- <ul [attr.id]="id" class="k-reset">
126
- <li
127
- *ngFor="let tag of tags; let index = index;"
128
- role="option"
129
- [attr.id]="itemId(tag, index)"
130
- [attr.aria-hidden]="tagAriaHidden(index)"
131
- aria-selected="true"
132
- [attr.aria-setsize]="tags?.length"
133
- class="k-button"
134
- [ngClass]="{
135
- 'k-state-focused': index === focused,
136
- 'k-state-disabled': isTagDisabled(tag, index)
137
- }"
138
- >
165
+ <div
166
+ *ngFor="let tag of tags; let index = index;"
167
+ role="option"
168
+ [attr.id]="itemId(tag, index)"
169
+ [attr.aria-hidden]="tagAriaHidden(index)"
170
+ aria-selected="true"
171
+ [attr.aria-setsize]="tags?.length"
172
+ class="k-chip"
173
+ [ngClass]="{
174
+ 'k-focus': index === focused,
175
+ 'k-disabled': isTagDisabled(tag, index),
176
+ 'k-chip-sm': size === 'small',
177
+ 'k-chip-md': size === 'medium',
178
+ 'k-chip-lg': size === 'large',
179
+ 'k-rounded-sm': rounded === 'small',
180
+ 'k-rounded-md': rounded === 'medium',
181
+ 'k-rounded-lg': rounded === 'large',
182
+ 'k-rounded-full': rounded === 'full',
183
+ 'k-chip-solid k-chip-solid-base': fillMode === 'solid',
184
+ 'k-chip-flat k-chip-flat-base': fillMode === 'flat',
185
+ 'k-chip-outline k-chip-outline-base': fillMode === 'outline'
186
+ }"
187
+ >
188
+ <span class="k-chip-content">
139
189
  <ng-template *ngIf="isGroupTag(tag); then groupTag else singleTag"></ng-template>
140
- <ng-template #groupTag>
141
- <span>
142
- <ng-template *ngIf="groupTemplate"
143
- [templateContext]="{
144
- templateRef: groupTemplate.templateRef,
145
- $implicit: tag
146
- }">
147
- </ng-template>
148
- <ng-template [ngIf]="!groupTemplate">{{ tag.length }} {{ tag.length === 1 ? 'item' : 'items' }} selected</ng-template>
149
- </span>
150
- </ng-template>
151
- <ng-template #singleTag>
152
- <span>
153
- <ng-template *ngIf="template"
154
- [templateContext]="{
155
- templateRef: template.templateRef,
156
- $implicit: tag
157
- }">
158
- </ng-template>
159
- <ng-template [ngIf]="!template">{{ tagProp(tag, textField, index) }}</ng-template>
160
- </span>
161
- </ng-template>
190
+ <ng-template #groupTag>
191
+ <span class="k-chip-label k-text-ellipsis">
192
+ <ng-template *ngIf="groupTemplate"
193
+ [templateContext]="{
194
+ templateRef: groupTemplate.templateRef,
195
+ $implicit: tag
196
+ }">
197
+ </ng-template>
198
+ <ng-template [ngIf]="!groupTemplate">{{ tag.length }} {{ tag.length === 1 ? 'item' : 'items' }} selected</ng-template>
199
+ </span>
200
+ </ng-template>
201
+ <ng-template #singleTag>
202
+ <span class="k-chip-label k-text-ellipsis">
203
+ <ng-template *ngIf="template"
204
+ [templateContext]="{
205
+ templateRef: template.templateRef,
206
+ $implicit: tag
207
+ }">
208
+ </ng-template>
209
+ <ng-template [ngIf]="!template">{{ tagProp(tag, textField, index) }}</ng-template>
210
+ </span>
211
+ </ng-template>
212
+ </span>
162
213
 
163
- <span aria-label="delete" [attr.aria-hidden]="index !== focused" class="k-select">
164
- <span class="k-icon k-i-close" (mousedown)="deleteTag($event, tag, index)">
214
+ <span class="k-chip-actions">
215
+ <span aria-label="delete" [attr.aria-hidden]="index !== focused" class="k-chip-action k-chip-remove-action">
216
+ <span class="k-icon k-i-x-circle" (mousedown)="deleteTag($event, tag, index)">
165
217
  </span>
166
218
  </span>
167
- </li>
168
- </ul>
219
+ </span>
220
+ </div>
221
+ <ng-content></ng-content>
169
222
  `
170
- })
223
+ }),
224
+ tslib_1.__metadata("design:paramtypes", [Renderer2,
225
+ ElementRef])
171
226
  ], TagListComponent);
172
227
  export { TagListComponent };