From 9a4429a0f27d9a803d96c7958bee9812acc84610 Mon Sep 17 00:00:00 2001 From: Robert Kuykendall Date: Wed, 22 Nov 2017 09:01:36 -0500 Subject: [PATCH] 1.1.1 --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- release/formsy-react.js | 2 +- release/formsy-react.js.map | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b23600c7..9049ff12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ + +# [1.1.1](https://github.com/formsy/formsy-react/compare/v1.1.0...v1.1.1) (2017-11-22) + +### Bug Fixes + +* **email validation:** Fix email validation broken for new domains ([f8dc5f](https://github.com/formsy/formsy-react/commit/f8dc5f)) +* **hoc binding:** Bind all necessary methods of the HOC ([5ea795](https://github.com/formsy/formsy-react/commit/5ea795)) + +### Features + +* **changelog:** Changelog with conventional-commits ([#26](https://github.com/formsy/formsy-react/issues/26)) ([d6ce00c](https://github.com/formsy/formsy-react/commit/d6ce00c)) + # [1.1.0](https://github.com/formsy/formsy-react/compare/v1.0.2...v1.1.0) (2017-11-21) diff --git a/package.json b/package.json index 4a798e01..11dae8c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "formsy-react", - "version": "1.1.0", + "version": "1.1.1", "description": "A form input builder and validator for React", "keywords": [ "form", diff --git a/release/formsy-react.js b/release/formsy-react.js index 526a46e4..15d9d402 100644 --- a/release/formsy-react.js +++ b/release/formsy-react.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.Formsy=t(require("react")):e.Formsy=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,r){e.exports=r(5)()},function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default={arraysDiffer:function(e,t){var r=this,n=!1;return e.length!==t.length?n=!0:e.forEach(function(e,i){r.isSame(e,t[i])||(n=!0)},this),n},objectsDiffer:function(e,t){var r=this,n=!1;return Object.keys(e).length!==Object.keys(t).length?n=!0:Object.keys(e).forEach(function(i){r.isSame(e[i],t[i])||(n=!0)},this),n},isSame:function(e,t){return(void 0===e?"undefined":n(e))===(void 0===t?"undefined":n(t))&&(Array.isArray(e)&&Array.isArray(t)?!this.arraysDiffer(e,t):"function"==typeof e?e.toString()===t.toString():"object"===(void 0===e?"undefined":n(e))&&null!==e&&null!==t?!this.objectsDiffer(e,t):e===t)},find:function(e,t){for(var r=0,n=e.length;r=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Wrapper=t.withFormsy=t.validationRules=t.propTypes=t.addValidationRule=void 0;var u=Object.assign||function(e){for(var t=1;t0&&this.setInputValidationErrors(this.props.validationErrors);var e=this.inputs.map(function(e){return e.props.name});b.default.arraysDiffer(this.prevInputNames,e)&&this.validateForm()}},{key:"getCurrentValues",value:function(){return this.inputs.reduce(function(e,t){var r=t.props.name,n=Object.assign({},e);return n[r]=t.state.value,n},{})}},{key:"getModel",value:function(){var e=this.getCurrentValues();return this.mapModel(e)}},{key:"getPristineValues",value:function(){return this.inputs.reduce(function(e,t){var r=t.props.name,n=Object.assign({},e);return n[r]=t.props.value,n},{})}},{key:"setFormPristine",value:function(e){this.setState({formSubmitted:!e}),this.inputs.forEach(function(t){t.setState({formSubmitted:!e,isPristine:e})})}},{key:"setInputValidationErrors",value:function(e){this.inputs.forEach(function(t){var r=t.props.name,n=[{isValid:!(r in e),validationError:"string"==typeof e[r]?[e[r]]:e[r]}];t.setState.apply(t,n)})}},{key:"isFormDisabled",value:function(){return this.props.disabled}},{key:"mapModel",value:function(e){return this.props.mapping?this.props.mapping(e):c.default.toObj(Object.keys(e).reduce(function(t,r){for(var n=r.split("."),i=t;n.length;){var o=n.shift();i[o]=n.length?i[o]||{}:e[r],i=i[o]}return t},{}))}},{key:"reset",value:function(e){this.setFormPristine(!0),this.resetModel(e)}},{key:"resetInternal",value:function(e){e.preventDefault(),this.reset(),this.props.onReset&&this.props.onReset()}},{key:"resetModel",value:function(e){this.inputs.forEach(function(t){var r=t.props.name;e&&Object.prototype.hasOwnProperty.call(e,r)?t.setValue(e[r]):t.resetValue()}),this.validateForm()}},{key:"runValidation",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.state.value,n=this.getCurrentValues(),i=e.props.validationErrors,o=e.props.validationError,a=b.default.runRules(r,n,e.validations,V.default),s=b.default.runRules(r,n,e.requiredValidations,V.default),u=!!Object.keys(e.requiredValidations).length&&!!s.success.length,l=!(a.failed.length||this.props.validationErrors&&this.props.validationErrors[e.props.name]);return{isRequired:u,isValid:!u&&l,error:function(){if(l&&!u)return[];if(a.errors.length)return a.errors;if(t.props.validationErrors&&t.props.validationErrors[e.props.name])return"string"==typeof t.props.validationErrors[e.props.name]?[t.props.validationErrors[e.props.name]]:t.props.validationErrors[e.props.name];if(u){var r=i[s.success[0]];return r?[r]:null}return a.failed.length?a.failed.map(function(e){return i[e]?i[e]:o}).filter(function(e,t,r){return r.indexOf(e)===t}):void 0}()}}},{key:"attachToForm",value:function(e){-1===this.inputs.indexOf(e)&&this.inputs.push(e),this.validate(e)}},{key:"detachFromForm",value:function(e){var t=this.inputs.indexOf(e);-1!==t&&(this.inputs=this.inputs.slice(0,t).concat(this.inputs.slice(t+1))),this.validateForm()}},{key:"isChanged",value:function(){return!b.default.isSame(this.getPristineValues(),this.getCurrentValues())}},{key:"submit",value:function(e){e&&e.preventDefault&&e.preventDefault(),this.setFormPristine(!1);var t=this.getModel();this.props.onSubmit(t,this.resetModel,this.updateInputsWithError),this.state.isValid?this.props.onValidSubmit(t,this.resetModel,this.updateInputsWithError):this.props.onInvalidSubmit(t,this.resetModel,this.updateInputsWithError)}},{key:"updateInputsWithError",value:function(e){var t=this;Object.keys(e).forEach(function(r){var n=b.default.find(t.inputs,function(e){return e.props.name===r});if(!n)throw new Error("You are trying to update an input that does not exist. Verify errors object with input names. "+JSON.stringify(e));var i=[{isValid:t.props.preventExternalInvalidation,externalError:"string"==typeof e[r]?[e[r]]:e[r]}];n.setState.apply(n,i)})}},{key:"validate",value:function(e){this.state.canChange&&this.props.onChange(this.getCurrentValues(),this.isChanged());var t=this.runValidation(e);e.setState({isValid:t.isValid,isRequired:t.isRequired,validationError:t.error,externalError:null},this.validateForm)}},{key:"validateForm",value:function(){var e=this,t=function(){var t=e.inputs.every(function(e){return e.state.isValid});e.setState({isValid:t}),t?e.props.onValid():e.props.onInvalid(),e.setState({canChange:!0})};this.inputs.forEach(function(r,n){var i=e.runValidation(r);i.isValid&&r.state.externalError&&(i.isValid=!1),r.setState({isValid:i.isValid,isRequired:i.isRequired,validationError:i.error,externalError:!i.isValid&&r.state.externalError?r.state.externalError:null},n===e.inputs.length-1?t:null)}),this.inputs.length||this.setState({canChange:!0})}},{key:"render",value:function(){var e=this.props,t=(e.getErrorMessage,e.getErrorMessages,e.getValue,e.hasValue,e.isFormDisabled,e.isFormSubmitted,e.isPristine,e.isRequired,e.isValid,e.isValidValue,e.mapping,e.onChange,e.onInvalidSubmit,e.onInvalid,e.onReset,e.onSubmit,e.onValid,e.onValidSubmit,e.preventExternalInvalidation,e.resetValue,e.setValidations,e.setValue,e.showError,e.showRequired,e.validationErrors,i(e,["getErrorMessage","getErrorMessages","getValue","hasValue","isFormDisabled","isFormSubmitted","isPristine","isRequired","isValid","isValidValue","mapping","onChange","onInvalidSubmit","onInvalid","onReset","onSubmit","onValid","onValidSubmit","preventExternalInvalidation","resetValue","setValidations","setValue","showError","showRequired","validationErrors"]));return m.default.createElement("form",u({onReset:this.resetInternal,onSubmit:this.submit},t),this.props.children)}}]),t}(m.default.Component);S.displayName="Formsy",S.defaultProps={children:null,disabled:!1,getErrorMessage:function(){},getErrorMessages:function(){},getValue:function(){},hasValue:function(){},isFormDisabled:function(){},isFormSubmitted:function(){},isPristine:function(){},isRequired:function(){},isValid:function(){},isValidValue:function(){},mapping:null,onChange:function(){},onError:function(){},onInvalid:function(){},onInvalidSubmit:function(){},onReset:function(){},onSubmit:function(){},onValid:function(){},onValidSubmit:function(){},preventExternalInvalidation:!1,resetValue:function(){},setValidations:function(){},setValue:function(){},showError:function(){},showRequired:function(){},validationErrors:null},S.propTypes={children:h.default.node,disabled:h.default.bool,getErrorMessage:h.default.func,getErrorMessages:h.default.func,getValue:h.default.func,hasValue:h.default.func,isFormDisabled:h.default.func,isFormSubmitted:h.default.func,isPristine:h.default.func,isRequired:h.default.func,isValid:h.default.func,isValidValue:h.default.func,mapping:h.default.func,preventExternalInvalidation:h.default.bool,onChange:h.default.func,onInvalid:h.default.func,onInvalidSubmit:h.default.func,onReset:h.default.func,onSubmit:h.default.func,onValid:h.default.func,onValidSubmit:h.default.func,resetValue:h.default.func,setValidations:h.default.func,setValue:h.default.func,showError:h.default.func,showRequired:h.default.func,validationErrors:h.default.object},S.childContextTypes={formsy:h.default.object};var F=function(e,t){V.default[e]=t},O=R.default,w=function(e){return console.warn("Wrapper has been renamed to withFormsy. Importing Wrapper from formsy-react is depreacted and will be removed in the future. Please rename your Wrapper imports to withFormsy."),O(e)};t.addValidationRule=F,t.propTypes=E.propTypes,t.validationRules=V.default,t.withFormsy=O,t.Wrapper=w,t.default=S},function(e,t){function r(e){return Object.keys(e).reduce(function(t,r){var n=r.match(/[^\[]*/i),i=r.match(/\[.*?\]/g)||[];i=[n[0]].concat(i).map(function(e){return e.replace(/\[|\]/g,"")});for(var o=t;i.length;){var a=i.shift();a in o?o=o[a]:(o[a]=i.length?isNaN(i[0])?{}:[]:e[r],o=o[a])}return t},{})}function n(e){function t(e,r,n){return Array.isArray(n)||"[object Object]"===Object.prototype.toString.call(n)?(Object.keys(n).forEach(function(i){t(e,r+"["+i+"]",n[i])}),e):(e[r]=n,e)}return Object.keys(e).reduce(function(r,n){return t(r,n,e[n])},{})}e.exports={fromObj:n,toObj:r}},function(e,t,r){"use strict";var n=r(6),i=r(7),o=r(8);e.exports=function(){function e(e,t,r,n,a,s){s!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){"use strict";function n(e){return function(){return e}}var i=function(){};i.thatReturns=n,i.thatReturnsFalse=n(!1),i.thatReturnsTrue=n(!0),i.thatReturnsNull=n(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t,r){"use strict";function n(e,t,r,n,o,a,s,u){if(i(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[r,n,o,a,s,u],d=0;l=new Error(t.replace(/%s/g,function(){return f[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var i=function(e){};e.exports=n},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return null!==e&&void 0!==e},i=function(e){return""===e},o={isDefaultRequiredValue:function(e,t){return void 0===t||""===t},isExisty:function(e,t){return n(t)},matchRegexp:function(e,t,r){return!n(t)||i(t)||r.test(t)},isUndefined:function(e,t){return void 0===t},isEmptyString:function(e,t){return i(t)},isEmail:function(e,t){return o.matchRegexp(e,t,/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i)},isUrl:function(e,t){return o.matchRegexp(e,t,/^(?:\w+:)?\/\/([^\s.]+\.\S{2}|localhost[:?\d]*)\S*$/i)},isTrue:function(e,t){return!0===t},isFalse:function(e,t){return!1===t},isNumeric:function(e,t){return"number"==typeof t||o.matchRegexp(e,t,/^[-+]?(?:\d*[.])?\d+$/)},isAlpha:function(e,t){return o.matchRegexp(e,t,/^[A-Z]+$/i)},isAlphanumeric:function(e,t){return o.matchRegexp(e,t,/^[0-9A-Z]+$/i)},isInt:function(e,t){return o.matchRegexp(e,t,/^(?:[-+]?(?:0|[1-9]\d*))$/)},isFloat:function(e,t){return o.matchRegexp(e,t,/^(?:[-+]?(?:\d+))?(?:\.\d*)?(?:[eE][+-]?(?:\d+))?$/)},isWords:function(e,t){return o.matchRegexp(e,t,/^[A-Z\s]+$/i)},isSpecialWords:function(e,t){return o.matchRegexp(e,t,/^[A-Z\s\u00C0-\u017F]+$/i)},isLength:function(e,t,r){return!n(t)||i(t)||t.length===r},equals:function(e,t,r){return!n(t)||i(t)||t===r},equalsField:function(e,t,r){return t===e[r]},maxLength:function(e,t,r){return!n(t)||t.length<=r},minLength:function(e,t,r){return!n(t)||i(t)||t.length>=r}};t.default=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.propTypes=void 0;var s=Object.assign||function(e){for(var t=1;t1)throw new Error("Formsy does not support multiple args on string validations. Use object format of validations instead.");var i=Object.assign({},e);return i[n]=!r.length||r[0],i},{}):e||{}},m={innerRef:f.default.func,name:f.default.string.isRequired,required:f.default.bool,validations:f.default.oneOfType([f.default.object,f.default.string]),value:f.default.any};t.propTypes=m,t.default=function(e){var t=function(t){function r(e){i(this,r);var t=o(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.state={value:e.value,isRequired:!1,isValid:!0,isPristine:!0,pristineValue:e.value,validationError:[],externalError:null,formSubmitted:!1},t.getErrorMessage=t.getErrorMessage.bind(t),t.getErrorMessages=t.getErrorMessages.bind(t),t.getValue=t.getValue.bind(t),t.isFormDisabled=t.isFormDisabled.bind(t),t.isPristine=t.isPristine.bind(t),t.isRequired=t.isRequired.bind(t),t.isValid=t.isValid.bind(t),t.resetValue=t.resetValue.bind(t),t.setValue=t.setValue.bind(t),t.showRequired=t.showRequired.bind(t),t}return a(r,t),u(r,[{key:"componentWillMount",value:function(){var e=this;if(!this.props.name)throw new Error("Form Input requires a name property when used");!function(){e.setValidations(e.props.validations,e.props.required),e.context.formsy.attachToForm(e)}()}},{key:"componentWillReceiveProps",value:function(e){this.setValidations(e.validations,e.required)}},{key:"componentDidUpdate",value:function(e){h.default.isSame(this.props.value,e.value)||this.setValue(this.props.value),h.default.isSame(this.props.validations,e.validations)&&h.default.isSame(this.props.required,e.required)||this.context.formsy.validate(this)}},{key:"componentWillUnmount",value:function(){this.context.formsy.detachFromForm(this)}},{key:"getErrorMessage",value:function(){var e=this.getErrorMessages();return e.length?e[0]:null}},{key:"getErrorMessages",value:function(){return!this.isValid()||this.showRequired()?this.state.externalError||this.state.validationError||[]:[]}},{key:"getValue",value:function(){return this.state.value}},{key:"setValidations",value:function(e,t){this.validations=v(e)||{},this.requiredValidations=!0===t?{isDefaultRequiredValue:!0}:v(t)}},{key:"setValue",value:function(e){var t=this;arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?this.setState({value:e}):this.setState({value:e,isPristine:!1},function(){t.context.formsy.validate(t)})}},{key:"hasValue",value:function(){return""!==this.state.value}},{key:"isFormDisabled",value:function(){return this.context.formsy.isFormDisabled()}},{key:"isFormSubmitted",value:function(){return this.state.formSubmitted}},{key:"isPristine",value:function(){return this.state.isPristine}},{key:"isRequired",value:function(){return!!this.props.required}},{key:"isValid",value:function(){return this.state.isValid}},{key:"isValidValue",value:function(e){return this.context.formsy.isValidValue.call(null,this,e)}},{key:"resetValue",value:function(){var e=this;this.setState({value:this.state.pristineValue,isPristine:!0},function(){e.context.formsy.validate(e)})}},{key:"showError",value:function(){return!this.showRequired()&&!this.isValid()}},{key:"showRequired",value:function(){return this.state.isRequired}},{key:"render",value:function(){var t=this.props.innerRef,r=s({getErrorMessage:this.getErrorMessage,getErrorMessages:this.getErrorMessages,getValue:this.getValue,hasValue:this.hasValue,isFormDisabled:this.isFormDisabled,isValid:this.isValid,isPristine:this.isPristine,isFormSubmitted:this.isFormSubmitted,isRequired:this.isRequired,isValidValue:this.isValidValue,resetValue:this.resetValue,setValidations:this.setValidations,setValue:this.setValue,showRequired:this.showRequired,showError:this.showError},this.props);return t&&(r.ref=t),c.default.createElement(e,r)}}]),r}(c.default.Component);return t.displayName="Formsy("+function(e){return e.displayName||e.name||("string"==typeof e?e:"Component")}(e)+")",t.contextTypes={formsy:f.default.object},t.defaultProps={innerRef:function(){},required:!1,validationError:"",validationErrors:{},validations:null,value:e.defaultValue},t.propTypes=m,t}}])}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.Formsy=t(require("react")):e.Formsy=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,r){e.exports=r(5)()},function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default={arraysDiffer:function(e,t){var r=this,n=!1;return e.length!==t.length?n=!0:e.forEach(function(e,i){r.isSame(e,t[i])||(n=!0)},this),n},objectsDiffer:function(e,t){var r=this,n=!1;return Object.keys(e).length!==Object.keys(t).length?n=!0:Object.keys(e).forEach(function(i){r.isSame(e[i],t[i])||(n=!0)},this),n},isSame:function(e,t){return(void 0===e?"undefined":n(e))===(void 0===t?"undefined":n(t))&&(Array.isArray(e)&&Array.isArray(t)?!this.arraysDiffer(e,t):"function"==typeof e?e.toString()===t.toString():"object"===(void 0===e?"undefined":n(e))&&null!==e&&null!==t?!this.objectsDiffer(e,t):e===t)},find:function(e,t){for(var r=0,n=e.length;r=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Wrapper=t.withFormsy=t.validationRules=t.propTypes=t.addValidationRule=void 0;var u=Object.assign||function(e){for(var t=1;t0&&this.setInputValidationErrors(this.props.validationErrors);var e=this.inputs.map(function(e){return e.props.name});b.default.arraysDiffer(this.prevInputNames,e)&&this.validateForm()}},{key:"getCurrentValues",value:function(){return this.inputs.reduce(function(e,t){var r=t.props.name,n=Object.assign({},e);return n[r]=t.state.value,n},{})}},{key:"getModel",value:function(){var e=this.getCurrentValues();return this.mapModel(e)}},{key:"getPristineValues",value:function(){return this.inputs.reduce(function(e,t){var r=t.props.name,n=Object.assign({},e);return n[r]=t.props.value,n},{})}},{key:"setFormPristine",value:function(e){this.setState({formSubmitted:!e}),this.inputs.forEach(function(t){t.setState({formSubmitted:!e,isPristine:e})})}},{key:"setInputValidationErrors",value:function(e){this.inputs.forEach(function(t){var r=t.props.name,n=[{isValid:!(r in e),validationError:"string"==typeof e[r]?[e[r]]:e[r]}];t.setState.apply(t,n)})}},{key:"isFormDisabled",value:function(){return this.props.disabled}},{key:"mapModel",value:function(e){return this.props.mapping?this.props.mapping(e):d.default.toObj(Object.keys(e).reduce(function(t,r){for(var n=r.split("."),i=t;n.length;){var o=n.shift();i[o]=n.length?i[o]||{}:e[r],i=i[o]}return t},{}))}},{key:"reset",value:function(e){this.setFormPristine(!0),this.resetModel(e)}},{key:"resetInternal",value:function(e){e.preventDefault(),this.reset(),this.props.onReset&&this.props.onReset()}},{key:"resetModel",value:function(e){this.inputs.forEach(function(t){var r=t.props.name;e&&Object.prototype.hasOwnProperty.call(e,r)?t.setValue(e[r]):t.resetValue()}),this.validateForm()}},{key:"runValidation",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.state.value,n=this.getCurrentValues(),i=e.props.validationErrors,o=e.props.validationError,a=b.default.runRules(r,n,e.validations,V.default),s=b.default.runRules(r,n,e.requiredValidations,V.default),u=!!Object.keys(e.requiredValidations).length&&!!s.success.length,l=!(a.failed.length||this.props.validationErrors&&this.props.validationErrors[e.props.name]);return{isRequired:u,isValid:!u&&l,error:function(){if(l&&!u)return[];if(a.errors.length)return a.errors;if(t.props.validationErrors&&t.props.validationErrors[e.props.name])return"string"==typeof t.props.validationErrors[e.props.name]?[t.props.validationErrors[e.props.name]]:t.props.validationErrors[e.props.name];if(u){var r=i[s.success[0]];return r?[r]:null}return a.failed.length?a.failed.map(function(e){return i[e]?i[e]:o}).filter(function(e,t,r){return r.indexOf(e)===t}):void 0}()}}},{key:"attachToForm",value:function(e){-1===this.inputs.indexOf(e)&&this.inputs.push(e),this.validate(e)}},{key:"detachFromForm",value:function(e){var t=this.inputs.indexOf(e);-1!==t&&(this.inputs=this.inputs.slice(0,t).concat(this.inputs.slice(t+1))),this.validateForm()}},{key:"isChanged",value:function(){return!b.default.isSame(this.getPristineValues(),this.getCurrentValues())}},{key:"submit",value:function(e){e&&e.preventDefault&&e.preventDefault(),this.setFormPristine(!1);var t=this.getModel();this.props.onSubmit(t,this.resetModel,this.updateInputsWithError),this.state.isValid?this.props.onValidSubmit(t,this.resetModel,this.updateInputsWithError):this.props.onInvalidSubmit(t,this.resetModel,this.updateInputsWithError)}},{key:"updateInputsWithError",value:function(e){var t=this;Object.keys(e).forEach(function(r){var n=b.default.find(t.inputs,function(e){return e.props.name===r});if(!n)throw new Error("You are trying to update an input that does not exist. Verify errors object with input names. "+JSON.stringify(e));var i=[{isValid:t.props.preventExternalInvalidation,externalError:"string"==typeof e[r]?[e[r]]:e[r]}];n.setState.apply(n,i)})}},{key:"validate",value:function(e){this.state.canChange&&this.props.onChange(this.getCurrentValues(),this.isChanged());var t=this.runValidation(e);e.setState({isValid:t.isValid,isRequired:t.isRequired,validationError:t.error,externalError:null},this.validateForm)}},{key:"validateForm",value:function(){var e=this,t=function(){var t=e.inputs.every(function(e){return e.state.isValid});e.setState({isValid:t}),t?e.props.onValid():e.props.onInvalid(),e.setState({canChange:!0})};this.inputs.forEach(function(r,n){var i=e.runValidation(r);i.isValid&&r.state.externalError&&(i.isValid=!1),r.setState({isValid:i.isValid,isRequired:i.isRequired,validationError:i.error,externalError:!i.isValid&&r.state.externalError?r.state.externalError:null},n===e.inputs.length-1?t:null)}),this.inputs.length||this.setState({canChange:!0})}},{key:"render",value:function(){var e=this.props,t=(e.getErrorMessage,e.getErrorMessages,e.getValue,e.hasValue,e.isFormDisabled,e.isFormSubmitted,e.isPristine,e.isRequired,e.isValid,e.isValidValue,e.mapping,e.onChange,e.onInvalidSubmit,e.onInvalid,e.onReset,e.onSubmit,e.onValid,e.onValidSubmit,e.preventExternalInvalidation,e.resetValue,e.setValidations,e.setValue,e.showError,e.showRequired,e.validationErrors,i(e,["getErrorMessage","getErrorMessages","getValue","hasValue","isFormDisabled","isFormSubmitted","isPristine","isRequired","isValid","isValidValue","mapping","onChange","onInvalidSubmit","onInvalid","onReset","onSubmit","onValid","onValidSubmit","preventExternalInvalidation","resetValue","setValidations","setValue","showError","showRequired","validationErrors"]));return v.default.createElement("form",u({onReset:this.resetInternal,onSubmit:this.submit},t),this.props.children)}}]),t}(v.default.Component);O.displayName="Formsy",O.defaultProps={children:null,disabled:!1,getErrorMessage:function(){},getErrorMessages:function(){},getValue:function(){},hasValue:function(){},isFormDisabled:function(){},isFormSubmitted:function(){},isPristine:function(){},isRequired:function(){},isValid:function(){},isValidValue:function(){},mapping:null,onChange:function(){},onError:function(){},onInvalid:function(){},onInvalidSubmit:function(){},onReset:function(){},onSubmit:function(){},onValid:function(){},onValidSubmit:function(){},preventExternalInvalidation:!1,resetValue:function(){},setValidations:function(){},setValue:function(){},showError:function(){},showRequired:function(){},validationErrors:null},O.propTypes={children:h.default.node,disabled:h.default.bool,getErrorMessage:h.default.func,getErrorMessages:h.default.func,getValue:h.default.func,hasValue:h.default.func,isFormDisabled:h.default.func,isFormSubmitted:h.default.func,isPristine:h.default.func,isRequired:h.default.func,isValid:h.default.func,isValidValue:h.default.func,mapping:h.default.func,preventExternalInvalidation:h.default.bool,onChange:h.default.func,onInvalid:h.default.func,onInvalidSubmit:h.default.func,onReset:h.default.func,onSubmit:h.default.func,onValid:h.default.func,onValidSubmit:h.default.func,resetValue:h.default.func,setValidations:h.default.func,setValue:h.default.func,showError:h.default.func,showRequired:h.default.func,validationErrors:h.default.object},O.childContextTypes={formsy:h.default.object};var R=function(e,t){V.default[e]=t},F=S.default,w=function(e){return console.warn("Wrapper has been renamed to withFormsy. Importing Wrapper from formsy-react is depreacted and will be removed in the future. Please rename your Wrapper imports to withFormsy."),F(e)};t.addValidationRule=R,t.propTypes=E.propTypes,t.validationRules=V.default,t.withFormsy=F,t.Wrapper=w,t.default=O},function(e,t){function r(e){return Object.keys(e).reduce(function(t,r){var n=r.match(/[^\[]*/i),i=r.match(/\[.*?\]/g)||[];i=[n[0]].concat(i).map(function(e){return e.replace(/\[|\]/g,"")});for(var o=t;i.length;){var a=i.shift();a in o?o=o[a]:(o[a]=i.length?isNaN(i[0])?{}:[]:e[r],o=o[a])}return t},{})}function n(e){function t(e,r,n){return Array.isArray(n)||"[object Object]"===Object.prototype.toString.call(n)?(Object.keys(n).forEach(function(i){t(e,r+"["+i+"]",n[i])}),e):(e[r]=n,e)}return Object.keys(e).reduce(function(r,n){return t(r,n,e[n])},{})}e.exports={fromObj:n,toObj:r}},function(e,t,r){"use strict";var n=r(6),i=r(7),o=r(8);e.exports=function(){function e(e,t,r,n,a,s){s!==o&&i(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){"use strict";function n(e){return function(){return e}}var i=function(){};i.thatReturns=n,i.thatReturnsFalse=n(!1),i.thatReturnsTrue=n(!0),i.thatReturnsNull=n(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t,r){"use strict";function n(e,t,r,n,o,a,s,u){if(i(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[r,n,o,a,s,u],c=0;l=new Error(t.replace(/%s/g,function(){return f[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var i=function(e){};e.exports=n},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return null!==e&&void 0!==e},i=function(e){return""===e},o={isDefaultRequiredValue:function(e,t){return void 0===t||""===t},isExisty:function(e,t){return n(t)},matchRegexp:function(e,t,r){return!n(t)||i(t)||r.test(t)},isUndefined:function(e,t){return void 0===t},isEmptyString:function(e,t){return i(t)},isEmail:function(e,t){return o.matchRegexp(e,t,/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i)},isUrl:function(e,t){return o.matchRegexp(e,t,/^(?:\w+:)?\/\/([^\s.]+\.\S{2}|localhost[:?\d]*)\S*$/i)},isTrue:function(e,t){return!0===t},isFalse:function(e,t){return!1===t},isNumeric:function(e,t){return"number"==typeof t||o.matchRegexp(e,t,/^[-+]?(?:\d*[.])?\d+$/)},isAlpha:function(e,t){return o.matchRegexp(e,t,/^[A-Z]+$/i)},isAlphanumeric:function(e,t){return o.matchRegexp(e,t,/^[0-9A-Z]+$/i)},isInt:function(e,t){return o.matchRegexp(e,t,/^(?:[-+]?(?:0|[1-9]\d*))$/)},isFloat:function(e,t){return o.matchRegexp(e,t,/^(?:[-+]?(?:\d+))?(?:\.\d*)?(?:[eE][+-]?(?:\d+))?$/)},isWords:function(e,t){return o.matchRegexp(e,t,/^[A-Z\s]+$/i)},isSpecialWords:function(e,t){return o.matchRegexp(e,t,/^[A-Z\s\u00C0-\u017F]+$/i)},isLength:function(e,t,r){return!n(t)||i(t)||t.length===r},equals:function(e,t,r){return!n(t)||i(t)||t===r},equalsField:function(e,t,r){return t===e[r]},maxLength:function(e,t,r){return!n(t)||t.length<=r},minLength:function(e,t,r){return!n(t)||i(t)||t.length>=r}};t.default=o},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.propTypes=void 0;var s=Object.assign||function(e){for(var t=1;t1)throw new Error("Formsy does not support multiple args on string validations. Use object format of validations instead.");var i=Object.assign({},e);return i[n]=!r.length||r[0],i},{}):e||{}},v={innerRef:f.default.func,name:f.default.string.isRequired,required:f.default.bool,validations:f.default.oneOfType([f.default.object,f.default.string]),value:f.default.any};t.propTypes=v,t.default=function(e){var t=function(t){function r(e){i(this,r);var t=o(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.getErrorMessage=function(){var e=t.getErrorMessages();return e.length?e[0]:null},t.getErrorMessages=function(){return!t.isValid()||t.showRequired()?t.state.externalError||t.state.validationError||[]:[]},t.getValue=function(){return t.state.value},t.setValidations=function(e,r){t.validations=m(e)||{},t.requiredValidations=!0===r?{isDefaultRequiredValue:!0}:m(r)},t.setValue=function(e){arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?t.setState({value:e}):t.setState({value:e,isPristine:!1},function(){t.context.formsy.validate(t)})},t.hasValue=function(){return""!==t.state.value},t.isFormDisabled=function(){return t.context.formsy.isFormDisabled()},t.isFormSubmitted=function(){return t.state.formSubmitted},t.isPristine=function(){return t.state.isPristine},t.isRequired=function(){return!!t.props.required},t.isValid=function(){return t.state.isValid},t.isValidValue=function(e){return t.context.formsy.isValidValue.call(null,t,e)},t.resetValue=function(){t.setState({value:t.state.pristineValue,isPristine:!0},function(){t.context.formsy.validate(t)})},t.showError=function(){return!t.showRequired()&&!t.isValid()},t.showRequired=function(){return t.state.isRequired},t.state={value:e.value,isRequired:!1,isValid:!0,isPristine:!0,pristineValue:e.value,validationError:[],externalError:null,formSubmitted:!1},t}return a(r,t),u(r,[{key:"componentWillMount",value:function(){var e=this;if(!this.props.name)throw new Error("Form Input requires a name property when used");!function(){e.setValidations(e.props.validations,e.props.required),e.context.formsy.attachToForm(e)}()}},{key:"componentWillReceiveProps",value:function(e){this.setValidations(e.validations,e.required)}},{key:"componentDidUpdate",value:function(e){h.default.isSame(this.props.value,e.value)||this.setValue(this.props.value),h.default.isSame(this.props.validations,e.validations)&&h.default.isSame(this.props.required,e.required)||this.context.formsy.validate(this)}},{key:"componentWillUnmount",value:function(){this.context.formsy.detachFromForm(this)}},{key:"render",value:function(){var t=this.props.innerRef,r=s({getErrorMessage:this.getErrorMessage,getErrorMessages:this.getErrorMessages,getValue:this.getValue,hasValue:this.hasValue,isFormDisabled:this.isFormDisabled,isValid:this.isValid,isPristine:this.isPristine,isFormSubmitted:this.isFormSubmitted,isRequired:this.isRequired,isValidValue:this.isValidValue,resetValue:this.resetValue,setValidations:this.setValidations,setValue:this.setValue,showRequired:this.showRequired,showError:this.showError},this.props);return t&&(r.ref=t),d.default.createElement(e,r)}}]),r}(d.default.Component);return t.displayName="Formsy("+function(e){return e.displayName||e.name||("string"==typeof e?e:"Component")}(e)+")",t.contextTypes={formsy:f.default.object},t.defaultProps={innerRef:function(){},required:!1,validationError:"",validationErrors:{},validations:null,value:e.defaultValue},t.propTypes=v,t}}])}); //# sourceMappingURL=formsy-react.js.map \ No newline at end of file diff --git a/release/formsy-react.js.map b/release/formsy-react.js.map index 696c7d6a..686542d3 100644 --- a/release/formsy-react.js.map +++ b/release/formsy-react.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///formsy-react.js","webpack:///webpack/bootstrap 08fb410aa77560bc74b2","webpack:///./node_modules/prop-types/index.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\",\"umd\":\"react\"}","webpack:///./src/utils.js","webpack:///./src/index.js","webpack:///./node_modules/form-data-to-object/index.js","webpack:///./node_modules/prop-types/factoryWithThrowingShims.js","webpack:///./node_modules/fbjs/lib/emptyFunction.js","webpack:///./node_modules/fbjs/lib/invariant.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./src/validationRules.js","webpack:///./src/Wrapper.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_1__","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","_typeof","Symbol","iterator","obj","constructor","default","arraysDiffer","a","b","_this","isDifferent","length","forEach","item","index","isSame","objectsDiffer","_this2","keys","key","Array","isArray","toString","find","collection","fn","runRules","currentValues","validations","validationRules","results","errors","failed","success","validationMethod","Error","validation","push","_interopRequireDefault","_objectWithoutProperties","target","indexOf","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","writable","setPrototypeOf","__proto__","Wrapper","withFormsy","propTypes","addValidationRule","undefined","_extends","assign","arguments","source","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_formDataToObject","_formDataToObject2","_propTypes","_propTypes2","_react","_react2","_utils","_utils2","_validationRules","_validationRules2","_Wrapper","_Wrapper2","Formsy","_React$Component","getPrototypeOf","state","isValid","isSubmitting","canChange","inputs","attachToForm","bind","detachFromForm","getCurrentValues","getPristineValues","isChanged","isFormDisabled","reset","resetInternal","runValidation","submit","updateInputsWithError","validate","validateForm","formsy","isValidValue","component","prevInputNames","map","validationErrors","setInputValidationErrors","newInputNames","reduce","data","dataCopy","mapModel","isPristine","setState","formSubmitted","args","validationError","apply","disabled","model","mapping","toObj","mappedModel","keyArray","split","base","currentKey","shift","setFormPristine","resetModel","event","preventDefault","onReset","setValue","resetValue","_this3","validationResults","requiredResults","requiredValidations","isRequired","error","filter","x","pos","arr","componentPos","slice","concat","getModel","onSubmit","onValidSubmit","onInvalidSubmit","_this4","input","JSON","stringify","preventExternalInvalidation","externalError","onChange","_this5","onValidationComplete","allIsValid","every","onValid","onInvalid","_props","nonFormsyProps","getErrorMessage","getErrorMessages","getValue","hasValue","isFormSubmitted","setValidations","showError","showRequired","createElement","children","Component","displayName","defaultProps","onError","node","bool","func","childContextTypes","deprecatedWrapper","console","warn","output","parentKey","match","paths","replace","currentPath","pathKey","isNaN","fromObj","recur","newObj","propName","currVal","v","emptyFunction","invariant","ReactPropTypesSecret","shim","componentName","location","propFullName","secret","getShim","ReactPropTypes","array","number","string","symbol","any","arrayOf","element","instanceOf","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","makeEmptyFunction","arg","thatReturns","thatReturnsFalse","thatReturnsTrue","thatReturnsNull","thatReturnsThis","thatReturnsArgument","condition","format","e","f","validateFormat","argIndex","framesToPop","isExisty","isEmpty","isDefaultRequiredValue","values","matchRegexp","regexp","test","isUndefined","isEmptyString","isEmail","isUrl","isTrue","isFalse","isNumeric","isAlpha","isAlphanumeric","isInt","isFloat","isWords","isSpecialWords","isLength","equals","eql","equalsField","field","maxLength","minLength","convertValidationsToObject","validationsAccumulator","validateMethod","parse","validationsAccumulatorCopy","innerRef","required","WrappedComponent","pristineValue","context","nextProps","prevProps","messages","propsForElement","ref","contextTypes","defaultValue"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,OAAAD,EAAAG,QAAA,UAEAJ,EAAA,OAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAZ,WAUA,OANAO,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,GAAA,EAGAX,EAAAD,QAvBA,GAAAU,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAhB,EAAAiB,EAAAC,GACAV,EAAAW,EAAAnB,EAAAiB,IACAG,OAAAC,eAAArB,EAAAiB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAxB,GACA,GAAAiB,GAAAjB,KAAAyB,WACA,WAA2B,MAAAzB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAO,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAA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D,QAzIsB1I,IAAA,YAAApB,MAAA,WA8IxB,OAAQ5B,KAAKgN,iBAAmBhN,KAAKoH,aA9IbpE,IAAA,eAAApB,MAAA,WAkJxB,MAAO5B,MAAKmH,MAAM0D,cAlJM7H,IAAA,SAAApB,MAAA,WAqJjB,GACCwR,GAAapT,KAAKgG,MAAlBoN,SACFQ,KACJnH,gBAAiBzM,KAAKyM,gBACtBC,iBAAkB1M,KAAK0M,iBACvBC,SAAU3M,KAAK2M,SACfC,SAAU5M,KAAK4M,SACf9E,eAAgB9H,KAAK8H,eACrBV,QAASpH,KAAKoH,QACd8B,WAAYlJ,KAAKkJ,WACjB2D,gBAAiB7M,KAAK6M,gBACtBhC,WAAY7K,KAAK6K,WACjBtC,aAAcvI,KAAKuI,aACnBiC,WAAYxK,KAAKwK,WACjBsC,eAAgB9M,KAAK8M,eACrBvC,SAAUvK,KAAKuK,SACfyC,aAAchN,KAAKgN,aACnBD,UAAW/M,KAAK+M,WACb/M,KAAKgG,MAOV,OAJIoN,KACFQ,EAAgBC,IAAMT,GAGjB3M,EAAAvE,QAAM+K,cAAcE,EAAWyG,OA9KdN,GACG7M,EAAAvE,QAAMiL,UA0MrC,OAjBAmG,GAAiBlG,YAAjB,UARA,SAAwB5E,GACtB,MACEA,GAAU4E,aACV5E,EAAU5H,OACY,gBAAd4H,GAAyBA,EAAY,cAIO2E,GAAxD,IAEAmG,EAAiBQ,cACfxL,OAAQ/B,EAAArE,QAAUZ,QAGpBgS,EAAiBjG,cACf+F,SAAU,aACVC,UAAU,EACV/J,gBAAiB,GACjBX,oBACAlF,YAAa,KACb7B,MAAOuL,EAAU4G,cAGnBT,EAAiB/N,UAAYA,EAEtB+N","file":"formsy-react.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Formsy\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"Formsy\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Formsy\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"Formsy\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (false) {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(5)();\n}\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = {\n arraysDiffer: function arraysDiffer(a, b) {\n var _this = this;\n\n var isDifferent = false;\n if (a.length !== b.length) {\n isDifferent = true;\n } else {\n a.forEach(function (item, index) {\n if (!_this.isSame(item, b[index])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n objectsDiffer: function objectsDiffer(a, b) {\n var _this2 = this;\n\n var isDifferent = false;\n if (Object.keys(a).length !== Object.keys(b).length) {\n isDifferent = true;\n } else {\n Object.keys(a).forEach(function (key) {\n if (!_this2.isSame(a[key], b[key])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n isSame: function isSame(a, b) {\n if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== (typeof b === 'undefined' ? 'undefined' : _typeof(b))) {\n return false;\n } else if (Array.isArray(a) && Array.isArray(b)) {\n return !this.arraysDiffer(a, b);\n } else if (typeof a === 'function') {\n return a.toString() === b.toString();\n } else if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object' && a !== null && b !== null) {\n return !this.objectsDiffer(a, b);\n }\n\n return a === b;\n },\n find: function find(collection, fn) {\n for (var i = 0, l = collection.length; i < l; i += 1) {\n var item = collection[i];\n if (fn(item)) {\n return item;\n }\n }\n return null;\n },\n runRules: function runRules(value, currentValues, validations, validationRules) {\n var results = {\n errors: [],\n failed: [],\n success: []\n };\n\n if (Object.keys(validations).length) {\n Object.keys(validations).forEach(function (validationMethod) {\n if (validationRules[validationMethod] && typeof validations[validationMethod] === 'function') {\n throw new Error('Formsy does not allow you to override default validations: ' + validationMethod);\n }\n\n if (!validationRules[validationMethod] && typeof validations[validationMethod] !== 'function') {\n throw new Error('Formsy does not have the validation rule: ' + validationMethod);\n }\n\n if (typeof validations[validationMethod] === 'function') {\n var validation = validations[validationMethod](currentValues, value);\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n }\n return;\n } else if (typeof validations[validationMethod] !== 'function') {\n var _validation = validationRules[validationMethod](currentValues, value, validations[validationMethod]);\n if (typeof _validation === 'string') {\n results.errors.push(_validation);\n results.failed.push(validationMethod);\n } else if (!_validation) {\n results.failed.push(validationMethod);\n } else {\n results.success.push(validationMethod);\n }\n return;\n }\n\n results.success.push(validationMethod);\n });\n }\n\n return results;\n }\n};\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Wrapper = exports.withFormsy = exports.validationRules = exports.propTypes = exports.addValidationRule = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _formDataToObject = __webpack_require__(4);\n\nvar _formDataToObject2 = _interopRequireDefault(_formDataToObject);\n\nvar _propTypes = __webpack_require__(0);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _react = __webpack_require__(1);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _utils = __webpack_require__(2);\n\nvar _utils2 = _interopRequireDefault(_utils);\n\nvar _validationRules = __webpack_require__(9);\n\nvar _validationRules2 = _interopRequireDefault(_validationRules);\n\nvar _Wrapper = __webpack_require__(10);\n\nvar _Wrapper2 = _interopRequireDefault(_Wrapper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Formsy = function (_React$Component) {\n _inherits(Formsy, _React$Component);\n\n function Formsy(props) {\n _classCallCheck(this, Formsy);\n\n var _this = _possibleConstructorReturn(this, (Formsy.__proto__ || Object.getPrototypeOf(Formsy)).call(this, props));\n\n _this.state = {\n isValid: true,\n isSubmitting: false,\n canChange: false\n };\n _this.inputs = [];\n _this.attachToForm = _this.attachToForm.bind(_this);\n _this.detachFromForm = _this.detachFromForm.bind(_this);\n _this.getCurrentValues = _this.getCurrentValues.bind(_this);\n _this.getPristineValues = _this.getPristineValues.bind(_this);\n _this.isChanged = _this.isChanged.bind(_this);\n _this.isFormDisabled = _this.isFormDisabled.bind(_this);\n _this.reset = _this.reset.bind(_this);\n _this.resetInternal = _this.resetInternal.bind(_this);\n _this.runValidation = _this.runValidation.bind(_this);\n _this.submit = _this.submit.bind(_this);\n _this.updateInputsWithError = _this.updateInputsWithError.bind(_this);\n _this.validate = _this.validate.bind(_this);\n _this.validateForm = _this.validateForm.bind(_this);\n return _this;\n }\n\n _createClass(Formsy, [{\n key: 'getChildContext',\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n formsy: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n validate: this.validate,\n isFormDisabled: this.isFormDisabled,\n isValidValue: function isValidValue(component, value) {\n return _this2.runValidation(component, value).isValid;\n }\n }\n };\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.validateForm();\n }\n }, {\n key: 'componentWillUpdate',\n value: function componentWillUpdate() {\n // Keep a reference to input names before form updates,\n // to check if inputs has changed after render\n this.prevInputNames = this.inputs.map(function (component) {\n return component.props.name;\n });\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n if (this.props.validationErrors && _typeof(this.props.validationErrors) === 'object' && Object.keys(this.props.validationErrors).length > 0) {\n this.setInputValidationErrors(this.props.validationErrors);\n }\n\n var newInputNames = this.inputs.map(function (component) {\n return component.props.name;\n });\n if (_utils2.default.arraysDiffer(this.prevInputNames, newInputNames)) {\n this.validateForm();\n }\n }\n }, {\n key: 'getCurrentValues',\n value: function getCurrentValues() {\n return this.inputs.reduce(function (data, component) {\n var name = component.props.name;\n var dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.state.value;\n return dataCopy;\n }, {});\n }\n }, {\n key: 'getModel',\n value: function getModel() {\n var currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n }\n }, {\n key: 'getPristineValues',\n value: function getPristineValues() {\n return this.inputs.reduce(function (data, component) {\n var name = component.props.name;\n var dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.props.value;\n return dataCopy;\n }, {});\n }\n }, {\n key: 'setFormPristine',\n value: function setFormPristine(isPristine) {\n this.setState({\n formSubmitted: !isPristine\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach(function (component) {\n component.setState({\n formSubmitted: !isPristine,\n isPristine: isPristine\n });\n });\n }\n }, {\n key: 'setInputValidationErrors',\n value: function setInputValidationErrors(errors) {\n this.inputs.forEach(function (component) {\n var name = component.props.name;\n var args = [{\n isValid: !(name in errors),\n validationError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n }\n }, {\n key: 'isFormDisabled',\n value: function isFormDisabled() {\n return this.props.disabled;\n }\n }, {\n key: 'mapModel',\n value: function mapModel(model) {\n if (this.props.mapping) {\n return this.props.mapping(model);\n }\n\n return _formDataToObject2.default.toObj(Object.keys(model).reduce(function (mappedModel, key) {\n var keyArray = key.split('.');\n var base = mappedModel;\n while (keyArray.length) {\n var currentKey = keyArray.shift();\n base[currentKey] = keyArray.length ? base[currentKey] || {} : model[key];\n base = base[currentKey];\n }\n return mappedModel;\n }, {}));\n }\n }, {\n key: 'reset',\n value: function reset(data) {\n this.setFormPristine(true);\n this.resetModel(data);\n }\n }, {\n key: 'resetInternal',\n value: function resetInternal(event) {\n event.preventDefault();\n this.reset();\n if (this.props.onReset) {\n this.props.onReset();\n }\n }\n\n // Reset each key in the model to the original / initial / specified value\n\n }, {\n key: 'resetModel',\n value: function resetModel(data) {\n this.inputs.forEach(function (component) {\n var name = component.props.name;\n if (data && Object.prototype.hasOwnProperty.call(data, name)) {\n component.setValue(data[name]);\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n }\n\n // Checks validation on current value or a passed value\n\n }, {\n key: 'runValidation',\n value: function runValidation(component) {\n var _this3 = this;\n\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : component.state.value;\n\n var currentValues = this.getCurrentValues();\n var validationErrors = component.props.validationErrors;\n var validationError = component.props.validationError;\n\n var validationResults = _utils2.default.runRules(value, currentValues, component.validations, _validationRules2.default);\n var requiredResults = _utils2.default.runRules(value, currentValues, component.requiredValidations, _validationRules2.default);\n\n var isRequired = Object.keys(component.requiredValidations).length ? !!requiredResults.success.length : false;\n var isValid = !validationResults.failed.length && !(this.props.validationErrors && this.props.validationErrors[component.props.name]);\n\n return {\n isRequired: isRequired,\n isValid: isRequired ? false : isValid,\n error: function () {\n if (isValid && !isRequired) {\n return [];\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (_this3.props.validationErrors && _this3.props.validationErrors[component.props.name]) {\n return typeof _this3.props.validationErrors[component.props.name] === 'string' ? [_this3.props.validationErrors[component.props.name]] : _this3.props.validationErrors[component.props.name];\n }\n\n if (isRequired) {\n var error = validationErrors[requiredResults.success[0]];\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed.map(function (failed) {\n return validationErrors[failed] ? validationErrors[failed] : validationError;\n }).filter(function (x, pos, arr) {\n return arr.indexOf(x) === pos;\n }); // remove duplicates\n }\n\n return undefined;\n }()\n };\n }\n\n // Method put on each input component to register\n // itself to the form\n\n }, {\n key: 'attachToForm',\n value: function attachToForm(component) {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n this.validate(component);\n }\n\n // Method put on each input component to unregister\n // itself from the form\n\n }, {\n key: 'detachFromForm',\n value: function detachFromForm(component) {\n var componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n }\n\n // Checks if the values have changed from their initial value\n\n }, {\n key: 'isChanged',\n value: function isChanged() {\n return !_utils2.default.isSame(this.getPristineValues(), this.getCurrentValues());\n }\n\n // Update model, submit to url prop and send the model\n\n }, {\n key: 'submit',\n value: function submit(event) {\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n var model = this.getModel();\n this.props.onSubmit(model, this.resetModel, this.updateInputsWithError);\n if (this.state.isValid) {\n this.props.onValidSubmit(model, this.resetModel, this.updateInputsWithError);\n } else {\n this.props.onInvalidSubmit(model, this.resetModel, this.updateInputsWithError);\n }\n }\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n\n }, {\n key: 'updateInputsWithError',\n value: function updateInputsWithError(errors) {\n var _this4 = this;\n\n Object.keys(errors).forEach(function (name) {\n var component = _utils2.default.find(_this4.inputs, function (input) {\n return input.props.name === name;\n });\n if (!component) {\n throw new Error('You are trying to update an input that does not exist. Verify errors object with input names. ' + JSON.stringify(errors));\n }\n var args = [{\n isValid: _this4.props.preventExternalInvalidation,\n externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n }\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n\n }, {\n key: 'validate',\n value: function validate(component) {\n // Trigger onChange\n if (this.state.canChange) {\n this.props.onChange(this.getCurrentValues(), this.isChanged());\n }\n\n var validation = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState({\n isValid: validation.isValid,\n isRequired: validation.isRequired,\n validationError: validation.error,\n externalError: null\n }, this.validateForm);\n }\n\n // Validate the form by going through all child input components\n // and check their state\n\n }, {\n key: 'validateForm',\n value: function validateForm() {\n var _this5 = this;\n\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n var onValidationComplete = function onValidationComplete() {\n var allIsValid = _this5.inputs.every(function (component) {\n return component.state.isValid;\n });\n\n _this5.setState({\n isValid: allIsValid\n });\n\n if (allIsValid) {\n _this5.props.onValid();\n } else {\n _this5.props.onInvalid();\n }\n\n // Tell the form that it can start to trigger change events\n _this5.setState({\n canChange: true\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach(function (component, index) {\n var validation = _this5.runValidation(component);\n if (validation.isValid && component.state.externalError) {\n validation.isValid = false;\n }\n component.setState({\n isValid: validation.isValid,\n isRequired: validation.isRequired,\n validationError: validation.error,\n externalError: !validation.isValid && component.state.externalError ? component.state.externalError : null\n }, index === _this5.inputs.length - 1 ? onValidationComplete : null);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState({\n canChange: true\n });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n getErrorMessage = _props.getErrorMessage,\n getErrorMessages = _props.getErrorMessages,\n getValue = _props.getValue,\n hasValue = _props.hasValue,\n isFormDisabled = _props.isFormDisabled,\n isFormSubmitted = _props.isFormSubmitted,\n isPristine = _props.isPristine,\n isRequired = _props.isRequired,\n isValid = _props.isValid,\n isValidValue = _props.isValidValue,\n mapping = _props.mapping,\n onChange = _props.onChange,\n onInvalidSubmit = _props.onInvalidSubmit,\n onInvalid = _props.onInvalid,\n onReset = _props.onReset,\n onSubmit = _props.onSubmit,\n onValid = _props.onValid,\n onValidSubmit = _props.onValidSubmit,\n preventExternalInvalidation = _props.preventExternalInvalidation,\n resetValue = _props.resetValue,\n setValidations = _props.setValidations,\n setValue = _props.setValue,\n showError = _props.showError,\n showRequired = _props.showRequired,\n validationErrors = _props.validationErrors,\n nonFormsyProps = _objectWithoutProperties(_props, ['getErrorMessage', 'getErrorMessages', 'getValue', 'hasValue', 'isFormDisabled', 'isFormSubmitted', 'isPristine', 'isRequired', 'isValid', 'isValidValue', 'mapping', 'onChange', 'onInvalidSubmit', 'onInvalid', 'onReset', 'onSubmit', 'onValid', 'onValidSubmit', 'preventExternalInvalidation', 'resetValue', 'setValidations', 'setValue', 'showError', 'showRequired', 'validationErrors']);\n\n return _react2.default.createElement('form', _extends({\n onReset: this.resetInternal,\n onSubmit: this.submit\n }, nonFormsyProps), this.props.children);\n }\n }]);\n\n return Formsy;\n}(_react2.default.Component);\n\nFormsy.displayName = 'Formsy';\n\nFormsy.defaultProps = {\n children: null,\n disabled: false,\n getErrorMessage: function getErrorMessage() {},\n getErrorMessages: function getErrorMessages() {},\n getValue: function getValue() {},\n hasValue: function hasValue() {},\n isFormDisabled: function isFormDisabled() {},\n isFormSubmitted: function isFormSubmitted() {},\n isPristine: function isPristine() {},\n isRequired: function isRequired() {},\n isValid: function isValid() {},\n isValidValue: function isValidValue() {},\n mapping: null,\n onChange: function onChange() {},\n onError: function onError() {},\n onInvalid: function onInvalid() {},\n onInvalidSubmit: function onInvalidSubmit() {},\n onReset: function onReset() {},\n onSubmit: function onSubmit() {},\n onValid: function onValid() {},\n onValidSubmit: function onValidSubmit() {},\n preventExternalInvalidation: false,\n resetValue: function resetValue() {},\n setValidations: function setValidations() {},\n setValue: function setValue() {},\n showError: function showError() {},\n showRequired: function showRequired() {},\n validationErrors: null\n};\n\nFormsy.propTypes = {\n children: _propTypes2.default.node,\n disabled: _propTypes2.default.bool,\n getErrorMessage: _propTypes2.default.func,\n getErrorMessages: _propTypes2.default.func,\n getValue: _propTypes2.default.func,\n hasValue: _propTypes2.default.func,\n isFormDisabled: _propTypes2.default.func,\n isFormSubmitted: _propTypes2.default.func,\n isPristine: _propTypes2.default.func,\n isRequired: _propTypes2.default.func,\n isValid: _propTypes2.default.func,\n isValidValue: _propTypes2.default.func,\n mapping: _propTypes2.default.func,\n preventExternalInvalidation: _propTypes2.default.bool,\n onChange: _propTypes2.default.func,\n onInvalid: _propTypes2.default.func,\n onInvalidSubmit: _propTypes2.default.func,\n onReset: _propTypes2.default.func,\n onSubmit: _propTypes2.default.func,\n onValid: _propTypes2.default.func,\n onValidSubmit: _propTypes2.default.func,\n resetValue: _propTypes2.default.func,\n setValidations: _propTypes2.default.func,\n setValue: _propTypes2.default.func,\n showError: _propTypes2.default.func,\n showRequired: _propTypes2.default.func,\n validationErrors: _propTypes2.default.object // eslint-disable-line\n};\n\nFormsy.childContextTypes = {\n formsy: _propTypes2.default.object\n};\n\nvar addValidationRule = function addValidationRule(name, func) {\n _validationRules2.default[name] = func;\n};\n\nvar withFormsy = _Wrapper2.default;\n\nvar deprecatedWrapper = function deprecatedWrapper(Component) {\n console.warn('Wrapper has been renamed to withFormsy. Importing Wrapper from formsy-react is depreacted and will be removed in the future. Please rename your Wrapper imports to withFormsy.');\n\n return withFormsy(Component);\n};\n\nexports.addValidationRule = addValidationRule;\nexports.propTypes = _Wrapper.propTypes;\nexports.validationRules = _validationRules2.default;\nexports.withFormsy = withFormsy;\nexports.Wrapper = deprecatedWrapper;\nexports.default = Formsy;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nfunction toObj(source) {\n return Object.keys(source).reduce(function (output, key) {\n var parentKey = key.match(/[^\\[]*/i);\n var paths = key.match(/\\[.*?\\]/g) || [];\n paths = [parentKey[0]].concat(paths).map(function (key) {\n return key.replace(/\\[|\\]/g, '');\n });\n var currentPath = output;\n while (paths.length) {\n var pathKey = paths.shift();\n\n if (pathKey in currentPath) {\n currentPath = currentPath[pathKey];\n } else {\n currentPath[pathKey] = paths.length ? isNaN(paths[0]) ? {} : [] : source[key];\n currentPath = currentPath[pathKey];\n }\n }\n\n return output;\n }, {});\n}\n\nfunction fromObj(obj) {\n function recur(newObj, propName, currVal) {\n if (Array.isArray(currVal) || Object.prototype.toString.call(currVal) === '[object Object]') {\n Object.keys(currVal).forEach(function(v) {\n recur(newObj, propName + \"[\" + v + \"]\", currVal[v]);\n });\n return newObj;\n }\n\n newObj[propName] = currVal;\n return newObj;\n }\n\n var keys = Object.keys(obj);\n return keys.reduce(function(newObj, propName) {\n return recur(newObj, propName, obj[propName]);\n }, {});\n}\n\nmodule.exports = {\n fromObj: fromObj,\n toObj: toObj\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(6);\nvar invariant = __webpack_require__(7);\nvar ReactPropTypesSecret = __webpack_require__(8);\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (false) {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _isExisty = function _isExisty(value) {\n return value !== null && value !== undefined;\n};\nvar isEmpty = function isEmpty(value) {\n return value === '';\n};\n\nvar validations = {\n isDefaultRequiredValue: function isDefaultRequiredValue(values, value) {\n return value === undefined || value === '';\n },\n isExisty: function isExisty(values, value) {\n return _isExisty(value);\n },\n matchRegexp: function matchRegexp(values, value, regexp) {\n return !_isExisty(value) || isEmpty(value) || regexp.test(value);\n },\n isUndefined: function isUndefined(values, value) {\n return value === undefined;\n },\n isEmptyString: function isEmptyString(values, value) {\n return isEmpty(value);\n },\n isEmail: function isEmail(values, value) {\n return validations.matchRegexp(values, value, /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i);\n },\n isUrl: function isUrl(values, value) {\n return validations.matchRegexp(values, value, /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i);\n },\n isTrue: function isTrue(values, value) {\n return value === true;\n },\n isFalse: function isFalse(values, value) {\n return value === false;\n },\n isNumeric: function isNumeric(values, value) {\n if (typeof value === 'number') {\n return true;\n }\n return validations.matchRegexp(values, value, /^[-+]?(?:\\d*[.])?\\d+$/);\n },\n isAlpha: function isAlpha(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z]+$/i);\n },\n isAlphanumeric: function isAlphanumeric(values, value) {\n return validations.matchRegexp(values, value, /^[0-9A-Z]+$/i);\n },\n isInt: function isInt(values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:0|[1-9]\\d*))$/);\n },\n isFloat: function isFloat(values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/);\n },\n isWords: function isWords(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s]+$/i);\n },\n isSpecialWords: function isSpecialWords(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s\\u00C0-\\u017F]+$/i);\n },\n isLength: function isLength(values, value, length) {\n return !_isExisty(value) || isEmpty(value) || value.length === length;\n },\n equals: function equals(values, value, eql) {\n return !_isExisty(value) || isEmpty(value) || value === eql;\n },\n equalsField: function equalsField(values, value, field) {\n return value === values[field];\n },\n maxLength: function maxLength(values, value, length) {\n return !_isExisty(value) || value.length <= length;\n },\n minLength: function minLength(values, value, length) {\n return !_isExisty(value) || isEmpty(value) || value.length >= length;\n }\n};\n\nexports.default = validations;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.propTypes = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _propTypes = __webpack_require__(0);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _react = __webpack_require__(1);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _utils = __webpack_require__(2);\n\nvar _utils2 = _interopRequireDefault(_utils);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar convertValidationsToObject = function convertValidationsToObject(validations) {\n if (typeof validations === 'string') {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce(function (validationsAccumulator, validation) {\n var args = validation.split(':');\n var validateMethod = args.shift();\n\n args = args.map(function (arg) {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error('Formsy does not support multiple args on string validations. Use object format of validations instead.');\n }\n\n // Avoid parameter reassignment\n var validationsAccumulatorCopy = Object.assign({}, validationsAccumulator);\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nvar propTypes = {\n innerRef: _propTypes2.default.func,\n name: _propTypes2.default.string.isRequired,\n required: _propTypes2.default.bool,\n validations: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.string]),\n value: _propTypes2.default.any // eslint-disable-line react/forbid-prop-types\n};\n\nexports.propTypes = propTypes;\n\nexports.default = function (Component) {\n var WrappedComponent = function (_React$Component) {\n _inherits(WrappedComponent, _React$Component);\n\n function WrappedComponent(props) {\n _classCallCheck(this, WrappedComponent);\n\n var _this = _possibleConstructorReturn(this, (WrappedComponent.__proto__ || Object.getPrototypeOf(WrappedComponent)).call(this, props));\n\n _this.state = {\n value: props.value,\n isRequired: false,\n isValid: true,\n isPristine: true,\n pristineValue: props.value,\n validationError: [],\n externalError: null,\n formSubmitted: false\n };\n _this.getErrorMessage = _this.getErrorMessage.bind(_this);\n _this.getErrorMessages = _this.getErrorMessages.bind(_this);\n _this.getValue = _this.getValue.bind(_this);\n _this.isFormDisabled = _this.isFormDisabled.bind(_this);\n _this.isPristine = _this.isPristine.bind(_this);\n _this.isRequired = _this.isRequired.bind(_this);\n _this.isValid = _this.isValid.bind(_this);\n _this.resetValue = _this.resetValue.bind(_this);\n _this.setValue = _this.setValue.bind(_this);\n _this.showRequired = _this.showRequired.bind(_this);\n return _this;\n }\n\n _createClass(WrappedComponent, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var _this2 = this;\n\n var configure = function configure() {\n _this2.setValidations(_this2.props.validations, _this2.props.required);\n\n // Pass a function instead?\n _this2.context.formsy.attachToForm(_this2);\n };\n\n if (!this.props.name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n configure();\n }\n\n // We have to make sure the validate method is kept when new props are added\n\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n this.setValidations(nextProps.validations, nextProps.required);\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!_utils2.default.isSame(this.props.value, prevProps.value)) {\n this.setValue(this.props.value);\n }\n\n // If validations or required is changed, run a new validation\n if (!_utils2.default.isSame(this.props.validations, prevProps.validations) || !_utils2.default.isSame(this.props.required, prevProps.required)) {\n this.context.formsy.validate(this);\n }\n }\n\n // Detach it when component unmounts\n\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.context.formsy.detachFromForm(this);\n }\n }, {\n key: 'getErrorMessage',\n value: function getErrorMessage() {\n var messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n }\n }, {\n key: 'getErrorMessages',\n value: function getErrorMessages() {\n return !this.isValid() || this.showRequired() ? this.state.externalError || this.state.validationError || [] : [];\n }\n }, {\n key: 'getValue',\n value: function getValue() {\n return this.state.value;\n }\n }, {\n key: 'setValidations',\n value: function setValidations(validations, required) {\n // Add validations to the store itself as the props object can not be modified\n this.validations = convertValidationsToObject(validations) || {};\n this.requiredValidations = required === true ? { isDefaultRequiredValue: true } : convertValidationsToObject(required);\n }\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n\n }, {\n key: 'setValue',\n value: function setValue(value) {\n var _this3 = this;\n\n var validate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n if (!validate) {\n this.setState({\n value: value\n });\n } else {\n this.setState({\n value: value,\n isPristine: false\n }, function () {\n _this3.context.formsy.validate(_this3);\n });\n }\n }\n }, {\n key: 'hasValue',\n value: function hasValue() {\n return this.state.value !== '';\n }\n }, {\n key: 'isFormDisabled',\n value: function isFormDisabled() {\n return this.context.formsy.isFormDisabled();\n }\n }, {\n key: 'isFormSubmitted',\n value: function isFormSubmitted() {\n return this.state.formSubmitted;\n }\n }, {\n key: 'isPristine',\n value: function isPristine() {\n return this.state.isPristine;\n }\n }, {\n key: 'isRequired',\n value: function isRequired() {\n return !!this.props.required;\n }\n }, {\n key: 'isValid',\n value: function isValid() {\n return this.state.isValid;\n }\n }, {\n key: 'isValidValue',\n value: function isValidValue(value) {\n return this.context.formsy.isValidValue.call(null, this, value);\n // return this.props.isValidValue.call(null, this, value);\n }\n }, {\n key: 'resetValue',\n value: function resetValue() {\n var _this4 = this;\n\n this.setState({\n value: this.state.pristineValue,\n isPristine: true\n }, function () {\n _this4.context.formsy.validate(_this4);\n });\n }\n }, {\n key: 'showError',\n value: function showError() {\n return !this.showRequired() && !this.isValid();\n }\n }, {\n key: 'showRequired',\n value: function showRequired() {\n return this.state.isRequired;\n }\n }, {\n key: 'render',\n value: function render() {\n var innerRef = this.props.innerRef;\n\n var propsForElement = _extends({\n getErrorMessage: this.getErrorMessage,\n getErrorMessages: this.getErrorMessages,\n getValue: this.getValue,\n hasValue: this.hasValue,\n isFormDisabled: this.isFormDisabled,\n isValid: this.isValid,\n isPristine: this.isPristine,\n isFormSubmitted: this.isFormSubmitted,\n isRequired: this.isRequired,\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showRequired: this.showRequired,\n showError: this.showError\n }, this.props);\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return _react2.default.createElement(Component, propsForElement);\n }\n }]);\n\n return WrappedComponent;\n }(_react2.default.Component);\n\n function getDisplayName(component) {\n return component.displayName || component.name || (typeof component === 'string' ? component : 'Component');\n }\n\n WrappedComponent.displayName = 'Formsy(' + getDisplayName(Component) + ')';\n\n WrappedComponent.contextTypes = {\n formsy: _propTypes2.default.object // What about required?\n };\n\n WrappedComponent.defaultProps = {\n innerRef: function innerRef() {},\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: Component.defaultValue\n };\n\n WrappedComponent.propTypes = propTypes;\n\n return WrappedComponent;\n};\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// formsy-react.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 08fb410aa77560bc74b2","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/prop-types/index.js\n// module id = 0\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\",\"umd\":\"react\"}\n// module id = 1\n// module chunks = 0","export default {\n arraysDiffer(a, b) {\n let isDifferent = false;\n if (a.length !== b.length) {\n isDifferent = true;\n } else {\n a.forEach((item, index) => {\n if (!this.isSame(item, b[index])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n\n objectsDiffer(a, b) {\n let isDifferent = false;\n if (Object.keys(a).length !== Object.keys(b).length) {\n isDifferent = true;\n } else {\n Object.keys(a).forEach((key) => {\n if (!this.isSame(a[key], b[key])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n\n isSame(a, b) {\n if (typeof a !== typeof b) {\n return false;\n } else if (Array.isArray(a) && Array.isArray(b)) {\n return !this.arraysDiffer(a, b);\n } else if (typeof a === 'function') {\n return a.toString() === b.toString();\n } else if (typeof a === 'object' && a !== null && b !== null) {\n return !this.objectsDiffer(a, b);\n }\n\n return a === b;\n },\n\n find(collection, fn) {\n for (let i = 0, l = collection.length; i < l; i += 1) {\n const item = collection[i];\n if (fn(item)) {\n return item;\n }\n }\n return null;\n },\n\n runRules(value, currentValues, validations, validationRules) {\n const results = {\n errors: [],\n failed: [],\n success: [],\n };\n\n if (Object.keys(validations).length) {\n Object.keys(validations).forEach((validationMethod) => {\n if (validationRules[validationMethod] && typeof validations[validationMethod] === 'function') {\n throw new Error(`Formsy does not allow you to override default validations: ${validationMethod}`);\n }\n\n if (!validationRules[validationMethod] && typeof validations[validationMethod] !== 'function') {\n throw new Error(`Formsy does not have the validation rule: ${validationMethod}`);\n }\n\n if (typeof validations[validationMethod] === 'function') {\n const validation = validations[validationMethod](currentValues, value);\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n }\n return;\n } else if (typeof validations[validationMethod] !== 'function') {\n const validation = validationRules[validationMethod](\n currentValues, value, validations[validationMethod],\n );\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n } else {\n results.success.push(validationMethod);\n }\n return;\n }\n\n results.success.push(validationMethod);\n });\n }\n\n return results;\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","import formDataToObject from 'form-data-to-object';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nimport utils from './utils';\nimport validationRules from './validationRules';\nimport Wrapper, { propTypes } from './Wrapper';\n\nclass Formsy extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n isValid: true,\n isSubmitting: false,\n canChange: false,\n };\n this.inputs = [];\n this.attachToForm = this.attachToForm.bind(this);\n this.detachFromForm = this.detachFromForm.bind(this);\n this.getCurrentValues = this.getCurrentValues.bind(this);\n this.getPristineValues = this.getPristineValues.bind(this);\n this.isChanged = this.isChanged.bind(this);\n this.isFormDisabled = this.isFormDisabled.bind(this);\n this.reset = this.reset.bind(this);\n this.resetInternal = this.resetInternal.bind(this);\n this.runValidation = this.runValidation.bind(this);\n this.submit = this.submit.bind(this);\n this.updateInputsWithError = this.updateInputsWithError.bind(this);\n this.validate = this.validate.bind(this);\n this.validateForm = this.validateForm.bind(this);\n }\n\n getChildContext() {\n return {\n formsy: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n validate: this.validate,\n isFormDisabled: this.isFormDisabled,\n isValidValue: (component, value) => this.runValidation(component, value).isValid,\n },\n };\n }\n\n componentDidMount() {\n this.validateForm();\n }\n\n componentWillUpdate() {\n // Keep a reference to input names before form updates,\n // to check if inputs has changed after render\n this.prevInputNames = this.inputs.map(component => component.props.name);\n }\n\n componentDidUpdate() {\n if (this.props.validationErrors && typeof this.props.validationErrors === 'object' && Object.keys(this.props.validationErrors).length > 0) {\n this.setInputValidationErrors(this.props.validationErrors);\n }\n\n const newInputNames = this.inputs.map(component => component.props.name);\n if (utils.arraysDiffer(this.prevInputNames, newInputNames)) {\n this.validateForm();\n }\n }\n\n getCurrentValues() {\n return this.inputs.reduce((data, component) => {\n const name = component.props.name;\n const dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.state.value;\n return dataCopy;\n }, {});\n }\n\n getModel() {\n const currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n }\n\n getPristineValues() {\n return this.inputs.reduce((data, component) => {\n const name = component.props.name;\n const dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.props.value;\n return dataCopy;\n }, {});\n }\n\n setFormPristine(isPristine) {\n this.setState({\n formSubmitted: !isPristine,\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component) => {\n component.setState({\n formSubmitted: !isPristine,\n isPristine,\n });\n });\n }\n\n setInputValidationErrors(errors) {\n this.inputs.forEach((component) => {\n const name = component.props.name;\n const args = [{\n isValid: !(name in errors),\n validationError: typeof errors[name] === 'string' ? [errors[name]] : errors[name],\n }];\n component.setState(...args);\n });\n }\n\n isFormDisabled() {\n return this.props.disabled;\n }\n\n mapModel(model) {\n if (this.props.mapping) {\n return this.props.mapping(model);\n }\n\n return formDataToObject.toObj(Object.keys(model).reduce((mappedModel, key) => {\n const keyArray = key.split('.');\n let base = mappedModel;\n while (keyArray.length) {\n const currentKey = keyArray.shift();\n base[currentKey] = (keyArray.length ? base[currentKey] || {} : model[key]);\n base = base[currentKey];\n }\n return mappedModel;\n }, {}));\n }\n\n reset(data) {\n this.setFormPristine(true);\n this.resetModel(data);\n }\n\n resetInternal(event) {\n event.preventDefault();\n this.reset();\n if (this.props.onReset) {\n this.props.onReset();\n }\n }\n\n // Reset each key in the model to the original / initial / specified value\n resetModel(data) {\n this.inputs.forEach((component) => {\n const name = component.props.name;\n if (data && Object.prototype.hasOwnProperty.call(data, name)) {\n component.setValue(data[name]);\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n }\n\n // Checks validation on current value or a passed value\n runValidation(component, value = component.state.value) {\n const currentValues = this.getCurrentValues();\n const validationErrors = component.props.validationErrors;\n const validationError = component.props.validationError;\n\n const validationResults = utils.runRules(\n value, currentValues, component.validations, validationRules,\n );\n const requiredResults = utils.runRules(\n value, currentValues, component.requiredValidations, validationRules,\n );\n\n const isRequired = Object.keys(component.requiredValidations).length ?\n !!requiredResults.success.length : false;\n const isValid = !validationResults.failed.length &&\n !(this.props.validationErrors && this.props.validationErrors[component.props.name]);\n\n return {\n isRequired,\n isValid: isRequired ? false : isValid,\n error: (() => {\n if (isValid && !isRequired) {\n return [];\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (this.props.validationErrors && this.props.validationErrors[component.props.name]) {\n return typeof this.props.validationErrors[component.props.name] === 'string' ? [this.props.validationErrors[component.props.name]] : this.props.validationErrors[component.props.name];\n }\n\n if (isRequired) {\n const error = validationErrors[requiredResults.success[0]];\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed.map(failed =>\n (validationErrors[failed] ? validationErrors[failed] : validationError))\n .filter((x, pos, arr) => arr.indexOf(x) === pos); // remove duplicates\n }\n\n return undefined;\n })(),\n };\n }\n\n // Method put on each input component to register\n // itself to the form\n attachToForm(component) {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n this.validate(component);\n }\n\n // Method put on each input component to unregister\n // itself from the form\n detachFromForm(component) {\n const componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n }\n\n // Checks if the values have changed from their initial value\n isChanged() {\n return !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n }\n\n // Update model, submit to url prop and send the model\n submit(event) {\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n const model = this.getModel();\n this.props.onSubmit(model, this.resetModel, this.updateInputsWithError);\n if (this.state.isValid) {\n this.props.onValidSubmit(model, this.resetModel, this.updateInputsWithError);\n } else {\n this.props.onInvalidSubmit(model, this.resetModel, this.updateInputsWithError);\n }\n }\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n updateInputsWithError(errors) {\n Object.keys(errors).forEach((name) => {\n const component = utils.find(this.inputs, input => input.props.name === name);\n if (!component) {\n throw new Error(`You are trying to update an input that does not exist. Verify errors object with input names. ${JSON.stringify(errors)}`);\n }\n const args = [{\n isValid: this.props.preventExternalInvalidation,\n externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name],\n }];\n component.setState(...args);\n });\n }\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n validate(component) {\n // Trigger onChange\n if (this.state.canChange) {\n this.props.onChange(this.getCurrentValues(), this.isChanged());\n }\n\n const validation = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState({\n isValid: validation.isValid,\n isRequired: validation.isRequired,\n validationError: validation.error,\n externalError: null,\n }, this.validateForm);\n }\n\n // Validate the form by going through all child input components\n // and check their state\n validateForm() {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n const onValidationComplete = () => {\n const allIsValid = this.inputs.every(component => component.state.isValid);\n\n this.setState({\n isValid: allIsValid,\n });\n\n if (allIsValid) {\n this.props.onValid();\n } else {\n this.props.onInvalid();\n }\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true,\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n const validation = this.runValidation(component);\n if (validation.isValid && component.state.externalError) {\n validation.isValid = false;\n }\n component.setState({\n isValid: validation.isValid,\n isRequired: validation.isRequired,\n validationError: validation.error,\n externalError: !validation.isValid && component.state.externalError ?\n component.state.externalError : null,\n }, index === this.inputs.length - 1 ? onValidationComplete : null);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState({\n canChange: true,\n });\n }\n }\n\n render() {\n const {\n getErrorMessage,\n getErrorMessages,\n getValue,\n hasValue,\n isFormDisabled,\n isFormSubmitted,\n isPristine,\n isRequired,\n isValid,\n isValidValue,\n mapping,\n onChange,\n // onError,\n onInvalidSubmit,\n onInvalid,\n onReset,\n onSubmit,\n onValid,\n onValidSubmit,\n preventExternalInvalidation,\n // reset,\n resetValue,\n setValidations,\n setValue,\n showError,\n showRequired,\n validationErrors,\n ...nonFormsyProps\n } = this.props;\n\n return React.createElement(\n 'form',\n {\n onReset: this.resetInternal,\n onSubmit: this.submit,\n ...nonFormsyProps,\n },\n this.props.children,\n );\n }\n}\n\nFormsy.displayName = 'Formsy';\n\nFormsy.defaultProps = {\n children: null,\n disabled: false,\n getErrorMessage: () => {},\n getErrorMessages: () => {},\n getValue: () => {},\n hasValue: () => {},\n isFormDisabled: () => {},\n isFormSubmitted: () => {},\n isPristine: () => {},\n isRequired: () => {},\n isValid: () => {},\n isValidValue: () => {},\n mapping: null,\n onChange: () => {},\n onError: () => {},\n onInvalid: () => {},\n onInvalidSubmit: () => {},\n onReset: () => {},\n onSubmit: () => {},\n onValid: () => {},\n onValidSubmit: () => {},\n preventExternalInvalidation: false,\n resetValue: () => {},\n setValidations: () => {},\n setValue: () => {},\n showError: () => {},\n showRequired: () => {},\n validationErrors: null,\n};\n\nFormsy.propTypes = {\n children: PropTypes.node,\n disabled: PropTypes.bool,\n getErrorMessage: PropTypes.func,\n getErrorMessages: PropTypes.func,\n getValue: PropTypes.func,\n hasValue: PropTypes.func,\n isFormDisabled: PropTypes.func,\n isFormSubmitted: PropTypes.func,\n isPristine: PropTypes.func,\n isRequired: PropTypes.func,\n isValid: PropTypes.func,\n isValidValue: PropTypes.func,\n mapping: PropTypes.func,\n preventExternalInvalidation: PropTypes.bool,\n onChange: PropTypes.func,\n onInvalid: PropTypes.func,\n onInvalidSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSubmit: PropTypes.func,\n onValid: PropTypes.func,\n onValidSubmit: PropTypes.func,\n resetValue: PropTypes.func,\n setValidations: PropTypes.func,\n setValue: PropTypes.func,\n showError: PropTypes.func,\n showRequired: PropTypes.func,\n validationErrors: PropTypes.object, // eslint-disable-line\n};\n\nFormsy.childContextTypes = {\n formsy: PropTypes.object,\n};\n\nconst addValidationRule = (name, func) => {\n validationRules[name] = func;\n};\n\nconst withFormsy = Wrapper;\n\nconst deprecatedWrapper = (Component) => {\n console.warn('Wrapper has been renamed to withFormsy. Importing Wrapper from formsy-react is depreacted and will be removed in the future. Please rename your Wrapper imports to withFormsy.');\n\n return withFormsy(Component);\n};\n\nexport {\n addValidationRule,\n propTypes,\n validationRules,\n withFormsy,\n deprecatedWrapper as Wrapper,\n};\n\nexport default Formsy;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","function toObj(source) {\n return Object.keys(source).reduce(function (output, key) {\n var parentKey = key.match(/[^\\[]*/i);\n var paths = key.match(/\\[.*?\\]/g) || [];\n paths = [parentKey[0]].concat(paths).map(function (key) {\n return key.replace(/\\[|\\]/g, '');\n });\n var currentPath = output;\n while (paths.length) {\n var pathKey = paths.shift();\n\n if (pathKey in currentPath) {\n currentPath = currentPath[pathKey];\n } else {\n currentPath[pathKey] = paths.length ? isNaN(paths[0]) ? {} : [] : source[key];\n currentPath = currentPath[pathKey];\n }\n }\n\n return output;\n }, {});\n}\n\nfunction fromObj(obj) {\n function recur(newObj, propName, currVal) {\n if (Array.isArray(currVal) || Object.prototype.toString.call(currVal) === '[object Object]') {\n Object.keys(currVal).forEach(function(v) {\n recur(newObj, propName + \"[\" + v + \"]\", currVal[v]);\n });\n return newObj;\n }\n\n newObj[propName] = currVal;\n return newObj;\n }\n\n var keys = Object.keys(obj);\n return keys.reduce(function(newObj, propName) {\n return recur(newObj, propName, obj[propName]);\n }, {});\n}\n\nmodule.exports = {\n fromObj: fromObj,\n toObj: toObj\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/form-data-to-object/index.js\n// module id = 4\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/prop-types/factoryWithThrowingShims.js\n// module id = 5\n// module chunks = 0","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fbjs/lib/emptyFunction.js\n// module id = 6\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fbjs/lib/invariant.js\n// module id = 7\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/prop-types/lib/ReactPropTypesSecret.js\n// module id = 8\n// module chunks = 0","const isExisty = value => value !== null && value !== undefined;\nconst isEmpty = value => value === '';\n\nconst validations = {\n isDefaultRequiredValue(values, value) {\n return value === undefined || value === '';\n },\n isExisty(values, value) {\n return isExisty(value);\n },\n matchRegexp(values, value, regexp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(value);\n },\n isUndefined(values, value) {\n return value === undefined;\n },\n isEmptyString(values, value) {\n return isEmpty(value);\n },\n isEmail(values, value) {\n return validations.matchRegexp(values, value, /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i);\n },\n isUrl(values, value) {\n return validations.matchRegexp(values, value, /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i);\n },\n isTrue(values, value) {\n return value === true;\n },\n isFalse(values, value) {\n return value === false;\n },\n isNumeric(values, value) {\n if (typeof value === 'number') {\n return true;\n }\n return validations.matchRegexp(values, value, /^[-+]?(?:\\d*[.])?\\d+$/);\n },\n isAlpha(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z]+$/i);\n },\n isAlphanumeric(values, value) {\n return validations.matchRegexp(values, value, /^[0-9A-Z]+$/i);\n },\n isInt(values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:0|[1-9]\\d*))$/);\n },\n isFloat(values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/);\n },\n isWords(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s]+$/i);\n },\n isSpecialWords(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s\\u00C0-\\u017F]+$/i);\n },\n isLength(values, value, length) {\n return !isExisty(value) || isEmpty(value) || value.length === length;\n },\n equals(values, value, eql) {\n return !isExisty(value) || isEmpty(value) || value === eql;\n },\n equalsField(values, value, field) {\n return value === values[field];\n },\n maxLength(values, value, length) {\n return !isExisty(value) || value.length <= length;\n },\n minLength(values, value, length) {\n return !isExisty(value) || isEmpty(value) || value.length >= length;\n },\n};\n\nexport default validations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/validationRules.js","import PropTypes from 'prop-types';\nimport React from 'react';\nimport utils from './utils';\n\nconst convertValidationsToObject = (validations) => {\n if (typeof validations === 'string') {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce((validationsAccumulator, validation) => {\n let args = validation.split(':');\n const validateMethod = args.shift();\n\n args = args.map((arg) => {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error('Formsy does not support multiple args on string validations. Use object format of validations instead.');\n }\n\n // Avoid parameter reassignment\n const validationsAccumulatorCopy = Object.assign({}, validationsAccumulator);\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nconst propTypes = {\n innerRef: PropTypes.func,\n name: PropTypes.string.isRequired,\n required: PropTypes.bool,\n validations: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.string,\n ]),\n value: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n};\n\nexport {\n propTypes,\n};\n\nexport default (Component) => {\n class WrappedComponent extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: props.value,\n isRequired: false,\n isValid: true,\n isPristine: true,\n pristineValue: props.value,\n validationError: [],\n externalError: null,\n formSubmitted: false,\n };\n this.getErrorMessage = this.getErrorMessage.bind(this);\n this.getErrorMessages = this.getErrorMessages.bind(this);\n this.getValue = this.getValue.bind(this);\n this.isFormDisabled = this.isFormDisabled.bind(this);\n this.isPristine = this.isPristine.bind(this);\n this.isRequired = this.isRequired.bind(this);\n this.isValid = this.isValid.bind(this);\n this.resetValue = this.resetValue.bind(this);\n this.setValue = this.setValue.bind(this);\n this.showRequired = this.showRequired.bind(this);\n }\n\n componentWillMount() {\n const configure = () => {\n this.setValidations(this.props.validations, this.props.required);\n\n // Pass a function instead?\n this.context.formsy.attachToForm(this);\n };\n\n if (!this.props.name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n configure();\n }\n\n // We have to make sure the validate method is kept when new props are added\n componentWillReceiveProps(nextProps) {\n this.setValidations(nextProps.validations, nextProps.required);\n }\n\n componentDidUpdate(prevProps) {\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(this.props.value, prevProps.value)) {\n this.setValue(this.props.value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(this.props.validations, prevProps.validations) ||\n !utils.isSame(this.props.required, prevProps.required)) {\n this.context.formsy.validate(this);\n }\n }\n\n // Detach it when component unmounts\n componentWillUnmount() {\n this.context.formsy.detachFromForm(this);\n }\n\n getErrorMessage() {\n const messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n }\n\n getErrorMessages() {\n return !this.isValid() || this.showRequired() ?\n (this.state.externalError || this.state.validationError || []) : [];\n }\n\n getValue() {\n return this.state.value;\n }\n\n setValidations(validations, required) {\n // Add validations to the store itself as the props object can not be modified\n this.validations = convertValidationsToObject(validations) || {};\n this.requiredValidations = required === true ? { isDefaultRequiredValue: true } :\n convertValidationsToObject(required);\n }\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n setValue(value, validate = true) {\n if (!validate) {\n this.setState({\n value,\n });\n } else {\n this.setState({\n value,\n isPristine: false,\n }, () => {\n this.context.formsy.validate(this);\n });\n }\n }\n\n hasValue() {\n return this.state.value !== '';\n }\n\n isFormDisabled() {\n return this.context.formsy.isFormDisabled();\n }\n\n isFormSubmitted() {\n return this.state.formSubmitted;\n }\n\n isPristine() {\n return this.state.isPristine;\n }\n\n isRequired() {\n return !!this.props.required;\n }\n\n isValid() {\n return this.state.isValid;\n }\n\n isValidValue(value) {\n return this.context.formsy.isValidValue.call(null, this, value);\n // return this.props.isValidValue.call(null, this, value);\n }\n\n resetValue() {\n this.setState({\n value: this.state.pristineValue,\n isPristine: true,\n }, () => {\n this.context.formsy.validate(this);\n });\n }\n\n showError() {\n return !this.showRequired() && !this.isValid();\n }\n\n showRequired() {\n return this.state.isRequired;\n }\n\n render() {\n const { innerRef } = this.props;\n const propsForElement = {\n getErrorMessage: this.getErrorMessage,\n getErrorMessages: this.getErrorMessages,\n getValue: this.getValue,\n hasValue: this.hasValue,\n isFormDisabled: this.isFormDisabled,\n isValid: this.isValid,\n isPristine: this.isPristine,\n isFormSubmitted: this.isFormSubmitted,\n isRequired: this.isRequired,\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showRequired: this.showRequired,\n showError: this.showError,\n ...this.props,\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return React.createElement(Component, propsForElement);\n }\n }\n\n function getDisplayName(component) {\n return (\n component.displayName ||\n component.name ||\n (typeof component === 'string' ? component : 'Component')\n );\n }\n\n WrappedComponent.displayName = `Formsy(${getDisplayName(Component)})`;\n\n WrappedComponent.contextTypes = {\n formsy: PropTypes.object, // What about required?\n };\n\n WrappedComponent.defaultProps = {\n innerRef: () => {},\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: Component.defaultValue,\n };\n\n WrappedComponent.propTypes = propTypes;\n\n return WrappedComponent;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/Wrapper.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///formsy-react.js","webpack:///webpack/bootstrap f8b95deee34b621baecf","webpack:///./node_modules/prop-types/index.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\",\"umd\":\"react\"}","webpack:///./src/utils.js","webpack:///./src/index.js","webpack:///./node_modules/form-data-to-object/index.js","webpack:///./node_modules/prop-types/factoryWithThrowingShims.js","webpack:///./node_modules/fbjs/lib/emptyFunction.js","webpack:///./node_modules/fbjs/lib/invariant.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./src/validationRules.js","webpack:///./src/Wrapper.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_1__","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","_typeof","Symbol","iterator","obj","constructor","default","arraysDiffer","a","b","_this","isDifferent","length","forEach","item","index","isSame","objectsDiffer","_this2","keys","key","Array","isArray","toString","find","collection","fn","runRules","currentValues","validations","validationRules","results","errors","failed","success","validationMethod","Error","validation","push","_interopRequireDefault","_objectWithoutProperties","target","indexOf","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","writable","setPrototypeOf","__proto__","Wrapper","withFormsy","propTypes","addValidationRule","undefined","_extends","assign","arguments","source","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_formDataToObject","_formDataToObject2","_propTypes","_propTypes2","_react","_react2","_utils","_utils2","_validationRules","_validationRules2","_Wrapper","_Wrapper2","Formsy","_React$Component","getPrototypeOf","state","isValid","isSubmitting","canChange","inputs","attachToForm","bind","detachFromForm","getCurrentValues","getPristineValues","isChanged","isFormDisabled","reset","resetInternal","runValidation","submit","updateInputsWithError","validate","validateForm","formsy","isValidValue","component","prevInputNames","map","validationErrors","setInputValidationErrors","newInputNames","reduce","data","dataCopy","mapModel","isPristine","setState","formSubmitted","args","validationError","apply","disabled","model","mapping","toObj","mappedModel","keyArray","split","base","currentKey","shift","setFormPristine","resetModel","event","preventDefault","onReset","setValue","resetValue","_this3","validationResults","requiredResults","requiredValidations","isRequired","error","filter","x","pos","arr","componentPos","slice","concat","getModel","onSubmit","onValidSubmit","onInvalidSubmit","_this4","input","JSON","stringify","preventExternalInvalidation","externalError","onChange","_this5","onValidationComplete","allIsValid","every","onValid","onInvalid","_props","nonFormsyProps","getErrorMessage","getErrorMessages","getValue","hasValue","isFormSubmitted","setValidations","showError","showRequired","createElement","children","Component","displayName","defaultProps","onError","node","bool","func","childContextTypes","deprecatedWrapper","console","warn","output","parentKey","match","paths","replace","currentPath","pathKey","isNaN","fromObj","recur","newObj","propName","currVal","v","emptyFunction","invariant","ReactPropTypesSecret","shim","componentName","location","propFullName","secret","getShim","ReactPropTypes","array","number","string","symbol","any","arrayOf","element","instanceOf","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","makeEmptyFunction","arg","thatReturns","thatReturnsFalse","thatReturnsTrue","thatReturnsNull","thatReturnsThis","thatReturnsArgument","condition","format","e","f","validateFormat","argIndex","framesToPop","isExisty","isEmpty","isDefaultRequiredValue","values","matchRegexp","regexp","test","isUndefined","isEmptyString","isEmail","isUrl","isTrue","isFalse","isNumeric","isAlpha","isAlphanumeric","isInt","isFloat","isWords","isSpecialWords","isLength","equals","eql","equalsField","field","maxLength","minLength","convertValidationsToObject","validationsAccumulator","validateMethod","parse","validationsAccumulatorCopy","innerRef","required","WrappedComponent","messages","context","pristineValue","nextProps","prevProps","propsForElement","ref","contextTypes","defaultValue"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,OAAAD,EAAAG,QAAA,UAEAJ,EAAA,OAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAZ,WAUA,OANAO,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,GAAA,EAGAX,EAAAD,QAvBA,GAAAU,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAhB,EAAAiB,EAAAC,GACAV,EAAAW,EAAAnB,EAAAiB,IACAG,OAAAC,eAAArB,EAAAiB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,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9M,KAAK8M,eACrBvC,SAAUvK,KAAKuK,SACfyC,aAAchN,KAAKgN,aACnBD,UAAW/M,KAAK+M,WACb/M,KAAKgG,MAOV,OAJIoN,KACFQ,EAAgBC,IAAMT,GAGjB3M,EAAAvE,QAAM+K,cAAcE,EAAWyG,OAlJdN,GACG7M,EAAAvE,QAAMiL,UA8KrC,OAjBAmG,GAAiBlG,YAAjB,UARA,SAAwB5E,GACtB,MACEA,GAAU4E,aACV5E,EAAU5H,OACY,gBAAd4H,GAAyBA,EAAY,cAIO2E,GAAxD,IAEAmG,EAAiBQ,cACfxL,OAAQ/B,EAAArE,QAAUZ,QAGpBgS,EAAiBjG,cACf+F,SAAU,aACVC,UAAU,EACV/J,gBAAiB,GACjBX,oBACAlF,YAAa,KACb7B,MAAOuL,EAAU4G,cAGnBT,EAAiB/N,UAAYA,EAEtB+N","file":"formsy-react.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Formsy\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"Formsy\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Formsy\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"Formsy\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (false) {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(5)();\n}\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.default = {\n arraysDiffer: function arraysDiffer(a, b) {\n var _this = this;\n\n var isDifferent = false;\n if (a.length !== b.length) {\n isDifferent = true;\n } else {\n a.forEach(function (item, index) {\n if (!_this.isSame(item, b[index])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n objectsDiffer: function objectsDiffer(a, b) {\n var _this2 = this;\n\n var isDifferent = false;\n if (Object.keys(a).length !== Object.keys(b).length) {\n isDifferent = true;\n } else {\n Object.keys(a).forEach(function (key) {\n if (!_this2.isSame(a[key], b[key])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n isSame: function isSame(a, b) {\n if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== (typeof b === 'undefined' ? 'undefined' : _typeof(b))) {\n return false;\n } else if (Array.isArray(a) && Array.isArray(b)) {\n return !this.arraysDiffer(a, b);\n } else if (typeof a === 'function') {\n return a.toString() === b.toString();\n } else if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object' && a !== null && b !== null) {\n return !this.objectsDiffer(a, b);\n }\n\n return a === b;\n },\n find: function find(collection, fn) {\n for (var i = 0, l = collection.length; i < l; i += 1) {\n var item = collection[i];\n if (fn(item)) {\n return item;\n }\n }\n return null;\n },\n runRules: function runRules(value, currentValues, validations, validationRules) {\n var results = {\n errors: [],\n failed: [],\n success: []\n };\n\n if (Object.keys(validations).length) {\n Object.keys(validations).forEach(function (validationMethod) {\n if (validationRules[validationMethod] && typeof validations[validationMethod] === 'function') {\n throw new Error('Formsy does not allow you to override default validations: ' + validationMethod);\n }\n\n if (!validationRules[validationMethod] && typeof validations[validationMethod] !== 'function') {\n throw new Error('Formsy does not have the validation rule: ' + validationMethod);\n }\n\n if (typeof validations[validationMethod] === 'function') {\n var validation = validations[validationMethod](currentValues, value);\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n }\n return;\n } else if (typeof validations[validationMethod] !== 'function') {\n var _validation = validationRules[validationMethod](currentValues, value, validations[validationMethod]);\n if (typeof _validation === 'string') {\n results.errors.push(_validation);\n results.failed.push(validationMethod);\n } else if (!_validation) {\n results.failed.push(validationMethod);\n } else {\n results.success.push(validationMethod);\n }\n return;\n }\n\n results.success.push(validationMethod);\n });\n }\n\n return results;\n }\n};\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Wrapper = exports.withFormsy = exports.validationRules = exports.propTypes = exports.addValidationRule = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _formDataToObject = __webpack_require__(4);\n\nvar _formDataToObject2 = _interopRequireDefault(_formDataToObject);\n\nvar _propTypes = __webpack_require__(0);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _react = __webpack_require__(1);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _utils = __webpack_require__(2);\n\nvar _utils2 = _interopRequireDefault(_utils);\n\nvar _validationRules = __webpack_require__(9);\n\nvar _validationRules2 = _interopRequireDefault(_validationRules);\n\nvar _Wrapper = __webpack_require__(10);\n\nvar _Wrapper2 = _interopRequireDefault(_Wrapper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Formsy = function (_React$Component) {\n _inherits(Formsy, _React$Component);\n\n function Formsy(props) {\n _classCallCheck(this, Formsy);\n\n var _this = _possibleConstructorReturn(this, (Formsy.__proto__ || Object.getPrototypeOf(Formsy)).call(this, props));\n\n _this.state = {\n isValid: true,\n isSubmitting: false,\n canChange: false\n };\n _this.inputs = [];\n _this.attachToForm = _this.attachToForm.bind(_this);\n _this.detachFromForm = _this.detachFromForm.bind(_this);\n _this.getCurrentValues = _this.getCurrentValues.bind(_this);\n _this.getPristineValues = _this.getPristineValues.bind(_this);\n _this.isChanged = _this.isChanged.bind(_this);\n _this.isFormDisabled = _this.isFormDisabled.bind(_this);\n _this.reset = _this.reset.bind(_this);\n _this.resetInternal = _this.resetInternal.bind(_this);\n _this.runValidation = _this.runValidation.bind(_this);\n _this.submit = _this.submit.bind(_this);\n _this.updateInputsWithError = _this.updateInputsWithError.bind(_this);\n _this.validate = _this.validate.bind(_this);\n _this.validateForm = _this.validateForm.bind(_this);\n return _this;\n }\n\n _createClass(Formsy, [{\n key: 'getChildContext',\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n formsy: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n validate: this.validate,\n isFormDisabled: this.isFormDisabled,\n isValidValue: function isValidValue(component, value) {\n return _this2.runValidation(component, value).isValid;\n }\n }\n };\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.validateForm();\n }\n }, {\n key: 'componentWillUpdate',\n value: function componentWillUpdate() {\n // Keep a reference to input names before form updates,\n // to check if inputs has changed after render\n this.prevInputNames = this.inputs.map(function (component) {\n return component.props.name;\n });\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n if (this.props.validationErrors && _typeof(this.props.validationErrors) === 'object' && Object.keys(this.props.validationErrors).length > 0) {\n this.setInputValidationErrors(this.props.validationErrors);\n }\n\n var newInputNames = this.inputs.map(function (component) {\n return component.props.name;\n });\n if (_utils2.default.arraysDiffer(this.prevInputNames, newInputNames)) {\n this.validateForm();\n }\n }\n }, {\n key: 'getCurrentValues',\n value: function getCurrentValues() {\n return this.inputs.reduce(function (data, component) {\n var name = component.props.name;\n var dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.state.value;\n return dataCopy;\n }, {});\n }\n }, {\n key: 'getModel',\n value: function getModel() {\n var currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n }\n }, {\n key: 'getPristineValues',\n value: function getPristineValues() {\n return this.inputs.reduce(function (data, component) {\n var name = component.props.name;\n var dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.props.value;\n return dataCopy;\n }, {});\n }\n }, {\n key: 'setFormPristine',\n value: function setFormPristine(isPristine) {\n this.setState({\n formSubmitted: !isPristine\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach(function (component) {\n component.setState({\n formSubmitted: !isPristine,\n isPristine: isPristine\n });\n });\n }\n }, {\n key: 'setInputValidationErrors',\n value: function setInputValidationErrors(errors) {\n this.inputs.forEach(function (component) {\n var name = component.props.name;\n var args = [{\n isValid: !(name in errors),\n validationError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n }\n }, {\n key: 'isFormDisabled',\n value: function isFormDisabled() {\n return this.props.disabled;\n }\n }, {\n key: 'mapModel',\n value: function mapModel(model) {\n if (this.props.mapping) {\n return this.props.mapping(model);\n }\n\n return _formDataToObject2.default.toObj(Object.keys(model).reduce(function (mappedModel, key) {\n var keyArray = key.split('.');\n var base = mappedModel;\n while (keyArray.length) {\n var currentKey = keyArray.shift();\n base[currentKey] = keyArray.length ? base[currentKey] || {} : model[key];\n base = base[currentKey];\n }\n return mappedModel;\n }, {}));\n }\n }, {\n key: 'reset',\n value: function reset(data) {\n this.setFormPristine(true);\n this.resetModel(data);\n }\n }, {\n key: 'resetInternal',\n value: function resetInternal(event) {\n event.preventDefault();\n this.reset();\n if (this.props.onReset) {\n this.props.onReset();\n }\n }\n\n // Reset each key in the model to the original / initial / specified value\n\n }, {\n key: 'resetModel',\n value: function resetModel(data) {\n this.inputs.forEach(function (component) {\n var name = component.props.name;\n if (data && Object.prototype.hasOwnProperty.call(data, name)) {\n component.setValue(data[name]);\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n }\n\n // Checks validation on current value or a passed value\n\n }, {\n key: 'runValidation',\n value: function runValidation(component) {\n var _this3 = this;\n\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : component.state.value;\n\n var currentValues = this.getCurrentValues();\n var validationErrors = component.props.validationErrors;\n var validationError = component.props.validationError;\n\n var validationResults = _utils2.default.runRules(value, currentValues, component.validations, _validationRules2.default);\n var requiredResults = _utils2.default.runRules(value, currentValues, component.requiredValidations, _validationRules2.default);\n\n var isRequired = Object.keys(component.requiredValidations).length ? !!requiredResults.success.length : false;\n var isValid = !validationResults.failed.length && !(this.props.validationErrors && this.props.validationErrors[component.props.name]);\n\n return {\n isRequired: isRequired,\n isValid: isRequired ? false : isValid,\n error: function () {\n if (isValid && !isRequired) {\n return [];\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (_this3.props.validationErrors && _this3.props.validationErrors[component.props.name]) {\n return typeof _this3.props.validationErrors[component.props.name] === 'string' ? [_this3.props.validationErrors[component.props.name]] : _this3.props.validationErrors[component.props.name];\n }\n\n if (isRequired) {\n var error = validationErrors[requiredResults.success[0]];\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed.map(function (failed) {\n return validationErrors[failed] ? validationErrors[failed] : validationError;\n }).filter(function (x, pos, arr) {\n return arr.indexOf(x) === pos;\n }); // remove duplicates\n }\n\n return undefined;\n }()\n };\n }\n\n // Method put on each input component to register\n // itself to the form\n\n }, {\n key: 'attachToForm',\n value: function attachToForm(component) {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n this.validate(component);\n }\n\n // Method put on each input component to unregister\n // itself from the form\n\n }, {\n key: 'detachFromForm',\n value: function detachFromForm(component) {\n var componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n }\n\n // Checks if the values have changed from their initial value\n\n }, {\n key: 'isChanged',\n value: function isChanged() {\n return !_utils2.default.isSame(this.getPristineValues(), this.getCurrentValues());\n }\n\n // Update model, submit to url prop and send the model\n\n }, {\n key: 'submit',\n value: function submit(event) {\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n var model = this.getModel();\n this.props.onSubmit(model, this.resetModel, this.updateInputsWithError);\n if (this.state.isValid) {\n this.props.onValidSubmit(model, this.resetModel, this.updateInputsWithError);\n } else {\n this.props.onInvalidSubmit(model, this.resetModel, this.updateInputsWithError);\n }\n }\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n\n }, {\n key: 'updateInputsWithError',\n value: function updateInputsWithError(errors) {\n var _this4 = this;\n\n Object.keys(errors).forEach(function (name) {\n var component = _utils2.default.find(_this4.inputs, function (input) {\n return input.props.name === name;\n });\n if (!component) {\n throw new Error('You are trying to update an input that does not exist. Verify errors object with input names. ' + JSON.stringify(errors));\n }\n var args = [{\n isValid: _this4.props.preventExternalInvalidation,\n externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n }\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n\n }, {\n key: 'validate',\n value: function validate(component) {\n // Trigger onChange\n if (this.state.canChange) {\n this.props.onChange(this.getCurrentValues(), this.isChanged());\n }\n\n var validation = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState({\n isValid: validation.isValid,\n isRequired: validation.isRequired,\n validationError: validation.error,\n externalError: null\n }, this.validateForm);\n }\n\n // Validate the form by going through all child input components\n // and check their state\n\n }, {\n key: 'validateForm',\n value: function validateForm() {\n var _this5 = this;\n\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n var onValidationComplete = function onValidationComplete() {\n var allIsValid = _this5.inputs.every(function (component) {\n return component.state.isValid;\n });\n\n _this5.setState({\n isValid: allIsValid\n });\n\n if (allIsValid) {\n _this5.props.onValid();\n } else {\n _this5.props.onInvalid();\n }\n\n // Tell the form that it can start to trigger change events\n _this5.setState({\n canChange: true\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach(function (component, index) {\n var validation = _this5.runValidation(component);\n if (validation.isValid && component.state.externalError) {\n validation.isValid = false;\n }\n component.setState({\n isValid: validation.isValid,\n isRequired: validation.isRequired,\n validationError: validation.error,\n externalError: !validation.isValid && component.state.externalError ? component.state.externalError : null\n }, index === _this5.inputs.length - 1 ? onValidationComplete : null);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState({\n canChange: true\n });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n getErrorMessage = _props.getErrorMessage,\n getErrorMessages = _props.getErrorMessages,\n getValue = _props.getValue,\n hasValue = _props.hasValue,\n isFormDisabled = _props.isFormDisabled,\n isFormSubmitted = _props.isFormSubmitted,\n isPristine = _props.isPristine,\n isRequired = _props.isRequired,\n isValid = _props.isValid,\n isValidValue = _props.isValidValue,\n mapping = _props.mapping,\n onChange = _props.onChange,\n onInvalidSubmit = _props.onInvalidSubmit,\n onInvalid = _props.onInvalid,\n onReset = _props.onReset,\n onSubmit = _props.onSubmit,\n onValid = _props.onValid,\n onValidSubmit = _props.onValidSubmit,\n preventExternalInvalidation = _props.preventExternalInvalidation,\n resetValue = _props.resetValue,\n setValidations = _props.setValidations,\n setValue = _props.setValue,\n showError = _props.showError,\n showRequired = _props.showRequired,\n validationErrors = _props.validationErrors,\n nonFormsyProps = _objectWithoutProperties(_props, ['getErrorMessage', 'getErrorMessages', 'getValue', 'hasValue', 'isFormDisabled', 'isFormSubmitted', 'isPristine', 'isRequired', 'isValid', 'isValidValue', 'mapping', 'onChange', 'onInvalidSubmit', 'onInvalid', 'onReset', 'onSubmit', 'onValid', 'onValidSubmit', 'preventExternalInvalidation', 'resetValue', 'setValidations', 'setValue', 'showError', 'showRequired', 'validationErrors']);\n\n return _react2.default.createElement('form', _extends({\n onReset: this.resetInternal,\n onSubmit: this.submit\n }, nonFormsyProps), this.props.children);\n }\n }]);\n\n return Formsy;\n}(_react2.default.Component);\n\nFormsy.displayName = 'Formsy';\n\nFormsy.defaultProps = {\n children: null,\n disabled: false,\n getErrorMessage: function getErrorMessage() {},\n getErrorMessages: function getErrorMessages() {},\n getValue: function getValue() {},\n hasValue: function hasValue() {},\n isFormDisabled: function isFormDisabled() {},\n isFormSubmitted: function isFormSubmitted() {},\n isPristine: function isPristine() {},\n isRequired: function isRequired() {},\n isValid: function isValid() {},\n isValidValue: function isValidValue() {},\n mapping: null,\n onChange: function onChange() {},\n onError: function onError() {},\n onInvalid: function onInvalid() {},\n onInvalidSubmit: function onInvalidSubmit() {},\n onReset: function onReset() {},\n onSubmit: function onSubmit() {},\n onValid: function onValid() {},\n onValidSubmit: function onValidSubmit() {},\n preventExternalInvalidation: false,\n resetValue: function resetValue() {},\n setValidations: function setValidations() {},\n setValue: function setValue() {},\n showError: function showError() {},\n showRequired: function showRequired() {},\n validationErrors: null\n};\n\nFormsy.propTypes = {\n children: _propTypes2.default.node,\n disabled: _propTypes2.default.bool,\n getErrorMessage: _propTypes2.default.func,\n getErrorMessages: _propTypes2.default.func,\n getValue: _propTypes2.default.func,\n hasValue: _propTypes2.default.func,\n isFormDisabled: _propTypes2.default.func,\n isFormSubmitted: _propTypes2.default.func,\n isPristine: _propTypes2.default.func,\n isRequired: _propTypes2.default.func,\n isValid: _propTypes2.default.func,\n isValidValue: _propTypes2.default.func,\n mapping: _propTypes2.default.func,\n preventExternalInvalidation: _propTypes2.default.bool,\n onChange: _propTypes2.default.func,\n onInvalid: _propTypes2.default.func,\n onInvalidSubmit: _propTypes2.default.func,\n onReset: _propTypes2.default.func,\n onSubmit: _propTypes2.default.func,\n onValid: _propTypes2.default.func,\n onValidSubmit: _propTypes2.default.func,\n resetValue: _propTypes2.default.func,\n setValidations: _propTypes2.default.func,\n setValue: _propTypes2.default.func,\n showError: _propTypes2.default.func,\n showRequired: _propTypes2.default.func,\n validationErrors: _propTypes2.default.object // eslint-disable-line\n};\n\nFormsy.childContextTypes = {\n formsy: _propTypes2.default.object\n};\n\nvar addValidationRule = function addValidationRule(name, func) {\n _validationRules2.default[name] = func;\n};\n\nvar withFormsy = _Wrapper2.default;\n\nvar deprecatedWrapper = function deprecatedWrapper(Component) {\n // eslint-disable-next-line no-console\n console.warn('Wrapper has been renamed to withFormsy. Importing Wrapper from formsy-react is depreacted and will be removed in the future. Please rename your Wrapper imports to withFormsy.');\n\n return withFormsy(Component);\n};\n\nexports.addValidationRule = addValidationRule;\nexports.propTypes = _Wrapper.propTypes;\nexports.validationRules = _validationRules2.default;\nexports.withFormsy = withFormsy;\nexports.Wrapper = deprecatedWrapper;\nexports.default = Formsy;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nfunction toObj(source) {\n return Object.keys(source).reduce(function (output, key) {\n var parentKey = key.match(/[^\\[]*/i);\n var paths = key.match(/\\[.*?\\]/g) || [];\n paths = [parentKey[0]].concat(paths).map(function (key) {\n return key.replace(/\\[|\\]/g, '');\n });\n var currentPath = output;\n while (paths.length) {\n var pathKey = paths.shift();\n\n if (pathKey in currentPath) {\n currentPath = currentPath[pathKey];\n } else {\n currentPath[pathKey] = paths.length ? isNaN(paths[0]) ? {} : [] : source[key];\n currentPath = currentPath[pathKey];\n }\n }\n\n return output;\n }, {});\n}\n\nfunction fromObj(obj) {\n function recur(newObj, propName, currVal) {\n if (Array.isArray(currVal) || Object.prototype.toString.call(currVal) === '[object Object]') {\n Object.keys(currVal).forEach(function(v) {\n recur(newObj, propName + \"[\" + v + \"]\", currVal[v]);\n });\n return newObj;\n }\n\n newObj[propName] = currVal;\n return newObj;\n }\n\n var keys = Object.keys(obj);\n return keys.reduce(function(newObj, propName) {\n return recur(newObj, propName, obj[propName]);\n }, {});\n}\n\nmodule.exports = {\n fromObj: fromObj,\n toObj: toObj\n}\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar emptyFunction = __webpack_require__(6);\nvar invariant = __webpack_require__(7);\nvar ReactPropTypesSecret = __webpack_require__(8);\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (false) {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar _isExisty = function _isExisty(value) {\n return value !== null && value !== undefined;\n};\nvar isEmpty = function isEmpty(value) {\n return value === '';\n};\n\nvar validations = {\n isDefaultRequiredValue: function isDefaultRequiredValue(values, value) {\n return value === undefined || value === '';\n },\n isExisty: function isExisty(values, value) {\n return _isExisty(value);\n },\n matchRegexp: function matchRegexp(values, value, regexp) {\n return !_isExisty(value) || isEmpty(value) || regexp.test(value);\n },\n isUndefined: function isUndefined(values, value) {\n return value === undefined;\n },\n isEmptyString: function isEmptyString(values, value) {\n return isEmpty(value);\n },\n isEmail: function isEmail(values, value) {\n // Regex from http://emailregex.com/\n return validations.matchRegexp(values, value, /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/i);\n },\n isUrl: function isUrl(values, value) {\n return validations.matchRegexp(values, value, /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i);\n },\n isTrue: function isTrue(values, value) {\n return value === true;\n },\n isFalse: function isFalse(values, value) {\n return value === false;\n },\n isNumeric: function isNumeric(values, value) {\n if (typeof value === 'number') {\n return true;\n }\n return validations.matchRegexp(values, value, /^[-+]?(?:\\d*[.])?\\d+$/);\n },\n isAlpha: function isAlpha(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z]+$/i);\n },\n isAlphanumeric: function isAlphanumeric(values, value) {\n return validations.matchRegexp(values, value, /^[0-9A-Z]+$/i);\n },\n isInt: function isInt(values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:0|[1-9]\\d*))$/);\n },\n isFloat: function isFloat(values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/);\n },\n isWords: function isWords(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s]+$/i);\n },\n isSpecialWords: function isSpecialWords(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s\\u00C0-\\u017F]+$/i);\n },\n isLength: function isLength(values, value, length) {\n return !_isExisty(value) || isEmpty(value) || value.length === length;\n },\n equals: function equals(values, value, eql) {\n return !_isExisty(value) || isEmpty(value) || value === eql;\n },\n equalsField: function equalsField(values, value, field) {\n return value === values[field];\n },\n maxLength: function maxLength(values, value, length) {\n return !_isExisty(value) || value.length <= length;\n },\n minLength: function minLength(values, value, length) {\n return !_isExisty(value) || isEmpty(value) || value.length >= length;\n }\n};\n\nexports.default = validations;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.propTypes = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _propTypes = __webpack_require__(0);\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _react = __webpack_require__(1);\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _utils = __webpack_require__(2);\n\nvar _utils2 = _interopRequireDefault(_utils);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar convertValidationsToObject = function convertValidationsToObject(validations) {\n if (typeof validations === 'string') {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce(function (validationsAccumulator, validation) {\n var args = validation.split(':');\n var validateMethod = args.shift();\n\n args = args.map(function (arg) {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error('Formsy does not support multiple args on string validations. Use object format of validations instead.');\n }\n\n // Avoid parameter reassignment\n var validationsAccumulatorCopy = Object.assign({}, validationsAccumulator);\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nvar propTypes = {\n innerRef: _propTypes2.default.func,\n name: _propTypes2.default.string.isRequired,\n required: _propTypes2.default.bool,\n validations: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.string]),\n value: _propTypes2.default.any // eslint-disable-line react/forbid-prop-types\n};\n\nexports.propTypes = propTypes;\n\nexports.default = function (Component) {\n var WrappedComponent = function (_React$Component) {\n _inherits(WrappedComponent, _React$Component);\n\n function WrappedComponent(props) {\n _classCallCheck(this, WrappedComponent);\n\n var _this = _possibleConstructorReturn(this, (WrappedComponent.__proto__ || Object.getPrototypeOf(WrappedComponent)).call(this, props));\n\n _this.getErrorMessage = function () {\n var messages = _this.getErrorMessages();\n return messages.length ? messages[0] : null;\n };\n\n _this.getErrorMessages = function () {\n if (!_this.isValid() || _this.showRequired()) {\n return _this.state.externalError || _this.state.validationError || [];\n }\n return [];\n };\n\n _this.getValue = function () {\n return _this.state.value;\n };\n\n _this.setValidations = function (validations, required) {\n // Add validations to the store itself as the props object can not be modified\n _this.validations = convertValidationsToObject(validations) || {};\n _this.requiredValidations = required === true ? { isDefaultRequiredValue: true } : convertValidationsToObject(required);\n };\n\n _this.setValue = function (value) {\n var validate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n if (!validate) {\n _this.setState({\n value: value\n });\n } else {\n _this.setState({\n value: value,\n isPristine: false\n }, function () {\n _this.context.formsy.validate(_this);\n });\n }\n };\n\n _this.hasValue = function () {\n return _this.state.value !== '';\n };\n\n _this.isFormDisabled = function () {\n return _this.context.formsy.isFormDisabled();\n };\n\n _this.isFormSubmitted = function () {\n return _this.state.formSubmitted;\n };\n\n _this.isPristine = function () {\n return _this.state.isPristine;\n };\n\n _this.isRequired = function () {\n return !!_this.props.required;\n };\n\n _this.isValid = function () {\n return _this.state.isValid;\n };\n\n _this.isValidValue = function (value) {\n return _this.context.formsy.isValidValue.call(null, _this, value);\n };\n\n _this.resetValue = function () {\n _this.setState({\n value: _this.state.pristineValue,\n isPristine: true\n }, function () {\n _this.context.formsy.validate(_this);\n });\n };\n\n _this.showError = function () {\n return !_this.showRequired() && !_this.isValid();\n };\n\n _this.showRequired = function () {\n return _this.state.isRequired;\n };\n\n _this.state = {\n value: props.value,\n isRequired: false,\n isValid: true,\n isPristine: true,\n pristineValue: props.value,\n validationError: [],\n externalError: null,\n formSubmitted: false\n };\n return _this;\n }\n\n _createClass(WrappedComponent, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n var _this2 = this;\n\n var configure = function configure() {\n _this2.setValidations(_this2.props.validations, _this2.props.required);\n\n // Pass a function instead?\n _this2.context.formsy.attachToForm(_this2);\n };\n\n if (!this.props.name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n configure();\n }\n\n // We have to make sure the validate method is kept when new props are added\n\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n this.setValidations(nextProps.validations, nextProps.required);\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!_utils2.default.isSame(this.props.value, prevProps.value)) {\n this.setValue(this.props.value);\n }\n\n // If validations or required is changed, run a new validation\n if (!_utils2.default.isSame(this.props.validations, prevProps.validations) || !_utils2.default.isSame(this.props.required, prevProps.required)) {\n this.context.formsy.validate(this);\n }\n }\n\n // Detach it when component unmounts\n\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.context.formsy.detachFromForm(this);\n }\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n\n }, {\n key: 'render',\n value: function render() {\n var innerRef = this.props.innerRef;\n\n var propsForElement = _extends({\n getErrorMessage: this.getErrorMessage,\n getErrorMessages: this.getErrorMessages,\n getValue: this.getValue,\n hasValue: this.hasValue,\n isFormDisabled: this.isFormDisabled,\n isValid: this.isValid,\n isPristine: this.isPristine,\n isFormSubmitted: this.isFormSubmitted,\n isRequired: this.isRequired,\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showRequired: this.showRequired,\n showError: this.showError\n }, this.props);\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return _react2.default.createElement(Component, propsForElement);\n }\n }]);\n\n return WrappedComponent;\n }(_react2.default.Component);\n\n function getDisplayName(component) {\n return component.displayName || component.name || (typeof component === 'string' ? component : 'Component');\n }\n\n WrappedComponent.displayName = 'Formsy(' + getDisplayName(Component) + ')';\n\n WrappedComponent.contextTypes = {\n formsy: _propTypes2.default.object // What about required?\n };\n\n WrappedComponent.defaultProps = {\n innerRef: function innerRef() {},\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: Component.defaultValue\n };\n\n WrappedComponent.propTypes = propTypes;\n\n return WrappedComponent;\n};\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// formsy-react.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f8b95deee34b621baecf","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/prop-types/index.js\n// module id = 0\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\",\"umd\":\"react\"}\n// module id = 1\n// module chunks = 0","export default {\n arraysDiffer(a, b) {\n let isDifferent = false;\n if (a.length !== b.length) {\n isDifferent = true;\n } else {\n a.forEach((item, index) => {\n if (!this.isSame(item, b[index])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n\n objectsDiffer(a, b) {\n let isDifferent = false;\n if (Object.keys(a).length !== Object.keys(b).length) {\n isDifferent = true;\n } else {\n Object.keys(a).forEach((key) => {\n if (!this.isSame(a[key], b[key])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n\n isSame(a, b) {\n if (typeof a !== typeof b) {\n return false;\n } else if (Array.isArray(a) && Array.isArray(b)) {\n return !this.arraysDiffer(a, b);\n } else if (typeof a === 'function') {\n return a.toString() === b.toString();\n } else if (typeof a === 'object' && a !== null && b !== null) {\n return !this.objectsDiffer(a, b);\n }\n\n return a === b;\n },\n\n find(collection, fn) {\n for (let i = 0, l = collection.length; i < l; i += 1) {\n const item = collection[i];\n if (fn(item)) {\n return item;\n }\n }\n return null;\n },\n\n runRules(value, currentValues, validations, validationRules) {\n const results = {\n errors: [],\n failed: [],\n success: [],\n };\n\n if (Object.keys(validations).length) {\n Object.keys(validations).forEach((validationMethod) => {\n if (validationRules[validationMethod] && typeof validations[validationMethod] === 'function') {\n throw new Error(`Formsy does not allow you to override default validations: ${validationMethod}`);\n }\n\n if (!validationRules[validationMethod] && typeof validations[validationMethod] !== 'function') {\n throw new Error(`Formsy does not have the validation rule: ${validationMethod}`);\n }\n\n if (typeof validations[validationMethod] === 'function') {\n const validation = validations[validationMethod](currentValues, value);\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n }\n return;\n } else if (typeof validations[validationMethod] !== 'function') {\n const validation = validationRules[validationMethod](\n currentValues, value, validations[validationMethod],\n );\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n } else {\n results.success.push(validationMethod);\n }\n return;\n }\n\n results.success.push(validationMethod);\n });\n }\n\n return results;\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","import formDataToObject from 'form-data-to-object';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nimport utils from './utils';\nimport validationRules from './validationRules';\nimport Wrapper, { propTypes } from './Wrapper';\n\nclass Formsy extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n isValid: true,\n isSubmitting: false,\n canChange: false,\n };\n this.inputs = [];\n this.attachToForm = this.attachToForm.bind(this);\n this.detachFromForm = this.detachFromForm.bind(this);\n this.getCurrentValues = this.getCurrentValues.bind(this);\n this.getPristineValues = this.getPristineValues.bind(this);\n this.isChanged = this.isChanged.bind(this);\n this.isFormDisabled = this.isFormDisabled.bind(this);\n this.reset = this.reset.bind(this);\n this.resetInternal = this.resetInternal.bind(this);\n this.runValidation = this.runValidation.bind(this);\n this.submit = this.submit.bind(this);\n this.updateInputsWithError = this.updateInputsWithError.bind(this);\n this.validate = this.validate.bind(this);\n this.validateForm = this.validateForm.bind(this);\n }\n\n getChildContext() {\n return {\n formsy: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n validate: this.validate,\n isFormDisabled: this.isFormDisabled,\n isValidValue: (component, value) => this.runValidation(component, value).isValid,\n },\n };\n }\n\n componentDidMount() {\n this.validateForm();\n }\n\n componentWillUpdate() {\n // Keep a reference to input names before form updates,\n // to check if inputs has changed after render\n this.prevInputNames = this.inputs.map(component => component.props.name);\n }\n\n componentDidUpdate() {\n if (this.props.validationErrors && typeof this.props.validationErrors === 'object' && Object.keys(this.props.validationErrors).length > 0) {\n this.setInputValidationErrors(this.props.validationErrors);\n }\n\n const newInputNames = this.inputs.map(component => component.props.name);\n if (utils.arraysDiffer(this.prevInputNames, newInputNames)) {\n this.validateForm();\n }\n }\n\n getCurrentValues() {\n return this.inputs.reduce((data, component) => {\n const name = component.props.name;\n const dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.state.value;\n return dataCopy;\n }, {});\n }\n\n getModel() {\n const currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n }\n\n getPristineValues() {\n return this.inputs.reduce((data, component) => {\n const name = component.props.name;\n const dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.props.value;\n return dataCopy;\n }, {});\n }\n\n setFormPristine(isPristine) {\n this.setState({\n formSubmitted: !isPristine,\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component) => {\n component.setState({\n formSubmitted: !isPristine,\n isPristine,\n });\n });\n }\n\n setInputValidationErrors(errors) {\n this.inputs.forEach((component) => {\n const name = component.props.name;\n const args = [{\n isValid: !(name in errors),\n validationError: typeof errors[name] === 'string' ? [errors[name]] : errors[name],\n }];\n component.setState(...args);\n });\n }\n\n isFormDisabled() {\n return this.props.disabled;\n }\n\n mapModel(model) {\n if (this.props.mapping) {\n return this.props.mapping(model);\n }\n\n return formDataToObject.toObj(Object.keys(model).reduce((mappedModel, key) => {\n const keyArray = key.split('.');\n let base = mappedModel;\n while (keyArray.length) {\n const currentKey = keyArray.shift();\n base[currentKey] = (keyArray.length ? base[currentKey] || {} : model[key]);\n base = base[currentKey];\n }\n return mappedModel;\n }, {}));\n }\n\n reset(data) {\n this.setFormPristine(true);\n this.resetModel(data);\n }\n\n resetInternal(event) {\n event.preventDefault();\n this.reset();\n if (this.props.onReset) {\n this.props.onReset();\n }\n }\n\n // Reset each key in the model to the original / initial / specified value\n resetModel(data) {\n this.inputs.forEach((component) => {\n const name = component.props.name;\n if (data && Object.prototype.hasOwnProperty.call(data, name)) {\n component.setValue(data[name]);\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n }\n\n // Checks validation on current value or a passed value\n runValidation(component, value = component.state.value) {\n const currentValues = this.getCurrentValues();\n const validationErrors = component.props.validationErrors;\n const validationError = component.props.validationError;\n\n const validationResults = utils.runRules(\n value, currentValues, component.validations, validationRules,\n );\n const requiredResults = utils.runRules(\n value, currentValues, component.requiredValidations, validationRules,\n );\n\n const isRequired = Object.keys(component.requiredValidations).length ?\n !!requiredResults.success.length : false;\n const isValid = !validationResults.failed.length &&\n !(this.props.validationErrors && this.props.validationErrors[component.props.name]);\n\n return {\n isRequired,\n isValid: isRequired ? false : isValid,\n error: (() => {\n if (isValid && !isRequired) {\n return [];\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (this.props.validationErrors && this.props.validationErrors[component.props.name]) {\n return typeof this.props.validationErrors[component.props.name] === 'string' ? [this.props.validationErrors[component.props.name]] : this.props.validationErrors[component.props.name];\n }\n\n if (isRequired) {\n const error = validationErrors[requiredResults.success[0]];\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed.map(failed =>\n (validationErrors[failed] ? validationErrors[failed] : validationError))\n .filter((x, pos, arr) => arr.indexOf(x) === pos); // remove duplicates\n }\n\n return undefined;\n })(),\n };\n }\n\n // Method put on each input component to register\n // itself to the form\n attachToForm(component) {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n this.validate(component);\n }\n\n // Method put on each input component to unregister\n // itself from the form\n detachFromForm(component) {\n const componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos).concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n }\n\n // Checks if the values have changed from their initial value\n isChanged() {\n return !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n }\n\n // Update model, submit to url prop and send the model\n submit(event) {\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n const model = this.getModel();\n this.props.onSubmit(model, this.resetModel, this.updateInputsWithError);\n if (this.state.isValid) {\n this.props.onValidSubmit(model, this.resetModel, this.updateInputsWithError);\n } else {\n this.props.onInvalidSubmit(model, this.resetModel, this.updateInputsWithError);\n }\n }\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n updateInputsWithError(errors) {\n Object.keys(errors).forEach((name) => {\n const component = utils.find(this.inputs, input => input.props.name === name);\n if (!component) {\n throw new Error(`You are trying to update an input that does not exist. Verify errors object with input names. ${JSON.stringify(errors)}`);\n }\n const args = [{\n isValid: this.props.preventExternalInvalidation,\n externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name],\n }];\n component.setState(...args);\n });\n }\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n validate(component) {\n // Trigger onChange\n if (this.state.canChange) {\n this.props.onChange(this.getCurrentValues(), this.isChanged());\n }\n\n const validation = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState({\n isValid: validation.isValid,\n isRequired: validation.isRequired,\n validationError: validation.error,\n externalError: null,\n }, this.validateForm);\n }\n\n // Validate the form by going through all child input components\n // and check their state\n validateForm() {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n const onValidationComplete = () => {\n const allIsValid = this.inputs.every(component => component.state.isValid);\n\n this.setState({\n isValid: allIsValid,\n });\n\n if (allIsValid) {\n this.props.onValid();\n } else {\n this.props.onInvalid();\n }\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true,\n });\n };\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n const validation = this.runValidation(component);\n if (validation.isValid && component.state.externalError) {\n validation.isValid = false;\n }\n component.setState({\n isValid: validation.isValid,\n isRequired: validation.isRequired,\n validationError: validation.error,\n externalError: !validation.isValid && component.state.externalError ?\n component.state.externalError : null,\n }, index === this.inputs.length - 1 ? onValidationComplete : null);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState({\n canChange: true,\n });\n }\n }\n\n render() {\n const {\n getErrorMessage,\n getErrorMessages,\n getValue,\n hasValue,\n isFormDisabled,\n isFormSubmitted,\n isPristine,\n isRequired,\n isValid,\n isValidValue,\n mapping,\n onChange,\n // onError,\n onInvalidSubmit,\n onInvalid,\n onReset,\n onSubmit,\n onValid,\n onValidSubmit,\n preventExternalInvalidation,\n // reset,\n resetValue,\n setValidations,\n setValue,\n showError,\n showRequired,\n validationErrors,\n ...nonFormsyProps\n } = this.props;\n\n return React.createElement(\n 'form',\n {\n onReset: this.resetInternal,\n onSubmit: this.submit,\n ...nonFormsyProps,\n },\n this.props.children,\n );\n }\n}\n\nFormsy.displayName = 'Formsy';\n\nFormsy.defaultProps = {\n children: null,\n disabled: false,\n getErrorMessage: () => {},\n getErrorMessages: () => {},\n getValue: () => {},\n hasValue: () => {},\n isFormDisabled: () => {},\n isFormSubmitted: () => {},\n isPristine: () => {},\n isRequired: () => {},\n isValid: () => {},\n isValidValue: () => {},\n mapping: null,\n onChange: () => {},\n onError: () => {},\n onInvalid: () => {},\n onInvalidSubmit: () => {},\n onReset: () => {},\n onSubmit: () => {},\n onValid: () => {},\n onValidSubmit: () => {},\n preventExternalInvalidation: false,\n resetValue: () => {},\n setValidations: () => {},\n setValue: () => {},\n showError: () => {},\n showRequired: () => {},\n validationErrors: null,\n};\n\nFormsy.propTypes = {\n children: PropTypes.node,\n disabled: PropTypes.bool,\n getErrorMessage: PropTypes.func,\n getErrorMessages: PropTypes.func,\n getValue: PropTypes.func,\n hasValue: PropTypes.func,\n isFormDisabled: PropTypes.func,\n isFormSubmitted: PropTypes.func,\n isPristine: PropTypes.func,\n isRequired: PropTypes.func,\n isValid: PropTypes.func,\n isValidValue: PropTypes.func,\n mapping: PropTypes.func,\n preventExternalInvalidation: PropTypes.bool,\n onChange: PropTypes.func,\n onInvalid: PropTypes.func,\n onInvalidSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSubmit: PropTypes.func,\n onValid: PropTypes.func,\n onValidSubmit: PropTypes.func,\n resetValue: PropTypes.func,\n setValidations: PropTypes.func,\n setValue: PropTypes.func,\n showError: PropTypes.func,\n showRequired: PropTypes.func,\n validationErrors: PropTypes.object, // eslint-disable-line\n};\n\nFormsy.childContextTypes = {\n formsy: PropTypes.object,\n};\n\nconst addValidationRule = (name, func) => {\n validationRules[name] = func;\n};\n\nconst withFormsy = Wrapper;\n\nconst deprecatedWrapper = (Component) => {\n // eslint-disable-next-line no-console\n console.warn('Wrapper has been renamed to withFormsy. Importing Wrapper from formsy-react is depreacted and will be removed in the future. Please rename your Wrapper imports to withFormsy.');\n\n return withFormsy(Component);\n};\n\nexport {\n addValidationRule,\n propTypes,\n validationRules,\n withFormsy,\n deprecatedWrapper as Wrapper,\n};\n\nexport default Formsy;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","function toObj(source) {\n return Object.keys(source).reduce(function (output, key) {\n var parentKey = key.match(/[^\\[]*/i);\n var paths = key.match(/\\[.*?\\]/g) || [];\n paths = [parentKey[0]].concat(paths).map(function (key) {\n return key.replace(/\\[|\\]/g, '');\n });\n var currentPath = output;\n while (paths.length) {\n var pathKey = paths.shift();\n\n if (pathKey in currentPath) {\n currentPath = currentPath[pathKey];\n } else {\n currentPath[pathKey] = paths.length ? isNaN(paths[0]) ? {} : [] : source[key];\n currentPath = currentPath[pathKey];\n }\n }\n\n return output;\n }, {});\n}\n\nfunction fromObj(obj) {\n function recur(newObj, propName, currVal) {\n if (Array.isArray(currVal) || Object.prototype.toString.call(currVal) === '[object Object]') {\n Object.keys(currVal).forEach(function(v) {\n recur(newObj, propName + \"[\" + v + \"]\", currVal[v]);\n });\n return newObj;\n }\n\n newObj[propName] = currVal;\n return newObj;\n }\n\n var keys = Object.keys(obj);\n return keys.reduce(function(newObj, propName) {\n return recur(newObj, propName, obj[propName]);\n }, {});\n}\n\nmodule.exports = {\n fromObj: fromObj,\n toObj: toObj\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/form-data-to-object/index.js\n// module id = 4\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/prop-types/factoryWithThrowingShims.js\n// module id = 5\n// module chunks = 0","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fbjs/lib/emptyFunction.js\n// module id = 6\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fbjs/lib/invariant.js\n// module id = 7\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/prop-types/lib/ReactPropTypesSecret.js\n// module id = 8\n// module chunks = 0","const isExisty = value => value !== null && value !== undefined;\nconst isEmpty = value => value === '';\n\nconst validations = {\n isDefaultRequiredValue(values, value) {\n return value === undefined || value === '';\n },\n isExisty(values, value) {\n return isExisty(value);\n },\n matchRegexp(values, value, regexp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(value);\n },\n isUndefined(values, value) {\n return value === undefined;\n },\n isEmptyString(values, value) {\n return isEmpty(value);\n },\n isEmail(values, value) {\n // Regex from http://emailregex.com/\n return validations.matchRegexp(values, value, /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/i);\n },\n isUrl(values, value) {\n return validations.matchRegexp(values, value, /^(?:\\w+:)?\\/\\/([^\\s.]+\\.\\S{2}|localhost[:?\\d]*)\\S*$/i);\n },\n isTrue(values, value) {\n return value === true;\n },\n isFalse(values, value) {\n return value === false;\n },\n isNumeric(values, value) {\n if (typeof value === 'number') {\n return true;\n }\n return validations.matchRegexp(values, value, /^[-+]?(?:\\d*[.])?\\d+$/);\n },\n isAlpha(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z]+$/i);\n },\n isAlphanumeric(values, value) {\n return validations.matchRegexp(values, value, /^[0-9A-Z]+$/i);\n },\n isInt(values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:0|[1-9]\\d*))$/);\n },\n isFloat(values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][+-]?(?:\\d+))?$/);\n },\n isWords(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s]+$/i);\n },\n isSpecialWords(values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s\\u00C0-\\u017F]+$/i);\n },\n isLength(values, value, length) {\n return !isExisty(value) || isEmpty(value) || value.length === length;\n },\n equals(values, value, eql) {\n return !isExisty(value) || isEmpty(value) || value === eql;\n },\n equalsField(values, value, field) {\n return value === values[field];\n },\n maxLength(values, value, length) {\n return !isExisty(value) || value.length <= length;\n },\n minLength(values, value, length) {\n return !isExisty(value) || isEmpty(value) || value.length >= length;\n },\n};\n\nexport default validations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/validationRules.js","import PropTypes from 'prop-types';\nimport React from 'react';\nimport utils from './utils';\n\nconst convertValidationsToObject = (validations) => {\n if (typeof validations === 'string') {\n return validations.split(/,(?![^{[]*[}\\]])/g).reduce((validationsAccumulator, validation) => {\n let args = validation.split(':');\n const validateMethod = args.shift();\n\n args = args.map((arg) => {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error('Formsy does not support multiple args on string validations. Use object format of validations instead.');\n }\n\n // Avoid parameter reassignment\n const validationsAccumulatorCopy = Object.assign({}, validationsAccumulator);\n validationsAccumulatorCopy[validateMethod] = args.length ? args[0] : true;\n return validationsAccumulatorCopy;\n }, {});\n }\n\n return validations || {};\n};\n\nconst propTypes = {\n innerRef: PropTypes.func,\n name: PropTypes.string.isRequired,\n required: PropTypes.bool,\n validations: PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.string,\n ]),\n value: PropTypes.any, // eslint-disable-line react/forbid-prop-types\n};\n\nexport {\n propTypes,\n};\n\nexport default (Component) => {\n class WrappedComponent extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: props.value,\n isRequired: false,\n isValid: true,\n isPristine: true,\n pristineValue: props.value,\n validationError: [],\n externalError: null,\n formSubmitted: false,\n };\n }\n\n componentWillMount() {\n const configure = () => {\n this.setValidations(this.props.validations, this.props.required);\n\n // Pass a function instead?\n this.context.formsy.attachToForm(this);\n };\n\n if (!this.props.name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n configure();\n }\n\n // We have to make sure the validate method is kept when new props are added\n componentWillReceiveProps(nextProps) {\n this.setValidations(nextProps.validations, nextProps.required);\n }\n\n componentDidUpdate(prevProps) {\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(this.props.value, prevProps.value)) {\n this.setValue(this.props.value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(this.props.validations, prevProps.validations) ||\n !utils.isSame(this.props.required, prevProps.required)) {\n this.context.formsy.validate(this);\n }\n }\n\n // Detach it when component unmounts\n componentWillUnmount() {\n this.context.formsy.detachFromForm(this);\n }\n\n getErrorMessage = () => {\n const messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n }\n\n getErrorMessages = () => {\n if (!this.isValid() || this.showRequired()) {\n return this.state.externalError || this.state.validationError || [];\n }\n return [];\n }\n\n getValue = () => this.state.value;\n\n setValidations = (validations, required) => {\n // Add validations to the store itself as the props object can not be modified\n this.validations = convertValidationsToObject(validations) || {};\n this.requiredValidations = required === true ? { isDefaultRequiredValue: true } :\n convertValidationsToObject(required);\n }\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n setValue = (value, validate = true) => {\n if (!validate) {\n this.setState({\n value,\n });\n } else {\n this.setState({\n value,\n isPristine: false,\n }, () => {\n this.context.formsy.validate(this);\n });\n }\n }\n\n hasValue = () => this.state.value !== '';\n\n isFormDisabled = () => this.context.formsy.isFormDisabled();\n\n isFormSubmitted = () => this.state.formSubmitted;\n\n isPristine = () => this.state.isPristine;\n\n isRequired = () => !!this.props.required;\n\n isValid = () => this.state.isValid;\n\n isValidValue = value =>\n this.context.formsy.isValidValue.call(null, this, value);\n\n resetValue = () => {\n this.setState({\n value: this.state.pristineValue,\n isPristine: true,\n }, () => {\n this.context.formsy.validate(this);\n });\n }\n\n showError = () => !this.showRequired() && !this.isValid();\n\n showRequired = () => this.state.isRequired;\n\n render() {\n const { innerRef } = this.props;\n const propsForElement = {\n getErrorMessage: this.getErrorMessage,\n getErrorMessages: this.getErrorMessages,\n getValue: this.getValue,\n hasValue: this.hasValue,\n isFormDisabled: this.isFormDisabled,\n isValid: this.isValid,\n isPristine: this.isPristine,\n isFormSubmitted: this.isFormSubmitted,\n isRequired: this.isRequired,\n isValidValue: this.isValidValue,\n resetValue: this.resetValue,\n setValidations: this.setValidations,\n setValue: this.setValue,\n showRequired: this.showRequired,\n showError: this.showError,\n ...this.props,\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return React.createElement(Component, propsForElement);\n }\n }\n\n function getDisplayName(component) {\n return (\n component.displayName ||\n component.name ||\n (typeof component === 'string' ? component : 'Component')\n );\n }\n\n WrappedComponent.displayName = `Formsy(${getDisplayName(Component)})`;\n\n WrappedComponent.contextTypes = {\n formsy: PropTypes.object, // What about required?\n };\n\n WrappedComponent.defaultProps = {\n innerRef: () => {},\n required: false,\n validationError: '',\n validationErrors: {},\n validations: null,\n value: Component.defaultValue,\n };\n\n WrappedComponent.propTypes = propTypes;\n\n return WrappedComponent;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/Wrapper.js"],"sourceRoot":""} \ No newline at end of file