mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Feature/support dropdownmenu position fixed (#37669)
* fix(reactstrap): Add positionFixed property to DropdownMenu of reactstrap * style(reactstrap): Format some test code * fix(reactstrap): Fix the component unit tests * style(reactstrap): Format code style
This commit is contained in:
1
types/reactstrap/index.d.ts
vendored
1
types/reactstrap/index.d.ts
vendored
@@ -9,6 +9,7 @@
|
||||
// Prabodh Tiwari <https://github.com/prabodht>
|
||||
// Georg Steinmetz <https://github.com/georg94>
|
||||
// Kyle Tsang <https://github.com/kyletsang>
|
||||
// Hayato Shimokawa <https://github.com/ichiwa>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
|
||||
1
types/reactstrap/lib/DropdownMenu.d.ts
vendored
1
types/reactstrap/lib/DropdownMenu.d.ts
vendored
@@ -11,6 +11,7 @@ export interface DropdownMenuProps extends React.HTMLAttributes<HTMLElement> {
|
||||
flip?: boolean;
|
||||
modifiers?: Popper.Modifiers;
|
||||
persist?: boolean;
|
||||
positionFixed?: boolean;
|
||||
}
|
||||
|
||||
declare class DropdownMenu<T = {[key: string]: any}> extends React.Component<DropdownMenuProps> {}
|
||||
|
||||
@@ -4563,3 +4563,35 @@ function Example128() {
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
class Example129 extends React.Component<any, any> {
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
|
||||
this.toggle = this.toggle.bind(this);
|
||||
this.state = {
|
||||
dropdownOpen: false,
|
||||
};
|
||||
}
|
||||
|
||||
toggle() {
|
||||
this.setState({
|
||||
dropdownOpen: !this.state.dropdownOpen,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Dropdown isOpen={this.state.dropdownOpen} toggle={this.toggle}>
|
||||
<DropdownToggle caret>Dropdown</DropdownToggle>
|
||||
<DropdownMenu persist positionFixed>
|
||||
<DropdownItem header>Header</DropdownItem>
|
||||
<DropdownItem disabled>Action</DropdownItem>
|
||||
<DropdownItem>Another Action</DropdownItem>
|
||||
<DropdownItem divider />
|
||||
<DropdownItem>Another Action</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
1
types/reactstrap/v7/lib/DropdownMenu.d.ts
vendored
1
types/reactstrap/v7/lib/DropdownMenu.d.ts
vendored
@@ -10,6 +10,7 @@ export type DropdownMenuProps<T = {}> = React.HTMLAttributes<HTMLElement> & {
|
||||
flip?: boolean;
|
||||
modifiers?: Popper.Modifiers;
|
||||
persist?: boolean;
|
||||
positionFixed?: boolean;
|
||||
} & T;
|
||||
|
||||
declare class DropdownMenu<T = {[key: string]: any}> extends React.Component<DropdownMenuProps<T>> {}
|
||||
|
||||
@@ -4357,3 +4357,35 @@ function Example126() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
class Example127 extends React.Component<any, any> {
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
|
||||
this.toggle = this.toggle.bind(this);
|
||||
this.state = {
|
||||
dropdownOpen: false,
|
||||
};
|
||||
}
|
||||
|
||||
toggle() {
|
||||
this.setState({
|
||||
dropdownOpen: !this.state.dropdownOpen,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Dropdown isOpen={this.state.dropdownOpen} toggle={this.toggle}>
|
||||
<DropdownToggle caret>Dropdown</DropdownToggle>
|
||||
<DropdownMenu persist positionFixed>
|
||||
<DropdownItem header>Header</DropdownItem>
|
||||
<DropdownItem disabled>Action</DropdownItem>
|
||||
<DropdownItem>Another Action</DropdownItem>
|
||||
<DropdownItem divider />
|
||||
<DropdownItem>Another Action</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user