Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

final-form

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

final-form - npm Package Compare versions

Comparing version 4.11.1 to 4.12.0

43

dist/final-form.cjs.js

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

focus = field.focus,
modified = field.modified,
name = field.name,

@@ -213,2 +214,3 @@ touched = field.touched,

length: Array.isArray(value) ? value.length : undefined,
modified: modified,
name: name,

@@ -228,3 +230,3 @@ pristine: pristine,

//
var fieldSubscriptionItems = ['active', 'data', 'dirty', 'dirtySinceLastSubmit', 'error', 'initial', 'invalid', 'length', 'pristine', 'submitError', 'submitFailed', 'submitSucceeded', 'submitting', 'touched', 'valid', 'value', 'visited'];
var fieldSubscriptionItems = ['active', 'data', 'dirty', 'dirtySinceLastSubmit', 'error', 'initial', 'invalid', 'length', 'modified', 'pristine', 'submitError', 'submitFailed', 'submitSucceeded', 'submitting', 'touched', 'valid', 'value', 'visited'];

@@ -294,3 +296,3 @@ //

//
var formSubscriptionItems = ['active', 'dirty', 'dirtyFields', 'dirtySinceLastSubmit', 'error', 'errors', 'hasSubmitErrors', 'hasValidationErrors', 'initialValues', 'invalid', 'pristine', 'submitting', 'submitError', 'submitErrors', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'validating', 'values', 'visited'];
var formSubscriptionItems = ['active', 'dirty', 'dirtyFields', 'dirtySinceLastSubmit', 'error', 'errors', 'hasSubmitErrors', 'hasValidationErrors', 'initialValues', 'invalid', 'modified', 'pristine', 'submitting', 'submitError', 'submitErrors', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'validating', 'values', 'visited'];

@@ -783,2 +785,3 @@ //

var _fieldKeys$reduce = fieldKeys.reduce(function (result, key) {
result.modified[key] = fields[key].modified;
result.touched[key] = fields[key].touched;

@@ -788,5 +791,7 @@ result.visited[key] = fields[key].visited;

}, {
modified: {},
touched: {},
visited: {}
}),
modified = _fieldKeys$reduce.modified,
touched = _fieldKeys$reduce.touched,

@@ -796,2 +801,3 @@ visited = _fieldKeys$reduce.visited;

nextFormState.dirtyFields = lastFormState && shallowEqual(lastFormState.dirtyFields, dirtyFields) ? lastFormState.dirtyFields : dirtyFields;
nextFormState.modified = lastFormState && shallowEqual(lastFormState.modified, modified) ? lastFormState.modified : modified;
nextFormState.touched = lastFormState && shallowEqual(lastFormState.touched, touched) ? lastFormState.touched : touched;

@@ -873,3 +879,4 @@ nextFormState.visited = lastFormState && shallowEqual(lastFormState.visited, visited) ? lastFormState.visited : visited;

change: function change(name, value) {
var formState = state.formState;
var fields = state.fields,
formState = state.formState;

@@ -880,3 +887,11 @@ if (getIn(formState.values, name) !== value) {

});
var previous = fields[name];
if (previous) {
// only track modified for registered fields
fields[name] = _extends({}, previous, {
modified: true
});
}
if (validateOnBlur) {

@@ -915,5 +930,6 @@ notifyFieldListeners();

},
initialize: function initialize(values) {
initialize: function initialize(data) {
var fields = state.fields,
formState = state.formState;
var values = typeof data === 'function' ? data(formState.values) : data;

@@ -926,2 +942,3 @@ if (!keepDirtyOnReinitialize) {

var field = fields[key];
field.modified = false;
field.touched = false;

@@ -972,3 +989,2 @@ field.visited = false;

// create initial field state
var initial = state.formState.initialValues ? getIn(state.formState.initialValues, name) : undefined;
state.fields[name] = {

@@ -986,5 +1002,5 @@ active: false,

},
initial: initial,
isEqual: fieldConfig && fieldConfig.isEqual || tripleEquals,
lastFieldState: undefined,
modified: false,
name: name,

@@ -999,4 +1015,15 @@ touched: false,

if (fieldConfig && fieldConfig.getValidator) {
state.fields[name].validators[index] = fieldConfig.getValidator;
if (fieldConfig) {
if (fieldConfig.getValidator) {
state.fields[name].validators[index] = fieldConfig.getValidator;
}
if (fieldConfig.initialValue !== undefined) {
state.formState.initialValues = setIn(state.formState.initialValues || {}, name, fieldConfig.initialValue);
state.formState.values = setIn(state.formState.values, name, fieldConfig.initialValue);
}
if (fieldConfig.defaultValue !== undefined) {
state.formState.values = setIn(state.formState.values, name, fieldConfig.defaultValue);
}
}

@@ -1003,0 +1030,0 @@

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

focus = field.focus,
modified = field.modified,
name = field.name,

@@ -207,2 +208,3 @@ touched = field.touched,

length: Array.isArray(value) ? value.length : undefined,
modified: modified,
name: name,

@@ -222,3 +224,3 @@ pristine: pristine,

//
var fieldSubscriptionItems = ['active', 'data', 'dirty', 'dirtySinceLastSubmit', 'error', 'initial', 'invalid', 'length', 'pristine', 'submitError', 'submitFailed', 'submitSucceeded', 'submitting', 'touched', 'valid', 'value', 'visited'];
var fieldSubscriptionItems = ['active', 'data', 'dirty', 'dirtySinceLastSubmit', 'error', 'initial', 'invalid', 'length', 'modified', 'pristine', 'submitError', 'submitFailed', 'submitSucceeded', 'submitting', 'touched', 'valid', 'value', 'visited'];

@@ -288,3 +290,3 @@ //

//
var formSubscriptionItems = ['active', 'dirty', 'dirtyFields', 'dirtySinceLastSubmit', 'error', 'errors', 'hasSubmitErrors', 'hasValidationErrors', 'initialValues', 'invalid', 'pristine', 'submitting', 'submitError', 'submitErrors', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'validating', 'values', 'visited'];
var formSubscriptionItems = ['active', 'dirty', 'dirtyFields', 'dirtySinceLastSubmit', 'error', 'errors', 'hasSubmitErrors', 'hasValidationErrors', 'initialValues', 'invalid', 'modified', 'pristine', 'submitting', 'submitError', 'submitErrors', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'validating', 'values', 'visited'];

@@ -777,2 +779,3 @@ //

var _fieldKeys$reduce = fieldKeys.reduce(function (result, key) {
result.modified[key] = fields[key].modified;
result.touched[key] = fields[key].touched;

@@ -782,5 +785,7 @@ result.visited[key] = fields[key].visited;

}, {
modified: {},
touched: {},
visited: {}
}),
modified = _fieldKeys$reduce.modified,
touched = _fieldKeys$reduce.touched,

@@ -790,2 +795,3 @@ visited = _fieldKeys$reduce.visited;

nextFormState.dirtyFields = lastFormState && shallowEqual(lastFormState.dirtyFields, dirtyFields) ? lastFormState.dirtyFields : dirtyFields;
nextFormState.modified = lastFormState && shallowEqual(lastFormState.modified, modified) ? lastFormState.modified : modified;
nextFormState.touched = lastFormState && shallowEqual(lastFormState.touched, touched) ? lastFormState.touched : touched;

@@ -867,3 +873,4 @@ nextFormState.visited = lastFormState && shallowEqual(lastFormState.visited, visited) ? lastFormState.visited : visited;

change: function change(name, value) {
var formState = state.formState;
var fields = state.fields,
formState = state.formState;

@@ -874,3 +881,11 @@ if (getIn(formState.values, name) !== value) {

});
var previous = fields[name];
if (previous) {
// only track modified for registered fields
fields[name] = _extends({}, previous, {
modified: true
});
}
if (validateOnBlur) {

@@ -909,5 +924,6 @@ notifyFieldListeners();

},
initialize: function initialize(values) {
initialize: function initialize(data) {
var fields = state.fields,
formState = state.formState;
var values = typeof data === 'function' ? data(formState.values) : data;

@@ -920,2 +936,3 @@ if (!keepDirtyOnReinitialize) {

var field = fields[key];
field.modified = false;
field.touched = false;

@@ -966,3 +983,2 @@ field.visited = false;

// create initial field state
var initial = state.formState.initialValues ? getIn(state.formState.initialValues, name) : undefined;
state.fields[name] = {

@@ -980,5 +996,5 @@ active: false,

},
initial: initial,
isEqual: fieldConfig && fieldConfig.isEqual || tripleEquals,
lastFieldState: undefined,
modified: false,
name: name,

@@ -993,4 +1009,15 @@ touched: false,

if (fieldConfig && fieldConfig.getValidator) {
state.fields[name].validators[index] = fieldConfig.getValidator;
if (fieldConfig) {
if (fieldConfig.getValidator) {
state.fields[name].validators[index] = fieldConfig.getValidator;
}
if (fieldConfig.initialValue !== undefined) {
state.formState.initialValues = setIn(state.formState.initialValues || {}, name, fieldConfig.initialValue);
state.formState.values = setIn(state.formState.values, name, fieldConfig.initialValue);
}
if (fieldConfig.defaultValue !== undefined) {
state.formState.values = setIn(state.formState.values, name, fieldConfig.defaultValue);
}
}

@@ -997,0 +1024,0 @@

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

focus = field.focus,
modified = field.modified,
name = field.name,

@@ -243,2 +244,3 @@ touched = field.touched,

length: Array.isArray(value) ? value.length : undefined,
modified: modified,
name: name,

@@ -258,3 +260,3 @@ pristine: pristine,

//
var fieldSubscriptionItems = ['active', 'data', 'dirty', 'dirtySinceLastSubmit', 'error', 'initial', 'invalid', 'length', 'pristine', 'submitError', 'submitFailed', 'submitSucceeded', 'submitting', 'touched', 'valid', 'value', 'visited'];
var fieldSubscriptionItems = ['active', 'data', 'dirty', 'dirtySinceLastSubmit', 'error', 'initial', 'invalid', 'length', 'modified', 'pristine', 'submitError', 'submitFailed', 'submitSucceeded', 'submitting', 'touched', 'valid', 'value', 'visited'];

@@ -324,3 +326,3 @@ //

//
var formSubscriptionItems = ['active', 'dirty', 'dirtyFields', 'dirtySinceLastSubmit', 'error', 'errors', 'hasSubmitErrors', 'hasValidationErrors', 'initialValues', 'invalid', 'pristine', 'submitting', 'submitError', 'submitErrors', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'validating', 'values', 'visited'];
var formSubscriptionItems = ['active', 'dirty', 'dirtyFields', 'dirtySinceLastSubmit', 'error', 'errors', 'hasSubmitErrors', 'hasValidationErrors', 'initialValues', 'invalid', 'modified', 'pristine', 'submitting', 'submitError', 'submitErrors', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'validating', 'values', 'visited'];

@@ -813,2 +815,3 @@ //

var _fieldKeys$reduce = fieldKeys.reduce(function (result, key) {
result.modified[key] = fields[key].modified;
result.touched[key] = fields[key].touched;

@@ -818,5 +821,7 @@ result.visited[key] = fields[key].visited;

}, {
modified: {},
touched: {},
visited: {}
}),
modified = _fieldKeys$reduce.modified,
touched = _fieldKeys$reduce.touched,

@@ -826,2 +831,3 @@ visited = _fieldKeys$reduce.visited;

nextFormState.dirtyFields = lastFormState && shallowEqual(lastFormState.dirtyFields, dirtyFields) ? lastFormState.dirtyFields : dirtyFields;
nextFormState.modified = lastFormState && shallowEqual(lastFormState.modified, modified) ? lastFormState.modified : modified;
nextFormState.touched = lastFormState && shallowEqual(lastFormState.touched, touched) ? lastFormState.touched : touched;

@@ -903,3 +909,4 @@ nextFormState.visited = lastFormState && shallowEqual(lastFormState.visited, visited) ? lastFormState.visited : visited;

change: function change(name, value) {
var formState = state.formState;
var fields = state.fields,
formState = state.formState;

@@ -910,3 +917,11 @@ if (getIn(formState.values, name) !== value) {

});
var previous = fields[name];
if (previous) {
// only track modified for registered fields
fields[name] = _extends({}, previous, {
modified: true
});
}
if (validateOnBlur) {

@@ -945,5 +960,6 @@ notifyFieldListeners();

},
initialize: function initialize(values) {
initialize: function initialize(data) {
var fields = state.fields,
formState = state.formState;
var values = typeof data === 'function' ? data(formState.values) : data;

@@ -956,2 +972,3 @@ if (!keepDirtyOnReinitialize) {

var field = fields[key];
field.modified = false;
field.touched = false;

@@ -1002,3 +1019,2 @@ field.visited = false;

// create initial field state
var initial = state.formState.initialValues ? getIn(state.formState.initialValues, name) : undefined;
state.fields[name] = {

@@ -1016,5 +1032,5 @@ active: false,

},
initial: initial,
isEqual: fieldConfig && fieldConfig.isEqual || tripleEquals,
lastFieldState: undefined,
modified: false,
name: name,

@@ -1029,4 +1045,15 @@ touched: false,

if (fieldConfig && fieldConfig.getValidator) {
state.fields[name].validators[index] = fieldConfig.getValidator;
if (fieldConfig) {
if (fieldConfig.getValidator) {
state.fields[name].validators[index] = fieldConfig.getValidator;
}
if (fieldConfig.initialValue !== undefined) {
state.formState.initialValues = setIn(state.formState.initialValues || {}, name, fieldConfig.initialValue);
state.formState.values = setIn(state.formState.values, name, fieldConfig.initialValue);
}
if (fieldConfig.defaultValue !== undefined) {
state.formState.values = setIn(state.formState.values, name, fieldConfig.defaultValue);
}
}

@@ -1033,0 +1060,0 @@

2

dist/final-form.umd.min.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self)["final-form"]={})}(this,function(e){"use strict";function N(){return(N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}var u=function(e){if(null==e||!e.length)return[];if("string"!=typeof e)throw new Error("toPath() expects a string");return e.split(/[.[\]]+/).filter(Boolean)},R=function(e,t){for(var i=u(t),r=e,n=0;n<i.length;n++){var a=i[n];if(null==r||"object"!=typeof r||Array.isArray(r)&&isNaN(a))return;r=r[a]}return r};function h(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==typeof t?t:String(t)}var n=function e(t,i,r,n,a){if(i>=r.length)return n;var u=r[i];if(isNaN(u)){var o;if(null==t){var s,l=e(void 0,i+1,r,n,a);return void 0===l?void 0:((s={})[u]=l,s)}if(Array.isArray(t))throw new Error("Cannot set a non-numeric property on an array");var f=e(t[u],i+1,r,n,a),c=Object.keys(t).length;if(void 0!==f)return N({},t,((o={})[u]=f,o));if(void 0===t[u]&&0===c)return;if(void 0!==t[u]&&c<=1)return isNaN(r[i-1])||a?void 0:{};t[u];return function(e,t){if(null==e)return{};var i,r,n={},a=Object.keys(e);for(r=0;r<a.length;r++)i=a[r],0<=t.indexOf(i)||(n[i]=e[i]);return n}(t,[u].map(h))}var d=Number(u);if(null==t){var v=e(void 0,i+1,r,n,a);if(void 0===v)return;var b=[];return b[d]=v,b}if(!Array.isArray(t))throw new Error("Cannot set a numeric property on an object");var m=e(t[d],i+1,r,n,a),S=[].concat(t);if(a&&void 0===m){if(S.splice(d,1),0===S.length)return}else S[d]=m;return S},A=function(e,t,i,r){if(void 0===r&&(r=!1),null==e)throw new Error("Cannot call setIn() with "+String(e)+" state");if(null==t)throw new Error("Cannot call setIn() with "+String(t)+" key");return n(e,0,u(t),i,r)},x="FINAL_FORM/form-error",I="FINAL_FORM/array-error",P=function(e,t){var i=e.errors,r=e.initialValues,n=e.lastSubmittedValues,a=e.submitErrors,u=e.submitFailed,o=e.submitSucceeded,s=e.submitting,l=e.values,f=t.active,c=t.blur,d=t.change,v=t.data,b=t.focus,m=t.name,S=t.touched,h=t.visited,y=R(l,m),g=R(i,m);g&&g[I]&&(g=g[I]);var p=a&&R(a,m),E=r&&R(r,m),F=t.isEqual(E,y),O=!g&&!p;return{active:f,blur:c,change:d,data:v,dirty:!F,dirtySinceLastSubmit:!(!n||t.isEqual(R(n,m),y)),error:g,focus:b,initial:E,invalid:!O,length:Array.isArray(y)?y.length:void 0,name:m,pristine:F,submitError:p,submitFailed:u,submitSucceeded:o,submitting:s,touched:S,valid:O,value:y,visited:h}},a=["active","data","dirty","dirtySinceLastSubmit","error","initial","invalid","length","pristine","submitError","submitFailed","submitSucceeded","submitting","touched","valid","value","visited"],L=function(e,t){if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(var n=Object.prototype.hasOwnProperty.bind(t),a=0;a<i.length;a++){var u=i[a];if(!n(u)||e[u]!==t[u])return!1}return!0};function o(t,i,r,n,e,a){var u=!1;return e.forEach(function(e){n[e]&&(t[e]=i[e],r&&(~a.indexOf(e)?L(i[e],r[e]):i[e]===r[e])||(u=!0))}),u}var s=["data"],q=function(e,t,i,r){var n={blur:e.blur,change:e.change,focus:e.focus,name:e.name};return o(n,e,t,i,a,s)||!t||r?n:void 0},l=["active","dirty","dirtyFields","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","invalid","pristine","submitting","submitError","submitErrors","submitFailed","submitSucceeded","touched","valid","validating","values","visited"],f=["touched","visited"],z=function(e,t,i,r){var n={};return o(n,e,t,i,l,f)||!t||r?n:void 0},_=function(r){var n,a;return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n&&t.length===n.length&&!t.some(function(e,t){return!L(n[t],e)})||(n=t,a=r.apply(void 0,t)),a}},C=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},B=function(e,t){return e===t},M=function i(r){return Object.keys(r).some(function(e){var t=r[e];return t&&"object"==typeof t?i(t):void 0!==t})};function D(e,t,i,r,n,a){void 0===a&&(a=!1);var u=n(i,r,t,a);u&&e(u)}function U(e,r,n,a){var u=e.entries;Object.keys(u).forEach(function(e){var t=u[Number(e)],i=t.subscription;D(t.subscriber,i,r,n,a)})}e.createForm=function(e){if(!e)throw new Error("No config specified");e.debug;var o=e.destroyOnUnregister,a=e.keepDirtyOnReinitialize,t=e.initialValues,u=e.mutators,s=e.onSubmit,v=e.validate,n=e.validateOnBlur;if(!s)throw new Error("No onSubmit function specified");var j={subscribers:{index:0,entries:{}},fieldSubscribers:{},fields:{},formState:{dirtySinceLastSubmit:!1,errors:{},initialValues:t&&N({},t),invalid:!1,pristine:!0,submitting:!1,submitFailed:!1,submitSucceeded:!1,valid:!0,validating:0,values:t?N({},t):{}},lastFormState:void 0},r=!1,b=!1,m=!1,S=0,h={},y=function(t){return function(e){return delete h[t],e}},l=function(e,t,i){var r=i(R(e.formState.values,t));e.formState.values=A(e.formState.values,t,r)||{}},f=function(e,t,i){if(e.fields[t]){var r,n;e.fields=N({},e.fields,((r={})[i]=N({},e.fields[t],{name:i,lastFieldState:void 0}),r)),delete e.fields[t],e.fieldSubscribers=N({},e.fieldSubscribers,((n={})[i]=e.fieldSubscribers[t],n)),delete e.fieldSubscribers[t];var a=R(e.formState.values,t);e.formState.values=A(e.formState.values,t,void 0)||{},e.formState.values=A(e.formState.values,i,a),delete e.lastFormState}},i=function(a){return function(){if(u){for(var e={formState:j.formState,fields:j.fields,fieldSubscribers:j.fieldSubscribers,lastFormState:j.lastFormState},t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=u[a](i,e,{changeValue:l,getIn:R,renameField:f,setIn:A,shallowEqual:L});return j.formState=e.formState,j.fields=e.fields,j.fieldSubscribers=e.fieldSubscribers,j.lastFormState=e.lastFormState,d(void 0,function(){p(),k()}),n}}},c=u?Object.keys(u).reduce(function(e,t){return e[t]=i(t),e},{}):{},g=function(r){return Object.keys(r.validators).reduce(function(e,t){var i=r.validators[Number(t)]();return i&&e.push(i),e},[])},d=function(e,t){if(b)return m=!0,void(t&&t());var s=j.fields,i=j.formState,r=Object.keys(s);if(v||r.some(function(e){return g(s[e]).length})){var o=!1;if(e){var n=s[e];if(n){var a=n.validateFields;a&&(o=!0,r=a.length?a.concat(e):[e])}}var l={},f={},u=[].concat(function(e){var t=[];if(v){var i=v(N({},j.formState.values));if(C(i)){var r=S++,n=i.then(e).then(y(r));t.push(n),h[r]=n}else e(i)}return t}(function(e){l=e||{}}),r.reduce(function(e,t){return e.concat((n=s[t],a=function(e){f[t]=e},o=[],(i=g(n)).length&&(i.forEach(function(e){var t=e(R(j.formState.values,n.name),j.formState.values,3===e.length?P(j.formState,j.fields[n.name]):void 0);if(t&&C(t)){var i=S++,r=t.then(a).then(y(i));o.push(r),h[i]=r}else u||(u=t)}),a(u)),o));var n,a,u,o,i},[])),c=function(){var u=N({},o?i.errors:{},l),e=function(a){r.forEach(function(e){if(s[e]){var t=R(l,e),i=R(u,e),r=g(s[e]).length,n=f[e];a(e,r&&n||v&&t||(t||o?void 0:i))}})};e(function(e,t){u=A(u,e,t)||{}}),e(function(e,t){if(t&&t[I]){var i=R(u,e),r=[].concat(i);r[I]=t[I],u=A(u,e,r)}}),L(i.errors,u)||(i.errors=u),i.error=l[x]};if(c(),u.length){j.formState.validating++,t&&t();var d=function(){j.formState.validating--,c(),t&&t()};Promise.all(u).then(d,d)}else t&&t()}else t&&t()},p=function(e){if(!r&&!b){var n=j.fields,a=j.fieldSubscribers,u=j.formState;Object.keys(n).forEach(function(e){var t=n[e],i=P(u,t),r=t.lastFieldState;L(i,r)||(t.lastFieldState=i,U(a[e],i,r,q))})}},E=function(){Object.keys(j.fields).forEach(function(e){j.fields[e].touched=!0})},F=function(){var i=j.fields,r=j.formState,e=j.lastFormState,t=Object.keys(i),n=!1,a=t.reduce(function(e,t){return!i[t].isEqual(R(r.values,t),R(r.initialValues||{},t))&&(n=!0,e[t]=!0),e},{});r.pristine=!n,r.dirtySinceLastSubmit=!(!r.lastSubmittedValues||t.every(function(e){var t=r.lastSubmittedValues||{};return i[e].isEqual(R(r.values,e),R(t,e))})),r.valid=!(r.error||r.submitError||M(r.errors)||r.submitErrors&&M(r.submitErrors));var u,o,s,l,f,c,d,v,b,m,S,h,y,g,p,E=(o=(u=r).active,s=u.dirtySinceLastSubmit,l=u.error,f=u.errors,c=u.initialValues,d=u.pristine,v=u.submitting,b=u.submitFailed,m=u.submitSucceeded,S=u.submitError,h=u.submitErrors,y=u.valid,g=u.validating,p=u.values,{active:o,dirty:!d,dirtySinceLastSubmit:s,error:l,errors:f,hasSubmitErrors:!!(S||h&&M(h)),hasValidationErrors:!(!l&&!M(f)),invalid:!y,initialValues:c,pristine:d,submitting:v,submitFailed:b,submitSucceeded:m,submitError:S,submitErrors:h,valid:y,validating:0<g,values:p}),F=t.reduce(function(e,t){return e.touched[t]=i[t].touched,e.visited[t]=i[t].visited,e},{touched:{},visited:{}}),O=F.touched,w=F.visited;return E.dirtyFields=e&&L(e.dirtyFields,a)?e.dirtyFields:a,E.touched=e&&L(e.touched,O)?e.touched:O,E.visited=e&&L(e.visited,w)?e.visited:w,e&&L(e,E)?e:E},O=!1,w=!1,k=function e(){if(O)w=!0;else{if(O=!0,!r&&!b){var t=j.lastFormState,i=F();i!==t&&(j.lastFormState=i,U(j.subscribers,i,t,z))}O=!1,w&&(w=!1,e())}};d();var V={batch:function(e){r=!0,e(),r=!1,p(),k()},blur:function(e){var t=j.fields,i=j.formState,r=t[e];r&&(delete i.active,t[e]=N({},r,{active:!1,touched:!0}),n?d(e,function(){p(),k()}):(p(),k()))},change:function(e,t){var i=j.formState;R(i.values,e)!==t&&(l(j,e,function(){return t}),n?(p(),k()):d(e,function(){p(),k()}))},focus:function(e){var t=j.fields[e];t&&!t.active&&(j.formState.active=e,t.active=!0,t.visited=!0,p(),k())},mutators:c,getFieldState:function(e){var t=j.fields[e];return t&&t.lastFieldState},getRegisteredFields:function(){return Object.keys(j.fields)},getState:function(){return F()},initialize:function(i){var r=j.fields,n=j.formState;a||(n.values=i),Object.keys(r).forEach(function(e){var t=r[e];t.touched=!1,t.visited=!1,a&&r[e].isEqual(R(n.values,e),R(n.initialValues||{},e))&&(n.values=A(n.values,e,R(i,e)))}),n.initialValues=i,d(void 0,function(){p(),k()})},isValidationPaused:function(){return b},pauseValidation:function(){b=!0},registerField:function(t,i,r,e){void 0===r&&(r={}),j.fieldSubscribers[t]||(j.fieldSubscribers[t]={index:0,entries:{}});var n=j.fieldSubscribers[t].index++;if(j.fieldSubscribers[t].entries[n]={subscriber:_(i),subscription:r},!j.fields[t]){var a=j.formState.initialValues?R(j.formState.initialValues,t):void 0;j.fields[t]={active:!1,blur:function(){return V.blur(t)},change:function(e){return V.change(t,e)},data:{},focus:function(){return V.focus(t)},initial:a,isEqual:e&&e.isEqual||B,lastFieldState:void 0,name:t,touched:!1,valid:!0,validateFields:e&&e.validateFields,validators:{},visited:!1}}e&&e.getValidator&&(j.fields[t].validators[n]=e.getValidator);var u=!1;return d(void 0,function(){var e;k(),u||(e=P(j.formState,j.fields[t]),D(i,r,e,void 0,q,!0),j.fields[t].lastFieldState=e,u=!0),p()}),function(){delete j.fields[t].validators[n],delete j.fieldSubscribers[t].entries[n],Object.keys(j.fieldSubscribers[t].entries).length||(delete j.fieldSubscribers[t],delete j.fields[t],j.formState.errors=A(j.formState.errors,t,void 0)||{},o&&(j.formState.values=A(j.formState.values,t,void 0,!0)||{})),d(void 0,function(){p(),k()})}},reset:function(e){void 0===e&&(e=j.formState.initialValues),j.formState.submitFailed=!1,j.formState.submitSucceeded=!1,delete j.formState.submitError,delete j.formState.submitErrors,delete j.formState.lastSubmittedValues,V.initialize(e||{})},resumeValidation:function(){b=!1,m&&d(void 0,function(){p(),k()}),m=!1},setConfig:function(e,t){switch(e){case"debug":break;case"destroyOnUnregister":o=t;break;case"initialValues":V.initialize(t);break;case"keepDirtyOnReinitialize":a=t;break;case"mutators":(u=t)?(Object.keys(c).forEach(function(e){e in t||delete c[e]}),Object.keys(t).forEach(function(e){c[e]=i(e)})):Object.keys(c).forEach(function(e){delete c[e]});break;case"onSubmit":s=t;break;case"validate":v=t,d(void 0,function(){p(),k()});break;case"validateOnBlur":n=t;break;default:throw new Error("Unrecognised option "+e)}},submit:function(){var t=j.formState;if(j.formState.error||M(j.formState.errors))return E(),j.formState.submitFailed=!0,k(),void p();var e=Object.keys(h);if(e.length)Promise.all(e.reduce(function(e,t){return e.push(h[Number(t)]),e},[])).then(V.submit,V.submit);else{var i,r=!1,n=function(e){return t.submitting=!1,e&&M(e)?(t.submitFailed=!0,t.submitSucceeded=!1,t.submitErrors=e,t.submitError=e[x],E()):(delete t.submitErrors,delete t.submitError,t.submitFailed=!1,t.submitSucceeded=!0),k(),p(),r=!0,i&&i(e),e};t.submitting=!0,t.submitFailed=!1,t.submitSucceeded=!1,t.lastSubmittedValues=N({},t.values);var a=s(t.values,V,n);if(!r){if(a&&C(a))return k(),p(),a.then(n,function(e){throw n(),e});if(3<=s.length)return k(),p(),new Promise(function(e){i=e});n(a)}}},subscribe:function(e,t){if(!e)throw new Error("No callback given.");if(!t)throw new Error("No subscription provided. What values do you want to listen to?");var i=_(e),r=j.subscribers,n=j.lastFormState,a=r.index++;r.entries[a]={subscriber:i,subscription:t};var u=F();return u!==n&&(j.lastFormState=u),D(i,t,u,u,z,!0),function(){delete r.entries[a]}}};return V},e.configOptions=["debug","initialValues","keepDirtyOnReinitialize","mutators","onSubmit","validate","validateOnBlur"],e.version="4.8.1",e.ARRAY_ERROR=I,e.FORM_ERROR=x,e.formSubscriptionItems=l,e.fieldSubscriptionItems=a,e.getIn=R,e.setIn=A,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self)["final-form"]={})}(this,function(e){"use strict";function N(){return(N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}var o=function(e){if(null==e||!e.length)return[];if("string"!=typeof e)throw new Error("toPath() expects a string");return e.split(/[.[\]]+/).filter(Boolean)},R=function(e,t){for(var i=o(t),r=e,n=0;n<i.length;n++){var a=i[n];if(null==r||"object"!=typeof r||Array.isArray(r)&&isNaN(a))return;r=r[a]}return r};function h(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==typeof t?t:String(t)}var n=function e(t,i,r,n,a){if(i>=r.length)return n;var o=r[i];if(isNaN(o)){var u;if(null==t){var s,l=e(void 0,i+1,r,n,a);return void 0===l?void 0:((s={})[o]=l,s)}if(Array.isArray(t))throw new Error("Cannot set a non-numeric property on an array");var f=e(t[o],i+1,r,n,a),d=Object.keys(t).length;if(void 0!==f)return N({},t,((u={})[o]=f,u));if(void 0===t[o]&&0===d)return;if(void 0!==t[o]&&d<=1)return isNaN(r[i-1])||a?void 0:{};t[o];return function(e,t){if(null==e)return{};var i,r,n={},a=Object.keys(e);for(r=0;r<a.length;r++)i=a[r],0<=t.indexOf(i)||(n[i]=e[i]);return n}(t,[o].map(h))}var c=Number(o);if(null==t){var v=e(void 0,i+1,r,n,a);if(void 0===v)return;var b=[];return b[c]=v,b}if(!Array.isArray(t))throw new Error("Cannot set a numeric property on an object");var m=e(t[c],i+1,r,n,a),S=[].concat(t);if(a&&void 0===m){if(S.splice(c,1),0===S.length)return}else S[c]=m;return S},A=function(e,t,i,r){if(void 0===r&&(r=!1),null==e)throw new Error("Cannot call setIn() with "+String(e)+" state");if(null==t)throw new Error("Cannot call setIn() with "+String(t)+" key");return n(e,0,o(t),i,r)},x="FINAL_FORM/form-error",I="FINAL_FORM/array-error",P=function(e,t){var i=e.errors,r=e.initialValues,n=e.lastSubmittedValues,a=e.submitErrors,o=e.submitFailed,u=e.submitSucceeded,s=e.submitting,l=e.values,f=t.active,d=t.blur,c=t.change,v=t.data,b=t.focus,m=t.modified,S=t.name,h=t.touched,y=t.visited,g=R(l,S),p=R(i,S);p&&p[I]&&(p=p[I]);var E=a&&R(a,S),F=r&&R(r,S),O=t.isEqual(F,g),w=!p&&!E;return{active:f,blur:d,change:c,data:v,dirty:!O,dirtySinceLastSubmit:!(!n||t.isEqual(R(n,S),g)),error:p,focus:b,initial:F,invalid:!w,length:Array.isArray(g)?g.length:void 0,modified:m,name:S,pristine:O,submitError:E,submitFailed:o,submitSucceeded:u,submitting:s,touched:h,valid:w,value:g,visited:y}},a=["active","data","dirty","dirtySinceLastSubmit","error","initial","invalid","length","modified","pristine","submitError","submitFailed","submitSucceeded","submitting","touched","valid","value","visited"],L=function(e,t){if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(var n=Object.prototype.hasOwnProperty.bind(t),a=0;a<i.length;a++){var o=i[a];if(!n(o)||e[o]!==t[o])return!1}return!0};function u(t,i,r,n,e,a){var o=!1;return e.forEach(function(e){n[e]&&(t[e]=i[e],r&&(~a.indexOf(e)?L(i[e],r[e]):i[e]===r[e])||(o=!0))}),o}var s=["data"],q=function(e,t,i,r){var n={blur:e.blur,change:e.change,focus:e.focus,name:e.name};return u(n,e,t,i,a,s)||!t||r?n:void 0},l=["active","dirty","dirtyFields","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","invalid","modified","pristine","submitting","submitError","submitErrors","submitFailed","submitSucceeded","touched","valid","validating","values","visited"],f=["touched","visited"],z=function(e,t,i,r){var n={};return u(n,e,t,i,l,f)||!t||r?n:void 0},_=function(r){var n,a;return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n&&t.length===n.length&&!t.some(function(e,t){return!L(n[t],e)})||(n=t,a=r.apply(void 0,t)),a}},C=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then},B=function(e,t){return e===t},M=function i(r){return Object.keys(r).some(function(e){var t=r[e];return t&&"object"==typeof t?i(t):void 0!==t})};function D(e,t,i,r,n,a){void 0===a&&(a=!1);var o=n(i,r,t,a);o&&e(o)}function U(e,r,n,a){var o=e.entries;Object.keys(o).forEach(function(e){var t=o[Number(e)],i=t.subscription;D(t.subscriber,i,r,n,a)})}e.createForm=function(e){if(!e)throw new Error("No config specified");e.debug;var o=e.destroyOnUnregister,a=e.keepDirtyOnReinitialize,t=e.initialValues,u=e.mutators,s=e.onSubmit,v=e.validate,l=e.validateOnBlur;if(!s)throw new Error("No onSubmit function specified");var k={subscribers:{index:0,entries:{}},fieldSubscribers:{},fields:{},formState:{dirtySinceLastSubmit:!1,errors:{},initialValues:t&&N({},t),invalid:!1,pristine:!0,submitting:!1,submitFailed:!1,submitSucceeded:!1,valid:!0,validating:0,values:t?N({},t):{}},lastFormState:void 0},r=!1,b=!1,m=!1,S=0,h={},y=function(t){return function(e){return delete h[t],e}},f=function(e,t,i){var r=i(R(e.formState.values,t));e.formState.values=A(e.formState.values,t,r)||{}},d=function(e,t,i){if(e.fields[t]){var r,n;e.fields=N({},e.fields,((r={})[i]=N({},e.fields[t],{name:i,lastFieldState:void 0}),r)),delete e.fields[t],e.fieldSubscribers=N({},e.fieldSubscribers,((n={})[i]=e.fieldSubscribers[t],n)),delete e.fieldSubscribers[t];var a=R(e.formState.values,t);e.formState.values=A(e.formState.values,t,void 0)||{},e.formState.values=A(e.formState.values,i,a),delete e.lastFormState}},i=function(a){return function(){if(u){for(var e={formState:k.formState,fields:k.fields,fieldSubscribers:k.fieldSubscribers,lastFormState:k.lastFormState},t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=u[a](i,e,{changeValue:f,getIn:R,renameField:d,setIn:A,shallowEqual:L});return k.formState=e.formState,k.fields=e.fields,k.fieldSubscribers=e.fieldSubscribers,k.lastFormState=e.lastFormState,c(void 0,function(){p(),j()}),n}}},n=u?Object.keys(u).reduce(function(e,t){return e[t]=i(t),e},{}):{},g=function(r){return Object.keys(r.validators).reduce(function(e,t){var i=r.validators[Number(t)]();return i&&e.push(i),e},[])},c=function(e,t){if(b)return m=!0,void(t&&t());var s=k.fields,i=k.formState,r=Object.keys(s);if(v||r.some(function(e){return g(s[e]).length})){var u=!1;if(e){var n=s[e];if(n){var a=n.validateFields;a&&(u=!0,r=a.length?a.concat(e):[e])}}var l={},f={},o=[].concat(function(e){var t=[];if(v){var i=v(N({},k.formState.values));if(C(i)){var r=S++,n=i.then(e).then(y(r));t.push(n),h[r]=n}else e(i)}return t}(function(e){l=e||{}}),r.reduce(function(e,t){return e.concat((n=s[t],a=function(e){f[t]=e},u=[],(i=g(n)).length&&(i.forEach(function(e){var t=e(R(k.formState.values,n.name),k.formState.values,3===e.length?P(k.formState,k.fields[n.name]):void 0);if(t&&C(t)){var i=S++,r=t.then(a).then(y(i));u.push(r),h[i]=r}else o||(o=t)}),a(o)),u));var n,a,o,u,i},[])),d=function(){var o=N({},u?i.errors:{},l),e=function(a){r.forEach(function(e){if(s[e]){var t=R(l,e),i=R(o,e),r=g(s[e]).length,n=f[e];a(e,r&&n||v&&t||(t||u?void 0:i))}})};e(function(e,t){o=A(o,e,t)||{}}),e(function(e,t){if(t&&t[I]){var i=R(o,e),r=[].concat(i);r[I]=t[I],o=A(o,e,r)}}),L(i.errors,o)||(i.errors=o),i.error=l[x]};if(d(),o.length){k.formState.validating++,t&&t();var c=function(){k.formState.validating--,d(),t&&t()};Promise.all(o).then(c,c)}else t&&t()}else t&&t()},p=function(e){if(!r&&!b){var n=k.fields,a=k.fieldSubscribers,o=k.formState;Object.keys(n).forEach(function(e){var t=n[e],i=P(o,t),r=t.lastFieldState;L(i,r)||(t.lastFieldState=i,U(a[e],i,r,q))})}},E=function(){Object.keys(k.fields).forEach(function(e){k.fields[e].touched=!0})},F=function(){var i=k.fields,r=k.formState,e=k.lastFormState,t=Object.keys(i),n=!1,a=t.reduce(function(e,t){return!i[t].isEqual(R(r.values,t),R(r.initialValues||{},t))&&(n=!0,e[t]=!0),e},{});r.pristine=!n,r.dirtySinceLastSubmit=!(!r.lastSubmittedValues||t.every(function(e){var t=r.lastSubmittedValues||{};return i[e].isEqual(R(r.values,e),R(t,e))})),r.valid=!(r.error||r.submitError||M(r.errors)||r.submitErrors&&M(r.submitErrors));var o,u,s,l,f,d,c,v,b,m,S,h,y,g,p,E=(u=(o=r).active,s=o.dirtySinceLastSubmit,l=o.error,f=o.errors,d=o.initialValues,c=o.pristine,v=o.submitting,b=o.submitFailed,m=o.submitSucceeded,S=o.submitError,h=o.submitErrors,y=o.valid,g=o.validating,p=o.values,{active:u,dirty:!c,dirtySinceLastSubmit:s,error:l,errors:f,hasSubmitErrors:!!(S||h&&M(h)),hasValidationErrors:!(!l&&!M(f)),invalid:!y,initialValues:d,pristine:c,submitting:v,submitFailed:b,submitSucceeded:m,submitError:S,submitErrors:h,valid:y,validating:0<g,values:p}),F=t.reduce(function(e,t){return e.modified[t]=i[t].modified,e.touched[t]=i[t].touched,e.visited[t]=i[t].visited,e},{modified:{},touched:{},visited:{}}),O=F.modified,w=F.touched,j=F.visited;return E.dirtyFields=e&&L(e.dirtyFields,a)?e.dirtyFields:a,E.modified=e&&L(e.modified,O)?e.modified:O,E.touched=e&&L(e.touched,w)?e.touched:w,E.visited=e&&L(e.visited,j)?e.visited:j,e&&L(e,E)?e:E},O=!1,w=!1,j=function e(){if(O)w=!0;else{if(O=!0,!r&&!b){var t=k.lastFormState,i=F();i!==t&&(k.lastFormState=i,U(k.subscribers,i,t,z))}O=!1,w&&(w=!1,e())}};c();var V={batch:function(e){r=!0,e(),r=!1,p(),j()},blur:function(e){var t=k.fields,i=k.formState,r=t[e];r&&(delete i.active,t[e]=N({},r,{active:!1,touched:!0}),l?c(e,function(){p(),j()}):(p(),j()))},change:function(e,t){var i=k.fields,r=k.formState;if(R(r.values,e)!==t){f(k,e,function(){return t});var n=i[e];n&&(i[e]=N({},n,{modified:!0})),l?(p(),j()):c(e,function(){p(),j()})}},focus:function(e){var t=k.fields[e];t&&!t.active&&(k.formState.active=e,t.active=!0,t.visited=!0,p(),j())},mutators:n,getFieldState:function(e){var t=k.fields[e];return t&&t.lastFieldState},getRegisteredFields:function(){return Object.keys(k.fields)},getState:function(){return F()},initialize:function(e){var i=k.fields,r=k.formState,n="function"==typeof e?e(r.values):e;a||(r.values=n),Object.keys(i).forEach(function(e){var t=i[e];t.modified=!1,t.touched=!1,t.visited=!1,a&&i[e].isEqual(R(r.values,e),R(r.initialValues||{},e))&&(r.values=A(r.values,e,R(n,e)))}),r.initialValues=n,c(void 0,function(){p(),j()})},isValidationPaused:function(){return b},pauseValidation:function(){b=!0},registerField:function(t,i,r,e){void 0===r&&(r={}),k.fieldSubscribers[t]||(k.fieldSubscribers[t]={index:0,entries:{}});var n=k.fieldSubscribers[t].index++;k.fieldSubscribers[t].entries[n]={subscriber:_(i),subscription:r},k.fields[t]||(k.fields[t]={active:!1,blur:function(){return V.blur(t)},change:function(e){return V.change(t,e)},data:{},focus:function(){return V.focus(t)},isEqual:e&&e.isEqual||B,lastFieldState:void 0,modified:!1,name:t,touched:!1,valid:!0,validateFields:e&&e.validateFields,validators:{},visited:!1}),e&&(e.getValidator&&(k.fields[t].validators[n]=e.getValidator),void 0!==e.initialValue&&(k.formState.initialValues=A(k.formState.initialValues||{},t,e.initialValue),k.formState.values=A(k.formState.values,t,e.initialValue)),void 0!==e.defaultValue&&(k.formState.values=A(k.formState.values,t,e.defaultValue)));var a=!1;return c(void 0,function(){var e;j(),a||(e=P(k.formState,k.fields[t]),D(i,r,e,void 0,q,!0),k.fields[t].lastFieldState=e,a=!0),p()}),function(){delete k.fields[t].validators[n],delete k.fieldSubscribers[t].entries[n],Object.keys(k.fieldSubscribers[t].entries).length||(delete k.fieldSubscribers[t],delete k.fields[t],k.formState.errors=A(k.formState.errors,t,void 0)||{},o&&(k.formState.values=A(k.formState.values,t,void 0,!0)||{})),c(void 0,function(){p(),j()})}},reset:function(e){void 0===e&&(e=k.formState.initialValues),k.formState.submitFailed=!1,k.formState.submitSucceeded=!1,delete k.formState.submitError,delete k.formState.submitErrors,delete k.formState.lastSubmittedValues,V.initialize(e||{})},resumeValidation:function(){b=!1,m&&c(void 0,function(){p(),j()}),m=!1},setConfig:function(e,t){switch(e){case"debug":break;case"destroyOnUnregister":o=t;break;case"initialValues":V.initialize(t);break;case"keepDirtyOnReinitialize":a=t;break;case"mutators":(u=t)?(Object.keys(n).forEach(function(e){e in t||delete n[e]}),Object.keys(t).forEach(function(e){n[e]=i(e)})):Object.keys(n).forEach(function(e){delete n[e]});break;case"onSubmit":s=t;break;case"validate":v=t,c(void 0,function(){p(),j()});break;case"validateOnBlur":l=t;break;default:throw new Error("Unrecognised option "+e)}},submit:function(){var t=k.formState;if(k.formState.error||M(k.formState.errors))return E(),k.formState.submitFailed=!0,j(),void p();var e=Object.keys(h);if(e.length)Promise.all(e.reduce(function(e,t){return e.push(h[Number(t)]),e},[])).then(V.submit,V.submit);else{var i,r=!1,n=function(e){return t.submitting=!1,e&&M(e)?(t.submitFailed=!0,t.submitSucceeded=!1,t.submitErrors=e,t.submitError=e[x],E()):(delete t.submitErrors,delete t.submitError,t.submitFailed=!1,t.submitSucceeded=!0),j(),p(),r=!0,i&&i(e),e};t.submitting=!0,t.submitFailed=!1,t.submitSucceeded=!1,t.lastSubmittedValues=N({},t.values);var a=s(t.values,V,n);if(!r){if(a&&C(a))return j(),p(),a.then(n,function(e){throw n(),e});if(3<=s.length)return j(),p(),new Promise(function(e){i=e});n(a)}}},subscribe:function(e,t){if(!e)throw new Error("No callback given.");if(!t)throw new Error("No subscription provided. What values do you want to listen to?");var i=_(e),r=k.subscribers,n=k.lastFormState,a=r.index++;r.entries[a]={subscriber:i,subscription:t};var o=F();return o!==n&&(k.lastFormState=o),D(i,t,o,o,z,!0),function(){delete r.entries[a]}}};return V},e.configOptions=["debug","initialValues","keepDirtyOnReinitialize","mutators","onSubmit","validate","validateOnBlur"],e.version="4.8.1",e.ARRAY_ERROR=I,e.FORM_ERROR=x,e.formSubscriptionItems=l,e.fieldSubscriptionItems=a,e.getIn=R,e.setIn=A,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=final-form.umd.min.js.map

@@ -19,2 +19,3 @@ export type Subscription = { [key: string]: boolean }

invalid?: boolean
modified?: boolean
pristine?: boolean

@@ -45,2 +46,3 @@ submitError?: boolean

invalid: boolean
modified?: { [key: string]: boolean }
pristine: boolean

@@ -73,2 +75,3 @@ submitError: any

length?: number
modified?: boolean
name: string

@@ -95,2 +98,3 @@ pristine?: boolean

length?: boolean
modified?: boolean
pristine?: boolean

@@ -125,4 +129,6 @@ submitError?: boolean

export interface FieldConfig {
defaultValue?: any
getValidator?: GetFieldValidator
initialValue?: any
isEqual?: IsEqual
getValidator?: GetFieldValidator
validateFields?: string[]

@@ -147,2 +153,3 @@ }

length?: any
modified: boolean
name: string

@@ -191,3 +198,3 @@ touched: boolean

focus: (name: string) => void
initialize: (values: object) => void
initialize: (data: Object | ((values: Object) => Object)) => void
isValidationPaused: () => boolean

@@ -194,0 +201,0 @@ getFieldState: (field: string) => FieldState | undefined

{
"name": "final-form",
"version": "4.11.1",
"version": "4.12.0",
"description": "🏁 Framework agnostic, high performance, subscription-based form state management",

@@ -43,3 +43,3 @@ "main": "dist/final-form.cjs.js",

"@babel/preset-flow": "7.0.0",
"@types/node": "^10.12.21",
"@types/node": "^11.10.4",
"babel-core": "^7.0.0-bridge.0",

@@ -57,3 +57,3 @@ "babel-eslint": "^10.0.1",

"eslint-plugin-react": "^7.12.4",
"flow-bin": "^0.92.1",
"flow-bin": "^0.94.0",
"glow": "^1.2.2",

@@ -92,11 +92,11 @@ "husky": "^1.3.1",

"path": "dist/final-form.umd.min.js",
"maxSize": "4.7kB"
"maxSize": "4.8kB"
},
{
"path": "dist/final-form.es.js",
"maxSize": "8.2kB"
"maxSize": "8.5kB"
},
{
"path": "dist/final-form.cjs.js",
"maxSize": "8.2kB"
"maxSize": "8.5kB"
}

@@ -103,0 +103,0 @@ ],

@@ -19,3 +19,3 @@ # 🏁 Final Form

✅ 💥 [**4.6k gzipped**](https://bundlephobia.com/result?p=final-form) 💥
✅ 💥 [**4.7k gzipped**](https://bundlephobia.com/result?p=final-form) 💥

@@ -114,2 +114,3 @@ ---

- [Vue Final Form](#vue-final-form)
- [Web Components Bindings](#web-components-bindings)
- [Define Form and React Define Form](#define-form-and-react-define-form)

@@ -142,4 +143,6 @@ - [🏁 Final Form Focus 🧐](#-final-form-focus-)

- [`FieldConfig`](#fieldconfig)
- [`defaultValue?: any`](#defaultvalue-any)
- [`getValidator?: () => (value: ?any, allValues: Object, meta: FieldState) => ?any | ?Promise<any>`](#getvalidator---value-any-allvalues-object-meta-fieldstate--any--promiseany)
- [`initialValue?: any`](#initialvalue-any)
- [`isEqual?: (a: any, b: any) => boolean`](#isequal-a-any-b-any--boolean)
- [`getValidator?: () => (value: ?any, allValues: Object, meta: FieldState) => ?any | ?Promise<any>`](#getvalidator---value-any-allvalues-object--any--promiseany)
- [`validateFields?: string[]`](#validatefields-string)

@@ -195,3 +198,3 @@ - [`FieldState`](#fieldstate)

- [`getState: () => FormState`](#getstate---formstate)
- [`initialize: (values: Object) => void`](#initialize-values-object--void)
- [`initialize: (data: Object | ((values: Object) => Object)) => void`](#initialize-data-object--values-object--object--void)
- [`isValidationPaused: () => boolean`](#isvalidationpaused---boolean)

@@ -276,3 +279,3 @@ - [`mutators: ?{ [string]: Function }`](#mutators--string-function-)

- [`submitSucceeded: boolean`](#submitsucceeded-boolean)
- [`submitting: boolean`](#submitting-boolean-4)
- [`submitting: boolean`](#submitting-boolean)
- [`valid: boolean`](#valid-boolean-1)

@@ -339,2 +342,6 @@ - [`validating: number`](#validating-number)

### [Web Components Bindings](https://github.com/corpusculejs/corpuscule/tree/master/packages/form)
CorpusculeJS provides a way to manage form state with 🏁 Final Form using Web Components.
### [Define Form](https://github.com/ForbesLindesay/define-form/tree/master/packages/define-form) and [React Define Form](https://github.com/ForbesLindesay/define-form/tree/master/packages/react-define-form)

@@ -498,6 +505,8 @@

#### `isEqual?: (a: any, b: any) => boolean`
#### `defaultValue?: any`
A function to determine if two values are equal. Defaults to `===`.
⚠️ You probably want `initialValue`! ⚠️
The value of the field upon creation. _**This value is only needed if you want your field be `dirty` upon creation (i.e. for its value to be different from its initial value).**_
#### `getValidator?: () => (value: ?any, allValues: Object, meta: FieldState) => ?any | ?Promise<any>`

@@ -507,2 +516,12 @@

#### `initialValue?: any`
The initial value for the field. This value will be used to calculate `dirty` and `pristine` by comparing it to the current value of the field. If you want field to be `dirty` upon creation, you can set one value with `initialValue` and set the value of the field with `defaultValue`.
The value given here will override any `initialValues` given to the entire form.
#### `isEqual?: (a: any, b: any) => boolean`
A function to determine if two values are equal. Defaults to `===`.
#### `validateFields?: string[]`

@@ -565,2 +584,7 @@

#### `modified?: boolean`
`true` if this field's value has ever been changed. `false` otherwise.
Once `true`, it will remain `true` for the lifetime of the field, or until the form is reset.
#### `name: string`

@@ -653,2 +677,7 @@

#### `modified?: boolean`
When `true` the `FieldSubscriber` will be notified of changes to the `modified`
value in `FieldState`.
#### `pristine?: boolean`

@@ -737,3 +766,3 @@

#### `initialize: (values: Object) => void`
#### `initialize: (data: Object | ((values: Object) => Object)) => void`

@@ -838,2 +867,6 @@ Initializes the form to the values provided. All the values will be set to these

#### `modified?: { [string]: boolean }`
An object full of booleans, with a boolean value for each field name denoting whether that field is `modified` or not. Note that this is a flat object, so if your field name is `addresses.shipping.street`, the `modified` value for that field will be available under `modified['addresses.shipping.street']`.
#### `pristine?: boolean`

@@ -946,2 +979,7 @@

#### `modified?: boolean`
When `true` the `FormSubscriber` will be notified of changes to the `modified`
value in `FormState`.
#### `pristine?: boolean`

@@ -1035,2 +1073,7 @@

#### `modified: boolean`
`true` if this field's value has ever changed. `false` otherwise. Useful
for knowing when to display error messages. Once `true`, it will remain `true` for the lifetime of the field, or until the form is reset.
#### `name: string`

@@ -1037,0 +1080,0 @@

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc