File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { NgDial } from './dial';
99import { NgImage } from './image' ;
1010import { NgLineEdit } from './line-edit' ;
1111import { NgPlainTextEdit } from './pline-text-edit' ;
12+ import { NgRadioButton } from './radiobutton' ;
1213
1314export type Constructable < T > = new ( ) => T ;
1415export type NgComponentClass = Constructable < NgComponent > ;
@@ -30,5 +31,6 @@ export class ComponentsMap {
3031 this . map . set ( NgImage . nodeName , NgImage ) ;
3132 this . map . set ( NgLineEdit . nodeName , NgLineEdit ) ;
3233 this . map . set ( NgPlainTextEdit . nodeName , NgPlainTextEdit ) ;
34+ this . map . set ( NgRadioButton . nodeName , NgRadioButton ) ;
3335 }
3436}
Original file line number Diff line number Diff line change 1+ import { QRadioButton } from '@nodegui/nodegui' ;
2+ import { NgComponent } from './component' ;
3+ import { RendererStyleFlags2 } from '@angular/core' ;
4+
5+ export class NgRadioButton extends QRadioButton implements NgComponent {
6+ public static nodeName = 'radiobutton' ;
7+ public parent : any ;
8+
9+ public appendChild ( newChild : any ) : void {
10+ console . warn ( 'radiobutton do not have append child' ) ;
11+ }
12+
13+ public insertBefore ( newChild : any , refChild : any ) { }
14+
15+ public setNgAttribute (
16+ name : string ,
17+ value : string ,
18+ namespace ?: string | null
19+ ) : void { }
20+
21+ public setProperty ( name : string , value : boolean | string ) : void {
22+ switch ( name ) {
23+ case 'text' :
24+ this . setText ( value as string ) ;
25+ break ;
26+ case 'enabled' :
27+ this . setEnabled ( value as boolean ) ;
28+ break ;
29+ default :
30+ break ;
31+ }
32+ }
33+
34+ public setStyle (
35+ style : string ,
36+ value : any ,
37+ flags ?: RendererStyleFlags2
38+ ) : void {
39+ this . setInlineStyle ( `${ style } :${ value } ` ) ;
40+ }
41+
42+ public setValue ( value : string ) : void {
43+ this . setText ( value ) ;
44+ }
45+
46+ removeAttribute ( name : string , namespace ?: string ) : void {
47+ throw new Error ( 'Method not implemented.' ) ;
48+ }
49+ removeChild ( oldChild : any ) : void {
50+ throw new Error ( 'Method not implemented.' ) ;
51+ }
52+ removeClass ( name : string ) : void {
53+ throw new Error ( 'Method not implemented.' ) ;
54+ }
55+ removeStyle ( style : string , flags ?: RendererStyleFlags2 ) : void {
56+ throw new Error ( 'Method not implemented.' ) ;
57+ }
58+ }
You can’t perform that action at this time.
0 commit comments