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

rc-form

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-form - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

32

lib/createForm.js

@@ -69,2 +69,7 @@ 'use strict';

_createClass(Form, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.componentDidUpdate();
}
}, {
key: 'componentWillReceiveProps',

@@ -86,11 +91,22 @@ value: function componentWillReceiveProps(nextProps) {

var fieldsKeys = Object.keys(fields);
var removeFields = {};
var changedFields = {};
fieldsKeys.forEach(function (s) {
if (!fieldsMeta[s]) {
delete fields[s];
removeFields[s] = undefined;
changedFields[s] = undefined;
}
});
if (onFieldsChange && !(0, _utils.isEmptyObject)(removeFields)) {
onFieldsChange(this.props, removeFields);
if (onFieldsChange) {
Object.keys(fieldsMeta).forEach(function (name) {
var fieldMeta = fieldsMeta[name];
var field = fields[name] || {};
if ('initialValue' in fieldMeta && !('value' in field)) {
changedFields[name] = {
value: fieldMeta.initialValue
};
}
});
if (!(0, _utils.isEmptyObject)(changedFields)) {
onFieldsChange(this.props, changedFields);
}
}

@@ -205,5 +221,5 @@ }

var fieldsMeta = this.fieldsMeta;
return Object.keys(this.fieldsMeta).filter(function (name) {
return fieldsMeta ? Object.keys(fieldsMeta).filter(function (name) {
return !fieldsMeta[name].hidden;
});
}) : [];
}

@@ -353,5 +369,3 @@ }, {

var field = _this4.getField(name, true);
if (!('value' in field) && 'initialValue' in fieldMeta) {
field.value = fieldMeta.initialValue;
}
field.value = _this4.getFieldValue(name);
return field;

@@ -358,0 +372,0 @@ }).filter(function (f) {

{
"name": "rc-form",
"version": "0.4.1",
"version": "0.4.2",
"description": "React High Order Form Component",

@@ -5,0 +5,0 @@ "keywords": [

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