/** @jsxImportSource react */ import type { Root } from "cx-react"; import { View } from "../../data/View"; import { ContainerBase, StyledContainerConfig } from "../../ui/Container"; import { Instance } from "../../ui/Instance"; import { BooleanProp, NumberProp } from "../../ui/Prop"; import { RenderingContext } from "../../ui/RenderingContext"; import { VDOM } from "../../ui/Widget"; import { SubscriberList } from "../../util/SubscriberList"; export interface OverlayConfig extends StyledContainerConfig { /** Set to `true` to enable resizing. */ resizable?: BooleanProp; /** Set to `true` to enable dragging the overlay. */ draggable?: BooleanProp; /** Base CSS class to be applied to the field. Defaults to `overlay`. */ baseClass?: string; /** Width of resize handle area. */ resizeWidth?: number; /** Set to `true` to initially place the overlay in the center of the page. */ center?: boolean; /** Set to `true` to initially place the overlay in the center of the page horizontally. */ centerX?: boolean; /** Set to `true` to initially place the overlay in the center of the page vertically. */ centerY?: boolean; /** Set to `true` to add a modal backdrop which masks mouse events for the rest of the page. */ modal?: boolean; /** Set to `true` to add a modal backdrop which will dismiss the window when clicked. */ backdrop?: boolean; /** Set to `true` to force the element to be rendered inline, instead of being appended to the body element. * Inline overlays have z-index set to a very high value, to ensure they are displayed on top of the other content. */ inline?: boolean; /** Set to `true` to automatically focus the top level overlay element. */ autoFocus?: boolean; /** Set to `true` to automatically focus the first focusable child in the overlay. */ autoFocusFirstChild?: boolean; /** Set to `true` to append the set animate state after the initial render. Appended CSS class may be used to add show/hide animations. */ animate?: boolean; /** Number of milliseconds to wait, before removing the element from the DOM. Used in combination with the animate property. */ destroyDelay?: number; /** Automatically dismiss overlay if it loses focus. */ dismissOnFocusOut?: boolean; /** Set to true to make the top level overlay element focusable. */ focusable?: boolean; /** Set to `true` to dismiss the window if the user presses the back button in the browser. */ dismissOnPopState?: boolean; /** A callback function which fires while the overlay is being moved around. */ onMove?: string | ((e: Event, instance: Instance, component: any) => void); /** A callback function which fires while the overlay is being resized. */ onResize?: string | ((e: Event, instance: Instance, component: any) => void); /** zIndex */ zIndex?: NumberProp; /** Set to `true` to make the window automatically close if Esc is pressed on the keyboard. Default value is false.*/ closeOnEscape?: boolean; /** Custom CSS styling for the container element. */ containerStyle?: string; /** Callback for focus out event. */ onFocusOut?: string; /** Callback for mouse enter event. */ onMouseEnter?: string; /** Callback for mouse leave event. */ onMouseLeave?: string; /** Callback for backdrop click. */ onBackdropClick?: string; /** Callback for mouse down event. */ onMouseDown?: string; /** Callback for key down event. */ onKeyDown?: string; /** Callback fired before dismiss. */ onBeforeDismiss?: string | (() => boolean); /** Callback fired when overlay will dismiss. */ overlayWillDismiss?: (instance: Instance, component: any) => boolean; /** Callback for click event. */ onClick?: string; } export interface OverlayOpenOptions { initiatingEvent?: React.SyntheticEvent; name?: string; dismiss?: () => void; parentEl?: Element; subscribeToBeforeDismiss?: (callback: () => boolean) => void; destroyDelay?: number; removeParentDOMElement?: boolean; } export interface ConfigureOverlayContainerContext { relatedElement?: HTMLElement | null; initiatingEvent?: React.SyntheticEvent; } export declare class OverlayInstance = Overlay> extends Instance { positionChangeSubscribers: SubscriberList; dismiss?: () => void; onBeforeDismiss?: () => boolean; beaconEl?: HTMLElement | null; } export declare class OverlayBase = OverlayInstance> extends ContainerBase { static configureOverlayContainer?: (containerEl: HTMLElement, context: ConfigureOverlayContainerContext) => void; styled: true; baseClass: string; resizable?: BooleanProp; resizeWidth: number; center?: boolean; centerX?: boolean; centerY?: boolean; modal?: boolean; backdrop?: boolean; inline?: boolean; autoFocus?: boolean; autoFocusFirstChild?: boolean; animate?: boolean; draggable?: BooleanProp; destroyDelay?: number; dismissOnFocusOut?: boolean; focusable?: boolean; containerStyle?: string; dismissOnPopState?: boolean; closeOnEscape?: boolean; onFocusOut?: string; onMouseLeave?: string; onMouseEnter?: string; onKeyDown?: string; onMove?: string | ((e: Event, instance: Instance, component: any) => void); onResize?: string | ((e: Event, instance: Instance, component: any) => void); onClick?: string; onMouseDown?: string; onBackdropClick?: string; overlayWillDismiss?: (instance: Instance, component: any) => boolean; style?: any; pad?: boolean; needsBeacon: boolean; init(): void; declareData(...args: any[]): void; prepareData(context: RenderingContext, instance: InstanceType): void; initInstance(context: RenderingContext, instance: InstanceType): void; explore(context: RenderingContext, instance: InstanceType): void; exploreCleanup(context: RenderingContext, instance: InstanceType): void; render(context: RenderingContext, instance: InstanceType, key: string): any; renderContents(context: RenderingContext, instance: InstanceType): any; getConfigureOverlayContainerContext(instance?: InstanceType, initiatingEvent?: React.SyntheticEvent): ConfigureOverlayContainerContext; overlayDidMount(instance: InstanceType, component: any): void; overlayDidUpdate(instance: InstanceType, component: any): void; overlayWillUnmount(instance: InstanceType, component: any): void; handleFocusOut(instance: InstanceType, component: any): void; handleKeyDown(e: any, instance: InstanceType, component?: any): void | false; handleMouseLeave(instance: InstanceType, component: any): void; handleMouseEnter(instance: InstanceType, component: any): void; getOverlayContainer(): HTMLElement; containerFactory(instance?: InstanceType, initiatingEvent?: React.SyntheticEvent): HTMLElement; open(storeOrInstance?: View | Instance, options?: OverlayOpenOptions): () => void; handleMove(e: any, instance: InstanceType, component: any): void; handleResize(e: any, instance: InstanceType, component: any): void; } export declare class Overlay extends OverlayBase { } export interface OverlayComponentProps { instance: OverlayInstance; parentEl?: HTMLElement; subscribeToBeforeDismiss?: (cb: () => boolean) => void; children: any; beaconEl: HTMLElement | null; } export interface OverlayComponentState { animated?: boolean; mods?: Record; } export declare class OverlayComponent extends VDOM.Component { el?: HTMLElement | null; containerEl?: HTMLElement | null; ownedEl?: HTMLElement | null; onOverlayRef?: (el: HTMLElement | null) => void; shadowEl?: HTMLElement | null; dismissed?: boolean; unmounting?: boolean; onPopState?: () => void; unsubscribeWheelBlock?: () => void; customStyle: any; root: Root; constructor(props: Props); render(): import("react/jsx-runtime").JSX.Element | null; renderOverlay(): import("react/jsx-runtime").JSX.Element; renderOverlayBody(): Props["children"]; onFocus(): void; onBlur(): void; onFocusIn(): void; onFocusOut(): void; onMouseEnter(e: React.MouseEvent): void; onMouseLeave(e: React.MouseEvent): void; onClick(e: React.MouseEvent): void; onKeyDown(e: React.KeyboardEvent): void; getResizePrefix(e: MouseEvent | React.MouseEvent | React.TouchEvent): string; onMouseDown(e: React.MouseEvent | React.TouchEvent): void; onBackdropClick(e: React.MouseEvent): void; onMouseUp(e: React.MouseEvent | React.TouchEvent): void; onMouseMove(e: MouseEvent, captureData: any): void; startMoveOperation(e: MouseEvent | React.MouseEvent | React.TouchEvent): void; onMove(e: MouseEvent, data: any): void; onBeforeDismiss(): boolean; componentDidMount(): void; componentWillUnmount(): void; setZIndex(zIndex: number): void; setCustomStyle(style: Partial): void; getOverlayStyle(): any; setCSSState(mods: Record): void; getOverlayCssClass(): string; overlayDidUpdate(): void; componentDidUpdate(): void; } interface OverlayBeaconProps { childrenFactory: (beacon: HTMLElement) => React.ReactNode; } export interface OverlayBeaconState { beaconRendered?: boolean; } export declare class OverlayBeacon extends VDOM.Component { el: HTMLElement | null; render(): import("react/jsx-runtime").JSX.Element; componentDidMount(): void; } export {}; //# sourceMappingURL=Overlay.d.ts.map