New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mobx-react-form

Package Overview
Dependencies
Maintainers
1
Versions
249
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobx-react-form - npm Package Compare versions

Comparing version 6.8.2 to 6.8.3

1

lib/Field.d.ts

@@ -122,3 +122,2 @@ import Base from "./Base";

showErrors(show?: boolean, deep?: boolean): void;
showAsyncErrors(): void;
observeValidationOnBlur(): void;

@@ -125,0 +124,0 @@ observeValidationOnChange(): void;

11

lib/Field.js

@@ -557,3 +557,2 @@ "use strict";

showErrors: mobx_1.action,
showAsyncErrors: mobx_1.action,
update: mobx_1.action

@@ -931,12 +930,8 @@ });

showErrors(show = true, deep = true) {
var _a, _b;
this.showError = show;
this.errorSync = lodash_1.default.head(this.validationErrorStack);
this.errorSync = lodash_1.default.head(this.validationErrorStack) || null;
this.errorAsync = (((_a = this.validationAsyncData) === null || _a === void 0 ? void 0 : _a.valid) === false) ? (_b = this.validationAsyncData) === null || _b === void 0 ? void 0 : _b.message : null;
deep && this.each((field) => field.showErrors(show, deep));
}
showAsyncErrors() {
var _a, _b;
this.errorAsync = (((_a = this.validationAsyncData) === null || _a === void 0 ? void 0 : _a.valid) === false)
? (_b = this.validationAsyncData) === null || _b === void 0 ? void 0 : _b.message
: null;
}
observeValidationOnBlur() {

@@ -943,0 +938,0 @@ const opt = this.state.options;

@@ -68,3 +68,2 @@ import { BaseInterface } from "./BaseInterface";

showErrors(show?: boolean, deep?: boolean): void;
showAsyncErrors(): void;
observeValidationOnBlur(): void;

@@ -71,0 +70,0 @@ observeValidationOnChange(): void;

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

import Field from "../Field";
import { BaseInterface } from "./BaseInterface";

@@ -5,3 +6,2 @@ import { FieldInterface, FieldConstructor } from "./FieldInterface";

import { ValidatorInterface, ValidationPlugins } from "./ValidatorInterface";
import Field from "src/Field";
export interface FormInterface extends BaseInterface {

@@ -8,0 +8,0 @@ name: string;

@@ -129,3 +129,2 @@ "use strict";

field.setValidationAsyncData(true);
field.showAsyncErrors();
resolve();

@@ -136,3 +135,2 @@ }

this.executeAsyncValidation(field);
field.showAsyncErrors();
resolve();

@@ -139,0 +137,0 @@ }

@@ -96,4 +96,3 @@ "use strict";

.catch((err) => err && this.handleAsyncError(field, err.errors))
.then(() => this.executeAsyncValidation(field))
.then(() => field.showAsyncErrors());
.then(() => this.executeAsyncValidation(field));
// push the promise into array

@@ -100,0 +99,0 @@ this.promises.push($p);

@@ -91,4 +91,3 @@ "use strict";

.then(($res) => field.setValidationAsyncData($res[0], $res[1]))
.then(() => this.executeAsyncValidation(field))
.then(() => field.showAsyncErrors());
.then(() => this.executeAsyncValidation(field));
// push the promise into array

@@ -95,0 +94,0 @@ this.promises.push($p);

@@ -80,3 +80,2 @@ "use strict";

field.setValidationAsyncData(true);
field.showAsyncErrors();
resolve();

@@ -87,3 +86,2 @@ }

this.executeAsyncValidation(field);
field.showAsyncErrors();
resolve();

@@ -90,0 +88,0 @@ }

{
"name": "mobx-react-form",
"license": "MIT",
"version": "6.8.2",
"version": "6.8.3",
"author": "Claudio Savino <claudio.savino@me.com> (https://twitter.com/foxhound87)",

@@ -6,0 +6,0 @@ "description": "Automagically manage React forms state and automatic validation with MobX.",

@@ -254,3 +254,2 @@ import {

showErrors: action,
showAsyncErrors: action,
update: action

@@ -819,12 +818,7 @@ });

this.showError = show;
this.errorSync = _.head(this.validationErrorStack) as string;
this.errorSync = _.head(this.validationErrorStack) as string || null;
this.errorAsync = (this.validationAsyncData?.valid === false) ? this.validationAsyncData?.message as string : null
deep && this.each((field: FieldInterface) => field.showErrors(show, deep));
}
showAsyncErrors(): void {
this.errorAsync = (this.validationAsyncData?.valid === false)
? this.validationAsyncData?.message as string
: null
}
observeValidationOnBlur(): void {

@@ -831,0 +825,0 @@ const opt = this.state.options;

@@ -78,3 +78,2 @@ import {BaseInterface} from "./BaseInterface";

showErrors(show?: boolean, deep?: boolean): void;
showAsyncErrors(): void;
observeValidationOnBlur(): void;

@@ -81,0 +80,0 @@ observeValidationOnChange(): void;

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

import Field from "../Field";
import { BaseInterface } from "./BaseInterface";

@@ -5,3 +6,2 @@ import { FieldInterface, FieldConstructor } from "./FieldInterface";

import { ValidatorInterface, ValidationPlugins } from "./ValidatorInterface";
import Field from "src/Field";
export interface FormInterface extends BaseInterface {

@@ -8,0 +8,0 @@ name: string;

@@ -125,3 +125,2 @@ import _ from "lodash";

field.setValidationAsyncData(true);
field.showAsyncErrors();
resolve();

@@ -131,8 +130,4 @@ }

handleAsyncFails(field, validation, resolve) {
field.setValidationAsyncData(
false,
_.head(validation.errors.get(field.path))
);
field.setValidationAsyncData(false, _.head(validation.errors.get(field.path)));
this.executeAsyncValidation(field);
field.showAsyncErrors();
resolve();

@@ -139,0 +134,0 @@ }

@@ -81,4 +81,3 @@ import _ from "lodash";

.catch((err) => err && this.handleAsyncError(field, err.errors))
.then(() => this.executeAsyncValidation(field))
.then(() => field.showAsyncErrors());
.then(() => this.executeAsyncValidation(field));

@@ -85,0 +84,0 @@ // push the promise into array

@@ -79,4 +79,3 @@ import {

.then(($res) => field.setValidationAsyncData($res[0], $res[1]))
.then(() => this.executeAsyncValidation(field))
.then(() => field.showAsyncErrors());
.then(() => this.executeAsyncValidation(field));
// push the promise into array

@@ -83,0 +82,0 @@ this.promises.push($p);

@@ -71,3 +71,2 @@ import {

field.setValidationAsyncData(true);
field.showAsyncErrors();
resolve();

@@ -79,3 +78,2 @@ }

this.executeAsyncValidation(field);
field.showAsyncErrors();
resolve();

@@ -82,0 +80,0 @@ }

@@ -149,3 +149,2 @@ (function webpackUniversalModuleDefinition(root, factory) {

field.setValidationAsyncData(true);
field.showAsyncErrors();
resolve();

@@ -156,3 +155,2 @@ }

this.executeAsyncValidation(field);
field.showAsyncErrors();
resolve();

@@ -159,0 +157,0 @@ }

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("_")):"function"==typeof define&&define.amd?define(["_"],t):"object"==typeof exports?exports.MobxReactFormValidatorDVR=t(require("_")):e.MobxReactFormValidatorDVR=t(e._)}(self,(e=>(()=>{"use strict";var t={823:function(e,t,a){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DVR=void 0;const i=s(a(479));class l{constructor({config:e={},state:t=null,promises:a=[]}){Object.defineProperty(this,"promises",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"extend",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state=t,this.promises=a,this.extend=e.extend,this.validator=e.package||e,this.extendValidator()}extendValidator(){"function"==typeof this.extend&&this.extend({validator:this.validator,form:this.state.form})}validate(e){const t=this.state.form.validatedValues;this.validateFieldAsync(e,t),this.validateFieldSync(e,t)}makeLabels(e,t){const a={[t.path]:t.label};i.default.forIn(e.rules[t.path],(e=>{if("string"==typeof e.value&&e.name.match(/^(required_|same|different)/))i.default.forIn(e.value.split(","),((t,s)=>{if(!e.name.match(/^required_(if|unless)/)||s%2==0){const e=this.state.form.$(t);e&&e.path&&e.label&&(a[e.path]=e.label)}}));else if("string"==typeof e.value&&e.name.match(/^(before|after)/)){const t=this.state.form.$(e.value);t&&t.path&&t.label&&(a[t.path]=t.label)}})),e.setAttributeNames(a)}validateFieldSync(e,t){const a=this.rules(e.rules,"sync");if(i.default.isEmpty(a[0]))return;const s={[e.path]:a},l=new this.validator(t,s);this.makeLabels(l,e),l.passes()||e.invalidate(i.default.head(l.errors.get(e.path)),!1)}validateFieldAsync(e,t){const a=this.rules(e.rules,"async");if(i.default.isEmpty(a[0]))return;const s={[e.path]:a},l=new this.validator(t,s);this.makeLabels(l,e);const r=new Promise((t=>l.checkAsync((()=>this.handleAsyncPasses(e,t)),(()=>this.handleAsyncFails(e,l,t)))));this.promises.push(r)}handleAsyncPasses(e,t){e.setValidationAsyncData(!0),e.showAsyncErrors(),t()}handleAsyncFails(e,t,a){e.setValidationAsyncData(!1,i.default.head(t.errors.get(e.path))),this.executeAsyncValidation(e),e.showAsyncErrors(),a()}executeAsyncValidation(e){!1===e.validationAsyncData.valid&&e.invalidate(e.validationAsyncData.message,!1,!0)}rules(e,t){const a=i.default.isString(e)?i.default.split(e,"|"):e,s=new this.validator;return i.default.filter(a,(e=>"async"===t?s.getRule(i.default.split(e,":")[0]).async:!s.getRule(i.default.split(e,":")[0]).async))}}t.DVR=l,t.default=e=>({class:l,config:e})},479:t=>{t.exports=e}},a={};return function e(s){var i=a[s];if(void 0!==i)return i.exports;var l=a[s]={exports:{}};return t[s].call(l.exports,l,l.exports,e),l.exports}(823)})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("_")):"function"==typeof define&&define.amd?define(["_"],t):"object"==typeof exports?exports.MobxReactFormValidatorDVR=t(require("_")):e.MobxReactFormValidatorDVR=t(e._)}(self,(e=>(()=>{"use strict";var t={823:function(e,t,a){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DVR=void 0;const i=s(a(479));class l{constructor({config:e={},state:t=null,promises:a=[]}){Object.defineProperty(this,"promises",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"extend",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state=t,this.promises=a,this.extend=e.extend,this.validator=e.package||e,this.extendValidator()}extendValidator(){"function"==typeof this.extend&&this.extend({validator:this.validator,form:this.state.form})}validate(e){const t=this.state.form.validatedValues;this.validateFieldAsync(e,t),this.validateFieldSync(e,t)}makeLabels(e,t){const a={[t.path]:t.label};i.default.forIn(e.rules[t.path],(e=>{if("string"==typeof e.value&&e.name.match(/^(required_|same|different)/))i.default.forIn(e.value.split(","),((t,s)=>{if(!e.name.match(/^required_(if|unless)/)||s%2==0){const e=this.state.form.$(t);e&&e.path&&e.label&&(a[e.path]=e.label)}}));else if("string"==typeof e.value&&e.name.match(/^(before|after)/)){const t=this.state.form.$(e.value);t&&t.path&&t.label&&(a[t.path]=t.label)}})),e.setAttributeNames(a)}validateFieldSync(e,t){const a=this.rules(e.rules,"sync");if(i.default.isEmpty(a[0]))return;const s={[e.path]:a},l=new this.validator(t,s);this.makeLabels(l,e),l.passes()||e.invalidate(i.default.head(l.errors.get(e.path)),!1)}validateFieldAsync(e,t){const a=this.rules(e.rules,"async");if(i.default.isEmpty(a[0]))return;const s={[e.path]:a},l=new this.validator(t,s);this.makeLabels(l,e);const r=new Promise((t=>l.checkAsync((()=>this.handleAsyncPasses(e,t)),(()=>this.handleAsyncFails(e,l,t)))));this.promises.push(r)}handleAsyncPasses(e,t){e.setValidationAsyncData(!0),t()}handleAsyncFails(e,t,a){e.setValidationAsyncData(!1,i.default.head(t.errors.get(e.path))),this.executeAsyncValidation(e),a()}executeAsyncValidation(e){!1===e.validationAsyncData.valid&&e.invalidate(e.validationAsyncData.message,!1,!0)}rules(e,t){const a=i.default.isString(e)?i.default.split(e,"|"):e,s=new this.validator;return i.default.filter(a,(e=>"async"===t?s.getRule(i.default.split(e,":")[0]).async:!s.getRule(i.default.split(e,":")[0]).async))}}t.DVR=l,t.default=e=>({class:l,config:e})},479:t=>{t.exports=e}},a={};return function e(s){var i=a[s];if(void 0!==i)return i.exports;var l=a[s]={exports:{}};return t[s].call(l.exports,l,l.exports,e),l.exports}(823)})()));
//# sourceMappingURL=MobxReactFormValidatorDVR.umd.min.js.map

@@ -116,4 +116,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

.catch((err) => err && this.handleAsyncError(field, err.errors))
.then(() => this.executeAsyncValidation(field))
.then(() => field.showAsyncErrors());
.then(() => this.executeAsyncValidation(field));
// push the promise into array

@@ -120,0 +119,0 @@ this.promises.push($p);

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("_")):"function"==typeof define&&define.amd?define(["_"],t):"object"==typeof exports?exports.MobxReactFormValidatorSVK=t(require("_")):e.MobxReactFormValidatorSVK=t(e._)}(self,(e=>(()=>{"use strict";var t={324:function(e,t,a){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(a(479));class n{constructor({config:e={},state:t=null,promises:a=[]}){Object.defineProperty(this,"promises",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"extend",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state=t,this.promises=a,this.extend=e.extend,this.schema=e.schema,this.initAJV(e)}extendOptions(e={}){return Object.assign(e,{allowRequired:i.default.get(e,"allowRequired")||!1,errorDataPath:"property",allErrors:!0,coerceTypes:!0,v5:!0})}initAJV(e){const t=new(e.package||e)(this.extendOptions(e.options));"function"==typeof this.extend&&this.extend({form:this.state.form,validator:t}),this.validator=t.compile(this.schema)}validate(e){const t=this.validator(this.parseValues(e.state.form.validatedValues));if(!(a=t)||"function"!=typeof a.then||"object"!=typeof a&&"function"!=typeof a){var a;this.handleSyncError(e,this.validator.errors)}else{const a=t.then((()=>e.setValidationAsyncData(!0))).catch((t=>t&&this.handleAsyncError(e,t.errors))).then((()=>this.executeAsyncValidation(e))).then((()=>e.showAsyncErrors()));this.promises.push(a)}}handleSyncError(e,t){const a=this.findError(e.path,t);if(i.default.isUndefined(a))return;const r=`${e.label} ${a.message}`;e.invalidate(r,!1)}handleAsyncError(e,t){const a=this.findError(e.path,t);if(i.default.isUndefined(a))return;const r=`${e.label} ${a.message}`;e.setValidationAsyncData(!1,r)}findError(e,t){return i.default.find(t,(({dataPath:t})=>{let a;return a=i.default.trimStart(t,"."),a=i.default.replace(a,"]",""),a=i.default.replace(a,"[","."),i.default.includes(a,e)}))}executeAsyncValidation(e){!1===e.validationAsyncData.valid&&e.invalidate(e.validationAsyncData.message,!1,!0)}parseValues(e){return!0===i.default.get(this.config,"options.allowRequired")?i.default.omitBy(e,i.default.isEmpty||i.default.isNull||i.default.isUndefined||i.default.isNaN):e}}t.default=e=>({class:n,config:e})},479:t=>{t.exports=e}},a={};return function e(r){var i=a[r];if(void 0!==i)return i.exports;var n=a[r]={exports:{}};return t[r].call(n.exports,n,n.exports,e),n.exports}(324)})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("_")):"function"==typeof define&&define.amd?define(["_"],t):"object"==typeof exports?exports.MobxReactFormValidatorSVK=t(require("_")):e.MobxReactFormValidatorSVK=t(e._)}(self,(e=>(()=>{"use strict";var t={324:function(e,t,a){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(a(479));class n{constructor({config:e={},state:t=null,promises:a=[]}){Object.defineProperty(this,"promises",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"extend",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state=t,this.promises=a,this.extend=e.extend,this.schema=e.schema,this.initAJV(e)}extendOptions(e={}){return Object.assign(e,{allowRequired:i.default.get(e,"allowRequired")||!1,errorDataPath:"property",allErrors:!0,coerceTypes:!0,v5:!0})}initAJV(e){const t=new(e.package||e)(this.extendOptions(e.options));"function"==typeof this.extend&&this.extend({form:this.state.form,validator:t}),this.validator=t.compile(this.schema)}validate(e){const t=this.validator(this.parseValues(e.state.form.validatedValues));if(!(a=t)||"function"!=typeof a.then||"object"!=typeof a&&"function"!=typeof a){var a;this.handleSyncError(e,this.validator.errors)}else{const a=t.then((()=>e.setValidationAsyncData(!0))).catch((t=>t&&this.handleAsyncError(e,t.errors))).then((()=>this.executeAsyncValidation(e)));this.promises.push(a)}}handleSyncError(e,t){const a=this.findError(e.path,t);if(i.default.isUndefined(a))return;const r=`${e.label} ${a.message}`;e.invalidate(r,!1)}handleAsyncError(e,t){const a=this.findError(e.path,t);if(i.default.isUndefined(a))return;const r=`${e.label} ${a.message}`;e.setValidationAsyncData(!1,r)}findError(e,t){return i.default.find(t,(({dataPath:t})=>{let a;return a=i.default.trimStart(t,"."),a=i.default.replace(a,"]",""),a=i.default.replace(a,"[","."),i.default.includes(a,e)}))}executeAsyncValidation(e){!1===e.validationAsyncData.valid&&e.invalidate(e.validationAsyncData.message,!1,!0)}parseValues(e){return!0===i.default.get(this.config,"options.allowRequired")?i.default.omitBy(e,i.default.isEmpty||i.default.isNull||i.default.isUndefined||i.default.isNaN):e}}t.default=e=>({class:n,config:e})},479:t=>{t.exports=e}},a={};return function e(r){var i=a[r];if(void 0!==i)return i.exports;var n=a[r]={exports:{}};return t[r].call(n.exports,n,n.exports,e),n.exports}(324)})()));
//# sourceMappingURL=MobxReactFormValidatorSVK.umd.min.js.map

@@ -111,4 +111,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

.then(($res) => field.setValidationAsyncData($res[0], $res[1]))
.then(() => this.executeAsyncValidation(field))
.then(() => field.showAsyncErrors());
.then(() => this.executeAsyncValidation(field));
// push the promise into array

@@ -115,0 +114,0 @@ this.promises.push($p);

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("_")):"function"==typeof define&&define.amd?define(["_"],t):"object"==typeof exports?exports.MobxReactFormValidatorVJF=t(require("_")):e.MobxReactFormValidatorVJF=t(e._)}(self,(e=>(()=>{"use strict";var t={69:function(e,t,a){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VJF=void 0;const o=i(a(479)),r=e=>!!e&&"function"==typeof e.then&&("object"==typeof e||"function"==typeof e);class n{constructor({config:e={},state:t=null,promises:a=[]}){Object.defineProperty(this,"promises",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"extend",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state=t,this.promises=a,this.extend=e.extend,this.validator=e.package||e,this.extendValidator()}extendValidator(){"function"==typeof this.extend&&this.extend({validator:this.validator,form:this.state.form})}validate(e){if(!e.validators)return;const t=e.validators;Array.isArray(t)&&t.map((t=>this.collectData(t,e))),this.executeValidation(e)}collectData(e,t){const a=this.handleFunctionResult(e,t);if(r(a)){const e=a.then((e=>t.setValidationAsyncData(e[0],e[1]))).then((()=>this.executeAsyncValidation(t))).then((()=>t.showAsyncErrors()));this.promises.push(e)}else t.validationFunctionsData.unshift({valid:a[0],message:a[1]})}executeValidation(e){e.validationFunctionsData.map((t=>!1===t.valid&&e.invalidate(t.message,!1)))}executeAsyncValidation(e){!1===e.validationAsyncData.valid&&e.invalidate(e.validationAsyncData.message,!1,!0)}handleFunctionResult(e,t){const a=e({validator:this.validator,form:this.state.form,field:t});return Array.isArray(a)?[a[0]||!1,a[1]||"Error"]:o.default.isBoolean(a)?[a,"Error"]:o.default.isString(a)?[!1,a]:r(a)?a:[!1,"Error"]}}t.VJF=n,t.default=e=>({class:n,config:e})},479:t=>{t.exports=e}},a={};return function e(i){var o=a[i];if(void 0!==o)return o.exports;var r=a[i]={exports:{}};return t[i].call(r.exports,r,r.exports,e),r.exports}(69)})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("_")):"function"==typeof define&&define.amd?define(["_"],t):"object"==typeof exports?exports.MobxReactFormValidatorVJF=t(require("_")):e.MobxReactFormValidatorVJF=t(e._)}(self,(e=>(()=>{"use strict";var t={69:function(e,t,a){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VJF=void 0;const o=i(a(479)),r=e=>!!e&&"function"==typeof e.then&&("object"==typeof e||"function"==typeof e);class n{constructor({config:e={},state:t=null,promises:a=[]}){Object.defineProperty(this,"promises",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"extend",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state=t,this.promises=a,this.extend=e.extend,this.validator=e.package||e,this.extendValidator()}extendValidator(){"function"==typeof this.extend&&this.extend({validator:this.validator,form:this.state.form})}validate(e){if(!e.validators)return;const t=e.validators;Array.isArray(t)&&t.map((t=>this.collectData(t,e))),this.executeValidation(e)}collectData(e,t){const a=this.handleFunctionResult(e,t);if(r(a)){const e=a.then((e=>t.setValidationAsyncData(e[0],e[1]))).then((()=>this.executeAsyncValidation(t)));this.promises.push(e)}else t.validationFunctionsData.unshift({valid:a[0],message:a[1]})}executeValidation(e){e.validationFunctionsData.map((t=>!1===t.valid&&e.invalidate(t.message,!1)))}executeAsyncValidation(e){!1===e.validationAsyncData.valid&&e.invalidate(e.validationAsyncData.message,!1,!0)}handleFunctionResult(e,t){const a=e({validator:this.validator,form:this.state.form,field:t});return Array.isArray(a)?[a[0]||!1,a[1]||"Error"]:o.default.isBoolean(a)?[a,"Error"]:o.default.isString(a)?[!1,a]:r(a)?a:[!1,"Error"]}}t.VJF=n,t.default=e=>({class:n,config:e})},479:t=>{t.exports=e}},a={};return function e(i){var o=a[i];if(void 0!==o)return o.exports;var r=a[i]={exports:{}};return t[i].call(r.exports,r,r.exports,e),r.exports}(69)})()));
//# sourceMappingURL=MobxReactFormValidatorVJF.umd.min.js.map

@@ -99,3 +99,2 @@ (function webpackUniversalModuleDefinition(root, factory) {

field.setValidationAsyncData(true);
field.showAsyncErrors();
resolve();

@@ -106,3 +105,2 @@ }

this.executeAsyncValidation(field);
field.showAsyncErrors();
resolve();

@@ -109,0 +107,0 @@ }

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MobxReactFormValidatorYUP=t():e.MobxReactFormValidatorYUP=t()}(self,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0});class a{constructor({config:e={},state:t=null,promises:a=[]}){Object.defineProperty(this,"promises",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"extend",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state=t,this.promises=a,this.extend=e.extend,this.validator=e.package||e,this.schema=e.schema(this.validator),this.extendValidator()}extendValidator(){"function"==typeof this.extend&&this.extend({validator:this.validator,form:this.state.form})}validate(e){const t=new Promise((t=>this.validator.reach(this.schema,e.path).label(e.label).validate(e.validatedValue,{strict:!0}).then((()=>this.handleAsyncPasses(e,t))).catch((a=>this.handleAsyncFails(e,t,a)))));this.promises.push(t)}handleAsyncPasses(e,t){e.setValidationAsyncData(!0),e.showAsyncErrors(),t()}handleAsyncFails(e,t,a){e.setValidationAsyncData(!1,a.errors[0]),this.executeAsyncValidation(e),e.showAsyncErrors(),t()}executeAsyncValidation(e){!1===e.validationAsyncData.valid&&e.invalidate(e.validationAsyncData.message,!1,!0)}}t.default=e=>({class:a,config:e})})(),e})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MobxReactFormValidatorYUP=t():e.MobxReactFormValidatorYUP=t()}(self,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0});class a{constructor({config:e={},state:t=null,promises:a=[]}){Object.defineProperty(this,"promises",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"extend",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"validator",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state=t,this.promises=a,this.extend=e.extend,this.validator=e.package||e,this.schema=e.schema(this.validator),this.extendValidator()}extendValidator(){"function"==typeof this.extend&&this.extend({validator:this.validator,form:this.state.form})}validate(e){const t=new Promise((t=>this.validator.reach(this.schema,e.path).label(e.label).validate(e.validatedValue,{strict:!0}).then((()=>this.handleAsyncPasses(e,t))).catch((a=>this.handleAsyncFails(e,t,a)))));this.promises.push(t)}handleAsyncPasses(e,t){e.setValidationAsyncData(!0),t()}handleAsyncFails(e,t,a){e.setValidationAsyncData(!1,a.errors[0]),this.executeAsyncValidation(e),t()}executeAsyncValidation(e){!1===e.validationAsyncData.valid&&e.invalidate(e.validationAsyncData.message,!1,!0)}}t.default=e=>({class:a,config:e})})(),e})()));
//# sourceMappingURL=MobxReactFormValidatorYUP.umd.min.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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