@jennifersoft/demian-components
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -11,2 +11,3 @@ import * as React from 'react'; | ||
onPressEnter?: (text: string) => void; | ||
onClear?: () => void; | ||
} | ||
@@ -13,0 +14,0 @@ interface SearchStateType { |
@@ -44,9 +44,17 @@ "use strict"; | ||
var _this = this; | ||
this.setState({ searchText: '' }, function () { | ||
if (_this.props.onChange) | ||
_this.props.onChange(_this.state.searchText); | ||
}); | ||
if (this.props.onClear) { | ||
this.props.onClear(); | ||
} | ||
else { | ||
this.setState({ searchText: '' }, function () { | ||
if (_this.props.onChange) | ||
_this.props.onChange(_this.state.searchText); | ||
}); | ||
} | ||
}; | ||
Search.prototype.render = function () { | ||
var _this = this; | ||
if (this.props.value != null && this.props.onClear) { | ||
console.error('if value set by props, set onClear also'); | ||
} | ||
return (React.createElement(SearchWrapper, { style: this.props.style }, | ||
@@ -53,0 +61,0 @@ React.createElement(SearchIconWrapper, { large: this.props.large, xlarge: this.props.xlarge }, this.state.searchText ? |
{ | ||
"name": "@jennifersoft/demian-components", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"description": "JENNIFER Front(Demian) Components", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
222739
3536