diff --git a/types/react-overlays/index.d.ts b/types/react-overlays/index.d.ts index d49853204d..82fd64bfdc 100644 --- a/types/react-overlays/index.d.ts +++ b/types/react-overlays/index.d.ts @@ -8,48 +8,48 @@ import * as React from "react"; export { - Affix, - AutoAffix, - Modal, - ModalManager, - Overlay, - Portal, - Dropdown, - DropdownMenu, - DropdownToggle, - RootCloseWrapper, - WaitForContainer -} from "./lib"; + Affix, + AutoAffix, + Modal, + ModalManager, + Overlay, + Portal, + Dropdown, + DropdownMenu, + DropdownToggle, + RootCloseWrapper, + WaitForContainer +} from './lib'; // these callbacks are used in a few components export interface TransitionCallbacks { - /** - * Callback fired before the Overlay transitions in - */ - onEnter?(node: HTMLElement): any; + /** + * Callback fired before the Overlay transitions in + */ + onEnter?(node: HTMLElement): any; - /** - * Callback fired as the Overlay begins to transition in - */ - onEntering?(node: HTMLElement): any; + /** + * Callback fired as the Overlay begins to transition in + */ + onEntering?(node: HTMLElement): any; - /** - * Callback fired after the Overlay finishes transitioning in - */ - onEntered?(node: HTMLElement): any; + /** + * Callback fired after the Overlay finishes transitioning in + */ + onEntered?(node: HTMLElement): any; - /** - * Callback fired right before the Overlay transitions out - */ - onExit?(node: HTMLElement): any; + /** + * Callback fired right before the Overlay transitions out + */ + onExit?(node: HTMLElement): any; - /** - * Callback fired as the Overlay begins to transition out - */ - onExiting?(node: HTMLElement): any; + /** + * Callback fired as the Overlay begins to transition out + */ + onExiting?(node: HTMLElement): any; - /** - * Callback fired after the Overlay finishes transitioning out - */ - onExited?(node: HTMLElement): any; + /** + * Callback fired after the Overlay finishes transitioning out + */ + onExited?(node: HTMLElement): any; } diff --git a/types/react-overlays/lib/Affix.d.ts b/types/react-overlays/lib/Affix.d.ts index abe04230ff..a3be5662a0 100644 --- a/types/react-overlays/lib/Affix.d.ts +++ b/types/react-overlays/lib/Affix.d.ts @@ -4,81 +4,81 @@ declare class Affix extends React.Component {} export = Affix; declare namespace Affix { - // put AffixProps inside the exported namespace so it's importable in AutoAffix - interface AffixProps { - /** - * Pixels to offset from top of screen when calculating position - */ - offsetTop?: number; + // put AffixProps inside the exported namespace so it's importable in AutoAffix + interface AffixProps { + /** + * Pixels to offset from top of screen when calculating position + */ + offsetTop?: number; - /** - * When affixed, pixels to offset from top of viewport - */ - viewportOffsetTop?: number; + /** + * When affixed, pixels to offset from top of viewport + */ + viewportOffsetTop?: number; - /** - * Pixels to offset from bottom of screen when calculating position - */ - offsetBottom?: number; + /** + * Pixels to offset from bottom of screen when calculating position + */ + offsetBottom?: number; - /** - * CSS class or classes to apply when at top - */ - topClassName?: string; + /** + * CSS class or classes to apply when at top + */ + topClassName?: string; - /** - * Style to apply when at top - */ - topStyle?: React.CSSProperties; + /** + * Style to apply when at top + */ + topStyle?: React.CSSProperties; - /** - * CSS class or classes to apply when affixed - */ - affixClassName?: string; + /** + * CSS class or classes to apply when affixed + */ + affixClassName?: string; - /** - * Style to apply when affixed - */ - affixStyle?: React.CSSProperties; + /** + * Style to apply when affixed + */ + affixStyle?: React.CSSProperties; - /** - * CSS class or classes to apply when at bottom - */ - bottomClassName?: string; + /** + * CSS class or classes to apply when at bottom + */ + bottomClassName?: string; - /** - * Style to apply when at bottom - */ - bottomStyle?: React.CSSProperties; + /** + * Style to apply when at bottom + */ + bottomStyle?: React.CSSProperties; - /** - * Callback fired when the right before the `affixStyle` and `affixStyle` props are rendered - */ - onAffix?(): void; + /** + * Callback fired when the right before the `affixStyle` and `affixStyle` props are rendered + */ + onAffix?(): void; - /** - * Callback fired after the component `affixStyle` and `affixClassName` props have been rendered. - */ - onAffixed?(): void; + /** + * Callback fired after the component `affixStyle` and `affixClassName` props have been rendered. + */ + onAffixed?(): void; - /** - * Callback fired when the right before the `topStyle` and `topClassName` props are rendered - */ - onAffixTop?(): void; + /** + * Callback fired when the right before the `topStyle` and `topClassName` props are rendered + */ + onAffixTop?(): void; - /** - * Callback fired after the component `topStyle` and `topClassName` props have been rendered. - */ - onAffixedTop?(): void; + /** + * Callback fired after the component `topStyle` and `topClassName` props have been rendered. + */ + onAffixedTop?(): void; - /** - * Callback fired when the right before the `bottomStyle` and `bottomClassName` props are rendered - */ - onAffixBottom?(): void; + /** + * Callback fired when the right before the `bottomStyle` and `bottomClassName` props are rendered + */ + onAffixBottom?(): void; - /** - * Callback fired after the component `bottomStyle` and `bottomClassName` props have been rendered. - */ - onAffixedBottom?(): void; - } + /** + * Callback fired after the component `bottomStyle` and `bottomClassName` props have been rendered. + */ + onAffixedBottom?(): void; + } } diff --git a/types/react-overlays/lib/AutoAffix.d.ts b/types/react-overlays/lib/AutoAffix.d.ts index fb239106a0..2b91ac582c 100644 --- a/types/react-overlays/lib/AutoAffix.d.ts +++ b/types/react-overlays/lib/AutoAffix.d.ts @@ -7,14 +7,14 @@ declare namespace AutoAffix {} export = AutoAffix; interface AutoAffixProps extends AffixProps { - /** - * The logical container node or component for determining offset from bottom - * of viewport, or a function that returns it - */ - container?: React.ReactInstance | (() => React.ReactInstance); + /** + * The logical container node or component for determining offset from bottom + * of viewport, or a function that returns it + */ + container?: React.ReactInstance | (() => React.ReactInstance); - /** - * Automatically set width when affixed - */ - autoWidth?: boolean; + /** + * Automatically set width when affixed + */ + autoWidth?: boolean; } diff --git a/types/react-overlays/lib/Dropdown.d.ts b/types/react-overlays/lib/Dropdown.d.ts index 24b0d3e24c..356f5d4f08 100644 --- a/types/react-overlays/lib/Dropdown.d.ts +++ b/types/react-overlays/lib/Dropdown.d.ts @@ -4,54 +4,54 @@ import DropdownMenu = require("./DropdownMenu"); import DropdownToggle = require("./DropdownToggle"); declare class Dropdown extends React.Component { - static Menu: typeof DropdownMenu; - static Toggle: typeof DropdownToggle; + static Menu: typeof DropdownMenu; + static Toggle: typeof DropdownToggle; } export = Dropdown; declare namespace Dropdown { - interface DropdownRenderProps { - props: { - onKeyDown(event: React.SyntheticEvent): void; - }; - } + interface DropdownRenderProps { + props: { + onKeyDown(event: React.SyntheticEvent): void; + }; + } - type Directions = "up" | "left" | "right" | "down"; + type Directions = 'up' | 'left' | 'right' | 'down'; - interface DropdownProps { - /** - * A render prop that returns the root dropdown element. The `props` - * argument should spread through to an element containing _both_ the - * menu and toggle in order to handle keyboard events for focus management. - */ - children(renderProps: DropdownRenderProps): React.ReactElement; + interface DropdownProps { + /** + * A render prop that returns the root dropdown element. The `props` + * argument should spread through to an element containing _both_ the + * menu and toggle in order to handle keyboard events for focus management. + */ + children(renderProps: DropdownRenderProps): React.ReactElement; - /** - * Determines the direction and location of the Menu in relation to it's Toggle. - */ - drop?: Directions; + /** + * Determines the direction and location of the Menu in relation to it's Toggle. + */ + drop?: Directions; - /** - * A css slector string that will return __focusable__ menu items. - * Selectors should be relative to the menu component: - * e.g. ` > li:not('.disabled')` - */ - itemSelector?: string; + /** + * A css slector string that will return __focusable__ menu items. + * Selectors should be relative to the menu component: + * e.g. ` > li:not('.disabled')` + */ + itemSelector?: string; - /** - * Align the menu to the 'end' side of the placement side of the Dropdown toggle. The default placement is `top-start` or `bottom-start`. - */ - alignEnd?: boolean; + /** + * Align the menu to the 'end' side of the placement side of the Dropdown toggle. The default placement is `top-start` or `bottom-start`. + */ + alignEnd?: boolean; - /** - * Whether or not the Dropdown is visible - */ - show?: boolean; + /** + * Whether or not the Dropdown is visible + */ + show?: boolean; - /** - * A callback fired when the Dropdown wishes to change visibility. Called with the requested - * `show` value, the DOM event, and the source that fired it: `'click'`,`'keydown'`,`'rootClose'`, or `'select'`. - */ - onToggle?(isOpen: boolean, event: React.SyntheticEvent): void; - } + /** + * A callback fired when the Dropdown wishes to change visibility. Called with the requested + * `show` value, the DOM event, and the source that fired it: `'click'`,`'keydown'`,`'rootClose'`, or `'select'`. + */ + onToggle?(isOpen: boolean, event: React.SyntheticEvent): void; + } } diff --git a/types/react-overlays/lib/DropdownMenu.d.ts b/types/react-overlays/lib/DropdownMenu.d.ts index c4a9090dcc..43f96f806d 100644 --- a/types/react-overlays/lib/DropdownMenu.d.ts +++ b/types/react-overlays/lib/DropdownMenu.d.ts @@ -3,53 +3,53 @@ import * as React from "react"; import Overlay = require("./Overlay"); declare class DropdownMenu extends React.Component< - DropdownMenu.DropdownMenuProps + DropdownMenu.DropdownMenuProps > {} export = DropdownMenu; declare namespace DropdownMenu { - interface DropdownMenuRenderProps extends Overlay.OverlayRenderProps { - alignEnd: boolean; - close(event: React.SyntheticEvent): void; - } + interface DropdownMenuRenderProps extends Overlay.OverlayRenderProps { + alignEnd: boolean; + close(event: React.SyntheticEvent): void; + } - interface DropdownMenuProps { - /** - * A render prop that returns a Menu element. The `props` - * argument should spread through to **a component that can accept a ref**. - */ - children(renderProps: DropdownMenuRenderProps): React.ReactElement; + interface DropdownMenuProps { + /** + * A render prop that returns a Menu element. The `props` + * argument should spread through to **a component that can accept a ref**. + */ + children(renderProps: DropdownMenuRenderProps): React.ReactElement; - /** - * Controls the visible state of the menu, generally this is - * provided by the parent `Dropdown` component, - * but may also be specified as a prop directly. - */ - show?: boolean; + /** + * Controls the visible state of the menu, generally this is + * provided by the parent `Dropdown` component, + * but may also be specified as a prop directly. + */ + show?: boolean; - /** - * Aligns the dropdown menu to the 'end' of it's placement position. - * Generally this is provided by the parent `Dropdown` component, - * but may also be specified as a prop directly. - */ - alignEnd?: boolean; + /** + * Aligns the dropdown menu to the 'end' of it's placement position. + * Generally this is provided by the parent `Dropdown` component, + * but may also be specified as a prop directly. + */ + alignEnd?: boolean; - /** - * Enables the Popper.js `flip` modifier, allowing the Dropdown to - * automatically adjust it's placement in case of overlap with the viewport or toggle. - */ - flip?: boolean; + /** + * Enables the Popper.js `flip` modifier, allowing the Dropdown to + * automatically adjust it's placement in case of overlap with the viewport or toggle. + */ + flip?: boolean; - usePopper?: boolean; + usePopper?: boolean; - /** - * A set of popper options and props passed directly to react-popper's Popper component. - */ - popperConfig?: object; + /** + * A set of popper options and props passed directly to react-popper's Popper component. + */ + popperConfig?: object; - /** - * Override the default event used by RootCloseWrapper. - */ - rootCloseEvent?: string; - } + /** + * Override the default event used by RootCloseWrapper. + */ + rootCloseEvent?: string; + } } diff --git a/types/react-overlays/lib/DropdownToggle.d.ts b/types/react-overlays/lib/DropdownToggle.d.ts index 8da2c6cfdb..136a929ad2 100644 --- a/types/react-overlays/lib/DropdownToggle.d.ts +++ b/types/react-overlays/lib/DropdownToggle.d.ts @@ -1,29 +1,29 @@ import * as React from "react"; declare class DropdownToggle extends React.Component< - DropdownToggle.DropdownToggleProps + DropdownToggle.DropdownToggleProps > {} export = DropdownToggle; declare namespace DropdownToggle { - interface DropdownToggleRenderProps { - show: boolean; - toggle(show: boolean): void; - props: { - ref?(element: HTMLElement): void; - "aria-haspopup": true; - "aria-expanded": boolean; - }; - } + interface DropdownToggleRenderProps { + show: boolean; + toggle(show: boolean): void; + props: { + ref?(element: HTMLElement): void; + 'aria-haspopup': true; + 'aria-expanded': boolean; + }; + } - interface DropdownToggleProps { - /** - * A render prop that returns a Toggle element. The `props` - * argument should spread through to **a component that can accept a ref**. Use - * the `onToggle` argument to toggle the menu open or closed - */ - children( - renderProps: DropdownToggleRenderProps - ): React.ReactElement; - } + interface DropdownToggleProps { + /** + * A render prop that returns a Toggle element. The `props` + * argument should spread through to **a component that can accept a ref**. Use + * the `onToggle` argument to toggle the menu open or closed + */ + children( + renderProps: DropdownToggleRenderProps + ): React.ReactElement; + } } diff --git a/types/react-overlays/lib/Modal.d.ts b/types/react-overlays/lib/Modal.d.ts index 7412b665cd..3d6b4e06c6 100644 --- a/types/react-overlays/lib/Modal.d.ts +++ b/types/react-overlays/lib/Modal.d.ts @@ -7,125 +7,125 @@ import * as ModalManager from "./ModalManager"; import { PortalProps } from "./Portal"; declare class Modal extends React.Component { - public static Manager: ModalManager; + public static Manager: ModalManager; } declare namespace Modal {} export = Modal; interface ModalProps extends TransitionCallbacks, PortalProps { - className?: string; + className?: string; - /** - * Set the visibility of the Modal - */ - show?: boolean; + /** + * Set the visibility of the Modal + */ + show?: boolean; - /** - * A Node, Component instance, or function that returns either. The Modal is appended to it's container element. - * - * For the sake of assistive technologies, the container should usually be the document body, so that the rest of the - * page content can be placed behind a virtual backdrop as well as a visual one. - */ - container?: React.ReactNode | Function; + /** + * A Node, Component instance, or function that returns either. The Modal is appended to it's container element. + * + * For the sake of assistive technologies, the container should usually be the document body, so that the rest of the + * page content can be placed behind a virtual backdrop as well as a visual one. + */ + container?: React.ReactNode | Function; - /** - * A callback fired when the Modal is opening. - */ - onShow?: Function; + /** + * A callback fired when the Modal is opening. + */ + onShow?: Function; - /** - * A callback fired when either the backdrop is clicked, or the escape key is pressed. - * - * The `onHide` callback only signals intent from the Modal, - * you must actually set the `show` prop to `false` for the Modal to close. - */ - onHide?: Function; + /** + * A callback fired when either the backdrop is clicked, or the escape key is pressed. + * + * The `onHide` callback only signals intent from the Modal, + * you must actually set the `show` prop to `false` for the Modal to close. + */ + onHide?: Function; - /** - * Include a backdrop component. - */ - backdrop?: boolean | "static"; + /** + * Include a backdrop component. + */ + backdrop?: boolean | 'static'; - /** - * A function that returns the dialog component. Useful for custom - * rendering. **Note:** the component should make sure to apply the provided ref. - * - * ```js - * renderDialog={props => } - * ``` - */ - renderDialog?(props: any): React.ReactNode; + /** + * A function that returns the dialog component. Useful for custom + * rendering. **Note:** the component should make sure to apply the provided ref. + * + * ```js + * renderDialog={props => } + * ``` + */ + renderDialog?(props: any): React.ReactNode; - /** - * A function that returns a backdrop component. Useful for custom - * backdrop rendering. - * - * ```js - * renderBackdrop={props => } - * ``` - */ - renderBackdrop?(props: any): React.ReactNode; + /** + * A function that returns a backdrop component. Useful for custom + * backdrop rendering. + * + * ```js + * renderBackdrop={props => } + * ``` + */ + renderBackdrop?(props: any): React.ReactNode; - /** - * A callback fired when the escape key, if specified in `keyboard`, is pressed. - */ - onEscapeKeyDown?: Function; + /** + * A callback fired when the escape key, if specified in `keyboard`, is pressed. + */ + onEscapeKeyDown?: Function; - /** - * A callback fired when the backdrop, if specified, is clicked. - */ - onBackdropClick?: Function; + /** + * A callback fired when the backdrop, if specified, is clicked. + */ + onBackdropClick?: Function; - /** - * A css class or set of classes applied to the modal container when the modal is open, - * and removed when it is closed. - */ - containerClassName?: string; + /** + * A css class or set of classes applied to the modal container when the modal is open, + * and removed when it is closed. + */ + containerClassName?: string; - /** - * Close the modal when escape key is pressed - */ - keyboard?: boolean; + /** + * Close the modal when escape key is pressed + */ + keyboard?: boolean; - /** - * A `react-transition-group@2.0.0` `` component used - * to control animations for the dialog component. - */ - transition?: React.ComponentType; + /** + * A `react-transition-group@2.0.0` `` component used + * to control animations for the dialog component. + */ + transition?: React.ComponentType; - /** - * A `react-transition-group@2.0.0` `` component used - * to control animations for the backdrop components. - */ - backdropTransition?: React.ComponentType; + /** + * A `react-transition-group@2.0.0` `` component used + * to control animations for the backdrop components. + */ + backdropTransition?: React.ComponentType; - /** - * When `true` The modal will automatically shift focus to itself when it opens, and - * replace it to the last focused element when it closes. This also - * works correctly with any Modal children that have the `autoFocus` prop. - * - * Generally this should never be set to `false` as it makes the Modal less - * accessible to assistive technologies, like screen readers. - */ - autoFocus?: boolean; + /** + * When `true` The modal will automatically shift focus to itself when it opens, and + * replace it to the last focused element when it closes. This also + * works correctly with any Modal children that have the `autoFocus` prop. + * + * Generally this should never be set to `false` as it makes the Modal less + * accessible to assistive technologies, like screen readers. + */ + autoFocus?: boolean; - /** - * When `true` The modal will prevent focus from leaving the Modal while open. - * - * Generally this should never be set to `false` as it makes the Modal less - * accessible to assistive technologies, like screen readers. - */ - enforceFocus?: boolean; + /** + * When `true` The modal will prevent focus from leaving the Modal while open. + * + * Generally this should never be set to `false` as it makes the Modal less + * accessible to assistive technologies, like screen readers. + */ + enforceFocus?: boolean; - /** - * When `true` The modal will restore focus to previously focused element once - * modal is hidden - */ - restoreFocus?: boolean; + /** + * When `true` The modal will restore focus to previously focused element once + * modal is hidden + */ + restoreFocus?: boolean; - /** - * A ModalManager instance used to track and manage the state of open - * Modals. Useful when customizing how modals interact within a container - */ - manager?: ModalManager; + /** + * A ModalManager instance used to track and manage the state of open + * Modals. Useful when customizing how modals interact within a container + */ + manager?: ModalManager; } diff --git a/types/react-overlays/lib/ModalManager.d.ts b/types/react-overlays/lib/ModalManager.d.ts index 82ce4cfd26..b0e884fa63 100644 --- a/types/react-overlays/lib/ModalManager.d.ts +++ b/types/react-overlays/lib/ModalManager.d.ts @@ -1,14 +1,17 @@ import * as Modal from "./Modal"; declare class ModalManager { - constructor(opts?: { hideSiblingNodes?: boolean; handleContainerOverflow?: boolean }); - isContainerOverflowing(modal: Modal): boolean; - containerIndexFromModal(modal: Modal): number; - setContainerStyle(containerState: any, container: any): void; - removeContainerStyle(containerState: any, container: any): void; - add(modal: Modal, container: any, className?: string): number; - remove(modal: Modal): void; - isTopModal(modal: Modal): boolean; + constructor(opts?: { + hideSiblingNodes?: boolean; + handleContainerOverflow?: boolean; + }); + isContainerOverflowing(modal: Modal): boolean; + containerIndexFromModal(modal: Modal): number; + setContainerStyle(containerState: any, container: any): void; + removeContainerStyle(containerState: any, container: any): void; + add(modal: Modal, container: any, className?: string): number; + remove(modal: Modal): void; + isTopModal(modal: Modal): boolean; } -declare namespace ModalManager { } +declare namespace ModalManager {} export = ModalManager; diff --git a/types/react-overlays/lib/Overlay.d.ts b/types/react-overlays/lib/Overlay.d.ts index 09ddb730ce..a1dd140338 100644 --- a/types/react-overlays/lib/Overlay.d.ts +++ b/types/react-overlays/lib/Overlay.d.ts @@ -10,78 +10,78 @@ declare class Overlay extends React.Component {} export = Overlay; declare namespace Overlay { - type Placements = "top" | "left" | "right" | "bottom"; + type Placements = 'top' | 'left' | 'right' | 'bottom'; - interface OverlayRenderProps { - show: boolean; - placement: Placements; - outOfBoundaries?: boolean; - scheduleUpdate(): void; - props: { - ref?(element: HTMLElement): void; - style: { [key: string]: string | number }; - "aria-labelledby"?: string; - }; - arrowProps: { - ref?(element: HTMLElement): void; - style: { [key: string]: string | number }; - }; - } + interface OverlayRenderProps { + show: boolean; + placement: Placements; + outOfBoundaries?: boolean; + scheduleUpdate(): void; + props: { + ref?(element: HTMLElement): void; + style: { [key: string]: string | number }; + 'aria-labelledby'?: string; + }; + arrowProps: { + ref?(element: HTMLElement): void; + style: { [key: string]: string | number }; + }; + } - interface OverlayProps extends TransitionCallbacks, PortalProps { - /** - * Set the visibility of the Overlay - */ - show?: boolean; + interface OverlayProps extends TransitionCallbacks, PortalProps { + /** + * Set the visibility of the Overlay + */ + show?: boolean; - /** Specify where the overlay element is positioned in relation to the target element */ - placement?: Placements; + /** Specify where the overlay element is positioned in relation to the target element */ + placement?: Placements; - /** - * Enables the Popper.js `flip` modifier, allowing the Overlay to - * automatically adjust it's placement in case of overlap with the viewport or toggle. - */ - flip?: boolean; + /** + * Enables the Popper.js `flip` modifier, allowing the Overlay to + * automatically adjust it's placement in case of overlap with the viewport or toggle. + */ + flip?: boolean; - /** - * A render prop that returns an element to overlay and position. See - * the [react-popper documentation](https://github.com/FezVrasta/react-popper#children) for more info. - */ - children(renderProps: OverlayRenderProps): React.ReactElement; + /** + * A render prop that returns an element to overlay and position. See + * the [react-popper documentation](https://github.com/FezVrasta/react-popper#children) for more info. + */ + children(renderProps: OverlayRenderProps): React.ReactElement; - /** - * A set of popper options and props passed directly to react-popper's Popper component. - */ - popperConfig?: object; + /** + * A set of popper options and props passed directly to react-popper's Popper component. + */ + popperConfig?: object; - /** - * Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay - */ - rootClose?: boolean; + /** + * Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay + */ + rootClose?: boolean; - /** - * Specify event for toggling overlay - */ - rootCloseEvent?: RootCloseWrapper.RootCloseWrapperProps["event"]; + /** + * Specify event for toggling overlay + */ + rootCloseEvent?: RootCloseWrapper.RootCloseWrapperProps['event']; - /** - * Specify disabled for disable RootCloseWrapper - */ - rootCloseDisabled?: boolean; + /** + * Specify disabled for disable RootCloseWrapper + */ + rootCloseDisabled?: boolean; - /** - * A Callback fired by the Overlay when it wishes to be hidden. - * - * __required__ when `rootClose` is `true`. - */ - onHide?(props: PortalProps, ...args: any[]): any; + /** + * A Callback fired by the Overlay when it wishes to be hidden. + * + * __required__ when `rootClose` is `true`. + */ + onHide?(props: PortalProps, ...args: any[]): any; - /** - * A `react-transition-group@2.0.0` `` component - * used to animate the overlay as it changes visibility. - */ - transition?: React.ComponentType; + /** + * A `react-transition-group@2.0.0` `` component + * used to animate the overlay as it changes visibility. + */ + transition?: React.ComponentType; - target?: React.ReactInstance | (() => React.ReactInstance); - } + target?: React.ReactInstance | (() => React.ReactInstance); + } } diff --git a/types/react-overlays/lib/Portal.d.ts b/types/react-overlays/lib/Portal.d.ts index a3e1827c43..6236f0370c 100644 --- a/types/react-overlays/lib/Portal.d.ts +++ b/types/react-overlays/lib/Portal.d.ts @@ -1,12 +1,12 @@ import * as React from "react"; -declare class Portal extends React.Component { } +declare class Portal extends React.Component {} export = Portal; declare namespace Portal { - interface PortalProps { - container?: React.ReactNode | Function; + interface PortalProps { + container?: React.ReactNode | Function; - onRendered?: Function; - } + onRendered?: Function; + } } diff --git a/types/react-overlays/lib/RootCloseWrapper.d.ts b/types/react-overlays/lib/RootCloseWrapper.d.ts index 60186deaf3..85b785903f 100644 --- a/types/react-overlays/lib/RootCloseWrapper.d.ts +++ b/types/react-overlays/lib/RootCloseWrapper.d.ts @@ -1,31 +1,31 @@ import * as React from "react"; declare class RootCloseWrapper extends React.Component< - RootCloseWrapper.RootCloseWrapperProps + RootCloseWrapper.RootCloseWrapperProps > {} export = RootCloseWrapper; declare namespace RootCloseWrapper { - interface RootCloseWrapperProps { - /** - * Callback fired after click or mousedown. Also triggers when user hits `esc`. - */ - onRootClose?(e: React.SyntheticEvent): void; + interface RootCloseWrapperProps { + /** + * Callback fired after click or mousedown. Also triggers when user hits `esc`. + */ + onRootClose?(e: React.SyntheticEvent): void; - /** - * Children to render. - */ - children?: React.ReactNode; + /** + * Children to render. + */ + children?: React.ReactNode; - /** - * Disable the the RootCloseWrapper, preventing it from triggering - * `onRootClose`. - */ - disabled?: boolean; + /** + * Disable the the RootCloseWrapper, preventing it from triggering + * `onRootClose`. + */ + disabled?: boolean; - /** - * Choose which document mouse event to bind to - */ - event?: "click" | "mousedown"; - } + /** + * Choose which document mouse event to bind to + */ + event?: 'click' | 'mousedown'; + } } diff --git a/types/react-overlays/lib/WaitForContainer.d.ts b/types/react-overlays/lib/WaitForContainer.d.ts index c9e275639e..19c8a6e22f 100644 --- a/types/react-overlays/lib/WaitForContainer.d.ts +++ b/types/react-overlays/lib/WaitForContainer.d.ts @@ -1,17 +1,17 @@ import * as React from "react"; declare class WaitForContainer extends React.Component< - WaitForContainer.WaitForContainerProps + WaitForContainer.WaitForContainerProps > {} export = WaitForContainer; declare namespace WaitForContainer { - interface WaitForContainerProps { - /** - * "offsetParent" of the component - */ - container?: React.ReactNode | Function; + interface WaitForContainerProps { + /** + * "offsetParent" of the component + */ + container?: React.ReactNode | Function; - onContainerResolved?: Function; - } + onContainerResolved?: Function; + } } diff --git a/types/react-overlays/lib/index.d.ts b/types/react-overlays/lib/index.d.ts index fd90edd095..553ae51582 100644 --- a/types/react-overlays/lib/index.d.ts +++ b/types/react-overlays/lib/index.d.ts @@ -11,15 +11,15 @@ import RootCloseWrapper = require("./RootCloseWrapper"); import WaitForContainer = require("./WaitForContainer"); export { - Affix, - AutoAffix, - Dropdown, - DropdownMenu, - DropdownToggle, - Modal, - ModalManager, - Overlay, - Portal, - RootCloseWrapper, - WaitForContainer + Affix, + AutoAffix, + Dropdown, + DropdownMenu, + DropdownToggle, + Modal, + ModalManager, + Overlay, + Portal, + RootCloseWrapper, + WaitForContainer }; diff --git a/types/react-overlays/test/react-overlays-tests-transition.tsx b/types/react-overlays/test/react-overlays-tests-transition.tsx index f2a1769a79..24a16beb97 100644 --- a/types/react-overlays/test/react-overlays-tests-transition.tsx +++ b/types/react-overlays/test/react-overlays-tests-transition.tsx @@ -4,12 +4,12 @@ import { CSSTransition } from "react-transition-group"; import { TransitionProps } from "react-transition-group/Transition"; export function OverlayFade(props: TransitionProps): JSX.Element { - return ( - - ); + return ( + + ); } diff --git a/types/react-overlays/test/react-overlays-tests.tsx b/types/react-overlays/test/react-overlays-tests.tsx index f1465dc384..9f125e0b29 100644 --- a/types/react-overlays/test/react-overlays-tests.tsx +++ b/types/react-overlays/test/react-overlays-tests.tsx @@ -6,64 +6,64 @@ import { OverlayRenderProps } from "react-overlays/lib/Overlay"; import { OverlayFade } from "./react-overlays-tests-transition"; class TestAffix extends React.Component { - render(): JSX.Element { - return ( -
- -
Test
-
-
- ); - } + render(): JSX.Element { + return ( +
+ +
Test
+
+
+ ); + } } function renderOverlayContent({ props }: OverlayRenderProps) { - return
Popover content
; + return
Popover content
; } class TestOverlay extends React.Component<{}, { open: boolean }> { - target: HTMLElement | null = null; - state = { open: false }; + target: HTMLElement | null = null; + state = { open: false }; - render(): JSX.Element { - const { open } = this.state; + render(): JSX.Element { + const { open } = this.state; - return ( -
- + return ( +
+ - this.target} - transition={OverlayFade} - onHide={() => this.setState({ open: false })} - placement="bottom" - > - {renderOverlayContent} - -
- ); - } + this.target} + transition={OverlayFade} + onHide={() => this.setState({ open: false })} + placement="bottom" + > + {renderOverlayContent} + +
+ ); + } } class TestRootCloseWrapper extends React.Component { - handleRootClose = () => {}; - render() { - return ( - -
Test
-
- ); - } + handleRootClose = () => {}; + render() { + return ( + +
Test
+
+ ); + } }