@anypoint-web-components/anypoint-switch
Advanced tools
Comparing version 0.1.12 to 0.1.13
{ | ||
"name": "@anypoint-web-components/anypoint-switch", | ||
"description": "A toggle button styled for Material Design and Anypoint platform.", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -28,10 +28,2 @@ import { LitElement, html } from 'lit-element'; | ||
static get formAssociated() { | ||
return true; | ||
} | ||
get form() { | ||
return this._internals && this._internals.form; | ||
} | ||
/** | ||
@@ -71,7 +63,2 @@ * @returns {EventListener} Previously registered event listener or null | ||
this._hasIronCheckedElementBehavior = true; | ||
// @ts-ignore | ||
if (this.attachInternals) { | ||
// @ts-ignore | ||
this._internals = this.attachInternals(); | ||
} | ||
} | ||
@@ -122,25 +109,6 @@ | ||
this.setAttribute('aria-checked', value ? 'true' : 'false'); | ||
if (this._internals) { | ||
if (this._internals.setFormValue) { | ||
this._internals.setFormValue(value ? this.value : ''); | ||
} | ||
if (this._internals.setValidity) { | ||
if (!this.matches(':disabled') && this.hasAttribute('required') && !value) { | ||
this._internals.setValidity({ | ||
customError: true | ||
}, 'This field is required.'); | ||
} else { | ||
this._internals.setValidity({}); | ||
} | ||
} | ||
} else { | ||
this.validate(this.checked); | ||
} | ||
this.validate(this.checked); | ||
} | ||
checkValidity() { | ||
if (this._internals && this._internals.checkValidity) { | ||
return this._internals.checkValidity(); | ||
} | ||
return this.required ? this.checked : true; | ||
@@ -155,11 +123,5 @@ } | ||
this.checked = false; | ||
if (this._internals && this._internals.setFormValue) { | ||
this._internals.setFormValue('') | ||
} | ||
} | ||
formStateRestoreCallback(state) { | ||
if (this._internals && this._internals.setFormValue) { | ||
this._internals.setFormValue(state) | ||
} | ||
this.checked = !!state; | ||
@@ -166,0 +128,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
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
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
24086
626
1