2025-09-21 20:30:37 +02:00
|
|
|
class Akordeon extends HTMLElement {
|
|
|
|
|
constructor() {
|
|
|
|
|
super();
|
|
|
|
|
this._internals = this.attachInternals();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get collapsed() {
|
|
|
|
|
return this._internals.states.has("hidden");
|
|
|
|
|
}
|
2025-09-15 01:58:08 +02:00
|
|
|
|
2025-09-21 20:30:37 +02:00
|
|
|
set collapsed(flag) {
|
|
|
|
|
if (flag) {
|
|
|
|
|
// Existence of identifier corresponds to "true"
|
|
|
|
|
this._internals.states.add("hidden");
|
|
|
|
|
} else {
|
|
|
|
|
// Absence of identifier corresponds to "false"
|
|
|
|
|
this._internals.states.delete("hidden");
|
2025-09-15 01:58:08 +02:00
|
|
|
}
|
|
|
|
|
}
|
2025-09-21 20:30:37 +02:00
|
|
|
|
|
|
|
|
connecterCallback() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
attributeChangedCallback(atrybut, poprzednio, obecnie) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
customElements.define("akordeon", Akordeon);
|