Comparing version 0.8.1 to 0.8.2
@@ -80,5 +80,5 @@ import { Component, createElement } from 'react'; | ||
if (propIsEnumerable.call(sourceComponent, key) || | ||
typeof targetComponent[key] === 'function') { | ||
typeof sourceComponent[key] === 'function') { | ||
try { | ||
targetComponent[key] = targetComponent[key]; | ||
targetComponent[key] = sourceComponent[key]; | ||
} | ||
@@ -85,0 +85,0 @@ catch (e) { } |
@@ -83,5 +83,5 @@ 'use strict'; | ||
if (propIsEnumerable.call(sourceComponent, key) || | ||
typeof targetComponent[key] === 'function') { | ||
typeof sourceComponent[key] === 'function') { | ||
try { | ||
targetComponent[key] = targetComponent[key]; | ||
targetComponent[key] = sourceComponent[key]; | ||
} | ||
@@ -88,0 +88,0 @@ catch (e) { } |
@@ -83,5 +83,5 @@ (function (global, factory) { | ||
if (propIsEnumerable.call(sourceComponent, key) || | ||
typeof targetComponent[key] === 'function') { | ||
typeof sourceComponent[key] === 'function') { | ||
try { | ||
targetComponent[key] = targetComponent[key]; | ||
targetComponent[key] = sourceComponent[key]; | ||
} | ||
@@ -88,0 +88,0 @@ catch (e) { } |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(t.Formik={},t.React)}(this,function(t,e){"use strict";function r(t,e){function r(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function n(t){return null!==t&&"object"==typeof t&&(t&&"function"==typeof t.then)}function o(t,e,r){if("string"!=typeof e){if(m){var n=p(e);n&&n!==m&&o(t,n,r)}var a=v(e);h&&(a=a.concat(h(e)));for(var s=0;s<a.length;++s){var i=a[s];if(!(d[i]||r&&r[i])&&(f.call(e,i)||"function"==typeof t[i]))try{t[i]=t[i]}catch(t){}}return t}return t}function a(t){for(var e={},r=0,n=t.inner;r<n.length;r++){var o=n[r];e[o.path]||(e[o.path]=o.message)}return e}function s(t,e){var r={};for(var n in t)if(t.hasOwnProperty(n)){var o=String(n);r[o]=""!==t[o]?t[o]:void 0}return e.validate(r,{abortEarly:!1})}function i(t){for(var e={},r=0,n=Object.keys(t);r<n.length;r++)e[n[r]]=!0;return e}var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},l=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},c="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,d={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},h=Object.getOwnPropertySymbols,f=Object.prototype.propertyIsEnumerable,p=Object.getPrototypeOf,m=p&&p(Object),v=Object.getOwnPropertyNames;t.Formik=function(t){var u=t.displayName,d=t.mapPropsToValues,h=void 0===d?function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&"function"!=typeof t[r]&&(e[r]=t[r]);return e}:d,f=t.mapValuesToPayload,p=t.validate,m=t.validationSchema,v=t.handleSubmit,S=t.validateOnChange,b=void 0!==S&&S,g=t.validateOnBlur,y=void 0===g||g;return function(t){var d=function(o){function u(t){var e=o.call(this,t)||this;return e.setErrors=function(t){e.setState({errors:t})},e.setTouched=function(t){e.setState({touched:t}),y&&e.runValidations(e.state.values)},e.setValues=function(t){e.setState({values:t}),b&&e.runValidations(t)},e.setStatus=function(t){e.setState({status:t})},e.setError=function(t){e.setState({error:t})},e.setSubmitting=function(t){e.setState({isSubmitting:t})},e.runValidationSchema=function(t,r){s(t,m).then(function(){e.setState({errors:{}}),r&&r()},function(t){return e.setState({errors:a(t),isSubmitting:!1})})},e.runValidations=function(t){if(p){var r=p(t,e.props);n(r)?p(t,e.props).then(function(){e.setState({errors:{}})},function(t){return e.setState({errors:t,isSubmitting:!1})}):e.setErrors(r)}m&&e.runValidationSchema(t)},e.handleChange=function(t){if(c)console.error("Warning: Formik's handleChange does not work with React Native. Use setFieldValue and within a callback instead. For more info see https://github.com/jaredpalmer/formikhttps://github.com/jaredpalmer/formik#react-native");else{t.persist();var r=t.target,n=r.type,o=r.name,a=r.id,s=r.value,i=r.checked,u=(r.outerHTML,o||a),d=/number|range/.test(n)?parseFloat(s):/checkbox/.test(n)?i:s;e.setState(function(t){return l({},t,{values:l({},t.values,(e={},e[u]=d,e))});var e}),b&&e.runValidations(l({},e.state.values,(h={},h[u]=s,h)));var h}},e.handleChangeValue=function(t,r){e.setState(function(e){return l({},e,{values:l({},e.values,(n={},n[t]=r,n)),touched:l({},e.touched,(o={},o[t]=!0,o))});var n,o}),e.runValidationSchema(l({},e.state.values,(n={},n[t]=r,n)));var n},e.setFieldValue=function(t,r){e.setState(function(e){return l({},e,{values:l({},e.values,(n={},n[t]=r,n))});var n}),b&&e.runValidations(l({},e.state.values,(n={},n[t]=r,n)));var n},e.handleSubmit=function(t){t.preventDefault(),e.submitForm()},e.submitForm=function(){if(e.setState({touched:i(e.state.values),isSubmitting:!0}),p){var t=p(e.state.values,e.props)||{};if(n(t))return void p(e.state.values,e.props).then(function(){e.setState({errors:{}}),e.executeSubmit()},function(t){return e.setState({errors:t,isSubmitting:!1})});e.setState({errors:t,isSubmitting:Object.keys(t).length>0}),0===Object.keys(t).length&&e.executeSubmit()}else m?e.runValidationSchema(e.state.values,e.executeSubmit):e.executeSubmit()},e.executeSubmit=function(){var t=f?f(e.state.values):e.state.values;v(t,{setStatus:e.setStatus,setTouched:e.setTouched,setErrors:e.setErrors,setError:e.setError,setValues:e.setValues,setFieldError:e.setFieldError,setFieldValue:e.setFieldValue,setFieldTouched:e.setFieldTouched,setSubmitting:e.setSubmitting,resetForm:e.resetForm,submitForm:e.submitForm,props:e.props})},e.handleBlur=function(t){if(c)console.error("Warning: Formik's handleBlur does not work with React Native. Use setFieldTouched(field, isTouched) within a callback instead. For more info see https://github.com/jaredpalmer/formik#setfieldtouched-field-string-istouched-boolean--void");else{t.persist();var r=t.target,n=r.name,o=r.id,a=n||o;e.setState(function(t){return{touched:l({},t.touched,(e={},e[a]=!0,e))};var e}),y&&e.runValidations(e.state.values)}},e.setFieldTouched=function(t,r){void 0===r&&(r=!0),e.setState(function(e){return l({},e,{touched:l({},e.touched,(n={},n[t]=r,n))});var n}),y&&e.runValidations(e.state.values)},e.setFieldError=function(t,r){e.setState(function(e){return l({},e,{errors:l({},e.errors,(n={},n[t]=r,n))});var n})},e.resetForm=function(t){e.setState({isSubmitting:!1,errors:{},touched:{},error:void 0,values:h(t||e.props)})},e.handleReset=function(){e.setState({isSubmitting:!1,errors:{},touched:{},error:void 0,values:h(e.props)})},e.state={values:h(t),errors:{},touched:{},isSubmitting:!1},f&&console.warn("Warning: Formik's mapValuesToPayload is deprecated and may be removed in future releases. Move that function to the first line of `handleSubmit` instead."),e}return r(u,o),u.prototype.render=function(){return e.createElement(t,l({},this.props,this.state,{dirty:Object.values(this.state.touched).filter(Boolean).length>0,setStatus:this.setStatus,setError:this.setError,setFieldError:this.setFieldError,setErrors:this.setErrors,setSubmitting:this.setSubmitting,setTouched:this.setTouched,setFieldTouched:this.setFieldTouched,setValues:this.setValues,setFieldValue:this.setFieldValue,resetForm:this.resetForm,submitForm:this.submitForm,handleReset:this.handleReset,handleSubmit:this.handleSubmit,handleChange:this.handleChange,handleBlur:this.handleBlur,handleChangeValue:this.handleChangeValue}))},u}(e.Component);return d.displayName="Formik("+(u||t.displayName||t.name||"Component")+")",d.WrappedComponent=t,o(d,t)}},t.yupToFormErrors=a,t.validateYupSchema=s,t.touchAllFields=i,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(t.Formik={},t.React)}(this,function(t,e){"use strict";function r(t,e){function r(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function n(t){return null!==t&&"object"==typeof t&&(t&&"function"==typeof t.then)}function o(t,e,r){if("string"!=typeof e){if(m){var n=p(e);n&&n!==m&&o(t,n,r)}var a=v(e);h&&(a=a.concat(h(e)));for(var s=0;s<a.length;++s){var i=a[s];if(!(d[i]||r&&r[i])&&(f.call(e,i)||"function"==typeof e[i]))try{t[i]=e[i]}catch(t){}}return t}return t}function a(t){for(var e={},r=0,n=t.inner;r<n.length;r++){var o=n[r];e[o.path]||(e[o.path]=o.message)}return e}function s(t,e){var r={};for(var n in t)if(t.hasOwnProperty(n)){var o=String(n);r[o]=""!==t[o]?t[o]:void 0}return e.validate(r,{abortEarly:!1})}function i(t){for(var e={},r=0,n=Object.keys(t);r<n.length;r++)e[n[r]]=!0;return e}var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},l=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},c="undefined"!=typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product,d={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},h=Object.getOwnPropertySymbols,f=Object.prototype.propertyIsEnumerable,p=Object.getPrototypeOf,m=p&&p(Object),v=Object.getOwnPropertyNames;t.Formik=function(t){var u=t.displayName,d=t.mapPropsToValues,h=void 0===d?function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&"function"!=typeof t[r]&&(e[r]=t[r]);return e}:d,f=t.mapValuesToPayload,p=t.validate,m=t.validationSchema,v=t.handleSubmit,S=t.validateOnChange,b=void 0!==S&&S,g=t.validateOnBlur,y=void 0===g||g;return function(t){var d=function(o){function u(t){var e=o.call(this,t)||this;return e.setErrors=function(t){e.setState({errors:t})},e.setTouched=function(t){e.setState({touched:t}),y&&e.runValidations(e.state.values)},e.setValues=function(t){e.setState({values:t}),b&&e.runValidations(t)},e.setStatus=function(t){e.setState({status:t})},e.setError=function(t){e.setState({error:t})},e.setSubmitting=function(t){e.setState({isSubmitting:t})},e.runValidationSchema=function(t,r){s(t,m).then(function(){e.setState({errors:{}}),r&&r()},function(t){return e.setState({errors:a(t),isSubmitting:!1})})},e.runValidations=function(t){if(p){var r=p(t,e.props);n(r)?p(t,e.props).then(function(){e.setState({errors:{}})},function(t){return e.setState({errors:t,isSubmitting:!1})}):e.setErrors(r)}m&&e.runValidationSchema(t)},e.handleChange=function(t){if(c)console.error("Warning: Formik's handleChange does not work with React Native. Use setFieldValue and within a callback instead. For more info see https://github.com/jaredpalmer/formikhttps://github.com/jaredpalmer/formik#react-native");else{t.persist();var r=t.target,n=r.type,o=r.name,a=r.id,s=r.value,i=r.checked,u=(r.outerHTML,o||a),d=/number|range/.test(n)?parseFloat(s):/checkbox/.test(n)?i:s;e.setState(function(t){return l({},t,{values:l({},t.values,(e={},e[u]=d,e))});var e}),b&&e.runValidations(l({},e.state.values,(h={},h[u]=s,h)));var h}},e.handleChangeValue=function(t,r){e.setState(function(e){return l({},e,{values:l({},e.values,(n={},n[t]=r,n)),touched:l({},e.touched,(o={},o[t]=!0,o))});var n,o}),e.runValidationSchema(l({},e.state.values,(n={},n[t]=r,n)));var n},e.setFieldValue=function(t,r){e.setState(function(e){return l({},e,{values:l({},e.values,(n={},n[t]=r,n))});var n}),b&&e.runValidations(l({},e.state.values,(n={},n[t]=r,n)));var n},e.handleSubmit=function(t){t.preventDefault(),e.submitForm()},e.submitForm=function(){if(e.setState({touched:i(e.state.values),isSubmitting:!0}),p){var t=p(e.state.values,e.props)||{};if(n(t))return void p(e.state.values,e.props).then(function(){e.setState({errors:{}}),e.executeSubmit()},function(t){return e.setState({errors:t,isSubmitting:!1})});e.setState({errors:t,isSubmitting:Object.keys(t).length>0}),0===Object.keys(t).length&&e.executeSubmit()}else m?e.runValidationSchema(e.state.values,e.executeSubmit):e.executeSubmit()},e.executeSubmit=function(){var t=f?f(e.state.values):e.state.values;v(t,{setStatus:e.setStatus,setTouched:e.setTouched,setErrors:e.setErrors,setError:e.setError,setValues:e.setValues,setFieldError:e.setFieldError,setFieldValue:e.setFieldValue,setFieldTouched:e.setFieldTouched,setSubmitting:e.setSubmitting,resetForm:e.resetForm,submitForm:e.submitForm,props:e.props})},e.handleBlur=function(t){if(c)console.error("Warning: Formik's handleBlur does not work with React Native. Use setFieldTouched(field, isTouched) within a callback instead. For more info see https://github.com/jaredpalmer/formik#setfieldtouched-field-string-istouched-boolean--void");else{t.persist();var r=t.target,n=r.name,o=r.id,a=n||o;e.setState(function(t){return{touched:l({},t.touched,(e={},e[a]=!0,e))};var e}),y&&e.runValidations(e.state.values)}},e.setFieldTouched=function(t,r){void 0===r&&(r=!0),e.setState(function(e){return l({},e,{touched:l({},e.touched,(n={},n[t]=r,n))});var n}),y&&e.runValidations(e.state.values)},e.setFieldError=function(t,r){e.setState(function(e){return l({},e,{errors:l({},e.errors,(n={},n[t]=r,n))});var n})},e.resetForm=function(t){e.setState({isSubmitting:!1,errors:{},touched:{},error:void 0,values:h(t||e.props)})},e.handleReset=function(){e.setState({isSubmitting:!1,errors:{},touched:{},error:void 0,values:h(e.props)})},e.state={values:h(t),errors:{},touched:{},isSubmitting:!1},f&&console.warn("Warning: Formik's mapValuesToPayload is deprecated and may be removed in future releases. Move that function to the first line of `handleSubmit` instead."),e}return r(u,o),u.prototype.render=function(){return e.createElement(t,l({},this.props,this.state,{dirty:Object.values(this.state.touched).filter(Boolean).length>0,setStatus:this.setStatus,setError:this.setError,setFieldError:this.setFieldError,setErrors:this.setErrors,setSubmitting:this.setSubmitting,setTouched:this.setTouched,setFieldTouched:this.setFieldTouched,setValues:this.setValues,setFieldValue:this.setFieldValue,resetForm:this.resetForm,submitForm:this.submitForm,handleReset:this.handleReset,handleSubmit:this.handleSubmit,handleChange:this.handleChange,handleBlur:this.handleBlur,handleChangeValue:this.handleChangeValue}))},u}(e.Component);return d.displayName="Formik("+(u||t.displayName||t.name||"Component")+")",d.WrappedComponent=t,o(d,t)}},t.yupToFormErrors=a,t.validateYupSchema=s,t.touchAllFields=i,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=formik.umd.min.js.map |
{ | ||
"name": "formik", | ||
"description": "Forms in React, without tears", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": "Jared Palmer <jared@palmer.net>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package