Merge pull request #32752 from georg94/reactstrap/UncontrolledPopover

Add UncontrolledPopover component to reactstrap types
This commit is contained in:
Armando Aguirre
2019-02-04 13:29:53 -08:00
committed by GitHub
4 changed files with 31 additions and 5 deletions
+5 -2
View File
@@ -246,7 +246,8 @@ import {
UncontrolledDropdown as UncontrolledDropdown_,
UncontrolledTooltip as UncontrolledTooltip_,
UncontrolledCollapse as UncontrolledCollapse_,
UncontrolledCarousel as UncontrolledCarousel_
UncontrolledCarousel as UncontrolledCarousel_,
UncontrolledPopover as UncontrolledPopover_
} from './lib/Uncontrolled';
export class UncontrolledAlert<T = {}> extends UncontrolledAlert_<T> {}
export class UncontrolledButtonDropdown<T = {}> extends UncontrolledButtonDropdown_<T> {}
@@ -254,11 +255,13 @@ export class UncontrolledDropdown<T = {}> extends UncontrolledDropdown_<T> {}
export class UncontrolledTooltip<T = {}> extends UncontrolledTooltip_<T> {}
export class UncontrolledCollapse<T = {}> extends UncontrolledCollapse_<T> {}
export class UncontrolledCarousel<T = {}> extends UncontrolledCarousel_<T> {}
export class UncontrolledPopover<T = {}> extends UncontrolledPopover_<T> {}
export {
UncontrolledButtonDropdownProps,
UncontrolledAlertProps,
UncontrolledDropdownProps,
UncontrolledTooltipProps,
UncontrolledCollapseProps,
UncontrolledCarouselProps
UncontrolledCarouselProps,
UncontrolledPopoverProps
} from './lib/Uncontrolled';
+4
View File
@@ -19,5 +19,9 @@ export type PopoverProps<T = {}> = React.HTMLAttributes<HTMLElement> & {
cssModule?: CSSModule;
} & T;
export type UncontrolledPopoverProps<T = {}> = PopoverProps<T> & {
defaultOpen?: boolean;
};
declare class Popover<T> extends React.Component<PopoverProps<T>> {}
export default Popover;
+5 -2
View File
@@ -5,7 +5,8 @@ import { UncontrolledButtonDropdownProps } from './ButtonDropdown';
import { UncontrolledDropdownProps } from './Dropdown';
import { UncontrolledTooltipProps } from './Tooltip';
import { UncontrolledCollapseProps } from './Collapse';
import { UncontrolledCarouselProps } from "./Carousel";
import { UncontrolledCarouselProps } from './Carousel';
import { UncontrolledPopoverProps } from './Popover';
export class UncontrolledAlert<T = {}> extends React.Component<UncontrolledAlertProps<T>> {}
export class UncontrolledButtonDropdown<T = {}> extends React.Component<UncontrolledButtonDropdownProps<T>> {}
@@ -13,10 +14,12 @@ export class UncontrolledDropdown<T = {}> extends React.Component<UncontrolledDr
export class UncontrolledTooltip<T = {}> extends React.Component<UncontrolledTooltipProps<T>> {}
export class UncontrolledCollapse<T = {}> extends React.Component<UncontrolledCollapseProps<T>> {}
export class UncontrolledCarousel<T = {}> extends React.Component<UncontrolledCarouselProps<T>> {}
export class UncontrolledPopover<T = {}> extends React.Component<UncontrolledPopoverProps<T>> {}
export { UncontrolledAlertProps } from './Alert';
export { UncontrolledButtonDropdownProps } from './ButtonDropdown';
export { UncontrolledDropdownProps } from './Dropdown';
export { UncontrolledTooltipProps } from './Tooltip';
export { UncontrolledCollapseProps } from './Collapse';
export { UncontrolledCarouselProps } from "./Carousel";
export { UncontrolledCarouselProps } from './Carousel';
export { UncontrolledPopoverProps } from './Popover';
+17 -1
View File
@@ -80,7 +80,8 @@ import {
Table,
Tag,
Tooltip,
Spinner
Spinner,
UncontrolledPopover,
} from 'reactstrap';
// --------------- Alert
@@ -4337,3 +4338,18 @@ function Example125() {
</div>
);
}
function Example126() {
return (
<div>
<UncontrolledPopover placement="bottom" target="UncontrolledPopover">
<PopoverHeader>Popover Title</PopoverHeader>
<PopoverBody>Lorem ipsum dolor sit amet</PopoverBody>
</UncontrolledPopover>
<UncontrolledPopover defaultOpen={true} placement="bottom" target="UncontrolledPopover">
<PopoverHeader>Popover Title</PopoverHeader>
<PopoverBody>Lorem ipsum dolor sit amet</PopoverBody>
</UncontrolledPopover>
</div>
);
}