diff --git a/dist/react-select.css b/dist/react-select.css index 867a5bf8a2..fe067509c7 100644 --- a/dist/react-select.css +++ b/dist/react-select.css @@ -113,8 +113,10 @@ font-size: inherit; margin: 0; outline: none; - line-height: 14px; /* For IE 8 compatibility */ - padding: 8px 0 12px; /* For IE 8 compatibility */ + line-height: 14px; + /* For IE 8 compatibility */ + padding: 8px 0 12px; + /* For IE 8 compatibility */ -webkit-appearance: none; } .is-focused .Select-input > input { @@ -240,8 +242,15 @@ border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } +.Select-option.is-selected { + background-color: #f5faff; + /* Fallback color for IE 8 */ + background-color: rgba(0, 126, 255, 0.04); + color: #333; +} .Select-option.is-focused { - background-color: rgb(235, 245, 255); /* Fallback color for IE 8 */ + background-color: #ebf5ff; + /* Fallback color for IE 8 */ background-color: rgba(0, 126, 255, 0.08); color: #333; } @@ -265,10 +274,10 @@ margin-left: 5px; } .Select--multi .Select-value { - background-color: rgb(235, 245, 255); /* Fallback color for IE 8 */ + background-color: #ebf5ff; + /* Fallback color for IE 8 */ background-color: rgba(0, 126, 255, 0.08); border-radius: 2px; - border: 1px solid rgb(178, 215, 254); /* Fallback color for IE 8 */ border: 1px solid rgba(0, 126, 255, 0.24); color: #007eff; display: inline-block; @@ -301,18 +310,21 @@ cursor: pointer; border-bottom-left-radius: 2px; border-top-left-radius: 2px; - border-right: 1px solid rgb(178, 215, 254); /* Fallback color for IE 8 */ + border-right: 1px solid #c2e0ff; + /* Fallback color for IE 8 */ border-right: 1px solid rgba(0, 126, 255, 0.24); padding: 1px 5px 3px; } .Select--multi .Select-value-icon:hover, .Select--multi .Select-value-icon:focus { - background-color: rgb(216, 234, 253); /* Fallback color for IE 8 */ + background-color: #d8eafd; + /* Fallback color for IE 8 */ background-color: rgba(0, 113, 230, 0.08); color: #0071e6; } .Select--multi .Select-value-icon:active { - background-color: rgb(178, 215, 254); /* Fallback color for IE 8 */ + background-color: #c2e0ff; + /* Fallback color for IE 8 */ background-color: rgba(0, 126, 255, 0.24); } .Select--multi.is-disabled .Select-value { diff --git a/dist/react-select.js b/dist/react-select.js index 9f2a82ab25..2bf25c4af2 100644 --- a/dist/react-select.js +++ b/dist/react-select.js @@ -64,7 +64,8 @@ var Async = _react2['default'].createClass({ loadOptions: _react2['default'].PropTypes.func.isRequired, // function to call to load options asynchronously loadingPlaceholder: _react2['default'].PropTypes.string, // replaces the placeholder while options are loading minimumInput: _react2['default'].PropTypes.number, // the minimum number of characters that trigger loadOptions - noResultsText: _react2['default'].PropTypes.string, // placeholder displayed when there are no matching search results (shared with Select) + noResultsText: stringOrNode, // placeholder displayed when there are no matching search results (shared with Select) + onInputChange: _react2['default'].PropTypes.func, // onInputChange handler: function (inputValue) {} placeholder: stringOrNode, // field placeholder, displayed when there's no value (shared with Select) searchPromptText: _react2['default'].PropTypes.string, // label to prompt for search input searchingText: _react2['default'].PropTypes.string }, @@ -126,6 +127,13 @@ var Async = _react2['default'].createClass({ }; }, loadOptions: function loadOptions(input) { + if (this.props.onInputChange) { + var nextState = this.props.onInputChange(input); + // Note: != used deliberately here to catch undefined and null + if (nextState != null) { + input = '' + nextState; + } + } if (this.props.ignoreAccents) input = (0, _utilsStripDiacritics2['default'])(input); if (this.props.ignoreCase) input = input.toLowerCase(); this._lastInput = input; @@ -339,7 +347,7 @@ var Select = _react2['default'].createClass({ propTypes: { addLabelText: _react2['default'].PropTypes.string, // placeholder displayed when you want to add a label on a multi-value input allowCreate: _react2['default'].PropTypes.bool, // whether to allow creation of new entries - autoBlur: _react2['default'].PropTypes.bool, + autoBlur: _react2['default'].PropTypes.bool, // automatically blur the component when an option is selected autofocus: _react2['default'].PropTypes.bool, // autofocus the component on mount autosize: _react2['default'].PropTypes.bool, // whether to enable autosizing or not backspaceRemoves: _react2['default'].PropTypes.bool, // whether backspace removes an item if there is no text input @@ -355,6 +363,7 @@ var Select = _react2['default'].createClass({ ignoreAccents: _react2['default'].PropTypes.bool, // whether to strip diacritics when filtering ignoreCase: _react2['default'].PropTypes.bool, // whether to perform case-insensitive filtering inputProps: _react2['default'].PropTypes.object, // custom attributes for the Input + inputRenderer: _react2['default'].PropTypes.func, // returns a custom input component isLoading: _react2['default'].PropTypes.bool, // whether the Select is loading externally or not (such as options being loaded) joinValues: _react2['default'].PropTypes.bool, // joins multiple values into a single form field with the delimiter (legacy mode) labelKey: _react2['default'].PropTypes.string, // path of the label value in option objects @@ -378,17 +387,20 @@ var Select = _react2['default'].createClass({ onOpen: _react2['default'].PropTypes.func, // fires when the menu is opened onValueClick: _react2['default'].PropTypes.func, // onClick handler for value labels: function (value, event) {} openAfterFocus: _react2['default'].PropTypes.bool, // boolean to enable opening dropdown when focused + openOnFocus: _react2['default'].PropTypes.bool, // always open options menu on focus optionClassName: _react2['default'].PropTypes.string, // additional class(es) to apply to the