@progress/kendo-angular-dialog
Version:
Dialog Package for Angular
104 lines (103 loc) • 4.3 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { TemplateRef, ViewContainerRef } from "@angular/core";
import { ActionsLayout } from "./../../common/actions-layout";
import { DialogAnimation } from "./dialog-animation";
import { DialogRef } from "./dialog-ref";
import { DialogResult } from "./dialog-result";
import { DialogThemeColor } from "./theme-color";
/**
* Represents the settings for opening a Dialog through the `DialogService`.
* ([See example.]({% slug api_dialog_dialogservice %}#toc-open))
*
*/
export declare class DialogSettings {
/**
* Use the `preventAction` callback to check if the pressed Dialog action should be prevented. If `true`, the Dialog does not close.
* If the **Close** button in the title bar is clicked, `DialogResult` is a `DialogCloseResult` instance.
* If the action buttons are used to close the Dialog, `DialogResult` contains the object passed when opening the Dialog. ([See example.](slug:service_dialog#toc-dialog-close-prevention))
* @param {DialogResult} ev The Dialog result.
* @param {DialogRef} [dialogRef] The Dialog reference, provided only when you create the Dialog using a component.
* @returns Returns `true` to prevent closing the Dialog.
*/
preventAction?: (ev: DialogResult, dialogRef?: DialogRef) => boolean;
/**
* Sets the Dialog `title`. If you omit `title`, the Dialog does not render a **Close** button.
*/
title?: string;
/**
* Sets the CSS classes for the Dialog wrapper element. Accepts any value supported by [`ngClass`](link:site.data.urls.angular['ngclassapi']).
*/
cssClass?: any;
/**
* Configures the Dialog opening `animation` ([see example]({% slug animations_dialog %})).
* @default { type: 'translate', duration: 300 }
*/
animation?: boolean | DialogAnimation;
/**
* Sets the HTML attributes for the Dialog wrapper element. Accepts string key-value pairs.
*/
htmlAttributes?: {
[key: string]: string;
};
/**
* Defines the Dialog `content`. ([See example.](slug:service_dialog#toc-rendering-the-content-area))
*/
content?: string | TemplateRef<any> | Function;
/**
* Sets the width of the Dialog.
* Use a number for pixels or a string for other units, for example, `50%`.
*/
width?: number | string;
/**
* Sets the minimum width of the Dialog.
* Use a number for pixels or a string for other units, for example, `50%`.
*/
minWidth?: number | string;
/**
* Sets the maximum width of the Dialog.
* Use a number for pixels or a string for other units, for example, `50%`.
*/
maxWidth?: number | string;
/**
* Sets the height of the Dialog.
* Use a number for pixels or a string for other units, for example, `50%`.
*/
height?: number | string;
/**
* Sets the minimum height of the Dialog.
* Use a number for pixels or a string for other units, for example, `50%`.
*/
minHeight?: number | string;
/**
* Sets the maximum height of the Dialog.
* Use a number for pixels or a string for other units, for example, `50%`.
*/
maxHeight?: number | string;
/**
* Defines the container where the Dialog is inserted. This changes the place in the page hierarchy where the Dialog appears. The component styling stays the same.
*/
appendTo?: ViewContainerRef;
/**
* Sets the `closeTitle` for the **Close** button.
*/
closeTitle?: string;
/**
* Sets the Dialog `actions` buttons.
*/
actions?: any[] | TemplateRef<any>;
/**
* Sets the layout of the Dialog action buttons with `actionsLayout`.
*/
actionsLayout?: ActionsLayout;
/**
* Sets the query selector for the element to focus automatically with `autoFocusedElement`.
*/
autoFocusedElement?: string;
/**
* Sets the theme color of the Dialog.
*/
themeColor?: DialogThemeColor;
}