com.phloxui
Version:
PhloxUI Ng2+ Framework
64 lines (63 loc) • 3.05 kB
TypeScript
import { OnInit } from '@angular/core';
import { Subject } from 'rxjs/Subject';
import { PhloxApp } from './PhloxApp.component';
import { IApplicationAware } from './IApplicationAware';
import { ObservableManager, PhloxAppService, NeedFocusService } from '../service/services';
import { INeedFocus } from '../component/components';
/**
* <p style="text-indent: 2em;">
* An abstract base class for side slide panel component. This class will automatically publish <code>hide</code> and <code>
* show</code> events to [[ObservableManager]] on topic name <code>side-slide-panel.[sub-topic-name].show</code> and <code>
* side-slide-panel.[sub-topic-name].hide</code> respectively. You can also control the show/hide state of this component
* via [[ObservableManager]] by publishing <code>boolean</code> to <code>side-slide-panel.[sub-topic-name].cmd</code> topic.
* This class provides the default implementation for method [[onLostFocus]] to automatically hide this component when focus lost.
* </p>
*
* @author shiorin, tee4cute
* @see [[ObservableManager]]
* @see [[INeedFocus]]
*/
export declare abstract class AbstractSideSlidePanel implements IApplicationAware, OnInit, INeedFocus {
static readonly SUB_TOPIC_NAME: string;
static readonly SHOW_TOPIC_NAME: string;
static readonly HIDE_TOPIC_NAME: string;
static readonly CMD_TOPIC_NAME: string;
static getShowTopicName(subTopicName: string): string;
static getHideTopicName(subTopicName: string): string;
static getCmdTopicName(subTopicName: string): string;
protected phloxAppService: PhloxAppService;
protected observableMgr: ObservableManager;
protected needFocusService: NeedFocusService;
protected active: boolean;
protected subTopicName: string;
protected showSubjects: Subject<any>[];
protected hideSubjects: Subject<any>[];
private readonly app;
constructor(phloxAppService: PhloxAppService, observableMgr: ObservableManager, needFocusService: NeedFocusService, subTopicName: string);
private initSideSlideEventTopics(showTopic, hideTopic, showCmdTopic);
ngOnInit(): void;
getApplication(): PhloxApp;
/**
* <p style="text-indent: 1em;">
* Show this component. This method also publishes an event to topic <code>side-slide-panel.[sub-topic-name].show</code>.
* </p>
*/
show(): void;
/**
* <p style="text-indent: 1em;">
* Hide this component. This method also publishes an event to topic <code>side-slide-panel.[sub-topic-name].hide</code>.
* </p>
*/
hide(): void;
/**
* <p style="text-indent: 1em;">
* Toggle show/hide this component. This method also publishes an event to topic <code>side-slide-panel.[sub-topic-name].show</code>
* and <code>side-slide-panel.[sub-topic-name].hide</code> when the component is shown or hidden respectively.
* </p>
*/
onToggle(event: MouseEvent): void;
onFocus(event: any): void;
onLostFocus(event: any): void;
isActive(): boolean;
getSubTopicName(): string;
}