menu-item.d.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. import { FocusableOption, FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';
  9. import { ElementRef, OnDestroy } from '@angular/core';
  10. import { CanDisable, CanDisableCtor, CanDisableRipple, CanDisableRippleCtor } from '@angular/material/core';
  11. import { Subject } from 'rxjs';
  12. import { MatMenuPanel } from './menu-panel';
  13. /** @docs-private */
  14. declare class MatMenuItemBase {
  15. }
  16. declare const _MatMenuItemMixinBase: CanDisableRippleCtor & CanDisableCtor & typeof MatMenuItemBase;
  17. /**
  18. * This directive is intended to be used inside an mat-menu tag.
  19. * It exists mostly to set the role attribute.
  20. */
  21. export declare class MatMenuItem extends _MatMenuItemMixinBase implements FocusableOption, CanDisable, CanDisableRipple, OnDestroy {
  22. private _elementRef;
  23. private _focusMonitor?;
  24. _parentMenu?: MatMenuPanel<MatMenuItem> | undefined;
  25. /** ARIA role for the menu item. */
  26. role: 'menuitem' | 'menuitemradio' | 'menuitemcheckbox';
  27. private _document;
  28. /** Stream that emits when the menu item is hovered. */
  29. readonly _hovered: Subject<MatMenuItem>;
  30. /** Whether the menu item is highlighted. */
  31. _highlighted: boolean;
  32. /** Whether the menu item acts as a trigger for a sub-menu. */
  33. _triggersSubmenu: boolean;
  34. constructor(_elementRef: ElementRef<HTMLElement>, document?: any, _focusMonitor?: FocusMonitor | undefined, _parentMenu?: MatMenuPanel<MatMenuItem> | undefined);
  35. /** Focuses the menu item. */
  36. focus(origin?: FocusOrigin, options?: FocusOptions): void;
  37. ngOnDestroy(): void;
  38. /** Used to set the `tabindex`. */
  39. _getTabIndex(): string;
  40. /** Returns the host DOM element. */
  41. _getHostElement(): HTMLElement;
  42. /** Prevents the default element actions if it is disabled. */
  43. _checkDisabled(event: Event): void;
  44. /** Emits to the hover stream. */
  45. _handleMouseEnter(): void;
  46. /** Gets the label to be used when determining whether the option should be focused. */
  47. getLabel(): string;
  48. }
  49. export {};