diff --git a/types/reactstrap/index.d.ts b/types/reactstrap/index.d.ts index fb0242be63..fc01df2e94 100644 --- a/types/reactstrap/index.d.ts +++ b/types/reactstrap/index.d.ts @@ -5,6 +5,7 @@ // Danilo Barros // Fábio Paiva // FaithForHumans +// Kurt Preston // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/reactstrap/lib/Popover.d.ts b/types/reactstrap/lib/Popover.d.ts index dcded7ab68..a256d9d254 100644 --- a/types/reactstrap/lib/Popover.d.ts +++ b/types/reactstrap/lib/Popover.d.ts @@ -1,33 +1,37 @@ -/// +/// import { CSSModule } from '../index'; -type Placement - = 'top' - | 'bottom' - | 'left' +export type Placement + = 'auto' + | 'auto-start' + | 'auto-end' + | 'top' + | 'top-start' + | 'top-end' | 'right' - | 'top left' - | 'top center' - | 'top right' - | 'right top' - | 'right middle' - | 'right bottom' - | 'bottom right' - | 'bottom center' - | 'bottom left' - | 'left top' - | 'left middle' - | 'left bottom'; + | 'right-start' + | 'right-end' + | 'bottom' + | 'bottom-start' + | 'bottom-end' + | 'left' + | 'left-start' + | 'left-end'; -export interface PopoverProps { - placement?: Placement; - target: string; +export interface PopoverProps extends React.HTMLAttributes { isOpen?: boolean; - tether?: Tether.ITetherOptions; - className?: string; - cssModule?: CSSModule; toggle?: () => void; + target: string | HTMLElement; + container?: string | HTMLElement; + className?: string; + placement?: Placement; + innerClassName?: string; + disabled?: boolean; + placementPrefix?: string; + delay?: number | {show: number, hide: number}; + modifiers?: object; + cssModule?: CSSModule; } declare const Popover: React.StatelessComponent; diff --git a/types/reactstrap/lib/Tooltip.d.ts b/types/reactstrap/lib/Tooltip.d.ts index a6183668bf..38a010f001 100644 --- a/types/reactstrap/lib/Tooltip.d.ts +++ b/types/reactstrap/lib/Tooltip.d.ts @@ -1,35 +1,34 @@ -/// +/// import { CSSModule } from '../index'; -type Placement - = 'top' - | 'bottom' - | 'left' +export type Placement + = 'auto' + | 'auto-start' + | 'auto-end' + | 'top' + | 'top-start' + | 'top-end' | 'right' - | 'top left' - | 'top center' - | 'top right' - | 'right top' - | 'right middle' - | 'right bottom' - | 'bottom right' - | 'bottom center' - | 'bottom left' - | 'left top' - | 'left middle' - | 'left bottom'; + | 'right-start' + | 'right-end' + | 'bottom' + | 'bottom-start' + | 'bottom-end' + | 'left' + | 'left-start' + | 'left-end'; -export interface UncontrolledProps { - placement?: Placement; - target: string; - disabled?: boolean; - tether?: Tether.ITetherOptions; - tetherRef?: (tether: Tether) => void; +export interface UncontrolledProps extends React.HTMLAttributes { + target: string | HTMLElement; + container?: string | HTMLElement; + delay?: number | {show: number, hide: number}; className?: string; - cssModule?: CSSModule; + innerClassName?: string; autohide?: boolean; - delay?: number | { show: number, hide: number }; + placement?: Placement; + modifiers?: object; + cssModule?: CSSModule; } export interface UncontrolledTooltipProps extends UncontrolledProps { /* intentionally blank */ diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index 352fbe8ac3..449c56a3a0 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -2479,7 +2479,7 @@ class Example85 extends React.Component { - + {}}> Popover Title Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. @@ -3500,3 +3500,24 @@ const Example113 = (props: any) => { ); }; + +class Example114 extends React.Component { +private element: HTMLElement; + +refFn(r: HTMLElement | null) { + if (r) { + this.element = r; + } +} + +render() { + return ( +
+

Somewhere in here is a tooltip.

+ + Hello world! + +
+ ); +} +}