@progress/kendo-angular-dropdowns 11.0.0-develop.111 → 11.0.0-develop.113

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.
@@ -62,14 +62,6 @@ export declare class DropDownTreeComponent implements OnInit, OnDestroy, OnChang
62
62
  get isAriaExpanded(): boolean;
63
63
  get hostAriaAutocomplete(): string;
64
64
  get isReadonly(): string;
65
- /**
66
- * @hidden
67
- */
68
- handleClick(): void;
69
- /**
70
- * @hidden
71
- */
72
- handleKeydown(event: any): void;
73
65
  noDataTemplate: NoDataTemplateDirective;
74
66
  headerTemplate: HeaderTemplateDirective;
75
67
  footerTemplate: FooterTemplateDirective;
@@ -311,6 +303,7 @@ export declare class DropDownTreeComponent implements OnInit, OnDestroy, OnChang
311
303
  */
312
304
  get isOpen(): boolean;
313
305
  get clearButtonVisiblity(): string;
306
+ private get isFilterActive();
314
307
  popupRef: PopupRef;
315
308
  /**
316
309
  * @hidden
@@ -404,6 +397,7 @@ export declare class DropDownTreeComponent implements OnInit, OnDestroy, OnChang
404
397
  private printableCharacters;
405
398
  private subs;
406
399
  private touchstartDisposeHandler;
400
+ private lastNodeOnFocus;
407
401
  constructor(injector: Injector, wrapper: ElementRef<HTMLElement>, popupService: PopupService, navigationService: NavigationService, renderer: Renderer2, _zone: NgZone, cdr: ChangeDetectorRef, localization: LocalizationService, touchEnabled: boolean);
408
402
  ngOnInit(): void;
409
403
  /**
@@ -418,6 +412,7 @@ export declare class DropDownTreeComponent implements OnInit, OnDestroy, OnChang
418
412
  * @hidden
419
413
  */
420
414
  ngAfterContentChecked(): void;
415
+ ngAfterViewInit(): void;
421
416
  /**
422
417
  * @hidden
423
418
  *
@@ -437,6 +432,10 @@ export declare class DropDownTreeComponent implements OnInit, OnDestroy, OnChang
437
432
  * @hidden
438
433
  */
439
434
  handleBlur(e?: FocusEvent): void;
435
+ /**
436
+ * @hidden
437
+ */
438
+ handleKeydown(event: any): void;
440
439
  /**
441
440
  * Focuses a specific item of the DropDownTree based on a provided index in the format of `1_1`.
442
441
  * The targeted item should be expanded in order for it to be focused.
@@ -538,6 +537,7 @@ export declare class DropDownTreeComponent implements OnInit, OnDestroy, OnChang
538
537
  private triggerPopupEvents;
539
538
  private createPopup;
540
539
  private destroyPopup;
540
+ private handleClick;
541
541
  private handleEscape;
542
542
  private setState;
543
543
  private clearState;
@@ -549,6 +549,11 @@ export declare class DropDownTreeComponent implements OnInit, OnDestroy, OnChang
549
549
  private handleDocumentBlur;
550
550
  private assignAriaDescribedBy;
551
551
  private setComponentClasses;
552
+ /**
553
+ * Remove the `TreeView` from the tab order, otherwise a focus loop between the page elements will occur
554
+ * and the user will not be able to tab to the rest of the browser elements
555
+ */
556
+ private removeTreeViewFromTabOrder;
552
557
  static ɵfac: i0.ɵɵFactoryDeclaration<DropDownTreeComponent, [null, null, null, null, null, null, null, null, { optional: true; }]>;
553
558
  static ɵcmp: i0.ɵɵComponentDeclaration<DropDownTreeComponent, "kendo-dropdowntree", ["kendoDropDownTree"], { "loading": "loading"; "clearButton": "clearButton"; "data": "data"; "value": "value"; "textField": "textField"; "valueField": "valueField"; "valueDepth": "valueDepth"; "hasChildren": "hasChildren"; "fetchChildren": "fetchChildren"; "placeholder": "placeholder"; "popupSettings": "popupSettings"; "dataItem": "dataItem"; "listHeight": "listHeight"; "disabled": "disabled"; "readonly": "readonly"; "valuePrimitive": "valuePrimitive"; "tabindex": "tabindex"; "size": "size"; "rounded": "rounded"; "fillMode": "fillMode"; "itemDisabled": "itemDisabled"; "isNodeExpanded": "isNodeExpanded"; "isNodeVisible": "isNodeVisible"; "loadOnDemand": "loadOnDemand"; "filterable": "filterable"; "filter": "filter"; "focusableId": "focusableId"; }, { "open": "open"; "opened": "opened"; "close": "close"; "closed": "closed"; "nodeExpand": "nodeExpand"; "nodeCollapse": "nodeCollapse"; "onFocus": "focus"; "onBlur": "blur"; "valueChange": "valueChange"; "filterChange": "filterChange"; }, ["noDataTemplate", "headerTemplate", "footerTemplate", "nodeTemplate", "valueTemplate"], never>;
554
559
  }
@@ -69,10 +69,6 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
69
69
  * @hidden
70
70
  */
71
71
  get formControl(): FormControl;
72
- /**
73
- * @hidden
74
- */
75
- handleClick(): void;
76
72
  /**
77
73
  * @hidden
78
74
  */
@@ -454,6 +450,7 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
454
450
  private isContentInit;
455
451
  constructor(injector: Injector, wrapper: ElementRef, popupService: PopupService, renderer: Renderer2, navigationService: NavigationService, _zone: NgZone, localization: LocalizationService, cdr: ChangeDetectorRef, lookup: MultiSelectTreeLookupService, touchEnabled: boolean);
456
452
  ngOnInit(): void;
453
+ ngAfterViewInit(): void;
457
454
  /**
458
455
  * @hidden
459
456
  */
@@ -581,6 +578,7 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
581
578
  private triggerPopupEvents;
582
579
  private createPopup;
583
580
  private destroyPopup;
581
+ private handleClick;
584
582
  private subscribeEvents;
585
583
  private subscribeFocusEvents;
586
584
  private unSubscribeFocusEvents;
@@ -2,7 +2,7 @@
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 { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostBinding, Input, Output, NgZone, Renderer2, TemplateRef, ViewChild, ChangeDetectorRef, ContentChild, forwardRef, ViewContainerRef, isDevMode, Optional, Inject, HostListener, Injector } from '@angular/core';
5
+ import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostBinding, Input, Output, NgZone, Renderer2, TemplateRef, ViewChild, ChangeDetectorRef, ContentChild, forwardRef, ViewContainerRef, isDevMode, Optional, Inject, Injector } from '@angular/core';
6
6
  import { anyChanged, guid, hasObservers, isDocumentAvailable, KendoInput } from '@progress/kendo-angular-common';
7
7
  import { PopupService } from '@progress/kendo-angular-popup';
8
8
  import { TreeViewComponent, DataBoundComponent, ExpandableComponent } from '@progress/kendo-angular-treeview';
@@ -256,27 +256,6 @@ export class DropDownTreeComponent {
256
256
  get isReadonly() {
257
257
  return this.readonly ? '' : null;
258
258
  }
259
- /**
260
- * @hidden
261
- */
262
- handleClick() {
263
- this.togglePopup(!this.isOpen);
264
- }
265
- /**
266
- * @hidden
267
- */
268
- handleKeydown(event) {
269
- if (this.disabled || this.readonly) {
270
- return;
271
- }
272
- if (isLetter(event.key)) {
273
- this.printableCharacters.next(event.key);
274
- }
275
- const eventData = event;
276
- this.navigationService.process({
277
- originalEvent: eventData
278
- });
279
- }
280
259
  set treeview(treeview) {
281
260
  if (treeview) {
282
261
  if (this.isFocused && !this.filterable || this.touchEnabled) {
@@ -447,6 +426,9 @@ export class DropDownTreeComponent {
447
426
  return 'visible';
448
427
  }
449
428
  }
429
+ get isFilterActive() {
430
+ return this.filterInput && document.activeElement === this.filterInput.nativeElement;
431
+ }
450
432
  /**
451
433
  * @hidden
452
434
  *
@@ -562,6 +544,10 @@ export class DropDownTreeComponent {
562
544
  ngAfterContentChecked() {
563
545
  this.verifySettings();
564
546
  }
547
+ ngAfterViewInit() {
548
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'click', this.handleClick.bind(this)));
549
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
550
+ }
565
551
  /**
566
552
  * @hidden
567
553
  *
@@ -617,17 +603,29 @@ export class DropDownTreeComponent {
617
603
  return;
618
604
  }
619
605
  this.isFocused = false;
606
+ this.togglePopup(false);
620
607
  if (hasObservers(this.onBlur) ||
621
608
  isUntouched(this.wrapper.nativeElement)) {
622
609
  this._zone.run(() => {
623
- this.togglePopup(false);
624
610
  this.onBlur.emit();
625
611
  this.onTouchedCallback();
626
612
  });
627
613
  }
628
- else {
629
- this.togglePopup(false);
614
+ }
615
+ /**
616
+ * @hidden
617
+ */
618
+ handleKeydown(event) {
619
+ if (this.disabled || this.readonly) {
620
+ return;
621
+ }
622
+ if (!this.isFilterActive && isLetter(event.key)) {
623
+ this.printableCharacters.next(event.key);
630
624
  }
625
+ const eventData = event;
626
+ this.navigationService.process({
627
+ originalEvent: eventData
628
+ });
631
629
  }
632
630
  /**
633
631
  * Focuses a specific item of the DropDownTree based on a provided index in the format of `1_1`.
@@ -920,6 +918,14 @@ export class DropDownTreeComponent {
920
918
  }
921
919
  }
922
920
  }
921
+ handleClick(e) {
922
+ // The check is needed otherwise when appended to the component, the popup reopens on click
923
+ // https://github.com/telerik/kendo-angular/issues/3738
924
+ if ((this.popupRef && !this.popupRef.popupElement.contains(e.target))
925
+ || (!this.popupRef && !e.target.className.includes('k-treeview-leaf'))) {
926
+ this.togglePopup(!this.isOpen);
927
+ }
928
+ }
923
929
  handleEscape() {
924
930
  this.togglePopup(false);
925
931
  this.focus();
@@ -953,10 +959,25 @@ export class DropDownTreeComponent {
953
959
  }),
954
960
  this.navigationService.enter
955
961
  .pipe(tap((event) => event.originalEvent.preventDefault()))
956
- .subscribe(() => this.togglePopup(true)),
962
+ .subscribe((e) => {
963
+ // The check is needed otherwise when appended to the component, the popup reopens on click
964
+ // https://github.com/telerik/kendo-angular/issues/3738
965
+ if (e.originalEvent.target === this.wrapper.nativeElement) {
966
+ this.togglePopup(true);
967
+ }
968
+ if (!this.isOpen) {
969
+ this.focus();
970
+ }
971
+ }),
957
972
  this.navigationService.esc
958
973
  .subscribe(() => this.handleEscape()),
959
- this.navigationService.tab.subscribe(() => this.focus()),
974
+ this.navigationService.tab.subscribe(() => {
975
+ this.focus();
976
+ if (this.isOpen) {
977
+ this.treeview.blur();
978
+ this.removeTreeViewFromTabOrder();
979
+ }
980
+ }),
960
981
  this.navigationService.down.subscribe((event) => {
961
982
  if (!this.treeview) {
962
983
  return;
@@ -1044,9 +1065,22 @@ export class DropDownTreeComponent {
1044
1065
  this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('picker', this.fillMode));
1045
1066
  }
1046
1067
  }
1068
+ /**
1069
+ * Remove the `TreeView` from the tab order, otherwise a focus loop between the page elements will occur
1070
+ * and the user will not be able to tab to the rest of the browser elements
1071
+ */
1072
+ removeTreeViewFromTabOrder() {
1073
+ const nodes = this.treeview.element.nativeElement.querySelectorAll('li');
1074
+ nodes.forEach(item => {
1075
+ if (item.getAttribute('tabindex') === '0') {
1076
+ this.lastNodeOnFocus = item;
1077
+ this.lastNodeOnFocus.setAttribute('tabindex', '-1');
1078
+ }
1079
+ });
1080
+ }
1047
1081
  }
1048
1082
  DropDownTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DropDownTreeComponent, deps: [{ token: i0.Injector }, { token: i0.ElementRef }, { token: i1.PopupService }, { token: i2.NavigationService }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i3.LocalizationService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1049
- DropDownTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DropDownTreeComponent, selector: "kendo-dropdowntree", inputs: { loading: "loading", clearButton: "clearButton", data: "data", value: "value", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", hasChildren: "hasChildren", fetchChildren: "fetchChildren", placeholder: "placeholder", popupSettings: "popupSettings", dataItem: "dataItem", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", itemDisabled: "itemDisabled", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", loadOnDemand: "loadOnDemand", filterable: "filterable", filter: "filter", focusableId: "focusableId" }, outputs: { open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", onFocus: "focus", onBlur: "blur", valueChange: "valueChange", filterChange: "filterChange" }, host: { listeners: { "click": "handleClick()", "keydown": "handleKeydown($event)" }, properties: { "class.k-dropdowntree": "this.hostClasses", "class.k-picker": "this.hostClasses", "attr.aria-invalid": "this.hostAriaInvalid", "class.k-disabled": "this.isDisabled", "attr.disabled": "this.isDisabledAttribute", "class.k-loading": "this.isLoading", "attr.aria-busy": "this.isBusy", "attr.aria-controls": "this.hostAriaControls", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-haspopup": "this.ariaHasPopup", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "attr.readonly": "this.isReadonly" } }, providers: [
1083
+ DropDownTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DropDownTreeComponent, selector: "kendo-dropdowntree", inputs: { loading: "loading", clearButton: "clearButton", data: "data", value: "value", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", hasChildren: "hasChildren", fetchChildren: "fetchChildren", placeholder: "placeholder", popupSettings: "popupSettings", dataItem: "dataItem", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", itemDisabled: "itemDisabled", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", loadOnDemand: "loadOnDemand", filterable: "filterable", filter: "filter", focusableId: "focusableId" }, outputs: { open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", onFocus: "focus", onBlur: "blur", valueChange: "valueChange", filterChange: "filterChange" }, host: { properties: { "class.k-dropdowntree": "this.hostClasses", "class.k-picker": "this.hostClasses", "attr.aria-invalid": "this.hostAriaInvalid", "class.k-disabled": "this.isDisabled", "attr.disabled": "this.isDisabledAttribute", "class.k-loading": "this.isLoading", "attr.aria-busy": "this.isBusy", "attr.aria-controls": "this.hostAriaControls", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-haspopup": "this.ariaHasPopup", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "attr.readonly": "this.isReadonly" } }, providers: [
1050
1084
  DataService,
1051
1085
  SelectionService,
1052
1086
  NavigationService,
@@ -1461,12 +1495,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1461
1495
  }], isReadonly: [{
1462
1496
  type: HostBinding,
1463
1497
  args: ['attr.readonly']
1464
- }], handleClick: [{
1465
- type: HostListener,
1466
- args: ['click']
1467
- }], handleKeydown: [{
1468
- type: HostListener,
1469
- args: ['keydown', ['$event']]
1470
1498
  }], noDataTemplate: [{
1471
1499
  type: ContentChild,
1472
1500
  args: [NoDataTemplateDirective, { static: false }]
@@ -2,7 +2,7 @@
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 { ChangeDetectorRef, Component, ContentChild, ElementRef, EventEmitter, forwardRef, HostBinding, HostListener, Inject, Injector, Input, isDevMode, NgZone, Optional, Output, Renderer2, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';
5
+ import { ChangeDetectorRef, Component, ContentChild, ElementRef, EventEmitter, forwardRef, HostBinding, Inject, Injector, Input, isDevMode, NgZone, Optional, Output, Renderer2, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';
6
6
  import { NgControl, NG_VALUE_ACCESSOR } from '@angular/forms';
7
7
  import { anyChanged, guid, hasObservers, Keys, KendoInput, isDocumentAvailable } from '@progress/kendo-angular-common';
8
8
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
@@ -295,12 +295,6 @@ export class MultiSelectTreeComponent {
295
295
  const ngControl = this.injector.get(NgControl, null);
296
296
  return ngControl?.control || null;
297
297
  }
298
- /**
299
- * @hidden
300
- */
301
- handleClick() {
302
- this.togglePopup(!this.isOpen);
303
- }
304
298
  /**
305
299
  * @hidden
306
300
  */
@@ -313,7 +307,7 @@ export class MultiSelectTreeComponent {
313
307
  if (this.disabled || this.readonly) {
314
308
  return;
315
309
  }
316
- if (isLetter(event.key)) {
310
+ if (!this.isFilterActive && isLetter(event.key)) {
317
311
  this.printableCharacters.next(event.key);
318
312
  }
319
313
  const eventData = event;
@@ -666,6 +660,10 @@ export class MultiSelectTreeComponent {
666
660
  }));
667
661
  this.setComponentClasses();
668
662
  }
663
+ ngAfterViewInit() {
664
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'click', this.handleClick.bind(this)));
665
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
666
+ }
669
667
  /**
670
668
  * @hidden
671
669
  */
@@ -1092,6 +1090,14 @@ export class MultiSelectTreeComponent {
1092
1090
  }
1093
1091
  }
1094
1092
  }
1093
+ handleClick(e) {
1094
+ // The check is needed otherwise when appended to the component, the popup reopens on click
1095
+ // https://github.com/telerik/kendo-angular/issues/3738
1096
+ if ((this.popupRef && this.popupRef.popupElement.contains(e.target))) {
1097
+ return;
1098
+ }
1099
+ this.togglePopup(!this.isOpen);
1100
+ }
1095
1101
  subscribeEvents() {
1096
1102
  [
1097
1103
  this.navigationService.open.subscribe((event) => {
@@ -1359,7 +1365,7 @@ export class MultiSelectTreeComponent {
1359
1365
  }
1360
1366
  }
1361
1367
  MultiSelectTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MultiSelectTreeComponent, deps: [{ token: i0.Injector }, { token: i0.ElementRef }, { token: i1.PopupService }, { token: i0.Renderer2 }, { token: i2.NavigationService }, { token: i0.NgZone }, { token: i3.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i4.MultiSelectTreeLookupService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1362
- MultiSelectTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectTreeComponent, selector: "kendo-multiselecttree", inputs: { tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", popupSettings: "popupSettings", checkableSettings: "checkableSettings", data: "data", value: "value", dataItems: "dataItems", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", loading: "loading", placeholder: "placeholder", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", loadOnDemand: "loadOnDemand", focusableId: "focusableId", clearButton: "clearButton", filterable: "filterable", checkAll: "checkAll", hasChildren: "hasChildren", fetchChildren: "fetchChildren", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", itemDisabled: "itemDisabled", tagMapper: "tagMapper" }, outputs: { onFocus: "focus", onBlur: "blur", open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", valueChange: "valueChange", removeTag: "removeTag", filterChange: "filterChange" }, host: { listeners: { "click": "handleClick()", "keydown": "handleKeydown($event)" }, properties: { "class.k-multiselect-tree": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.isDisabled", "attr.aria-disabled": "this.isDisabled", "attr.aria-controls": "this.hostAriaControls", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "class.k-loading": "this.isLoading", "attr.aria-invalid": "this.hostAriaInvalid", "attr.aria-busy": "this.isBusy", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-haspopup": "this.ariaHasPopup", "attr.readonly": "this.isReadonly", "attr.aria-describedby": "this.ariaDescribedBy", "attr.aria-activedescendant": "this.ariaActiveDescendant" } }, providers: [
1368
+ MultiSelectTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectTreeComponent, selector: "kendo-multiselecttree", inputs: { tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", popupSettings: "popupSettings", checkableSettings: "checkableSettings", data: "data", value: "value", dataItems: "dataItems", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", loading: "loading", placeholder: "placeholder", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", loadOnDemand: "loadOnDemand", focusableId: "focusableId", clearButton: "clearButton", filterable: "filterable", checkAll: "checkAll", hasChildren: "hasChildren", fetchChildren: "fetchChildren", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", itemDisabled: "itemDisabled", tagMapper: "tagMapper" }, outputs: { onFocus: "focus", onBlur: "blur", open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", valueChange: "valueChange", removeTag: "removeTag", filterChange: "filterChange" }, host: { properties: { "class.k-multiselect-tree": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.isDisabled", "attr.aria-disabled": "this.isDisabled", "attr.aria-controls": "this.hostAriaControls", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "class.k-loading": "this.isLoading", "attr.aria-invalid": "this.hostAriaInvalid", "attr.aria-busy": "this.isBusy", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-haspopup": "this.ariaHasPopup", "attr.readonly": "this.isReadonly", "attr.aria-describedby": "this.ariaDescribedBy", "attr.aria-activedescendant": "this.ariaActiveDescendant" } }, providers: [
1363
1369
  LocalizationService,
1364
1370
  NavigationService,
1365
1371
  DataService,
@@ -1845,12 +1851,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1845
1851
  }], ariaActiveDescendant: [{
1846
1852
  type: HostBinding,
1847
1853
  args: ['attr.aria-activedescendant']
1848
- }], handleClick: [{
1849
- type: HostListener,
1850
- args: ['click']
1851
- }], handleKeydown: [{
1852
- type: HostListener,
1853
- args: ['keydown', ['$event']]
1854
1854
  }], headerTemplate: [{
1855
1855
  type: ContentChild,
1856
1856
  args: [HeaderTemplateDirective, { static: false }]
@@ -4,7 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { guid, isPresent, isArray, isObjectArray, resolveAllValues, selectedIndices, getter, isNumber, isUntouched, inDropDown, getSizeClass, getRoundedClass, getFillModeClass } from '../common/util';
6
6
  import { SearchBarComponent } from '../common/searchbar.component';
7
- import { ViewChild, Renderer2, ViewContainerRef, Component, HostBinding, Input, ElementRef, TemplateRef, Output, EventEmitter, isDevMode, forwardRef, ContentChild, ChangeDetectorRef, KeyValueDiffers, NgZone, Optional, Inject, HostListener } from '@angular/core';
7
+ import { ViewChild, Renderer2, ViewContainerRef, Component, HostBinding, Input, ElementRef, TemplateRef, Output, EventEmitter, isDevMode, forwardRef, ContentChild, ChangeDetectorRef, KeyValueDiffers, NgZone, Optional, Inject } from '@angular/core';
8
8
  import { Subscription, Subject, of, merge } from 'rxjs';
9
9
  import { catchError, filter, map, tap } from 'rxjs/operators';
10
10
  import { isChanged, isDocumentAvailable, KendoInput, hasObservers, anyChanged } from '@progress/kendo-angular-common';
@@ -572,31 +572,6 @@ export class MultiSelectComponent {
572
572
  get isLoading() {
573
573
  return this.loading;
574
574
  }
575
- /**
576
- * @hidden
577
- */
578
- handleKeyboardEvent(event) {
579
- if (this.isFocused && this.isOpen && (event.ctrlKey || event.metaKey) && event.keyCode === Keys.KeyA) {
580
- event.preventDefault();
581
- this.handleSelectAll();
582
- }
583
- }
584
- /**
585
- * @hidden
586
- */
587
- hostMousedown(event) {
588
- const inputElement = this.searchbar.input.nativeElement;
589
- if (event.button === 0) {
590
- if (this.isFocused && this.isOpen && event.target === inputElement) {
591
- return;
592
- }
593
- if (!this.touchEnabled || (this.touchEnabled && event.target.tagName !== 'SPAN')) {
594
- this.searchbar.focus();
595
- }
596
- this.togglePopup(!this.isOpen);
597
- event.preventDefault();
598
- }
599
- }
600
575
  get listContainerClasses() {
601
576
  const containerClasses = ['k-list-container', 'k-reset'];
602
577
  if (this.popupSettings.popupClass) {
@@ -895,6 +870,8 @@ export class MultiSelectComponent {
895
870
  }
896
871
  ngAfterViewInit() {
897
872
  this.searchbar.setInputSize();
873
+ this.observableSubscriptions.add(this.renderer.listen(this.wrapper.nativeElement, 'mousedown', this.handleMousedown.bind(this)));
874
+ this.observableSubscriptions.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
898
875
  }
899
876
  ngOnDestroy() {
900
877
  this._toggle(false);
@@ -1159,6 +1136,30 @@ export class MultiSelectComponent {
1159
1136
  this.clearFilter();
1160
1137
  }
1161
1138
  }
1139
+ handleMousedown(event) {
1140
+ const inputElement = this.searchbar.input.nativeElement;
1141
+ if (event.button === 0) {
1142
+ if (this.isFocused && this.isOpen && event.target === inputElement) {
1143
+ return;
1144
+ }
1145
+ if (!this.touchEnabled || (this.touchEnabled && event.target.tagName !== 'SPAN')) {
1146
+ this.searchbar.focus();
1147
+ }
1148
+ // The check is needed otherwise when appended to the component, the popup reopens on click
1149
+ // https://github.com/telerik/kendo-angular/issues/3738
1150
+ if ((this.popupRef && this.popupRef.popupElement.contains(event.target))) {
1151
+ return;
1152
+ }
1153
+ event.preventDefault();
1154
+ this.togglePopup(!this.isOpen);
1155
+ }
1156
+ }
1157
+ handleKeydown(event) {
1158
+ if (this.isFocused && this.isOpen && (event.ctrlKey || event.metaKey) && event.keyCode === Keys.KeyA) {
1159
+ event.preventDefault();
1160
+ this.handleSelectAll();
1161
+ }
1162
+ }
1162
1163
  handleEnter(event) {
1163
1164
  const service = this.selectionService;
1164
1165
  const focusedIndex = this.selectionService.focused;
@@ -1473,7 +1474,7 @@ export class MultiSelectComponent {
1473
1474
  }
1474
1475
  }
1475
1476
  MultiSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MultiSelectComponent, deps: [{ token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i2.PopupService }, { token: i3.DataService }, { token: i4.SelectionService }, { token: i5.NavigationService }, { token: i6.DisabledItemsService }, { token: i0.ChangeDetectorRef }, { token: i0.KeyValueDiffers }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1476
- MultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectComponent, selector: "kendo-multiselect", inputs: { focusableId: "focusableId", autoClose: "autoClose", loading: "loading", data: "data", value: "value", valueField: "valueField", textField: "textField", tabindex: "tabindex", tabIndex: "tabIndex", size: "size", rounded: "rounded", fillMode: "fillMode", placeholder: "placeholder", disabled: "disabled", itemDisabled: "itemDisabled", checkboxes: "checkboxes", readonly: "readonly", filterable: "filterable", virtual: "virtual", popupSettings: "popupSettings", listHeight: "listHeight", valuePrimitive: "valuePrimitive", clearButton: "clearButton", tagMapper: "tagMapper", allowCustom: "allowCustom", valueNormalizer: "valueNormalizer" }, outputs: { filterChange: "filterChange", valueChange: "valueChange", open: "open", opened: "opened", close: "close", closed: "closed", onFocus: "focus", onBlur: "blur", removeTag: "removeTag" }, host: { listeners: { "keydown": "handleKeyboardEvent($event)", "mousedown": "hostMousedown($event)" }, properties: { "class.k-multiselect": "this.hostClasses", "class.k-input": "this.hostClasses", "attr.dir": "this.dir", "class.k-disabled": "this.disabledClass", "class.k-loading": "this.isLoading" } }, providers: [
1477
+ MultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectComponent, selector: "kendo-multiselect", inputs: { focusableId: "focusableId", autoClose: "autoClose", loading: "loading", data: "data", value: "value", valueField: "valueField", textField: "textField", tabindex: "tabindex", tabIndex: "tabIndex", size: "size", rounded: "rounded", fillMode: "fillMode", placeholder: "placeholder", disabled: "disabled", itemDisabled: "itemDisabled", checkboxes: "checkboxes", readonly: "readonly", filterable: "filterable", virtual: "virtual", popupSettings: "popupSettings", listHeight: "listHeight", valuePrimitive: "valuePrimitive", clearButton: "clearButton", tagMapper: "tagMapper", allowCustom: "allowCustom", valueNormalizer: "valueNormalizer" }, outputs: { filterChange: "filterChange", valueChange: "valueChange", open: "open", opened: "opened", close: "close", closed: "closed", onFocus: "focus", onBlur: "blur", removeTag: "removeTag" }, host: { properties: { "class.k-multiselect": "this.hostClasses", "class.k-input": "this.hostClasses", "attr.dir": "this.dir", "class.k-disabled": "this.disabledClass", "class.k-loading": "this.isLoading" } }, providers: [
1477
1478
  MULTISELECT_VALUE_ACCESSOR,
1478
1479
  DataService,
1479
1480
  SelectionService,
@@ -1932,10 +1933,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1932
1933
  }], isLoading: [{
1933
1934
  type: HostBinding,
1934
1935
  args: ['class.k-loading']
1935
- }], handleKeyboardEvent: [{
1936
- type: HostListener,
1937
- args: ['keydown', ['$event']]
1938
- }], hostMousedown: [{
1939
- type: HostListener,
1940
- args: ['mousedown', ['$event']]
1941
1936
  }] } });
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-dropdowns',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1673607505,
12
+ publishDate: 1673621065,
13
13
  version: '',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
15
15
  };
@@ -32,7 +32,7 @@ const packageMetadata = {
32
32
  name: '@progress/kendo-angular-dropdowns',
33
33
  productName: 'Kendo UI for Angular',
34
34
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
35
- publishDate: 1673607505,
35
+ publishDate: 1673621065,
36
36
  version: '',
37
37
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
38
38
  };
@@ -8093,31 +8093,6 @@ class MultiSelectComponent {
8093
8093
  get isLoading() {
8094
8094
  return this.loading;
8095
8095
  }
8096
- /**
8097
- * @hidden
8098
- */
8099
- handleKeyboardEvent(event) {
8100
- if (this.isFocused && this.isOpen && (event.ctrlKey || event.metaKey) && event.keyCode === Keys.KeyA) {
8101
- event.preventDefault();
8102
- this.handleSelectAll();
8103
- }
8104
- }
8105
- /**
8106
- * @hidden
8107
- */
8108
- hostMousedown(event) {
8109
- const inputElement = this.searchbar.input.nativeElement;
8110
- if (event.button === 0) {
8111
- if (this.isFocused && this.isOpen && event.target === inputElement) {
8112
- return;
8113
- }
8114
- if (!this.touchEnabled || (this.touchEnabled && event.target.tagName !== 'SPAN')) {
8115
- this.searchbar.focus();
8116
- }
8117
- this.togglePopup(!this.isOpen);
8118
- event.preventDefault();
8119
- }
8120
- }
8121
8096
  get listContainerClasses() {
8122
8097
  const containerClasses = ['k-list-container', 'k-reset'];
8123
8098
  if (this.popupSettings.popupClass) {
@@ -8416,6 +8391,8 @@ class MultiSelectComponent {
8416
8391
  }
8417
8392
  ngAfterViewInit() {
8418
8393
  this.searchbar.setInputSize();
8394
+ this.observableSubscriptions.add(this.renderer.listen(this.wrapper.nativeElement, 'mousedown', this.handleMousedown.bind(this)));
8395
+ this.observableSubscriptions.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
8419
8396
  }
8420
8397
  ngOnDestroy() {
8421
8398
  this._toggle(false);
@@ -8680,6 +8657,30 @@ class MultiSelectComponent {
8680
8657
  this.clearFilter();
8681
8658
  }
8682
8659
  }
8660
+ handleMousedown(event) {
8661
+ const inputElement = this.searchbar.input.nativeElement;
8662
+ if (event.button === 0) {
8663
+ if (this.isFocused && this.isOpen && event.target === inputElement) {
8664
+ return;
8665
+ }
8666
+ if (!this.touchEnabled || (this.touchEnabled && event.target.tagName !== 'SPAN')) {
8667
+ this.searchbar.focus();
8668
+ }
8669
+ // The check is needed otherwise when appended to the component, the popup reopens on click
8670
+ // https://github.com/telerik/kendo-angular/issues/3738
8671
+ if ((this.popupRef && this.popupRef.popupElement.contains(event.target))) {
8672
+ return;
8673
+ }
8674
+ event.preventDefault();
8675
+ this.togglePopup(!this.isOpen);
8676
+ }
8677
+ }
8678
+ handleKeydown(event) {
8679
+ if (this.isFocused && this.isOpen && (event.ctrlKey || event.metaKey) && event.keyCode === Keys.KeyA) {
8680
+ event.preventDefault();
8681
+ this.handleSelectAll();
8682
+ }
8683
+ }
8683
8684
  handleEnter(event) {
8684
8685
  const service = this.selectionService;
8685
8686
  const focusedIndex = this.selectionService.focused;
@@ -8994,7 +8995,7 @@ class MultiSelectComponent {
8994
8995
  }
8995
8996
  }
8996
8997
  MultiSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MultiSelectComponent, deps: [{ token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i2.PopupService }, { token: DataService }, { token: SelectionService }, { token: NavigationService }, { token: DisabledItemsService }, { token: i0.ChangeDetectorRef }, { token: i0.KeyValueDiffers }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
8997
- MultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectComponent, selector: "kendo-multiselect", inputs: { focusableId: "focusableId", autoClose: "autoClose", loading: "loading", data: "data", value: "value", valueField: "valueField", textField: "textField", tabindex: "tabindex", tabIndex: "tabIndex", size: "size", rounded: "rounded", fillMode: "fillMode", placeholder: "placeholder", disabled: "disabled", itemDisabled: "itemDisabled", checkboxes: "checkboxes", readonly: "readonly", filterable: "filterable", virtual: "virtual", popupSettings: "popupSettings", listHeight: "listHeight", valuePrimitive: "valuePrimitive", clearButton: "clearButton", tagMapper: "tagMapper", allowCustom: "allowCustom", valueNormalizer: "valueNormalizer" }, outputs: { filterChange: "filterChange", valueChange: "valueChange", open: "open", opened: "opened", close: "close", closed: "closed", onFocus: "focus", onBlur: "blur", removeTag: "removeTag" }, host: { listeners: { "keydown": "handleKeyboardEvent($event)", "mousedown": "hostMousedown($event)" }, properties: { "class.k-multiselect": "this.hostClasses", "class.k-input": "this.hostClasses", "attr.dir": "this.dir", "class.k-disabled": "this.disabledClass", "class.k-loading": "this.isLoading" } }, providers: [
8998
+ MultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectComponent, selector: "kendo-multiselect", inputs: { focusableId: "focusableId", autoClose: "autoClose", loading: "loading", data: "data", value: "value", valueField: "valueField", textField: "textField", tabindex: "tabindex", tabIndex: "tabIndex", size: "size", rounded: "rounded", fillMode: "fillMode", placeholder: "placeholder", disabled: "disabled", itemDisabled: "itemDisabled", checkboxes: "checkboxes", readonly: "readonly", filterable: "filterable", virtual: "virtual", popupSettings: "popupSettings", listHeight: "listHeight", valuePrimitive: "valuePrimitive", clearButton: "clearButton", tagMapper: "tagMapper", allowCustom: "allowCustom", valueNormalizer: "valueNormalizer" }, outputs: { filterChange: "filterChange", valueChange: "valueChange", open: "open", opened: "opened", close: "close", closed: "closed", onFocus: "focus", onBlur: "blur", removeTag: "removeTag" }, host: { properties: { "class.k-multiselect": "this.hostClasses", "class.k-input": "this.hostClasses", "attr.dir": "this.dir", "class.k-disabled": "this.disabledClass", "class.k-loading": "this.isLoading" } }, providers: [
8998
8999
  MULTISELECT_VALUE_ACCESSOR,
8999
9000
  DataService,
9000
9001
  SelectionService,
@@ -9455,12 +9456,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
9455
9456
  }], isLoading: [{
9456
9457
  type: HostBinding,
9457
9458
  args: ['class.k-loading']
9458
- }], handleKeyboardEvent: [{
9459
- type: HostListener,
9460
- args: ['keydown', ['$event']]
9461
- }], hostMousedown: [{
9462
- type: HostListener,
9463
- args: ['mousedown', ['$event']]
9464
9459
  }] } });
9465
9460
 
9466
9461
  /**
@@ -10507,27 +10502,6 @@ class DropDownTreeComponent {
10507
10502
  get isReadonly() {
10508
10503
  return this.readonly ? '' : null;
10509
10504
  }
10510
- /**
10511
- * @hidden
10512
- */
10513
- handleClick() {
10514
- this.togglePopup(!this.isOpen);
10515
- }
10516
- /**
10517
- * @hidden
10518
- */
10519
- handleKeydown(event) {
10520
- if (this.disabled || this.readonly) {
10521
- return;
10522
- }
10523
- if (isLetter(event.key)) {
10524
- this.printableCharacters.next(event.key);
10525
- }
10526
- const eventData = event;
10527
- this.navigationService.process({
10528
- originalEvent: eventData
10529
- });
10530
- }
10531
10505
  set treeview(treeview) {
10532
10506
  if (treeview) {
10533
10507
  if (this.isFocused && !this.filterable || this.touchEnabled) {
@@ -10698,6 +10672,9 @@ class DropDownTreeComponent {
10698
10672
  return 'visible';
10699
10673
  }
10700
10674
  }
10675
+ get isFilterActive() {
10676
+ return this.filterInput && document.activeElement === this.filterInput.nativeElement;
10677
+ }
10701
10678
  /**
10702
10679
  * @hidden
10703
10680
  *
@@ -10813,6 +10790,10 @@ class DropDownTreeComponent {
10813
10790
  ngAfterContentChecked() {
10814
10791
  this.verifySettings();
10815
10792
  }
10793
+ ngAfterViewInit() {
10794
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'click', this.handleClick.bind(this)));
10795
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
10796
+ }
10816
10797
  /**
10817
10798
  * @hidden
10818
10799
  *
@@ -10868,17 +10849,29 @@ class DropDownTreeComponent {
10868
10849
  return;
10869
10850
  }
10870
10851
  this.isFocused = false;
10852
+ this.togglePopup(false);
10871
10853
  if (hasObservers(this.onBlur) ||
10872
10854
  isUntouched(this.wrapper.nativeElement)) {
10873
10855
  this._zone.run(() => {
10874
- this.togglePopup(false);
10875
10856
  this.onBlur.emit();
10876
10857
  this.onTouchedCallback();
10877
10858
  });
10878
10859
  }
10879
- else {
10880
- this.togglePopup(false);
10860
+ }
10861
+ /**
10862
+ * @hidden
10863
+ */
10864
+ handleKeydown(event) {
10865
+ if (this.disabled || this.readonly) {
10866
+ return;
10867
+ }
10868
+ if (!this.isFilterActive && isLetter(event.key)) {
10869
+ this.printableCharacters.next(event.key);
10881
10870
  }
10871
+ const eventData = event;
10872
+ this.navigationService.process({
10873
+ originalEvent: eventData
10874
+ });
10882
10875
  }
10883
10876
  /**
10884
10877
  * Focuses a specific item of the DropDownTree based on a provided index in the format of `1_1`.
@@ -11171,6 +11164,14 @@ class DropDownTreeComponent {
11171
11164
  }
11172
11165
  }
11173
11166
  }
11167
+ handleClick(e) {
11168
+ // The check is needed otherwise when appended to the component, the popup reopens on click
11169
+ // https://github.com/telerik/kendo-angular/issues/3738
11170
+ if ((this.popupRef && !this.popupRef.popupElement.contains(e.target))
11171
+ || (!this.popupRef && !e.target.className.includes('k-treeview-leaf'))) {
11172
+ this.togglePopup(!this.isOpen);
11173
+ }
11174
+ }
11174
11175
  handleEscape() {
11175
11176
  this.togglePopup(false);
11176
11177
  this.focus();
@@ -11204,10 +11205,25 @@ class DropDownTreeComponent {
11204
11205
  }),
11205
11206
  this.navigationService.enter
11206
11207
  .pipe(tap((event) => event.originalEvent.preventDefault()))
11207
- .subscribe(() => this.togglePopup(true)),
11208
+ .subscribe((e) => {
11209
+ // The check is needed otherwise when appended to the component, the popup reopens on click
11210
+ // https://github.com/telerik/kendo-angular/issues/3738
11211
+ if (e.originalEvent.target === this.wrapper.nativeElement) {
11212
+ this.togglePopup(true);
11213
+ }
11214
+ if (!this.isOpen) {
11215
+ this.focus();
11216
+ }
11217
+ }),
11208
11218
  this.navigationService.esc
11209
11219
  .subscribe(() => this.handleEscape()),
11210
- this.navigationService.tab.subscribe(() => this.focus()),
11220
+ this.navigationService.tab.subscribe(() => {
11221
+ this.focus();
11222
+ if (this.isOpen) {
11223
+ this.treeview.blur();
11224
+ this.removeTreeViewFromTabOrder();
11225
+ }
11226
+ }),
11211
11227
  this.navigationService.down.subscribe((event) => {
11212
11228
  if (!this.treeview) {
11213
11229
  return;
@@ -11295,9 +11311,22 @@ class DropDownTreeComponent {
11295
11311
  this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('picker', this.fillMode));
11296
11312
  }
11297
11313
  }
11314
+ /**
11315
+ * Remove the `TreeView` from the tab order, otherwise a focus loop between the page elements will occur
11316
+ * and the user will not be able to tab to the rest of the browser elements
11317
+ */
11318
+ removeTreeViewFromTabOrder() {
11319
+ const nodes = this.treeview.element.nativeElement.querySelectorAll('li');
11320
+ nodes.forEach(item => {
11321
+ if (item.getAttribute('tabindex') === '0') {
11322
+ this.lastNodeOnFocus = item;
11323
+ this.lastNodeOnFocus.setAttribute('tabindex', '-1');
11324
+ }
11325
+ });
11326
+ }
11298
11327
  }
11299
11328
  DropDownTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DropDownTreeComponent, deps: [{ token: i0.Injector }, { token: i0.ElementRef }, { token: i2.PopupService }, { token: NavigationService }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
11300
- DropDownTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DropDownTreeComponent, selector: "kendo-dropdowntree", inputs: { loading: "loading", clearButton: "clearButton", data: "data", value: "value", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", hasChildren: "hasChildren", fetchChildren: "fetchChildren", placeholder: "placeholder", popupSettings: "popupSettings", dataItem: "dataItem", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", itemDisabled: "itemDisabled", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", loadOnDemand: "loadOnDemand", filterable: "filterable", filter: "filter", focusableId: "focusableId" }, outputs: { open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", onFocus: "focus", onBlur: "blur", valueChange: "valueChange", filterChange: "filterChange" }, host: { listeners: { "click": "handleClick()", "keydown": "handleKeydown($event)" }, properties: { "class.k-dropdowntree": "this.hostClasses", "class.k-picker": "this.hostClasses", "attr.aria-invalid": "this.hostAriaInvalid", "class.k-disabled": "this.isDisabled", "attr.disabled": "this.isDisabledAttribute", "class.k-loading": "this.isLoading", "attr.aria-busy": "this.isBusy", "attr.aria-controls": "this.hostAriaControls", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-haspopup": "this.ariaHasPopup", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "attr.readonly": "this.isReadonly" } }, providers: [
11329
+ DropDownTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DropDownTreeComponent, selector: "kendo-dropdowntree", inputs: { loading: "loading", clearButton: "clearButton", data: "data", value: "value", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", hasChildren: "hasChildren", fetchChildren: "fetchChildren", placeholder: "placeholder", popupSettings: "popupSettings", dataItem: "dataItem", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", itemDisabled: "itemDisabled", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", loadOnDemand: "loadOnDemand", filterable: "filterable", filter: "filter", focusableId: "focusableId" }, outputs: { open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", onFocus: "focus", onBlur: "blur", valueChange: "valueChange", filterChange: "filterChange" }, host: { properties: { "class.k-dropdowntree": "this.hostClasses", "class.k-picker": "this.hostClasses", "attr.aria-invalid": "this.hostAriaInvalid", "class.k-disabled": "this.isDisabled", "attr.disabled": "this.isDisabledAttribute", "class.k-loading": "this.isLoading", "attr.aria-busy": "this.isBusy", "attr.aria-controls": "this.hostAriaControls", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-haspopup": "this.ariaHasPopup", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "attr.readonly": "this.isReadonly" } }, providers: [
11301
11330
  DataService,
11302
11331
  SelectionService,
11303
11332
  NavigationService,
@@ -11714,12 +11743,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
11714
11743
  }], isReadonly: [{
11715
11744
  type: HostBinding,
11716
11745
  args: ['attr.readonly']
11717
- }], handleClick: [{
11718
- type: HostListener,
11719
- args: ['click']
11720
- }], handleKeydown: [{
11721
- type: HostListener,
11722
- args: ['keydown', ['$event']]
11723
11746
  }], noDataTemplate: [{
11724
11747
  type: ContentChild,
11725
11748
  args: [NoDataTemplateDirective, { static: false }]
@@ -12504,12 +12527,6 @@ class MultiSelectTreeComponent {
12504
12527
  const ngControl = this.injector.get(NgControl, null);
12505
12528
  return (ngControl === null || ngControl === void 0 ? void 0 : ngControl.control) || null;
12506
12529
  }
12507
- /**
12508
- * @hidden
12509
- */
12510
- handleClick() {
12511
- this.togglePopup(!this.isOpen);
12512
- }
12513
12530
  /**
12514
12531
  * @hidden
12515
12532
  */
@@ -12523,7 +12540,7 @@ class MultiSelectTreeComponent {
12523
12540
  if (this.disabled || this.readonly) {
12524
12541
  return;
12525
12542
  }
12526
- if (isLetter(event.key)) {
12543
+ if (!this.isFilterActive && isLetter(event.key)) {
12527
12544
  this.printableCharacters.next(event.key);
12528
12545
  }
12529
12546
  const eventData = event;
@@ -12876,6 +12893,10 @@ class MultiSelectTreeComponent {
12876
12893
  }));
12877
12894
  this.setComponentClasses();
12878
12895
  }
12896
+ ngAfterViewInit() {
12897
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'click', this.handleClick.bind(this)));
12898
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
12899
+ }
12879
12900
  /**
12880
12901
  * @hidden
12881
12902
  */
@@ -13298,6 +13319,14 @@ class MultiSelectTreeComponent {
13298
13319
  }
13299
13320
  }
13300
13321
  }
13322
+ handleClick(e) {
13323
+ // The check is needed otherwise when appended to the component, the popup reopens on click
13324
+ // https://github.com/telerik/kendo-angular/issues/3738
13325
+ if ((this.popupRef && this.popupRef.popupElement.contains(e.target))) {
13326
+ return;
13327
+ }
13328
+ this.togglePopup(!this.isOpen);
13329
+ }
13301
13330
  subscribeEvents() {
13302
13331
  [
13303
13332
  this.navigationService.open.subscribe((event) => {
@@ -13565,7 +13594,7 @@ class MultiSelectTreeComponent {
13565
13594
  }
13566
13595
  }
13567
13596
  MultiSelectTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MultiSelectTreeComponent, deps: [{ token: i0.Injector }, { token: i0.ElementRef }, { token: i2.PopupService }, { token: i0.Renderer2 }, { token: NavigationService }, { token: i0.NgZone }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: MultiSelectTreeLookupService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
13568
- MultiSelectTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectTreeComponent, selector: "kendo-multiselecttree", inputs: { tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", popupSettings: "popupSettings", checkableSettings: "checkableSettings", data: "data", value: "value", dataItems: "dataItems", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", loading: "loading", placeholder: "placeholder", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", loadOnDemand: "loadOnDemand", focusableId: "focusableId", clearButton: "clearButton", filterable: "filterable", checkAll: "checkAll", hasChildren: "hasChildren", fetchChildren: "fetchChildren", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", itemDisabled: "itemDisabled", tagMapper: "tagMapper" }, outputs: { onFocus: "focus", onBlur: "blur", open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", valueChange: "valueChange", removeTag: "removeTag", filterChange: "filterChange" }, host: { listeners: { "click": "handleClick()", "keydown": "handleKeydown($event)" }, properties: { "class.k-multiselect-tree": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.isDisabled", "attr.aria-disabled": "this.isDisabled", "attr.aria-controls": "this.hostAriaControls", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "class.k-loading": "this.isLoading", "attr.aria-invalid": "this.hostAriaInvalid", "attr.aria-busy": "this.isBusy", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-haspopup": "this.ariaHasPopup", "attr.readonly": "this.isReadonly", "attr.aria-describedby": "this.ariaDescribedBy", "attr.aria-activedescendant": "this.ariaActiveDescendant" } }, providers: [
13597
+ MultiSelectTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectTreeComponent, selector: "kendo-multiselecttree", inputs: { tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", popupSettings: "popupSettings", checkableSettings: "checkableSettings", data: "data", value: "value", dataItems: "dataItems", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", loading: "loading", placeholder: "placeholder", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", loadOnDemand: "loadOnDemand", focusableId: "focusableId", clearButton: "clearButton", filterable: "filterable", checkAll: "checkAll", hasChildren: "hasChildren", fetchChildren: "fetchChildren", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", itemDisabled: "itemDisabled", tagMapper: "tagMapper" }, outputs: { onFocus: "focus", onBlur: "blur", open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", valueChange: "valueChange", removeTag: "removeTag", filterChange: "filterChange" }, host: { properties: { "class.k-multiselect-tree": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.isDisabled", "attr.aria-disabled": "this.isDisabled", "attr.aria-controls": "this.hostAriaControls", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "class.k-loading": "this.isLoading", "attr.aria-invalid": "this.hostAriaInvalid", "attr.aria-busy": "this.isBusy", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-haspopup": "this.ariaHasPopup", "attr.readonly": "this.isReadonly", "attr.aria-describedby": "this.ariaDescribedBy", "attr.aria-activedescendant": "this.ariaActiveDescendant" } }, providers: [
13569
13598
  LocalizationService,
13570
13599
  NavigationService,
13571
13600
  DataService,
@@ -14053,12 +14082,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
14053
14082
  }], ariaActiveDescendant: [{
14054
14083
  type: HostBinding,
14055
14084
  args: ['attr.aria-activedescendant']
14056
- }], handleClick: [{
14057
- type: HostListener,
14058
- args: ['click']
14059
- }], handleKeydown: [{
14060
- type: HostListener,
14061
- args: ['keydown', ['$event']]
14062
14085
  }], headerTemplate: [{
14063
14086
  type: ContentChild,
14064
14087
  args: [HeaderTemplateDirective, { static: false }]
@@ -32,7 +32,7 @@ const packageMetadata = {
32
32
  name: '@progress/kendo-angular-dropdowns',
33
33
  productName: 'Kendo UI for Angular',
34
34
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
35
- publishDate: 1673607505,
35
+ publishDate: 1673621065,
36
36
  version: '',
37
37
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
38
38
  };
@@ -8086,31 +8086,6 @@ class MultiSelectComponent {
8086
8086
  get isLoading() {
8087
8087
  return this.loading;
8088
8088
  }
8089
- /**
8090
- * @hidden
8091
- */
8092
- handleKeyboardEvent(event) {
8093
- if (this.isFocused && this.isOpen && (event.ctrlKey || event.metaKey) && event.keyCode === Keys.KeyA) {
8094
- event.preventDefault();
8095
- this.handleSelectAll();
8096
- }
8097
- }
8098
- /**
8099
- * @hidden
8100
- */
8101
- hostMousedown(event) {
8102
- const inputElement = this.searchbar.input.nativeElement;
8103
- if (event.button === 0) {
8104
- if (this.isFocused && this.isOpen && event.target === inputElement) {
8105
- return;
8106
- }
8107
- if (!this.touchEnabled || (this.touchEnabled && event.target.tagName !== 'SPAN')) {
8108
- this.searchbar.focus();
8109
- }
8110
- this.togglePopup(!this.isOpen);
8111
- event.preventDefault();
8112
- }
8113
- }
8114
8089
  get listContainerClasses() {
8115
8090
  const containerClasses = ['k-list-container', 'k-reset'];
8116
8091
  if (this.popupSettings.popupClass) {
@@ -8409,6 +8384,8 @@ class MultiSelectComponent {
8409
8384
  }
8410
8385
  ngAfterViewInit() {
8411
8386
  this.searchbar.setInputSize();
8387
+ this.observableSubscriptions.add(this.renderer.listen(this.wrapper.nativeElement, 'mousedown', this.handleMousedown.bind(this)));
8388
+ this.observableSubscriptions.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
8412
8389
  }
8413
8390
  ngOnDestroy() {
8414
8391
  this._toggle(false);
@@ -8673,6 +8650,30 @@ class MultiSelectComponent {
8673
8650
  this.clearFilter();
8674
8651
  }
8675
8652
  }
8653
+ handleMousedown(event) {
8654
+ const inputElement = this.searchbar.input.nativeElement;
8655
+ if (event.button === 0) {
8656
+ if (this.isFocused && this.isOpen && event.target === inputElement) {
8657
+ return;
8658
+ }
8659
+ if (!this.touchEnabled || (this.touchEnabled && event.target.tagName !== 'SPAN')) {
8660
+ this.searchbar.focus();
8661
+ }
8662
+ // The check is needed otherwise when appended to the component, the popup reopens on click
8663
+ // https://github.com/telerik/kendo-angular/issues/3738
8664
+ if ((this.popupRef && this.popupRef.popupElement.contains(event.target))) {
8665
+ return;
8666
+ }
8667
+ event.preventDefault();
8668
+ this.togglePopup(!this.isOpen);
8669
+ }
8670
+ }
8671
+ handleKeydown(event) {
8672
+ if (this.isFocused && this.isOpen && (event.ctrlKey || event.metaKey) && event.keyCode === Keys.KeyA) {
8673
+ event.preventDefault();
8674
+ this.handleSelectAll();
8675
+ }
8676
+ }
8676
8677
  handleEnter(event) {
8677
8678
  const service = this.selectionService;
8678
8679
  const focusedIndex = this.selectionService.focused;
@@ -8987,7 +8988,7 @@ class MultiSelectComponent {
8987
8988
  }
8988
8989
  }
8989
8990
  MultiSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MultiSelectComponent, deps: [{ token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i2.PopupService }, { token: DataService }, { token: SelectionService }, { token: NavigationService }, { token: DisabledItemsService }, { token: i0.ChangeDetectorRef }, { token: i0.KeyValueDiffers }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
8990
- MultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectComponent, selector: "kendo-multiselect", inputs: { focusableId: "focusableId", autoClose: "autoClose", loading: "loading", data: "data", value: "value", valueField: "valueField", textField: "textField", tabindex: "tabindex", tabIndex: "tabIndex", size: "size", rounded: "rounded", fillMode: "fillMode", placeholder: "placeholder", disabled: "disabled", itemDisabled: "itemDisabled", checkboxes: "checkboxes", readonly: "readonly", filterable: "filterable", virtual: "virtual", popupSettings: "popupSettings", listHeight: "listHeight", valuePrimitive: "valuePrimitive", clearButton: "clearButton", tagMapper: "tagMapper", allowCustom: "allowCustom", valueNormalizer: "valueNormalizer" }, outputs: { filterChange: "filterChange", valueChange: "valueChange", open: "open", opened: "opened", close: "close", closed: "closed", onFocus: "focus", onBlur: "blur", removeTag: "removeTag" }, host: { listeners: { "keydown": "handleKeyboardEvent($event)", "mousedown": "hostMousedown($event)" }, properties: { "class.k-multiselect": "this.hostClasses", "class.k-input": "this.hostClasses", "attr.dir": "this.dir", "class.k-disabled": "this.disabledClass", "class.k-loading": "this.isLoading" } }, providers: [
8991
+ MultiSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectComponent, selector: "kendo-multiselect", inputs: { focusableId: "focusableId", autoClose: "autoClose", loading: "loading", data: "data", value: "value", valueField: "valueField", textField: "textField", tabindex: "tabindex", tabIndex: "tabIndex", size: "size", rounded: "rounded", fillMode: "fillMode", placeholder: "placeholder", disabled: "disabled", itemDisabled: "itemDisabled", checkboxes: "checkboxes", readonly: "readonly", filterable: "filterable", virtual: "virtual", popupSettings: "popupSettings", listHeight: "listHeight", valuePrimitive: "valuePrimitive", clearButton: "clearButton", tagMapper: "tagMapper", allowCustom: "allowCustom", valueNormalizer: "valueNormalizer" }, outputs: { filterChange: "filterChange", valueChange: "valueChange", open: "open", opened: "opened", close: "close", closed: "closed", onFocus: "focus", onBlur: "blur", removeTag: "removeTag" }, host: { properties: { "class.k-multiselect": "this.hostClasses", "class.k-input": "this.hostClasses", "attr.dir": "this.dir", "class.k-disabled": "this.disabledClass", "class.k-loading": "this.isLoading" } }, providers: [
8991
8992
  MULTISELECT_VALUE_ACCESSOR,
8992
8993
  DataService,
8993
8994
  SelectionService,
@@ -9446,12 +9447,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
9446
9447
  }], isLoading: [{
9447
9448
  type: HostBinding,
9448
9449
  args: ['class.k-loading']
9449
- }], handleKeyboardEvent: [{
9450
- type: HostListener,
9451
- args: ['keydown', ['$event']]
9452
- }], hostMousedown: [{
9453
- type: HostListener,
9454
- args: ['mousedown', ['$event']]
9455
9450
  }] } });
9456
9451
 
9457
9452
  /**
@@ -10496,27 +10491,6 @@ class DropDownTreeComponent {
10496
10491
  get isReadonly() {
10497
10492
  return this.readonly ? '' : null;
10498
10493
  }
10499
- /**
10500
- * @hidden
10501
- */
10502
- handleClick() {
10503
- this.togglePopup(!this.isOpen);
10504
- }
10505
- /**
10506
- * @hidden
10507
- */
10508
- handleKeydown(event) {
10509
- if (this.disabled || this.readonly) {
10510
- return;
10511
- }
10512
- if (isLetter(event.key)) {
10513
- this.printableCharacters.next(event.key);
10514
- }
10515
- const eventData = event;
10516
- this.navigationService.process({
10517
- originalEvent: eventData
10518
- });
10519
- }
10520
10494
  set treeview(treeview) {
10521
10495
  if (treeview) {
10522
10496
  if (this.isFocused && !this.filterable || this.touchEnabled) {
@@ -10687,6 +10661,9 @@ class DropDownTreeComponent {
10687
10661
  return 'visible';
10688
10662
  }
10689
10663
  }
10664
+ get isFilterActive() {
10665
+ return this.filterInput && document.activeElement === this.filterInput.nativeElement;
10666
+ }
10690
10667
  /**
10691
10668
  * @hidden
10692
10669
  *
@@ -10802,6 +10779,10 @@ class DropDownTreeComponent {
10802
10779
  ngAfterContentChecked() {
10803
10780
  this.verifySettings();
10804
10781
  }
10782
+ ngAfterViewInit() {
10783
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'click', this.handleClick.bind(this)));
10784
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
10785
+ }
10805
10786
  /**
10806
10787
  * @hidden
10807
10788
  *
@@ -10857,17 +10838,29 @@ class DropDownTreeComponent {
10857
10838
  return;
10858
10839
  }
10859
10840
  this.isFocused = false;
10841
+ this.togglePopup(false);
10860
10842
  if (hasObservers(this.onBlur) ||
10861
10843
  isUntouched(this.wrapper.nativeElement)) {
10862
10844
  this._zone.run(() => {
10863
- this.togglePopup(false);
10864
10845
  this.onBlur.emit();
10865
10846
  this.onTouchedCallback();
10866
10847
  });
10867
10848
  }
10868
- else {
10869
- this.togglePopup(false);
10849
+ }
10850
+ /**
10851
+ * @hidden
10852
+ */
10853
+ handleKeydown(event) {
10854
+ if (this.disabled || this.readonly) {
10855
+ return;
10856
+ }
10857
+ if (!this.isFilterActive && isLetter(event.key)) {
10858
+ this.printableCharacters.next(event.key);
10870
10859
  }
10860
+ const eventData = event;
10861
+ this.navigationService.process({
10862
+ originalEvent: eventData
10863
+ });
10871
10864
  }
10872
10865
  /**
10873
10866
  * Focuses a specific item of the DropDownTree based on a provided index in the format of `1_1`.
@@ -11160,6 +11153,14 @@ class DropDownTreeComponent {
11160
11153
  }
11161
11154
  }
11162
11155
  }
11156
+ handleClick(e) {
11157
+ // The check is needed otherwise when appended to the component, the popup reopens on click
11158
+ // https://github.com/telerik/kendo-angular/issues/3738
11159
+ if ((this.popupRef && !this.popupRef.popupElement.contains(e.target))
11160
+ || (!this.popupRef && !e.target.className.includes('k-treeview-leaf'))) {
11161
+ this.togglePopup(!this.isOpen);
11162
+ }
11163
+ }
11163
11164
  handleEscape() {
11164
11165
  this.togglePopup(false);
11165
11166
  this.focus();
@@ -11193,10 +11194,25 @@ class DropDownTreeComponent {
11193
11194
  }),
11194
11195
  this.navigationService.enter
11195
11196
  .pipe(tap((event) => event.originalEvent.preventDefault()))
11196
- .subscribe(() => this.togglePopup(true)),
11197
+ .subscribe((e) => {
11198
+ // The check is needed otherwise when appended to the component, the popup reopens on click
11199
+ // https://github.com/telerik/kendo-angular/issues/3738
11200
+ if (e.originalEvent.target === this.wrapper.nativeElement) {
11201
+ this.togglePopup(true);
11202
+ }
11203
+ if (!this.isOpen) {
11204
+ this.focus();
11205
+ }
11206
+ }),
11197
11207
  this.navigationService.esc
11198
11208
  .subscribe(() => this.handleEscape()),
11199
- this.navigationService.tab.subscribe(() => this.focus()),
11209
+ this.navigationService.tab.subscribe(() => {
11210
+ this.focus();
11211
+ if (this.isOpen) {
11212
+ this.treeview.blur();
11213
+ this.removeTreeViewFromTabOrder();
11214
+ }
11215
+ }),
11200
11216
  this.navigationService.down.subscribe((event) => {
11201
11217
  if (!this.treeview) {
11202
11218
  return;
@@ -11284,9 +11300,22 @@ class DropDownTreeComponent {
11284
11300
  this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('picker', this.fillMode));
11285
11301
  }
11286
11302
  }
11303
+ /**
11304
+ * Remove the `TreeView` from the tab order, otherwise a focus loop between the page elements will occur
11305
+ * and the user will not be able to tab to the rest of the browser elements
11306
+ */
11307
+ removeTreeViewFromTabOrder() {
11308
+ const nodes = this.treeview.element.nativeElement.querySelectorAll('li');
11309
+ nodes.forEach(item => {
11310
+ if (item.getAttribute('tabindex') === '0') {
11311
+ this.lastNodeOnFocus = item;
11312
+ this.lastNodeOnFocus.setAttribute('tabindex', '-1');
11313
+ }
11314
+ });
11315
+ }
11287
11316
  }
11288
11317
  DropDownTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DropDownTreeComponent, deps: [{ token: i0.Injector }, { token: i0.ElementRef }, { token: i2.PopupService }, { token: NavigationService }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
11289
- DropDownTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DropDownTreeComponent, selector: "kendo-dropdowntree", inputs: { loading: "loading", clearButton: "clearButton", data: "data", value: "value", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", hasChildren: "hasChildren", fetchChildren: "fetchChildren", placeholder: "placeholder", popupSettings: "popupSettings", dataItem: "dataItem", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", itemDisabled: "itemDisabled", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", loadOnDemand: "loadOnDemand", filterable: "filterable", filter: "filter", focusableId: "focusableId" }, outputs: { open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", onFocus: "focus", onBlur: "blur", valueChange: "valueChange", filterChange: "filterChange" }, host: { listeners: { "click": "handleClick()", "keydown": "handleKeydown($event)" }, properties: { "class.k-dropdowntree": "this.hostClasses", "class.k-picker": "this.hostClasses", "attr.aria-invalid": "this.hostAriaInvalid", "class.k-disabled": "this.isDisabled", "attr.disabled": "this.isDisabledAttribute", "class.k-loading": "this.isLoading", "attr.aria-busy": "this.isBusy", "attr.aria-controls": "this.hostAriaControls", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-haspopup": "this.ariaHasPopup", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "attr.readonly": "this.isReadonly" } }, providers: [
11318
+ DropDownTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: DropDownTreeComponent, selector: "kendo-dropdowntree", inputs: { loading: "loading", clearButton: "clearButton", data: "data", value: "value", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", hasChildren: "hasChildren", fetchChildren: "fetchChildren", placeholder: "placeholder", popupSettings: "popupSettings", dataItem: "dataItem", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", itemDisabled: "itemDisabled", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", loadOnDemand: "loadOnDemand", filterable: "filterable", filter: "filter", focusableId: "focusableId" }, outputs: { open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", onFocus: "focus", onBlur: "blur", valueChange: "valueChange", filterChange: "filterChange" }, host: { properties: { "class.k-dropdowntree": "this.hostClasses", "class.k-picker": "this.hostClasses", "attr.aria-invalid": "this.hostAriaInvalid", "class.k-disabled": "this.isDisabled", "attr.disabled": "this.isDisabledAttribute", "class.k-loading": "this.isLoading", "attr.aria-busy": "this.isBusy", "attr.aria-controls": "this.hostAriaControls", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-haspopup": "this.ariaHasPopup", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "attr.readonly": "this.isReadonly" } }, providers: [
11290
11319
  DataService,
11291
11320
  SelectionService,
11292
11321
  NavigationService,
@@ -11701,12 +11730,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
11701
11730
  }], isReadonly: [{
11702
11731
  type: HostBinding,
11703
11732
  args: ['attr.readonly']
11704
- }], handleClick: [{
11705
- type: HostListener,
11706
- args: ['click']
11707
- }], handleKeydown: [{
11708
- type: HostListener,
11709
- args: ['keydown', ['$event']]
11710
11733
  }], noDataTemplate: [{
11711
11734
  type: ContentChild,
11712
11735
  args: [NoDataTemplateDirective, { static: false }]
@@ -12491,12 +12514,6 @@ class MultiSelectTreeComponent {
12491
12514
  const ngControl = this.injector.get(NgControl, null);
12492
12515
  return ngControl?.control || null;
12493
12516
  }
12494
- /**
12495
- * @hidden
12496
- */
12497
- handleClick() {
12498
- this.togglePopup(!this.isOpen);
12499
- }
12500
12517
  /**
12501
12518
  * @hidden
12502
12519
  */
@@ -12509,7 +12526,7 @@ class MultiSelectTreeComponent {
12509
12526
  if (this.disabled || this.readonly) {
12510
12527
  return;
12511
12528
  }
12512
- if (isLetter(event.key)) {
12529
+ if (!this.isFilterActive && isLetter(event.key)) {
12513
12530
  this.printableCharacters.next(event.key);
12514
12531
  }
12515
12532
  const eventData = event;
@@ -12862,6 +12879,10 @@ class MultiSelectTreeComponent {
12862
12879
  }));
12863
12880
  this.setComponentClasses();
12864
12881
  }
12882
+ ngAfterViewInit() {
12883
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'click', this.handleClick.bind(this)));
12884
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
12885
+ }
12865
12886
  /**
12866
12887
  * @hidden
12867
12888
  */
@@ -13288,6 +13309,14 @@ class MultiSelectTreeComponent {
13288
13309
  }
13289
13310
  }
13290
13311
  }
13312
+ handleClick(e) {
13313
+ // The check is needed otherwise when appended to the component, the popup reopens on click
13314
+ // https://github.com/telerik/kendo-angular/issues/3738
13315
+ if ((this.popupRef && this.popupRef.popupElement.contains(e.target))) {
13316
+ return;
13317
+ }
13318
+ this.togglePopup(!this.isOpen);
13319
+ }
13291
13320
  subscribeEvents() {
13292
13321
  [
13293
13322
  this.navigationService.open.subscribe((event) => {
@@ -13555,7 +13584,7 @@ class MultiSelectTreeComponent {
13555
13584
  }
13556
13585
  }
13557
13586
  MultiSelectTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: MultiSelectTreeComponent, deps: [{ token: i0.Injector }, { token: i0.ElementRef }, { token: i2.PopupService }, { token: i0.Renderer2 }, { token: NavigationService }, { token: i0.NgZone }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: MultiSelectTreeLookupService }, { token: TOUCH_ENABLED, optional: true }], target: i0.ɵɵFactoryTarget.Component });
13558
- MultiSelectTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectTreeComponent, selector: "kendo-multiselecttree", inputs: { tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", popupSettings: "popupSettings", checkableSettings: "checkableSettings", data: "data", value: "value", dataItems: "dataItems", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", loading: "loading", placeholder: "placeholder", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", loadOnDemand: "loadOnDemand", focusableId: "focusableId", clearButton: "clearButton", filterable: "filterable", checkAll: "checkAll", hasChildren: "hasChildren", fetchChildren: "fetchChildren", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", itemDisabled: "itemDisabled", tagMapper: "tagMapper" }, outputs: { onFocus: "focus", onBlur: "blur", open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", valueChange: "valueChange", removeTag: "removeTag", filterChange: "filterChange" }, host: { listeners: { "click": "handleClick()", "keydown": "handleKeydown($event)" }, properties: { "class.k-multiselect-tree": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.isDisabled", "attr.aria-disabled": "this.isDisabled", "attr.aria-controls": "this.hostAriaControls", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "class.k-loading": "this.isLoading", "attr.aria-invalid": "this.hostAriaInvalid", "attr.aria-busy": "this.isBusy", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-haspopup": "this.ariaHasPopup", "attr.readonly": "this.isReadonly", "attr.aria-describedby": "this.ariaDescribedBy", "attr.aria-activedescendant": "this.ariaActiveDescendant" } }, providers: [
13587
+ MultiSelectTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: MultiSelectTreeComponent, selector: "kendo-multiselecttree", inputs: { tabindex: "tabindex", size: "size", rounded: "rounded", fillMode: "fillMode", popupSettings: "popupSettings", checkableSettings: "checkableSettings", data: "data", value: "value", dataItems: "dataItems", textField: "textField", valueField: "valueField", valueDepth: "valueDepth", loading: "loading", placeholder: "placeholder", listHeight: "listHeight", disabled: "disabled", readonly: "readonly", valuePrimitive: "valuePrimitive", loadOnDemand: "loadOnDemand", focusableId: "focusableId", clearButton: "clearButton", filterable: "filterable", checkAll: "checkAll", hasChildren: "hasChildren", fetchChildren: "fetchChildren", isNodeExpanded: "isNodeExpanded", isNodeVisible: "isNodeVisible", itemDisabled: "itemDisabled", tagMapper: "tagMapper" }, outputs: { onFocus: "focus", onBlur: "blur", open: "open", opened: "opened", close: "close", closed: "closed", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", valueChange: "valueChange", removeTag: "removeTag", filterChange: "filterChange" }, host: { properties: { "class.k-multiselect-tree": "this.hostClasses", "class.k-input": "this.hostClasses", "class.k-disabled": "this.isDisabled", "attr.aria-disabled": "this.isDisabled", "attr.aria-controls": "this.hostAriaControls", "attr.aria-autocomplete": "this.hostAriaAutocomplete", "class.k-loading": "this.isLoading", "attr.aria-invalid": "this.hostAriaInvalid", "attr.aria-busy": "this.isBusy", "attr.id": "this.id", "attr.dir": "this.direction", "attr.tabindex": "this.hostTabIndex", "attr.role": "this.role", "attr.aria-expanded": "this.isAriaExpanded", "attr.aria-haspopup": "this.ariaHasPopup", "attr.readonly": "this.isReadonly", "attr.aria-describedby": "this.ariaDescribedBy", "attr.aria-activedescendant": "this.ariaActiveDescendant" } }, providers: [
13559
13588
  LocalizationService,
13560
13589
  NavigationService,
13561
13590
  DataService,
@@ -14041,12 +14070,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
14041
14070
  }], ariaActiveDescendant: [{
14042
14071
  type: HostBinding,
14043
14072
  args: ['attr.aria-activedescendant']
14044
- }], handleClick: [{
14045
- type: HostListener,
14046
- args: ['click']
14047
- }], handleKeydown: [{
14048
- type: HostListener,
14049
- args: ['keydown', ['$event']]
14050
14073
  }], headerTemplate: [{
14051
14074
  type: ContentChild,
14052
14075
  args: [HeaderTemplateDirective, { static: false }]
@@ -389,14 +389,6 @@ export declare class MultiSelectComponent implements OnDestroy, OnChanges, OnIni
389
389
  get dir(): string;
390
390
  get disabledClass(): boolean;
391
391
  get isLoading(): boolean;
392
- /**
393
- * @hidden
394
- */
395
- handleKeyboardEvent(event: KeyboardEvent): void;
396
- /**
397
- * @hidden
398
- */
399
- hostMousedown(event: any): void;
400
392
  disabledIndices: Set<number>;
401
393
  private initialized;
402
394
  private _size;
@@ -538,6 +530,8 @@ export declare class MultiSelectComponent implements OnDestroy, OnChanges, OnIni
538
530
  private disabledItemsMapper;
539
531
  private createCustomValueStream;
540
532
  private handleItemChange;
533
+ private handleMousedown;
534
+ private handleKeydown;
541
535
  private handleEnter;
542
536
  private handleClose;
543
537
  private handleEnd;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-dropdowns",
3
- "version": "11.0.0-develop.111",
3
+ "version": "11.0.0-develop.113",
4
4
  "description": "A wide variety of native Angular dropdown components including AutoComplete, ComboBox, DropDownList, DropDownTree, MultiColumnComboBox, MultiSelect, and MultiSelectTree ",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -25,14 +25,14 @@
25
25
  "@angular/platform-browser": "13 - 15",
26
26
  "@progress/kendo-common": "^0.2.1",
27
27
  "@progress/kendo-licensing": "^1.0.2",
28
- "@progress/kendo-angular-common": "11.0.0-develop.111",
29
- "@progress/kendo-angular-l10n": "11.0.0-develop.111",
30
- "@progress/kendo-angular-popup": "11.0.0-develop.111",
31
- "@progress/kendo-angular-icons": "11.0.0-develop.111",
32
- "@progress/kendo-angular-schematics": "11.0.0-develop.111",
33
- "@progress/kendo-angular-treeview": "11.0.0-develop.111",
28
+ "@progress/kendo-angular-common": "11.0.0-develop.113",
29
+ "@progress/kendo-angular-l10n": "11.0.0-develop.113",
30
+ "@progress/kendo-angular-popup": "11.0.0-develop.113",
31
+ "@progress/kendo-angular-icons": "11.0.0-develop.113",
32
+ "@progress/kendo-angular-schematics": "11.0.0-develop.113",
33
+ "@progress/kendo-angular-treeview": "11.0.0-develop.113",
34
34
  "rxjs": "^6.5.3 || ^7.0.0",
35
- "@progress/kendo-angular-label": "11.0.0-develop.111"
35
+ "@progress/kendo-angular-label": "11.0.0-develop.113"
36
36
  },
37
37
  "dependencies": {
38
38
  "tslib": "^2.3.1"