@code.gov/code-gov-style
Advanced tools
Comparing version 1.7.1 to 1.7.2
@@ -10,3 +10,7 @@ 'use strict'; | ||
} | ||
static get observedAttributes() { | ||
return ['options']; | ||
} | ||
get collapsed() { | ||
@@ -22,3 +26,3 @@ return this.className.includes("collapsed"); | ||
if (newValue) { | ||
this.className = (this.className + " " + className).trim(); | ||
this.className = (this.className.replace(className, "") + " " + className).trim(); | ||
} else { | ||
@@ -43,2 +47,8 @@ this.className = this.className.replace(className, "").trim(); | ||
attributeChangedCallback(attrName, oldVal, newVal) { | ||
if (attrName === 'options') { | ||
this.update(); | ||
} | ||
} | ||
getHTML() { | ||
@@ -80,6 +90,9 @@ return ` | ||
} | ||
this.options = parsedOptions.map(option => { | ||
return { name: option, value: option, selected: false }; | ||
}); | ||
console.log("options:", this.options); | ||
if (parsedOptions) { | ||
this.options = parsedOptions.map(option => { | ||
return { name: option, value: option, selected: false }; | ||
}); | ||
} else { | ||
this.options = []; | ||
} | ||
@@ -90,3 +103,2 @@ container.className = "filter-box"; | ||
// appending the container to the shadow DOM | ||
this.appendChild(container); | ||
@@ -112,5 +124,5 @@ | ||
if (event.target.checked) { | ||
li.className += " checked"; | ||
li.className = (li.className.replace("checked", "") + " checked").trim(); | ||
} else { | ||
li.className = li.className.replace("checked", ""); | ||
li.className = li.className.replace("checked", "").trim(); | ||
} | ||
@@ -123,2 +135,4 @@ }, false); | ||
*/ | ||
const event = new Event('change', {}); | ||
this.dispatchEvent(event); | ||
} | ||
@@ -125,0 +139,0 @@ |
@@ -10,3 +10,7 @@ 'use strict'; | ||
} | ||
static get observedAttributes() { | ||
return ['options']; | ||
} | ||
get collapsed() { | ||
@@ -22,3 +26,3 @@ return this.className.includes("collapsed"); | ||
if (newValue) { | ||
this.className = (this.className + " " + className).trim(); | ||
this.className = (this.className.replace(className, "") + " " + className).trim(); | ||
} else { | ||
@@ -43,2 +47,8 @@ this.className = this.className.replace(className, "").trim(); | ||
attributeChangedCallback(attrName, oldVal, newVal) { | ||
if (attrName === 'options') { | ||
this.update(); | ||
} | ||
} | ||
getHTML() { | ||
@@ -80,6 +90,9 @@ return ` | ||
} | ||
this.options = parsedOptions.map(option => { | ||
return { name: option, value: option, selected: false }; | ||
}); | ||
console.log("options:", this.options); | ||
if (parsedOptions) { | ||
this.options = parsedOptions.map(option => { | ||
return { name: option, value: option, selected: false }; | ||
}); | ||
} else { | ||
this.options = []; | ||
} | ||
@@ -90,3 +103,2 @@ container.className = "filter-box"; | ||
// appending the container to the shadow DOM | ||
this.appendChild(container); | ||
@@ -112,5 +124,5 @@ | ||
if (event.target.checked) { | ||
li.className += " checked"; | ||
li.className = (li.className.replace("checked", "") + " checked").trim(); | ||
} else { | ||
li.className = li.className.replace("checked", ""); | ||
li.className = li.className.replace("checked", "").trim(); | ||
} | ||
@@ -123,2 +135,4 @@ }, false); | ||
*/ | ||
const event = new Event('change', {}); | ||
this.dispatchEvent(event); | ||
} | ||
@@ -125,0 +139,0 @@ |
{ | ||
"name": "@code.gov/code-gov-style", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "Style for code.gov including buttons, banners, and cards. Inspired by and somewhat based on USWDS.", | ||
@@ -31,4 +31,4 @@ "main": "index.js", | ||
"@code.gov/code-gov-font": "0.6.0", | ||
"prismjs": "^1.14.0" | ||
"prismjs": "^1.15.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
475318
1052
Updatedprismjs@^1.15.0