File tree Expand file tree Collapse file tree 3 files changed +67
-0
lines changed
Expand file tree Collapse file tree 3 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ import { LitElement , html , css } from 'lit' ;
3+ import Event from '../../core/event' ;
4+
5+ /**
6+ * NavBarElement
7+ */
8+ export class NavBarElement extends LitElement {
9+ static get properties ( ) {
10+ return {
11+ /**
12+ * Name of the button to use when firing the EVENT_CLICK event
13+ * @type {String }
14+ */
15+ name : { type : String } ,
16+
17+ /**
18+ * Whether the button is disabled
19+ * @type {Boolean }
20+ */
21+ disabled : { type : Boolean } ,
22+ } ;
23+ }
24+
25+ static get styles ( ) {
26+ return css `
27+ :host nav {
28+ position: relative;
29+ padding: var(--navbar-padding);
30+ background-color: var(--navbar-background-color);
31+ color: var(--navbar-color);
32+ display: flex;
33+ flex-flow: row wrap;
34+ justify-content: space-between;
35+ align-items: center;
36+ border-bottom: var(--navbar-border-bottom);
37+ }
38+ ` ;
39+ }
40+
41+ render ( ) {
42+ return html `
43+ < nav > < ul > < slot > </ slot > </ ul > </ nav >
44+ ` ;
45+ }
46+
47+ constructor ( ) {
48+ super ( ) ;
49+ // Default properties
50+ this . name = '' ;
51+ this . disabled = false ;
52+ }
53+
54+ onClick ( ) {
55+ this . dispatchEvent ( new CustomEvent (
56+ Event . EVENT_CLICK , { detail : this . name } ,
57+ ) ) ;
58+ }
59+ }
60+
61+ customElements . define ( 'wc-navbar' , NavBarElement ) ;
Original file line number Diff line number Diff line change 88 < link href ="./index.css " rel ="stylesheet ">
99</ head >
1010< body >
11+ < wc-navbar name ="navbar "> </ wc-navbar >
12+
13+
1114 < div class ="container ">
1215 < h1 > Button Group</ h1 >
1316 < wc-button-group >
@@ -32,5 +35,6 @@ <h1>Icon</h1>
3235 </ div >
3336
3437
38+
3539</ body >
3640</ html >
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import './component/button/ButtonElement';
66import './component/button/ButtonGroupElement' ;
77import './component/button/CloseButtonElement' ;
88import './component/icon/IconElement' ;
9+ import './component/nav/NavBarElement' ;
10+
911
1012// CSS
1113import './css/core.css' ;
You can’t perform that action at this time.
0 commit comments