File tree Expand file tree Collapse file tree 1 file changed +41
-3
lines changed Expand file tree Collapse file tree 1 file changed +41
-3
lines changed Original file line number Diff line number Diff line change @@ -51,17 +51,55 @@ export class ButtonElement extends LitElement {
5151 get classes ( ) {
5252 const classes = [ ] ;
5353 if ( this . type ) {
54- classes . push ( this . type ) ;
54+ classes . push ( this . type . toLowerCase ( ) ) ;
5555 }
5656 if ( this . textTransform ) {
57- classes . push ( `text-transform-${ this . textTransform } ` ) ;
57+ classes . push ( `text-transform-${ this . textTransform . toLowerCase ( ) } ` ) ;
5858 }
5959 return classes ;
6060 }
6161
62- render ( ) {
62+ get controlButtonIcon ( ) {
63+ switch ( this . type . toLowerCase ( ) ) {
64+ case 'close' :
65+ return 'x-square' ;
66+ case 'help' :
67+ return 'question-square' ;
68+ case 'maximise' :
69+ return 'fullscreen' ;
70+ case 'minimise' :
71+ return 'fullscreen-exit' ;
72+ default :
73+ return '' ;
74+ }
75+ }
76+
77+ renderButton ( ) {
78+ return html `
79+ < button class =${ this . classes . join ( ' ' ) || nothing } ?disabled =${ this . disabled } > < slot > </ slot > </ button >
80+ ` ;
81+ }
82+
83+ renderSubmit ( ) {
6384 return html `
6485 < button class =${ this . classes . join ( ' ' ) || nothing } ?disabled =${ this . disabled } > < slot > </ slot > </ button >
6586 ` ;
6687 }
88+
89+ renderControl ( ) {
90+ return html `
91+ < button class =${ this . classes . join ( ' ' ) || nothing } ?disabled =${ this . disabled } > < slot > </ slot > </ button >
92+ ` ;
93+ }
94+
95+ render ( ) {
96+ switch ( this . type . toLowerCase ( ) ) {
97+ case 'control' :
98+ return this . renderControl ( ) ;
99+ case 'submit' :
100+ return this . renderSubmit ( ) ;
101+ default :
102+ return this . renderButton ( ) ;
103+ }
104+ }
67105}
You can’t perform that action at this time.
0 commit comments