@vaadin/field-base
Advanced tools
Comparing version 23.2.0-alpha2 to 23.2.0-dev.48e5e3967
{ | ||
"name": "@vaadin/field-base", | ||
"version": "23.2.0-alpha2", | ||
"version": "23.2.0-dev.48e5e3967", | ||
"publishConfig": { | ||
@@ -35,3 +35,3 @@ "access": "public" | ||
"@polymer/polymer": "^3.0.0", | ||
"@vaadin/component-base": "23.2.0-alpha2", | ||
"@vaadin/component-base": "23.2.0-dev.48e5e3967", | ||
"lit": "^2.0.0" | ||
@@ -44,3 +44,3 @@ }, | ||
}, | ||
"gitHead": "c9b8113d0fa9a602f8b9cb915c1826355af2e8df" | ||
"gitHead": "961bc4ae5b707c3c02f12b99819b3c12c9b478aa" | ||
} |
@@ -33,2 +33,10 @@ /** | ||
checkValidity(): boolean; | ||
/** | ||
* Fired whenever the field is validated. | ||
* | ||
* @event validated | ||
* @param {Object} detail | ||
* @param {boolean} detail.valid the result of the validation. | ||
*/ | ||
} |
@@ -39,8 +39,13 @@ /** | ||
/** | ||
* Returns true if field is valid, and sets `invalid` based on the field validity. | ||
* Validates the field and sets the `invalid` property based on the result. | ||
* | ||
* The method fires a `validated` event with the result of the validation. | ||
* | ||
* @return {boolean} True if the value is valid. | ||
*/ | ||
validate() { | ||
return !(this.invalid = !this.checkValidity()); | ||
const isValid = this.checkValidity(); | ||
this.invalid = !isValid; | ||
this.dispatchEvent(new CustomEvent('validated', { detail: { valid: isValid } })); | ||
return isValid; | ||
} | ||
@@ -56,3 +61,11 @@ | ||
} | ||
/** | ||
* Fired whenever the field is validated. | ||
* | ||
* @event validated | ||
* @param {Object} detail | ||
* @param {boolean} detail.valid the result of the validation. | ||
*/ | ||
}, | ||
); |
116004
3230
+ Added@vaadin/component-base@23.2.0-dev.48e5e3967(transitive)
- Removed@vaadin/component-base@23.2.0-alpha2(transitive)