"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _classCallCheck2=require("babel-runtime/helpers/classCallCheck"),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_createClass2=require("babel-runtime/helpers/createClass"),_createClass3=_interopRequireDefault(_createClass2),_possibleConstructorReturn2=require("babel-runtime/helpers/possibleConstructorReturn"),_possibleConstructorReturn3=_interopRequireDefault(_possibleConstructorReturn2),_inherits2=require("babel-runtime/helpers/inherits"),_inherits3=_interopRequireDefault(_inherits2),_react=require("react"),React=_interopRequireWildcard(_react),_icon=require("../icon"),_icon2=_interopRequireDefault(_icon),_input=require("../input"),_input2=_interopRequireDefault(_input);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var Search=function(e){function t(){(0,_classCallCheck3.default)(this,t);var r=(0,_possibleConstructorReturn3.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return r.handleChange=function(e){var t=r.props.onChange;t&&t(e)},r.handleClear=function(e){e.preventDefault();var t=r.props.handleClear;t&&t(e)},r}return(0,_inherits3.default)(t,e),(0,_createClass3.default)(t,[{key:"render",value:function(){var e=this.props,t=e.placeholder,r=e.value,a=e.prefixCls,l=r&&0<r.length?React.createElement("a",{href:"#",className:a+"-action",onClick:this.handleClear},React.createElement(_icon2.default,{type:"close-circle"})):React.createElement("span",{className:a+"-action"},React.createElement(_icon2.default,{type:"search"}));return React.createElement("div",null,React.createElement(_input2.default,{placeholder:t,className:a,value:r,onChange:this.handleChange}),l)}}]),t}(React.Component);(exports.default=Search).defaultProps={placeholder:""},module.exports=exports.default;