react-select-plus
Advanced tools
Comparing version 1.0.0-rc.3.patch10 to 1.0.0-rc.3.patch11
@@ -250,8 +250,2 @@ 'use strict'; | ||
return _this3.select = _ref; | ||
}, | ||
onChange: function onChange(newValues) { | ||
if (_this3.props.multi && _this3.props.value && newValues.length > _this3.props.value.length) { | ||
_this3.clearOptions(); | ||
} | ||
_this3.props.onChange(newValues); | ||
} | ||
@@ -258,0 +252,0 @@ }; |
@@ -501,2 +501,4 @@ /*! | ||
closeMenu: function closeMenu() { | ||
var _this = this; | ||
if (this.props.onCloseResetsInput) { | ||
@@ -507,2 +509,4 @@ this.setState({ | ||
inputValue: '' | ||
}, function () { | ||
if (_this.props.onInputChange) _this.props.onInputChange(''); | ||
}); | ||
@@ -598,3 +602,8 @@ } else { | ||
// enter | ||
if (!this.state.isOpen) return; | ||
if (!this.state.isOpen) { | ||
this.setState({ | ||
isOpen: true | ||
}); | ||
return; | ||
}; | ||
event.stopPropagation(); | ||
@@ -686,3 +695,3 @@ this.selectFocusedOption(); | ||
getValueArray: function getValueArray(value, nextProps) { | ||
var _this = this; | ||
var _this2 = this; | ||
@@ -698,3 +707,3 @@ /** support optionally passing in the `nextProps` so `componentWillReceiveProps` updates will function as expected */ | ||
return value.map(function (value) { | ||
return _this.expandValue(value, props); | ||
return _this2.expandValue(value, props); | ||
}).filter(function (i) { | ||
@@ -739,3 +748,3 @@ return i; | ||
setValue: function setValue(value) { | ||
var _this2 = this; | ||
var _this3 = this; | ||
@@ -752,3 +761,3 @@ if (this.props.autoBlur) { | ||
value = this.props.multi ? value.map(function (i) { | ||
return i[_this2.props.valueKey]; | ||
return i[_this3.props.valueKey]; | ||
}).join(this.props.delimiter) : value[this.props.valueKey]; | ||
@@ -760,3 +769,3 @@ } | ||
selectValue: function selectValue(value) { | ||
var _this3 = this; | ||
var _this4 = this; | ||
@@ -770,3 +779,4 @@ //NOTE: update value in the callback to make sure the input value is empty so that there are no styling issues (Chrome had issue otherwise) | ||
}, function () { | ||
_this3.addValue(value); | ||
_this4.addValue(value); | ||
if (_this4.props.onInputChange) _this4.props.onInputChange(''); | ||
}); | ||
@@ -779,3 +789,4 @@ } else { | ||
}, function () { | ||
_this3.setValue(value); | ||
_this4.setValue(value); | ||
if (_this4.props.onInputChange) _this4.props.onInputChange(''); | ||
}); | ||
@@ -816,2 +827,4 @@ } | ||
clearValue: function clearValue(event) { | ||
var _this5 = this; | ||
// if the event was triggered by a mousedown and not the primary | ||
@@ -828,3 +841,6 @@ // button, ignore it. | ||
inputValue: '' | ||
}, this.focus); | ||
}, function () { | ||
_this5.focus(); | ||
if (_this5.props.onInputChange) _this5.props.onInputChange(''); | ||
}); | ||
}, | ||
@@ -873,2 +889,4 @@ | ||
focusAdjacentOption: function focusAdjacentOption(dir) { | ||
var _this6 = this; | ||
var options = this._visibleOptions.map(function (option, index) { | ||
@@ -885,2 +903,4 @@ return { option: option, index: index }; | ||
focusedOption: this._focusedOption || (options.length ? options[dir === 'next' ? 0 : options.length - 1].option : null) | ||
}, function () { | ||
if (_this6.props.onInputChange) _this6.props.onInputChange(''); | ||
}); | ||
@@ -959,3 +979,3 @@ return; | ||
renderValue: function renderValue(valueArray, isOpen) { | ||
var _this4 = this; | ||
var _this7 = this; | ||
@@ -977,8 +997,8 @@ var renderLabel = this.props.valueRenderer || this.getOptionLabel; | ||
{ | ||
id: _this4._instancePrefix + '-value-' + i, | ||
instancePrefix: _this4._instancePrefix, | ||
disabled: _this4.props.disabled || value.clearableValue === false, | ||
key: 'value-' + i + '-' + value[_this4.props.valueKey], | ||
id: _this7._instancePrefix + '-value-' + i, | ||
instancePrefix: _this7._instancePrefix, | ||
disabled: _this7.props.disabled || value.clearableValue === false, | ||
key: 'value-' + i + '-' + value[_this7.props.valueKey], | ||
onClick: onClick, | ||
onRemove: _this4.removeValue, | ||
onRemove: _this7.removeValue, | ||
value: value | ||
@@ -1012,3 +1032,3 @@ }, | ||
var _classNames, | ||
_this5 = this; | ||
_this8 = this; | ||
@@ -1036,3 +1056,3 @@ var className = (0, _classnames2['default'])('Select-input', this.props.inputProps.className); | ||
ref: function ref(_ref2) { | ||
return _this5.input = _ref2; | ||
return _this8.input = _ref2; | ||
}, | ||
@@ -1063,3 +1083,3 @@ required: this.state.required, | ||
ref: function (ref) { | ||
return _this5.input = ref; | ||
return _this8.input = ref; | ||
}, | ||
@@ -1229,3 +1249,3 @@ 'aria-readonly': '' + !!this.props.disabled, | ||
renderHiddenField: function renderHiddenField(valueArray) { | ||
var _this6 = this; | ||
var _this9 = this; | ||
@@ -1235,3 +1255,3 @@ if (!this.props.name) return; | ||
var value = valueArray.map(function (i) { | ||
return stringifyValue(i[_this6.props.valueKey]); | ||
return stringifyValue(i[_this9.props.valueKey]); | ||
}).join(this.props.delimiter); | ||
@@ -1241,3 +1261,3 @@ return _react2['default'].createElement('input', { | ||
ref: function (ref) { | ||
return _this6.value = ref; | ||
return _this9.value = ref; | ||
}, | ||
@@ -1252,5 +1272,5 @@ name: this.props.name, | ||
ref: 'value' + index, | ||
name: _this6.props.name, | ||
value: stringifyValue(item[_this6.props.valueKey]), | ||
disabled: _this6.props.disabled }); | ||
name: _this9.props.name, | ||
value: stringifyValue(item[_this9.props.valueKey]), | ||
disabled: _this9.props.disabled }); | ||
}); | ||
@@ -1285,3 +1305,3 @@ }, | ||
renderOuter: function renderOuter(options, valueArray, focusedOption) { | ||
var _this7 = this; | ||
var _this10 = this; | ||
@@ -1300,3 +1320,3 @@ var Dropdown = this.props.dropdownComponent; | ||
{ ref: function (ref) { | ||
return _this7.menuContainer = ref; | ||
return _this10.menuContainer = ref; | ||
}, className: 'Select-menu-outer', style: this.props.menuContainerStyle }, | ||
@@ -1306,3 +1326,3 @@ _react2['default'].createElement( | ||
{ ref: function (ref) { | ||
return _this7.menu = ref; | ||
return _this10.menu = ref; | ||
}, role: 'listbox', className: 'Select-menu', id: this._instancePrefix + '-list', | ||
@@ -1319,3 +1339,3 @@ style: this.props.menuStyle, | ||
render: function render() { | ||
var _this8 = this; | ||
var _this11 = this; | ||
@@ -1358,3 +1378,3 @@ var valueArray = this.getValueArray(this.props.value); | ||
{ ref: function (ref) { | ||
return _this8.wrapper = ref; | ||
return _this11.wrapper = ref; | ||
}, | ||
@@ -1367,3 +1387,3 @@ className: className, | ||
{ ref: function (ref) { | ||
return _this8.control = ref; | ||
return _this11.control = ref; | ||
}, | ||
@@ -1370,0 +1390,0 @@ className: 'Select-control', |
{ | ||
"name": "react-select-plus", | ||
"version": "1.0.0-rc.3.patch10", | ||
"version": "1.0.0-rc.3.patch11", | ||
"description": "A fork of react-select with support for option groups", | ||
@@ -5,0 +5,0 @@ "main": "lib/Select.js", |
@@ -203,8 +203,2 @@ import React, { Component, PropTypes } from 'react'; | ||
ref: (ref) => (this.select = ref), | ||
onChange: (newValues) => { | ||
if (this.props.multi && this.props.value && (newValues.length > this.props.value.length)) { | ||
this.clearOptions(); | ||
} | ||
this.props.onChange(newValues); | ||
} | ||
}; | ||
@@ -211,0 +205,0 @@ |
@@ -451,2 +451,4 @@ /*! | ||
inputValue: '' | ||
}, () => { | ||
if (this.props.onInputChange) this.props.onInputChange(''); | ||
}); | ||
@@ -539,3 +541,8 @@ } else { | ||
case 13: // enter | ||
if (!this.state.isOpen) return; | ||
if (!this.state.isOpen) { | ||
this.setState({ | ||
isOpen: true | ||
}); | ||
return; | ||
}; | ||
event.stopPropagation(); | ||
@@ -681,2 +688,3 @@ this.selectFocusedOption(); | ||
this.addValue(value); | ||
if (this.props.onInputChange) this.props.onInputChange(''); | ||
}); | ||
@@ -690,2 +698,3 @@ } else { | ||
this.setValue(value); | ||
if (this.props.onInputChange) this.props.onInputChange(''); | ||
}); | ||
@@ -733,3 +742,6 @@ } | ||
inputValue: '', | ||
}, this.focus); | ||
}, () => { | ||
this.focus(); | ||
if (this.props.onInputChange) this.props.onInputChange(''); | ||
}); | ||
}, | ||
@@ -787,2 +799,4 @@ | ||
focusedOption: this._focusedOption || (options.length ? options[dir === 'next' ? 0 : options.length - 1].option : null) | ||
}, () => { | ||
if (this.props.onInputChange) this.props.onInputChange(''); | ||
}); | ||
@@ -789,0 +803,0 @@ return; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
840994
12989
2