├── .gitignore ├── demo ├── src │ ├── index.js │ ├── fruit.js │ ├── app.styl │ └── App.js ├── .gitignore ├── README.md ├── package.json └── public │ ├── index.html │ └── bundle.css ├── src ├── styles │ └── react-datalist.styl ├── components │ ├── DataListOption.js │ └── DataList.js └── ReactDataList.js ├── LICENSE ├── package.json ├── lib ├── components │ ├── DataListOption.js │ └── DataList.js └── ReactDataList.js ├── README.md └── test └── spec.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.swp 3 | -------------------------------------------------------------------------------- /demo/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render( 6 | , 7 | document.getElementById('root') 8 | ); 9 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | 6 | # testing 7 | coverage 8 | 9 | # production 10 | build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log 16 | -------------------------------------------------------------------------------- /demo/README.md: -------------------------------------------------------------------------------- 1 | React Datalist Demo 2 | ============================== 3 | 4 | This is a runnable demo showing how to use `react-datalist` 5 | 6 | ## Running Example 7 | 8 | **In the demo directory, run:** 9 | ``` 10 | $ npm install 11 | $ npm start 12 | ``` 13 | **Open [http://localhost:3000](http://localhost:3000) to view it in the browser.** 14 | -------------------------------------------------------------------------------- /src/styles/react-datalist.styl: -------------------------------------------------------------------------------- 1 | .react-datalist 2 | margin : 0 !important 3 | border : 1px solid #A1C1E7 4 | max-height : 500px 5 | overflow-x : scroll 6 | background-color : white 7 | 8 | .react-datalist-option 9 | display : block 10 | margin : 0 !important 11 | width : 94% 12 | padding : 3% 13 | cursor : pointer 14 | 15 | &:hover 16 | background-color #BAD4FE 17 | 18 | &.react-datalist-option-selected 19 | background-color #BAD4FE 20 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-datalist-demo-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "react-scripts": "0.6.1" 7 | }, 8 | "dependencies": { 9 | "react": "^15.3.2", 10 | "react-datalist": "^3.0.0", 11 | "react-dom": "^15.3.2", 12 | "stylusify": "^2.1.0" 13 | }, 14 | "scripts": { 15 | "compile-stylus": "stylus src/app.styl -p > public/bundle.css", 16 | "start": "npm run compile-stylus && react-scripts start", 17 | "build": "npm run compile-stylus && react-scripts build" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/components/DataListOption.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | export default class DatalistOption extends React.Component { 4 | render() { 5 | var classes = 'react-datalist-option' 6 | if (this.props.selected) classes += ' react-datalist-option-selected' 7 | if (this.props.useNative) return ( 8 |