-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge JedWatson/react-select#1213 into react-select-plus
- Loading branch information
Showing
19 changed files
with
1,339 additions
and
646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use strict'; | ||
|
||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
|
||
var _react = require('react'); | ||
|
||
var _react2 = _interopRequireDefault(_react); | ||
|
||
var _Select = require('./Select'); | ||
|
||
var _Select2 = _interopRequireDefault(_Select); | ||
|
||
var AsyncCreatable = _react2['default'].createClass({ | ||
displayName: 'AsyncCreatableSelect', | ||
|
||
render: function render() { | ||
var _this = this; | ||
|
||
return _react2['default'].createElement( | ||
_Select2['default'].Async, | ||
this.props, | ||
function (asyncProps) { | ||
return _react2['default'].createElement( | ||
_Select2['default'].Creatable, | ||
_this.props, | ||
function (creatableProps) { | ||
return _react2['default'].createElement(_Select2['default'], _extends({}, asyncProps, creatableProps, { | ||
onInputChange: function (input) { | ||
creatableProps.onInputChange(input); | ||
return asyncProps.onInputChange(input); | ||
}, | ||
ref: function (ref) { | ||
creatableProps.ref(ref); | ||
asyncProps.ref(ref); | ||
} | ||
})); | ||
} | ||
); | ||
} | ||
); | ||
} | ||
}); | ||
|
||
module.exports = AsyncCreatable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import Select from './Select'; | ||
|
||
const AsyncCreatable = React.createClass({ | ||
displayName: 'AsyncCreatableSelect', | ||
|
||
render () { | ||
return ( | ||
<Select.Async {...this.props}> | ||
{(asyncProps) => ( | ||
<Select.Creatable {...this.props}> | ||
{(creatableProps) => ( | ||
<Select | ||
{...asyncProps} | ||
{...creatableProps} | ||
onInputChange={(input) => { | ||
creatableProps.onInputChange(input); | ||
return asyncProps.onInputChange(input); | ||
}} | ||
ref={(ref) => { | ||
creatableProps.ref(ref); | ||
asyncProps.ref(ref); | ||
}} | ||
/> | ||
)} | ||
</Select.Creatable> | ||
)} | ||
</Select.Async> | ||
); | ||
} | ||
}); | ||
|
||
module.exports = AsyncCreatable; |
Oops, something went wrong.