@@ -8,7 +8,7 @@ import type { dxElementWrapper } from '@js/core/renderer';
88import $ from '@js/core/renderer' ;
99import type { DxEvent } from '@js/events' ;
1010import type { OptionChanged } from '@ts/core/widget/types' ;
11- import type { EditorProperties } from '@ts/ui/editor/editor' ;
11+ import type { EditorProperties , ValueChangedEvent } from '@ts/ui/editor/editor' ;
1212import Editor from '@ts/ui/editor/editor' ;
1313
1414const RADIO_BUTTON_CLASS = 'dx-radiobutton' ;
@@ -24,11 +24,10 @@ class RadioButton extends Editor {
2424
2525 _clickAction ?: ( event ?: Record < string , unknown > ) => void ;
2626
27- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
28- _supportedKeys ( ) : Record < string , ( e : KeyboardEvent ) => void | boolean > {
29- const click = function ( e ) {
27+ _supportedKeys ( ) : Record < string , ( e : KeyboardEvent ) => void > {
28+ const click = ( e : KeyboardEvent ) : void => {
3029 e . preventDefault ( ) ;
31- this . _clickAction ( { event : e } ) ;
30+ this . _clickAction ?. ( { event : e } ) ;
3231 } ;
3332 return {
3433 ...super . _supportedKeys ( ) ,
@@ -70,10 +69,12 @@ class RadioButton extends Editor {
7069 }
7170
7271 _initMarkup ( ) : void {
72+ const { value } = this . option ( ) ;
73+
7374 super . _initMarkup ( ) ;
7475
7576 this . _renderIcon ( ) ;
76- this . _renderCheckedState ( this . option ( ' value' ) ) ;
77+ this . _renderCheckedState ( value ) ;
7778 this . _renderClick ( ) ;
7879 this . setAria ( 'role' , 'radio' ) ;
7980 }
@@ -85,7 +86,7 @@ class RadioButton extends Editor {
8586 this . $element ( ) . append ( this . _$icon ) ;
8687 }
8788
88- _renderCheckedState ( checked ) : void {
89+ _renderCheckedState ( checked : boolean ) : void {
8990 this . $element ( )
9091 . toggleClass ( RADIO_BUTTON_CHECKED_CLASS , checked )
9192 . find ( `.${ RADIO_BUTTON_ICON_CLASS } ` )
@@ -94,10 +95,9 @@ class RadioButton extends Editor {
9495 }
9596
9697 _renderClick ( ) : void {
97- // @ts -expect-error ts-error
98- const eventName = addNamespace ( clickEventName , this . NAME ) ;
98+ const eventName = addNamespace ( clickEventName , this . NAME ?? '' ) ;
9999
100- this . _clickAction = this . _createAction ( ( args ) : void => {
100+ this . _clickAction = this . _createAction ( ( args : { event : ValueChangedEvent } ) : void => {
101101 this . _clickHandler ( args . event ) ;
102102 } ) ;
103103
@@ -107,7 +107,7 @@ class RadioButton extends Editor {
107107 } ) ;
108108 }
109109
110- _clickHandler ( e ) : void {
110+ _clickHandler ( e : ValueChangedEvent ) : void {
111111 this . _saveValueChangeEvent ( e ) ;
112112 this . option ( 'value' , true ) ;
113113 this . _saveValueChangeEvent ( undefined ) ;
0 commit comments