import { IgniteElement } from './ignite-element.js'; import { IgniteTemplate, div, html, list, a, slot } from './ignite-template.js'; class Sheet extends IgniteElement { constructor() { super(); } get properties() { return { show: false, items: ["1", "2"], href: "www.google.com", name: "default content", color: "red", linkClick: this.onClick1, linkClick2: this.onClick2 }; } render() { return this.template .class(this.show) .child( new div( new html("

this is before

"), new list(this.items, (item) => { return new a(new html(`

${item}

`)).attribute("href", this.href) }), new html("

this is after

"), new html("

---- begin sheet's slot ----

"), new slot(this), new html("

---- end of slot ----

"), new a("I go nowhere, but you can click me ;)") .on("click", this.linkClick).on("click", this.linkClick2) .style("color", this.color, "important") ) ); } onClick1(event) { console.log("Element was clicked 1!"); } onClick2(event) { console.log("Element was clicked 2!"); } } class SheetTemplate extends IgniteTemplate { constructor(...items) { super(items); this.tagName = "md-sheet"; } } customElements.define("md-sheet", Sheet); export { SheetTemplate as Sheet };