/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { WindowActionsEvent, WindowMoveEvent } from './events'; import { windowStage } from './StageEnum'; /** * Represents the props of the [Window component]({% slug overview_window %}). */ export interface WindowProps { /** * The id of the window. */ id?: string; /** * Defines the string selector to the element to which the Window will be appended. Defaults to its parent element. */ appendTo?: string; /** * Acccepts a named slot `string`, functional or class component for the close button. If set to `false` the button is not rendered. * * @default true */ closeButton?: string | Function | object | boolean; /** * Specifies if the Window stage will change on title double click. The this is on by default. */ doubleClickStageChange?: boolean; /** * Specifies if the Window will be draggable ([see example]({% slug positioningdragging_window %}#toc-dragging)). */ draggable?: boolean; /** * Specifies the height of the Window ([see example]({% slug dimensionsresizing_window %}#toc-dimensions)). */ height?: number; /** * Specifies the initial `left` value ([see example]({% slug positioningdragging_window %}#toc-positioning)). The Window will be in an uncontrolled mode. */ initialLeft?: number; /** * Specifies the initial `top` value ([see example]({% slug positioningdragging_window %}#toc-positioning)). The component will be in an uncontrolled mode. */ initialTop?: number; /** * Specifies the initial width of the Window ([see example]({% slug dimensionsresizing_window %}#toc-dimensions)). The component will be in an uncontrolled mode. */ initialWidth?: number; /** * Specifies the initial height of the Window ([see example]({% slug dimensionsresizing_window %}#toc-dimensions)). The component will be in an uncontrolled mode. */ initialHeight?: number; /** * Specifies the left coordinates of the Window. */ left?: number; windowStyle?: object; windowClass?: string; /** * Acccepts a named slot `string`, functional or class component for the maximize button. If set to `false` the button is not rendered. * * @default true */ maximizeButton?: string | Function | object | boolean; /** * Specifies the minimum height of the Window ([see example]({% slug dimensionsresizing_window %}#toc-resizing)). */ minHeight?: number; /** * Specifies the minimum width of the Window ([see example]({% slug dimensionsresizing_window %}#toc-resizing)). */ minWidth?: number; /** * Acccepts a named slot `string`, functional or class component for the minimize button. If set to `false` the button is not rendered. * * @default true */ minimizeButton?: string | Function | object | boolean; /** * Specifies if the Window will be modal by rendering an overlay under the component. */ modal?: boolean; /** * Specifies if the Window will be resizable ([see example]({% slug dimensionsresizing_window %}#toc-resizing)). */ resizable?: boolean; /** * Specifies the theme color of the Dialog. */ themeColor?: 'promary' | 'dark' | 'light' | string; /** * Acccepts a named slot `string`, functional or class component for the restore button. If set to `false` the button is not rendered. * * @default true */ restoreButton?: string | Function | object | boolean; /** * Specifies if the Window content will update during resizing. */ shouldUpdateOnDrag?: boolean; /** * Specifies the title of the Window ([see example]({% slug title_window %})). */ title?: string | any; /** * Acccepts a named slot `string`, functional or class component for the title render. */ titleRender?: string | Function | object; /** * Specifies the top coordinates of the Window. */ top?: number; /** * Specifies the width of the Window. */ width?: number; /** * Controls the state of the Window ([see example]({% slug windowstage_window %})). * * The supported values are: * * `DEFAULT` * * `MINIMIZED` * * `FULLSCREEN` */ stage?: windowStage | string; /** * Specifies the direction of the Window content. * * The supported values are: * * `"ltr"` * * `"rtl"` */ dir?: string; /** * Fires when the **Close** button in the title is clicked or when the `Esc` button is pressed. */ onClose?: (event: WindowActionsEvent) => void; /** * Fires when the Window is dragged. */ onMove?: (event: WindowMoveEvent) => void; /** * Fires when the `DEFAULT`, `FULLSCREEN`, or `MINIMIZED` state of the Window is changed. */ onStagechange?: (event: WindowActionsEvent) => void; /** * Fires when the Window resizes. */ onResize?: (event: WindowMoveEvent) => void; /** * Fires when modal overlay of the Window is clicked. */ onOverlayclick?: (event: any) => void; }