react-final-form
Advanced tools
Comparing version 3.3.1 to 3.4.0
@@ -27,2 +27,3 @@ import * as React from 'react' | ||
active: boolean | ||
data: object, | ||
dirty: boolean | ||
@@ -29,0 +30,0 @@ dirtySinceLastSubmit: boolean |
@@ -279,9 +279,9 @@ 'use strict'; | ||
if (_value === undefined) { | ||
input.checked = !!value; | ||
input.checked = !!value; | ||
} else { | ||
input.checked = !!(Array.isArray(value) && ~value.indexOf(_value)); | ||
input.checked = !!(Array.isArray(value) && ~value.indexOf(_value)); | ||
input.value = _value; | ||
} | ||
} else if (rest.type === 'radio') { | ||
input.checked = value === _value; | ||
input.checked = value === _value; | ||
input.value = _value; | ||
@@ -401,3 +401,3 @@ } else if (component === 'select' && rest.multiple) { | ||
var version = '3.3.0'; | ||
var version = '3.4.0'; | ||
@@ -499,2 +499,14 @@ var versions = { | ||
ReactFinalForm.prototype.componentWillUpdate = function componentWillUpdate() { | ||
if (this.form) { | ||
this.form.pauseValidation(); | ||
} | ||
}; | ||
ReactFinalForm.prototype.componentDidUpdate = function componentDidUpdate() { | ||
if (this.form) { | ||
this.form.resumeValidation(); | ||
} | ||
}; | ||
ReactFinalForm.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
@@ -501,0 +513,0 @@ var _this2 = this; |
@@ -273,9 +273,9 @@ import { createElement, Component } from 'react'; | ||
if (_value === undefined) { | ||
input.checked = !!value; | ||
input.checked = !!value; | ||
} else { | ||
input.checked = !!(Array.isArray(value) && ~value.indexOf(_value)); | ||
input.checked = !!(Array.isArray(value) && ~value.indexOf(_value)); | ||
input.value = _value; | ||
} | ||
} else if (rest.type === 'radio') { | ||
input.checked = value === _value; | ||
input.checked = value === _value; | ||
input.value = _value; | ||
@@ -395,3 +395,3 @@ } else if (component === 'select' && rest.multiple) { | ||
var version$1 = '3.3.0'; | ||
var version$1 = '3.4.0'; | ||
@@ -493,2 +493,14 @@ var versions = { | ||
ReactFinalForm.prototype.componentWillUpdate = function componentWillUpdate() { | ||
if (this.form) { | ||
this.form.pauseValidation(); | ||
} | ||
}; | ||
ReactFinalForm.prototype.componentDidUpdate = function componentDidUpdate() { | ||
if (this.form) { | ||
this.form.resumeValidation(); | ||
} | ||
}; | ||
ReactFinalForm.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
@@ -495,0 +507,0 @@ var _this2 = this; |
@@ -193,3 +193,3 @@ (function (global, factory) { | ||
// istanbul ignore next | ||
if ("development" !== 'production' && !context.reactFinalForm) { | ||
if (!context.reactFinalForm) { | ||
console.error('Warning: Field must be used inside of a ReactFinalForm component'); | ||
@@ -278,9 +278,9 @@ } | ||
if (_value === undefined) { | ||
input.checked = !!value; | ||
input.checked = !!value; | ||
} else { | ||
input.checked = !!(Array.isArray(value) && ~value.indexOf(_value)); | ||
input.checked = !!(Array.isArray(value) && ~value.indexOf(_value)); | ||
input.value = _value; | ||
} | ||
} else if (rest.type === 'radio') { | ||
input.checked = value === _value; | ||
input.checked = value === _value; | ||
input.value = _value; | ||
@@ -351,3 +351,3 @@ } else if (component === 'select' && rest.multiple) { | ||
if ("development" !== 'production' && event && event.target) { | ||
if (event && event.target) { | ||
var targetType = event.target.type; | ||
@@ -401,3 +401,3 @@ var props = _this2.props; | ||
var version = '3.3.0'; | ||
var version = '3.4.0'; | ||
@@ -499,2 +499,14 @@ var versions = { | ||
ReactFinalForm.prototype.componentWillUpdate = function componentWillUpdate() { | ||
if (this.form) { | ||
this.form.pauseValidation(); | ||
} | ||
}; | ||
ReactFinalForm.prototype.componentDidUpdate = function componentDidUpdate() { | ||
if (this.form) { | ||
this.form.resumeValidation(); | ||
} | ||
}; | ||
ReactFinalForm.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { | ||
@@ -642,3 +654,3 @@ var _this2 = this; | ||
// istanbul ignore next | ||
if ("development" !== 'production' && !context.reactFinalForm) { | ||
if (!context.reactFinalForm) { | ||
console.error('Warning: FormSpy must be used inside of a ReactFinalForm component'); | ||
@@ -645,0 +657,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","final-form"],e):e(t["react-final-form"]={},t.React,t.PropTypes,t.FinalForm)}(this,function(t,e,n,r){"use strict";function i(t,e,n){return t?!e||n.some(function(n){return t[n]!==e[n]}):!!e}n=n&&n.hasOwnProperty("default")?n.default:n;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},c=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},f=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e};function l(t,n){var r=t.render,i=t.children,o=t.component,a=c(t,["render","children","component"]);return o?e.createElement(o,u({},a,{children:i,render:r})):r?r(u({},a,{children:i})):"function"!=typeof i?null:i(a)}var p="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,m=r.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),d=function(t){function n(e,r){a(this,n);var i=f(this,t.call(this,e,r));h.call(i);var o=void 0;return i.context.reactFinalForm&&i.subscribe(e,function(t){o?i.notify(t):o=t}),i.state={state:o},i}return s(n,t),n.prototype.componentWillReceiveProps=function(t){var e=t.name,n=t.subscription;(this.props.name!==e||i(this.props.subscription,n,r.fieldSubscriptionItems))&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))},n.prototype.componentWillUnmount=function(){this.unsubscribe()},n.prototype.render=function(){var t=this.props,n=t.allowNull,r=t.component,i=t.children,o=t.format,a=(t.parse,t.isEqual,t.name),s=(t.subscription,t.validate,t.validateFields,t.value),f=c(t,["allowNull","component","children","format","parse","isEqual","name","subscription","validate","validateFields","value"]),p=this.state.state||{},m=(p.blur,p.change,p.focus,p.value),d=(p.name,c(p,["blur","change","focus","value","name"])),h={active:d.active,data:d.data,dirty:d.dirty,dirtySinceLastSubmit:d.dirtySinceLastSubmit,error:d.error,initial:d.initial,invalid:d.invalid,pristine:d.pristine,submitError:d.submitError,submitFailed:d.submitFailed,submitSucceeded:d.submitSucceeded,touched:d.touched,valid:d.valid,visited:d.visited};o&&(m=o(m,a)),null!==m||n||(m="");var b=u({name:a,value:m},this.handlers);return"checkbox"===f.type?void 0===s?b.checked=!!m:(b.checked=!(!Array.isArray(m)||!~m.indexOf(s)),b.value=s):"radio"===f.type?(b.checked=m===s,b.value=s):"select"===r&&f.multiple&&(b.value=b.value||[]),"function"==typeof i?i(u({input:b,meta:h},f)):"string"==typeof r?e.createElement(r,u({},b,{children:i},f)):l(u({},{input:b,meta:h},{children:i,component:r},f))},n}(e.Component);d.contextTypes={reactFinalForm:n.object},d.defaultProps={format:function(t,e){return void 0===t?"":t},parse:function(t,e){return""===t?void 0:t}};var h=function(){var t=this;this.subscribe=function(e,n){var r=e.isEqual,i=e.name,o=e.subscription,a=e.validateFields;t.unsubscribe=t.context.reactFinalForm.registerField(i,n,o||m,{isEqual:r,getValidator:function(){return t.props.validate},validateFields:a})},this.notify=function(e){return t.setState({state:e})},this.handlers={onBlur:function(e){t.state.state&&t.state.state.blur()},onChange:function(e){var n=t.props,r=n.parse,i=n.value,o=e&&e.target?function(t,e,n,r){if(!r&&t.nativeEvent&&void 0!==t.nativeEvent.text)return t.nativeEvent.text;if(r&&t.nativeEvent)return t.nativeEvent.text;var i=t.target,o=i.type,a=i.value,u=i.checked;switch(o){case"checkbox":if(void 0!==n){if(u)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return e;var s=e.indexOf(n);return s<0?e:e.slice(0,s).concat(e.slice(s+1))}return!!u;case"select-multiple":return function(t){var e=[];if(t)for(var n=0;n<t.length;n++){var r=t[n];r.selected&&e.push(r.value)}return e}(t.target.options);default:return a}}(e,t.state.state&&t.state.state.value,i,p):e;t.state.state&&t.state.state.change(r?r(o,t.props.name):o)},onFocus:function(e){t.state.state&&t.state.state.focus()}}},b={"final-form":r.version,"react-final-form":"3.3.0"},v=r.formSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),y=function(t){function e(n){a(this,e);var i=f(this,t.call(this,n));i.notify=function(t){i.mounted&&i.setState({state:t}),i.mounted=!0},i.handleSubmit=function(t){return t&&"function"==typeof t.preventDefault&&t.preventDefault(),i.form.submit()};var o=n.debug,u=n.decorators,s=n.initialValues,c=n.mutators,l=n.onSubmit,p=n.subscription,m={debug:o,initialValues:s,mutators:c,onSubmit:l,validate:n.validate,validateOnBlur:n.validateOnBlur};i.mounted=!1;try{i.form=r.createForm(m)}catch(t){}if(i.unsubscriptions=[],i.form){var d={};i.form.subscribe(function(t){d=t},p||v)(),i.state={state:d}}return u&&u.forEach(function(t){i.unsubscriptions.push(t(i.form))}),i}return s(e,t),e.prototype.getChildContext=function(){return{reactFinalForm:this.form}},e.prototype.componentWillMount=function(){this.form&&this.form.pauseValidation()},e.prototype.componentDidMount=function(){this.form&&(this.unsubscriptions.push(this.form.subscribe(this.notify,this.props.subscription||v)),this.form.resumeValidation())},e.prototype.componentWillReceiveProps=function(t){var e=this;t.initialValues&&!function(t,e){if(t===e)return!0;if("object"!==(void 0===t?"undefined":o(t))||!t||"object"!==(void 0===e?"undefined":o(e))||!e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(e),a=0;a<n.length;a++){var u=n[a];if(!i(u)||t[u]!==e[u])return!1}return!0}(this.props.initialValues,t.initialValues)&&this.form.initialize(t.initialValues),["debug","mutators","onSubmit","validate","validateOnBlur"].forEach(function(n){e.props[n]!==t[n]&&e.form.setConfig&&e.form.setConfig(n,t[n])})},e.prototype.componentWillUnmount=function(){this.unsubscriptions.forEach(function(t){return t()})},e.prototype.render=function(){var t=this,e=this.props,n=(e.debug,e.initialValues,e.mutators,e.onSubmit,e.subscription,e.validate,e.validateOnBlur,c(e,["debug","initialValues","mutators","onSubmit","subscription","validate","validateOnBlur"])),r=u({},this.state?this.state.state:{},{batch:this.form&&function(e){return t.form.batch(e)},blur:this.form&&function(e){return t.form.blur(e)},change:this.form&&function(e,n){return t.form.change(e,n)},focus:this.form&&function(e){return t.form.focus(e)},form:this.form,handleSubmit:this.handleSubmit,initialize:this.form&&function(e){return t.form.initialize(e)},mutators:this.form&&Object.keys(this.form.mutators).reduce(function(e,n){return e[n]=function(){var e;(e=t.form.mutators)[n].apply(e,arguments)},e},{}),reset:this.form&&function(e){return t.form.reset(e)}});return l(u({},n,r,{__versions:b}))},e}(e.Component);y.childContextTypes={reactFinalForm:n.object};var g=function(t){function e(n,r){a(this,e);var i=f(this,t.call(this,n,r));i.subscribe=function(t,e){var n=t.subscription;i.unsubscribe=i.context.reactFinalForm.subscribe(e,n||v)},i.notify=function(t){i.setState({state:t}),i.props.onChange&&i.props.onChange(t)};var o=void 0;return i.context.reactFinalForm&&i.subscribe(n,function(t){o?i.notify(t):(o=t,n.onChange&&n.onChange(t))}),o&&(i.state={state:o}),i}return s(e,t),e.prototype.componentWillReceiveProps=function(t){var e=t.subscription;i(this.props.subscription,e,r.formSubscriptionItems)&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))},e.prototype.componentWillUnmount=function(){this.unsubscribe()},e.prototype.render=function(){var t=this.props,e=t.onChange,n=(t.subscription,c(t,["onChange","subscription"])),r=this.context.reactFinalForm,i={batch:r&&function(t){return r.batch(t)},blur:r&&function(t){return r.blur(t)},change:r&&function(t,e){return r.change(t,e)},focus:r&&function(t){return r.focus(t)},form:r,initialize:r&&function(t){return r.initialize(t)},mutators:r&&Object.keys(r.mutators).reduce(function(t,e){return t[e]=function(){var t;(t=r.mutators)[e].apply(t,arguments)},t},{}),reset:r&&function(t){return r.reset(t)}};return e?null:l(u({},n,this.state?this.state.state:{},i))},e}(e.Component);g.contextTypes={reactFinalForm:n.object},t.Field=d,t.Form=y,t.version="3.3.0",t.FormSpy=g,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("final-form")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","final-form"],e):e(t["react-final-form"]={},t.React,t.PropTypes,t.FinalForm)}(this,function(t,e,n,r){"use strict";function i(t,e,n){return t?!e||n.some(function(n){return t[n]!==e[n]}):!!e}n=n&&n.hasOwnProperty("default")?n.default:n;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=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},u=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},c=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},f=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e};function l(t,n){var r=t.render,i=t.children,o=t.component,a=c(t,["render","children","component"]);return o?e.createElement(o,s({},a,{children:i,render:r})):r?r(s({},a,{children:i})):"function"!=typeof i?null:i(a)}var p="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,m=r.fieldSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),d=function(t){function n(e,r){a(this,n);var i=f(this,t.call(this,e,r));h.call(i);var o=void 0;return i.context.reactFinalForm&&i.subscribe(e,function(t){o?i.notify(t):o=t}),i.state={state:o},i}return u(n,t),n.prototype.componentWillReceiveProps=function(t){var e=t.name,n=t.subscription;(this.props.name!==e||i(this.props.subscription,n,r.fieldSubscriptionItems))&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))},n.prototype.componentWillUnmount=function(){this.unsubscribe()},n.prototype.render=function(){var t=this.props,n=t.allowNull,r=t.component,i=t.children,o=t.format,a=(t.parse,t.isEqual,t.name),u=(t.subscription,t.validate,t.validateFields,t.value),f=c(t,["allowNull","component","children","format","parse","isEqual","name","subscription","validate","validateFields","value"]),p=this.state.state||{},m=(p.blur,p.change,p.focus,p.value),d=(p.name,c(p,["blur","change","focus","value","name"])),h={active:d.active,data:d.data,dirty:d.dirty,dirtySinceLastSubmit:d.dirtySinceLastSubmit,error:d.error,initial:d.initial,invalid:d.invalid,pristine:d.pristine,submitError:d.submitError,submitFailed:d.submitFailed,submitSucceeded:d.submitSucceeded,touched:d.touched,valid:d.valid,visited:d.visited};o&&(m=o(m,a)),null!==m||n||(m="");var b=s({name:a,value:m},this.handlers);return"checkbox"===f.type?void 0===u?b.checked=!!m:(b.checked=!(!Array.isArray(m)||!~m.indexOf(u)),b.value=u):"radio"===f.type?(b.checked=m===u,b.value=u):"select"===r&&f.multiple&&(b.value=b.value||[]),"function"==typeof i?i(s({input:b,meta:h},f)):"string"==typeof r?e.createElement(r,s({},b,{children:i},f)):l(s({},{input:b,meta:h},{children:i,component:r},f))},n}(e.Component);d.contextTypes={reactFinalForm:n.object},d.defaultProps={format:function(t,e){return void 0===t?"":t},parse:function(t,e){return""===t?void 0:t}};var h=function(){var t=this;this.subscribe=function(e,n){var r=e.isEqual,i=e.name,o=e.subscription,a=e.validateFields;t.unsubscribe=t.context.reactFinalForm.registerField(i,n,o||m,{isEqual:r,getValidator:function(){return t.props.validate},validateFields:a})},this.notify=function(e){return t.setState({state:e})},this.handlers={onBlur:function(e){t.state.state&&t.state.state.blur()},onChange:function(e){var n=t.props,r=n.parse,i=n.value,o=e&&e.target?function(t,e,n,r){if(!r&&t.nativeEvent&&void 0!==t.nativeEvent.text)return t.nativeEvent.text;if(r&&t.nativeEvent)return t.nativeEvent.text;var i=t.target,o=i.type,a=i.value,s=i.checked;switch(o){case"checkbox":if(void 0!==n){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))}return!!s;case"select-multiple":return function(t){var e=[];if(t)for(var n=0;n<t.length;n++){var r=t[n];r.selected&&e.push(r.value)}return e}(t.target.options);default:return a}}(e,t.state.state&&t.state.state.value,i,p):e;t.state.state&&t.state.state.change(r?r(o,t.props.name):o)},onFocus:function(e){t.state.state&&t.state.state.focus()}}},b={"final-form":r.version,"react-final-form":"3.4.0"},v=r.formSubscriptionItems.reduce(function(t,e){return t[e]=!0,t},{}),y=function(t){function e(n){a(this,e);var i=f(this,t.call(this,n));i.notify=function(t){i.mounted&&i.setState({state:t}),i.mounted=!0},i.handleSubmit=function(t){return t&&"function"==typeof t.preventDefault&&t.preventDefault(),i.form.submit()};var o=n.debug,s=n.decorators,u=n.initialValues,c=n.mutators,l=n.onSubmit,p=n.subscription,m={debug:o,initialValues:u,mutators:c,onSubmit:l,validate:n.validate,validateOnBlur:n.validateOnBlur};i.mounted=!1;try{i.form=r.createForm(m)}catch(t){}if(i.unsubscriptions=[],i.form){var d={};i.form.subscribe(function(t){d=t},p||v)(),i.state={state:d}}return s&&s.forEach(function(t){i.unsubscriptions.push(t(i.form))}),i}return u(e,t),e.prototype.getChildContext=function(){return{reactFinalForm:this.form}},e.prototype.componentWillMount=function(){this.form&&this.form.pauseValidation()},e.prototype.componentDidMount=function(){this.form&&(this.unsubscriptions.push(this.form.subscribe(this.notify,this.props.subscription||v)),this.form.resumeValidation())},e.prototype.componentWillUpdate=function(){this.form&&this.form.pauseValidation()},e.prototype.componentDidUpdate=function(){this.form&&this.form.resumeValidation()},e.prototype.componentWillReceiveProps=function(t){var e=this;t.initialValues&&!function(t,e){if(t===e)return!0;if("object"!==(void 0===t?"undefined":o(t))||!t||"object"!==(void 0===e?"undefined":o(e))||!e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(e),a=0;a<n.length;a++){var s=n[a];if(!i(s)||t[s]!==e[s])return!1}return!0}(this.props.initialValues,t.initialValues)&&this.form.initialize(t.initialValues),["debug","mutators","onSubmit","validate","validateOnBlur"].forEach(function(n){e.props[n]!==t[n]&&e.form.setConfig&&e.form.setConfig(n,t[n])})},e.prototype.componentWillUnmount=function(){this.unsubscriptions.forEach(function(t){return t()})},e.prototype.render=function(){var t=this,e=this.props,n=(e.debug,e.initialValues,e.mutators,e.onSubmit,e.subscription,e.validate,e.validateOnBlur,c(e,["debug","initialValues","mutators","onSubmit","subscription","validate","validateOnBlur"])),r=s({},this.state?this.state.state:{},{batch:this.form&&function(e){return t.form.batch(e)},blur:this.form&&function(e){return t.form.blur(e)},change:this.form&&function(e,n){return t.form.change(e,n)},focus:this.form&&function(e){return t.form.focus(e)},form:this.form,handleSubmit:this.handleSubmit,initialize:this.form&&function(e){return t.form.initialize(e)},mutators:this.form&&Object.keys(this.form.mutators).reduce(function(e,n){return e[n]=function(){var e;(e=t.form.mutators)[n].apply(e,arguments)},e},{}),reset:this.form&&function(e){return t.form.reset(e)}});return l(s({},n,r,{__versions:b}))},e}(e.Component);y.childContextTypes={reactFinalForm:n.object};var g=function(t){function e(n,r){a(this,e);var i=f(this,t.call(this,n,r));i.subscribe=function(t,e){var n=t.subscription;i.unsubscribe=i.context.reactFinalForm.subscribe(e,n||v)},i.notify=function(t){i.setState({state:t}),i.props.onChange&&i.props.onChange(t)};var o=void 0;return i.context.reactFinalForm&&i.subscribe(n,function(t){o?i.notify(t):(o=t,n.onChange&&n.onChange(t))}),o&&(i.state={state:o}),i}return u(e,t),e.prototype.componentWillReceiveProps=function(t){var e=t.subscription;i(this.props.subscription,e,r.formSubscriptionItems)&&this.context.reactFinalForm&&(this.unsubscribe(),this.subscribe(t,this.notify))},e.prototype.componentWillUnmount=function(){this.unsubscribe()},e.prototype.render=function(){var t=this.props,e=t.onChange,n=(t.subscription,c(t,["onChange","subscription"])),r=this.context.reactFinalForm,i={batch:r&&function(t){return r.batch(t)},blur:r&&function(t){return r.blur(t)},change:r&&function(t,e){return r.change(t,e)},focus:r&&function(t){return r.focus(t)},form:r,initialize:r&&function(t){return r.initialize(t)},mutators:r&&Object.keys(r.mutators).reduce(function(t,e){return t[e]=function(){var t;(t=r.mutators)[e].apply(t,arguments)},t},{}),reset:r&&function(t){return r.reset(t)}};return e?null:l(s({},n,this.state?this.state.state:{},i))},e}(e.Component);g.contextTypes={reactFinalForm:n.object},t.Field=d,t.Form=y,t.version="3.4.0",t.FormSpy=g,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=react-final-form.umd.min.js.map |
{ | ||
"name": "react-final-form", | ||
"version": "3.3.1", | ||
"description": "🏁 High performance subscription-based form state management for React", | ||
"version": "3.4.0", | ||
"description": | ||
"🏁 High performance subscription-based form state management for React", | ||
"main": "dist/react-final-form.cjs.js", | ||
@@ -9,5 +10,3 @@ "jsnext:main": "dist/react-final-form.es.js", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"files": ["dist"], | ||
"scripts": { | ||
@@ -20,3 +19,4 @@ "start": "nps", | ||
}, | ||
"author": "Erik Rasmussen <rasmussenerik@gmail.com> (http://github.com/erikras)", | ||
"author": | ||
"Erik Rasmussen <rasmussenerik@gmail.com> (http://github.com/erikras)", | ||
"license": "MIT", | ||
@@ -32,4 +32,4 @@ "repository": { | ||
"devDependencies": { | ||
"@types/react": "^16.3.9", | ||
"babel-eslint": "^8.0.3", | ||
"@types/react": "^16.3.12", | ||
"babel-eslint": "^8.2.3", | ||
"babel-jest": "^22.4.3", | ||
@@ -45,9 +45,9 @@ "babel-plugin-external-helpers": "^6.22.0", | ||
"eslint-config-react-app": "^2.1.0", | ||
"eslint-plugin-babel": "^5.0.0", | ||
"eslint-plugin-flowtype": "^2.46.1", | ||
"eslint-plugin-babel": "^5.1.0", | ||
"eslint-plugin-flowtype": "^2.46.3", | ||
"eslint-plugin-import": "^2.11.0", | ||
"eslint-plugin-jsx-a11y": "^6.0.2", | ||
"eslint-plugin-react": "^7.7.0", | ||
"final-form": "^4.5.2", | ||
"flow-bin": "^0.69.0", | ||
"final-form": "^4.6.0", | ||
"flow-bin": "^0.70.0", | ||
"glow": "^1.2.2", | ||
@@ -60,9 +60,9 @@ "husky": "^0.14.3", | ||
"opencollective": "^1.0.3", | ||
"prettier": "^1.12.0", | ||
"prettier": "^1.12.1", | ||
"prettier-eslint-cli": "^4.7.1", | ||
"prop-types": "^15.6.1", | ||
"react": "^16.3.1", | ||
"react-dom": "^16.3.1", | ||
"rollup": "^0.57.1", | ||
"rollup-plugin-babel": "^3.0.2", | ||
"react": "^16.3.2", | ||
"react-dom": "^16.3.2", | ||
"rollup": "^0.58.1", | ||
"rollup-plugin-babel": "^3.0.4", | ||
"rollup-plugin-commonjs": "^9.1.0", | ||
@@ -82,6 +82,3 @@ "rollup-plugin-flow": "^1.1.1", | ||
"lint-staged": { | ||
"*.{js*,ts*,json,md,css}": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
"*.{js*,ts*,json,md,css}": ["prettier --write", "git add"] | ||
}, | ||
@@ -88,0 +85,0 @@ "bundlesize": [ |
@@ -176,3 +176,3 @@ # 🏁 React Final Form | ||
* [`meta.active?: boolean`](#metaactive-boolean) | ||
* [`meta.data: Object`](#metadata-object) | ||
* [`meta.data?: Object`](#metadata-object) | ||
* [`meta.dirty?: boolean`](#metadirty-boolean) | ||
@@ -532,3 +532,3 @@ * [`meta.error?: any`](#metaerror-any) | ||
#### `meta.data: Object` | ||
#### `meta.data?: Object` | ||
@@ -535,0 +535,0 @@ [See the 🏁 Final Form docs on `data`](https://github.com/final-form/final-form#data-object). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
139721
2128