Comparing version 3.0.1 to 3.1.0
@@ -58,3 +58,5 @@ import React from 'react'; | ||
private handleBlur; | ||
set(value: any): void; | ||
set(value: any, opts?: { | ||
silent: boolean; | ||
}): void; | ||
unset(): void; | ||
@@ -61,0 +63,0 @@ setError(error: any): void; |
@@ -416,3 +416,4 @@ import equal from 'fast-deep-equal'; | ||
}; | ||
Field.prototype.set = function (value) { | ||
Field.prototype.set = function (value, opts) { | ||
var silent = (opts || {}).silent; | ||
var modifiedValue = Field.modifyValue(value); | ||
@@ -424,3 +425,5 @@ if (modifiedValue !== this.state.value && !this.readOnly) { | ||
}); | ||
this._events.dispatch(eventNames.change, this.state.value); | ||
if (silent) { | ||
this._events.dispatch(eventNames.change, this.state.value); | ||
} | ||
} | ||
@@ -427,0 +430,0 @@ }; |
@@ -58,3 +58,5 @@ import React from 'react'; | ||
private handleBlur; | ||
set(value: any): void; | ||
set(value: any, opts?: { | ||
silent: boolean; | ||
}): void; | ||
unset(): void; | ||
@@ -61,0 +63,0 @@ setError(error: any): void; |
@@ -422,3 +422,4 @@ 'use strict'; | ||
}; | ||
Field.prototype.set = function (value) { | ||
Field.prototype.set = function (value, opts) { | ||
var silent = (opts || {}).silent; | ||
var modifiedValue = Field.modifyValue(value); | ||
@@ -430,3 +431,5 @@ if (modifiedValue !== this.state.value && !this.readOnly) { | ||
}); | ||
this._events.dispatch(eventNames.change, this.state.value); | ||
if (silent) { | ||
this._events.dispatch(eventNames.change, this.state.value); | ||
} | ||
} | ||
@@ -433,0 +436,0 @@ }; |
{ | ||
"name": "formular", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Pavel Ivanov", |
@@ -264,3 +264,3 @@ # Formular | ||
unsetRef(): void | ||
set(value: any): void | ||
set(value: any, opts?: { silent: boolean }): void | ||
unset(): void | ||
@@ -275,3 +275,5 @@ validate = (): CancelablePromise | ||
**Note:** `{ silent: true }` in field.set doesn't trigger events. | ||
## Events | ||
@@ -278,0 +280,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
115981
2257
326