UNPKG

@itwin/core-react

Version:

A react component library of iTwin.js UI general purpose components

95 lines 5.85 kB
/** @packageDocumentation * @module Common */ import * as React from "react"; /** Properties for [[withOnOutsideClick]] React higher-order component * @public * @deprecated in 4.15.0. Props of deprecated {@link withOnOutsideClick} HOC. */ export interface WithOnOutsideClickProps { /** Outside click callback function */ onOutsideClick?: (event: MouseEvent) => any; /** If false outside click processing and closing are skipped if click occurs in another Popup component, default to false. */ closeOnNestedPopupOutsideClick?: boolean; } /** withOnOutsideClick is a React higher-order component that adds outside click support. * @public * @deprecated in 4.15.0. Used internally. */ export declare const withOnOutsideClick: <ComponentProps extends object>(Component: React.ComponentType<ComponentProps>, defaultOnOutsideClick?: (event: MouseEvent) => any, useCapture?: boolean, usePointerEvents?: boolean) => { new (props: ComponentProps & WithOnOutsideClickProps): { /** @internal */ outsideClickContainerDiv?: HTMLDivElement | null; /** @internal */ isDownOutside: boolean; /** @internal */ isInCorePopup(element: HTMLElement): boolean; /** @internal */ onOutsideClick(e: MouseEvent): any; /** @internal */ handleDocumentClick: (e: MouseEvent) => any; /** @internal */ handleDocumentPointerDown: (e: PointerEvent) => void; /** @internal */ handleDocumentPointerUp: (e: PointerEvent) => void; handleOutsideClickContainerDivSet: (outsideClickContainerDiv: HTMLDivElement | null) => void; getParentDocument(): Document; componentDidMount(): void; componentWillUnmount(): void; render(): React.JSX.Element; context: unknown; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps & WithOnOutsideClickProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly<ComponentProps & WithOnOutsideClickProps>; state: Readonly<{}>; shouldComponentUpdate?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextState: Readonly<{}>, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly<ComponentProps & WithOnOutsideClickProps>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly<ComponentProps & WithOnOutsideClickProps>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextState: Readonly<{}>, nextContext: any): void; }; new (props: ComponentProps & WithOnOutsideClickProps, context: any): { /** @internal */ outsideClickContainerDiv?: HTMLDivElement | null; /** @internal */ isDownOutside: boolean; /** @internal */ isInCorePopup(element: HTMLElement): boolean; /** @internal */ onOutsideClick(e: MouseEvent): any; /** @internal */ handleDocumentClick: (e: MouseEvent) => any; /** @internal */ handleDocumentPointerDown: (e: PointerEvent) => void; /** @internal */ handleDocumentPointerUp: (e: PointerEvent) => void; handleOutsideClickContainerDivSet: (outsideClickContainerDiv: HTMLDivElement | null) => void; getParentDocument(): Document; componentDidMount(): void; componentWillUnmount(): void; render(): React.JSX.Element; context: unknown; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps & WithOnOutsideClickProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callback?: (() => void) | undefined): void; readonly props: Readonly<ComponentProps & WithOnOutsideClickProps>; state: Readonly<{}>; shouldComponentUpdate?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextState: Readonly<{}>, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly<ComponentProps & WithOnOutsideClickProps>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly<ComponentProps & WithOnOutsideClickProps>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps & WithOnOutsideClickProps>, nextState: Readonly<{}>, nextContext: any): void; }; contextType?: React.Context<any> | undefined; propTypes?: any; }; //# sourceMappingURL=withOnOutsideClick.d.ts.map