@rdkmaster/jigsaw-labs
Version:
Jigsaw, the next generation component set for RDK
65 lines (64 loc) • 2.87 kB
TypeScript
import { AfterContentInit, AfterViewInit, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList, Renderer2 } from "@angular/core";
import { ButtonInfo, IPopupable } from "../../service/popup.service";
import { AbstractJigsawComponent } from "../common";
import { JigsawButton } from "../button/button";
export interface IDialog extends IPopupable {
buttons: ButtonInfo[];
caption: string;
dialog: JigsawDialog;
dispose: (answer?: ButtonInfo) => void;
}
export declare type DialogCallback = (button: ButtonInfo) => void;
/**
* 这个类用于应用在需要根据已有的对话框组件派生出该对话框组件的更具体的对话框的时候使用。
* 对话框组件是具备一定抽象性的,因此他们的API一般会较多较复杂,应用在使用时需要做较多的配置。
* 已知的对话框组件有 JigsawDialog、JigsawAlert、JigsawNotification
* 其中,Jigsaw已经基于JigsawAlert这类对话框派生出了4个内置的具体Alert组件,分别是
* JigsawInfoAlert、JigsawWarningAlert、JigsawErrorAlert、JigsawConfirmAlert
* 可以看到JigsawAlert使用起来比较麻烦,但是它具体化后的这些组件使用起来就非常简单了。
*/
export declare abstract class DialogBase implements IDialog, AfterViewInit, OnInit {
initData: any;
abstract dialog: JigsawDialog;
private _caption;
caption: string;
private _buttons;
buttons: ButtonInfo[];
answer: EventEmitter<ButtonInfo>;
dispose: (answer?: ButtonInfo) => void;
ngOnInit(): void;
ngAfterViewInit(): void;
}
/**
* 这是所有对话框组件的基类,是一个内部,应用一般不应该直接使用这个类。
* 当需要实现一种新的对话框的时候,则需要继承这个类,已知的对话框组件有JigsawDialog、JigsawAlert、JigsawNotification
*/
export declare abstract class AbstractDialogComponentBase extends AbstractJigsawComponent implements IPopupable, AfterContentInit, OnDestroy {
buttons: ButtonInfo[];
caption: string;
initData: any;
protected popupElement: HTMLElement;
protected renderer: Renderer2;
protected elementRef: ElementRef;
private _top;
top: string;
answer: EventEmitter<ButtonInfo>;
close: EventEmitter<any>;
ngAfterContentInit(): void;
dispose(answer?: ButtonInfo): void;
protected abstract getPopupElement(): HTMLElement;
protected init(): void;
ngOnDestroy(): void;
}
export declare class JigsawDialog extends AbstractDialogComponentBase {
close: EventEmitter<any>;
caption: string;
/**
* @internal
*/
_$inlineButtons: QueryList<JigsawButton>;
constructor(renderer: Renderer2, elementRef: ElementRef);
protected getPopupElement(): HTMLElement;
}
export declare class JigsawDialogModule {
}