1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-29 07:00:16 +02:00

Refact docs and examples (linting) (#22)

This commit is contained in:
2024-12-13 15:04:52 +01:00
committed by GitHub
parent b50f8449aa
commit eef4e8dfa6
58 changed files with 1851 additions and 1593 deletions

View File

@@ -12,7 +12,7 @@ export class CustomHTMLTestElement extends HTMLElement{
}
connectedCallback(){
if(!this.hasAttribute("pre-name")) this.setAttribute("pre-name", "default");
customElementRender(this, this.attachShadow({ mode: "open" }), this.render, this.attributes)
customElementRender(this.attachShadow({ mode: "open" }), this.render, this.attributes)
}
attributes(element){
@@ -22,7 +22,7 @@ export class CustomHTMLTestElement extends HTMLElement{
render({ name, preName, test }){
console.log(scope.state);
scope.host(
on.connected(()=> console.log(CustomHTMLTestElement)),
on.connected(console.log),
on.attributeChanged(e=> console.log(e)),
on.disconnected(()=> console.log(CustomHTMLTestElement))
);
@@ -34,11 +34,13 @@ export class CustomHTMLTestElement extends HTMLElement{
text(test),
text(name),
text(preName),
el("button", { type: "button", textContent: "pre-name", onclick: ()=> preName("Ahoj") })
el("button", { type: "button", textContent: "pre-name", onclick: ()=> preName("Ahoj") }),
" | ",
el("slot", { className: "test", name: "test" }),
);
}
test= "A";
get name(){ return this.getAttribute("name"); }
set name(value){ this.setAttribute("name", value); }
/** @attr pre-name */
@@ -61,7 +63,7 @@ export class CustomSlottingHTMLElement extends HTMLElement{
));
}
connectedCallback(){
customElementRender(this, this, this.render);
customElementRender(this, this.render);
}
}
customElementWithDDE(CustomSlottingHTMLElement);