@progress/kendo-angular-dialog
Version:
Dialog Package for Angular
265 lines (264 loc) • 9.89 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 { OnInit, OnDestroy, AfterViewInit, EventEmitter, ElementRef, Renderer2, QueryList, NgZone, OnChanges, SimpleChange, TemplateRef } from '@angular/core';
import { LocalizationService } from '@progress/kendo-angular-l10n';
import { DragResizeService } from './drag-resize.service';
import { ResizeHandleDirective } from './window-resize-handle.directive';
import { WindowTitleBarComponent } from './window-titlebar.component';
import { NavigationService } from './navigation.service';
import { WindowDimensionSetting, WindowOffsetSetting, WindowState } from './models/window-types';
import { WindowMessages } from './models/window-messages';
import { WindowThemeColor } from './models';
import * as i0 from "@angular/core";
/**
* Represents the [Kendo UI Window component for Angular]({% slug overview_window_dialogs %}).
*
* @example
* ```html
* <kendo-window title="My Window" [width]="400" [height]="300">
* </kendo-window>
* ```
*
* @remarks
* Supported children components are: {@link CustomMessagesComponent}, {@link WindowTitleBarComponent}.
*/
export declare class WindowComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
private el;
private renderer;
private service;
private navigation;
private ngZone;
private localization;
/**
* Specifies the query selector used to set the initial focus ([see examples]({% slug initial_focus_window %})).
*/
autoFocusedElement: string;
/**
* Sets the text in the title bar.
*/
title: string;
/**
* Specifies if the user can drag the component.
* @default true
*/
set draggable(value: boolean);
get draggable(): boolean;
/**
* Specifies if the user can resize the component.
* @default true
*/
set resizable(value: boolean);
get resizable(): boolean;
/**
* Sets the predefined theme color for the Window. The color applies to the title bar background and border, and updates the text color.
*/
set themeColor(themeColor: WindowThemeColor);
get themeColor(): WindowThemeColor;
/**
* @hidden
*/
set cssClass(classes: any);
get cssClass(): any;
/**
* @hidden
*/
set htmlAttributes(attributes: {
[key: string]: string;
});
get htmlAttributes(): {
[key: string]: string;
};
/**
* Specifies if the content stays in the DOM when minimized.
* @default false
*/
keepContent: boolean;
/**
* Sets the initial state of the Window.
*/
set state(value: WindowState);
get state(): WindowState;
/**
* Sets the minimum width in pixels.
* @default 120
*/
set minWidth(value: number);
get minWidth(): number;
/**
* Sets the minimum height in pixels.
* @default 100
*/
set minHeight(value: number);
get minHeight(): number;
/**
* Sets the width in pixels.
*/
set width(value: number);
get width(): number;
/**
* Sets the height in pixels.
*/
set height(value: number);
get height(): number;
/**
* Sets the initial top offset in pixels.
*/
set top(value: number);
get top(): number;
/**
* Sets the initial left offset in pixels.
*/
set left(value: number);
get left(): number;
get closeButtonTitle(): string;
get restoreButtonTitle(): string;
get maximizeButtonTitle(): string;
get minimizeButtonTitle(): string;
/**
* Fires when the user starts to move the Window.
*/
dragStart: EventEmitter<any>;
/**
* Fires after the Window has been moved by the user.
*/
dragEnd: EventEmitter<any>;
/**
* Fires when the user starts to resize the Window.
*/
resizeStart: EventEmitter<any>;
/**
* Fires after the Window has been resized by the user.
*/
resizeEnd: EventEmitter<any>;
/**
* Fires when the user closes the Window.
*/
close: EventEmitter<any>;
/**
* Fires when the `width` property is updated after resizing. The event data contains the new width. Allows two-way binding of the `width` property.
*/
widthChange: EventEmitter<number>;
/**
* Fires when the `height` property is updated after resizing. The event data contains the new height. Allows two-way binding of the `height` property.
*/
heightChange: EventEmitter<number>;
/**
* Fires when the `top` property is updated after dragging or resizing. The event data contains the new top offset. Allows two-way binding of the `top` property.
*/
topChange: EventEmitter<number>;
/**
* Fires when the `left` property is updated after dragging or resizing. The event data contains the new left offset. Allows two-way binding of the `left` property.
*/
leftChange: EventEmitter<number>;
/**
* Fires when the `state` property is updated. The event data contains the new state. Allows two-way binding of the `state` property.
*/
stateChange: EventEmitter<WindowState>;
/**
* @hidden
*/
contentTemplate: TemplateRef<any>;
/**
* @hidden
*/
titleBarTemplate: TemplateRef<any>;
/**
* @hidden
*/
messages: WindowMessages;
/**
* @hidden
*/
showLicenseWatermark: boolean;
tabIndex: number;
role: string;
hostClass: boolean;
get dir(): string;
titleBarView: WindowTitleBarComponent;
titleBarContent: WindowTitleBarComponent;
resizeHandles: QueryList<ResizeHandleDirective>;
resizeDirections: Array<string>;
/**
* @hidden
*/
titleId: string;
private _htmlAttributes;
private _cssClass;
private _themeColor;
private direction;
private draged;
private resized;
private windowSubscription;
private domSubs;
private localizationChangeSubscription;
constructor(el: ElementRef, renderer: Renderer2, service: DragResizeService, navigation: NavigationService, ngZone: NgZone, localization: LocalizationService);
ngAfterViewInit(): void;
ngOnInit(): void;
ngOnChanges(changes: {
[propertyName: string]: SimpleChange;
}): void;
ngOnDestroy(): void;
/**
* Focuses the wrapper of the Window component.
*/
focus(): void;
/**
* Brings the current Window component on top of other Window components on the page.
*/
bringToFront(): void;
/**
* Manually updates the `width` or `height` option of the Window.
* The required style will be applied to the Window wrapper element and the
* corresponding property of the component instance will be updated.
* This method is intended to be used for sizing dynamically created components using the
* [`WindowService`]({% slug api_dialog_windowservice %})
* @param dimension The option to update.
* @param value The value in pixels.
*/
setDimension(dimension: WindowDimensionSetting, value: number): void;
/**
* Manually updates the `top` or `left` offset of the Window.
* The required style will be applied to the Window wrapper element and the
* corresponding property of the component instance will be updated.
* This method is intended to be used for positioning dynamically created components using the
* [`WindowService`]({% slug api_dialog_windowservice %})
* @param offset The option to update.
* @param value The value in pixels.
*/
setOffset(offset: WindowOffsetSetting, value: number): void;
get showDefaultTitleBar(): boolean;
get styleMinWidth(): string;
get styleMinHeight(): string;
get stylePosition(): string;
get wrapperMaximizedClass(): boolean;
get wrapperMinimizedClass(): boolean;
/**
* @hidden
*/
onComponentFocus(): void;
/**
* @hidden
*/
onComponentBlur(): void;
private subscribeEvents;
private initDomEvents;
private onKeyDown;
private setServiceClasses;
private setNextZIndex;
private setInitialOffset;
private updateAllOffset;
private setStyle;
private removeStyle;
private get options();
private setOption;
private handleInitialFocus;
/**
* @hidden
*/
private generateTitleId;
private handleThemeColorClass;
static ɵfac: i0.ɵɵFactoryDeclaration<WindowComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<WindowComponent, "kendo-window", ["kendoWindow"], { "autoFocusedElement": { "alias": "autoFocusedElement"; "required": false; }; "title": { "alias": "title"; "required": false; }; "draggable": { "alias": "draggable"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "themeColor": { "alias": "themeColor"; "required": false; }; "keepContent": { "alias": "keepContent"; "required": false; }; "state": { "alias": "state"; "required": false; }; "minWidth": { "alias": "minWidth"; "required": false; }; "minHeight": { "alias": "minHeight"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "top": { "alias": "top"; "required": false; }; "left": { "alias": "left"; "required": false; }; }, { "dragStart": "dragStart"; "dragEnd": "dragEnd"; "resizeStart": "resizeStart"; "resizeEnd": "resizeEnd"; "close": "close"; "widthChange": "widthChange"; "heightChange": "heightChange"; "topChange": "topChange"; "leftChange": "leftChange"; "stateChange": "stateChange"; }, ["titleBarContent"], ["kendo-window-titlebar", "*"], true, never>;
}