Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-flatpickr

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-flatpickr - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

18

build/index.js

@@ -67,4 +67,7 @@ 'use strict';

var node = document.getElementById(id);
var options = _extends({}, this.props.options, {
onChange: this.props.onChange
});
this.flatpickr = new _flatpickr2.default(node, this.props);
this.flatpickr = new _flatpickr2.default(node, options);
}

@@ -74,10 +77,13 @@ }, {

value: function render() {
// ignore onChange, options
var _props = this.props,
onChange = _props.onChange,
props = _objectWithoutProperties(_props, ['onChange']);
options = _props.options,
defaultValue = _props.defaultValue,
value = _props.value,
props = _objectWithoutProperties(_props, ['onChange', 'options', 'defaultValue', 'value']);
var id = this.state.id;
// ignore onChange
return _react2.default.createElement('input', _extends({}, props, { id: id }));
return _react2.default.createElement('input', _extends({}, props, { id: id, defaultValue: defaultValue || value }));
}

@@ -90,4 +96,8 @@ }]);

DateTimePicker.propTypes = {
options: _react.PropTypes.object,
id: _react.PropTypes.string
};
DateTimePicker.defaultProps = {
options: {}
};
exports.default = DateTimePicker;

@@ -94,0 +104,0 @@

@@ -8,5 +8,10 @@

static propTypes = {
options: PropTypes.object,
id: PropTypes.string
}
static defaultProps = {
options: {}
}
state = {

@@ -30,12 +35,16 @@ id: ''

const node = document.getElementById(id)
const options = {
...this.props.options,
onChange: this.props.onChange
}
this.flatpickr = new Flatpickr(node, this.props)
this.flatpickr = new Flatpickr(node, options)
}
render() {
const { onChange, ...props } = this.props
// ignore onChange, options
const { onChange, options, defaultValue, value, ...props } = this.props
const { id } = this.state
// ignore onChange
return (
<input {...props} id={id} />
<input {...props} id={id} defaultValue={defaultValue || value}/>
)

@@ -42,0 +51,0 @@ }

{
"name": "react-flatpickr",
"version": "1.1.1",
"version": "2.0.0",
"description": "flatpickr for React",

@@ -25,3 +25,3 @@ "main": "build/index.js",

"dependencies": {
"flatpickr": "^2.1.1"
"flatpickr": "^2.2.3"
},

@@ -28,0 +28,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc