react-final-form-arrays
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -5,2 +5,9 @@ 'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var _objectWithoutPropertiesLoose = _interopDefault(require('@babel/runtime/helpers/objectWithoutPropertiesLoose')); | ||
var _extends = _interopDefault(require('@babel/runtime/helpers/extends')); | ||
var _assertThisInitialized = _interopDefault(require('@babel/runtime/helpers/assertThisInitialized')); | ||
var _inheritsLoose = _interopDefault(require('@babel/runtime/helpers/inheritsLoose')); | ||
var _defineProperty = _interopDefault(require('@babel/runtime/helpers/defineProperty')); | ||
var React = require('react'); | ||
@@ -11,64 +18,2 @@ var reactLifecyclesCompat = require('react-lifecycles-compat'); | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _inheritsLoose(subClass, superClass) { | ||
subClass.prototype = Object.create(superClass.prototype); | ||
subClass.prototype.constructor = subClass; | ||
subClass.__proto__ = superClass; | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _assertThisInitialized(self) { | ||
if (self === void 0) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
} | ||
return self; | ||
} | ||
// | ||
@@ -142,3 +87,3 @@ function diffSubscription (a, b, keys) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "isEqual", function (a, b) { | ||
_defineProperty(_assertThisInitialized(_this), "isEqual", function (a, b) { | ||
if (typeof _this.props.isEqual === 'function') { | ||
@@ -151,3 +96,3 @@ return _this.props.isEqual(a, b); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "subscribe", function (_ref, listener) { | ||
_defineProperty(_assertThisInitialized(_this), "subscribe", function (_ref, listener) { | ||
var name = _ref.name, | ||
@@ -165,3 +110,3 @@ subscription = _ref.subscription; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "validate", function () { | ||
_defineProperty(_assertThisInitialized(_this), "validate", function () { | ||
var validate = _this.props.validate; | ||
@@ -181,8 +126,8 @@ if (!validate) return undefined; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "bindMutators", function (_ref2) { | ||
_defineProperty(_assertThisInitialized(_this), "bindMutators", function (_ref2) { | ||
var name = _ref2.name; | ||
var reactFinalForm$$1 = _this.props.reactFinalForm; | ||
var reactFinalForm = _this.props.reactFinalForm; | ||
if (reactFinalForm$$1) { | ||
var mutators = reactFinalForm$$1.mutators; | ||
if (reactFinalForm) { | ||
var mutators = reactFinalForm.mutators; | ||
var hasMutators = !!(mutators && mutators.push && mutators.pop); // istanbul ignore next | ||
@@ -210,3 +155,3 @@ | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "notify", function (state) { | ||
_defineProperty(_assertThisInitialized(_this), "notify", function (state) { | ||
setTimeout(function () { | ||
@@ -221,3 +166,3 @@ if (_this.mounted) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "forEach", function (iterator) { | ||
_defineProperty(_assertThisInitialized(_this), "forEach", function (iterator) { | ||
var name = _this.props.name; // required || for Flow, but results in uncovered line in Jest/Istanbul | ||
@@ -233,3 +178,3 @@ // istanbul ignore next | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "map", function (iterator) { | ||
_defineProperty(_assertThisInitialized(_this), "map", function (iterator) { | ||
var name = _this.props.name; // required || for Flow, but results in uncovered line in Jest/Istanbul | ||
@@ -364,7 +309,7 @@ // istanbul ignore next | ||
reactLifecyclesCompat.polyfill(FieldArray); | ||
var FieldArray$1 = reactFinalForm.withReactFinalForm(FieldArray); | ||
var decorated = reactFinalForm.withReactFinalForm < FieldArrayProps > FieldArray; | ||
// | ||
exports.FieldArray = FieldArray$1; | ||
exports.FieldArray = decorated; | ||
exports.version = version; |
@@ -1,68 +0,11 @@ | ||
import { Component, createElement } from 'react'; | ||
import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose'; | ||
import _extends from '@babel/runtime/helpers/extends'; | ||
import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized'; | ||
import _inheritsLoose from '@babel/runtime/helpers/inheritsLoose'; | ||
import _defineProperty from '@babel/runtime/helpers/defineProperty'; | ||
import { createElement, Component } from 'react'; | ||
import { polyfill } from 'react-lifecycles-compat'; | ||
import { fieldSubscriptionItems, version, ARRAY_ERROR } from 'final-form'; | ||
import { version as version$1, withReactFinalForm } from 'react-final-form'; | ||
import { fieldSubscriptionItems, version as version$1, ARRAY_ERROR } from 'final-form'; | ||
import { withReactFinalForm, version as version$2 } from 'react-final-form'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _inheritsLoose(subClass, superClass) { | ||
subClass.prototype = Object.create(superClass.prototype); | ||
subClass.prototype.constructor = subClass; | ||
subClass.__proto__ = superClass; | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _assertThisInitialized(self) { | ||
if (self === void 0) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
} | ||
return self; | ||
} | ||
// | ||
@@ -115,7 +58,7 @@ function diffSubscription (a, b, keys) { | ||
var version$2 = '2.0.1'; | ||
var version = '2.0.1'; | ||
var versions = { | ||
'final-form': version, | ||
'react-final-form': version$1, | ||
'react-final-form-arrays': version$2 | ||
'final-form': version$1, | ||
'react-final-form': version$2, | ||
'react-final-form-arrays': version | ||
}; | ||
@@ -137,3 +80,3 @@ var all = fieldSubscriptionItems.reduce(function (result, key) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "isEqual", function (a, b) { | ||
_defineProperty(_assertThisInitialized(_this), "isEqual", function (a, b) { | ||
if (typeof _this.props.isEqual === 'function') { | ||
@@ -146,3 +89,3 @@ return _this.props.isEqual(a, b); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "subscribe", function (_ref, listener) { | ||
_defineProperty(_assertThisInitialized(_this), "subscribe", function (_ref, listener) { | ||
var name = _ref.name, | ||
@@ -160,3 +103,3 @@ subscription = _ref.subscription; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "validate", function () { | ||
_defineProperty(_assertThisInitialized(_this), "validate", function () { | ||
var validate = _this.props.validate; | ||
@@ -176,3 +119,3 @@ if (!validate) return undefined; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "bindMutators", function (_ref2) { | ||
_defineProperty(_assertThisInitialized(_this), "bindMutators", function (_ref2) { | ||
var name = _ref2.name; | ||
@@ -205,3 +148,3 @@ var reactFinalForm = _this.props.reactFinalForm; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "notify", function (state) { | ||
_defineProperty(_assertThisInitialized(_this), "notify", function (state) { | ||
setTimeout(function () { | ||
@@ -216,3 +159,3 @@ if (_this.mounted) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "forEach", function (iterator) { | ||
_defineProperty(_assertThisInitialized(_this), "forEach", function (iterator) { | ||
var name = _this.props.name; // required || for Flow, but results in uncovered line in Jest/Istanbul | ||
@@ -228,3 +171,3 @@ // istanbul ignore next | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "map", function (iterator) { | ||
_defineProperty(_assertThisInitialized(_this), "map", function (iterator) { | ||
var name = _this.props.name; // required || for Flow, but results in uncovered line in Jest/Istanbul | ||
@@ -356,9 +299,9 @@ // istanbul ignore next | ||
_defineProperty(FieldArray, "displayName", "ReactFinalFormFieldArray(" + version + ")(" + version$2 + ")"); | ||
_defineProperty(FieldArray, "displayName", "ReactFinalFormFieldArray(" + version$1 + ")(" + version + ")"); | ||
polyfill(FieldArray); | ||
var FieldArray$1 = withReactFinalForm(FieldArray); | ||
var decorated = withReactFinalForm < FieldArrayProps > FieldArray; | ||
// | ||
export { FieldArray$1 as FieldArray, version$2 as version }; | ||
export { decorated as FieldArray, version }; |
(function (global, factory) { | ||
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'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@babel/runtime/helpers/objectWithoutPropertiesLoose'), require('@babel/runtime/helpers/extends'), require('@babel/runtime/helpers/assertThisInitialized'), require('@babel/runtime/helpers/inheritsLoose'), require('@babel/runtime/helpers/defineProperty'), require('react'), require('react-lifecycles-compat'), require('final-form'), require('react-final-form')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@babel/runtime/helpers/objectWithoutPropertiesLoose', '@babel/runtime/helpers/extends', '@babel/runtime/helpers/assertThisInitialized', '@babel/runtime/helpers/inheritsLoose', '@babel/runtime/helpers/defineProperty', 'react', 'react-lifecycles-compat', 'final-form', 'react-final-form'], factory) : | ||
(global = global || self, factory(global['react-final-form-arrays'] = {}, global._objectWithoutPropertiesLoose, global._extends, global._assertThisInitialized, global._inheritsLoose, global._defineProperty, global.React, global.ReactLifecyclesCompat, global.FinalForm, global.ReactFinalForm)); | ||
}(this, function (exports, _objectWithoutPropertiesLoose, _extends, _assertThisInitialized, _inheritsLoose, _defineProperty, React, reactLifecyclesCompat, finalForm, reactFinalForm) { 'use strict'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
_objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose && _objectWithoutPropertiesLoose.hasOwnProperty('default') ? _objectWithoutPropertiesLoose['default'] : _objectWithoutPropertiesLoose; | ||
_extends = _extends && _extends.hasOwnProperty('default') ? _extends['default'] : _extends; | ||
_assertThisInitialized = _assertThisInitialized && _assertThisInitialized.hasOwnProperty('default') ? _assertThisInitialized['default'] : _assertThisInitialized; | ||
_inheritsLoose = _inheritsLoose && _inheritsLoose.hasOwnProperty('default') ? _inheritsLoose['default'] : _inheritsLoose; | ||
_defineProperty = _defineProperty && _defineProperty.hasOwnProperty('default') ? _defineProperty['default'] : _defineProperty; | ||
return obj; | ||
} | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
function _inheritsLoose(subClass, superClass) { | ||
subClass.prototype = Object.create(superClass.prototype); | ||
subClass.prototype.constructor = subClass; | ||
subClass.__proto__ = superClass; | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
if (source == null) return {}; | ||
var target = {}; | ||
var sourceKeys = Object.keys(source); | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
key = sourceKeys[i]; | ||
if (excluded.indexOf(key) >= 0) continue; | ||
target[key] = source[key]; | ||
} | ||
return target; | ||
} | ||
function _assertThisInitialized(self) { | ||
if (self === void 0) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
} | ||
return self; | ||
} | ||
// | ||
@@ -137,3 +81,3 @@ function diffSubscription (a, b, keys) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "isEqual", function (a, b) { | ||
_defineProperty(_assertThisInitialized(_this), "isEqual", function (a, b) { | ||
if (typeof _this.props.isEqual === 'function') { | ||
@@ -146,3 +90,3 @@ return _this.props.isEqual(a, b); | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "subscribe", function (_ref, listener) { | ||
_defineProperty(_assertThisInitialized(_this), "subscribe", function (_ref, listener) { | ||
var name = _ref.name, | ||
@@ -160,3 +104,3 @@ subscription = _ref.subscription; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "validate", function () { | ||
_defineProperty(_assertThisInitialized(_this), "validate", function () { | ||
var validate = _this.props.validate; | ||
@@ -176,8 +120,8 @@ if (!validate) return undefined; | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "bindMutators", function (_ref2) { | ||
_defineProperty(_assertThisInitialized(_this), "bindMutators", function (_ref2) { | ||
var name = _ref2.name; | ||
var reactFinalForm$$1 = _this.props.reactFinalForm; | ||
var reactFinalForm = _this.props.reactFinalForm; | ||
if (reactFinalForm$$1) { | ||
var mutators = reactFinalForm$$1.mutators; | ||
if (reactFinalForm) { | ||
var mutators = reactFinalForm.mutators; | ||
var hasMutators = !!(mutators && mutators.push && mutators.pop); // istanbul ignore next | ||
@@ -205,3 +149,3 @@ | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "notify", function (state) { | ||
_defineProperty(_assertThisInitialized(_this), "notify", function (state) { | ||
setTimeout(function () { | ||
@@ -216,3 +160,3 @@ if (_this.mounted) { | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "forEach", function (iterator) { | ||
_defineProperty(_assertThisInitialized(_this), "forEach", function (iterator) { | ||
var name = _this.props.name; // required || for Flow, but results in uncovered line in Jest/Istanbul | ||
@@ -228,3 +172,3 @@ // istanbul ignore next | ||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "map", function (iterator) { | ||
_defineProperty(_assertThisInitialized(_this), "map", function (iterator) { | ||
var name = _this.props.name; // required || for Flow, but results in uncovered line in Jest/Istanbul | ||
@@ -359,7 +303,7 @@ // istanbul ignore next | ||
reactLifecyclesCompat.polyfill(FieldArray); | ||
var FieldArray$1 = reactFinalForm.withReactFinalForm(FieldArray); | ||
var decorated = reactFinalForm.withReactFinalForm < FieldArrayProps > FieldArray; | ||
// | ||
exports.FieldArray = FieldArray$1; | ||
exports.FieldArray = decorated; | ||
exports.version = version; | ||
@@ -369,3 +313,3 @@ | ||
}))); | ||
})); | ||
//# sourceMappingURL=react-final-form-arrays.umd.js.map |
@@ -1,2 +0,2 @@ | ||
!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="2.0.1",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})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/defineProperty"),require("react"),require("react-lifecycles-compat"),require("final-form"),require("react-final-form")):"function"==typeof define&&define.amd?define(["exports","@babel/runtime/helpers/objectWithoutPropertiesLoose","@babel/runtime/helpers/extends","@babel/runtime/helpers/assertThisInitialized","@babel/runtime/helpers/inheritsLoose","@babel/runtime/helpers/defineProperty","react","react-lifecycles-compat","final-form","react-final-form"],t):t((e=e||self)["react-final-form-arrays"]={},e._objectWithoutPropertiesLoose,e._extends,e._assertThisInitialized,e._inheritsLoose,e._defineProperty,e.React,e.ReactLifecyclesCompat,e.FinalForm,e.ReactFinalForm)}(this,function(e,_,L,i,n,a,A,t,o,r){"use strict";_=_&&_.hasOwnProperty("default")?_.default:_,L=L&&L.hasOwnProperty("default")?L.default:L,i=i&&i.hasOwnProperty("default")?i.default:i,n=n&&n.hasOwnProperty("default")?n.default:n,a=a&&a.hasOwnProperty("default")?a.default:a;var s="2.0.1",O={"final-form":o.version,"react-final-form":r.version,"react-final-form-arrays":s},u=o.fieldSubscriptionItems.reduce(function(e,t){return e[t]=!0,e},{}),l=function(r){function e(e){var s,t;return s=r.call(this,e)||this,a(i(s),"isEqual",function(e,t){return"function"!=typeof s.props.isEqual||s.props.isEqual(e,t)}),a(i(s),"subscribe",function(e,t){var r=e.name,i=e.subscription;s.unsubscribe=s.props.reactFinalForm.registerField(r,t,i?L({},i,{length:!0}):u,{getValidator:function(){return s.validate},isEqual:s.isEqual})}),a(i(s),"validate",function(){var e=s.props.validate;if(e){var t=e(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1]);if(!t||Array.isArray(t))return t;var r=[];return r[o.ARRAY_ERROR]=t,r}}),a(i(s),"bindMutators",function(e){var n=e.name,t=s.props.reactFinalForm;if(t){var a=t.mutators;!!(a&&a.push&&a.pop)&&(s.mutators=Object.keys(a).reduce(function(e,i){return e[i]=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return a[i].apply(a,[n].concat(t))},e},{}))}}),a(i(s),"notify",function(e){setTimeout(function(){s.mounted&&s.setState({state:e})})}),a(i(s),"forEach",function(e){for(var t=s.props.name,r=s.state.state&&s.state.state.length||0,i=0;i<r;i++)e(t+"["+i+"]",i)}),a(i(s),"map",function(e){for(var t=s.props.name,r=s.state.state&&s.state.state.length||0,i=[],n=0;n<r;n++)i.push(e(t+"["+n+"]",n));return i}),e.reactFinalForm&&s.subscribe(e,function(e){t?s.notify(e):t=e}),s.state={state:t},s.bindMutators(e),s.mounted=!1,s}n(e,r);var t=e.prototype;return t.UNSAFE_componentWillReceiveProps=function(e){var t,r,i,n=e.name,a=e.subscription;(this.props.name!==n||(t=this.props.subscription,r=a,i=o.fieldSubscriptionItems,t?!r||i.some(function(e){return t[e]!==r[e]}):r))&&this.props.reactFinalForm&&(this.unsubscribe(),this.subscribe(e,this.notify)),this.props.name!==n&&this.bindMutators(e)},t.componentDidMount=function(){this.mounted=!0},t.componentWillUnmount=function(){this.mounted=!1,this.unsubscribe()},t.render=function(){var e,t,r,i,n,a=this.props,s=a.name,o=_(a,["name"]),u=this.state.state||{},l=u.length,c=u.active,d=u.dirty,p=u.dirtySinceLastSubmit,f=u.error,m=u.initial,h=u.invalid,b=u.pristine,v=u.submitError,y=u.submitFailed,F=u.submitSucceeded,q=u.touched,E=u.valid,P=u.visited,S=_(u,["length","active","dirty","dirtySinceLastSubmit","error","initial","invalid","pristine","submitError","submitFailed","submitSucceeded","touched","valid","visited"]),g={active:c,dirty:d,dirtySinceLastSubmit:p,error:f,initial:m,invalid:h,pristine:b,submitError:v,submitFailed:y,submitSucceeded:F,touched:q,valid:E,visited:P},R=L({},g,S);return e=L({fields:L({name:s,forEach:this.forEach,length:l,map:this.map},this.mutators,R),meta:g},o,{__versions:O}),t=e.render,r=e.children,i=e.component,n=_(e,["render","children","component"]),i?A.createElement(i,L({},n,{children:r})):t?t(L({},n,{children:r})):r(n)},e}(A.Component);a(l,"displayName","ReactFinalFormFieldArray("+o.version+")("+s+")"),t.polyfill(l);var c=r.withReactFinalForm<FieldArrayProps>l;e.FieldArray=c,e.version=s,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=react-final-form-arrays.umd.min.js.map |
{ | ||
"name": "react-final-form-arrays", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A component for rendering and editing arrays 🏁 React Final Form", | ||
@@ -28,54 +28,54 @@ "main": "dist/react-final-form-arrays.cjs.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0", | ||
"@babel/plugin-proposal-decorators": "^7.0.0", | ||
"@babel/plugin-proposal-export-namespace-from": "^7.0.0", | ||
"@babel/plugin-proposal-function-sent": "^7.0.0", | ||
"@babel/plugin-proposal-json-strings": "^7.0.0", | ||
"@babel/plugin-proposal-numeric-separator": "^7.0.0", | ||
"@babel/plugin-proposal-throw-expressions": "^7.0.0", | ||
"@babel/plugin-syntax-dynamic-import": "^7.0.0", | ||
"@babel/plugin-syntax-import-meta": "^7.0.0", | ||
"@babel/plugin-transform-flow-strip-types": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/core": "^7.3.4", | ||
"@babel/plugin-proposal-class-properties": "^7.3.4", | ||
"@babel/plugin-proposal-decorators": "^7.3.0", | ||
"@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.3.4", | ||
"@babel/plugin-transform-runtime": "^7.3.4", | ||
"@babel/preset-env": "^7.3.4", | ||
"@babel/preset-flow": "^7.0.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@types/react": "^16.4.16", | ||
"@types/react": "^16.8.6", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^23.6.0", | ||
"bundlesize": "^0.17.0", | ||
"doctoc": "^1.3.1", | ||
"eslint": "^5.7.0", | ||
"eslint-config-react-app": "^3.0.4", | ||
"babel-jest": "^24.1.0", | ||
"bundlesize": "^0.17.1", | ||
"doctoc": "^1.4.0", | ||
"eslint": "^5.15.0", | ||
"eslint-config-react-app": "^3.0.7", | ||
"eslint-plugin-babel": "^5.2.1", | ||
"eslint-plugin-flowtype": "^3.0.0", | ||
"eslint-plugin-import": "^2.14.0", | ||
"eslint-plugin-jsx-a11y": "^6.1.2", | ||
"eslint-plugin-react": "^7.11.1", | ||
"final-form": "^4.10.0", | ||
"final-form-arrays": "^1.1.0", | ||
"flow-bin": "^0.83.0", | ||
"eslint-plugin-flowtype": "^3.4.2", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-plugin-jsx-a11y": "^6.2.1", | ||
"eslint-plugin-react": "^7.12.4", | ||
"final-form": "^4.11.1", | ||
"final-form-arrays": "^1.1.2", | ||
"flow-bin": "^0.94.0", | ||
"glow": "^1.2.2", | ||
"husky": "^1.1.2", | ||
"jest": "^23.6.0", | ||
"jest-watch-typeahead": "^0.2.0", | ||
"lint-staged": "^7.3.0", | ||
"nps": "^5.9.3", | ||
"husky": "^1.3.1", | ||
"jest": "^24.1.0", | ||
"jest-watch-typeahead": "^0.2.1", | ||
"lint-staged": "^8.1.5", | ||
"nps": "^5.9.4", | ||
"nps-utils": "^1.7.0", | ||
"prettier": "^1.14.3", | ||
"prettier": "^1.16.4", | ||
"prettier-eslint-cli": "^4.7.1", | ||
"prop-types": "^15.6.2", | ||
"raf": "^3.4.0", | ||
"react": "^16.5.2", | ||
"react-dom": "^16.5.2", | ||
"react-final-form": "^4.0.0", | ||
"rollup": "^0.66.6", | ||
"rollup-plugin-babel": "^4.0.1", | ||
"rollup-plugin-commonjs": "^9.2.0", | ||
"react": "^16.8.3", | ||
"react-dom": "^16.8.3", | ||
"react-final-form": "^4.0.2", | ||
"rollup": "^1.4.1", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^9.2.1", | ||
"rollup-plugin-flow": "^1.1.1", | ||
"rollup-plugin-node-resolve": "^3.4.0", | ||
"rollup-plugin-node-resolve": "^4.0.1", | ||
"rollup-plugin-replace": "^2.1.0", | ||
"rollup-plugin-uglify": "^6.0.0", | ||
"typescript": "^3.1.3", | ||
"@babel/preset-flow": "^7.0.0" | ||
"rollup-plugin-uglify": "^6.0.2", | ||
"typescript": "^3.3.3333" | ||
}, | ||
@@ -93,2 +93,5 @@ "peerDependencies": { | ||
"jest-watch-typeahead/testname" | ||
], | ||
"testPathIgnorePatterns": [ | ||
".*\\.tsx?" | ||
] | ||
@@ -117,4 +120,5 @@ }, | ||
"dependencies": { | ||
"@babel/runtime": "^7.3.4", | ||
"react-lifecycles-compat": "^3.0.4" | ||
} | ||
} |
@@ -79,51 +79,47 @@ # 🏁 React Final Form Arrays | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
- [🏁 React Final Form Arrays](#-react-final-form-arrays) | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Table of Contents](#table-of-contents) | ||
- [Examples](#examples) | ||
- [Simple Example](#simple-example) | ||
- [Rendering](#rendering) | ||
- [API](#api) | ||
- [`FieldArray : React.ComponentType<FieldArrayProps>`](#fieldarray--reactcomponenttypefieldarrayprops) | ||
- [`version: string`](#version-string) | ||
- [Types](#types) | ||
- [`FieldArrayProps`](#fieldarrayprops) | ||
- [`children?: ((props: FieldArrayRenderProps) => React.Node) | React.Node`](#children-props-fieldarrayrenderprops--reactnode--reactnode) | ||
- [`component?: React.ComponentType<FieldArrayRenderProps>`](#component-reactcomponenttypefieldarrayrenderprops) | ||
- [`name: string`](#name-string) | ||
- [`render?: (props: FieldArrayRenderProps) => React.Node`](#render-props-fieldarrayrenderprops--reactnode) | ||
- [`isEqual?: (allPreviousValues: Array<any>, allNewValues: Array<any>) => boolean`](#isequal-allpreviousvalues-arrayany-allnewvalues-arrayany--boolean) | ||
- [`subscription?: FieldSubscription`](#subscription-fieldsubscription) | ||
- [`validate?: (value: ?any[], allValues: Object) => ?any`](#validate-value-any-allvalues-object--any) | ||
- [`FieldArrayRenderProps`](#fieldarrayrenderprops) | ||
- [`fields.forEach: (iterator: (name: string, index: number) => void) => void`](#fieldsforeach-iterator-name-string-index-number--void--void) | ||
- [`fields.insert: (index: number, value: any) => void`](#fieldsinsert-index-number-value-any--void) | ||
- [`fields.map: (iterator: (name: string, index: number) => any) => any[]`](#fieldsmap-iterator-name-string-index-number--any--any) | ||
- [`fields.move: (from: number, to: number) => void`](#fieldsmove-from-number-to-number--void) | ||
- [`fields.name: string`](#fieldsname-string) | ||
- [`fields.pop: () => any`](#fieldspop---any) | ||
- [`fields.push: (value: any) => void`](#fieldspush-value-any--void) | ||
- [`fields.remove: (index: number) => any`](#fieldsremove-index-number--any) | ||
- [`fields.shift: () => any`](#fieldsshift---any) | ||
- [`fields.swap: (indexA: number, indexB: number) => void`](#fieldsswap-indexa-number-indexb-number--void) | ||
- [`fields.unshift: (value: any) => void`](#fieldsunshift-value-any--void) | ||
- [`meta.active?: boolean`](#metaactive-boolean) | ||
- [`meta.data: Object`](#metadata-object) | ||
- [`meta.dirty?: boolean`](#metadirty-boolean) | ||
- [`meta.error?: any`](#metaerror-any) | ||
- [`meta.initial?: any`](#metainitial-any) | ||
- [`meta.invalid?: boolean`](#metainvalid-boolean) | ||
- [`meta.pristine?: boolean`](#metapristine-boolean) | ||
- [`meta.submitError?: any`](#metasubmiterror-any) | ||
- [`meta.submitFailed?: boolean`](#metasubmitfailed-boolean) | ||
- [`meta.submitSucceeded?: boolean`](#metasubmitsucceeded-boolean) | ||
- [`meta.touched?: boolean`](#metatouched-boolean) | ||
- [`meta.valid?: boolean`](#metavalid-boolean) | ||
- [`meta.visited?: boolean`](#metavisited-boolean) | ||
- [Examples](#examples) | ||
- [Simple Example](#simple-example) | ||
- [React Beautiful DnD Example](#react-beautiful-dnd-example) | ||
- [Rendering](#rendering) | ||
- [API](#api) | ||
- [`FieldArray : React.ComponentType<FieldArrayProps>`](#fieldarray--reactcomponenttypefieldarrayprops) | ||
- [`version: string`](#version-string) | ||
- [Types](#types) | ||
- [`FieldArrayProps`](#fieldarrayprops) | ||
- [`children?: ((props: FieldArrayRenderProps) => React.Node) | React.Node`](#children-props-fieldarrayrenderprops--reactnode--reactnode) | ||
- [`component?: React.ComponentType<FieldArrayRenderProps>`](#component-reactcomponenttypefieldarrayrenderprops) | ||
- [`name: string`](#name-string) | ||
- [`render?: (props: FieldArrayRenderProps) => React.Node`](#render-props-fieldarrayrenderprops--reactnode) | ||
- [`isEqual?: (allPreviousValues: Array<any>, allNewValues: Array<any>) => boolean`](#isequal-allpreviousvalues-arrayany-allnewvalues-arrayany--boolean) | ||
- [`subscription?: FieldSubscription`](#subscription-fieldsubscription) | ||
- [`validate?: (value: ?any[], allValues: Object) => ?any`](#validate-value-any-allvalues-object--any) | ||
- [`FieldArrayRenderProps`](#fieldarrayrenderprops) | ||
- [`fields.forEach: (iterator: (name: string, index: number) => void) => void`](#fieldsforeach-iterator-name-string-index-number--void--void) | ||
- [`fields.insert: (index: number, value: any) => void`](#fieldsinsert-index-number-value-any--void) | ||
- [`fields.map: (iterator: (name: string, index: number) => any) => any[]`](#fieldsmap-iterator-name-string-index-number--any--any) | ||
- [`fields.move: (from: number, to: number) => void`](#fieldsmove-from-number-to-number--void) | ||
- [`fields.name: string`](#fieldsname-string) | ||
- [`fields.pop: () => any`](#fieldspop---any) | ||
- [`fields.push: (value: any) => void`](#fieldspush-value-any--void) | ||
- [`fields.remove: (index: number) => any`](#fieldsremove-index-number--any) | ||
- [`fields.shift: () => any`](#fieldsshift---any) | ||
- [`fields.swap: (indexA: number, indexB: number) => void`](#fieldsswap-indexa-number-indexb-number--void) | ||
- [`fields.update: (index: number, value: any) => void`](#fieldsupdate-index-number-value-any--void) | ||
- [`fields.unshift: (value: any) => void`](#fieldsunshift-value-any--void) | ||
- [`meta.active?: boolean`](#metaactive-boolean) | ||
- [`meta.data: Object`](#metadata-object) | ||
- [`meta.dirty?: boolean`](#metadirty-boolean) | ||
- [`meta.error?: any`](#metaerror-any) | ||
- [`meta.initial?: any`](#metainitial-any) | ||
- [`meta.invalid?: boolean`](#metainvalid-boolean) | ||
- [`meta.pristine?: boolean`](#metapristine-boolean) | ||
- [`meta.submitError?: any`](#metasubmiterror-any) | ||
- [`meta.submitFailed?: boolean`](#metasubmitfailed-boolean) | ||
- [`meta.submitSucceeded?: boolean`](#metasubmitsucceeded-boolean) | ||
- [`meta.touched?: boolean`](#metatouched-boolean) | ||
- [`meta.valid?: boolean`](#metavalid-boolean) | ||
- [`meta.visited?: boolean`](#metavisited-boolean) | ||
@@ -139,2 +135,6 @@ <!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
### [React Beautiful DnD Example](https://codesandbox.io/s/8k0ykyr7z9) | ||
Demostrates how to integrate the simple example with [react-beautiful-dnd](https://github.com/atlassian/react-beautiful-dnd) | ||
## Rendering | ||
@@ -269,2 +269,6 @@ | ||
#### `fields.update: (index: number, value: any) => void` | ||
Updates a value of the specified index of the array field. | ||
#### `fields.unshift: (value: any) => void` | ||
@@ -271,0 +275,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
326
55256
7
810
+ Added@babel/runtime@^7.3.4