File tree 4 files changed +9
-21
lines changed
components/hds/code-editor
4 files changed +9
-21
lines changed Original file line number Diff line number Diff line change 4
4
@isIconOnly ={{ true }}
5
5
@color =" secondary"
6
6
@size =" small"
7
- @icon ={{ this.icon }}
7
+ @icon ={{ this.state }}
8
8
@text =" Toggle full screen view"
9
9
{{ on " click" @onToggleFullScreen }}
10
10
/>
Original file line number Diff line number Diff line change @@ -20,28 +20,16 @@ export default class HdsCodeEditorFullScreenButton extends Component<HdsCodeEdit
20
20
return this . args . isFullScreen ? 'minimize' : 'maximize' ;
21
21
}
22
22
23
- get className ( ) {
23
+ get className ( ) : string {
24
24
const classes = [
25
25
'hds-code-editor__full-screen-button' ,
26
26
'hds-code-editor__button' ,
27
27
] ;
28
28
29
- const stateClass = {
30
- minimize : 'hds-code-editor__full-screen-button--minimize' ,
31
- maximize : 'hds-code-editor__full-screen-button--maximize' ,
32
- } [ this . state ] ;
29
+ const stateClass = `hds-code-editor__full-screen-button--${ this . state } ` ;
33
30
34
31
classes . push ( stateClass ) ;
35
32
36
33
return classes . join ( ' ' ) ;
37
34
}
38
-
39
- get icon ( ) : HdsButtonSignature [ 'Args' ] [ 'icon' ] {
40
- const stateIcons = {
41
- minimize : 'minimize' ,
42
- maximize : 'maximize' ,
43
- } as const ;
44
-
45
- return stateIcons [ this . state ] ;
46
- }
47
35
}
Original file line number Diff line number Diff line change @@ -87,9 +87,9 @@ export default class HdsCodeEditor extends Component<HdsCodeEditorSignature> {
87
87
}
88
88
89
89
@action
90
- onInput ( newVal : string ) : void {
91
- this . _value = newVal ;
92
- this . args . onInput ?.( newVal ) ;
90
+ onInput ( newValue : string ) : void {
91
+ this . _value = newValue ;
92
+ this . args . onInput ?.( newValue ) ;
93
93
}
94
94
95
95
@action
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export interface HdsCodeEditorSignature {
31
31
} ;
32
32
}
33
33
34
- async function defineStreamLangugage ( streamParser : StreamParser < unknown > ) {
34
+ async function defineStreamLanguage ( streamParser : StreamParser < unknown > ) {
35
35
const { StreamLanguage } = await import ( '@codemirror/language' ) ;
36
36
37
37
return StreamLanguage . define ( streamParser ) ;
@@ -46,13 +46,13 @@ const LANGUAGES: Record<
46
46
ruby : {
47
47
load : async ( ) => {
48
48
const { ruby } = await import ( '@codemirror/legacy-modes/mode/ruby' ) ;
49
- return defineStreamLangugage ( ruby ) ;
49
+ return defineStreamLanguage ( ruby ) ;
50
50
} ,
51
51
} ,
52
52
shell : {
53
53
load : async ( ) => {
54
54
const { shell } = await import ( '@codemirror/legacy-modes/mode/shell' ) ;
55
- return defineStreamLangugage ( shell ) ;
55
+ return defineStreamLanguage ( shell ) ;
56
56
} ,
57
57
} ,
58
58
go : {
You can’t perform that action at this time.
0 commit comments