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

react-final-form-arrays

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-final-form-arrays - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

1

dist/index.d.ts

@@ -48,4 +48,5 @@ import * as React from 'react'

name: string
isEqual?: (a: any, b: any) => boolean
subscription?: FieldSubscription
validate?: (value: any, allValues: object) => any
}

23

dist/react-final-form-arrays.cjs.js

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

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var React = require('react');
var reactLifecyclesCompat = require('react-lifecycles-compat');
var PropTypes = _interopDefault(require('prop-types'));
var finalForm = require('final-form');

@@ -139,6 +136,6 @@ var reactFinalForm = require('react-final-form');

function FieldArray(props, context) {
function FieldArray(props) {
var _this;
_this = _React$Component.call(this, props, context) || this;
_this = _React$Component.call(this, props) || this;

@@ -156,3 +153,3 @@ _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "isEqual", function (a, b) {

subscription = _ref.subscription;
_this.unsubscribe = _this.context.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, {
_this.unsubscribe = _this.props.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, {
length: true

@@ -184,3 +181,3 @@ }) : all, {

var name = _ref2.name;
var reactFinalForm$$1 = _this.context.reactFinalForm;
var reactFinalForm$$1 = _this.props.reactFinalForm;

@@ -248,7 +245,7 @@ if (reactFinalForm$$1) {

if (process.env.NODE_ENV !== 'production' && !context.reactFinalForm) {
if (process.env.NODE_ENV !== 'production' && !props.reactFinalForm) {
console.error('Warning: FieldArray must be used inside of a ReactFinalForm component');
}
var _reactFinalForm = _this.context.reactFinalForm;
var _reactFinalForm = props.reactFinalForm;

@@ -283,3 +280,3 @@ if (_reactFinalForm) {

if (this.props.name !== name || diffSubscription(this.props.subscription, subscription, finalForm.fieldSubscriptionItems)) {
if (this.context.reactFinalForm) {
if (this.props.reactFinalForm) {
// avoid error, warning will alert developer to their mistake

@@ -363,10 +360,8 @@ this.unsubscribe();

FieldArray.contextTypes = {
reactFinalForm: PropTypes.object
};
reactLifecyclesCompat.polyfill(FieldArray);
var FieldArray$1 = reactFinalForm.withReactFinalForm(FieldArray);
//
exports.FieldArray = FieldArray;
exports.FieldArray = FieldArray$1;
exports.version = version;
import { Component, createElement } from 'react';
import { polyfill } from 'react-lifecycles-compat';
import PropTypes from 'prop-types';
import { fieldSubscriptionItems, version, ARRAY_ERROR } from 'final-form';
import { version as version$1 } from 'react-final-form';
import { version as version$1, withReactFinalForm } from 'react-final-form';

@@ -132,6 +131,6 @@ function _defineProperty(obj, key, value) {

function FieldArray(props, context) {
function FieldArray(props) {
var _this;
_this = _React$Component.call(this, props, context) || this;
_this = _React$Component.call(this, props) || this;

@@ -149,3 +148,3 @@ _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "isEqual", function (a, b) {

subscription = _ref.subscription;
_this.unsubscribe = _this.context.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, {
_this.unsubscribe = _this.props.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, {
length: true

@@ -177,3 +176,3 @@ }) : all, {

var name = _ref2.name;
var reactFinalForm = _this.context.reactFinalForm;
var reactFinalForm = _this.props.reactFinalForm;

@@ -241,7 +240,7 @@ if (reactFinalForm) {

if (process.env.NODE_ENV !== 'production' && !context.reactFinalForm) {
if (process.env.NODE_ENV !== 'production' && !props.reactFinalForm) {
console.error('Warning: FieldArray must be used inside of a ReactFinalForm component');
}
var _reactFinalForm = _this.context.reactFinalForm;
var _reactFinalForm = props.reactFinalForm;

@@ -276,3 +275,3 @@ if (_reactFinalForm) {

if (this.props.name !== name || diffSubscription(this.props.subscription, subscription, fieldSubscriptionItems)) {
if (this.context.reactFinalForm) {
if (this.props.reactFinalForm) {
// avoid error, warning will alert developer to their mistake

@@ -356,9 +355,7 @@ this.unsubscribe();

FieldArray.contextTypes = {
reactFinalForm: PropTypes.object
};
polyfill(FieldArray);
var FieldArray$1 = withReactFinalForm(FieldArray);
//
export { FieldArray, version$2 as version };
export { FieldArray$1 as FieldArray, version$2 as version };
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-lifecycles-compat'), require('prop-types'), require('final-form'), require('react-final-form')) :
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-lifecycles-compat', 'prop-types', 'final-form', 'react-final-form'], factory) :
(factory((global['react-final-form-arrays'] = {}),global.React,global.ReactLifecyclesCompat,global.PropTypes,global.FinalForm,global.ReactFinalForm));
}(this, (function (exports,React,reactLifecyclesCompat,PropTypes,finalForm,reactFinalForm) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-lifecycles-compat'), require('final-form'), require('react-final-form')) :
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-lifecycles-compat', 'final-form', 'react-final-form'], factory) :
(factory((global['react-final-form-arrays'] = {}),global.React,global.ReactLifecyclesCompat,global.FinalForm,global.ReactFinalForm));
}(this, (function (exports,React,reactLifecyclesCompat,finalForm,reactFinalForm) { 'use strict';
PropTypes = PropTypes && PropTypes.hasOwnProperty('default') ? PropTypes['default'] : PropTypes;
function _defineProperty(obj, key, value) {

@@ -134,6 +132,6 @@ if (key in obj) {

function FieldArray(props, context) {
function FieldArray(props) {
var _this;
_this = _React$Component.call(this, props, context) || this;
_this = _React$Component.call(this, props) || this;

@@ -151,3 +149,3 @@ _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "isEqual", function (a, b) {

subscription = _ref.subscription;
_this.unsubscribe = _this.context.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, {
_this.unsubscribe = _this.props.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, {
length: true

@@ -179,3 +177,3 @@ }) : all, {

var name = _ref2.name;
var reactFinalForm$$1 = _this.context.reactFinalForm;
var reactFinalForm$$1 = _this.props.reactFinalForm;

@@ -243,7 +241,7 @@ if (reactFinalForm$$1) {

if (!context.reactFinalForm) {
if (!props.reactFinalForm) {
console.error('Warning: FieldArray must be used inside of a ReactFinalForm component');
}
var _reactFinalForm = _this.context.reactFinalForm;
var _reactFinalForm = props.reactFinalForm;

@@ -278,3 +276,3 @@ if (_reactFinalForm) {

if (this.props.name !== name || diffSubscription(this.props.subscription, subscription, finalForm.fieldSubscriptionItems)) {
if (this.context.reactFinalForm) {
if (this.props.reactFinalForm) {
// avoid error, warning will alert developer to their mistake

@@ -358,10 +356,8 @@ this.unsubscribe();

FieldArray.contextTypes = {
reactFinalForm: PropTypes.object
};
reactLifecyclesCompat.polyfill(FieldArray);
var FieldArray$1 = reactFinalForm.withReactFinalForm(FieldArray);
//
exports.FieldArray = FieldArray;
exports.FieldArray = FieldArray$1;
exports.version = version;

@@ -368,0 +364,0 @@

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-lifecycles-compat"),require("prop-types"),require("final-form"),require("react-final-form")):"function"==typeof define&&define.amd?define(["exports","react","react-lifecycles-compat","prop-types","final-form","react-final-form"],e):e(t["react-final-form-arrays"]={},t.React,t.ReactLifecyclesCompat,t.PropTypes,t.FinalForm,t.ReactFinalForm)}(this,function(t,p,e,r,s,i){"use strict";function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(){return(d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}function m(t,e){if(null==t)return{};var r,i,n={},o=Object.keys(t);for(i=0;i<o.length;i++)r=o[i],0<=e.indexOf(r)||(n[r]=t[r]);return n}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}r=r&&r.hasOwnProperty("default")?r.default:r;var n="1.0.6",h={"final-form":s.version,"react-final-form":i.version,"react-final-form-arrays":n},u=s.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),a=function(i){var t,e;function r(t,e){var a,r;return o(c(c(a=i.call(this,t,e)||this)),"isEqual",function(t,e){return"function"!=typeof a.props.isEqual||a.props.isEqual(t,e)}),o(c(c(a)),"subscribe",function(t,e){var r=t.name,i=t.subscription;a.unsubscribe=a.context.reactFinalForm.registerField(r,e,i?d({},i,{length:!0}):u,{getValidator:function(){return a.validate},isEqual:a.isEqual})}),o(c(c(a)),"validate",function(){var t=a.props.validate;if(t){var e=t(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1]);if(!e||Array.isArray(e))return e;var r=[];return r[s.ARRAY_ERROR]=e,r}}),o(c(c(a)),"bindMutators",function(t){var n=t.name,e=a.context.reactFinalForm;if(e){var o=e.mutators;!!(o&&o.push&&o.pop)&&(a.mutators=Object.keys(o).reduce(function(t,i){return t[i]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return o[i].apply(o,[n].concat(e))},t},{}))}}),o(c(c(a)),"notify",function(t){setTimeout(function(){a.mounted&&a.setState({state:t})})}),o(c(c(a)),"forEach",function(t){for(var e=a.props.name,r=a.state.state&&a.state.state.length||0,i=0;i<r;i++)t(e+"["+i+"]",i)}),o(c(c(a)),"map",function(t){for(var e=a.props.name,r=a.state.state&&a.state.state.length||0,i=[],n=0;n<r;n++)i.push(t(e+"["+n+"]",n));return i}),a.context.reactFinalForm&&a.subscribe(t,function(t){r?a.notify(t):r=t}),a.state={state:r},a.bindMutators(t),a.mounted=!1,a}e=i,(t=r).prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e;var n=r.prototype;return n.UNSAFE_componentWillReceiveProps=function(t){var e,r,i,n=t.name,o=t.subscription;(this.props.name!==n||(e=this.props.subscription,r=o,i=s.fieldSubscriptionItems,e?!r||i.some(function(t){return e[t]!==r[t]}):r))&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify)),this.props.name!==n&&this.bindMutators(t)},n.componentDidMount=function(){this.mounted=!0},n.componentWillUnmount=function(){this.mounted=!1,this.unsubscribe()},n.render=function(){var t,e,r,i,n,o=this.props,a=o.name,s=m(o,["name"]),c=this.state.state||{},u=c.length,l={active:c.active,dirty:c.dirty,dirtySinceLastSubmit:c.dirtySinceLastSubmit,error:c.error,initial:c.initial,invalid:c.invalid,pristine:c.pristine,submitError:c.submitError,submitFailed:c.submitFailed,submitSucceeded:c.submitSucceeded,touched:c.touched,valid:c.valid,visited:c.visited},f=d({},l,m(c,["length","active","dirty","dirtySinceLastSubmit","error","initial","invalid","pristine","submitError","submitFailed","submitSucceeded","touched","valid","visited"]));return t=d({fields:d({name:a,forEach:this.forEach,length:u,map:this.map},this.mutators,f),meta:l},s,{__versions:h}),e=t.render,r=t.children,i=t.component,n=m(t,["render","children","component"]),i?p.createElement(i,d({},n,{children:r})):e?e(d({},n,{children:r})):r(n)},r}(p.Component);o(a,"displayName","ReactFinalFormFieldArray("+s.version+")("+n+")"),a.contextTypes={reactFinalForm:r.object},e.polyfill(a),t.FieldArray=a,t.version=n,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-lifecycles-compat"),require("final-form"),require("react-final-form")):"function"==typeof define&&define.amd?define(["exports","react","react-lifecycles-compat","final-form","react-final-form"],e):e(t["react-final-form-arrays"]={},t.React,t.ReactLifecyclesCompat,t.FinalForm,t.ReactFinalForm)}(this,function(t,p,e,s,r){"use strict";function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(){return(d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}).apply(this,arguments)}function m(t,e){if(null==t)return{};var r,i,n={},a=Object.keys(t);for(i=0;i<a.length;i++)r=a[i],0<=e.indexOf(r)||(n[r]=t[r]);return n}function c(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var i="1.0.6",h={"final-form":s.version,"react-final-form":r.version,"react-final-form-arrays":i},u=s.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),n=function(r){var t,e;function i(t){var o,e;return a(c(c(o=r.call(this,t)||this)),"isEqual",function(t,e){return"function"!=typeof o.props.isEqual||o.props.isEqual(t,e)}),a(c(c(o)),"subscribe",function(t,e){var r=t.name,i=t.subscription;o.unsubscribe=o.props.reactFinalForm.registerField(r,e,i?d({},i,{length:!0}):u,{getValidator:function(){return o.validate},isEqual:o.isEqual})}),a(c(c(o)),"validate",function(){var t=o.props.validate;if(t){var e=t(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1]);if(!e||Array.isArray(e))return e;var r=[];return r[s.ARRAY_ERROR]=e,r}}),a(c(c(o)),"bindMutators",function(t){var n=t.name,e=o.props.reactFinalForm;if(e){var a=e.mutators;!!(a&&a.push&&a.pop)&&(o.mutators=Object.keys(a).reduce(function(t,i){return t[i]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return a[i].apply(a,[n].concat(e))},t},{}))}}),a(c(c(o)),"notify",function(t){setTimeout(function(){o.mounted&&o.setState({state:t})})}),a(c(c(o)),"forEach",function(t){for(var e=o.props.name,r=o.state.state&&o.state.state.length||0,i=0;i<r;i++)t(e+"["+i+"]",i)}),a(c(c(o)),"map",function(t){for(var e=o.props.name,r=o.state.state&&o.state.state.length||0,i=[],n=0;n<r;n++)i.push(t(e+"["+n+"]",n));return i}),t.reactFinalForm&&o.subscribe(t,function(t){e?o.notify(t):e=t}),o.state={state:e},o.bindMutators(t),o.mounted=!1,o}e=r,(t=i).prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e;var n=i.prototype;return n.UNSAFE_componentWillReceiveProps=function(t){var e,r,i,n=t.name,a=t.subscription;(this.props.name!==n||(e=this.props.subscription,r=a,i=s.fieldSubscriptionItems,e?!r||i.some(function(t){return e[t]!==r[t]}):r))&&this.props.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify)),this.props.name!==n&&this.bindMutators(t)},n.componentDidMount=function(){this.mounted=!0},n.componentWillUnmount=function(){this.mounted=!1,this.unsubscribe()},n.render=function(){var t,e,r,i,n,a=this.props,o=a.name,s=m(a,["name"]),c=this.state.state||{},u=c.length,l={active:c.active,dirty:c.dirty,dirtySinceLastSubmit:c.dirtySinceLastSubmit,error:c.error,initial:c.initial,invalid:c.invalid,pristine:c.pristine,submitError:c.submitError,submitFailed:c.submitFailed,submitSucceeded:c.submitSucceeded,touched:c.touched,valid:c.valid,visited:c.visited},f=d({},l,m(c,["length","active","dirty","dirtySinceLastSubmit","error","initial","invalid","pristine","submitError","submitFailed","submitSucceeded","touched","valid","visited"]));return t=d({fields:d({name:o,forEach:this.forEach,length:u,map:this.map},this.mutators,f),meta:l},s,{__versions:h}),e=t.render,r=t.children,i=t.component,n=m(t,["render","children","component"]),i?p.createElement(i,d({},n,{children:r})):e?e(d({},n,{children:r})):r(n)},i}(p.Component);a(n,"displayName","ReactFinalFormFieldArray("+s.version+")("+i+")"),e.polyfill(n);var o=r.withReactFinalForm(n);t.FieldArray=o,t.version=i,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=react-final-form-arrays.umd.min.js.map
{
"name": "react-final-form-arrays",
"version": "1.1.0",
"version": "2.0.0",
"description": "A component for rendering and editing arrays 🏁 React Final Form",

@@ -70,3 +70,3 @@ "main": "dist/react-final-form-arrays.cjs.js",

"react-dom": "^16.5.2",
"react-final-form": "^3.6.7",
"react-final-form": "^4.0.0",
"rollup": "^0.66.6",

@@ -85,4 +85,5 @@ "rollup-plugin-babel": "^4.0.1",

"final-form-arrays": ">=1.0.4",
"react-final-form": "^4.0.0",
"prop-types": "^15.6.0",
"react": "^15.3.0 || ^16.0.0-0"
"react": "^16.3.0"
},

@@ -89,0 +90,0 @@ "jest": {

Sorry, the diff of this file is not supported yet

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