Merge pull request #12914 from alisabzevari/types-2.0

Add dataSourceConfig typings to material-ui/AutoComplete
This commit is contained in:
Paul van Brenk
2016-11-29 14:39:08 -08:00
committed by GitHub
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -533,6 +533,7 @@ declare namespace __MaterialUI {
animated?: boolean;
animation?: React.ComponentClass<Popover.PopoverAnimationProps>;
dataSource: AutoCompleteDataSource;
dataSourceConfig?: { text: string; value: string; };
disableFocusRipple?: boolean;
errorStyle?: React.CSSProperties;
errorText?: string;
+11
View File
@@ -396,6 +396,11 @@ export class AutoCompleteExampleSimple extends React.Component<{}, {dataSource:
});
};
dataSourceConfig = {
text: 'textKey',
value: 'valueKey',
};
render() {
return (
<div>
@@ -414,6 +419,12 @@ export class AutoCompleteExampleSimple extends React.Component<{}, {dataSource:
animated: true
}}
/>
<AutoComplete
hintText="Type anything"
dataSource={this.state.dataSource}
dataSourceConfig={this.dataSourceConfig}
onUpdateInput={this.handleUpdateInput}
/>
</div>
);
}