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.3.0 to 3.3.1

1

dist/react-final-form.cjs.js

@@ -256,2 +256,3 @@ 'use strict';

active: otherState.active,
data: otherState.data,
dirty: otherState.dirty,

@@ -258,0 +259,0 @@ dirtySinceLastSubmit: otherState.dirtySinceLastSubmit,

@@ -250,2 +250,3 @@ import { createElement, Component } from 'react';

active: otherState.active,
data: otherState.data,
dirty: otherState.dirty,

@@ -252,0 +253,0 @@ dirtySinceLastSubmit: otherState.dirtySinceLastSubmit,

@@ -254,2 +254,3 @@ (function (global, factory) {

active: otherState.active,
data: otherState.data,
dirty: otherState.dirty,

@@ -256,0 +257,0 @@ dirtySinceLastSubmit: otherState.dirtySinceLastSubmit,

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";function i(t,e,n){return t?!e||n.some(function(n){return t[n]!==e[n]}):!!e}n=n&&n.hasOwnProperty("default")?n.default:n;var o="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},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=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},s=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)},c=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},f=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 l(t,n){var r=t.render,i=t.children,o=t.component,a=c(t,["render","children","component"]);return o?e.createElement(o,u({},a,{children:i,render:r})):r?r(u({},a,{children:i})):"function"!=typeof i?null:i(a)}var p="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,m=r.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),d=function(t){function n(e,r){a(this,n);var i=f(this,t.call(this,e,r));h.call(i);var o=void 0;return i.context.reactFinalForm&&i.subscribe(e,function(t){o?i.notify(t):o=t}),i.state={state:o},i}return s(n,t),n.prototype.componentWillReceiveProps=function(t){var e=t.name,n=t.subscription;(this.props.name!==e||i(this.props.subscription,n,r.fieldSubscriptionItems))&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))},n.prototype.componentWillUnmount=function(){this.unsubscribe()},n.prototype.render=function(){var t=this.props,n=t.allowNull,r=t.component,i=t.children,o=t.format,a=(t.parse,t.isEqual,t.name),s=(t.subscription,t.validate,t.validateFields,t.value),f=c(t,["allowNull","component","children","format","parse","isEqual","name","subscription","validate","validateFields","value"]),p=this.state.state||{},m=(p.blur,p.change,p.focus,p.value),d=(p.name,c(p,["blur","change","focus","value","name"])),h={active:d.active,dirty:d.dirty,dirtySinceLastSubmit:d.dirtySinceLastSubmit,error:d.error,initial:d.initial,invalid:d.invalid,pristine:d.pristine,submitError:d.submitError,submitFailed:d.submitFailed,submitSucceeded:d.submitSucceeded,touched:d.touched,valid:d.valid,visited:d.visited};o&&(m=o(m,a)),null!==m||n||(m="");var b=u({name:a,value:m},this.handlers);return"checkbox"===f.type?void 0===s?b.checked=!!m:(b.checked=!(!Array.isArray(m)||!~m.indexOf(s)),b.value=s):"radio"===f.type?(b.checked=m===s,b.value=s):"select"===r&&f.multiple&&(b.value=b.value||[]),"function"==typeof i?i(u({input:b,meta:h},f)):"string"==typeof r?e.createElement(r,u({},b,{children:i},f)):l(u({},{input:b,meta:h},{children:i,component:r},f))},n}(e.Component);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 h=function(){var t=this;this.subscribe=function(e,n){var r=e.isEqual,i=e.name,o=e.subscription,a=e.validateFields;t.unsubscribe=t.context.reactFinalForm.registerField(i,n,o||m,{isEqual:r,getValidator:function(){return t.props.validate},validateFields:a})},this.notify=function(e){return t.setState({state:e})},this.handlers={onBlur:function(e){t.state.state&&t.state.state.blur()},onChange:function(e){var n=t.props,r=n.parse,i=n.value,o=e&&e.target?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}}(e,t.state.state&&t.state.state.value,i,p):e;t.state.state&&t.state.state.change(r?r(o,t.props.name):o)},onFocus:function(e){t.state.state&&t.state.state.focus()}}},b={"final-form":r.version,"react-final-form":"3.3.0"},v=r.formSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),y=function(t){function e(n){a(this,e);var i=f(this,t.call(this,n));i.notify=function(t){i.mounted&&i.setState({state:t}),i.mounted=!0},i.handleSubmit=function(t){return t&&"function"==typeof t.preventDefault&&t.preventDefault(),i.form.submit()};var o=n.debug,u=n.decorators,s=n.initialValues,c=n.mutators,l=n.onSubmit,p=n.subscription,m={debug:o,initialValues:s,mutators:c,onSubmit:l,validate:n.validate,validateOnBlur:n.validateOnBlur};i.mounted=!1;try{i.form=r.createForm(m)}catch(t){}if(i.unsubscriptions=[],i.form){var d={};i.form.subscribe(function(t){d=t},p||v)(),i.state={state:d}}return u&&u.forEach(function(t){i.unsubscriptions.push(t(i.form))}),i}return s(e,t),e.prototype.getChildContext=function(){return{reactFinalForm:this.form}},e.prototype.componentWillMount=function(){this.form&&this.form.pauseValidation()},e.prototype.componentDidMount=function(){this.form&&(this.unsubscriptions.push(this.form.subscribe(this.notify,this.props.subscription||v)),this.form.resumeValidation())},e.prototype.componentWillReceiveProps=function(t){var e=this;t.initialValues&&!function(t,e){if(t===e)return!0;if("object"!==(void 0===t?"undefined":o(t))||!t||"object"!==(void 0===e?"undefined":o(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),a=0;a<n.length;a++){var u=n[a];if(!i(u)||t[u]!==e[u])return!1}return!0}(this.props.initialValues,t.initialValues)&&this.form.initialize(t.initialValues),["debug","mutators","onSubmit","validate","validateOnBlur"].forEach(function(n){e.props[n]!==t[n]&&e.form.setConfig&&e.form.setConfig(n,t[n])})},e.prototype.componentWillUnmount=function(){this.unsubscriptions.forEach(function(t){return t()})},e.prototype.render=function(){var t=this,e=this.props,n=(e.debug,e.initialValues,e.mutators,e.onSubmit,e.subscription,e.validate,e.validateOnBlur,c(e,["debug","initialValues","mutators","onSubmit","subscription","validate","validateOnBlur"])),r=u({},this.state?this.state.state:{},{batch:this.form&&function(e){return t.form.batch(e)},blur:this.form&&function(e){return t.form.blur(e)},change:this.form&&function(e,n){return t.form.change(e,n)},focus:this.form&&function(e){return t.form.focus(e)},form:this.form,handleSubmit:this.handleSubmit,initialize:this.form&&function(e){return t.form.initialize(e)},mutators:this.form&&Object.keys(this.form.mutators).reduce(function(e,n){return e[n]=function(){var e;(e=t.form.mutators)[n].apply(e,arguments)},e},{}),reset:this.form&&function(e){return t.form.reset(e)}});return l(u({},n,r,{__versions:b}))},e}(e.Component);y.childContextTypes={reactFinalForm:n.object};var g=function(t){function e(n,r){a(this,e);var i=f(this,t.call(this,n,r));i.subscribe=function(t,e){var n=t.subscription;i.unsubscribe=i.context.reactFinalForm.subscribe(e,n||v)},i.notify=function(t){i.setState({state:t}),i.props.onChange&&i.props.onChange(t)};var o=void 0;return i.context.reactFinalForm&&i.subscribe(n,function(t){o?i.notify(t):(o=t,n.onChange&&n.onChange(t))}),o&&(i.state={state:o}),i}return s(e,t),e.prototype.componentWillReceiveProps=function(t){var e=t.subscription;i(this.props.subscription,e,r.formSubscriptionItems)&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))},e.prototype.componentWillUnmount=function(){this.unsubscribe()},e.prototype.render=function(){var t=this.props,e=t.onChange,n=(t.subscription,c(t,["onChange","subscription"])),r=this.context.reactFinalForm,i={batch:r&&function(t){return r.batch(t)},blur:r&&function(t){return r.blur(t)},change:r&&function(t,e){return r.change(t,e)},focus:r&&function(t){return r.focus(t)},form:r,initialize:r&&function(t){return r.initialize(t)},mutators:r&&Object.keys(r.mutators).reduce(function(t,e){return t[e]=function(){var t;(t=r.mutators)[e].apply(t,arguments)},t},{}),reset:r&&function(t){return r.reset(t)}};return e?null:l(u({},n,this.state?this.state.state:{},i))},e}(e.Component);g.contextTypes={reactFinalForm:n.object},t.Field=d,t.Form=y,t.version="3.3.0",t.FormSpy=g,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";function i(t,e,n){return t?!e||n.some(function(n){return t[n]!==e[n]}):!!e}n=n&&n.hasOwnProperty("default")?n.default:n;var o="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},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=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},s=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)},c=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},f=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 l(t,n){var r=t.render,i=t.children,o=t.component,a=c(t,["render","children","component"]);return o?e.createElement(o,u({},a,{children:i,render:r})):r?r(u({},a,{children:i})):"function"!=typeof i?null:i(a)}var p="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,m=r.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),d=function(t){function n(e,r){a(this,n);var i=f(this,t.call(this,e,r));h.call(i);var o=void 0;return i.context.reactFinalForm&&i.subscribe(e,function(t){o?i.notify(t):o=t}),i.state={state:o},i}return s(n,t),n.prototype.componentWillReceiveProps=function(t){var e=t.name,n=t.subscription;(this.props.name!==e||i(this.props.subscription,n,r.fieldSubscriptionItems))&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))},n.prototype.componentWillUnmount=function(){this.unsubscribe()},n.prototype.render=function(){var t=this.props,n=t.allowNull,r=t.component,i=t.children,o=t.format,a=(t.parse,t.isEqual,t.name),s=(t.subscription,t.validate,t.validateFields,t.value),f=c(t,["allowNull","component","children","format","parse","isEqual","name","subscription","validate","validateFields","value"]),p=this.state.state||{},m=(p.blur,p.change,p.focus,p.value),d=(p.name,c(p,["blur","change","focus","value","name"])),h={active:d.active,data:d.data,dirty:d.dirty,dirtySinceLastSubmit:d.dirtySinceLastSubmit,error:d.error,initial:d.initial,invalid:d.invalid,pristine:d.pristine,submitError:d.submitError,submitFailed:d.submitFailed,submitSucceeded:d.submitSucceeded,touched:d.touched,valid:d.valid,visited:d.visited};o&&(m=o(m,a)),null!==m||n||(m="");var b=u({name:a,value:m},this.handlers);return"checkbox"===f.type?void 0===s?b.checked=!!m:(b.checked=!(!Array.isArray(m)||!~m.indexOf(s)),b.value=s):"radio"===f.type?(b.checked=m===s,b.value=s):"select"===r&&f.multiple&&(b.value=b.value||[]),"function"==typeof i?i(u({input:b,meta:h},f)):"string"==typeof r?e.createElement(r,u({},b,{children:i},f)):l(u({},{input:b,meta:h},{children:i,component:r},f))},n}(e.Component);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 h=function(){var t=this;this.subscribe=function(e,n){var r=e.isEqual,i=e.name,o=e.subscription,a=e.validateFields;t.unsubscribe=t.context.reactFinalForm.registerField(i,n,o||m,{isEqual:r,getValidator:function(){return t.props.validate},validateFields:a})},this.notify=function(e){return t.setState({state:e})},this.handlers={onBlur:function(e){t.state.state&&t.state.state.blur()},onChange:function(e){var n=t.props,r=n.parse,i=n.value,o=e&&e.target?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}}(e,t.state.state&&t.state.state.value,i,p):e;t.state.state&&t.state.state.change(r?r(o,t.props.name):o)},onFocus:function(e){t.state.state&&t.state.state.focus()}}},b={"final-form":r.version,"react-final-form":"3.3.0"},v=r.formSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),y=function(t){function e(n){a(this,e);var i=f(this,t.call(this,n));i.notify=function(t){i.mounted&&i.setState({state:t}),i.mounted=!0},i.handleSubmit=function(t){return t&&"function"==typeof t.preventDefault&&t.preventDefault(),i.form.submit()};var o=n.debug,u=n.decorators,s=n.initialValues,c=n.mutators,l=n.onSubmit,p=n.subscription,m={debug:o,initialValues:s,mutators:c,onSubmit:l,validate:n.validate,validateOnBlur:n.validateOnBlur};i.mounted=!1;try{i.form=r.createForm(m)}catch(t){}if(i.unsubscriptions=[],i.form){var d={};i.form.subscribe(function(t){d=t},p||v)(),i.state={state:d}}return u&&u.forEach(function(t){i.unsubscriptions.push(t(i.form))}),i}return s(e,t),e.prototype.getChildContext=function(){return{reactFinalForm:this.form}},e.prototype.componentWillMount=function(){this.form&&this.form.pauseValidation()},e.prototype.componentDidMount=function(){this.form&&(this.unsubscriptions.push(this.form.subscribe(this.notify,this.props.subscription||v)),this.form.resumeValidation())},e.prototype.componentWillReceiveProps=function(t){var e=this;t.initialValues&&!function(t,e){if(t===e)return!0;if("object"!==(void 0===t?"undefined":o(t))||!t||"object"!==(void 0===e?"undefined":o(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),a=0;a<n.length;a++){var u=n[a];if(!i(u)||t[u]!==e[u])return!1}return!0}(this.props.initialValues,t.initialValues)&&this.form.initialize(t.initialValues),["debug","mutators","onSubmit","validate","validateOnBlur"].forEach(function(n){e.props[n]!==t[n]&&e.form.setConfig&&e.form.setConfig(n,t[n])})},e.prototype.componentWillUnmount=function(){this.unsubscriptions.forEach(function(t){return t()})},e.prototype.render=function(){var t=this,e=this.props,n=(e.debug,e.initialValues,e.mutators,e.onSubmit,e.subscription,e.validate,e.validateOnBlur,c(e,["debug","initialValues","mutators","onSubmit","subscription","validate","validateOnBlur"])),r=u({},this.state?this.state.state:{},{batch:this.form&&function(e){return t.form.batch(e)},blur:this.form&&function(e){return t.form.blur(e)},change:this.form&&function(e,n){return t.form.change(e,n)},focus:this.form&&function(e){return t.form.focus(e)},form:this.form,handleSubmit:this.handleSubmit,initialize:this.form&&function(e){return t.form.initialize(e)},mutators:this.form&&Object.keys(this.form.mutators).reduce(function(e,n){return e[n]=function(){var e;(e=t.form.mutators)[n].apply(e,arguments)},e},{}),reset:this.form&&function(e){return t.form.reset(e)}});return l(u({},n,r,{__versions:b}))},e}(e.Component);y.childContextTypes={reactFinalForm:n.object};var g=function(t){function e(n,r){a(this,e);var i=f(this,t.call(this,n,r));i.subscribe=function(t,e){var n=t.subscription;i.unsubscribe=i.context.reactFinalForm.subscribe(e,n||v)},i.notify=function(t){i.setState({state:t}),i.props.onChange&&i.props.onChange(t)};var o=void 0;return i.context.reactFinalForm&&i.subscribe(n,function(t){o?i.notify(t):(o=t,n.onChange&&n.onChange(t))}),o&&(i.state={state:o}),i}return s(e,t),e.prototype.componentWillReceiveProps=function(t){var e=t.subscription;i(this.props.subscription,e,r.formSubscriptionItems)&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))},e.prototype.componentWillUnmount=function(){this.unsubscribe()},e.prototype.render=function(){var t=this.props,e=t.onChange,n=(t.subscription,c(t,["onChange","subscription"])),r=this.context.reactFinalForm,i={batch:r&&function(t){return r.batch(t)},blur:r&&function(t){return r.blur(t)},change:r&&function(t,e){return r.change(t,e)},focus:r&&function(t){return r.focus(t)},form:r,initialize:r&&function(t){return r.initialize(t)},mutators:r&&Object.keys(r.mutators).reduce(function(t,e){return t[e]=function(){var t;(t=r.mutators)[e].apply(t,arguments)},t},{}),reset:r&&function(t){return r.reset(t)}};return e?null:l(u({},n,this.state?this.state.state:{},i))},e}(e.Component);g.contextTypes={reactFinalForm:n.object},t.Field=d,t.Form=y,t.version="3.3.0",t.FormSpy=g,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=react-final-form.umd.min.js.map
{
"name": "react-final-form",
"version": "3.3.0",
"version": "3.3.1",
"description": "🏁 High performance subscription-based form state management for React",

@@ -5,0 +5,0 @@ "main": "dist/react-final-form.cjs.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc