UNPKG

@covalent/core

Version:

Core Teradata UI Platform for layouts, icons, custom components and themes. This should be added as a dependency for any project that wants to use layouts, icons and themes for Angular Material.

262 lines (251 loc) 11.3 kB
import * as i0 from '@angular/core'; import { AfterViewInit, OnDestroy, ElementRef, AfterContentInit, QueryList, EventEmitter, Renderer2 } from '@angular/core'; import { ThemePalette } from '@angular/material/core'; import { MatDialogConfig, MatDialogRef } from '@angular/material/dialog'; import { ComponentType } from '@angular/cdk/portal'; import { DragRef } from '@angular/cdk/drag-drop'; import { Subject, Subscription } from 'rxjs'; declare class TdAlertDialogComponent { private _dialogRef; title?: string; message?: string; closeButton?: string; close(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TdAlertDialogComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TdAlertDialogComponent, "td-alert-dialog", never, {}, {}, never, never, true, never>; } declare class TdConfirmDialogComponent { private _dialogRef; title?: string; message?: string; cancelButton: string; acceptButton: string; isDestructive: boolean; cancel(): void; accept(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TdConfirmDialogComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TdConfirmDialogComponent, "td-confirm-dialog", never, {}, {}, never, never, true, never>; } declare class TdPromptDialogComponent implements AfterViewInit, OnDestroy { private _ngZone; private _dialogRef; title?: string; message?: string; value?: string; cancelButton: string; acceptButton: string; /** The native `<input matInput />` element. */ _input: ElementRef<HTMLInputElement>; _closeBtn: ElementRef<HTMLButtonElement>; _acceptBtn: ElementRef<HTMLButtonElement>; private _destroy$; ngAfterViewInit(): void; ngOnDestroy(): void; cancel(): void; accept(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TdPromptDialogComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TdPromptDialogComponent, "td-prompt-dialog", never, {}, {}, never, never, true, never>; } declare class TdDialogTitleDirective { static ɵfac: i0.ɵɵFactoryDeclaration<TdDialogTitleDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TdDialogTitleDirective, "[tdDialogTitle]", never, {}, {}, never, never, true, never>; } declare class TdDialogContentDirective { static ɵfac: i0.ɵɵFactoryDeclaration<TdDialogContentDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TdDialogContentDirective, "[tdDialogContent]", never, {}, {}, never, never, true, never>; } declare class TdDialogActionsDirective { static ɵfac: i0.ɵɵFactoryDeclaration<TdDialogActionsDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TdDialogActionsDirective, "[tdDialogActions]", never, {}, {}, never, never, true, never>; } declare class TdDialogStatusDirective { static ɵfac: i0.ɵɵFactoryDeclaration<TdDialogStatusDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TdDialogStatusDirective, "[tdDialogStatus]", never, {}, {}, never, never, true, never>; } declare class TdDialogComponent implements AfterContentInit { dialogTitle: QueryList<TdDialogTitleDirective>; dialogContent: QueryList<TdDialogContentDirective>; dialogActions: QueryList<TdDialogActionsDirective>; dialogStatus: QueryList<TdDialogStatusDirective>; ngAfterContentInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TdDialogComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TdDialogComponent, "td-dialog", never, {}, {}, ["dialogTitle", "dialogContent", "dialogActions", "dialogStatus"], ["[tdDialogStatus]", "[tdDialogTitle]", "[tdDialogContent]", "[tdDialogActions]"], true, never>; } declare class TdWindowDialogComponent { toolbarColor?: ThemePalette; docked?: boolean | undefined; title?: string; toggleDockedStateLabel?: string; closeLabel?: string; dockToggled: EventEmitter<boolean>; closed: EventEmitter<void>; toolbarHeight: number; toggleDockedState(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TdWindowDialogComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TdWindowDialogComponent, "td-window-dialog", never, { "toolbarColor": { "alias": "toolbarColor"; "required": false; }; "docked": { "alias": "docked"; "required": false; }; "title": { "alias": "title"; "required": false; }; "toggleDockedStateLabel": { "alias": "toggleDockedStateLabel"; "required": false; }; "closeLabel": { "alias": "closeLabel"; "required": false; }; }, { "dockToggled": "dockToggled"; "closed": "closed"; }, never, ["*"], true, never>; } type TdStatusDialogStates = 'error' | 'positive' | 'warning'; type TdStatusDialogDetailsLabels = { showDetailsLabel: string; hideDetailsLabel: string; }; declare class TdStatusDialogComponent { private _dialogRef; closeButton?: string; message?: string; state?: TdStatusDialogStates; title?: string; details?: string; showDetails?: boolean | undefined; detailsLabels?: TdStatusDialogDetailsLabels; close(): void; getStatusIcon(): string; toggleDetails(): void; static ɵfac: i0.ɵɵFactoryDeclaration<TdStatusDialogComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<TdStatusDialogComponent, "td-status-dialog", never, {}, {}, never, never, true, never>; } /** * @deprecated This module is deprecated and will be removed in future versions. * Please migrate to using standalone components as soon as possible. */ declare class CovalentDialogsModule { static ɵfac: i0.ɵɵFactoryDeclaration<CovalentDialogsModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<CovalentDialogsModule, never, [typeof TdAlertDialogComponent, typeof TdConfirmDialogComponent, typeof TdPromptDialogComponent, typeof TdDialogComponent, typeof TdDialogStatusDirective, typeof TdDialogTitleDirective, typeof TdDialogActionsDirective, typeof TdDialogContentDirective, typeof TdWindowDialogComponent, typeof TdAlertDialogComponent, typeof TdConfirmDialogComponent, typeof TdPromptDialogComponent, typeof TdStatusDialogComponent], [typeof TdAlertDialogComponent, typeof TdConfirmDialogComponent, typeof TdPromptDialogComponent, typeof TdDialogComponent, typeof TdDialogStatusDirective, typeof TdDialogTitleDirective, typeof TdDialogActionsDirective, typeof TdDialogContentDirective, typeof TdWindowDialogComponent, typeof TdAlertDialogComponent, typeof TdConfirmDialogComponent, typeof TdPromptDialogComponent, typeof TdStatusDialogComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<CovalentDialogsModule>; } interface IDialogConfig extends MatDialogConfig { title?: string; message: string; } interface IAlertConfig extends IDialogConfig { closeButton?: string; } interface IConfirmConfig extends IDialogConfig { acceptButton?: string; cancelButton?: string; isDestructive?: boolean; } interface IPromptConfig extends IConfirmConfig { value?: string; } interface IStatusConfig extends IAlertConfig { state?: TdStatusDialogStates; details?: string; detailsLabels?: TdStatusDialogDetailsLabels; } interface IDraggableConfig<T> { component: ComponentType<T>; config?: MatDialogConfig; dragHandleSelectors?: string[]; draggableClass?: string; } interface IDraggableRefs<T> { matDialogRef: MatDialogRef<T>; dragRefSubject: Subject<DragRef>; } declare class TdDialogService { private _document; private _dialogService; private _dragDrop; private rendererFactory; private _renderer2; constructor(); /** * params: * - component: ComponentType<T> * - config: MatDialogConfig * Wrapper function over the open() method in MatDialog. * Opens a modal dialog containing the given component. */ open<T>(component: ComponentType<T>, config?: MatDialogConfig): MatDialogRef<T>; /** * Wrapper function over the closeAll() method in MatDialog. * Closes all of the currently-open dialogs. */ closeAll(): void; /** * params: * - config: IAlertConfig { * message: string; * title?: string; * viewContainerRef?: ViewContainerRef; * closeButton?: string; * } * * Opens an alert dialog with the provided config. * Returns an MatDialogRef<TdAlertDialogComponent> object. */ openAlert(config: IAlertConfig): MatDialogRef<TdAlertDialogComponent>; /** * params: * - config: IConfirmConfig { * message: string; * title?: string; * viewContainerRef?: ViewContainerRef; * acceptButton?: string; * cancelButton?: string; * isDestructive?: boolean; * } * * Opens a confirm dialog with the provided config. * Returns an MatDialogRef<TdConfirmDialogComponent> object. */ openConfirm(config: IConfirmConfig): MatDialogRef<TdConfirmDialogComponent>; /** * params: * - config: IPromptConfig { * message: string; * title?: string; * value?: string; * viewContainerRef?: ViewContainerRef; * acceptButton?: string; * cancelButton?: string; * } * * Opens a prompt dialog with the provided config. * Returns an MatDialogRef<TdPromptDialogComponent> object. */ openPrompt(config: IPromptConfig): MatDialogRef<TdPromptDialogComponent>; /** * Opens a draggable dialog containing the given component. */ openDraggable<T>({ component, config, dragHandleSelectors, draggableClass, }: IDraggableConfig<T>): IDraggableRefs<T>; private _createConfig; /** * params: * - config: IStatusConfig { * closeButton?: string; * details?: string; * detailsLabels?: TdStatusDialogDetailsLabels; * message: string; * state?: 'error' | 'positive' | 'warning' * title?: string; * viewContainerRef?: ViewContainerRef; * } * * Opens a status dialog with the provided config. * Returns an MatDialogRef<TdStatusDialogComponent> object. */ openStatus(config: IStatusConfig): MatDialogRef<TdStatusDialogComponent>; static ɵfac: i0.ɵɵFactoryDeclaration<TdDialogService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<TdDialogService>; } declare class ResizableDraggableDialog { private _document; private _renderer2; private _dialogRef; private _dragRef; cornerElements: HTMLElement[]; pointerDownSubs: Subscription[]; constructor(_document: any, _renderer2: Renderer2, _dialogRef: MatDialogRef<any>, _dragRef: DragRef); attach(): void; detach(): void; private _getDialogWrapper; private _getViewportDimensions; private _getDialogWrapperDimensions; private _initialPositionReset; private _attachCorners; private _handleMouseDown; } export { CovalentDialogsModule, ResizableDraggableDialog, TdAlertDialogComponent, TdConfirmDialogComponent, TdDialogActionsDirective, TdDialogComponent, TdDialogContentDirective, TdDialogService, TdDialogStatusDirective, TdDialogTitleDirective, TdPromptDialogComponent, TdStatusDialogComponent, TdWindowDialogComponent }; export type { IAlertConfig, IConfirmConfig, IDialogConfig, IDraggableConfig, IDraggableRefs, IPromptConfig, IStatusConfig, TdStatusDialogDetailsLabels, TdStatusDialogStates };