Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
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 4.0.1 to 4.0.2

2

dist/react-final-form.cjs.js

@@ -461,3 +461,3 @@ 'use strict';

var version = '3.6.0';
var version = '4.0.2';
var versions = {

@@ -464,0 +464,0 @@ 'final-form': finalForm.version,

@@ -457,3 +457,3 @@ import { createElement, Component, createContext } from 'react';

var version$1 = '3.6.0';
var version$1 = '4.0.2';
var versions = {

@@ -460,0 +460,0 @@ 'final-form': version,

@@ -460,3 +460,3 @@ (function (global, factory) {

var version = '3.6.0';
var version = '4.0.2';
var versions = {

@@ -463,0 +463,0 @@ 'final-form': finalForm.version,

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","react","final-form"],e):e(t["react-final-form"]={},t.React,t.FinalForm)}(this,function(t,h,s){"use strict";function v(){return(v=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}).apply(this,arguments)}function r(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function b(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],0<=e.indexOf(n)||(i[n]=t[n]);return i}function i(e,n,t){return e?!n||t.some(function(t){return e[t]!==n[t]}):!!n}function y(t,e){var n=t.render,r=t.children,i=t.component,o=b(t,["render","children","component"]);return i?h.createElement(i,v({},o,{children:r,render:n})):n?n(v({},o,{children:r})):"function"!=typeof r?null:r(o)}var o="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,u=h.createContext(null),e=function(n){return function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(){var e=this;return h.createElement(u.Consumer,{children:function(t){return h.createElement(n,v({reactFinalForm:t},e.props))}})},e}(h.Component)},c=s.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),n=function(n){function d(t){var a,e;return(a=n.call(this,t)||this).subscribe=function(t,e){var n=t.isEqual,r=t.name,i=t.subscription,o=t.validateFields;a.unsubscribe=a.props.reactFinalForm.registerField(r,e,i||c,{isEqual:n,getValidator:function(){return a.props.validate},validateFields:o})},a.notify=function(t){return a.setState({state:t})},a.handlers={onBlur:function(t){var e=a.state.state;if(e){var n=a.props,r=n.format,i=n.formatOnBlur;e.blur(),r&&i&&e.change(r(e.value,e.name))}},onChange:function(t){var e=a.props,n=e.parse,r=e.value,i=t&&t.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,s=i.checked;switch(o){case"checkbox":if(void 0===n)return!!s;if(s)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return e;var u=e.indexOf(n);return u<0?e:e.slice(0,u).concat(e.slice(u+1));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}}(t,a.state.state&&a.state.state.value,r,o):t;a.state.state&&a.state.state.change(n?n(i,a.props.name):i)},onFocus:function(t){a.state.state&&a.state.state.focus()}},a.props.reactFinalForm&&a.subscribe(t,function(t){e?a.notify(t):e=t}),a.state={state:e},a}r(d,n);var t=d.prototype;return t.componentDidUpdate=function(t){var e=this.props,n=e.name,r=e.subscription;(t.name!==n||i(t.subscription,r,s.fieldSubscriptionItems))&&this.props.reactFinalForm&&(this.unsubscribe(),this.subscribe(this.props,this.notify))},t.componentWillUnmount=function(){this.unsubscribe()},t.render=function(){var t=this.props,e=t.allowNull,n=t.component,r=t.children,i=t.format,o=t.formatOnBlur,a=(t.parse,t.isEqual,t.name),s=(t.subscription,t.validate,t.validateFields,t.reactFinalForm,t.value),u=b(t,["allowNull","component","children","format","formatOnBlur","parse","isEqual","name","subscription","validate","validateFields","reactFinalForm","value"]),c=this.state.state||{},f=(c.blur,c.change,c.focus,c.value),l=(c.name,b(c,["blur","change","focus","value","name"])),p={active:l.active,data:l.data,dirty:l.dirty,dirtySinceLastSubmit:l.dirtySinceLastSubmit,error:l.error,initial:l.initial,invalid:l.invalid,pristine:l.pristine,submitError:l.submitError,submitFailed:l.submitFailed,submitSucceeded:l.submitSucceeded,submitting:l.submitting,touched:l.touched,valid:l.valid,visited:l.visited};o?f=d.defaultProps.format(f,a):i&&(f=i(f,a)),null!==f||e||(f="");var m=v({name:a,value:f},this.handlers);return"checkbox"===u.type?void 0===s?m.checked=!!f:(m.checked=!(!Array.isArray(f)||!~f.indexOf(s)),m.value=s):"radio"===u.type?(m.checked=f===s,m.value=s):"select"===n&&u.multiple&&(m.value=m.value||[]),"function"==typeof r?r(v({input:m,meta:p},u)):"string"==typeof n?h.createElement(n,v({},m,{children:r},u)):y(v({},{input:m,meta:p},{children:r,component:n},u))},d}(h.Component);n.defaultProps={format:function(t,e){return void 0===t?"":t},parse:function(t,e){return""===t?void 0:t}};var a=e(n),f=function(t){return!(!t||"function"!=typeof t.stopPropagation)},l="3.6.0",p={"final-form":s.version,"react-final-form":l},m=s.formSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),d=function(a){function t(t){var e;(e=a.call(this,t)||this).notify=function(t){e.mounted&&e.setState({state:t}),e.mounted=!0},e.handleSubmit=function(t){return t&&("function"==typeof t.preventDefault&&t.preventDefault(),"function"==typeof t.stopPropagation&&t.stopPropagation()),e.form.submit()};t.children,t.component,t.render;var n=t.subscription,r=t.decorators,i=b(t,["children","component","render","subscription","decorators"]);e.mounted=!1;try{e.form=s.createForm(i)}catch(t){}if(e.unsubscriptions=[],e.form){var o={};e.form.subscribe(function(t){o=t},n||m)(),e.state={state:o}}return r&&r.forEach(function(t){e.unsubscriptions.push(t(e.form))}),e}r(t,a);var e=t.prototype;return e.componentWillMount=function(){this.form&&this.form.pauseValidation()},e.componentDidMount=function(){this.form&&(this.unsubscriptions.push(this.form.subscribe(this.notify,this.props.subscription||m)),this.form.resumeValidation())},e.componentWillUpdate=function(){this.form&&(this.resumeValidation=this.resumeValidation||!this.form.isValidationPaused(),this.form.pauseValidation())},e.componentDidUpdate=function(e){var n=this;this.form&&this.resumeValidation&&this.form.resumeValidation(),this.props.initialValues&&!(this.props.initialValuesEqual||function(t,e){if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof 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 a=n[o];if(!i(a)||t[a]!==e[a])return!1}return!0})(e.initialValues,this.props.initialValues)&&this.form.initialize(this.props.initialValues),s.configOptions.forEach(function(t){"initialValues"!==t&&e[t]!==n.props[t]&&n.form.setConfig(t,n.props[t])})},e.componentWillUnmount=function(){this.unsubscriptions.forEach(function(t){return t()})},e.render=function(){var n=this,t=this.props,e=(t.debug,t.initialValues,t.mutators,t.onSubmit,t.subscription,t.validate,t.validateOnBlur,b(t,["debug","initialValues","mutators","onSubmit","subscription","validate","validateOnBlur"])),r=v({},this.state?this.state.state:{},{batch:this.form&&function(t){return n.form.batch(t)},blur:this.form&&function(t){return n.form.blur(t)},change:this.form&&function(t,e){return n.form.change(t,e)},focus:this.form&&function(t){return n.form.focus(t)},form:v({},this.form,{reset:function(t){f(t)?n.form.reset():n.form.reset(t)}}),handleSubmit:this.handleSubmit,initialize:this.form&&function(t){return n.form.initialize(t)},mutators:this.form&&Object.keys(this.form.mutators).reduce(function(t,e){return t[e]=function(){var t;(t=n.form.mutators)[e].apply(t,arguments)},t},{}),reset:this.form&&function(t){return n.form.reset(t)}});return h.createElement(u.Provider,{value:this.form},y(v({},e,r,{__versions:p})))},t}(h.Component),g=e(function(t){function e(e){var r,n;return(r=t.call(this,e)||this).subscribe=function(t,e){var n=t.subscription;r.unsubscribe=r.props.reactFinalForm.subscribe(e,n||m)},r.notify=function(t){r.setState({state:t}),r.props.onChange&&r.props.onChange(t)},r.props.reactFinalForm&&r.subscribe(e,function(t){n?r.notify(t):(n=t,e.onChange&&e.onChange(t))}),n&&(r.state={state:n}),r}r(e,t);var n=e.prototype;return n.componentDidUpdate=function(t){var e=this.props.subscription;i(t.subscription,e,s.formSubscriptionItems)&&this.props.reactFinalForm&&(this.unsubscribe(),this.subscribe(this.props,this.notify))},n.componentWillUnmount=function(){this.unsubscribe()},n.render=function(){var t=this.props,e=t.onChange,n=t.reactFinalForm,r=b(t,["onChange","reactFinalForm"]),i={batch:n&&function(t){return n.batch(t)},blur:n&&function(t){return n.blur(t)},change:n&&function(t,e){return n.change(t,e)},focus:n&&function(t){return n.focus(t)},form:v({},n,{reset:function(t){f(t)?n.reset():n.reset(t)}}),initialize:n&&function(t){return n.initialize(t)},mutators:n&&Object.keys(n.mutators).reduce(function(t,e){return t[e]=function(){var t;(t=n.mutators)[e].apply(t,arguments)},t},{}),reset:n&&function(t){return n.reset(t)}};return e?null:y(v({},r,this.state?this.state.state:{},i))},e}(h.Component));t.Field=a,t.Form=d,t.version=l,t.FormSpy=g,t.withReactFinalForm=e,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","react","final-form"],e):e(t["react-final-form"]={},t.React,t.FinalForm)}(this,function(t,h,s){"use strict";function v(){return(v=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}).apply(this,arguments)}function r(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function b(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],0<=e.indexOf(n)||(i[n]=t[n]);return i}function i(e,n,t){return e?!n||t.some(function(t){return e[t]!==n[t]}):!!n}function y(t,e){var n=t.render,r=t.children,i=t.component,o=b(t,["render","children","component"]);return i?h.createElement(i,v({},o,{children:r,render:n})):n?n(v({},o,{children:r})):"function"!=typeof r?null:r(o)}var o="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,u=h.createContext(null),e=function(n){return function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.render=function(){var e=this;return h.createElement(u.Consumer,{children:function(t){return h.createElement(n,v({reactFinalForm:t},e.props))}})},e}(h.Component)},c=s.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),n=function(n){function d(t){var a,e;return(a=n.call(this,t)||this).subscribe=function(t,e){var n=t.isEqual,r=t.name,i=t.subscription,o=t.validateFields;a.unsubscribe=a.props.reactFinalForm.registerField(r,e,i||c,{isEqual:n,getValidator:function(){return a.props.validate},validateFields:o})},a.notify=function(t){return a.setState({state:t})},a.handlers={onBlur:function(t){var e=a.state.state;if(e){var n=a.props,r=n.format,i=n.formatOnBlur;e.blur(),r&&i&&e.change(r(e.value,e.name))}},onChange:function(t){var e=a.props,n=e.parse,r=e.value,i=t&&t.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,s=i.checked;switch(o){case"checkbox":if(void 0===n)return!!s;if(s)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return e;var u=e.indexOf(n);return u<0?e:e.slice(0,u).concat(e.slice(u+1));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}}(t,a.state.state&&a.state.state.value,r,o):t;a.state.state&&a.state.state.change(n?n(i,a.props.name):i)},onFocus:function(t){a.state.state&&a.state.state.focus()}},a.props.reactFinalForm&&a.subscribe(t,function(t){e?a.notify(t):e=t}),a.state={state:e},a}r(d,n);var t=d.prototype;return t.componentDidUpdate=function(t){var e=this.props,n=e.name,r=e.subscription;(t.name!==n||i(t.subscription,r,s.fieldSubscriptionItems))&&this.props.reactFinalForm&&(this.unsubscribe(),this.subscribe(this.props,this.notify))},t.componentWillUnmount=function(){this.unsubscribe()},t.render=function(){var t=this.props,e=t.allowNull,n=t.component,r=t.children,i=t.format,o=t.formatOnBlur,a=(t.parse,t.isEqual,t.name),s=(t.subscription,t.validate,t.validateFields,t.reactFinalForm,t.value),u=b(t,["allowNull","component","children","format","formatOnBlur","parse","isEqual","name","subscription","validate","validateFields","reactFinalForm","value"]),c=this.state.state||{},f=(c.blur,c.change,c.focus,c.value),l=(c.name,b(c,["blur","change","focus","value","name"])),p={active:l.active,data:l.data,dirty:l.dirty,dirtySinceLastSubmit:l.dirtySinceLastSubmit,error:l.error,initial:l.initial,invalid:l.invalid,pristine:l.pristine,submitError:l.submitError,submitFailed:l.submitFailed,submitSucceeded:l.submitSucceeded,submitting:l.submitting,touched:l.touched,valid:l.valid,visited:l.visited};o?f=d.defaultProps.format(f,a):i&&(f=i(f,a)),null!==f||e||(f="");var m=v({name:a,value:f},this.handlers);return"checkbox"===u.type?void 0===s?m.checked=!!f:(m.checked=!(!Array.isArray(f)||!~f.indexOf(s)),m.value=s):"radio"===u.type?(m.checked=f===s,m.value=s):"select"===n&&u.multiple&&(m.value=m.value||[]),"function"==typeof r?r(v({input:m,meta:p},u)):"string"==typeof n?h.createElement(n,v({},m,{children:r},u)):y(v({},{input:m,meta:p},{children:r,component:n},u))},d}(h.Component);n.defaultProps={format:function(t,e){return void 0===t?"":t},parse:function(t,e){return""===t?void 0:t}};var a=e(n),f=function(t){return!(!t||"function"!=typeof t.stopPropagation)},l="4.0.2",p={"final-form":s.version,"react-final-form":l},m=s.formSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),d=function(a){function t(t){var e;(e=a.call(this,t)||this).notify=function(t){e.mounted&&e.setState({state:t}),e.mounted=!0},e.handleSubmit=function(t){return t&&("function"==typeof t.preventDefault&&t.preventDefault(),"function"==typeof t.stopPropagation&&t.stopPropagation()),e.form.submit()};t.children,t.component,t.render;var n=t.subscription,r=t.decorators,i=b(t,["children","component","render","subscription","decorators"]);e.mounted=!1;try{e.form=s.createForm(i)}catch(t){}if(e.unsubscriptions=[],e.form){var o={};e.form.subscribe(function(t){o=t},n||m)(),e.state={state:o}}return r&&r.forEach(function(t){e.unsubscriptions.push(t(e.form))}),e}r(t,a);var e=t.prototype;return e.componentWillMount=function(){this.form&&this.form.pauseValidation()},e.componentDidMount=function(){this.form&&(this.unsubscriptions.push(this.form.subscribe(this.notify,this.props.subscription||m)),this.form.resumeValidation())},e.componentWillUpdate=function(){this.form&&(this.resumeValidation=this.resumeValidation||!this.form.isValidationPaused(),this.form.pauseValidation())},e.componentDidUpdate=function(e){var n=this;this.form&&this.resumeValidation&&this.form.resumeValidation(),this.props.initialValues&&!(this.props.initialValuesEqual||function(t,e){if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof 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 a=n[o];if(!i(a)||t[a]!==e[a])return!1}return!0})(e.initialValues,this.props.initialValues)&&this.form.initialize(this.props.initialValues),s.configOptions.forEach(function(t){"initialValues"!==t&&e[t]!==n.props[t]&&n.form.setConfig(t,n.props[t])})},e.componentWillUnmount=function(){this.unsubscriptions.forEach(function(t){return t()})},e.render=function(){var n=this,t=this.props,e=(t.debug,t.initialValues,t.mutators,t.onSubmit,t.subscription,t.validate,t.validateOnBlur,b(t,["debug","initialValues","mutators","onSubmit","subscription","validate","validateOnBlur"])),r=v({},this.state?this.state.state:{},{batch:this.form&&function(t){return n.form.batch(t)},blur:this.form&&function(t){return n.form.blur(t)},change:this.form&&function(t,e){return n.form.change(t,e)},focus:this.form&&function(t){return n.form.focus(t)},form:v({},this.form,{reset:function(t){f(t)?n.form.reset():n.form.reset(t)}}),handleSubmit:this.handleSubmit,initialize:this.form&&function(t){return n.form.initialize(t)},mutators:this.form&&Object.keys(this.form.mutators).reduce(function(t,e){return t[e]=function(){var t;(t=n.form.mutators)[e].apply(t,arguments)},t},{}),reset:this.form&&function(t){return n.form.reset(t)}});return h.createElement(u.Provider,{value:this.form},y(v({},e,r,{__versions:p})))},t}(h.Component),g=e(function(t){function e(e){var r,n;return(r=t.call(this,e)||this).subscribe=function(t,e){var n=t.subscription;r.unsubscribe=r.props.reactFinalForm.subscribe(e,n||m)},r.notify=function(t){r.setState({state:t}),r.props.onChange&&r.props.onChange(t)},r.props.reactFinalForm&&r.subscribe(e,function(t){n?r.notify(t):(n=t,e.onChange&&e.onChange(t))}),n&&(r.state={state:n}),r}r(e,t);var n=e.prototype;return n.componentDidUpdate=function(t){var e=this.props.subscription;i(t.subscription,e,s.formSubscriptionItems)&&this.props.reactFinalForm&&(this.unsubscribe(),this.subscribe(this.props,this.notify))},n.componentWillUnmount=function(){this.unsubscribe()},n.render=function(){var t=this.props,e=t.onChange,n=t.reactFinalForm,r=b(t,["onChange","reactFinalForm"]),i={batch:n&&function(t){return n.batch(t)},blur:n&&function(t){return n.blur(t)},change:n&&function(t,e){return n.change(t,e)},focus:n&&function(t){return n.focus(t)},form:v({},n,{reset:function(t){f(t)?n.reset():n.reset(t)}}),initialize:n&&function(t){return n.initialize(t)},mutators:n&&Object.keys(n.mutators).reduce(function(t,e){return t[e]=function(){var t;(t=n.mutators)[e].apply(t,arguments)},t},{}),reset:n&&function(t){return n.reset(t)}};return e?null:y(v({},r,this.state?this.state.state:{},i))},e}(h.Component));t.Field=a,t.Form=d,t.version=l,t.FormSpy=g,t.withReactFinalForm=e,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=react-final-form.umd.min.js.map
{
"name": "react-final-form",
"version": "4.0.1",
"version": "4.0.2",
"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