react-final-form-arrays
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -20,3 +20,3 @@ 'use strict'; | ||
// | ||
var diffSubscription = function (a, b, keys) { | ||
function diffSubscription (a, b, keys) { | ||
if (a) { | ||
@@ -34,3 +34,3 @@ if (b) { | ||
} | ||
}; | ||
} | ||
@@ -241,3 +241,3 @@ var classCallCheck = function (instance, Constructor) { | ||
_this2.unsubscribe = _this2.context.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, { length: true }) : all, _this2.validate); | ||
_this2.unsubscribe = _this2.context.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, { length: true }) : all, { validate: _this2.validate }); | ||
}; | ||
@@ -304,5 +304,5 @@ | ||
// | ||
var version$1 = '0.0.1'; | ||
var version$1 = '1.0.2'; | ||
exports.version = version$1; | ||
exports.FieldArray = FieldArray; |
@@ -14,3 +14,3 @@ import { PureComponent, createElement } from 'react'; | ||
// | ||
var diffSubscription = function (a, b, keys) { | ||
function diffSubscription (a, b, keys) { | ||
if (a) { | ||
@@ -28,3 +28,3 @@ if (b) { | ||
} | ||
}; | ||
} | ||
@@ -235,3 +235,3 @@ var classCallCheck = function (instance, Constructor) { | ||
_this2.unsubscribe = _this2.context.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, { length: true }) : all, _this2.validate); | ||
_this2.unsubscribe = _this2.context.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, { length: true }) : all, { validate: _this2.validate }); | ||
}; | ||
@@ -298,4 +298,4 @@ | ||
// | ||
var version$1 = '0.0.1'; | ||
var version$1 = '1.0.2'; | ||
export { version$1 as version, FieldArray }; |
@@ -17,3 +17,3 @@ (function (global, factory) { | ||
// | ||
var diffSubscription = function (a, b, keys) { | ||
function diffSubscription (a, b, keys) { | ||
if (a) { | ||
@@ -31,3 +31,3 @@ if (b) { | ||
} | ||
}; | ||
} | ||
@@ -238,3 +238,3 @@ var classCallCheck = function (instance, Constructor) { | ||
_this2.unsubscribe = _this2.context.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, { length: true }) : all, _this2.validate); | ||
_this2.unsubscribe = _this2.context.reactFinalForm.registerField(name, listener, subscription ? _extends({}, subscription, { length: true }) : all, { validate: _this2.validate }); | ||
}; | ||
@@ -301,3 +301,3 @@ | ||
// | ||
var version$1 = '0.0.1'; | ||
var version$1 = '1.0.2'; | ||
@@ -304,0 +304,0 @@ exports.version = version$1; |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","final-form"],e):e(t["react-final-form-arrays"]={},t.React,t.PropTypes,t.FinalForm)}(this,function(t,e,r,n){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;var o=function(t,e){},i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},u=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},f=n.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),l=function(t){function r(t,e){i(this,r);var n=c(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));p.call(n);var a=void 0;o(e.reactFinalForm,"FieldArray must be used inside of a ReactFinalForm component");return n.context.reactFinalForm&&n.subscribe(t,function(t){a?n.notify(t):a=t}),n.state={state:a||{}},n.bindMutators(t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,e.PureComponent),a(r,[{key:"componentWillReceiveProps",value:function(t){var e=t.name,r=t.subscription;(this.props.name!==e||function(t,e,r){return t?!e||r.some(function(r){return t[r]!==e[r]}):!!e}(this.props.subscription,r,n.fieldSubscriptionItems))&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify)),this.props.name!==e&&this.bindMutators(t)}},{key:"componentWillUnmount",value:function(){this.unsubscribe()}},{key:"render",value:function(){var t=this.props,r=t.name,n=u(t,["name"]),o=this.state.state,i=o.value,a=o.length,c=u(o,["value","length"]);return function(t,r){var n=t.render,o=t.children,i=t.component,a=u(t,["render","children","component"]);return i?e.createElement(i,s({},a,{children:o})):n?n(s({},a,{children:o})):"function"!=typeof o?null:o(a)}(s({fields:s({name:r,forEach:this.forEach,length:a,map:this.map},this.mutators),meta:c,value:i},n))}}]),r}();l.displayName="ReactFinalFormFieldArray("+n.version+")("+h+")";var p=function(){var t=this;this.subscribe=function(e,r){var n=e.name,o=e.subscription;t.unsubscribe=t.context.reactFinalForm.registerField(n,r,o?s({},o,{length:!0}):f,t.validate)},this.bindMutators=function(e){var r=e.name,n=t.context.reactFinalForm;if(n){var i=n.mutators;o(i&&i.push&&i.pop,"Array mutators not found. You need to provide the mutators from final-form-arrays to your form"),i&&(t.mutators=Object.keys(i).reduce(function(t,e){return t[e]=function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return i[e].apply(i,[r].concat(n))},t},{}))}},this.validate=function(e,r){return t.props.validate&&t.props.validate(e,r)},this.notify=function(e){setTimeout(function(){return t.setState({state:e})})},this.forEach=function(e){for(var r=t.props.name,n=t.state.state.length,o=0;o<n;o++)e(r+"["+o+"]",o)},this.map=function(e){for(var r=t.props.name,n=t.state.state.length,o=[],i=0;i<n;i++)o.push(e(r+"["+i+"]",i));return o}};l.contextTypes={reactFinalForm:r.object};var h="0.0.1";t.version=h,t.FieldArray=l,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","final-form"],e):e(t["react-final-form-arrays"]={},t.React,t.PropTypes,t.FinalForm)}(this,function(t,e,r,n){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r;var o=function(t,e){};var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},u=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e};var f=n.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),l=function(t){function r(t,e){i(this,r);var n=c(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));p.call(n);var a=void 0;return o(e.reactFinalForm,"FieldArray must be used inside of a ReactFinalForm component"),n.context.reactFinalForm&&n.subscribe(t,function(t){a?n.notify(t):a=t}),n.state={state:a||{}},n.bindMutators(t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,e.PureComponent),a(r,[{key:"componentWillReceiveProps",value:function(t){var e,r,o,i=t.name,a=t.subscription;(this.props.name!==i||(e=this.props.subscription,r=a,o=n.fieldSubscriptionItems,e?!r||o.some(function(t){return e[t]!==r[t]}):r))&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify)),this.props.name!==i&&this.bindMutators(t)}},{key:"componentWillUnmount",value:function(){this.unsubscribe()}},{key:"render",value:function(){var t,r,n,o,i,a=this.props,c=a.name,f=u(a,["name"]),l=this.state.state,p=l.value,h=l.length,m=u(l,["value","length"]);return t=s({fields:s({name:c,forEach:this.forEach,length:h,map:this.map},this.mutators),meta:m,value:p},f),r=t.render,n=t.children,o=t.component,i=u(t,["render","children","component"]),o?e.createElement(o,s({},i,{children:n})):r?r(s({},i,{children:n})):"function"!=typeof n?null:n(i)}}]),r}();l.displayName="ReactFinalFormFieldArray("+n.version+")("+h+")";var p=function(){var t=this;this.subscribe=function(e,r){var n=e.name,o=e.subscription;t.unsubscribe=t.context.reactFinalForm.registerField(n,r,o?s({},o,{length:!0}):f,{validate:t.validate})},this.bindMutators=function(e){var r=e.name,n=t.context.reactFinalForm;if(n){var i=n.mutators;o(i&&i.push&&i.pop,"Array mutators not found. You need to provide the mutators from final-form-arrays to your form"),i&&(t.mutators=Object.keys(i).reduce(function(t,e){return t[e]=function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];return i[e].apply(i,[r].concat(n))},t},{}))}},this.validate=function(e,r){return t.props.validate&&t.props.validate(e,r)},this.notify=function(e){setTimeout(function(){return t.setState({state:e})})},this.forEach=function(e){for(var r=t.props.name,n=t.state.state.length,o=0;o<n;o++)e(r+"["+o+"]",o)},this.map=function(e){for(var r=t.props.name,n=t.state.state.length,o=[],i=0;i<n;i++)o.push(e(r+"["+i+"]",i));return o}};l.contextTypes={reactFinalForm:r.object};var h="1.0.2";t.version=h,t.FieldArray=l,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=react-final-form-arrays.umd.min.js.map |
{ | ||
"name": "react-final-form-arrays", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": | ||
@@ -9,2 +9,3 @@ "A component for rendering and editing arrays 🏁 React Final Form", | ||
"module": "dist/react-final-form-arrays.es.js", | ||
"typings": "dist/index.d.js", | ||
"files": ["dist"], | ||
@@ -28,2 +29,3 @@ "scripts": { | ||
"devDependencies": { | ||
"@types/react": "^16.0.31", | ||
"babel-eslint": "^8.0.2", | ||
@@ -45,6 +47,6 @@ "babel-jest": "^21.2.0", | ||
"eslint-plugin-react": "^7.4.0", | ||
"final-form": "^1.2.0", | ||
"final-form-arrays": "^1.0.0", | ||
"final-form": "^2.0.0", | ||
"final-form-arrays": "^1.0.3", | ||
"flow": "^0.2.3", | ||
"flow-bin": "^0.60.1", | ||
"flow-bin": "^0.61.0", | ||
"husky": "^0.14.3", | ||
@@ -71,6 +73,6 @@ "jest": "^21.2.1", | ||
"peerDependencies": { | ||
"final-form": "^1.0.0", | ||
"final-form-arrays": "^1.0.0", | ||
"final-form": ">=2.0.0", | ||
"final-form-arrays": ">=1.0.3", | ||
"prop-types": "^15.6.0", | ||
"react": "^15.0.0-0 || ^16.0.0-0" | ||
"react": "^15.3.0 || ^16.0.0-0" | ||
}, | ||
@@ -81,3 +83,3 @@ "jest": { | ||
"lint-staged": { | ||
"*.{js,json,md,css}": ["prettier --write", "git add"] | ||
"*.{js*,ts,json,md,css}": ["prettier --write", "git add"] | ||
}, | ||
@@ -84,0 +86,0 @@ "bundlesize": [ |
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
47505
12
742
40