Skip to content

Commit f97a584

Browse files
Scheduler - Replace underscore-prefixed: m_appointment.ts + m_tooltip_strategy_base.ts
1 parent 272bcb3 commit f97a584

6 files changed

Lines changed: 86 additions & 86 deletions

File tree

packages/devextreme/js/__internal/scheduler/appointments/appointment/agenda_appointment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class AgendaAppointment extends Appointment {
1111
return this.$element().find(`.${APPOINTMENT_CONTENT_CLASSES.AGENDA_MARKER}`);
1212
}
1313

14-
_renderResourceList(): void {
14+
private renderResourceList(): void {
1515
const resourceManager = this.option('getResourceManager')();
1616

1717
// eslint-disable-next-line no-void
@@ -42,6 +42,6 @@ export class AgendaAppointment extends Appointment {
4242

4343
_render(): void {
4444
super._render();
45-
this._renderResourceList();
45+
this.renderResourceList();
4646
}
4747
}

packages/devextreme/js/__internal/scheduler/appointments/appointment/m_appointment.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
111111
this._invalidate();
112112
break;
113113
case 'isDragSource':
114-
this._renderDragSourceClass();
114+
this.renderDragSourceClass();
115115
break;
116116
default:
117117
// @ts-expect-error
118118
super._optionChanged(args);
119119
}
120120
}
121121

122-
_getHorizontalResizingRule() {
122+
private getHorizontalResizingRule() {
123123
const reducedHandles = {
124124
head: this.option('rtlEnabled') ? 'right' : 'left',
125125
body: '',
@@ -137,7 +137,7 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
137137
};
138138
}
139139

140-
_getVerticalResizingRule() {
140+
private getVerticalResizingRule() {
141141
const height = Math.round(this.invoke('getCellHeight'));
142142

143143
return {
@@ -153,24 +153,24 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
153153
// @ts-expect-error
154154
super._render();
155155

156-
this._renderAppointmentGeometry();
157-
this._renderAriaLabel();
158-
this._renderEmptyClass();
159-
this._renderReducedAppointment();
160-
this._renderAllDayClass();
161-
this._renderDragSourceClass();
162-
this._renderDirection();
156+
this.renderAppointmentGeometry();
157+
this.renderAriaLabel();
158+
this.renderEmptyClass();
159+
this.renderReducedAppointment();
160+
this.renderAllDayClass();
161+
this.renderDragSourceClass();
162+
this.renderDirection();
163163

164164
this.$element().data('dxAppointmentStartDate', this.option('startDate'));
165165
this.$element().attr('role', 'button');
166166

167-
this._renderRecurrenceClass();
168-
this._renderResizable();
167+
this.renderRecurrenceClass();
168+
this.renderResizable();
169169

170-
this._setResourceColor();
170+
this.setResourceColor();
171171
}
172172

173-
_setResourceColor() {
173+
private setResourceColor() {
174174
const appointmentConfig = {
175175
itemData: this.rawAppointment,
176176
groupIndex: this.option('groupIndex') ?? 0,
@@ -186,7 +186,7 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
186186
});
187187
}
188188

189-
_renderAriaLabel(): void {
189+
private renderAriaLabel(): void {
190190
const $element: dxElementWrapper = this.$element();
191191
$element.attr('aria-label', getAriaLabel(this.option()));
192192

@@ -205,7 +205,7 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
205205
});
206206
}
207207

208-
_renderAppointmentGeometry(): void {
208+
private renderAppointmentGeometry(): void {
209209
const geometry: any = this.option('geometry');
210210
const $element: any = this.$element();
211211
move($element, {
@@ -219,15 +219,15 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
219219
});
220220
}
221221

222-
_renderEmptyClass() {
222+
private renderEmptyClass() {
223223
const geometry: any = this.option('geometry');
224224

225225
if (geometry.empty || this.option('isCompact')) {
226226
(this.$element() as any).addClass(EMPTY_APPOINTMENT_CLASS);
227227
}
228228
}
229229

230-
_renderReducedAppointment() {
230+
private renderReducedAppointment() {
231231
const reducedPart: any = this.option('reduced');
232232

233233
if (!reducedPart) {
@@ -238,10 +238,10 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
238238
.toggleClass(REDUCED_APPOINTMENT_CLASS, true)
239239
.toggleClass(REDUCED_APPOINTMENT_PARTS_CLASSES[reducedPart], true);
240240

241-
this._renderAppointmentReducedIcon();
241+
this.renderAppointmentReducedIcon();
242242
}
243243

244-
_renderAppointmentReducedIcon() {
244+
private renderAppointmentReducedIcon() {
245245
const $icon = $('<div>')
246246
.addClass(REDUCED_APPOINTMENT_ICON)
247247
.appendTo(this.$element());
@@ -259,28 +259,28 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
259259
});
260260
}
261261

262-
_renderAllDayClass() {
262+
private renderAllDayClass() {
263263
(this.$element() as any).toggleClass(ALL_DAY_APPOINTMENT_CLASS, Boolean(this.option('allDay')));
264264
}
265265

266-
_renderDragSourceClass() {
266+
private renderDragSourceClass() {
267267
(this.$element() as any).toggleClass(APPOINTMENT_DRAG_SOURCE_CLASS, Boolean(this.option('isDragSource')));
268268
}
269269

270-
_renderRecurrenceClass() {
270+
private renderRecurrenceClass() {
271271
const rule = this.dataAccessors.get('recurrenceRule', this.rawAppointment);
272272

273273
if (validateRRule(rule)) {
274274
(this.$element() as any).addClass(RECURRENCE_APPOINTMENT_CLASS);
275275
}
276276
}
277277

278-
_renderDirection() {
278+
private renderDirection() {
279279
(this.$element() as any).addClass(DIRECTION_APPOINTMENT_CLASSES[this.option('direction') as any]);
280280
}
281281

282-
_createResizingConfig() {
283-
const config: any = this.option('direction') === 'vertical' ? this._getVerticalResizingRule() : this._getHorizontalResizingRule();
282+
private createResizingConfig() {
283+
const config: any = this.option('direction') === 'vertical' ? this.getVerticalResizingRule() : this.getHorizontalResizingRule();
284284

285285
if (!this.invoke('isGroupedByDate')) {
286286
config.stepPrecision = 'strict';
@@ -289,14 +289,14 @@ export class Appointment extends DOMComponent<AppointmentProperties> {
289289
return config;
290290
}
291291

292-
_renderResizable() {
292+
private renderResizable() {
293293
if (this.option('allowResize')) {
294294
// @ts-expect-error
295295
this._createComponent(
296296
this.$element(),
297297
Resizable,
298298
extend(
299-
this._createResizingConfig(),
299+
this.createResizingConfig(),
300300
this.option('resizableConfig'),
301301
),
302302
);

packages/devextreme/js/__internal/scheduler/m_scheduler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
400400
break;
401401
case 'onAppointmentContextMenu':
402402
this._appointments.option('onItemContextMenu', this._createActionByOption(name));
403-
this.appointmentTooltip._options.onItemContextMenu = this._createActionByOption(name);
403+
this.appointmentTooltip.options.onItemContextMenu = this._createActionByOption(name);
404404
break;
405405
case 'noDataText':
406406
case 'allowMultipleCellSelection':

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ const MAX_TOOLTIP_HEIGHT = 200;
99

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

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

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

@@ -43,14 +43,14 @@ export class DesktopTooltipStrategy extends TooltipStrategyBase {
4343
protected override createTooltip(target, dataList) {
4444
const tooltipElement = this.createTooltipElement(APPOINTMENT_TOOLTIP_WRAPPER_CLASS);
4545

46-
const tooltip = this._options.createComponent(tooltipElement, Tooltip, {
46+
const tooltip = this.options.createComponent(tooltipElement, Tooltip, {
4747
target,
4848
maxHeight: MAX_TOOLTIP_HEIGHT,
49-
rtlEnabled: this._extraOptions.rtlEnabled,
49+
rtlEnabled: this.extraOptions.rtlEnabled,
5050
onShown: this.onShown.bind(this),
5151
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({
@@ -62,11 +62,11 @@ export class DesktopTooltipStrategy extends TooltipStrategyBase {
6262
}
6363

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

6868
protected override onListItemContextMenu(e) {
69-
const contextMenuEventArgs = this._options.createEventArgs(e);
70-
this._options.onItemContextMenu(contextMenuEventArgs);
69+
const contextMenuEventArgs = this.options.createEventArgs(e);
70+
this.options.onItemContextMenu(contextMenuEventArgs);
7171
}
7272
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,16 @@ export class MobileTooltipStrategy extends TooltipStrategyBase {
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 onShowingHandler(): 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
@@ -94,12 +94,12 @@ export class MobileTooltipStrategy extends TooltipStrategyBase {
9494
protected override createTooltip(target, dataList) {
9595
const element = this.createTooltipElement(CLASS.slidePanel);
9696

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

102-
onShowing: () => this._onShowing(),
102+
onShowing: () => this.onShowingHandler(),
103103
onShown: this.onShown.bind(this),
104104
contentTemplate: this.getContentTemplate(dataList),
105105
wrapperAttr: { class: CLASS.slidePanel },

0 commit comments

Comments
 (0)