const { dom } = require("../js/misc"); const { View } = require("./view"); class CustomCheckbox extends View { constructor() { super(); const isChecked = this.hasAttribute("checked") && (this.getAttribute("checked").length == 0 || this.getAttribute("checked") === "true"); const label = this.hasAttribute("label") ? this.getAttribute("label") : ""; const abbr = this.hasAttribute("abbr") ? this.getAttribute("abbr") : ""; this.innerHTML = /*html*/ ` `; this.classList.add("customcheckbox"); this._checkbox = View.elements(this).checkbox; this._checkbox.addEventListener("change", (event) => { event.stopPropagation(); this.fireChangeEvent(); }); } get checkbox() { return this._checkbox; } get checked() { return this._checkbox.checked; } set checked(value) { this._checkbox.checked = value; } set label(value) { this.elements.label.innerText = value; } } customElements.define("custom-checkbox", CustomCheckbox);