UNPKG

@progress/kendo-angular-dialog

Version:
115 lines (114 loc) 4.8 kB
/**----------------------------------------------------------------------------------------- * 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"; /** * The settings that can be used when the Dialog is opened through `DialogService`. * ([see example]({% slug api_dialog_dialogservice %}#toc-open)). */ export declare class DialogSettings { /** * Defines a predicate that verifies if the pressed dialog action should be prevented. Returning true from the predicate prevents the dialog from closing. * If the **Close** button of the title bar is clicked, `DialogResult` is a `DialogCloseResult` instance. * If the Dialog is closed through the action buttons, `DialogResult` contains the object that was passed when the Dialog was opened. ([see example](slug:service_dialog#toc-dialog-close-prevention)) * @param {DialogResult} ev * @param {DialogRef} [dialogRef] - provided only when the dialog is created using a component. * @returns */ preventAction?: (ev: DialogResult, dialogRef?: DialogRef) => boolean; /** * Sets the title of the Dialog. If `title` is omitted, * the Dialog will not render a **Close** button. */ title?: string; /** * Sets the CSS classes that will be rendered on the Dialog wrapper element. * Supports the union type of values that NgClass accepts [ngClass](link:site.data.urls.angular['ngclassapi']). */ cssClass?: any; /** * Configures the Dialog opening animation ([see example]({% slug animations_dialog %})). * By default the animation type is set to `translate` and its duration is `300ms`. */ animation?: boolean | DialogAnimation; /** * Sets the HTML attributes of the Dialog wrapper element. * The property accepts string key-value based pairs. */ htmlAttributes?: { [key: string]: string; }; /** * Defines the content of the Dialog. * ([see example](slug:service_dialog#toc-rendering-the-content-area)). */ content?: string | TemplateRef<any> | Function; /** * Specifies the width of the Dialog. * A numeric value sets the width in pixels. * A string value sets the width in arbitrary units&mdash;for example, `50%`. */ width?: number | string; /** * Specifies the minimum width of the Dialog. * A numeric value sets the minimum width in pixels. * A string value sets the minimum width in arbitrary units&mdash;for example, `50%`. */ minWidth?: number | string; /** * Specifies the maximum width of the Dialog. * A numeric value sets the maximum width in pixels. * A string value sets the maximum width in arbitrary units&mdash;for example, `50%`. */ maxWidth?: number | string; /** * Specifies the height of the Dialog. * A numeric value sets the height in pixels. * A string value sets the height in arbitrary units&mdash;for example, `50%`. */ height?: number | string; /** * Specifies the minimum height of the Dialog. * A numeric value sets the minimum height in pixels. * A string value sets the minimum height in arbitrary units&mdash;for example, `50%`. */ minHeight?: number | string; /** * Specifies the maximum height of the Dialog. * A numeric value sets the maximum height in pixels. * A string value sets the maximum height in arbitrary units&mdash;for example, `50%`. */ maxHeight?: number | string; /** * Defines the container in which the Dialog will be inserted. * Specifying this option changes the place in the page hierarchy where the Dialog will be inserted. * The styling of the component will remain the same. */ appendTo?: ViewContainerRef; /** * Specifies the title of the close button. */ closeTitle?: string; /** * Sets the action buttons of the Dialog. */ actions?: any[] | TemplateRef<any>; /** * Specifies the layout of the action buttons in the Dialog. */ actionsLayout?: ActionsLayout; /** * Sets the focused element query selector. */ autoFocusedElement?: string; /** * Specifies the theme color of the Dialog. */ themeColor?: DialogThemeColor; }