@progress/kendo-angular-listbox 11.4.0-develop.6 → 11.4.0-develop.7

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.
@@ -2,7 +2,9 @@
2
2
  * Copyright © 2023 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 { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, isDevMode, Output, Renderer2 } from '@angular/core';
5
+ /* eslint-disable @typescript-eslint/no-inferrable-types */
6
+ /* eslint-disable @typescript-eslint/no-explicit-any */
7
+ import { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, isDevMode, NgZone, Output, QueryList, Renderer2, ViewChild, ViewChildren } from '@angular/core';
6
8
  import { validatePackage } from '@progress/kendo-licensing';
7
9
  import { Subscription } from 'rxjs';
8
10
  import { packageMetadata } from './package-metadata';
@@ -10,20 +12,26 @@ import { ListBoxSelectionService } from './selection.service';
10
12
  import { ItemTemplateDirective } from './item-template.directive';
11
13
  import { defaultItemDisabled, fieldAccessor, getTools } from './util';
12
14
  import { allTools, DEFAULT_TOOLBAR_POSITION, sizeClassMap, actionsClasses } from './constants';
15
+ import { KeyboardNavigationService } from './keyboard-navigation.service';
16
+ import { take } from 'rxjs/operators';
13
17
  import * as i0 from "@angular/core";
14
- import * as i1 from "./selection.service";
15
- import * as i2 from "@progress/kendo-angular-buttons";
16
- import * as i3 from "@angular/common";
17
- import * as i4 from "./item-selectable.directive";
18
+ import * as i1 from "./keyboard-navigation.service";
19
+ import * as i2 from "./selection.service";
20
+ import * as i3 from "@progress/kendo-angular-buttons";
21
+ import * as i4 from "@angular/common";
22
+ import * as i5 from "./item-selectable.directive";
18
23
  const DEFAULT_SIZE = 'medium';
24
+ let idx = 0;
19
25
  /**
20
26
  * Represents the [Kendo UI ListBox component for Angular]({% slug overview_listbox %}).
21
27
  */
22
28
  export class ListBoxComponent {
23
- constructor(selectionService, renderer, hostElement) {
29
+ constructor(keyboardNavigationService, selectionService, hostElement, renderer, zone) {
30
+ this.keyboardNavigationService = keyboardNavigationService;
24
31
  this.selectionService = selectionService;
25
- this.renderer = renderer;
26
32
  this.hostElement = hostElement;
33
+ this.renderer = renderer;
34
+ this.zone = zone;
27
35
  /**
28
36
  * @hidden
29
37
  */
@@ -32,6 +40,14 @@ export class ListBoxComponent {
32
40
  * The data which will be displayed by the ListBox.
33
41
  */
34
42
  this.data = [];
43
+ /**
44
+ * The value of the aria-label attribute of the Listbox element.
45
+ */
46
+ this.listboxLabel = 'Listbox';
47
+ /**
48
+ * The value of the aria-label attribute of the Listbox toolbar element.
49
+ */
50
+ this.listboxToolbarLabel = 'Toolbar';
35
51
  /**
36
52
  * A function which determines if a specific item is disabled.
37
53
  */
@@ -44,18 +60,19 @@ export class ListBoxComponent {
44
60
  * Fires when the user clicks a ListBox item.
45
61
  */
46
62
  this.actionClick = new EventEmitter();
63
+ /**
64
+ * @hidden
65
+ */
66
+ this.getChildListbox = new EventEmitter();
47
67
  /**
48
68
  * @hidden
49
69
  */
50
70
  this.selectedTools = allTools;
51
71
  this._size = DEFAULT_SIZE;
52
- this.sub = new Subscription();
72
+ this.subs = new Subscription();
53
73
  validatePackage(packageMetadata);
54
74
  this.setToolbarClass(DEFAULT_TOOLBAR_POSITION);
55
75
  this.setSizingClass(this.size);
56
- this.sub.add(this.selectionService.onSelect.subscribe((e) => {
57
- this.selectionChange.next(e);
58
- }));
59
76
  }
60
77
  /**
61
78
  * Sets the size of the component.
@@ -96,17 +113,52 @@ export class ListBoxComponent {
96
113
  get listClasses() {
97
114
  return `k-list k-list-${sizeClassMap[this.size]}`;
98
115
  }
99
- /**
100
- * @hidden
101
- */
116
+ ngOnInit() {
117
+ // This event emitter gives us the connectedWith value from the DataBinding directive
118
+ this.getChildListbox.emit();
119
+ if (this.childListbox) {
120
+ // This allows us to know to which parent Listbox the child Listbox is connected to
121
+ this.childListbox.parentListbox = this;
122
+ }
123
+ if (this.selectedIndex) {
124
+ this.keyboardNavigationService.focusedToolIndex = this.selectedIndex;
125
+ }
126
+ }
127
+ ngAfterViewInit() {
128
+ const toolsRef = this.tools.toArray();
129
+ const hostEl = this.hostElement.nativeElement;
130
+ const navService = this.keyboardNavigationService;
131
+ navService.listboxItems = Array.from(this.listboxElement.nativeElement.querySelectorAll('li.k-list-item'));
132
+ this.setIds();
133
+ this.initSubscriptions(navService, hostEl, toolsRef);
134
+ }
102
135
  ngOnDestroy() {
103
- this.sub.unsubscribe();
136
+ this.subs.unsubscribe();
104
137
  }
105
138
  /**
106
139
  * @hidden
107
140
  */
108
141
  performAction(actionName) {
109
- this.actionClick.next(actionName);
142
+ const isActionTransferTo = actionName === 'transferTo' || actionName === 'transferAllFrom';
143
+ const isListboxChild = this.parentListbox && !this.childListbox;
144
+ const isListboxParentAndChild = !!(this.parentListbox && this.childListbox);
145
+ const isListboxParent = !!(this.childListbox || (!this.childListbox && !this.parentListbox));
146
+ if (isListboxChild || (isListboxParentAndChild && isActionTransferTo)) {
147
+ this.parentListbox.actionClick.next(actionName);
148
+ }
149
+ else if (isListboxParent || (isListboxParentAndChild && !isActionTransferTo)) {
150
+ this.actionClick.next(actionName);
151
+ }
152
+ const toolsRef = this.tools.toArray() || this.parentListbox.tools.toArray();
153
+ const focusedToolIndex = toolsRef.findIndex(elem => elem.nativeElement === document.activeElement);
154
+ if ((this.selectedTools.length > 0 || this.parentListbox.selectedTools.length > 0) && focusedToolIndex > -1) {
155
+ const navService = this.keyboardNavigationService || this.parentListbox.keyboardNavigationService;
156
+ const selectedTools = this.selectedTools || this.parentListbox.selectedTools;
157
+ const prevTool = toolsRef[navService.focusedToolIndex]?.element;
158
+ navService.focusedToolIndex = selectedTools.findIndex(tool => tool.name === actionName);
159
+ const currentTool = toolsRef[navService.focusedToolIndex]?.element;
160
+ navService.changeTabindex(prevTool, currentTool);
161
+ }
110
162
  }
111
163
  /**
112
164
  * Programmatically selects a ListBox node.
@@ -126,6 +178,15 @@ export class ListBoxComponent {
126
178
  get selectedIndex() {
127
179
  return this.selectionService.selectedIndex;
128
180
  }
181
+ /**
182
+ * @hidden
183
+ */
184
+ get getListboxId() {
185
+ const id = ++idx;
186
+ const listboxId = `k-listbox-${id}`;
187
+ return listboxId;
188
+ }
189
+ ;
129
190
  /**
130
191
  * @hidden
131
192
  */
@@ -135,6 +196,100 @@ export class ListBoxComponent {
135
196
  }
136
197
  return fieldAccessor(dataItem, this.textField);
137
198
  }
199
+ /**
200
+ * @hidden
201
+ */
202
+ updateListboxItems() {
203
+ this.zone.onStable.pipe(take(1)).subscribe(() => {
204
+ this.keyboardNavigationService.listboxItems = Array.from(this.listboxElement.nativeElement.querySelectorAll('li.k-list-item'));
205
+ });
206
+ }
207
+ /**
208
+ * @hidden
209
+ */
210
+ swapItems(firstItemIndex, secondItemIndex) {
211
+ const listboxItems = this.keyboardNavigationService.listboxItems;
212
+ [listboxItems[firstItemIndex], listboxItems[secondItemIndex]] = [listboxItems[secondItemIndex], listboxItems[firstItemIndex]];
213
+ }
214
+ onClickEvent(listboxItems, prevIndex, currentIndex, dir) {
215
+ this.selectionChange.next(currentIndex);
216
+ this.keyboardNavigationService.selectedListboxItemIndex = currentIndex;
217
+ this.keyboardNavigationService.focusedListboxItemIndex = currentIndex;
218
+ this.zone.onStable.pipe(take(1)).subscribe(() => {
219
+ if (dir)
220
+ this.swapItems(prevIndex, currentIndex);
221
+ const previousItem = prevIndex ? listboxItems[prevIndex] : listboxItems[0];
222
+ const currentItem = listboxItems[currentIndex];
223
+ this.keyboardNavigationService.changeTabindex(previousItem, currentItem);
224
+ });
225
+ }
226
+ initSubscriptions(navService, hostEl, toolsRef) {
227
+ this.subs.add(navService.onDeleteEvent.subscribe((index) => this.onDeleteEvent(index, navService)));
228
+ this.subs.add(this.renderer.listen(hostEl, 'keydown', event => navService.onKeyDown(event, toolsRef, this.selectedTools, this.childListbox, this.parentListbox)));
229
+ this.subs.add(this.renderer.listen(this.listboxElement.nativeElement, 'focusin', () => navService.onFocusIn()));
230
+ this.subs.add(navService.onShiftSelectedItem.subscribe((actionToPerform) => this.onShiftItems(actionToPerform)));
231
+ this.subs.add(navService.onTransferAllEvent.subscribe((actionToPerform) => this.onShiftItems(actionToPerform)));
232
+ this.subs.add(navService.onMoveSelectedItem.subscribe((dir) => this.performAction(dir)));
233
+ this.subs.add(this.selectionService.onSelect.subscribe((e) => this.onClickEvent(navService.listboxItems, e.prevIndex, e.index, e.dir)));
234
+ this.subs.add(navService.onSelectionChange.subscribe((index) => {
235
+ this.selectionService.selectedIndex = index;
236
+ this.selectionChange.next({ index, prevIndex: null });
237
+ }));
238
+ }
239
+ onShiftItems(actionToPerform) {
240
+ this.performAction(actionToPerform);
241
+ if (actionToPerform === 'transferFrom' || actionToPerform === 'transferAllTo') {
242
+ this.updateListboxItems();
243
+ this.childListbox?.updateListboxItems();
244
+ }
245
+ else {
246
+ this.updateListboxItems();
247
+ this.parentListbox?.updateListboxItems();
248
+ }
249
+ }
250
+ setIds() {
251
+ const listbox = this.listboxElement.nativeElement;
252
+ this.listboxId = this.getListboxId;
253
+ this.renderer.setAttribute(listbox, 'id', this.listboxId);
254
+ if (this.selectedTools.length > 0 || this.parentListbox?.selectedTools.length > 0) {
255
+ const toolbar = this.toolbarElement?.nativeElement;
256
+ const parentToolbar = this.parentListbox?.toolbarElement.nativeElement;
257
+ if (this.parentListbox && this.childListbox) {
258
+ this.zone.onStable.pipe(take(1)).subscribe(() => {
259
+ this.toolbarId = `${this.parentListbox.listboxId} ${this.listboxId} ${this.childListbox.listboxId}`;
260
+ this.renderer.setAttribute(toolbar, 'aria-controls', this.toolbarId);
261
+ });
262
+ }
263
+ else if (this.childListbox && !this.parentListbox) {
264
+ this.zone.onStable.pipe(take(1)).subscribe(() => {
265
+ this.toolbarId = this.toolbarId = `${this.listboxId} ${this.childListbox.listboxId}`;
266
+ this.renderer.setAttribute(toolbar, 'aria-controls', this.toolbarId);
267
+ });
268
+ }
269
+ else if (this.parentListbox && this.selectedTools.length > 0) {
270
+ this.toolbarId = `${this.parentListbox.listboxId} ${this.listboxId}`;
271
+ this.parentListbox.toolbarId = this.toolbarId = `${this.parentListbox.listboxId} ${this.listboxId}`;
272
+ this.renderer.setAttribute(toolbar, 'aria-controls', this.toolbarId);
273
+ this.renderer.setAttribute(parentToolbar, 'aria-controls', this.parentListbox.toolbarId);
274
+ }
275
+ else if (!this.parentListbox && !this.childListbox) {
276
+ this.toolbarId = this.listboxId;
277
+ this.renderer.setAttribute(toolbar, 'aria-controls', this.toolbarId);
278
+ }
279
+ }
280
+ }
281
+ onDeleteEvent(index, navService) {
282
+ this.selectionService.selectedIndex = index;
283
+ this.performAction('remove');
284
+ this.updateListboxItems();
285
+ const setIndex = index + 1 === navService.listboxItems.length ?
286
+ { index: index - 1, tabindex: index - 1 } : { index, tabindex: index + 1 };
287
+ navService.changeTabindex(null, navService.listboxItems[setIndex['tabindex']]);
288
+ this.selectionChange.next({ index: setIndex['index'], prevIndex: null });
289
+ navService.selectedListboxItemIndex = setIndex['index'];
290
+ navService.focusedListboxItem = setIndex['index'];
291
+ this.selectionService.selectedIndex = setIndex['index'];
292
+ }
138
293
  setToolbarClass(pos) {
139
294
  Object.keys(actionsClasses).forEach((className) => {
140
295
  if (pos === className) {
@@ -149,95 +304,140 @@ export class ListBoxComponent {
149
304
  this.renderer.addClass(this.hostElement.nativeElement, `k-listbox-${sizeClassMap[size]}`);
150
305
  }
151
306
  }
152
- ListBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxComponent, deps: [{ token: i1.ListBoxSelectionService }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
153
- ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ListBoxComponent, selector: "kendo-listbox", inputs: { textField: "textField", data: "data", size: "size", toolbar: "toolbar", itemDisabled: "itemDisabled" }, outputs: { selectionChange: "selectionChange", actionClick: "actionClick" }, host: { properties: { "class.k-listbox": "this.listboxClassName" } }, providers: [ListBoxSelectionService], queries: [{ propertyName: "itemTemplate", first: true, predicate: ItemTemplateDirective, descendants: true }], ngImport: i0, template: `
154
- <div class="k-listbox-actions" *ngIf="selectedTools.length > 0">
155
- <button
156
- *ngFor="let tool of selectedTools"
157
- kendoButton
158
- [size]="this.size"
159
- [icon]="tool.icon"
160
- [svgIcon]="tool.svgIcon"
161
- (click)="performAction(tool.name)"
162
- role="button"
163
- ></button>
164
- </div>
165
- <div class="k-list-scroller k-selectable">
166
- <div class="{{ listClasses }}">
167
- <div class="k-list-content">
168
- <ul class="k-list-ul">
169
- <li
170
- class="k-list-item"
171
- *ngFor="let item of data; let i = index;"
172
- kendoListBoxItemSelectable
173
- [index]="i"
174
- [class.k-disabled]="itemDisabled(item)"
175
- >
176
- <ng-template *ngIf="itemTemplate; else defaultItemTemplate"
177
- [templateContext]="{
178
- templateRef: itemTemplate.templateRef,
179
- $implicit: item
180
- }">
181
- </ng-template>
182
- <ng-template #defaultItemTemplate>
183
- <span class="k-list-item-text">{{ getText(item) }}</span>
184
- </ng-template>
185
- </li>
186
- </ul>
187
- </div>
307
+ ListBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxComponent, deps: [{ token: i1.KeyboardNavigationService }, { token: i2.ListBoxSelectionService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
308
+ ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ListBoxComponent, selector: "kendo-listbox", inputs: { textField: "textField", data: "data", size: "size", toolbar: "toolbar", listboxLabel: "listboxLabel", listboxToolbarLabel: "listboxToolbarLabel", itemDisabled: "itemDisabled" }, outputs: { selectionChange: "selectionChange", actionClick: "actionClick", getChildListbox: "getChildListbox" }, host: { properties: { "class.k-listbox": "this.listboxClassName" } }, providers: [ListBoxSelectionService, KeyboardNavigationService], queries: [{ propertyName: "itemTemplate", first: true, predicate: ItemTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "listboxElement", first: true, predicate: ["listbox"], descendants: true }, { propertyName: "toolbarElement", first: true, predicate: ["toolbar"], descendants: true }, { propertyName: "tools", predicate: ["tools"], descendants: true }], ngImport: i0, template: `
309
+ <div
310
+ #toolbar
311
+ class="k-listbox-actions"
312
+ *ngIf="selectedTools.length > 0"
313
+ role="toolbar"
314
+ [attr.aria-label]="listboxToolbarLabel"
315
+ >
316
+ <button
317
+ #tools
318
+ *ngFor="let tool of selectedTools; let i = index;"
319
+ kendoButton
320
+ [attr.tabindex]="i === 0 ? '0' : '-1'"
321
+ [size]="this.size"
322
+ [icon]="tool.icon"
323
+ [svgIcon]="tool.svgIcon"
324
+ [attr.title]="tool.label"
325
+ (click)="performAction(tool.name)"
326
+ role="button"
327
+ ></button>
328
+ </div>
329
+ <div class="k-list-scroller k-selectable">
330
+ <div class="{{ listClasses }}">
331
+ <div class="k-list-content">
332
+ <ul
333
+ #listbox
334
+ class="k-list-ul"
335
+ role="listbox"
336
+ [attr.aria-label]="listboxLabel"
337
+ [attr.aria-multiselectable]="false"
338
+ >
339
+ <li
340
+ *ngFor="let item of data; let i = index;"
341
+ kendoListBoxItemSelectable
342
+ class="k-list-item"
343
+ [attr.tabindex]="i === 0 ? '0' : '-1'"
344
+ role="option"
345
+ [attr.aria-selected]="selectedIndex === i"
346
+ [index]="i"
347
+ [class.k-disabled]="itemDisabled(item)"
348
+ >
349
+ <ng-template *ngIf="itemTemplate; else defaultItemTemplate"
350
+ [templateContext]="{
351
+ templateRef: itemTemplate.templateRef,
352
+ $implicit: item
353
+ }">
354
+ </ng-template>
355
+ <ng-template #defaultItemTemplate>
356
+ <span class="k-list-item-text">{{ getText(item) }}</span>
357
+ </ng-template>
358
+ </li>
359
+ </ul>
188
360
  </div>
189
361
  </div>
190
- `, isInline: true, components: [{ type: i2.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.ItemSelectableDirective, selector: "[kendoListBoxItemSelectable]", inputs: ["index"] }, { type: i2.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }] });
362
+ </div>
363
+ `, isInline: true, components: [{ type: i3.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.ItemSelectableDirective, selector: "[kendoListBoxItemSelectable]", inputs: ["index"] }, { type: i3.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }] });
191
364
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxComponent, decorators: [{
192
365
  type: Component,
193
366
  args: [{
194
367
  selector: 'kendo-listbox',
195
- providers: [ListBoxSelectionService],
368
+ providers: [ListBoxSelectionService, KeyboardNavigationService],
196
369
  template: `
197
- <div class="k-listbox-actions" *ngIf="selectedTools.length > 0">
198
- <button
199
- *ngFor="let tool of selectedTools"
200
- kendoButton
201
- [size]="this.size"
202
- [icon]="tool.icon"
203
- [svgIcon]="tool.svgIcon"
204
- (click)="performAction(tool.name)"
205
- role="button"
206
- ></button>
207
- </div>
208
- <div class="k-list-scroller k-selectable">
209
- <div class="{{ listClasses }}">
210
- <div class="k-list-content">
211
- <ul class="k-list-ul">
212
- <li
213
- class="k-list-item"
214
- *ngFor="let item of data; let i = index;"
215
- kendoListBoxItemSelectable
216
- [index]="i"
217
- [class.k-disabled]="itemDisabled(item)"
218
- >
219
- <ng-template *ngIf="itemTemplate; else defaultItemTemplate"
220
- [templateContext]="{
221
- templateRef: itemTemplate.templateRef,
222
- $implicit: item
223
- }">
224
- </ng-template>
225
- <ng-template #defaultItemTemplate>
226
- <span class="k-list-item-text">{{ getText(item) }}</span>
227
- </ng-template>
228
- </li>
229
- </ul>
230
- </div>
370
+ <div
371
+ #toolbar
372
+ class="k-listbox-actions"
373
+ *ngIf="selectedTools.length > 0"
374
+ role="toolbar"
375
+ [attr.aria-label]="listboxToolbarLabel"
376
+ >
377
+ <button
378
+ #tools
379
+ *ngFor="let tool of selectedTools; let i = index;"
380
+ kendoButton
381
+ [attr.tabindex]="i === 0 ? '0' : '-1'"
382
+ [size]="this.size"
383
+ [icon]="tool.icon"
384
+ [svgIcon]="tool.svgIcon"
385
+ [attr.title]="tool.label"
386
+ (click)="performAction(tool.name)"
387
+ role="button"
388
+ ></button>
389
+ </div>
390
+ <div class="k-list-scroller k-selectable">
391
+ <div class="{{ listClasses }}">
392
+ <div class="k-list-content">
393
+ <ul
394
+ #listbox
395
+ class="k-list-ul"
396
+ role="listbox"
397
+ [attr.aria-label]="listboxLabel"
398
+ [attr.aria-multiselectable]="false"
399
+ >
400
+ <li
401
+ *ngFor="let item of data; let i = index;"
402
+ kendoListBoxItemSelectable
403
+ class="k-list-item"
404
+ [attr.tabindex]="i === 0 ? '0' : '-1'"
405
+ role="option"
406
+ [attr.aria-selected]="selectedIndex === i"
407
+ [index]="i"
408
+ [class.k-disabled]="itemDisabled(item)"
409
+ >
410
+ <ng-template *ngIf="itemTemplate; else defaultItemTemplate"
411
+ [templateContext]="{
412
+ templateRef: itemTemplate.templateRef,
413
+ $implicit: item
414
+ }">
415
+ </ng-template>
416
+ <ng-template #defaultItemTemplate>
417
+ <span class="k-list-item-text">{{ getText(item) }}</span>
418
+ </ng-template>
419
+ </li>
420
+ </ul>
231
421
  </div>
232
422
  </div>
423
+ </div>
233
424
  `
234
425
  }]
235
- }], ctorParameters: function () { return [{ type: i1.ListBoxSelectionService }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { listboxClassName: [{
426
+ }], ctorParameters: function () { return [{ type: i1.KeyboardNavigationService }, { type: i2.ListBoxSelectionService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { listboxClassName: [{
236
427
  type: HostBinding,
237
428
  args: ['class.k-listbox']
238
429
  }], itemTemplate: [{
239
430
  type: ContentChild,
240
- args: [ItemTemplateDirective, { static: false }]
431
+ args: [ItemTemplateDirective]
432
+ }], listboxElement: [{
433
+ type: ViewChild,
434
+ args: ['listbox']
435
+ }], toolbarElement: [{
436
+ type: ViewChild,
437
+ args: ['toolbar']
438
+ }], tools: [{
439
+ type: ViewChildren,
440
+ args: ['tools']
241
441
  }], textField: [{
242
442
  type: Input
243
443
  }], data: [{
@@ -246,10 +446,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
246
446
  type: Input
247
447
  }], toolbar: [{
248
448
  type: Input
449
+ }], listboxLabel: [{
450
+ type: Input
451
+ }], listboxToolbarLabel: [{
452
+ type: Input
249
453
  }], itemDisabled: [{
250
454
  type: Input
251
455
  }], selectionChange: [{
252
456
  type: Output
253
457
  }], actionClick: [{
254
458
  type: Output
459
+ }], getChildListbox: [{
460
+ type: Output
255
461
  }] } });
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-listbox',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1678518161,
13
- version: '11.4.0-develop.6',
12
+ publishDate: 1678790104,
13
+ version: '11.4.0-develop.7',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
15
  };
@@ -12,9 +12,9 @@ export class ListBoxSelectionService {
12
12
  this.onSelect = new EventEmitter();
13
13
  this.selectedIndex = null;
14
14
  }
15
- select(index) {
15
+ select(index, dir) {
16
+ this.onSelect.next({ index: index, prevIndex: this.selectedIndex, dir });
16
17
  this.selectedIndex = index;
17
- this.onSelect.next({ index: this.selectedIndex });
18
18
  }
19
19
  isSelected(index) {
20
20
  return index === this.selectedIndex;