@vaadin/vaadin-checkbox
Advanced tools
Comparing version 2.5.1 to 2.6.0
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-checkbox", | ||
"version": "2.5.1", | ||
"version": "2.6.0", | ||
"main": "vaadin-checkbox.js", | ||
@@ -28,4 +28,2 @@ "author": "Vaadin Ltd", | ||
"resolutions": { | ||
"es-abstract": "1.17.6", | ||
"@types/doctrine": "0.0.3", | ||
"inherits": "2.0.3", | ||
@@ -44,6 +42,5 @@ "samsam": "1.1.3", | ||
}, | ||
"scripts": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify" | ||
}, | ||
"devDependencies": { | ||
"devDependencies": { | ||
"@web-padawan/gen-typescript-declarations": "^1.6.2", | ||
"web-component-tester": "6.9.2", | ||
"@polymer/iron-component-page": "^4.0.0", | ||
@@ -56,3 +53,7 @@ "@polymer/iron-test-helpers": "^3.0.0", | ||
"@vaadin/vaadin-button": "^2.4.0" | ||
}, | ||
"scripts": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify", | ||
"test": "wct --npm" | ||
} | ||
} |
@@ -107,7 +107,14 @@ /** | ||
ready(): void; | ||
_setInvalid(invalid: boolean): void; | ||
/** | ||
* Returns true if `value` is valid. | ||
* `<iron-form>` uses this to check the validity or all its elements. | ||
* Override this method to define whether the given `invalid` state should be set. | ||
*/ | ||
_shouldSetInvalid(_invalid: boolean): boolean; | ||
/** | ||
* Validates the field and sets the `invalid` property based on the result. | ||
* | ||
* The method fires a `validated` event with the result of the validation. | ||
* | ||
* @returns True if the value is valid. | ||
@@ -114,0 +121,0 @@ */ |
@@ -247,10 +247,34 @@ /** | ||
/** | ||
* Returns true if `value` is valid. | ||
* `<iron-form>` uses this to check the validity or all its elements. | ||
* @param {boolean} invalid | ||
* @protected | ||
*/ | ||
_setInvalid(invalid) { | ||
if (this._shouldSetInvalid(invalid)) { | ||
this.invalid = invalid; | ||
} | ||
} | ||
/** | ||
* Override this method to define whether the given `invalid` state should be set. | ||
* | ||
* @param {boolean} _invalid | ||
* @return {boolean} | ||
* @protected | ||
*/ | ||
_shouldSetInvalid(_invalid) { | ||
return true; | ||
} | ||
/** | ||
* 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() { | ||
this.invalid = this.required && this.value.length === 0; | ||
return !this.invalid; | ||
const isValid = !(this.required && this.value.length === 0); | ||
this._setInvalid(!isValid); | ||
this.dispatchEvent(new CustomEvent('validated', {detail: {valid: isValid}})); | ||
return isValid; | ||
} | ||
@@ -406,2 +430,10 @@ | ||
} | ||
/** | ||
* Fired whenever the field is validated. | ||
* | ||
* @event validated | ||
* @param {Object} detail | ||
* @param {boolean} detail.valid the result of the validation. | ||
*/ | ||
} | ||
@@ -408,0 +440,0 @@ |
@@ -114,3 +114,3 @@ /** | ||
static get version() { | ||
return '2.5.0'; | ||
return '2.6.0'; | ||
} | ||
@@ -117,0 +117,0 @@ |
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
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
60188
1328
9