react-final-form-arrays
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -270,3 +270,5 @@ 'use strict'; | ||
this.notify = function (state) { | ||
return _this2.setState({ state: state }); | ||
setTimeout(function () { | ||
return _this2.setState({ state: state }); | ||
}); | ||
}; | ||
@@ -273,0 +275,0 @@ |
@@ -264,3 +264,5 @@ import { PureComponent, createElement } from 'react'; | ||
this.notify = function (state) { | ||
return _this2.setState({ state: state }); | ||
setTimeout(function () { | ||
return _this2.setState({ state: state }); | ||
}); | ||
}; | ||
@@ -267,0 +269,0 @@ |
@@ -267,3 +267,5 @@ (function (global, factory) { | ||
this.notify = function (state) { | ||
return _this2.setState({ state: state }); | ||
setTimeout(function () { | ||
return _this2.setState({ state: state }); | ||
}); | ||
}; | ||
@@ -270,0 +272,0 @@ |
@@ -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){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){},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})}); | ||
//# sourceMappingURL=react-final-form-arrays.umd.min.js.map |
{ | ||
"name": "react-final-form-arrays", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": | ||
@@ -20,8 +20,8 @@ "A component for rendering and editing arrays 🏁 React Final Form", | ||
"type": "git", | ||
"url": "https://github.com/erikras/react-final-form-arrays.git" | ||
"url": "https://github.com/final-form/react-final-form-arrays.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/erikras/react-final-form-arrays/issues" | ||
"url": "https://github.com/final-form/react-final-form-arrays/issues" | ||
}, | ||
"homepage": "https://github.com/erikras/react-final-form-arrays#readme", | ||
"homepage": "https://github.com/final-form/react-final-form-arrays#readme", | ||
"devDependencies": { | ||
@@ -28,0 +28,0 @@ "babel-eslint": "^8.0.2", |
@@ -5,4 +5,4 @@ # 🏁 React Final Form Arrays | ||
[![NPM Downloads](https://img.shields.io/npm/dm/react-final-form-arrays.svg?style=flat)](https://www.npmjs.com/package/react-final-form-arrays) | ||
[![Build Status](https://img.shields.io/travis/erikras/react-final-form-arrays/v6.svg?style=flat)](https://travis-ci.org/erikras/react-final-form-arrays) | ||
[![codecov.io](https://codecov.io/gh/erikras/react-final-form-arrays/branch/master/graph/badge.svg)](https://codecov.io/gh/erikras/react-final-form-arrays) | ||
[![Build Status](https://travis-ci.org/final-form/react-final-form-arrays.svg?branch=master)](https://travis-ci.org/final-form/react-final-form-arrays) | ||
[![codecov.io](https://codecov.io/gh/final-form/react-final-form-arrays/branch/master/graph/badge.svg)](https://codecov.io/gh/final-form/react-final-form-arrays) | ||
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) | ||
@@ -129,6 +129,6 @@ | ||
### [Simple Example](https://codesandbox.io/s/ww40y2m595) | ||
### [Simple Example](https://codesandbox.io/s/kx8qv67nk5) | ||
Uses the built-in React inputs: `input`, `select`, and `textarea` to build a | ||
form with no validation. | ||
Demostrates how to use `<FieldArray/>` to render an array of inputs, as well as | ||
use `push`, `pop`, and `remove` mutations. | ||
@@ -192,7 +192,7 @@ ## Rendering | ||
A | ||
[`FieldSubscription`](https://github.com/erikras/final-form#fieldsubscription--string-boolean-) | ||
[`FieldSubscription`](https://github.com/final-form/final-form#fieldsubscription--string-boolean-) | ||
that selects of all the items of | ||
[`FieldState`](https://github.com/erikras/final-form#fieldstate) that you wish | ||
to update for. If you don't pass a `subscription` prop, it defaults to _all_ of | ||
[`FieldState`](https://github.com/erikras/final-form#fieldstate). | ||
[`FieldState`](https://github.com/final-form/final-form#fieldstate) that you | ||
wish to update for. If you don't pass a `subscription` prop, it defaults to | ||
_all_ of [`FieldState`](https://github.com/final-form/final-form#fieldstate). | ||
@@ -267,50 +267,50 @@ #### `validate?: (value: ?any[], allValues: Object) => ?any` | ||
[See the 🏁 Final Form docs on `active`](https://github.com/erikras/final-form#active-boolean). | ||
[See the 🏁 Final Form docs on `active`](https://github.com/final-form/final-form#active-boolean). | ||
#### `meta.data: Object` | ||
[See the 🏁 Final Form docs on `data`](https://github.com/erikras/final-form#data-object). | ||
[See the 🏁 Final Form docs on `data`](https://github.com/final-form/final-form#data-object). | ||
#### `meta.dirty?: boolean` | ||
[See the 🏁 Final Form docs on `dirty`](https://github.com/erikras/final-form#dirty-boolean). | ||
[See the 🏁 Final Form docs on `dirty`](https://github.com/final-form/final-form#dirty-boolean). | ||
#### `meta.error?: any` | ||
[See the 🏁 Final Form docs on `error`](https://github.com/erikras/final-form#error-any). | ||
[See the 🏁 Final Form docs on `error`](https://github.com/final-form/final-form#error-any). | ||
#### `meta.initial?: any` | ||
[See the 🏁 Final Form docs on `initial`](https://github.com/erikras/final-form#initial-any). | ||
[See the 🏁 Final Form docs on `initial`](https://github.com/final-form/final-form#initial-any). | ||
#### `meta.invalid?: boolean` | ||
[See the 🏁 Final Form docs on `invalid`](https://github.com/erikras/final-form#invalid-boolean). | ||
[See the 🏁 Final Form docs on `invalid`](https://github.com/final-form/final-form#invalid-boolean). | ||
#### `meta.pristine?: boolean` | ||
[See the 🏁 Final Form docs on `pristine`](https://github.com/erikras/final-form#pristine-boolean). | ||
[See the 🏁 Final Form docs on `pristine`](https://github.com/final-form/final-form#pristine-boolean). | ||
#### `meta.submitError?: any` | ||
[See the 🏁 Final Form docs on `submitError`](https://github.com/erikras/final-form#submiterror-any). | ||
[See the 🏁 Final Form docs on `submitError`](https://github.com/final-form/final-form#submiterror-any). | ||
#### `meta.submitFailed?: boolean` | ||
[See the 🏁 Final Form docs on `submitFailed`](https://github.com/erikras/final-form#submitfailed-boolean). | ||
[See the 🏁 Final Form docs on `submitFailed`](https://github.com/final-form/final-form#submitfailed-boolean). | ||
#### `meta.submitSucceeded?: boolean` | ||
[See the 🏁 Final Form docs on `submitSucceeded`](https://github.com/erikras/final-form#submitsucceeded-boolean). | ||
[See the 🏁 Final Form docs on `submitSucceeded`](https://github.com/final-form/final-form#submitsucceeded-boolean). | ||
#### `meta.touched?: boolean` | ||
[See the 🏁 Final Form docs on `touched`](https://github.com/erikras/final-form#touched-boolean). | ||
[See the 🏁 Final Form docs on `touched`](https://github.com/final-form/final-form#touched-boolean). | ||
#### `meta.valid?: boolean` | ||
[See the 🏁 Final Form docs on `valid`](https://github.com/erikras/final-form#valid-boolean). | ||
[See the 🏁 Final Form docs on `valid`](https://github.com/final-form/final-form#valid-boolean). | ||
#### `meta.visited?: boolean` | ||
[See the 🏁 Final Form docs on `visited`](https://github.com/erikras/final-form#visited-boolean). | ||
[See the 🏁 Final Form docs on `visited`](https://github.com/final-form/final-form#visited-boolean). |
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
47261
738