alaska-field-password
Advanced tools
Comparing version 0.12.12 to 0.13.0
{ | ||
"name": "alaska-field-password", | ||
"version": "0.12.12", | ||
"version": "0.13.0", | ||
"description": "Alaska password field", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -32,6 +32,27 @@ // @flow | ||
shouldComponentUpdate(props: Alaska$view$Field$View$Props, state: State) { | ||
return props.disabled !== this.props.disabled || !shallowEqualWithout(state, this.state); | ||
componentWillReceiveProps(nextProps: Alaska$view$Field$View$Props) { | ||
if (nextProps.record._id !== this.props.record._id) { | ||
this.setState({ | ||
value1: '', | ||
value2: '' | ||
}); | ||
} | ||
} | ||
shouldComponentUpdate(nextProps: Alaska$view$Field$View$Props, state: State) { | ||
return nextProps.disabled !== this.props.disabled | ||
|| nextProps.record._id !== this.props.record._id | ||
|| nextProps.value !== this.props.value | ||
|| !shallowEqualWithout(state, this.state); | ||
} | ||
getError(): string { | ||
const { t } = this.context; | ||
const { value1, value2 } = this.state; | ||
if (value1 !== value2) { | ||
return t('The passwords are not match'); | ||
} | ||
return ''; | ||
} | ||
handleChange(index: number, e: SyntheticInputEvent<*>) { | ||
@@ -38,0 +59,0 @@ // $Flow e.target.value确认存在 |
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
7366
231