Skip to content

Commit

Permalink
changed to auto-complete
Browse files Browse the repository at this point in the history
bug fixed
  • Loading branch information
yongxu committed Nov 7, 2015
1 parent 6832086 commit c28be97
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 107 deletions.
4 changes: 2 additions & 2 deletions docs/src/app/app-routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const InlineStyles = require('./components/pages/customization/inline-styles');

const Components = require('./components/pages/components');
const AppBar = require('./components/pages/components/app-bar');
const AutoComplete = require('./components/pages/components/auto-complete');
const Avatars = require('./components/pages/components/avatars');
const Buttons = require('./components/pages/components/buttons');
const Cards = require('./components/pages/components/cards');
Expand All @@ -37,7 +38,6 @@ const Menus = require('./components/pages/components/menus');
const Paper = require('./components/pages/components/paper');
const Progress = require('./components/pages/components/progress');
const RefreshIndicator = require('./components/pages/components/refresh-indicator');
const SearchField = require('./components/pages/components/search-field');
const Sliders = require('./components/pages/components/sliders');
const Snackbar = require('./components/pages/components/snackbar');
const Switches = require('./components/pages/components/switches');
Expand Down Expand Up @@ -77,6 +77,7 @@ const AppRoutes = (
<Redirect from="components" to="/components/appbar" />
<Route path="components" component={Components}>
<Route path="appbar" component={AppBar} />
<Route path="auto-complete" component={AutoComplete} />
<Route path="avatars" component={Avatars} />
<Route path="buttons" component={Buttons} />
<Route path="cards" component={Cards} />
Expand All @@ -93,7 +94,6 @@ const AppRoutes = (
<Route path="paper" component={Paper} />
<Route path="progress" component={Progress} />
<Route path="refresh-indicator" component={RefreshIndicator} />
<Route path="search-field" component={SearchField} />
<Route path="sliders" component={Sliders} />
<Route path="switches" component={Switches} />
<Route path="snackbar" component={Snackbar} />
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/components/pages/components.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default class Components extends React.Component {
render() {
let menuItems = [
{ route: '/components/appbar', text: 'AppBar'},
{ route: '/components/auto-complete', text: 'Auto Complete'},
{ route: '/components/avatars', text: 'Avatars'},
{ route: '/components/buttons', text: 'Buttons'},
{ route: '/components/cards', text: 'Cards'},
Expand All @@ -22,7 +23,6 @@ export default class Components extends React.Component {
{ route: '/components/paper', text: 'Paper'},
{ route: '/components/progress', text: 'Progress'},
{ route: '/components/refresh-indicator', text: 'Refresh Indicator'},
{ route: '/components/search-field', text: 'Search Field'},
{ route: '/components/sliders', text: 'Sliders'},
{ route: '/components/switches', text: 'Switches'},
{ route: '/components/snackbar', text: 'Snackbar'},
Expand Down
82 changes: 82 additions & 0 deletions docs/src/app/components/pages/components/auto-complete.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
const React = require('react');

const { AutoComplete } = require('material-ui');
const ComponentDoc = require('../../component-doc');

const Code = require('auto-complete-code');

class AutoCompletePage extends React.Component {

constructor(props) {
super(props);
}

render() {

let desc = null;

return (
<ComponentDoc
name="Auto Complete"
code={Code}
desc={desc}
componentInfo={[{
name: 'Auto Complete',
infoArray: [],
}]}>

<br/>

<div>
<AutoComplete
onUpdateRequests={(t) => {console.log(t); return [t, t+t, t+t+t];}}
onNewRequest={(t) => {console.log('request:'+t);}} />

<AutoComplete
fullWidth = {true}
hintText = "hint"
onUpdateRequests={(t) => {console.log(t); return [t, t+t, t+t+t];}}
onNewRequest={(t) => {console.log('request:'+t);}} />

<AutoComplete
fullWidth={true}
searchText= "***************"
errorText= "error message"
onUpdateRequests={(t) => {console.log(t); return [t, t+t, t+t+t];}}
onNewRequest={(t) => {console.log('request:'+t);}} />

<AutoComplete
fullWidth={true}
hintText = "type here"
onUpdateRequests={(t) => {
console.log(t);
return [
(<AutoComplete.Item primaryText={t} secondaryText="&#9786;" />),
(<AutoComplete.Divider/>),
(<AutoComplete.Item primaryText={t.toUpperCase()} secondaryText="&#9885;" />),
];
}}
onNewRequest={(t, index) => {console.log('request:'+index);}} />


<AutoComplete
floatingLabelText = "floating Label"
dataSource = {["12345","23456","34567"]} />

<AutoComplete
fullWidth={true}
floatingLabelText = "auto"
auto = {true}
dataSource = {["12345","23456","34567"]} />

</div>

</ComponentDoc>
);

}


}

module.exports = AutoCompletePage;
54 changes: 0 additions & 54 deletions docs/src/app/components/pages/components/search-field.jsx

This file was deleted.

28 changes: 28 additions & 0 deletions docs/src/app/components/raw-code/auto-complete-code.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<AutoComplete
onUpdateRequests={(t) => {console.log(t); return [t, t+t, t+t+t];}}
onNewRequest={(t) => {console.log('request:'+t);}} />
<AutoComplete
fullWidth = {true}
hintText = "hint"
onUpdateRequests={(t) => {console.log(t); return [t, t+t, t+t+t];}}
onNewRequest={(t) => {console.log('request:'+t);}} />

<AutoComplete
fullWidth={true}
searchText= "***************"
errorText= "error message"
onUpdateRequests={(t) => {console.log(t); return [t, t+t, t+t+t];}}
onNewRequest={(t) => {console.log('request:'+t);}} />

<AutoComplete
fullWidth={true}
hintText = "type here"
onUpdateRequests={(t) => {
console.log(t);
return [
(<AutoComplete.Item primaryText={t} secondaryText="&#9786;" />),
(<AutoComplete.Divider/>),
(<AutoComplete.Item primaryText={t.toUpperCase()} secondaryText="&#9885;" />)
];
}}
onNewRequest={(t,index) => {console.log('request:'+index);}} />
8 changes: 0 additions & 8 deletions docs/src/app/components/raw-code/search-field-code.txt

This file was deleted.

Loading

0 comments on commit c28be97

Please sign in to comment.