@ewc-lib/ewc-icon-button
Advanced tools
Comparing version 0.2.0-alpha to 0.2.1-alpha
{ | ||
"name": "@ewc-lib/ewc-icon-button", | ||
"version": "0.2.0-alpha", | ||
"version": "0.2.1-alpha", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/main.js", |
@@ -0,0 +0,0 @@ # Screenshot |
@@ -0,0 +0,0 @@ |
@@ -7,5 +7,5 @@ /* | ||
static get(icon, size, bgStyle) { | ||
static get(icon, size, bgStyle, name) { | ||
let html = ` | ||
<button part="button" tabindex="-1"> | ||
<button part="button" tabindex="-1" aria-label="${name}"> | ||
<svg class="" width="${size}px" height="${size}px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="cursor: pointer; pointer-events: auto;"> | ||
@@ -12,0 +12,0 @@ ${icons[bgStyle]} |
@@ -19,2 +19,3 @@ /* | ||
#bg | ||
#name | ||
@@ -36,5 +37,6 @@ getAttr(name, _default) { | ||
this.#size = this.getAttr("size",40) | ||
this.#size = this.getAttr("size", 40) | ||
this.#state = this.getAttr("state","true") | ||
this.#bg = this.getAttr("background","light") | ||
this.#name = this.getAttr("name", "button") | ||
@@ -46,3 +48,3 @@ this.style.width=this.#size | ||
this.attachShadow({mode: 'open'}) | ||
this.shadowRoot.appendChild( HTML.get( this.#icon, this.#size, "circle").cloneNode(true) ) | ||
this.shadowRoot.appendChild( HTML.get( this.#icon, this.#size, "circle", this.#name).cloneNode(true) ) | ||
this.#installEventHandlers() | ||
@@ -53,3 +55,3 @@ this.#setupColors() | ||
static get observedAttributes() { return ["icon", "background", "state", "size"] } | ||
static get observedAttributes() { return ["icon", "background", "state", "size", "name"] } | ||
@@ -61,2 +63,3 @@ attributeChangedCallback(name, oldValue, newValue) { | ||
if (name === 'size') { } | ||
if (name === 'name') { } | ||
} | ||
@@ -63,0 +66,0 @@ |
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
17060
227
6
1