alaska-field-datetime
Advanced tools
Comparing version 0.10.1 to 0.10.2
@@ -109,4 +109,4 @@ /** | ||
DatetimeField.viewOptions = ['min', 'max', 'format', 'dateFormat', 'timeFormat'] | ||
DatetimeField.viewOptions = ['min', 'max', 'format', 'dateFormat', 'timeFormat']; | ||
module.exports = DatetimeField; |
@@ -59,5 +59,2 @@ 'use strict'; | ||
DatetimeFieldCell.propTypes = { | ||
children: _react2.default.PropTypes.node | ||
}; | ||
exports.default = DatetimeFieldCell; |
@@ -33,2 +33,6 @@ 'use strict'; | ||
var _React$PropTypes = _react2.default.PropTypes; | ||
var object = _React$PropTypes.object; | ||
var func = _React$PropTypes.func; | ||
var DatetimeFieldFilter = function (_React$Component) { | ||
@@ -66,2 +70,9 @@ _inherits(DatetimeFieldFilter, _React$Component); | ||
} | ||
var error = false; | ||
if (!value1) { | ||
error = true; | ||
} | ||
if (mode === 4 && (!value2 || value1 >= value2)) { | ||
error = true; | ||
} | ||
_this.state = { | ||
@@ -71,3 +82,3 @@ mode: mode, // 1 等于 2大于 3小于 4区间 | ||
value2: value2, | ||
error: false | ||
error: error | ||
}; | ||
@@ -104,3 +115,3 @@ _this.handleMode1 = _this.handleMode.bind(_this, 1); | ||
var buttonClassName = 'btn btn-default'; | ||
var buttonClassNameActive = buttonClassName + ' active'; | ||
var buttonClassNameActive = buttonClassName + ' btn-success'; | ||
var input2 = null; | ||
@@ -119,3 +130,3 @@ if (mode === 4) { | ||
} | ||
var className = 'row field-filter field-filter-number' + (error ? ' error' : ''); | ||
var className = 'row field-filter datetime-field-filter' + (error ? ' error' : ''); | ||
return _react2.default.createElement( | ||
@@ -130,3 +141,3 @@ 'div', | ||
_react2.default.createElement( | ||
'form', | ||
'div', | ||
{ className: 'form-inline col-xs-10' }, | ||
@@ -190,8 +201,8 @@ _react2.default.createElement( | ||
DatetimeFieldFilter.propTypes = { | ||
field: _react2.default.PropTypes.object, | ||
onChange: _react2.default.PropTypes.func, | ||
onClose: _react2.default.PropTypes.func | ||
field: object, | ||
onChange: func, | ||
onClose: func | ||
}; | ||
DatetimeFieldFilter.contextTypes = { | ||
t: _react2.default.PropTypes.func | ||
t: func | ||
}; | ||
@@ -198,0 +209,0 @@ |
@@ -39,2 +39,9 @@ 'use strict'; | ||
var _React$PropTypes = _react2.default.PropTypes; | ||
var bool = _React$PropTypes.bool; | ||
var object = _React$PropTypes.object; | ||
var any = _React$PropTypes.any; | ||
var func = _React$PropTypes.func; | ||
var string = _React$PropTypes.string; | ||
var DatetimeFieldView = function (_React$Component) { | ||
@@ -76,3 +83,3 @@ _inherits(DatetimeFieldView, _React$Component); | ||
var help = field.help; | ||
var className = 'form-group'; | ||
var className = 'form-group datetime-field'; | ||
if (errorText) { | ||
@@ -144,13 +151,13 @@ className += ' has-error'; | ||
DatetimeFieldView.propTypes = { | ||
model: _react2.default.PropTypes.object, | ||
field: _react2.default.PropTypes.object, | ||
data: _react2.default.PropTypes.object, | ||
errorText: _react2.default.PropTypes.string, | ||
disabled: _react2.default.PropTypes.bool, | ||
value: _react2.default.PropTypes.any, | ||
onChange: _react2.default.PropTypes.func | ||
model: object, | ||
field: object, | ||
data: object, | ||
errorText: string, | ||
disabled: bool, | ||
value: any, | ||
onChange: func | ||
}; | ||
DatetimeFieldView.contextTypes = { | ||
settings: _react2.default.PropTypes.object | ||
settings: object | ||
}; | ||
exports.default = DatetimeFieldView; |
{ | ||
"name": "alaska-field-datetime", | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"description": "Alaska datetime field", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
27391
501