Merge pull request #18723 from dan-j/master

[material-ui] Added missing prop definitions for <DropDownMenu />
This commit is contained in:
Andrew Casey
2017-08-08 13:37:38 -07:00
committed by GitHub
2 changed files with 15 additions and 0 deletions
+4
View File
@@ -1229,6 +1229,7 @@ declare namespace __MaterialUI {
interface DropDownMenuProps {
// <div/> is the element that gets the 'other' properties
anchorOrigin?: propTypes.origin;
animated?: boolean;
animation?: React.ComponentClass<Popover.PopoverAnimationProps>;
autoWidth?: boolean;
@@ -1239,13 +1240,16 @@ declare namespace __MaterialUI {
labelStyle?: React.CSSProperties;
listStyle?: React.CSSProperties;
maxHeight?: number;
menuItemStyle?: React.CSSProperties;
menuStyle?: React.CSSProperties;
multiple?: boolean;
onChange?(e: TouchTapEvent, index: number, menuItemValue: any): void;
onClose?(e: TouchTapEvent): void;
openImmediately?: boolean;
selectedMenuItemStyle?: React.CSSProperties;
selectionRenderer?(value: any, menuItem: any): void;
style?: React.CSSProperties;
targetOrigin?: propTypes.origin;
underlineStyle?: React.CSSProperties;
value?: any;
}
+11
View File
@@ -2764,6 +2764,17 @@ class DropDownMenuOpenImmediateExample extends React.Component<{}, {value?: numb
}
}
const DropDownMenuAnchorExample: React.SFC<{}> = () => (
<DropDownMenu
value={1}
targetOrigin={{ horizontal: 'middle', vertical: 'top' }}
anchorOrigin={{ horizontal: 'middle', vertical: 'top' }}
>
<MenuItem value={1} primaryText="First" />
<MenuItem value={2} primaryText="Second" />
</DropDownMenu>
);
const items: Array<React.ReactElement<__MaterialUI.Menus.MenuItemProps>> = [];
for (let i = 0; i < 100; i++) {
items.push(<MenuItem value={i} key={i} primaryText={`Item ${i}`}/>);