├── .gitattributes ├── .travis.yml ├── .npmignore ├── .gitignore ├── preview.png ├── src ├── utils.js ├── List.jsx ├── ListItem.jsx ├── Filter.jsx └── index.jsx ├── .eslintrc ├── .mversionrc ├── .editorconfig ├── .babelrc ├── test ├── helpers │ └── setup-test-env.js └── test.js ├── example ├── index.html ├── style.css └── app.jsx ├── style.css ├── webpack.config.js ├── LICENSE ├── package.json ├── README.md └── CHANGELOG.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - v10 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | example/bundle.js 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | example/bundle.js 4 | /lib 5 | -------------------------------------------------------------------------------- /preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VovanR/react-multiselect-two-sides/HEAD/preview.png -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | export function filterBy(option, filter, labelKey) { 2 | return option[labelKey].toLowerCase().indexOf(filter.toLowerCase()) > -1; 3 | } 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "xo", 4 | "xo-react" 5 | ], 6 | "settings": { 7 | "react": { 8 | "version": "16" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.mversionrc: -------------------------------------------------------------------------------- 1 | { 2 | "commitMessage": "chore(ver): v%s", 3 | "scripts": { 4 | "postcommit": "git push --follow-tags", 5 | "precommit": "conventional-changelog -p angular -i CHANGELOG.md --same-file && git add CHANGELOG.md" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [{*.json,*.yml}] 11 | indent_style = space 12 | indent_size = 2 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-react", 4 | "@babel/preset-env" 5 | ], 6 | "env": { 7 | "production": { 8 | "plugins": [ 9 | [ 10 | "transform-react-remove-prop-types", 11 | { 12 | "removeImport": true 13 | } 14 | ] 15 | ] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/helpers/setup-test-env.js: -------------------------------------------------------------------------------- 1 | import 'raf/polyfill'; 2 | import {JSDOM} from 'jsdom'; 3 | 4 | import Enzyme from 'enzyme'; 5 | import Adapter from 'enzyme-adapter-react-16'; 6 | Enzyme.configure({adapter: new Adapter()}); 7 | 8 | const jsdom = new JSDOM('
'); 9 | const {window} = jsdom; 10 | global.window = window; 11 | global.document = window.document; 12 | global.navigator = { 13 | userAgent: 'node.js' 14 | }; 15 | copyProps(window, global); 16 | 17 | function copyProps(src, target) { 18 | const props = Object.getOwnPropertyNames(src) 19 | .filter(prop => typeof target[prop] === 'undefined') 20 | .map(prop => Object.getOwnPropertyDescriptor(src, prop)); 21 | Object.defineProperties(target, props); 22 | } 23 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
165 | {settings.map(setting => {
166 | if (typeof setting.value === 'boolean') {
167 | return (
168 |