mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[reactstrap]: Update types to 8.5 (#45691)
This commit is contained in:
parent
7dc8fd8266
commit
3b2503801a
2
types/reactstrap/index.d.ts
vendored
2
types/reactstrap/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for reactstrap 8.4
|
||||
// Type definitions for reactstrap 8.5
|
||||
// Project: https://github.com/reactstrap/reactstrap#readme
|
||||
// Definitions by: Ali Hammad Baig <https://github.com/alihammad>
|
||||
// Marco Falkenberg <https://github.com/mfal>
|
||||
|
||||
1
types/reactstrap/lib/Modal.d.ts
vendored
1
types/reactstrap/lib/Modal.d.ts
vendored
@ -31,6 +31,7 @@ export interface ModalProps extends React.HTMLAttributes<HTMLElement> {
|
||||
role?: string;
|
||||
unmountOnClose?: boolean;
|
||||
returnFocusAfterClose?: boolean;
|
||||
container?: string | HTMLElement | React.RefObject<HTMLElement>;
|
||||
}
|
||||
|
||||
declare class Modal<T> extends React.Component<ModalProps> {}
|
||||
|
||||
7
types/reactstrap/lib/Popover.d.ts
vendored
7
types/reactstrap/lib/Popover.d.ts
vendored
@ -2,6 +2,12 @@ import * as React from 'react';
|
||||
import * as Popper from 'popper.js';
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface PopoverChildrenRenderProps {
|
||||
scheduleUpdate: () => void;
|
||||
}
|
||||
|
||||
export type PopoverChildren = ((props: PopoverChildrenRenderProps) => React.ReactNode) | React.ReactNode;
|
||||
|
||||
export interface PopoverProps extends React.HTMLAttributes<HTMLElement> {
|
||||
[key: string]: any;
|
||||
isOpen?: boolean;
|
||||
@ -21,6 +27,7 @@ export interface PopoverProps extends React.HTMLAttributes<HTMLElement> {
|
||||
cssModule?: CSSModule;
|
||||
fade?: boolean;
|
||||
flip?: boolean;
|
||||
children?: PopoverChildren;
|
||||
}
|
||||
|
||||
export interface UncontrolledPopoverProps extends PopoverProps {
|
||||
|
||||
3
types/reactstrap/lib/Progress.d.ts
vendored
3
types/reactstrap/lib/Progress.d.ts
vendored
@ -7,6 +7,7 @@ export interface ProgressProps extends React.HTMLAttributes<HTMLElement> {
|
||||
multi?: boolean;
|
||||
tag?: string;
|
||||
value?: string | number;
|
||||
min?: string | number;
|
||||
max?: string | number;
|
||||
animated?: boolean;
|
||||
striped?: boolean;
|
||||
@ -14,6 +15,8 @@ export interface ProgressProps extends React.HTMLAttributes<HTMLElement> {
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
barClassName?: string;
|
||||
barAriaValueText?: string;
|
||||
barAriaLabelledBy?: string;
|
||||
}
|
||||
|
||||
declare class Progress<T = {[key: string]: any}> extends React.Component<ProgressProps> {}
|
||||
|
||||
8
types/reactstrap/lib/Tooltip.d.ts
vendored
8
types/reactstrap/lib/Tooltip.d.ts
vendored
@ -2,6 +2,13 @@ import * as React from 'react';
|
||||
import * as Popper from 'popper.js';
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface TooltipChildrenRenderProps {
|
||||
scheduleUpdate: () => void;
|
||||
}
|
||||
|
||||
export type TooltipChildren =
|
||||
((props: TooltipChildrenRenderProps) => React.ReactNode) | React.ReactNode;
|
||||
|
||||
export interface UncontrolledTooltipProps extends React.HTMLAttributes<HTMLElement> {
|
||||
[key: string]: any;
|
||||
target: string | HTMLElement | React.RefObject<HTMLElement>;
|
||||
@ -16,6 +23,7 @@ export interface UncontrolledTooltipProps extends React.HTMLAttributes<HTMLEleme
|
||||
cssModule?: CSSModule;
|
||||
fade?: boolean;
|
||||
flip?: boolean;
|
||||
children?: TooltipChildren;
|
||||
}
|
||||
|
||||
export interface TooltipProps extends UncontrolledTooltipProps {
|
||||
|
||||
@ -2123,7 +2123,7 @@ class ModalExample72 extends React.Component<any, any> {
|
||||
return (
|
||||
<div>
|
||||
<Button color="danger" onClick={this.toggle}>{this.props.buttonLabel}</Button>
|
||||
<Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className}>
|
||||
<Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className} container="#test">
|
||||
<ModalHeader toggle={this.toggle}>Modal title</ModalHeader>
|
||||
<ModalBody>
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
@ -2144,6 +2144,7 @@ class ModalExample72 extends React.Component<any, any> {
|
||||
|
||||
class ModalExample73 extends React.Component<any, any> {
|
||||
state: any;
|
||||
element: HTMLElement;
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@ -2184,7 +2185,7 @@ class ModalExample73 extends React.Component<any, any> {
|
||||
{' '}
|
||||
<Button color="danger" onClick={this.toggle}>{this.props.buttonLabel}</Button>
|
||||
</Form>
|
||||
<Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className} backdrop={this.state.backdrop}>
|
||||
<Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className} backdrop={this.state.backdrop} container={this.element}>
|
||||
<ModalHeader toggle={this.toggle}>Modal title</ModalHeader>
|
||||
<ModalBody>
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
|
||||
@ -3016,13 +3017,13 @@ const Example92 = (props: any) => {
|
||||
return (
|
||||
<div>
|
||||
<div className="text-center">1 of 5</div>
|
||||
<Progress value="1" max="5" />
|
||||
<Progress value="1" min="1" max="5" />
|
||||
<div className="text-center">50 of 135</div>
|
||||
<Progress value={50} max="135" />
|
||||
<div className="text-center">75 of 111</div>
|
||||
<Progress value={75} max={111} />
|
||||
<Progress value={75} min={1} max={111} />
|
||||
<div className="text-center">463 of 500</div>
|
||||
<Progress value="463" max={500} />
|
||||
<Progress value="463" max={500} barAriaValueText="test" barAriaLabelledBy="test" />
|
||||
|
||||
<div className="text-center">Various (40) of 55</div>
|
||||
<Progress multi>
|
||||
@ -4800,3 +4801,20 @@ const UtilTest = () => {
|
||||
btn: 'btn2'
|
||||
});
|
||||
};
|
||||
|
||||
const ScheduleUpdate = () => {
|
||||
return (
|
||||
<>
|
||||
<UncontrolledPopover trigger="click" placement="top" target="ScheduleUpdateButton">
|
||||
{({ scheduleUpdate }) => (
|
||||
<div>test</div>
|
||||
)}
|
||||
</UncontrolledPopover>
|
||||
<UncontrolledTooltip placement="top" target="ScheduleUpdateTooltip" trigger="click">
|
||||
{({ scheduleUpdate }) => (
|
||||
<div>test</div>
|
||||
)}
|
||||
</UncontrolledTooltip>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user