@progress/kendo-angular-toolbar 6.1.1-dev.202210141232 → 6.1.1

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.
@@ -3,6 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { Component, HostBinding, ViewChild, ContentChildren, Input, ViewChildren, HostListener, Output, EventEmitter, ViewContainerRef } from '@angular/core';
6
+ import { guid } from '@progress/kendo-angular-common';
6
7
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
7
8
  import { validatePackage } from '@progress/kendo-licensing';
8
9
  import { packageMetadata } from './package-metadata';
@@ -64,6 +65,15 @@ export class ToolBarComponent {
64
65
  this.cancelRenderedToolsSubscription$ = new Subject();
65
66
  this.subscriptions = new Subscription();
66
67
  this.popupSubs = new Subscription();
68
+ this.role = 'toolbar';
69
+ /**
70
+ * @hidden
71
+ */
72
+ this.overflowBtnId = guid();
73
+ /**
74
+ * @hidden
75
+ */
76
+ this.popupId = guid();
67
77
  validatePackage(packageMetadata);
68
78
  this.direction = localization.rtl ? 'rtl' : 'ltr';
69
79
  }
@@ -144,9 +154,6 @@ export class ToolBarComponent {
144
154
  }
145
155
  this.element.nativeElement.setAttribute('tabindex', this.tabindex.toString());
146
156
  }
147
- get getRole() {
148
- return 'toolbar';
149
- }
150
157
  get getDir() {
151
158
  return this.direction;
152
159
  }
@@ -193,6 +200,12 @@ export class ToolBarComponent {
193
200
  case Keys.Escape:
194
201
  this.zone.run(() => this.toggle(false));
195
202
  break;
203
+ case Keys.Home:
204
+ this.zone.run(() => this.navigationService.focusFirst(ev));
205
+ break;
206
+ case Keys.End:
207
+ this.zone.run(() => this.navigationService.focusLast(ev));
208
+ break;
196
209
  default:
197
210
  break;
198
211
  }
@@ -336,6 +349,7 @@ export class ToolBarComponent {
336
349
  this.overflowRenderedTools.changes
337
350
  .pipe(takeUntil(this.cancelRenderedToolsSubscription$))
338
351
  .subscribe((rts) => this.navigationService.setRenderedTools(rts.toArray()));
352
+ this.renderer.setAttribute(this.overflowButton.nativeElement, 'aria-controls', this.popupId);
339
353
  }
340
354
  /**
341
355
  * @hidden
@@ -350,6 +364,7 @@ export class ToolBarComponent {
350
364
  if (this.overflowKeydownListener) {
351
365
  this.overflowKeydownListener();
352
366
  }
367
+ this.renderer.removeAttribute(this.overflowButton.nativeElement, 'aria-controls');
353
368
  }
354
369
  displayAnchor() {
355
370
  const visibility = this.allTools.filter(t => t.overflows && t.responsive).length > 0 ? 'visible' : 'hidden';
@@ -467,7 +482,7 @@ export class ToolBarComponent {
467
482
  }
468
483
  }
469
484
  ToolBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarComponent, deps: [{ token: i1.LocalizationService }, { token: i2.PopupService }, { token: i3.RefreshService }, { token: i4.NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
470
- ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarComponent, selector: "kendo-toolbar", inputs: { overflow: "overflow", resizable: "resizable", popupSettings: "popupSettings", tabindex: "tabindex", tabIndex: "tabIndex" }, outputs: { open: "open", close: "close" }, host: { listeners: { "focus": "onFocus($event)", "focusout": "onFocusOut($event)" }, properties: { "class.k-widget": "this.hostClasses", "class.k-toolbar": "this.hostClasses", "attr.role": "this.getRole", "attr.dir": "this.getDir", "class.k-toolbar-resizable": "this.resizableClass" } }, providers: [
485
+ ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarComponent, selector: "kendo-toolbar", inputs: { overflow: "overflow", resizable: "resizable", popupSettings: "popupSettings", tabindex: "tabindex", tabIndex: "tabIndex" }, outputs: { open: "open", close: "close" }, host: { listeners: { "focus": "onFocus($event)", "focusout": "onFocusOut($event)" }, properties: { "class.k-widget": "this.hostClasses", "class.k-toolbar": "this.hostClasses", "attr.role": "this.role", "attr.dir": "this.getDir", "class.k-toolbar-resizable": "this.resizableClass" } }, providers: [
471
486
  RefreshService,
472
487
  NavigationService,
473
488
  LocalizationService,
@@ -496,19 +511,26 @@ ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
496
511
  tabindex="-1"
497
512
  [title]="moreToolsTitle"
498
513
  [attr.aria-label]="moreToolsTitle"
514
+ [attr.aria-expanded]="popupOpen"
515
+ [id]="overflowBtnId"
516
+ aria-haspopup="menu"
499
517
  *ngIf="overflow"
500
518
  [style.visibility]="'hidden'"
501
519
  [style.position]="'relative'"
502
520
  [style.margin-inline-start]="'auto'"
503
- class="k-overflow-anchor k-button"
521
+ class="k-overflow-anchor k-button k-button-flat"
504
522
  (click)="showPopup()"
505
523
  >
506
524
  <span class="k-icon k-i-more-vertical"></span>
507
525
  </button>
508
526
  <ng-template #popupTemplate>
509
- <ul class="k-overflow-container k-list-container k-reset">
527
+ <ul
528
+ class="k-overflow-container k-list-container k-reset"
529
+ role="menu"
530
+ [id]="popupId"
531
+ [attr.aria-labelledby]="overflowBtnId">
510
532
  <ng-container *ngFor="let tool of allTools; let index = index">
511
- <li class="k-item">
533
+ <li class="k-item" role="menuitem">
512
534
  <kendo-toolbar-renderer
513
535
  #overflowRenderer
514
536
  (rendererClick)="onRendererClick($event)"
@@ -558,19 +580,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
558
580
  tabindex="-1"
559
581
  [title]="moreToolsTitle"
560
582
  [attr.aria-label]="moreToolsTitle"
583
+ [attr.aria-expanded]="popupOpen"
584
+ [id]="overflowBtnId"
585
+ aria-haspopup="menu"
561
586
  *ngIf="overflow"
562
587
  [style.visibility]="'hidden'"
563
588
  [style.position]="'relative'"
564
589
  [style.margin-inline-start]="'auto'"
565
- class="k-overflow-anchor k-button"
590
+ class="k-overflow-anchor k-button k-button-flat"
566
591
  (click)="showPopup()"
567
592
  >
568
593
  <span class="k-icon k-i-more-vertical"></span>
569
594
  </button>
570
595
  <ng-template #popupTemplate>
571
- <ul class="k-overflow-container k-list-container k-reset">
596
+ <ul
597
+ class="k-overflow-container k-list-container k-reset"
598
+ role="menu"
599
+ [id]="popupId"
600
+ [attr.aria-labelledby]="overflowBtnId">
572
601
  <ng-container *ngFor="let tool of allTools; let index = index">
573
- <li class="k-item">
602
+ <li class="k-item" role="menuitem">
574
603
  <kendo-toolbar-renderer
575
604
  #overflowRenderer
576
605
  (rendererClick)="onRendererClick($event)"
@@ -634,7 +663,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
634
663
  }], onFocusOut: [{
635
664
  type: HostListener,
636
665
  args: ['focusout', ['$event']]
637
- }], getRole: [{
666
+ }], role: [{
638
667
  type: HostBinding,
639
668
  args: ['attr.role']
640
669
  }], getDir: [{
@@ -36,7 +36,7 @@ const TOOLBAR_COMMON = [
36
36
  LocalizedToolbarMessagesDirective
37
37
  ];
38
38
  /**
39
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }}) definition for the ToolBar component.
39
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the ToolBar component.
40
40
  *
41
41
  * The package exports:
42
42
  * - `ToolBarComponent`&mdash;The ToolBarComponent class.
@@ -97,9 +97,10 @@ export class ToolBarButtonGroupComponent extends ToolBarToolComponent {
97
97
  return this.overflows ? this.overflowButtonGroup : this.toolbarButtonGroup;
98
98
  }
99
99
  focusButton(index, ev) {
100
+ var _a;
100
101
  // Guard against focusing twice on mousedown.
101
102
  if (!ev.type || ev.type === 'focus' || ev.type === 'keydown') {
102
- this.buttonElements[index].focus();
103
+ (_a = this.buttonElements[index]) === null || _a === void 0 ? void 0 : _a.focus();
103
104
  }
104
105
  }
105
106
  }
@@ -16,11 +16,6 @@ import * as i3 from "@angular/common";
16
16
  export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
17
17
  constructor() {
18
18
  super();
19
- // showText and showIcon showIcon should be declared first
20
- /**
21
- * Defines the location of the button text that will be displayed.
22
- */
23
- this.showText = 'both';
24
19
  /**
25
20
  * Defines the location of the button icon that will be displayed.
26
21
  */
@@ -85,16 +80,21 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
85
80
  };
86
81
  this._popupSettings = { animate: true, popupClass: '' };
87
82
  this.focusedIndex = -1;
83
+ this._showText = 'both';
88
84
  this.getNextKey = getNextKey();
89
85
  this.getPrevKey = getPrevKey();
90
86
  }
87
+ // showText and showIcon showIcon should be declared first
91
88
  /**
92
- * Sets the text of the DropDownButton
93
- * ([see example]({% slug controltypes_toolbar %}#toc-dropdownbuttons).
89
+ * Defines the location of the button text that will be displayed.
94
90
  */
95
- set text(text) {
96
- this.toolbarOptions.text = getValueForLocation(text, this.showText, false);
97
- this.overflowOptions.text = getValueForLocation(text, this.showText, true);
91
+ set showText(value) {
92
+ this._showText = value;
93
+ this.setTextDisplayMode();
94
+ }
95
+ ;
96
+ get showText() {
97
+ return this._showText;
98
98
  }
99
99
  /**
100
100
  * Defines an icon that will be rendered next to the button text.
@@ -159,6 +159,9 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
159
159
  }
160
160
  return this._data;
161
161
  }
162
+ ngOnInit() {
163
+ this.setTextDisplayMode();
164
+ }
162
165
  get overflowButtons() {
163
166
  return [...this.overflowDropDownButtonButtonList.buttons.toArray().filter(b => !b.nativeElement.disabled)];
164
167
  }
@@ -210,6 +213,10 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
210
213
  this.overflowButtons[index].nativeElement.focus();
211
214
  }
212
215
  }
216
+ setTextDisplayMode() {
217
+ this.toolbarOptions.text = this.showText === 'overflow' ? undefined : this.text;
218
+ this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
219
+ }
213
220
  }
214
221
  ToolBarDropDownButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarDropDownButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
215
222
  ToolBarDropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarDropDownButtonComponent, selector: "kendo-toolbar-dropdownbutton", inputs: { showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", popupSettings: "popupSettings", look: "look", primary: "primary", fillMode: "fillMode", themeColor: "themeColor", buttonClass: "buttonClass", textField: "textField", disabled: "disabled", data: "data" }, outputs: { itemClick: "itemClick", open: "open", close: "close" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarDropDownButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "dropdownButton", first: true, predicate: ["dropdownButton"], descendants: true, read: ElementRef, static: true }, { propertyName: "dropDownButtonComponent", first: true, predicate: DropDownButtonComponent, descendants: true }, { propertyName: "toolbarDropDownButton", first: true, predicate: ["toolbarDropDownButton"], descendants: true }, { propertyName: "overflowDropDownButtonButtonList", first: true, predicate: ["overflowDropDownButtonButtonList"], descendants: true }], exportAs: ["kendoToolBarDropDownButton"], usesInheritance: true, ngImport: i0, template: `
@@ -15,11 +15,6 @@ import * as i3 from "@angular/common";
15
15
  export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
16
16
  constructor() {
17
17
  super();
18
- // showText and showIcon showIcon should be declared first
19
- /**
20
- * Specifies where button text should be displayed
21
- */
22
- this.showText = 'both';
23
18
  /**
24
19
  * Specifies where button icon should be displayed
25
20
  */
@@ -96,15 +91,21 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
96
91
  };
97
92
  this._popupSettings = { animate: true, popupClass: '' };
98
93
  this.focusedIndex = -1;
94
+ this._showText = 'both';
99
95
  this.getNextKey = getNextKey();
100
96
  this.getPrevKey = getPrevKey();
101
97
  }
98
+ // showText and showIcon showIcon should be declared first
102
99
  /**
103
- * Sets the text of the SplitButton ([see example]({% slug controltypes_toolbar %}#toc-splitbuttons).
100
+ * Specifies where button text should be displayed
104
101
  */
105
- set text(text) {
106
- this.toolbarOptions.text = getValueForLocation(text, this.showText, false);
107
- this.overflowOptions.text = getValueForLocation(text, this.showText, true);
102
+ set showText(value) {
103
+ this._showText = value;
104
+ this.setTextDisplayMode();
105
+ }
106
+ ;
107
+ get showText() {
108
+ return this._showText;
108
109
  }
109
110
  /**
110
111
  * Defines the icon that will be rendered next to the button text
@@ -166,6 +167,9 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
166
167
  }
167
168
  return this._data;
168
169
  }
170
+ ngOnInit() {
171
+ this.setTextDisplayMode();
172
+ }
169
173
  get overflowButtons() {
170
174
  return [this.overflowSplitButton, ...this.overflowSplitButtonButtonList.buttons.toArray().filter(b => !b.nativeElement.disabled)];
171
175
  }
@@ -222,6 +226,10 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
222
226
  this.overflowButtons[index].nativeElement.focus();
223
227
  }
224
228
  }
229
+ setTextDisplayMode() {
230
+ this.toolbarOptions.text = this.showText === 'overflow' ? undefined : this.text;
231
+ this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
232
+ }
225
233
  }
226
234
  ToolBarSplitButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarSplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
227
235
  ToolBarSplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarSplitButtonComponent, selector: "kendo-toolbar-splitbutton", inputs: { showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", disabled: "disabled", popupSettings: "popupSettings", fillMode: "fillMode", themeColor: "themeColor", look: "look", buttonClass: "buttonClass", arrowButtonClass: "arrowButtonClass", arrowButtonIcon: "arrowButtonIcon", textField: "textField", data: "data" }, outputs: { buttonClick: "buttonClick", itemClick: "itemClick", open: "open", close: "close" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarSplitButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "toolbarSplitButton", first: true, predicate: ["toolbarSplitButton"], descendants: true }, { propertyName: "overflowSplitButton", first: true, predicate: ["overflowSplitButton"], descendants: true, read: ElementRef }, { propertyName: "overflowSplitButtonButtonList", first: true, predicate: ["overflowSplitButtonButtonList"], descendants: true }], exportAs: ["kendoToolBarSplitButton"], usesInheritance: true, ngImport: i0, template: `
@@ -4,12 +4,12 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
6
  import { EventEmitter, Injectable, Component, Input, Output, HostBinding, HostListener, Directive, forwardRef, ViewContainerRef, ContentChildren, ViewChild, ViewChildren, ElementRef, NgModule } from '@angular/core';
7
+ import * as i6 from '@progress/kendo-angular-common';
8
+ import { Keys, guid, isDocumentAvailable, ResizeSensorModule } from '@progress/kendo-angular-common';
7
9
  import * as i1 from '@progress/kendo-angular-l10n';
8
10
  import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
9
11
  import { validatePackage } from '@progress/kendo-licensing';
10
12
  import { take, filter, takeUntil } from 'rxjs/operators';
11
- import * as i6 from '@progress/kendo-angular-common';
12
- import { Keys, isDocumentAvailable, ResizeSensorModule } from '@progress/kendo-angular-common';
13
13
  import { Subject, Subscription, merge, fromEvent } from 'rxjs';
14
14
  import * as i2 from '@progress/kendo-angular-popup';
15
15
  import { PopupModule } from '@progress/kendo-angular-popup';
@@ -25,7 +25,7 @@ const packageMetadata = {
25
25
  name: '@progress/kendo-angular-toolbar',
26
26
  productName: 'Kendo UI for Angular',
27
27
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
28
- publishDate: 1665750746,
28
+ publishDate: 1667809539,
29
29
  version: '',
30
30
  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'
31
31
  };
@@ -259,7 +259,11 @@ class NavigationService {
259
259
  this.focus();
260
260
  }
261
261
  focusNext(ev) {
262
- if (!this.isOverflowButtonFocused && this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
262
+ if (this.isOverflowButtonFocused) {
263
+ const firstFocusableRT = this.getFocusableTools()[0];
264
+ this.focus(firstFocusableRT, ev);
265
+ }
266
+ else if (!this.isOverflowButtonFocused && this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
263
267
  const nextRT = this.getFocusableTools().slice(this.focused.index + 1)[0];
264
268
  if (nextRT) {
265
269
  this.focus(nextRT, ev);
@@ -268,6 +272,10 @@ class NavigationService {
268
272
  if (this.isOverflowButtonVisible() && !this.isPopupFocused) {
269
273
  this.focusOverflowButton();
270
274
  }
275
+ else {
276
+ const firstRT = this.getFocusableTools()[0];
277
+ this.focus(firstRT, ev);
278
+ }
271
279
  }
272
280
  }
273
281
  }
@@ -276,13 +284,22 @@ class NavigationService {
276
284
  const lastFocusableRT = this.getFocusableTools().reverse()[0];
277
285
  this.focus(lastFocusableRT, ev);
278
286
  }
279
- else if (this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
287
+ else if (!this.isOverflowButtonFocused && this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
280
288
  const prevRT = this.getFocusableTools()
281
289
  .slice(0, this.focused.index)
282
290
  .reverse()[0];
283
291
  if (prevRT) {
284
292
  this.focus(prevRT, ev);
285
293
  }
294
+ else {
295
+ if (this.isOverflowButtonVisible() && !this.isPopupFocused) {
296
+ this.focusOverflowButton();
297
+ }
298
+ else {
299
+ const lastRT = this.getFocusableTools().reverse()[0];
300
+ this.focus(lastRT, ev);
301
+ }
302
+ }
286
303
  }
287
304
  }
288
305
  resetNavigation() {
@@ -302,6 +319,18 @@ class NavigationService {
302
319
  overFlowButton.nativeElement.focus();
303
320
  }
304
321
  }
322
+ focusLast(ev) {
323
+ const lastTool = this.getFocusableTools().reverse()[0];
324
+ const overFlowButton = this.overflowButton;
325
+ if (lastTool) {
326
+ this.focused.renderedTool = lastTool;
327
+ this.focused.index = this.getFocusableTools().findIndex(rt => rt === lastTool);
328
+ this.focus(lastTool, ev);
329
+ }
330
+ else if (overFlowButton) {
331
+ overFlowButton.nativeElement.focus();
332
+ }
333
+ }
305
334
  getFocusableTools() {
306
335
  return this.renderedTools.filter(rt => rt.tool.overflows === this.isPopupFocused && rt.tool.canFocus());
307
336
  }
@@ -699,6 +728,15 @@ class ToolBarComponent {
699
728
  this.cancelRenderedToolsSubscription$ = new Subject();
700
729
  this.subscriptions = new Subscription();
701
730
  this.popupSubs = new Subscription();
731
+ this.role = 'toolbar';
732
+ /**
733
+ * @hidden
734
+ */
735
+ this.overflowBtnId = guid();
736
+ /**
737
+ * @hidden
738
+ */
739
+ this.popupId = guid();
702
740
  validatePackage(packageMetadata);
703
741
  this.direction = localization.rtl ? 'rtl' : 'ltr';
704
742
  }
@@ -779,9 +817,6 @@ class ToolBarComponent {
779
817
  }
780
818
  this.element.nativeElement.setAttribute('tabindex', this.tabindex.toString());
781
819
  }
782
- get getRole() {
783
- return 'toolbar';
784
- }
785
820
  get getDir() {
786
821
  return this.direction;
787
822
  }
@@ -828,6 +863,12 @@ class ToolBarComponent {
828
863
  case Keys.Escape:
829
864
  this.zone.run(() => this.toggle(false));
830
865
  break;
866
+ case Keys.Home:
867
+ this.zone.run(() => this.navigationService.focusFirst(ev));
868
+ break;
869
+ case Keys.End:
870
+ this.zone.run(() => this.navigationService.focusLast(ev));
871
+ break;
831
872
  default:
832
873
  break;
833
874
  }
@@ -971,6 +1012,7 @@ class ToolBarComponent {
971
1012
  this.overflowRenderedTools.changes
972
1013
  .pipe(takeUntil(this.cancelRenderedToolsSubscription$))
973
1014
  .subscribe((rts) => this.navigationService.setRenderedTools(rts.toArray()));
1015
+ this.renderer.setAttribute(this.overflowButton.nativeElement, 'aria-controls', this.popupId);
974
1016
  }
975
1017
  /**
976
1018
  * @hidden
@@ -985,6 +1027,7 @@ class ToolBarComponent {
985
1027
  if (this.overflowKeydownListener) {
986
1028
  this.overflowKeydownListener();
987
1029
  }
1030
+ this.renderer.removeAttribute(this.overflowButton.nativeElement, 'aria-controls');
988
1031
  }
989
1032
  displayAnchor() {
990
1033
  const visibility = this.allTools.filter(t => t.overflows && t.responsive).length > 0 ? 'visible' : 'hidden';
@@ -1102,7 +1145,7 @@ class ToolBarComponent {
1102
1145
  }
1103
1146
  }
1104
1147
  ToolBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarComponent, deps: [{ token: i1.LocalizationService }, { token: i2.PopupService }, { token: RefreshService }, { token: NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1105
- ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarComponent, selector: "kendo-toolbar", inputs: { overflow: "overflow", resizable: "resizable", popupSettings: "popupSettings", tabindex: "tabindex", tabIndex: "tabIndex" }, outputs: { open: "open", close: "close" }, host: { listeners: { "focus": "onFocus($event)", "focusout": "onFocusOut($event)" }, properties: { "class.k-widget": "this.hostClasses", "class.k-toolbar": "this.hostClasses", "attr.role": "this.getRole", "attr.dir": "this.getDir", "class.k-toolbar-resizable": "this.resizableClass" } }, providers: [
1148
+ ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarComponent, selector: "kendo-toolbar", inputs: { overflow: "overflow", resizable: "resizable", popupSettings: "popupSettings", tabindex: "tabindex", tabIndex: "tabIndex" }, outputs: { open: "open", close: "close" }, host: { listeners: { "focus": "onFocus($event)", "focusout": "onFocusOut($event)" }, properties: { "class.k-widget": "this.hostClasses", "class.k-toolbar": "this.hostClasses", "attr.role": "this.role", "attr.dir": "this.getDir", "class.k-toolbar-resizable": "this.resizableClass" } }, providers: [
1106
1149
  RefreshService,
1107
1150
  NavigationService,
1108
1151
  LocalizationService,
@@ -1131,19 +1174,26 @@ ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
1131
1174
  tabindex="-1"
1132
1175
  [title]="moreToolsTitle"
1133
1176
  [attr.aria-label]="moreToolsTitle"
1177
+ [attr.aria-expanded]="popupOpen"
1178
+ [id]="overflowBtnId"
1179
+ aria-haspopup="menu"
1134
1180
  *ngIf="overflow"
1135
1181
  [style.visibility]="'hidden'"
1136
1182
  [style.position]="'relative'"
1137
1183
  [style.margin-inline-start]="'auto'"
1138
- class="k-overflow-anchor k-button"
1184
+ class="k-overflow-anchor k-button k-button-flat"
1139
1185
  (click)="showPopup()"
1140
1186
  >
1141
1187
  <span class="k-icon k-i-more-vertical"></span>
1142
1188
  </button>
1143
1189
  <ng-template #popupTemplate>
1144
- <ul class="k-overflow-container k-list-container k-reset">
1190
+ <ul
1191
+ class="k-overflow-container k-list-container k-reset"
1192
+ role="menu"
1193
+ [id]="popupId"
1194
+ [attr.aria-labelledby]="overflowBtnId">
1145
1195
  <ng-container *ngFor="let tool of allTools; let index = index">
1146
- <li class="k-item">
1196
+ <li class="k-item" role="menuitem">
1147
1197
  <kendo-toolbar-renderer
1148
1198
  #overflowRenderer
1149
1199
  (rendererClick)="onRendererClick($event)"
@@ -1193,19 +1243,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1193
1243
  tabindex="-1"
1194
1244
  [title]="moreToolsTitle"
1195
1245
  [attr.aria-label]="moreToolsTitle"
1246
+ [attr.aria-expanded]="popupOpen"
1247
+ [id]="overflowBtnId"
1248
+ aria-haspopup="menu"
1196
1249
  *ngIf="overflow"
1197
1250
  [style.visibility]="'hidden'"
1198
1251
  [style.position]="'relative'"
1199
1252
  [style.margin-inline-start]="'auto'"
1200
- class="k-overflow-anchor k-button"
1253
+ class="k-overflow-anchor k-button k-button-flat"
1201
1254
  (click)="showPopup()"
1202
1255
  >
1203
1256
  <span class="k-icon k-i-more-vertical"></span>
1204
1257
  </button>
1205
1258
  <ng-template #popupTemplate>
1206
- <ul class="k-overflow-container k-list-container k-reset">
1259
+ <ul
1260
+ class="k-overflow-container k-list-container k-reset"
1261
+ role="menu"
1262
+ [id]="popupId"
1263
+ [attr.aria-labelledby]="overflowBtnId">
1207
1264
  <ng-container *ngFor="let tool of allTools; let index = index">
1208
- <li class="k-item">
1265
+ <li class="k-item" role="menuitem">
1209
1266
  <kendo-toolbar-renderer
1210
1267
  #overflowRenderer
1211
1268
  (rendererClick)="onRendererClick($event)"
@@ -1269,7 +1326,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1269
1326
  }], onFocusOut: [{
1270
1327
  type: HostListener,
1271
1328
  args: ['focusout', ['$event']]
1272
- }], getRole: [{
1329
+ }], role: [{
1273
1330
  type: HostBinding,
1274
1331
  args: ['attr.role']
1275
1332
  }], getDir: [{
@@ -1700,9 +1757,10 @@ class ToolBarButtonGroupComponent extends ToolBarToolComponent {
1700
1757
  return this.overflows ? this.overflowButtonGroup : this.toolbarButtonGroup;
1701
1758
  }
1702
1759
  focusButton(index, ev) {
1760
+ var _a;
1703
1761
  // Guard against focusing twice on mousedown.
1704
1762
  if (!ev.type || ev.type === 'focus' || ev.type === 'keydown') {
1705
- this.buttonElements[index].focus();
1763
+ (_a = this.buttonElements[index]) === null || _a === void 0 ? void 0 : _a.focus();
1706
1764
  }
1707
1765
  }
1708
1766
  }
@@ -1962,11 +2020,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1962
2020
  class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
1963
2021
  constructor() {
1964
2022
  super();
1965
- // showText and showIcon showIcon should be declared first
1966
- /**
1967
- * Defines the location of the button text that will be displayed.
1968
- */
1969
- this.showText = 'both';
1970
2023
  /**
1971
2024
  * Defines the location of the button icon that will be displayed.
1972
2025
  */
@@ -2031,16 +2084,21 @@ class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
2031
2084
  };
2032
2085
  this._popupSettings = { animate: true, popupClass: '' };
2033
2086
  this.focusedIndex = -1;
2087
+ this._showText = 'both';
2034
2088
  this.getNextKey = getNextKey();
2035
2089
  this.getPrevKey = getPrevKey();
2036
2090
  }
2091
+ // showText and showIcon showIcon should be declared first
2037
2092
  /**
2038
- * Sets the text of the DropDownButton
2039
- * ([see example]({% slug controltypes_toolbar %}#toc-dropdownbuttons).
2093
+ * Defines the location of the button text that will be displayed.
2040
2094
  */
2041
- set text(text) {
2042
- this.toolbarOptions.text = getValueForLocation(text, this.showText, false);
2043
- this.overflowOptions.text = getValueForLocation(text, this.showText, true);
2095
+ set showText(value) {
2096
+ this._showText = value;
2097
+ this.setTextDisplayMode();
2098
+ }
2099
+ ;
2100
+ get showText() {
2101
+ return this._showText;
2044
2102
  }
2045
2103
  /**
2046
2104
  * Defines an icon that will be rendered next to the button text.
@@ -2105,6 +2163,9 @@ class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
2105
2163
  }
2106
2164
  return this._data;
2107
2165
  }
2166
+ ngOnInit() {
2167
+ this.setTextDisplayMode();
2168
+ }
2108
2169
  get overflowButtons() {
2109
2170
  return [...this.overflowDropDownButtonButtonList.buttons.toArray().filter(b => !b.nativeElement.disabled)];
2110
2171
  }
@@ -2156,6 +2217,10 @@ class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
2156
2217
  this.overflowButtons[index].nativeElement.focus();
2157
2218
  }
2158
2219
  }
2220
+ setTextDisplayMode() {
2221
+ this.toolbarOptions.text = this.showText === 'overflow' ? undefined : this.text;
2222
+ this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
2223
+ }
2159
2224
  }
2160
2225
  ToolBarDropDownButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarDropDownButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2161
2226
  ToolBarDropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarDropDownButtonComponent, selector: "kendo-toolbar-dropdownbutton", inputs: { showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", popupSettings: "popupSettings", look: "look", primary: "primary", fillMode: "fillMode", themeColor: "themeColor", buttonClass: "buttonClass", textField: "textField", disabled: "disabled", data: "data" }, outputs: { itemClick: "itemClick", open: "open", close: "close" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarDropDownButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "dropdownButton", first: true, predicate: ["dropdownButton"], descendants: true, read: ElementRef, static: true }, { propertyName: "dropDownButtonComponent", first: true, predicate: DropDownButtonComponent, descendants: true }, { propertyName: "toolbarDropDownButton", first: true, predicate: ["toolbarDropDownButton"], descendants: true }, { propertyName: "overflowDropDownButtonButtonList", first: true, predicate: ["overflowDropDownButtonButtonList"], descendants: true }], exportAs: ["kendoToolBarDropDownButton"], usesInheritance: true, ngImport: i0, template: `
@@ -2323,11 +2388,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2323
2388
  class ToolBarSplitButtonComponent extends ToolBarToolComponent {
2324
2389
  constructor() {
2325
2390
  super();
2326
- // showText and showIcon showIcon should be declared first
2327
- /**
2328
- * Specifies where button text should be displayed
2329
- */
2330
- this.showText = 'both';
2331
2391
  /**
2332
2392
  * Specifies where button icon should be displayed
2333
2393
  */
@@ -2404,15 +2464,21 @@ class ToolBarSplitButtonComponent extends ToolBarToolComponent {
2404
2464
  };
2405
2465
  this._popupSettings = { animate: true, popupClass: '' };
2406
2466
  this.focusedIndex = -1;
2467
+ this._showText = 'both';
2407
2468
  this.getNextKey = getNextKey();
2408
2469
  this.getPrevKey = getPrevKey();
2409
2470
  }
2471
+ // showText and showIcon showIcon should be declared first
2410
2472
  /**
2411
- * Sets the text of the SplitButton ([see example]({% slug controltypes_toolbar %}#toc-splitbuttons).
2473
+ * Specifies where button text should be displayed
2412
2474
  */
2413
- set text(text) {
2414
- this.toolbarOptions.text = getValueForLocation(text, this.showText, false);
2415
- this.overflowOptions.text = getValueForLocation(text, this.showText, true);
2475
+ set showText(value) {
2476
+ this._showText = value;
2477
+ this.setTextDisplayMode();
2478
+ }
2479
+ ;
2480
+ get showText() {
2481
+ return this._showText;
2416
2482
  }
2417
2483
  /**
2418
2484
  * Defines the icon that will be rendered next to the button text
@@ -2474,6 +2540,9 @@ class ToolBarSplitButtonComponent extends ToolBarToolComponent {
2474
2540
  }
2475
2541
  return this._data;
2476
2542
  }
2543
+ ngOnInit() {
2544
+ this.setTextDisplayMode();
2545
+ }
2477
2546
  get overflowButtons() {
2478
2547
  return [this.overflowSplitButton, ...this.overflowSplitButtonButtonList.buttons.toArray().filter(b => !b.nativeElement.disabled)];
2479
2548
  }
@@ -2530,6 +2599,10 @@ class ToolBarSplitButtonComponent extends ToolBarToolComponent {
2530
2599
  this.overflowButtons[index].nativeElement.focus();
2531
2600
  }
2532
2601
  }
2602
+ setTextDisplayMode() {
2603
+ this.toolbarOptions.text = this.showText === 'overflow' ? undefined : this.text;
2604
+ this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
2605
+ }
2533
2606
  }
2534
2607
  ToolBarSplitButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarSplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2535
2608
  ToolBarSplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarSplitButtonComponent, selector: "kendo-toolbar-splitbutton", inputs: { showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", disabled: "disabled", popupSettings: "popupSettings", fillMode: "fillMode", themeColor: "themeColor", look: "look", buttonClass: "buttonClass", arrowButtonClass: "arrowButtonClass", arrowButtonIcon: "arrowButtonIcon", textField: "textField", data: "data" }, outputs: { buttonClick: "buttonClick", itemClick: "itemClick", open: "open", close: "close" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarSplitButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "toolbarSplitButton", first: true, predicate: ["toolbarSplitButton"], descendants: true }, { propertyName: "overflowSplitButton", first: true, predicate: ["overflowSplitButton"], descendants: true, read: ElementRef }, { propertyName: "overflowSplitButtonButtonList", first: true, predicate: ["overflowSplitButtonButtonList"], descendants: true }], exportAs: ["kendoToolBarSplitButton"], usesInheritance: true, ngImport: i0, template: `
@@ -2874,7 +2947,7 @@ const TOOLBAR_COMMON = [
2874
2947
  LocalizedToolbarMessagesDirective
2875
2948
  ];
2876
2949
  /**
2877
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }}) definition for the ToolBar component.
2950
+ * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the ToolBar component.
2878
2951
  *
2879
2952
  * The package exports:
2880
2953
  * - `ToolBarComponent`&mdash;The ToolBarComponent class.
@@ -25,6 +25,7 @@ export declare class NavigationService {
25
25
  focusPrev(ev: KeyboardEvent): void;
26
26
  resetNavigation(): void;
27
27
  focusFirst(ev: Event): void;
28
+ focusLast(ev: Event): void;
28
29
  private getFocusableTools;
29
30
  private focus;
30
31
  private blurOverflowButton;