Comparing version 0.16.0 to 0.17.0
@@ -10,3 +10,3 @@ import { ComposibleValidatable, Validator } from './types'; | ||
/** | ||
* The value is stored in the field. May or may not be *valid*. | ||
* The value you should bind to the input in your field. | ||
*/ | ||
@@ -16,4 +16,10 @@ value: TValue; | ||
error?: string; | ||
/** The value set from code or a hot value that's been validated */ | ||
/** The value set from code or a `value` that's been validated */ | ||
$: TValue; | ||
/** | ||
* Set to true if a validation run has been completed since init | ||
* Use case: | ||
* - to show a green color in the field if `hasError` is false | ||
**/ | ||
hasBeenValidated: boolean; | ||
private autoValidationEnabled; | ||
@@ -20,0 +26,0 @@ enableAutoValidation: () => void; |
@@ -20,2 +20,8 @@ "use strict"; | ||
this.config = config; | ||
/** | ||
* Set to true if a validation run has been completed since init | ||
* Use case: | ||
* - to show a green color in the field if `hasError` is false | ||
**/ | ||
this.hasBeenValidated = false; | ||
this.autoValidationEnabled = true; | ||
@@ -65,2 +71,3 @@ this.enableAutoValidation = function () { | ||
_this.error = undefined; | ||
_this.hasBeenValidated = false; | ||
_this.$ = value; | ||
@@ -97,2 +104,3 @@ _this.on$Reinit(); | ||
_this.validating = false; | ||
_this.hasBeenValidated = true; | ||
/** For any change in field error, update our error */ | ||
@@ -179,2 +187,5 @@ if (fieldError != _this.error) { | ||
mobx_1.observable | ||
], FieldState.prototype, "hasBeenValidated", void 0); | ||
__decorate([ | ||
mobx_1.observable | ||
], FieldState.prototype, "autoValidationEnabled", void 0); | ||
@@ -181,0 +192,0 @@ __decorate([ |
@@ -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": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "Painless and simple MobX form management", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -0,0 +0,0 @@ # FormState |
@@ -12,3 +12,3 @@ import { observable, action, computed, runInAction } from 'mobx'; | ||
/** | ||
* The value is stored in the field. May or may not be *valid*. | ||
* The value you should bind to the input in your field. | ||
*/ | ||
@@ -20,5 +20,12 @@ @observable value: TValue; | ||
/** The value set from code or a hot value that's been validated */ | ||
/** The value set from code or a `value` that's been validated */ | ||
@observable $: TValue; | ||
/** | ||
* Set to true if a validation run has been completed since init | ||
* Use case: | ||
* - to show a green color in the field if `hasError` is false | ||
**/ | ||
@observable hasBeenValidated: boolean = false; | ||
@observable private autoValidationEnabled = true; | ||
@@ -88,2 +95,3 @@ @action public enableAutoValidation = () => { | ||
this.error = undefined; | ||
this.hasBeenValidated = false; | ||
this.$ = value; | ||
@@ -128,2 +136,3 @@ this.on$Reinit(); | ||
this.validating = false; | ||
this.hasBeenValidated = true; | ||
@@ -130,0 +139,0 @@ /** For any change in field error, update our error */ |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66683
28
1852
1