react-flatpickr
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -60,2 +60,6 @@ 'use strict'; | ||
this.flatpickr = new _flatpickr2.default(this.node, options); | ||
if (this.props.hasOwnProperty('value')) { | ||
this.flatpickr.setDate(this.props.value, false); | ||
} | ||
} | ||
@@ -81,4 +85,5 @@ }, { | ||
return _react2.default.createElement('input', _extends({}, props, { defaultValue: defaultValue || value, ref: function ref(node) { | ||
return _this2.node = node; | ||
return _react2.default.createElement('input', _extends({}, props, { defaultValue: defaultValue || value, | ||
ref: function ref(node) { | ||
_this2.node = node; | ||
} })); | ||
@@ -92,3 +97,6 @@ } | ||
DateTimePicker.propTypes = { | ||
options: _react.PropTypes.object | ||
defaultValue: _react.PropTypes.string, | ||
options: _react.PropTypes.object, | ||
onChange: _react.PropTypes.func, | ||
value: _react.PropTypes.string | ||
}; | ||
@@ -95,0 +103,0 @@ DateTimePicker.defaultProps = { |
@@ -6,5 +6,7 @@ | ||
class DateTimePicker extends Component { | ||
static propTypes = { | ||
defaultValue: PropTypes.string, | ||
options: PropTypes.object, | ||
onChange: PropTypes.func, | ||
value: PropTypes.string | ||
} | ||
@@ -31,7 +33,11 @@ | ||
const options = { | ||
...this.props.options, | ||
onChange: this.props.onChange | ||
...this.props.options, | ||
onChange: this.props.onChange | ||
} | ||
this.flatpickr = new Flatpickr(this.node, options) | ||
if (this.props.hasOwnProperty('value')) { | ||
this.flatpickr.setDate(this.props.value, false) | ||
} | ||
} | ||
@@ -48,3 +54,4 @@ | ||
return ( | ||
<input {...props} defaultValue={defaultValue || value} ref={node => this.node = node} /> | ||
<input {...props} defaultValue={defaultValue || value} | ||
ref={node => { this.node = node }} /> | ||
) | ||
@@ -51,0 +58,0 @@ } |
{ | ||
"name": "react-flatpickr", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"description": "flatpickr for React", | ||
@@ -36,5 +36,3 @@ "main": "build/index.js", | ||
"css-loader": "^0.26.1", | ||
"eslint": "^3.14.1", | ||
"eslint-config-bx-bsd": "^1.4.0", | ||
"eslint-plugin-react": "^6.9.0", | ||
"eslint-config-ok": "github:haoxins/eslint-config", | ||
"react": "^15.4.2", | ||
@@ -47,5 +45,5 @@ "react-dom": "^15.4.2", | ||
"extends": [ | ||
"eslint-config-bx-bsd" | ||
"ok" | ||
] | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1822540
13
21035
2