import "jquery-ui/ui/widgets/button"; import "jquery-ui/ui/widgets/dialog"; export interface IPopupOptions { content: HTMLElement | string; autoOpen?: boolean; closeOnEscape?: boolean; /** * Removes popup HTMLElement when it is closed by the user. * Otherwise, it will stay hidden and might be reopened programmatically. */ removeOnClose?: boolean; title?: string; closeButton?: boolean; color?: string; modal?: boolean; dialogClass?: string; draggable?: boolean; resizable?: boolean; /** Please see: https://api.jqueryui.com/dialog/#option-position */ position?: { my: string; at: string; of: Element; collision: string; }; width?: number; /** Number in px or "auto" */ height?: number | string; padding?: number; backgroundColor?: string; titlebarColor?: string; onOpen?: () => void; onClose?: () => void; /** Triggered when a dialog is about to close. If canceled (by returning false), the dialog will not close. */ onBeforeClose?: () => boolean; onRemove?: () => void; onResize?: () => void; onDragStart?: () => void; onDragStop?: () => void; } export interface IPopupController { /** Opens popup (makes sense only if autoOpen option is set to false during initialization). */ open: () => void; /** Closes popup (display: none). Also removes HTML element from DOM tree if `removeOnClose` is equal to true. */ close: () => void; /** Removes HTML element from DOM tree. */ remove: () => void; } export declare const ADD_POPUP_DEFAULT_OPTIONS: { title: string; autoOpen: boolean; closeButton: boolean; closeOnEscape: boolean; removeOnClose: boolean; modal: boolean; draggable: boolean; resizable: boolean; width: number; height: string; padding: number; /** * Note that dialogClass is intentionally undocumented. Styling uses class makes us depend on the * current dialog implementation. It might be necessary for LARA themes, although plugins should not use it. */ dialogClass: string; backgroundColor: string; titlebarColor: string; position: { my: string; at: string; of: Window & typeof globalThis; }; onOpen: undefined; onBeforeClose: undefined; onResize: undefined; onDragStart: undefined; onDragStop: undefined; }; /**************************************************************************** Ask LARA to add a new popup window. Note that many options closely resemble jQuery UI dialog options which is used under the hood. You can refer to jQuery UI API docs in many cases: https://api.jqueryui.com/dialog Only `content` is required. Other options have reasonable default values (subject to change, so if you expect particular behaviour, provide necessary options explicitly). React warning: if you use React to render content, remember to call `ReactDOM.unmountComponentAtNode(content)` in `onRemove` handler. ****************************************************************************/ export declare const addPopup: (_options: IPopupOptions) => IPopupController;