', SchedulerCalendar, {
+ this.calendar = this._createComponent('
', SchedulerCalendar, {
value: currentDate,
min,
max,
@@ -232,17 +232,17 @@ export class SchedulerHeader extends Widget {
tabIndex,
onValueChanged: async (e) => {
this._updateCurrentDate(e.value);
- await this._calendar?.hide();
+ await this.calendar?.hide();
},
});
- this._calendar.$element().appendTo(this.$element());
+ this.calendar.$element().appendTo(this.$element());
}
private _getCalendarOptionUpdater(name: string) {
return (value: unknown): void => {
- if (this._calendar) {
- this._calendar.option(name, value);
+ if (this.calendar) {
+ this.calendar.option(name, value);
}
};
}
@@ -290,7 +290,7 @@ export class SchedulerHeader extends Widget {
}
public async _showCalendar(e: ItemClickEvent): Promise {
- await this._calendar?.show(e.element);
+ await this.calendar?.show(e.element);
}
}
diff --git a/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts b/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts
index 4214cf6750ec..126eb6f6baec 100644
--- a/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts
+++ b/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts
@@ -26,8 +26,8 @@ export class CompactAppointmentsHelper {
render(options: CompactAppointmentOptions): dxElementWrapper {
const { isCompact, items } = options;
- const template = this._createTemplate(items.length, isCompact);
- const button = this._createCompactButton(template, options);
+ const template = this.createTemplate(items.length, isCompact);
+ const button = this.createCompactButton(template, options);
const $button = button.$element();
this.elements.push($button);
@@ -44,33 +44,33 @@ export class CompactAppointmentsHelper {
this.elements = [];
}
- _onButtonClick(e, options: CompactAppointmentOptions) {
+ private onButtonClick(e, options: CompactAppointmentOptions) {
const $button = $(e.element);
this.instance.showAppointmentTooltipCore(
$button,
// @ts-expect-error
$button.data('items'),
- this._getExtraOptionsForTooltip(options, $button),
+ this.getExtraOptionsForTooltip(options, $button),
);
}
- _getExtraOptionsForTooltip(options: CompactAppointmentOptions, $appointmentCollector) {
+ private getExtraOptionsForTooltip(options: CompactAppointmentOptions, $appointmentCollector) {
return {
- clickEvent: this._clickEvent(options.onAppointmentClick).bind(this),
- dragBehavior: options.allowDrag && this._createTooltipDragBehavior($appointmentCollector).bind(this),
+ clickEvent: this.clickEvent(options.onAppointmentClick).bind(this),
+ dragBehavior: options.allowDrag && this.createTooltipDragBehavior($appointmentCollector).bind(this),
isButtonClick: true,
_loopFocus: true,
};
}
- _clickEvent(onAppointmentClick) {
+ private clickEvent(onAppointmentClick) {
return (e) => {
const clickEventArgs = this.instance._createEventArgs(e);
onAppointmentClick(clickEventArgs);
};
}
- _createTooltipDragBehavior($appointmentCollector) {
+ private createTooltipDragBehavior($appointmentCollector) {
return (e) => {
const $element = $(e.element);
const $schedulerElement = $(this.instance.element());
@@ -92,23 +92,23 @@ export class CompactAppointmentsHelper {
};
}
- _setPosition(element, position) {
+ private setPosition(element, position) {
move(element, {
top: position.top,
left: position.left,
});
}
- _createCompactButton(template, options: CompactAppointmentOptions) {
- const $button = this._createCompactButtonElement(options);
+ private createCompactButton(template, options: CompactAppointmentOptions) {
+ const $button = this.createCompactButtonElement(options);
// @ts-expect-error
return this.instance._createComponent($button, Button, {
type: 'default',
width: options.width,
height: options.height,
- onClick: (e) => this._onButtonClick(e, options),
- template: this._renderTemplate(template, options.items, options.isCompact),
+ onClick: (e) => this.onButtonClick(e, options),
+ template: this.renderTemplate(template, options.items, options.isCompact),
});
}
@@ -131,10 +131,10 @@ export class CompactAppointmentsHelper {
return geometry;
}
- _createCompactButtonElement({
+ private createCompactButtonElement({
isCompact, $container, coordinates, sortedIndex, items,
}: CompactAppointmentOptions) {
- const appointmentDate = this._getDateText(
+ const appointmentDate = this.getDateText(
items[0].appointment,
items[0].targetedAppointment,
);
@@ -146,12 +146,12 @@ export class CompactAppointmentsHelper {
result.data(APPOINTMENT_SETTINGS_KEY, { sortedIndex });
- this._setPosition(result, coordinates);
+ this.setPosition(result, coordinates);
return result;
}
- _renderTemplate(template, items: AppointmentTooltipItem[], isCompact) {
+ private renderTemplate(template, items: AppointmentTooltipItem[], isCompact) {
return new (FunctionTemplate as any)((options) => template.render({
model: {
appointmentCount: items.length,
@@ -162,18 +162,18 @@ export class CompactAppointmentsHelper {
}));
}
- _createTemplate(count, isCompact) {
- this._initButtonTemplate(count, isCompact);
+ private createTemplate(count, isCompact) {
+ this.initButtonTemplate(count, isCompact);
return this.instance.getAppointmentTemplate('appointmentCollectorTemplate');
}
- _initButtonTemplate(count, isCompact) {
+ private initButtonTemplate(count, isCompact) {
this.instance._templateManager.addDefaultTemplates({
- appointmentCollector: new (FunctionTemplate as any)((options) => this._createButtonTemplate(count, $(options.container), isCompact)),
+ appointmentCollector: new (FunctionTemplate as any)((options) => this.createButtonTemplate(count, $(options.container), isCompact)),
});
}
- _createButtonTemplate(appointmentCount, element, isCompact) {
+ private createButtonTemplate(appointmentCount, element, isCompact) {
const text = isCompact
? appointmentCount
: (messageLocalization.getFormatter('dxScheduler-moreAppointments') as any)(appointmentCount);
@@ -183,19 +183,19 @@ export class CompactAppointmentsHelper {
.addClass(APPOINTMENT_COLLECTOR_CONTENT_CLASS);
}
- _localizeDate(date) {
+ private localizeDate(date) {
return `${dateLocalization.format(date, 'monthAndDay')}, ${dateLocalization.format(date, 'year')}`;
}
- _getDateText(
+ private getDateText(
appointment: Appointment,
targetedAppointment: Appointment | TargetedAppointment | undefined,
): string {
const startDate = targetedAppointment?.displayStartDate ?? appointment.startDate;
const endDate = targetedAppointment?.displayEndDate ?? appointment.endDate;
- const startDateText = this._localizeDate(startDate);
- const endDateText = this._localizeDate(endDate);
+ const startDateText = this.localizeDate(startDate);
+ const endDateText = this.localizeDate(endDate);
return startDateText === endDateText
? startDateText
diff --git a/packages/devextreme/js/__internal/scheduler/m_table_creator.ts b/packages/devextreme/js/__internal/scheduler/m_table_creator.ts
index 9af94f69319a..766e45e5bee2 100644
--- a/packages/devextreme/js/__internal/scheduler/m_table_creator.ts
+++ b/packages/devextreme/js/__internal/scheduler/m_table_creator.ts
@@ -133,9 +133,9 @@ class SchedulerTableCreator {
let rows: any = [];
if (type === this.VERTICAL) {
- rows = this._makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount);
+ rows = this.makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount);
} else {
- rows = this._makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate);
+ rows = this.makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate);
}
return rows;
@@ -244,7 +244,7 @@ class SchedulerTableCreator {
return table;
}
- _makeFlexGroupedRowCells(group, repeatCount, cssClasses, cellTemplate, repeatByDate = 1) {
+ private makeFlexGroupedRowCells(group, repeatCount, cssClasses, cellTemplate, repeatByDate = 1) {
const cells: any[] = [];
const { items } = group;
const itemCount = items.length;
@@ -283,7 +283,7 @@ class SchedulerTableCreator {
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
- _makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount?: any) {
+ private makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount?: any) {
const cellTemplates: any = [];
let repeatCount = 1;
const cellsArray: any = [];
@@ -300,7 +300,7 @@ class SchedulerTableCreator {
repeatCount = groups[i - 1].items.length * repeatCount;
}
- const cells = this._makeFlexGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate);
+ const cells = this.makeFlexGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate);
cells.forEach(cellIterator);
cellsArray.push(cells);
}
@@ -325,7 +325,7 @@ class SchedulerTableCreator {
};
}
- _makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate) {
+ private makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate) {
let repeatCount = 1;
const groupCount = groups.length;
const rows: any = [];
@@ -346,7 +346,7 @@ class SchedulerTableCreator {
repeatCount = groups[i - 1].items.length * repeatCount;
}
- const cells: any = this._makeGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate, repeatByDate);
+ const cells: any = this.makeGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate, repeatByDate);
rows.push(
$('')
@@ -375,7 +375,7 @@ class SchedulerTableCreator {
};
}
- _makeGroupedRowCells(group, repeatCount, cssClasses, cellTemplate, repeatByDate) {
+ private makeGroupedRowCells(group, repeatCount, cssClasses, cellTemplate, repeatByDate) {
repeatByDate = repeatByDate || 1;
repeatCount *= repeatByDate;
diff --git a/packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts b/packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts
index af4ee4029f5b..ff11cdf6b0f2 100644
--- a/packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts
+++ b/packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts
@@ -26,7 +26,7 @@ export class AppointmentDataSource {
return Boolean(this.dataSource);
}
- _getStoreKey(target) {
+ private getStoreKey(target) {
const store = this.dataSource.store();
return store.keyOf(target);
@@ -36,10 +36,10 @@ export class AppointmentDataSource {
this.dataSource = dataSource;
this.cleanState();
- this._initStoreChangeHandlers();
+ this.initStoreChangeHandlers();
}
- _initStoreChangeHandlers() {
+ private initStoreChangeHandlers() {
const { dataSource } = this;
const store = dataSource?.store();
@@ -97,7 +97,7 @@ export class AppointmentDataSource {
}
update(target, data) {
- const key = this._getStoreKey(target);
+ const key = this.getStoreKey(target);
// @ts-expect-error
const d = new Deferred();
@@ -111,7 +111,7 @@ export class AppointmentDataSource {
}
remove(rawAppointment) {
- const key = this._getStoreKey(rawAppointment);
+ const key = this.getStoreKey(rawAppointment);
return this.dataSource.store().remove(key).done(() => this.dataSource.load());
}
diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/legacyAppointmentPopup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/legacyAppointmentPopup.tests.js
index 83dc3d7fc41d..fd570f89c2d2 100644
--- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/legacyAppointmentPopup.tests.js
+++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/legacyAppointmentPopup.tests.js
@@ -446,7 +446,7 @@ QUnit.module('Appointment popup form', moduleConfig, () => {
const deferred = scheduler.appointmentPopup.saveAppointmentData();
- assert.notOk(scheduler.appointmentPopup.getInstance()._tryLockSaveChanges(), 'Save changes already locked');
+ assert.notOk(scheduler.appointmentPopup.getInstance().tryLockSaveChanges(), 'Save changes already locked');
assert.ok(scheduler.appointmentPopup.hasLoadPanel(), 'has load panel');