Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-form-with-constraints

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-form-with-constraints - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0

9

CHANGELOG.md

@@ -0,1 +1,10 @@

## v0.12.0 (2019/03/21)
### Features
- Update examples to use hooks
- Remove *.js.gz files
- Upgrade NPM packages
## v0.11.0 (2019/01/05)

@@ -2,0 +11,0 @@

62

dist/react-form-with-constraints.development.js

@@ -198,3 +198,3 @@ (function (global, factory) {

var ValidateFieldEvent = 'VALIDATE_FIELD_EVENT';
var withValidateFieldEventEmitter = function (Base) {
function withValidateFieldEventEmitter(Base) {
return (function (_super) {

@@ -218,6 +218,6 @@ __extends(ValidateFieldEventEmitter, _super);

}(Base));
};
}
var FieldWillValidateEvent = 'FIELD_WILL_VALIDATE_EVENT';
var withFieldWillValidateEventEmitter = function (Base) {
function withFieldWillValidateEventEmitter(Base) {
return (function (_super) {

@@ -241,6 +241,6 @@ __extends(FieldWillValidateEventEmitter, _super);

}(Base));
};
}
var FieldDidValidateEvent = 'FIELD_DID_VALIDATE_EVENT';
var withFieldDidValidateEventEmitter = function (Base) {
function withFieldDidValidateEventEmitter(Base) {
return (function (_super) {

@@ -264,6 +264,6 @@ __extends(FieldDidValidateEventEmitter, _super);

}(Base));
};
}
var FieldDidResetEvent = 'FIELD_DID_RESET_EVENT';
var withFieldDidResetEventEmitter = function (Base) {
function withFieldDidResetEventEmitter(Base) {
return (function (_super) {

@@ -287,3 +287,3 @@ __extends(ResetFieldEvenEmitter, _super);

}(Base));
};
}

@@ -337,7 +337,7 @@ var InputElement = (function () {

var clearArray = function (array) {
function clearArray(array) {
while (array.length) {
array.pop();
}
};
}

@@ -426,8 +426,10 @@ var Field = (function () {

var flattenDeep = function (arrayOfArrays) {
function flattenDeep(arrayOfArrays) {
return arrayOfArrays
.reduce(function (prev, curr) { return prev.concat(Array.isArray(curr) ? flattenDeep(curr) : curr); }, []);
};
}
var notUndefined = function (value) { return value !== undefined; };
function notUndefined(value) {
return value !== undefined;
}

@@ -1142,3 +1144,3 @@ var FormWithConstraintsComponent = (function (_super) {

var deepForEach = function (children, fn) {
function deepForEach(children, fn) {
React.Children.forEach(children, function (child) {

@@ -1151,25 +1153,25 @@ var element = child;

});
};
}
exports.FieldFeedbackType = FieldFeedbackType$1;
exports.Async = Async;
exports.EventEmitter = EventEmitter;
exports.Field = Field;
exports.EventEmitter = EventEmitter;
exports.deepForEach = deepForEach;
exports.FormWithConstraints = FormWithConstraints;
exports.FieldFeedbacks = FieldFeedbacks;
exports.FieldDidResetEvent = FieldDidResetEvent;
exports.FieldDidValidateEvent = FieldDidValidateEvent;
exports.FieldFeedback = FieldFeedback;
exports.FieldFeedbackType = FieldFeedbackType$1;
exports.FieldFeedbackWhenValid = FieldFeedbackWhenValid;
exports.Async = Async;
exports.FieldFeedbacks = FieldFeedbacks;
exports.FieldWillValidateEvent = FieldWillValidateEvent;
exports.FieldsStore = FieldsStore;
exports.FormWithConstraints = FormWithConstraints;
exports.IValidityState = IValidityState;
exports.Input = Input;
exports.InputElement = InputElement;
exports.ValidateFieldEvent = ValidateFieldEvent;
exports.deepForEach = deepForEach;
exports.withFieldDidResetEventEmitter = withFieldDidResetEventEmitter;
exports.withFieldDidValidateEventEmitter = withFieldDidValidateEventEmitter;
exports.withFieldWillValidateEventEmitter = withFieldWillValidateEventEmitter;
exports.withValidateFieldEventEmitter = withValidateFieldEventEmitter;
exports.FieldWillValidateEvent = FieldWillValidateEvent;
exports.withFieldWillValidateEventEmitter = withFieldWillValidateEventEmitter;
exports.FieldDidValidateEvent = FieldDidValidateEvent;
exports.withFieldDidValidateEventEmitter = withFieldDidValidateEventEmitter;
exports.FieldDidResetEvent = FieldDidResetEvent;
exports.withFieldDidResetEventEmitter = withFieldDidResetEventEmitter;
exports.InputElement = InputElement;
exports.IValidityState = IValidityState;
exports.Input = Input;

@@ -1176,0 +1178,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","react","prop-types"],t):t((e=e||self).ReactFormWithConstraints={},e.React,e.PropTypes)}(this,function(s,f,i){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function r(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var p=function(){return(p=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function h(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&(i[n[r]]=e[n[r]])}return i}function l(a,o,s,l){return new(s||(s=Promise))(function(e,t){function i(e){try{r(l.next(e))}catch(e){t(e)}}function n(e){try{r(l.throw(e))}catch(e){t(e)}}function r(t){t.done?e(t.value):new s(function(e){e(t.value)}).then(i,n)}r((l=l.apply(a,o||[])).next())})}function v(i,n){var r,a,o,e,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,a&&(o=2&t[0]?a.return:t[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,t[1])).done)return o;switch(a=0,o&&(t=[2&t[0],o.value]),t[0]){case 0:case 1:o=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(o=0<(o=s.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3])){s.label=t[1];break}if(6===t[0]&&s.label<o[1]){s.label=o[1],o=t;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(t);break}o[2]&&s.ops.pop(),s.trys.pop();continue}t=n.call(i,s)}catch(e){t=[6,e],a=0}finally{r=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function y(e){var t="function"==typeof Symbol&&e[Symbol.iterator],i=0;return t?t.call(e):{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function a(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,a=i.call(e),o=[];try{for(;(void 0===t||0<t--)&&!(n=a.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e}var e,t,o=function(){function e(){this.listeners=new Map}return e.prototype.emit=function(c){for(var f=[],e=1;e<arguments.length;e++)f[e-1]=arguments[e];return l(this,void 0,void 0,function(){var t,i,n,r,a,o,s,l,d,u;return v(this,function(e){switch(e.label){case 0:if(n=this.listeners.get(c),r=new Array,void 0===n)return[3,8];e.label=1;case 1:e.trys.push([1,6,7,8]),a=y(n),o=a.next(),e.label=2;case 2:return o.done?[3,5]:(s=o.value,d=(l=r).push,[4,s.apply(void 0,m(f))]);case 3:d.apply(l,[e.sent()]),e.label=4;case 4:return o=a.next(),[3,2];case 5:return[3,8];case 6:return u=e.sent(),t={error:u},[3,8];case 7:try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}return[7];case 8:return[2,r]}})})},e.prototype.addListener=function(e,t){this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t)},e.prototype.removeListener=function(e,t){var i=this.listeners.get(e),n=i.lastIndexOf(t);i.splice(n,1),0===i.length&&this.listeners.delete(e)},e}(),d="VALIDATE_FIELD_EVENT",u=function(e){return function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.validateFieldEventEmitter=new o,e}return r(e,t),e.prototype.emitValidateFieldEvent=function(e){return this.validateFieldEventEmitter.emit(d,e)},e.prototype.addValidateFieldEventListener=function(e){this.validateFieldEventEmitter.addListener(d,e)},e.prototype.removeValidateFieldEventListener=function(e){this.validateFieldEventEmitter.removeListener(d,e)},e}(e)},c="FIELD_WILL_VALIDATE_EVENT",F=function(e){return function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.fieldWillValidateEventEmitter=new o,e}return r(e,t),e.prototype.emitFieldWillValidateEvent=function(e){return this.fieldWillValidateEventEmitter.emit(c,e)},e.prototype.addFieldWillValidateEventListener=function(e){this.fieldWillValidateEventEmitter.addListener(c,e)},e.prototype.removeFieldWillValidateEventListener=function(e){this.fieldWillValidateEventEmitter.removeListener(c,e)},e}(e)},E="FIELD_DID_VALIDATE_EVENT",b=function(e){return function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.fieldDidValidateEventEmitter=new o,e}return r(e,t),e.prototype.emitFieldDidValidateEvent=function(e){return this.fieldDidValidateEventEmitter.emit(E,e)},e.prototype.addFieldDidValidateEventListener=function(e){this.fieldDidValidateEventEmitter.addListener(E,e)},e.prototype.removeFieldDidValidateEventListener=function(e){this.fieldDidValidateEventEmitter.removeListener(E,e)},e}(e)},w="FIELD_DID_RESET_EVENT",g=function(e){return function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.fieldDidResetEventEmitter=new o,e}return r(e,t),e.prototype.emitFieldDidResetEvent=function(e){return this.fieldDidResetEventEmitter.emit(w,e)},e.prototype.addFieldDidResetEventListener=function(e){this.fieldDidResetEventEmitter.addListener(w,e)},e.prototype.removeFieldDidResetEventListener=function(e){this.fieldDidResetEventEmitter.removeListener(w,e)},e}(e)},V=function(e){void 0===e.props?(e=e,this.name=e.name,this.type=e.type,this.value=e.value,this.validity=new k(e.validity),this.validationMessage=e.validationMessage):(e=e,this.name=e.props.name,this.type=void 0,this.value=e.props.value,this.validity=void 0,this.validationMessage=void 0)},k=function(e){this.badInput=e.badInput,this.customError=e.customError,this.patternMismatch=e.patternMismatch,this.rangeOverflow=e.rangeOverflow,this.rangeUnderflow=e.rangeUnderflow,this.stepMismatch=e.stepMismatch,this.tooLong=e.tooLong,this.tooShort=e.tooShort,this.typeMismatch=e.typeMismatch,this.valid=e.valid,this.valueMissing=e.valueMissing};(t=e||(e={})).Error="error",t.Warning="warning",t.Info="info",t.WhenValid="whenValid";var D,x=e,L=function(){function e(e){this.name=e,this.validations=[]}return e.prototype.addOrReplaceValidation=function(t){var e=this.validations.findIndex(function(e){return e.key===t.key});-1<e?this.validations[e]=t:this.validations.push(t)},e.prototype.clearValidations=function(){!function(e){for(;e.length;)e.pop()}(this.validations)},e.prototype.hasFeedbacksOfType=function(t,i){return this.validations.some(function(e){return(void 0===i||e.key.startsWith(i+"."))&&e.type===t&&!0===e.show})},e.prototype.hasErrors=function(e){return this.hasFeedbacksOfType(x.Error,e)},e.prototype.hasWarnings=function(e){return this.hasFeedbacksOfType(x.Warning,e)},e.prototype.hasInfos=function(e){return this.hasFeedbacksOfType(x.Info,e)},e.prototype.hasFeedbacks=function(e){return this.hasErrors(e)||this.hasWarnings(e)||this.hasInfos(e)},e.prototype.isValid=function(){return!this.hasErrors()},e}();(D=s.FieldEvent||(s.FieldEvent={})).Added="FIELD_ADDED",D.Removed="FIELD_REMOVED";var R,S=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.fields=new Array,e}return r(e,t),e.prototype.getField=function(t){var e=this.fields.filter(function(e){return e.name===t});return 1===e.length?e[0]:void 0},e.prototype.addField=function(t){if(0===this.fields.filter(function(e){return e.name===t}).length){var e=new L(t);this.fields.push(e),this.emit(s.FieldEvent.Added,e)}},e.prototype.removeField=function(t){var e=this.fields.filter(function(e){return e.name===t}),i=this.fields.indexOf(e[0]);-1<i&&(this.fields.splice(i,1),this.emit(s.FieldEvent.Removed,t))},e.prototype.isValid=function(){return this.fields.every(function(e){return e.isValid()})},e.prototype.hasFeedbacks=function(){return this.fields.some(function(e){return e.hasFeedbacks()})},e}(o),W=function(e){return e.reduce(function(e,t){return e.concat(Array.isArray(t)?W(t):t)},[])},O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.form=null,e.fieldsStore=new S,e.fieldFeedbacksKeyCounter=0,e}return r(e,t),e.prototype.getChildContext=function(){return{form:this}},e.prototype.computeFieldFeedbacksKey=function(){return""+this.fieldFeedbacksKeyCounter++},e.prototype.validateFields=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._validateFields.apply(this,m([!0],e))},e.prototype.validateForm=function(){return this.validateFieldsWithoutFeedback()},e.prototype.validateFieldsWithoutFeedback=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._validateFields.apply(this,m([!1],e))},e.prototype._validateFields=function(u){for(var c=[],e=1;e<arguments.length;e++)c[e-1]=arguments[e];return l(this,void 0,void 0,function(){var t,i,n,r,a,o,s,l,d;return v(this,function(e){switch(e.label){case 0:n=new Array,r=this.normalizeInputs.apply(this,m(c)),e.label=1;case 1:e.trys.push([1,6,7,8]),a=y(r),o=a.next(),e.label=2;case 2:return o.done?[3,5]:(s=o.value,[4,this.validateField(u,new V(s))]);case 3:void 0!==(l=e.sent())&&n.push(l),e.label=4;case 4:return o=a.next(),[3,2];case 5:return[3,8];case 6:return d=e.sent(),t={error:d},[3,8];case 7:try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}return[7];case 8:return[2,n]}})})},e.prototype.validateField=function(n,r){return l(this,void 0,void 0,function(){var t,i;return v(this,function(e){switch(e.label){case 0:return t=r.name,void 0!==(i=this.fieldsStore.getField(t))?[3,1]:[3,3];case 1:return!n&&i.hasFeedbacks()?[3,3]:(i.clearValidations(),this.emitFieldWillValidateEvent(t),[4,this.emitValidateFieldEvent(r)]);case 2:e.sent(),this.emitFieldDidValidateEvent(i),e.label=3;case 3:return[2,i]}})})},e.prototype.normalizeInputs=function(){for(var e,r=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return 0===t.length?(e=(e=m(this.form.querySelectorAll("[name]"))).filter(function(e){return void 0!==e.validity})).filter(function(e){return"checkbox"!==e.type&&"radio"!==e.type}).map(function(e){return e.name}).forEach(function(e,t,i){if(i.indexOf(e)!==t)throw new Error("Multiple elements matching '[name=\""+e+"\"]' inside the form")}):e=t.map(function(e){if("string"!=typeof e)return e;var t='[name="'+e+'"]',i=m(r.form.querySelectorAll(t));if(0<i.filter(function(e){return void 0===e.validity}).length)throw new Error("'"+t+"' should match an <input>, <select> or <textarea>");if(1<i.filter(function(e){return"checkbox"!==e.type&&"radio"!==e.type}).length)throw new Error("Multiple elements matching '"+t+"' inside the form");var n=i[0];if(void 0===n)throw new Error("Could not find field '"+t+"' inside the form");return n}),e},e.prototype.isValid=function(){return this.fieldsStore.isValid()},e.prototype.hasFeedbacks=function(){return this.fieldsStore.hasFeedbacks()},e.prototype.reset=function(){return this.resetFields()},e.prototype.resetFields=function(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];return l(this,void 0,void 0,function(){var t,i,n,r,a,o,s,l,d;return v(this,function(e){switch(e.label){case 0:n=new Array,r=this.normalizeInputs.apply(this,m(u)),e.label=1;case 1:e.trys.push([1,6,7,8]),a=y(r),o=a.next(),e.label=2;case 2:return o.done?[3,5]:(s=o.value,[4,this.resetField(new V(s))]);case 3:void 0!==(l=e.sent())&&n.push(l),e.label=4;case 4:return o=a.next(),[3,2];case 5:return[3,8];case 6:return d=e.sent(),t={error:d},[3,8];case 7:try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}return[7];case 8:return[2,n]}})})},e.prototype.resetField=function(n){return l(this,void 0,void 0,function(){var t,i;return v(this,function(e){switch(e.label){case 0:return t=n.name,void 0!==(i=this.fieldsStore.getField(t))?[3,1]:[3,3];case 1:return i.clearValidations(),[4,this.emitFieldDidResetEvent(i)];case 2:e.sent(),e.label=3;case 3:return[2,i]}})})},e.prototype.render=function(){var t=this;return f.createElement("form",p({ref:function(e){return t.form=e}},this.props))},e.childContextTypes={form:i.instanceOf(e).isRequired},e}(g(F(b(u(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(f.Component)))))),I=function(a){function e(e,t){var i=a.call(this,e,t)||this;i.fieldFeedbackKeyCounter=0,i.validate=function(o){return l(i,void 0,void 0,function(){var t,i,n,r,a;return v(this,function(e){switch(e.label){case 0:return t=this.context,i=t.form,n=t.fieldFeedbacks,o.name!==this.fieldName?[3,3]:(a=i.fieldsStore.getField(this.fieldName),n&&("first"===n.props.stop&&a.hasFeedbacks(n.key)||"first-error"===n.props.stop&&a.hasErrors(n.key)||"first-warning"===n.props.stop&&a.hasWarnings(n.key)||"first-info"===n.props.stop&&a.hasInfos(n.key))?[3,3]:[3,1]);case 1:return[4,this._validate(o)];case 2:r=e.sent(),e.label=3;case 3:return[2,r]}})})};var n=t.form,r=t.fieldFeedbacks;if(i.key=r?r.computeFieldFeedbackKey():n.computeFieldFeedbacksKey(),r){if(i.fieldName=r.fieldName,void 0!==e.for)throw new Error("FieldFeedbacks cannot have a parent and a 'for' prop")}else{if(void 0===e.for)throw new Error("FieldFeedbacks cannot be without parent and without 'for' prop");i.fieldName=e.for}return i}return r(e,a),e.prototype.getChildContext=function(){return{fieldFeedbacks:this}},e.prototype.computeFieldFeedbackKey=function(){return this.key+"."+this.fieldFeedbackKeyCounter++},e.prototype.addFieldFeedback=function(){return this.computeFieldFeedbackKey()},e.prototype.componentWillMount=function(){var e=this.context,t=e.form,i=e.fieldFeedbacks;t.fieldsStore.addField(this.fieldName),(i||t).addValidateFieldEventListener(this.validate)},e.prototype.componentWillUnmount=function(){var e=this.context,t=e.form,i=e.fieldFeedbacks;t.fieldsStore.removeField(this.fieldName),(i||t).removeValidateFieldEventListener(this.validate)},e.prototype._validate=function(i){return l(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:return[4,this.emitValidateFieldEvent(i)];case 1:return t=e.sent(),[2,W(t)]}})})},e.prototype.render=function(){var e=this.props.children;return void 0!==e?e:null},e.defaultProps={stop:"first-error"},e.contextTypes={form:i.instanceOf(O).isRequired,fieldFeedbacks:i.instanceOf(e)},e.childContextTypes={fieldFeedbacks:i.instanceOf(e).isRequired},e}(u(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(f.Component)));(R=s.Status||(s.Status={}))[R.None=0]="None",R[R.Pending=1]="Pending",R[R.Rejected=2]="Rejected",R[R.Resolved=3]="Resolved";var M=function(e){function t(){var o=null!==e&&e.apply(this,arguments)||this;return o.state={status:s.Status.None},o.validate=function(e){var t,i=o.context,n=i.form,r=i.fieldFeedbacks,a=n.fieldsStore.getField(e.name);return"first"===r.props.stop&&a.hasFeedbacks(r.key)||"first-error"===r.props.stop&&a.hasErrors(r.key)||"first-warning"===r.props.stop&&a.hasWarnings(r.key)||"first-info"===r.props.stop&&a.hasInfos(r.key)?o.setState({status:s.Status.None}):t=o._validate(e),t},o}return r(t,e),t.prototype.getChildContext=function(){return{async:this}},t.prototype.componentWillMount=function(){this.context.fieldFeedbacks.addValidateFieldEventListener(this.validate)},t.prototype.componentWillUnmount=function(){this.context.fieldFeedbacks.removeValidateFieldEventListener(this.validate)},t.prototype._validate=function(n){return l(this,void 0,void 0,function(){var t,i;return v(this,function(e){switch(e.label){case 0:this.setState({status:s.Status.Pending}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.props.promise(n.value)];case 2:return t=e.sent(),this.setState({status:s.Status.Resolved,value:t}),[3,4];case 3:return i=e.sent(),this.setState({status:s.Status.Rejected,value:i}),[3,4];case 4:return[2,this.emitValidateFieldEvent(n)]}})})},t.prototype.render=function(){var e=this.props,t=this.state,i=null;switch(t.status){case s.Status.None:break;case s.Status.Pending:e.pending&&(i=e.pending);break;case s.Status.Resolved:e.then&&(i=e.then(t.value));break;case s.Status.Rejected:e.catch&&(i=e.catch(t.value))}return i},t.contextTypes={form:i.instanceOf(O).isRequired,fieldFeedbacks:i.instanceOf(I).isRequired},t.childContextTypes={async:i.instanceOf(t).isRequired},t}(u(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(f.Component))),_=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={fieldIsValid:void 0},t.fieldWillValidate=function(e){e===t.context.fieldFeedbacks.fieldName&&t.setState({fieldIsValid:void 0})},t.fieldDidValidate=function(e){e.name===t.context.fieldFeedbacks.fieldName&&t.setState({fieldIsValid:e.isValid()})},t.fieldDidReset=function(e){e.name===t.context.fieldFeedbacks.fieldName&&t.setState({fieldIsValid:void 0})},t}return r(t,e),t.prototype.componentWillMount=function(){var e=this.context.form;e.addFieldWillValidateEventListener(this.fieldWillValidate),e.addFieldDidValidateEventListener(this.fieldDidValidate),e.addFieldDidResetEventListener(this.fieldDidReset)},t.prototype.componentWillUnmount=function(){var e=this.context.form;e.removeFieldWillValidateEventListener(this.fieldWillValidate),e.removeFieldDidValidateEventListener(this.fieldDidValidate),e.removeFieldDidResetEventListener(this.fieldDidReset)},t.prototype.render=function(){var e=this.props,t=e.style,i=h(e,["style"]);return this.state.fieldIsValid?f.createElement("span",p({},i,{style:p({display:"block"},t)})):null},t.contextTypes={form:i.instanceOf(O).isRequired,fieldFeedbacks:i.instanceOf(I).isRequired},t}(f.Component),N=function(s){function e(e,t){var l=s.call(this,e,t)||this;l.validate=function(e){var t=l.props.when,i=l.context,n=i.form,r=i.fieldFeedbacks,a=n.fieldsStore.getField(e.name),o=p({},l.state.validation);if("first"===r.props.stop&&a.hasFeedbacks(r.key)||"first-error"===r.props.stop&&a.hasErrors(r.key)||"first-warning"===r.props.stop&&a.hasWarnings(r.key)||"first-info"===r.props.stop&&a.hasInfos(r.key))o.show=void 0;else if(o.show=!1,"function"==typeof t)o.show=t(e.value);else{if("string"!=typeof t)throw new TypeError("Invalid FieldFeedback 'when' type: "+typeof t);if("valid"===t)o.show=void 0;else{var s=e.validity;s.valid||("*"===t?o.show=!0:(s.badInput&&"badInput"===t||s.patternMismatch&&"patternMismatch"===t||s.rangeOverflow&&"rangeOverflow"===t||s.rangeUnderflow&&"rangeUnderflow"===t||s.stepMismatch&&"stepMismatch"===t||s.tooLong&&"tooLong"===t||s.tooShort&&"tooShort"===t||s.typeMismatch&&"typeMismatch"===t||s.valueMissing&&"valueMissing"===t)&&(o.show=!0))}}return a.addOrReplaceValidation(o),l.setState({validation:o,validationMessage:e.validationMessage}),o},l.fieldDidReset=function(e){e.name===l.context.fieldFeedbacks.fieldName&&l.setState(function(e){return{validation:p({},e.validation,{show:void 0}),validationMessage:""}})},l.key=t.fieldFeedbacks.addFieldFeedback();var i=e.error,n=e.warning,r=e.info,a=e.when,o=x.Error;if("valid"===a?o=x.WhenValid:n?o=x.Warning:r&&(o=x.Info),o===x.WhenValid&&(i||n||r))throw new Error('Cannot have an attribute (error, warning...) with FieldFeedback when="valid"');return l.state={validation:{key:l.key,type:o,show:void 0},validationMessage:""},l}return r(e,s),e.prototype.componentWillMount=function(){var e=this.context,t=e.form,i=e.fieldFeedbacks,n=e.async;n?n.addValidateFieldEventListener(this.validate):i.addValidateFieldEventListener(this.validate),t.addFieldDidResetEventListener(this.fieldDidReset)},e.prototype.componentWillUnmount=function(){var e=this.context,t=e.form,i=e.fieldFeedbacks,n=e.async;n?n.removeValidateFieldEventListener(this.validate):i.removeValidateFieldEventListener(this.validate),t.removeFieldDidResetEventListener(this.fieldDidReset)},e.prototype.render=function(){var e=this.props,t=(e.when,e.error,e.warning,e.info,e.className),i=e.classes,n=e.style,r=e.children,a=h(e,["when","error","warning","info","className","classes","style","children"]),o=this.state,s=o.validation,l=o.validationMessage,d=i[s.type],u=void 0!==t?t+" "+d:d;if(s.type===x.WhenValid)return f.createElement(_,p({"data-feedback":this.key,style:n,className:u},a),r);if(s.show){var c=void 0!==r?r:l;return f.createElement("span",p({"data-feedback":this.key,className:u,style:p({display:"block"},n)},a),c)}return null},e.defaultProps={when:function(){return!0},classes:{error:"error",warning:"warning",info:"info",whenValid:"when-valid"}},e.contextTypes={form:i.instanceOf(O).isRequired,fieldFeedbacks:i.instanceOf(I).isRequired,async:i.instanceOf(M)},e}(f.Component),C=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={field:void 0},t.fieldWillValidate=function(e){e===t.props.name&&t.setState({field:"pending"})},t.fieldDidValidate=function(e){e.name===t.props.name&&t.setState({field:e})},t.fieldDidReset=function(e){e.name===t.props.name&&t.setState({field:void 0})},t}return r(t,e),t.prototype.componentWillMount=function(){this.context.form.addFieldWillValidateEventListener(this.fieldWillValidate),this.context.form.addFieldDidValidateEventListener(this.fieldDidValidate),this.context.form.addFieldDidResetEventListener(this.fieldDidReset)},t.prototype.componentWillUnmount=function(){this.context.form.removeFieldWillValidateEventListener(this.fieldWillValidate),this.context.form.removeFieldDidValidateEventListener(this.fieldDidValidate),this.context.form.removeFieldDidResetEventListener(this.fieldDidReset)},t.prototype.fieldValidationStates=function(){var e=this.state.field,t=[];return void 0!==e&&("pending"===e?t.push("isPending"):(e.hasErrors()&&t.push("hasErrors"),e.hasWarnings()&&t.push("hasWarnings"),e.hasInfos()&&t.push("hasInfos"),e.isValid()&&t.push("isValid"))),t},t.prototype.render=function(){var e=this.props,t=e.innerRef,i=e.className,n=e.classes,r=h(e,["innerRef","className","classes"]),a=this.fieldValidationStates(),o=i;return a.forEach(function(e){var t=n[e];void 0!==t&&(void 0!==o?o+=" "+t:o=t)}),f.createElement("input",p({ref:t},r,{className:o}))},t.contextTypes={form:i.instanceOf(O).isRequired},t.defaultProps={classes:{isPending:"is-pending",hasErrors:"has-errors",hasWarnings:"has-warnings",hasInfos:"has-infos",isValid:"is-valid"}},t}(f.Component),T=function(e,i){f.Children.forEach(e,function(e){var t=e;t.props&&t.props.children&&"object"==typeof t.props.children&&T(t.props.children,i),i(t)})};s.FieldFeedbackType=x,s.Field=L,s.EventEmitter=o,s.deepForEach=T,s.FormWithConstraints=O,s.FieldFeedbacks=I,s.FieldFeedback=N,s.FieldFeedbackWhenValid=_,s.Async=M,s.FieldsStore=S,s.ValidateFieldEvent=d,s.withValidateFieldEventEmitter=u,s.FieldWillValidateEvent=c,s.withFieldWillValidateEventEmitter=F,s.FieldDidValidateEvent=E,s.withFieldDidValidateEventEmitter=b,s.FieldDidResetEvent=w,s.withFieldDidResetEventEmitter=g,s.InputElement=V,s.IValidityState=k,s.Input=C,Object.defineProperty(s,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","react","prop-types"],t):t((e=e||self).ReactFormWithConstraints={},e.React,e.PropTypes)}(this,function(s,f,i){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function r(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var p=function(){return(p=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function h(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&(i[n[r]]=e[n[r]])}return i}function l(a,o,s,l){return new(s||(s=Promise))(function(e,t){function i(e){try{r(l.next(e))}catch(e){t(e)}}function n(e){try{r(l.throw(e))}catch(e){t(e)}}function r(t){t.done?e(t.value):new s(function(e){e(t.value)}).then(i,n)}r((l=l.apply(a,o||[])).next())})}function v(i,n){var r,a,o,e,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,a&&(o=2&t[0]?a.return:t[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,t[1])).done)return o;switch(a=0,o&&(t=[2&t[0],o.value]),t[0]){case 0:case 1:o=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,a=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(o=0<(o=s.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3])){s.label=t[1];break}if(6===t[0]&&s.label<o[1]){s.label=o[1],o=t;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(t);break}o[2]&&s.ops.pop(),s.trys.pop();continue}t=n.call(i,s)}catch(e){t=[6,e],a=0}finally{r=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function y(e){var t="function"==typeof Symbol&&e[Symbol.iterator],i=0;return t?t.call(e):{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function a(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,a=i.call(e),o=[];try{for(;(void 0===t||0<t--)&&!(n=a.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e}var o=function(){function e(){this.listeners=new Map}return e.prototype.emit=function(c){for(var f=[],e=1;e<arguments.length;e++)f[e-1]=arguments[e];return l(this,void 0,void 0,function(){var t,i,n,r,a,o,s,l,d,u;return v(this,function(e){switch(e.label){case 0:if(n=this.listeners.get(c),r=new Array,void 0===n)return[3,8];e.label=1;case 1:e.trys.push([1,6,7,8]),a=y(n),o=a.next(),e.label=2;case 2:return o.done?[3,5]:(s=o.value,d=(l=r).push,[4,s.apply(void 0,m(f))]);case 3:d.apply(l,[e.sent()]),e.label=4;case 4:return o=a.next(),[3,2];case 5:return[3,8];case 6:return u=e.sent(),t={error:u},[3,8];case 7:try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}return[7];case 8:return[2,r]}})})},e.prototype.addListener=function(e,t){this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t)},e.prototype.removeListener=function(e,t){var i=this.listeners.get(e),n=i.lastIndexOf(t);i.splice(n,1),0===i.length&&this.listeners.delete(e)},e}(),d="VALIDATE_FIELD_EVENT";function e(e){return function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.validateFieldEventEmitter=new o,e}return r(e,t),e.prototype.emitValidateFieldEvent=function(e){return this.validateFieldEventEmitter.emit(d,e)},e.prototype.addValidateFieldEventListener=function(e){this.validateFieldEventEmitter.addListener(d,e)},e.prototype.removeValidateFieldEventListener=function(e){this.validateFieldEventEmitter.removeListener(d,e)},e}(e)}var u="FIELD_WILL_VALIDATE_EVENT";function t(e){return function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.fieldWillValidateEventEmitter=new o,e}return r(e,t),e.prototype.emitFieldWillValidateEvent=function(e){return this.fieldWillValidateEventEmitter.emit(u,e)},e.prototype.addFieldWillValidateEventListener=function(e){this.fieldWillValidateEventEmitter.addListener(u,e)},e.prototype.removeFieldWillValidateEventListener=function(e){this.fieldWillValidateEventEmitter.removeListener(u,e)},e}(e)}var c="FIELD_DID_VALIDATE_EVENT";function F(e){return function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.fieldDidValidateEventEmitter=new o,e}return r(e,t),e.prototype.emitFieldDidValidateEvent=function(e){return this.fieldDidValidateEventEmitter.emit(c,e)},e.prototype.addFieldDidValidateEventListener=function(e){this.fieldDidValidateEventEmitter.addListener(c,e)},e.prototype.removeFieldDidValidateEventListener=function(e){this.fieldDidValidateEventEmitter.removeListener(c,e)},e}(e)}var E="FIELD_DID_RESET_EVENT";function b(e){return function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.fieldDidResetEventEmitter=new o,e}return r(e,t),e.prototype.emitFieldDidResetEvent=function(e){return this.fieldDidResetEventEmitter.emit(E,e)},e.prototype.addFieldDidResetEventListener=function(e){this.fieldDidResetEventEmitter.addListener(E,e)},e.prototype.removeFieldDidResetEventListener=function(e){this.fieldDidResetEventEmitter.removeListener(E,e)},e}(e)}var w,g,V=function(e){void 0===e.props?(e=e,this.name=e.name,this.type=e.type,this.value=e.value,this.validity=new k(e.validity),this.validationMessage=e.validationMessage):(e=e,this.name=e.props.name,this.type=void 0,this.value=e.props.value,this.validity=void 0,this.validationMessage=void 0)},k=function(e){this.badInput=e.badInput,this.customError=e.customError,this.patternMismatch=e.patternMismatch,this.rangeOverflow=e.rangeOverflow,this.rangeUnderflow=e.rangeUnderflow,this.stepMismatch=e.stepMismatch,this.tooLong=e.tooLong,this.tooShort=e.tooShort,this.typeMismatch=e.typeMismatch,this.valid=e.valid,this.valueMissing=e.valueMissing};(g=w||(w={})).Error="error",g.Warning="warning",g.Info="info",g.WhenValid="whenValid";var D=w;var x,L=function(){function e(e){this.name=e,this.validations=[]}return e.prototype.addOrReplaceValidation=function(t){var e=this.validations.findIndex(function(e){return e.key===t.key});-1<e?this.validations[e]=t:this.validations.push(t)},e.prototype.clearValidations=function(){!function(e){for(;e.length;)e.pop()}(this.validations)},e.prototype.hasFeedbacksOfType=function(t,i){return this.validations.some(function(e){return(void 0===i||e.key.startsWith(i+"."))&&e.type===t&&!0===e.show})},e.prototype.hasErrors=function(e){return this.hasFeedbacksOfType(D.Error,e)},e.prototype.hasWarnings=function(e){return this.hasFeedbacksOfType(D.Warning,e)},e.prototype.hasInfos=function(e){return this.hasFeedbacksOfType(D.Info,e)},e.prototype.hasFeedbacks=function(e){return this.hasErrors(e)||this.hasWarnings(e)||this.hasInfos(e)},e.prototype.isValid=function(){return!this.hasErrors()},e}();(x=s.FieldEvent||(s.FieldEvent={})).Added="FIELD_ADDED",x.Removed="FIELD_REMOVED";var R=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.fields=new Array,e}return r(e,t),e.prototype.getField=function(t){var e=this.fields.filter(function(e){return e.name===t});return 1===e.length?e[0]:void 0},e.prototype.addField=function(t){if(0===this.fields.filter(function(e){return e.name===t}).length){var e=new L(t);this.fields.push(e),this.emit(s.FieldEvent.Added,e)}},e.prototype.removeField=function(t){var e=this.fields.filter(function(e){return e.name===t}),i=this.fields.indexOf(e[0]);-1<i&&(this.fields.splice(i,1),this.emit(s.FieldEvent.Removed,t))},e.prototype.isValid=function(){return this.fields.every(function(e){return e.isValid()})},e.prototype.hasFeedbacks=function(){return this.fields.some(function(e){return e.hasFeedbacks()})},e}(o);var S,W=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.form=null,e.fieldsStore=new R,e.fieldFeedbacksKeyCounter=0,e}return r(e,t),e.prototype.getChildContext=function(){return{form:this}},e.prototype.computeFieldFeedbacksKey=function(){return""+this.fieldFeedbacksKeyCounter++},e.prototype.validateFields=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._validateFields.apply(this,m([!0],e))},e.prototype.validateForm=function(){return this.validateFieldsWithoutFeedback()},e.prototype.validateFieldsWithoutFeedback=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._validateFields.apply(this,m([!1],e))},e.prototype._validateFields=function(u){for(var c=[],e=1;e<arguments.length;e++)c[e-1]=arguments[e];return l(this,void 0,void 0,function(){var t,i,n,r,a,o,s,l,d;return v(this,function(e){switch(e.label){case 0:n=new Array,r=this.normalizeInputs.apply(this,m(c)),e.label=1;case 1:e.trys.push([1,6,7,8]),a=y(r),o=a.next(),e.label=2;case 2:return o.done?[3,5]:(s=o.value,[4,this.validateField(u,new V(s))]);case 3:void 0!==(l=e.sent())&&n.push(l),e.label=4;case 4:return o=a.next(),[3,2];case 5:return[3,8];case 6:return d=e.sent(),t={error:d},[3,8];case 7:try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}return[7];case 8:return[2,n]}})})},e.prototype.validateField=function(n,r){return l(this,void 0,void 0,function(){var t,i;return v(this,function(e){switch(e.label){case 0:return t=r.name,void 0!==(i=this.fieldsStore.getField(t))?[3,1]:[3,3];case 1:return!n&&i.hasFeedbacks()?[3,3]:(i.clearValidations(),this.emitFieldWillValidateEvent(t),[4,this.emitValidateFieldEvent(r)]);case 2:e.sent(),this.emitFieldDidValidateEvent(i),e.label=3;case 3:return[2,i]}})})},e.prototype.normalizeInputs=function(){for(var e,r=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return 0===t.length?(e=(e=m(this.form.querySelectorAll("[name]"))).filter(function(e){return void 0!==e.validity})).filter(function(e){return"checkbox"!==e.type&&"radio"!==e.type}).map(function(e){return e.name}).forEach(function(e,t,i){if(i.indexOf(e)!==t)throw new Error("Multiple elements matching '[name=\""+e+"\"]' inside the form")}):e=t.map(function(e){if("string"!=typeof e)return e;var t='[name="'+e+'"]',i=m(r.form.querySelectorAll(t));if(0<i.filter(function(e){return void 0===e.validity}).length)throw new Error("'"+t+"' should match an <input>, <select> or <textarea>");if(1<i.filter(function(e){return"checkbox"!==e.type&&"radio"!==e.type}).length)throw new Error("Multiple elements matching '"+t+"' inside the form");var n=i[0];if(void 0===n)throw new Error("Could not find field '"+t+"' inside the form");return n}),e},e.prototype.isValid=function(){return this.fieldsStore.isValid()},e.prototype.hasFeedbacks=function(){return this.fieldsStore.hasFeedbacks()},e.prototype.reset=function(){return this.resetFields()},e.prototype.resetFields=function(){for(var u=[],e=0;e<arguments.length;e++)u[e]=arguments[e];return l(this,void 0,void 0,function(){var t,i,n,r,a,o,s,l,d;return v(this,function(e){switch(e.label){case 0:n=new Array,r=this.normalizeInputs.apply(this,m(u)),e.label=1;case 1:e.trys.push([1,6,7,8]),a=y(r),o=a.next(),e.label=2;case 2:return o.done?[3,5]:(s=o.value,[4,this.resetField(new V(s))]);case 3:void 0!==(l=e.sent())&&n.push(l),e.label=4;case 4:return o=a.next(),[3,2];case 5:return[3,8];case 6:return d=e.sent(),t={error:d},[3,8];case 7:try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}return[7];case 8:return[2,n]}})})},e.prototype.resetField=function(n){return l(this,void 0,void 0,function(){var t,i;return v(this,function(e){switch(e.label){case 0:return t=n.name,void 0!==(i=this.fieldsStore.getField(t))?[3,1]:[3,3];case 1:return i.clearValidations(),[4,this.emitFieldDidResetEvent(i)];case 2:e.sent(),e.label=3;case 3:return[2,i]}})})},e.prototype.render=function(){var t=this;return f.createElement("form",p({ref:function(e){return t.form=e}},this.props))},e.childContextTypes={form:i.instanceOf(e).isRequired},e}(b(t(F(e(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(f.Component)))))),O=function(a){function e(e,t){var i=a.call(this,e,t)||this;i.fieldFeedbackKeyCounter=0,i.validate=function(o){return l(i,void 0,void 0,function(){var t,i,n,r,a;return v(this,function(e){switch(e.label){case 0:return t=this.context,i=t.form,n=t.fieldFeedbacks,o.name!==this.fieldName?[3,3]:(a=i.fieldsStore.getField(this.fieldName),n&&("first"===n.props.stop&&a.hasFeedbacks(n.key)||"first-error"===n.props.stop&&a.hasErrors(n.key)||"first-warning"===n.props.stop&&a.hasWarnings(n.key)||"first-info"===n.props.stop&&a.hasInfos(n.key))?[3,3]:[3,1]);case 1:return[4,this._validate(o)];case 2:r=e.sent(),e.label=3;case 3:return[2,r]}})})};var n=t.form,r=t.fieldFeedbacks;if(i.key=r?r.computeFieldFeedbackKey():n.computeFieldFeedbacksKey(),r){if(i.fieldName=r.fieldName,void 0!==e.for)throw new Error("FieldFeedbacks cannot have a parent and a 'for' prop")}else{if(void 0===e.for)throw new Error("FieldFeedbacks cannot be without parent and without 'for' prop");i.fieldName=e.for}return i}return r(e,a),e.prototype.getChildContext=function(){return{fieldFeedbacks:this}},e.prototype.computeFieldFeedbackKey=function(){return this.key+"."+this.fieldFeedbackKeyCounter++},e.prototype.addFieldFeedback=function(){return this.computeFieldFeedbackKey()},e.prototype.componentWillMount=function(){var e=this.context,t=e.form,i=e.fieldFeedbacks;t.fieldsStore.addField(this.fieldName),(i||t).addValidateFieldEventListener(this.validate)},e.prototype.componentWillUnmount=function(){var e=this.context,t=e.form,i=e.fieldFeedbacks;t.fieldsStore.removeField(this.fieldName),(i||t).removeValidateFieldEventListener(this.validate)},e.prototype._validate=function(i){return l(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:return[4,this.emitValidateFieldEvent(i)];case 1:return t=e.sent(),[2,function i(e){return e.reduce(function(e,t){return e.concat(Array.isArray(t)?i(t):t)},[])}(t)]}})})},e.prototype.render=function(){var e=this.props.children;return void 0!==e?e:null},e.defaultProps={stop:"first-error"},e.contextTypes={form:i.instanceOf(W).isRequired,fieldFeedbacks:i.instanceOf(e)},e.childContextTypes={fieldFeedbacks:i.instanceOf(e).isRequired},e}(e(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(f.Component)));(S=s.Status||(s.Status={}))[S.None=0]="None",S[S.Pending=1]="Pending",S[S.Rejected=2]="Rejected",S[S.Resolved=3]="Resolved";var I=function(e){function t(){var o=null!==e&&e.apply(this,arguments)||this;return o.state={status:s.Status.None},o.validate=function(e){var t,i=o.context,n=i.form,r=i.fieldFeedbacks,a=n.fieldsStore.getField(e.name);return"first"===r.props.stop&&a.hasFeedbacks(r.key)||"first-error"===r.props.stop&&a.hasErrors(r.key)||"first-warning"===r.props.stop&&a.hasWarnings(r.key)||"first-info"===r.props.stop&&a.hasInfos(r.key)?o.setState({status:s.Status.None}):t=o._validate(e),t},o}return r(t,e),t.prototype.getChildContext=function(){return{async:this}},t.prototype.componentWillMount=function(){this.context.fieldFeedbacks.addValidateFieldEventListener(this.validate)},t.prototype.componentWillUnmount=function(){this.context.fieldFeedbacks.removeValidateFieldEventListener(this.validate)},t.prototype._validate=function(n){return l(this,void 0,void 0,function(){var t,i;return v(this,function(e){switch(e.label){case 0:this.setState({status:s.Status.Pending}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.props.promise(n.value)];case 2:return t=e.sent(),this.setState({status:s.Status.Resolved,value:t}),[3,4];case 3:return i=e.sent(),this.setState({status:s.Status.Rejected,value:i}),[3,4];case 4:return[2,this.emitValidateFieldEvent(n)]}})})},t.prototype.render=function(){var e=this.props,t=this.state,i=null;switch(t.status){case s.Status.None:break;case s.Status.Pending:e.pending&&(i=e.pending);break;case s.Status.Resolved:e.then&&(i=e.then(t.value));break;case s.Status.Rejected:e.catch&&(i=e.catch(t.value))}return i},t.contextTypes={form:i.instanceOf(W).isRequired,fieldFeedbacks:i.instanceOf(O).isRequired},t.childContextTypes={async:i.instanceOf(t).isRequired},t}(e(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(f.Component))),M=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={fieldIsValid:void 0},t.fieldWillValidate=function(e){e===t.context.fieldFeedbacks.fieldName&&t.setState({fieldIsValid:void 0})},t.fieldDidValidate=function(e){e.name===t.context.fieldFeedbacks.fieldName&&t.setState({fieldIsValid:e.isValid()})},t.fieldDidReset=function(e){e.name===t.context.fieldFeedbacks.fieldName&&t.setState({fieldIsValid:void 0})},t}return r(t,e),t.prototype.componentWillMount=function(){var e=this.context.form;e.addFieldWillValidateEventListener(this.fieldWillValidate),e.addFieldDidValidateEventListener(this.fieldDidValidate),e.addFieldDidResetEventListener(this.fieldDidReset)},t.prototype.componentWillUnmount=function(){var e=this.context.form;e.removeFieldWillValidateEventListener(this.fieldWillValidate),e.removeFieldDidValidateEventListener(this.fieldDidValidate),e.removeFieldDidResetEventListener(this.fieldDidReset)},t.prototype.render=function(){var e=this.props,t=e.style,i=h(e,["style"]);return this.state.fieldIsValid?f.createElement("span",p({},i,{style:p({display:"block"},t)})):null},t.contextTypes={form:i.instanceOf(W).isRequired,fieldFeedbacks:i.instanceOf(O).isRequired},t}(f.Component),_=function(s){function e(e,t){var l=s.call(this,e,t)||this;l.validate=function(e){var t=l.props.when,i=l.context,n=i.form,r=i.fieldFeedbacks,a=n.fieldsStore.getField(e.name),o=p({},l.state.validation);if("first"===r.props.stop&&a.hasFeedbacks(r.key)||"first-error"===r.props.stop&&a.hasErrors(r.key)||"first-warning"===r.props.stop&&a.hasWarnings(r.key)||"first-info"===r.props.stop&&a.hasInfos(r.key))o.show=void 0;else if(o.show=!1,"function"==typeof t)o.show=t(e.value);else{if("string"!=typeof t)throw new TypeError("Invalid FieldFeedback 'when' type: "+typeof t);if("valid"===t)o.show=void 0;else{var s=e.validity;s.valid||("*"===t?o.show=!0:(s.badInput&&"badInput"===t||s.patternMismatch&&"patternMismatch"===t||s.rangeOverflow&&"rangeOverflow"===t||s.rangeUnderflow&&"rangeUnderflow"===t||s.stepMismatch&&"stepMismatch"===t||s.tooLong&&"tooLong"===t||s.tooShort&&"tooShort"===t||s.typeMismatch&&"typeMismatch"===t||s.valueMissing&&"valueMissing"===t)&&(o.show=!0))}}return a.addOrReplaceValidation(o),l.setState({validation:o,validationMessage:e.validationMessage}),o},l.fieldDidReset=function(e){e.name===l.context.fieldFeedbacks.fieldName&&l.setState(function(e){return{validation:p({},e.validation,{show:void 0}),validationMessage:""}})},l.key=t.fieldFeedbacks.addFieldFeedback();var i=e.error,n=e.warning,r=e.info,a=e.when,o=D.Error;if("valid"===a?o=D.WhenValid:n?o=D.Warning:r&&(o=D.Info),o===D.WhenValid&&(i||n||r))throw new Error('Cannot have an attribute (error, warning...) with FieldFeedback when="valid"');return l.state={validation:{key:l.key,type:o,show:void 0},validationMessage:""},l}return r(e,s),e.prototype.componentWillMount=function(){var e=this.context,t=e.form,i=e.fieldFeedbacks,n=e.async;n?n.addValidateFieldEventListener(this.validate):i.addValidateFieldEventListener(this.validate),t.addFieldDidResetEventListener(this.fieldDidReset)},e.prototype.componentWillUnmount=function(){var e=this.context,t=e.form,i=e.fieldFeedbacks,n=e.async;n?n.removeValidateFieldEventListener(this.validate):i.removeValidateFieldEventListener(this.validate),t.removeFieldDidResetEventListener(this.fieldDidReset)},e.prototype.render=function(){var e=this.props,t=(e.when,e.error,e.warning,e.info,e.className),i=e.classes,n=e.style,r=e.children,a=h(e,["when","error","warning","info","className","classes","style","children"]),o=this.state,s=o.validation,l=o.validationMessage,d=i[s.type],u=void 0!==t?t+" "+d:d;if(s.type===D.WhenValid)return f.createElement(M,p({"data-feedback":this.key,style:n,className:u},a),r);if(s.show){var c=void 0!==r?r:l;return f.createElement("span",p({"data-feedback":this.key,className:u,style:p({display:"block"},n)},a),c)}return null},e.defaultProps={when:function(){return!0},classes:{error:"error",warning:"warning",info:"info",whenValid:"when-valid"}},e.contextTypes={form:i.instanceOf(W).isRequired,fieldFeedbacks:i.instanceOf(O).isRequired,async:i.instanceOf(I)},e}(f.Component),N=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={field:void 0},t.fieldWillValidate=function(e){e===t.props.name&&t.setState({field:"pending"})},t.fieldDidValidate=function(e){e.name===t.props.name&&t.setState({field:e})},t.fieldDidReset=function(e){e.name===t.props.name&&t.setState({field:void 0})},t}return r(t,e),t.prototype.componentWillMount=function(){this.context.form.addFieldWillValidateEventListener(this.fieldWillValidate),this.context.form.addFieldDidValidateEventListener(this.fieldDidValidate),this.context.form.addFieldDidResetEventListener(this.fieldDidReset)},t.prototype.componentWillUnmount=function(){this.context.form.removeFieldWillValidateEventListener(this.fieldWillValidate),this.context.form.removeFieldDidValidateEventListener(this.fieldDidValidate),this.context.form.removeFieldDidResetEventListener(this.fieldDidReset)},t.prototype.fieldValidationStates=function(){var e=this.state.field,t=[];return void 0!==e&&("pending"===e?t.push("isPending"):(e.hasErrors()&&t.push("hasErrors"),e.hasWarnings()&&t.push("hasWarnings"),e.hasInfos()&&t.push("hasInfos"),e.isValid()&&t.push("isValid"))),t},t.prototype.render=function(){var e=this.props,t=e.innerRef,i=e.className,n=e.classes,r=h(e,["innerRef","className","classes"]),a=this.fieldValidationStates(),o=i;return a.forEach(function(e){var t=n[e];void 0!==t&&(void 0!==o?o+=" "+t:o=t)}),f.createElement("input",p({ref:t},r,{className:o}))},t.contextTypes={form:i.instanceOf(W).isRequired},t.defaultProps={classes:{isPending:"is-pending",hasErrors:"has-errors",hasWarnings:"has-warnings",hasInfos:"has-infos",isValid:"is-valid"}},t}(f.Component);s.Async=I,s.EventEmitter=o,s.Field=L,s.FieldDidResetEvent=E,s.FieldDidValidateEvent=c,s.FieldFeedback=_,s.FieldFeedbackType=D,s.FieldFeedbackWhenValid=M,s.FieldFeedbacks=O,s.FieldWillValidateEvent=u,s.FieldsStore=R,s.FormWithConstraints=W,s.IValidityState=k,s.Input=N,s.InputElement=V,s.ValidateFieldEvent=d,s.deepForEach=function i(e,n){f.Children.forEach(e,function(e){var t=e;t.props&&t.props.children&&"object"==typeof t.props.children&&i(t.props.children,n),n(t)})},s.withFieldDidResetEventEmitter=b,s.withFieldDidValidateEventEmitter=F,s.withFieldWillValidateEventEmitter=t,s.withValidateFieldEventEmitter=e,Object.defineProperty(s,"__esModule",{value:!0})});
//# sourceMappingURL=react-form-with-constraints.production.min.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var clearArray = function (array) {
function clearArray(array) {
while (array.length) {
array.pop();
}
};
}
exports.default = clearArray;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xlYXJBcnJheS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2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D4oYXJyYXk6IFRbXSkge1xuICB3aGlsZSAoYXJyYXkubGVuZ3RoKSB7XG4gICAgYXJyYXkucG9wKCk7XG4gIH1cbn1cbiJdfQ==
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var deepForEach = function (children, fn) {
function deepForEach(children, fn) {
React.Children.forEach(children, function (child) {

@@ -12,4 +12,4 @@ var element = child;

});
};
}
exports.default = deepForEach;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVlcEZvckVhY2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZGVlcEZvckVhY2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw2QkFBK0I7QUFJL0IsSUFBTSxXQUFXLEdBQUcsVUFBQyxRQUF5QixFQUFFLEVBQTRDO0lBQzFGLEtBQUssQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLFFBQVEsRUFBRSxVQUFBLEtBQUs7UUFDcEMsSUFBTSxPQUFPLEdBQUcsS0FBZ0MsQ0FBQztRQUNqRCxJQUFJLE9BQU8sQ0FBQyxLQUFLLElBQUksT0FBTyxDQUFDLEtBQUssQ0FBQyxRQUFRLElBQUksT0FBTyxPQUFPLENBQUMsS0FBSyxDQUFDLFFBQVEsS0FBSyxRQUFRLEVBQUU7WUFDekYsV0FBVyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsUUFBUSxFQUFFLEVBQUUsQ0FBQyxDQUFDO1NBQ3pDO1FBQ0QsRUFBRSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ2QsQ0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDLENBQUM7QUFFRixrQkFBZSxXQUFXLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBSZWFjdCBmcm9tICdyZWFjdCc7XG5cbi8vIFJlY3Vyc2l2ZSBSZWFjdC5DaGlsZHJlbi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iJdfQ==
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var flattenDeep = function (arrayOfArrays) {
function flattenDeep(arrayOfArrays) {
return arrayOfArrays
.reduce(function (prev, curr) { return prev.concat(Array.isArray(curr) ? flattenDeep(curr) : curr); }, []);
};
}
exports.default = flattenDeep;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmxhdHRlbkRlZXAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZmxhdHRlbkRlZXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFPQSxJQUFNLFdBQVcsR0FBRyxVQUFJLGFBQWdDO0lBQ3RELE9BQU8sYUFBYTtTQUNqQixNQUFNLENBQ0wsVUFBQyxJQUFJLEVBQUUsSUFBSSxJQUFLLE9BQUEsSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxFQUEzRCxDQUEyRCxFQUMzRSxFQUFFLENBQ0gsQ0FBQztBQUNOLENBQUMsQ0FBQztBQUVGLGtCQUFlLFdBQVcsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8vIEZsYXR0ZW4gbmVzdGVkIGFycmF5cyB1c2luZyByZWN1cnNpb24gaW4gSmF2YVNjcmlwdCBodHRwczovL3N0YWNrb3ZlcmZsb3cuY29tL3EvMzA1ODIzNTJcbi8vIFNlZSBNZXJnZS9mbGF0dGVuIGFuIGFycmF5IG9mIGFycmF5cyBpbiBKYXZhU2NyaXB0PyBodHRwczovL3N0YWNrb3ZlcmZsb3cuY29tL3EvMTA4NjUwMjVcbi8vIFNlZSBMb2Rhc2ggXy5mbGF0dGVuRGVlcChhcnJheSkgaHR0cHM6Ly9sb2Rhc2guY29tL2RvY3MvNC4xN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ENBQTJELEVBQzNFLEVBQUUsQ0FDSCxDQUFDO0FBQ04sQ0FBQztBQU5ELDhCQU1DIiwic291cmNlc0NvbnRlbnQiOlsiLy8gRmxhdHRlbiBuZXN0ZWQgYXJyYXlzIHVzaW5nIHJlY3Vyc2lvbiBpbiBKYXZhU2NyaXB0IGh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vcS8zMDU4MjM1MlxuLy8gU2VlIE1lcmdlL2ZsYXR0ZW4gYW4gYXJyYXkgb2YgYXJyYXlzIGluIEphdmFTY3JpcHQ/IGh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vcS8xMDg2NTAyNVxuLy8gU2VlIExvZGFzaCBfLmZsYXR0ZW5EZWVwKGFycmF5KSBodHRwczovL2xvZGFzaC5jb20vZG9jcy80LjE3LjUjZmxhdHRlbkRlZXBcbi8vIFNlZSBBcnJheS5wcm90b3R5cGUuZmxhdHRlbigpIGh0dHBzOi8vZGV2ZWxvcGVyLm1vemlsbGEub3JnL2VuLVVTL2RvY3MvV2ViL0phdmFTY3JpcHQvUmVmZXJlbmNlL0dsb2JhbF9PYmplY3RzL0FycmF5L2ZsYXR0ZW5cblxuaW50ZXJmYWNlIFJlY3Vyc2l2ZUFycmF5PFQ+IGV4dGVuZHMgQXJyYXk8VCB8IFJlY3Vyc2l2ZUFycmF5PFQ+PiB7fVxuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBmbGF0dGVuRGVlcDxUPihhcnJheU9mQXJyYXlzOiBSZWN1cnNpdmVBcnJheTxUPik6IFRbXSB7XG4gIHJldHVybiBhcnJheU9mQXJyYXlzXG4gICAgLnJlZHVjZTxUW10+KFxuICAgICAgKHByZXYsIGN1cnIpID0+IHByZXYuY29uY2F0KEFycmF5LmlzQXJyYXkoY3VycikgPyBmbGF0dGVuRGVlcChjdXJyKSA6IGN1cnIpLFxuICAgICAgW11cbiAgICApO1xufVxuIl19
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var notUndefined = function (value) { return value !== undefined; };
function notUndefined(value) {
return value !== undefined;
}
exports.default = notUndefined;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90VW5kZWZpbmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL25vdFVuZGVmaW5lZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLElBQU0sWUFBWSxHQUFHLFVBQUksS0FBb0IsSUFBaUIsT0FBQSxLQUFLLEtBQUssU0FBUyxFQUFuQixDQUFtQixDQUFDO0FBRWxGLGtCQUFlLFlBQVksQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFNlZSBcIlR5cGVTY3JpcHQgc3RhdGljIGFuYWx5c2lzIGlzIHVuYWJsZSB0byB0cmFjayB0aGlzIGJlaGF2aW9yXCIgaHR0cHM6Ly9jb2RlcmV2aWV3LnN0YWNrZXhjaGFuZ2UuY29tL2EvMTM4Mjg5LzE0ODg0N1xuLy8gU2VlIFR5cGVTY3JpcHQgZmlsdGVyIG91dCBudWxscyBmcm9tIGFuIGFycmF5IGh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vcS80MzExODY5MlxuY29uc3Qgbm90VW5kZWZpbmVkID0gPFQ+KHZhbHVlOiBUIHwgdW5kZWZpbmVkKTogdmFsdWUgaXMgVCA9PiB2YWx1ZSAhPT0gdW5kZWZpbmVkO1xuXG5leHBvcnQgZGVmYXVsdCBub3RVbmRlZmluZWQ7XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90VW5kZWZpbmVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL25vdFVuZGVmaW5lZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLFNBQXdCLFlBQVksQ0FBSSxLQUFvQjtJQUMxRCxPQUFPLEtBQUssS0FBSyxTQUFTLENBQUM7QUFDN0IsQ0FBQztBQUZELCtCQUVDIiwic291cmNlc0NvbnRlbnQiOlsiLy8gU2VlIFwiVHlwZVNjcmlwdCBzdGF0aWMgYW5hbHlzaXMgaXMgdW5hYmxlIHRvIHRyYWNrIHRoaXMgYmVoYXZpb3JcIiBodHRwczovL2NvZGVyZXZpZXcuc3RhY2tleGNoYW5nZS5jb20vYS8xMzgyODkvMTQ4ODQ3XG4vLyBTZWUgVHlwZVNjcmlwdCBmaWx0ZXIgb3V0IG51bGxzIGZyb20gYW4gYXJyYXkgaHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS9xLzQzMTE4NjkyXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBub3RVbmRlZmluZWQ8VD4odmFsdWU6IFQgfCB1bmRlZmluZWQpOiB2YWx1ZSBpcyBUIHtcbiAgcmV0dXJuIHZhbHVlICE9PSB1bmRlZmluZWQ7XG59XG4iXX0=

@@ -18,3 +18,3 @@ "use strict";

exports.FieldDidResetEvent = 'FIELD_DID_RESET_EVENT';
var withFieldDidResetEventEmitter = function (Base) {
function withFieldDidResetEventEmitter(Base) {
return (function (_super) {

@@ -38,4 +38,4 @@ __extends(ResetFieldEvenEmitter, _super);

}(Base));
};
}
exports.withFieldDidResetEventEmitter = withFieldDidResetEventEmitter;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l0aEZpZWxkRGlkUmVzZXRFdmVudEVtaXR0ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvd2l0aEZpZWxkRGlkUmVzZXRFdmVudEVtaXR0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsK0NBQTBDO0FBSTdCLFFBQUEsa0JBQWtCLEdBQUcsdUJBQXVCLENBQUM7QUFHMUQsSUFBTSw2QkFBNkIsR0FBRyxVQUFnQyxJQUFXO0lBRy9F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RFbWl0dGVyLnJlbW92ZUxpc3RlbmVyKEZpZWxkRGlkUmVzZXRFdmVudCwgbGlzdGVuZXIpO1xuICAgIH1cbiAgfTtcbn1cbiJdfQ==

@@ -18,3 +18,3 @@ "use strict";

exports.FieldDidValidateEvent = 'FIELD_DID_VALIDATE_EVENT';
var withFieldDidValidateEventEmitter = function (Base) {
function withFieldDidValidateEventEmitter(Base) {
return (function (_super) {

@@ -38,4 +38,4 @@ __extends(FieldDidValidateEventEmitter, _super);

}(Base));
};
}
exports.withFieldDidValidateEventEmitter = withFieldDidValidateEventEmitter;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l0aEZpZWxkRGlkVmFsaWRhdGVFdmVudEVtaXR0ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvd2l0aEZpZWxkRGlkVmFsaWRhdGVFdmVudEVtaXR0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsK0NBQTBDO0FBSTdCLFFBQUEscUJBQXFCLEdBQUcsMEJBQTBCLENBQUM7QUFHaEUsSUFBTSxnQ0FBZ0MsR0FBRyxVQUFnQyxJQUFXO0lBR2xGO1FBQWtELGdEQUFJO1FBQS9DO1lBQUEscUVBY047WUFiQyxrQ0FBNEIsR0FBRyxJQUFJLHNCQUFZLEVBQUUsQ0FBQzs7UUFhcEQsQ0FBQztRQVhDLGdFQUF5QixHQUF6QixVQUEwQixLQUFZO1lBQ3BDLE9BQU8sSUFBSSxDQUFDLDRCQUE0QixDQUFDLElBQUksQ0FBQyw2QkFBcUIsRUFBRSxLQUFLLENBQUMsQ0FBQztRQUM5RSxDQUFDO1FBRUQsdUVBQWdDLEdBQWhDLFVBQWlDLFFBQWtCO1lBQ2pELElBQUksQ0FBQyw0QkFBNEIsQ0FBQyxXQUFXLENBQUMsNkJBQXFCLEVBQUUsUUFBUSxDQUFDLENB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mdW5jdGlvbiB3aXRoRmllbGREaWRWYWxpZGF0ZUV2ZW50RW1pdHRlcjxUQmFzZSBleHRlbmRzIENvbnN0cnVjdG9yPHt9Pj4oQmFzZTogVEJhc2UpIHtcbiAgdHlwZSBMaXN0ZW5lciA9IChmaWVsZDogRmllbGQpID0+IHZvaWQ7XG5cbiAgcmV0dXJuIGNsYXNzIEZpZWxkRGlkVmFsaWRhdGVFdmVudEVtaXR0ZXIgZXh0ZW5kcyBCYXNlIHtcbiAgICBmaWVsZERpZFZhbGlkYXRlRXZlbnRFbWl0dGVyID0gbmV3IEV2ZW50RW1pdHRlcigpO1xuXG4gICAgZW1pdEZpZWxkRGlkVmFsaWRhdGVFdmVudChmaWVsZDogRmllbGQpIHtcbiAgICAgIHJldHVybiB0aGlzLmZpZWxkRGlkVmFsaWRhdGVFdmVudEVtaXR0ZXIuZW1pdChGaWVsZERpZFZhbGlkYXRlRXZlbnQsIGZpZWxkKTtcbiAgICB9XG5cbiAgICBhZGRGaWVsZERpZFZhbGlkYXRlRXZlbnRMaXN0ZW5lcihsaXN0ZW5lcjogTGlzdGVuZXIpIHtcbiAgICAgIHRoaXMuZmllbGREaWRWYWxpZGF0ZUV2ZW50RW1pdHRlci5hZGRMaXN0ZW5lcihGaWVsZERpZFZhbGlkYXRlRXZlbnQsIGxpc3RlbmVyKTtcbiAgICB9XG5cbiAgICByZW1vdmVGaWVsZERpZFZhbGlkYXRlRXZlbnRMaXN0ZW5lcihsaXN0ZW5lcjogTGlzdGVuZXIpIHtcbiAgICAgIHRoaXMuZmllbGREaWRWYWxpZGF0ZUV2ZW50RW1pdHRlci5yZW1vdmVMaXN0ZW5lcihGaWVsZERpZFZhbGlkYXRlRXZlbnQsIGxpc3RlbmVyKTtcbiAgICB9XG4gIH07XG59XG4iXX0=

@@ -18,3 +18,3 @@ "use strict";

exports.FieldWillValidateEvent = 'FIELD_WILL_VALIDATE_EVENT';
var withFieldWillValidateEventEmitter = function (Base) {
function withFieldWillValidateEventEmitter(Base) {
return (function (_super) {

@@ -38,4 +38,4 @@ __extends(FieldWillValidateEventEmitter, _super);

}(Base));
};
}
exports.withFieldWillValidateEventEmitter = withFieldWillValidateEventEmitter;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l0aEZpZWxkV2lsbFZhbGlkYXRlRXZlbnRFbWl0dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3dpdGhGaWVsZFdpbGxWYWxpZGF0ZUV2ZW50RW1pdHRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7QUFBQSwrQ0FBMEM7QUFHN0IsUUFBQSxzQkFBc0IsR0FBRywyQkFBMkIsQ0FBQztBQUdsRSxJQUFNLGlDQUFpQyxHQUFHLFVBQWdDLElBQVc7SUFHbkY7UUFBbUQsaURBQUk7UUFBaEQ7WUFBQSxxRUFjTjtZQWJDLG1DQUE2QixHQUFHLElBQUksc0JBQVksRUFBRSxDQUFDOztRQWFyRCxDQUFDO1FBWEMsa0VBQTBCLEdBQTFCLFVBQTJCLFNBQWlCO1lBQzFDLE9BQU8sSUFBSSxDQUFDLDZCQUE2QixDQUFDLElBQUksQ0FBQyw4QkFBc0IsRUFBRSxTQUFTLENBQUMsQ0FBQztRQUNwRixDQUFDO1FBRUQseUVBQWlDLEdBQWpDLFVBQWtDLFFBQWtCO1lBQ2xELElBQUksQ0FBQyw2QkFBNkIsQ0FBQyxXQUFXLENBQUMsOEJBQXNCLEVBQUUsUUFBUSxDQUFDLENBQUM7UUFDbkYsQ0FBQztRQUVELDRFQUFvQyxHQUFwQyxVQUFxQyxRQUFrQjtZQUNyRCxJQUFJLENBQUMsNkJBQTZCLENBQUMsY0FBYyxDQUFDLDhCQUFzQixFQUFFLFFBQVEsQ0FBQyxDQUFDO1FBQ3RGLENBQUM7UUFDSCxvQ0FBQztJQUFELENBQUMsQUFkTSxDQUE0Qy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GVFdmVudEVtaXR0ZXIgZXh0ZW5kcyBCYXNlIHtcbiAgICBmaWVsZFdpbGxWYWxpZGF0ZUV2ZW50RW1pdHRlciA9IG5ldyBFdmVudEVtaXR0ZXIoKTtcblxuICAgIGVtaXRGaWVsZFdpbGxWYWxpZGF0ZUV2ZW50KGZpZWxkTmFtZTogc3RyaW5nKSB7XG4gICAgICByZXR1cm4gdGhpcy5maWVsZFdpbGxWYWxpZGF0ZUV2ZW50RW1pdHRlci5lbWl0KEZpZWxkV2lsbFZhbGlkYXRlRXZlbnQsIGZpZWxkTmFtZSk7XG4gICAgfVxuXG4gICAgYWRkRmllbGRXaWxsVmFsaWRhdGVFdmVudExpc3RlbmVyKGxpc3RlbmVyOiBMaXN0ZW5lcikge1xuICAgICAgdGhpcy5maWVsZFdpbGxWYWxpZGF0ZUV2ZW50RW1pdHRlci5hZGRMaXN0ZW5lcihGaWVsZFdpbGxWYWxpZGF0ZUV2ZW50LCBsaXN0ZW5lcik7XG4gICAgfVxuXG4gICAgcmVtb3ZlRmllbGRXaWxsVmFsaWRhdGVFdmVudExpc3RlbmVyKGxpc3RlbmVyOiBMaXN0ZW5lcikge1xuICAgICAgdGhpcy5maWVsZFdpbGxWYWxpZGF0ZUV2ZW50RW1pdHRlci5yZW1vdmVMaXN0ZW5lcihGaWVsZFdpbGxWYWxpZGF0ZUV2ZW50LCBsaXN0ZW5lcik7XG4gICAgfVxuICB9O1xufVxuIl19

@@ -18,3 +18,3 @@ "use strict";

exports.ValidateFieldEvent = 'VALIDATE_FIELD_EVENT';
var withValidateFieldEventEmitter = function (Base) {
function withValidateFieldEventEmitter(Base) {
return (function (_super) {

@@ -38,4 +38,4 @@ __extends(ValidateFieldEventEmitter, _super);

}(Base));
};
}
exports.withValidateFieldEventEmitter = withValidateFieldEventEmitter;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l0aFZhbGlkYXRlRmllbGRFdmVudEVtaXR0ZXIuanMiLCJz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BCYXNlIHtcbiAgICB2YWxpZGF0ZUZpZWxkRXZlbnRFbWl0dGVyID0gbmV3IEV2ZW50RW1pdHRlcjxMaXN0ZW5lclJldHVyblR5cGU+KCk7XG5cbiAgICBlbWl0VmFsaWRhdGVGaWVsZEV2ZW50KGlucHV0OiBJbnB1dEVsZW1lbnQpIHtcbiAgICAgIHJldHVybiB0aGlzLnZhbGlkYXRlRmllbGRFdmVudEVtaXR0ZXIuZW1pdChWYWxpZGF0ZUZpZWxkRXZlbnQsIGlucHV0KTtcbiAgICB9XG5cbiAgICBhZGRWYWxpZGF0ZUZpZWxkRXZlbnRMaXN0ZW5lcihsaXN0ZW5lcjogTGlzdGVuZXIpIHtcbiAgICAgIHRoaXMudmFsaWRhdGVGaWVsZEV2ZW50RW1pdHRlci5hZGRMaXN0ZW5lcihWYWxpZGF0ZUZpZWxkRXZlbnQsIGxpc3RlbmVyKTtcbiAgICB9XG5cbiAgICByZW1vdmVWYWxpZGF0ZUZpZWxkRXZlbnRMaXN0ZW5lcihsaXN0ZW5lcjogTGlzdGVuZXIpIHtcbiAgICAgIHRoaXMudmFsaWRhdGVGaWVsZEV2ZW50RW1pdHRlci5yZW1vdmVMaXN0ZW5lcihWYWxpZGF0ZUZpZWxkRXZlbnQsIGxpc3RlbmVyKTtcbiAgICB9XG4gIH07XG59XG4iXX0=

@@ -1,2 +0,1 @@

declare const clearArray: <T>(array: T[]) => void;
export default clearArray;
export default function clearArray<T>(array: T[]): void;

@@ -1,6 +0,5 @@

const clearArray = (array) => {
export default function clearArray(array) {
while (array.length) {
array.pop();
}
};
export default clearArray;
}
import * as React from 'react';
declare const deepForEach: (children: React.ReactNode, fn: (child: React.ReactElement<any>) => void) => void;
export default deepForEach;
export default function deepForEach(children: React.ReactNode, fn: (child: React.ReactElement<any>) => void): void;
import * as React from 'react';
const deepForEach = (children, fn) => {
export default function deepForEach(children, fn) {
React.Children.forEach(children, child => {

@@ -10,3 +10,2 @@ const element = child;

});
};
export default deepForEach;
}
interface RecursiveArray<T> extends Array<T | RecursiveArray<T>> {
}
declare const flattenDeep: <T>(arrayOfArrays: RecursiveArray<T>) => T[];
export default flattenDeep;
export default function flattenDeep<T>(arrayOfArrays: RecursiveArray<T>): T[];
export {};

@@ -1,5 +0,4 @@

const flattenDeep = (arrayOfArrays) => {
export default function flattenDeep(arrayOfArrays) {
return arrayOfArrays
.reduce((prev, curr) => prev.concat(Array.isArray(curr) ? flattenDeep(curr) : curr), []);
};
export default flattenDeep;
}

@@ -1,2 +0,1 @@

declare const notUndefined: <T>(value: T | undefined) => value is T;
export default notUndefined;
export default function notUndefined<T>(value: T | undefined): value is T;

@@ -1,2 +0,3 @@

const notUndefined = (value) => value !== undefined;
export default notUndefined;
export default function notUndefined(value) {
return value !== undefined;
}

@@ -5,3 +5,3 @@ import EventEmitter from './EventEmitter';

export declare const FieldDidResetEvent = "FIELD_DID_RESET_EVENT";
declare const withFieldDidResetEventEmitter: <TBase extends Constructor<{}>>(Base: TBase) => {
export declare function withFieldDidResetEventEmitter<TBase extends Constructor<{}>>(Base: TBase): {
new (...args: any[]): {

@@ -14,2 +14,1 @@ fieldDidResetEventEmitter: EventEmitter<void>;

} & TBase;
export { withFieldDidResetEventEmitter };
import EventEmitter from './EventEmitter';
export const FieldDidResetEvent = 'FIELD_DID_RESET_EVENT';
const withFieldDidResetEventEmitter = (Base) => {
export function withFieldDidResetEventEmitter(Base) {
return class ResetFieldEvenEmitter extends Base {

@@ -19,3 +19,2 @@ constructor() {

};
};
export { withFieldDidResetEventEmitter };
}

@@ -5,3 +5,3 @@ import EventEmitter from './EventEmitter';

export declare const FieldDidValidateEvent = "FIELD_DID_VALIDATE_EVENT";
declare const withFieldDidValidateEventEmitter: <TBase extends Constructor<{}>>(Base: TBase) => {
export declare function withFieldDidValidateEventEmitter<TBase extends Constructor<{}>>(Base: TBase): {
new (...args: any[]): {

@@ -14,2 +14,1 @@ fieldDidValidateEventEmitter: EventEmitter<void>;

} & TBase;
export { withFieldDidValidateEventEmitter };
import EventEmitter from './EventEmitter';
export const FieldDidValidateEvent = 'FIELD_DID_VALIDATE_EVENT';
const withFieldDidValidateEventEmitter = (Base) => {
export function withFieldDidValidateEventEmitter(Base) {
return class FieldDidValidateEventEmitter extends Base {

@@ -19,3 +19,2 @@ constructor() {

};
};
export { withFieldDidValidateEventEmitter };
}
import EventEmitter from './EventEmitter';
import Constructor from './Constructor';
export declare const FieldWillValidateEvent = "FIELD_WILL_VALIDATE_EVENT";
declare const withFieldWillValidateEventEmitter: <TBase extends Constructor<{}>>(Base: TBase) => {
export declare function withFieldWillValidateEventEmitter<TBase extends Constructor<{}>>(Base: TBase): {
new (...args: any[]): {

@@ -12,2 +12,1 @@ fieldWillValidateEventEmitter: EventEmitter<void>;

} & TBase;
export { withFieldWillValidateEventEmitter };
import EventEmitter from './EventEmitter';
export const FieldWillValidateEvent = 'FIELD_WILL_VALIDATE_EVENT';
const withFieldWillValidateEventEmitter = (Base) => {
export function withFieldWillValidateEventEmitter(Base) {
return class FieldWillValidateEventEmitter extends Base {

@@ -19,3 +19,2 @@ constructor() {

};
};
export { withFieldWillValidateEventEmitter };
}

@@ -5,3 +5,3 @@ import EventEmitter from './EventEmitter';

export declare const ValidateFieldEvent = "VALIDATE_FIELD_EVENT";
declare const withValidateFieldEventEmitter: <ListenerReturnType, TBase extends Constructor<{}>>(Base: TBase) => {
export declare function withValidateFieldEventEmitter<ListenerReturnType, TBase extends Constructor<{}>>(Base: TBase): {
new (...args: any[]): {

@@ -14,2 +14,1 @@ validateFieldEventEmitter: EventEmitter<ListenerReturnType>;

} & TBase;
export { withValidateFieldEventEmitter };
import EventEmitter from './EventEmitter';
export const ValidateFieldEvent = 'VALIDATE_FIELD_EVENT';
const withValidateFieldEventEmitter = (Base) => {
export function withValidateFieldEventEmitter(Base) {
return class ValidateFieldEventEmitter extends Base {

@@ -19,3 +19,2 @@ constructor() {

};
};
export { withValidateFieldEventEmitter };
}
{
"name": "react-form-with-constraints",
"version": "0.11.0",
"version": "0.12.0",
"repository": {

@@ -29,3 +29,3 @@ "type": "git",

"scripts": {
"clean": "del-cli lib lib-es5 dist coverage .rpt2_cache README.md LICENSE CHANGELOG.md",
"clean": "rm -rf lib lib-es5 dist coverage .rpt2_cache README.md LICENSE CHANGELOG.md",
"tsc": "tsc",

@@ -35,3 +35,3 @@ "build": "yarn build:esnext && yarn build:es5",

"build:es5": "tsc --project tsconfig.lib-es5.json",
"dist": "cross-env NODE_ENV=development rollup --config && cross-env NODE_ENV=production rollup --config",
"dist": "NODE_ENV=development rollup --config && NODE_ENV=production rollup --config",
"prepack": "cp ../../README.md ../../LICENSE ../../CHANGELOG.md .",

@@ -46,3 +46,3 @@ "prepublishOnly": "yarn clean && yarn tsc && yarn build && yarn dist",

"dependencies": {
"prop-types": "^15.6.2"
"prop-types": "^15.7.2"
},

@@ -56,4 +56,2 @@ "devDependencies": {

"@types/react": "latest",
"cross-env": "latest",
"del-cli": "latest",
"enzyme": "latest",

@@ -63,17 +61,13 @@ "enzyme-adapter-react-16": "latest",

"js-beautify": "latest",
"node-gyp": "latest",
"node-zopfli": "latest",
"react": "latest",
"react-dom": "latest",
"rollup": "^0.68.2",
"rollup-plugin-filesize": "^5.0.1",
"rollup-plugin-gzip": "latest",
"rollup": "latest",
"rollup-plugin-filesize": "latest",
"rollup-plugin-strip": "latest",
"rollup-plugin-typescript2": "latest",
"rollup-plugin-uglify": "latest",
"rollup-pluginutils": "latest",
"ts-jest": "latest",
"typescript": "latest"
},
"gitHead": "58becea4459e61fe45eb967281911d7c87d20f24"
"gitHead": "c2778c8bc5b2ba2a6e984dec1fc1432b2a6f1eba"
}

@@ -6,3 +6,3 @@ # react-form-with-constraints

[![codecov](https://codecov.io/gh/tkrotoff/react-form-with-constraints/branch/master/graph/badge.svg)](https://codecov.io/gh/tkrotoff/react-form-with-constraints)
[![gzip size](https://img.badgesize.io/https://unpkg.com/react-form-with-constraints@latest/dist/react-form-with-constraints.production.min.js.gz?compression=gzip)](https://unpkg.com/react-form-with-constraints/dist/)
[![gzip size](https://img.badgesize.io/https://unpkg.com/react-form-with-constraints@latest/dist/react-form-with-constraints.production.min.js?compression=gzip)](https://unpkg.com/react-form-with-constraints/dist/)

@@ -82,10 +82,10 @@ Simple form validation for React

- [Bootstrap 4 example](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/Bootstrap4)
- [Material-UI example](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/MaterialUI)
- [WizardForm example](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/WizardForm)
- [SignUp example](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/SignUp)
- [ClubMembers example](https://codesandbox.io/s/q8364yn60j)
- [Password without state example](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/PasswordWithoutState)
- [Bootstrap 4 example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/Bootstrap4)
- [Material-UI example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/MaterialUI)
- [WizardForm example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/WizardForm)
- [SignUp example (React classes)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/SignUp)
- [ClubMembers example (React classes + MobX)](https://codesandbox.io/s/q8364yn60j)
- [Password without state example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/PasswordWithoutState)
- [React Native example](examples/ReactNative):
- [React Native example (React classes)](examples/ReactNative):

@@ -97,5 +97,5 @@ | iOS | Android |

- Other examples from [the examples directory](examples):
- [Plain old React form validation example](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/PlainOldReact)
- [React with HTML5 constraint validation API example](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/HTML5ConstraintValidationAPI)
- [Server-side rendering example](examples/ServerSideRendering)
- [Plain old React form validation example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/PlainOldReact)
- [React with HTML5 constraint validation API example (React hooks)](https://codesandbox.io/s/github/tkrotoff/react-form-with-constraints/tree/master/examples/HTML5ConstraintValidationAPI)
- [Server-side rendering example (React hooks)](examples/ServerSideRendering)

@@ -152,55 +152,42 @@ ## How it works

```JSX
class MyForm extends React.Component {
async handleChange = e => {
function MyForm() {
const form = useRef(null);
async function handleChange(e) {
const target = e.target;
// Validates only the given fields and returns Promise<Field[]>
const fields = await this.form.validateFields(target);
const fieldIsValid = fields.every(field => field.isValid());
if (fieldIsValid) console.log(`Field '${target.name}' is valid`);
else console.log(`Field '${target.name}' is invalid`);
if (this.form.isValid()) console.log('The form is valid');
else console.log('The form is invalid');
const fields = await form.current.validateFields(target);
}
async handleSubmit = e => {
async function handleSubmit(e) {
e.preventDefault();
// Validates the non-dirty fields and returns Promise<Field[]>
const fields = await this.form.validateForm();
const fields = await form.current.validateForm();
// or simply use this.form.isValid()
const formIsValid = fields.every(field => field.isValid());
if (formIsValid) console.log('The form is valid');
if (form.current.isValid()) console.log('The form is valid');
else console.log('The form is invalid');
}
render() {
return (
<FormWithConstraints
ref={formWithConstraints => this.form = formWithConstraints}
onSubmit={this.handleSubmit} noValidate
>
<input
name="username"
onChange={this.handleChange}
required minLength={3}
return (
<FormWithConstraints ref={form} onSubmit={handleSubmit} noValidate>
<input
name="username"
onChange={handleChange}
required minLength={3}
/>
<FieldFeedbacks for="username">
<FieldFeedback when="tooShort">Too short</FieldFeedback>
<Async
promise={checkUsernameAvailability}
then={available => available ?
<FieldFeedback key="1" info style={{color: 'green'}}>Username available</FieldFeedback> :
<FieldFeedback key="2">Username already taken, choose another</FieldFeedback>
}
/>
<FieldFeedbacks for="username">
<FieldFeedback when="tooShort">Too short</FieldFeedback>
<Async
promise={checkUsernameAvailability}
then={available => available ?
<FieldFeedback key="1" info style={{color: 'green'}}>Username available</FieldFeedback> :
<FieldFeedback key="2">Username already taken, choose another</FieldFeedback>
}
/>
<FieldFeedback when="*" />
</FieldFeedbacks>
</FormWithConstraints>
);
}
<FieldFeedback when="*" />
</FieldFeedbacks>
</FormWithConstraints>
);
}

@@ -207,0 +194,0 @@ ```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc