@progress/kendo-angular-layout 7.1.5-dev.202210191350 → 7.1.5-dev.202210241150

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.
@@ -16,10 +16,12 @@ export declare class DrawerService {
16
16
  owner: any;
17
17
  selectedIndices: Array<number>;
18
18
  viewData: Set<DrawerViewItem>;
19
+ focusIndex: number;
19
20
  private originalItems;
20
21
  private idxCounter;
21
22
  init(): void;
22
23
  get view(): Array<DrawerViewItem>;
24
+ changeFocusedItem(items: any, keyName: any, renderer: any): void;
23
25
  private populateViewData;
24
26
  private resetViewData;
25
27
  private loadChildren;
@@ -10,7 +10,7 @@ import * as i0 from "@angular/core";
10
10
  * @hidden
11
11
  */
12
12
  export declare class DrawerItemComponent implements AfterViewInit {
13
- drawer: DrawerService;
13
+ drawerService: DrawerService;
14
14
  private element;
15
15
  private renderer;
16
16
  viewItem: DrawerViewItem;
@@ -24,7 +24,7 @@ export declare class DrawerItemComponent implements AfterViewInit {
24
24
  get disabledClass(): boolean;
25
25
  get selectedClass(): boolean;
26
26
  get label(): boolean;
27
- constructor(drawer: DrawerService, element: ElementRef, renderer: Renderer2);
27
+ constructor(drawerService: DrawerService, element: ElementRef, renderer: Renderer2);
28
28
  ngAfterViewInit(): void;
29
29
  get iconClasses(): string[];
30
30
  get item(): any;
@@ -2,10 +2,11 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { ElementRef, NgZone, OnDestroy, OnInit, Renderer2, TemplateRef, EventEmitter } from "@angular/core";
5
+ import { ElementRef, NgZone, OnDestroy, OnInit, Renderer2, TemplateRef, EventEmitter, QueryList } from "@angular/core";
6
6
  import { DrawerService } from './drawer.service';
7
7
  import { DrawerListSelectEvent } from './events/drawer-list-select.event';
8
8
  import { DrawerViewItem } from './models/drawer-view-item.interface';
9
+ import { DrawerItemComponent } from './item.component';
9
10
  import * as i0 from "@angular/core";
10
11
  /**
11
12
  * @hidden
@@ -20,6 +21,7 @@ export declare class DrawerListComponent implements OnInit, OnDestroy {
20
21
  expanded: boolean;
21
22
  view: DrawerViewItem[];
22
23
  select: EventEmitter<DrawerListSelectEvent>;
24
+ items: QueryList<DrawerItemComponent>;
23
25
  private subscriptions;
24
26
  constructor(drawerService: DrawerService, renderer: Renderer2, ngZone: NgZone, element: ElementRef);
25
27
  ngOnInit(): void;
@@ -27,7 +29,7 @@ export declare class DrawerListComponent implements OnInit, OnDestroy {
27
29
  identifyItem(_index: number, viewItem: DrawerViewItem): any;
28
30
  private initDomEvents;
29
31
  private clickHandler;
30
- private keyDownHandler;
32
+ private onEnterOrSpaceKeyDown;
31
33
  private getDrawerItemIndex;
32
34
  static ɵfac: i0.ɵɵFactoryDeclaration<DrawerListComponent, never>;
33
35
  static ɵcmp: i0.ɵɵComponentDeclaration<DrawerListComponent, "[kendoDrawerList]", never, { "itemTemplate": "itemTemplate"; "mini": "mini"; "expanded": "expanded"; "view": "view"; }, { "select": "select"; }, never, never>;
@@ -105,5 +105,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
105
105
  args: ['attr.dir']
106
106
  }], drawer: [{
107
107
  type: ContentChild,
108
- args: [DrawerComponent, { static: false }]
108
+ args: [DrawerComponent]
109
109
  }] } });
@@ -273,7 +273,7 @@ export class DrawerComponent {
273
273
  }
274
274
  }
275
275
  DrawerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DrawerComponent, deps: [{ token: i0.ElementRef }, { token: i1.AnimationBuilder }, { token: i2.LocalizationService }, { token: i3.DrawerService }], target: i0.ɵɵFactoryTarget.Component });
276
- DrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DrawerComponent, selector: "kendo-drawer", inputs: { mode: "mode", position: "position", mini: "mini", expanded: "expanded", width: "width", miniWidth: "miniWidth", autoCollapse: "autoCollapse", items: "items", isItemExpanded: "isItemExpanded", animation: "animation" }, outputs: { expand: "expand", collapse: "collapse", select: "select", expandedChange: "expandedChange" }, host: { properties: { "class.k-widget": "this.hostClasses", "class.k-drawer": "this.hostClasses", "class.k-drawer-start": "this.startPositionClass", "class.k-drawer-end": "this.endPositionClass", "style.transform": "this.overlayTransofrmStyles", "style.flexBasis.px": "this.flexStyles", "attr.dir": "this.direction" } }, providers: [
276
+ DrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DrawerComponent, selector: "kendo-drawer", inputs: { mode: "mode", position: "position", mini: "mini", expanded: "expanded", width: "width", miniWidth: "miniWidth", autoCollapse: "autoCollapse", items: "items", isItemExpanded: "isItemExpanded", animation: "animation" }, outputs: { expand: "expand", collapse: "collapse", select: "select", expandedChange: "expandedChange" }, host: { properties: { "class.k-drawer": "this.hostClasses", "class.k-drawer-start": "this.startPositionClass", "class.k-drawer-end": "this.endPositionClass", "style.transform": "this.overlayTransofrmStyles", "style.flexBasis.px": "this.flexStyles", "attr.dir": "this.direction" } }, providers: [
277
277
  LocalizationService,
278
278
  DrawerService,
279
279
  {
@@ -288,6 +288,8 @@ DrawerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versio
288
288
  </ng-template>
289
289
 
290
290
  <ul kendoDrawerList
291
+ role="menubar"
292
+ orientation="vertical"
291
293
  (select)="onSelect($event)"
292
294
  [mini]="mini"
293
295
  [expanded]="expanded"
@@ -327,6 +329,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
327
329
  </ng-template>
328
330
 
329
331
  <ul kendoDrawerList
332
+ role="menubar"
333
+ orientation="vertical"
330
334
  (select)="onSelect($event)"
331
335
  [mini]="mini"
332
336
  [expanded]="expanded"
@@ -347,9 +351,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
347
351
  `
348
352
  }]
349
353
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.AnimationBuilder }, { type: i2.LocalizationService }, { type: i3.DrawerService }]; }, propDecorators: { hostClasses: [{
350
- type: HostBinding,
351
- args: ['class.k-widget']
352
- }, {
353
354
  type: HostBinding,
354
355
  args: ['class.k-drawer']
355
356
  }], startPositionClass: [{
@@ -397,14 +398,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
397
398
  type: Output
398
399
  }], drawerTemplate: [{
399
400
  type: ContentChild,
400
- args: [DrawerTemplateDirective, { static: false }]
401
+ args: [DrawerTemplateDirective]
401
402
  }], footerTemplate: [{
402
403
  type: ContentChild,
403
- args: [DrawerFooterTemplateDirective, { static: false }]
404
+ args: [DrawerFooterTemplateDirective]
404
405
  }], headerTemplate: [{
405
406
  type: ContentChild,
406
- args: [DrawerHeaderTemplateDirective, { static: false }]
407
+ args: [DrawerHeaderTemplateDirective]
407
408
  }], itemTemplate: [{
408
409
  type: ContentChild,
409
- args: [DrawerItemTemplateDirective, { static: false }]
410
+ args: [DrawerItemTemplateDirective]
410
411
  }] } });
@@ -15,6 +15,7 @@ export const defaultIsItemExpanded = (_item) => false;
15
15
  export class DrawerService {
16
16
  constructor() {
17
17
  this.selectedIndices = [];
18
+ this.focusIndex = 0;
18
19
  this.originalItems = [];
19
20
  this.idxCounter = 0;
20
21
  this.isItemExpanded = defaultIsItemExpanded;
@@ -28,6 +29,33 @@ export class DrawerService {
28
29
  get view() {
29
30
  return Array.from(this.viewData);
30
31
  }
32
+ changeFocusedItem(items, keyName, renderer) {
33
+ const currentItem = items.get(this.focusIndex);
34
+ let nextItem;
35
+ if (keyName === 'arrowUp') {
36
+ if (this.focusIndex === 0) {
37
+ nextItem = items.get(items.length - 1);
38
+ this.focusIndex = items.length - 1;
39
+ }
40
+ else {
41
+ nextItem = items.get(this.focusIndex - 1);
42
+ this.focusIndex = this.focusIndex - 1;
43
+ }
44
+ }
45
+ else if (keyName === 'arrowDown') {
46
+ if (this.focusIndex === items.length - 1) {
47
+ nextItem = items.get(0);
48
+ this.focusIndex = 0;
49
+ }
50
+ else {
51
+ nextItem = items.get(this.focusIndex + 1);
52
+ this.focusIndex = this.focusIndex + 1;
53
+ }
54
+ }
55
+ renderer.setAttribute(currentItem.nativeElement, 'tabindex', '-1');
56
+ renderer.setAttribute(nextItem.nativeElement, 'tabindex', '0');
57
+ nextItem.nativeElement.focus();
58
+ }
31
59
  populateViewData(items, level = 0) {
32
60
  items.forEach((item) => {
33
61
  this.setSelection(item);
@@ -11,8 +11,8 @@ import * as i2 from "@angular/common";
11
11
  * @hidden
12
12
  */
13
13
  export class DrawerItemComponent {
14
- constructor(drawer, element, renderer) {
15
- this.drawer = drawer;
14
+ constructor(drawerService, element, renderer) {
15
+ this.drawerService = drawerService;
16
16
  this.element = element;
17
17
  this.renderer = renderer;
18
18
  }
@@ -20,7 +20,7 @@ export class DrawerItemComponent {
20
20
  return this.item.disabled;
21
21
  }
22
22
  get selectedClass() {
23
- return this.drawer.selectedIndices.indexOf(this.index) >= 0;
23
+ return this.drawerService.selectedIndices.indexOf(this.index) >= 0;
24
24
  }
25
25
  get label() {
26
26
  return this.item.text ? this.item.text : null;
@@ -3,12 +3,13 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { Subscription } from 'rxjs';
6
- import { Component, Input, Output, EventEmitter } from "@angular/core";
6
+ import { Component, ElementRef, Input, Output, EventEmitter, ViewChildren } from "@angular/core";
7
7
  import { closestItem, itemIndex } from '../common/dom-queries';
8
8
  import { DRAWER_ITEM_INDEX } from './models/constants';
9
9
  import { Keys } from '@progress/kendo-angular-common';
10
10
  import { ACTIVE_NESTED_LINK_SELECTOR, nestedLink } from './util';
11
11
  import { DrawerListSelectEvent } from './events/drawer-list-select.event';
12
+ import { DrawerItemComponent } from './item.component';
12
13
  import * as i0 from "@angular/core";
13
14
  import * as i1 from "./drawer.service";
14
15
  import * as i2 from "./item.component";
@@ -43,12 +44,26 @@ export class DrawerListComponent {
43
44
  this.ngZone.runOutsideAngular(() => {
44
45
  const nativeElement = this.element.nativeElement;
45
46
  this.subscriptions.add(this.renderer.listen(nativeElement, 'click', this.clickHandler.bind(this)));
46
- this.subscriptions.add(this.renderer.listen(nativeElement, 'keydown', this.keyDownHandler.bind(this)));
47
+ this.subscriptions.add(this.renderer.listen(nativeElement, 'keydown', (e) => {
48
+ const isEnterOrSpace = e.keyCode === Keys.Enter || e.keyCode === Keys.Space;
49
+ const isArrowUpOrDown = e.keyCode === Keys.ArrowUp || e.keyCode === Keys.ArrowDown;
50
+ if (isEnterOrSpace) {
51
+ this.onEnterOrSpaceKeyDown(e);
52
+ }
53
+ else if (isArrowUpOrDown) {
54
+ if (e.target.classList.contains('k-drawer-item')) {
55
+ const keyName = e.keyCode === Keys.ArrowUp ? 'arrowUp' : 'arrowDown';
56
+ this.drawerService.changeFocusedItem(this.items, keyName, this.renderer);
57
+ }
58
+ }
59
+ }));
47
60
  });
48
61
  }
49
62
  clickHandler(e) {
50
63
  const viewItemIdx = this.getDrawerItemIndex(e.target);
51
64
  const viewItem = this.view[viewItemIdx];
65
+ const filterItems = this.view.filter(items => !items.item.separator);
66
+ const selectedItemIndex = filterItems.findIndex(item => item.index === viewItemIdx);
52
67
  if (!viewItem) {
53
68
  return;
54
69
  }
@@ -65,17 +80,14 @@ export class DrawerListComponent {
65
80
  const event = new DrawerListSelectEvent(args);
66
81
  this.select.emit(event);
67
82
  if (!event.isDefaultPrevented()) {
83
+ this.drawerService.focusIndex = selectedItemIndex;
68
84
  this.drawerService.onSelect(viewItemIdx);
69
85
  this.drawerService.init();
70
86
  this.view = this.drawerService.view;
71
87
  }
72
88
  });
73
89
  }
74
- keyDownHandler(e) {
75
- const isEnterOrSpace = e.keyCode === Keys.Enter || e.keyCode === Keys.Space;
76
- if (!isEnterOrSpace) {
77
- return;
78
- }
90
+ onEnterOrSpaceKeyDown(e) {
79
91
  this.clickHandler(e);
80
92
  const link = nestedLink(this.element.nativeElement, ACTIVE_NESTED_LINK_SELECTOR);
81
93
  if (link) {
@@ -91,7 +103,7 @@ export class DrawerListComponent {
91
103
  }
92
104
  }
93
105
  DrawerListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DrawerListComponent, deps: [{ token: i1.DrawerService }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
94
- DrawerListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DrawerListComponent, selector: "[kendoDrawerList]", inputs: { itemTemplate: "itemTemplate", mini: "mini", expanded: "expanded", view: "view" }, outputs: { select: "select" }, ngImport: i0, template: "\n <ng-container *ngFor=\"let v of view; trackBy:identifyItem; let idx = index\">\n <li *ngIf=\"!v.item.separator\" kendoDrawerItem\n class=\"k-drawer-item {{expanded ? ' k-level-' + v.level : ''}}\"\n [viewItem]=\"v\"\n [index]=\"idx\"\n [mini]=\"mini\"\n [expanded]=\"expanded\"\n [itemTemplate]=\"itemTemplate\"\n [attr.data-kendo-drawer-index]=\"v.index\"\n [ngClass]=\"v.item.cssClass\"\n [ngStyle]=\"v.item.cssStyle\"\n tabindex=\"0\">\n </li>\n\n <li *ngIf=\"v.item.separator\"\n class=\"k-drawer-item k-drawer-separator\"\n [ngClass]=\"v.item.cssClass\"\n [ngStyle]=\"v.item.cssStyle\">\n &nbsp;\n </li>\n </ng-container>\n ", isInline: true, components: [{ type: i2.DrawerItemComponent, selector: "[kendoDrawerItem]", inputs: ["viewItem", "index", "itemTemplate", "mini", "expanded", "disabled", "cssClass", "cssStyle"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
106
+ DrawerListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DrawerListComponent, selector: "[kendoDrawerList]", inputs: { itemTemplate: "itemTemplate", mini: "mini", expanded: "expanded", view: "view" }, outputs: { select: "select" }, viewQueries: [{ propertyName: "items", predicate: DrawerItemComponent, descendants: true, read: ElementRef }], ngImport: i0, template: "\n <ng-container *ngFor=\"let v of view; trackBy:identifyItem; let idx = index\">\n <li *ngIf=\"!v.item.separator\" kendoDrawerItem\n class=\"k-drawer-item {{expanded ? ' k-level-' + v.level : ''}}\"\n role=\"menuitem\"\n [viewItem]=\"v\"\n [index]=\"idx\"\n [mini]=\"mini\"\n [expanded]=\"expanded\"\n [itemTemplate]=\"itemTemplate\"\n [attr.data-kendo-drawer-index]=\"v.index\"\n [ngClass]=\"v.item.cssClass\"\n [ngStyle]=\"v.item.cssStyle\"\n [tabindex]=\"v.item.id === 0 ? '0' : '-1'\">\n </li>\n\n <li *ngIf=\"v.item.separator\"\n role=\"separator\"\n class=\"k-drawer-item k-drawer-separator\"\n [ngClass]=\"v.item.cssClass\"\n [ngStyle]=\"v.item.cssStyle\">\n &nbsp;\n </li>\n </ng-container>\n ", isInline: true, components: [{ type: i2.DrawerItemComponent, selector: "[kendoDrawerItem]", inputs: ["viewItem", "index", "itemTemplate", "mini", "expanded", "disabled", "cssClass", "cssStyle"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
95
107
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DrawerListComponent, decorators: [{
96
108
  type: Component,
97
109
  args: [{
@@ -101,6 +113,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
101
113
  <ng-container *ngFor="let v of view; trackBy:identifyItem; let idx = index">
102
114
  <li *ngIf="!v.item.separator" kendoDrawerItem
103
115
  class="k-drawer-item {{expanded ? ' k-level-' + v.level : ''}}"
116
+ role="menuitem"
104
117
  [viewItem]="v"
105
118
  [index]="idx"
106
119
  [mini]="mini"
@@ -109,10 +122,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
109
122
  [attr.${DRAWER_ITEM_INDEX}]="v.index"
110
123
  [ngClass]="v.item.cssClass"
111
124
  [ngStyle]="v.item.cssStyle"
112
- tabindex="0">
125
+ [tabindex]="v.item.id === 0 ? '0' : '-1'">
113
126
  </li>
114
127
 
115
128
  <li *ngIf="v.item.separator"
129
+ role="separator"
116
130
  class="k-drawer-item k-drawer-separator"
117
131
  [ngClass]="v.item.cssClass"
118
132
  [ngStyle]="v.item.cssStyle">
@@ -131,4 +145,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
131
145
  type: Input
132
146
  }], select: [{
133
147
  type: Output
148
+ }], items: [{
149
+ type: ViewChildren,
150
+ args: [DrawerItemComponent, { read: ElementRef }]
134
151
  }] } });
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { isFocusable, hasClass } from './../common/dom-queries';
6
- import { Component, ContentChild, EventEmitter, HostBinding, Input, Output, HostListener, ViewChild } from '@angular/core';
6
+ import { Component, ContentChild, EventEmitter, HostBinding, Input, Output, ViewChild } from '@angular/core';
7
7
  import { ExpansionPanelTitleDirective } from './expansionpanel-title.directive';
8
8
  import { collapse, expand } from './animations';
9
9
  import { isPresent } from '../common/util';
@@ -93,7 +93,6 @@ export class ExpansionPanelComponent {
93
93
  */
94
94
  this.collapse = new EventEmitter();
95
95
  this.hostClass = true;
96
- this.tabindex = 0;
97
96
  /**
98
97
  * @hidden
99
98
  */
@@ -128,31 +127,13 @@ export class ExpansionPanelComponent {
128
127
  get expandedClass() {
129
128
  return this.expanded && !this.disabled;
130
129
  }
131
- get focusClass() {
132
- return this.focused;
133
- }
134
- get disabledClass() {
135
- return this.disabled;
136
- }
137
- /**
138
- * @hidden
139
- */
140
- onComponentBlur() {
141
- if (this.focused) {
142
- this.focused = false;
143
- }
144
- }
145
- /**
146
- * @hidden
147
- */
148
- onComponentFocus() {
149
- if (!this.focused) {
150
- this.focused = true;
151
- }
152
- }
153
130
  ngOnInit() {
154
131
  this.renderer.removeAttribute(this.hostElement.nativeElement, 'title');
155
132
  this.subscriptions = this.localizationService.changes.subscribe(({ rtl }) => { this.direction = rtl ? 'rtl' : 'ltr'; });
133
+ const elem = this.hostElement.nativeElement;
134
+ const header = this.header.nativeElement;
135
+ this.subscriptions.add(this.renderer.listen(header, 'focus', () => this.focusExpansionPanel(elem)));
136
+ this.subscriptions.add(this.renderer.listen(header, 'blur', () => this.blurExpansionPanel(elem)));
156
137
  }
157
138
  ngAfterViewInit() {
158
139
  this.initDomEvents();
@@ -172,8 +153,8 @@ export class ExpansionPanelComponent {
172
153
  }
173
154
  if (!this.disabled) {
174
155
  this.ngZone.runOutsideAngular(() => {
175
- const nativeElement = this.hostElement.nativeElement;
176
- this.subscriptions.add(this.renderer.listen(nativeElement, 'keydown', this.keyDownHandler.bind(this)));
156
+ const elem = this.hostElement.nativeElement;
157
+ this.subscriptions.add(this.renderer.listen(elem, 'keydown', this.keyDownHandler.bind(this)));
177
158
  });
178
159
  }
179
160
  }
@@ -185,7 +166,7 @@ export class ExpansionPanelComponent {
185
166
  if (!isEnterOrSpace) {
186
167
  return;
187
168
  }
188
- if (hasClass(ev.target, 'k-expander')) {
169
+ if (hasClass(ev.target, 'k-expander-header')) {
189
170
  ev.preventDefault();
190
171
  this.ngZone.run(() => {
191
172
  this.onHeaderAction();
@@ -196,7 +177,8 @@ export class ExpansionPanelComponent {
196
177
  * @hidden
197
178
  */
198
179
  onHeaderClick(ev) {
199
- if (!isFocusable(ev.target) && !this.disabled) {
180
+ const header = this.header.nativeElement;
181
+ if (!isFocusable(ev.target) || (ev.target === header) && !this.disabled) {
200
182
  this.onHeaderAction();
201
183
  }
202
184
  }
@@ -204,7 +186,6 @@ export class ExpansionPanelComponent {
204
186
  * @hidden
205
187
  */
206
188
  onHeaderAction() {
207
- this.focused = true;
208
189
  const eventArgs = new ExpansionPanelActionEvent();
209
190
  eventArgs.action = this.expanded ? 'collapse' : 'expand';
210
191
  this.action.emit(eventArgs);
@@ -259,6 +240,18 @@ export class ExpansionPanelComponent {
259
240
  }
260
241
  this.emitExpandCollapseEvent();
261
242
  }
243
+ focusExpansionPanel(el) {
244
+ if (!this.focused) {
245
+ this.focused = true;
246
+ this.renderer.addClass(el, 'k-focus');
247
+ }
248
+ }
249
+ blurExpansionPanel(el) {
250
+ if (this.focused) {
251
+ this.focused = false;
252
+ this.renderer.removeClass(el, 'k-focus');
253
+ }
254
+ }
262
255
  setExpanded(value) {
263
256
  this._expanded = value;
264
257
  this.expandedChange.emit(value);
@@ -299,18 +292,24 @@ export class ExpansionPanelComponent {
299
292
  }
300
293
  }
301
294
  ExpansionPanelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ExpansionPanelComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.LocalizationService }, { token: i2.AnimationBuilder }], target: i0.ɵɵFactoryTarget.Component });
302
- ExpansionPanelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ExpansionPanelComponent, selector: "kendo-expansionpanel", inputs: { title: "title", subtitle: "subtitle", disabled: "disabled", expanded: "expanded", expandIcon: "expandIcon", collapseIcon: "collapseIcon", animation: "animation" }, outputs: { expandedChange: "expandedChange", action: "action", expand: "expand", collapse: "collapse" }, host: { listeners: { "blur": "onComponentBlur()", "focus": "onComponentFocus()" }, properties: { "class.k-expander": "this.hostClass", "class.k-expanded": "this.expandedClass", "class.k-focus": "this.focusClass", "attr.aria-disabled": "this.disabledClass", "class.k-disabled": "this.disabledClass", "attr.dir": "this.direction", "attr.tabindex": "this.tabindex" } }, providers: [
295
+ ExpansionPanelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ExpansionPanelComponent, selector: "kendo-expansionpanel", inputs: { title: "title", subtitle: "subtitle", disabled: "disabled", expanded: "expanded", expandIcon: "expandIcon", collapseIcon: "collapseIcon", animation: "animation" }, outputs: { expandedChange: "expandedChange", action: "action", expand: "expand", collapse: "collapse" }, host: { properties: { "class.k-expander": "this.hostClass", "class.k-expanded": "this.expandedClass", "attr.dir": "this.direction" } }, providers: [
303
296
  LocalizationService,
304
297
  {
305
298
  provide: L10N_PREFIX,
306
299
  useValue: 'kendo.expansionpanel'
307
300
  }
308
- ], queries: [{ propertyName: "titleTemplate", first: true, predicate: ExpansionPanelTitleDirective, descendants: true }], viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, static: true }], exportAs: ["kendoExpansionPanel"], ngImport: i0, template: `
301
+ ], queries: [{ propertyName: "titleTemplate", first: true, predicate: ExpansionPanelTitleDirective, descendants: true }], viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true, static: true }, { propertyName: "header", first: true, predicate: ["header"], descendants: true, static: true }], exportAs: ["kendoExpansionPanel"], ngImport: i0, template: `
309
302
  <div
303
+ #header
310
304
  [class.k-expander-header]="true"
305
+ [class.k-disabled]="disabled"
306
+ [attr.aria-disabled]="disabled"
311
307
  [attr.aria-expanded]="expanded && !disabled"
312
308
  role="button"
313
- (click)="onHeaderClick($event)">
309
+ tabindex="0"
310
+ [attr.aria-controls]="title"
311
+ (click)="onHeaderClick($event)"
312
+ >
314
313
  <ng-container *ngIf="!titleTemplate">
315
314
  <div *ngIf="title" class="k-expander-title">{{ title }}</div>
316
315
  <span class="k-spacer"></span>
@@ -327,7 +326,7 @@ ExpansionPanelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
327
326
  </span>
328
327
  </div>
329
328
  <div #content class="k-expander-content-wrapper">
330
- <div class="k-expander-content" [attr.aria-hidden]="!expanded">
329
+ <div [id]="title" class="k-expander-content" [attr.aria-hidden]="!expanded">
331
330
  <ng-content></ng-content>
332
331
  </div>
333
332
  </div>
@@ -346,10 +345,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
346
345
  selector: 'kendo-expansionpanel',
347
346
  template: `
348
347
  <div
348
+ #header
349
349
  [class.k-expander-header]="true"
350
+ [class.k-disabled]="disabled"
351
+ [attr.aria-disabled]="disabled"
350
352
  [attr.aria-expanded]="expanded && !disabled"
351
353
  role="button"
352
- (click)="onHeaderClick($event)">
354
+ tabindex="0"
355
+ [attr.aria-controls]="title"
356
+ (click)="onHeaderClick($event)"
357
+ >
353
358
  <ng-container *ngIf="!titleTemplate">
354
359
  <div *ngIf="title" class="k-expander-title">{{ title }}</div>
355
360
  <span class="k-spacer"></span>
@@ -366,7 +371,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
366
371
  </span>
367
372
  </div>
368
373
  <div #content class="k-expander-content-wrapper">
369
- <div class="k-expander-content" [attr.aria-hidden]="!expanded">
374
+ <div [id]="title" class="k-expander-content" [attr.aria-hidden]="!expanded">
370
375
  <ng-content></ng-content>
371
376
  </div>
372
377
  </div>
@@ -400,31 +405,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
400
405
  }], content: [{
401
406
  type: ViewChild,
402
407
  args: ['content', { static: true }]
408
+ }], header: [{
409
+ type: ViewChild,
410
+ args: ['header', { static: true }]
403
411
  }], hostClass: [{
404
412
  type: HostBinding,
405
413
  args: ['class.k-expander']
406
414
  }], expandedClass: [{
407
415
  type: HostBinding,
408
416
  args: ['class.k-expanded']
409
- }], focusClass: [{
410
- type: HostBinding,
411
- args: ['class.k-focus']
412
- }], disabledClass: [{
413
- type: HostBinding,
414
- args: ['attr.aria-disabled']
415
- }, {
416
- type: HostBinding,
417
- args: ['class.k-disabled']
418
417
  }], direction: [{
419
418
  type: HostBinding,
420
419
  args: ['attr.dir']
421
- }], tabindex: [{
422
- type: HostBinding,
423
- args: ['attr.tabindex']
424
- }], onComponentBlur: [{
425
- type: HostListener,
426
- args: ['blur']
427
- }], onComponentFocus: [{
428
- type: HostListener,
429
- args: ['focus']
430
420
  }] } });
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-layout',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1666187359,
12
+ publishDate: 1666612185,
13
13
  version: '',
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
  };
@@ -102,12 +102,10 @@ export declare class ExpansionPanelComponent implements OnInit, AfterViewInit, O
102
102
  */
103
103
  titleTemplate: ExpansionPanelTitleDirective;
104
104
  content: ElementRef;
105
+ header: ElementRef;
105
106
  hostClass: boolean;
106
107
  get expandedClass(): boolean;
107
- get focusClass(): boolean;
108
- get disabledClass(): boolean;
109
108
  direction: string;
110
- tabindex: number;
111
109
  /**
112
110
  * @hidden
113
111
  */
@@ -115,14 +113,6 @@ export declare class ExpansionPanelComponent implements OnInit, AfterViewInit, O
115
113
  private animationEnd;
116
114
  private subscriptions;
117
115
  private _expanded;
118
- /**
119
- * @hidden
120
- */
121
- onComponentBlur(): void;
122
- /**
123
- * @hidden
124
- */
125
- onComponentFocus(): void;
126
116
  constructor(renderer: Renderer2, hostElement: ElementRef, ngZone: NgZone, localizationService: LocalizationService, builder: AnimationBuilder);
127
117
  ngOnInit(): void;
128
118
  ngAfterViewInit(): void;
@@ -154,6 +144,8 @@ export declare class ExpansionPanelComponent implements OnInit, AfterViewInit, O
154
144
  * @param expanded? - Boolean. Specifies, whether the ExpansionPanel will be expanded or collapsed.
155
145
  */
156
146
  toggle(expanded?: boolean): void;
147
+ private focusExpansionPanel;
148
+ private blurExpansionPanel;
157
149
  private setExpanded;
158
150
  private animateContent;
159
151
  private createPlayer;