From 5da2ba519def090d94875df6e989550dcb9eb4f2 Mon Sep 17 00:00:00 2001 From: Robert Kuykendall Date: Tue, 12 Dec 2017 21:41:31 -0500 Subject: [PATCH] 1.1.2 --- CHANGELOG.md | 8 ++++++++ package.json | 4 ++-- release/formsy-react.js.map | 2 +- yarn.lock | 6 +++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9049ff12..ee7856bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ + +## [1.1.2](https://github.com/formsy/formsy-react/compare/v1.1.1...v1.1.2) (2017-12-13) + +### Bug Fixes + +* **deprecation:** Make Wrapper deprecation warning only show once ([#30](https://github.com/formsy/formsy-react/issues/30)) ([a1c0bbe](https://github.com/formsy/formsy-react/commit/a1c0bbe)) +* **binding:** Fix resetForm throwing error due to bad binding ([#41](https://github.com/formsy/formsy-react/issues/41)) ([b58cfd](https://github.com/formsy/formsy-react/commit/b58cfd)) + # [1.1.1](https://github.com/formsy/formsy-react/compare/v1.1.0...v1.1.1) (2017-11-22) diff --git a/package.json b/package.json index e8a527cc..1d0630d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "formsy-react", - "version": "1.1.1", + "version": "1.1.2", "description": "A form input builder and validator for React", "keywords": [ "form", @@ -46,7 +46,7 @@ "babel-preset-es2015": "^6.24.1", "babel-preset-react": "^6.24.1", "babel-preset-stage-2": "^6.24.1", - "eslint": "^4.13.0", + "eslint": "^4.13.1", "eslint-config-airbnb": "^16.1.0", "eslint-plugin-import": "^2.7.0", "eslint-plugin-jsx-a11y": "^6.0.2", diff --git a/release/formsy-react.js.map b/release/formsy-react.js.map index 696f2c29..0b167ee9 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 bdf4964b375525c54106","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","self","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","ReferenceError","_inherits","subClass","superClass","create","writable","setPrototypeOf","__proto__","Wrapper","withFormsy","propTypes","addValidationRule","undefined","_extends","assign","arguments","source","_formDataToObject","_formDataToObject2","_propTypes","_propTypes2","_react","_react2","_utils","_utils2","_validationRules","_validationRules2","_Wrapper","_Wrapper2","Formsy","_React$Component","props","getPrototypeOf","getChildContext","formsy","attachToForm","detachFromForm","validate","isFormDisabled","isValidValue","component","runValidation","isValid","componentDidMount","validateForm","componentWillUpdate","prevInputNames","inputs","map","componentDidUpdate","validationErrors","setInputValidationErrors","newInputNames","getCurrentValues","reduce","data","dataCopy","state","getModel","mapModel","getPristineValues","setFormPristine","isPristine","setState","formSubmitted","args","validationError","apply","disabled","model","mapping","toObj","mappedModel","keyArray","split","base","currentKey","shift","reset","resetModel","resetInternal","event","preventDefault","onReset","setValue","resetValue","_component$props","validationResults","requiredResults","requiredValidations","isRequired","error","filter","x","pos","arr","componentPos","slice","concat","isChanged","submit","onSubmit","updateInputsWithError","onValidSubmit","onInvalidSubmit","input","JSON","stringify","preventExternalInvalidation","externalError","canChange","onChange","onValidationComplete","allIsValid","every","onValid","onInvalid","render","_this$props","nonFormsyProps","getErrorMessage","getErrorMessages","getValue","hasValue","isFormSubmitted","setValidations","showError","showRequired","createElement","children","isSubmitting","Component","displayName","defaultProps","onError","node","bool","func","childContextTypes","didWarnAboutWrapperDeprecation","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","_createClass","defineProperties","descriptor","protoProps","staticProps","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,QACC,mBAAAO,WAAAC,KAAA,S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A9CPgD,IAAA,uBAAApB,MAAA,WAoDxB5B,KAAK0T,QAAQ5M,OAAOE,eAAehH,SApDXgD,IAAA,SAAApB,MAAA,WAyHjB,GACC0R,GAAatT,KAAK2G,MAAlB2M,SACFQ,KACJ1H,gBAAiBpM,KAAKoM,gBACtBC,iBAAkBrM,KAAKqM,iBACvBC,SAAUtM,KAAKsM,SACfC,SAAUvM,KAAKuM,SACfrF,eAAgBlH,KAAKkH,eACrBI,QAAStH,KAAKsH,QACdoB,WAAY1I,KAAK0I,WACjB8D,gBAAiBxM,KAAKwM,gBACtBlC,WAAYtK,KAAKsK,WACjBnD,aAAcnH,KAAKmH,aACnB8C,WAAYjK,KAAKiK,WACjBwC,eAAgBzM,KAAKyM,eACrBzC,SAAUhK,KAAKgK,SACf2C,aAAc3M,KAAK2M,aACnBD,UAAW1M,KAAK0M,WACb1M,KAAK2G,MAOV,OAJI2M,KACFQ,EAAgBC,IAAMT,GAGjBpN,EAAAhE,QAAM0K,cAAcG,EAAW+G,OAlJdN,GACGtN,EAAAhE,QAAM6K,UA8KrC,OAjBAyG,GAAiBxG,YAAjB,UARA,SAAwB5F,GACtB,MACEA,GAAU4F,aACV5F,EAAUxG,OACY,gBAAdwG,GAAyBA,EAAY,cAIO2F,GAAxD,IAEAyG,EAAiBQ,cACflN,OAAQd,EAAA9D,QAAUZ,QAGpBkS,EAAiBvG,cACfqG,SAAU,aACVC,UAAU,EACVzK,gBAAiB,GACjBhB,oBACArE,YAAa,KACb7B,MAAOmL,EAAUkH,cAGnBT,EAAiBlO,UAAYA,EAEtBkO","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})(typeof self !== 'undefined' ? self : 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})(typeof self !== 'undefined' ? self : 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\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 _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\n/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\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.getChildContext = function () {\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 _this.runValidation(component, value).isValid;\n }\n }\n };\n };\n\n _this.componentDidMount = function () {\n _this.validateForm();\n };\n\n _this.componentWillUpdate = function () {\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 _this.componentDidUpdate = function () {\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 _this.getCurrentValues = function () {\n return _this.inputs.reduce(function (data, component) {\n var name = component.props.name;\n\n var dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.state.value;\n return dataCopy;\n }, {});\n };\n\n _this.getModel = function () {\n var currentValues = _this.getCurrentValues();\n return _this.mapModel(currentValues);\n };\n\n _this.getPristineValues = function () {\n return _this.inputs.reduce(function (data, component) {\n var name = component.props.name;\n\n var dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.props.value;\n return dataCopy;\n }, {});\n };\n\n _this.setFormPristine = function (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 _this.setInputValidationErrors = function (errors) {\n _this.inputs.forEach(function (component) {\n var name = component.props.name;\n\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 _this.isFormDisabled = function () {\n return _this.props.disabled;\n };\n\n _this.mapModel = function (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 _this.reset = function (data) {\n _this.setFormPristine(true);\n _this.resetModel(data);\n };\n\n _this.resetInternal = function (event) {\n event.preventDefault();\n _this.reset();\n if (_this.props.onReset) {\n _this.props.onReset();\n }\n };\n\n _this.resetModel = function (data) {\n _this.inputs.forEach(function (component) {\n var name = component.props.name;\n\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 _this.runValidation = function (component) {\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : component.state.value;\n\n var currentValues = _this.getCurrentValues();\n var _component$props = component.props,\n validationError = _component$props.validationError,\n validationErrors = _component$props.validationErrors;\n\n\n var validationResults = _utils2.default.runRules(value, currentValues, component.validations, _validationRules2.default);\n\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 (_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 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 _this.attachToForm = function (component) {\n if (_this.inputs.indexOf(component) === -1) {\n _this.inputs.push(component);\n }\n\n _this.validate(component);\n };\n\n _this.detachFromForm = function (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 _this.isChanged = function () {\n return !_utils2.default.isSame(_this.getPristineValues(), _this.getCurrentValues());\n };\n\n _this.submit = function (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 _this.updateInputsWithError = function (errors) {\n Object.keys(errors).forEach(function (name) {\n var component = _utils2.default.find(_this.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: _this.props.preventExternalInvalidation,\n externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n };\n\n _this.validate = function (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 _this.validateForm = function () {\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 = _this.inputs.every(function (component) {\n return component.state.isValid;\n });\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(function (component, index) {\n var 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 ? 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 _this.render = function () {\n var _this$props = _this.props,\n getErrorMessage = _this$props.getErrorMessage,\n getErrorMessages = _this$props.getErrorMessages,\n getValue = _this$props.getValue,\n hasValue = _this$props.hasValue,\n isFormDisabled = _this$props.isFormDisabled,\n isFormSubmitted = _this$props.isFormSubmitted,\n isPristine = _this$props.isPristine,\n isRequired = _this$props.isRequired,\n isValid = _this$props.isValid,\n isValidValue = _this$props.isValidValue,\n mapping = _this$props.mapping,\n onChange = _this$props.onChange,\n onInvalidSubmit = _this$props.onInvalidSubmit,\n onInvalid = _this$props.onInvalid,\n onReset = _this$props.onReset,\n onSubmit = _this$props.onSubmit,\n onValid = _this$props.onValid,\n onValidSubmit = _this$props.onValidSubmit,\n preventExternalInvalidation = _this$props.preventExternalInvalidation,\n resetValue = _this$props.resetValue,\n setValidations = _this$props.setValidations,\n setValue = _this$props.setValue,\n showError = _this$props.showError,\n showRequired = _this$props.showRequired,\n validationErrors = _this$props.validationErrors,\n nonFormsyProps = _objectWithoutProperties(_this$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 _this.state = {\n isValid: true,\n isSubmitting: false,\n canChange: false\n };\n _this.inputs = [];\n return _this;\n }\n\n // Reset each key in the model to the original / initial / specified value\n\n\n // Checks validation on current value or a passed value\n\n\n // Method put on each input component to register\n // itself to the form\n\n\n // Method put on each input component to unregister\n // itself from the form\n\n\n // Checks if the values have changed from their initial value\n\n\n // Update model, submit to url prop and send the model\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 // 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 // Validate the form by going through all child input components\n // and check their state\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 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 preventExternalInvalidation: _propTypes2.default.bool,\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 didWarnAboutWrapperDeprecation = false;\n\nvar deprecatedWrapper = function deprecatedWrapper(Component) {\n if (!didWarnAboutWrapperDeprecation) {\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 didWarnAboutWrapperDeprecation = true;\n }\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\n/* eslint-disable react/default-props-match-prop-types */\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 bdf4964b375525c54106","/**\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,\n value,\n validations[validationMethod],\n );\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\n/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\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 }\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;\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;\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;\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;\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 {\n validationError,\n validationErrors,\n } = component.props;\n\n const validationResults = utils.runRules(\n value,\n currentValues,\n component.validations,\n validationRules,\n );\n\n const requiredResults = utils.runRules(\n value,\n currentValues,\n component.requiredValidations,\n 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 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 preventExternalInvalidation: PropTypes.bool,\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\nlet didWarnAboutWrapperDeprecation = false;\n\nconst deprecatedWrapper = (Component) => {\n if (!didWarnAboutWrapperDeprecation) {\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 didWarnAboutWrapperDeprecation = true;\n }\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\n/* eslint-disable react/default-props-match-prop-types */\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 +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///formsy-react.js","webpack:///webpack/bootstrap bdf4964b375525c54106","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","self","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","ReferenceError","_inherits","subClass","superClass","create","writable","setPrototypeOf","__proto__","Wrapper","withFormsy","propTypes","addValidationRule","undefined","_extends","assign","arguments","source","_formDataToObject","_formDataToObject2","_propTypes","_propTypes2","_react","_react2","_utils","_utils2","_validationRules","_validationRules2","_Wrapper","_Wrapper2","Formsy","_React$Component","props","getPrototypeOf","getChildContext","formsy","attachToForm","detachFromForm","validate","isFormDisabled","isValidValue","component","runValidation","isValid","componentDidMount","validateForm","componentWillUpdate","prevInputNames","inputs","map","componentDidUpdate","validationErrors","setInputValidationErrors","newInputNames","getCurrentValues","reduce","data","dataCopy","state","getModel","mapModel","getPristineValues","setFormPristine","isPristine","setState","formSubmitted","args","validationError","apply","disabled","model","mapping","toObj","mappedModel","keyArray","split","base","currentKey","shift","reset","resetModel","resetInternal","event","preventDefault","onReset","setValue","resetValue","_component$props","validationResults","requiredResults","requiredValidations","isRequired","error","filter","x","pos","arr","componentPos","slice","concat","isChanged","submit","onSubmit","updateInputsWithError","onValidSubmit","onInvalidSubmit","input","JSON","stringify","preventExternalInvalidation","externalError","canChange","onChange","onValidationComplete","allIsValid","every","onValid","onInvalid","render","_this$props","nonFormsyProps","getErrorMessage","getErrorMessages","getValue","hasValue","isFormSubmitted","setValidations","showError","showRequired","createElement","children","isSubmitting","Component","displayName","defaultProps","onError","node","bool","func","childContextTypes","didWarnAboutWrapperDeprecation","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","_createClass","defineProperties","descriptor","protoProps","staticProps","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,QACC,mBAAAO,WAAAC,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAV,OAGA,IAAAC,GAAAU,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAb,WAUA,OANAQ,GAAAE,GAAAI,KAAAb,EAAAD,QAAAC,IAAAD,QAAAS,GAGAR,EAAAY,GAAA,EAGAZ,EAAAD,QAvBA,GAAAW,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAjB,EAAAkB,EAAAC,GACAV,EAAAW,EAAApB,EAAAkB,IACAG,OAAAC,eAAAtB,EAAAkB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAzB,GACA,GAAAkB,GAAAlB,KAAA0B,WACA,WAA2B,MAAA1B,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAQ,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDpB,EAAAuB,EAAA,GAGAvB,IAAAwB,EAAA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EAAY,cAIO2F,GAAxD,IAEAyG,EAAiBQ,cACflN,OAAQd,EAAA9D,QAAUZ,QAGpBkS,EAAiBvG,cACfqG,SAAU,aACVC,UAAU,EACVzK,gBAAiB,GACjBhB,oBACArE,YAAa,KACb7B,MAAOmL,EAAUkH,cAGnBT,EAAiBlO,UAAYA,EAEtBkO","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})(typeof self !== 'undefined' ? self : 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})(typeof self !== 'undefined' ? self : 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\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 _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\n/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\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.getChildContext = function () {\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 _this.runValidation(component, value).isValid;\n }\n }\n };\n };\n\n _this.componentDidMount = function () {\n _this.validateForm();\n };\n\n _this.componentWillUpdate = function () {\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 _this.componentDidUpdate = function () {\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 _this.getCurrentValues = function () {\n return _this.inputs.reduce(function (data, component) {\n var name = component.props.name;\n\n var dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.state.value;\n return dataCopy;\n }, {});\n };\n\n _this.getModel = function () {\n var currentValues = _this.getCurrentValues();\n return _this.mapModel(currentValues);\n };\n\n _this.getPristineValues = function () {\n return _this.inputs.reduce(function (data, component) {\n var name = component.props.name;\n\n var dataCopy = Object.assign({}, data); // avoid param reassignment\n dataCopy[name] = component.props.value;\n return dataCopy;\n }, {});\n };\n\n _this.setFormPristine = function (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 _this.setInputValidationErrors = function (errors) {\n _this.inputs.forEach(function (component) {\n var name = component.props.name;\n\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 _this.isFormDisabled = function () {\n return _this.props.disabled;\n };\n\n _this.mapModel = function (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 _this.reset = function (data) {\n _this.setFormPristine(true);\n _this.resetModel(data);\n };\n\n _this.resetInternal = function (event) {\n event.preventDefault();\n _this.reset();\n if (_this.props.onReset) {\n _this.props.onReset();\n }\n };\n\n _this.resetModel = function (data) {\n _this.inputs.forEach(function (component) {\n var name = component.props.name;\n\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 _this.runValidation = function (component) {\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : component.state.value;\n\n var currentValues = _this.getCurrentValues();\n var _component$props = component.props,\n validationError = _component$props.validationError,\n validationErrors = _component$props.validationErrors;\n\n\n var validationResults = _utils2.default.runRules(value, currentValues, component.validations, _validationRules2.default);\n\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 (_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 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 _this.attachToForm = function (component) {\n if (_this.inputs.indexOf(component) === -1) {\n _this.inputs.push(component);\n }\n\n _this.validate(component);\n };\n\n _this.detachFromForm = function (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 _this.isChanged = function () {\n return !_utils2.default.isSame(_this.getPristineValues(), _this.getCurrentValues());\n };\n\n _this.submit = function (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 _this.updateInputsWithError = function (errors) {\n Object.keys(errors).forEach(function (name) {\n var component = _utils2.default.find(_this.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: _this.props.preventExternalInvalidation,\n externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n };\n\n _this.validate = function (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 _this.validateForm = function () {\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 = _this.inputs.every(function (component) {\n return component.state.isValid;\n });\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(function (component, index) {\n var 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 ? 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 _this.render = function () {\n var _this$props = _this.props,\n getErrorMessage = _this$props.getErrorMessage,\n getErrorMessages = _this$props.getErrorMessages,\n getValue = _this$props.getValue,\n hasValue = _this$props.hasValue,\n isFormDisabled = _this$props.isFormDisabled,\n isFormSubmitted = _this$props.isFormSubmitted,\n isPristine = _this$props.isPristine,\n isRequired = _this$props.isRequired,\n isValid = _this$props.isValid,\n isValidValue = _this$props.isValidValue,\n mapping = _this$props.mapping,\n onChange = _this$props.onChange,\n onInvalidSubmit = _this$props.onInvalidSubmit,\n onInvalid = _this$props.onInvalid,\n onReset = _this$props.onReset,\n onSubmit = _this$props.onSubmit,\n onValid = _this$props.onValid,\n onValidSubmit = _this$props.onValidSubmit,\n preventExternalInvalidation = _this$props.preventExternalInvalidation,\n resetValue = _this$props.resetValue,\n setValidations = _this$props.setValidations,\n setValue = _this$props.setValue,\n showError = _this$props.showError,\n showRequired = _this$props.showRequired,\n validationErrors = _this$props.validationErrors,\n nonFormsyProps = _objectWithoutProperties(_this$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 _this.state = {\n isValid: true,\n isSubmitting: false,\n canChange: false\n };\n _this.inputs = [];\n return _this;\n }\n\n // Reset each key in the model to the original / initial / specified value\n\n\n // Checks validation on current value or a passed value\n\n\n // Method put on each input component to register\n // itself to the form\n\n\n // Method put on each input component to unregister\n // itself from the form\n\n\n // Checks if the values have changed from their initial value\n\n\n // Update model, submit to url prop and send the model\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 // 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 // Validate the form by going through all child input components\n // and check their state\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 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 preventExternalInvalidation: _propTypes2.default.bool,\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 didWarnAboutWrapperDeprecation = false;\n\nvar deprecatedWrapper = function deprecatedWrapper(Component) {\n if (!didWarnAboutWrapperDeprecation) {\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 didWarnAboutWrapperDeprecation = true;\n }\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\n/* eslint-disable react/default-props-match-prop-types */\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 bdf4964b375525c54106","/**\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,\n value,\n validations[validationMethod],\n );\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\n/* eslint-disable react/no-unused-state, react/default-props-match-prop-types */\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 }\n\n getChildContext = () => (\n {\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 this.inputs.reduce((data, component) => {\n const { name } = component.props;\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 this.inputs.reduce((data, component) => {\n const { name } = component.props;\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;\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 = () => this.props.disabled;\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;\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 {\n validationError,\n validationErrors,\n } = component.props;\n\n const validationResults = utils.runRules(\n value,\n currentValues,\n component.validations,\n validationRules,\n );\n\n const requiredResults = utils.runRules(\n value,\n currentValues,\n component.requiredValidations,\n 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 = () => !utils.isSame(this.getPristineValues(), this.getCurrentValues());\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 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 preventExternalInvalidation: PropTypes.bool,\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\nlet didWarnAboutWrapperDeprecation = false;\n\nconst deprecatedWrapper = (Component) => {\n if (!didWarnAboutWrapperDeprecation) {\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 didWarnAboutWrapperDeprecation = true;\n }\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\n/* eslint-disable react/default-props-match-prop-types */\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 diff --git a/yarn.lock b/yarn.lock index d6dd0b67..746f6324 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2181,9 +2181,9 @@ eslint-scope@^3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint@^4.13.0: - version "4.13.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.13.0.tgz#1991aa359586af83877bde59de9d41f53e20826d" +eslint@^4.13.1: + version "4.13.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.13.1.tgz#0055e0014464c7eb7878caf549ef2941992b444f" dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0"