@progress/kendo-angular-buttons 8.0.1-dev.202208171439 → 8.1.0-dev.202209081231

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.
@@ -9,7 +9,7 @@ import { isDocumentAvailable, Keys, isChanged, hasObservers, guid, EventsModule
9
9
  import * as i1 from '@progress/kendo-angular-l10n';
10
10
  import { LocalizationService, L10N_PREFIX, ComponentMessages } from '@progress/kendo-angular-l10n';
11
11
  import { Subject, Subscription, fromEvent, merge } from 'rxjs';
12
- import { take, filter } from 'rxjs/operators';
12
+ import { take, filter, tap } from 'rxjs/operators';
13
13
  import { validatePackage } from '@progress/kendo-licensing';
14
14
  import { detectDesktopBrowser, detectMobileOS } from '@progress/kendo-common';
15
15
  import * as i2 from '@angular/common';
@@ -26,7 +26,7 @@ const packageMetadata = {
26
26
  name: '@progress/kendo-angular-buttons',
27
27
  productName: 'Kendo UI for Angular',
28
28
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
29
- publishDate: 1660747155,
29
+ publishDate: 1662640269,
30
30
  version: '',
31
31
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
32
32
  };
@@ -782,9 +782,19 @@ class ButtonGroupComponent {
782
782
  this.service = service;
783
783
  this.element = element;
784
784
  /**
785
- * By default, the selection mode of the ButtonGroup is set to `multiple`.
785
+ * The selection mode of the ButtonGroup.
786
+ * @default 'multiple'
786
787
  */
787
788
  this.selection = 'multiple';
789
+ /**
790
+ * When this option is set to `true` (default), the component is a single tab-stop,
791
+ * and focus is moved through the inner buttons via the arrow keys.
792
+ *
793
+ * When the option is set to `false`, the inner buttons are part of the natural tab sequence of the page.
794
+ *
795
+ * @default true
796
+ */
797
+ this.navigable = true;
788
798
  /**
789
799
  * Fires every time keyboard navigation occurs.
790
800
  */
@@ -792,6 +802,15 @@ class ButtonGroupComponent {
792
802
  this._tabIndex = 0;
793
803
  this.currentTabIndex = 0;
794
804
  this.subs = new Subscription();
805
+ this.role = 'group';
806
+ this.focusHandler = () => {
807
+ this.currentTabIndex = -1;
808
+ const focusedIndex = this.buttons.toArray().findIndex(current => current.element.tabIndex !== -1);
809
+ const index = focusedIndex === -1 ? 0 : focusedIndex;
810
+ this.focus(this.buttons.filter((_current, i) => {
811
+ return i === index;
812
+ }));
813
+ };
795
814
  validatePackage(packageMetadata);
796
815
  this.subs.add(localization.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
797
816
  }
@@ -814,9 +833,6 @@ class ButtonGroupComponent {
814
833
  get stretchedClass() {
815
834
  return !!this.width;
816
835
  }
817
- get getRole() {
818
- return this.isSelectionSingle() ? 'radiogroup' : 'group';
819
- }
820
836
  get dir() {
821
837
  return this.direction;
822
838
  }
@@ -827,35 +843,7 @@ class ButtonGroupComponent {
827
843
  return this.width;
828
844
  }
829
845
  get wrapperTabIndex() {
830
- return this.disabled ? undefined : this.currentTabIndex;
831
- }
832
- /**
833
- * @hidden
834
- */
835
- keydown(event) {
836
- if (!this.disabled) {
837
- this.navigateFocus(event);
838
- }
839
- }
840
- /**
841
- * @hidden
842
- */
843
- onFocus() {
844
- this.currentTabIndex = -1;
845
- const focusedIndex = this.buttons.toArray().findIndex(current => current.element.tabIndex !== -1);
846
- const index = focusedIndex === -1 ? 0 : focusedIndex;
847
- this.focus(this.buttons.filter((_current, i) => {
848
- return i === index;
849
- }));
850
- }
851
- /**
852
- * @hidden
853
- */
854
- focusout(event) {
855
- if (event.relatedTarget && event.relatedTarget.parentNode !== this.element.nativeElement) {
856
- this.defocus(this.buttons.toArray());
857
- this.currentTabIndex = this.tabIndex;
858
- }
846
+ return this.disabled ? undefined : this.navigable ? this.currentTabIndex : undefined;
859
847
  }
860
848
  ngOnInit() {
861
849
  this.subs.add(this.service.buttonClicked$.subscribe((button) => {
@@ -865,33 +853,55 @@ class ButtonGroupComponent {
865
853
  this.deactivate(this.buttons.filter(current => current !== button));
866
854
  }
867
855
  else {
868
- this.defocus(this.buttons.toArray());
856
+ if (this.navigable) {
857
+ this.defocus(this.buttons.toArray());
858
+ }
869
859
  newSelectionValue = !button.selected;
870
860
  }
871
861
  if (button.togglable) {
872
862
  button.setSelected(newSelectionValue);
873
863
  }
874
- button.setAttribute(tabindex, '0');
864
+ if (this.navigable) {
865
+ button.setAttribute(tabindex, '0');
866
+ }
867
+ }));
868
+ this.handleSubs('focus', () => this.navigable, this.focusHandler);
869
+ this.handleSubs('keydown', () => this.navigable && !this.disabled, (event) => this.navigateFocus(event));
870
+ this.handleSubs('focusout', (event) => this.navigable && event.relatedTarget && event.relatedTarget.parentNode !== this.element.nativeElement, () => {
871
+ this.defocus(this.buttons.toArray());
872
+ this.currentTabIndex = this.tabIndex;
873
+ });
874
+ this.subs.add(fromEvent(this.element.nativeElement, 'focusout')
875
+ .pipe(filter((event) => this.navigable && event.relatedTarget && event.relatedTarget.parentNode !== this.element.nativeElement))
876
+ .subscribe(() => {
877
+ this.defocus(this.buttons.toArray());
878
+ this.currentTabIndex = this.tabIndex;
875
879
  }));
876
880
  }
877
- ngOnChanges(change) {
878
- if (isChanged('disabled', change)) {
881
+ ngOnChanges(changes) {
882
+ if (isChanged('disabled', changes)) {
879
883
  this.buttons.forEach((button) => {
880
884
  if (isPresent(this.disabled)) {
881
885
  button.disabled = this.disabled;
882
886
  }
883
887
  });
884
888
  }
885
- }
886
- ngAfterContentInit() {
887
- this.buttons.forEach((button) => {
888
- if (button.selected) {
889
- button.setAttribute(tabindex, '0');
889
+ if (isChanged('navigable', changes)) {
890
+ if (changes.navigable.currentValue) {
891
+ this.setButtonsTabIndex();
892
+ this.currentTabIndex = 0;
890
893
  }
891
894
  else {
892
- button.setAttribute(tabindex, '-1');
895
+ this.currentTabIndex = -1;
896
+ this.buttons.forEach((button) => button.setAttribute(tabindex, '0'));
893
897
  }
894
- });
898
+ }
899
+ }
900
+ ngAfterContentInit() {
901
+ if (!this.navigable) {
902
+ return;
903
+ }
904
+ this.setButtonsTabIndex();
895
905
  }
896
906
  ngAfterViewChecked() {
897
907
  if (this.buttons.length) {
@@ -932,13 +942,17 @@ class ButtonGroupComponent {
932
942
  deactivate(buttons) {
933
943
  buttons.forEach((button) => {
934
944
  button.setSelected(false);
935
- button.setAttribute(tabindex, '-1');
945
+ if (this.navigable) {
946
+ button.setAttribute(tabindex, '-1');
947
+ }
936
948
  });
937
949
  }
938
950
  activate(buttons) {
939
951
  buttons.forEach((button) => {
940
952
  button.setSelected(true);
941
- button.setAttribute(tabindex, '0');
953
+ if (this.navigable) {
954
+ button.setAttribute(tabindex, '0');
955
+ }
942
956
  button.focus();
943
957
  });
944
958
  }
@@ -963,9 +977,24 @@ class ButtonGroupComponent {
963
977
  isSelectionSingle() {
964
978
  return this.selection === 'single';
965
979
  }
980
+ setButtonsTabIndex() {
981
+ this.buttons.forEach((button) => {
982
+ if (button.selected) {
983
+ button.setAttribute(tabindex, '0');
984
+ }
985
+ else {
986
+ button.setAttribute(tabindex, '-1');
987
+ }
988
+ });
989
+ }
990
+ handleSubs(eventName, predicate, handler) {
991
+ this.subs.add(fromEvent(this.element.nativeElement, eventName)
992
+ .pipe(filter(predicate))
993
+ .subscribe(handler));
994
+ }
966
995
  }
967
996
  ButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ButtonGroupComponent, deps: [{ token: KendoButtonService }, { token: i1.LocalizationService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
968
- ButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ButtonGroupComponent, selector: "kendo-buttongroup", inputs: { disabled: "disabled", selection: "selection", width: "width", tabIndex: "tabIndex" }, outputs: { navigate: "navigate" }, host: { listeners: { "keydown": "keydown($event)", "focus": "onFocus()", "focusout": "focusout($event)" }, properties: { "class.k-button-group": "this.wrapperClass", "class.k-disabled": "this.disabledClass", "class.k-button-group-stretched": "this.stretchedClass", "attr.role": "this.getRole", "attr.dir": "this.dir", "attr.aria-disabled": "this.ariaDisabled", "style.width": "this.wrapperWidth", "attr.tabindex": "this.wrapperTabIndex" } }, providers: [
997
+ ButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ButtonGroupComponent, selector: "kendo-buttongroup", inputs: { disabled: "disabled", selection: "selection", width: "width", tabIndex: "tabIndex", navigable: "navigable" }, outputs: { navigate: "navigate" }, host: { properties: { "class.k-button-group": "this.wrapperClass", "class.k-disabled": "this.disabledClass", "class.k-button-group-stretched": "this.stretchedClass", "attr.role": "this.role", "attr.dir": "this.dir", "attr.aria-disabled": "this.ariaDisabled", "style.width": "this.wrapperWidth", "attr.tabindex": "this.wrapperTabIndex" } }, providers: [
969
998
  KendoButtonService,
970
999
  LocalizationService,
971
1000
  {
@@ -1003,6 +1032,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1003
1032
  args: ['width']
1004
1033
  }], tabIndex: [{
1005
1034
  type: Input
1035
+ }], navigable: [{
1036
+ type: Input
1006
1037
  }], navigate: [{
1007
1038
  type: Output
1008
1039
  }], buttons: [{
@@ -1017,7 +1048,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1017
1048
  }], stretchedClass: [{
1018
1049
  type: HostBinding,
1019
1050
  args: ['class.k-button-group-stretched']
1020
- }], getRole: [{
1051
+ }], role: [{
1021
1052
  type: HostBinding,
1022
1053
  args: ['attr.role']
1023
1054
  }], dir: [{
@@ -1032,15 +1063,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1032
1063
  }], wrapperTabIndex: [{
1033
1064
  type: HostBinding,
1034
1065
  args: ['attr.tabindex']
1035
- }], keydown: [{
1036
- type: HostListener,
1037
- args: ['keydown', ['$event']]
1038
- }], onFocus: [{
1039
- type: HostListener,
1040
- args: ['focus']
1041
- }], focusout: [{
1042
- type: HostListener,
1043
- args: ['focusout', ['$event']]
1044
1066
  }] } });
1045
1067
 
1046
1068
  /**
@@ -1263,13 +1285,14 @@ class ListComponent {
1263
1285
  ListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1264
1286
  ListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListComponent, selector: "kendo-button-list", inputs: { data: "data", textField: "textField", itemTemplate: "itemTemplate", size: "size" }, outputs: { onItemClick: "onItemClick", onItemBlur: "onItemBlur" }, ngImport: i0, template: `
1265
1287
  <ul class="k-group k-menu-group k-reset" [ngClass]="sizeClass" unselectable="on" role="menu">
1266
- <li role="menuitem" unselectable="on"
1288
+ <li role="menuitem"
1289
+ unselectable="on"
1267
1290
  kendoButtonFocusable
1268
1291
  *ngFor="let dataItem of data; let index = index;"
1269
1292
  [index]="index"
1270
1293
  tabindex="-1"
1271
1294
  class="k-item k-menu-item"
1272
- (click)="onClick(index)"
1295
+ (click)="$event.stopImmediatePropagation(); onClick(index);"
1273
1296
  (blur)="onBlur()"
1274
1297
  [attr.aria-disabled]="dataItem.disabled ? true : false">
1275
1298
  <ng-template [ngIf]="itemTemplate?.templateRef">
@@ -1303,13 +1326,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1303
1326
  selector: 'kendo-button-list',
1304
1327
  template: `
1305
1328
  <ul class="k-group k-menu-group k-reset" [ngClass]="sizeClass" unselectable="on" role="menu">
1306
- <li role="menuitem" unselectable="on"
1329
+ <li role="menuitem"
1330
+ unselectable="on"
1307
1331
  kendoButtonFocusable
1308
1332
  *ngFor="let dataItem of data; let index = index;"
1309
1333
  [index]="index"
1310
1334
  tabindex="-1"
1311
1335
  class="k-item k-menu-item"
1312
- (click)="onClick(index)"
1336
+ (click)="$event.stopImmediatePropagation(); onClick(index);"
1313
1337
  (blur)="onBlur()"
1314
1338
  [attr.aria-disabled]="dataItem.disabled ? true : false">
1315
1339
  <ng-template [ngIf]="itemTemplate?.templateRef">
@@ -1495,13 +1519,8 @@ class NavigationService {
1495
1519
  const keyEvent = args.keyEvent;
1496
1520
  let index;
1497
1521
  let action = NavigationAction.Undefined;
1498
- if (keyEvent === KeyEvents.keypress) {
1499
- if (this.isEnter(keyCode)) {
1500
- action = NavigationAction.EnterPress;
1501
- }
1502
- }
1503
- else if (keyEvent === KeyEvents.keyup) {
1504
- if (this.isEnter(keyCode)) {
1522
+ if (keyEvent === KeyEvents.keyup) {
1523
+ if (this.isEnterOrSpace(keyCode)) {
1505
1524
  action = NavigationAction.EnterUp;
1506
1525
  }
1507
1526
  }
@@ -1512,7 +1531,7 @@ class NavigationService {
1512
1531
  else if (args.altKey && keyCode === Keys.ArrowUp) {
1513
1532
  action = NavigationAction.Close;
1514
1533
  }
1515
- else if (this.isEnter(keyCode)) {
1534
+ else if (this.isEnterOrSpace(keyCode)) {
1516
1535
  action = NavigationAction.Enter;
1517
1536
  }
1518
1537
  else if (keyCode === Keys.Escape) {
@@ -1555,11 +1574,11 @@ class NavigationService {
1555
1574
  }
1556
1575
  }
1557
1576
  if (action !== NavigationAction.Undefined) {
1558
- this[NavigationAction[action].toLowerCase()].emit(index);
1577
+ this[NavigationAction[action].toLowerCase()].emit({ index, target: args.target });
1559
1578
  }
1560
1579
  return action;
1561
1580
  }
1562
- isEnter(keyCode) {
1581
+ isEnterOrSpace(keyCode) {
1563
1582
  return keyCode === Keys.Enter || keyCode === Keys.Space;
1564
1583
  }
1565
1584
  next(args) {
@@ -1580,16 +1599,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1580
1599
  args: [NAVIGATION_CONFIG]
1581
1600
  }] }]; } });
1582
1601
 
1602
+ /**
1603
+ * @hidden
1604
+ */
1605
+ class PopupContainerService {
1606
+ }
1607
+ PopupContainerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PopupContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1608
+ PopupContainerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PopupContainerService });
1609
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PopupContainerService, decorators: [{
1610
+ type: Injectable
1611
+ }] });
1612
+
1583
1613
  /**
1584
1614
  * @hidden
1585
1615
  */
1586
1616
  class ListButton {
1587
- constructor(focusService, navigationService, wrapperRef, _zone, localization, cdr) {
1617
+ constructor(focusService, navigationService, wrapperRef, _zone, popupService, elRef, localization, cdr, containerService) {
1588
1618
  this.focusService = focusService;
1589
1619
  this.navigationService = navigationService;
1590
1620
  this.wrapperRef = wrapperRef;
1591
1621
  this._zone = _zone;
1622
+ this.popupService = popupService;
1623
+ this.elRef = elRef;
1592
1624
  this.cdr = cdr;
1625
+ this.containerService = containerService;
1593
1626
  this._open = false;
1594
1627
  this._disabled = false;
1595
1628
  this._active = false;
@@ -1597,6 +1630,22 @@ class ListButton {
1597
1630
  this.listId = guid();
1598
1631
  this._isFocused = false;
1599
1632
  this.subs = new Subscription();
1633
+ this.popupSubs = new Subscription();
1634
+ /**
1635
+ * Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
1636
+ */
1637
+ this.tabIndex = 0;
1638
+ /**
1639
+ * Fires each time the popup is about to open.
1640
+ * This event is preventable. If you cancel the event, the popup will remain closed.
1641
+ */
1642
+ this.open = new EventEmitter();
1643
+ /**
1644
+ * Fires each time the popup is about to close.
1645
+ * This event is preventable. If you cancel the event, the popup will remain open.
1646
+ */
1647
+ this.close = new EventEmitter();
1648
+ this.isClosePrevented = false;
1600
1649
  validatePackage(packageMetadata);
1601
1650
  this.focusService = focusService;
1602
1651
  this.navigationService = navigationService;
@@ -1604,6 +1653,75 @@ class ListButton {
1604
1653
  this.subs.add(localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr')));
1605
1654
  this.subscribeEvents();
1606
1655
  }
1656
+ /**
1657
+ * Sets the disabled state of the DropDownButton.
1658
+ */
1659
+ set disabled(value) {
1660
+ if (value && this.openState) {
1661
+ this.openState = false;
1662
+ }
1663
+ this._disabled = value;
1664
+ }
1665
+ get disabled() {
1666
+ return this._disabled;
1667
+ }
1668
+ /**
1669
+ * @hidden
1670
+ */
1671
+ get componentTabIndex() {
1672
+ return this.disabled ? (-1) : this.tabIndex;
1673
+ }
1674
+ get appendTo() {
1675
+ const { appendTo } = this.popupSettings;
1676
+ if (!appendTo || appendTo === 'root') {
1677
+ return undefined;
1678
+ }
1679
+ return appendTo === 'component' ? this.containerService.container : appendTo;
1680
+ }
1681
+ /**
1682
+ * Configures the popup of the DropDownButton.
1683
+ *
1684
+ * The available options are:
1685
+ * - `animate: Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
1686
+ * - `popupClass: String`&mdash;Specifies a list of CSS classes that are used to style the popup.
1687
+ * - `appendTo: "root" | "component" | ViewContainerRef`&mdash;Specifies the component to which the popup will be appended.
1688
+ * - `align: "left" | "center" | "right"`&mdash;Specifies the alignment of the popup.
1689
+ */
1690
+ set popupSettings(settings) {
1691
+ this._popupSettings = Object.assign({ animate: true, popupClass: '' }, settings);
1692
+ }
1693
+ get popupSettings() {
1694
+ return this._popupSettings;
1695
+ }
1696
+ /**
1697
+ * @hidden
1698
+ */
1699
+ get anchorAlign() {
1700
+ let align = { horizontal: this.popupSettings.align || 'left', vertical: 'bottom' };
1701
+ if (this.direction === 'rtl' && !isPresent(this.popupSettings.align)) {
1702
+ align.horizontal = 'right';
1703
+ }
1704
+ return align;
1705
+ }
1706
+ /**
1707
+ * @hidden
1708
+ */
1709
+ get popupAlign() {
1710
+ let align = { horizontal: this.popupSettings.align || 'left', vertical: 'top' };
1711
+ if (this.direction === 'rtl' && !isPresent(this.popupSettings.align)) {
1712
+ align.horizontal = 'right';
1713
+ }
1714
+ return align;
1715
+ }
1716
+ ngOnChanges(changes) {
1717
+ if (isChanged("popupSettings", changes) && isPresent(this.popupRef)) {
1718
+ const popup = this.popupRef.popup.instance;
1719
+ const newSettings = changes.popupSettings.currentValue;
1720
+ popup.popupClass = newSettings.popupClass;
1721
+ popup.animate = newSettings.animate;
1722
+ popup.popupAlign = this.popupAlign;
1723
+ }
1724
+ }
1607
1725
  get popupClasses() {
1608
1726
  const popupClasses = ['k-menu-popup'];
1609
1727
  if (this._popupSettings.popupClass) {
@@ -1614,9 +1732,21 @@ class ListButton {
1614
1732
  get openState() {
1615
1733
  return this._open;
1616
1734
  }
1735
+ /**
1736
+ * @hidden
1737
+ */
1617
1738
  set openState(open) {
1739
+ if (this.disabled) {
1740
+ return;
1741
+ }
1618
1742
  this._open = open;
1619
1743
  }
1744
+ /**
1745
+ * Returns the current open state of the popup.
1746
+ */
1747
+ get isOpen() {
1748
+ return this._open;
1749
+ }
1620
1750
  /**
1621
1751
  * @hidden
1622
1752
  */
@@ -1624,23 +1754,29 @@ class ListButton {
1624
1754
  if (this._disabled) {
1625
1755
  return;
1626
1756
  }
1627
- this.openState = !this.openState;
1628
- if (!this.openState) {
1629
- this.focusService.focus(-1);
1757
+ this._toggle(!this.openState);
1758
+ if (!this.isClosePrevented) {
1759
+ this.focusService.focus(this.openState ? 0 : -1);
1630
1760
  }
1631
1761
  }
1632
1762
  /**
1633
1763
  * @hidden
1634
1764
  */
1635
1765
  onItemClick(index) {
1766
+ this.togglePopupVisibility();
1767
+ if (this.isClosePrevented) {
1768
+ this.emitItemClickHandler(index);
1769
+ return;
1770
+ }
1771
+ if (isDocumentAvailable() && !this.isClosePrevented) {
1772
+ this.focusButton();
1773
+ }
1636
1774
  this.emitItemClickHandler(index);
1637
- setTimeout(() => this.focusWrapper(), 1);
1638
1775
  }
1639
1776
  ngOnDestroy() {
1640
1777
  this.openState = false;
1641
- clearTimeout(this.focusFirstTimeout);
1642
- clearTimeout(this.blurTimeout);
1643
1778
  this.subs.unsubscribe();
1779
+ this.destroyPopup();
1644
1780
  }
1645
1781
  subscribeEvents() {
1646
1782
  if (!isDocumentAvailable()) {
@@ -1657,41 +1793,36 @@ class ListButton {
1657
1793
  }
1658
1794
  subscribeComponentBlurredEvent() {
1659
1795
  this._zone.runOutsideAngular(() => {
1660
- this.subs.add(this.navigationService.tab.pipe(filter(() => this._isFocused)).subscribe(this.handleTab.bind(this)));
1796
+ this.subs.add(this.navigationService.tab.pipe(filter(() => this._isFocused), tap(() => this.focusButton())).subscribe(this.handleTab.bind(this)));
1661
1797
  this.subs.add(fromEvent(document, 'click')
1662
1798
  .pipe(filter((event) => !this.wrapperContains(event.target)), filter(() => this._isFocused))
1663
1799
  .subscribe(() => this._zone.run(() => this.blurWrapper())));
1664
1800
  });
1665
1801
  }
1666
1802
  subscribeNavigationEvents() {
1667
- this.subs.add(this.navigationService.navigate.subscribe(this.focusService.focus.bind(this.focusService)));
1668
- this.subs.add(this.navigationService.enterup.subscribe(() => {
1669
- this.enterHandler();
1670
- this.focusWrapper();
1671
- }));
1672
- this.subs.add(this.navigationService.open.subscribe(() => {
1673
- if (!this._open) {
1674
- this.togglePopupVisibility();
1675
- this.focusFirstItem();
1676
- }
1677
- else {
1678
- this.focusWrapper();
1679
- }
1680
- }));
1681
- this.subs.add(merge(this.navigationService.close, this.navigationService.esc).subscribe(() => this.focusWrapper()));
1803
+ this.subs.add(this.navigationService.navigate
1804
+ .subscribe(this.onArrowKeyNavigate.bind(this)));
1805
+ this.subs.add(this.navigationService.enterup.subscribe(this.onNavigationEnterUp.bind(this)));
1806
+ this.subs.add(this.navigationService.open.subscribe(this.onNavigationOpen.bind(this)));
1807
+ this.subs.add(merge(this.navigationService.close, this.navigationService.esc).subscribe(this.onNavigationClose.bind(this)));
1682
1808
  }
1683
- enterHandler() { } // eslint-disable-line
1684
1809
  /**
1685
- * @hidden
1810
+ * Toggles the visibility of the popup.
1811
+ * If the `toggle` method is used to open or close the popup, the `open` and `close` events will not be fired.
1812
+ *
1813
+ * @param open - The state of the popup.
1686
1814
  */
1687
- keyDownHandler(event) {
1688
- this.keyHandler(event);
1815
+ toggle(open) {
1816
+ if (this.disabled) {
1817
+ return;
1818
+ }
1819
+ this._toggle((open === undefined) ? !this.openState : open);
1689
1820
  }
1690
1821
  /**
1691
1822
  * @hidden
1692
1823
  */
1693
- keyPressHandler(event) {
1694
- this.keyHandler(event, KeyEvents.keypress);
1824
+ keyDownHandler(event) {
1825
+ this.keyHandler(event);
1695
1826
  }
1696
1827
  /**
1697
1828
  * @hidden
@@ -1706,23 +1837,22 @@ class ListButton {
1706
1837
  if (this._disabled) {
1707
1838
  return;
1708
1839
  }
1709
- let focused = this.focusService.focused || 0;
1710
1840
  const eventData = event;
1841
+ eventData.stopImmediatePropagation();
1842
+ let focused = this.focusService.focused || 0;
1711
1843
  const action = this.navigationService.process({
1712
1844
  altKey: eventData.altKey,
1713
1845
  current: focused,
1714
1846
  keyCode: eventData.keyCode,
1715
1847
  keyEvent: keyEvent,
1716
1848
  max: this._data ? this._data.length - 1 : 0,
1717
- min: 0
1849
+ min: 0,
1850
+ target: event.target
1718
1851
  });
1719
1852
  if (action !== NavigationAction.Undefined &&
1720
1853
  action !== NavigationAction.Tab &&
1721
- (action !== NavigationAction.Enter || (action === NavigationAction.Enter && this._open))) {
1722
- if (event.keyCode === Keys.Space && action === NavigationAction.EnterUp) {
1723
- this._open = false;
1724
- }
1725
- else {
1854
+ (action !== NavigationAction.Enter || (action === NavigationAction.Enter && this.openState))) {
1855
+ if (!(event.keyCode === Keys.Space && action === NavigationAction.EnterUp)) {
1726
1856
  eventData.preventDefault();
1727
1857
  }
1728
1858
  }
@@ -1735,14 +1865,10 @@ class ListButton {
1735
1865
  if (dataItem && dataItem.click && !dataItem.disabled) {
1736
1866
  dataItem.click(dataItem);
1737
1867
  }
1738
- }
1739
- focusFirstItem() {
1740
- if (this._data && isPresent(this._data[0])) {
1741
- this.focusFirstTimeout = setTimeout(() => this.focusService.focus(0), 1);
1742
- }
1868
+ this.focusService.focus(index);
1743
1869
  }
1744
1870
  focusWrapper() {
1745
- if (this._open) {
1871
+ if (this.openState) {
1746
1872
  this.togglePopupVisibility();
1747
1873
  this.focusButton();
1748
1874
  }
@@ -1751,7 +1877,10 @@ class ListButton {
1751
1877
  return this.wrapper === element || this.wrapper.contains(element);
1752
1878
  }
1753
1879
  blurWrapper(emit = true) {
1754
- if (this._open) {
1880
+ if (!this._isFocused) {
1881
+ return;
1882
+ }
1883
+ if (this.openState) {
1755
1884
  this.togglePopupVisibility();
1756
1885
  }
1757
1886
  this._isFocused = false;
@@ -1766,43 +1895,127 @@ class ListButton {
1766
1895
  }
1767
1896
  }
1768
1897
  handleTab() {
1769
- this.focusButton();
1770
- this.blurWrapper(false);
1898
+ this.blurWrapper();
1771
1899
  }
1772
- }
1773
- ListButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListButton, deps: [{ token: FocusService }, { token: NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1774
- ListButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListButton, selector: "ng-component", ngImport: i0, template: '', isInline: true });
1775
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListButton, decorators: [{
1776
- type: Component,
1777
- args: [{
1778
- template: ''
1779
- }]
1780
- }], ctorParameters: function () { return [{ type: FocusService }, { type: NavigationService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }]; } });
1781
-
1782
- /**
1783
- * @hidden
1784
- */
1785
- class Messages extends ComponentMessages {
1786
- }
1787
- Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
1788
- Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Messages, selector: "kendo-splitbutton-messages-base", inputs: { splitButtonLabel: "splitButtonLabel" }, usesInheritance: true, ngImport: i0 });
1789
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, decorators: [{
1790
- type: Directive,
1791
- args: [{
1792
- // eslint-disable-next-line @angular-eslint/directive-selector
1793
- selector: 'kendo-splitbutton-messages-base'
1794
- }]
1795
- }], propDecorators: { splitButtonLabel: [{
1796
- type: Input
1797
- }] } });
1798
-
1799
- /**
1800
- * @hidden
1801
- */
1802
- class LocalizedSplitButtonMessagesDirective extends Messages {
1803
- constructor(service) {
1804
- super();
1805
- this.service = service;
1900
+ onNavigationEnterUp() {
1901
+ if (!this._disabled && !this.openState) {
1902
+ this._active = false;
1903
+ }
1904
+ if (this.openState) {
1905
+ let focused = this.focusService.focused;
1906
+ if (isPresent(focused) && focused !== -1) {
1907
+ this.emitItemClickHandler(focused);
1908
+ }
1909
+ }
1910
+ this.togglePopupVisibility();
1911
+ if (!this.openState && isDocumentAvailable()) {
1912
+ this.button.nativeElement.focus();
1913
+ }
1914
+ }
1915
+ onNavigationOpen() {
1916
+ if (!this._disabled && !this.openState) {
1917
+ this.togglePopupVisibility();
1918
+ }
1919
+ }
1920
+ onNavigationClose() {
1921
+ if (this.openState && !this.isClosePrevented) {
1922
+ this.togglePopupVisibility();
1923
+ if (isDocumentAvailable()) {
1924
+ this.button.nativeElement.focus();
1925
+ }
1926
+ }
1927
+ }
1928
+ onArrowKeyNavigate({ index }) {
1929
+ this.focusService.focus(index);
1930
+ }
1931
+ _toggle(open) {
1932
+ if (this.openState === open) {
1933
+ return;
1934
+ }
1935
+ const eventArgs = new PreventableEvent();
1936
+ if (open && !this.openState) {
1937
+ this.open.emit(eventArgs);
1938
+ }
1939
+ else if (!open && this.openState) {
1940
+ this.close.emit(eventArgs);
1941
+ }
1942
+ if (eventArgs.isDefaultPrevented()) {
1943
+ this.isClosePrevented = true;
1944
+ return;
1945
+ }
1946
+ this.openState = open;
1947
+ this.destroyPopup();
1948
+ if (this.openState) {
1949
+ this.createPopup();
1950
+ }
1951
+ }
1952
+ createPopup() {
1953
+ this.popupRef = this.popupService.open({
1954
+ anchor: this.elRef,
1955
+ anchorAlign: this.anchorAlign,
1956
+ animate: this.popupSettings.animate,
1957
+ appendTo: this.appendTo,
1958
+ content: this.containerService.template,
1959
+ popupAlign: this.popupAlign,
1960
+ popupClass: this.popupClasses
1961
+ });
1962
+ this.popupSubs.add(this.popupRef.popupAnchorViewportLeave.subscribe(() => this.openState = false));
1963
+ }
1964
+ destroyPopup() {
1965
+ if (this.popupRef) {
1966
+ this.popupRef.close();
1967
+ this.popupRef = null;
1968
+ this.popupSubs.unsubscribe();
1969
+ this.isClosePrevented = false;
1970
+ // this.focusService.resetFocus();
1971
+ }
1972
+ }
1973
+ }
1974
+ ListButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListButton, deps: [{ token: FocusService }, { token: NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.PopupService }, { token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: PopupContainerService }], target: i0.ɵɵFactoryTarget.Component });
1975
+ ListButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListButton, selector: "ng-component", inputs: { disabled: "disabled", tabIndex: "tabIndex", buttonClass: "buttonClass", popupSettings: "popupSettings" }, outputs: { open: "open", close: "close" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
1976
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListButton, decorators: [{
1977
+ type: Component,
1978
+ args: [{
1979
+ template: ''
1980
+ }]
1981
+ }], ctorParameters: function () { return [{ type: FocusService }, { type: NavigationService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i3.PopupService }, { type: i0.ElementRef }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: PopupContainerService }]; }, propDecorators: { disabled: [{
1982
+ type: Input
1983
+ }], tabIndex: [{
1984
+ type: Input
1985
+ }], buttonClass: [{
1986
+ type: Input
1987
+ }], open: [{
1988
+ type: Output
1989
+ }], close: [{
1990
+ type: Output
1991
+ }], popupSettings: [{
1992
+ type: Input
1993
+ }] } });
1994
+
1995
+ /**
1996
+ * @hidden
1997
+ */
1998
+ class Messages extends ComponentMessages {
1999
+ }
2000
+ Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2001
+ Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: Messages, selector: "kendo-splitbutton-messages-base", inputs: { splitButtonLabel: "splitButtonLabel" }, usesInheritance: true, ngImport: i0 });
2002
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, decorators: [{
2003
+ type: Directive,
2004
+ args: [{
2005
+ // eslint-disable-next-line @angular-eslint/directive-selector
2006
+ selector: 'kendo-splitbutton-messages-base'
2007
+ }]
2008
+ }], propDecorators: { splitButtonLabel: [{
2009
+ type: Input
2010
+ }] } });
2011
+
2012
+ /**
2013
+ * @hidden
2014
+ */
2015
+ class LocalizedSplitButtonMessagesDirective extends Messages {
2016
+ constructor(service) {
2017
+ super();
2018
+ this.service = service;
1806
2019
  }
1807
2020
  }
1808
2021
  LocalizedSplitButtonMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: LocalizedSplitButtonMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
@@ -1876,10 +2089,8 @@ const DEFAULT_FILL_MODE$1 = 'solid';
1876
2089
  * ```
1877
2090
  */
1878
2091
  class SplitButtonComponent extends ListButton {
1879
- constructor(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, renderer) {
1880
- super(focusService, navigationService, wrapperRef, zone, localization, cdr);
1881
- this.popupService = popupService;
1882
- this.elRef = elRef;
2092
+ constructor(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, renderer, containerService) {
2093
+ super(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, containerService);
1883
2094
  this.localization = localization;
1884
2095
  this.renderer = renderer;
1885
2096
  /**
@@ -2019,10 +2230,9 @@ class SplitButtonComponent extends ListButton {
2019
2230
  this.activeArrow = false;
2020
2231
  this.listId = guid();
2021
2232
  this.buttonText = '';
2022
- this.lockFocus = false;
2233
+ this.arrowButtonClicked = false;
2023
2234
  this._rounded = DEFAULT_ROUNDED$1;
2024
2235
  this._fillMode = DEFAULT_FILL_MODE$1;
2025
- this.popupSubs = new Subscription();
2026
2236
  this._itemClick = this.itemClick;
2027
2237
  this._blur = this.onBlur;
2028
2238
  }
@@ -2104,31 +2314,6 @@ class SplitButtonComponent extends ListButton {
2104
2314
  }
2105
2315
  return this._data;
2106
2316
  }
2107
- /**
2108
- * @hidden
2109
- */
2110
- set openState(open) {
2111
- if (this.disabled) {
2112
- return;
2113
- }
2114
- const eventArgs = new PreventableEvent();
2115
- if (open) {
2116
- this.open.emit(eventArgs);
2117
- }
2118
- else {
2119
- this.close.emit(eventArgs);
2120
- }
2121
- if (eventArgs.isDefaultPrevented()) {
2122
- return;
2123
- }
2124
- this._toggle(open);
2125
- }
2126
- /**
2127
- * @hidden
2128
- */
2129
- get openState() {
2130
- return this._open;
2131
- }
2132
2317
  /**
2133
2318
  * @hidden
2134
2319
  */
@@ -2145,7 +2330,7 @@ class SplitButtonComponent extends ListButton {
2145
2330
  this._isFocused = value;
2146
2331
  }
2147
2332
  get isFocused() {
2148
- return this._isFocused && !this._disabled;
2333
+ return this._isFocused && !this._disabled && isDocumentAvailable() && this.wrapperContains(document.activeElement);
2149
2334
  }
2150
2335
  get widgetClasses() {
2151
2336
  return true;
@@ -2163,18 +2348,24 @@ class SplitButtonComponent extends ListButton {
2163
2348
  /**
2164
2349
  * @hidden
2165
2350
  */
2166
- onButtonFocus() {
2167
- if (!this.isFocused) {
2351
+ onButtonFocus(event) {
2352
+ if (!this._disabled) {
2353
+ // eslint-disable-next-line no-unused-expressions
2354
+ !this._isFocused && this.onFocus.emit();
2168
2355
  this._isFocused = true;
2169
- this.onFocus.emit();
2356
+ this.focusService.resetFocus();
2357
+ const relatedTargetInList = event.relatedTarget && closest(event.relatedTarget, '.k-popup kendo-button-list');
2358
+ if (this.openState && !relatedTargetInList) {
2359
+ this.focusService.focus(0);
2360
+ }
2170
2361
  }
2171
2362
  }
2172
2363
  /**
2173
2364
  * @hidden
2174
2365
  */
2175
2366
  onArrowButtonClick() {
2176
- this.lockFocus = true;
2177
2367
  this.togglePopupVisibility();
2368
+ this.arrowButtonClicked = false;
2178
2369
  }
2179
2370
  /**
2180
2371
  * @hidden
@@ -2186,23 +2377,23 @@ class SplitButtonComponent extends ListButton {
2186
2377
  * @hidden
2187
2378
  */
2188
2379
  toggleArrowButtonActiveState(enable) {
2380
+ this.arrowButtonClicked = true;
2189
2381
  this.activeArrow = enable;
2190
2382
  }
2191
2383
  /**
2192
2384
  * @hidden
2193
2385
  */
2194
2386
  onButtonClick() {
2195
- this.lockFocus = true;
2387
+ // this.lockFocus = true;
2196
2388
  this.buttonClick.emit();
2197
2389
  }
2198
2390
  /**
2199
2391
  * @hidden
2200
2392
  */
2201
2393
  onButtonBlur() {
2202
- if (!this.isOpen && !this.lockFocus) {
2394
+ if (!this.isOpen && !this.arrowButtonClicked) {
2203
2395
  this.blurWrapper();
2204
2396
  }
2205
- this.lockFocus = false;
2206
2397
  }
2207
2398
  /**
2208
2399
  * @hidden
@@ -2213,12 +2404,6 @@ class SplitButtonComponent extends ListButton {
2213
2404
  this._active = true;
2214
2405
  }
2215
2406
  }
2216
- /**
2217
- * @hidden
2218
- */
2219
- keypress(event) {
2220
- this.keyPressHandler(event);
2221
- }
2222
2407
  /**
2223
2408
  * @hidden
2224
2409
  */
@@ -2232,6 +2417,8 @@ class SplitButtonComponent extends ListButton {
2232
2417
  * @hidden
2233
2418
  */
2234
2419
  ngAfterViewInit() {
2420
+ this.containerService.container = this.containerRef;
2421
+ this.containerService.template = this.popupTemplate;
2235
2422
  this.updateButtonText();
2236
2423
  this.handleClasses(this.rounded, 'rounded');
2237
2424
  }
@@ -2250,14 +2437,22 @@ class SplitButtonComponent extends ListButton {
2250
2437
  popup.popupAlign = this.popupAlign;
2251
2438
  }
2252
2439
  }
2440
+ /**
2441
+ * @hidden
2442
+ */
2443
+ onNavigationEnterUp(args) {
2444
+ if (args.target !== this.button.nativeElement) {
2445
+ super.onNavigationEnterUp();
2446
+ }
2447
+ }
2253
2448
  /**
2254
2449
  * @hidden
2255
2450
  */
2256
2451
  togglePopupVisibility() {
2257
- super.togglePopupVisibility();
2258
- if (isDocumentAvailable() && this.lockFocus) {
2452
+ if (isDocumentAvailable() && this.wrapperContains(document.activeElement) && this.arrowButtonClicked) {
2259
2453
  this.button.nativeElement.focus();
2260
2454
  }
2455
+ super.togglePopupVisibility();
2261
2456
  }
2262
2457
  /**
2263
2458
  * @hidden
@@ -2302,86 +2497,22 @@ class SplitButtonComponent extends ListButton {
2302
2497
  this.blurWrapper();
2303
2498
  }
2304
2499
  }
2305
- ngOnDestroy() {
2306
- super.ngOnDestroy();
2307
- this.destroyPopup();
2308
- }
2309
- /**
2310
- * Toggles the visibility of the popup.
2311
- * If the `toggle` method is used to open or close the popup, the `open` and `close` events will not be fired.
2312
- *
2313
- * @param open - The state of the popup.
2314
- */
2315
- toggle(open) {
2316
- if (this.disabled) {
2317
- return;
2318
- }
2319
- tick(() => this._toggle(open === undefined ? !this._open : open));
2320
- }
2321
2500
  /**
2322
2501
  * Returns the current open state of the popup.
2323
2502
  */
2324
2503
  get isOpen() {
2325
2504
  return this.openState;
2326
2505
  }
2327
- enterHandler() {
2328
- if (this.disabled) {
2329
- return;
2330
- }
2331
- if (this.openState) {
2332
- let focused = this.focusService.focused;
2333
- if (isPresent(focused) && focused !== -1) {
2334
- this.emitItemClickHandler(focused);
2335
- }
2336
- }
2337
- else {
2338
- this.buttonClick.emit();
2339
- }
2340
- }
2341
2506
  updateButtonText() {
2342
2507
  if (isDocumentAvailable()) {
2343
2508
  let innerText = this.wrapper.innerText
2344
2509
  .split('\n')
2345
2510
  .join('')
2346
2511
  .trim();
2347
- //setTimout is needed because of `Expression has changed after it was checked.` error;
2512
+ //setTimeout is needed because of `Expression has changed after it was checked.` error;
2348
2513
  setTimeout(() => (this.buttonText = innerText), 0);
2349
2514
  }
2350
2515
  }
2351
- get appendTo() {
2352
- const { appendTo } = this.popupSettings;
2353
- if (!appendTo || appendTo === 'root') {
2354
- return undefined;
2355
- }
2356
- return appendTo === 'component' ? this.containerRef : appendTo;
2357
- }
2358
- _toggle(open) {
2359
- this._open = open;
2360
- this.destroyPopup();
2361
- if (this._open) {
2362
- this.createPopup();
2363
- }
2364
- }
2365
- createPopup() {
2366
- this.popupRef = this.popupService.open({
2367
- anchor: this.elRef,
2368
- anchorAlign: this.anchorAlign,
2369
- animate: this.popupSettings.animate,
2370
- appendTo: this.appendTo,
2371
- content: this.popupTemplate,
2372
- popupAlign: this.popupAlign,
2373
- popupClass: this.popupClasses
2374
- });
2375
- this.popupSubs.add(this.popupRef.popupAnchorViewportLeave.subscribe(() => (this.openState = false)));
2376
- this.popupSubs.add(this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this)));
2377
- }
2378
- destroyPopup() {
2379
- if (this.popupRef) {
2380
- this.popupSubs.unsubscribe();
2381
- this.popupRef.close();
2382
- this.popupRef = null;
2383
- }
2384
- }
2385
2516
  handleClasses(value, input) {
2386
2517
  const elem = this.wrapperRef.nativeElement;
2387
2518
  const classes = getStylingClasses('button', input, this[input], value);
@@ -2393,8 +2524,8 @@ class SplitButtonComponent extends ListButton {
2393
2524
  }
2394
2525
  }
2395
2526
  }
2396
- SplitButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SplitButtonComponent, deps: [{ token: FocusService }, { token: NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.PopupService }, { token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
2397
- SplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SplitButtonComponent, selector: "kendo-splitbutton", inputs: { text: "text", icon: "icon", iconClass: "iconClass", type: "type", imageUrl: "imageUrl", size: "size", rounded: "rounded", fillMode: "fillMode", themeColor: "themeColor", disabled: "disabled", popupSettings: "popupSettings", tabIndex: "tabIndex", textField: "textField", data: "data", buttonClass: "buttonClass", arrowButtonClass: "arrowButtonClass", arrowButtonIcon: "arrowButtonIcon" }, outputs: { buttonClick: "buttonClick", itemClick: "itemClick", onFocus: "focus", onBlur: "blur", open: "open", close: "close" }, host: { listeners: { "keydown": "keydown($event)", "keypress": "keypress($event)", "keyup": "keyup($event)" }, properties: { "class.k-focus": "this.isFocused", "class.k-split-button": "this.widgetClasses", "class.k-button-group": "this.widgetClasses", "attr.dir": "this.dir" } }, providers: [
2527
+ SplitButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SplitButtonComponent, deps: [{ token: FocusService }, { token: NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.PopupService }, { token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: PopupContainerService }], target: i0.ɵɵFactoryTarget.Component });
2528
+ SplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SplitButtonComponent, selector: "kendo-splitbutton", inputs: { text: "text", icon: "icon", iconClass: "iconClass", type: "type", imageUrl: "imageUrl", size: "size", rounded: "rounded", fillMode: "fillMode", themeColor: "themeColor", disabled: "disabled", popupSettings: "popupSettings", tabIndex: "tabIndex", textField: "textField", data: "data", buttonClass: "buttonClass", arrowButtonClass: "arrowButtonClass", arrowButtonIcon: "arrowButtonIcon" }, outputs: { buttonClick: "buttonClick", itemClick: "itemClick", onFocus: "focus", onBlur: "blur", open: "open", close: "close" }, host: { listeners: { "keydown": "keydown($event)", "keyup": "keyup($event)" }, properties: { "class.k-focus": "this.isFocused", "class.k-split-button": "this.widgetClasses", "class.k-button-group": "this.widgetClasses", "attr.dir": "this.dir" } }, providers: [
2398
2529
  FocusService,
2399
2530
  NavigationService,
2400
2531
  NAVIGATION_SETTINGS_PROVIDER$2,
@@ -2402,8 +2533,9 @@ SplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
2402
2533
  {
2403
2534
  provide: L10N_PREFIX,
2404
2535
  useValue: 'kendo.splitbutton'
2405
- }
2406
- ], queries: [{ propertyName: "itemTemplate", first: true, predicate: ButtonItemTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true, static: true }, { propertyName: "arrowButton", first: true, predicate: ["arrowButton"], descendants: true, read: ElementRef, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "containerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], exportAs: ["kendoSplitButton"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
2536
+ },
2537
+ PopupContainerService
2538
+ ], queries: [{ propertyName: "itemTemplate", first: true, predicate: ButtonItemTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }, { propertyName: "arrowButton", first: true, predicate: ["arrowButton"], descendants: true, read: ElementRef }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true }, { propertyName: "containerRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef }], exportAs: ["kendoSplitButton"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
2407
2539
  <ng-container kendoSplitButtonLocalizedMessages
2408
2540
  i18n-splitButtonLabel="kendo.splitbutton.splitButtonLabel|The text for the SplitButton aria-label"
2409
2541
  splitButtonLabel="{{ '{buttonText} splitbutton' }}">
@@ -2424,7 +2556,7 @@ SplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
2424
2556
  [iconClass]="iconClass"
2425
2557
  [imageUrl]="imageUrl"
2426
2558
  [ngClass]="buttonClass"
2427
- (focus)="onButtonFocus()"
2559
+ (focus)="onButtonFocus($event)"
2428
2560
  (click)="onButtonClick()"
2429
2561
  (blur)="onButtonBlur()"
2430
2562
  (mousedown)="toggleButtonActiveState(true)"
@@ -2462,7 +2594,6 @@ SplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
2462
2594
  [itemTemplate]="itemTemplate"
2463
2595
  (onItemClick)="onItemClick($event)"
2464
2596
  (keydown)="keyDownHandler($event)"
2465
- (keypress)="keyPressHandler($event)"
2466
2597
  (keyup)="keyUpHandler($event)"
2467
2598
  [attr.dir]="dir"
2468
2599
  [size]="size"
@@ -2483,7 +2614,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2483
2614
  {
2484
2615
  provide: L10N_PREFIX,
2485
2616
  useValue: 'kendo.splitbutton'
2486
- }
2617
+ },
2618
+ PopupContainerService
2487
2619
  ],
2488
2620
  selector: 'kendo-splitbutton',
2489
2621
  template: `
@@ -2507,7 +2639,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2507
2639
  [iconClass]="iconClass"
2508
2640
  [imageUrl]="imageUrl"
2509
2641
  [ngClass]="buttonClass"
2510
- (focus)="onButtonFocus()"
2642
+ (focus)="onButtonFocus($event)"
2511
2643
  (click)="onButtonClick()"
2512
2644
  (blur)="onButtonBlur()"
2513
2645
  (mousedown)="toggleButtonActiveState(true)"
@@ -2545,7 +2677,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2545
2677
  [itemTemplate]="itemTemplate"
2546
2678
  (onItemClick)="onItemClick($event)"
2547
2679
  (keydown)="keyDownHandler($event)"
2548
- (keypress)="keyPressHandler($event)"
2549
2680
  (keyup)="keyUpHandler($event)"
2550
2681
  [attr.dir]="dir"
2551
2682
  [size]="size"
@@ -2555,7 +2686,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2555
2686
  <ng-container #container></ng-container>
2556
2687
  `
2557
2688
  }]
2558
- }], ctorParameters: function () { return [{ type: FocusService }, { type: NavigationService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i3.PopupService }, { type: i0.ElementRef }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }]; }, propDecorators: { text: [{
2689
+ }], ctorParameters: function () { return [{ type: FocusService }, { type: NavigationService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i3.PopupService }, { type: i0.ElementRef }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: PopupContainerService }]; }, propDecorators: { text: [{
2559
2690
  type: Input
2560
2691
  }], icon: [{
2561
2692
  type: Input
@@ -2605,19 +2736,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2605
2736
  type: Output
2606
2737
  }], itemTemplate: [{
2607
2738
  type: ContentChild,
2608
- args: [ButtonItemTemplateDirective, { static: false }]
2739
+ args: [ButtonItemTemplateDirective]
2609
2740
  }], button: [{
2610
2741
  type: ViewChild,
2611
- args: ['button', { static: true }]
2742
+ args: ['button']
2612
2743
  }], arrowButton: [{
2613
2744
  type: ViewChild,
2614
- args: ['arrowButton', { static: true, read: ElementRef }]
2745
+ args: ['arrowButton', { read: ElementRef }]
2615
2746
  }], popupTemplate: [{
2616
2747
  type: ViewChild,
2617
- args: ['popupTemplate', { static: true }]
2748
+ args: ['popupTemplate']
2618
2749
  }], containerRef: [{
2619
2750
  type: ViewChild,
2620
- args: ['container', { read: ViewContainerRef, static: true }]
2751
+ args: ['container', { read: ViewContainerRef }]
2621
2752
  }], isFocused: [{
2622
2753
  type: HostBinding,
2623
2754
  args: ['class.k-focus']
@@ -2633,9 +2764,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2633
2764
  }], keydown: [{
2634
2765
  type: HostListener,
2635
2766
  args: ['keydown', ['$event']]
2636
- }], keypress: [{
2637
- type: HostListener,
2638
- args: ['keypress', ['$event']]
2639
2767
  }], keyup: [{
2640
2768
  type: HostListener,
2641
2769
  args: ['keyup', ['$event']]
@@ -2730,10 +2858,9 @@ const DEFAULT_FILL_MODE = 'solid';
2730
2858
  * ```
2731
2859
  */
2732
2860
  class DropDownButtonComponent extends ListButton {
2733
- constructor(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr) {
2734
- super(focusService, navigationService, wrapperRef, zone, localization, cdr);
2735
- this.popupService = popupService;
2736
- this.elRef = elRef;
2861
+ constructor(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, containerService) {
2862
+ super(focusService, navigationService, wrapperRef, zone, popupService, elRef, localization, cdr, containerService);
2863
+ this.containerService = containerService;
2737
2864
  /**
2738
2865
  * Defines the name of an existing icon in a Kendo UI theme.
2739
2866
  */
@@ -2789,24 +2916,10 @@ class DropDownButtonComponent extends ListButton {
2789
2916
  * * `none` &mdash;Removes the default CSS class (no class would be rendered).
2790
2917
  */
2791
2918
  this.themeColor = 'base';
2792
- /**
2793
- * Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
2794
- */
2795
- this.tabIndex = 0;
2796
2919
  /**
2797
2920
  * Fires each time the user clicks on a drop-down list item. The event data contains the data item bound to the clicked list item.
2798
2921
  */
2799
2922
  this.itemClick = new EventEmitter();
2800
- /**
2801
- * Fires each time the popup is about to open.
2802
- * This event is preventable. If you cancel the event, the popup will remain closed.
2803
- */
2804
- this.open = new EventEmitter();
2805
- /**
2806
- * Fires each time the popup is about to close.
2807
- * This event is preventable. If you cancel the event, the popup will remain open.
2808
- */
2809
- this.close = new EventEmitter();
2810
2923
  /**
2811
2924
  * Fires each time the DropDownButton gets focused.
2812
2925
  */
@@ -2816,38 +2929,11 @@ class DropDownButtonComponent extends ListButton {
2816
2929
  */
2817
2930
  this.onBlur = new EventEmitter();
2818
2931
  this.listId = guid();
2932
+ this.buttonId = guid();
2819
2933
  this._fillMode = DEFAULT_FILL_MODE;
2820
- this.popupSubs = new Subscription();
2821
2934
  this._itemClick = this.itemClick;
2822
2935
  this._blur = this.onBlur;
2823
2936
  }
2824
- /**
2825
- * Configures the popup of the DropDownButton.
2826
- *
2827
- * The available options are:
2828
- * - `animate: Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
2829
- * - `popupClass: String`&mdash;Specifies a list of CSS classes that are used to style the popup.
2830
- * - `appendTo: "root" | "component" | ViewContainerRef`&mdash;Specifies the component to which the popup will be appended.
2831
- * - `align: "left" | "center" | "right"`&mdash;Specifies the alignment of the popup.
2832
- */
2833
- set popupSettings(settings) {
2834
- this._popupSettings = Object.assign({ animate: true, popupClass: '' }, settings);
2835
- }
2836
- get popupSettings() {
2837
- return this._popupSettings;
2838
- }
2839
- /**
2840
- * Sets the disabled state of the DropDownButton.
2841
- */
2842
- set disabled(value) {
2843
- if (value && this.openState) {
2844
- this.openState = false;
2845
- }
2846
- this._disabled = value;
2847
- }
2848
- get disabled() {
2849
- return this._disabled;
2850
- }
2851
2937
  /**
2852
2938
  * Sets or gets the data of the DropDownButton.
2853
2939
  *
@@ -2876,44 +2962,6 @@ class DropDownButtonComponent extends ListButton {
2876
2962
  get fillMode() {
2877
2963
  return this._fillMode;
2878
2964
  }
2879
- /**
2880
- * @hidden
2881
- */
2882
- set openState(open) {
2883
- if (this.disabled) {
2884
- return;
2885
- }
2886
- const eventArgs = new PreventableEvent();
2887
- if (open) {
2888
- this.open.emit(eventArgs);
2889
- }
2890
- else {
2891
- this.close.emit(eventArgs);
2892
- }
2893
- if (eventArgs.isDefaultPrevented()) {
2894
- return;
2895
- }
2896
- this._toggle(open);
2897
- }
2898
- /**
2899
- * @hidden
2900
- */
2901
- get openState() {
2902
- return this._open;
2903
- }
2904
- /**
2905
- * @hidden
2906
- */
2907
- get componentTabIndex() {
2908
- return this.disabled ? (-1) : this.tabIndex;
2909
- }
2910
- get appendTo() {
2911
- const { appendTo } = this.popupSettings;
2912
- if (!appendTo || appendTo === 'root') {
2913
- return undefined;
2914
- }
2915
- return appendTo === 'component' ? this.container : appendTo;
2916
- }
2917
2965
  get focused() {
2918
2966
  return this._isFocused && !this._disabled;
2919
2967
  }
@@ -2934,15 +2982,12 @@ class DropDownButtonComponent extends ListButton {
2934
2982
  */
2935
2983
  keydown(event) {
2936
2984
  this.keyDownHandler(event);
2937
- if (event.keyCode === Keys.Space) {
2985
+ if (event.keyCode === Keys.Space || event.keyCode === Keys.Enter) {
2938
2986
  this._active = true;
2939
2987
  }
2940
- }
2941
- /**
2942
- * @hidden
2943
- */
2944
- keypress(event) {
2945
- this.keyPressHandler(event);
2988
+ if (event.keyCode === Keys.Enter) {
2989
+ event.preventDefault();
2990
+ }
2946
2991
  }
2947
2992
  /**
2948
2993
  * @hidden
@@ -2973,36 +3018,17 @@ class DropDownButtonComponent extends ListButton {
2973
3018
  * @hidden
2974
3019
  */
2975
3020
  openPopup() {
3021
+ this._isFocused = true;
2976
3022
  this.togglePopupVisibility();
2977
3023
  }
2978
3024
  /**
2979
3025
  * @hidden
2980
3026
  */
2981
3027
  onButtonBlur() {
2982
- if (!this.isOpen) {
3028
+ if (!this.openState) {
2983
3029
  this.blurWrapper();
2984
3030
  }
2985
3031
  }
2986
- /**
2987
- * @hidden
2988
- */
2989
- get anchorAlign() {
2990
- let align = { horizontal: this.popupSettings.align || 'left', vertical: 'bottom' };
2991
- if (this.direction === 'rtl' && !isPresent(this.popupSettings.align)) {
2992
- align.horizontal = 'right';
2993
- }
2994
- return align;
2995
- }
2996
- /**
2997
- * @hidden
2998
- */
2999
- get popupAlign() {
3000
- let align = { horizontal: this.popupSettings.align || 'left', vertical: 'top' };
3001
- if (this.direction === 'rtl' && !isPresent(this.popupSettings.align)) {
3002
- align.horizontal = 'right';
3003
- }
3004
- return align;
3005
- }
3006
3032
  /**
3007
3033
  * Focuses the DropDownButton component.
3008
3034
  */
@@ -3020,44 +3046,23 @@ class DropDownButtonComponent extends ListButton {
3020
3046
  this.blurWrapper();
3021
3047
  }
3022
3048
  }
3023
- ngOnChanges(changes) {
3024
- if (isChanged("popupSettings", changes) && isPresent(this.popupRef)) {
3025
- const popup = this.popupRef.popup.instance;
3026
- const newSettings = changes.popupSettings.currentValue;
3027
- popup.popupClass = newSettings.popupClass;
3028
- popup.animate = newSettings.animate;
3029
- popup.popupAlign = this.popupAlign;
3030
- }
3031
- }
3032
- ngOnDestroy() {
3033
- super.ngOnDestroy();
3034
- this.destroyPopup();
3035
- }
3036
- /**
3037
- * Toggles the visibility of the popup.
3038
- * If the `toggle` method is used to open or close the popup, the `open` and `close` events will not be fired.
3039
- *
3040
- * @param open - The state of the popup.
3041
- */
3042
- toggle(open) {
3043
- if (this.disabled) {
3044
- return;
3045
- }
3046
- tick(() => (this._toggle((open === undefined) ? !this._open : open)));
3047
- }
3048
- /**
3049
- * Returns the current open state of the popup.
3050
- */
3051
- get isOpen() {
3052
- return this.openState;
3049
+ ngAfterViewInit() {
3050
+ this.containerService.container = this.container;
3051
+ this.containerService.template = this.popupTemplate;
3053
3052
  }
3054
3053
  /**
3055
3054
  * @hidden
3056
3055
  */
3057
- handleFocus() {
3058
- if (!this._disabled && !this._isFocused) {
3056
+ handleFocus(event) {
3057
+ if (!this._disabled) {
3058
+ // eslint-disable-next-line no-unused-expressions
3059
+ !this._isFocused && this.onFocus.emit();
3059
3060
  this._isFocused = true;
3060
- this.onFocus.emit();
3061
+ this.focusService.resetFocus();
3062
+ const relatedTargetInList = event.relatedTarget && closest(event.relatedTarget, '.k-popup kendo-button-list');
3063
+ if (this.openState && !relatedTargetInList) {
3064
+ this.focusService.focus(0);
3065
+ }
3061
3066
  }
3062
3067
  }
3063
3068
  /**
@@ -3068,77 +3073,9 @@ class DropDownButtonComponent extends ListButton {
3068
3073
  || this.wrapper.contains(element)
3069
3074
  || (this.popupRef && this.popupRef.popupElement.contains(element));
3070
3075
  }
3071
- subscribeNavigationEvents() {
3072
- this.subs.add(this.navigationService.navigate
3073
- .subscribe(this.onArrowKeyNavigate.bind(this)));
3074
- this.subs.add(this.navigationService.enterup.subscribe(this.onNavigationEnterUp.bind(this)));
3075
- this.subs.add(this.navigationService.open.subscribe(this.onNavigationOpen.bind(this)));
3076
- this.subs.add(merge(this.navigationService.close, this.navigationService.esc).subscribe(this.onNavigationClose.bind(this)));
3077
- }
3078
- onNavigationEnterUp() {
3079
- if (!this._disabled && !this.openState) {
3080
- this._active = false;
3081
- }
3082
- if (this.openState) {
3083
- let focused = this.focusService.focused;
3084
- if (isPresent(focused) && focused !== -1) {
3085
- this.emitItemClickHandler(focused);
3086
- }
3087
- }
3088
- this.togglePopupVisibility();
3089
- if (!this.openState && isDocumentAvailable()) {
3090
- this.button.nativeElement.focus();
3091
- }
3092
- }
3093
- onNavigationOpen() {
3094
- if (!this._disabled && !this.openState) {
3095
- this.togglePopupVisibility();
3096
- }
3097
- }
3098
- onNavigationClose() {
3099
- if (this.openState) {
3100
- this.togglePopupVisibility();
3101
- if (isDocumentAvailable()) {
3102
- this.button.nativeElement.focus();
3103
- }
3104
- }
3105
- }
3106
- onArrowKeyNavigate(index) {
3107
- this.focusService.focus(index);
3108
- }
3109
- _toggle(open) {
3110
- if (this._open === open) {
3111
- return;
3112
- }
3113
- this._open = open;
3114
- this.destroyPopup();
3115
- if (this._open) {
3116
- this.createPopup();
3117
- }
3118
- }
3119
- createPopup() {
3120
- this.popupRef = this.popupService.open({
3121
- anchor: this.elRef,
3122
- anchorAlign: this.anchorAlign,
3123
- animate: this.popupSettings.animate,
3124
- appendTo: this.appendTo,
3125
- content: this.popupTemplate,
3126
- popupAlign: this.popupAlign,
3127
- popupClass: this.popupClasses
3128
- });
3129
- this.popupSubs.add(this.popupRef.popupAnchorViewportLeave.subscribe(() => this.openState = false));
3130
- this.popupSubs.add(this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this)));
3131
- }
3132
- destroyPopup() {
3133
- if (this.popupRef) {
3134
- this.popupRef.close();
3135
- this.popupRef = null;
3136
- this.popupSubs.unsubscribe();
3137
- }
3138
- }
3139
3076
  }
3140
- DropDownButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropDownButtonComponent, deps: [{ token: FocusService }, { token: NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.PopupService }, { token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3141
- DropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: { icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", popupSettings: "popupSettings", textField: "textField", disabled: "disabled", data: "data", size: "size", rounded: "rounded", fillMode: "fillMode", themeColor: "themeColor", buttonClass: "buttonClass", tabIndex: "tabIndex" }, outputs: { itemClick: "itemClick", open: "open", close: "close", onFocus: "focus", onBlur: "blur" }, host: { listeners: { "keydown": "keydown($event)", "keypress": "keypress($event)", "keyup": "keyup($event)", "mousedown": "mousedown($event)", "mouseup": "mouseup($event)" }, properties: { "class.k-focus": "this.focused", "class.k-dropdown-button": "this.widgetClasses", "attr.dir": "this.dir" } }, providers: [
3077
+ DropDownButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DropDownButtonComponent, deps: [{ token: FocusService }, { token: NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.PopupService }, { token: i0.ElementRef }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: PopupContainerService }], target: i0.ɵɵFactoryTarget.Component });
3078
+ DropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: { icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", textField: "textField", data: "data", size: "size", rounded: "rounded", fillMode: "fillMode", themeColor: "themeColor" }, outputs: { itemClick: "itemClick", onFocus: "focus", onBlur: "blur" }, host: { listeners: { "keydown": "keydown($event)", "keyup": "keyup($event)", "mousedown": "mousedown($event)", "mouseup": "mouseup($event)" }, properties: { "class.k-focus": "this.focused", "class.k-dropdown-button": "this.widgetClasses", "attr.dir": "this.dir" } }, providers: [
3142
3079
  FocusService,
3143
3080
  NavigationService,
3144
3081
  NAVIGATION_SETTINGS_PROVIDER$1,
@@ -3146,11 +3083,12 @@ DropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
3146
3083
  {
3147
3084
  provide: L10N_PREFIX,
3148
3085
  useValue: 'kendo.dropdownbutton'
3149
- }
3150
- ], queries: [{ propertyName: "itemTemplate", first: true, predicate: ButtonItemTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true, static: true }, { propertyName: "buttonList", first: true, predicate: ["buttonList"], descendants: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], exportAs: ["kendoDropDownButton"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
3086
+ },
3087
+ PopupContainerService
3088
+ ], queries: [{ propertyName: "itemTemplate", first: true, predicate: ButtonItemTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }, { propertyName: "buttonList", first: true, predicate: ["buttonList"], descendants: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef }], exportAs: ["kendoDropDownButton"], usesInheritance: true, ngImport: i0, template: `
3151
3089
  <button kendoButton #button
3152
- role="menu"
3153
3090
  type="button"
3091
+ [id]="buttonId"
3154
3092
  [tabindex]="componentTabIndex"
3155
3093
  [class.k-active]="active"
3156
3094
  [disabled]="disabled"
@@ -3163,12 +3101,12 @@ DropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
3163
3101
  [fillMode]="fillMode"
3164
3102
  [themeColor]="fillMode ? themeColor : null"
3165
3103
  (click)="openPopup()"
3166
- (focus)="handleFocus()"
3104
+ (focus)="handleFocus($event)"
3167
3105
  (blur)="onButtonBlur()"
3168
3106
  [attr.aria-disabled]="disabled"
3169
3107
  [attr.aria-expanded]="openState"
3170
3108
  [attr.aria-haspopup]="true"
3171
- [attr.aria-owns]="listId"
3109
+ [attr.aria-controls]="listId"
3172
3110
  >
3173
3111
  <ng-content></ng-content>
3174
3112
  </button>
@@ -3181,9 +3119,9 @@ DropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
3181
3119
  [itemTemplate]="itemTemplate"
3182
3120
  (onItemClick)="onItemClick($event)"
3183
3121
  (keydown)="keyDownHandler($event)"
3184
- (keypress)="keyPressHandler($event)"
3185
3122
  (keyup)="keyUpHandler($event)"
3186
3123
  [attr.dir]="dir"
3124
+ [attr.aria-labelledby]="buttonId"
3187
3125
  [size]="size"
3188
3126
  >
3189
3127
  </kendo-button-list>
@@ -3202,13 +3140,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3202
3140
  {
3203
3141
  provide: L10N_PREFIX,
3204
3142
  useValue: 'kendo.dropdownbutton'
3205
- }
3143
+ },
3144
+ PopupContainerService
3206
3145
  ],
3207
3146
  selector: 'kendo-dropdownbutton',
3208
3147
  template: `
3209
3148
  <button kendoButton #button
3210
- role="menu"
3211
3149
  type="button"
3150
+ [id]="buttonId"
3212
3151
  [tabindex]="componentTabIndex"
3213
3152
  [class.k-active]="active"
3214
3153
  [disabled]="disabled"
@@ -3221,12 +3160,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3221
3160
  [fillMode]="fillMode"
3222
3161
  [themeColor]="fillMode ? themeColor : null"
3223
3162
  (click)="openPopup()"
3224
- (focus)="handleFocus()"
3163
+ (focus)="handleFocus($event)"
3225
3164
  (blur)="onButtonBlur()"
3226
3165
  [attr.aria-disabled]="disabled"
3227
3166
  [attr.aria-expanded]="openState"
3228
3167
  [attr.aria-haspopup]="true"
3229
- [attr.aria-owns]="listId"
3168
+ [attr.aria-controls]="listId"
3230
3169
  >
3231
3170
  <ng-content></ng-content>
3232
3171
  </button>
@@ -3239,9 +3178,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3239
3178
  [itemTemplate]="itemTemplate"
3240
3179
  (onItemClick)="onItemClick($event)"
3241
3180
  (keydown)="keyDownHandler($event)"
3242
- (keypress)="keyPressHandler($event)"
3243
3181
  (keyup)="keyUpHandler($event)"
3244
3182
  [attr.dir]="dir"
3183
+ [attr.aria-labelledby]="buttonId"
3245
3184
  [size]="size"
3246
3185
  >
3247
3186
  </kendo-button-list>
@@ -3249,18 +3188,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3249
3188
  <ng-container #container></ng-container>
3250
3189
  `
3251
3190
  }]
3252
- }], ctorParameters: function () { return [{ type: FocusService }, { type: NavigationService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i3.PopupService }, { type: i0.ElementRef }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { icon: [{
3191
+ }], ctorParameters: function () { return [{ type: FocusService }, { type: NavigationService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i3.PopupService }, { type: i0.ElementRef }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: PopupContainerService }]; }, propDecorators: { icon: [{
3253
3192
  type: Input
3254
3193
  }], iconClass: [{
3255
3194
  type: Input
3256
3195
  }], imageUrl: [{
3257
3196
  type: Input
3258
- }], popupSettings: [{
3259
- type: Input
3260
3197
  }], textField: [{
3261
3198
  type: Input
3262
- }], disabled: [{
3263
- type: Input
3264
3199
  }], data: [{
3265
3200
  type: Input
3266
3201
  }], size: [{
@@ -3271,16 +3206,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3271
3206
  type: Input
3272
3207
  }], themeColor: [{
3273
3208
  type: Input
3274
- }], buttonClass: [{
3275
- type: Input
3276
- }], tabIndex: [{
3277
- type: Input
3278
3209
  }], itemClick: [{
3279
3210
  type: Output
3280
- }], open: [{
3281
- type: Output
3282
- }], close: [{
3283
- type: Output
3284
3211
  }], onFocus: [{
3285
3212
  type: Output,
3286
3213
  args: ['focus']
@@ -3298,25 +3225,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
3298
3225
  args: ['attr.dir']
3299
3226
  }], itemTemplate: [{
3300
3227
  type: ContentChild,
3301
- args: [ButtonItemTemplateDirective, { static: false }]
3228
+ args: [ButtonItemTemplateDirective]
3302
3229
  }], button: [{
3303
3230
  type: ViewChild,
3304
- args: ['button', { static: true }]
3231
+ args: ['button']
3305
3232
  }], buttonList: [{
3306
3233
  type: ViewChild,
3307
- args: ['buttonList', { static: false }]
3234
+ args: ['buttonList']
3308
3235
  }], popupTemplate: [{
3309
3236
  type: ViewChild,
3310
- args: ['popupTemplate', { static: true }]
3237
+ args: ['popupTemplate']
3311
3238
  }], container: [{
3312
3239
  type: ViewChild,
3313
- args: ['container', { read: ViewContainerRef, static: true }]
3240
+ args: ['container', { read: ViewContainerRef }]
3314
3241
  }], keydown: [{
3315
3242
  type: HostListener,
3316
3243
  args: ['keydown', ['$event']]
3317
- }], keypress: [{
3318
- type: HostListener,
3319
- args: ['keypress', ['$event']]
3320
3244
  }], keyup: [{
3321
3245
  type: HostListener,
3322
3246
  args: ['keyup', ['$event']]
@@ -4722,7 +4646,7 @@ class FloatingActionButtonComponent {
4722
4646
  this.subscriptions.add(this.navigationService.enter.subscribe(this.onNavigationEnterPress.bind(this)));
4723
4647
  this.subscriptions.add(merge(this.navigationService.close, this.navigationService.esc).subscribe(this.onNavigationClose.bind(this)));
4724
4648
  }
4725
- onArrowKeyNavigate(index) {
4649
+ onArrowKeyNavigate({ index }) {
4726
4650
  this.focusService.focus(index);
4727
4651
  }
4728
4652
  onNavigationEnterPress() {