@@ -169,6 +169,7 @@ exports.default = _react2.default.createClass({
169
169
monthLabels : _react2 . default . PropTypes . array ,
170
170
onChange : _react2 . default . PropTypes . func ,
171
171
onClear : _react2 . default . PropTypes . func ,
172
+ disabled : _react2 . default . PropTypes . bool ,
172
173
weekStartsOnMonday : _react2 . default . PropTypes . bool ,
173
174
clearButtonElement : _react2 . default . PropTypes . oneOfType ( [ _react2 . default . PropTypes . string , _react2 . default . PropTypes . object ] ) ,
174
175
showClearButton : _react2 . default . PropTypes . bool ,
@@ -190,7 +191,8 @@ exports.default = _react2.default.createClass({
190
191
nextButtonElement : ">" ,
191
192
calendarPlacement : "bottom" ,
192
193
dateFormat : dateFormat ,
193
- showClearButton : true
194
+ showClearButton : true ,
195
+ disabled : false
194
196
} ;
195
197
} ,
196
198
getInitialState : function getInitialState ( ) {
@@ -426,7 +428,7 @@ exports.default = _react2.default.createClass({
426
428
dateFormat : this . props . dateFormat } ) ;
427
429
return _react2 . default . createElement (
428
430
_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 } ,
430
432
_react2 . default . createElement (
431
433
_reactBootstrap . Overlay ,
432
434
{ rootClose : true , onHide : this . handleHide , show : this . state . focused , container : function container ( ) {
@@ -447,15 +449,21 @@ exports.default = _react2.default.createClass({
447
449
value : this . state . inputValue || '' ,
448
450
ref : 'input' ,
449
451
type : 'text' ,
452
+ disabled : this . props . disabled ,
450
453
placeholder : this . state . focused ? this . props . dateFormat : this . state . placeholder ,
451
454
onFocus : this . handleFocus ,
452
455
onBlur : this . handleBlur ,
453
- onChange : this . handleInputChange
456
+ onChange : this . handleInputChange ,
457
+ style : { width : "100%" }
454
458
} ) ,
455
459
this . props . showClearButton && _react2 . default . createElement (
456
460
_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
+ )
459
467
)
460
468
) ;
461
469
}
0 commit comments