UNPKG

@ux-aspects/ux-aspects

Version:

Open source user interface framework for building modern, responsive, mobile big data applications

59 lines (58 loc) 2.84 kB
import { FocusableOption, FocusOrigin } from '@angular/cdk/a11y'; import { BooleanInput } from '@angular/cdk/coercion'; import { EventEmitter, OnDestroy, OnInit } from '@angular/core'; import { BehaviorSubject, Subject } from 'rxjs'; import { MenuItemType } from './menu-item-type.enum'; import * as i0 from "@angular/core"; export declare class MenuItemComponent implements OnInit, OnDestroy, FocusableOption { private readonly _menu; private readonly _elementRef; private readonly _focusIndicatorService; private readonly _renderer; /** Define if this item is disabled or not */ set disabled(disabled: boolean); get disabled(): boolean; /** Determine if the menu should close on item click/enter.*/ set closeOnSelect(value: boolean); get closeOnSelect(): boolean; /** Define the role of the element */ role: 'menuitem' | 'menuitemradio' | 'menuitemcheckbox'; /** Emits when the menu item is clicked or the enter key is pressed. */ activate: EventEmitter<MouseEvent | KeyboardEvent>; /** Access the open state */ get isOpen(): boolean; /** Indicate the type of the menu item */ readonly type: MenuItemType; /** Store the current hover state */ readonly isHovered$: BehaviorSubject<boolean>; /** Store the current focus state */ readonly isFocused$: BehaviorSubject<boolean>; /** Store the current expanded state */ readonly isExpanded$: BehaviorSubject<boolean>; /** Emit when an item is clicked */ readonly onClick$: Subject<FocusOrigin>; /** Store the focus indicator instance */ private _focusIndicator; /** Automatically unsubscribe from observables on destroy */ private readonly _onDestroy$; private _disabled; private _closeOnSelect; ngOnInit(): void; ngOnDestroy(): void; focus(origin: FocusOrigin): void; /** This function is built into the CDK manager to allow jumping to items based on text content */ getLabel(): string; _onMouseEnter(): void; _onMouseLeave(): void; _onFocus(): void; _onBlur(): void; _onClick(event: MouseEvent | KeyboardEvent): void; /** Forward any keyboard events to the MenuComponent for accessibility */ _onKeydown(event: KeyboardEvent): void; /** Update the tab index on this item */ private setTabIndex; static ngAcceptInputType_disabled: boolean | string; static ngAcceptInputType_closeOnSelect: BooleanInput; static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemComponent, "[uxMenuItem]", never, { "disabled": { "alias": "disabled"; "required": false; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; }; "role": { "alias": "role"; "required": false; }; }, { "activate": "activate"; }, never, ["*"], false, never>; }