From a2f0dc2938b88828ecd48d5588b61333fefbd273 Mon Sep 17 00:00:00 2001 From: mtgto Date: Sat, 13 Jan 2018 03:02:26 +0900 Subject: [PATCH] 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. --- types/material-ui/index.d.ts | 19 +++++++++---------- types/material-ui/material-ui-tests.tsx | 12 +++++++++++- types/material-ui/scripts/generate.ts | 4 ++-- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 357b766e3f..08a18a752b 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -1241,11 +1241,14 @@ declare namespace __MaterialUI { export interface IconMenuProps { // is the element that get the 'other' properties anchorOrigin?: propTypes.origin; + animated?: boolean; animation?: React.ComponentClass; className?: string; - iconButtonElement: React.ReactElement; + clickCloseDelay?: number; + iconButtonElement: React.ReactElement; 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 autoWidth?: boolean; + children?: Array>; 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; - width?: string | number; } export class IconMenu extends React.Component { } @@ -1281,7 +1281,6 @@ declare namespace __MaterialUI { anchorOrigin?: propTypes.origin; animated?: boolean; animation?: React.ComponentClass; - autoWidth?: boolean; className?: string; disabled?: boolean; iconButton?: React.ReactNode; diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index f678ae8a51..316a14b78a 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -4487,6 +4487,17 @@ const IconMenuExampleSimple = () => ( + } + onClick={(e) => {}} + onItemClick={(e, child) => {}} + > + + + + + + ); @@ -4696,7 +4707,6 @@ class DropDownMenuSimpleExample extends Component<{}, {value?: number}> { value={this.state.value} onChange={this.handleChange} style={styles.customWidth} - autoWidth={false} > diff --git a/types/material-ui/scripts/generate.ts b/types/material-ui/scripts/generate.ts index f8024d5805..e37b84d1de 100644 --- a/types/material-ui/scripts/generate.ts +++ b/types/material-ui/scripts/generate.ts @@ -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()