com.phloxui
Version:
PhloxUI Ng2+ Framework
60 lines (59 loc) • 2.6 kB
TypeScript
import { EventEmitter } from '@angular/core';
import { AbstractMenu } from './AbstractMenu';
import { NeedFocusService } from '../service/NeedFocusService.service';
import { AbstractI18NApplicable } from '../share/AbstractI18NApplicable';
import { MenuItemModel } from './model/MenuItemModel';
export declare const ACTION_PERFORM: string;
/**
* <p style="text-indent: 2em;">
* An abstract base class for <code>menu item</code> component. This class provides you a default [[onClick]] event handler which
* automatically call the [[MenuItemModel.actionPerformedHandler]] if specified. It also resets the current focusing component if
* [[MenuItemModel.autoResetFocus]] is set to <code>true</code>. A <code>menu item</code> can be, but not necessary, in a parent
* <code>menu</code>. It is up to each component implementation which is a sub class of this class to decide that it is required
* to allow a <code>menu item</code> can be displayed standalone outside the parent <code>menu</code> or not.
* </p>
*
* @author shiorin, tee4cute
* @see [[MenuItemModel]]
* @see [[AbstractMenu]]
*/
export declare abstract class AbstractMenuItem extends AbstractI18NApplicable {
protected model: MenuItemModel;
protected menu: AbstractMenu;
protected needFocusService: NeedFocusService;
protected clickEvent: EventEmitter<any>;
protected beforeClickEvent: EventEmitter<any>;
constructor(needFocusService: NeedFocusService);
onClick($event: MouseEvent, fireEvent?: boolean): void;
emitActionPerform($event?: any): void;
protected emitBeforeClickEvent($event?: any): void;
protected emitClickEvent($event?: any): void;
/**
* <p style="text-indent: 1em;">
* Get the parent <code>memu</code> associated with <code>this</code> <code>menu item</code>.
* </p>
*/
getMenu(): AbstractMenu;
/**
* <p style="text-indent: 1em;">
* Set a parent <code>menu</code> associated with <code>this</code> <code>menu item</code>.
* </p>
*/
setMenu(menu: AbstractMenu): void;
/**
* <p style="text-indent: 1em;">
* Get the <code>model</code> of <code>this</code> <code>menu item</code>.
* </p>
*/
getModel(): MenuItemModel;
/**
* <p style="text-indent: 1em;">
* Set a <code>model</code> of <code>this</code> <code>menu item</code>.
* </p>
*/
setModel(model: MenuItemModel): void;
getClickEvent(): EventEmitter<any>;
setClickEvent(event: EventEmitter<any>): void;
getBeforeClickEvent(): EventEmitter<any>;
setBeforeClickEvent(event: EventEmitter<any>): void;
}