react-select-plus
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("prop-types"),require("react-dom"),require("react-input-autosize"),require("classnames")):"function"==typeof define&&define.amd?define(["react","prop-types","react-dom","react-input-autosize","classnames"],t):e.Select=t(e.React,e.PropTypes,e.ReactDOM,e.AutosizeInput,e.classNames)}(this,function(e,t,u,n,s){"use strict";function o(e){for(var t=0;t<y.length;t++)e=e.replace(y[t].letters,y[t].base);return e}function i(e){return e.replace(/^\s+|\s+$/g,"")}function r(e,t,u,n){var s=this;return n.ignoreAccents&&(t=o(t)),n.ignoreCase&&(t=t.toLowerCase()),n.trimFilter&&(t=i(t)),u&&(u=u.map(function(e){return e[n.valueKey]})),e.filter(function(e){if(u&&u.indexOf(e[n.valueKey])>-1)return!1;if(n.filterOption)return n.filterOption.call(s,e,t);if(!t)return!0;var i=String(e[n.valueKey]),r=String(e[n.labelKey]);return n.ignoreAccents&&("label"!==n.matchProp&&(i=o(i)),"value"!==n.matchProp&&(r=o(r))),n.ignoreCase&&("label"!==n.matchProp&&(i=i.toLowerCase()),"value"!==n.matchProp&&(r=r.toLowerCase())),"start"===n.matchPos?"label"!==n.matchProp&&i.substr(0,t.length)===t||"value"!==n.matchProp&&r.substr(0,t.length)===t:"label"!==n.matchProp&&i.indexOf(t)>=0||"value"!==n.matchProp&&r.indexOf(t)>=0})}function a(e){return e&&Array.isArray(e.options)}function l(e){var t=e.focusedOption,u=e.focusOption,n=e.inputValue,o=e.instancePrefix,i=(e.labelKey,e.onFocus),r=e.onOptionRef,l=e.onSelect,p=e.optionClassName,h=e.optionComponent,c=e.optionGroupComponent,d=e.optionRenderer,f=e.options,v=e.removeValue,E=e.selectValue,g=e.valueArray,y=e.valueKey,m=c,O=h,F=d||this.getOptionLabel;return function e(h){return h.map(function(h,c){if(a(h)){var d=s({"Select-option-group":!0});return b.createElement(m,{className:d,key:"option-group-"+c,label:F(h),option:h,optionIndex:c},e(h.options))}var f=g&&g.indexOf(h)>-1,C=h===t,A=s(p,{"Select-option":!0,"is-selected":f,"is-focused":C,"is-disabled":h.disabled});return b.createElement(O,{className:A,focusOption:u,inputValue:n,instancePrefix:o,isDisabled:h.disabled,isFocused:C,isSelected:f,key:"option-"+c+"-"+h[y],onFocus:i,onSelect:l,option:h,optionIndex:c,ref:function(e){r(e,C)},removeValue:v,selectValue:E},F(h,c))})}(f)}function p(e){var t={};for(var u in e)e.hasOwnProperty(u)&&(t[u]=e[u]);return t}function h(e){return e&&Array.isArray(e.options)}function c(e){return b.createElement(_,e)}function d(e){var t=e.option,u=e.options,n=e.labelKey,s=e.valueKey;return 0===u.filter(function(e){return e[n]===t[n]||e[s]===t[s]}).length}function f(e){return!!e.label}function v(e){var t=e.label,u=e.labelKey,n={};return n[e.valueKey]=t,n[u]=t,n.className="Select-create-option-placeholder",n}function E(e){return'Create option "'+e+'"'}function g(e){switch(e.keyCode){case 9:case 13:case 188:return!0;default:return!1}}var b="default"in e?e.default:e;t=t&&t.hasOwnProperty("default")?t.default:t,n=n&&n.hasOwnProperty("default")?n.default:n,s=s&&s.hasOwnProperty("default")?s.default:s;var y=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}],m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O=(function(){function e(e){this.value=e}function t(t){function u(s,o){try{var i=t[s](o),r=i.value;r instanceof e?Promise.resolve(r.value).then(function(e){u("next",e)},function(e){u("throw",e)}):n(i.done?"return":"normal",i.value)}catch(e){n("throw",e)}}function n(e,t){switch(e){case"return":s.resolve({value:t,done:!0});break;case"throw":s.reject(t);break;default:s.resolve({value:t,done:!1})}(s=s.next)?u(s.key,s.arg):o=null}var s,o;this._invoke=function(e,t){return new Promise(function(n,i){var r={key:e,arg:t,resolve:n,reject:i,next:null};o?o=o.next=r:(s=o=r,u(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),F=function(){function e(e,t){for(var u=0;u<t.length;u++){var n=t[u];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,u,n){return u&&e(t.prototype,u),n&&e(t,n),t}}(),C=function(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e},A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var u=arguments[t];for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n])}return e},D=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},k=function(e,t){var u={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(u[n]=e[n]);return u},w=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},T=function(e){function t(){return O(this,t),w(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return D(t,e),F(t,[{key:"render",value:function(){return this.props.children}}]),t}(b.Component),S=function(e){function t(e){O(this,t);var u=w(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return u.handleMouseDown=u.handleMouseDown.bind(u),u.handleMouseEnter=u.handleMouseEnter.bind(u),u.handleMouseMove=u.handleMouseMove.bind(u),u.handleTouchStart=u.handleTouchStart.bind(u),u.handleTouchEnd=u.handleTouchEnd.bind(u),u.handleTouchMove=u.handleTouchMove.bind(u),u.onFocus=u.onFocus.bind(u),u}return D(t,e),F(t,[{key:"blockEvent",value:function(e){e.preventDefault(),e.stopPropagation(),"A"===e.target.tagName&&"href"in e.target&&(e.target.target?window.open(e.target.href,e.target.target):window.location.href=e.target.href)}},{key:"handleMouseDown",value:function(e){e.preventDefault(),e.stopPropagation(),this.props.onSelect(this.props.option,e)}},{key:"handleMouseEnter",value:function(e){this.onFocus(e)}},{key:"handleMouseMove",value:function(e){this.onFocus(e)}},{key:"handleTouchEnd",value:function(e){this.dragging||this.handleMouseDown(e)}},{key:"handleTouchMove",value:function(e){this.dragging=!0}},{key:"handleTouchStart",value:function(e){this.dragging=!1}},{key:"onFocus",value:function(e){this.props.isFocused||this.props.onFocus(this.props.option,e)}},{key:"render",value:function(){var e=this.props,t=e.option,u=e.instancePrefix,n=e.optionIndex,o=s(this.props.className,t.className);return t.disabled?b.createElement("div",{className:o,onMouseDown:this.blockEvent,onClick:this.blockEvent},this.props.children):b.createElement("div",{className:o,style:t.style,role:"option","aria-label":t.label,onMouseDown:this.handleMouseDown,onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd,id:u+"-option-"+n,title:t.title},this.props.children)}}]),t}(b.Component),V=function(e){function t(){return O(this,t),w(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return D(t,e),F(t,[{key:"blockEvent",value:function(e){e.preventDefault(),e.stopPropagation(),"A"===e.target.tagName&&"href"in e.target&&(e.target.target?window.open(e.target.href,e.target.target):window.location.href=e.target.href)}},{key:"handleMouseDown",value:function(e){e.preventDefault(),e.stopPropagation()}},{key:"handleTouchEnd",value:function(e){this.dragging||this.handleMouseDown(e)}},{key:"handleTouchMove",value:function(e){this.dragging=!0}},{key:"handleTouchStart",value:function(e){this.dragging=!1}},{key:"render",value:function(){var e=this.props.option,t=s(this.props.className,e.className);return e.disabled?b.createElement("div",{className:t,onMouseDown:this.blockEvent,onClick:this.blockEvent},this.props.children):b.createElement("div",{className:t,style:e.style,onMouseDown:this.handleMouseDown,onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd,title:e.title},b.createElement("div",{className:"Select-option-group-label"},this.props.label),this.props.children)}}]),t}(b.Component),P=function(e){function t(e){O(this,t);var u=w(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return u.handleMouseDown=u.handleMouseDown.bind(u),u.onRemove=u.onRemove.bind(u),u.handleTouchEndRemove=u.handleTouchEndRemove.bind(u),u.handleTouchMove=u.handleTouchMove.bind(u),u.handleTouchStart=u.handleTouchStart.bind(u),u}return D(t,e),F(t,[{key:"handleMouseDown",value:function(e){if("mousedown"!==e.type||0===e.button)return this.props.onClick?(e.stopPropagation(),void this.props.onClick(this.props.value,e)):void(this.props.value.href&&e.stopPropagation())}},{key:"onRemove",value:function(e){e.preventDefault(),e.stopPropagation(),this.props.onRemove(this.props.value)}},{key:"handleTouchEndRemove",value:function(e){this.dragging||this.onRemove(e)}},{key:"handleTouchMove",value:function(e){this.dragging=!0}},{key:"handleTouchStart",value:function(e){this.dragging=!1}},{key:"renderRemoveIcon",value:function(){if(!this.props.disabled&&this.props.onRemove)return b.createElement("span",{className:"Select-value-icon","aria-hidden":"true",onMouseDown:this.onRemove,onTouchEnd:this.handleTouchEndRemove,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove},"×")}},{key:"renderLabel",value:function(){return this.props.onClick||this.props.value.href?b.createElement("a",{className:"Select-value-label",href:this.props.value.href,target:this.props.value.target,onMouseDown:this.handleMouseDown,onTouchEnd:this.handleMouseDown},this.props.children):b.createElement("span",{className:"Select-value-label",role:"option","aria-selected":"true",id:this.props.id},this.props.children)}},{key:"render",value:function(){return b.createElement("div",{className:s("Select-value",this.props.value.className),style:this.props.value.style,title:this.props.value.title},this.renderRemoveIcon(),this.renderLabel())}}]),t}(b.Component),M=function(e){return"string"==typeof e?e:null!==e&&JSON.stringify(e)||""},B=(t.oneOfType([t.string,t.node]),t.oneOfType([t.string,t.number]),1),_=function(e){function t(e){O(this,t);var u=w(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return["clearValue","focusOption","handleInputBlur","handleInputChange","handleInputFocus","handleInputValueChange","handleKeyDown","handleMenuScroll","handleMouseDown","handleMouseDownOnArrow","handleMouseDownOnMenu","handleRequired","handleTouchOutside","handleTouchMove","handleTouchStart","handleTouchEnd","handleTouchEndClearValue","handleValueClick","getOptionLabel","onOptionRef","removeValue","selectValue"].forEach(function(e){return u[e]=u[e].bind(u)}),u.state={inputValue:"",isFocused:!1,isOpen:!1,isPseudoFocused:!1,required:!1},u}return D(t,e),F(t,[{key:"componentWillMount",value:function(){this._flatOptions=this.flattenOptions(this.props.options),this._instancePrefix="react-select-"+(this.props.instanceId||++B)+"-";var e=this.getValueArray(this.props.value);this.props.required&&this.setState({required:this.handleRequired(e[0],this.props.multi)})}},{key:"componentDidMount",value:function(){void 0!==this.props.autofocus&&"undefined"!=typeof console&&console.warn("Warning: The autofocus prop has changed to autoFocus, support will be removed after react-select@1.0"),(this.props.autoFocus||this.props.autofocus)&&this.focus()}},{key:"componentWillReceiveProps",value:function(e){e.options!==this.props.options&&(this._flatOptions=this.flattenOptions(e.options));var t=this.getValueArray(e.value,e);!e.isOpen&&this.props.isOpen?this.closeMenu():e.isOpen&&!this.props.isOpen&&this.setState({isOpen:!0}),e.required?this.setState({required:this.handleRequired(t[0],e.multi)}):this.props.required&&this.setState({required:!1})}},{key:"componentDidUpdate",value:function(e,t){if(this.menu&&this.focused&&this.state.isOpen&&!this.hasScrolledToOption){var n=u.findDOMNode(this.focused),s=u.findDOMNode(this.menu),o=s.scrollTop,i=o+s.offsetHeight,r=n.offsetTop,a=r+n.offsetHeight;(o>r||i<a)&&(s.scrollTop=n.offsetTop),this.hasScrolledToOption=!0}else this.state.isOpen||(this.hasScrolledToOption=!1);if(this._scrollToFocusedOptionOnUpdate&&this.focused&&this.menu){this._scrollToFocusedOptionOnUpdate=!1;var l=u.findDOMNode(this.focused),p=u.findDOMNode(this.menu),h=l.getBoundingClientRect(),c=p.getBoundingClientRect();h.bottom>c.bottom?p.scrollTop=l.offsetTop+l.clientHeight-p.offsetHeight:h.top<c.top&&(p.scrollTop=l.offsetTop)}if(this.props.scrollMenuIntoView&&this.menuContainer){var d=this.menuContainer.getBoundingClientRect();window.innerHeight<d.bottom+this.props.menuBuffer&&window.scrollBy(0,d.bottom+this.props.menuBuffer-window.innerHeight)}if(e.disabled!==this.props.disabled&&(this.setState({isFocused:!1}),this.closeMenu()),t.isOpen!==this.state.isOpen){this.toggleTouchOutsideEvent(this.state.isOpen);var f=this.state.isOpen?this.props.onOpen:this.props.onClose;f&&f()}}},{key:"componentWillUnmount",value:function(){this.toggleTouchOutsideEvent(!1)}},{key:"toggleTouchOutsideEvent",value:function(e){e?!document.addEventListener&&document.attachEvent?document.attachEvent("ontouchstart",this.handleTouchOutside):document.addEventListener("touchstart",this.handleTouchOutside):!document.removeEventListener&&document.detachEvent?document.detachEvent("ontouchstart",this.handleTouchOutside):document.removeEventListener("touchstart",this.handleTouchOutside)}},{key:"handleTouchOutside",value:function(e){this.wrapper&&!this.wrapper.contains(e.target)&&this.closeMenu()}},{key:"focus",value:function(){this.input&&this.input.focus()}},{key:"blurInput",value:function(){this.input&&this.input.blur()}},{key:"handleTouchMove",value:function(e){this.dragging=!0}},{key:"handleTouchStart",value:function(e){this.dragging=!1}},{key:"handleTouchEnd",value:function(e){this.dragging||this.handleMouseDown(e)}},{key:"handleTouchEndClearValue",value:function(e){this.dragging||this.clearValue(e)}},{key:"handleMouseDown",value:function(e){if(!(this.props.disabled||"mousedown"===e.type&&0!==e.button))if("INPUT"!==e.target.tagName){if(e.preventDefault(),!this.props.searchable)return this.focus(),this.setState({isOpen:!this.state.isOpen});if(this.state.isFocused){this.focus();var t=this.input;"function"==typeof t.getInput&&(t=t.getInput()),t.value="",this.setState({isOpen:!0,isPseudoFocused:!1})}else this._openAfterFocus=this.props.openOnClick,this.focus()}else this.state.isFocused?this.state.isOpen||this.setState({isOpen:!0,isPseudoFocused:!1}):(this._openAfterFocus=this.props.openOnClick,this.focus())}},{key:"handleMouseDownOnArrow",value:function(e){this.props.disabled||"mousedown"===e.type&&0!==e.button||(this.state.isOpen||this.setState({isOpen:!0}),e.stopPropagation(),e.preventDefault(),this.state.isOpen&&this.closeMenu())}},{key:"handleMouseDownOnMenu",value:function(e){this.props.disabled||"mousedown"===e.type&&0!==e.button||(e.stopPropagation(),e.preventDefault(),this._openAfterFocus=!0,this.focus())}},{key:"closeMenu",value:function(){this.props.onCloseResetsInput?this.setState({isOpen:!1,isPseudoFocused:this.state.isFocused&&!this.props.multi,inputValue:this.handleInputValueChange("")}):this.setState({isOpen:!1,isPseudoFocused:this.state.isFocused&&!this.props.multi}),this.hasScrolledToOption=!1}},{key:"handleInputFocus",value:function(e){if(!this.props.disabled){var t=this.state.isOpen||this._openAfterFocus||this.props.openOnFocus;this.props.onFocus&&this.props.onFocus(e),this.setState({isFocused:!0,isOpen:t}),this._openAfterFocus=!1}}},{key:"handleInputBlur",value:function(e){if(!this.menu||this.menu!==document.activeElement&&!this.menu.contains(document.activeElement)){this.props.onBlur&&this.props.onBlur(e);var t={isFocused:!1,isOpen:!1,isPseudoFocused:!1};this.props.onBlurResetsInput&&(t.inputValue=this.handleInputValueChange("")),this.setState(t)}else this.focus()}},{key:"handleInputChange",value:function(e){var t=e.target.value;this.state.inputValue!==e.target.value&&(t=this.handleInputValueChange(t)),this.setState({isOpen:!0,isPseudoFocused:!1,inputValue:t})}},{key:"handleInputValueChange",value:function(e){if(this.props.onInputChange){var t=this.props.onInputChange(e);null!=t&&"object"!==(void 0===t?"undefined":m(t))&&(e=""+t)}return e}},{key:"handleKeyDown",value:function(e){if(!(this.props.disabled||"function"==typeof this.props.onInputKeyDown&&(this.props.onInputKeyDown(e),e.defaultPrevented))){switch(e.keyCode){case 8:return void(!this.state.inputValue&&this.props.backspaceRemoves&&(e.preventDefault(),this.popValue()));case 9:if(e.shiftKey||!this.state.isOpen||!this.props.tabSelectsValue)return;return e.preventDefault(),void this.selectFocusedOption();case 13:return e.preventDefault(),e.stopPropagation(),void(this.state.isOpen?this.selectFocusedOption():this.focusNextOption());case 27:this.state.isOpen?(this.closeMenu(),e.stopPropagation()):this.props.clearable&&this.props.escapeClearsValue&&(this.clearValue(e),e.stopPropagation());break;case 32:if(this.props.searchable)return;if(e.preventDefault(),!this.state.isOpen)return void this.focusNextOption();e.stopPropagation(),this.selectFocusedOption();break;case 38:this.focusPreviousOption();break;case 40:this.focusNextOption();break;case 33:this.focusPageUpOption();break;case 34:this.focusPageDownOption();break;case 35:if(e.shiftKey)return;this.focusEndOption();break;case 36:if(e.shiftKey)return;this.focusStartOption();break;case 46:return void(!this.state.inputValue&&this.props.deleteRemoves&&(e.preventDefault(),this.popValue()));default:return}e.preventDefault()}}},{key:"handleValueClick",value:function(e,t){this.props.onValueClick&&this.props.onValueClick(e,t)}},{key:"handleMenuScroll",value:function(e){if(this.props.onMenuScrollToBottom){var t=e.target;t.scrollHeight>t.offsetHeight&&t.scrollHeight-t.offsetHeight-t.scrollTop<=0&&this.props.onMenuScrollToBottom()}}},{key:"handleRequired",value:function(e,t){return!e||(t?0===e.length:0===Object.keys(e).length)}},{key:"getOptionLabel",value:function(e){return e[this.props.labelKey]}},{key:"getValueArray",value:function(e,t){var u=this,n="object"===(void 0===t?"undefined":m(t))?t:this.props;if(n.multi){if("string"==typeof e&&(e=e.split(n.delimiter)),!Array.isArray(e)){if(null===e||void 0===e)return[];e=[e]}return e.map(function(e){return u.expandValue(e,n)}).filter(function(e){return e})}var s=this.expandValue(e,n);return s?[s]:[]}},{key:"expandValue",value:function(e,t){var u=void 0===e?"undefined":m(e);if("string"!==u&&"number"!==u&&"boolean"!==u)return e;var n=t.labelKey,s=t.renderInvalidValues,o=t.valueKey,i=this._flatOptions;if(i&&""!==e){for(var r=0;r<i.length;r++)if(String(i[r][o])===String(e))return i[r];if(s){var a;return this._invalidOptions=this._invalidOptions||{},this._invalidOptions[e]=this._invalidOptions[e]||(a={invalid:!0},C(a,n,e),C(a,o,e),a),this._invalidOptions[e]}}}},{key:"setValue",value:function(e){var t=this;if(this.props.autoBlur&&this.blurInput(),this.props.required){var u=this.handleRequired(e,this.props.multi);this.setState({required:u})}this.props.onChange&&(this.props.simpleValue&&e&&(e=this.props.multi?e.map(function(e){return e[t.props.valueKey]}).join(this.props.delimiter):e[this.props.valueKey]),this.props.onChange(e))}},{key:"selectValue",value:function(e){var t=this;if(this.props.closeOnSelect&&(this.hasScrolledToOption=!1),this.props.multi){var u=this.props.onSelectResetsInput?"":this.state.inputValue;this.setState({focusedIndex:null,inputValue:this.handleInputValueChange(u),isOpen:!this.props.closeOnSelect},function(){t.getValueArray(t.props.value).some(function(u){return u[t.props.valueKey]===e[t.props.valueKey]})?t.removeValue(e):t.addValue(e)})}else this.setState({inputValue:this.handleInputValueChange(""),isOpen:!this.props.closeOnSelect,isPseudoFocused:this.state.isFocused},function(){t.setValue(e)})}},{key:"addValue",value:function(e){var t=this.getValueArray(this.props.value),u=this._visibleOptions.filter(function(e){return!e.disabled}),n=u.indexOf(e);this.setValue(t.concat(e)),u.length-1===n?this.focusOption(u[n-1]):u.length>n&&this.focusOption(u[n+1])}},{key:"popValue",value:function(){var e=this.getValueArray(this.props.value);e.length&&!1!==e[e.length-1].clearableValue&&this.setValue(this.props.multi?e.slice(0,e.length-1):null)}},{key:"removeValue",value:function(e){var t=this,u=this.getValueArray(this.props.value);this.setValue(u.filter(function(u){return u[t.props.valueKey]!==e[t.props.valueKey]})),this.focus()}},{key:"clearValue",value:function(e){e&&"mousedown"===e.type&&0!==e.button||(e.preventDefault(),this.setValue(this.getResetValue()),this.setState({isOpen:!1,inputValue:this.handleInputValueChange("")},this.focus))}},{key:"getResetValue",value:function(){return void 0!==this.props.resetValue?this.props.resetValue:this.props.multi?[]:null}},{key:"focusOption",value:function(e){this.setState({focusedOption:e})}},{key:"focusNextOption",value:function(){this.focusAdjacentOption("next")}},{key:"focusPreviousOption",value:function(){this.focusAdjacentOption("previous")}},{key:"focusPageUpOption",value:function(){this.focusAdjacentOption("page_up")}},{key:"focusPageDownOption",value:function(){this.focusAdjacentOption("page_down")}},{key:"focusStartOption",value:function(){this.focusAdjacentOption("start")}},{key:"focusEndOption",value:function(){this.focusAdjacentOption("end")}},{key:"focusAdjacentOption",value:function(e){var t=this._visibleOptions.map(function(e,t){return{option:e,index:t}}).filter(function(e){return!e.option.disabled});if(this._scrollToFocusedOptionOnUpdate=!0,this.state.isOpen){if(t.length){for(var u=-1,n=0;n<t.length;n++)if(this._focusedOption===t[n].option){u=n;break}if("next"===e&&-1!==u)u=(u+1)%t.length;else if("previous"===e)u>0?u-=1:u=t.length-1;else if("start"===e)u=0;else if("end"===e)u=t.length-1;else if("page_up"===e)u=(s=u-this.props.pageSize)<0?0:s;else if("page_down"===e){var s=u+this.props.pageSize;u=s>t.length-1?t.length-1:s}-1===u&&(u=0),this.setState({focusedIndex:t[u].index,focusedOption:t[u].option})}}else this.setState({isOpen:!0,inputValue:"",focusedOption:this._focusedOption||(t.length?t["next"===e?0:t.length-1].option:null)})}},{key:"getFocusedOption",value:function(){return this._focusedOption}},{key:"selectFocusedOption",value:function(){if(this._focusedOption)return this.selectValue(this._focusedOption)}},{key:"renderLoading",value:function(){if(this.props.isLoading)return b.createElement("span",{className:"Select-loading-zone","aria-hidden":"true"},b.createElement("span",{className:"Select-loading"}))}},{key:"renderValue",value:function(e,t){var u=this,n=this.props.valueRenderer||this.getOptionLabel,s=this.props.valueComponent;if(!e.length)return this.state.inputValue?null:b.createElement("div",{className:"Select-placeholder"},this.props.placeholder);var o=this.props.onValueClick?this.handleValueClick:null;return this.props.multi?e.map(function(e,t){return b.createElement(s,{id:u._instancePrefix+"-value-"+t,instancePrefix:u._instancePrefix,disabled:u.props.disabled||!1===e.clearableValue,key:"value-"+t+"-"+e[u.props.valueKey],onClick:o,onRemove:u.removeValue,value:e},n(e,t),b.createElement("span",{className:"Select-aria-only"}," "))}):this.state.inputValue?void 0:(t&&(o=null),b.createElement(s,{id:this._instancePrefix+"-value-item",disabled:this.props.disabled,instancePrefix:this._instancePrefix,onClick:o,value:e[0]},n(e[0])))}},{key:"renderInput",value:function(e,t){var u,o=this,i=s("Select-input",this.props.inputProps.className),r=!!this.state.isOpen,a=s((u={},C(u,this._instancePrefix+"-list",r),C(u,this._instancePrefix+"-backspace-remove-message",this.props.multi&&!this.props.disabled&&this.state.isFocused&&!this.state.inputValue),u)),l=A({},this.props.inputProps,{role:"combobox","aria-expanded":""+r,"aria-owns":a,"aria-haspopup":""+r,"aria-activedescendant":r?this._instancePrefix+"-option-"+t:this._instancePrefix+"-value","aria-describedby":this.props["aria-describedby"],"aria-labelledby":this.props["aria-labelledby"],"aria-label":this.props["aria-label"],className:i,tabIndex:this.props.tabIndex,onBlur:this.handleInputBlur,onChange:this.handleInputChange,onFocus:this.handleInputFocus,ref:function(e){return o.input=e},required:this.state.required,value:this.state.inputValue});if(this.props.inputRenderer)return this.props.inputRenderer(l);if(this.props.disabled||!this.props.searchable){var p=this.props.inputProps,h=(p.inputClassName,k(p,["inputClassName"])),c=s(C({},this._instancePrefix+"-list",r));return b.createElement("div",A({},h,{role:"combobox","aria-expanded":r,"aria-owns":c,"aria-activedescendant":r?this._instancePrefix+"-option-"+t:this._instancePrefix+"-value","aria-labelledby":this.props["aria-labelledby"],"aria-label":this.props["aria-label"],className:i,tabIndex:this.props.tabIndex||0,onBlur:this.handleInputBlur,onFocus:this.handleInputFocus,ref:function(e){return o.input=e},"aria-disabled":""+!!this.props.disabled,style:{border:0,width:1,display:"inline-block"}}))}return this.props.autosize?b.createElement(n,A({id:this.props.id},l,{minWidth:"5"})):b.createElement("div",{className:i,key:"input-wrap"},b.createElement("input",A({id:this.props.id},l)))}},{key:"renderClear",value:function(){var e=this.getValueArray(this.props.value);if(this.props.clearable&&e.length&&!this.props.disabled&&!this.props.isLoading){var t=this.props.clearRenderer();return b.createElement("span",{className:"Select-clear-zone",title:this.props.multi?this.props.clearAllText:this.props.clearValueText,"aria-label":this.props.multi?this.props.clearAllText:this.props.clearValueText,onMouseDown:this.clearValue,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEndClearValue},t)}}},{key:"renderArrow",value:function(){if(this.props.arrowRenderer){var e=this.handleMouseDownOnArrow,t=this.state.isOpen,u=this.props.arrowRenderer({onMouseDown:e,isOpen:t});return u?b.createElement("span",{className:"Select-arrow-zone",onMouseDown:e},u):null}}},{key:"filterFlatOptions",value:function(e){var t=this.state.inputValue,u=this._flatOptions;return this.props.filterOptions?("function"==typeof this.props.filterOptions?this.props.filterOptions:r)(u,t,e,{filterOption:this.props.filterOption,ignoreAccents:this.props.ignoreAccents,ignoreCase:this.props.ignoreCase,labelKey:this.props.labelKey,matchPos:this.props.matchPos,matchProp:this.props.matchProp,valueKey:this.props.valueKey,trimFilter:this.props.trimFilter}):u}},{key:"flattenOptions",value:function(e,t){if(!e)return[];for(var u=[],n=0;n<e.length;n++){var s=p(e[n]);t&&(s.group=t),h(s)?(u=u.concat(this.flattenOptions(s.options,s)),s.options=[]):u.push(s)}return u}},{key:"unflattenOptions",value:function(e){var t=[],u=void 0,n=void 0;return e.forEach(function(e){for(e.isInTree=!1,u=e.group;u;)u.isInTree&&(u.options=[],u.isInTree=!1),u=u.group}),e.forEach(function(e){for(u=(n=e).group;u;)n.isInTree||(u.options.push(n),n.isInTree=!0),u=(n=u).group;n.isInTree||(t.push(n),n.isInTree=!0)}),e.forEach(function(e){delete e.isInTree}),t}},{key:"onOptionRef",value:function(e,t){t&&(this.focused=e)}},{key:"renderMenu",value:function(e,t,u){return e&&e.length?this.props.menuRenderer({focusedOption:u,focusOption:this.focusOption,inputValue:this.state.inputValue,instancePrefix:this._instancePrefix,labelKey:this.props.labelKey,onFocus:this.focusOption,onSelect:this.selectValue,optionClassName:this.props.optionClassName,optionComponent:this.props.optionComponent,optionGroupComponent:this.props.optionGroupComponent,optionRenderer:this.props.optionRenderer||this.getOptionLabel,options:e,selectValue:this.selectValue,removeValue:this.removeValue,valueArray:t,valueKey:this.props.valueKey,onOptionRef:this.onOptionRef}):this.props.noResultsText?b.createElement("div",{className:"Select-noresults"},this.props.noResultsText):null}},{key:"renderHiddenField",value:function(e){var t=this;if(this.props.name){if(this.props.joinValues){var u=e.map(function(e){return M(e[t.props.valueKey])}).join(this.props.delimiter);return b.createElement("input",{type:"hidden",ref:function(e){return t.value=e},name:this.props.name,value:u,disabled:this.props.disabled})}return e.map(function(e,u){return b.createElement("input",{key:"hidden."+u,type:"hidden",ref:"value"+u,name:t.props.name,value:M(e[t.props.valueKey]),disabled:t.props.disabled})})}}},{key:"getFocusableOptionIndex",value:function(e){var t=this._visibleOptions;if(!t.length)return null;var u=this.props.valueKey,n=this.state.focusedOption||e;if(n&&!n.disabled){var s=-1;if(t.some(function(e,t){var o=e[u]===n[u];return o&&(s=t),o}),-1!==s)return s}for(var o=0;o<t.length;o++)if(!t[o].disabled)return o;return null}},{key:"renderOuter",value:function(e,t,u){var n=this,s=this.props.dropdownComponent,o=this.renderMenu(e,t,u);return o?b.createElement(s,null,b.createElement("div",{ref:function(e){return n.menuContainer=e},className:"Select-menu-outer",style:this.props.menuContainerStyle},b.createElement("div",{ref:function(e){return n.menu=e},role:"listbox",tabIndex:-1,className:"Select-menu",id:this._instancePrefix+"-list",style:this.props.menuStyle,onScroll:this.handleMenuScroll,onMouseDown:this.handleMouseDownOnMenu},o))):null}},{key:"render",value:function(){var e=this,t=this.getValueArray(this.props.value);this._visibleOptions=this.filterFlatOptions(this.props.multi&&this.props.removeSelected?t:null);var u=this.unflattenOptions(this._visibleOptions),n="boolean"==typeof this.props.isOpen?this.props.isOpen:this.state.isOpen;this.props.multi&&!u.length&&t.length&&!this.state.inputValue&&(n=!1);var o=this.getFocusableOptionIndex(t[0]),i=null;i=this._focusedOption=null!==o?this._visibleOptions[o]:null;var r=s("Select",this.props.className,{"Select--multi":this.props.multi,"Select--single":!this.props.multi,"is-clearable":this.props.clearable,"is-disabled":this.props.disabled,"is-focused":this.state.isFocused,"is-loading":this.props.isLoading,"is-open":n,"is-pseudo-focused":this.state.isPseudoFocused,"is-searchable":this.props.searchable,"has-value":t.length,"Select--rtl":this.props.rtl}),a=null;return this.props.multi&&!this.props.disabled&&t.length&&!this.state.inputValue&&this.state.isFocused&&this.props.backspaceRemoves&&(a=b.createElement("span",{id:this._instancePrefix+"-backspace-remove-message",className:"Select-aria-only","aria-live":"assertive"},this.props.backspaceToRemoveMessage.replace("{label}",t[t.length-1][this.props.labelKey]))),b.createElement("div",{ref:function(t){return e.wrapper=t},className:r,style:this.props.wrapperStyle},this.renderHiddenField(t),b.createElement("div",{ref:function(t){return e.control=t},className:"Select-control",style:this.props.style,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchEnd:this.handleTouchEnd,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove},b.createElement("span",{className:"Select-multi-value-wrapper",id:this._instancePrefix+"-value"},this.renderValue(t,n),this.renderInput(t,o)),a,this.renderLoading(),this.renderClear(),this.renderArrow()),n?this.renderOuter(u,t,i):null)}}]),t}(b.Component);_.defaultProps={arrowRenderer:function(e){var t=e.onMouseDown;return b.createElement("span",{className:"Select-arrow",onMouseDown:t})},autosize:!0,backspaceRemoves:!0,backspaceToRemoveMessage:"Press backspace to remove {label}",clearable:!0,clearAllText:"Clear all",clearRenderer:function(){return b.createElement("span",{className:"Select-clear",dangerouslySetInnerHTML:{__html:"×"}})},clearValueText:"Clear value",closeOnSelect:!0,deleteRemoves:!0,delimiter:",",disabled:!1,dropdownComponent:T,escapeClearsValue:!0,filterOptions:r,ignoreAccents:!0,ignoreCase:!0,inputProps:{},isLoading:!1,joinValues:!1,labelKey:"label",matchPos:"any",matchProp:"any",menuBuffer:0,menuRenderer:l,multi:!1,noResultsText:"No results found",onBlurResetsInput:!0,onSelectResetsInput:!0,onCloseResetsInput:!0,openOnClick:!0,optionComponent:S,optionGroupComponent:V,pageSize:5,placeholder:"Select...",removeSelected:!0,required:!1,rtl:!1,scrollMenuIntoView:!0,searchable:!0,simpleValue:!1,tabSelectsValue:!0,trimFilter:!0,valueComponent:P,valueKey:"value"};t.bool.isRequired,t.any,t.func.isRequired,t.bool,t.bool,t.func.isRequired,t.oneOfType([t.string,t.node]),t.bool,t.oneOfType([t.string,t.node]),t.func,t.func,t.array.isRequired,t.oneOfType([t.string,t.node]),t.oneOfType([t.string,t.node]),t.any;var I={},x={autoload:!0,cache:I,children:function(e){return b.createElement(_,e)},ignoreAccents:!0,ignoreCase:!0,loadingPlaceholder:"Loading...",options:[],searchPromptText:"Type to search"},R=function(e){function t(e,u){O(this,t);var n=w(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u));return n._cache=e.cache===I?{}:e.cache,n.state={inputValue:"",isLoading:!1,options:e.options},n.onInputChange=n.onInputChange.bind(n),n}return D(t,e),F(t,[{key:"componentDidMount",value:function(){this.props.autoload&&this.loadOptions("")}},{key:"componentWillReceiveProps",value:function(e){e.options!==this.props.options&&this.setState({options:e.options})}},{key:"componentWillUnmount",value:function(){this._callback=null}},{key:"loadOptions",value:function(e){var t=this,u=this.props.loadOptions,n=this._cache;if(n&&Object.prototype.hasOwnProperty.call(n,e))return this._callback=null,void this.setState({isLoading:!1,options:n[e]});var s=function u(s,o){var i=o&&o.options||[];n&&(n[e]=i),u===t._callback&&(t._callback=null,t.setState({isLoading:!1,options:i}))};this._callback=s;var o=u(e,s);o&&o.then(function(e){return s(0,e)},function(e){return s()}),this._callback&&!this.state.isLoading&&this.setState({isLoading:!0})}},{key:"onInputChange",value:function(e){var t=this.props,u=t.ignoreAccents,n=t.ignoreCase,s=t.onInputChange,i=e;if(s){var r=s(i);null!=r&&"object"!==(void 0===r?"undefined":m(r))&&(i=""+r)}var a=i;return u&&(a=o(a)),n&&(a=a.toLowerCase()),this.setState({inputValue:i}),this.loadOptions(a),i}},{key:"noResultsText",value:function(){var e=this.props,t=e.loadingPlaceholder,u=e.noResultsText,n=e.searchPromptText,s=this.state,o=s.inputValue;return s.isLoading?t:o&&u?u:n}},{key:"focus",value:function(){this.select.focus()}},{key:"render",value:function(){var e=this,t=this.props,u=t.children,n=t.loadingPlaceholder,s=(t.multi,t.onChange,t.placeholder),o=this.state,i=o.isLoading,r=o.options,a={noResultsText:this.noResultsText(),placeholder:i?n:s,options:i&&n?[]:r,ref:function(t){return e.select=t}};return u(A({},this.props,a,{isLoading:i,onInputChange:this.onInputChange}))}}]),t}(e.Component);R.defaultProps=x;var K=function(e){function t(e,u){O(this,t);var n=w(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u));return n.filterOptions=n.filterOptions.bind(n),n.menuRenderer=n.menuRenderer.bind(n),n.onInputKeyDown=n.onInputKeyDown.bind(n),n.onInputChange=n.onInputChange.bind(n),n.onOptionSelect=n.onOptionSelect.bind(n),n}return D(t,e),F(t,[{key:"createNewOption",value:function(){var e=this.props,t=e.isValidNewOption,u=e.newOptionCreator,n=e.onNewOptionClick,s=e.options,o=void 0===s?[]:s;if(t({label:this.inputValue})){var i=u({label:this.inputValue,labelKey:this.labelKey,valueKey:this.valueKey});this.isOptionUnique({option:i})&&(n?n(i):(o.unshift(i),this.select.selectValue(i)))}}},{key:"filterOptions",value:function(){var e=this.props,t=e.filterOptions,u=e.isValidNewOption,n=e.promptTextCreator,s=(arguments.length<=2?void 0:arguments[2])||[],o=t.apply(void 0,arguments)||[];if(u({label:this.inputValue})){var i=this.props.newOptionCreator,r=i({label:this.inputValue,labelKey:this.labelKey,valueKey:this.valueKey});if(this.isOptionUnique({option:r,options:s.concat(o)})){var a=n(this.inputValue);this._createPlaceholderOption=i({label:a,labelKey:this.labelKey,valueKey:this.valueKey}),o.unshift(this._createPlaceholderOption)}}return o}},{key:"isOptionUnique",value:function(e){var t=e.option,u=e.options,n=this.props.isOptionUnique;return u=u||this.select.filterFlatOptions(),n({labelKey:this.labelKey,option:t,options:u,valueKey:this.valueKey})}},{key:"menuRenderer",value:function(e){var t=this.props.menuRenderer;return t(A({},e,{onSelect:this.onOptionSelect,selectValue:this.onOptionSelect}))}},{key:"onInputChange",value:function(e){var t=this.props.onInputChange;return this.inputValue=e,t&&(this.inputValue=t(e)),this.inputValue}},{key:"onInputKeyDown",value:function(e){var t=this.props,u=t.shouldKeyDownEventCreateNewOption,n=t.onInputKeyDown,s=this.select.getFocusedOption();s&&s===this._createPlaceholderOption&&u({keyCode:e.keyCode})?(this.createNewOption(),e.preventDefault()):n&&n(e)}},{key:"onOptionSelect",value:function(e,t){e===this._createPlaceholderOption?this.createNewOption():this.select.selectValue(e)}},{key:"focus",value:function(){this.select.focus()}},{key:"render",value:function(){var e=this,t=this.props,u=(t.newOptionCreator,t.shouldKeyDownEventCreateNewOption,t.ref),n=k(t,["newOptionCreator","shouldKeyDownEventCreateNewOption","ref"]),s=this.props.children;return s||(s=c),s(A({},n,{allowCreate:!0,filterOptions:this.filterOptions,menuRenderer:this.menuRenderer,onInputChange:this.onInputChange,onInputKeyDown:this.onInputKeyDown,ref:function(t){e.select=t,t&&(e.labelKey=t.props.labelKey,e.valueKey=t.props.valueKey),u&&u(t)}}))}}]),t}(b.Component);K.isOptionUnique=d,K.isValidNewOption=f,K.newOptionCreator=v,K.promptTextCreator=E,K.shouldKeyDownEventCreateNewOption=g,K.defaultProps={filterOptions:r,isOptionUnique:d,isValidNewOption:f,menuRenderer:l,newOptionCreator:v,promptTextCreator:E,shouldKeyDownEventCreateNewOption:g};var N=function(e){function t(){return O(this,t),w(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return D(t,e),F(t,[{key:"focus",value:function(){this.select.focus()}},{key:"render",value:function(){var e=this;return b.createElement(R,this.props,function(t){var u=t.ref,n=k(t,["ref"]),s=u;return b.createElement(K,n,function(t){var u=t.ref,n=k(t,["ref"]),o=u;return e.props.children(A({},n,{ref:function(t){o(t),s(t),e.select=t}}))})})}}]),t}(b.Component);return N.defaultProps={children:function(e){return b.createElement(_,e)}},_.Async=R,_.AsyncCreatable=N,_.Creatable=K,_.Value=P,_.Option=S,_}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react-input-autosize"),require("classnames"),require("prop-types"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react-input-autosize","classnames","prop-types","react","react-dom"],t):e.Select=t(e.AutosizeInput,e.classNames,e.PropTypes,e.React,e.ReactDOM)}(this,function(e,t,u,n,s){"use strict";function o(e){var t={};for(var u in e)e.hasOwnProperty(u)&&(t[u]=e[u]);return t}function i(e){return e&&Array.isArray(e.options)}e=e&&e.hasOwnProperty("default")?e.default:e,t=t&&t.hasOwnProperty("default")?t.default:t,u=u&&u.hasOwnProperty("default")?u.default:u;var a="default"in n?n.default:n,r=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}],l=function(e){for(var t=0;t<r.length;t++)e=e.replace(r[t].letters,r[t].base);return e},p=function(e){return e.replace(/^\s+|\s+$/g,"")},h=function(e){return void 0!==e&&null!==e&&""!==e},c=function(e,t,u,n){return n.ignoreAccents&&(t=l(t)),n.ignoreCase&&(t=t.toLowerCase()),n.trimFilter&&(t=p(t)),u&&(u=u.map(function(e){return e[n.valueKey]})),e.filter(function(e){if(u&&u.indexOf(e[n.valueKey])>-1)return!1;if(n.filterOption)return n.filterOption.call(void 0,e,t);if(!t)return!0;var s=e[n.valueKey],o=e[n.labelKey],i=h(s),a=h(o);if(!i&&!a)return!1;var r=i?String(s):null,p=a?String(o):null;return n.ignoreAccents&&(r&&"label"!==n.matchProp&&(r=l(r)),p&&"value"!==n.matchProp&&(p=l(p))),n.ignoreCase&&(r&&"label"!==n.matchProp&&(r=r.toLowerCase()),p&&"value"!==n.matchProp&&(p=p.toLowerCase())),"start"===n.matchPos?r&&"label"!==n.matchProp&&r.substr(0,t.length)===t||p&&"value"!==n.matchProp&&p.substr(0,t.length)===t:r&&"label"!==n.matchProp&&r.indexOf(t)>=0||p&&"value"!==n.matchProp&&p.indexOf(t)>=0})},d=function(e){return e&&Array.isArray(e.options)},f=function(e){var u=e.focusedOption,n=e.focusOption,s=e.inputValue,o=e.instancePrefix,i=e.onFocus,r=e.onOptionRef,l=e.onSelect,p=e.optionClassName,h=e.optionComponent,c=e.optionGroupComponent,f=e.optionRenderer,v=e.options,E=e.removeValue,g=e.selectValue,b=e.valueArray,y=e.valueKey,m=c,O=h,F=f;return function e(h){return h.map(function(h,c){if(d(h)){var f=t({"Select-option-group":!0});return a.createElement(m,{className:f,key:"option-group-"+c,label:F(h),option:h,optionIndex:c},e(h.options))}var v=b&&b.indexOf(h)>-1,C=h===u,A=t(p,{"Select-option":!0,"is-selected":v,"is-focused":C,"is-disabled":h.disabled});return a.createElement(O,{className:A,focusOption:n,inputValue:s,instancePrefix:o,isDisabled:h.disabled,isFocused:C,isSelected:v,key:"option-"+c+"-"+h[y],onFocus:i,onSelect:l,option:h,optionIndex:c,ref:function(e){r(e,C)},removeValue:E,selectValue:g},F(h,c))})}(v)},v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E=(function(){function e(e){this.value=e}function t(t){function u(s,o){try{var i=t[s](o),a=i.value;a instanceof e?Promise.resolve(a.value).then(function(e){u("next",e)},function(e){u("throw",e)}):n(i.done?"return":"normal",i.value)}catch(e){n("throw",e)}}function n(e,t){switch(e){case"return":s.resolve({value:t,done:!0});break;case"throw":s.reject(t);break;default:s.resolve({value:t,done:!1})}(s=s.next)?u(s.key,s.arg):o=null}var s,o;this._invoke=function(e,t){return new Promise(function(n,i){var a={key:e,arg:t,resolve:n,reject:i,next:null};o?o=o.next=a:(s=o=a,u(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),g=function(){function e(e,t){for(var u=0;u<t.length;u++){var n=t[u];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,u,n){return u&&e(t.prototype,u),n&&e(t,n),t}}(),b=function(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e},y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var u=arguments[t];for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n])}return e},m=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},O=function(e,t){var u={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(u[n]=e[n]);return u},F=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},C=function(e){function t(){return E(this,t),F(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return m(t,e),g(t,[{key:"render",value:function(){return this.props.children}}]),t}(a.Component),A=function(e){e.preventDefault(),e.stopPropagation(),"A"===e.target.tagName&&"href"in e.target&&(e.target.target?window.open(e.target.href,e.target.target):window.location.href=e.target.href)},D=function(e){function u(e){E(this,u);var t=F(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,e));return t.handleMouseDown=t.handleMouseDown.bind(t),t.handleMouseEnter=t.handleMouseEnter.bind(t),t.handleMouseMove=t.handleMouseMove.bind(t),t.handleTouchStart=t.handleTouchStart.bind(t),t.handleTouchEnd=t.handleTouchEnd.bind(t),t.handleTouchMove=t.handleTouchMove.bind(t),t.onFocus=t.onFocus.bind(t),t}return m(u,e),g(u,[{key:"handleMouseDown",value:function(e){e.preventDefault(),e.stopPropagation(),this.props.onSelect(this.props.option,e)}},{key:"handleMouseEnter",value:function(e){this.onFocus(e)}},{key:"handleMouseMove",value:function(e){this.onFocus(e)}},{key:"handleTouchEnd",value:function(e){this.dragging||this.handleMouseDown(e)}},{key:"handleTouchMove",value:function(){this.dragging=!0}},{key:"handleTouchStart",value:function(){this.dragging=!1}},{key:"onFocus",value:function(e){this.props.isFocused||this.props.onFocus(this.props.option,e)}},{key:"render",value:function(){var e=this.props,u=e.option,n=e.instancePrefix,s=e.optionIndex,o=t(this.props.className,u.className);return u.disabled?a.createElement("div",{className:o,onMouseDown:A,onClick:A},this.props.children):a.createElement("div",{className:o,style:u.style,role:"option","aria-label":u.label,onMouseDown:this.handleMouseDown,onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd,id:n+"-option-"+s,title:u.title},this.props.children)}}]),u}(a.Component),k=function(e){function u(e){E(this,u);var t=F(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,e));return t.handleMouseDown=t.handleMouseDown.bind(t),t.handleTouchEnd=t.handleTouchEnd.bind(t),t.handleTouchMove=t.handleTouchMove.bind(t),t.handleTouchStart=t.handleTouchStart.bind(t),t}return m(u,e),g(u,[{key:"blockEvent",value:function(e){e.preventDefault(),e.stopPropagation(),"A"===e.target.tagName&&"href"in e.target&&(e.target.target?window.open(e.target.href,e.target.target):window.location.href=e.target.href)}},{key:"handleMouseDown",value:function(e){e.preventDefault(),e.stopPropagation()}},{key:"handleTouchEnd",value:function(e){this.dragging||this.handleMouseDown(e)}},{key:"handleTouchMove",value:function(e){this.dragging=!0}},{key:"handleTouchStart",value:function(e){this.dragging=!1}},{key:"render",value:function(){var e=this.props.option,u=t(this.props.className,e.className);return e.disabled?a.createElement("div",{className:u,onMouseDown:this.blockEvent,onClick:this.blockEvent},this.props.children):a.createElement("div",{className:u,style:e.style,onMouseDown:this.handleMouseDown,onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd,title:e.title},a.createElement("div",{className:"Select-option-group-label"},this.props.label),this.props.children)}}]),u}(a.Component),w=function(e){function u(e){E(this,u);var t=F(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,e));return t.handleMouseDown=t.handleMouseDown.bind(t),t.onRemove=t.onRemove.bind(t),t.handleTouchEndRemove=t.handleTouchEndRemove.bind(t),t.handleTouchMove=t.handleTouchMove.bind(t),t.handleTouchStart=t.handleTouchStart.bind(t),t}return m(u,e),g(u,[{key:"handleMouseDown",value:function(e){if("mousedown"!==e.type||0===e.button)return this.props.onClick?(e.stopPropagation(),void this.props.onClick(this.props.value,e)):void(this.props.value.href&&e.stopPropagation())}},{key:"onRemove",value:function(e){e.preventDefault(),e.stopPropagation(),this.props.onRemove(this.props.value)}},{key:"handleTouchEndRemove",value:function(e){this.dragging||this.onRemove(e)}},{key:"handleTouchMove",value:function(){this.dragging=!0}},{key:"handleTouchStart",value:function(){this.dragging=!1}},{key:"renderRemoveIcon",value:function(){if(!this.props.disabled&&this.props.onRemove)return a.createElement("span",{className:"Select-value-icon","aria-hidden":"true",onMouseDown:this.onRemove,onTouchEnd:this.handleTouchEndRemove,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove},"×")}},{key:"renderLabel",value:function(){return this.props.onClick||this.props.value.href?a.createElement("a",{className:"Select-value-label",href:this.props.value.href,target:this.props.value.target,onMouseDown:this.handleMouseDown,onTouchEnd:this.handleMouseDown},this.props.children):a.createElement("span",{className:"Select-value-label",role:"option","aria-selected":"true",id:this.props.id},this.props.children)}},{key:"render",value:function(){return a.createElement("div",{className:t("Select-value",this.props.value.className),style:this.props.value.style,title:this.props.value.title},this.renderRemoveIcon(),this.renderLabel())}}]),u}(a.Component),S=function(e){return"string"==typeof e?e:null!==e&&JSON.stringify(e)||""},T=(u.oneOfType([u.string,u.node]),u.oneOfType([u.string,u.number]),1),V=function(e,t){var u=e.inputValue,n=e.isPseudoFocused,s=e.isFocused,o=t.onSelectResetsInput;return!u||!o&&!(!s&&n||s&&!n)},P=function(e,t,u){var n=e.inputValue,s=e.isPseudoFocused,o=e.isFocused,i=t.onSelectResetsInput;return!n||!i&&!u&&!s&&!o},M=function(e,t){return!e||(t?0===e.length:0===Object.keys(e).length)},_=function(u){function n(e){E(this,n);var t=F(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return["clearValue","focusOption","getOptionLabel","handleInputBlur","handleInputChange","handleInputFocus","handleInputValueChange","handleKeyDown","handleMenuScroll","handleMouseDown","handleMouseDownOnArrow","handleMouseDownOnMenu","handleTouchEnd","handleTouchEndClearValue","handleTouchMove","handleTouchOutside","handleTouchStart","handleValueClick","onOptionRef","removeValue","selectValue"].forEach(function(e){return t[e]=t[e].bind(t)}),t.state={inputValue:"",isFocused:!1,isOpen:!1,isPseudoFocused:!1,required:!1},t}return m(n,u),g(n,[{key:"componentWillMount",value:function(){this._flatOptions=this.flattenOptions(this.props.options),this._instancePrefix="react-select-"+(this.props.instanceId||++T)+"-";var e=this.getValueArray(this.props.value);this.props.required&&this.setState({required:M(e[0],this.props.multi)})}},{key:"componentDidMount",value:function(){void 0!==this.props.autofocus&&"undefined"!=typeof console&&console.warn("Warning: The autofocus prop has changed to autoFocus, support will be removed after react-select@1.0"),(this.props.autoFocus||this.props.autofocus)&&this.focus()}},{key:"componentWillReceiveProps",value:function(e){e.options!==this.props.options&&(this._flatOptions=this.flattenOptions(e.options));var t=this.getValueArray(e.value,e);!e.isOpen&&this.props.isOpen?this.closeMenu():e.isOpen&&!this.props.isOpen&&this.setState({isOpen:!0}),e.required?this.setState({required:M(t[0],e.multi)}):this.props.required&&this.setState({required:!1}),this.state.inputValue&&this.props.value!==e.value&&e.onSelectResetsInput&&this.setState({inputValue:this.handleInputValueChange("")})}},{key:"componentDidUpdate",value:function(e,t){if(this.menu&&this.focused&&this.state.isOpen&&!this.hasScrolledToOption){var u=s.findDOMNode(this.focused),n=s.findDOMNode(this.menu),o=n.scrollTop,i=o+n.offsetHeight,a=u.offsetTop,r=a+u.offsetHeight;(o>a||i<r)&&(n.scrollTop=u.offsetTop),this.hasScrolledToOption=!0}else this.state.isOpen||(this.hasScrolledToOption=!1);if(this._scrollToFocusedOptionOnUpdate&&this.focused&&this.menu){this._scrollToFocusedOptionOnUpdate=!1;var l=s.findDOMNode(this.focused),p=s.findDOMNode(this.menu),h=l.getBoundingClientRect(),c=p.getBoundingClientRect();h.bottom>c.bottom?p.scrollTop=l.offsetTop+l.clientHeight-p.offsetHeight:h.top<c.top&&(p.scrollTop=l.offsetTop)}if(this.props.scrollMenuIntoView&&this.menuContainer){var d=this.menuContainer.getBoundingClientRect();window.innerHeight<d.bottom+this.props.menuBuffer&&window.scrollBy(0,d.bottom+this.props.menuBuffer-window.innerHeight)}if(e.disabled!==this.props.disabled&&(this.setState({isFocused:!1}),this.closeMenu()),t.isOpen!==this.state.isOpen){this.toggleTouchOutsideEvent(this.state.isOpen);var f=this.state.isOpen?this.props.onOpen:this.props.onClose;f&&f()}}},{key:"componentWillUnmount",value:function(){this.toggleTouchOutsideEvent(!1)}},{key:"toggleTouchOutsideEvent",value:function(e){e?!document.addEventListener&&document.attachEvent?document.attachEvent("ontouchstart",this.handleTouchOutside):document.addEventListener("touchstart",this.handleTouchOutside):!document.removeEventListener&&document.detachEvent?document.detachEvent("ontouchstart",this.handleTouchOutside):document.removeEventListener("touchstart",this.handleTouchOutside)}},{key:"handleTouchOutside",value:function(e){this.wrapper&&!this.wrapper.contains(e.target)&&this.closeMenu()}},{key:"focus",value:function(){this.input&&this.input.focus()}},{key:"blurInput",value:function(){this.input&&this.input.blur()}},{key:"handleTouchMove",value:function(){this.dragging=!0}},{key:"handleTouchStart",value:function(){this.dragging=!1}},{key:"handleTouchEnd",value:function(e){this.dragging||this.handleMouseDown(e)}},{key:"handleTouchEndClearValue",value:function(e){this.dragging||this.clearValue(e)}},{key:"handleMouseDown",value:function(e){if(!(this.props.disabled||"mousedown"===e.type&&0!==e.button))if("INPUT"!==e.target.tagName){if(e.preventDefault(),!this.props.searchable)return this.focus(),this.setState({isOpen:!this.state.isOpen});if(this.state.isFocused){this.focus();var t=this.input,u=!0;"function"==typeof t.getInput&&(t=t.getInput()),t.value="",this._focusAfterClear&&(u=!1,this._focusAfterClear=!1),this.setState({isOpen:u,isPseudoFocused:!1,focusedOption:null})}else this._openAfterFocus=this.props.openOnClick,this.focus(),this.setState({focusedOption:null})}else this.state.isFocused?this.state.isOpen||this.setState({isOpen:!0,isPseudoFocused:!1}):(this._openAfterFocus=this.props.openOnClick,this.focus())}},{key:"handleMouseDownOnArrow",value:function(e){this.props.disabled||"mousedown"===e.type&&0!==e.button||(this.state.isOpen?(e.stopPropagation(),e.preventDefault(),this.closeMenu()):this.setState({isOpen:!0}))}},{key:"handleMouseDownOnMenu",value:function(e){this.props.disabled||"mousedown"===e.type&&0!==e.button||(e.stopPropagation(),e.preventDefault(),this._openAfterFocus=!0,this.focus())}},{key:"closeMenu",value:function(){this.props.onCloseResetsInput?this.setState({inputValue:this.handleInputValueChange(""),isOpen:!1,isPseudoFocused:this.state.isFocused&&!this.props.multi}):this.setState({isOpen:!1,isPseudoFocused:this.state.isFocused&&!this.props.multi}),this.hasScrolledToOption=!1}},{key:"handleInputFocus",value:function(e){if(!this.props.disabled){var t=this.state.isOpen||this._openAfterFocus||this.props.openOnFocus;t=!this._focusAfterClear&&t,this.props.onFocus&&this.props.onFocus(e),this.setState({isFocused:!0,isOpen:!!t}),this._focusAfterClear=!1,this._openAfterFocus=!1}}},{key:"handleInputBlur",value:function(e){if(!this.menu||this.menu!==document.activeElement&&!this.menu.contains(document.activeElement)){this.props.onBlur&&this.props.onBlur(e);var t={isFocused:!1,isOpen:!1,isPseudoFocused:!1};this.props.onBlurResetsInput&&(t.inputValue=this.handleInputValueChange("")),this.setState(t)}else this.focus()}},{key:"handleInputChange",value:function(e){var t=e.target.value;this.state.inputValue!==e.target.value&&(t=this.handleInputValueChange(t)),this.setState({inputValue:t,isOpen:!0,isPseudoFocused:!1})}},{key:"setInputValue",value:function(e){if(this.props.onInputChange){var t=this.props.onInputChange(e);null!=t&&"object"!==(void 0===t?"undefined":v(t))&&(e=""+t)}this.setState({inputValue:e})}},{key:"handleInputValueChange",value:function(e){if(this.props.onInputChange){var t=this.props.onInputChange(e);null!=t&&"object"!==(void 0===t?"undefined":v(t))&&(e=""+t)}return e}},{key:"handleKeyDown",value:function(e){if(!(this.props.disabled||"function"==typeof this.props.onInputKeyDown&&(this.props.onInputKeyDown(e),e.defaultPrevented)))switch(e.keyCode){case 8:!this.state.inputValue&&this.props.backspaceRemoves&&(e.preventDefault(),this.popValue());break;case 9:if(e.shiftKey||!this.state.isOpen||!this.props.tabSelectsValue)break;e.preventDefault(),this.selectFocusedOption();break;case 13:e.preventDefault(),e.stopPropagation(),this.state.isOpen?this.selectFocusedOption():this.focusNextOption();break;case 27:e.preventDefault(),this.state.isOpen?(this.closeMenu(),e.stopPropagation()):this.props.clearable&&this.props.escapeClearsValue&&(this.clearValue(e),e.stopPropagation());break;case 32:if(this.props.searchable)break;if(e.preventDefault(),!this.state.isOpen){this.focusNextOption();break}e.stopPropagation(),this.selectFocusedOption();break;case 38:e.preventDefault(),this.focusPreviousOption();break;case 40:e.preventDefault(),this.focusNextOption();break;case 33:e.preventDefault(),this.focusPageUpOption();break;case 34:e.preventDefault(),this.focusPageDownOption();break;case 35:if(e.shiftKey)break;e.preventDefault(),this.focusEndOption();break;case 36:if(e.shiftKey)break;e.preventDefault(),this.focusStartOption();break;case 46:e.preventDefault(),!this.state.inputValue&&this.props.deleteRemoves&&this.popValue()}}},{key:"handleValueClick",value:function(e,t){this.props.onValueClick&&this.props.onValueClick(e,t)}},{key:"handleMenuScroll",value:function(e){if(this.props.onMenuScrollToBottom){var t=e.target;t.scrollHeight>t.offsetHeight&&t.scrollHeight-t.offsetHeight-t.scrollTop<=0&&this.props.onMenuScrollToBottom()}}},{key:"getOptionLabel",value:function(e){return e[this.props.labelKey]}},{key:"getValueArray",value:function(e){var t=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n="object"===(void 0===u?"undefined":v(u))?u:this.props;if(n.multi){if("string"==typeof e&&(e=e.split(n.delimiter)),!Array.isArray(e)){if(null===e||void 0===e)return[];e=[e]}return e.map(function(e){return t.expandValue(e,n)}).filter(function(e){return e})}var s=this.expandValue(e,n);return s?[s]:[]}},{key:"expandValue",value:function(e,t){var u=void 0===e?"undefined":v(e);if("string"!==u&&"number"!==u&&"boolean"!==u)return e;var n=t.labelKey,s=t.renderInvalidValues,o=t.valueKey,i=this._flatOptions;if(i){for(var a=0;a<i.length;a++)if(String(i[a][o])===String(e))return i[a];if(s){var r;return this._invalidOptions=this._invalidOptions||{},this._invalidOptions[e]=this._invalidOptions[e]||(r={invalid:!0},b(r,n,e),b(r,o,e),r),this._invalidOptions[e]}}}},{key:"setValue",value:function(e){var t=this;if(this.props.autoBlur&&this.blurInput(),this.props.required){var u=M(e,this.props.multi);this.setState({required:u})}this.props.simpleValue&&e&&(e=this.props.multi?e.map(function(e){return e[t.props.valueKey]}).join(this.props.delimiter):e[this.props.valueKey]),this.props.onChange&&this.props.onChange(e)}},{key:"selectValue",value:function(e){var t=this;this.props.closeOnSelect&&(this.hasScrolledToOption=!1);var u=this.props.onSelectResetsInput?"":this.state.inputValue;this.props.multi?this.setState({focusedIndex:null,inputValue:this.handleInputValueChange(u),isOpen:!this.props.closeOnSelect},function(){t.getValueArray(t.props.value).some(function(u){return u[t.props.valueKey]===e[t.props.valueKey]})?t.removeValue(e):t.addValue(e)}):this.setState({inputValue:this.handleInputValueChange(u),isOpen:!this.props.closeOnSelect,isPseudoFocused:this.state.isFocused},function(){t.setValue(e)})}},{key:"addValue",value:function(e){var t=this.getValueArray(this.props.value),u=this._visibleOptions.filter(function(e){return!e.disabled}),n=u.indexOf(e);this.setValue(t.concat(e)),u.length-1===n?this.focusOption(u[n-1]):u.length>n&&this.focusOption(u[n+1])}},{key:"popValue",value:function(){var e=this.getValueArray(this.props.value);e.length&&!1!==e[e.length-1].clearableValue&&this.setValue(this.props.multi?e.slice(0,e.length-1):null)}},{key:"removeValue",value:function(e){var t=this,u=this.getValueArray(this.props.value);this.setValue(u.filter(function(u){return u[t.props.valueKey]!==e[t.props.valueKey]})),this.focus()}},{key:"clearValue",value:function(e){e&&"mousedown"===e.type&&0!==e.button||(e.preventDefault(),this.setValue(this.getResetValue()),this.setState({inputValue:this.handleInputValueChange(""),isOpen:!1},this.focus),this._focusAfterClear=!0)}},{key:"getResetValue",value:function(){return void 0!==this.props.resetValue?this.props.resetValue:this.props.multi?[]:null}},{key:"focusOption",value:function(e){this.setState({focusedOption:e})}},{key:"focusNextOption",value:function(){this.focusAdjacentOption("next")}},{key:"focusPreviousOption",value:function(){this.focusAdjacentOption("previous")}},{key:"focusPageUpOption",value:function(){this.focusAdjacentOption("page_up")}},{key:"focusPageDownOption",value:function(){this.focusAdjacentOption("page_down")}},{key:"focusStartOption",value:function(){this.focusAdjacentOption("start")}},{key:"focusEndOption",value:function(){this.focusAdjacentOption("end")}},{key:"focusAdjacentOption",value:function(e){var t=this._visibleOptions.map(function(e,t){return{option:e,index:t}}).filter(function(e){return!e.option.disabled});if(this._scrollToFocusedOptionOnUpdate=!0,!this.state.isOpen){var u={focusedOption:this._focusedOption||(t.length?t["next"===e?0:t.length-1].option:null),isOpen:!0};return this.props.onSelectResetsInput&&(u.inputValue=""),void this.setState(u)}if(t.length){for(var n=-1,s=0;s<t.length;s++)if(this._focusedOption===t[s].option){n=s;break}if("next"===e&&-1!==n)n=(n+1)%t.length;else if("previous"===e)n>0?n-=1:n=t.length-1;else if("start"===e)n=0;else if("end"===e)n=t.length-1;else if("page_up"===e){var o=n-this.props.pageSize;n=o<0?0:o}else if("page_down"===e){var i=n+this.props.pageSize;n=i>t.length-1?t.length-1:i}-1===n&&(n=0),this.setState({focusedIndex:t[n].index,focusedOption:t[n].option})}}},{key:"getFocusedOption",value:function(){return this._focusedOption}},{key:"selectFocusedOption",value:function(){if(this._focusedOption)return this.selectValue(this._focusedOption)}},{key:"renderLoading",value:function(){if(this.props.isLoading)return a.createElement("span",{className:"Select-loading-zone","aria-hidden":"true"},a.createElement("span",{className:"Select-loading"}))}},{key:"renderValue",value:function(e,t){var u=this,n=this.props.valueRenderer||this.getOptionLabel,s=this.props.valueComponent;if(!e.length)return P(this.state,this.props,t)?a.createElement("div",{className:"Select-placeholder"},this.props.placeholder):null;var o=this.props.onValueClick?this.handleValueClick:null;return this.props.multi?e.map(function(e,t){return a.createElement(s,{disabled:u.props.disabled||!1===e.clearableValue,id:u._instancePrefix+"-value-"+t,instancePrefix:u._instancePrefix,key:"value-"+t+"-"+e[u.props.valueKey],onClick:o,onRemove:u.removeValue,placeholder:u.props.placeholder,value:e},n(e,t),a.createElement("span",{className:"Select-aria-only"}," "))}):V(this.state,this.props)?(t&&(o=null),a.createElement(s,{disabled:this.props.disabled,id:this._instancePrefix+"-value-item",instancePrefix:this._instancePrefix,onClick:o,placeholder:this.props.placeholder,value:e[0]},n(e[0]))):void 0}},{key:"renderInput",value:function(u,n){var s,o=this,i=t("Select-input",this.props.inputProps.className),r=this.state.isOpen,l=t((s={},b(s,this._instancePrefix+"-list",r),b(s,this._instancePrefix+"-backspace-remove-message",this.props.multi&&!this.props.disabled&&this.state.isFocused&&!this.state.inputValue),s)),p=this.state.inputValue;!p||this.props.onSelectResetsInput||this.state.isFocused||(p="");var h=y({},this.props.inputProps,{"aria-activedescendant":r?this._instancePrefix+"-option-"+n:this._instancePrefix+"-value","aria-describedby":this.props["aria-describedby"],"aria-expanded":""+r,"aria-haspopup":""+r,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-owns":l,className:i,onBlur:this.handleInputBlur,onChange:this.handleInputChange,onFocus:this.handleInputFocus,ref:function(e){return o.input=e},role:"combobox",required:this.state.required,tabIndex:this.props.tabIndex,value:p});if(this.props.inputRenderer)return this.props.inputRenderer(h);if(this.props.disabled||!this.props.searchable){var c=O(this.props.inputProps,[]),d=t(b({},this._instancePrefix+"-list",r));return a.createElement("div",y({},c,{"aria-expanded":r,"aria-owns":d,"aria-activedescendant":r?this._instancePrefix+"-option-"+n:this._instancePrefix+"-value","aria-disabled":""+this.props.disabled,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],className:i,onBlur:this.handleInputBlur,onFocus:this.handleInputFocus,ref:function(e){return o.input=e},role:"combobox",style:{border:0,width:1,display:"inline-block"},tabIndex:this.props.tabIndex||0}))}return this.props.autosize?a.createElement(e,y({id:this.props.id},h,{minWidth:"5"})):a.createElement("div",{className:i,key:"input-wrap"},a.createElement("input",y({id:this.props.id},h)))}},{key:"renderClear",value:function(){var e=this.getValueArray(this.props.value);if(this.props.clearable&&e.length&&!this.props.disabled&&!this.props.isLoading){var t=this.props.multi?this.props.clearAllText:this.props.clearValueText,u=this.props.clearRenderer();return a.createElement("span",{"aria-label":t,className:"Select-clear-zone",onMouseDown:this.clearValue,onTouchEnd:this.handleTouchEndClearValue,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,title:t},u)}}},{key:"renderArrow",value:function(){if(this.props.arrowRenderer){var e=this.handleMouseDownOnArrow,t=this.state.isOpen,u=this.props.arrowRenderer({onMouseDown:e,isOpen:t});return u?a.createElement("span",{className:"Select-arrow-zone",onMouseDown:e},u):null}}},{key:"filterFlatOptions",value:function(e){var t=this.state.inputValue,u=this._flatOptions;return this.props.filterOptions?("function"==typeof this.props.filterOptions?this.props.filterOptions:c)(u,t,e,{filterOption:this.props.filterOption,ignoreAccents:this.props.ignoreAccents,ignoreCase:this.props.ignoreCase,labelKey:this.props.labelKey,matchPos:this.props.matchPos,matchProp:this.props.matchProp,trimFilter:this.props.trimFilter,valueKey:this.props.valueKey}):u}},{key:"flattenOptions",value:function(e,t){if(!e)return[];for(var u=[],n=0;n<e.length;n++){var s=o(e[n]);t&&(s.group=t),i(s)?(u=u.concat(this.flattenOptions(s.options,s)),s.options=[]):u.push(s)}return u}},{key:"unflattenOptions",value:function(e){var t=[],u=void 0,n=void 0;return e.forEach(function(e){for(e.isInTree=!1,u=e.group;u;)u.isInTree&&(u.options=[],u.isInTree=!1),u=u.group}),e.forEach(function(e){for(u=(n=e).group;u;)n.isInTree||(u.options.push(n),n.isInTree=!0),u=(n=u).group;n.isInTree||(t.push(n),n.isInTree=!0)}),e.forEach(function(e){delete e.isInTree}),t}},{key:"onOptionRef",value:function(e,t){t&&(this.focused=e)}},{key:"renderMenu",value:function(e,t,u){return e&&e.length?this.props.menuRenderer({focusedOption:u,focusOption:this.focusOption,inputValue:this.state.inputValue,instancePrefix:this._instancePrefix,labelKey:this.props.labelKey,onFocus:this.focusOption,onOptionRef:this.onOptionRef,onSelect:this.selectValue,optionClassName:this.props.optionClassName,optionComponent:this.props.optionComponent,optionGroupComponent:this.props.optionGroupComponent,optionRenderer:this.props.optionRenderer||this.getOptionLabel,options:e,removeValue:this.removeValue,selectValue:this.selectValue,valueArray:t,valueKey:this.props.valueKey}):this.props.noResultsText?a.createElement("div",{className:"Select-noresults"},this.props.noResultsText):null}},{key:"renderHiddenField",value:function(e){var t=this;if(this.props.name){if(this.props.joinValues){var u=e.map(function(e){return S(e[t.props.valueKey])}).join(this.props.delimiter);return a.createElement("input",{disabled:this.props.disabled,name:this.props.name,ref:function(e){return t.value=e},type:"hidden",value:u})}return e.map(function(e,u){return a.createElement("input",{disabled:t.props.disabled,key:"hidden."+u,name:t.props.name,ref:"value"+u,type:"hidden",value:S(e[t.props.valueKey])})})}}},{key:"getFocusableOptionIndex",value:function(e){var t=this._visibleOptions;if(!t.length)return null;var u=this.props.valueKey,n=this.state.focusedOption||e;if(n&&!n.disabled){var s=-1;if(t.some(function(e,t){var o=e[u]===n[u];return o&&(s=t),o}),-1!==s)return s}for(var o=0;o<t.length;o++)if(!t[o].disabled)return o;return null}},{key:"renderOuter",value:function(e,t,u){var n=this,s=this.props.dropdownComponent,o=this.renderMenu(e,t,u);return o?a.createElement(s,null,a.createElement("div",{ref:function(e){return n.menuContainer=e},className:"Select-menu-outer",style:this.props.menuContainerStyle},a.createElement("div",{className:"Select-menu",id:this._instancePrefix+"-list",onMouseDown:this.handleMouseDownOnMenu,onScroll:this.handleMenuScroll,ref:function(e){return n.menu=e},role:"listbox",style:this.props.menuStyle,tabIndex:-1},o))):null}},{key:"render",value:function(){var e=this,u=this.getValueArray(this.props.value);this._visibleOptions=this.filterFlatOptions(this.props.multi&&this.props.removeSelected?u:null);var n=this.unflattenOptions(this._visibleOptions),s="boolean"==typeof this.props.isOpen?this.props.isOpen:this.state.isOpen;this.props.multi&&!n.length&&u.length&&!this.state.inputValue&&(s=!1);var o=this.getFocusableOptionIndex(u[0]),i=null;i=this._focusedOption=null!==o?this._visibleOptions[o]:null;var r=t("Select",this.props.className,{"has-value":u.length,"is-clearable":this.props.clearable,"is-disabled":this.props.disabled,"is-focused":this.state.isFocused,"is-loading":this.props.isLoading,"is-open":s,"is-pseudo-focused":this.state.isPseudoFocused,"is-searchable":this.props.searchable,"Select--multi":this.props.multi,"Select--rtl":this.props.rtl,"Select--single":!this.props.multi}),l=null;return this.props.multi&&!this.props.disabled&&u.length&&!this.state.inputValue&&this.state.isFocused&&this.props.backspaceRemoves&&(l=a.createElement("span",{id:this._instancePrefix+"-backspace-remove-message",className:"Select-aria-only","aria-live":"assertive"},this.props.backspaceToRemoveMessage.replace("{label}",u[u.length-1][this.props.labelKey]))),a.createElement("div",{ref:function(t){return e.wrapper=t},className:r,style:this.props.wrapperStyle},this.renderHiddenField(u),a.createElement("div",{ref:function(t){return e.control=t},className:"Select-control",onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchEnd:this.handleTouchEnd,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,style:this.props.style},a.createElement("span",{className:"Select-multi-value-wrapper",id:this._instancePrefix+"-value"},this.renderValue(u,s),this.renderInput(u,o)),l,this.renderLoading(),this.renderClear(),this.renderArrow()),s?this.renderOuter(n,u,i):null)}}]),n}(a.Component);_.defaultProps={arrowRenderer:function(e){var t=e.onMouseDown;return a.createElement("span",{className:"Select-arrow",onMouseDown:t})},autosize:!0,backspaceRemoves:!0,backspaceToRemoveMessage:"Press backspace to remove {label}",clearable:!0,clearAllText:"Clear all",clearRenderer:function(){return a.createElement("span",{className:"Select-clear",dangerouslySetInnerHTML:{__html:"×"}})},clearValueText:"Clear value",closeOnSelect:!0,deleteRemoves:!0,delimiter:",",disabled:!1,dropdownComponent:C,escapeClearsValue:!0,filterOptions:c,ignoreAccents:!0,ignoreCase:!0,inputProps:{},isLoading:!1,joinValues:!1,labelKey:"label",matchPos:"any",matchProp:"any",menuBuffer:0,menuRenderer:f,multi:!1,noResultsText:"No results found",onBlurResetsInput:!0,onCloseResetsInput:!0,onSelectResetsInput:!0,openOnClick:!0,optionComponent:D,optionGroupComponent:k,pageSize:5,placeholder:"Select...",removeSelected:!0,required:!1,rtl:!1,scrollMenuIntoView:!0,searchable:!0,simpleValue:!1,tabSelectsValue:!0,trimFilter:!0,valueComponent:w,valueKey:"value"};u.bool.isRequired,u.any,u.func.isRequired,u.bool,u.bool,u.func.isRequired,u.oneOfType([u.string,u.node]),u.bool,u.oneOfType([u.string,u.node]),u.func,u.func,u.array.isRequired,u.oneOfType([u.string,u.node]),u.oneOfType([u.string,u.node]),u.any;var B={},I={autoload:!0,cache:B,children:function(e){return a.createElement(_,e)},ignoreAccents:!0,ignoreCase:!0,loadingPlaceholder:"Loading...",options:[],searchPromptText:"Type to search"},x=function(e){function t(e,u){E(this,t);var n=F(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u));return n._cache=e.cache===B?{}:e.cache,n.state={inputValue:"",isLoading:!1,options:e.options},n.onInputChange=n.onInputChange.bind(n),n}return m(t,e),g(t,[{key:"componentDidMount",value:function(){this.props.autoload&&this.loadOptions("")}},{key:"componentWillReceiveProps",value:function(e){e.options!==this.props.options&&this.setState({options:e.options})}},{key:"componentWillUnmount",value:function(){this._callback=null}},{key:"loadOptions",value:function(e){var t=this,u=this.props.loadOptions,n=this._cache;if(n&&Object.prototype.hasOwnProperty.call(n,e))return this._callback=null,void this.setState({isLoading:!1,options:n[e]});var s=function u(s,o){var i=o&&o.options||[];n&&(n[e]=i),u===t._callback&&(t._callback=null,t.setState({isLoading:!1,options:i}))};this._callback=s;var o=u(e,s);o&&o.then(function(e){return s(0,e)},function(e){return s()}),this._callback&&!this.state.isLoading&&this.setState({isLoading:!0})}},{key:"onInputChange",value:function(e){var t=this.props,u=t.ignoreAccents,n=t.ignoreCase,s=t.onInputChange,o=e;if(s){var i=s(o);null!=i&&"object"!==(void 0===i?"undefined":v(i))&&(o=""+i)}var a=o;return u&&(a=l(a)),n&&(a=a.toLowerCase()),this.setState({inputValue:o}),this.loadOptions(a),o}},{key:"noResultsText",value:function(){var e=this.props,t=e.loadingPlaceholder,u=e.noResultsText,n=e.searchPromptText,s=this.state,o=s.inputValue;return s.isLoading?t:o&&u?u:n}},{key:"focus",value:function(){this.select.focus()}},{key:"render",value:function(){var e=this,t=this.props,u=t.children,n=t.loadingPlaceholder,s=t.placeholder,o=this.state,i=o.isLoading,a=o.options,r={noResultsText:this.noResultsText(),placeholder:i?n:s,options:i&&n?[]:a,ref:function(t){return e.select=t}};return u(y({},this.props,r,{isLoading:i,onInputChange:this.onInputChange}))}}]),t}(n.Component);x.defaultProps=I;var R=function(e){function t(e,u){E(this,t);var n=F(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u));return n.filterOptions=n.filterOptions.bind(n),n.menuRenderer=n.menuRenderer.bind(n),n.onInputKeyDown=n.onInputKeyDown.bind(n),n.onInputChange=n.onInputChange.bind(n),n.onOptionSelect=n.onOptionSelect.bind(n),n}return m(t,e),g(t,[{key:"createNewOption",value:function(){var e=this.props,t=e.isValidNewOption,u=e.newOptionCreator,n=e.onNewOptionClick,s=e.options,o=void 0===s?[]:s;if(t({label:this.inputValue})){var i=u({label:this.inputValue,labelKey:this.labelKey,valueKey:this.valueKey});this.isOptionUnique({option:i,options:o})&&(n?n(i):(o.unshift(i),this.select.selectValue(i)))}}},{key:"filterOptions",value:function(){var e=this.props,t=e.filterOptions,u=e.isValidNewOption,n=e.promptTextCreator,s=(arguments.length<=2?void 0:arguments[2])||[],o=t.apply(void 0,arguments)||[];if(u({label:this.inputValue})){var i=this.props.newOptionCreator,a=i({label:this.inputValue,labelKey:this.labelKey,valueKey:this.valueKey});if(this.isOptionUnique({option:a,options:s.concat(o)})){var r=n(this.inputValue);this._createPlaceholderOption=i({label:r,labelKey:this.labelKey,valueKey:this.valueKey}),o.unshift(this._createPlaceholderOption)}}return o}},{key:"isOptionUnique",value:function(e){var t=e.option,u=e.options,n=this.props.isOptionUnique;return u=u||this.select.filterFlatOptions(),n({labelKey:this.labelKey,option:t,options:u,valueKey:this.valueKey})}},{key:"menuRenderer",value:function(e){var t=this.props.menuRenderer;return t(y({},e,{onSelect:this.onOptionSelect,selectValue:this.onOptionSelect}))}},{key:"onInputChange",value:function(e){var t=this.props.onInputChange;return this.inputValue=e,t&&(this.inputValue=t(e)),this.inputValue}},{key:"onInputKeyDown",value:function(e){var t=this.props,u=t.shouldKeyDownEventCreateNewOption,n=t.onInputKeyDown,s=this.select.getFocusedOption();s&&s===this._createPlaceholderOption&&u({keyCode:e.keyCode})?(this.createNewOption(),e.preventDefault()):n&&n(e)}},{key:"onOptionSelect",value:function(e){e===this._createPlaceholderOption?this.createNewOption():this.select.selectValue(e)}},{key:"focus",value:function(){this.select.focus()}},{key:"render",value:function(){var e=this,t=this.props,u=t.ref,n=O(t,["ref"]),s=this.props.children;return s||(s=K),s(y({},n,{allowCreate:!0,filterOptions:this.filterOptions,menuRenderer:this.menuRenderer,onInputChange:this.onInputChange,onInputKeyDown:this.onInputKeyDown,ref:function(t){e.select=t,t&&(e.labelKey=t.props.labelKey,e.valueKey=t.props.valueKey),u&&u(t)}}))}}]),t}(a.Component),K=function(e){return a.createElement(_,e)},N=function(e){var t=e.option,u=e.options,n=e.labelKey,s=e.valueKey;return!u||!u.length||0===u.filter(function(e){return e[n]===t[n]||e[s]===t[s]}).length},j=function(e){return!!e.label},L=function(e){var t=e.label,u=e.labelKey,n={};return n[e.valueKey]=t,n[u]=t,n.className="Select-create-option-placeholder",n},q=function(e){return'Create option "'+e+'"'},U=function(e){switch(e.keyCode){case 9:case 13:case 188:return!0;default:return!1}};R.isOptionUnique=N,R.isValidNewOption=j,R.newOptionCreator=L,R.promptTextCreator=q,R.shouldKeyDownEventCreateNewOption=U,R.defaultProps={filterOptions:c,isOptionUnique:N,isValidNewOption:j,menuRenderer:f,newOptionCreator:L,promptTextCreator:q,shouldKeyDownEventCreateNewOption:U};var z=function(e){function t(){return E(this,t),F(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return m(t,e),g(t,[{key:"focus",value:function(){this.select.focus()}},{key:"render",value:function(){var e=this;return a.createElement(x,this.props,function(t){var u=t.ref,n=O(t,["ref"]),s=u;return a.createElement(R,n,function(t){var u=t.ref,n=O(t,["ref"]),o=u;return e.props.children(y({},n,{ref:function(t){o(t),s(t),e.select=t}}))})})}}]),t}(a.Component);return z.defaultProps={children:function(e){return a.createElement(_,e)}},_.Async=x,_.AsyncCreatable=z,_.Creatable=R,_.Value=w,_.Option=D,_}); |
1074
HISTORY.md
# React-Select-Plus | ||
## v1.2.0 / 2018-01-08 | ||
* Source cleanup, thanks to [Yuri S](https://github.com/yuri-sakharov) and | ||
[Charles Lee](https://github.com/gwyneplaine) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2262) | ||
* Switched from babel-preset-es2015 to babel-preset-env, thanks | ||
[Rambabu Yadlapalli](https://github.com/RamYadlapalli) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2254) | ||
* Fixed focused option. Issue #2237, thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2245) | ||
* Fix onSelectResetsInput bug from keyboard navigation, thanks | ||
[Charles Lee](https://github.com/gwyneplaine) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2259) | ||
* Fixed all warnings on running tests, thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2231) | ||
* Added missing tests for Option.js and refactored Option-test.js., thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2249) | ||
* Added missing tests for Async.js, thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2250) | ||
* Fixed console error in GitHub users example, thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2244) | ||
* Fixed readme example. Issue #2235, thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2246) | ||
* Regression fix for single select with onSelectResetsInput=false, thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2226) | ||
* Pass placeholder prop to ValueComponent, thanks | ||
[Aravind Srivatsan](https://github.com/aravindsrivats) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2225) | ||
* Refactored handleKeyDown switch, thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2228) | ||
* onSelectResetsInput regression fixed, thanks | ||
[Jed Watson](https://github.com/dehamilton) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2215) | ||
* Don't open drop down menu when clear values, thanks | ||
[Jed Watson](https://github.com/Chopinsky) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2198) | ||
* Clear input value on receiving props with another value., thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2183) | ||
* Fix/is option unique crash, thanks [Jacob Zuo](https://github.com/Chopinsky) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2185) | ||
* Use react-input-autosize v2.1.2 for guard against undefined window, thanks | ||
[DStyleZ](https://github.com/sximba) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2187) | ||
* Fix issue #2182, thanks [Kurt Hoyt](https://github.com/kurtinatlanta) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2213) | ||
* Documenting behavior of onBlurResetsInput in the readme., thanks | ||
[hobbsl](https://github.com/levininja) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2212) | ||
* Use onSelectResetsInput for single select, thanks | ||
[lachiet](https://github.com/lachiet) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2205) | ||
* Fix state value in README example, thanks | ||
[Srishan Bhattarai](https://github.com/srishanbhattarai) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2192) | ||
* document breaking change of removing getInputValue, thanks | ||
[Turadg Aleahmad](https://github.com/turadg) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2195) | ||
* Fixed search for invalid label and/or value, thanks | ||
[Yuri S](https://github.com/yuri-sakharov) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2179) | ||
## v1.1.0 / 2017-11-28 | ||
* added; more props are passed to the Option component: `focusOption`, `inputValue`, `selectValue`, `removeValue` | ||
* added; the `inputValue` is passed as the third argument to the `optionRenderer` | ||
* fixed; issues opening the menu correctly for multiselect when `autosize={false}` | ||
* fixed; removed `event.stopPropagation()` from Select's `clearValue` and `onClick` handlers, thanks [Thomas Burke](https://github.com/etburke) | ||
* fixed; `handleMouseDownOnArrow` when `openOnClick={false}`, thanks [elias ghali](https://github.com/elghali) | ||
* fixed; conditional scrolling into view of focused option, thanks [Michael Lewis](https://github.com/mtlewis) | ||
* added; more props are passed to the Option component: `focusOption`, | ||
`inputValue`, `selectValue`, `removeValue` | ||
* added; the `inputValue` is passed as the third argument to the | ||
`optionRenderer` | ||
* fixed; issues opening the menu correctly for multiselect when | ||
`autosize={false}` | ||
* fixed; removed `event.stopPropagation()` from Select's `clearValue` and | ||
`onClick` handlers, thanks [Thomas Burke](https://github.com/etburke) | ||
* fixed; `handleMouseDownOnArrow` when `openOnClick={false}`, thanks | ||
[elias ghali](https://github.com/elghali) | ||
* fixed; conditional scrolling into view of focused option, thanks | ||
[Michael Lewis](https://github.com/mtlewis) | ||
@@ -18,50 +94,143 @@ ## v1.0.1 / 2017-11-24 | ||
* reverted spacebar-selects-option behaviour for searchable selects, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2163) | ||
* fixed behaviour where async doesn't handle onInputChange returning a value, thanks [Anton](https://github.com/tehbi4) - [see PR](https://github.com/JedWatson/react-select/pull/2133) | ||
* fixed Creatable bug where the first enter keypress is ignored when `promptTextCreator` returns only the label, thanks [George Karagkiaouris](https://github.com/karaggeorge) - [see PR](https://github.com/JedWatson/react-select/pull/2140) | ||
* Utility functions are now exported from the es6 build, thanks [Deiru](https://github.com/Deiru2k) - [see PR](https://github.com/JedWatson/react-select/pull/2154) | ||
* Update aria-only class to have absolute positioning, thanks [Jacob Hilker](https://github.com/JHilker) - [see PR](https://github.com/JedWatson/react-select/pull/1243) | ||
* gives possibility to use ref property for Creatable, thanks [blacktemplar](https://github.com/blacktemplar) - [see PR](https://github.com/JedWatson/react-select/pull/1646) | ||
* Adds lint and test pre-commit hooks, thanks [carymcpoland](https://github.com/mcpolandc) - [see PR](https://github.com/JedWatson/react-select/pull/2077) | ||
* Disable some browser-specific behaviours that break the input, thanks [Jed Watson](https://github.com/JedWatson) - [see PR](https://github.com/JedWatson/react-select/pull/2101) | ||
* onOpen: run after dom has rendered, thanks [Karl-Aksel Puulmann](https://github.com/macobo) - [see PR](https://github.com/JedWatson/react-select/pull/#1756) | ||
* fix not clearing when given invalid values, from #1756, thanks [Mário][https://github.com/ticklemynausea] - [see PR](https://github.com/JedWatson/react-select/pull/2100) | ||
* Exports Option Component, thanks [Erkelens, Jan Paul](https://github.com/jperkelens) - [see PR](https://github.com/JedWatson/react-select/pull/2097) | ||
* Fix/numeric multi select, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2086) | ||
* removeSelected prop (round 2), for optionally keeping selected values in dropdown, thanks [Jed Watson](https://github.com/banderson) - [see PR](https://github.com/JedWatson/react-select/pull/1891) | ||
* pass removeValue() and always pass valueArray, thanks [kcliu](https://github.com/kcliu) - [see PR](https://github.com/JedWatson/react-select/pull/1850) | ||
* Accessibility Enhancements - Aria tags, Space/Enter keys, thanks [sushmabadam](https://github.com/sushmabadam) - [see PR](https://github.com/JedWatson/react-select/pull/1428) | ||
* added rtl support, thanks [Dekel](https://github.com/dekelb) - [see PR](https://github.com/JedWatson/react-select/pull/1613) | ||
* Add inputValue to menuRenderer, thanks [headcanon](https://github.com/chronick) - [see PR](https://github.com/JedWatson/react-select/pull/1732) | ||
* fix typo in handleKeyDown method, thanks [jasonchangxo](https://github.com/jasonchangxo) - [see PR](https://github.com/JedWatson/react-select/pull/2088) | ||
* Fix/numeric multi select, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2086) | ||
* expose children in AsyncCreatable.js, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2084) | ||
* replace trim fn loop with regex, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2085) | ||
* Trim search text from beginning and the end. (fixes #1861), thanks [Serkan Ozer](https://github.com/serkanozer) - [see PR](https://github.com/JedWatson/react-select/pull/1862) | ||
* Add variable for focused input background, thanks [Aron Strandberg](https://github.com/aronstrandberg) - [see PR](https://github.com/JedWatson/react-select/pull/1998) | ||
* Added id in the input select, thanks [thecreazy](https://github.com/thecreazy) - [see PR](https://github.com/JedWatson/react-select/pull/2027) | ||
* adding a nvmrc file and adding coverage to eslintignore, thanks [Dave Birch](https://github.com/uxtx) - [see PR](https://github.com/JedWatson/react-select/pull/1137) | ||
* Updated the comment for the deleteRemoves option., thanks [Abul Dider](https://github.com/dider7) - [see PR](https://github.com/JedWatson/react-select/pull/2078) | ||
* implemented optional rendering of arrow, thanks [rolandjohann](https://github.com/rolandjohann) - [see PR](https://github.com/JedWatson/react-select/pull/1761) | ||
* Skip rendering arrow wrapper when custom arrow renderer returns falsy value, thanks [Mike Lewis](https://github.com/mtlewis) - [see PR](https://github.com/JedWatson/react-select/pull/2055) | ||
* do not show clear button if value is an empty string, thanks [Marie Godon](https://github.com/mariegodon) - [see PR](https://github.com/JedWatson/react-select/pull/2074) | ||
* Set isLoading to false if cache hit, thanks [timhwang21](https://github.com/timhwang21) - [see PR](https://github.com/JedWatson/react-select/pull/2042) | ||
* Add aria-labels to Options, thanks [jasonchangxo](https://github.com/jasonchangxo) - [see PR](https://github.com/JedWatson/react-select/pull/2036) | ||
* Adds source links to each example, thanks [Damon Bauer](https://github.com/damonbauer) - [see PR](https://github.com/JedWatson/react-select/pull/2051) | ||
* Issue #2056: onInputChange should return modified value, thanks [Caleb Scholze](https://github.com/cscholze) - [see PR](https://github.com/JedWatson/react-select/pull/2057) | ||
* Remove option `addLabelText` from README and propTypes, thanks [Jannes Jeising](https://github.com/jjeising) - [see PR](https://github.com/JedWatson/react-select/pull/2040) | ||
* GitHub has a capital H, thanks [David Baumgold](https://github.com/singingwolfboy) - [see PR](https://github.com/JedWatson/react-select/pull/2053) | ||
* refactor componentWillUnmount(), thanks [riophae](https://github.com/riophae) - [see PR](https://github.com/JedWatson/react-select/pull/2064) | ||
* Slim down NPM package, thanks [Valentin Agachi](https://github.com/avaly) - [see PR](https://github.com/JedWatson/react-select/pull/2062) | ||
* Update contributing doc, thanks [Gregg Brewster](https://github.com/greggb) - [see PR](https://github.com/JedWatson/react-select/pull/2059) | ||
* strip proptypes in production build (fixes #1882), thanks [Jochen Berger](https://github.com/jochenberger) - [see PR](https://github.com/JedWatson/react-select/pull/2003) | ||
* Support Webpack 2, Webpack 3, rollup., thanks [Matthew Schnee](https://github.com/mschnee) - [see PR](https://github.com/JedWatson/react-select/pull/2020) | ||
* Add missing semicolon, thanks [jochenberger](https://github.com/jochenberger) - [see PR](https://github.com/JedWatson/react-select/pull/2018) | ||
* autofocus --> autoFocus, thanks [Charles Lee](https://github.com/gwyneplaine) - [see PR](https://github.com/JedWatson/react-select/pull/2002) | ||
* Async> cache async response regardless of req order, thanks [Timothy Hwang](https://github.com/timhwang21) - [see PR](https://github.com/JedWatson/react-select/pull/2012) | ||
* Make this work in preact., thanks [liaoxuezhi](https://github.com/2betop) - [see PR](https://github.com/JedWatson/react-select/pull/2013) | ||
* Correct release candidate version on README, thanks [Damon Aw](https://github.com/daemonsy) - [see PR](https://github.com/JedWatson/react-select/pull/2017) | ||
* Fix test name, thanks [jochenberger](https://github.com/jochenberger) - [see PR](https://github.com/JedWatson/react-select/pull/2005) | ||
* Fixing css states to be scoped with Select selector, closes #1951., thanks [Adam Girton](https://github.com/agirton) - [see PR](https://github.com/JedWatson/react-select/pull/2000) | ||
* fix typo, thanks [jochenberger](https://github.com/jochenberger) - [see PR](https://github.com/JedWatson/react-select/pull/1999) | ||
* breaking; removed `getInputValue` function - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2108) | ||
* reverted spacebar-selects-option behaviour for searchable selects, thanks | ||
[Charles Lee](https://github.com/gwyneplaine) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2163) | ||
* fixed behaviour where async doesn't handle onInputChange returning a value, | ||
thanks [Anton](https://github.com/tehbi4) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2133) | ||
* fixed Creatable bug where the first enter keypress is ignored when | ||
`promptTextCreator` returns only the label, thanks | ||
[George Karagkiaouris](https://github.com/karaggeorge) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2140) | ||
* Utility functions are now exported from the es6 build, thanks | ||
[Deiru](https://github.com/Deiru2k) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2154) | ||
* Update aria-only class to have absolute positioning, thanks | ||
[Jacob Hilker](https://github.com/JHilker) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1243) | ||
* gives possibility to use ref property for Creatable, thanks | ||
[blacktemplar](https://github.com/blacktemplar) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1646) | ||
* Adds lint and test pre-commit hooks, thanks | ||
[carymcpoland](https://github.com/mcpolandc) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2077) | ||
* Disable some browser-specific behaviours that break the input, thanks | ||
[Jed Watson](https://github.com/JedWatson) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2101) | ||
* onOpen: run after dom has rendered, thanks | ||
[Karl-Aksel Puulmann](https://github.com/macobo) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/#1756) | ||
* fix not clearing when given invalid values, from #1756, thanks | ||
[Mário][https://github.com/ticklemynausea] - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2100) | ||
* Exports Option Component, thanks | ||
[Erkelens, Jan Paul](https://github.com/jperkelens) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2097) | ||
* Fix/numeric multi select, thanks | ||
[Charles Lee](https://github.com/gwyneplaine) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2086) | ||
* removeSelected prop (round 2), for optionally keeping selected values in | ||
dropdown, thanks [Jed Watson](https://github.com/banderson) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1891) | ||
* pass removeValue() and always pass valueArray, thanks | ||
[kcliu](https://github.com/kcliu) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1850) | ||
* Accessibility Enhancements - Aria tags, Space/Enter keys, thanks | ||
[sushmabadam](https://github.com/sushmabadam) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1428) | ||
* added rtl support, thanks [Dekel](https://github.com/dekelb) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1613) | ||
* Add inputValue to menuRenderer, thanks | ||
[headcanon](https://github.com/chronick) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1732) | ||
* fix typo in handleKeyDown method, thanks | ||
[jasonchangxo](https://github.com/jasonchangxo) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2088) | ||
* Fix/numeric multi select, thanks | ||
[Charles Lee](https://github.com/gwyneplaine) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2086) | ||
* expose children in AsyncCreatable.js, thanks | ||
[Charles Lee](https://github.com/gwyneplaine) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2084) | ||
* replace trim fn loop with regex, thanks | ||
[Charles Lee](https://github.com/gwyneplaine) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2085) | ||
* Trim search text from beginning and the end. (fixes #1861), thanks | ||
[Serkan Ozer](https://github.com/serkanozer) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1862) | ||
* Add variable for focused input background, thanks | ||
[Aron Strandberg](https://github.com/aronstrandberg) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1998) | ||
* Added id in the input select, thanks | ||
[thecreazy](https://github.com/thecreazy) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2027) | ||
* adding a nvmrc file and adding coverage to eslintignore, thanks | ||
[Dave Birch](https://github.com/uxtx) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1137) | ||
* Updated the comment for the deleteRemoves option., thanks | ||
[Abul Dider](https://github.com/dider7) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2078) | ||
* implemented optional rendering of arrow, thanks | ||
[rolandjohann](https://github.com/rolandjohann) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1761) | ||
* Skip rendering arrow wrapper when custom arrow renderer returns falsy value, | ||
thanks [Mike Lewis](https://github.com/mtlewis) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2055) | ||
* do not show clear button if value is an empty string, thanks | ||
[Marie Godon](https://github.com/mariegodon) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2074) | ||
* Set isLoading to false if cache hit, thanks | ||
[timhwang21](https://github.com/timhwang21) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2042) | ||
* Add aria-labels to Options, thanks | ||
[jasonchangxo](https://github.com/jasonchangxo) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2036) | ||
* Adds source links to each example, thanks | ||
[Damon Bauer](https://github.com/damonbauer) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2051) | ||
* Issue #2056: onInputChange should return modified value, thanks | ||
[Caleb Scholze](https://github.com/cscholze) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2057) | ||
* Remove option `addLabelText` from README and propTypes, thanks | ||
[Jannes Jeising](https://github.com/jjeising) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2040) | ||
* GitHub has a capital H, thanks | ||
[David Baumgold](https://github.com/singingwolfboy) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2053) | ||
* refactor componentWillUnmount(), thanks | ||
[riophae](https://github.com/riophae) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2064) | ||
* Slim down NPM package, thanks [Valentin Agachi](https://github.com/avaly) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2062) | ||
* Update contributing doc, thanks [Gregg Brewster](https://github.com/greggb) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2059) | ||
* strip proptypes in production build (fixes #1882), thanks | ||
[Jochen Berger](https://github.com/jochenberger) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2003) | ||
* Support Webpack 2, Webpack 3, rollup., thanks | ||
[Matthew Schnee](https://github.com/mschnee) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2020) | ||
* Add missing semicolon, thanks | ||
[jochenberger](https://github.com/jochenberger) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2018) | ||
* autofocus --> autoFocus, thanks | ||
[Charles Lee](https://github.com/gwyneplaine) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2002) | ||
* Async> cache async response regardless of req order, thanks | ||
[Timothy Hwang](https://github.com/timhwang21) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2012) | ||
* Make this work in preact., thanks [liaoxuezhi](https://github.com/2betop) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2013) | ||
* Correct release candidate version on README, thanks | ||
[Damon Aw](https://github.com/daemonsy) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2017) | ||
* Fix test name, thanks [jochenberger](https://github.com/jochenberger) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2005) | ||
* Fixing css states to be scoped with Select selector, closes #1951., thanks | ||
[Adam Girton](https://github.com/agirton) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/2000) | ||
* fix typo, thanks [jochenberger](https://github.com/jochenberger) - | ||
[see PR](https://github.com/JedWatson/react-select/pull/1999) | ||
@@ -74,28 +243,47 @@ ## v1.0.0-rc.10.patch1 / 2017-11-03 | ||
* changed; `openAfterFocus` prop has been renamed to `openOnClick`, and now defaults to `true` | ||
* fixed; React.PropTypes deprecation warning, thanks [Jeremy Liberman](https://github.com/MrLeebo) | ||
* improved; scrolling behaviour when navigating the menu with the keyboard, thanks [boatkorachal](https://github.com/boatkorachal) | ||
* fixed; error with the `Async` cache when you type `"hasOwnProperty"`, thanks [SuhushinAS](https://github.com/SuhushinAS) | ||
* changed; `openAfterFocus` prop has been renamed to `openOnClick`, and now | ||
defaults to `true` | ||
* fixed; React.PropTypes deprecation warning, thanks | ||
[Jeremy Liberman](https://github.com/MrLeebo) | ||
* improved; scrolling behaviour when navigating the menu with the keyboard, | ||
thanks [boatkorachal](https://github.com/boatkorachal) | ||
* fixed; error with the `Async` cache when you type `"hasOwnProperty"`, thanks | ||
[SuhushinAS](https://github.com/SuhushinAS) | ||
## v1.0.0-rc.9 / 2017-09-13 | ||
* fixed; clearable padding style, thanks [Minori Miyauchi](https://github.com/mmiyauchi) | ||
* fixed; clearable padding style, thanks | ||
[Minori Miyauchi](https://github.com/mmiyauchi) | ||
* fixed; removed use of `Object.assign`, fixes IE compatibility | ||
* added; new `closeOnSelect` prop (defaults to `true`) that controls whether the menu is closed when an option is selected, thanks to [Michael Elgar](https://github.com/melgar) for the original idea | ||
* changed; by default, the menu for multi-selects now closes when an option is selected | ||
* changed; `Async` component no longer always clears options when one is selected (although the menu is now closed by default). Use `closeOnSelect={false} onSelectResetsInput={false}` to leave the menu open. | ||
* added; new `closeOnSelect` prop (defaults to `true`) that controls whether the | ||
menu is closed when an option is selected, thanks to | ||
[Michael Elgar](https://github.com/melgar) for the original idea | ||
* changed; by default, the menu for multi-selects now closes when an option is | ||
selected | ||
* changed; `Async` component no longer always clears options when one is | ||
selected (although the menu is now closed by default). Use | ||
`closeOnSelect={false} onSelectResetsInput={false}` to leave the menu open. | ||
* fixed; `Async` component always called `onChange` even when it wasn't provided | ||
* fixed; input lag for the `Async` component when results are returned from cache | ||
* fixed; input lag for the `Async` component when results are returned from | ||
cache | ||
* fixed; required was not being updated without an onChange handler | ||
* fixed; peer dependencies for `prop-types`, thanks [Michaël De Boey](https://github.com/MichaelDeBoey) | ||
* fixed; internal optimisations, thanks [Kieran Boyle](https://github.com/dysfunc) | ||
* added; `Value` component is now exported, thanks [Prof Gra](https://github.com/Grahack) | ||
* fixed; callback fired after `Async` component unmounts, thanks [Andrew Russell](https://github.com/DeadHeadRussell) | ||
* fixed; wrapping on Firefox in SCSS files, thanks [Michael Williamson](https://github.com/mwilliamson) | ||
* fixed; peer dependencies for `prop-types`, thanks | ||
[Michaël De Boey](https://github.com/MichaelDeBoey) | ||
* fixed; internal optimisations, thanks | ||
[Kieran Boyle](https://github.com/dysfunc) | ||
* added; `Value` component is now exported, thanks | ||
[Prof Gra](https://github.com/Grahack) | ||
* fixed; callback fired after `Async` component unmounts, thanks | ||
[Andrew Russell](https://github.com/DeadHeadRussell) | ||
* fixed; wrapping on Firefox in SCSS files, thanks | ||
[Michael Williamson](https://github.com/mwilliamson) | ||
## v1.0.0-rc.8 / 2017-09-12 | ||
* fixed; `onMenuScrollToBottom` does not work in chrome 58.0, thanks [Simon Hartcher](https://github.com/deevus) | ||
* fixed; `onMenuScrollToBottom` does not work in chrome 58.0, thanks | ||
[Simon Hartcher](https://github.com/deevus) | ||
* fixed; missing es6 module build for `js:next` entrypoint | ||
* updated; `react-input-autosize@2.0.0` including several fixes for react-select (see [changes](https://github.com/JedWatson/react-input-autosize/blob/master/HISTORY.md)) | ||
* updated; `react-input-autosize@2.0.0` including several fixes for react-select | ||
(see | ||
[changes](https://github.com/JedWatson/react-input-autosize/blob/master/HISTORY.md)) | ||
@@ -108,34 +296,61 @@ ## v1.0.0-rc.7 / 2017-09-11 | ||
* fixed; changing `required` prop from `true` to `false` now works as expected, thanks [George Karagkiaouris](https://github.com/karaggeorge) | ||
* added; new prop `onSelectResetsInput` controls whether the input value is cleared when options are selected, thanks [David Roeca](https://github.com/davidroeca) and [Alexander Nosov](https://github.com/nosovsh) | ||
* fixed; tabindex parent bug fix for Edge, thanks [George Payne](https://github.com/George-A-Payne) | ||
* fixed; update selectize link in README.md, thanks [kerumen](https://github.com/kerumen) | ||
* fixed; changing `required` prop from `true` to `false` now works as expected, | ||
thanks [George Karagkiaouris](https://github.com/karaggeorge) | ||
* added; new prop `onSelectResetsInput` controls whether the input value is | ||
cleared when options are selected, thanks | ||
[David Roeca](https://github.com/davidroeca) and | ||
[Alexander Nosov](https://github.com/nosovsh) | ||
* fixed; tabindex parent bug fix for Edge, thanks | ||
[George Payne](https://github.com/George-A-Payne) | ||
* fixed; update selectize link in README.md, thanks | ||
[kerumen](https://github.com/kerumen) | ||
* added; standard issue template, thanks [agirton](https://github.com/agirton) | ||
* added; new build process using rollup and webpack. Removed grunt. thanks [gwyneplaine](https://github.com/gwyneplaine) | ||
* fixed; updated contributor docs with the correct node version reference [gwyneplaine](https://github.com/gwyneplaine) | ||
* fixed; missing method binds in Option, thanks [agirton](https://github.com/agirton) | ||
* fixed; converted components to use es6 classes, thanks [jochenberger](https://github.com/jochenberger) | ||
* fixed; console.log example in usage docs, thanks [rohmanhm](https://github.com/rohmanhm) | ||
* fixed; hide create option after closing menu, thanks [andreme](https://github.com/andreme) | ||
* added; new build process using rollup and webpack. Removed grunt. thanks | ||
[gwyneplaine](https://github.com/gwyneplaine) | ||
* fixed; updated contributor docs with the correct node version reference | ||
[gwyneplaine](https://github.com/gwyneplaine) | ||
* fixed; missing method binds in Option, thanks | ||
[agirton](https://github.com/agirton) | ||
* fixed; converted components to use es6 classes, thanks | ||
[jochenberger](https://github.com/jochenberger) | ||
* fixed; console.log example in usage docs, thanks | ||
[rohmanhm](https://github.com/rohmanhm) | ||
* fixed; hide create option after closing menu, thanks | ||
[andreme](https://github.com/andreme) | ||
* fixed; remove circular reference, thanks [agirton](https://github.com/agirton) | ||
* fixed; readme typo, thanks [ieldanr](https:/github.com/ieldanr) | ||
* fixed; add missing function binds in Option component, thanks [agirton](https://github.com/agirton) and [blacktemplar](https://github.com/blacktemplar) | ||
* fixed; re-added fix to [#1580](https://github.com/JedWatson/react-select/issues/1580), thanks [agirton](https://github.com/agirton) | ||
* fixed; avoid mutating user inputs when ignoring case/accents, thanks [not-an-aardvark](https://github.com/not-an-aardvark) | ||
* fixed; issues synchronising options props in `Async`, thanks [cbergmiller](https://github.com/cbergmiller) | ||
* fixed; backspace handling for non-multi select controls, thanks [Jeremy Liberman](https://github.com/MrLeebo) | ||
* fixed; add missing function binds in Option component, thanks | ||
[agirton](https://github.com/agirton) and | ||
[blacktemplar](https://github.com/blacktemplar) | ||
* fixed; re-added fix to | ||
[#1580](https://github.com/JedWatson/react-select/issues/1580), thanks | ||
[agirton](https://github.com/agirton) | ||
* fixed; avoid mutating user inputs when ignoring case/accents, thanks | ||
[not-an-aardvark](https://github.com/not-an-aardvark) | ||
* fixed; issues synchronising options props in `Async`, thanks | ||
[cbergmiller](https://github.com/cbergmiller) | ||
* fixed; backspace handling for non-multi select controls, thanks | ||
[Jeremy Liberman](https://github.com/MrLeebo) | ||
## v1.0.0-rc.5 / 2017-05-25 | ||
* fixed; Allow `falsey` values to be clearable, thanks [Simon Gaestel](https://github.com/sgaestel) | ||
* fixed; issue where Firefox would crash due to incorrect use of `aria-owns` attribute, thanks [Max Hubenthal](https://github.com/mhubenthal) | ||
* fixed; regression where options not using the value key couldn't be focused, thanks [Benjamin Piouffle](https://github.com/Betree) | ||
* fixed; Allow `falsey` values to be clearable, thanks | ||
[Simon Gaestel](https://github.com/sgaestel) | ||
* fixed; issue where Firefox would crash due to incorrect use of `aria-owns` | ||
attribute, thanks [Max Hubenthal](https://github.com/mhubenthal) | ||
* fixed; regression where options not using the value key couldn't be focused, | ||
thanks [Benjamin Piouffle](https://github.com/Betree) | ||
## v1.0.0-rc.4 / 2017-05-14 | ||
* fixed; no more warning when using React 15.5, thanks [Adam Girton](https://github.com/agirton) | ||
* fixed; issue comparing objects in `getFocusableOptionIndex`, thanks [rndm2](https://github.com/rndm2) | ||
* fixed; missing .focus() method in `Creatable`, thanks [Anton Alexandrenok](https://github.com/the-spyke) | ||
* added; support for `aria-describedby` attribute, thanks [Eric Lee](https://github.com/ericj17) | ||
* added; `.is-clearable` className when clearable is true, thanks [Dan Diaz](https://github.com/dan-diaz) | ||
* fixed; no more warning when using React 15.5, thanks | ||
[Adam Girton](https://github.com/agirton) | ||
* fixed; issue comparing objects in `getFocusableOptionIndex`, thanks | ||
[rndm2](https://github.com/rndm2) | ||
* fixed; missing .focus() method in `Creatable`, thanks | ||
[Anton Alexandrenok](https://github.com/the-spyke) | ||
* added; support for `aria-describedby` attribute, thanks | ||
[Eric Lee](https://github.com/ericj17) | ||
* added; `.is-clearable` className when clearable is true, thanks | ||
[Dan Diaz](https://github.com/dan-diaz) | ||
@@ -145,47 +360,90 @@ ## v1.0.0-rc.3 / 2017-02-01 | ||
* added; `arrowRenderer` prop, thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* added; child-function support to `Async` and `Creatable` components so that they can compose each other (or future HOCs), thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* added; `asyncCreatable` HOC that combines `Async` and `Creatable` so they can be used together, thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* added; undocumented arguments for `menuRenderer`, thanks [Julian Krispel-Samsel](https://github.com/juliankrispel) | ||
* fixed; Do not focus and open menu when disabled, thanks [nhducit](https://github.com/nhducit) | ||
* fixed; Scrolling with arrow-keys is not working correctly, thanks [Damian Pieczynski](https://github.com/piecyk) | ||
* added; "select all text" functionality `Shift+Home|Del`, thanks [Damian Pieczynski](https://github.com/piecyk) | ||
* added; support for `boolean` values, thanks [Aaron Hardy](https://github.com/Aaronius) | ||
* fixed; Remove duplicated `promptTextCreator` field from readme, thanks [Jih-Chi Lee](https://github.com/jihchi) | ||
* fixed; Adding back ref that was removed in rc2, thanks [Martin Jujou](https://github.com/jooj123) | ||
* fixed; `Creatable` component doesn't allow input key down handling, thanks [Ivan Leonenko](https://github.com/IvanLeonenko) | ||
* added; Allow react nodes to be passed as loadingPlaceholder, thanks [Daniel Heath](https://github.com/DanielHeath) | ||
* fixed; IE8 compatibility issues, thanks [Kirill Mesnyankin](https://github.com/strayiker) | ||
* improved; Allow users to specify noResultsText, thanks [Daniel Heath](https://github.com/DanielHeath) | ||
* added; Only remove options if a loading placeholder is available, thanks [Daniel Heath](https://github.com/DanielHeath) | ||
* fixed; firefox display items in two rows due to reflow, thanks [Daniel Heath](https://github.com/DanielHeath) | ||
* added; child-function support to `Async` and `Creatable` components so that | ||
they can compose each other (or future HOCs), thanks | ||
[Brian Vaughn](https://github.com/bvaughn) | ||
* added; `asyncCreatable` HOC that combines `Async` and `Creatable` so they can | ||
be used together, thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* added; undocumented arguments for `menuRenderer`, thanks | ||
[Julian Krispel-Samsel](https://github.com/juliankrispel) | ||
* fixed; Do not focus and open menu when disabled, thanks | ||
[nhducit](https://github.com/nhducit) | ||
* fixed; Scrolling with arrow-keys is not working correctly, thanks | ||
[Damian Pieczynski](https://github.com/piecyk) | ||
* added; "select all text" functionality `Shift+Home|Del`, thanks | ||
[Damian Pieczynski](https://github.com/piecyk) | ||
* added; support for `boolean` values, thanks | ||
[Aaron Hardy](https://github.com/Aaronius) | ||
* fixed; Remove duplicated `promptTextCreator` field from readme, thanks | ||
[Jih-Chi Lee](https://github.com/jihchi) | ||
* fixed; Adding back ref that was removed in rc2, thanks | ||
[Martin Jujou](https://github.com/jooj123) | ||
* fixed; `Creatable` component doesn't allow input key down handling, thanks | ||
[Ivan Leonenko](https://github.com/IvanLeonenko) | ||
* added; Allow react nodes to be passed as loadingPlaceholder, thanks | ||
[Daniel Heath](https://github.com/DanielHeath) | ||
* fixed; IE8 compatibility issues, thanks | ||
[Kirill Mesnyankin](https://github.com/strayiker) | ||
* improved; Allow users to specify noResultsText, thanks | ||
[Daniel Heath](https://github.com/DanielHeath) | ||
* added; Only remove options if a loading placeholder is available, thanks | ||
[Daniel Heath](https://github.com/DanielHeath) | ||
* fixed; firefox display items in two rows due to reflow, thanks | ||
[Daniel Heath](https://github.com/DanielHeath) | ||
* fixed; `Creatable` readme typo, thanks [Ben](https://github.com/rockingskier) | ||
* fixed; explain way to implement `allowCreate` functionality with `Creatable` to readme, thanks [mayerwin](https://github.com/mayerwin) | ||
* added; delete key removes an item when there is no input, thanks [forum-is](https://github.com/forum-is) | ||
* added; `onNewOptionClick` handler for `Creatable`, thanks [Lee Siong Chan](https://github.com/leesiongchan) | ||
* fixed; `onInputChange` consistent for `Creatable`, thanks [Lee Siong Chan](https://github.com/leesiongchan) | ||
* fixed; `menuRenderer` is treated consistently between `Creatable` and `Select`, thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* fixed; `asyncCreatable` options parsing will not parse undefined values into props, thanks [Romain Dardour](https://github.com/unity) | ||
* added; pass `inputProps` to `inputRenderer`, thanks [Alec Winograd](https://github.com/awinograd) | ||
* fixed; no exception when clearing an Async field that is not set to multi, thanks [Patrik Stutz](https://github.com/VanCoding) | ||
* added; allow rendering a custom clear component, thanks [Conor Hastings](https://github.com/conorhastings) | ||
* fixed; document `ignoreAccents`, thanks [Domenico Matteo](https://github.com/dmatteo) | ||
* fixed; arrowing up or down in `Select` with 0 options does not throw type error, thanks [Alex Howard](https://github.com/thezanke) | ||
* fixed; `Creatable` handles null children prop, thanks [Jack Coulter](https://github.com/jscinoz) | ||
* added; provide `isOpen` to arrowRenderer, thanks [Kuan](https://github.com/khankuan) | ||
* fixed; re-added the `focus()` method on `Select.Async`, thanks, [Maarten Claes](https://github.com/mcls) | ||
* fixed; focus the next available option after a selection, not the top option, thanks [Nicolas Raynaud](https://github.com/nraynaud) | ||
* fixed; explain way to implement `allowCreate` functionality with `Creatable` | ||
to readme, thanks [mayerwin](https://github.com/mayerwin) | ||
* added; delete key removes an item when there is no input, thanks | ||
[forum-is](https://github.com/forum-is) | ||
* added; `onNewOptionClick` handler for `Creatable`, thanks | ||
[Lee Siong Chan](https://github.com/leesiongchan) | ||
* fixed; `onInputChange` consistent for `Creatable`, thanks | ||
[Lee Siong Chan](https://github.com/leesiongchan) | ||
* fixed; `menuRenderer` is treated consistently between `Creatable` and | ||
`Select`, thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* fixed; `asyncCreatable` options parsing will not parse undefined values into | ||
props, thanks [Romain Dardour](https://github.com/unity) | ||
* added; pass `inputProps` to `inputRenderer`, thanks | ||
[Alec Winograd](https://github.com/awinograd) | ||
* fixed; no exception when clearing an Async field that is not set to multi, | ||
thanks [Patrik Stutz](https://github.com/VanCoding) | ||
* added; allow rendering a custom clear component, thanks | ||
[Conor Hastings](https://github.com/conorhastings) | ||
* fixed; document `ignoreAccents`, thanks | ||
[Domenico Matteo](https://github.com/dmatteo) | ||
* fixed; arrowing up or down in `Select` with 0 options does not throw type | ||
error, thanks [Alex Howard](https://github.com/thezanke) | ||
* fixed; `Creatable` handles null children prop, thanks | ||
[Jack Coulter](https://github.com/jscinoz) | ||
* added; provide `isOpen` to arrowRenderer, thanks | ||
[Kuan](https://github.com/khankuan) | ||
* fixed; re-added the `focus()` method on `Select.Async`, thanks, | ||
[Maarten Claes](https://github.com/mcls) | ||
* fixed; focus the next available option after a selection, not the top option, | ||
thanks [Nicolas Raynaud](https://github.com/nraynaud) | ||
Note there has also been a breaking change to the props for the `Async` component: both `minimumInput` and `searchingText` have been removed. See #1226 for more details. Apologies for doing this in an RC release, but we had to trade off between resolving some important bugs and breaking the API, and figured it was better to do this before declaring 1.0.0 stable. | ||
Note there has also been a breaking change to the props for the `Async` | ||
component: both `minimumInput` and `searchingText` have been removed. See #1226 | ||
for more details. Apologies for doing this in an RC release, but we had to trade | ||
off between resolving some important bugs and breaking the API, and figured it | ||
was better to do this before declaring 1.0.0 stable. | ||
## v1.0.0-rc.1 / 2016-09-04 | ||
* fixed; reset value to `[]` when `multi=true`, thanks [Michael Williamson](https://github.com/mwilliamson) | ||
* added; pass index to `renderLabel` method, thanks [nhducit](https://github.com/nhducit) | ||
* fixed; reset value to `[]` when `multi=true`, thanks | ||
[Michael Williamson](https://github.com/mwilliamson) | ||
* added; pass index to `renderLabel` method, thanks | ||
[nhducit](https://github.com/nhducit) | ||
* fixed; uncontrolled to controlled component warning in React 15.3 | ||
* fixed; props cleanup, thanks [Forbes Lindesay](https://github.com/ForbesLindesay) | ||
* fixed; issue where a value of the number `0` would be assumed to be no value, thanks [Hanwen Cheng](https://github.com/hanwencheng) | ||
* fixed; internal refs converted to callbacks instead of strings, thanks [Johnny Nguyen](https://github.com/gojohnnygo) | ||
* added; optional `instanceId` prop for server-side rendering, thanks [Jevin Anderson](https://github.com/JevinAnderson) | ||
* added; `onCloseResetsInput` prop, thanks [Frankie](https://github.com/frankievx) | ||
* added; `Creatable` component, replaces pre-1.0 `allowCreate` prop, thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* fixed; props cleanup, thanks | ||
[Forbes Lindesay](https://github.com/ForbesLindesay) | ||
* fixed; issue where a value of the number `0` would be assumed to be no value, | ||
thanks [Hanwen Cheng](https://github.com/hanwencheng) | ||
* fixed; internal refs converted to callbacks instead of strings, thanks | ||
[Johnny Nguyen](https://github.com/gojohnnygo) | ||
* added; optional `instanceId` prop for server-side rendering, thanks | ||
[Jevin Anderson](https://github.com/JevinAnderson) | ||
* added; `onCloseResetsInput` prop, thanks | ||
[Frankie](https://github.com/frankievx) | ||
* added; `Creatable` component, replaces pre-1.0 `allowCreate` prop, thanks | ||
[Brian Vaughn](https://github.com/bvaughn) | ||
@@ -199,23 +457,45 @@ ## v1.0.0-beta14.patch1 / 2016-07-25 | ||
* fixed; `react-input-autosize` has been udpated to `1.1.0`, which includes fixes for the new warnings that React 15.2 logs | ||
* fixed; "Unknown prop `inputClassName` on <div> tag" warning, thanks [Max Stoiber](https://github.com/mxstbr) | ||
* fixed; Removed unnecessary `onUnfocus`, thanks [Johnny Nguyen](https://github.com/gojohnnygo) | ||
* added; Support for react components in `searchPromptText`, thanks [Matt](https://github.com/hellaeon) | ||
* fixed; focus bug on iOS, thanks [Tony deCatanzaro](https://github.com/tonydecat) | ||
* fixed; Async bugs with Promises, thanks [Vladimir](https://github.com/VladimirPal) and [Ian Firkin](https://github.com/lobsteropteryx) | ||
* fixed; `searchingText` bug, thanks [Tony deCatanzaro](https://github.com/tonydecat) | ||
* improved; More antive-like input behaviour, thanks [Johnny Nguyen](https://github.com/gojohnnygo) | ||
* fixed; Added missing unit (px) to `minWidth` attribute, thanks [Ian Witherow](https://github.com/ianwitherow) | ||
* added; Support for assistive technologies, thanks [Dave Brotherstone](https://github.com/bruderstein) | ||
* fixed; React error if `onChange` callback causes a root component to unmount, thanks [Nathan Norton](https://github.com/Xesued) | ||
* fixed; Open menu is now closed if `disabled` becomes true, thanks [Jason Moon](https://github.com/jsnmoon) | ||
* fixed; Prevent `getFocusableOptionIndex` from returning a disabled option, thanks [Brian Powers](https://github.com/brianspowers) | ||
* added; Home, End, Page Up/Down support, thanks [Jason Kadrmas](https://github.com/blackjk3) | ||
* fixed; Don't render `backspaceToRemoveMessage` if `backspaceRemoves` is set to false, thanks [Ryan Zec](https://github.com/ryanzec) | ||
* fixed; Issue with an outline appearing on the auto sized input, thanks [Ryan Zec](https://github.com/ryanzec) | ||
* fixed; Events don't propagate when `esc` is pressed, thanks [Yoshihide Jimbo](https://github.com/jmblog) | ||
* fixed; Update `required` prop based on nextProps on update, thanks [Matt Shwery](https://github.com/mshwery) | ||
* fixed; On focus check whether input ref is a real input or an input component, thanks [Peter Brant](https://github.com/pbrant) and [Greg Poole](https://github.com/gpoole) | ||
* fixed; `react-input-autosize` has been udpated to `1.1.0`, which includes | ||
fixes for the new warnings that React 15.2 logs | ||
* fixed; "Unknown prop `inputClassName` on <div> tag" warning, thanks | ||
[Max Stoiber](https://github.com/mxstbr) | ||
* fixed; Removed unnecessary `onUnfocus`, thanks | ||
[Johnny Nguyen](https://github.com/gojohnnygo) | ||
* added; Support for react components in `searchPromptText`, thanks | ||
[Matt](https://github.com/hellaeon) | ||
* fixed; focus bug on iOS, thanks | ||
[Tony deCatanzaro](https://github.com/tonydecat) | ||
* fixed; Async bugs with Promises, thanks | ||
[Vladimir](https://github.com/VladimirPal) and | ||
[Ian Firkin](https://github.com/lobsteropteryx) | ||
* fixed; `searchingText` bug, thanks | ||
[Tony deCatanzaro](https://github.com/tonydecat) | ||
* improved; More antive-like input behaviour, thanks | ||
[Johnny Nguyen](https://github.com/gojohnnygo) | ||
* fixed; Added missing unit (px) to `minWidth` attribute, thanks | ||
[Ian Witherow](https://github.com/ianwitherow) | ||
* added; Support for assistive technologies, thanks | ||
[Dave Brotherstone](https://github.com/bruderstein) | ||
* fixed; React error if `onChange` callback causes a root component to unmount, | ||
thanks [Nathan Norton](https://github.com/Xesued) | ||
* fixed; Open menu is now closed if `disabled` becomes true, thanks | ||
[Jason Moon](https://github.com/jsnmoon) | ||
* fixed; Prevent `getFocusableOptionIndex` from returning a disabled option, | ||
thanks [Brian Powers](https://github.com/brianspowers) | ||
* added; Home, End, Page Up/Down support, thanks | ||
[Jason Kadrmas](https://github.com/blackjk3) | ||
* fixed; Don't render `backspaceToRemoveMessage` if `backspaceRemoves` is set to | ||
false, thanks [Ryan Zec](https://github.com/ryanzec) | ||
* fixed; Issue with an outline appearing on the auto sized input, thanks | ||
[Ryan Zec](https://github.com/ryanzec) | ||
* fixed; Events don't propagate when `esc` is pressed, thanks | ||
[Yoshihide Jimbo](https://github.com/jmblog) | ||
* fixed; Update `required` prop based on nextProps on update, thanks | ||
[Matt Shwery](https://github.com/mshwery) | ||
* fixed; On focus check whether input ref is a real input or an input component, | ||
thanks [Peter Brant](https://github.com/pbrant) and | ||
[Greg Poole](https://github.com/gpoole) | ||
Also a big thanks to [Brian Vaughn](https://github.com/bvaughn) for his help triaging issues for this release! | ||
Also a big thanks to [Brian Vaughn](https://github.com/bvaughn) for his help | ||
triaging issues for this release! | ||
@@ -228,21 +508,37 @@ ## v1.0.0-beta13.patch1 / 2016-06-22 | ||
* added; `inputRenderer` prop, allows you to override the input component, thanks [Sean Burke](https://github.com/leftmostcat) | ||
* added; `openOnFocus` prop, causes the menu to always open when the select control is focused, thanks [HuysentruytRuben](https://github.com/HuysentruytRuben) | ||
* added; `react-virtualised-select` HOC example, thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* added; `tabSelectsValue` prop can be set to false to prevent selection of focused option when tab is pressed, thanks [Byron Anderson](https://github.com/byronanderson) | ||
* added; ability to override `resetValue` when clearing the control, thanks [Alexander Luberg](https://github.com/LubergAlexander) | ||
* added; input can be updated with `onInputChange`, thanks [Brett DeWoody](https://github.com/brettdewoody) | ||
* added; Styles for .is-selected class, thanks [Danny Herran](https://github.com/dherran) | ||
* fixed; `noResultsText` prop type is now `stringOrNode` for Async component, thanks [Michael Groeneman](https://github.com/mgroeneman) | ||
* fixed; `onInputChange` is wrapped by Async component, thanks [Eric O'Connell](https://github.com/drd) | ||
* fixed; `scrollMenuIntoView` behaviour in IE10, thanks [Ivan Jager](https://github.com/aij) | ||
* fixed; isEqualNode replaced with strict equality check, thanks [Alexandre Balhier](https://github.com/abalhier) | ||
* fixed; issue with value object not being passed to `handleRequired`, thanks [Andrew Hite](https://github.com/andyhite) | ||
* fixed; the menu-outer container is no longer rendered when it does not contain anything, thanks [Kuan](https://github.com/khankuan) | ||
* improved; better support for IE8 in styles, thanks [Rockallite Wulf](https://github.com/rockallite) | ||
* fixed; when opening the menu, scroll to the top of the group containing the focused option rather than to the option itself, thanks [mattics](https://github.com/mattics) | ||
* added; `inputRenderer` prop, allows you to override the input component, | ||
thanks [Sean Burke](https://github.com/leftmostcat) | ||
* added; `openOnFocus` prop, causes the menu to always open when the select | ||
control is focused, thanks | ||
[HuysentruytRuben](https://github.com/HuysentruytRuben) | ||
* added; `react-virtualised-select` HOC example, thanks | ||
[Brian Vaughn](https://github.com/bvaughn) | ||
* added; `tabSelectsValue` prop can be set to false to prevent selection of | ||
focused option when tab is pressed, thanks | ||
[Byron Anderson](https://github.com/byronanderson) | ||
* added; ability to override `resetValue` when clearing the control, thanks | ||
[Alexander Luberg](https://github.com/LubergAlexander) | ||
* added; input can be updated with `onInputChange`, thanks | ||
[Brett DeWoody](https://github.com/brettdewoody) | ||
* added; Styles for .is-selected class, thanks | ||
[Danny Herran](https://github.com/dherran) | ||
* fixed; `noResultsText` prop type is now `stringOrNode` for Async component, | ||
thanks [Michael Groeneman](https://github.com/mgroeneman) | ||
* fixed; `onInputChange` is wrapped by Async component, thanks | ||
[Eric O'Connell](https://github.com/drd) | ||
* fixed; `scrollMenuIntoView` behaviour in IE10, thanks | ||
[Ivan Jager](https://github.com/aij) | ||
* fixed; isEqualNode replaced with strict equality check, thanks | ||
[Alexandre Balhier](https://github.com/abalhier) | ||
* fixed; issue with value object not being passed to `handleRequired`, thanks | ||
[Andrew Hite](https://github.com/andyhite) | ||
* fixed; the menu-outer container is no longer rendered when it does not contain | ||
anything, thanks [Kuan](https://github.com/khankuan) | ||
* improved; better support for IE8 in styles, thanks | ||
[Rockallite Wulf](https://github.com/rockallite) | ||
## v1.0.0-beta12 / 2016-04-02 | ||
* added; `menuRenderer` method and example for effeciently rendering thousands of options, thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* added; `menuRenderer` method and example for effeciently rendering thousands | ||
of options, thanks [Brian Vaughn](https://github.com/bvaughn) | ||
* added; `optionClassName` prop, thanks [Max Tyler](https://github.com/iam4x) | ||
@@ -254,5 +550,6 @@ * added; `renderInvalidValues` prop for showing values that do not match options | ||
* updated dependencies to allow use with React 15.x | ||
* fixed; multi=true was breaking with option groups, thanks [Alex Olshansky](https://github.com/clbn) | ||
* changed; multiple selected values are now submitted using multiple inputs, thanks [Trinh Hoang Nhu](https://github.com/james4388) | ||
* added; `joinValues` prop to revert the above change and submit multiple values in a single field with the delimiter | ||
* changed; multiple selected values are now submitted using multiple inputs, | ||
thanks [Trinh Hoang Nhu](https://github.com/james4388) | ||
* added; `joinValues` prop to revert the above change and submit multiple values | ||
in a single field with the delimiter | ||
@@ -266,12 +563,22 @@ ## v1.0.0-beta10 / 2016-02-23 | ||
* **First version of React-Select-Plus fork** | ||
* added; onBlurResetsInput prop, thanks [Sly Bridges](https://github.com/slybridges) | ||
* changed; Enter selects and retains focus, Tab selects and shifts focus, thanks [RDX](https://github.com/rdsubhas) | ||
* fixed; Hide noResultsText when value is falsy, thanks [Fernando Alex Helwanger](https://github.com/fhelwanger) | ||
* added; `required` prop, adds HTML5 required attribute, thanks [Domenico Matteo](https://github.com/dmatteo) | ||
* fixed; Touch drag behaviour, thanks [Pavel Tarnopolsky](https://github.com/Paveltarno) | ||
* added; `onOpen` and `onClose` event props, thanks [Jacob Page](https://github.com/DullReferenceException) | ||
* fixed; Pressing Enter on open Select should stop propagation, thanks [Jeremy Liberman](https://github.com/MrLeebo) | ||
* fixed; Missing handleMouseDownOnMenu, thanks [Jeremy Liberman](https://github.com/MrLeebo) | ||
* added; Ensures the selected option is immediately visible when the menu is open, thanks [Martin Jujou](https://github.com/jooj123) | ||
* added; `autoBlur` prop, blurs the input when a value is selected, thanks [Pavel Tarnopolsky](https://github.com/Paveltarno) | ||
* added; onBlurResetsInput prop, thanks | ||
[Sly Bridges](https://github.com/slybridges) | ||
* changed; Enter selects and retains focus, Tab selects and shifts focus, thanks | ||
[RDX](https://github.com/rdsubhas) | ||
* fixed; Hide noResultsText when value is falsy, thanks | ||
[Fernando Alex Helwanger](https://github.com/fhelwanger) | ||
* added; `required` prop, adds HTML5 required attribute, thanks | ||
[Domenico Matteo](https://github.com/dmatteo) | ||
* fixed; Touch drag behaviour, thanks | ||
[Pavel Tarnopolsky](https://github.com/Paveltarno) | ||
* added; `onOpen` and `onClose` event props, thanks | ||
[Jacob Page](https://github.com/DullReferenceException) | ||
* fixed; Pressing Enter on open Select should stop propagation, thanks | ||
[Jeremy Liberman](https://github.com/MrLeebo) | ||
* fixed; Missing handleMouseDownOnMenu, thanks | ||
[Jeremy Liberman](https://github.com/MrLeebo) | ||
* added; Ensures the selected option is immediately visible when the menu is | ||
open, thanks [Martin Jujou](https://github.com/jooj123) | ||
* added; `autoBlur` prop, blurs the input when a value is selected, thanks | ||
[Pavel Tarnopolsky](https://github.com/Paveltarno) | ||
* fixed; Several isFocused checks weren't working properly | ||
@@ -281,17 +588,27 @@ | ||
* fixed; input focus bug when toggling `disabled` prop, thanks [Davide Curletti](https://github.com/dcurletti) | ||
* fixed; `focus()` is now exposed on the `Async` component, thanks [AugustinLF](https://github.com/AugustinLF) | ||
* fixed; input focus bug when toggling `disabled` prop, thanks | ||
[Davide Curletti](https://github.com/dcurletti) | ||
* fixed; `focus()` is now exposed on the `Async` component, thanks | ||
[AugustinLF](https://github.com/AugustinLF) | ||
## v1.0.0-beta7 / 2015-12-15 | ||
* You can now use React elements for placeholders and the text props, thanks [kromit](https://github.com/kromit) and [Alyssa Biasi](https://github.com/alyssaBiasi) | ||
* Fixed a problem where the border doesn't show when the element is inside a table, thanks [Rodrigo Boratto](https://github.com/rwrz) | ||
* New prop `scrollMenuIntoView` scrolls the viewport to display the menu, thanks [Alexander Zaharakis](https://github.com/azaharakis) | ||
* New LESS / SCSS variable `select-option-bg` lets you control the menu option background color, thanks [Evan Goldenberg](https://github.com/Naveg) | ||
* Fixed an error in the blur handler on IE when the menu is not visible, thanks [Gaston Sanchez](https://github.com/gaastonsr) | ||
* Added support for a `clearableValue` option property in `multi` mode, thanks [Sly Bridges](https://github.com/slybridges) | ||
* You can now use React elements for placeholders and the text props, thanks | ||
[kromit](https://github.com/kromit) and | ||
[Alyssa Biasi](https://github.com/alyssaBiasi) | ||
* Fixed a problem where the border doesn't show when the element is inside a | ||
table, thanks [Rodrigo Boratto](https://github.com/rwrz) | ||
* New prop `scrollMenuIntoView` scrolls the viewport to display the menu, thanks | ||
[Alexander Zaharakis](https://github.com/azaharakis) | ||
* New LESS / SCSS variable `select-option-bg` lets you control the menu option | ||
background color, thanks [Evan Goldenberg](https://github.com/Naveg) | ||
* Fixed an error in the blur handler on IE when the menu is not visible, thanks | ||
[Gaston Sanchez](https://github.com/gaastonsr) | ||
* Added support for a `clearableValue` option property in `multi` mode, thanks | ||
[Sly Bridges](https://github.com/slybridges) | ||
## v1.0.0-beta6 / 2015-11-29 | ||
* Test suite complete and passing, with a couple of minor fixes thanks to @bruderstein | ||
* Test suite complete and passing, with a couple of minor fixes thanks to | ||
@bruderstein | ||
@@ -304,11 +621,15 @@ ## v1.0.0-beta5 / 2015-11-08 | ||
* New default styles that match [Elemental UI](http://elemental-ui.com) and look right at home in the new [KeystoneJS Admin UI](http://keystonejs.com) | ||
* New default styles that match [Elemental UI](http://elemental-ui.com) and look | ||
right at home in the new [KeystoneJS Admin UI](http://keystonejs.com) | ||
We're potentially going to ship some theme stylesheets in the future, shout out on GitHub if this interests you. | ||
We're potentially going to ship some theme stylesheets in the future, shout out | ||
on GitHub if this interests you. | ||
## v1.0.0-beta3 / 2015-11-08 | ||
* The selected value populated in the hidden field has been fixed (was `"[object Object]"` before) | ||
* The selected value populated in the hidden field has been fixed (was `"[object | ||
Object]"` before) | ||
* Added new `autofocus` prop | ||
* Fixed duplicate key error for options and values with duplicate `value` properties | ||
* Fixed duplicate key error for options and values with duplicate `value` | ||
properties | ||
* SCSS variables now have `!default` so you can override them | ||
@@ -321,4 +642,6 @@ | ||
* Async options cache works again | ||
* New style props for custom styling the component without modifying css classes: `style` `wrapperStyle` `menuStyle` `menuContainerStyle` | ||
* The menu opens and closes correctly when `searchable={false}`, there is still some work to do on this use-case | ||
* New style props for custom styling the component without modifying css | ||
classes: `style` `wrapperStyle` `menuStyle` `menuContainerStyle` | ||
* The menu opens and closes correctly when `searchable={false}`, there is still | ||
some work to do on this use-case | ||
@@ -329,21 +652,33 @@ ## v1.0.0-beta1 / 2015-11-06 | ||
* Everything is simpler (I'm nearly done and the source code is only 60% of the size of the last version) | ||
* No more timeouts or weird handlers, the restructuring has let me make everything more straight-forward | ||
* The options array is no longer preprocessed into state, just retrieved from props | ||
* The values array is now initialised in the Options array during render, and not stored in state, which along with the change to options makes the component more reliable and fixes issues with props not updating correctly | ||
* The component no longer stores its own value in state (ever) - it needs to be passed as a prop and handled with `onChange`. | ||
* Complex values are now enabled by default (so you're passed the option object, not its value); you can enable the legacy mode with a prop | ||
* Everything is simpler (I'm nearly done and the source code is only 60% of the | ||
size of the last version) | ||
* No more timeouts or weird handlers, the restructuring has let me make | ||
everything more straight-forward | ||
* The options array is no longer preprocessed into state, just retrieved from | ||
props | ||
* The values array is now initialised in the Options array during render, and | ||
not stored in state, which along with the change to options makes the | ||
component more reliable and fixes issues with props not updating correctly | ||
* The component no longer stores its own value in state (ever) - it needs to be | ||
passed as a prop and handled with `onChange`. | ||
* Complex values are now enabled by default (so you're passed the option object, | ||
not its value); you can enable the legacy mode with a prop | ||
* The Value and Option components have been cleaned up as well for consistency | ||
* The hidden `<input>` field is now optional and the component is better suited to use in a rich React.js app than it was | ||
* You can disable options filtering to do the filtering externally with `onInputChange` | ||
* The hidden `<input>` field is now optional and the component is better suited | ||
to use in a rich React.js app than it was | ||
* You can disable options filtering to do the filtering externally with | ||
`onInputChange` | ||
* Accents on characters can now be ignored | ||
* The `asyncOptions` prop has been replaced by a new wrapper component: `Select.Async` | ||
* The `asyncOptions` prop has been replaced by a new wrapper component: | ||
`Select.Async` | ||
Note that "Tag mode" (creating options on the fly) isn't reimplemented yet. | ||
A full guide to the breaking changes and new features will be written up soon. In the meantime please see the new examples. | ||
A full guide to the breaking changes and new features will be written up soon. | ||
In the meantime please see the new examples. | ||
## v0.9.1 / 2015-11-01 | ||
* added; new Contributors example w/ async options loading and custom value / label keys | ||
* added; new Contributors example w/ async options loading and custom value / | ||
label keys | ||
* fixed; several issues with custom `valueKey` and `labelKey` props | ||
@@ -356,27 +691,37 @@ * fixed; autoload now loads options with no search input | ||
* improved; Options rendering should be more performant | ||
* breaking change; Custom `Option` components now need to pass their `option` prop to event handlers; see [this commit](https://github.com/JedWatson/react-select/commit/89af12a80a972794222b193a767f44234bbe9817) for an example of the required change. | ||
* breaking change; Custom `Option` components now need to pass their `option` | ||
prop to event handlers; see | ||
[this commit](https://github.com/JedWatson/react-select/commit/89af12a80a972794222b193a767f44234bbe9817) | ||
for an example of the required change. | ||
## v0.8.4 / 2015-10-27 | ||
* fixed; LESS math operations now work with --strict-math=on, thanks [Vincent Fretin](https://github.com/vincentfretin) | ||
* fixed; LESS math operations now work with --strict-math=on, thanks | ||
[Vincent Fretin](https://github.com/vincentfretin) | ||
## v0.8.3 / 2015-10-27 | ||
* fixed; IE issue where clicking the scrollbar would close the menu, thanks [Pete Nykänen](https://github.com/petetnt) | ||
* fixed; IE issue where clicking the scrollbar would close the menu, thanks | ||
[Pete Nykänen](https://github.com/petetnt) | ||
## v0.8.2 / 2015-10-22 | ||
* added; Promise support for `loadAsyncOptions`, thanks [Domenico Matteo](https://github.com/dmatteo) | ||
* added; Promise support for `loadAsyncOptions`, thanks | ||
[Domenico Matteo](https://github.com/dmatteo) | ||
## v0.8.1 / 2015-10-20 | ||
* fixed; `loadAsyncOptions` raises TypeError in setup, see #439 for details, thanks [Pancham Mehrunkar](https://github.com/pancham348) | ||
* fixed; `loadAsyncOptions` raises TypeError in setup, see #439 for details, | ||
thanks [Pancham Mehrunkar](https://github.com/pancham348) | ||
## v0.8.0 / 2015-10-19 | ||
This release contains significant DOM structure and CSS improvements by @jossmac, including: | ||
This release contains significant DOM structure and CSS improvements by | ||
@jossmac, including: | ||
* no more `position: absolute` for inner controls | ||
* `display: table` is used for layout, which works in IE8 and above, and [all other modern browsers](http://caniuse.com/#feat=css-table) | ||
* less "magic numbers" used for layout, should fix various browser-specific alignment issues | ||
* `display: table` is used for layout, which works in IE8 and above, and | ||
[all other modern browsers](http://caniuse.com/#feat=css-table) | ||
* less "magic numbers" used for layout, should fix various browser-specific | ||
alignment issues | ||
* clear "x" control now animates in | ||
@@ -387,26 +732,38 @@ * clearer `.Select--multi` className replaces `.Select.is-multi` | ||
There are no functional changes, but if you've forked the LESS / CSS to create your own theme you'll want to pay close attention to PR #527 when upgrading to this version. | ||
There are no functional changes, but if you've forked the LESS / CSS to create | ||
your own theme you'll want to pay close attention to PR #527 when upgrading to | ||
this version. | ||
## v0.7.0 / 2015-10-10 | ||
React Select is updated for React 0.14. If you're still using React 0.13, please continue to use `react-select@0.6.x`. There are no functional differences between v0.7.0 and v0.6.12. | ||
React Select is updated for React 0.14. If you're still using React 0.13, please | ||
continue to use `react-select@0.6.x`. There are no functional differences | ||
between v0.7.0 and v0.6.12. | ||
Additionally, our tests now require Node.js 4.x. If you are developing `react-select`, please make sure you are running the latest version of node. | ||
Additionally, our tests now require Node.js 4.x. If you are developing | ||
`react-select`, please make sure you are running the latest version of node. | ||
Thanks to @bruderstein, @dmatteo and @hull for their help getting these updates shipped! | ||
Thanks to @bruderstein, @dmatteo and @hull for their help getting these updates | ||
shipped! | ||
## v0.6.12 / 2015-10-02 | ||
* added; `labelKey` and `valueKey` props, so you can now use different keys in `option` objects for the label and value | ||
* added; `labelKey` and `valueKey` props, so you can now use different keys in | ||
`option` objects for the label and value | ||
* fixed; additional `isMounted()` checks in timeouts | ||
* fixed; componentDidUpdate timeout is reset correctly, see #208 and #434, thanks [Petr Gladkikh](https://github.com/PetrGlad) | ||
* fixed; mousedown event on scrollbar in menu no longer hides it, thanks [Yishai Burt](https://github.com/burtyish) | ||
* fixed; componentDidUpdate timeout is reset correctly, see #208 and #434, | ||
thanks [Petr Gladkikh](https://github.com/PetrGlad) | ||
* fixed; mousedown event on scrollbar in menu no longer hides it, thanks | ||
[Yishai Burt](https://github.com/burtyish) | ||
## v0.6.11 / 2015-09-28 | ||
* added; `isLoading` prop, allows indication of async options loading in situations where more control is required, thanks [Jon Gautsch](https://github.com/jgautsch) | ||
* added; `isLoading` prop, allows indication of async options loading in | ||
situations where more control is required, thanks | ||
[Jon Gautsch](https://github.com/jgautsch) | ||
## v0.6.10 / 2015-09-24 | ||
* fixed; a build issue with the previous release that prevented the stylesheet being generated / included | ||
* fixed; a build issue with the previous release that prevented the stylesheet | ||
being generated / included | ||
* fixed; a LESS syntax issue, thanks [Bob Cardenas](https://github.com/bcardi) | ||
@@ -416,8 +773,14 @@ | ||
* added; `style` key for package.json, thanks [Stephen Wan](https://github.com/stephen) | ||
* added; `onInputChange` handler that returns the current input value, thanks [Tom Leslie](https://github.com/lomteslie) | ||
* fixed; simplifying handleKey function & preventDefault behaviour, thanks [davidpene](https://github.com/davidpene) | ||
* fixed; Display spinner while auto-loading initial data, thanks [Ben Jenkinson](https://github.com/BenJenkinson) | ||
* fixed; better support for touch events, thanks [Montlouis-Calixte Stéphane](https://github.com/bulby97) | ||
* fixed; prevent value splitting on non-multi-value select, thanks [Alan R. Soares](https://github.com/alanrsoares) | ||
* added; `style` key for package.json, thanks | ||
[Stephen Wan](https://github.com/stephen) | ||
* added; `onInputChange` handler that returns the current input value, thanks | ||
[Tom Leslie](https://github.com/lomteslie) | ||
* fixed; simplifying handleKey function & preventDefault behaviour, thanks | ||
[davidpene](https://github.com/davidpene) | ||
* fixed; Display spinner while auto-loading initial data, thanks | ||
[Ben Jenkinson](https://github.com/BenJenkinson) | ||
* fixed; better support for touch events, thanks | ||
[Montlouis-Calixte Stéphane](https://github.com/bulby97) | ||
* fixed; prevent value splitting on non-multi-value select, thanks | ||
[Alan R. Soares](https://github.com/alanrsoares) | ||
@@ -427,57 +790,84 @@ ## v0.6.8 / 2015-09-16 | ||
* fixed; broader range of allowed prereleases for React 0.14, including rc1 | ||
* fixed; preventing backspace from navigating back in the browser history, thanks [davidpene](https://github.com/davidpene) | ||
* fixed; preventing backspace from navigating back in the browser history, | ||
thanks [davidpene](https://github.com/davidpene) | ||
## v0.6.7 / 2015-08-28 | ||
* fixed; missing styles for `.Select-search-prompt` and `.Select-searching` issues, thanks [Jaak Erisalu](https://github.com/jaakerisalu) and [davidpene](https://github.com/davidpene) | ||
* fixed; missing styles for `.Select-search-prompt` and `.Select-searching` | ||
issues, thanks [Jaak Erisalu](https://github.com/jaakerisalu) and | ||
[davidpene](https://github.com/davidpene) | ||
## v0.6.6 / 2015-08-26 | ||
* fixed; issue in Chrome where clicking the scrollbar would close the menu, thanks [Vladimir Matsola](https://github.com/vomchik) | ||
* fixed; issue in Chrome where clicking the scrollbar would close the menu, | ||
thanks [Vladimir Matsola](https://github.com/vomchik) | ||
## v0.6.5 / 2015-08-24 | ||
* fixed; completely ignores clicks on disabled items, unless the target of the click is a link, thanks [Ben Stahl](https://github.com/bhstahl) | ||
* fixed; completely ignores clicks on disabled items, unless the target of the | ||
click is a link, thanks [Ben Stahl](https://github.com/bhstahl) | ||
## v0.6.4 / 2015-08-24 | ||
This release includes a huge improvement to the examples / website thanks to @jossmac. Also: | ||
This release includes a huge improvement to the examples / website thanks to | ||
@jossmac. Also: | ||
* added; support for React 0.14 beta3 | ||
* fixed; disabled options after searching, thanks @bruderstein | ||
* added; support for "Searching..." text (w/ prop) while loading async results, thanks @bruderstein and @johnomalley | ||
* added; `className`, `style` and `title` keys are now supported in option properties, thanks @bruderstein | ||
* added; support for "Searching..." text (w/ prop) while loading async results, | ||
thanks @bruderstein and @johnomalley | ||
* added; `className`, `style` and `title` keys are now supported in option | ||
properties, thanks @bruderstein | ||
## v0.6.3 / 2015-08-18 | ||
Otherwise known as "the real 0.6.2" this includes the updated build for the last version; sorry about that! | ||
Otherwise known as "the real 0.6.2" this includes the updated build for the last | ||
version; sorry about that! | ||
## v0.6.2 / 2015-08-13 | ||
* changed; if the `searchable` prop is `false`, the menu is opened _or closed_ on click, more like a standard Select input. thanks [MaaikeB](https://github.com/MaaikeB) | ||
* changed; if the `searchable` prop is `false`, the menu is opened _or closed_ | ||
on click, more like a standard Select input. thanks | ||
[MaaikeB](https://github.com/MaaikeB) | ||
## v0.6.1 / 2015-08-09 | ||
* added; Support for options with numeric values, thanks [Dave Brotherstone](https://github.com/bruderstein) | ||
* changed; Disabled options now appear in the search results , thanks [Dave Brotherstone](https://github.com/bruderstein) | ||
* fixed; asyncOptions are reloaded on componentWillReceiveProps when the value has changed, thanks [Francis Cote](https://github.com/drfeelgoud) | ||
* added; `cacheAsyncResults` prop (default `true`) now controls whether the internal cache is used for `asyncOptions` | ||
* added; Support for options with numeric values, thanks | ||
[Dave Brotherstone](https://github.com/bruderstein) | ||
* changed; Disabled options now appear in the search results , thanks | ||
[Dave Brotherstone](https://github.com/bruderstein) | ||
* fixed; asyncOptions are reloaded on componentWillReceiveProps when the value | ||
has changed, thanks [Francis Cote](https://github.com/drfeelgoud) | ||
* added; `cacheAsyncResults` prop (default `true`) now controls whether the | ||
internal cache is used for `asyncOptions` | ||
## v0.6.0 / 2015-08-05 | ||
* improved; option, value and single value have been split out into their own components, and can be customised with props. see [#328](https://github.com/JedWatson/react-select/pull/328) for more details. | ||
* improved; Near-complete test coverage thanks to the awesome work of [Dave Brotherstone](https://github.com/bruderstein) | ||
* improved; Support all alpha/beta/rc's of React 0.14.0, thanks [Sébastien Lorber](https://github.com/slorber) | ||
* fixed; Close multi-select menu when tabbing away, thanks [Ben Alpert](https://github.com/spicyj) | ||
* improved; option, value and single value have been split out into their own | ||
components, and can be customised with props. see | ||
[#328](https://github.com/JedWatson/react-select/pull/328) for more details. | ||
* improved; Near-complete test coverage thanks to the awesome work of | ||
[Dave Brotherstone](https://github.com/bruderstein) | ||
* improved; Support all alpha/beta/rc's of React 0.14.0, thanks | ||
[Sébastien Lorber](https://github.com/slorber) | ||
* fixed; Close multi-select menu when tabbing away, thanks | ||
[Ben Alpert](https://github.com/spicyj) | ||
* fixed; Bug where Select shows the value instead of the label (reapplying fix) | ||
* fixed; `valueRenderer` now works when `multi={false}`, thanks [Chris Portela](https://github.com/0xCMP) | ||
* added; New property `backspaceRemoves` (default `true`), allows the default behaviour of removing values with backspace when `multi={true}`, thanks [Leo Lehikoinen](https://github.com/lehikol2) | ||
* fixed; `valueRenderer` now works when `multi={false}`, thanks | ||
[Chris Portela](https://github.com/0xCMP) | ||
* added; New property `backspaceRemoves` (default `true`), allows the default | ||
behaviour of removing values with backspace when `multi={true}`, thanks | ||
[Leo Lehikoinen](https://github.com/lehikol2) | ||
## v0.5.6 / 2015-07-27 | ||
* fixed; Allow entering of commas when allowCreate is on but multi is off, thanks [Angelo DiNardi](https://github.com/adinardi) | ||
* fixed; Times (clear) character is now rendered from string unicode character for consistent output, thanks [Nibbles](https://github.com/Siliconrob) | ||
* fixed; Allow entering of commas when allowCreate is on but multi is off, | ||
thanks [Angelo DiNardi](https://github.com/adinardi) | ||
* fixed; Times (clear) character is now rendered from string unicode character | ||
for consistent output, thanks [Nibbles](https://github.com/Siliconrob) | ||
* fixed; allowCreate bug, thanks [goodzsq](https://github.com/goodzsq) | ||
* fixed; changes to props.placeholder weren't being reflected correctly, thanks [alesn](https://github.com/alesn) | ||
* fixed; error when escape is pressedn where `clearValue` was not passed the event, thanks [Mikhail Kotelnikov](https://github.com/mkotelnikov) | ||
* fixed; changes to props.placeholder weren't being reflected correctly, thanks | ||
[alesn](https://github.com/alesn) | ||
* fixed; error when escape is pressedn where `clearValue` was not passed the | ||
event, thanks [Mikhail Kotelnikov](https://github.com/mkotelnikov) | ||
* added; More tests, thanks [Dave Brotherstone](https://github.com/bruderstein) | ||
@@ -487,3 +877,4 @@ | ||
* fixed; replaced usage of `component.getDOMNode()` with `React.findDOMNode(component)` for compatibility with React 0.14 | ||
* fixed; replaced usage of `component.getDOMNode()` with | ||
`React.findDOMNode(component)` for compatibility with React 0.14 | ||
@@ -493,3 +884,4 @@ ## v0.5.4 / 2015-07-06 | ||
* fixed; regression in 0.5.3 that broke componentWillMount, sorry everyone! | ||
* added; `addLabelText` prop for customising the "add {label}?" text when in tags mode, thanks [Fenn](https://github.com/Fenntasy) | ||
* added; `addLabelText` prop for customising the "add {label}?" text when in | ||
tags mode, thanks [Fenn](https://github.com/Fenntasy) | ||
@@ -499,40 +891,67 @@ ## v0.5.3 / 2015-07-05 | ||
* fixed; autoload issues, thanks [Maxime Tyler](https://github.com/iam4x) | ||
* fixed; style incompatibilities with Foundation framework, thanks [Timothy Kempf](https://github.com/Fauntleroy) | ||
* fixed; style incompatibilities with Foundation framework, thanks | ||
[Timothy Kempf](https://github.com/Fauntleroy) | ||
## v0.5.2 / 2015-06-28 | ||
* fixed; bug where Select shows the value instead of the label, thanks [Stephen Demjanenko](https://github.com/sdemjanenko) | ||
* added; 'is-selected' classname is added to the selected option, thanks [Alexey Volodkin](https://github.com/miraks) | ||
* fixed; async options are now loaded with the initial value, thanks [Pokai Chang](https://github.com/Neson) | ||
* fixed; `react-input-autosize` now correctly escapes ampersands (&), not actually a fix in react-select but worth noting here because it would have been causing a problem in `react-select` as well. | ||
* fixed; bug where Select shows the value instead of the label, thanks | ||
[Stephen Demjanenko](https://github.com/sdemjanenko) | ||
* added; 'is-selected' classname is added to the selected option, thanks | ||
[Alexey Volodkin](https://github.com/miraks) | ||
* fixed; async options are now loaded with the initial value, thanks | ||
[Pokai Chang](https://github.com/Neson) | ||
* fixed; `react-input-autosize` now correctly escapes ampersands (&), not | ||
actually a fix in react-select but worth noting here because it would have | ||
been causing a problem in `react-select` as well. | ||
## v0.5.1 / 2015-06-21 | ||
* added; custom option and value rendering capability, thanks [Brian Reavis](https://github.com/brianreavis) | ||
* fixed; collapsing issue when single-select or empty multi-select fields are disabled | ||
* fixed; issue where an empty value would be left after clearing all values in a multi-select field | ||
* added; custom option and value rendering capability, thanks | ||
[Brian Reavis](https://github.com/brianreavis) | ||
* fixed; collapsing issue when single-select or empty multi-select fields are | ||
disabled | ||
* fixed; issue where an empty value would be left after clearing all values in a | ||
multi-select field | ||
## v0.5.0 / 2015-06-20 | ||
* fixed; `esc` key incorrectly created empty options, thanks [rgrzelak](https://github.com/rgrzelak) | ||
* adeed; New feature to allow option creation ("tags mode"), enable with `allowCreate` prop, thanks [Florent Vilmart](https://github.com/flovilmart) and [Brian Reavis](https://github.com/brianreavis) | ||
* fixed; IE8 compatibility fallback for `addEventListener/removeEventListener`, which don't exist in IE8, thanks [Stefan Billiet](https://github.com/StefanBilliet) | ||
* fixed; Undefined values when using asyncOptions, thanks [bannaN](https://github.com/bannaN) | ||
* fixed; Prevent add the last focused value when the drop down menu is closed / Pushing enter without dropdown open adds a value, thanks [Giuseppe](https://github.com/giuse88) | ||
* fixed; Callback context is undefined, thanks [Giuseppe](https://github.com/giuse88) | ||
* fixed; Issue with event being swallowed on Enter `keydown`, thanks [Kevin Burke](https://github.com/kembuco) | ||
* added; Support for case-insensitive filtering when `matchPos="start"`, thanks [wesrage](https://github.com/wesrage) | ||
* added; Support for customizable background color, thanks [John Morales](https://github.com/JohnMorales) | ||
* fixed; Updated ESLint and cleared up warnings, thanks [Alexander Shemetovsky](https://github.com/AlexKVal) | ||
* fixed; Close dropdown when clicking on select, thanks [Nik Butenko](https://github.com/nkbt) | ||
* added; Tests, and mocha test framework, thanks [Craig Dallimore](https://github.com/craigdallimore) | ||
* fixed; You can now start the example server and watch for changes with `npm start` | ||
* fixed; `esc` key incorrectly created empty options, thanks | ||
[rgrzelak](https://github.com/rgrzelak) | ||
* adeed; New feature to allow option creation ("tags mode"), enable with | ||
`allowCreate` prop, thanks [Florent Vilmart](https://github.com/flovilmart) | ||
and [Brian Reavis](https://github.com/brianreavis) | ||
* fixed; IE8 compatibility fallback for `addEventListener/removeEventListener`, | ||
which don't exist in IE8, thanks | ||
[Stefan Billiet](https://github.com/StefanBilliet) | ||
* fixed; Undefined values when using asyncOptions, thanks | ||
[bannaN](https://github.com/bannaN) | ||
* fixed; Prevent add the last focused value when the drop down menu is closed / | ||
Pushing enter without dropdown open adds a value, thanks | ||
[Giuseppe](https://github.com/giuse88) | ||
* fixed; Callback context is undefined, thanks | ||
[Giuseppe](https://github.com/giuse88) | ||
* fixed; Issue with event being swallowed on Enter `keydown`, thanks | ||
[Kevin Burke](https://github.com/kembuco) | ||
* added; Support for case-insensitive filtering when `matchPos="start"`, thanks | ||
[wesrage](https://github.com/wesrage) | ||
* added; Support for customizable background color, thanks | ||
[John Morales](https://github.com/JohnMorales) | ||
* fixed; Updated ESLint and cleared up warnings, thanks | ||
[Alexander Shemetovsky](https://github.com/AlexKVal) | ||
* fixed; Close dropdown when clicking on select, thanks | ||
[Nik Butenko](https://github.com/nkbt) | ||
* added; Tests, and mocha test framework, thanks | ||
[Craig Dallimore](https://github.com/craigdallimore) | ||
* fixed; You can now start the example server and watch for changes with `npm | ||
start` | ||
## v0.4.9 / 2015-05-11 | ||
* fixed; focus was being grabbed by the select when `autoload` and `asyncOptions` were set | ||
* fixed; focus was being grabbed by the select when `autoload` and | ||
`asyncOptions` were set | ||
* added; `focus` method on the component | ||
* added; support for disabled options, thanks [Pasha Palangpour](https://github.com/pashap) | ||
* improved; more closures, less binds, for better performance, thanks [Daniel Cousens](https://github.com/dcousens) | ||
* added; support for disabled options, thanks | ||
[Pasha Palangpour](https://github.com/pashap) | ||
* improved; more closures, less binds, for better performance, thanks | ||
[Daniel Cousens](https://github.com/dcousens) | ||
@@ -544,8 +963,11 @@ ## v0.4.8 / 2015-05-02 | ||
* fixed; clarified dependency documentation and added dependencies for Bower | ||
* fixed; Scoping issues in `_bindCloseMenuIfClickedOutside`, thanks [bannaN](https://github.com/bannaN) | ||
* fixed; Doesnt try to set focus afterupdate if component is disabled, thanks [bannaN](https://github.com/bannaN) | ||
* fixed; Scoping issues in `_bindCloseMenuIfClickedOutside`, thanks | ||
[bannaN](https://github.com/bannaN) | ||
* fixed; Doesnt try to set focus afterupdate if component is disabled, thanks | ||
[bannaN](https://github.com/bannaN) | ||
## v0.4.7 / 2015-04-21 | ||
* improved; lodash is no longer a dependency, thanks [Daniel Lo Nigro](https://github.com/Daniel15) | ||
* improved; lodash is no longer a dependency, thanks | ||
[Daniel Lo Nigro](https://github.com/Daniel15) | ||
@@ -558,8 +980,11 @@ ## v0.4.6 / 2015-04-06 | ||
* fixed; issue with long options overlapping arrow and clear icons, thanks [Rohit Kalkur](https://github.com/rovolution) | ||
* fixed; issue with long options overlapping arrow and clear icons, thanks | ||
[Rohit Kalkur](https://github.com/rovolution) | ||
## v0.4.4 / 2015-03-26 | ||
* fixed; error handling click events when the menu is closed, thanks [Ilya Petrov](https://github.com/muromec) | ||
* fixed; issue where options will not be filtered in certain conditions, thanks [G. Kay Lee](https://github.com/gsklee) | ||
* fixed; error handling click events when the menu is closed, thanks | ||
[Ilya Petrov](https://github.com/muromec) | ||
* fixed; issue where options will not be filtered in certain conditions, thanks | ||
[G. Kay Lee](https://github.com/gsklee) | ||
@@ -574,8 +999,11 @@ ## v0.4.3 / 2015-03-25 | ||
* fixed; incorrect `classnames` variable assignment in window scope | ||
* fixed; all ESLint errors and warnings (except invalid JSX undefined/unused vars due to ESLint bug) | ||
* fixed; first option is now focused correctly, thanks [Eivind Siqveland Larsen](https://github.com/esiqveland) | ||
* fixed; all ESLint errors and warnings (except invalid JSX undefined/unused | ||
vars due to ESLint bug) | ||
* fixed; first option is now focused correctly, thanks | ||
[Eivind Siqveland Larsen](https://github.com/esiqveland) | ||
## v0.4.1 / 2015-03-20 | ||
* fixed; IE11 issue: clicking on scrollbar within menu no longer closes menu, thanks [Rohit Kalkur](https://github.com/rovolution) | ||
* fixed; IE11 issue: clicking on scrollbar within menu no longer closes menu, | ||
thanks [Rohit Kalkur](https://github.com/rovolution) | ||
@@ -588,12 +1016,20 @@ ## v0.4.0 / 2015-03-12 | ||
* improved; less/no repaint on scroll for performance wins, thanks [jsmunich](https://github.com/jsmunich) | ||
* added; `onBlur` and `onFocus` event handlers, thanks [Jonas Budelmann](https://github.com/cloudkite) | ||
* added; support for `inputProps` prop, passed to the `<input>` component, thanks [Yann Plantevin](https://github.com/YannPl) | ||
* changed; now using [react-component-gulp-tasks](https://github.com/JedWatson/react-component-gulp-tasks) for build | ||
* fixed; issue w/ remote callbacks overriding cached options, thanks [Corey McMahon](https://github.com/coreymcmahon) | ||
* fixed; if not `this.props.multi`, menu doesn't need handleMouseDown, thanks [wenbing](https://github.com/wenbing) | ||
* improved; less/no repaint on scroll for performance wins, thanks | ||
[jsmunich](https://github.com/jsmunich) | ||
* added; `onBlur` and `onFocus` event handlers, thanks | ||
[Jonas Budelmann](https://github.com/cloudkite) | ||
* added; support for `inputProps` prop, passed to the `<input>` component, | ||
thanks [Yann Plantevin](https://github.com/YannPl) | ||
* changed; now using | ||
[react-component-gulp-tasks](https://github.com/JedWatson/react-component-gulp-tasks) | ||
for build | ||
* fixed; issue w/ remote callbacks overriding cached options, thanks | ||
[Corey McMahon](https://github.com/coreymcmahon) | ||
* fixed; if not `this.props.multi`, menu doesn't need handleMouseDown, thanks | ||
[wenbing](https://github.com/wenbing) | ||
## v0.3.4 / 2015-02-23 | ||
* fixed; issues with the underscore/lodash dependency change, thanks [Aaron Powell](https://github.com/aaronpowell) | ||
* fixed; issues with the underscore/lodash dependency change, thanks | ||
[Aaron Powell](https://github.com/aaronpowell) | ||
@@ -603,9 +1039,14 @@ ## v0.3.3 / 2015-02-22 | ||
* added; `disabled` prop, thanks [Danny Shaw](https://github.com/dannyshaw) | ||
* added; `searchable` prop - set to `false` to disable the search box, thanks [Julen Ruiz Aizpuru](https://github.com/julen) | ||
* added; `onOptionLabelClick` prop - see [#66](https://github.com/JedWatson/react-select/pull/66) for docs, thanks [Dmitry Smirnov](https://github.com/dmitry-smirnov) | ||
* fixed; `text-overflow: ellipsis;` typo, thanks [Andru Vallance](https://github.com/andru) | ||
* added; `searchable` prop - set to `false` to disable the search box, thanks | ||
[Julen Ruiz Aizpuru](https://github.com/julen) | ||
* added; `onOptionLabelClick` prop - see | ||
[#66](https://github.com/JedWatson/react-select/pull/66) for docs, thanks | ||
[Dmitry Smirnov](https://github.com/dmitry-smirnov) | ||
* fixed; `text-overflow: ellipsis;` typo, thanks | ||
[Andru Vallance](https://github.com/andru) | ||
## v0.3.2 / 2015-01-30 | ||
* fixed; issue adding undefined values to multiselect, thanks [Tejas Dinkar](https://github.com/gja) | ||
* fixed; issue adding undefined values to multiselect, thanks | ||
[Tejas Dinkar](https://github.com/gja) | ||
@@ -622,8 +1063,13 @@ ## v0.3.1 / 2015-01-20 | ||
* added; `searchPromptText` property that is displayed when `asyncOptions` is set and there are (a) no options loaded, and (b) no input entered to search on, thanks [Anton Fedchenko](https://github.com/kompot) | ||
* added; `clearable` property (defaults to `true`) to control whether the "clear" control is available, thanks [Anton Fedchenko](https://github.com/kompot) | ||
* added; `searchPromptText` property that is displayed when `asyncOptions` is | ||
set and there are (a) no options loaded, and (b) no input entered to search | ||
on, thanks [Anton Fedchenko](https://github.com/kompot) | ||
* added; `clearable` property (defaults to `true`) to control whether the | ||
"clear" control is available, thanks | ||
[Anton Fedchenko](https://github.com/kompot) | ||
## v0.2.13 / 2015-01-05 | ||
* fixed; height issues in Safari, thanks [Joss Mackison](https://github.com/jossmac) | ||
* fixed; height issues in Safari, thanks | ||
[Joss Mackison](https://github.com/jossmac) | ||
* added; Option to specify "Clear value" label as prop for i18n | ||
@@ -633,7 +1079,9 @@ | ||
* fixed; UI now responds to touch events, and works on mobile devices! thanks [Fraser Xu](https://github.com/fraserxu) | ||
* fixed; UI now responds to touch events, and works on mobile devices! thanks | ||
[Fraser Xu](https://github.com/fraserxu) | ||
## v0.2.11 / 2015-01-04 | ||
* fixed; Options in the dropdown now scroll into view when they are focused, thanks [Adam](https://github.com/fmovlex) | ||
* fixed; Options in the dropdown now scroll into view when they are focused, | ||
thanks [Adam](https://github.com/fmovlex) | ||
* improved; Example dist is now excluded from the npm package | ||
@@ -646,19 +1094,23 @@ | ||
* fixed; Values are now expanded correctly when options change (see #28) | ||
* added; Option to specify "No results found" label as prop for i18n, thanks [Julen Ruiz Aizpuru](https://github.com/julen) | ||
* added; Option to specify "No results found" label as prop for i18n, thanks | ||
[Julen Ruiz Aizpuru](https://github.com/julen) | ||
## v0.2.9 / 2014-12-09 | ||
* added; `filterOption` and `filterOptions` props for more control over filtering | ||
* added; `filterOption` and `filterOptions` props for more control over | ||
filtering | ||
## v0.2.8 / 2014-12-08 | ||
* added; `matchPos` option to control whether to match the `start` or `any` position in the string when filtering options (default: `any`) | ||
* added; `matchProp` option to control whether to match the `value`, `label` or `any` property of each option when filtering (default: `any`) | ||
* added; `matchPos` option to control whether to match the `start` or `any` | ||
position in the string when filtering options (default: `any`) | ||
* added; `matchProp` option to control whether to match the `value`, `label` or | ||
`any` property of each option when filtering (default: `any`) | ||
## v0.2.7 / 2014-12-01 | ||
* fixed; screen-readers will now read "clear value" instead of "times" for the clear button | ||
* fixed; screen-readers will now read "clear value" instead of "times" for the | ||
clear button | ||
* fixed; non-left-click mousedown events aren't blocked by the control | ||
## v0.2.6 / 2014-11-30 | ||
@@ -665,0 +1117,0 @@ |
@@ -13,2 +13,6 @@ 'use strict'; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _react = require('react'); | ||
@@ -18,6 +22,2 @@ | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _Select = require('./Select'); | ||
@@ -63,2 +63,6 @@ | ||
var defaultChildren = function defaultChildren(props) { | ||
return _react2.default.createElement(_Select2.default, props); | ||
}; | ||
var defaultProps = { | ||
@@ -241,6 +245,3 @@ autoload: true, | ||
loadingPlaceholder = _props3.loadingPlaceholder, | ||
multi = _props3.multi, | ||
onChange = _props3.onChange, | ||
placeholder = _props3.placeholder, | ||
value = _props3.value; | ||
placeholder = _props3.placeholder; | ||
var _state2 = this.state, | ||
@@ -274,6 +275,2 @@ isLoading = _state2.isLoading, | ||
Async.propTypes = propTypes; | ||
Async.defaultProps = defaultProps; | ||
function defaultChildren(props) { | ||
return _react2.default.createElement(_Select2.default, props); | ||
} | ||
Async.defaultProps = defaultProps; |
@@ -11,6 +11,2 @@ 'use strict'; | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _propTypes = require('prop-types'); | ||
@@ -20,5 +16,5 @@ | ||
var _Select = require('./Select'); | ||
var _react = require('react'); | ||
var _Select2 = _interopRequireDefault(_Select); | ||
var _react2 = _interopRequireDefault(_react); | ||
@@ -33,2 +29,6 @@ var _Async = require('./Async'); | ||
var _Select = require('./Select'); | ||
var _Select2 = _interopRequireDefault(_Select); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -96,5 +96,3 @@ | ||
; | ||
function defaultChildren(props) { | ||
var defaultChildren = function defaultChildren(props) { | ||
return _react2.default.createElement(_Select2.default, props); | ||
@@ -101,0 +99,0 @@ }; |
@@ -11,6 +11,2 @@ 'use strict'; | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _propTypes = require('prop-types'); | ||
@@ -20,5 +16,5 @@ | ||
var _Select = require('./Select'); | ||
var _react = require('react'); | ||
var _Select2 = _interopRequireDefault(_Select); | ||
var _react2 = _interopRequireDefault(_react); | ||
@@ -33,2 +29,6 @@ var _defaultFilterOptions = require('./utils/defaultFilterOptions'); | ||
var _Select = require('./Select'); | ||
var _Select2 = _interopRequireDefault(_Select); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -68,4 +68,3 @@ | ||
_props$options = _props.options, | ||
options = _props$options === undefined ? [] : _props$options, | ||
shouldKeyDownEventCreateNewOption = _props.shouldKeyDownEventCreateNewOption; | ||
options = _props$options === undefined ? [] : _props$options; | ||
@@ -75,3 +74,3 @@ | ||
var option = newOptionCreator({ label: this.inputValue, labelKey: this.labelKey, valueKey: this.valueKey }); | ||
var _isOptionUnique = this.isOptionUnique({ option: option }); | ||
var _isOptionUnique = this.isOptionUnique({ option: option, options: options }); | ||
@@ -201,3 +200,3 @@ // Don't add the same option twice. | ||
key: 'onOptionSelect', | ||
value: function onOptionSelect(option, event) { | ||
value: function onOptionSelect(option) { | ||
if (option === this._createPlaceholderOption) { | ||
@@ -220,6 +219,4 @@ this.createNewOption(); | ||
var _props4 = this.props, | ||
newOptionCreator = _props4.newOptionCreator, | ||
shouldKeyDownEventCreateNewOption = _props4.shouldKeyDownEventCreateNewOption, | ||
refProp = _props4.ref, | ||
restProps = _objectWithoutProperties(_props4, ['newOptionCreator', 'shouldKeyDownEventCreateNewOption', 'ref']); | ||
restProps = _objectWithoutProperties(_props4, ['ref']); | ||
@@ -263,9 +260,7 @@ var children = this.props.children; | ||
; | ||
function defaultChildren(props) { | ||
var defaultChildren = function defaultChildren(props) { | ||
return _react2.default.createElement(_Select2.default, props); | ||
}; | ||
function isOptionUnique(_ref3) { | ||
var isOptionUnique = function isOptionUnique(_ref3) { | ||
var option = _ref3.option, | ||
@@ -276,2 +271,6 @@ options = _ref3.options, | ||
if (!options || !options.length) { | ||
return true; | ||
} | ||
return options.filter(function (existingOption) { | ||
@@ -282,9 +281,8 @@ return existingOption[labelKey] === option[labelKey] || existingOption[valueKey] === option[valueKey]; | ||
function isValidNewOption(_ref4) { | ||
var isValidNewOption = function isValidNewOption(_ref4) { | ||
var label = _ref4.label; | ||
return !!label; | ||
}; | ||
function newOptionCreator(_ref5) { | ||
var newOptionCreator = function newOptionCreator(_ref5) { | ||
var label = _ref5.label, | ||
@@ -298,10 +296,11 @@ labelKey = _ref5.labelKey, | ||
option.className = 'Select-create-option-placeholder'; | ||
return option; | ||
}; | ||
function promptTextCreator(label) { | ||
var promptTextCreator = function promptTextCreator(label) { | ||
return 'Create option "' + label + '"'; | ||
} | ||
}; | ||
function shouldKeyDownEventCreateNewOption(_ref6) { | ||
var shouldKeyDownEventCreateNewOption = function shouldKeyDownEventCreateNewOption(_ref6) { | ||
var keyCode = _ref6.keyCode; | ||
@@ -308,0 +307,0 @@ |
@@ -9,5 +9,5 @@ 'use strict'; | ||
var _react = require('react'); | ||
var _classnames = require('classnames'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
@@ -18,6 +18,10 @@ var _propTypes = require('prop-types'); | ||
var _classnames = require('classnames'); | ||
var _react = require('react'); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _blockEvent = require('./utils/blockEvent'); | ||
var _blockEvent2 = _interopRequireDefault(_blockEvent); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -50,16 +54,2 @@ | ||
_createClass(Option, [{ | ||
key: 'blockEvent', | ||
value: function blockEvent(event) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
if (event.target.tagName !== 'A' || !('href' in event.target)) { | ||
return; | ||
} | ||
if (event.target.target) { | ||
window.open(event.target.href, event.target.target); | ||
} else { | ||
window.location.href = event.target.href; | ||
} | ||
} | ||
}, { | ||
key: 'handleMouseDown', | ||
@@ -92,3 +82,3 @@ value: function handleMouseDown(event) { | ||
key: 'handleTouchMove', | ||
value: function handleTouchMove(event) { | ||
value: function handleTouchMove() { | ||
// Set a flag that the view is being dragged | ||
@@ -99,3 +89,3 @@ this.dragging = true; | ||
key: 'handleTouchStart', | ||
value: function handleTouchStart(event) { | ||
value: function handleTouchStart() { | ||
// Set a flag that the view is not being dragged | ||
@@ -124,4 +114,4 @@ this.dragging = false; | ||
{ className: className, | ||
onMouseDown: this.blockEvent, | ||
onClick: this.blockEvent }, | ||
onMouseDown: _blockEvent2.default, | ||
onClick: _blockEvent2.default }, | ||
this.props.children | ||
@@ -150,4 +140,2 @@ ) : _react2.default.createElement( | ||
; | ||
Option.propTypes = { | ||
@@ -154,0 +142,0 @@ children: _propTypes2.default.node, |
@@ -32,6 +32,12 @@ 'use strict'; | ||
function OptionGroup() { | ||
function OptionGroup(props) { | ||
_classCallCheck(this, OptionGroup); | ||
return _possibleConstructorReturn(this, (OptionGroup.__proto__ || Object.getPrototypeOf(OptionGroup)).apply(this, arguments)); | ||
var _this = _possibleConstructorReturn(this, (OptionGroup.__proto__ || Object.getPrototypeOf(OptionGroup)).call(this, props)); | ||
_this.handleMouseDown = _this.handleMouseDown.bind(_this); | ||
_this.handleTouchEnd = _this.handleTouchEnd.bind(_this); | ||
_this.handleTouchMove = _this.handleTouchMove.bind(_this); | ||
_this.handleTouchStart = _this.handleTouchStart.bind(_this); | ||
return _this; | ||
} | ||
@@ -38,0 +44,0 @@ |
@@ -13,6 +13,10 @@ 'use strict'; | ||
var _react = require('react'); | ||
var _reactInputAutosize = require('react-input-autosize'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _reactInputAutosize2 = _interopRequireDefault(_reactInputAutosize); | ||
var _classnames = require('classnames'); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _propTypes = require('prop-types'); | ||
@@ -22,12 +26,8 @@ | ||
var _reactDom = require('react-dom'); | ||
var _react = require('react'); | ||
var _reactInputAutosize = require('react-input-autosize'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _reactInputAutosize2 = _interopRequireDefault(_reactInputAutosize); | ||
var _reactDom = require('react-dom'); | ||
var _classnames = require('classnames'); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _defaultArrowRenderer = require('./utils/defaultArrowRenderer'); | ||
@@ -37,2 +37,6 @@ | ||
var _defaultClearRenderer = require('./utils/defaultClearRenderer'); | ||
var _defaultClearRenderer2 = _interopRequireDefault(_defaultClearRenderer); | ||
var _defaultFilterOptions = require('./utils/defaultFilterOptions'); | ||
@@ -46,6 +50,2 @@ | ||
var _defaultClearRenderer = require('./utils/defaultClearRenderer'); | ||
var _defaultClearRenderer2 = _interopRequireDefault(_defaultClearRenderer); | ||
var _Dropdown = require('./Dropdown'); | ||
@@ -107,2 +107,33 @@ | ||
var shouldShowValue = function shouldShowValue(state, props) { | ||
var inputValue = state.inputValue, | ||
isPseudoFocused = state.isPseudoFocused, | ||
isFocused = state.isFocused; | ||
var onSelectResetsInput = props.onSelectResetsInput; | ||
if (!inputValue) return true; | ||
if (!onSelectResetsInput) { | ||
return !(!isFocused && isPseudoFocused || isFocused && !isPseudoFocused); | ||
} | ||
return false; | ||
}; | ||
var shouldShowPlaceholder = function shouldShowPlaceholder(state, props, isOpen) { | ||
var inputValue = state.inputValue, | ||
isPseudoFocused = state.isPseudoFocused, | ||
isFocused = state.isFocused; | ||
var onSelectResetsInput = props.onSelectResetsInput; | ||
return !inputValue || !onSelectResetsInput && !isOpen && !isPseudoFocused && !isFocused; | ||
}; | ||
var handleRequired = function handleRequired(value, multi) { | ||
if (!value) return true; | ||
return multi ? value.length === 0 : Object.keys(value).length === 0; | ||
}; | ||
var Select = function (_React$Component) { | ||
@@ -116,3 +147,3 @@ _inherits(Select, _React$Component); | ||
['clearValue', 'focusOption', 'handleInputBlur', 'handleInputChange', 'handleInputFocus', 'handleInputValueChange', 'handleKeyDown', 'handleMenuScroll', 'handleMouseDown', 'handleMouseDownOnArrow', 'handleMouseDownOnMenu', 'handleRequired', 'handleTouchOutside', 'handleTouchMove', 'handleTouchStart', 'handleTouchEnd', 'handleTouchEndClearValue', 'handleValueClick', 'getOptionLabel', 'onOptionRef', 'removeValue', 'selectValue'].forEach(function (fn) { | ||
['clearValue', 'focusOption', 'getOptionLabel', 'handleInputBlur', 'handleInputChange', 'handleInputFocus', 'handleInputValueChange', 'handleKeyDown', 'handleMenuScroll', 'handleMouseDown', 'handleMouseDownOnArrow', 'handleMouseDownOnMenu', 'handleTouchEnd', 'handleTouchEndClearValue', 'handleTouchMove', 'handleTouchOutside', 'handleTouchStart', 'handleValueClick', 'onOptionRef', 'removeValue', 'selectValue'].forEach(function (fn) { | ||
return _this[fn] = _this[fn].bind(_this); | ||
@@ -140,3 +171,3 @@ }); | ||
this.setState({ | ||
required: this.handleRequired(valueArray[0], this.props.multi) | ||
required: handleRequired(valueArray[0], this.props.multi) | ||
}); | ||
@@ -172,3 +203,3 @@ } | ||
this.setState({ | ||
required: this.handleRequired(valueArray[0], nextProps.multi) | ||
required: handleRequired(valueArray[0], nextProps.multi) | ||
}); | ||
@@ -179,2 +210,6 @@ } else if (this.props.required) { | ||
} | ||
if (this.state.inputValue && this.props.value !== nextProps.value && nextProps.onSelectResetsInput) { | ||
this.setState({ inputValue: this.handleInputValueChange('') }); | ||
} | ||
} | ||
@@ -278,3 +313,3 @@ }, { | ||
key: 'handleTouchMove', | ||
value: function handleTouchMove(event) { | ||
value: function handleTouchMove() { | ||
// Set a flag that the view is being dragged | ||
@@ -285,3 +320,3 @@ this.dragging = true; | ||
key: 'handleTouchStart', | ||
value: function handleTouchStart(event) { | ||
value: function handleTouchStart() { | ||
// Set a flag that the view is not being dragged | ||
@@ -329,2 +364,3 @@ this.dragging = false; | ||
} | ||
return; | ||
@@ -338,3 +374,3 @@ } | ||
if (!this.props.searchable) { | ||
// TODO: This code means that if a select is searchable, onClick the options menu will not appear, only on subsequent click will it open. | ||
// This code means that if a select is searchable, onClick the options menu will not appear, only on subsequent click will it open. | ||
this.focus(); | ||
@@ -353,2 +389,4 @@ return this.setState({ | ||
var input = this.input; | ||
var toOpen = true; | ||
if (typeof input.getInput === 'function') { | ||
@@ -362,6 +400,12 @@ // Get the actual DOM input if the ref is an <AutosizeInput /> component | ||
if (this._focusAfterClear) { | ||
toOpen = false; | ||
this._focusAfterClear = false; | ||
} | ||
// if the input is focused, ensure the menu is open | ||
this.setState({ | ||
isOpen: true, | ||
isPseudoFocused: false | ||
isOpen: toOpen, | ||
isPseudoFocused: false, | ||
focusedOption: null | ||
}); | ||
@@ -372,2 +416,3 @@ } else { | ||
this.focus(); | ||
this.setState({ focusedOption: null }); | ||
} | ||
@@ -383,4 +428,11 @@ } | ||
} | ||
// If the menu isn't open, let the event bubble to the main handleMouseDown | ||
if (!this.state.isOpen) { | ||
if (this.state.isOpen) { | ||
// prevent default event handlers | ||
event.stopPropagation(); | ||
event.preventDefault(); | ||
// close the menu | ||
this.closeMenu(); | ||
} else { | ||
// If the menu isn't open, let the event bubble to the main handleMouseDown | ||
this.setState({ | ||
@@ -390,9 +442,2 @@ isOpen: true | ||
} | ||
// prevent default event handlers | ||
event.stopPropagation(); | ||
event.preventDefault(); | ||
// close the menu | ||
if (this.state.isOpen) { | ||
this.closeMenu(); | ||
} | ||
} | ||
@@ -407,2 +452,3 @@ }, { | ||
} | ||
event.stopPropagation(); | ||
@@ -419,5 +465,5 @@ event.preventDefault(); | ||
this.setState({ | ||
inputValue: this.handleInputValueChange(''), | ||
isOpen: false, | ||
isPseudoFocused: this.state.isFocused && !this.props.multi, | ||
inputValue: this.handleInputValueChange('') | ||
isPseudoFocused: this.state.isFocused && !this.props.multi | ||
}); | ||
@@ -436,10 +482,16 @@ } else { | ||
if (this.props.disabled) return; | ||
var isOpen = this.state.isOpen || this._openAfterFocus || this.props.openOnFocus; | ||
var toOpen = this.state.isOpen || this._openAfterFocus || this.props.openOnFocus; | ||
toOpen = this._focusAfterClear ? false : toOpen; //if focus happens after clear values, don't open dropdown yet. | ||
if (this.props.onFocus) { | ||
this.props.onFocus(event); | ||
} | ||
this.setState({ | ||
isFocused: true, | ||
isOpen: isOpen | ||
isOpen: !!toOpen | ||
}); | ||
this._focusAfterClear = false; | ||
this._openAfterFocus = false; | ||
@@ -479,8 +531,21 @@ } | ||
this.setState({ | ||
inputValue: newInputValue, | ||
isOpen: true, | ||
isPseudoFocused: false, | ||
inputValue: newInputValue | ||
isPseudoFocused: false | ||
}); | ||
} | ||
}, { | ||
key: 'setInputValue', | ||
value: function setInputValue(newValue) { | ||
if (this.props.onInputChange) { | ||
var nextState = this.props.onInputChange(newValue); | ||
if (nextState != null && (typeof nextState === 'undefined' ? 'undefined' : _typeof(nextState)) !== 'object') { | ||
newValue = '' + nextState; | ||
} | ||
} | ||
this.setState({ | ||
inputValue: newValue | ||
}); | ||
} | ||
}, { | ||
key: 'handleInputValueChange', | ||
@@ -516,11 +581,11 @@ value: function handleInputValueChange(newValue) { | ||
} | ||
return; | ||
break; | ||
case 9: | ||
// tab | ||
if (event.shiftKey || !this.state.isOpen || !this.props.tabSelectsValue) { | ||
return; | ||
break; | ||
} | ||
event.preventDefault(); | ||
this.selectFocusedOption(); | ||
return; | ||
break; | ||
case 13: | ||
@@ -535,6 +600,6 @@ // enter | ||
} | ||
return; | ||
break; | ||
case 27: | ||
// escape | ||
event.preventDefault(); | ||
if (this.state.isOpen) { | ||
@@ -551,3 +616,3 @@ this.closeMenu(); | ||
if (this.props.searchable) { | ||
return; | ||
break; | ||
} | ||
@@ -557,3 +622,3 @@ event.preventDefault(); | ||
this.focusNextOption(); | ||
return; | ||
break; | ||
} | ||
@@ -565,2 +630,3 @@ event.stopPropagation(); | ||
// up | ||
event.preventDefault(); | ||
this.focusPreviousOption(); | ||
@@ -570,2 +636,3 @@ break; | ||
// down | ||
event.preventDefault(); | ||
this.focusNextOption(); | ||
@@ -575,2 +642,3 @@ break; | ||
// page up | ||
event.preventDefault(); | ||
this.focusPageUpOption(); | ||
@@ -580,2 +648,3 @@ break; | ||
// page down | ||
event.preventDefault(); | ||
this.focusPageDownOption(); | ||
@@ -586,4 +655,5 @@ break; | ||
if (event.shiftKey) { | ||
return; | ||
break; | ||
} | ||
event.preventDefault(); | ||
this.focusEndOption(); | ||
@@ -594,4 +664,5 @@ break; | ||
if (event.shiftKey) { | ||
return; | ||
break; | ||
} | ||
event.preventDefault(); | ||
this.focusStartOption(); | ||
@@ -601,11 +672,8 @@ break; | ||
// delete | ||
event.preventDefault(); | ||
if (!this.state.inputValue && this.props.deleteRemoves) { | ||
event.preventDefault(); | ||
this.popValue(); | ||
} | ||
return; | ||
default: | ||
return; | ||
break; | ||
} | ||
event.preventDefault(); | ||
} | ||
@@ -629,8 +697,2 @@ }, { | ||
}, { | ||
key: 'handleRequired', | ||
value: function handleRequired(value, multi) { | ||
if (!value) return true; | ||
return multi ? value.length === 0 : Object.keys(value).length === 0; | ||
} | ||
}, { | ||
key: 'getOptionLabel', | ||
@@ -643,4 +705,4 @@ value: function getOptionLabel(op) { | ||
* Turns a value into an array from the given options | ||
* @param {String|Number|Array} value - the value of the select input | ||
* @param {Object} nextProps - optionally specify the nextProps so the returned array uses the latest configuration | ||
* @param {String|Number|Array} value - the value of the select input | ||
* @param {Object} nextProps - optionally specify the nextProps so the returned array uses the latest configuration | ||
* @returns {Array} the value of the select represented in an array | ||
@@ -651,5 +713,7 @@ */ | ||
key: 'getValueArray', | ||
value: function getValueArray(value, nextProps) { | ||
value: function getValueArray(value) { | ||
var _this2 = this; | ||
var nextProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; | ||
/** support optionally passing in the `nextProps` so `componentWillReceiveProps` updates will function as expected */ | ||
@@ -691,3 +755,3 @@ var props = (typeof nextProps === 'undefined' ? 'undefined' : _typeof(nextProps)) === 'object' ? nextProps : this.props; | ||
var options = this._flatOptions; | ||
if (!options || value === '') return; | ||
if (!options) return; | ||
for (var i = 0; i < options.length; i++) { | ||
@@ -717,11 +781,11 @@ if (String(options[i][valueKey]) === String(value)) return options[i]; | ||
if (this.props.required) { | ||
var required = this.handleRequired(value, this.props.multi); | ||
var required = handleRequired(value, this.props.multi); | ||
this.setState({ required: required }); | ||
} | ||
if (this.props.simpleValue && value) { | ||
value = this.props.multi ? value.map(function (i) { | ||
return i[_this3.props.valueKey]; | ||
}).join(this.props.delimiter) : value[this.props.valueKey]; | ||
} | ||
if (this.props.onChange) { | ||
if (this.props.simpleValue && value) { | ||
value = this.props.multi ? value.map(function (i) { | ||
return i[_this3.props.valueKey]; | ||
}).join(this.props.delimiter) : value[this.props.valueKey]; | ||
} | ||
this.props.onChange(value); | ||
@@ -740,4 +804,4 @@ } | ||
} | ||
var updatedValue = this.props.onSelectResetsInput ? '' : this.state.inputValue; | ||
if (this.props.multi) { | ||
var updatedValue = this.props.onSelectResetsInput ? '' : this.state.inputValue; | ||
this.setState({ | ||
@@ -759,3 +823,3 @@ focusedIndex: null, | ||
this.setState({ | ||
inputValue: this.handleInputValueChange(''), | ||
inputValue: this.handleInputValueChange(updatedValue), | ||
isOpen: !this.props.closeOnSelect, | ||
@@ -812,8 +876,12 @@ isPseudoFocused: this.state.isFocused | ||
} | ||
event.preventDefault(); | ||
this.setValue(this.getResetValue()); | ||
this.setState({ | ||
isOpen: false, | ||
inputValue: this.handleInputValueChange('') | ||
inputValue: this.handleInputValueChange(''), | ||
isOpen: false | ||
}, this.focus); | ||
this._focusAfterClear = true; | ||
} | ||
@@ -878,7 +946,10 @@ }, { | ||
if (!this.state.isOpen) { | ||
this.setState({ | ||
isOpen: true, | ||
inputValue: '', | ||
focusedOption: this._focusedOption || (options.length ? options[dir === 'next' ? 0 : options.length - 1].option : null) | ||
}); | ||
var newState = { | ||
focusedOption: this._focusedOption || (options.length ? options[dir === 'next' ? 0 : options.length - 1].option : null), | ||
isOpen: true | ||
}; | ||
if (this.props.onSelectResetsInput) { | ||
newState.inputValue = ''; | ||
} | ||
this.setState(newState); | ||
return; | ||
@@ -914,7 +985,7 @@ } | ||
} else if (dir === 'page_down') { | ||
var potentialIndex = focusedIndex + this.props.pageSize; | ||
if (potentialIndex > options.length - 1) { | ||
var _potentialIndex = focusedIndex + this.props.pageSize; | ||
if (_potentialIndex > options.length - 1) { | ||
focusedIndex = options.length - 1; | ||
} else { | ||
focusedIndex = potentialIndex; | ||
focusedIndex = _potentialIndex; | ||
} | ||
@@ -962,3 +1033,4 @@ } | ||
if (!valueArray.length) { | ||
return !this.state.inputValue ? _react2.default.createElement( | ||
var showPlaceholder = shouldShowPlaceholder(this.state, this.props, isOpen); | ||
return showPlaceholder ? _react2.default.createElement( | ||
'div', | ||
@@ -975,8 +1047,9 @@ { className: 'Select-placeholder' }, | ||
{ | ||
disabled: _this6.props.disabled || value.clearableValue === false, | ||
id: _this6._instancePrefix + '-value-' + i, | ||
instancePrefix: _this6._instancePrefix, | ||
disabled: _this6.props.disabled || value.clearableValue === false, | ||
key: 'value-' + i + '-' + value[_this6.props.valueKey], | ||
onClick: onClick, | ||
onRemove: _this6.removeValue, | ||
placeholder: _this6.props.placeholder, | ||
value: value | ||
@@ -992,3 +1065,3 @@ }, | ||
}); | ||
} else if (!this.state.inputValue) { | ||
} else if (shouldShowValue(this.state, this.props)) { | ||
if (isOpen) onClick = null; | ||
@@ -998,6 +1071,7 @@ return _react2.default.createElement( | ||
{ | ||
disabled: this.props.disabled, | ||
id: this._instancePrefix + '-value-item', | ||
disabled: this.props.disabled, | ||
instancePrefix: this._instancePrefix, | ||
onClick: onClick, | ||
placeholder: this.props.placeholder, | ||
value: valueArray[0] | ||
@@ -1016,16 +1090,21 @@ }, | ||
var className = (0, _classnames2.default)('Select-input', this.props.inputProps.className); | ||
var isOpen = !!this.state.isOpen; | ||
var isOpen = this.state.isOpen; | ||
var ariaOwns = (0, _classnames2.default)((_classNames = {}, _defineProperty(_classNames, this._instancePrefix + '-list', isOpen), _defineProperty(_classNames, this._instancePrefix + '-backspace-remove-message', this.props.multi && !this.props.disabled && this.state.isFocused && !this.state.inputValue), _classNames)); | ||
var value = this.state.inputValue; | ||
if (value && !this.props.onSelectResetsInput && !this.state.isFocused) { | ||
// it hides input value when it is not focused and was not reset on select | ||
value = ''; | ||
} | ||
var inputProps = _extends({}, this.props.inputProps, { | ||
role: 'combobox', | ||
'aria-activedescendant': isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value', | ||
'aria-describedby': this.props['aria-describedby'], | ||
'aria-expanded': '' + isOpen, | ||
'aria-owns': ariaOwns, | ||
'aria-haspopup': '' + isOpen, | ||
'aria-activedescendant': isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value', | ||
'aria-describedby': this.props['aria-describedby'], | ||
'aria-label': this.props['aria-label'], | ||
'aria-labelledby': this.props['aria-labelledby'], | ||
'aria-label': this.props['aria-label'], | ||
'aria-owns': ariaOwns, | ||
className: className, | ||
tabIndex: this.props.tabIndex, | ||
onBlur: this.handleInputBlur, | ||
@@ -1037,4 +1116,6 @@ onChange: this.handleInputChange, | ||
}, | ||
role: 'combobox', | ||
required: this.state.required, | ||
value: this.state.inputValue | ||
tabIndex: this.props.tabIndex, | ||
value: value | ||
}); | ||
@@ -1047,16 +1128,13 @@ | ||
if (this.props.disabled || !this.props.searchable) { | ||
var _props$inputProps = this.props.inputProps, | ||
inputClassName = _props$inputProps.inputClassName, | ||
divProps = _objectWithoutProperties(_props$inputProps, ['inputClassName']); | ||
var divProps = _objectWithoutProperties(this.props.inputProps, []); | ||
var _ariaOwns = (0, _classnames2.default)(_defineProperty({}, this._instancePrefix + '-list', isOpen)); | ||
return _react2.default.createElement('div', _extends({}, divProps, { | ||
role: 'combobox', | ||
'aria-expanded': isOpen, | ||
'aria-owns': _ariaOwns, | ||
'aria-activedescendant': isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value', | ||
'aria-disabled': '' + this.props.disabled, | ||
'aria-label': this.props['aria-label'], | ||
'aria-labelledby': this.props['aria-labelledby'], | ||
'aria-label': this.props['aria-label'], | ||
className: className, | ||
tabIndex: this.props.tabIndex || 0, | ||
onBlur: this.handleInputBlur, | ||
@@ -1067,4 +1145,6 @@ onFocus: this.handleInputFocus, | ||
}, | ||
'aria-disabled': '' + !!this.props.disabled, | ||
style: { border: 0, width: 1, display: 'inline-block' } })); | ||
role: 'combobox', | ||
style: { border: 0, width: 1, display: 'inline-block' }, | ||
tabIndex: this.props.tabIndex || 0 | ||
})); | ||
} | ||
@@ -1086,2 +1166,3 @@ | ||
if (!this.props.clearable || !valueArray.length || this.props.disabled || this.props.isLoading) return; | ||
var ariaLabel = this.props.multi ? this.props.clearAllText : this.props.clearValueText; | ||
var clear = this.props.clearRenderer(); | ||
@@ -1091,8 +1172,10 @@ | ||
'span', | ||
{ className: 'Select-clear-zone', title: this.props.multi ? this.props.clearAllText : this.props.clearValueText, | ||
'aria-label': this.props.multi ? this.props.clearAllText : this.props.clearValueText, | ||
{ | ||
'aria-label': ariaLabel, | ||
className: 'Select-clear-zone', | ||
onMouseDown: this.clearValue, | ||
onTouchEnd: this.handleTouchEndClearValue, | ||
onTouchMove: this.handleTouchMove, | ||
onTouchStart: this.handleTouchStart, | ||
onTouchMove: this.handleTouchMove, | ||
onTouchEnd: this.handleTouchEndClearValue | ||
title: ariaLabel | ||
}, | ||
@@ -1140,4 +1223,4 @@ clear | ||
matchProp: this.props.matchProp, | ||
valueKey: this.props.valueKey, | ||
trimFilter: this.props.trimFilter | ||
trimFilter: this.props.trimFilter, | ||
valueKey: this.props.valueKey | ||
}); | ||
@@ -1232,2 +1315,3 @@ } else { | ||
onFocus: this.focusOption, | ||
onOptionRef: this.onOptionRef, | ||
onSelect: this.selectValue, | ||
@@ -1239,7 +1323,6 @@ optionClassName: this.props.optionClassName, | ||
options: options, | ||
removeValue: this.removeValue, | ||
selectValue: this.selectValue, | ||
removeValue: this.removeValue, | ||
valueArray: valueArray, | ||
valueKey: this.props.valueKey, | ||
onOptionRef: this.onOptionRef | ||
valueKey: this.props.valueKey | ||
}); | ||
@@ -1267,17 +1350,20 @@ } else if (this.props.noResultsText) { | ||
return _react2.default.createElement('input', { | ||
type: 'hidden', | ||
disabled: this.props.disabled, | ||
name: this.props.name, | ||
ref: function ref(_ref4) { | ||
return _this8.value = _ref4; | ||
}, | ||
name: this.props.name, | ||
value: value, | ||
disabled: this.props.disabled }); | ||
type: 'hidden', | ||
value: value | ||
}); | ||
} | ||
return valueArray.map(function (item, index) { | ||
return _react2.default.createElement('input', { key: 'hidden.' + index, | ||
return _react2.default.createElement('input', { | ||
disabled: _this8.props.disabled, | ||
key: 'hidden.' + index, | ||
name: _this8.props.name, | ||
ref: 'value' + index, | ||
type: 'hidden', | ||
ref: 'value' + index, | ||
name: _this8.props.name, | ||
value: stringifyValue(item[_this8.props.valueKey]), | ||
disabled: _this8.props.disabled }); | ||
value: stringifyValue(item[_this8.props.valueKey]) | ||
}); | ||
}); | ||
@@ -1333,8 +1419,14 @@ } | ||
'div', | ||
{ ref: function ref(_ref5) { | ||
{ | ||
className: 'Select-menu', | ||
id: this._instancePrefix + '-list', | ||
onMouseDown: this.handleMouseDownOnMenu, | ||
onScroll: this.handleMenuScroll, | ||
ref: function ref(_ref5) { | ||
return _this9.menu = _ref5; | ||
}, role: 'listbox', tabIndex: -1, className: 'Select-menu', id: this._instancePrefix + '-list', | ||
}, | ||
role: 'listbox', | ||
style: this.props.menuStyle, | ||
onScroll: this.handleMenuScroll, | ||
onMouseDown: this.handleMouseDownOnMenu }, | ||
tabIndex: -1 | ||
}, | ||
menu | ||
@@ -1364,4 +1456,3 @@ ) | ||
var className = (0, _classnames2.default)('Select', this.props.className, { | ||
'Select--multi': this.props.multi, | ||
'Select--single': !this.props.multi, | ||
'has-value': valueArray.length, | ||
'is-clearable': this.props.clearable, | ||
@@ -1374,4 +1465,5 @@ 'is-disabled': this.props.disabled, | ||
'is-searchable': this.props.searchable, | ||
'has-value': valueArray.length, | ||
'Select--rtl': this.props.rtl | ||
'Select--multi': this.props.multi, | ||
'Select--rtl': this.props.rtl, | ||
'Select--single': !this.props.multi | ||
}); | ||
@@ -1402,8 +1494,8 @@ | ||
className: 'Select-control', | ||
style: this.props.style, | ||
onKeyDown: this.handleKeyDown, | ||
onMouseDown: this.handleMouseDown, | ||
onTouchEnd: this.handleTouchEnd, | ||
onTouchMove: this.handleTouchMove, | ||
onTouchStart: this.handleTouchStart, | ||
onTouchMove: this.handleTouchMove | ||
style: this.props.style | ||
}, | ||
@@ -1429,4 +1521,2 @@ _react2.default.createElement( | ||
; | ||
Select.propTypes = { | ||
@@ -1544,4 +1634,4 @@ 'aria-describedby': _propTypes2.default.string, // HTML ID(s) of element(s) that should be used to describe this input (for assistive tech) | ||
onBlurResetsInput: true, | ||
onCloseResetsInput: true, | ||
onSelectResetsInput: true, | ||
onCloseResetsInput: true, | ||
openOnClick: true, | ||
@@ -1548,0 +1638,0 @@ optionComponent: _Option2.default, |
@@ -6,3 +6,2 @@ 'use strict'; | ||
}); | ||
exports.default = arrowRenderer; | ||
@@ -19,3 +18,3 @@ var _react = require('react'); | ||
function arrowRenderer(_ref) { | ||
var arrowRenderer = function arrowRenderer(_ref) { | ||
var onMouseDown = _ref.onMouseDown; | ||
@@ -31,2 +30,4 @@ | ||
onMouseDown: _propTypes2.default.func | ||
}; | ||
}; | ||
exports.default = arrowRenderer; |
@@ -6,3 +6,2 @@ 'use strict'; | ||
}); | ||
exports.default = clearRenderer; | ||
@@ -15,3 +14,3 @@ var _react = require('react'); | ||
function clearRenderer() { | ||
var clearRenderer = function clearRenderer() { | ||
return _react2.default.createElement('span', { | ||
@@ -21,2 +20,4 @@ className: 'Select-clear', | ||
}); | ||
}; | ||
}; | ||
exports.default = clearRenderer; |
@@ -17,5 +17,7 @@ 'use strict'; | ||
function filterOptions(options, filterValue, excludeOptions, props) { | ||
var _this = this; | ||
var isValid = function isValid(value) { | ||
return typeof value !== 'undefined' && value !== null && value !== ''; | ||
}; | ||
var filterOptions = function filterOptions(options, filterValue, excludeOptions, props) { | ||
if (props.ignoreAccents) { | ||
@@ -39,20 +41,31 @@ filterValue = (0, _stripDiacritics2.default)(filterValue); | ||
if (excludeOptions && excludeOptions.indexOf(option[props.valueKey]) > -1) return false; | ||
if (props.filterOption) return props.filterOption.call(_this, option, filterValue); | ||
if (props.filterOption) return props.filterOption.call(undefined, option, filterValue); | ||
if (!filterValue) return true; | ||
var valueTest = String(option[props.valueKey]); | ||
var labelTest = String(option[props.labelKey]); | ||
var value = option[props.valueKey]; | ||
var label = option[props.labelKey]; | ||
var hasValue = isValid(value); | ||
var hasLabel = isValid(label); | ||
if (!hasValue && !hasLabel) { | ||
return false; | ||
} | ||
var valueTest = hasValue ? String(value) : null; | ||
var labelTest = hasLabel ? String(label) : null; | ||
if (props.ignoreAccents) { | ||
if (props.matchProp !== 'label') valueTest = (0, _stripDiacritics2.default)(valueTest); | ||
if (props.matchProp !== 'value') labelTest = (0, _stripDiacritics2.default)(labelTest); | ||
if (valueTest && props.matchProp !== 'label') valueTest = (0, _stripDiacritics2.default)(valueTest); | ||
if (labelTest && props.matchProp !== 'value') labelTest = (0, _stripDiacritics2.default)(labelTest); | ||
} | ||
if (props.ignoreCase) { | ||
if (props.matchProp !== 'label') valueTest = valueTest.toLowerCase(); | ||
if (props.matchProp !== 'value') labelTest = labelTest.toLowerCase(); | ||
if (valueTest && props.matchProp !== 'label') valueTest = valueTest.toLowerCase(); | ||
if (labelTest && props.matchProp !== 'value') labelTest = labelTest.toLowerCase(); | ||
} | ||
return props.matchPos === 'start' ? props.matchProp !== 'label' && valueTest.substr(0, filterValue.length) === filterValue || props.matchProp !== 'value' && labelTest.substr(0, filterValue.length) === filterValue : props.matchProp !== 'label' && valueTest.indexOf(filterValue) >= 0 || props.matchProp !== 'value' && labelTest.indexOf(filterValue) >= 0; | ||
return props.matchPos === 'start' ? valueTest && props.matchProp !== 'label' && valueTest.substr(0, filterValue.length) === filterValue || labelTest && props.matchProp !== 'value' && labelTest.substr(0, filterValue.length) === filterValue : valueTest && props.matchProp !== 'label' && valueTest.indexOf(filterValue) >= 0 || labelTest && props.matchProp !== 'value' && labelTest.indexOf(filterValue) >= 0; | ||
}); | ||
} | ||
}; | ||
exports.default = filterOptions; |
@@ -11,2 +11,6 @@ 'use strict'; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _react = require('react'); | ||
@@ -18,7 +22,7 @@ | ||
function isGroup(option) { | ||
var isGroup = function isGroup(option) { | ||
return option && Array.isArray(option.options); | ||
} | ||
}; | ||
function menuRenderer(_ref) { | ||
var menuRenderer = function menuRenderer(_ref) { | ||
var focusedOption = _ref.focusedOption, | ||
@@ -28,3 +32,2 @@ focusOption = _ref.focusOption, | ||
instancePrefix = _ref.instancePrefix, | ||
labelKey = _ref.labelKey, | ||
onFocus = _ref.onFocus, | ||
@@ -45,3 +48,3 @@ onOptionRef = _ref.onOptionRef, | ||
var Option = optionComponent; | ||
var renderLabel = optionRenderer || this.getOptionLabel; | ||
var renderLabel = optionRenderer; | ||
@@ -105,4 +108,22 @@ var renderOptions = function renderOptions(optionsSubset) { | ||
return renderOptions(options); | ||
} | ||
}; | ||
menuRenderer.propTypes = { | ||
focusOption: _propTypes2.default.func, | ||
focusedOption: _propTypes2.default.object, | ||
inputValue: _propTypes2.default.string, | ||
instancePrefix: _propTypes2.default.string, | ||
onFocus: _propTypes2.default.func, | ||
onOptionRef: _propTypes2.default.func, | ||
onSelect: _propTypes2.default.func, | ||
optionClassName: _propTypes2.default.string, | ||
optionComponent: _propTypes2.default.func, | ||
optionRenderer: _propTypes2.default.func, | ||
options: _propTypes2.default.array, | ||
removeValue: _propTypes2.default.func, | ||
selectValue: _propTypes2.default.func, | ||
valueArray: _propTypes2.default.array, | ||
valueKey: _propTypes2.default.string | ||
}; | ||
exports.default = menuRenderer; |
@@ -6,6 +6,5 @@ 'use strict'; | ||
}); | ||
exports.default = stripDiacritics; | ||
var map = [{ 'base': 'A', 'letters': /[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g }, { 'base': 'AA', 'letters': /[\uA732]/g }, { 'base': 'AE', 'letters': /[\u00C6\u01FC\u01E2]/g }, { 'base': 'AO', 'letters': /[\uA734]/g }, { 'base': 'AU', 'letters': /[\uA736]/g }, { 'base': 'AV', 'letters': /[\uA738\uA73A]/g }, { 'base': 'AY', 'letters': /[\uA73C]/g }, { 'base': 'B', 'letters': /[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g }, { 'base': 'C', 'letters': /[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g }, { 'base': 'D', 'letters': /[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g }, { 'base': 'DZ', 'letters': /[\u01F1\u01C4]/g }, { 'base': 'Dz', 'letters': /[\u01F2\u01C5]/g }, { 'base': 'E', 'letters': /[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g }, { 'base': 'F', 'letters': /[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g }, { 'base': 'G', 'letters': /[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g }, { 'base': 'H', 'letters': /[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g }, { 'base': 'I', 'letters': /[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g }, { 'base': 'J', 'letters': /[\u004A\u24BF\uFF2A\u0134\u0248]/g }, { 'base': 'K', 'letters': /[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g }, { 'base': 'L', 'letters': /[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g }, { 'base': 'LJ', 'letters': /[\u01C7]/g }, { 'base': 'Lj', 'letters': /[\u01C8]/g }, { 'base': 'M', 'letters': /[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g }, { 'base': 'N', 'letters': /[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g }, { 'base': 'NJ', 'letters': /[\u01CA]/g }, { 'base': 'Nj', 'letters': /[\u01CB]/g }, { 'base': 'O', 'letters': /[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g }, { 'base': 'OI', 'letters': /[\u01A2]/g }, { 'base': 'OO', 'letters': /[\uA74E]/g }, { 'base': 'OU', 'letters': /[\u0222]/g }, { 'base': 'P', 'letters': /[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g }, { 'base': 'Q', 'letters': /[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g }, { 'base': 'R', 'letters': /[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g }, { 'base': 'S', 'letters': /[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g }, { 'base': 'T', 'letters': /[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g }, { 'base': 'TZ', 'letters': /[\uA728]/g }, { 'base': 'U', 'letters': /[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g }, { 'base': 'V', 'letters': /[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g }, { 'base': 'VY', 'letters': /[\uA760]/g }, { 'base': 'W', 'letters': /[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g }, { 'base': 'X', 'letters': /[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g }, { 'base': 'Y', 'letters': /[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g }, { 'base': 'Z', 'letters': /[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g }, { 'base': 'a', 'letters': /[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g }, { 'base': 'aa', 'letters': /[\uA733]/g }, { 'base': 'ae', 'letters': /[\u00E6\u01FD\u01E3]/g }, { 'base': 'ao', 'letters': /[\uA735]/g }, { 'base': 'au', 'letters': /[\uA737]/g }, { 'base': 'av', 'letters': /[\uA739\uA73B]/g }, { 'base': 'ay', 'letters': /[\uA73D]/g }, { 'base': 'b', 'letters': /[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g }, { 'base': 'c', 'letters': /[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g }, { 'base': 'd', 'letters': /[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g }, { 'base': 'dz', 'letters': /[\u01F3\u01C6]/g }, { 'base': 'e', 'letters': /[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g }, { 'base': 'f', 'letters': /[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g }, { 'base': 'g', 'letters': /[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g }, { 'base': 'h', 'letters': /[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g }, { 'base': 'hv', 'letters': /[\u0195]/g }, { 'base': 'i', 'letters': /[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g }, { 'base': 'j', 'letters': /[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g }, { 'base': 'k', 'letters': /[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g }, { 'base': 'l', 'letters': /[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g }, { 'base': 'lj', 'letters': /[\u01C9]/g }, { 'base': 'm', 'letters': /[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g }, { 'base': 'n', 'letters': /[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g }, { 'base': 'nj', 'letters': /[\u01CC]/g }, { 'base': 'o', 'letters': /[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g }, { 'base': 'oi', 'letters': /[\u01A3]/g }, { 'base': 'ou', 'letters': /[\u0223]/g }, { 'base': 'oo', 'letters': /[\uA74F]/g }, { 'base': 'p', 'letters': /[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g }, { 'base': 'q', 'letters': /[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g }, { 'base': 'r', 'letters': /[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g }, { 'base': 's', 'letters': /[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g }, { 'base': 't', 'letters': /[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g }, { 'base': 'tz', 'letters': /[\uA729]/g }, { 'base': 'u', 'letters': /[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g }, { 'base': 'v', 'letters': /[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g }, { 'base': 'vy', 'letters': /[\uA761]/g }, { 'base': 'w', 'letters': /[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g }, { 'base': 'x', 'letters': /[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g }, { 'base': 'y', 'letters': /[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g }, { 'base': 'z', 'letters': /[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g }]; | ||
function stripDiacritics(str) { | ||
var stripDiacritics = function stripDiacritics(str) { | ||
for (var i = 0; i < map.length; i++) { | ||
@@ -15,2 +14,4 @@ str = str.replace(map[i].letters, map[i].base); | ||
return str; | ||
}; | ||
}; | ||
exports.default = stripDiacritics; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
exports.default = trim; | ||
function trim(str) { | ||
return str.replace(/^\s+|\s+$/g, ''); | ||
} | ||
var trim = function trim(str) { | ||
return str.replace(/^\s+|\s+$/g, ''); | ||
}; | ||
exports.default = trim; |
@@ -9,5 +9,5 @@ 'use strict'; | ||
var _react = require('react'); | ||
var _classnames = require('classnames'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
@@ -18,5 +18,5 @@ var _propTypes = require('prop-types'); | ||
var _classnames = require('classnames'); | ||
var _react = require('react'); | ||
var _classnames2 = _interopRequireDefault(_classnames); | ||
var _react2 = _interopRequireDefault(_react); | ||
@@ -81,3 +81,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
key: 'handleTouchMove', | ||
value: function handleTouchMove(event) { | ||
value: function handleTouchMove() { | ||
// Set a flag that the view is being dragged | ||
@@ -88,3 +88,3 @@ this.dragging = true; | ||
key: 'handleTouchStart', | ||
value: function handleTouchStart(event) { | ||
value: function handleTouchStart() { | ||
// Set a flag that the view is not being dragged | ||
@@ -140,4 +140,2 @@ this.dragging = false; | ||
; | ||
Value.propTypes = { | ||
@@ -144,0 +142,0 @@ children: _propTypes2.default.node, |
{ | ||
"name": "react-select-plus", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A fork of react-select with support for option groups", | ||
@@ -18,3 +18,3 @@ "main": "lib/index.js", | ||
"prop-types": "^15.5.8", | ||
"react-input-autosize": "^2.1.0" | ||
"react-input-autosize": "^2.1.2" | ||
}, | ||
@@ -28,3 +28,3 @@ "devDependencies": { | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.8", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-react": "^6.24.1", | ||
@@ -88,5 +88,5 @@ "babel-preset-stage-0": "^6.24.1", | ||
"lint": "eslint .", | ||
"deploy": "NODE_ENV=production nps publish", | ||
"deploy": "cross-env NODE_ENV=production nps publish", | ||
"start": "webpack-dev-server --progress", | ||
"test": "NODE_ENV=test mocha --compilers js:babel-core/register", | ||
"test": "cross-env NODE_ENV=test mocha --compilers js:babel-core/register", | ||
"precommit": "lint-staged && yarn run test" | ||
@@ -93,0 +93,0 @@ }, |
@@ -63,6 +63,9 @@ # React-Select-Plus | ||
render() { | ||
const { selectedOption } = this.state; | ||
const value = selectedOption && selectedOption.value; | ||
return ( | ||
<Select | ||
name="form-field-name" | ||
value={this.state.value} | ||
value={value} | ||
onChange={this.handleChange} | ||
@@ -403,3 +406,3 @@ options={[ | ||
| `onBlur` | function | undefined | onBlur handler: `function(event) {}` | | ||
| `onBlurResetsInput` | boolean | true | whether to clear input on blur or not | | ||
| `onBlurResetsInput` | boolean | true | Whether to clear input on blur or not. If set to false, it only works if onCloseResetsInput is false as well. | | ||
| `onChange` | function | undefined | onChange handler: `function(newOption) {}` | | ||
@@ -413,3 +416,3 @@ | `onClose` | function | undefined | handler for when the menu closes: `function () {}` | | ||
| `onOpen` | function | undefined | handler for when the menu opens: `function () {}` | | ||
| `onSelectResetsInput` | boolean | true | whether the input value should be reset when options are selected, for `multi` | ||
| `onSelectResetsInput` | boolean | true | whether the input value should be reset when options are selected. Also input value will be set to empty if 'onSelectResetsInput=true' and Select will get new value that not equal previous value. | | ||
| `onValueClick` | function | undefined | onClick handler for value labels: `function (value, event) {}` | | ||
@@ -416,0 +419,0 @@ | `openOnClick` | boolean | true | open the options menu when the control is clicked (requires searchable = true) | |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
493881
40
8616
483
Updatedreact-input-autosize@^2.1.2