@vaadin/vaadin-custom-field
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-custom-field", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"main": "vaadin-custom-field.js", | ||
@@ -29,4 +29,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", | ||
@@ -61,3 +58,7 @@ "@polymer/iron-test-helpers": "^3.0.0", | ||
"@vaadin/vaadin-list-box": "^1.3.0" | ||
}, | ||
"scripts": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify", | ||
"test": "wct --npm" | ||
} | ||
} |
@@ -103,7 +103,14 @@ /** | ||
helperText: string|null; | ||
_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. | ||
@@ -110,0 +117,0 @@ */ |
@@ -101,3 +101,3 @@ /** | ||
static get version() { | ||
return '1.3.0'; | ||
return '1.4.0'; | ||
} | ||
@@ -220,9 +220,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() { | ||
return !(this.invalid = !this.checkValidity()); | ||
const isValid = this.checkValidity(); | ||
this._setInvalid(!isValid); | ||
this.dispatchEvent(new CustomEvent('validated', {detail: {valid: isValid}})); | ||
return isValid; | ||
} | ||
@@ -287,2 +312,10 @@ | ||
} | ||
/** | ||
* Fired whenever the field is validated. | ||
* | ||
* @event validated | ||
* @param {Object} detail | ||
* @param {boolean} detail.valid the result of the validation. | ||
*/ | ||
} | ||
@@ -289,0 +322,0 @@ |
@@ -130,2 +130,7 @@ import '@vaadin/vaadin-lumo-styles/color.js'; | ||
} | ||
/* When custom-field is used with components without outer margin */ | ||
:host([theme~="whitespace"][has-label]) [part="label"] { | ||
padding-bottom: 0.5em; | ||
} | ||
</style> | ||
@@ -132,0 +137,0 @@ </template> |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
46626
857
14
1