@progress/kendo-angular-dropdowns 21.4.1 → 22.0.0

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 (84) hide show
  1. package/common/localization/messages.d.ts +1 -1
  2. package/dropdowntrees/checked-state/base-check.directive.d.ts +1 -1
  3. package/fesm2022/progress-kendo-angular-dropdowns.mjs +173 -173
  4. package/package.json +14 -22
  5. package/schematics/ngAdd/index.js +2 -2
  6. package/esm2022/autocomplete/autocomplete.component.mjs +0 -1687
  7. package/esm2022/autocomplete/autocomplete.module.mjs +0 -70
  8. package/esm2022/comboboxes/combobox-column/column-cell-template.directive.mjs +0 -42
  9. package/esm2022/comboboxes/combobox-column/column-header-template.directive.mjs +0 -40
  10. package/esm2022/comboboxes/combobox-column/combobox-column.component.mjs +0 -116
  11. package/esm2022/comboboxes/combobox-column/util.mjs +0 -60
  12. package/esm2022/comboboxes/combobox.component.mjs +0 -2149
  13. package/esm2022/comboboxes/combobox.module.mjs +0 -77
  14. package/esm2022/comboboxes/multicolumncombobox.component.mjs +0 -883
  15. package/esm2022/common/adaptive-renderer.component.mjs +0 -253
  16. package/esm2022/common/constants/error-messages.mjs +0 -61
  17. package/esm2022/common/data.service.mjs +0 -250
  18. package/esm2022/common/disabled-items/disabled-items.service.mjs +0 -47
  19. package/esm2022/common/disabled-items/item-disabled.mjs +0 -5
  20. package/esm2022/common/filter-input.directive.mjs +0 -39
  21. package/esm2022/common/filtering/filter-settings.mjs +0 -5
  22. package/esm2022/common/filtering/filter.directive.mjs +0 -136
  23. package/esm2022/common/filtering/filterable-component.mjs +0 -34
  24. package/esm2022/common/list-item.directive.mjs +0 -25
  25. package/esm2022/common/list.component.mjs +0 -968
  26. package/esm2022/common/localization/custom-messages.component.mjs +0 -96
  27. package/esm2022/common/localization/localized-messages.directive.mjs +0 -47
  28. package/esm2022/common/localization/messages.mjs +0 -77
  29. package/esm2022/common/models/checkboxes-settings.mjs +0 -15
  30. package/esm2022/common/models/direction.mjs +0 -5
  31. package/esm2022/common/models/fillmode.mjs +0 -5
  32. package/esm2022/common/models/list-type.mjs +0 -5
  33. package/esm2022/common/models/page-change-event.mjs +0 -5
  34. package/esm2022/common/models/popup-settings.mjs +0 -5
  35. package/esm2022/common/models/preventable-event.mjs +0 -25
  36. package/esm2022/common/models/remove-tag-event.mjs +0 -23
  37. package/esm2022/common/models/rounded.mjs +0 -5
  38. package/esm2022/common/models/size.mjs +0 -5
  39. package/esm2022/common/models/virtualization-settings.mjs +0 -24
  40. package/esm2022/common/navigation/navigation-action.mjs +0 -32
  41. package/esm2022/common/navigation/navigation.service.mjs +0 -188
  42. package/esm2022/common/searchbar.component.mjs +0 -386
  43. package/esm2022/common/selection/selectable.directive.mjs +0 -83
  44. package/esm2022/common/selection/selection.service.mjs +0 -166
  45. package/esm2022/common/shared-events.directive.mjs +0 -99
  46. package/esm2022/common/taglist.component.mjs +0 -295
  47. package/esm2022/common/templates/custom-item-template.directive.mjs +0 -48
  48. package/esm2022/common/templates/fixed-group-template.directive.mjs +0 -55
  49. package/esm2022/common/templates/footer-template.directive.mjs +0 -49
  50. package/esm2022/common/templates/group-tag-template.directive.mjs +0 -47
  51. package/esm2022/common/templates/group-template.directive.mjs +0 -55
  52. package/esm2022/common/templates/header-template.directive.mjs +0 -49
  53. package/esm2022/common/templates/item-template.directive.mjs +0 -48
  54. package/esm2022/common/templates/no-data-template.directive.mjs +0 -49
  55. package/esm2022/common/templates/tag-template.directive.mjs +0 -46
  56. package/esm2022/common/templates/value-template.directive.mjs +0 -50
  57. package/esm2022/common/util.mjs +0 -376
  58. package/esm2022/directives.mjs +0 -172
  59. package/esm2022/dropdownlist/dropdownlist.component.mjs +0 -1999
  60. package/esm2022/dropdownlist/dropdownlist.module.mjs +0 -79
  61. package/esm2022/dropdowns.module.mjs +0 -76
  62. package/esm2022/dropdowntrees/checked-state/base-check.directive.mjs +0 -76
  63. package/esm2022/dropdowntrees/checked-state/check-all.directive.mjs +0 -170
  64. package/esm2022/dropdowntrees/checked-state/check.directive.mjs +0 -168
  65. package/esm2022/dropdowntrees/checked-state/checkable-settings.mjs +0 -5
  66. package/esm2022/dropdowntrees/checked-state/checked-item.mjs +0 -5
  67. package/esm2022/dropdowntrees/data-binding/dropdowntree/flat-binding.directive.mjs +0 -69
  68. package/esm2022/dropdowntrees/data-binding/dropdowntree/hierarchy-binding.directive.mjs +0 -62
  69. package/esm2022/dropdowntrees/data-binding/multiselecttree/flat-binding.directive.mjs +0 -69
  70. package/esm2022/dropdowntrees/data-binding/multiselecttree/hierarchy-binding.directive.mjs +0 -62
  71. package/esm2022/dropdowntrees/dropdowntree.component.mjs +0 -1967
  72. package/esm2022/dropdowntrees/dropdowntrees.module.mjs +0 -79
  73. package/esm2022/dropdowntrees/expanded-state/expand.directive.mjs +0 -49
  74. package/esm2022/dropdowntrees/lookup/lookup.mjs +0 -5
  75. package/esm2022/dropdowntrees/lookup/lookup.service.mjs +0 -82
  76. package/esm2022/dropdowntrees/multiselecttree.component.mjs +0 -2359
  77. package/esm2022/dropdowntrees/summary-tag/summary-tag.directive.mjs +0 -70
  78. package/esm2022/dropdowntrees/templates/node-template.directive.mjs +0 -31
  79. package/esm2022/index.mjs +0 -55
  80. package/esm2022/multiselect/multiselect.component.mjs +0 -2380
  81. package/esm2022/multiselect/multiselect.module.mjs +0 -79
  82. package/esm2022/multiselect/summary-tag.directive.mjs +0 -68
  83. package/esm2022/package-metadata.mjs +0 -16
  84. package/esm2022/progress-kendo-angular-dropdowns.mjs +0 -8
@@ -1,968 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Component, Input, Output, EventEmitter, ViewChildren, QueryList, ElementRef, ViewChild, ChangeDetectorRef, NgZone, Renderer2 } from '@angular/core';
6
- import { ResizeSensorComponent, TemplateContextDirective, isChanged, replaceMessagePlaceholder } from '@progress/kendo-angular-common';
7
- import { LocalizationService } from '@progress/kendo-angular-l10n';
8
- import { ListItemDirective } from './list-item.directive';
9
- import { ItemTemplateDirective } from './templates/item-template.directive';
10
- import { GroupTemplateDirective } from './templates/group-template.directive';
11
- import { FixedGroupTemplateDirective } from './templates/fixed-group-template.directive';
12
- import { isPresent, getter, closest, getSizeClass, getRoundedClass } from './util';
13
- import { SelectionService } from './selection/selection.service';
14
- import { fromEvent, merge } from 'rxjs';
15
- import { map, tap, auditTime, switchMap, take } from 'rxjs/operators';
16
- import { DisabledItemsService } from './disabled-items/disabled-items.service';
17
- import { DataService } from './data.service';
18
- import { NavigationAction } from './navigation/navigation-action';
19
- import { SelectableDirective } from './selection/selectable.directive';
20
- import { NgStyle, NgClass } from '@angular/common';
21
- import { CustomItemTemplateDirective } from './templates/custom-item-template.directive';
22
- import * as i0 from "@angular/core";
23
- import * as i1 from "./data.service";
24
- import * as i2 from "./selection/selection.service";
25
- import * as i3 from "./disabled-items/disabled-items.service";
26
- import * as i4 from "@progress/kendo-angular-l10n";
27
- /**
28
- * @hidden
29
- */
30
- export class ListComponent {
31
- dataService;
32
- wrapper;
33
- selectionService;
34
- disabledItemsService;
35
- cdr;
36
- zone;
37
- renderer;
38
- localization;
39
- selected = [];
40
- focused = -1;
41
- textField;
42
- valueField;
43
- height;
44
- template;
45
- groupTemplate;
46
- fixedGroupTemplate;
47
- show = true;
48
- id;
49
- optionPrefix;
50
- multipleSelection = false;
51
- virtual;
52
- type = 'list';
53
- checkboxes = { enabled: false };
54
- ariaLive;
55
- isMultiselect;
56
- isActionSheetExpanded;
57
- showStickyHeader;
58
- rowWidth;
59
- customItemTemplate;
60
- text;
61
- allowCustom;
62
- defaultItem;
63
- set data(data) {
64
- this._data = data[0]?.header ? data.slice(0) : data;
65
- if (this.dataService.grouped) {
66
- if (this.virtual) {
67
- const firstGroupItem = this.dataService.data.find(item => item.header && item.groupIndex === this.data[0].groupIndex);
68
- if (!this.data[0].header) {
69
- this._data = [firstGroupItem, ...this._data.slice(1)];
70
- }
71
- }
72
- this.groupedData = this._data.filter(item => item?.header);
73
- this.groupedData.forEach(group => {
74
- group.items = this._data.filter(item => !item.header && item.groupIndex === group.groupIndex);
75
- });
76
- }
77
- }
78
- get data() {
79
- return this._data;
80
- }
81
- set size(size) {
82
- if (this.type === 'list') {
83
- this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('list', this.size));
84
- if (size) {
85
- this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('list', size));
86
- }
87
- this._size = size;
88
- }
89
- }
90
- get size() {
91
- return this._size;
92
- }
93
- groupedData;
94
- rounded = 'medium';
95
- onClick = new EventEmitter();
96
- pageChange = new EventEmitter();
97
- listResize = new EventEmitter();
98
- popupListScroll = new EventEmitter();
99
- items;
100
- content;
101
- list;
102
- virtualContainer;
103
- currentGroup;
104
- startFrom = 0;
105
- lastLoaded = 0;
106
- lastScrollTop = 0;
107
- listContentClass;
108
- listClass;
109
- listItemClass;
110
- listVirtualClass;
111
- listGroupStickyHeaderClass;
112
- listGroupStickyHeaderTextClass;
113
- listGroupItemClass;
114
- listGroupItemTextClass;
115
- scrollToFocused = false;
116
- _data;
117
- scrollSubscription;
118
- selectSubscription;
119
- _size = 'medium';
120
- get pageSize() {
121
- if (this.virtual.pageSize) {
122
- return this.virtual.pageSize;
123
- }
124
- const size = Math.round(this.height / this.virtual.itemHeight);
125
- return size;
126
- }
127
- get scrollHeight() {
128
- return this.virtual.total * this.virtual.itemHeight;
129
- }
130
- get overflowY() {
131
- if (isPresent(this.virtual)) {
132
- const overflow = this.hasVirtualScrollbar() ? 'scroll' : 'hidden';
133
- return overflow;
134
- }
135
- }
136
- /**
137
- * @hidden
138
- */
139
- get useCustomValueText() {
140
- const localizationMsg = this.localization.get('useCustomValueText');
141
- return replaceMessagePlaceholder(localizationMsg, 'customValue', this.text);
142
- }
143
- /**
144
- * @hidden
145
- */
146
- get checkboxClasses() {
147
- return `${this.size ? getSizeClass('checkbox', this.size) : ''} ${this.rounded ? getRoundedClass(this.rounded) : ''}`;
148
- }
149
- /* tslint:disable:member-ordering */
150
- constructor(dataService, wrapper, selectionService, disabledItemsService, cdr, zone, renderer, localization) {
151
- this.dataService = dataService;
152
- this.wrapper = wrapper;
153
- this.selectionService = selectionService;
154
- this.disabledItemsService = disabledItemsService;
155
- this.cdr = cdr;
156
- this.zone = zone;
157
- this.renderer = renderer;
158
- this.localization = localization;
159
- this.selectSubscription = merge(this.selectionService.onSelect.pipe(map((args) => args.indices[0])), this.selectionService.onFocus)
160
- .pipe(
161
- // handle only the very last onSelect/onFocus emission
162
- switchMap(event => this.zone.onStable.pipe(take(1), map(() => event))))
163
- .subscribe(this.scrollToItem.bind(this));
164
- this.prepareClasses();
165
- }
166
- ngOnChanges(changes) {
167
- if (isChanged('data', changes, false)) {
168
- if (this.lastLoaded <= 0) {
169
- this.lastLoaded = this.data.length - 1;
170
- this.scrollToFocused = !changes['data'].isFirstChange();
171
- }
172
- this.setOverflow();
173
- }
174
- if (isChanged('virtual', changes, false)) {
175
- this.setOverflow();
176
- }
177
- if (isChanged('type', changes, false)) {
178
- this.prepareClasses();
179
- }
180
- }
181
- ngAfterViewInit() {
182
- this.setComponentClasses();
183
- this.zone.runOutsideAngular(() => {
184
- this.scrollSubscription = fromEvent(this.content.nativeElement, "scroll").pipe(auditTime(100), tap(this.prefetchData.bind(this)), tap(this.findCurrentGroup.bind(this))).subscribe(() => {
185
- this.lastScrollTop = this.content.nativeElement.scrollTop;
186
- });
187
- });
188
- this.setOverflow();
189
- }
190
- ngAfterViewChecked() {
191
- if (this.virtual) {
192
- this.positionItems();
193
- }
194
- if (this.items && this.scrollToFocused) {
195
- this.scrollToFocused = false;
196
- const scrollTarget = this.items.length && this.selectionService.focused === -1 ? 0 : this.selectionService.focused;
197
- this.scrollToItem(scrollTarget);
198
- }
199
- if (this.dataService.grouped) {
200
- this.findCurrentGroup();
201
- }
202
- }
203
- ngOnDestroy() {
204
- this.selectSubscription.unsubscribe();
205
- if (this.scrollSubscription) {
206
- this.scrollSubscription.unsubscribe();
207
- }
208
- }
209
- onCheckedChange(e, index) {
210
- const isChecked = e.target['checked'];
211
- if (isChecked && !this.selectionService.isSelected(index)) {
212
- this.selectionService.add(index);
213
- }
214
- if (!isChecked && this.selectionService.isSelected(index)) {
215
- this.selectionService.deselect(index);
216
- }
217
- }
218
- prepareClasses() {
219
- if (this.type === 'list') {
220
- this.listContentClass = 'k-list-content';
221
- this.listClass = 'k-list-ul';
222
- this.listItemClass = 'k-list-item';
223
- this.listVirtualClass = 'k-virtual-list';
224
- this.listGroupStickyHeaderClass = 'k-list-group-sticky-header';
225
- this.listGroupStickyHeaderTextClass = 'k-list-header-text';
226
- this.listGroupItemClass = 'k-list-group-item';
227
- this.listGroupItemTextClass = 'k-list-item-text';
228
- }
229
- else {
230
- this.listContentClass = 'k-table-body k-table-scroller';
231
- this.listClass = 'k-table k-table-list';
232
- this.listItemClass = 'k-table-row';
233
- this.listVirtualClass = 'k-virtual-table';
234
- this.listGroupStickyHeaderClass = 'k-table-group-sticky-header';
235
- this.listGroupStickyHeaderTextClass = 'k-table-th';
236
- this.listGroupItemClass = 'k-table-group-row';
237
- this.listGroupItemTextClass = 'k-table-th';
238
- }
239
- }
240
- isChecked(index) {
241
- const normalizedIndex = this.virtual ? index + this.virtual.skip : index;
242
- return this.selectionService.isSelected(normalizedIndex);
243
- }
244
- firstVisibleItem() {
245
- const content = this.content.nativeElement;
246
- const rect = content.getBoundingClientRect();
247
- // IE9 hack
248
- const disabled = Array.prototype.slice.call(content.querySelectorAll(".k-disabled"));
249
- // This is a workaround for finding elements with pointer-events: none;
250
- disabled.forEach((el) => this.renderer.setStyle(el, "pointer-events", "auto"));
251
- const item = document.elementFromPoint(rect.left + 1, rect.top + 1);
252
- disabled.forEach((el) => this.renderer.setStyle(el, "pointer-events", "none"));
253
- // return the closest `li` item to cover the custom template scenario
254
- return closest(item, 'li');
255
- }
256
- findCurrentGroup() {
257
- if (!this.dataService.grouped) {
258
- this.currentGroup = undefined;
259
- return;
260
- }
261
- const item = this.firstVisibleItem();
262
- if (item) {
263
- let index;
264
- if (item.getAttribute("role") === "presentation") {
265
- index = parseInt(item.getAttribute("group-index"), 10);
266
- this.currentGroup = this.dataService.groupAt(index)?.value;
267
- }
268
- else {
269
- index = parseInt(item.getAttribute("index"), 10);
270
- this.currentGroup = this.dataService.itemGroup(this.dataService.itemAt(index));
271
- }
272
- }
273
- else {
274
- this.currentGroup = undefined;
275
- }
276
- this.cdr.detectChanges();
277
- }
278
- prefetchData() {
279
- if (!this.virtual) {
280
- return;
281
- }
282
- const visibleItems = Math.trunc(this.content.nativeElement.clientHeight / this.virtual.itemHeight);
283
- const offsetY = this.content.nativeElement.scrollTop;
284
- const start = Math.trunc(offsetY / this.virtual.itemHeight);
285
- const down = offsetY > this.lastScrollTop;
286
- const nextPage = (start + visibleItems >= this.lastLoaded) && this.lastLoaded < this.virtual.total - 1;
287
- const leftOver = this.pageSize - (this.lastLoaded - this.startFrom);
288
- const prevPage = this.lastLoaded - this.pageSize + visibleItems >= start - leftOver;
289
- if (down && nextPage) {
290
- this.changePage(start);
291
- }
292
- if (!down && prevPage) {
293
- this.changePage(start - this.pageSize + visibleItems + 1);
294
- }
295
- }
296
- changePage(start) {
297
- this.zone.run(() => {
298
- let end = this.pageSize + start;
299
- if (end > this.virtual.total) {
300
- start--;
301
- end = this.virtual.total;
302
- }
303
- if (start < 0) {
304
- start = 0;
305
- }
306
- this.startFrom = start;
307
- this.lastLoaded = end;
308
- this.pageChange.emit({ skip: start, take: this.pageSize });
309
- });
310
- }
311
- index(groupIndex, itemIndex) {
312
- return groupIndex > 0 ? (this.dataService.groupIndices[groupIndex - 1] + itemIndex) : itemIndex;
313
- }
314
- getText(dataItem) {
315
- return getter(dataItem, this.textField);
316
- }
317
- getValue(dataItem) {
318
- return getter(dataItem, this.valueField);
319
- }
320
- generateGroupId(dataItem) {
321
- return `${this.optionPrefix}-${dataItem.groupIndex}-${dataItem.value.toString().split(' ').join('')}`;
322
- }
323
- isDisabled(index) {
324
- if (isPresent(this.virtual) && !this.dataService.grouped) {
325
- index += this.virtual.skip;
326
- }
327
- return this.disabledItemsService.isIndexDisabled(index);
328
- }
329
- isAltRow(index) {
330
- return this.type === 'dropdowngrid' && index % 2 !== 0;
331
- }
332
- scrollToItem(index) {
333
- let flatIndex = index;
334
- if (this.dataService.grouped) {
335
- // takes into account the group header items
336
- flatIndex = this.dataService.flatIndex(index);
337
- }
338
- if (this.virtual && flatIndex > -1) {
339
- this.scrollToIndex(flatIndex);
340
- return;
341
- }
342
- const items = this.items.toArray();
343
- if (isPresent(items[flatIndex]) && flatIndex !== -1) {
344
- this.scroll(items[flatIndex].element);
345
- }
346
- }
347
- scrollWithOnePage(action) {
348
- const content = this.content.nativeElement;
349
- const contentOffsetHeight = content.clientHeight;
350
- if (action === NavigationAction.PageDown) {
351
- content.scrollTop += contentOffsetHeight;
352
- }
353
- else if (action === NavigationAction.PageUp) {
354
- content.scrollTop -= contentOffsetHeight;
355
- }
356
- }
357
- scrollToIndex(index) {
358
- const content = this.content.nativeElement;
359
- let contentScrollTop = content.scrollTop;
360
- const itemOffsetTop = index * this.virtual.itemHeight;
361
- const itemOffsetHeight = this.virtual.itemHeight;
362
- const contentOffsetHeight = content.clientHeight;
363
- const bottomDistance = itemOffsetTop + itemOffsetHeight;
364
- if (contentScrollTop > itemOffsetTop) {
365
- contentScrollTop = itemOffsetTop;
366
- }
367
- else if (bottomDistance > (contentScrollTop + contentOffsetHeight)) {
368
- contentScrollTop = (bottomDistance - contentOffsetHeight);
369
- }
370
- content.scrollTop = contentScrollTop;
371
- }
372
- scroll(item) {
373
- if (!item) {
374
- return;
375
- }
376
- const nativeElement = item.nativeElement;
377
- const content = this.content.nativeElement;
378
- const itemOffsetTop = nativeElement.offsetTop;
379
- const itemOffsetHeight = nativeElement.offsetHeight;
380
- let contentScrollTop = content.scrollTop;
381
- const contentOffsetHeight = content.clientHeight;
382
- const bottomDistance = itemOffsetTop + itemOffsetHeight;
383
- if (contentScrollTop > itemOffsetTop) {
384
- contentScrollTop = itemOffsetTop;
385
- }
386
- else if (bottomDistance > (contentScrollTop + contentOffsetHeight)) {
387
- contentScrollTop = (bottomDistance - contentOffsetHeight);
388
- }
389
- content.scrollTop = contentScrollTop;
390
- }
391
- /**
392
- * Indicates whether a scrollbar is currently rendered in the list.
393
- */
394
- hasScrollbar() {
395
- if (!(isPresent(this.items) && this.items.length && isPresent(this.list) && isPresent(this.content))) {
396
- return false;
397
- }
398
- const hasVirtualScroll = isPresent(this.virtual) && this.hasVirtualScrollbar();
399
- return hasVirtualScroll || this.list.nativeElement.scrollHeight > this.content.nativeElement.offsetHeight;
400
- }
401
- isItemSelected(index) {
402
- return this.selectionService.isSelected(index) || null;
403
- }
404
- get isDisabledDefaultItem() {
405
- return this.disabledItemsService.isItemDisabled(this.defaultItem);
406
- }
407
- getDefaultItemText() {
408
- return getter(this.defaultItem, this.textField);
409
- }
410
- /**
411
- * Sets the list's content overflow (hides/shows scrollbar)
412
- */
413
- setOverflow() {
414
- if (this.virtual) {
415
- const overflow = this.hasVirtualScrollbar() ? 'scroll' : 'hidden';
416
- this.renderer.setStyle(this.content.nativeElement, 'overflow-y', overflow);
417
- }
418
- }
419
- /**
420
- * Indicates whether the scrollbar should be visible in virtual mode.
421
- */
422
- hasVirtualScrollbar() {
423
- const contentOffsetHeight = this.content.nativeElement.offsetHeight;
424
- const virtualOffsetHeight = this.virtualContainer && this.virtualContainer.nativeElement.offsetHeight;
425
- return this.virtualContainer && virtualOffsetHeight > contentOffsetHeight;
426
- }
427
- positionItems() {
428
- this.items.forEach((item, index) => {
429
- const offsetY = (index + this.startFrom) * this.virtual.itemHeight;
430
- this.renderer.setStyle(item.element.nativeElement, "transform", `translateY(${offsetY}px`);
431
- });
432
- }
433
- setComponentClasses() {
434
- if (this.type === 'list') {
435
- this.renderer.addClass(this.wrapper.nativeElement, 'k-list');
436
- if (this.size) {
437
- this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('list', this.size));
438
- }
439
- }
440
- if (this.type === 'dropdowngrid') {
441
- this.renderer.setStyle(this.wrapper.nativeElement, 'overflow-y', 'scroll');
442
- }
443
- if (isPresent(this.virtual)) {
444
- this.renderer.addClass(this.wrapper.nativeElement, this.listVirtualClass);
445
- }
446
- }
447
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListComponent, deps: [{ token: i1.DataService }, { token: i0.ElementRef }, { token: i2.SelectionService }, { token: i3.DisabledItemsService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i4.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
448
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ListComponent, isStandalone: true, selector: "kendo-list", inputs: { selected: "selected", focused: "focused", textField: "textField", valueField: "valueField", height: "height", template: "template", groupTemplate: "groupTemplate", fixedGroupTemplate: "fixedGroupTemplate", show: "show", id: "id", optionPrefix: "optionPrefix", multipleSelection: "multipleSelection", virtual: "virtual", type: "type", checkboxes: "checkboxes", ariaLive: "ariaLive", isMultiselect: "isMultiselect", isActionSheetExpanded: "isActionSheetExpanded", showStickyHeader: "showStickyHeader", rowWidth: "rowWidth", customItemTemplate: "customItemTemplate", text: "text", allowCustom: "allowCustom", defaultItem: "defaultItem", data: "data", size: "size", rounded: "rounded" }, outputs: { onClick: "onClick", pageChange: "pageChange", listResize: "listResize", popupListScroll: "popupListScroll" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, static: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true }, { propertyName: "virtualContainer", first: true, predicate: ["virtualContainer"], descendants: true }, { propertyName: "items", predicate: ListItemDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
449
- @if (defaultItem && !template) {
450
- <div
451
- class="k-list-optionlabel"
452
- [ngClass]="{ 'k-disabled': isDisabledDefaultItem }"
453
- kendoDropDownsSelectable
454
- [index]="-1">
455
- {{ getDefaultItemText() }}
456
- </div>
457
- }
458
- @if (defaultItem && template) {
459
- <div
460
- class="k-list-optionlabel"
461
- [ngClass]="{ 'k-disabled': isDisabledDefaultItem }"
462
- kendoDropDownsSelectable
463
- [index]="-1">
464
- <ng-template
465
- [templateContext]="{
466
- templateRef: template.templateRef,
467
- $implicit: defaultItem
468
- }">
469
- </ng-template>
470
- </div>
471
- }
472
- @if (allowCustom && text) {
473
- <div
474
- kendoDropDownsSelectable
475
- [multipleSelection]="true"
476
- [index]="-1"
477
- class="k-list-custom-value">
478
- @if (customItemTemplate) {
479
- <ng-template
480
- [templateContext]="{
481
- templateRef: customItemTemplate.templateRef,
482
- $implicit: text
483
- }">
484
- </ng-template>
485
- } @else {
486
- {{useCustomValueText}}
487
- }
488
- </div>
489
- }
490
- @if (dataService.grouped && showStickyHeader) {
491
- <div
492
- [class]="listGroupStickyHeaderClass"
493
- [ngStyle]="{
494
- 'height.px': virtual?.itemHeight,
495
- 'minHeight.px' : virtual?.itemHeight,
496
- 'boxSizing' : virtual ? 'border-box' : 'inherit'}"
497
- >
498
- @if (fixedGroupTemplate) {
499
- <ng-template
500
- [templateContext]="{
501
- templateRef: fixedGroupTemplate.templateRef,
502
- $implicit: currentGroup
503
- }">
504
- </ng-template>
505
- }
506
- @if (!fixedGroupTemplate) {
507
- <span [class]="listGroupStickyHeaderTextClass">{{ currentGroup }}</span>
508
- }
509
- </div>
510
- }
511
- <div #content
512
- [class]="listContentClass"
513
- [style.maxHeight.px]="height"
514
- unselectable="on"
515
- (scroll)="popupListScroll.emit($event)"
516
- [attr.role]="dataService.grouped ? 'listbox' : null"
517
- [attr.id]="dataService.grouped ? id : null"
518
- [attr.aria-live]="dataService.grouped ? ariaLive : null"
519
- [attr.aria-multiselectable]="dataService.grouped ? isMultiselect : null"
520
- [attr.aria-hidden]="dataService.grouped ? !show : null"
521
- >
522
- @if (!dataService.grouped) {
523
- <ul #list
524
- [attr.role]="'listbox'"
525
- [class]="listClass"
526
- [attr.id]="id"
527
- [attr.aria-live]="ariaLive"
528
- [attr.aria-multiselectable]="isMultiselect"
529
- [attr.aria-hidden]="!show">
530
- @for (dataItem of data; track $index; let itemIndex = $index) {
531
- <li
532
- role="option"
533
- kendoDropDownsSelectable
534
- [checkboxes]="checkboxes"
535
- [height]="virtual?.itemHeight"
536
- [index]="itemIndex + startFrom"
537
- [multipleSelection]="multipleSelection"
538
- [attr.id]="optionPrefix + '-' + itemIndex"
539
- [attr.tabIndex]="-1"
540
- [attr.aria-selected]="isItemSelected(itemIndex)"
541
- [class]="listItemClass"
542
- [ngClass]="{
543
- 'k-disabled': isDisabled(itemIndex),
544
- 'k-table-alt-row': isAltRow(itemIndex)
545
- }"
546
- [style.width.px]="rowWidth ?? null"
547
- >
548
- @if (checkboxes.enabled) {
549
- <input
550
- type="checkbox"
551
- class="k-checkbox"
552
- role="presentation"
553
- tabindex="-1"
554
- [ngClass]="checkboxClasses"
555
- (change)="onCheckedChange($event, itemIndex + startFrom)"
556
- [checked]="isChecked(itemIndex)"
557
- />
558
- }
559
- @if (template) {
560
- <ng-template
561
- [templateContext]="{
562
- templateRef: template.templateRef,
563
- $implicit: dataItem
564
- }">
565
- </ng-template>
566
- }
567
- @if (!template) {
568
- <span class="k-list-item-text">{{ getText(dataItem) }}</span>
569
- }
570
- </li>
571
- }
572
- @if (!virtual) {
573
- <kendo-resize-sensor
574
- (resize)="listResize.emit()"
575
- >
576
- </kendo-resize-sensor>
577
- }
578
- </ul>
579
- }
580
-
581
- @if (dataService.grouped) {
582
- <ng-container #list>
583
- @for (dataItem of groupedData; track dataItem) {
584
- <ul
585
- #groupUl
586
- class="k-list-ul"
587
- [attr.role]="'group'"
588
- [attr.aria-labelledby]="generateGroupId(dataItem)"
589
- >
590
- @if (dataItem.header) {
591
- <li
592
- role="presentation"
593
- [class]="listGroupItemClass"
594
- [class.k-table-alt-row]="isAltRow(dataItem.index - 1)"
595
- [ngStyle]="{
596
- 'height.px': virtual?.itemHeight,
597
- 'minHeight.px' : virtual?.itemHeight,
598
- 'boxSizing' : virtual ? 'border-box' : 'inherit'}"
599
- [attr.group-index]="dataItem.index"
600
- [attr.id]="groupUl.getAttribute('aria-labelledby')"
601
- [style.width.px]="rowWidth ?? null"
602
- >
603
- <span [class]="listGroupItemTextClass">
604
- @if (groupTemplate) {
605
- <ng-template
606
- [templateContext]="{
607
- templateRef: groupTemplate.templateRef,
608
- $implicit: dataItem.value
609
- }">
610
- </ng-template>
611
- }
612
- @if (!groupTemplate) {
613
- {{ dataItem.value }}
614
- }
615
- </span>
616
- </li>
617
- }
618
- @for (item of dataItem.items; track item) {
619
- <li
620
- role="option"
621
- kendoDropDownsSelectable
622
- [height]="virtual?.itemHeight"
623
- [index]="item.offsetIndex"
624
- [multipleSelection]="multipleSelection"
625
- [attr.absolute-index]="item.index"
626
- [attr.id]="optionPrefix + '-' + (item.index - 1 - item.groupIndex)"
627
- [attr.tabIndex]="-1"
628
- [attr.aria-selected]="isItemSelected(item.offsetIndex)"
629
- [class]="listItemClass"
630
- [ngClass]="{
631
- 'k-disabled': isDisabled(item.offsetIndex),
632
- 'k-table-alt-row': isAltRow(item.index - 1)
633
- }"
634
- [style.width.px]="rowWidth ?? null">
635
- @if (template) {
636
- <ng-template
637
- [templateContext]="{
638
- templateRef: template.templateRef,
639
- $implicit: item.value
640
- }">
641
- </ng-template>
642
- }
643
- @if (!template) {
644
- <span class="k-list-item-text">{{ getText(item.value) }}</span>
645
- }
646
- </li>
647
- }
648
- @if (!virtual) {
649
- <kendo-resize-sensor
650
- (resize)="listResize.emit()"
651
- >
652
- </kendo-resize-sensor>
653
- }
654
- </ul>
655
- }
656
- </ng-container>
657
- }
658
- @if (virtual) {
659
- <div #virtualContainer class="k-height-container" role="presentation">
660
- <div [style.height.px]="scrollHeight">
661
- <kendo-resize-sensor (resize)="listResize.emit()"></kendo-resize-sensor>
662
- </div>
663
- </div>
664
- }
665
- </div>
666
- `, isInline: true, dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { kind: "directive", type: ListItemDirective, selector: "\"li[role=option], li[role=group], li[role=presentation]\"" }, { kind: "directive", type: SelectableDirective, selector: "[kendoDropDownsSelectable]", inputs: ["index", "checkboxes", "height", "isMultiselect", "multipleSelection"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }] });
667
- }
668
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListComponent, decorators: [{
669
- type: Component,
670
- args: [{
671
- selector: 'kendo-list',
672
- template: `
673
- @if (defaultItem && !template) {
674
- <div
675
- class="k-list-optionlabel"
676
- [ngClass]="{ 'k-disabled': isDisabledDefaultItem }"
677
- kendoDropDownsSelectable
678
- [index]="-1">
679
- {{ getDefaultItemText() }}
680
- </div>
681
- }
682
- @if (defaultItem && template) {
683
- <div
684
- class="k-list-optionlabel"
685
- [ngClass]="{ 'k-disabled': isDisabledDefaultItem }"
686
- kendoDropDownsSelectable
687
- [index]="-1">
688
- <ng-template
689
- [templateContext]="{
690
- templateRef: template.templateRef,
691
- $implicit: defaultItem
692
- }">
693
- </ng-template>
694
- </div>
695
- }
696
- @if (allowCustom && text) {
697
- <div
698
- kendoDropDownsSelectable
699
- [multipleSelection]="true"
700
- [index]="-1"
701
- class="k-list-custom-value">
702
- @if (customItemTemplate) {
703
- <ng-template
704
- [templateContext]="{
705
- templateRef: customItemTemplate.templateRef,
706
- $implicit: text
707
- }">
708
- </ng-template>
709
- } @else {
710
- {{useCustomValueText}}
711
- }
712
- </div>
713
- }
714
- @if (dataService.grouped && showStickyHeader) {
715
- <div
716
- [class]="listGroupStickyHeaderClass"
717
- [ngStyle]="{
718
- 'height.px': virtual?.itemHeight,
719
- 'minHeight.px' : virtual?.itemHeight,
720
- 'boxSizing' : virtual ? 'border-box' : 'inherit'}"
721
- >
722
- @if (fixedGroupTemplate) {
723
- <ng-template
724
- [templateContext]="{
725
- templateRef: fixedGroupTemplate.templateRef,
726
- $implicit: currentGroup
727
- }">
728
- </ng-template>
729
- }
730
- @if (!fixedGroupTemplate) {
731
- <span [class]="listGroupStickyHeaderTextClass">{{ currentGroup }}</span>
732
- }
733
- </div>
734
- }
735
- <div #content
736
- [class]="listContentClass"
737
- [style.maxHeight.px]="height"
738
- unselectable="on"
739
- (scroll)="popupListScroll.emit($event)"
740
- [attr.role]="dataService.grouped ? 'listbox' : null"
741
- [attr.id]="dataService.grouped ? id : null"
742
- [attr.aria-live]="dataService.grouped ? ariaLive : null"
743
- [attr.aria-multiselectable]="dataService.grouped ? isMultiselect : null"
744
- [attr.aria-hidden]="dataService.grouped ? !show : null"
745
- >
746
- @if (!dataService.grouped) {
747
- <ul #list
748
- [attr.role]="'listbox'"
749
- [class]="listClass"
750
- [attr.id]="id"
751
- [attr.aria-live]="ariaLive"
752
- [attr.aria-multiselectable]="isMultiselect"
753
- [attr.aria-hidden]="!show">
754
- @for (dataItem of data; track $index; let itemIndex = $index) {
755
- <li
756
- role="option"
757
- kendoDropDownsSelectable
758
- [checkboxes]="checkboxes"
759
- [height]="virtual?.itemHeight"
760
- [index]="itemIndex + startFrom"
761
- [multipleSelection]="multipleSelection"
762
- [attr.id]="optionPrefix + '-' + itemIndex"
763
- [attr.tabIndex]="-1"
764
- [attr.aria-selected]="isItemSelected(itemIndex)"
765
- [class]="listItemClass"
766
- [ngClass]="{
767
- 'k-disabled': isDisabled(itemIndex),
768
- 'k-table-alt-row': isAltRow(itemIndex)
769
- }"
770
- [style.width.px]="rowWidth ?? null"
771
- >
772
- @if (checkboxes.enabled) {
773
- <input
774
- type="checkbox"
775
- class="k-checkbox"
776
- role="presentation"
777
- tabindex="-1"
778
- [ngClass]="checkboxClasses"
779
- (change)="onCheckedChange($event, itemIndex + startFrom)"
780
- [checked]="isChecked(itemIndex)"
781
- />
782
- }
783
- @if (template) {
784
- <ng-template
785
- [templateContext]="{
786
- templateRef: template.templateRef,
787
- $implicit: dataItem
788
- }">
789
- </ng-template>
790
- }
791
- @if (!template) {
792
- <span class="k-list-item-text">{{ getText(dataItem) }}</span>
793
- }
794
- </li>
795
- }
796
- @if (!virtual) {
797
- <kendo-resize-sensor
798
- (resize)="listResize.emit()"
799
- >
800
- </kendo-resize-sensor>
801
- }
802
- </ul>
803
- }
804
-
805
- @if (dataService.grouped) {
806
- <ng-container #list>
807
- @for (dataItem of groupedData; track dataItem) {
808
- <ul
809
- #groupUl
810
- class="k-list-ul"
811
- [attr.role]="'group'"
812
- [attr.aria-labelledby]="generateGroupId(dataItem)"
813
- >
814
- @if (dataItem.header) {
815
- <li
816
- role="presentation"
817
- [class]="listGroupItemClass"
818
- [class.k-table-alt-row]="isAltRow(dataItem.index - 1)"
819
- [ngStyle]="{
820
- 'height.px': virtual?.itemHeight,
821
- 'minHeight.px' : virtual?.itemHeight,
822
- 'boxSizing' : virtual ? 'border-box' : 'inherit'}"
823
- [attr.group-index]="dataItem.index"
824
- [attr.id]="groupUl.getAttribute('aria-labelledby')"
825
- [style.width.px]="rowWidth ?? null"
826
- >
827
- <span [class]="listGroupItemTextClass">
828
- @if (groupTemplate) {
829
- <ng-template
830
- [templateContext]="{
831
- templateRef: groupTemplate.templateRef,
832
- $implicit: dataItem.value
833
- }">
834
- </ng-template>
835
- }
836
- @if (!groupTemplate) {
837
- {{ dataItem.value }}
838
- }
839
- </span>
840
- </li>
841
- }
842
- @for (item of dataItem.items; track item) {
843
- <li
844
- role="option"
845
- kendoDropDownsSelectable
846
- [height]="virtual?.itemHeight"
847
- [index]="item.offsetIndex"
848
- [multipleSelection]="multipleSelection"
849
- [attr.absolute-index]="item.index"
850
- [attr.id]="optionPrefix + '-' + (item.index - 1 - item.groupIndex)"
851
- [attr.tabIndex]="-1"
852
- [attr.aria-selected]="isItemSelected(item.offsetIndex)"
853
- [class]="listItemClass"
854
- [ngClass]="{
855
- 'k-disabled': isDisabled(item.offsetIndex),
856
- 'k-table-alt-row': isAltRow(item.index - 1)
857
- }"
858
- [style.width.px]="rowWidth ?? null">
859
- @if (template) {
860
- <ng-template
861
- [templateContext]="{
862
- templateRef: template.templateRef,
863
- $implicit: item.value
864
- }">
865
- </ng-template>
866
- }
867
- @if (!template) {
868
- <span class="k-list-item-text">{{ getText(item.value) }}</span>
869
- }
870
- </li>
871
- }
872
- @if (!virtual) {
873
- <kendo-resize-sensor
874
- (resize)="listResize.emit()"
875
- >
876
- </kendo-resize-sensor>
877
- }
878
- </ul>
879
- }
880
- </ng-container>
881
- }
882
- @if (virtual) {
883
- <div #virtualContainer class="k-height-container" role="presentation">
884
- <div [style.height.px]="scrollHeight">
885
- <kendo-resize-sensor (resize)="listResize.emit()"></kendo-resize-sensor>
886
- </div>
887
- </div>
888
- }
889
- </div>
890
- `,
891
- standalone: true,
892
- imports: [NgStyle, TemplateContextDirective, ListItemDirective, SelectableDirective, NgClass, ResizeSensorComponent]
893
- }]
894
- }], ctorParameters: () => [{ type: i1.DataService }, { type: i0.ElementRef }, { type: i2.SelectionService }, { type: i3.DisabledItemsService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i4.LocalizationService }], propDecorators: { selected: [{
895
- type: Input
896
- }], focused: [{
897
- type: Input
898
- }], textField: [{
899
- type: Input
900
- }], valueField: [{
901
- type: Input
902
- }], height: [{
903
- type: Input
904
- }], template: [{
905
- type: Input
906
- }], groupTemplate: [{
907
- type: Input
908
- }], fixedGroupTemplate: [{
909
- type: Input
910
- }], show: [{
911
- type: Input
912
- }], id: [{
913
- type: Input
914
- }], optionPrefix: [{
915
- type: Input
916
- }], multipleSelection: [{
917
- type: Input
918
- }], virtual: [{
919
- type: Input
920
- }], type: [{
921
- type: Input
922
- }], checkboxes: [{
923
- type: Input
924
- }], ariaLive: [{
925
- type: Input
926
- }], isMultiselect: [{
927
- type: Input
928
- }], isActionSheetExpanded: [{
929
- type: Input
930
- }], showStickyHeader: [{
931
- type: Input
932
- }], rowWidth: [{
933
- type: Input
934
- }], customItemTemplate: [{
935
- type: Input
936
- }], text: [{
937
- type: Input
938
- }], allowCustom: [{
939
- type: Input
940
- }], defaultItem: [{
941
- type: Input
942
- }], data: [{
943
- type: Input
944
- }], size: [{
945
- type: Input
946
- }], rounded: [{
947
- type: Input
948
- }], onClick: [{
949
- type: Output
950
- }], pageChange: [{
951
- type: Output
952
- }], listResize: [{
953
- type: Output
954
- }], popupListScroll: [{
955
- type: Output
956
- }], items: [{
957
- type: ViewChildren,
958
- args: [ListItemDirective]
959
- }], content: [{
960
- type: ViewChild,
961
- args: ['content', { static: true }]
962
- }], list: [{
963
- type: ViewChild,
964
- args: ['list']
965
- }], virtualContainer: [{
966
- type: ViewChild,
967
- args: ['virtualContainer']
968
- }] } });