diff options
Diffstat (limited to 'web/components')
| -rw-r--r-- | web/components/app/index.ts | 13 | ||||
| -rw-r--r-- | web/components/grid/index.ts | 14 | ||||
| -rw-r--r-- | web/components/index.ts | 2 |
3 files changed, 29 insertions, 0 deletions
diff --git a/web/components/app/index.ts b/web/components/app/index.ts new file mode 100644 index 0000000..f4eaff1 --- /dev/null +++ b/web/components/app/index.ts @@ -0,0 +1,13 @@ +import ntvGrid from "../grid"; + +class NotiveAppElement extends HTMLElement { + connectedCallback() { + this.append( + ...window.notive.doc.grids.map((_grid) => { + return ntvGrid({ foo: "1" }); + }), + ); + } +} + +customElements.define("ntv-app", NotiveAppElement); diff --git a/web/components/grid/index.ts b/web/components/grid/index.ts new file mode 100644 index 0000000..7faf6b1 --- /dev/null +++ b/web/components/grid/index.ts @@ -0,0 +1,14 @@ +import h, { type CreateElement } from "../../html"; + +class NotiveGridElement extends HTMLElement { + foo: string; + + connectedCallback() { + this.appendChild(h.p("OK: " + this.foo)); + } +} + +customElements.define("ntv-grid", NotiveGridElement); + +export default ((...args: any[]): NotiveGridElement => + (h as any)["ntv-grid"](...args)) as CreateElement<NotiveGridElement>; diff --git a/web/components/index.ts b/web/components/index.ts new file mode 100644 index 0000000..8bc14e7 --- /dev/null +++ b/web/components/index.ts @@ -0,0 +1,2 @@ +import "./app"; +import "./grid"; |
