Skip to content

Commit c5053ee

Browse files
Scheduler — Replace underscore-prefixed: m_tooltip_strategy_base.ts (#32981)
1 parent 5ee9e58 commit c5053ee

File tree

7 files changed

+294
-261
lines changed

7 files changed

+294
-261
lines changed

packages/devextreme/js/__internal/scheduler/tooltip_strategies/m_desktop_tooltip_strategy.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,49 +8,49 @@ const APPOINTMENT_TOOLTIP_WRAPPER_CLASS = 'dx-scheduler-appointment-tooltip-wrap
88
const MAX_TOOLTIP_HEIGHT = 200;
99

1010
export class DesktopTooltipStrategy extends TooltipStrategyBase {
11-
_prepareBeforeVisibleChanged(dataList) {
12-
this._tooltip.option('position', {
11+
protected override prepareBeforeVisibleChanged(dataList) {
12+
this.tooltip.option('position', {
1313
my: 'bottom',
1414
at: 'top',
15-
boundary: this._getBoundary(dataList),
16-
offset: this._extraOptions.offset,
15+
boundary: this.getBoundary(dataList),
16+
offset: this.extraOptions.offset,
1717
collision: 'fit flipfit',
1818
});
1919
}
2020

21-
_getBoundary(dataList) {
21+
private getBoundary(dataList) {
2222
return this._options.isAppointmentInAllDayPanel(dataList[0].appointment) ? this._options.container : this._options.getScrollableContainer();
2323
}
2424

25-
_onShown() {
26-
super._onShown();
27-
if (this._extraOptions.isButtonClick) {
28-
this._list.focus();
29-
this._list.option('focusedElement', null);
25+
protected override onShown() {
26+
super.onShown();
27+
if (this.extraOptions.isButtonClick) {
28+
this.list.focus();
29+
this.list.option('focusedElement', null);
3030
}
3131
}
3232

3333
// @ts-expect-error
34-
_createListOption(target, dataList) {
34+
protected override createListOption(target, dataList) {
3535
// @ts-expect-error
36-
const result: any = super._createListOption(target, dataList);
36+
const result: any = super.createListOption(target, dataList);
3737
// T724287 this condition is not covered by tests, because touch variable cannot be overridden.
3838
// In the future, it is necessary to cover the tests
3939
result.showScrollbar = supportUtils.touch ? 'always' : 'onHover';
4040
return result;
4141
}
4242

43-
_createTooltip(target, dataList) {
44-
const tooltipElement = this._createTooltipElement(APPOINTMENT_TOOLTIP_WRAPPER_CLASS);
43+
protected override createTooltip(target, dataList) {
44+
const tooltipElement = this.createTooltipElement(APPOINTMENT_TOOLTIP_WRAPPER_CLASS);
4545

4646
const tooltip = this._options.createComponent(tooltipElement, Tooltip, {
4747
target,
4848
maxHeight: MAX_TOOLTIP_HEIGHT,
49-
rtlEnabled: this._extraOptions.rtlEnabled,
50-
onShown: this._onShown.bind(this),
51-
contentTemplate: this._getContentTemplate(dataList),
49+
rtlEnabled: this.extraOptions.rtlEnabled,
50+
onShown: this.onShown.bind(this),
51+
contentTemplate: this.getContentTemplate(dataList),
5252
wrapperAttr: { class: APPOINTMENT_TOOLTIP_WRAPPER_CLASS },
53-
_loopFocus: this._extraOptions._loopFocus,
53+
_loopFocus: this.extraOptions._loopFocus,
5454
});
5555

5656
tooltip.setAria({
@@ -61,11 +61,11 @@ export class DesktopTooltipStrategy extends TooltipStrategyBase {
6161
return tooltip;
6262
}
6363

64-
_onListRender(e) {
65-
return this._extraOptions.dragBehavior && this._extraOptions.dragBehavior(e);
64+
protected override onListRender(e) {
65+
return this.extraOptions.dragBehavior && this.extraOptions.dragBehavior(e);
6666
}
6767

68-
_onListItemContextMenu(e) {
68+
protected override onListItemContextMenu(e) {
6969
const contextMenuEventArgs = this._options.createEventArgs(e);
7070
this._options.onItemContextMenu(contextMenuEventArgs);
7171
}

packages/devextreme/js/__internal/scheduler/tooltip_strategies/m_mobile_tooltip_strategy.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@ const createTabletDeviceConfig = (listHeight) => {
6464
};
6565

6666
export class MobileTooltipStrategy extends TooltipStrategyBase {
67-
_shouldUseTarget() {
67+
protected override shouldUseTarget() {
6868
return false;
6969
}
7070

7171
private setTooltipConfig(): void {
7272
const isTabletWidth = getWidth(getWindow()) > 700;
7373

74-
const listHeight = getOuterHeight(this._list.$element().find(CLASS.scrollableContent));
75-
this._tooltip.option(
74+
const listHeight = getOuterHeight(this.list.$element().find(CLASS.scrollableContent));
75+
this.tooltip.option(
7676
isTabletWidth
7777
? createTabletDeviceConfig(listHeight)
7878
: createPhoneDeviceConfig(listHeight),
7979
);
8080
}
8181

82-
private async _onShowing(): Promise<void> {
83-
this._tooltip.option('height', MAX_HEIGHT.DEFAULT);
82+
private async onShowing(): Promise<void> {
83+
this.tooltip.option('height', MAX_HEIGHT.DEFAULT);
8484
/*
8585
NOTE: there are two setTooltipConfig calls to reduce blinking of overlay.
8686
The first one sets initial sizes, the second updates them after rendering async templates
@@ -91,17 +91,17 @@ export class MobileTooltipStrategy extends TooltipStrategyBase {
9191
this.setTooltipConfig();
9292
}
9393

94-
_createTooltip(target, dataList) {
95-
const element = this._createTooltipElement(CLASS.slidePanel);
94+
protected override createTooltip(target, dataList) {
95+
const element = this.createTooltipElement(CLASS.slidePanel);
9696

9797
return this._options.createComponent(element, Overlay, {
9898
target: getWindow(),
9999
hideOnOutsideClick: true,
100100
animation: animationConfig,
101101

102-
onShowing: () => this._onShowing(),
103-
onShown: this._onShown.bind(this),
104-
contentTemplate: this._getContentTemplate(dataList),
102+
onShowing: () => this.onShowing(),
103+
onShown: this.onShown.bind(this),
104+
contentTemplate: this.getContentTemplate(dataList),
105105
wrapperAttr: { class: CLASS.slidePanel },
106106
});
107107
}

0 commit comments

Comments
 (0)