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

react-flatpickr

Package Overview
Dependencies
Maintainers
2
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 3.6.0 to 3.6.1

build/example.js

33

build/index.js

@@ -45,11 +45,8 @@ 'use strict';

_createClass(DateTimePicker, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(props) {
key: 'componentDidReceiveProps',
value: function componentDidReceiveProps(props, prevProps) {
var options = props.options;
var prevOptions = prevProps.options;
if (props.hasOwnProperty('value')) {
this.flatpickr.setDate(props.value, false);
}
// Add prop hooks to options

@@ -64,5 +61,9 @@ var _iteratorNormalCompletion = true;

if (props[hook]) {
if (props.hasOwnProperty(hook)) {
options[hook] = props[hook];
}
// Add prev ones too so we can compare against them later
if (prevProps.hasOwnProperty(hook)) {
prevOptions[hook] = prevProps[hook];
}
}

@@ -84,14 +85,20 @@ } catch (err) {

var optionsKeys = Object.getOwnPropertyNames(props.options);
var optionsKeys = Object.getOwnPropertyNames(options);
for (var index = optionsKeys.length - 1; index >= 0; index--) {
var key = optionsKeys[index];
var value = props.options[key];
var value = options[key];
// Hook handlers must be set as an array
if (hooks.indexOf(key) !== -1 && !Array.isArray(value)) {
value = [value];
if (value !== prevOptions[key]) {
// Hook handlers must be set as an array
if (hooks.indexOf(key) !== -1 && !Array.isArray(value)) {
value = [value];
}
this.flatpickr.set(key, value);
}
}
this.flatpickr.set(key, value);
if (props.hasOwnProperty('value') && props.value !== prevProps.value) {
this.flatpickr.setDate(props.value, false);
}

@@ -98,0 +105,0 @@ }

@@ -42,28 +42,35 @@

componentWillReceiveProps(props) {
componentDidReceiveProps(props, prevProps) {
const { options } = props
const prevOptions = prevProps.options
if (props.hasOwnProperty('value')) {
this.flatpickr.setDate(props.value, false)
}
// Add prop hooks to options
for (let hook of hooks) {
if (props[hook]) {
if (props.hasOwnProperty(hook)) {
options[hook] = props[hook]
}
// Add prev ones too so we can compare against them later
if (prevProps.hasOwnProperty(hook)) {
prevOptions[hook] = prevProps[hook]
}
}
const optionsKeys = Object.getOwnPropertyNames(props.options)
const optionsKeys = Object.getOwnPropertyNames(options)
for (let index = optionsKeys.length - 1; index >= 0; index--) {
const key = optionsKeys[index]
let value = props.options[key]
let value = options[key]
// Hook handlers must be set as an array
if (hooks.indexOf(key) !== -1 && !Array.isArray(value)) {
value = [value]
if (value !== prevOptions[key]) {
// Hook handlers must be set as an array
if (hooks.indexOf(key) !== -1 && !Array.isArray(value)) {
value = [value]
}
this.flatpickr.set(key, value)
}
}
this.flatpickr.set(key, value)
if (props.hasOwnProperty('value') && props.value !== prevProps.value) {
this.flatpickr.setDate(props.value, false)
}

@@ -70,0 +77,0 @@ }

{
"name": "react-flatpickr",
"version": "3.6.0",
"version": "3.6.1",
"description": "flatpickr for React",

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

"dependencies": {
"flatpickr": "^4.0.1",
"flatpickr": "^4.0.5",
"prop-types": "^15.5.10"

@@ -29,0 +29,0 @@ },

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