Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ran build update dist files #1285

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 43 additions & 15 deletions dist/react-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ var propTypes = {
children: _react2['default'].PropTypes.func.isRequired, // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element
ignoreAccents: _react2['default'].PropTypes.bool, // strip diacritics when filtering; defaults to true
ignoreCase: _react2['default'].PropTypes.bool, // perform case-insensitive filtering; defaults to true
loadingPlaceholder: _react.PropTypes.string.isRequired, // replaces the placeholder while options are loading
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
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]),
searchPromptText: _react2['default'].PropTypes.oneOfType([// label to prompt for search input
_react2['default'].PropTypes.string, _react2['default'].PropTypes.node])
};
_react2['default'].PropTypes.string, _react2['default'].PropTypes.node]),
onInputChange: _react2['default'].PropTypes.func };

// optional for keeping track of what is being typed
var defaultProps = {
autoload: true,
cache: {},
Expand Down Expand Up @@ -155,6 +157,7 @@ var Async = (function (_Component) {
var _props2 = this.props;
var ignoreAccents = _props2.ignoreAccents;
var ignoreCase = _props2.ignoreCase;
var onInputChange = _props2.onInputChange;

if (ignoreAccents) {
inputValue = (0, _utilsStripDiacritics2['default'])(inputValue);
Expand All @@ -164,11 +167,17 @@ var Async = (function (_Component) {
inputValue = inputValue.toLowerCase();
}

if (onInputChange) {
onInputChange(inputValue);
}

return this.loadOptions(inputValue);
}
}, {
key: 'render',
value: function render() {
var _this3 = this;

var _props3 = this.props;
var children = _props3.children;
var loadingPlaceholder = _props3.loadingPlaceholder;
Expand All @@ -181,7 +190,10 @@ var Async = (function (_Component) {
var props = {
noResultsText: isLoading ? loadingPlaceholder : searchPromptText,
placeholder: isLoading ? loadingPlaceholder : placeholder,
options: isLoading ? [] : options
options: isLoading ? [] : options,
ref: function ref(_ref) {
return _this3.select = _ref;
}
};

return children(_extends({}, this.props, props, {
Expand Down Expand Up @@ -433,7 +445,9 @@ var Creatable = _react2['default'].createClass({
},

onInputKeyDown: function onInputKeyDown(event) {
var shouldKeyDownEventCreateNewOption = this.props.shouldKeyDownEventCreateNewOption;
var _props3 = this.props;
var shouldKeyDownEventCreateNewOption = _props3.shouldKeyDownEventCreateNewOption;
var onInputKeyDown = _props3.onInputKeyDown;

var focusedOption = this.select.getFocusedOption();

Expand All @@ -442,6 +456,8 @@ var Creatable = _react2['default'].createClass({

// Prevent decorated Select from doing anything additional with this keyDown event
event.preventDefault();
} else if (onInputKeyDown) {
onInputKeyDown(event);
}
},

Expand All @@ -456,13 +472,13 @@ var Creatable = _react2['default'].createClass({
render: function render() {
var _this = this;

var _props3 = this.props;
var _props3$children = _props3.children;
var children = _props3$children === undefined ? defaultChildren : _props3$children;
var newOptionCreator = _props3.newOptionCreator;
var shouldKeyDownEventCreateNewOption = _props3.shouldKeyDownEventCreateNewOption;
var _props4 = this.props;
var _props4$children = _props4.children;
var children = _props4$children === undefined ? defaultChildren : _props4$children;
var newOptionCreator = _props4.newOptionCreator;
var shouldKeyDownEventCreateNewOption = _props4.shouldKeyDownEventCreateNewOption;

var restProps = _objectWithoutProperties(_props3, ['children', 'newOptionCreator', 'shouldKeyDownEventCreateNewOption']);
var restProps = _objectWithoutProperties(_props4, ['children', 'newOptionCreator', 'shouldKeyDownEventCreateNewOption']);

var props = _extends({}, restProps, {
allowCreate: true,
Expand Down Expand Up @@ -938,14 +954,26 @@ var Select = _react2['default'].createClass({
},

componentWillUnmount: function componentWillUnmount() {
document.removeEventListener('touchstart', this.handleTouchOutside);
if (!document.removeEventListener && document.detachEvent) {
document.detachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.removeEventListener('touchstart', this.handleTouchOutside);
}
},

toggleTouchOutsideEvent: function toggleTouchOutsideEvent(enabled) {
if (enabled) {
document.addEventListener('touchstart', this.handleTouchOutside);
if (!document.addEventListener && document.attachEvent) {
document.attachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.addEventListener('touchstart', this.handleTouchOutside);
}
} else {
document.removeEventListener('touchstart', this.handleTouchOutside);
if (!document.removeEventListener && document.detachEvent) {
document.detachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.removeEventListener('touchstart', this.handleTouchOutside);
}
}
},

Expand Down Expand Up @@ -1601,7 +1629,7 @@ var Select = _react2['default'].createClass({
}

if (this.props.autosize) {
return _react2['default'].createElement(_reactInputAutosize2['default'], _extends({}, inputProps, { minWidth: '5px' }));
return _react2['default'].createElement(_reactInputAutosize2['default'], _extends({}, inputProps, { minWidth: '5' }));
}
return _react2['default'].createElement(
'div',
Expand Down
4 changes: 2 additions & 2 deletions dist/react-select.min.js

Large diffs are not rendered by default.

3,602 changes: 1,799 additions & 1,803 deletions examples/dist/app.js

Large diffs are not rendered by default.

58 changes: 43 additions & 15 deletions examples/dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@ var propTypes = {
children: _react2['default'].PropTypes.func.isRequired, // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element
ignoreAccents: _react2['default'].PropTypes.bool, // strip diacritics when filtering; defaults to true
ignoreCase: _react2['default'].PropTypes.bool, // perform case-insensitive filtering; defaults to true
loadingPlaceholder: _react.PropTypes.string.isRequired, // replaces the placeholder while options are loading
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
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]),
searchPromptText: _react2['default'].PropTypes.oneOfType([// label to prompt for search input
_react2['default'].PropTypes.string, _react2['default'].PropTypes.node])
};
_react2['default'].PropTypes.string, _react2['default'].PropTypes.node]),
onInputChange: _react2['default'].PropTypes.func };

// optional for keeping track of what is being typed
var defaultProps = {
autoload: true,
cache: {},
Expand Down Expand Up @@ -154,6 +156,7 @@ var Async = (function (_Component) {
var _props2 = this.props;
var ignoreAccents = _props2.ignoreAccents;
var ignoreCase = _props2.ignoreCase;
var onInputChange = _props2.onInputChange;

if (ignoreAccents) {
inputValue = (0, _utilsStripDiacritics2['default'])(inputValue);
Expand All @@ -163,11 +166,17 @@ var Async = (function (_Component) {
inputValue = inputValue.toLowerCase();
}

if (onInputChange) {
onInputChange(inputValue);
}

return this.loadOptions(inputValue);
}
}, {
key: 'render',
value: function render() {
var _this3 = this;

var _props3 = this.props;
var children = _props3.children;
var loadingPlaceholder = _props3.loadingPlaceholder;
Expand All @@ -180,7 +189,10 @@ var Async = (function (_Component) {
var props = {
noResultsText: isLoading ? loadingPlaceholder : searchPromptText,
placeholder: isLoading ? loadingPlaceholder : placeholder,
options: isLoading ? [] : options
options: isLoading ? [] : options,
ref: function ref(_ref) {
return _this3.select = _ref;
}
};

return children(_extends({}, this.props, props, {
Expand Down Expand Up @@ -428,7 +440,9 @@ var Creatable = _react2['default'].createClass({
},

onInputKeyDown: function onInputKeyDown(event) {
var shouldKeyDownEventCreateNewOption = this.props.shouldKeyDownEventCreateNewOption;
var _props3 = this.props;
var shouldKeyDownEventCreateNewOption = _props3.shouldKeyDownEventCreateNewOption;
var onInputKeyDown = _props3.onInputKeyDown;

var focusedOption = this.select.getFocusedOption();

Expand All @@ -437,6 +451,8 @@ var Creatable = _react2['default'].createClass({

// Prevent decorated Select from doing anything additional with this keyDown event
event.preventDefault();
} else if (onInputKeyDown) {
onInputKeyDown(event);
}
},

Expand All @@ -451,13 +467,13 @@ var Creatable = _react2['default'].createClass({
render: function render() {
var _this = this;

var _props3 = this.props;
var _props3$children = _props3.children;
var children = _props3$children === undefined ? defaultChildren : _props3$children;
var newOptionCreator = _props3.newOptionCreator;
var shouldKeyDownEventCreateNewOption = _props3.shouldKeyDownEventCreateNewOption;
var _props4 = this.props;
var _props4$children = _props4.children;
var children = _props4$children === undefined ? defaultChildren : _props4$children;
var newOptionCreator = _props4.newOptionCreator;
var shouldKeyDownEventCreateNewOption = _props4.shouldKeyDownEventCreateNewOption;

var restProps = _objectWithoutProperties(_props3, ['children', 'newOptionCreator', 'shouldKeyDownEventCreateNewOption']);
var restProps = _objectWithoutProperties(_props4, ['children', 'newOptionCreator', 'shouldKeyDownEventCreateNewOption']);

var props = _extends({}, restProps, {
allowCreate: true,
Expand Down Expand Up @@ -1182,14 +1198,26 @@ var Select = _react2['default'].createClass({
},

componentWillUnmount: function componentWillUnmount() {
document.removeEventListener('touchstart', this.handleTouchOutside);
if (!document.removeEventListener && document.detachEvent) {
document.detachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.removeEventListener('touchstart', this.handleTouchOutside);
}
},

toggleTouchOutsideEvent: function toggleTouchOutsideEvent(enabled) {
if (enabled) {
document.addEventListener('touchstart', this.handleTouchOutside);
if (!document.addEventListener && document.attachEvent) {
document.attachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.addEventListener('touchstart', this.handleTouchOutside);
}
} else {
document.removeEventListener('touchstart', this.handleTouchOutside);
if (!document.removeEventListener && document.detachEvent) {
document.detachEvent('ontouchstart', this.handleTouchOutside);
} else {
document.removeEventListener('touchstart', this.handleTouchOutside);
}
}
},

Expand Down Expand Up @@ -1845,7 +1873,7 @@ var Select = _react2['default'].createClass({
}

if (this.props.autosize) {
return _react2['default'].createElement(_reactInputAutosize2['default'], _extends({}, inputProps, { minWidth: '5px' }));
return _react2['default'].createElement(_reactInputAutosize2['default'], _extends({}, inputProps, { minWidth: '5' }));
}
return _react2['default'].createElement(
'div',
Expand Down
Loading