Comparing version 1.0.1 to 1.0.2
@@ -0,0 +0,0 @@ # 1.0.1 |
@@ -15,2 +15,10 @@ import { ComposibleValidatable, Validator } from './types'; | ||
error?: string; | ||
/** | ||
* Allows you to set an error on a field lazily | ||
* Use case: | ||
* You validate some things on client (e.g. isRequired) | ||
* You then validate the field on the backend with an explict action (e.g. continue button) | ||
* You now want to highlight an error from the backend for this field | ||
**/ | ||
setError(error: string): void; | ||
/** If the field has been touched */ | ||
@@ -23,3 +31,3 @@ dirty?: boolean; | ||
* Use case: | ||
* - to show a green color in the field if `hasError` is false | ||
* - to show a green color in the field : `hasError == false && hasBeenValidated == true` | ||
**/ | ||
@@ -26,0 +34,0 @@ hasBeenValidated: boolean; |
@@ -26,3 +26,3 @@ "use strict"; | ||
* Use case: | ||
* - to show a green color in the field if `hasError` is false | ||
* - to show a green color in the field : `hasError == false && hasBeenValidated == true` | ||
**/ | ||
@@ -211,2 +211,12 @@ this.hasBeenValidated = false; | ||
} | ||
/** | ||
* Allows you to set an error on a field lazily | ||
* Use case: | ||
* You validate some things on client (e.g. isRequired) | ||
* You then validate the field on the backend with an explict action (e.g. continue button) | ||
* You now want to highlight an error from the backend for this field | ||
**/ | ||
FieldState.prototype.setError = function (error) { | ||
this.error = error; | ||
}; | ||
Object.defineProperty(FieldState.prototype, "hasError", { | ||
@@ -226,2 +236,5 @@ get: function () { | ||
__decorate([ | ||
mobx_1.action | ||
], FieldState.prototype, "setError", null); | ||
__decorate([ | ||
mobx_1.observable | ||
@@ -228,0 +241,0 @@ ], FieldState.prototype, "dirty", void 0); |
@@ -0,0 +0,0 @@ import { ComposibleValidatable, Validator } from './types'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Validatable, Validator } from './types'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** A truthy string or falsy values */ |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export * from './core/types'; |
@@ -0,0 +0,0 @@ "use strict"; |
export declare function debounce<T extends Function>(func: T, milliseconds: number, immediate?: boolean): T; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "formstate", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Painless and simple MobX form management", | ||
@@ -48,2 +48,3 @@ "main": "./lib/index.js", | ||
"mocha": "5.0.5", | ||
"moment": "2.22.1", | ||
"react": "15.4.2", | ||
@@ -50,0 +51,0 @@ "react-dom": "15.4.2", |
@@ -0,0 +0,0 @@ # FormState |
@@ -19,2 +19,12 @@ import { observable, action, computed, runInAction } from 'mobx'; | ||
/** | ||
* Allows you to set an error on a field lazily | ||
* Use case: | ||
* You validate some things on client (e.g. isRequired) | ||
* You then validate the field on the backend with an explict action (e.g. continue button) | ||
* You now want to highlight an error from the backend for this field | ||
**/ | ||
@action setError(error: string) { | ||
this.error = error; | ||
} | ||
@@ -30,3 +40,3 @@ /** If the field has been touched */ | ||
* Use case: | ||
* - to show a green color in the field if `hasError` is false | ||
* - to show a green color in the field : `hasError == false && hasBeenValidated == true` | ||
**/ | ||
@@ -33,0 +43,0 @@ @observable hasBeenValidated: boolean = false; |
@@ -0,0 +0,0 @@ import { observable, action, computed, runInAction, isObservable, isArrayLike } from 'mobx'; |
@@ -0,0 +0,0 @@ import { observable, action, computed, runInAction } from 'mobx'; |
@@ -0,0 +0,0 @@ import * as utils from '../internal/utils'; |
@@ -0,0 +0,0 @@ export * from './core/types'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { starts } from 'starts'; |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
76947
30
2050
22
1