@@ -20,40 +20,41 @@ const APPOINTMENT_TOOLTIP_TEMPLATE = 'appointmentTooltipTemplate';
2020export class TooltipStrategyBase {
2121 protected asyncTemplatePromises = new Set < Promise < void > > ( ) ;
2222
23- _tooltip : any ;
23+ protected tooltip : any ;
2424
25+ // TODO: make private once external usages in m_scheduler.ts are removed
2526 _options : any ;
2627
27- _extraOptions : any ;
28+ protected extraOptions : any ;
2829
29- _list : any ;
30+ protected list : any ;
3031
3132 constructor ( options ) {
32- this . _tooltip = null ;
33+ this . tooltip = null ;
3334 this . _options = options ;
34- this . _extraOptions = null ;
35+ this . extraOptions = null ;
3536 }
3637
3738 show ( target , dataList , extraOptions ) {
3839 if ( this . canShowTooltip ( dataList ) ) {
3940 this . hide ( ) ;
40- this . _extraOptions = extraOptions ;
41+ this . extraOptions = extraOptions ;
4142 this . showCore ( target , dataList ) ;
4243 }
4344 }
4445
4546 private showCore ( target , dataList ) {
4647 const describedByValue = isRenderer ( target ) && target . attr ( 'aria-describedby' ) as string ;
4748
48- if ( ! this . _tooltip ) {
49- this . _tooltip = this . createTooltip ( target , dataList ) ;
49+ if ( ! this . tooltip ) {
50+ this . tooltip = this . createTooltip ( target , dataList ) ;
5051 } else {
51- this . shouldUseTarget ( ) && this . _tooltip . option ( 'target' , target ) ;
52- this . _list . option ( 'dataSource' , dataList ) ;
52+ this . shouldUseTarget ( ) && this . tooltip . option ( 'target' , target ) ;
53+ this . list . option ( 'dataSource' , dataList ) ;
5354 }
5455
5556 this . prepareBeforeVisibleChanged ( dataList ) ;
56- this . _tooltip . option ( 'visible' , true ) ;
57+ this . tooltip . option ( 'visible' , true ) ;
5758
5859 describedByValue && target . attr ( 'aria-describedby' , describedByValue ) ;
5960 }
@@ -64,7 +65,7 @@ export class TooltipStrategyBase {
6465 }
6566
6667 private isDeletingAllowed ( appointment ) {
67- const { editing } = this . _extraOptions ;
68+ const { editing } = this . extraOptions ;
6869 const disabled = this . _options . getAppointmentDisabled ( appointment ) ;
6970 const isDeletingAllowed = editing === true || editing ?. allowDeleting === true ;
7071 return ! disabled && isDeletingAllowed ;
@@ -74,18 +75,18 @@ export class TooltipStrategyBase {
7475 return ( container ) => {
7576 const listElement = $ ( '<div>' ) ;
7677 $ ( container ) . append ( listElement ) ;
77- this . _list = this . createList ( listElement , dataList ) ;
78- this . _list . registerKeyHandler ?.( 'escape' , ( ) => {
78+ this . list = this . createList ( listElement , dataList ) ;
79+ this . list . registerKeyHandler ?.( 'escape' , ( ) => {
7980 this . hide ( ) ;
80- this . _tooltip . option ( 'target' ) . focus ( ) ;
81+ this . tooltip . option ( 'target' ) . focus ( ) ;
8182 } ) ;
82- this . _list . registerKeyHandler ?.( 'del' , ( ) => {
83- const { focusedElement } = this . _list . option ( ) ;
83+ this . list . registerKeyHandler ?.( 'del' , ( ) => {
84+ const { focusedElement } = this . list . option ( ) ;
8485 if ( ! focusedElement ) {
8586 return ;
8687 }
8788
88- const { appointment, targetedAppointment } = this . _list . _getItemData ( focusedElement ) ;
89+ const { appointment, targetedAppointment } = this . list . _getItemData ( focusedElement ) ;
8990 if ( ! appointment ) {
9091 return ;
9192 }
@@ -99,22 +100,22 @@ export class TooltipStrategyBase {
99100 }
100101
101102 isAlreadyShown ( target ) {
102- if ( this . _tooltip && this . _tooltip . option ( 'visible' ) ) {
103- return this . _tooltip . option ( 'target' ) [ 0 ] === target [ 0 ] ;
103+ if ( this . tooltip && this . tooltip . option ( 'visible' ) ) {
104+ return this . tooltip . option ( 'target' ) [ 0 ] === target [ 0 ] ;
104105 }
105106 return undefined ;
106107 }
107108
108109 protected onShown ( ) {
109- this . _list . option ( 'focusStateEnabled' , this . _extraOptions . focusStateEnabled ) ;
110+ this . list . option ( 'focusStateEnabled' , this . extraOptions . focusStateEnabled ) ;
110111 }
111112
112113 dispose ( ) {
113114 }
114115
115116 hide ( ) {
116- if ( this . _tooltip ) {
117- this . _tooltip . option ( 'visible' , false ) ;
117+ if ( this . tooltip ) {
118+ this . tooltip . option ( 'visible' , false ) ;
118119 }
119120 }
120121
@@ -171,7 +172,7 @@ export class TooltipStrategyBase {
171172 }
172173
173174 private createFunctionTemplate ( template , appointmentData , targetedAppointmentData , index ) {
174- const isButtonClicked = Boolean ( this . _extraOptions . isButtonClick ) ;
175+ const isButtonClicked = Boolean ( this . extraOptions . isButtonClick ) ;
175176
176177 // @ts -expect-error
177178 return new FunctionTemplate ( ( options ) => {
@@ -196,7 +197,7 @@ export class TooltipStrategyBase {
196197
197198 private onListItemClick ( e ) {
198199 this . hide ( ) ;
199- this . _extraOptions . clickEvent && this . _extraOptions . clickEvent ( e ) ;
200+ this . extraOptions . clickEvent && this . extraOptions . clickEvent ( e ) ;
200201 this . _options . showAppointmentPopup ( e . itemData . appointment , false , e . itemData . targetedAppointment ) ;
201202 }
202203
0 commit comments