import * as i0 from '@angular/core'; import { Injector, ApplicationRef, EnvironmentInjector, Type, TemplateRef, ViewRef, AfterViewInit, AfterContentInit } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; import * as tableau_ui_angular_dialog from 'tableau-ui-angular/dialog'; import * as i2 from '@angular/common'; import * as i3 from 'tableau-ui-angular/button'; interface IDialogArgs extends IModalArgs, IDialogPositionAndSizeArgs { skipCreatingBackdrop?: boolean; backdropCss?: Record; containerCss?: Record; trapFocus?: boolean; } interface IModalArgs extends IConfirmationDialogArgs { header?: IDialogHeaderArgs; } interface IConfirmationDialogArgs extends IDialogSizeArgs { closeOnBackdropClick?: boolean; closeOnEscape?: boolean; } interface IDialogHeaderArgs { title: string; allowClose: boolean; } interface IDialogSizeArgs { width?: string | ((referenceElementRect: DOMRect) => string | undefined); height?: string | ((referenceElementRect: DOMRect) => string | undefined); minWidth?: string | ((referenceElementRect: DOMRect) => string | undefined); minHeight?: string | ((referenceElementRect: DOMRect) => string | undefined); maxWidth?: string | ((referenceElementRect: DOMRect) => string | undefined); maxHeight?: string | ((referenceElementRect: DOMRect) => string | undefined); } interface IDialogPositionAndSizeArgs extends IDialogSizeArgs { top?: string | ((actualWidth: number, actualHeight: number, referenceElementRect?: DOMRect) => string | undefined); left?: string | ((actualWidth: number, actualHeight: number, referenceElementRect?: DOMRect) => string | undefined); } declare function injectDialogRef(): DialogRef; interface IDialogRef { closed$: Observable; close: () => void; } declare class DialogRef implements IDialogRef { private readonly _closed$; readonly closed$: Observable; private _result; close(result?: T): void; /** * Sets the result of the dialog without closing it. * This is useful for cases where you want to update the result * but keep the dialog open, such as in a form submission. * If the close() function is called with a non-undefined result, it will overwrite this value * @param result The result to set. */ setResultWithoutClosing(result?: T): void; } /** * The dialog will be placed in the global stacking context, placed at the end of the document body. * This is useful for dialogs that need to be displayed above all other content, such as modals or overlays. */ declare class GlobalStackOptions { /** * The reference element thats' DOMRect is passed to the left() and height() function of the dialog args. * Optional. */ readonly referenceElement?: HTMLElement; constructor( /** * The reference element thats' DOMRect is passed to the left() and height() function of the dialog args. * Optional. */ referenceElement?: HTMLElement); } /** * The dialog will be placed in the local stacking context, inserted after the specified element. * This is useful for dialogs that need to be displayed relative to a specific element, such as tooltips or popovers. * The dialog will be placed after the `insertAfterElement` in the DOM. * The dialog content will be tabbable right after the `insertAfterElement`. */ declare class LocalStackOptions { /** * The element after which the dialog will be inserted in the DOM. * If 'referenceElement' is not provided, this will be the reference element that's DOMRect is passed to the left() and height() function of the dialog args. */ readonly insertAfterElement: HTMLElement; /** * The reference element that's DOMRect is passed to the left() and height() function of the dialog args. * If not provided, the `insertAfterElement` will be used as the reference element. */ readonly referenceElement?: HTMLElement; constructor( /** * The element after which the dialog will be inserted in the DOM. * If 'referenceElement' is not provided, this will be the reference element that's DOMRect is passed to the left() and height() function of the dialog args. */ insertAfterElement: HTMLElement, /** * The reference element that's DOMRect is passed to the left() and height() function of the dialog args. * If not provided, the `insertAfterElement` will be used as the reference element. */ referenceElement?: HTMLElement); } type StackOptions = GlobalStackOptions | LocalStackOptions; declare class DialogService { injector: Injector; appRef: ApplicationRef; environmentInjector: EnvironmentInjector; openModal(component: Type, data: TData, args?: IModalArgs): DialogRef; openTemplateModal(contentTemplate: TemplateRef, contentTemplateContext: TContext, args?: IModalArgs): DialogRef; _openModal(getViewRef: (injector: Injector) => ViewRef, data: TData, args?: IModalArgs): DialogRef; openConfirmationMessageDialog(title: string, message: string, color: 'error' | 'primary' | 'secondary', acceptBtnText: string | undefined, cancelBtnText: string | undefined, autofocus: 'accept' | 'cancel' | undefined, args?: IConfirmationDialogArgs): Promise; openConfirmationTemplateDialog(title: string, template: TemplateRef, templateContext: TContext, color: 'error' | 'primary' | 'secondary', acceptBtnText: string | undefined, cancelBtnText: string | undefined, autofocus: 'accept' | 'cancel' | undefined, args?: IConfirmationDialogArgs): Promise; readonly startZIndex = 100; readonly zIndexStep = 10; private readonly zIndex; dialogStack: { dialogRef: IDialogRef; zIndex: number; args: IDialogArgs; }[]; openTemplateDialog(contentTemplate: TemplateRef, args: IDialogArgs, contentTemplateContext: TContext, stackOptions?: StackOptions): DialogRef; openDialog(component: Type, data: TData, args?: IDialogArgs, stackOptions?: StackOptions): DialogRef; private _openDialog; private createBackdrop; escapeSubscription: Subscription | null; private setEscapeHandler; private createView; private createDialogElement; private static manageDialogPosition; private static getReferenceElement; private static calculateAndSetPosition; private trapFocus; private restoreFocus; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare function injectDialogData(): T; declare class ConfirmationDialogComponent implements AfterViewInit, AfterContentInit { protected data: IConfirmationDialogData; protected readonly data2: IConfirmationDialogData; protected dialogRef: tableau_ui_angular_dialog.DialogRef; private readonly $accept; private readonly $cancel; ngAfterContentInit(): void; ngAfterViewInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class IConfirmationDialogData { content: string | undefined; contentTemplate: TemplateRef | undefined; contentTemplateContext: T | undefined; color: 'error' | 'primary' | 'secondary'; acceptBtnText: string | undefined; cancelBtnText: string | undefined; autofocus: 'accept' | 'cancel' | undefined; } declare class TableauUiDialogModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { DialogRef, DialogService, GlobalStackOptions, LocalStackOptions, TableauUiDialogModule, injectDialogData, injectDialogRef }; export type { IConfirmationDialogArgs, IDialogArgs, IDialogHeaderArgs, IDialogPositionAndSizeArgs, IDialogSizeArgs, IModalArgs, StackOptions };