Skip to content

Commit 6bf848e

Browse files
authored
Scheduler: get rid of the old adapters (DevExpress#30828)
1 parent 9b74576 commit 6bf848e

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Button from '@js/ui/button';
77

88
import { APPOINTMENT_SETTINGS_KEY, LIST_ITEM_CLASS, LIST_ITEM_DATA_KEY } from './constants';
99
import { createAppointmentAdapter } from './m_appointment_adapter';
10-
import { AppointmentTooltipInfo } from './m_data_structures';
10+
import type { AppointmentTooltipItem } from './types';
1111

1212
const APPOINTMENT_COLLECTOR_CLASS = 'dx-scheduler-appointment-collector';
1313
const COMPACT_APPOINTMENT_COLLECTOR_CLASS = `${APPOINTMENT_COLLECTOR_CLASS}-compact`;
@@ -57,7 +57,14 @@ export class CompactAppointmentsHelper {
5757
targetedAdapter.endDate = info.sourceAppointment.endDate;
5858
}
5959

60-
return new AppointmentTooltipInfo(appointment, targetedAdapter.source(), items.colors[index], items.settings[index]);
60+
const tooltipInfo: AppointmentTooltipItem = {
61+
appointment,
62+
targetedAppointment: targetedAdapter.source(),
63+
color: items.colors?.[index] ?? [],
64+
settings: items.settings?.[index] ?? [],
65+
};
66+
67+
return tooltipInfo;
6168
});
6269
}
6370

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

Lines changed: 0 additions & 10 deletions
This file was deleted.

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import { SchedulerHeader } from './header/m_header';
5757
import { createAppointmentAdapter } from './m_appointment_adapter';
5858
import AppointmentLayoutManager from './m_appointments_layout_manager';
5959
import { CompactAppointmentsHelper } from './m_compact_appointments_helper';
60-
import { AppointmentTooltipInfo } from './m_data_structures';
6160
import { hide as hideLoading, show as showLoading } from './m_loading';
6261
import { getRecurrenceProcessor } from './m_recurrence';
6362
import subscribes from './m_subscribes';
@@ -76,7 +75,8 @@ import { ResourceProcessor } from './resources/resource_processor';
7675
import { DesktopTooltipStrategy } from './tooltip_strategies/m_desktop_tooltip_strategy';
7776
import { MobileTooltipStrategy } from './tooltip_strategies/m_mobile_tooltip_strategy';
7877
import type {
79-
AppointmentDataItem, AppointmentViewModel, SafeAppointment, ViewType,
78+
AppointmentDataItem, AppointmentTooltipItem,
79+
AppointmentViewModel, SafeAppointment, ViewType,
8080
} from './types';
8181
import { AppointmentDataAccessor } from './utils/data_accessor/appointment_data_accessor';
8282
import SchedulerAgenda from './workspaces/m_agenda';
@@ -2415,7 +2415,12 @@ class Scheduler extends Widget<any> {
24152415
const getAppointmentColor = this.createGetAppointmentColor();
24162416
const deferredColor = getAppointmentColor(appointmentConfig);
24172417

2418-
const info = new AppointmentTooltipInfo(appointment, targetedAppointment, deferredColor);
2418+
const info: AppointmentTooltipItem = {
2419+
appointment,
2420+
targetedAppointment,
2421+
color: deferredColor,
2422+
settings: [],
2423+
};
24192424
this.showAppointmentTooltipCore(element, [info]);
24202425
}
24212426
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,10 @@ export interface ViewDataProviderType {
262262
getCellsBetween: (first: ViewCellData, last: ViewCellData) => ViewCellData[];
263263
viewType: ViewType;
264264
}
265+
266+
export interface AppointmentTooltipItem {
267+
appointment: Appointment;
268+
targetedAppointment?: Appointment;
269+
color?: string;
270+
settings: never[];
271+
}

0 commit comments

Comments
 (0)