File tree Expand file tree Collapse file tree 7 files changed +16
-20
lines changed Expand file tree Collapse file tree 7 files changed +16
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ export const HTML = `
2+ <link rel="stylesheet" href="__css__" />
3+ <slot></slot>
4+ ` . 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 "./menu-group.html.js" ;
23
34class MenuGroup extends HTMLElement {
45 static name = Object . freeze ( "menu-group" ) ;
56
67 constructor ( ) {
78 super ( ) ;
89 this . attachShadow ( { mode : "open" } ) ;
9- this . style . display = "none" ;
10+ this . shadowRoot . innerHTML = HTML ;
1011 }
1112
1213 async connectedCallback ( ) {
13- this . shadowRoot . innerHTML = await ComponentModule . load_html ( {
14- url : import . meta. url ,
15- } ) ;
16-
1714 await this . #addChevron( ) ;
18- this . style . display = "flex" ;
1915 }
2016
2117 #addChevron( ) {
Original file line number Diff line number Diff line change 22 - - menu- item- hover- bg: var(--selected-background-color );
33 - - menu- item- hover- fg: var(- - selected- color );
44
5+ dis play: flex;
6+ flex- direction: row;
57 padding: var(- - padding);
68 cursor : pointer;
79 width: fit- content;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ export const HTML = `
2+ <link rel="stylesheet" href="__css__" />
3+ <slot name="prefix"></slot>
4+ <slot></slot>
5+ <slot name="suffix"></slot>
6+ ` . replace ( "__css__" , import . meta. url . replace ( ".html.js" , ".css" ) ) ;
Original file line number Diff line number Diff line change 1- import { ComponentModule } from "../../../src/modules/component .js" ;
1+ import { HTML } from "./menu-item.html .js" ;
22
33class MenuItem extends HTMLElement {
44 static name = Object . freeze ( "menu-item" ) ;
55
66 constructor ( ) {
77 super ( ) ;
88 this . attachShadow ( { mode : "open" } ) ;
9- this . style . display = "none" ;
10- }
11-
12- async connectedCallback ( ) {
13- this . shadowRoot . innerHTML = await ComponentModule . load_html ( {
14- url : import . meta. url ,
15- } ) ;
16-
17- this . style . display = "flex" ;
9+ this . shadowRoot . innerHTML = HTML ;
1810 }
1911}
2012
You can’t perform that action at this time.
0 commit comments