Skip to content

Commit

Permalink
Create a new build
Browse files Browse the repository at this point in the history
  • Loading branch information
realplatanopapi committed May 5, 2017
1 parent 789312f commit 9de3d21
Show file tree
Hide file tree
Showing 10 changed files with 3,535 additions and 1,462 deletions.
31 changes: 25 additions & 6 deletions dist/react-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var propTypes = {
loadingPlaceholder: _react2['default'].PropTypes.oneOfType([// replaces the placeholder while options are loading
_react2['default'].PropTypes.string, _react2['default'].PropTypes.node]),
loadOptions: _react2['default'].PropTypes.func.isRequired, // callback to load options asynchronously; (inputValue: string, callback: Function): ?Promise
multi: _react2['default'].PropTypes.bool, // multi-value input
options: _react.PropTypes.array.isRequired, // array of options
placeholder: _react2['default'].PropTypes.oneOfType([// field placeholder, displayed when there's no value (shared with Select)
_react2['default'].PropTypes.string, _react2['default'].PropTypes.node]),
Expand Down Expand Up @@ -176,14 +177,14 @@ var Async = (function (_Component) {
inputValue = (0, _utilsStripDiacritics2['default'])(inputValue);
}

if (ignoreCase) {
inputValue = inputValue.toLowerCase();
}

if (onInputChange) {
onInputChange(inputValue);
}

if (ignoreCase) {
return this.loadOptions(inputValue.toLowerCase());
}

return this.loadOptions(inputValue);
}
}, {
Expand Down Expand Up @@ -296,6 +297,10 @@ function reduce(obj) {
var AsyncCreatable = _react2['default'].createClass({
displayName: 'AsyncCreatableSelect',

focus: function focus() {
this.select.focus();
},

render: function render() {
var _this = this;

Expand All @@ -313,6 +318,7 @@ var AsyncCreatable = _react2['default'].createClass({
return asyncProps.onInputChange(input);
},
ref: function (ref) {
_this.select = ref;
creatableProps.ref(ref);
asyncProps.ref(ref);
}
Expand Down Expand Up @@ -554,6 +560,10 @@ var Creatable = _react2['default'].createClass({
}
},

focus: function focus() {
this.select.focus();
},

render: function render() {
var _this = this;

Expand Down Expand Up @@ -859,6 +869,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
'aria-describedby': _react2['default'].PropTypes.string, // HTML ID(s) of element(s) that should be used to describe this input (for assistive tech)
'aria-label': _react2['default'].PropTypes.string, // Aria label (for assistive tech)
'aria-labelledby': _react2['default'].PropTypes.string, // HTML ID of an element that should be used as the label (for assistive tech)
arrowRenderer: _react2['default'].PropTypes.func, // Create drop-down caret element
Expand Down Expand Up @@ -1173,7 +1184,7 @@ var Select = _react2['default'].createClass({
});
} else {
// otherwise, focus the input and open the menu
this._openAfterFocus = true;
this._openAfterFocus = this.props.openOnFocus;
this.focus();
}
},
Expand Down Expand Up @@ -1706,6 +1717,7 @@ var Select = _react2['default'].createClass({
'aria-owns': ariaOwns,
'aria-haspopup': '' + isOpen,
'aria-activedescendant': isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value',
'aria-describedby': this.props['aria-describedby'],
'aria-labelledby': this.props['aria-labelledby'],
'aria-label': this.props['aria-label'],
className: className,
Expand Down Expand Up @@ -1877,7 +1889,14 @@ var Select = _react2['default'].createClass({

var focusedOption = this.state.focusedOption || selectedOption;
if (focusedOption && !focusedOption.disabled) {
var focusedOptionIndex = options.indexOf(focusedOption);
var focusedOptionIndex = -1;
options.some(function (option, index) {
var isOptionEqual = option.value === focusedOption.value;
if (isOptionEqual) {
focusedOptionIndex = index;
}
return isOptionEqual;
});
if (focusedOptionIndex !== -1) {
return focusedOptionIndex;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/react-select.min.js

Large diffs are not rendered by default.

1,061 changes: 948 additions & 113 deletions examples/dist/app.js

Large diffs are not rendered by default.

31 changes: 25 additions & 6 deletions examples/dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var propTypes = {
loadingPlaceholder: _react2['default'].PropTypes.oneOfType([// replaces the placeholder while options are loading
_react2['default'].PropTypes.string, _react2['default'].PropTypes.node]),
loadOptions: _react2['default'].PropTypes.func.isRequired, // callback to load options asynchronously; (inputValue: string, callback: Function): ?Promise
multi: _react2['default'].PropTypes.bool, // multi-value input
options: _react.PropTypes.array.isRequired, // array of options
placeholder: _react2['default'].PropTypes.oneOfType([// field placeholder, displayed when there's no value (shared with Select)
_react2['default'].PropTypes.string, _react2['default'].PropTypes.node]),
Expand Down Expand Up @@ -175,14 +176,14 @@ var Async = (function (_Component) {
inputValue = (0, _utilsStripDiacritics2['default'])(inputValue);
}

if (ignoreCase) {
inputValue = inputValue.toLowerCase();
}

if (onInputChange) {
onInputChange(inputValue);
}

if (ignoreCase) {
return this.loadOptions(inputValue.toLowerCase());
}

return this.loadOptions(inputValue);
}
}, {
Expand Down Expand Up @@ -293,6 +294,10 @@ function reduce(obj) {
var AsyncCreatable = _react2['default'].createClass({
displayName: 'AsyncCreatableSelect',

focus: function focus() {
this.select.focus();
},

render: function render() {
var _this = this;

Expand All @@ -310,6 +315,7 @@ var AsyncCreatable = _react2['default'].createClass({
return asyncProps.onInputChange(input);
},
ref: function (ref) {
_this.select = ref;
creatableProps.ref(ref);
asyncProps.ref(ref);
}
Expand Down Expand Up @@ -549,6 +555,10 @@ var Creatable = _react2['default'].createClass({
}
},

focus: function focus() {
this.select.focus();
},

render: function render() {
var _this = this;

Expand Down Expand Up @@ -1127,6 +1137,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
'aria-describedby': _react2['default'].PropTypes.string, // HTML ID(s) of element(s) that should be used to describe this input (for assistive tech)
'aria-label': _react2['default'].PropTypes.string, // Aria label (for assistive tech)
'aria-labelledby': _react2['default'].PropTypes.string, // HTML ID of an element that should be used as the label (for assistive tech)
arrowRenderer: _react2['default'].PropTypes.func, // Create drop-down caret element
Expand Down Expand Up @@ -1441,7 +1452,7 @@ var Select = _react2['default'].createClass({
});
} else {
// otherwise, focus the input and open the menu
this._openAfterFocus = true;
this._openAfterFocus = this.props.openOnFocus;
this.focus();
}
},
Expand Down Expand Up @@ -1974,6 +1985,7 @@ var Select = _react2['default'].createClass({
'aria-owns': ariaOwns,
'aria-haspopup': '' + isOpen,
'aria-activedescendant': isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value',
'aria-describedby': this.props['aria-describedby'],
'aria-labelledby': this.props['aria-labelledby'],
'aria-label': this.props['aria-label'],
className: className,
Expand Down Expand Up @@ -2145,7 +2157,14 @@ var Select = _react2['default'].createClass({

var focusedOption = this.state.focusedOption || selectedOption;
if (focusedOption && !focusedOption.disabled) {
var focusedOptionIndex = options.indexOf(focusedOption);
var focusedOptionIndex = -1;
options.some(function (option, index) {
var isOptionEqual = option.value === focusedOption.value;
if (isOptionEqual) {
focusedOptionIndex = index;
}
return isOptionEqual;
});
if (focusedOptionIndex !== -1) {
return focusedOptionIndex;
}
Expand Down
Loading

0 comments on commit 9de3d21

Please sign in to comment.