Skip to content

Commit

Permalink
update lib
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghe committed Jul 18, 2016
1 parent 2e95a46 commit 3fa9e20
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/MDSearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');
Expand Down Expand Up @@ -50,6 +52,7 @@ var MDSearchBox = function (_Component) {
var width = _props.width;
var height = _props.height;

var inputOptionalProps = !!this.props.text ? { value: this.props.text } : {};
var style = { width: width, height: height };
return _react2.default.createElement(
'div',
Expand All @@ -58,15 +61,14 @@ var MDSearchBox = function (_Component) {
'div',
{ className: _MDSearchBox2.default.searchbox },
_react2.default.createElement('span', { className: 'fontawesome-search' }),
_react2.default.createElement('input', {
_react2.default.createElement('input', _extends({
type: 'searchbox',
id: 'searchbox',
ref: 'searchbox',
placeholder: '搜索',
onChange: this.onChange,
className: _MDSearchBox2.default.input,
value: !!this.props.text || null
})
className: _MDSearchBox2.default.input
}, inputOptionalProps))
)
);
}
Expand Down

0 comments on commit 3fa9e20

Please sign in to comment.