@@ -169,6 +169,7 @@ exports.default = _react2.default.createClass({
169169 monthLabels : _react2 . default . PropTypes . array ,
170170 onChange : _react2 . default . PropTypes . func ,
171171 onClear : _react2 . default . PropTypes . func ,
172+ disabled : _react2 . default . PropTypes . bool ,
172173 weekStartsOnMonday : _react2 . default . PropTypes . bool ,
173174 clearButtonElement : _react2 . default . PropTypes . oneOfType ( [ _react2 . default . PropTypes . string , _react2 . default . PropTypes . object ] ) ,
174175 showClearButton : _react2 . default . PropTypes . bool ,
@@ -190,7 +191,8 @@ exports.default = _react2.default.createClass({
190191 nextButtonElement : ">" ,
191192 calendarPlacement : "bottom" ,
192193 dateFormat : dateFormat ,
193- showClearButton : true
194+ showClearButton : true ,
195+ disabled : false
194196 } ;
195197 } ,
196198 getInitialState : function getInitialState ( ) {
@@ -426,7 +428,7 @@ exports.default = _react2.default.createClass({
426428 dateFormat : this . props . dateFormat } ) ;
427429 return _react2 . default . createElement (
428430 _reactBootstrap . InputGroup ,
429- { ref : 'inputGroup' , bsClass : this . props . bsClass , bsSize : this . props . bsSize , id : this . props . id ? this . props . id + "_group" : null } ,
431+ { ref : 'inputGroup' , bsClass : this . props . showClearButton ? this . props . bsClass : "" , bsSize : this . props . bsSize , id : this . props . id ? this . props . id + "_group" : null } ,
430432 _react2 . default . createElement (
431433 _reactBootstrap . Overlay ,
432434 { rootClose : true , onHide : this . handleHide , show : this . state . focused , container : function container ( ) {
@@ -447,15 +449,21 @@ exports.default = _react2.default.createClass({
447449 value : this . state . inputValue || '' ,
448450 ref : 'input' ,
449451 type : 'text' ,
452+ disabled : this . props . disabled ,
450453 placeholder : this . state . focused ? this . props . dateFormat : this . state . placeholder ,
451454 onFocus : this . handleFocus ,
452455 onBlur : this . handleBlur ,
453- onChange : this . handleInputChange
456+ onChange : this . handleInputChange ,
457+ style : { width : "100%" }
454458 } ) ,
455459 this . props . showClearButton && _react2 . default . createElement (
456460 _reactBootstrap . InputGroup . Addon ,
457- { onClick : this . clear , style : { cursor : this . state . inputValue ? "pointer" : "not-allowed" } } ,
458- this . props . clearButtonElement
461+ { onClick : this . props . disabled ? null : this . clear , style : { cursor : this . state . inputValue && ! this . props . disabled ? "pointer" : "not-allowed" } } ,
462+ _react2 . default . createElement (
463+ 'div' ,
464+ { style : { opacity : this . state . inputValue && ! this . props . disabled ? 1 : 0.5 } } ,
465+ this . props . clearButtonElement
466+ )
459467 )
460468 ) ;
461469 }
0 commit comments