@progress/kendo-angular-dropdowns 11.0.0-develop.99 → 11.0.1-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  Progress Kendo UI for Angular 2023
2
2
 
3
- Copyright (c) 2016-2022 Progress Software Corporation and/or one of its
3
+ Copyright © 2016-2023 Progress Software Corporation and/or one of its
4
4
  subsidiaries or affiliates. All rights reserved.
5
5
 
6
6
  Portions of the Product include certain open source and commercial third-party
@@ -65,7 +65,7 @@ the Product:
65
65
 
66
66
  (1) The Apache Software License, Version 2.0:
67
67
 
68
- Progress Kendo UI for Angular 2022 incorporates TsLib v1.9.3. Such technology
68
+ Progress Kendo UI for Angular 2023 incorporates TsLib v1.9.3. Such technology
69
69
  is subject to the following terms and conditions: Apache Software License Version 2.0.
70
70
 
71
71
  Apache License
@@ -290,7 +290,7 @@ is subject to the following terms and conditions: Apache Software License Versio
290
290
 
291
291
  (2) BSD-Style Licenses:
292
292
 
293
- (a) Progress Kendo UI for Angular 2022 incorporates xlf-translate v2.0.4. Such
293
+ (a) Progress Kendo UI for Angular 2023 incorporates xlf-translate v2.0.4. Such
294
294
  technology is subject to the following terms and conditions:
295
295
 
296
296
  BSD 3-Clause License
@@ -325,7 +325,7 @@ technology is subject to the following terms and conditions:
325
325
 
326
326
  (3) The ISC License:
327
327
 
328
- (a) Progress Kendo UI for Angular 2022 incorporates glob v7.1.3. Such technology
328
+ (a) Progress Kendo UI for Angular 2023 incorporates glob v7.1.3. Such technology
329
329
  is subject to the following terms and conditions:
330
330
 
331
331
  The ISC License
@@ -352,7 +352,7 @@ is subject to the following terms and conditions:
352
352
 
353
353
  (4) MIT-Style Licenses:
354
354
 
355
- (a) Progress Kendo UI for Angular 2022 incorporates HammerJS v2.0.8. Such
355
+ (a) Progress Kendo UI for Angular 2023 incorporates HammerJS v2.0.8. Such
356
356
  technology is subject to the following terms and conditions:
357
357
 
358
358
  The MIT License (MIT)
@@ -377,7 +377,7 @@ technology is subject to the following terms and conditions:
377
377
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
378
378
  SOFTWARE.
379
379
 
380
- (b) Progress Kendo UI for Angular 2022 incorporates prosemirror-commands v1*,
380
+ (b) Progress Kendo UI for Angular 2023 incorporates prosemirror-commands v1*,
381
381
  prosemirror-cursor v1*, prosemirror-gapcursor v1*, prosemirror-history v1*,
382
382
  prosemirror-inputrules v1*, prosemirror-keymap v1*, prosemirror-model v1*,
383
383
  prosemirror-schema-list v1*, prosemirror-state v1*, prosemirror-tables v0.7*,
@@ -404,7 +404,7 @@ subject to the following terms and conditions:
404
404
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
405
405
  THE SOFTWARE.
406
406
 
407
- (c) Progress Kendo UI for Angular 2022 incorporates cheerio v0.2.2. Such technology is subject to the following terms and conditions:
407
+ (c) Progress Kendo UI for Angular 2023 incorporates cheerio v0.2.2. Such technology is subject to the following terms and conditions:
408
408
 
409
409
  MIT License
410
410
 
@@ -428,7 +428,7 @@ subject to the following terms and conditions:
428
428
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
429
429
  SOFTWARE.
430
430
 
431
- (d) Progress Kendo UI for Angular 2022 incorporates @types/prosemirror-commands v1*,
431
+ (d) Progress Kendo UI for Angular 2023 incorporates @types/prosemirror-commands v1*,
432
432
  @types/prosemirror-dropcursor v1*, @types/prosemirror-gapcursor v1*, @types/prosemirror-history v1*,
433
433
  @types/prosemirror-inputrules v1*, @types/prosemirror-keymap v1*, @types/prosemirror-model v1*,
434
434
  @types/prosemirror-schema-list v1*, @types/prosemirror-state v1*, @types/prosemirror-tables v0.9*,
@@ -457,7 +457,7 @@ subject to the following terms and conditions:
457
457
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
458
458
  SOFTWARE.
459
459
 
460
- (e) Progress Kendo UI for Angular 2022 incorporates pako-esm v1.0.0. Such
460
+ (e) Progress Kendo UI for Angular 2023 incorporates pako-esm v1.0.0. Such
461
461
  technology is subject to the following terms and conditions:
462
462
 
463
463
  Copyright © 2020 Progress Software Corporation and/or one of its subsidiaries
@@ -483,7 +483,7 @@ technology is subject to the following terms and conditions:
483
483
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
484
484
  THE SOFTWARE.
485
485
 
486
- (f) Progress Kendo UI for Angular 2022 incorporates jszip-esm v1.0.0. Such
486
+ (f) Progress Kendo UI for Angular 2023 incorporates jszip-esm v1.0.0. Such
487
487
  technology is subject to the following terms and conditions:
488
488
 
489
489
  Copyright © 2020 Progress Software Corporation and/or one of its subsidiaries
@@ -510,7 +510,7 @@ technology is subject to the following terms and conditions:
510
510
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
511
511
  THE SOFTWARE.
512
512
 
513
- (g) Progress Kendo UI for Angular 2022 incorporates data.task v3.1.2. Such
513
+ (g) Progress Kendo UI for Angular 2023 incorporates data.task v3.1.2. Such
514
514
  technology is subject to the following terms and conditions:
515
515
 
516
516
  The MIT License
@@ -535,7 +535,7 @@ technology is subject to the following terms and conditions:
535
535
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
536
536
  THE SOFTWARE.
537
537
 
538
- (h) Progress Kendo UI for Angular 2022 incorporates ramda v0.23. Such technology
538
+ (h) Progress Kendo UI for Angular 2023 incorporates ramda v0.23. Such technology
539
539
  is subject to the following terms and conditions:
540
540
 
541
541
  The MIT License (MIT)
@@ -560,7 +560,7 @@ is subject to the following terms and conditions:
560
560
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
561
561
  THE SOFTWARE.
562
562
 
563
- (i) Progress Kendo UI for Angular 2022 incorporates js-yaml v3.14.0. Such
563
+ (i) Progress Kendo UI for Angular 2023 incorporates js-yaml v3.14.0. Such
564
564
  technology is subject to the following terms and conditions:
565
565
 
566
566
  (The MIT License)
@@ -587,7 +587,7 @@ technology is subject to the following terms and conditions:
587
587
 
588
588
  (5) UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE:
589
589
 
590
- Progress Kendo UI for Angular 2022 incorporates Unicode CLDR Database v33.
590
+ Progress Kendo UI for Angular 2023 incorporates Unicode CLDR Database v33.
591
591
  Such technology is subject to the following terms and conditions:
592
592
 
593
593
  UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
@@ -605,7 +605,7 @@ Such technology is subject to the following terms and conditions:
605
605
 
606
606
  COPYRIGHT AND PERMISSION NOTICE
607
607
 
608
- Copyright © 1991-2021 Unicode, Inc. All rights reserved.
608
+ Copyright © 1991-2019 Unicode, Inc. All rights reserved.
609
609
  Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
610
610
 
611
611
  Permission is hereby granted, free of charge, to any person obtaining
@@ -642,7 +642,7 @@ incorporated into the Product: NONE
642
642
 
643
643
  3. Special Notices Regarding Progress Products incorporated into the Product:
644
644
 
645
- (a) Progress Kendo UI for Angular 2022 incorporates Kendo UI Licensing CLI v1.1
645
+ (a) Progress Kendo UI for Angular 2023 incorporates Kendo UI Licensing CLI v1.1
646
646
  from Progress Software Corporation. See NOTICE.txt text file within product for
647
647
  third-party license information.
648
648
 
@@ -651,4 +651,4 @@ the release notes or other documentation that accompanies updates received in
651
651
  connection with support of the Product.
652
652
 
653
653
 
654
- Updated 1/6/2022
654
+ Updated 13.Jan.2023
@@ -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;
@@ -274,7 +266,7 @@ export declare class DropDownTreeComponent implements OnInit, OnDestroy, OnChang
274
266
  */
275
267
  isNodeExpanded: (item: object, index: string) => boolean;
276
268
  /**
277
- * A callback which determines whether a tree node should be rendered as hidden. The utility .k-display-none class is used to hide the nodes.
269
+ * A callback which determines whether a tree node should be rendered as hidden. The utility .k-hidden class is used to hide the nodes.
278
270
  * Useful for custom filtering implementations.
279
271
  */
280
272
  isNodeVisible: (item: object, index: string) => boolean;
@@ -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
  */
@@ -265,7 +261,7 @@ export declare class MultiSelectTreeComponent implements OnInit, OnDestroy, OnCh
265
261
  */
266
262
  isNodeExpanded: (item: object, index: string) => boolean;
267
263
  /**
268
- * A callback which determines whether a tree node should be rendered as hidden. The utility .k-display-none class is used to hide the nodes.
264
+ * A callback which determines whether a tree node should be rendered as hidden. The utility .k-hidden class is used to hide the nodes.
269
265
  * Useful for custom filtering implementations.
270
266
  */
271
267
  isNodeVisible: (item: object, index: string) => boolean;
@@ -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';
@@ -162,7 +162,7 @@ export class DropDownTreeComponent {
162
162
  */
163
163
  this.itemDisabled = itemDisabled;
164
164
  /**
165
- * A callback which determines whether a tree node should be rendered as hidden. The utility .k-display-none class is used to hide the nodes.
165
+ * A callback which determines whether a tree node should be rendered as hidden. The utility .k-hidden class is used to hide the nodes.
166
166
  * Useful for custom filtering implementations.
167
167
  */
168
168
  this.isNodeVisible = isNodeVisible;
@@ -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
  *
@@ -527,8 +509,6 @@ export class DropDownTreeComponent {
527
509
  return node.text.toLowerCase().indexOf(this._typedValue) === 0;
528
510
  });
529
511
  this.treeview.focus(itemToFocus?.index);
530
- const htmlItem = document.querySelector(`kendo-popup[id='${this._popupId}'] li.k-treeview-item[data-treeindex='${itemToFocus?.index}']`);
531
- htmlItem?.scrollIntoView();
532
512
  }), debounceTime(1000)).subscribe(() => {
533
513
  this._typedValue = '';
534
514
  }));
@@ -562,6 +542,10 @@ export class DropDownTreeComponent {
562
542
  ngAfterContentChecked() {
563
543
  this.verifySettings();
564
544
  }
545
+ ngAfterViewInit() {
546
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'click', this.handleClick.bind(this)));
547
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
548
+ }
565
549
  /**
566
550
  * @hidden
567
551
  *
@@ -617,17 +601,29 @@ export class DropDownTreeComponent {
617
601
  return;
618
602
  }
619
603
  this.isFocused = false;
604
+ this.togglePopup(false);
620
605
  if (hasObservers(this.onBlur) ||
621
606
  isUntouched(this.wrapper.nativeElement)) {
622
607
  this._zone.run(() => {
623
- this.togglePopup(false);
624
608
  this.onBlur.emit();
625
609
  this.onTouchedCallback();
626
610
  });
627
611
  }
628
- else {
629
- this.togglePopup(false);
612
+ }
613
+ /**
614
+ * @hidden
615
+ */
616
+ handleKeydown(event) {
617
+ if (this.disabled || this.readonly) {
618
+ return;
619
+ }
620
+ if (!this.isFilterActive && isLetter(event.key)) {
621
+ this.printableCharacters.next(event.key);
630
622
  }
623
+ const eventData = event;
624
+ this.navigationService.process({
625
+ originalEvent: eventData
626
+ });
631
627
  }
632
628
  /**
633
629
  * Focuses a specific item of the DropDownTree based on a provided index in the format of `1_1`.
@@ -920,6 +916,14 @@ export class DropDownTreeComponent {
920
916
  }
921
917
  }
922
918
  }
919
+ handleClick(e) {
920
+ // The check is needed otherwise when appended to the component, the popup reopens on click
921
+ // https://github.com/telerik/kendo-angular/issues/3738
922
+ if ((this.popupRef && !this.popupRef.popupElement.contains(e.target))
923
+ || (!this.popupRef && !e.target.className.includes('k-treeview-leaf'))) {
924
+ this.togglePopup(!this.isOpen);
925
+ }
926
+ }
923
927
  handleEscape() {
924
928
  this.togglePopup(false);
925
929
  this.focus();
@@ -953,10 +957,25 @@ export class DropDownTreeComponent {
953
957
  }),
954
958
  this.navigationService.enter
955
959
  .pipe(tap((event) => event.originalEvent.preventDefault()))
956
- .subscribe(() => this.togglePopup(true)),
960
+ .subscribe((e) => {
961
+ // The check is needed otherwise when appended to the component, the popup reopens on click
962
+ // https://github.com/telerik/kendo-angular/issues/3738
963
+ if (e.originalEvent.target === this.wrapper.nativeElement) {
964
+ this.togglePopup(true);
965
+ }
966
+ if (!this.isOpen) {
967
+ this.focus();
968
+ }
969
+ }),
957
970
  this.navigationService.esc
958
971
  .subscribe(() => this.handleEscape()),
959
- this.navigationService.tab.subscribe(() => this.focus()),
972
+ this.navigationService.tab.subscribe(() => {
973
+ this.focus();
974
+ if (this.isOpen) {
975
+ this.treeview.blur();
976
+ this.removeTreeViewFromTabOrder();
977
+ }
978
+ }),
960
979
  this.navigationService.down.subscribe((event) => {
961
980
  if (!this.treeview) {
962
981
  return;
@@ -1044,9 +1063,22 @@ export class DropDownTreeComponent {
1044
1063
  this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('picker', this.fillMode));
1045
1064
  }
1046
1065
  }
1066
+ /**
1067
+ * Remove the `TreeView` from the tab order, otherwise a focus loop between the page elements will occur
1068
+ * and the user will not be able to tab to the rest of the browser elements
1069
+ */
1070
+ removeTreeViewFromTabOrder() {
1071
+ const nodes = this.treeview.element.nativeElement.querySelectorAll('li');
1072
+ nodes.forEach(item => {
1073
+ if (item.getAttribute('tabindex') === '0') {
1074
+ this.lastNodeOnFocus = item;
1075
+ this.lastNodeOnFocus.setAttribute('tabindex', '-1');
1076
+ }
1077
+ });
1078
+ }
1047
1079
  }
1048
1080
  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: [
1081
+ 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
1082
  DataService,
1051
1083
  SelectionService,
1052
1084
  NavigationService,
@@ -1461,12 +1493,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1461
1493
  }], isReadonly: [{
1462
1494
  type: HostBinding,
1463
1495
  args: ['attr.readonly']
1464
- }], handleClick: [{
1465
- type: HostListener,
1466
- args: ['click']
1467
- }], handleKeydown: [{
1468
- type: HostListener,
1469
- args: ['keydown', ['$event']]
1470
1496
  }], noDataTemplate: [{
1471
1497
  type: ContentChild,
1472
1498
  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';
@@ -148,7 +148,7 @@ export class MultiSelectTreeComponent {
148
148
  */
149
149
  this.fetchChildren = fetchChildren;
150
150
  /**
151
- * A callback which determines whether a tree node should be rendered as hidden. The utility .k-display-none class is used to hide the nodes.
151
+ * A callback which determines whether a tree node should be rendered as hidden. The utility .k-hidden class is used to hide the nodes.
152
152
  * Useful for custom filtering implementations.
153
153
  */
154
154
  this.isNodeVisible = isNodeVisible;
@@ -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;
@@ -652,8 +646,6 @@ export class MultiSelectTreeComponent {
652
646
  return node.text.toLowerCase().indexOf(this._typedValue) === 0;
653
647
  });
654
648
  this.treeview.focus(itemToFocus?.index);
655
- const htmlItem = document.querySelector(`kendo-popup[id='${this._popupId}'] li.k-treeview-item[data-treeindex='${itemToFocus?.index}']`);
656
- htmlItem?.scrollIntoView();
657
649
  }), debounceTime(1000)).subscribe(() => {
658
650
  this._typedValue = '';
659
651
  }));
@@ -666,6 +658,10 @@ export class MultiSelectTreeComponent {
666
658
  }));
667
659
  this.setComponentClasses();
668
660
  }
661
+ ngAfterViewInit() {
662
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'click', this.handleClick.bind(this)));
663
+ this.subs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', this.handleKeydown.bind(this)));
664
+ }
669
665
  /**
670
666
  * @hidden
671
667
  */
@@ -1092,6 +1088,14 @@ export class MultiSelectTreeComponent {
1092
1088
  }
1093
1089
  }
1094
1090
  }
1091
+ handleClick(e) {
1092
+ // The check is needed otherwise when appended to the component, the popup reopens on click
1093
+ // https://github.com/telerik/kendo-angular/issues/3738
1094
+ if ((this.popupRef && this.popupRef.popupElement.contains(e.target))) {
1095
+ return;
1096
+ }
1097
+ this.togglePopup(!this.isOpen);
1098
+ }
1095
1099
  subscribeEvents() {
1096
1100
  [
1097
1101
  this.navigationService.open.subscribe((event) => {
@@ -1359,7 +1363,7 @@ export class MultiSelectTreeComponent {
1359
1363
  }
1360
1364
  }
1361
1365
  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: [
1366
+ 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
1367
  LocalizationService,
1364
1368
  NavigationService,
1365
1369
  DataService,
@@ -1845,12 +1849,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1845
1849
  }], ariaActiveDescendant: [{
1846
1850
  type: HostBinding,
1847
1851
  args: ['attr.aria-activedescendant']
1848
- }], handleClick: [{
1849
- type: HostListener,
1850
- args: ['click']
1851
- }], handleKeydown: [{
1852
- type: HostListener,
1853
- args: ['keydown', ['$event']]
1854
1852
  }], headerTemplate: [{
1855
1853
  type: ContentChild,
1856
1854
  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
  }] } });