Socket
Socket
Sign inDemoInstall

react-final-form

Package Overview
Dependencies
9
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.5 to 3.1.0

16

dist/react-final-form.cjs.js

@@ -485,2 +485,16 @@ 'use strict';

}, {
key: 'componentWillMount',
value: function componentWillMount() {
if (this.form) {
this.form.pauseValidation();
}
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
if (this.form) {
this.form.resumeValidation();
}
}
}, {
key: 'componentWillReceiveProps',

@@ -621,3 +635,3 @@ value: function componentWillReceiveProps(nextProps) {

//
var version = '3.0.5';
var version = '3.1.0';

@@ -624,0 +638,0 @@ exports.version = version;

@@ -479,2 +479,16 @@ import { createElement, PureComponent } from 'react';

}, {
key: 'componentWillMount',
value: function componentWillMount() {
if (this.form) {
this.form.pauseValidation();
}
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
if (this.form) {
this.form.resumeValidation();
}
}
}, {
key: 'componentWillReceiveProps',

@@ -615,4 +629,4 @@ value: function componentWillReceiveProps(nextProps) {

//
var version$1 = '3.0.5';
var version$1 = '3.1.0';
export { version$1 as version, Field, ReactFinalForm as Form, FormSpy };

@@ -482,2 +482,16 @@ (function (global, factory) {

}, {
key: 'componentWillMount',
value: function componentWillMount() {
if (this.form) {
this.form.pauseValidation();
}
}
}, {
key: 'componentDidMount',
value: function componentDidMount() {
if (this.form) {
this.form.resumeValidation();
}
}
}, {
key: 'componentWillReceiveProps',

@@ -618,3 +632,3 @@ value: function componentWillReceiveProps(nextProps) {

//
var version = '3.0.5';
var version = '3.1.0';

@@ -621,0 +635,0 @@ exports.version = version;

2

dist/react-final-form.umd.min.js

@@ -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"]={},t.React,t.PropTypes,t.FinalForm)}(this,function(t,e,n,r){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var i=function(t,e){};function o(t,e,n){return t?!e||n.some(function(n){return t[n]!==e[n]}):!!e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},l=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)},f=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},p=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};function m(t,n){var r=t.render,i=t.children,o=t.component,a=f(t,["render","children","component"]);return o?e.createElement(o,c({},a,{children:i,render:r})):r?r(c({},a,{children:i})):"function"!=typeof i?null:i(a)}var b="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,h=function(t,e,n,r){if(!r&&t.nativeEvent&&void 0!==t.nativeEvent.text)return t.nativeEvent.text;if(r&&t.nativeEvent)return t.nativeEvent.text;var i=t.target,o=i.type,a=i.value,u=i.checked;switch(o){case"checkbox":if(void 0!==n){if(u)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return e;var s=e.indexOf(n);return s<0?e:e.slice(0,s).concat(e.slice(s+1))}return!!u;case"select-multiple":return function(t){var e=[];if(t)for(var n=0;n<t.length;n++){var r=t[n];r.selected&&e.push(r.value)}return e}(t.target.options);default:return a}},v=r.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),d=function(t){function n(t,e){u(this,n);var r=p(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e));r.subscribe=function(t,e){var n=t.isEqual,i=t.name,o=t.subscription,a=t.validateFields;r.unsubscribe=r.context.reactFinalForm.registerField(i,e,o||v,{isEqual:n,getValidator:function(){return r.props.validate},validateFields:a})},r.notify=function(t){return r.setState({state:t})},r.handlers={onBlur:function(t){r.state.state.blur()},onChange:function(t){var e=r.props,n=e.parse,i=e.value,o=t&&t.target?h(t,r.state.state.value,i,b):t;r.state.state.change(null!==n?n(o,r.props.name):o)},onFocus:function(t){r.state.state.focus()}};var o=void 0;return i(e.reactFinalForm,"Field must be used inside of a ReactFinalForm component"),r.context.reactFinalForm&&r.subscribe(t,function(t){o?r.notify(t):o=t}),r.state={state:o||{}},r}return l(n,t),s(n,[{key:"componentWillReceiveProps",value:function(t){var e=t.name,n=t.subscription;(this.props.name!==e||o(this.props.subscription,n,r.fieldSubscriptionItems))&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))}},{key:"componentWillUnmount",value:function(){this.unsubscribe()}},{key:"render",value:function(){var t=this.props,n=t.allowNull,r=t.component,i=t.children,o=t.format,a=(t.parse,t.isEqual,t.name),u=(t.subscription,t.validate,t.validateFields,t.value),s=f(t,["allowNull","component","children","format","parse","isEqual","name","subscription","validate","validateFields","value"]),l=this.state.state,p=(l.blur,l.change,l.focus,l.value),b=(l.name,f(l,["blur","change","focus","value","name"]));null!==o&&(p=o(p,a)),null!==p||n||(p="");var h=c({name:a,value:p},this.handlers);return"checkbox"===s.type?void 0===u?h.checked=!!p:(h.checked=Array.isArray(p)&&~p.indexOf(u),h.value=u):"radio"===s.type&&(h.checked=p===u,h.value=u),"select"===r&&s.multiple&&(h.value=h.value||[]),"function"==typeof i?i(c({input:h,meta:b},s)):"string"==typeof r?e.createElement(r,c({},h,{children:i},s)):m(c({input:h,meta:b,children:i,component:r},s))}}]),n}(e.PureComponent);d.contextTypes={reactFinalForm:n.object},d.defaultProps={format:function(t,e){return void 0===t?"":t},parse:function(t,e){return""===t?void 0:t}};var y={"final-form":r.version,"react-final-form":w},F=r.formSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),g=function(t){function e(t){u(this,e);var n=p(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.notify=function(t){return n.setState({state:t})},n.handleSubmit=function(t){return t&&t.preventDefault(),n.form.submit()};t.children,t.component;var o=t.debug,a=t.decorators,s=t.initialValues,c=t.mutators,l=t.onSubmit,f=(t.render,t.subscription),m={debug:o,initialValues:s,mutators:c,onSubmit:l,validate:t.validate,validateOnBlur:t.validateOnBlur};try{n.form=r.createForm(m)}catch(t){i(!1,t.message)}var b=void 0;return n.unsubscriptions=[],n.form&&n.unsubscriptions.push(n.form.subscribe(function(t){b?n.notify(t):b=t},f||F)),n.state={state:b},a&&a.forEach(function(t){n.unsubscriptions.push(t(n.form))}),n}return l(e,t),s(e,[{key:"getChildContext",value:function(){return{reactFinalForm:this.form}}},{key:"componentWillReceiveProps",value:function(t){(function(t,e){if(t===e)return!0;if("object"!==(void 0===t?"undefined":a(t))||!t||"object"!==(void 0===e?"undefined":a(e))||!e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(e),o=0;o<n.length;o++){var u=n[o];if(!i(u)||t[u]!==e[u])return!1}return!0})(this.props.initialValues,t.initialValues)||this.form.initialize(t.initialValues)}},{key:"componentWillUnmount",value:function(){this.unsubscriptions.forEach(function(t){return t()})}},{key:"render",value:function(){var t=this.props,e=(t.debug,t.initialValues,t.mutators,t.onSubmit,t.subscription,t.validate,t.validateOnBlur,f(t,["debug","initialValues","mutators","onSubmit","subscription","validate","validateOnBlur"]));return m(c({},e,this.state.state,{mutators:this.form&&this.form.mutators,batch:this.form&&this.form.batch,blur:this.form&&this.form.blur,change:this.form&&this.form.change,focus:this.form&&this.form.focus,handleSubmit:this.handleSubmit,initialize:this.form&&this.form.initialize,reset:this.form&&this.form.reset,__versions:y}))}}]),e}(e.PureComponent);g.childContextTypes={reactFinalForm:n.object},g.displayName="ReactFinalForm("+r.version+")("+w+")";var O=function(t){function e(t,n){u(this,e);var r=p(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));r.subscribe=function(t,e){var n=t.subscription;r.unsubscribe=r.context.reactFinalForm.subscribe(e,n||F)},r.notify=function(t){r.setState({state:t}),r.props.onChange&&r.props.onChange(t)};var o=void 0;return i(n.reactFinalForm,"FormSpy must be used inside of a ReactFinalForm component"),r.context.reactFinalForm&&r.subscribe(t,function(e){o?r.notify(e):(o=e,t.onChange&&t.onChange(e))}),r.state={state:o},r}return l(e,t),s(e,[{key:"componentWillReceiveProps",value:function(t){var e=t.subscription;o(this.props.subscription,e,r.formSubscriptionItems)&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))}},{key:"componentWillUnmount",value:function(){this.unsubscribe()}},{key:"render",value:function(){var t=this.props,e=t.onChange,n=(t.subscription,f(t,["onChange","subscription"])),r=this.context.reactFinalForm;return e?null:m(c({},n,this.state.state,{mutators:r&&r.mutators,batch:r&&r.batch,blur:r&&r.blur,change:r&&r.change,focus:r&&r.focus,initialize:r&&r.initialize,reset:r&&r.reset}))}}]),e}(e.PureComponent);O.contextTypes={reactFinalForm:n.object};var w="3.0.5";t.version=w,t.Field=d,t.Form=g,t.FormSpy=O,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"]={},t.React,t.PropTypes,t.FinalForm)}(this,function(t,e,n,r){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var i=function(t,e){};function o(t,e,n){return t?!e||n.some(function(n){return t[n]!==e[n]}):!!e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},l=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)},f=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},p=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};function m(t,n){var r=t.render,i=t.children,o=t.component,a=f(t,["render","children","component"]);return o?e.createElement(o,c({},a,{children:i,render:r})):r?r(c({},a,{children:i})):"function"!=typeof i?null:i(a)}var h="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,b=function(t,e,n,r){if(!r&&t.nativeEvent&&void 0!==t.nativeEvent.text)return t.nativeEvent.text;if(r&&t.nativeEvent)return t.nativeEvent.text;var i=t.target,o=i.type,a=i.value,u=i.checked;switch(o){case"checkbox":if(void 0!==n){if(u)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return e;var s=e.indexOf(n);return s<0?e:e.slice(0,s).concat(e.slice(s+1))}return!!u;case"select-multiple":return function(t){var e=[];if(t)for(var n=0;n<t.length;n++){var r=t[n];r.selected&&e.push(r.value)}return e}(t.target.options);default:return a}},v=r.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),d=function(t){function n(t,e){u(this,n);var r=p(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t,e));r.subscribe=function(t,e){var n=t.isEqual,i=t.name,o=t.subscription,a=t.validateFields;r.unsubscribe=r.context.reactFinalForm.registerField(i,e,o||v,{isEqual:n,getValidator:function(){return r.props.validate},validateFields:a})},r.notify=function(t){return r.setState({state:t})},r.handlers={onBlur:function(t){r.state.state.blur()},onChange:function(t){var e=r.props,n=e.parse,i=e.value,o=t&&t.target?b(t,r.state.state.value,i,h):t;r.state.state.change(null!==n?n(o,r.props.name):o)},onFocus:function(t){r.state.state.focus()}};var o=void 0;return i(e.reactFinalForm,"Field must be used inside of a ReactFinalForm component"),r.context.reactFinalForm&&r.subscribe(t,function(t){o?r.notify(t):o=t}),r.state={state:o||{}},r}return l(n,t),s(n,[{key:"componentWillReceiveProps",value:function(t){var e=t.name,n=t.subscription;(this.props.name!==e||o(this.props.subscription,n,r.fieldSubscriptionItems))&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))}},{key:"componentWillUnmount",value:function(){this.unsubscribe()}},{key:"render",value:function(){var t=this.props,n=t.allowNull,r=t.component,i=t.children,o=t.format,a=(t.parse,t.isEqual,t.name),u=(t.subscription,t.validate,t.validateFields,t.value),s=f(t,["allowNull","component","children","format","parse","isEqual","name","subscription","validate","validateFields","value"]),l=this.state.state,p=(l.blur,l.change,l.focus,l.value),h=(l.name,f(l,["blur","change","focus","value","name"]));null!==o&&(p=o(p,a)),null!==p||n||(p="");var b=c({name:a,value:p},this.handlers);return"checkbox"===s.type?void 0===u?b.checked=!!p:(b.checked=Array.isArray(p)&&~p.indexOf(u),b.value=u):"radio"===s.type&&(b.checked=p===u,b.value=u),"select"===r&&s.multiple&&(b.value=b.value||[]),"function"==typeof i?i(c({input:b,meta:h},s)):"string"==typeof r?e.createElement(r,c({},b,{children:i},s)):m(c({input:b,meta:h,children:i,component:r},s))}}]),n}(e.PureComponent);d.contextTypes={reactFinalForm:n.object},d.defaultProps={format:function(t,e){return void 0===t?"":t},parse:function(t,e){return""===t?void 0:t}};var y={"final-form":r.version,"react-final-form":w},F=r.formSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),g=function(t){function e(t){u(this,e);var n=p(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.notify=function(t){return n.setState({state:t})},n.handleSubmit=function(t){return t&&t.preventDefault(),n.form.submit()};t.children,t.component;var o=t.debug,a=t.decorators,s=t.initialValues,c=t.mutators,l=t.onSubmit,f=(t.render,t.subscription),m={debug:o,initialValues:s,mutators:c,onSubmit:l,validate:t.validate,validateOnBlur:t.validateOnBlur};try{n.form=r.createForm(m)}catch(t){i(!1,t.message)}var h=void 0;return n.unsubscriptions=[],n.form&&n.unsubscriptions.push(n.form.subscribe(function(t){h?n.notify(t):h=t},f||F)),n.state={state:h},a&&a.forEach(function(t){n.unsubscriptions.push(t(n.form))}),n}return l(e,t),s(e,[{key:"getChildContext",value:function(){return{reactFinalForm:this.form}}},{key:"componentWillMount",value:function(){this.form&&this.form.pauseValidation()}},{key:"componentDidMount",value:function(){this.form&&this.form.resumeValidation()}},{key:"componentWillReceiveProps",value:function(t){(function(t,e){if(t===e)return!0;if("object"!==(void 0===t?"undefined":a(t))||!t||"object"!==(void 0===e?"undefined":a(e))||!e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(e),o=0;o<n.length;o++){var u=n[o];if(!i(u)||t[u]!==e[u])return!1}return!0})(this.props.initialValues,t.initialValues)||this.form.initialize(t.initialValues)}},{key:"componentWillUnmount",value:function(){this.unsubscriptions.forEach(function(t){return t()})}},{key:"render",value:function(){var t=this.props,e=(t.debug,t.initialValues,t.mutators,t.onSubmit,t.subscription,t.validate,t.validateOnBlur,f(t,["debug","initialValues","mutators","onSubmit","subscription","validate","validateOnBlur"]));return m(c({},e,this.state.state,{mutators:this.form&&this.form.mutators,batch:this.form&&this.form.batch,blur:this.form&&this.form.blur,change:this.form&&this.form.change,focus:this.form&&this.form.focus,handleSubmit:this.handleSubmit,initialize:this.form&&this.form.initialize,reset:this.form&&this.form.reset,__versions:y}))}}]),e}(e.PureComponent);g.childContextTypes={reactFinalForm:n.object},g.displayName="ReactFinalForm("+r.version+")("+w+")";var O=function(t){function e(t,n){u(this,e);var r=p(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));r.subscribe=function(t,e){var n=t.subscription;r.unsubscribe=r.context.reactFinalForm.subscribe(e,n||F)},r.notify=function(t){r.setState({state:t}),r.props.onChange&&r.props.onChange(t)};var o=void 0;return i(n.reactFinalForm,"FormSpy must be used inside of a ReactFinalForm component"),r.context.reactFinalForm&&r.subscribe(t,function(e){o?r.notify(e):(o=e,t.onChange&&t.onChange(e))}),r.state={state:o},r}return l(e,t),s(e,[{key:"componentWillReceiveProps",value:function(t){var e=t.subscription;o(this.props.subscription,e,r.formSubscriptionItems)&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))}},{key:"componentWillUnmount",value:function(){this.unsubscribe()}},{key:"render",value:function(){var t=this.props,e=t.onChange,n=(t.subscription,f(t,["onChange","subscription"])),r=this.context.reactFinalForm;return e?null:m(c({},n,this.state.state,{mutators:r&&r.mutators,batch:r&&r.batch,blur:r&&r.blur,change:r&&r.change,focus:r&&r.focus,initialize:r&&r.initialize,reset:r&&r.reset}))}}]),e}(e.PureComponent);O.contextTypes={reactFinalForm:n.object};var w="3.1.0";t.version=w,t.Field=d,t.Form=g,t.FormSpy=O,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=react-final-form.umd.min.js.map
{
"name": "react-final-form",
"version": "3.0.5",
"version": "3.1.0",
"description":

@@ -45,4 +45,4 @@ "🏁 High performance subscription-based form state management for React",

"eslint-plugin-react": "^7.4.0",
"final-form": "^4.0.4",
"flow-bin": "^0.63.1",
"final-form": "^4.2.0",
"flow-bin": "^0.64.0",
"husky": "^0.14.3",

@@ -70,3 +70,3 @@ "jest": "^22.1.4",

"peerDependencies": {
"final-form": "^4.0.4",
"final-form": "^4.2.0",
"prop-types": "^15.6.0",

@@ -73,0 +73,0 @@ "react": "^15.3.0 || ^16.0.0-0"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc