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 6.5.0 to 6.5.1

11

dist/react-final-form.cjs.js

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

var ReactFinalFormContext = React.createContext();
var ReactFinalFormContext = /*#__PURE__*/React.createContext();

@@ -125,3 +125,3 @@ function useLatest(value) {

var version = "6.5.0";
var version = "6.5.1";

@@ -585,3 +585,3 @@ var addLazyState = function addLazyState(dest, state, keys) {

}, // eslint-disable-next-line react-hooks/exhaustive-deps
[state.name, format, formatOnBlur]),
[state.blur, state.name, format, formatOnBlur]),
onChange: React.useCallback(function (event) {

@@ -605,4 +605,5 @@ // istanbul ignore next

onFocus: React.useCallback(function (event) {
state.focus(); // eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
state.focus();
}, // eslint-disable-next-line react-hooks/exhaustive-deps
[state.focus])
};

@@ -609,0 +610,0 @@ var meta = {};

@@ -107,3 +107,3 @@ import _extends from '@babel/runtime/helpers/esm/extends';

var ReactFinalFormContext = createContext();
var ReactFinalFormContext = /*#__PURE__*/createContext();

@@ -118,3 +118,3 @@ function useLatest(value) {

var version = "6.5.0";
var version = "6.5.1";

@@ -578,3 +578,3 @@ var addLazyState = function addLazyState(dest, state, keys) {

}, // eslint-disable-next-line react-hooks/exhaustive-deps
[state.name, format, formatOnBlur]),
[state.blur, state.name, format, formatOnBlur]),
onChange: useCallback(function (event) {

@@ -598,4 +598,5 @@ // istanbul ignore next

onFocus: useCallback(function (event) {
state.focus(); // eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
state.focus();
}, // eslint-disable-next-line react-hooks/exhaustive-deps
[state.focus])
};

@@ -602,0 +603,0 @@ var meta = {};

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

var ReactFinalFormContext = React.createContext();
var ReactFinalFormContext = /*#__PURE__*/React.createContext();

@@ -154,3 +154,3 @@ function useLatest(value) {

var version = "6.5.0";
var version = "6.5.1";

@@ -614,3 +614,3 @@ var addLazyState = function addLazyState(dest, state, keys) {

}, // eslint-disable-next-line react-hooks/exhaustive-deps
[state.name, format, formatOnBlur]),
[state.blur, state.name, format, formatOnBlur]),
onChange: React.useCallback(function (event) {

@@ -634,4 +634,5 @@ // istanbul ignore next

onFocus: React.useCallback(function (event) {
state.focus(); // eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
state.focus();
}, // eslint-disable-next-line react-hooks/exhaustive-deps
[state.focus])
};

@@ -638,0 +639,0 @@ var meta = {};

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","react","final-form"],t):t((e=e||self)["react-final-form"]={},e.React,e.FinalForm)}(this,function(e,x,w){"use strict";var V="default"in x?x.default:x;function R(){return(R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function C(e,t){if(null==e)return{};for(var r,n={},i=Object.keys(e),u=0;u<i.length;u++)r=i[u],0<=t.indexOf(r)||(n[r]=e[r]);return n}function j(e,t,r){var n=e.render,i=e.children,u=e.component,a=C(e,["render","children","component"]);if(u)return x.createElement(u,Object.assign(t,a,{children:i,render:n}));if(n)return n(void 0===i?Object.assign(t,a):Object.assign(t,a,{children:i}));if("function"!=typeof i)throw new Error("Must specify either a render prop, a render function as children, or a component prop to "+r);return i(Object.assign(t,a))}function k(e,t,r){void 0===r&&(r=function(e,t){return e===t});var n=V.useRef(e);V.useEffect(function(){r(e,n.current)||(t(),n.current=e)})}var B=function(e,t){if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),u=0;u<r.length;u++){var a=r[u];if(!i(a)||e[a]!==t[a])return!1}return!0},q=function(e){return!(!e||"function"!=typeof e.stopPropagation)},P=x.createContext();function U(e){var t=V.useRef(e);return V.useEffect(function(){t.current=e}),t}function A(t,r,e){e.forEach(function(e){Object.defineProperty(t,e,{get:function(){return r[e]},enumerable:!0})})}var t="6.5.0",D=function(e,t){return A(e,t,["active","dirty","dirtyFields","dirtySinceLastSubmit","dirtyFieldsSinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","invalid","modified","modifiedSinceLastSubmit","pristine","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited"])},L={"final-form":w.version,"react-final-form":t},N=w.formSubscriptionItems.reduce(function(e,t){return e[t]=!0,e},{});function r(e){var t,r,n=e.debug,i=e.decorators,u=e.destroyOnUnregister,a=e.form,o=e.initialValues,c=e.initialValuesEqual,l=e.keepDirtyOnReinitialize,f=e.mutators,s=e.onSubmit,d=e.subscription,v=void 0===d?N:d,m=e.validate,p=e.validateOnBlur,b=C(e,["debug","decorators","destroyOnUnregister","form","initialValues","initialValuesEqual","keepDirtyOnReinitialize","mutators","onSubmit","subscription","validate","validateOnBlur"]),g={debug:n,destroyOnUnregister:u,initialValues:o,keepDirtyOnReinitialize:l,mutators:f,onSubmit:s,validate:m,validateOnBlur:p},y=(t=function(){var e=a||w.createForm(g);return e.pauseValidation(),e},(r=V.useRef()).current||(r.current=t()),r.current),h=x.useState(function(){var t={};return y.subscribe(function(e){t=e},v)(),t}),S=h[0],O=h[1],F=U(S);x.useEffect(function(){y.isValidationPaused()&&y.resumeValidation();var e=[y.subscribe(function(e){B(e,F.current)||O(e)},v)].concat(i?i.map(function(e){return e(y)}):[]);return function(){y.pauseValidation(),e.reverse().forEach(function(e){return e()})}},[i]),k(n,function(){y.setConfig("debug",n)}),k(u,function(){y.destroyOnUnregister=!!u}),k(l,function(){y.setConfig("keepDirtyOnReinitialize",l)}),k(o,function(){y.setConfig("initialValues",o)},c||B),k(f,function(){y.setConfig("mutators",f)}),k(s,function(){y.setConfig("onSubmit",s)}),k(m,function(){y.setConfig("validate",m)}),k(p,function(){y.setConfig("validateOnBlur",p)});var E={form:R({},y,{reset:function(e){q(e)?y.reset():y.reset(e)}}),handleSubmit:function(e){return e&&("function"==typeof e.preventDefault&&e.preventDefault(),"function"==typeof e.stopPropagation&&e.stopPropagation()),y.submit()}};return D(E,S),x.createElement(P.Provider,{value:y},j(R({},b,{__versions:L}),E,"ReactFinalForm"))}function z(e){var t=x.useContext(P);if(!t)throw new Error((e||"useForm")+" must be used inside of a <Form> component");return t}function o(e){var t=void 0===e?{}:e,r=t.onChange,n=t.subscription,i=void 0===n?N:n,u=z("useFormState"),a=x.useRef(!0),o=x.useRef(r);o.current=r;var c=x.useState(function(){var t={};return u.subscribe(function(e){t=e},i)(),r&&r(t),t}),l=c[0],f=c[1];x.useEffect(function(){return u.subscribe(function(e){a.current?a.current=!1:(f(e),o.current&&o.current(e))},i)},[]);var s={};return D(s,l),s}function n(e){var t=e.onChange,r=e.subscription,n=C(e,["onChange","subscription"]),i=z("FormSpy"),u=o({onChange:t,subscription:r});if(t)return null;var a={form:R({},i,{reset:function(e){q(e)?i.reset():i.reset(e)}})};return j(R({},n,a),u,"FormSpy")}function _(e){return void 0===e?"":e}function I(e){return""===e?void 0:e}var M="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,T=w.fieldSubscriptionItems.reduce(function(e,t){return e[t]=!0,e},{});function E(a,e){void 0===e&&(e={});function r(e,t){return S.registerField(a,e,b,{afterSubmit:n,beforeSubmit:function(){var e,t,r=O.current,n=r.beforeSubmit,i=r.formatOnBlur,u=r.format;return!i||(t=(void 0===u?_:u)(e=S.getFieldState(a).value,a))!==e&&S.change(a,t),n&&n()},data:u,defaultValue:o,getValidator:function(){return O.current.validate},initialValue:s,isEqual:function(e,t){return(O.current.isEqual||function(e,t){return e===t})(e,t)},silent:t,validateFields:y})}var n=e.afterSubmit,t=e.allowNull,i=e.component,u=e.data,o=e.defaultValue,c=e.format,l=void 0===c?_:c,f=e.formatOnBlur,s=e.initialValue,d=e.multiple,v=e.parse,m=void 0===v?I:v,p=e.subscription,b=void 0===p?T:p,g=e.type,y=e.validateFields,h=e.value,S=z("useField"),O=U(e),F=x.useRef(!0),E=x.useState(function(){var t={},e=S.destroyOnUnregister;return S.destroyOnUnregister=!1,r(function(e){t=e},!0)(),S.destroyOnUnregister=e,t}),w=E[0],V=E[1];x.useEffect(function(){return r(function(e){F.current?F.current=!1:V(e)},!1)},[a,u,o,s]);var C={onBlur:x.useCallback(function(e){var t;w.blur(),f&&(t=S.getFieldState(w.name),w.change(l(t.value,w.name)))},[w.name,l,f]),onChange:x.useCallback(function(e){var t=e&&e.target?function(e,t,r,n){if(!n&&e.nativeEvent&&void 0!==e.nativeEvent.text)return e.nativeEvent.text;if(n&&e.nativeEvent)return e.nativeEvent.text;var i=e.target,u=i.type,a=i.value,o=i.checked;switch(u){case"checkbox":if(void 0===r)return!!o;if(o)return Array.isArray(t)?t.concat(r):[r];if(!Array.isArray(t))return t;var c=t.indexOf(r);return c<0?t:t.slice(0,c).concat(t.slice(c+1));case"select-multiple":return function(e){var t=[];if(e)for(var r=0;r<e.length;r++){var n=e[r];n.selected&&t.push(n.value)}return t}(e.target.options);default:return a}}(e,w.value,h,M):e;w.change(m(t,a))},[h,a,m,w.change,w.value,g]),onFocus:x.useCallback(function(e){w.focus()},[])},j={};A(j,w,["active","data","dirty","dirtySinceLastSubmit","error","initial","invalid","length","modified","modifiedSinceLastSubmit","pristine","submitError","submitFailed","submitSucceeded","submitting","touched","valid","validating","visited"]);var k=R({name:a,get value(){var e=w.value;return f?"input"===i&&(e=_(e)):e=l(e,a),null!==e||t||(e=""),"checkbox"===g||"radio"===g?h:"select"===i&&d?e||[]:e},get checked(){return"checkbox"===g?void 0===h?!!w.value:!(!Array.isArray(w.value)||!~w.value.indexOf(h)):"radio"===g?w.value===h:void 0}},C);return d&&(k.multiple=d),void 0!==g&&(k.type=g),{input:k,meta:j}}var i=x.forwardRef(function(e,t){var r=e.afterSubmit,n=e.allowNull,i=e.beforeSubmit,u=e.children,a=e.component,o=e.data,c=e.defaultValue,l=e.format,f=e.formatOnBlur,s=e.initialValue,d=e.isEqual,v=e.multiple,m=e.name,p=e.parse,b=e.subscription,g=e.type,y=e.validate,h=e.validateFields,S=e.value,O=C(e,["afterSubmit","allowNull","beforeSubmit","children","component","data","defaultValue","format","formatOnBlur","initialValue","isEqual","multiple","name","parse","subscription","type","validate","validateFields","value"]),F=E(m,{afterSubmit:r,allowNull:n,beforeSubmit:i,children:u,component:a,data:o,defaultValue:c,format:l,formatOnBlur:f,initialValue:s,isEqual:d,multiple:v,parse:p,subscription:b,type:g,validate:y,validateFields:h,value:S});if("function"==typeof u)return u(R({},F,O));if("string"==typeof a)return x.createElement(a,R({},F.input,{children:u,ref:t},O));if(!m)throw new Error("prop name cannot be undefined in <Field> component");return j(R({children:u,component:a,ref:t},O),F,"Field("+m+")")});e.Field=i,e.Form=r,e.FormSpy=n,e.useField=E,e.useForm=z,e.useFormState=o,e.version=t,e.withTypes=function(){return{Form:r,FormSpy:n}},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","react","final-form"],t):t((e=e||self)["react-final-form"]={},e.React,e.FinalForm)}(this,function(e,x,w){"use strict";var V="default"in x?x.default:x;function R(){return(R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function C(e,t){if(null==e)return{};for(var r,n={},i=Object.keys(e),u=0;u<i.length;u++)r=i[u],0<=t.indexOf(r)||(n[r]=e[r]);return n}function j(e,t,r){var n=e.render,i=e.children,u=e.component,a=C(e,["render","children","component"]);if(u)return x.createElement(u,Object.assign(t,a,{children:i,render:n}));if(n)return n(void 0===i?Object.assign(t,a):Object.assign(t,a,{children:i}));if("function"!=typeof i)throw new Error("Must specify either a render prop, a render function as children, or a component prop to "+r);return i(Object.assign(t,a))}function k(e,t,r){void 0===r&&(r=function(e,t){return e===t});var n=V.useRef(e);V.useEffect(function(){r(e,n.current)||(t(),n.current=e)})}var B=function(e,t){if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),u=0;u<r.length;u++){var a=r[u];if(!i(a)||e[a]!==t[a])return!1}return!0},q=function(e){return!(!e||"function"!=typeof e.stopPropagation)},P=x.createContext();function U(e){var t=V.useRef(e);return V.useEffect(function(){t.current=e}),t}function A(t,r,e){e.forEach(function(e){Object.defineProperty(t,e,{get:function(){return r[e]},enumerable:!0})})}var t="6.5.1",D=function(e,t){return A(e,t,["active","dirty","dirtyFields","dirtySinceLastSubmit","dirtyFieldsSinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","invalid","modified","modifiedSinceLastSubmit","pristine","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited"])},L={"final-form":w.version,"react-final-form":t},N=w.formSubscriptionItems.reduce(function(e,t){return e[t]=!0,e},{});function r(e){var t,r,n=e.debug,i=e.decorators,u=e.destroyOnUnregister,a=e.form,o=e.initialValues,c=e.initialValuesEqual,l=e.keepDirtyOnReinitialize,f=e.mutators,s=e.onSubmit,d=e.subscription,v=void 0===d?N:d,m=e.validate,p=e.validateOnBlur,b=C(e,["debug","decorators","destroyOnUnregister","form","initialValues","initialValuesEqual","keepDirtyOnReinitialize","mutators","onSubmit","subscription","validate","validateOnBlur"]),g={debug:n,destroyOnUnregister:u,initialValues:o,keepDirtyOnReinitialize:l,mutators:f,onSubmit:s,validate:m,validateOnBlur:p},y=(t=function(){var e=a||w.createForm(g);return e.pauseValidation(),e},(r=V.useRef()).current||(r.current=t()),r.current),h=x.useState(function(){var t={};return y.subscribe(function(e){t=e},v)(),t}),S=h[0],O=h[1],F=U(S);x.useEffect(function(){y.isValidationPaused()&&y.resumeValidation();var e=[y.subscribe(function(e){B(e,F.current)||O(e)},v)].concat(i?i.map(function(e){return e(y)}):[]);return function(){y.pauseValidation(),e.reverse().forEach(function(e){return e()})}},[i]),k(n,function(){y.setConfig("debug",n)}),k(u,function(){y.destroyOnUnregister=!!u}),k(l,function(){y.setConfig("keepDirtyOnReinitialize",l)}),k(o,function(){y.setConfig("initialValues",o)},c||B),k(f,function(){y.setConfig("mutators",f)}),k(s,function(){y.setConfig("onSubmit",s)}),k(m,function(){y.setConfig("validate",m)}),k(p,function(){y.setConfig("validateOnBlur",p)});var E={form:R({},y,{reset:function(e){q(e)?y.reset():y.reset(e)}}),handleSubmit:function(e){return e&&("function"==typeof e.preventDefault&&e.preventDefault(),"function"==typeof e.stopPropagation&&e.stopPropagation()),y.submit()}};return D(E,S),x.createElement(P.Provider,{value:y},j(R({},b,{__versions:L}),E,"ReactFinalForm"))}function z(e){var t=x.useContext(P);if(!t)throw new Error((e||"useForm")+" must be used inside of a <Form> component");return t}function o(e){var t=void 0===e?{}:e,r=t.onChange,n=t.subscription,i=void 0===n?N:n,u=z("useFormState"),a=x.useRef(!0),o=x.useRef(r);o.current=r;var c=x.useState(function(){var t={};return u.subscribe(function(e){t=e},i)(),r&&r(t),t}),l=c[0],f=c[1];x.useEffect(function(){return u.subscribe(function(e){a.current?a.current=!1:(f(e),o.current&&o.current(e))},i)},[]);var s={};return D(s,l),s}function n(e){var t=e.onChange,r=e.subscription,n=C(e,["onChange","subscription"]),i=z("FormSpy"),u=o({onChange:t,subscription:r});if(t)return null;var a={form:R({},i,{reset:function(e){q(e)?i.reset():i.reset(e)}})};return j(R({},n,a),u,"FormSpy")}function _(e){return void 0===e?"":e}function I(e){return""===e?void 0:e}var M="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,T=w.fieldSubscriptionItems.reduce(function(e,t){return e[t]=!0,e},{});function E(a,e){void 0===e&&(e={});function r(e,t){return S.registerField(a,e,b,{afterSubmit:n,beforeSubmit:function(){var e,t,r=O.current,n=r.beforeSubmit,i=r.formatOnBlur,u=r.format;return!i||(t=(void 0===u?_:u)(e=S.getFieldState(a).value,a))!==e&&S.change(a,t),n&&n()},data:u,defaultValue:o,getValidator:function(){return O.current.validate},initialValue:s,isEqual:function(e,t){return(O.current.isEqual||function(e,t){return e===t})(e,t)},silent:t,validateFields:y})}var n=e.afterSubmit,t=e.allowNull,i=e.component,u=e.data,o=e.defaultValue,c=e.format,l=void 0===c?_:c,f=e.formatOnBlur,s=e.initialValue,d=e.multiple,v=e.parse,m=void 0===v?I:v,p=e.subscription,b=void 0===p?T:p,g=e.type,y=e.validateFields,h=e.value,S=z("useField"),O=U(e),F=x.useRef(!0),E=x.useState(function(){var t={},e=S.destroyOnUnregister;return S.destroyOnUnregister=!1,r(function(e){t=e},!0)(),S.destroyOnUnregister=e,t}),w=E[0],V=E[1];x.useEffect(function(){return r(function(e){F.current?F.current=!1:V(e)},!1)},[a,u,o,s]);var C={onBlur:x.useCallback(function(e){var t;w.blur(),f&&(t=S.getFieldState(w.name),w.change(l(t.value,w.name)))},[w.blur,w.name,l,f]),onChange:x.useCallback(function(e){var t=e&&e.target?function(e,t,r,n){if(!n&&e.nativeEvent&&void 0!==e.nativeEvent.text)return e.nativeEvent.text;if(n&&e.nativeEvent)return e.nativeEvent.text;var i=e.target,u=i.type,a=i.value,o=i.checked;switch(u){case"checkbox":if(void 0===r)return!!o;if(o)return Array.isArray(t)?t.concat(r):[r];if(!Array.isArray(t))return t;var c=t.indexOf(r);return c<0?t:t.slice(0,c).concat(t.slice(c+1));case"select-multiple":return function(e){var t=[];if(e)for(var r=0;r<e.length;r++){var n=e[r];n.selected&&t.push(n.value)}return t}(e.target.options);default:return a}}(e,w.value,h,M):e;w.change(m(t,a))},[h,a,m,w.change,w.value,g]),onFocus:x.useCallback(function(e){w.focus()},[w.focus])},j={};A(j,w,["active","data","dirty","dirtySinceLastSubmit","error","initial","invalid","length","modified","modifiedSinceLastSubmit","pristine","submitError","submitFailed","submitSucceeded","submitting","touched","valid","validating","visited"]);var k=R({name:a,get value(){var e=w.value;return f?"input"===i&&(e=_(e)):e=l(e,a),null!==e||t||(e=""),"checkbox"===g||"radio"===g?h:"select"===i&&d?e||[]:e},get checked(){return"checkbox"===g?void 0===h?!!w.value:!(!Array.isArray(w.value)||!~w.value.indexOf(h)):"radio"===g?w.value===h:void 0}},C);return d&&(k.multiple=d),void 0!==g&&(k.type=g),{input:k,meta:j}}var i=x.forwardRef(function(e,t){var r=e.afterSubmit,n=e.allowNull,i=e.beforeSubmit,u=e.children,a=e.component,o=e.data,c=e.defaultValue,l=e.format,f=e.formatOnBlur,s=e.initialValue,d=e.isEqual,v=e.multiple,m=e.name,p=e.parse,b=e.subscription,g=e.type,y=e.validate,h=e.validateFields,S=e.value,O=C(e,["afterSubmit","allowNull","beforeSubmit","children","component","data","defaultValue","format","formatOnBlur","initialValue","isEqual","multiple","name","parse","subscription","type","validate","validateFields","value"]),F=E(m,{afterSubmit:r,allowNull:n,beforeSubmit:i,children:u,component:a,data:o,defaultValue:c,format:l,formatOnBlur:f,initialValue:s,isEqual:d,multiple:v,parse:p,subscription:b,type:g,validate:y,validateFields:h,value:S});if("function"==typeof u)return u(R({},F,O));if("string"==typeof a)return x.createElement(a,R({},F.input,{children:u,ref:t},O));if(!m)throw new Error("prop name cannot be undefined in <Field> component");return j(R({children:u,component:a,ref:t},O),F,"Field("+m+")")});e.Field=i,e.Form=r,e.FormSpy=n,e.useField=E,e.useForm=z,e.useFormState=o,e.version=t,e.withTypes=function(){return{Form:r,FormSpy:n}},Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=react-final-form.umd.min.js.map
{
"name": "react-final-form",
"version": "6.5.0",
"version": "6.5.1",
"description": "🏁 High performance subscription-based form state management for React",

@@ -90,2 +90,3 @@ "main": "dist/react-final-form.cjs.js",

"tslint": "^6.1.0",
"ts-essentials": "^6.0.5",
"typescript": "^3.9.3"

@@ -132,6 +133,4 @@ },

"dependencies": {
"@babel/runtime": "^7.10.0",
"@scarf/scarf": "^1.0.5",
"ts-essentials": "^6.0.5"
"@babel/runtime": "^7.10.0"
}
}

@@ -19,3 +19,3 @@ [<img src="form-nerd-logo.png" align="left"/>](https://formnerd.co/react-final-form-readme) **You build great forms, but do you know HOW users use your forms? [Find out with Form Nerd!](https://formnerd.co/react-final-form-readme) Professional analytics from the creator of React Final Form.**

✅ Zero dependencies
✅ Zero dependencies (that affect your bundle size)

@@ -31,2 +31,10 @@ ✅ Only peer dependencies: React and

[<img align="right" src="docs/sencha.svg" height="100"/>](https://www.sencha.com/)
### React Final Form is sponsored by [Sencha](https://www.sencha.com/).
Comprehensive JS framework and UI components for building enterprise-grade web apps.
---
## 💬 [Give Feedback on React Final Form](https://goo.gl/forms/dxdfxKNy64DLb99z2) 💬

@@ -33,0 +41,0 @@

@@ -15,4 +15,4 @@ import * as React from 'react';

export interface ReactContext<FormValues> {
reactFinalForm: FormApi<FormValues>;
export interface ReactContext<FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>> {
reactFinalForm: FormApi<FormValues, InitialFormValues>;
}

@@ -53,4 +53,4 @@

export interface FormRenderProps<FormValues = AnyObject>
extends FormState<FormValues>,
export interface FormRenderProps<FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>>
extends FormState<FormValues, InitialFormValues>,
RenderableProps<FormRenderProps<FormValues>> {

@@ -65,5 +65,5 @@ form: FormApi<FormValues>;

export interface FormSpyRenderProps<FormValues = AnyObject>
extends FormState<FormValues> {
form: FormApi<FormValues>;
export interface FormSpyRenderProps<FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>>
extends FormState<FormValues, InitialFormValues> {
form: FormApi<FormValues, InitialFormValues>;
}

@@ -77,8 +77,8 @@

export interface FormProps<FormValues = AnyObject>
extends Config<FormValues>,
RenderableProps<FormRenderProps<FormValues>> {
export interface FormProps<FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>>
extends Config<FormValues, InitialFormValues>,
RenderableProps<FormRenderProps<FormValues, InitialFormValues>> {
subscription?: FormSubscription;
decorators?: Array<Decorator<FormValues>>;
form?: FormApi<FormValues>;
decorators?: Array<Decorator<FormValues, InitialFormValues>>;
form?: FormApi<FormValues, InitialFormValues>;
initialValuesEqual?: (a?: AnyObject, b?: AnyObject) => boolean;

@@ -115,10 +115,10 @@ }

export interface UseFormStateParams<FormValues = AnyObject> {
onChange?: (formState: FormState<FormValues>) => void;
export interface UseFormStateParams<FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>> {
onChange?: (formState: FormState<FormValues, InitialFormValues>) => void;
subscription?: FormSubscription;
}
export interface FormSpyProps<FormValues = AnyObject>
extends UseFormStateParams<FormValues>,
RenderableProps<FormSpyRenderProps<FormValues>> {}
export interface FormSpyProps<FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>>
extends UseFormStateParams<FormValues, InitialFormValues>,
RenderableProps<FormSpyRenderProps<FormValues, InitialFormValues>> {}

@@ -135,7 +135,7 @@ export const Field: <

) => React.ReactElement;
export const Form: <FormValues = AnyObject>(
props: FormProps<FormValues>
export const Form: <FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>>(
props: FormProps<FormValues, InitialFormValues>
) => React.ReactElement;
export const FormSpy: <FormValues = AnyObject>(
props: FormSpyProps<FormValues>
export const FormSpy: <FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>>(
props: FormSpyProps<FormValues, InitialFormValues>
) => React.ReactElement;

@@ -146,12 +146,12 @@ export function useField<FieldValue = any, T extends HTMLElement = HTMLElement>(

): FieldRenderProps<FieldValue, T>;
export function useForm<FormValues = AnyObject>(
export function useForm<FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>>(
componentName?: string
): FormApi<FormValues>;
export function useFormState<FormValues = AnyObject>(
): FormApi<FormValues, InitialFormValues>;
export function useFormState<FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>>(
params?: UseFormStateParams
): FormState<FormValues>;
export function withTypes<FormValues>(): {
Form: React.FC<FormProps<FormValues>>;
FormSpy: React.FC<FormSpyProps<FormValues>>;
): FormState<FormValues, InitialFormValues>;
export function withTypes<FormValues = Record<string, any>, InitialFormValues = Partial<FormValues>>(): {
Form: React.FC<FormProps<FormValues, InitialFormValues>>;
FormSpy: React.FC<FormSpyProps<FormValues, InitialFormValues>>;
};
export const version: string;

Sorry, the diff of this file is not supported yet

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