File tree 1 file changed +41
-3
lines changed
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 {
51
51
get classes ( ) {
52
52
const classes = [ ] ;
53
53
if ( this . type ) {
54
- classes . push ( this . type ) ;
54
+ classes . push ( this . type . toLowerCase ( ) ) ;
55
55
}
56
56
if ( this . textTransform ) {
57
- classes . push ( `text-transform-${ this . textTransform } ` ) ;
57
+ classes . push ( `text-transform-${ this . textTransform . toLowerCase ( ) } ` ) ;
58
58
}
59
59
return classes ;
60
60
}
61
61
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 ( ) {
63
84
return html `
64
85
< button class =${ this . classes . join ( ' ' ) || nothing } ?disabled =${ this . disabled } > < slot > </ slot > </ button >
65
86
` ;
66
87
}
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
+ }
67
105
}
You can’t perform that action at this time.
0 commit comments