nuke-input
Advanced tools
Comparing version 1.0.42 to 1.0.43
# Changelog | ||
## 1.0.43 / 2018-01-12 | ||
* [[3a12205](http://gitlab.alibaba-inc.com/nuke/input/commit/3a1220577a9f73670785db210a0dec0f6edf9755)] - `fix` update change event ,set inputvalue and status | ||
## 1.0.42 / 2018-01-12 | ||
@@ -5,0 +9,0 @@ |
@@ -95,2 +95,3 @@ 'use strict'; | ||
_this.inputHandler = _this.inputHandler.bind(_this); | ||
// this.changeHandler = this.changeHandler.bind(this); | ||
_this.focusHandler = _this.focusHandler.bind(_this); | ||
@@ -323,3 +324,5 @@ _this.blurHandler = _this.blurHandler.bind(_this); | ||
value: function changeHandler(text, eventObj) { | ||
var type = this.props.type; | ||
var _props3 = this.props, | ||
type = _props3.type, | ||
maxLength = _props3.maxLength; | ||
@@ -330,2 +333,9 @@ if (type === 'date' || type === 'time') { | ||
}); | ||
} else { | ||
this.setState({ | ||
value: text, | ||
inputValue: text, | ||
count: text.length, | ||
maxLengthError: text.length > maxLength | ||
}); | ||
} | ||
@@ -341,11 +351,11 @@ this.trigger('onChange', text, eventObj); | ||
maxLengthError = _state.maxLengthError; | ||
var _props3 = this.props, | ||
placeholder = _props3.placeholder, | ||
placeholderColor = _props3.placeholderColor, | ||
themeStyle = _props3.themeStyle, | ||
status = _props3.status, | ||
disabled = _props3.disabled, | ||
errorMessage = _props3.errorMessage, | ||
floatPlaceholder = _props3.floatPlaceholder, | ||
hideErrorWhenFocus = _props3.hideErrorWhenFocus; | ||
var _props4 = this.props, | ||
placeholder = _props4.placeholder, | ||
placeholderColor = _props4.placeholderColor, | ||
themeStyle = _props4.themeStyle, | ||
status = _props4.status, | ||
disabled = _props4.disabled, | ||
errorMessage = _props4.errorMessage, | ||
floatPlaceholder = _props4.floatPlaceholder, | ||
hideErrorWhenFocus = _props4.hideErrorWhenFocus; | ||
@@ -373,7 +383,7 @@ | ||
value: function renderCount() { | ||
var _props4 = this.props, | ||
maxLength = _props4.maxLength, | ||
multiple = _props4.multiple, | ||
renderCount = _props4.renderCount, | ||
themeStyle = _props4.themeStyle; | ||
var _props5 = this.props, | ||
maxLength = _props5.maxLength, | ||
multiple = _props5.multiple, | ||
renderCount = _props5.renderCount, | ||
themeStyle = _props5.themeStyle; | ||
@@ -424,9 +434,9 @@ if (!maxLength || !renderCount) return null; | ||
value: function renderHelpLine(styles) { | ||
var _props5 = this.props, | ||
status = _props5.status, | ||
errorMessage = _props5.errorMessage, | ||
autoAdjustHeight = _props5.autoAdjustHeight, | ||
_props5$hideErrorWhen = _props5.hideErrorWhenFocus, | ||
hideErrorWhenFocus = _props5$hideErrorWhen === undefined ? false : _props5$hideErrorWhen, | ||
renderCount = _props5.renderCount; | ||
var _props6 = this.props, | ||
status = _props6.status, | ||
errorMessage = _props6.errorMessage, | ||
autoAdjustHeight = _props6.autoAdjustHeight, | ||
_props6$hideErrorWhen = _props6.hideErrorWhenFocus, | ||
hideErrorWhenFocus = _props6$hideErrorWhen === undefined ? false : _props6$hideErrorWhen, | ||
renderCount = _props6.renderCount; | ||
var _state2 = this.state, | ||
@@ -473,29 +483,29 @@ focus = _state2.focus, | ||
value: function render() { | ||
var _props6 = this.props, | ||
defaultValue = _props6.defaultValue, | ||
onChange = _props6.onChange, | ||
onFocus = _props6.onFocus, | ||
onInput = _props6.onInput, | ||
onBlur = _props6.onBlur, | ||
placeholder = _props6.placeholder, | ||
renderCount = _props6.renderCount, | ||
readOnly = _props6.readOnly, | ||
disabled = _props6.disabled, | ||
_props6$style = _props6.style, | ||
style = _props6$style === undefined ? {} : _props6$style, | ||
maxLength = _props6.maxLength, | ||
multiple = _props6.multiple, | ||
inputStyle = _props6.inputStyle, | ||
returnKeyType = _props6.returnKeyType, | ||
hasClear = _props6.hasClear, | ||
rows = _props6.rows, | ||
type = _props6.type, | ||
icon = _props6.icon, | ||
autoAdjustHeight = _props6.autoAdjustHeight, | ||
status = _props6.status, | ||
floatPlaceholder = _props6.floatPlaceholder, | ||
hideErrorWhenFocus = _props6.hideErrorWhenFocus, | ||
errorMessage = _props6.errorMessage, | ||
maxRows = _props6.maxRows, | ||
others = _objectWithoutProperties(_props6, ['defaultValue', 'onChange', 'onFocus', 'onInput', 'onBlur', 'placeholder', 'renderCount', 'readOnly', 'disabled', 'style', 'maxLength', 'multiple', 'inputStyle', 'returnKeyType', 'hasClear', 'rows', 'type', 'icon', 'autoAdjustHeight', 'status', 'floatPlaceholder', 'hideErrorWhenFocus', 'errorMessage', 'maxRows']); | ||
var _props7 = this.props, | ||
defaultValue = _props7.defaultValue, | ||
onChange = _props7.onChange, | ||
onFocus = _props7.onFocus, | ||
onInput = _props7.onInput, | ||
onBlur = _props7.onBlur, | ||
placeholder = _props7.placeholder, | ||
renderCount = _props7.renderCount, | ||
readOnly = _props7.readOnly, | ||
disabled = _props7.disabled, | ||
_props7$style = _props7.style, | ||
style = _props7$style === undefined ? {} : _props7$style, | ||
maxLength = _props7.maxLength, | ||
multiple = _props7.multiple, | ||
inputStyle = _props7.inputStyle, | ||
returnKeyType = _props7.returnKeyType, | ||
hasClear = _props7.hasClear, | ||
rows = _props7.rows, | ||
type = _props7.type, | ||
icon = _props7.icon, | ||
autoAdjustHeight = _props7.autoAdjustHeight, | ||
status = _props7.status, | ||
floatPlaceholder = _props7.floatPlaceholder, | ||
hideErrorWhenFocus = _props7.hideErrorWhenFocus, | ||
errorMessage = _props7.errorMessage, | ||
maxRows = _props7.maxRows, | ||
others = _objectWithoutProperties(_props7, ['defaultValue', 'onChange', 'onFocus', 'onInput', 'onBlur', 'placeholder', 'renderCount', 'readOnly', 'disabled', 'style', 'maxLength', 'multiple', 'inputStyle', 'returnKeyType', 'hasClear', 'rows', 'type', 'icon', 'autoAdjustHeight', 'status', 'floatPlaceholder', 'hideErrorWhenFocus', 'errorMessage', 'maxRows']); | ||
@@ -502,0 +512,0 @@ var styles = this.props.themeStyle; |
@@ -82,2 +82,3 @@ 'use strict'; | ||
_this.onInput = _this.onInput.bind(_this); | ||
_this.onChange = _this.onChange.bind(_this); | ||
_this.clearHandler = _this.clearHandler.bind(_this); | ||
@@ -115,2 +116,15 @@ _this.focusHandler = _this.focusHandler.bind(_this); | ||
}, { | ||
key: 'onChange', | ||
value: function onChange(text, eventObj) { | ||
var maxLength = this.props.maxLength; | ||
this.setState({ | ||
value: text, | ||
inputValue: text, | ||
count: text.length, | ||
maxLengthError: text.length > maxLength | ||
}); | ||
this.trigger('onChange', text, eventObj); | ||
} | ||
}, { | ||
key: 'getInput', | ||
@@ -124,2 +138,3 @@ value: function getInput() { | ||
onInput = _props.onInput, | ||
onChange = _props.onChange, | ||
_props$style = _props.style, | ||
@@ -132,3 +147,3 @@ style = _props$style === undefined ? {} : _props$style, | ||
multiple = _props.multiple, | ||
others = _objectWithoutProperties(_props, ['readOnly', 'disabled', 'onInput', 'style', 'inputStyle', 'hasClear', 'rows', 'multiple']); | ||
others = _objectWithoutProperties(_props, ['readOnly', 'disabled', 'onInput', 'onChange', 'style', 'inputStyle', 'hasClear', 'rows', 'multiple']); | ||
@@ -146,2 +161,3 @@ var value = this.state.value; | ||
onInput: this.onInput, | ||
onChange: this.onChange, | ||
onFocus: this.focusHandler, | ||
@@ -148,0 +164,0 @@ onBlur: this.blurHandler, |
{ | ||
"name": "nuke-input", | ||
"version": "1.0.42", | ||
"version": "1.0.43", | ||
"description": "输入框", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
160022
36
2250