-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from RUVATA/v1.3.8
v1.3.8
- Loading branch information
Showing
6 changed files
with
66 additions
and
49 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
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 |
---|---|---|
|
@@ -195,11 +195,6 @@ var renderCustomActions = function renderCustomActions(_ref2, muteEventHandler, | |
|
||
var actions = customActions instanceof Function ? customActions(suggestions) : customActions; | ||
|
||
// ToDo: @remove in >= 1.3.5 | ||
if (!(customActions instanceof Function)) { | ||
console.warn('\x1b[31m' + '\n \u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E\n \u2502 [email protected] \u2502\n \u2502 *** DEPRECATION WARNING **** \u2502\n \u2502 at v1.3.5 will be deprecated variant to place customActions \u2502\n \u2502 as React.Element it must be placed only as function that \u2502\n \u2502 returns React.Element and take suggestions as argument \u2502\n \u2502 see more in project README.md \u2502\n \u2502 https://github.com/orbita-center/react-dadata-box \u2502\n \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F\n ' + '\x1b[0m'); | ||
} | ||
|
||
actions = actions instanceof Array ? actions : actions ? [actions] : false; | ||
|
||
return actions && actions.length ? [React.createElement('hr', { key: 'custom-actions-line', className: 'actions-delimiter' })].concat(actions.map(function (node) { | ||
|
@@ -387,8 +382,13 @@ var _initialiseProps = function _initialiseProps() { | |
} | ||
}; | ||
|
||
this.onInputBlur = function () { | ||
this.onInputBlur = function (e) { | ||
_this2.setState({ inputFocused: false }); | ||
if (e && _this2.props.onBlur) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
_this2.props.onBlur(e, _this2.state.query); | ||
} | ||
}; | ||
|
||
this.debounce = function (func) { | ||
|
@@ -552,6 +552,7 @@ ReactDaDataBox.propTypes = { | |
debounce: _propTypes2.default.number, | ||
forceOpenList: _propTypes2.default.bool, | ||
onChange: _propTypes2.default.func, | ||
onBlur: _propTypes2.default.func, | ||
onIdleOut: _propTypes2.default.func, | ||
payloadModifier: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.shape, _propTypes2.default.func]), | ||
placeholder: _propTypes2.default.string, | ||
|
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 |
---|---|---|
|
@@ -129,25 +129,6 @@ const renderCustomActions = ({ customActions, customStyles, suggestions }, muteE | |
|
||
let actions = customActions instanceof Function ? customActions(suggestions) : customActions; | ||
|
||
// ToDo: @remove in >= 1.3.5 | ||
if (!(customActions instanceof Function)) { | ||
console.warn( | ||
'\x1b[31m' + | ||
` | ||
╭────────────────────────────────────────────────────────────────╮ | ||
│ [email protected] │ | ||
│ *** DEPRECATION WARNING **** │ | ||
│ at v1.3.5 will be deprecated variant to place customActions │ | ||
│ as React.Element it must be placed only as function that │ | ||
│ returns React.Element and take suggestions as argument │ | ||
│ see more in project README.md │ | ||
│ https://github.com/orbita-center/react-dadata-box │ | ||
╰────────────────────────────────────────────────────────────────╯ | ||
` + | ||
'\x1b[0m' | ||
); | ||
} | ||
|
||
actions = actions instanceof Array ? actions : actions ? [actions] : false; | ||
|
||
return actions && actions.length | ||
|
@@ -261,8 +242,13 @@ class ReactDaDataBox extends React.PureComponent { | |
} | ||
}; | ||
|
||
onInputBlur = () => { | ||
onInputBlur = (e) => { | ||
this.setState({ inputFocused: false }); | ||
if (e && this.props.onBlur) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
this.props.onBlur(e, this.state.query); | ||
} | ||
}; | ||
|
||
debounce = (func, cooldown = 350) => { | ||
|
@@ -478,6 +464,7 @@ ReactDaDataBox.propTypes = { | |
debounce: PropTypes.number, | ||
forceOpenList: PropTypes.bool, | ||
onChange: PropTypes.func, | ||
onBlur: PropTypes.func, | ||
onIdleOut: PropTypes.func, | ||
payloadModifier: PropTypes.oneOfType([PropTypes.object, PropTypes.shape, PropTypes.func]), | ||
placeholder: PropTypes.string, | ||
|