{"_id":"500tech-react-select","_rev":"3-374832f7782da1aa0f9ac4cad71e481a","name":"500tech-react-select","description":"A Select control built with and for ReactJS","dist-tags":{"latest":"0.6.2"},"versions":{"0.6.2":{"name":"500tech-react-select","version":"0.6.2","description":"A Select control built with and for ReactJS","main":"lib/Select.js","author":{"name":"Jed Watson"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/JedWatson/react-select.git"},"dependencies":{"classnames":"^2.1.3","react-input-autosize":"^0.5.0"},"devDependencies":{"babel":"^5.6.14","babel-eslint":"^4.0.5","chai":"^3.0.0","coveralls":"^2.11.3","eslint":"^1.1.0","eslint-plugin-react":"^3.2.2","gulp":"^3.9.0","istanbul":"^0.3.17","jsdom":"^3.1.2","mocha":"^2.2.5","react":">=0.13.3","react-gravatar":"2.0.0","react-component-gulp-tasks":"^0.7.0","sinon":"^1.15.4","unexpected":"^9.2.1","unexpected-dom":"^1.2.0","unexpected-sinon":"^6.4.1"},"peerDependencies":{"react":">=0.13.3"},"browserify-shim":{"classnames":"global:classNames","react":"global:React","react-input-autosize":"global:AutosizeInput"},"scripts":{"build":"gulp clean && NODE_ENV=production gulp build","bump":"gulp bump","bump:major":"gulp bump:major","bump:minor":"gulp bump:minor","cover":"istanbul cover _mocha -- -u exports --compilers js:babel/register -R spec","coveralls":"NODE_ENV=test istanbul cover _mocha --report lcovonly -- -u exports --compilers js:babel/register -R spec && cat coverage/lcov.info | coveralls","examples":"gulp dev:server","lint":"eslint .","publish:examples":"gulp publish:examples","release":"gulp release","start":"gulp dev","test":"mocha --compilers js:babel/register","watch":"gulp watch:lib"},"keywords":["combobox","form","input","multiselect","react","react-component","select","ui"],"gitHead":"b3a2ea96f44ac527b5ed936d6bfd1a8da4c275a4","bugs":{"url":"https://github.com/JedWatson/react-select/issues"},"homepage":"https://github.com/JedWatson/react-select#readme","_id":"500tech-react-select@0.6.2","_shasum":"e8ea825e1ba16b2fcddc050e7339e88d3e1a5451","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.7","_npmUser":{"name":"morsdyce","email":"maayan@glikm.com"},"dist":{"shasum":"e8ea825e1ba16b2fcddc050e7339e88d3e1a5451","tarball":"https://registry.npmjs.org/500tech-react-select/-/500tech-react-select-0.6.2.tgz","integrity":"sha512-WoTsIP33dHFKqScap9TmBDpj/QDs9UiIIQqwJjmQdQaxRfgP32KLyyxuxWx9gq9UfJJ/TXbYP9IcK5gNcCyfhg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICLSLfviqDr4FA3j202h7K3Fj9FoCowyzHKpOXqpXFehAiBBD1EtfdSUsQgSFslBSmNPVoLWjburLeBGHPcr8yZsXA=="}]},"maintainers":[{"name":"morsdyce","email":"maayan@glikm.com"}]}},"readme":"[![Build Status](https://travis-ci.org/JedWatson/react-select.svg?branch=master)](https://travis-ci.org/JedWatson/react-select)\n[![Coverage Status](https://coveralls.io/repos/JedWatson/react-select/badge.svg?branch=master&service=github)](https://coveralls.io/github/JedWatson/react-select?branch=master)\n\nReact-Select\n============\n\nA Select control built with and for [React](http://facebook.github.io/react/index.html). Initially built for use in [KeystoneJS](http://www.keystonejs.com).\n\n\n## Demo & Examples\n\nLive demo: [jedwatson.github.io/react-select](http://jedwatson.github.io/react-select/)\n\nTo build the examples locally, run:\n\n```\nnpm install\ngulp dev\n```\n\nThen open [`localhost:8000`](http://localhost:8000) in a browser.\n\n\n## Project Status\n\nThis project is quite stable and ready for production use, however there are plans to improve it including:\n\n- CSS Styles and theme support (working, could be improved)\n- Documentation website (currently just examples)\n- Custom options rendering\n\nIt's loosely based on [Selectize](http://brianreavis.github.io/selectize.js/) (in terms of behaviour and user experience) and [React-Autocomplete](https://github.com/rackt/react-autocomplete) (as a native React Combobox implementation), as well as other select controls including [Chosen](http://harvesthq.github.io/chosen/) and [Select2](http://ivaynberg.github.io/select2/).\n\n\n## Installation\n\nThe easiest way to use React-Select is to install it from NPM and include it in your own React build process (using [Browserify](http://browserify.org), etc).\n\n```\nnpm install react-select --save\n```\n\nYou can also use the standalone build by including `dist/select.js` and `dist/default.css` in your page. If you use this, make sure you have already included the following dependencies:\n\n* [React](http://facebook.github.io/react/)\n* [classNames](http://jedwatson.github.io/classnames/)\n* [react-input-autosize](https://github.com/JedWatson/react-input-autosize)\n\n\n## Usage\n\nReact-Select generates a hidden text field containing the selected value, so you can submit it as part of a standard form. You can also listen for changes with the `onChange` event property.\n\nOptions should be provided as an `Array` of `Object`s, each with a `value` and `label` property for rendering and searching. You can use a `disabled` property to indicate whether the option is disabled or not.\n\nThe `value` property of each option should be set to either a string or a number.\n\nWhen the value is changed, `onChange(newValue, [selectedOptions])` will fire.\n\n```\nvar Select = require('react-select');\n\nvar options = [\n\t{ value: 'one', label: 'One' },\n\t{ value: 'two', label: 'Two' }\n];\n\nfunction logChange(val) {\n\tconsole.log(\"Selected: \" + val);\n}\n\n<Select\n\tname=\"form-field-name\"\n\tvalue=\"one\"\n\toptions={options}\n\tonChange={logChange}\n/>\n```\n\n### Multiselect options\n\nYou can enable multi-value selection by setting `multi={true}`. In this mode:\n\n* Selected options will be removed from the dropdown menu\n* The values of the selected items are joined using the `delimiter` property to create the input value\n* A simple value, if provided, will be split using the `delimiter` property\n* The `onChange` event provides an array of the selected options as the second argument\n* The first argument to `onChange` is always a string, regardless of whether the values of the selected options are numbers or strings\n\n### Async options\n\nIf you want to load options asynchronously, instead of providing an `options` Array, provide a `asyncOptions` Function.\n\nThe function takes two arguments `String input, Function callback`and will be called when the input text is changed.\n\nWhen your async process finishes getting the options, pass them to `callback(err, data)` in a Object `{ options: [] }`.\n\nThe select control will intelligently cache options for input strings that have already been fetched. The cached result set will be filtered as more specific searches are input, so if your async process would only return a smaller set of results for a more specific query, also pass `complete: true` in the callback object. Caching can be disabled by setting `cacheAsyncResults` to `false` (Note that `complete: true` will then have no effect).\n\nUnless you specify the property `autoload={false}` the control will automatically load the default set of options (i.e. for `input: ''`) when it is mounted.\n\n```\nvar Select = require('react-select');\n\nvar getOptions = function(input, callback) {\n\tsetTimeout(function() {\n\t\tcallback(null, {\n\t\t\toptions: [\n\t\t\t\t{ value: 'one', label: 'One' },\n\t\t\t\t{ value: 'two', label: 'Two' }\n\t\t\t],\n\t\t\t// CAREFUL! Only set this to true when there are no more options,\n\t\t\t// or more specific queries will not be sent to the server.\n\t\t\tcomplete: true\n\t\t});\n\t}, 500);\n};\n\n<Select\n\tname=\"form-field-name\"\n\tvalue=\"one\"\n\tasyncOptions={getOptions}\n/>\n```\n\n### Filtering options\n\nYou can control how options are filtered with the following properties:\n\n* `matchPos`: `\"start\"` or `\"any\"`: whether to match the text entered at the start or any position in the option value\n* `matchProp`: `\"label\"`, `\"value\"` or `\"any\"`: whether to match the value, label or both values of each option when filtering\n* `ignoreCase`: `Boolean`: whether to ignore case or match the text exactly when filtering\n\n`matchProp` and `matchPos` both default to `\"any\"`.\n`ignoreCase` defaults to `true`.\n\n#### Advanced filters\n\nYou can also completely replace the method used to filter either a single option, or the entire options array (allowing custom sort mechanisms, etc.)\n\n* `filterOption`: `function(Object option, String filter)` returns `Boolean`. Will override `matchPos`, `matchProp` and `ignoreCase` options.\n* `filterOptions`: `function(Array options, String filter, Array currentValues)` returns `Array filteredOptions`. Will override `filterOption`, `matchPos`, `matchProp` and `ignoreCase` options.\n\nFor multi-select inputs, when providing a custom `filterOptions` method, remember to exclude current values from the returned array of options.\n\n### Further options\n\n\n\tProperty\t\t\t|\tType\t\t|\tDescription\n:-----------------------|:--------------|:--------------------------------\n\tvalue \t\t\t\t|\tany\t\t\t|\t initial field value\n\tvalueRenderer\t\t|\tfunc\t\t|\t function which returns a custom way to render the value selected\n\tmulti \t\t\t\t|\tbool\t\t|\t multi-value input\n\tdisabled \t\t\t|\tbool\t\t|\t whether the Select is disabled or not\n\toptions \t\t\t|\tarray\t\t|\t array of options\n\toptionRenderer\t\t|\tfunc\t\t|\t function which returns a custom way to render the options in the menu\n\tdelimiter \t\t\t|\tstring\t\t|\t delimiter to use to join multiple values\n\tasyncOptions \t\t|\tfunc\t\t|\t function to call to get options\n\tautoload \t\t\t|\tbool\t\t|\t whether to auto-load the default async options set\n\tdisableCache \t\t|\tbool\t\t|\t disables the options cache for asyncOptions\n\tplaceholder \t\t|\tstring\t\t|\t field placeholder, displayed when there's no value\n\tnoResultsText \t\t|\tstring\t\t|\t placeholder displayed when there are no matching search results\n\tclearable \t\t\t|\tbool\t\t|\t should it be possible to reset value\n\tclearValueText \t\t|\tstring\t\t|\t title for the \"clear\" control\n\tclearAllText \t\t|\tstring\t\t|\t title for the \"clear\" control when multi: true\n\tsearchable \t\t\t|\tbool\t\t|\t whether to enable searching feature or not\n\tsearchPromptText \t|\tstring\t\t|\t label to prompt for search input\n\tname \t\t\t\t|\tstring\t\t|\t field name, for hidden <input /> tag\n\tonChange \t\t\t|\tfunc\t\t|\t onChange handler: function(newValue) {}\n\tonFocus \t\t\t|\tfunc\t\t|\t onFocus handler: function(event) {}\n\tonBlur \t\t\t\t|\tfunc\t\t|\t onBlur handler: function(event) {}\n\tclassName \t\t\t|\tstring\t\t|\t className for the outer element\n\tfilterOption \t\t|\tfunc\t\t|\t method to filter a single option: function(option, filterString)\n\tfilterOptions \t\t|\tfunc\t\t|\t method to filter the options array: function([options], filterString, [values])\n\tmatchPos \t\t\t|\tstring\t\t|\t (any, start) match the start or entire string when filtering\n\tmatchProp \t\t\t|\tstring\t\t|\t (any, label, value) which option property to filter on\n\tignoreCase \t\t\t|\tbool\t\t|\t whether to perform case-insensitive filtering\n\tinputProps \t\t\t|\tobject\t\t|\t custom attributes for the Input (in the Select-control) e.g: {'data-foo': 'bar'}\n\tbackspaceRemoves \t|\tbool\t\t|\t whether pressing backspace removes the last item when there is no input value\n\n\n# Contributing\n\nSee our [CONTRIBUTING.md](https://github.com/JedWatson/react-select/blob/master/CONTRIBUTING.md) for information on how to contribute.\n\n\n# License\n\nMIT Licensed. Copyright (c) Jed Watson 2015.\n","maintainers":[{"name":"morsdyce","email":"maayan@glikm.com"}],"time":{"modified":"2022-06-12T14:07:55.553Z","created":"2015-08-18T08:08:29.050Z","0.6.2":"2015-08-18T08:08:29.050Z"},"homepage":"https://github.com/JedWatson/react-select#readme","keywords":["combobox","form","input","multiselect","react","react-component","select","ui"],"repository":{"type":"git","url":"git+https://github.com/JedWatson/react-select.git"},"author":{"name":"Jed Watson"},"bugs":{"url":"https://github.com/JedWatson/react-select/issues"},"license":"MIT","readmeFilename":"README.md"}