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 3.1.2 to 3.1.3

3

dist/index.d.ts

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

import * as React from 'react'
import { FieldSubscription, FieldState } from 'final-form'
import { FieldState } from 'final-form'
import { UseFieldConfig } from 'react-final-form'

@@ -4,0 +3,0 @@ export const version: string

@@ -5,11 +5,14 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var _extends = _interopDefault(require('@babel/runtime/helpers/extends'));
var _objectWithoutPropertiesLoose = _interopDefault(require('@babel/runtime/helpers/objectWithoutPropertiesLoose'));
var _extends = require('@babel/runtime/helpers/extends');
var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/objectWithoutPropertiesLoose');
var finalForm = require('final-form');
var reactFinalForm = require('react-final-form');
var React = require('react');
var React__default = _interopDefault(React);
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
var _objectWithoutPropertiesLoose__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutPropertiesLoose);
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
// shared logic between components that use either render prop,

@@ -21,6 +24,6 @@ // children render function, or component prop

component = props.component,
rest = _objectWithoutPropertiesLoose(props, ["render", "children", "component"]);
rest = _objectWithoutPropertiesLoose__default['default'](props, ["render", "children", "component"]);
if (component) {
return React.createElement(component, _extends({}, rest, {
return /*#__PURE__*/React.createElement(component, _extends__default['default']({}, rest, {
children: children,

@@ -32,3 +35,3 @@ render: render

if (render) {
return render(children === undefined ? rest : _extends({}, rest, {
return render(children === undefined ? rest : _extends__default['default']({}, rest, {
children: children

@@ -65,3 +68,3 @@ })); // inject children back in

function useConstant(init) {
var ref = React__default.useRef();
var ref = React__default['default'].useRef();

@@ -130,3 +133,3 @@ if (!ref.current) {

var _useField = reactFinalForm.useField(name, {
subscription: _extends({}, subscription, {
subscription: _extends__default['default']({}, subscription, {
length: true

@@ -144,5 +147,5 @@ }),

length = _useField$meta.length,
meta = _objectWithoutPropertiesLoose(_useField$meta, ["length"]),
meta = _objectWithoutPropertiesLoose__default['default'](_useField$meta, ["length"]),
input = _useField.input,
fieldState = _objectWithoutPropertiesLoose(_useField, ["meta", "input"]);
fieldState = _objectWithoutPropertiesLoose__default['default'](_useField, ["meta", "input"]);

@@ -173,3 +176,3 @@ var forEach = function forEach(iterator) {

return {
fields: _extends({
fields: _extends__default['default']({
name: name,

@@ -179,3 +182,3 @@ forEach: forEach,

map: map
}, mutators, {}, fieldState, {
}, mutators, fieldState, {
value: input.value

@@ -202,3 +205,3 @@ }),

validate = _ref.validate,
rest = _objectWithoutPropertiesLoose(_ref, ["name", "subscription", "defaultValue", "initialValue", "isEqual", "validate"]);
rest = _objectWithoutPropertiesLoose__default['default'](_ref, ["name", "subscription", "defaultValue", "initialValue", "isEqual", "validate"]);

@@ -215,5 +218,5 @@ var _useFieldArray = useFieldArray(name, {

return renderComponent(_extends({
return renderComponent(_extends__default['default']({
fields: fields,
meta: _extends({}, meta, {
meta: _extends__default['default']({}, meta, {
__versions: versions

@@ -220,0 +223,0 @@ })

@@ -5,3 +5,3 @@ import _extends from '@babel/runtime/helpers/extends';

import { useForm, useField, version as version$2 } from 'react-final-form';
import React__default, { createElement } from 'react';
import React, { createElement } from 'react';

@@ -17,3 +17,3 @@ // shared logic between components that use either render prop,

if (component) {
return createElement(component, _extends({}, rest, {
return /*#__PURE__*/createElement(component, _extends({}, rest, {
children: children,

@@ -57,3 +57,3 @@ render: render

function useConstant(init) {
var ref = React__default.useRef();
var ref = React.useRef();

@@ -168,3 +168,3 @@ if (!ref.current) {

map: map
}, mutators, {}, fieldState, {
}, mutators, fieldState, {
value: input.value

@@ -171,0 +171,0 @@ }),

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/extends'), require('@babel/runtime/helpers/objectWithoutPropertiesLoose'), require('final-form'), require('react-final-form'), require('react')) :
typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/extends', '@babel/runtime/helpers/objectWithoutPropertiesLoose', 'final-form', 'react-final-form', 'react'], factory) :
(global = global || self, factory(global['react-final-form-arrays'] = {}, global._extends, global._objectWithoutPropertiesLoose, global.FinalForm, global.ReactFinalForm, global.React));
}(this, function (exports, _extends, _objectWithoutPropertiesLoose, finalForm, reactFinalForm, React) { 'use strict';
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['react-final-form-arrays'] = {}, global._extends, global._objectWithoutPropertiesLoose, global.FinalForm, global.ReactFinalForm, global.React));
}(this, (function (exports, _extends, _objectWithoutPropertiesLoose, finalForm, reactFinalForm, React) { 'use strict';
_extends = _extends && _extends.hasOwnProperty('default') ? _extends['default'] : _extends;
_objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose && _objectWithoutPropertiesLoose.hasOwnProperty('default') ? _objectWithoutPropertiesLoose['default'] : _objectWithoutPropertiesLoose;
var React__default = 'default' in React ? React['default'] : React;
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
var _objectWithoutPropertiesLoose__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutPropertiesLoose);
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
// shared logic between components that use either render prop,

@@ -17,6 +19,6 @@ // children render function, or component prop

component = props.component,
rest = _objectWithoutPropertiesLoose(props, ["render", "children", "component"]);
rest = _objectWithoutPropertiesLoose__default['default'](props, ["render", "children", "component"]);
if (component) {
return React.createElement(component, _extends({}, rest, {
return /*#__PURE__*/React.createElement(component, _extends__default['default']({}, rest, {
children: children,

@@ -28,3 +30,3 @@ render: render

if (render) {
return render(children === undefined ? rest : _extends({}, rest, {
return render(children === undefined ? rest : _extends__default['default']({}, rest, {
children: children

@@ -61,3 +63,3 @@ })); // inject children back in

function useConstant(init) {
var ref = React__default.useRef();
var ref = React__default['default'].useRef();

@@ -126,3 +128,3 @@ if (!ref.current) {

var _useField = reactFinalForm.useField(name, {
subscription: _extends({}, subscription, {
subscription: _extends__default['default']({}, subscription, {
length: true

@@ -140,5 +142,5 @@ }),

length = _useField$meta.length,
meta = _objectWithoutPropertiesLoose(_useField$meta, ["length"]),
meta = _objectWithoutPropertiesLoose__default['default'](_useField$meta, ["length"]),
input = _useField.input,
fieldState = _objectWithoutPropertiesLoose(_useField, ["meta", "input"]);
fieldState = _objectWithoutPropertiesLoose__default['default'](_useField, ["meta", "input"]);

@@ -169,3 +171,3 @@ var forEach = function forEach(iterator) {

return {
fields: _extends({
fields: _extends__default['default']({
name: name,

@@ -175,3 +177,3 @@ forEach: forEach,

map: map
}, mutators, {}, fieldState, {
}, mutators, fieldState, {
value: input.value

@@ -198,3 +200,3 @@ }),

validate = _ref.validate,
rest = _objectWithoutPropertiesLoose(_ref, ["name", "subscription", "defaultValue", "initialValue", "isEqual", "validate"]);
rest = _objectWithoutPropertiesLoose__default['default'](_ref, ["name", "subscription", "defaultValue", "initialValue", "isEqual", "validate"]);

@@ -211,5 +213,5 @@ var _useFieldArray = useFieldArray(name, {

return renderComponent(_extends({
return renderComponent(_extends__default['default']({
fields: fields,
meta: _extends({}, meta, {
meta: _extends__default['default']({}, meta, {
__versions: versions

@@ -226,3 +228,3 @@ })

}));
})));
//# sourceMappingURL=react-final-form-arrays.umd.js.map

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

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require("final-form"),require("react-final-form"),require("react")):"function"==typeof define&&define.amd?define(["exports","@babel/runtime/helpers/extends","@babel/runtime/helpers/objectWithoutPropertiesLoose","final-form","react-final-form","react"],r):r((e=e||self)["react-final-form-arrays"]={},e._extends,e._objectWithoutPropertiesLoose,e.FinalForm,e.ReactFinalForm,e.React)}(this,function(e,A,q,E,F,c){"use strict";A=A&&A.hasOwnProperty("default")?A.default:A,q=q&&q.hasOwnProperty("default")?q.default:q;var t="default"in c?c.default:c;function V(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&!e.some(function(e,r){return e!==t[r]})}function R(e){var r=t.useRef();return r.current||(r.current=e()),r.current}function d(i,e){var r=void 0===e?{}:e,t=r.subscription,n=void 0===t?g:t,a=r.defaultValue,u=r.initialValue,o=r.isEqual,l=void 0===o?V:o,f=r.validate,s=F.useForm("useFieldArray").mutators;if(!!!(s&&s.push&&s.pop))throw new Error("Array mutators not found. You need to provide the mutators from final-form-arrays to your form");var c=R(function(){return Object.keys(s).reduce(function(e,n){return e[n]=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return s[n].apply(s,[i].concat(r))},e},{})}),d=R(function(){return function(e,r,t){if(f){var n=f(e,r,t);if(!n||Array.isArray(n))return n;var i=[];return i[E.ARRAY_ERROR]=n,i}}}),p=F.useField(i,{subscription:A({},n,{length:!0}),defaultValue:a,initialValue:u,isEqual:l,validate:d,format:function(e){return e}}),m=p.meta,h=m.length,v=q(m,["length"]),y=p.input,b=q(p,["meta","input"]);return{fields:A({name:i,forEach:function(e){for(var r=h||0,t=0;t<r;t++)e(i+"["+t+"]",t)},length:h||0,map:function(e){for(var r=h||0,t=[],n=0;n<r;n++)t.push(e(i+"["+n+"]",n));return t}},c,{},b,{value:y.value}),meta:v}}var g=E.fieldSubscriptionItems.reduce(function(e,r){return e[r]=!0,e},{}),r="3.1.2",p={"final-form":E.version,"react-final-form":F.version,"react-final-form-arrays":r};e.FieldArray=function(e){var r=e.name,t=e.subscription,n=e.defaultValue,i=e.initialValue,a=e.isEqual,u=e.validate,o=q(e,["name","subscription","defaultValue","initialValue","isEqual","validate"]),l=d(r,{subscription:t,defaultValue:n,initialValue:i,isEqual:a,validate:u}),f=l.fields,s=l.meta;return function(e,r){var t=e.render,n=e.children,i=e.component,a=q(e,["render","children","component"]);if(i)return c.createElement(i,A({},a,{children:n,render:t}));if(t)return t(void 0===n?a:A({},a,{children:n}));if("function"!=typeof n)throw new Error("Must specify either a render prop, a render function as children, or a component prop to "+r);return n(a)}(A({fields:f,meta:A({},s,{__versions:p})},o),"FieldArray("+r+")")},e.useFieldArray=d,e.version=r,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require("final-form"),require("react-final-form"),require("react")):"function"==typeof define&&define.amd?define(["exports","@babel/runtime/helpers/extends","@babel/runtime/helpers/objectWithoutPropertiesLoose","final-form","react-final-form","react"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["react-final-form-arrays"]={},e._extends,e._objectWithoutPropertiesLoose,e.FinalForm,e.ReactFinalForm,e.React)}(this,function(e,r,t,s,d,o){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(r),p=n(t),i=n(o);function m(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&!e.some(function(e,r){return e!==t[r]})}function h(e){var r=i.default.useRef();return r.current||(r.current=e()),r.current}function l(i,e){var r=void 0===(a=(l=void 0===e?{}:e).subscription)?v:a,t=l.defaultValue,n=l.initialValue,a=void 0===(e=l.isEqual)?m:e,u=l.validate,o=d.useForm("useFieldArray").mutators;if(!!!(o&&o.push&&o.pop))throw new Error("Array mutators not found. You need to provide the mutators from final-form-arrays to your form");var e=h(function(){return Object.keys(o).reduce(function(e,n){return e[n]=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return o[n].apply(o,[i].concat(r))},e},{})}),l=h(function(){return function(e,r,t){if(u){r=u(e,r,t);if(!r||Array.isArray(r))return r;t=[];return t[s.ARRAY_ERROR]=r,t}}}),n=d.useField(i,{subscription:c.default({},r,{length:!0}),defaultValue:t,initialValue:n,isEqual:a,validate:l,format:function(e){return e}}),f=(a=n.meta).length,l=p.default(a,["length"]),a=n.input,n=p.default(n,["meta","input"]);return{fields:c.default({name:i,forEach:function(e){for(var r=f||0,t=0;t<r;t++)e(i+"["+t+"]",t)},length:f||0,map:function(e){for(var r=f||0,t=[],n=0;n<r;n++)t.push(e(i+"["+n+"]",n));return t}},e,n,{value:a.value}),meta:l}}var v=s.fieldSubscriptionItems.reduce(function(e,r){return e[r]=!0,e},{}),t="3.1.2",f={"final-form":s.version,"react-final-form":d.version,"react-final-form-arrays":t};e.FieldArray=function(e){var r=e.name,t=e.subscription,n=e.defaultValue,i=e.initialValue,a=e.isEqual,u=e.validate,e=p.default(e,["name","subscription","defaultValue","initialValue","isEqual","validate"]),a=l(r,{subscription:t,defaultValue:n,initialValue:i,isEqual:a,validate:u}),u=a.fields,a=a.meta;return function(e,r){var t=e.render,n=e.children,i=e.component,e=p.default(e,["render","children","component"]);if(i)return o.createElement(i,c.default({},e,{children:n,render:t}));if(t)return t(void 0===n?e:c.default({},e,{children:n}));if("function"!=typeof n)throw new Error("Must specify either a render prop, a render function as children, or a component prop to "+r);return n(e)}(c.default({fields:u,meta:c.default({},a,{__versions:f})},e),"FieldArray("+r+")")},e.useFieldArray=l,e.version=t,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=react-final-form-arrays.umd.min.js.map
{
"name": "react-final-form-arrays",
"version": "3.1.2",
"version": "3.1.3",
"description": "A component for rendering and editing arrays 🏁 React Final Form",

@@ -28,58 +28,59 @@ "main": "dist/react-final-form-arrays.cjs.js",

"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-proposal-decorators": "^7.4.4",
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
"@babel/plugin-proposal-function-sent": "^7.2.0",
"@babel/plugin-proposal-json-strings": "^7.2.0",
"@babel/plugin-proposal-numeric-separator": "^7.2.0",
"@babel/plugin-proposal-throw-expressions": "^7.2.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-import-meta": "^7.2.0",
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@testing-library/jest-dom": "^4.0.0",
"@testing-library/react": "^8.0.1",
"@types/react": "^16.8.20",
"@babel/core": "^7.12.3",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-decorators": "^7.12.1",
"@babel/plugin-proposal-export-namespace-from": "^7.12.1",
"@babel/plugin-proposal-function-sent": "^7.12.1",
"@babel/plugin-proposal-json-strings": "^7.12.1",
"@babel/plugin-proposal-numeric-separator": "^7.12.1",
"@babel/plugin-proposal-throw-expressions": "^7.12.1",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-flow-strip-types": "^7.12.1",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/preset-flow": "^7.12.1",
"@babel/preset-react": "^7.12.1",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@types/react": "^16.9.53",
"@typescript-eslint/eslint-plugin": "^4.5.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.8.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.0",
"bundlesize": "^0.18.0",
"doctoc": "^1.4.0",
"eslint": "^5.16.0",
"eslint-config-react-app": "^4.0.1",
"eslint-plugin-babel": "^5.2.1",
"eslint-plugin-flowtype": "^3.10.3",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.13.0",
"eslint-plugin-react-hooks": "^1.6.0",
"fast-check": "^1.16.0",
"final-form": "^4.18.1",
"final-form-arrays": "^3.0.0",
"flow-bin": "^0.102.0",
"eslint": "^7.11.0",
"eslint-config-react-app": "^5.2.1",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"fast-check": "^2.5.0",
"final-form": "^4.20.1",
"final-form-arrays": "^3.0.2",
"flow-bin": "^0.136.0",
"glow": "^1.2.2",
"husky": "^3.0.0",
"jest": "^24.8.0",
"jest-watch-typeahead": "^0.3.1",
"lint-staged": "^9.2.0",
"nps": "^5.9.5",
"husky": "^4.3.0",
"jest": "^26.6.0",
"jest-watch-typeahead": "^0.6.1",
"lint-staged": "^10.4.2",
"nps": "^5.10.0",
"nps-utils": "^1.7.0",
"prettier": "^1.18.2",
"prettier": "^2.1.2",
"prettier-eslint-cli": "^5.0.0",
"raf": "^3.4.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-final-form": "^6.2.1",
"rollup": "^1.15.5",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.0.0",
"raf": "^3.4.1",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-final-form": "^6.5.2",
"rollup": "^2.32.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.0.2",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-uglify": "^6.0.2",
"typescript": "^3.5.2"
"rollup-plugin-uglify": "^6.0.4",
"typescript": "^4.0.3"
},

@@ -90,3 +91,3 @@ "peerDependencies": {

"react-final-form": "^6.2.1",
"react": "^16.8.0"
"react": "^16.8.0 || ^17.0.0"
},

@@ -123,4 +124,4 @@ "jest": {

"dependencies": {
"@babel/runtime": "^7.4.5"
"@babel/runtime": "^7.12.1"
}
}

@@ -118,2 +118,3 @@ 💰 **Wanna get paid the big bucks writing React? [Take this quiz](https://triplebyte.com/a/V6j0KPS/rffarrays) and get offers from top tech companies!** 💰

- [`fields.unshift: (value: any) => void`](#fieldsunshift-value-any--void)
- [`fields.value: any[]`](#fieldsvalue-any)
- [`meta.active?: boolean`](#metaactive-boolean)

@@ -120,0 +121,0 @@ - [`meta.data: Object`](#metadata-object)

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