File tree Expand file tree Collapse file tree 6 files changed +24
-25
lines changed Expand file tree Collapse file tree 6 files changed +24
-25
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+
2+ export const HTML = `
3+ <link rel="stylesheet" href="__css__" />
4+ <material-icon></material-icon>
5+ ` . replace ( "__css__" , import . meta. url . replace ( ".html.js" , ".css" ) ) ;
Original file line number Diff line number Diff line change 11import { ComponentModule } from "../../src/modules/component.js" ;
2+ import { HTML } from "./activity-state.html.js" ;
23
34class ActivityState extends HTMLElement {
45 static name = Object . freeze ( "activity-state" ) ;
@@ -8,20 +9,13 @@ class ActivityState extends HTMLElement {
89 constructor ( ) {
910 super ( ) ;
1011 this . attachShadow ( { mode : "open" } ) ;
11- this . style . display = "none" ;
12+ this . shadowRoot . innerHTML = HTML ;
1213 }
1314
1415 async connectedCallback ( ) {
15- this . shadowRoot . innerHTML = await ComponentModule . load_html ( {
16- url : import . meta. url ,
17- } ) ;
18-
19- requestAnimationFrame ( ( ) => {
20- if ( this . #state) {
21- this . setState ( this . #state) ;
22- }
23- this . style . display = "block" ;
24- } ) ;
16+ if ( this . #state) {
17+ this . setState ( this . #state) ;
18+ }
2519 }
2620
2721 setState ( state ) {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+
2+ export const HTML = `
3+ <link rel="stylesheet" href="__css__">
4+ <slot name="prefix"></slot>
5+
6+ <button class="icon-button" data-action="home">
7+ <material-icon icon="home"></material-icon>
8+ </button>
9+
10+ <slot></slot>
11+ <slot name="suffix"></slot>
12+ ` . replace ( "__css__" , import . meta. url . replace ( ".html.js" , ".css" ) ) ;
Original file line number Diff line number Diff line change 11import { ComponentModule } from "../../src/modules/component.js" ;
22import { EventsManager } from "../../src/system/events-manager.js" ;
3+ import { HTML } from "./app-header.html.js"
34
45class AppHeader extends HTMLElement {
56 static name = Object . freeze ( "app-header" ) ;
@@ -9,13 +10,10 @@ class AppHeader extends HTMLElement {
910 constructor ( ) {
1011 super ( ) ;
1112 this . attachShadow ( { mode : "open" } ) ;
13+ this . shadowRoot . innerHTML = HTML ;
1214 }
1315
1416 async connectedCallback ( ) {
15- this . shadowRoot . innerHTML = await ComponentModule . load_html ( {
16- url : import . meta. url ,
17- } ) ;
18-
1917 this . #eventsManager. addPointerEvent ( this , "click" , this . #click. bind ( this ) ) ;
2018 }
2119
You can’t perform that action at this time.
0 commit comments