2022-05-05 12:19:06 +02:00
|
|
|
class CCPOutputWidgetController extends HTMLElement {
|
|
|
|
|
|
|
|
#output = null;
|
|
|
|
|
|
|
|
constructor(){
|
|
|
|
super()
|
2024-11-15 15:24:35 +01:00
|
|
|
this.#output = JSON.parse(base64DecodeUnicode(this.getAttribute("output")))
|
2022-05-05 12:19:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
connectedCallback(){
|
|
|
|
this.innerHTML = this.render()
|
|
|
|
}
|
|
|
|
|
|
|
|
get name(){
|
|
|
|
return this.#output.id
|
|
|
|
}
|
|
|
|
|
|
|
|
get enabled(){
|
|
|
|
return this.querySelector("input").checked
|
|
|
|
}
|
|
|
|
|
|
|
|
render(){
|
|
|
|
return `
|
|
|
|
<div class="col form-check">
|
2024-02-09 11:01:00 +01:00
|
|
|
<input class="form-check-input" type="checkbox" name="${this.#output.id}" alt="${this.#output.description}" title="${this.#output.description}" checked="checked"/>
|
2022-05-05 12:19:06 +02:00
|
|
|
<label class="form-check-label">${this.#output.title}</label>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
window.customElements.define('d4s-ccp-output', CCPOutputWidgetController);
|