material-ui: Fix IconMenu properties. (#22663)

* material-ui: Fix IconMenu properties.

* material-ui: Bug Fix IconMenu#onClick argument

* material-ui: Bug Fix IconMenu#children typedef.
This commit is contained in:
mtgto
2018-01-12 10:02:26 -08:00
committed by Ryan Cavanaugh
parent 5ee253b57e
commit a2f0dc2938
3 changed files with 22 additions and 13 deletions
+9 -10
View File
@@ -1241,11 +1241,14 @@ declare namespace __MaterialUI {
export interface IconMenuProps {
// <Menu/> is the element that get the 'other' properties
anchorOrigin?: propTypes.origin;
animated?: boolean;
animation?: React.ComponentClass<Popover.PopoverAnimationProps>;
className?: string;
iconButtonElement: React.ReactElement<IconButtonProps>;
clickCloseDelay?: number;
iconButtonElement: React.ReactElement<IconButton>;
iconStyle?: React.CSSProperties;
menuStyle?: React.CSSProperties;
onClick?(e: React.SyntheticEvent<{}>): void;
onItemClick?(e: React.SyntheticEvent<{}>, item: MenuItem): void;
onKeyboardFocus?(e: React.FocusEvent<{}>, isKeyboardFocused: boolean): void;
onMouseDown?: React.MouseEventHandler<{}>;
@@ -1253,25 +1256,22 @@ declare namespace __MaterialUI {
onMouseLeave?: React.MouseEventHandler<{}>;
onMouseUp?: React.MouseEventHandler<{}>;
onRequestChange?(opening: boolean, reason: string): void;
onClick?: React.MouseEventHandler<{}>;
open?: boolean;
style?: React.CSSProperties;
targetOrigin?: propTypes.origin;
clickCloseDelay?: number;
useLayerForClickAway?: boolean;
animated?: boolean;
// Other properties from <Menu/>
autoWidth?: boolean;
children?: Array<React.ReactElement<MenuItemProps>>;
desktop?: boolean;
disableAutoFocus?: boolean;
initiallyKeyboardFocused?: boolean;
listStyle?: React.CSSProperties;
maxHeight?: number;
multiple?: boolean;
onChange?(e: React.SyntheticEvent<{}>, itemValue: any | any[]): void;
onKeyDown?: React.KeyboardEventHandler<{}>;
selectedMenuItemStyle?: React.CSSProperties;
style?: React.CSSProperties;
value?: any | any[];
valueLink?: ReactLink<any | any[]>;
width?: string | number;
}
export class IconMenu extends React.Component<IconMenuProps> {
}
@@ -1281,7 +1281,6 @@ declare namespace __MaterialUI {
anchorOrigin?: propTypes.origin;
animated?: boolean;
animation?: React.ComponentClass<Popover.PopoverAnimationProps>;
autoWidth?: boolean;
className?: string;
disabled?: boolean;
iconButton?: React.ReactNode;
+11 -1
View File
@@ -4487,6 +4487,17 @@ const IconMenuExampleSimple = () => (
<MenuItem primaryText="Help"/>
<MenuItem primaryText="Sign out"/>
</IconMenu>
<IconMenu
iconButtonElement={<IconButton><NavigationMoreVert /></IconButton>}
onClick={(e) => {}}
onItemClick={(e, child) => {}}
>
<MenuItem primaryText="Refresh"/>
<MenuItem primaryText="Send feedback"/>
<MenuItem primaryText="Settings"/>
<MenuItem primaryText="Help"/>
<MenuItem primaryText="Sign out"/>
</IconMenu>
</div>
);
@@ -4696,7 +4707,6 @@ class DropDownMenuSimpleExample extends Component<{}, {value?: number}> {
value={this.state.value}
onChange={this.handleChange}
style={styles.customWidth}
autoWidth={false}
>
<MenuItem value={1} primaryText="Custom width"/>
<MenuItem value={2} primaryText="Every Night"/>
+2 -2
View File
@@ -39,9 +39,9 @@ const github = (path) => new Promise((resolve, reject) => {
}).on('error', reject)
})
const categories = () => github(`/repos/callemall/material-ui/contents/src/svg-icons?ref=master&access_token=${token}`)
const categories = () => github(`/repos/mui-org/material-ui/contents/src/svg-icons?ref=master&access_token=${token}`)
const contents = (path) => github(`/repos/callemall/material-ui/contents/${path}?ref=master&access_token=${token}`)
const contents = (path) => github(`/repos/mui-org/material-ui/contents/${path}?ref=master&access_token=${token}`)
const collator = new Intl.Collator()