@@ -31,6 +31,10 @@ export const FOCUSED_STATE_CLASS = 'dx-state-focused';
3131export const HOVER_STATE_CLASS = 'dx-state-hover' ;
3232const INVISIBLE_STATE_CLASS = 'dx-state-invisible' ;
3333
34+ export const EMPTY_ACTIVE_STATE_UNIT = '' ;
35+ const DEFAULT_FEEDBACK_HIDE_TIMEOUT = 400 ;
36+ const DEFAULT_FEEDBACK_SHOW_TIMEOUT = 30 ;
37+
3438export type SupportedKeyHandler = (
3539 e : DxEvent < KeyboardEvent > ,
3640 options ?: KeyboardKeyDownEvent
@@ -70,12 +74,6 @@ export interface WidgetProperties<TComponent = any> extends WidgetOptions<TCompo
7074class Widget <
7175 TProperties extends WidgetProperties = WidgetProperties ,
7276> extends DOMComponent < Widget < TProperties > , TProperties > {
73- public _activeStateUnit ! : string ;
74-
75- public _feedbackHideTimeout = 400 ;
76-
77- private readonly _feedbackShowTimeout : number = 30 ;
78-
7977 _contentReadyAction ?: ( ( event ?: Record < string , unknown > ) => void ) | null ;
8078
8179 protected _keyboardListenerId ?: string | null ;
@@ -97,6 +95,18 @@ class Widget<
9795 return options ;
9896 }
9997
98+ protected _activeStateUnit ( ) : string {
99+ return EMPTY_ACTIVE_STATE_UNIT ;
100+ }
101+
102+ protected _feedbackHideTimeout ( ) : number {
103+ return DEFAULT_FEEDBACK_HIDE_TIMEOUT ;
104+ }
105+
106+ protected _feedbackShowTimeout ( ) : number {
107+ return DEFAULT_FEEDBACK_SHOW_TIMEOUT ;
108+ }
109+
100110 // eslint-disable-next-line @typescript-eslint/no-unused-vars
101111 _supportedKeys ( e ?: DxEvent < KeyboardEvent > ) : SupportedKeys {
102112 return { } ;
@@ -285,13 +295,13 @@ class Widget<
285295 }
286296
287297 _findActiveTarget ( $element : dxElementWrapper ) : dxElementWrapper {
288- return $element . find ( this . _activeStateUnit ) . not ( `.${ DISABLED_STATE_CLASS } ` ) ;
298+ return $element . find ( this . _activeStateUnit ( ) ) . not ( `.${ DISABLED_STATE_CLASS } ` ) ;
289299 }
290300
291301 _getActiveElement ( ) : dxElementWrapper {
292302 const activeElement = this . _eventBindingTarget ( ) ;
293303
294- if ( this . _activeStateUnit ) {
304+ if ( this . _activeStateUnit ( ) ) {
295305 return this . _findActiveTarget ( activeElement ) ;
296306 }
297307
@@ -434,7 +444,7 @@ class Widget<
434444
435445 _attachHoverEvents ( ) : void {
436446 const { hoverStateEnabled } = this . option ( ) ;
437- const selector = this . _activeStateUnit ;
447+ const selector = this . _activeStateUnit ( ) ;
438448 const namespace = 'UIFeedback' ;
439449 const $el = this . _eventBindingTarget ( ) ;
440450
@@ -453,7 +463,7 @@ class Widget<
453463
454464 _attachFeedbackEvents ( ) : void {
455465 const { activeStateEnabled } = this . option ( ) ;
456- const selector = this . _activeStateUnit ;
466+ const selector = this . _activeStateUnit ( ) ;
457467 const namespace = 'UIFeedback' ;
458468 const $el = this . _eventBindingTarget ( ) ;
459469
@@ -468,8 +478,8 @@ class Widget<
468478 { excludeValidators : [ 'disabled' , 'readOnly' ] } ,
469479 ) ,
470480 {
471- showTimeout : this . _feedbackShowTimeout ,
472- hideTimeout : this . _feedbackHideTimeout ,
481+ showTimeout : this . _feedbackShowTimeout ( ) ,
482+ hideTimeout : this . _feedbackHideTimeout ( ) ,
473483 selector,
474484 namespace,
475485 } ,
@@ -521,7 +531,7 @@ class Widget<
521531 }
522532
523533 _findHoverTarget ( $el ?: dxElementWrapper ) : dxElementWrapper | undefined {
524- return $el ?. closest ( this . _activeStateUnit || this . _eventBindingTarget ( ) ) ;
534+ return $el ?. closest ( this . _activeStateUnit ( ) || this . _eventBindingTarget ( ) ) ;
525535 }
526536
527537 _hover ( $el : dxElementWrapper | undefined , $previous : dxElementWrapper | undefined ) : void {
0 commit comments