react-form
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-form"]=t():e["react-form"]=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("prop-types")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),f=r(1),p=n(f),d=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),u(t,[{key:"componentWillReceiveProps",value:function(e,t){t.formApi.submitted===this.context.formApi.submitted||this.props.nestedForm||this.context.formApi.setTouched(this.props.field,!0,!1),t.formApi.submits===this.context.formApi.submits||this.props.nestedForm||this.context.formApi.setTouched(this.props.field,!0,!1)}},{key:"shouldComponentUpdate",value:function(e,t,r){var n=this.props.field,i=this.context.formApi,o=r.formApi,a=s({},this.props.children.props),u=s({},e.children.props);if(a.children=null,u.children=null,!Array.isArray(n)){return o.values[n]!==i.values[n]||o.touched[n]!==i.touched[n]||o.errors[n]!==i.errors[n]||o.warnings[n]!==i.warnings[n]||o.successes[n]!==i.successes[n]||JSON.stringify(a)!==JSON.stringify(u)||r.formApi.submits!==this.context.formApi.submits||!1}return o.values[n[0]]!==i.values[n[0]]||o.touched[n[0]]!==i.touched[n[0]]||o.errors[n[0]]!==i.errors[n[0]]||o.warnings[n[0]]!==i.warnings[n[0]]||o.successes[n[0]]!==i.successes[n[0]]||JSON.stringify(a)!==JSON.stringify(u)||r.formApi.submits!==this.context.formApi.submits||!1}},{key:"render",value:function(){var e=this.context.formApi,t=this.props,r=t.children,n=t.field,i={setValue:function(t){e.setValue(n,t)},format:function(t){e.format(n,t)},setTouched:function(t){e.setTouched(n,t)},setError:function(t){e.setError(n,t)},setWarning:function(t){e.setWarning(n,t)},setSuccess:function(t){e.setSuccess(n,t)},getValue:function(){return e.getValue(n)},getTouched:function(){return e.getTouched(n)},getError:function(){return e.getError(n)},getWarning:function(){return e.getWarning(n)},getSuccess:function(){return e.getSuccess(n)},validatingField:function(){return e.validatingField(n)},doneValidatingField:function(){return e.doneValidatingField(n)},reset:function(){return e.reset(n)},registerAsyncValidation:e.registerAsyncValidation,submitted:e.submitted,submits:e.submits};return l.default.cloneElement(r,{fieldApi:i})}}]),t}(c.Component);d.contextTypes={formApi:p.default.object},t.default=d},function(e,t,r){"use strict";function n(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(i,o){try{var a=t[i](o),s=a.value}catch(e){return void r(e)}if(!a.done)return Promise.resolve(s).then(function(e){n("next",e)},function(e){n("throw",e)});e(s)}return n("next")})}}function i(e,t){return{type:T,field:e,value:t}}function o(e,t){return{type:V,field:e,format:t}}function a(e,t){return{type:N,field:e,error:t}}function s(e,t){return{type:C,field:e,warning:t}}function u(e,t){return{type:P,field:e,success:t}}function c(e,t){return{type:R,field:e,error:t}}function l(e,t){return{type:k,field:e,warning:t}}function f(e,t){return{type:x,field:e,success:t}}function p(e){return{type:I,field:e}}function d(e){return{type:F,field:e}}function y(e){return{type:D,field:e}}function h(e,t){return{type:M,field:e,touched:t}}function v(e){return{type:U,field:e}}function b(){return{type:W}}function g(){return{type:J}}function m(){return{type:L}}function O(){return{type:Y}}function S(){return{type:G}}function _(e){return{type:q,field:e}}function E(e){return{type:B,field:e}}function A(e,t){return{type:H,field:e,error:t}}function w(e){return{type:z,field:e}}function j(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return{}};return function(){var i=n(regeneratorRuntime.mark(function n(i,o){var a,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=Array.isArray(e)?e[0]:e,!r[a]){t.next=17;break}return i(_(e)),t.prev=3,t.next=6,r[a](o().values[a]);case 6:s=t.sent,s.hasOwnProperty("error")&&i(c(e,s.error)),s.hasOwnProperty("warning")&&i(l(e,s.warning)),s.hasOwnProperty("success")&&i(f(e,s.success)),i(w(e)),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),i(A(e,t.t0));case 16:i(E(e));case 17:case"end":return t.stop()}},n,t,[[3,13]])}));return function(e,t){return i.apply(this,arguments)}}()}Object.defineProperty(t,"__esModule",{value:!0}),t.setValue=i,t.format=o,t.setError=a,t.setWarning=s,t.setSuccess=u,t.setAsyncError=c,t.setAsyncWarning=l,t.setAsyncSuccess=f,t.removeAsyncError=p,t.removeAsyncWarning=d,t.removeAsyncSuccess=y,t.setTouched=h,t.reset=v,t.preValidate=b,t.validate=g,t.submit=m,t.submitted=O,t.submits=S,t.validatingField=_,t.doneValidatingField=E,t.validationFailure=A,t.validationSuccess=w,t.asyncValidate=j;var T=t.SET_VALUE="SET_VALUE",V=t.FORMAT="FORMAT",N=t.SET_ERROR="SET_ERROR",C=t.SET_WARNING="SET_WARNING",P=t.SET_SUCCESS="SET_SUCCESS",R=t.SET_ASYNC_ERROR="SET_ASYNC_ERROR",k=t.SET_ASYNC_WARNING="SET_ASYNC_WARNING",x=t.SET_ASYNC_SUCCESS="SET_ASYNC_SUCCESS",I=t.REMOVE_ASYNC_ERROR="REMOVE_ASYNC_ERROR",F=t.REMOVE_ASYNC_WARNING="REMOVE_ASYNC_WARNING",D=t.REMOVE_ASYNC_SUCCESS="REMOVE_ASYNC_SUCCESS",M=t.SET_TOUCHED="SET_TOUCHED",U=t.RESET="RESET",W=t.PRE_VALIDATE="PRE_VALIDATE",J=t.VALIDATE="VALIDATE",L=t.SUBMIT="SUBMIT",Y=t.SUBMITTED="SUBMITTED",G=t.SUBMITS="SUBMITS",q=t.VALIDATING_FIELD="VALIDATING_FIELD",B=t.DONE_VALIDATING_FIELD="DONE_VALIDATING_FIELD",H=t.VALIDATION_FAILURE="VALIDATION_FAILURE",z=t.VALIDATION_SUCCESS="VALIDATION_SUCCESS"},function(e,t,r){r(5),e.exports=r(6)},function(e,t){e.exports=require("babel-polyfill")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TextArea=t.Checkbox=t.Select=t.Radio=t.RadioGroup=t.FormField=t.NestedForm=t.Text=t.Form=void 0;var i=r(7),o=n(i),a=r(13),s=n(a),u=r(14),c=n(u),l=r(15),f=n(l),p=r(16),d=n(p),y=r(17),h=n(y),v=r(18),b=n(v),g=r(19),m=n(g),O=r(2),S=n(O);t.Form=o.default,t.Text=s.default,t.NestedForm=m.default,t.FormField=S.default,t.RadioGroup=b.default,t.Radio=c.default,t.Select=d.default,t.Checkbox=h.default,t.TextArea=f.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(i,o){try{var a=t[i](o),s=a.value}catch(e){return void r(e)}if(!a.done)return Promise.resolve(s).then(function(e){n("next",e)},function(e){n("throw",e)});e(s)}return n("next")})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=r(0),d=n(p),y=r(1),h=n(y),v=r(8),b=n(v),g=r(9),m=r(10),O=(r(11),r(12)),S=n(O),_=r(3),E=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(_),A=function e(t){return Array.isArray(t)?t.some(function(t){return e(t)}):null!==t&&"object"===(void 0===t?"undefined":f(t))?Object.keys(t).some(function(r){return e(t[r])}):t},w=function(e){return Object.assign(e.errors,e.asyncErrors)},j=function(e){return Object.assign(e.warnings,e.asyncWarnings)},T=function(e){return Object.assign(e.successes,e.asyncSuccesses)},V=function(e){return Object.assign(JSON.parse(JSON.stringify(e)),{errors:w(e),warnings:j(e),successes:T(e)})},N=function(e){function t(e){a(this,t);var r=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.getValue=r.getValue.bind(r),r.setValue=r.setValue.bind(r),r.getTouched=r.getTouched.bind(r),r.setTouched=r.setTouched.bind(r),r.setError=r.setError.bind(r),r.format=r.format.bind(r),r.setWarning=r.setWarning.bind(r),r.setSuccess=r.setSuccess.bind(r),r.submitForm=r.submitForm.bind(r),r.reset=r.reset.bind(r),r.getError=r.getError.bind(r),r.getWarning=r.getWarning.bind(r),r.getSuccess=r.getSuccess.bind(r),r.doneValidatingField=r.doneValidatingField.bind(r),r.validatingField=r.validatingField.bind(r),r.registerAsyncValidation=r.registerAsyncValidation.bind(r),r.callAsynchronousValidators=r.callAsynchronousValidators.bind(r),r.asyncValidators=[],r}return u(t,e),l(t,[{key:"getChildContext",value:function(){return{formApi:this.api}}},{key:"componentDidMount",value:function(){this.props.dispatch(E.preValidate()),this.props.dispatch(E.validate()),this.props.registerAsyncValidation&&this.props.registerAsyncValidation(this.callAsynchronousValidators)}},{key:"componentWillReceiveProps",value:function(e){e.submits>this.props.submits&&(this.props.dispatch(E.preValidate()),this.props.dispatch(E.validate()),this.props.dispatch(E.submits()));var t=JSON.stringify(e.formState)!==JSON.stringify(this.props.formState);this.props.formDidUpdate&&t&&this.props.formDidUpdate(V(e.formState)),this.props.update&&t&&this.props.update(V(e.formState))}},{key:"componentWillUnmount",value:function(){this.props.reset&&this.props.reset()}},{key:"setValue",value:function(e,t){this.props.dispatch(E.setValue(e,t)),this.props.dispatch(E.removeAsyncError(e)),this.props.dispatch(E.removeAsyncWarning(e)),this.props.dispatch(E.removeAsyncSuccess(e)),this.props.dispatch(E.preValidate()),this.props.dispatch(E.validate())}},{key:"setTouched",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.props.dispatch(E.setTouched(e,t)),r&&this.props.dispatch(E.asyncValidate(e,this.props.asyncValidators))}},{key:"setError",value:function(e,t){this.props.dispatch(E.setError(e,t))}},{key:"setWarning",value:function(e,t){this.props.dispatch(E.setWarning(e,t))}},{key:"setSuccess",value:function(e,t){this.props.dispatch(E.setSuccess(e,t))}},{key:"getTouched",value:function(e){return Array.isArray(e)?this.props.formState.touched[e[0]]?this.props.formState.touched[e[0]][e[1]]:void 0:this.props.formState.touched[e]}},{key:"getValue",value:function(e){return Array.isArray(e)?this.props.formState.values[e[0]]?this.props.formState.values[e[0]][e[1]]:void 0:this.props.formState.values[e]}},{key:"getError",value:function(e){var t=this.errors;return Array.isArray(e)?t[e[0]]?t[e[0]][e[1]]:void 0:t[e]}},{key:"getWarning",value:function(e){var t=this.warnings;return Array.isArray(e)?t[e[0]]?t[e[0]][e[1]]:void 0:t[e]}},{key:"getSuccess",value:function(e){var t=this.successes;return Array.isArray(e)?t[e[0]]?t[e[0]][e[1]]:void 0:t[e]}},{key:"registerAsyncValidation",value:function(e){this.asyncValidators.push(e)}},{key:"format",value:function(e,t){this.props.dispatch(E.format(e,t)),this.props.dispatch(E.preValidate()),this.props.dispatch(E.validate())}},{key:"reset",value:function(e){this.props.dispatch(E.reset(e))}},{key:"validatingField",value:function(e){this.props.dispatch(E.validatingField(e))}},{key:"doneValidatingField",value:function(e){this.props.dispatch(E.doneValidatingField(e))}},{key:"submitForm",value:function(e){if(this.props.dispatch(E.preValidate()),this.props.dispatch(E.validate()),this.props.dispatch(E.submits()),e&&e.preventDefault&&!this.props.dontPreventDefault&&e.preventDefault(e),this.props.dontPreventDefault){A(this.errors)&&e&&e.preventDefault&&e.preventDefault(e)}this.finishSubmission()}},{key:"finishSubmission",value:function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){var t,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.callAsynchronousValidators();case 2:t=this.errors,r=A(t),r||0!==this.props.formState.asyncValidations||(this.props.dispatch(E.submitted()),this.props.onSubmit&&this.props.onSubmit(this.props.formState.values));case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"callAsynchronousValidators",value:function(){function e(){return t.apply(this,arguments)}var t=o(regeneratorRuntime.mark(function e(){var t,r,n=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.asyncValidators?Object.keys(this.props.asyncValidators).map(function(e){return n.props.dispatch(E.asyncValidate(e,n.props.asyncValidators))}):[],r=this.asyncValidators?this.asyncValidators.map(function(e){return e()}):[],t=t.concat(r),e.next=5,Promise.all(t);case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"render",value:function(){var e=this.props,t=e.children,r=e.component,n=e.render;return r?d.default.createElement(r,{formApi:this.api}):n?n(this.api):"function"==typeof t?t(this.api):d.default.cloneElement(t,{formApi:this.api})}},{key:"api",get:function(){return{values:this.props.formState.values,errors:this.errors,warnings:this.warnings,successes:this.successes,touched:this.props.formState.touched,asyncValidations:this.props.formState.asyncValidations,validating:this.props.formState.validating,validationFailures:this.props.formState.validationFailures,validationFailed:this.props.formState.validationFailed,submitForm:this.submitForm,setValue:this.setValue,getValue:this.getValue,setTouched:this.setTouched,getTouched:this.getTouched,getWarning:this.getWarning,getError:this.getError,getSuccess:this.getSuccess,setError:this.setError,setWarning:this.setWarning,setSuccess:this.setSuccess,format:this.format,submitted:this.props.formState.submitted,submits:this.props.formState.submits,reset:this.reset,validatingField:this.validatingField,doneValidatingField:this.doneValidatingField,registerAsyncValidation:this.registerAsyncValidation}}},{key:"errors",get:function(){return Object.assign(this.props.formState.errors,this.props.formState.asyncErrors)}},{key:"warnings",get:function(){return Object.assign(this.props.formState.warnings,this.props.formState.asyncWarnings)}},{key:"successes",get:function(){return Object.assign(this.props.formState.successes,this.props.formState.asyncSuccesses)}},{key:"currentState",get:function(){return Object.assign(JSON.parse(JSON.stringify(this.props.formState)),{errors:this.errors,warnings:this.warnings,successes:this.successes})}}]),t}(p.Component);N.childContextTypes={formApi:h.default.object};var C=function(e){return{formState:e}},P=function(e){return{dispatch:e}},R=(0,m.connect)(C,P)(N),k=function(e){function t(e){a(this,t);var r=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),n=e.validateError,i=e.validateWarning,o=e.validateSuccess,u=e.preValidate,c=e.defaultValues;return r.store=(0,g.createStore)(S.default.build({validateError:n,validateWarning:i,validateSuccess:o,preValidate:u,defaultValues:c}),(0,g.applyMiddleware)(b.default)),r}return u(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=i(e,["children"]);return d.default.createElement(R,c({store:this.store},r),t)}}]),t}(p.Component);t.default=k},function(e,t){e.exports=require("redux-thunk")},function(e,t){e.exports=require("redux")},function(e,t){e.exports=require("react-redux")},function(e,t){e.exports=require("redux-logger")},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=r(3),s={values:{},touched:{},errors:{},warnings:{},successes:{},asyncErrors:{},asyncWarnings:{},asyncSuccesses:{},validating:{},validationFailed:{},validationFailures:0,asyncValidations:0,submitted:!1,submits:0},u=function(e,t){var r=t.field,n=t.value,i=JSON.parse(JSON.stringify(e.values));return Array.isArray(r)?(i[r[0]]=i[r[0]]||[],i[r[0]][r[1]]=n):i[r]=n,o({},e,{values:i})},c=function(e,t){var r=t.field,n=o({},e.values);return Array.isArray(r)?(n[r[0]]=n[r[0]]||[],n[r[0]][r[1]]=t.format(n[r[0]][r[1]])):n[r]=t.format(n[r]),o({},e,{values:n})},l=function(e,t){var r=t.field,n=t.touched,i=JSON.parse(JSON.stringify(e.touched));return Array.isArray(r)?(i[r[0]]=i[r[0]]||[],i[r[0]][r[1]]=n):i[r]=n,o({},e,{touched:i})},f=function(e,t){var r=t.field,n=t.warning,i=JSON.parse(JSON.stringify(e.warnings));return Array.isArray(r)?(i[r[0]]=i[r[0]]||[],i[r[0]][r[1]]=n):i[r]=n,o({},e,{warnings:i})},p=function(e,t){var r=t.field,n=t.error,i=JSON.parse(JSON.stringify(e.errors));return Array.isArray(r)?(i[r[0]]=i[r[0]]||[],i[r[0]][r[1]]=n):i[r]=n,o({},e,{errors:i})},d=function(e,t){var r=t.field,n=t.success,i=JSON.parse(JSON.stringify(e.successes));return Array.isArray(r)?(i[r[0]]=i[r[0]]||[],i[r[0]][r[1]]=n):i[r]=n,o({},e,{successes:i})},y=function(e,t){var r=t.field,n=t.warning,i=JSON.parse(JSON.stringify(e.asyncWarnings));return Array.isArray(r)?i[r[0]]=n:i[r]=n,o({},e,{asyncWarnings:i})},h=function(e,t){var r=t.field,n=t.error,i=JSON.parse(JSON.stringify(e.asyncErrors));return Array.isArray(r)?i[r[0]]=n:i[r]=n,o({},e,{asyncErrors:i})},v=function(e,t){var r=t.field,n=t.success,i=JSON.parse(JSON.stringify(e.asyncSuccesses));return Array.isArray(r)?i[r[0]]=n:i[r]=n,o({},e,{asyncSuccesses:i})},b=function(e,t){var r=t.field,n=JSON.parse(JSON.stringify(e.asyncWarnings));return Array.isArray(r)?delete n[r[0]]:delete n[r],o({},e,{asyncWarnings:n})},g=function(e,t){var r=t.field,n=JSON.parse(JSON.stringify(e.asyncErrors));return Array.isArray(r)?delete n[r[0]]:delete n[r],o({},e,{asyncErrors:n})},m=function(e,t){var r=t.field,n=JSON.parse(JSON.stringify(e.asyncSuccesses));return Array.isArray(r)?delete n[r[0]]:delete n[r],o({},e,{asyncSuccesses:n})},O=function(e,t,r,n,i){var a=r?r(e.values):{},s=n?n(e.values):{},u=i?i(e.values,a):{};return a=o({},e.errors,a),s=o({},e.warnings,s),u=o({},e.successes,u),o({},e,{errors:a,warnings:s,successes:u})},S=function(e,t,r){var n=r?r(e.values):e.values;return o({},e,{values:n})},_=function(e){return o({},e,{submits:e.submits+1})},E=function(e){return o({},e,{submitted:!0})},A=function(e,t){var r=t.field,n=JSON.parse(JSON.stringify(e));return n.values[r]=null,n.touched[r]=null,n.errors[r]=null,n.warnings[r]=null,n.successes[r]=null,n.asyncErrors[r]=null,n.asyncWarnings[r]=null,n.asyncSuccesses[r]=null,o({},e,n)},w=function(e,t){var r=t.field,n=JSON.parse(JSON.stringify(e.validating)),i=e.asyncValidations;return Array.isArray(r)?(i=n[r[0]]?i:i+1,n[r[0]]=!0):(i=n[r]?i:i+1,n[r]=!0),o({},e,{asyncValidations:i,validating:n})},j=function(e,t){var r=t.field,n=JSON.parse(JSON.stringify(e.validating)),i=e.asyncValidations;return Array.isArray(r)?(i=n[r[0]]?i-1:i,n[r[0]]=!1):(i=n[r]?i-1:i,n[r]=!1),o({},e,{asyncValidations:i,validating:n})},T=function(e,t){var r=t.field,n=JSON.parse(JSON.stringify(e.validationFailed)),i=e.validationFailures;return Array.isArray(r)?(i=!1===n[r[0]]?i+1:i,n[r[0]]=!0):(i=n[r]?i:i+1,n[r]=!0),o({},e,{validationFailures:i,validationFailed:n})},V=function(e,t){var r=t.field,n=e.validationFailures,i=JSON.parse(JSON.stringify(e.validationFailed));return Array.isArray(r)?(n=!0===i[r[0]]?n-1:n,i[r[0]]=!1):(n=!0===i[r]?n-1:n,i[r]=!1),o({},e,{validationFailures:n,validationFailed:i})},N=function(){function e(){n(this,e)}return i(e,null,[{key:"build",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.validateError,r=e.validateWarning,n=e.validateSuccess,i=e.defaultValues,o=Object.assign({},s,{values:i||{}});return function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,s=arguments[1];switch(s.type){case a.SET_VALUE:return u(i,s);case a.FORMAT:return c(i,s);case a.SET_ERROR:return p(i,s);case a.SET_WARNING:return f(i,s);case a.SET_SUCCESS:return d(i,s);case a.SET_ASYNC_ERROR:return h(i,s);case a.SET_ASYNC_WARNING:return y(i,s);case a.SET_ASYNC_SUCCESS:return v(i,s);case a.SET_TOUCHED:return l(i,s);case a.REMOVE_ASYNC_ERROR:return g(i,s);case a.REMOVE_ASYNC_WARNING:return b(i,s);case a.REMOVE_ASYNC_SUCCESS:return m(i,s);case a.PRE_VALIDATE:return S(i,0,e.preValidate);case a.VALIDATE:return O(i,0,t,r,n);case a.SUBMITTED:return E(i);case a.SUBMITS:return _(i);case a.RESET:return A(i,s);case a.VALIDATION_FAILURE:return T(i,s);case a.VALIDATION_SUCCESS:return V(i,s);case a.DONE_VALIDATING_FIELD:return j(i,s);case a.VALIDATING_FIELD:return w(i,s);default:return i}}}}]),e}();t.default=N},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=r(0),f=n(l),p=r(1),d=n(p),y=r(2),h=n(y),v=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=e.fieldDidUpdate,r=e.fieldApi,n=e.onInput,o=i(e,["fieldDidUpdate","fieldApi","onInput"]),a=r.getValue,s=r.setValue,c=r.setTouched;r.format;return f.default.createElement("input",u({value:a(),onInput:function(e){s(e.target.value),t&&t(e.target.value),n&&n(e)},onBlur:function(){c()}},o))}}]),t}(l.Component),b=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=i(e,["field"]);return f.default.createElement(h.default,{field:t},f.default.createElement(v,r))}}]),t}(l.Component);b.propTypes={field:d.default.oneOfType([d.default.string,d.default.array]).isRequired},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=r(0),f=n(l),p=r(1),d=n(p),y=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=(e.onChange,e.onClick),r=e.group,n=e.value,o=i(e,["onChange","onClick","group","value"]);return f.default.createElement("input",u({checked:r.getValue()===n,onBlur:function(){return r.setTouched()},onClick:function(e){r.setValue(n),r.fieldDidUpdate(n),t&&t(e)},type:"radio"},o))}}]),t}(l.Component);y.propTypes={value:d.default.string.isRequired,group:d.default.object.isRequired},t.default=y},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=r(0),f=n(l),p=r(1),d=n(p),y=r(2),h=n(y),v=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=(e.onChange,e.fieldApi),r=e.fieldDidUpdate,n=e.onInput,o=i(e,["onChange","fieldApi","fieldDidUpdate","onInput"]),a=t.getValue,s=t.setValue,c=t.setTouched;return f.default.createElement("textarea",u({value:a(""),onInput:function(e){s(e.target.value),r&&r(e.target.value),n&&n(e)},onBlur:function(){return c()}},o))}}]),t}(l.Component),b=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=i(e,["field"]);return f.default.createElement(h.default,{field:t},f.default.createElement(v,r))}}]),t}(l.Component);b.propTypes={field:d.default.oneOfType([d.default.string,d.default.array]).isRequired},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=r(0),p=n(f),d=r(1),y=n(d),h=r(2),v=n(h),b=function(e){function t(){return a(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.fieldDidUpdate,r=e.fieldApi,n=e.options,a=e.onChange,s=e.placeholder,u=o(e,["fieldDidUpdate","fieldApi","options","onChange","placeholder"]),l=r.getValue,f=r.setValue,d=r.setTouched,y=n.find(function(e){return""===e.value})?n:[{label:s||"Select One...",value:"",disabled:!0}].concat(i(n)),h=y.findIndex(function(e){return""===e.value}),v=y.findIndex(function(e){return e.value===l()});return p.default.createElement("select",c({onBlur:function(){return d()},onChange:function(e){var r=y[e.target.value].value;f(r),a&&a(e),t&&t(r)},value:v>-1?v:h},u),y.map(function(e,t){return p.default.createElement("option",{key:e.value,value:t,disabled:e.disabled},e.label)}))}}]),t}(f.Component),g=function(e){function t(){return a(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),l(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=o(e,["field"]);return p.default.createElement(v.default,{field:t},p.default.createElement(b,r))}}]),t}(f.Component);g.propTypes={field:y.default.oneOfType([y.default.string,y.default.array]).isRequired},t.default=g},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=r(0),f=n(l),p=r(1),d=n(p),y=r(2),h=n(y),v=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=e.fieldDidUpdate,r=e.fieldApi,n=e.onChange,o=i(e,["fieldDidUpdate","fieldApi","onChange"]),a=r.getValue,s=r.setValue,c=r.setTouched;return f.default.createElement("input",u({checked:a(),onBlur:function(){return c()},onChange:function(e){s(e.target.checked),n&&n(e),t&&t(e.target.checked)},type:"checkbox"},o))}}]),t}(l.Component),b=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=i(e,["field"]);return f.default.createElement(h.default,{field:t},f.default.createElement(v,r))}}]),t}(l.Component);b.propTypes={field:d.default.string.isRequired},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),f=r(1),p=n(f),d=r(2),y=n(d),h=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),u(t,[{key:"componentWillMount",value:function(){this.props.value&&this.props.fieldApi.setValue(this.props.value)}},{key:"render",value:function(){var e=this.props,t=e.fieldApi,r=e.children,n=e.component,i=e.render,o=e.fieldDidUpdate;return t.fieldDidUpdate=function(e){o&&o(e)},n?l.default.createElement(n,{group:t}):i?i(t):"function"==typeof r?r(t):l.default.cloneElement(r,{group:t})}}]),t}(c.Component),v=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=i(e,["field"]);return l.default.createElement(y.default,{field:t},l.default.createElement(h,r))}}]),t}(c.Component);v.propTypes={field:p.default.string.isRequired},t.default=v},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),f=r(1),p=n(f),d=r(2),y=n(d),h=function(e){var t=e.children,r=e.fieldApi,n=r.setValue,i=r.setError,o=r.setWarning,a=r.setSuccess,s=r.setTouched,u=r.submitted,c=r.submits,f=r.validatingField,p=r.doneValidatingField,d=r.registerAsyncValidation,y=r.reset;return l.default.cloneElement(t,{submitted:u,submits:c,reset:y,update:function(e){var t=e.values,r=e.errors,u=e.successes,c=e.warnings,l=e.touched,d=e.asyncValidations,y=!!r&&Object.keys(r).some(function(e){return r[e]}),h=!!u&&Object.keys(u).some(function(e){return u[e]}),v=!!c&&Object.keys(c).some(function(e){return c[e]});n(t),s(l),i(y?r:null),o(v?c:null),a(h?u:null),d>0?f():p()},registerAsyncValidation:d})},v=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),u(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=e.children;return l.default.createElement(y.default,{field:t,nestedForm:!0},l.default.createElement(h,s({field:t},r.props),r))}}]),t}(c.Component);v.propTypes={field:p.default.oneOfType([p.default.string,p.default.array]).isRequired},t.default=v}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["react-form"]=t():e["react-form"]=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)}([function(e,t){e.exports=require("babel-runtime/helpers/classCallCheck")},function(e,t){e.exports=require("babel-runtime/helpers/createClass")},function(e,t){e.exports=require("babel-runtime/helpers/extends")},function(e,t){e.exports=require("babel-runtime/core-js/object/get-prototype-of")},function(e,t){e.exports=require("babel-runtime/helpers/possibleConstructorReturn")},function(e,t){e.exports=require("babel-runtime/helpers/inherits")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("babel-runtime/helpers/objectWithoutProperties")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(10),u=n(a),i=r(2),s=n(i),o=r(3),l=n(o),d=r(0),f=n(d),c=r(1),p=n(c),h=r(4),y=n(h),v=r(5),S=n(v),m=r(6),_=n(m),A=r(7),E=n(A),g=function(e){function t(){return(0,f.default)(this,t),(0,y.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,S.default)(t,e),(0,p.default)(t,[{key:"componentWillReceiveProps",value:function(e,t){t.formApi.submitted===this.context.formApi.submitted||this.props.nestedForm||this.context.formApi.setTouched(this.props.field,!0,!1),t.formApi.submits===this.context.formApi.submits||this.props.nestedForm||this.context.formApi.setTouched(this.props.field,!0,!1)}},{key:"shouldComponentUpdate",value:function(e,t,r){var n=this.props.field,a=this.context.formApi,i=r.formApi,o=(0,s.default)({},this.props.children.props),l=(0,s.default)({},e.children.props);if(o.children=null,l.children=null,!Array.isArray(n)){return i.values[n]!==a.values[n]||i.touched[n]!==a.touched[n]||i.errors[n]!==a.errors[n]||i.warnings[n]!==a.warnings[n]||i.successes[n]!==a.successes[n]||(0,u.default)(o)!==(0,u.default)(l)||r.formApi.submits!==this.context.formApi.submits||!1}return i.values[n[0]]!==a.values[n[0]]||i.touched[n[0]]!==a.touched[n[0]]||i.errors[n[0]]!==a.errors[n[0]]||i.warnings[n[0]]!==a.warnings[n[0]]||i.successes[n[0]]!==a.successes[n[0]]||(0,u.default)(o)!==(0,u.default)(l)||r.formApi.submits!==this.context.formApi.submits||!1}},{key:"render",value:function(){var e=this.context.formApi,t=this.props,r=t.children,n=t.field,a={setValue:function(t){e.setValue(n,t)},format:function(t){e.format(n,t)},setTouched:function(t){e.setTouched(n,t)},setError:function(t){e.setError(n,t)},setWarning:function(t){e.setWarning(n,t)},setSuccess:function(t){e.setSuccess(n,t)},getValue:function(){return e.getValue(n)},getTouched:function(){return e.getTouched(n)},getError:function(){return e.getError(n)},getWarning:function(){return e.getWarning(n)},getSuccess:function(){return e.getSuccess(n)},validatingField:function(){return e.validatingField(n)},doneValidatingField:function(){return e.doneValidatingField(n)},reset:function(){return e.reset(n)},registerAsyncValidation:e.registerAsyncValidation,submitted:e.submitted,submits:e.submits};return _.default.cloneElement(r,{fieldApi:a})}}]),t}(m.Component);g.contextTypes={formApi:E.default.object},t.default=g},function(e,t){e.exports=require("babel-runtime/core-js/json/stringify")},function(e,t){e.exports=require("babel-runtime/regenerator")},function(e,t){e.exports=require("babel-runtime/helpers/asyncToGenerator")},function(e,t){e.exports=require("babel-runtime/core-js/object/assign")},function(e,t){e.exports=require("babel-runtime/core-js/object/keys")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return{type:F,field:e,value:t}}function u(e,t){return{type:k,field:e,format:t}}function i(e,t){return{type:x,field:e,error:t}}function s(e,t){return{type:D,field:e,warning:t}}function o(e,t){return{type:M,field:e,success:t}}function l(e,t){return{type:U,field:e,error:t}}function d(e,t){return{type:W,field:e,warning:t}}function f(e,t){return{type:L,field:e,success:t}}function c(e){return{type:w,field:e}}function p(e){return{type:j,field:e}}function h(e){return{type:q,field:e}}function y(e,t){return{type:P,field:e,touched:t}}function v(e){return{type:Y,field:e}}function S(){return{type:G}}function m(){return{type:J}}function _(){return{type:B}}function A(){return{type:H}}function E(){return{type:z}}function g(e){return{type:K,field:e}}function b(e){return{type:Q,field:e}}function V(e,t){return{type:X,field:e,error:t}}function T(e){return{type:Z,field:e}}function C(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return{}};return function(){var n=(0,I.default)(N.default.mark(function n(a,u){var i,s;return N.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=Array.isArray(e)?e[0]:e,!r[i]){t.next=17;break}return a(g(e)),t.prev=3,t.next=6,r[i](u().values[i]);case 6:s=t.sent,s.hasOwnProperty("error")&&a(l(e,s.error)),s.hasOwnProperty("warning")&&a(d(e,s.warning)),s.hasOwnProperty("success")&&a(f(e,s.success)),a(T(e)),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),a(V(e,t.t0));case 16:a(b(e));case 17:case"end":return t.stop()}},n,t,[[3,13]])}));return function(e,t){return n.apply(this,arguments)}}()}Object.defineProperty(t,"__esModule",{value:!0}),t.VALIDATION_SUCCESS=t.VALIDATION_FAILURE=t.DONE_VALIDATING_FIELD=t.VALIDATING_FIELD=t.SUBMITS=t.SUBMITTED=t.SUBMIT=t.VALIDATE=t.PRE_VALIDATE=t.RESET=t.SET_TOUCHED=t.REMOVE_ASYNC_SUCCESS=t.REMOVE_ASYNC_WARNING=t.REMOVE_ASYNC_ERROR=t.SET_ASYNC_SUCCESS=t.SET_ASYNC_WARNING=t.SET_ASYNC_ERROR=t.SET_SUCCESS=t.SET_WARNING=t.SET_ERROR=t.FORMAT=t.SET_VALUE=void 0;var R=r(11),N=n(R),O=r(12),I=n(O);t.setValue=a,t.format=u,t.setError=i,t.setWarning=s,t.setSuccess=o,t.setAsyncError=l,t.setAsyncWarning=d,t.setAsyncSuccess=f,t.removeAsyncError=c,t.removeAsyncWarning=p,t.removeAsyncSuccess=h,t.setTouched=y,t.reset=v,t.preValidate=S,t.validate=m,t.submit=_,t.submitted=A,t.submits=E,t.validatingField=g,t.doneValidatingField=b,t.validationFailure=V,t.validationSuccess=T,t.asyncValidate=C;var F=t.SET_VALUE="SET_VALUE",k=t.FORMAT="FORMAT",x=t.SET_ERROR="SET_ERROR",D=t.SET_WARNING="SET_WARNING",M=t.SET_SUCCESS="SET_SUCCESS",U=t.SET_ASYNC_ERROR="SET_ASYNC_ERROR",W=t.SET_ASYNC_WARNING="SET_ASYNC_WARNING",L=t.SET_ASYNC_SUCCESS="SET_ASYNC_SUCCESS",w=t.REMOVE_ASYNC_ERROR="REMOVE_ASYNC_ERROR",j=t.REMOVE_ASYNC_WARNING="REMOVE_ASYNC_WARNING",q=t.REMOVE_ASYNC_SUCCESS="REMOVE_ASYNC_SUCCESS",P=t.SET_TOUCHED="SET_TOUCHED",Y=t.RESET="RESET",G=t.PRE_VALIDATE="PRE_VALIDATE",J=t.VALIDATE="VALIDATE",B=t.SUBMIT="SUBMIT",H=t.SUBMITTED="SUBMITTED",z=t.SUBMITS="SUBMITS",K=t.VALIDATING_FIELD="VALIDATING_FIELD",Q=t.DONE_VALIDATING_FIELD="DONE_VALIDATING_FIELD",X=t.VALIDATION_FAILURE="VALIDATION_FAILURE",Z=t.VALIDATION_SUCCESS="VALIDATION_SUCCESS"},function(e,t,r){e.exports=r(17)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TextArea=t.Checkbox=t.Select=t.Radio=t.RadioGroup=t.FormField=t.NestedForm=t.Text=t.Form=void 0;var a=r(18),u=n(a),i=r(26),s=n(i),o=r(27),l=n(o),d=r(28),f=n(d),c=r(29),p=n(c),h=r(31),y=n(h),v=r(32),S=n(v),m=r(33),_=n(m),A=r(9),E=n(A);t.Form=u.default,t.Text=s.default,t.NestedForm=_.default,t.FormField=E.default,t.RadioGroup=S.default,t.Radio=l.default,t.Select=p.default,t.Checkbox=y.default,t.TextArea=f.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),u=n(a),i=r(8),s=n(i),o=r(19),l=n(o),d=r(11),f=n(d),c=r(12),p=n(c),h=r(3),y=n(h),v=r(0),S=n(v),m=r(1),_=n(m),A=r(4),E=n(A),g=r(5),b=n(g),V=r(10),T=n(V),C=r(13),R=n(C),N=r(14),O=n(N),I=r(20),F=n(I),k=r(6),x=n(k),D=r(7),M=n(D),U=r(21),W=n(U),L=r(22),w=r(23),j=(r(24),r(25)),q=n(j),P=r(15),Y=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(P),G=function e(t){return Array.isArray(t)?t.some(function(t){return e(t)}):null!==t&&"object"===(void 0===t?"undefined":(0,F.default)(t))?(0,O.default)(t).some(function(r){return e(t[r])}):t},J=function(e){return(0,R.default)(e.errors,e.asyncErrors)},B=function(e){return(0,R.default)(e.warnings,e.asyncWarnings)},H=function(e){return(0,R.default)(e.successes,e.asyncSuccesses)},z=function(e){return(0,R.default)(JSON.parse((0,T.default)(e)),{errors:J(e),warnings:B(e),successes:H(e)})},K=function(e){function t(e){(0,S.default)(this,t);var r=(0,E.default)(this,(t.__proto__||(0,y.default)(t)).call(this,e));return r.getValue=r.getValue.bind(r),r.setValue=r.setValue.bind(r),r.getTouched=r.getTouched.bind(r),r.setTouched=r.setTouched.bind(r),r.setError=r.setError.bind(r),r.format=r.format.bind(r),r.setWarning=r.setWarning.bind(r),r.setSuccess=r.setSuccess.bind(r),r.submitForm=r.submitForm.bind(r),r.reset=r.reset.bind(r),r.getError=r.getError.bind(r),r.getWarning=r.getWarning.bind(r),r.getSuccess=r.getSuccess.bind(r),r.doneValidatingField=r.doneValidatingField.bind(r),r.validatingField=r.validatingField.bind(r),r.registerAsyncValidation=r.registerAsyncValidation.bind(r),r.callAsynchronousValidators=r.callAsynchronousValidators.bind(r),r.asyncValidators=[],r}return(0,b.default)(t,e),(0,_.default)(t,[{key:"getChildContext",value:function(){return{formApi:this.api}}},{key:"componentDidMount",value:function(){this.props.dispatch(Y.preValidate()),this.props.dispatch(Y.validate()),this.props.registerAsyncValidation&&this.props.registerAsyncValidation(this.callAsynchronousValidators)}},{key:"componentWillReceiveProps",value:function(e){e.submits>this.props.submits&&(this.props.dispatch(Y.preValidate()),this.props.dispatch(Y.validate()),this.props.dispatch(Y.submits()));var t=(0,T.default)(e.formState)!==(0,T.default)(this.props.formState);this.props.formDidUpdate&&t&&this.props.formDidUpdate(z(e.formState)),this.props.update&&t&&this.props.update(z(e.formState))}},{key:"componentWillUnmount",value:function(){this.props.reset&&this.props.reset()}},{key:"setValue",value:function(e,t){this.props.dispatch(Y.setValue(e,t)),this.props.dispatch(Y.removeAsyncError(e)),this.props.dispatch(Y.removeAsyncWarning(e)),this.props.dispatch(Y.removeAsyncSuccess(e)),this.props.dispatch(Y.preValidate()),this.props.dispatch(Y.validate())}},{key:"setTouched",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.props.dispatch(Y.setTouched(e,t)),r&&this.props.dispatch(Y.asyncValidate(e,this.props.asyncValidators))}},{key:"setError",value:function(e,t){this.props.dispatch(Y.setError(e,t))}},{key:"setWarning",value:function(e,t){this.props.dispatch(Y.setWarning(e,t))}},{key:"setSuccess",value:function(e,t){this.props.dispatch(Y.setSuccess(e,t))}},{key:"getTouched",value:function(e){return Array.isArray(e)?this.props.formState.touched[e[0]]?this.props.formState.touched[e[0]][e[1]]:void 0:this.props.formState.touched[e]}},{key:"getValue",value:function(e){return Array.isArray(e)?this.props.formState.values[e[0]]?this.props.formState.values[e[0]][e[1]]:void 0:this.props.formState.values[e]}},{key:"getError",value:function(e){var t=this.errors;return Array.isArray(e)?t[e[0]]?t[e[0]][e[1]]:void 0:t[e]}},{key:"getWarning",value:function(e){var t=this.warnings;return Array.isArray(e)?t[e[0]]?t[e[0]][e[1]]:void 0:t[e]}},{key:"getSuccess",value:function(e){var t=this.successes;return Array.isArray(e)?t[e[0]]?t[e[0]][e[1]]:void 0:t[e]}},{key:"registerAsyncValidation",value:function(e){this.asyncValidators.push(e)}},{key:"format",value:function(e,t){this.props.dispatch(Y.format(e,t)),this.props.dispatch(Y.preValidate()),this.props.dispatch(Y.validate())}},{key:"reset",value:function(e){this.props.dispatch(Y.reset(e))}},{key:"validatingField",value:function(e){this.props.dispatch(Y.validatingField(e))}},{key:"doneValidatingField",value:function(e){this.props.dispatch(Y.doneValidatingField(e))}},{key:"submitForm",value:function(e){if(this.props.dispatch(Y.preValidate()),this.props.dispatch(Y.validate()),this.props.dispatch(Y.submits()),e&&e.preventDefault&&!this.props.dontPreventDefault&&e.preventDefault(e),this.props.dontPreventDefault){G(this.errors)&&e&&e.preventDefault&&e.preventDefault(e)}this.finishSubmission()}},{key:"finishSubmission",value:function(){function e(){return t.apply(this,arguments)}var t=(0,p.default)(f.default.mark(function e(){var t,r;return f.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.callAsynchronousValidators();case 2:t=this.errors,r=G(t),r||0!==this.props.formState.asyncValidations||(this.props.dispatch(Y.submitted()),this.props.onSubmit&&this.props.onSubmit(this.props.formState.values));case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"callAsynchronousValidators",value:function(){function e(){return t.apply(this,arguments)}var t=(0,p.default)(f.default.mark(function e(){var t,r,n=this;return f.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.props.asyncValidators?(0,O.default)(this.props.asyncValidators).map(function(e){return n.props.dispatch(Y.asyncValidate(e,n.props.asyncValidators))}):[],r=this.asyncValidators?this.asyncValidators.map(function(e){return e()}):[],t=t.concat(r),e.next=5,l.default.all(t);case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"render",value:function(){var e=this.props,t=e.children,r=e.component,n=e.render;return r?x.default.createElement(r,{formApi:this.api}):n?n(this.api):"function"==typeof t?t(this.api):x.default.cloneElement(t,{formApi:this.api})}},{key:"api",get:function(){return{values:this.props.formState.values,errors:this.errors,warnings:this.warnings,successes:this.successes,touched:this.props.formState.touched,asyncValidations:this.props.formState.asyncValidations,validating:this.props.formState.validating,validationFailures:this.props.formState.validationFailures,validationFailed:this.props.formState.validationFailed,submitForm:this.submitForm,setValue:this.setValue,getValue:this.getValue,setTouched:this.setTouched,getTouched:this.getTouched,getWarning:this.getWarning,getError:this.getError,getSuccess:this.getSuccess,setError:this.setError,setWarning:this.setWarning,setSuccess:this.setSuccess,format:this.format,submitted:this.props.formState.submitted,submits:this.props.formState.submits,reset:this.reset,validatingField:this.validatingField,doneValidatingField:this.doneValidatingField,registerAsyncValidation:this.registerAsyncValidation}}},{key:"errors",get:function(){return(0,R.default)(this.props.formState.errors,this.props.formState.asyncErrors)}},{key:"warnings",get:function(){return(0,R.default)(this.props.formState.warnings,this.props.formState.asyncWarnings)}},{key:"successes",get:function(){return(0,R.default)(this.props.formState.successes,this.props.formState.asyncSuccesses)}},{key:"currentState",get:function(){return(0,R.default)(JSON.parse((0,T.default)(this.props.formState)),{errors:this.errors,warnings:this.warnings,successes:this.successes})}}]),t}(k.Component);K.childContextTypes={formApi:M.default.object};var Q=function(e){return{formState:e}},X=function(e){return{dispatch:e}},Z=(0,w.connect)(Q,X)(K),$=function(e){function t(e){(0,S.default)(this,t);var r=(0,E.default)(this,(t.__proto__||(0,y.default)(t)).call(this,e)),n=e.validateError,a=e.validateWarning,u=e.validateSuccess,i=e.preValidate,s=e.defaultValues;return r.store=(0,L.createStore)(q.default.build({validateError:n,validateWarning:a,validateSuccess:u,preValidate:i,defaultValues:s}),(0,L.applyMiddleware)(W.default)),r}return(0,b.default)(t,e),(0,_.default)(t,[{key:"render",value:function(){var e=this.props,t=e.children,r=(0,s.default)(e,["children"]);return x.default.createElement(Z,(0,u.default)({store:this.store},r),t)}}]),t}(k.Component);t.default=$},function(e,t){e.exports=require("babel-runtime/core-js/promise")},function(e,t){e.exports=require("babel-runtime/helpers/typeof")},function(e,t){e.exports=require("redux-thunk")},function(e,t){e.exports=require("redux")},function(e,t){e.exports=require("react-redux")},function(e,t){e.exports=require("redux-logger")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(13),u=n(a),i=r(0),s=n(i),o=r(1),l=n(o),d=r(2),f=n(d),c=r(10),p=n(c),h=r(15),y={values:{},touched:{},errors:{},warnings:{},successes:{},asyncErrors:{},asyncWarnings:{},asyncSuccesses:{},validating:{},validationFailed:{},validationFailures:0,asyncValidations:0,submitted:!1,submits:0},v=function(e,t){var r=t.field,n=t.value,a=JSON.parse((0,p.default)(e.values));return Array.isArray(r)?(a[r[0]]=a[r[0]]||[],a[r[0]][r[1]]=n):a[r]=n,(0,f.default)({},e,{values:a})},S=function(e,t){var r=t.field,n=(0,f.default)({},e.values);return Array.isArray(r)?(n[r[0]]=n[r[0]]||[],n[r[0]][r[1]]=t.format(n[r[0]][r[1]])):n[r]=t.format(n[r]),(0,f.default)({},e,{values:n})},m=function(e,t){var r=t.field,n=t.touched,a=JSON.parse((0,p.default)(e.touched));return Array.isArray(r)?(a[r[0]]=a[r[0]]||[],a[r[0]][r[1]]=n):a[r]=n,(0,f.default)({},e,{touched:a})},_=function(e,t){var r=t.field,n=t.warning,a=JSON.parse((0,p.default)(e.warnings));return Array.isArray(r)?(a[r[0]]=a[r[0]]||[],a[r[0]][r[1]]=n):a[r]=n,(0,f.default)({},e,{warnings:a})},A=function(e,t){var r=t.field,n=t.error,a=JSON.parse((0,p.default)(e.errors));return Array.isArray(r)?(a[r[0]]=a[r[0]]||[],a[r[0]][r[1]]=n):a[r]=n,(0,f.default)({},e,{errors:a})},E=function(e,t){var r=t.field,n=t.success,a=JSON.parse((0,p.default)(e.successes));return Array.isArray(r)?(a[r[0]]=a[r[0]]||[],a[r[0]][r[1]]=n):a[r]=n,(0,f.default)({},e,{successes:a})},g=function(e,t){var r=t.field,n=t.warning,a=JSON.parse((0,p.default)(e.asyncWarnings));return Array.isArray(r)?a[r[0]]=n:a[r]=n,(0,f.default)({},e,{asyncWarnings:a})},b=function(e,t){var r=t.field,n=t.error,a=JSON.parse((0,p.default)(e.asyncErrors));return Array.isArray(r)?a[r[0]]=n:a[r]=n,(0,f.default)({},e,{asyncErrors:a})},V=function(e,t){var r=t.field,n=t.success,a=JSON.parse((0,p.default)(e.asyncSuccesses));return Array.isArray(r)?a[r[0]]=n:a[r]=n,(0,f.default)({},e,{asyncSuccesses:a})},T=function(e,t){var r=t.field,n=JSON.parse((0,p.default)(e.asyncWarnings));return Array.isArray(r)?delete n[r[0]]:delete n[r],(0,f.default)({},e,{asyncWarnings:n})},C=function(e,t){var r=t.field,n=JSON.parse((0,p.default)(e.asyncErrors));return Array.isArray(r)?delete n[r[0]]:delete n[r],(0,f.default)({},e,{asyncErrors:n})},R=function(e,t){var r=t.field,n=JSON.parse((0,p.default)(e.asyncSuccesses));return Array.isArray(r)?delete n[r[0]]:delete n[r],(0,f.default)({},e,{asyncSuccesses:n})},N=function(e,t,r,n,a){var u=r?r(e.values):{},i=n?n(e.values):{},s=a?a(e.values,u):{};return u=(0,f.default)({},e.errors,u),i=(0,f.default)({},e.warnings,i),s=(0,f.default)({},e.successes,s),(0,f.default)({},e,{errors:u,warnings:i,successes:s})},O=function(e,t,r){var n=r?r(e.values):e.values;return(0,f.default)({},e,{values:n})},I=function(e){return(0,f.default)({},e,{submits:e.submits+1})},F=function(e){return(0,f.default)({},e,{submitted:!0})},k=function(e,t){var r=t.field,n=JSON.parse((0,p.default)(e));return n.values[r]=null,n.touched[r]=null,n.errors[r]=null,n.warnings[r]=null,n.successes[r]=null,n.asyncErrors[r]=null,n.asyncWarnings[r]=null,n.asyncSuccesses[r]=null,(0,f.default)({},e,n)},x=function(e,t){var r=t.field,n=JSON.parse((0,p.default)(e.validating)),a=e.asyncValidations;return Array.isArray(r)?(a=n[r[0]]?a:a+1,n[r[0]]=!0):(a=n[r]?a:a+1,n[r]=!0),(0,f.default)({},e,{asyncValidations:a,validating:n})},D=function(e,t){var r=t.field,n=JSON.parse((0,p.default)(e.validating)),a=e.asyncValidations;return Array.isArray(r)?(a=n[r[0]]?a-1:a,n[r[0]]=!1):(a=n[r]?a-1:a,n[r]=!1),(0,f.default)({},e,{asyncValidations:a,validating:n})},M=function(e,t){var r=t.field,n=JSON.parse((0,p.default)(e.validationFailed)),a=e.validationFailures;return Array.isArray(r)?(a=!1===n[r[0]]?a+1:a,n[r[0]]=!0):(a=n[r]?a:a+1,n[r]=!0),(0,f.default)({},e,{validationFailures:a,validationFailed:n})},U=function(e,t){var r=t.field,n=e.validationFailures,a=JSON.parse((0,p.default)(e.validationFailed));return Array.isArray(r)?(n=!0===a[r[0]]?n-1:n,a[r[0]]=!1):(n=!0===a[r]?n-1:n,a[r]=!1),(0,f.default)({},e,{validationFailures:n,validationFailed:a})},W=function(){function e(){(0,s.default)(this,e)}return(0,l.default)(e,null,[{key:"build",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.validateError,r=e.validateWarning,n=e.validateSuccess,a=e.defaultValues,i=(0,u.default)({},y,{values:a||{}});return function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,u=arguments[1];switch(u.type){case h.SET_VALUE:return v(a,u);case h.FORMAT:return S(a,u);case h.SET_ERROR:return A(a,u);case h.SET_WARNING:return _(a,u);case h.SET_SUCCESS:return E(a,u);case h.SET_ASYNC_ERROR:return b(a,u);case h.SET_ASYNC_WARNING:return g(a,u);case h.SET_ASYNC_SUCCESS:return V(a,u);case h.SET_TOUCHED:return m(a,u);case h.REMOVE_ASYNC_ERROR:return C(a,u);case h.REMOVE_ASYNC_WARNING:return T(a,u);case h.REMOVE_ASYNC_SUCCESS:return R(a,u);case h.PRE_VALIDATE:return O(a,0,e.preValidate);case h.VALIDATE:return N(a,0,t,r,n);case h.SUBMITTED:return F(a);case h.SUBMITS:return I(a);case h.RESET:return k(a,u);case h.VALIDATION_FAILURE:return M(a,u);case h.VALIDATION_SUCCESS:return U(a,u);case h.DONE_VALIDATING_FIELD:return D(a,u);case h.VALIDATING_FIELD:return x(a,u);default:return a}}}}]),e}();t.default=W},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),u=n(a),i=r(8),s=n(i),o=r(3),l=n(o),d=r(0),f=n(d),c=r(1),p=n(c),h=r(4),y=n(h),v=r(5),S=n(v),m=r(6),_=n(m),A=r(7),E=n(A),g=r(9),b=n(g),V=function(e){function t(){return(0,f.default)(this,t),(0,y.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,S.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.fieldDidUpdate,r=e.fieldApi,n=e.onInput,a=(0,s.default)(e,["fieldDidUpdate","fieldApi","onInput"]),i=r.getValue,o=r.setValue,l=r.setTouched;r.format;return _.default.createElement("input",(0,u.default)({value:i(),onInput:function(e){o(e.target.value),t&&t(e.target.value),n&&n(e)},onBlur:function(){l()}},a))}}]),t}(m.Component),T=function(e){function t(){return(0,f.default)(this,t),(0,y.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,S.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=(0,s.default)(e,["field"]);return _.default.createElement(b.default,{field:t},_.default.createElement(V,r))}}]),t}(m.Component);T.propTypes={field:E.default.oneOfType([E.default.string,E.default.array]).isRequired},t.default=T},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),u=n(a),i=r(8),s=n(i),o=r(3),l=n(o),d=r(0),f=n(d),c=r(1),p=n(c),h=r(4),y=n(h),v=r(5),S=n(v),m=r(6),_=n(m),A=r(7),E=n(A),g=function(e){function t(){return(0,f.default)(this,t),(0,y.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,S.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=(e.onChange,e.onClick),r=e.group,n=e.value,a=(0,s.default)(e,["onChange","onClick","group","value"]);return _.default.createElement("input",(0,u.default)({checked:r.getValue()===n,onBlur:function(){return r.setTouched()},onClick:function(e){r.setValue(n),r.fieldDidUpdate(n),t&&t(e)},type:"radio"},a))}}]),t}(m.Component);g.propTypes={value:E.default.string.isRequired,group:E.default.object.isRequired},t.default=g},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),u=n(a),i=r(8),s=n(i),o=r(3),l=n(o),d=r(0),f=n(d),c=r(1),p=n(c),h=r(4),y=n(h),v=r(5),S=n(v),m=r(6),_=n(m),A=r(7),E=n(A),g=r(9),b=n(g),V=function(e){function t(){return(0,f.default)(this,t),(0,y.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,S.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=(e.onChange,e.fieldApi),r=e.fieldDidUpdate,n=e.onInput,a=(0,s.default)(e,["onChange","fieldApi","fieldDidUpdate","onInput"]),i=t.getValue,o=t.setValue,l=t.setTouched;return _.default.createElement("textarea",(0,u.default)({value:i(""),onInput:function(e){o(e.target.value),r&&r(e.target.value),n&&n(e)},onBlur:function(){return l()}},a))}}]),t}(m.Component),T=function(e){function t(){return(0,f.default)(this,t),(0,y.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,S.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=(0,s.default)(e,["field"]);return _.default.createElement(b.default,{field:t},_.default.createElement(V,r))}}]),t}(m.Component);T.propTypes={field:E.default.oneOfType([E.default.string,E.default.array]).isRequired},t.default=T},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),u=n(a),i=r(30),s=n(i),o=r(8),l=n(o),d=r(3),f=n(d),c=r(0),p=n(c),h=r(1),y=n(h),v=r(4),S=n(v),m=r(5),_=n(m),A=r(6),E=n(A),g=r(7),b=n(g),V=r(9),T=n(V),C=function(e){function t(){return(0,p.default)(this,t),(0,S.default)(this,(t.__proto__||(0,f.default)(t)).apply(this,arguments))}return(0,_.default)(t,e),(0,y.default)(t,[{key:"render",value:function(){var e=this.props,t=e.fieldDidUpdate,r=e.fieldApi,n=e.options,a=e.onChange,i=e.placeholder,o=(0,l.default)(e,["fieldDidUpdate","fieldApi","options","onChange","placeholder"]),d=r.getValue,f=r.setValue,c=r.setTouched,p=n.find(function(e){return""===e.value})?n:[{label:i||"Select One...",value:"",disabled:!0}].concat((0,s.default)(n)),h=p.findIndex(function(e){return""===e.value}),y=p.findIndex(function(e){return e.value===d()});return E.default.createElement("select",(0,u.default)({onBlur:function(){return c()},onChange:function(e){var r=p[e.target.value].value;f(r),a&&a(e),t&&t(r)},value:y>-1?y:h},o),p.map(function(e,t){return E.default.createElement("option",{key:e.value,value:t,disabled:e.disabled},e.label)}))}}]),t}(A.Component),R=function(e){function t(){return(0,p.default)(this,t),(0,S.default)(this,(t.__proto__||(0,f.default)(t)).apply(this,arguments))}return(0,_.default)(t,e),(0,y.default)(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=(0,l.default)(e,["field"]);return E.default.createElement(T.default,{field:t},E.default.createElement(C,r))}}]),t}(A.Component);R.propTypes={field:b.default.oneOfType([b.default.string,b.default.array]).isRequired},t.default=R},function(e,t){e.exports=require("babel-runtime/helpers/toConsumableArray")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),u=n(a),i=r(8),s=n(i),o=r(3),l=n(o),d=r(0),f=n(d),c=r(1),p=n(c),h=r(4),y=n(h),v=r(5),S=n(v),m=r(6),_=n(m),A=r(7),E=n(A),g=r(9),b=n(g),V=function(e){function t(){return(0,f.default)(this,t),(0,y.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,S.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.fieldDidUpdate,r=e.fieldApi,n=e.onChange,a=(0,s.default)(e,["fieldDidUpdate","fieldApi","onChange"]),i=r.getValue,o=r.setValue,l=r.setTouched;return _.default.createElement("input",(0,u.default)({checked:i(),onBlur:function(){return l()},onChange:function(e){o(e.target.checked),n&&n(e),t&&t(e.target.checked)},type:"checkbox"},a))}}]),t}(m.Component),T=function(e){function t(){return(0,f.default)(this,t),(0,y.default)(this,(t.__proto__||(0,l.default)(t)).apply(this,arguments))}return(0,S.default)(t,e),(0,p.default)(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=(0,s.default)(e,["field"]);return _.default.createElement(b.default,{field:t},_.default.createElement(V,r))}}]),t}(m.Component);T.propTypes={field:E.default.string.isRequired},t.default=T},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(8),u=n(a),i=r(3),s=n(i),o=r(0),l=n(o),d=r(1),f=n(d),c=r(4),p=n(c),h=r(5),y=n(h),v=r(6),S=n(v),m=r(7),_=n(m),A=r(9),E=n(A),g=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,f.default)(t,[{key:"componentWillMount",value:function(){this.props.value&&this.props.fieldApi.setValue(this.props.value)}},{key:"render",value:function(){var e=this.props,t=e.fieldApi,r=e.children,n=e.component,a=e.render,u=e.fieldDidUpdate;return t.fieldDidUpdate=function(e){u&&u(e)},n?S.default.createElement(n,{group:t}):a?a(t):"function"==typeof r?r(t):S.default.cloneElement(r,{group:t})}}]),t}(v.Component),b=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=(0,u.default)(e,["field"]);return S.default.createElement(E.default,{field:t},S.default.createElement(g,r))}}]),t}(v.Component);b.propTypes={field:_.default.string.isRequired},t.default=b},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),u=n(a),i=r(3),s=n(i),o=r(0),l=n(o),d=r(1),f=n(d),c=r(4),p=n(c),h=r(5),y=n(h),v=r(14),S=n(v),m=r(6),_=n(m),A=r(7),E=n(A),g=r(9),b=n(g),V=function(e){var t=e.children,r=e.fieldApi,n=r.setValue,a=r.setError,u=r.setWarning,i=r.setSuccess,s=r.setTouched,o=r.submitted,l=r.submits,d=r.validatingField,f=r.doneValidatingField,c=r.registerAsyncValidation,p=r.reset;return _.default.cloneElement(t,{submitted:o,submits:l,reset:p,update:function(e){var t=e.values,r=e.errors,o=e.successes,l=e.warnings,c=e.touched,p=e.asyncValidations,h=!!r&&(0,S.default)(r).some(function(e){return r[e]}),y=!!o&&(0,S.default)(o).some(function(e){return o[e]}),v=!!l&&(0,S.default)(l).some(function(e){return l[e]});n(t),s(c),a(h?r:null),u(v?l:null),i(y?o:null),p>0?d():f()},registerAsyncValidation:c})},T=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,s.default)(t)).apply(this,arguments))}return(0,y.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e=this.props,t=e.field,r=e.children;return _.default.createElement(b.default,{field:t,nestedForm:!0},_.default.createElement(V,(0,u.default)({field:t},r.props),r))}}]),t}(m.Component);T.propTypes={field:E.default.oneOfType([E.default.string,E.default.array]).isRequired},t.default=T}])}); |
{ | ||
"name": "react-form", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "React Form is a lightweight framework and utility for building powerful forms in React applications.", | ||
@@ -45,3 +45,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"babel-polyfill": "^6.26.0", | ||
"babel-runtime": "^6.26.0", | ||
"prop-types": "^15.5.10", | ||
@@ -57,2 +57,3 @@ "react-redux": "^5.0.6", | ||
"babel-loader": "^7.1.1", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-env": "^1.6.0", | ||
@@ -98,5 +99,6 @@ "babel-preset-react": "^6.24.1", | ||
"plugins": [ | ||
"react-hot-loader/babel" | ||
"react-hot-loader/babel", | ||
"transform-runtime" | ||
] | ||
} | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
36832
36
2
+ Addedbabel-runtime@^6.26.0
- Removedbabel-polyfill@^6.26.0
- Removedbabel-polyfill@6.26.0(transitive)
- Removedregenerator-runtime@0.10.5(transitive)