Add dataSourceConfig typings to material-ui/AutoComplete

This commit is contained in:
Ali Sabzevari
2016-11-25 11:41:51 +01:00
parent dc6cc8dcb9
commit 05b4a4ec04
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>
);
}