Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import {
import { logger } from '@ts/core/utils/m_console';

import { getResourceManagerMock } from '../__mock__/resource_manager.mock';
import SchedulerTimelineDay from '../workspaces/m_timeline_day';
import SchedulerTimelineMonth from '../workspaces/m_timeline_month';
import SchedulerTimelineWeek from '../workspaces/m_timeline_week';
import SchedulerTimelineWorkWeek from '../workspaces/m_timeline_work_week';
import type SchedulerWorkSpace from '../workspaces/m_work_space';
import SchedulerWorkSpaceDay from '../workspaces/m_work_space_day';
import SchedulerWorkSpaceMonth from '../workspaces/m_work_space_month';
import SchedulerWorkSpaceWeek from '../workspaces/m_work_space_week';
import SchedulerWorkSpaceWorkWeek from '../workspaces/m_work_space_work_week';
import SchedulerTimelineDay from '../workspaces/timeline_day';
import SchedulerTimelineMonth from '../workspaces/timeline_month';
import SchedulerTimelineWeek from '../workspaces/timeline_week';
import SchedulerWorkSpaceDay from '../workspaces/work_space_day';
import SchedulerWorkSpaceMonth from '../workspaces/work_space_month';
import SchedulerWorkSpaceWeek from '../workspaces/work_space_week';
import { setupSchedulerTestEnvironment } from './__mock__/m_mock_scheduler';

jest.mock('@ts/core/m_devices', () => {
Expand Down
19 changes: 10 additions & 9 deletions packages/devextreme/js/__internal/scheduler/m_scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import type {
} from '@js/ui/scheduler';
import errors from '@js/ui/widget/ui.errors';
import { dateUtilsTs } from '@ts/core/utils/date';
import type { OptionChanged } from '@ts/core/widget/types';

import { createA11yStatusContainer } from './a11y_status/a11y_status_render';
import { getA11yStatusText } from './a11y_status/a11y_status_text';
Expand Down Expand Up @@ -79,21 +80,21 @@ import type { IFieldExpr } from './utils/index';
import { macroTaskArray } from './utils/index';
import { isAgendaWorkspaceComponent } from './utils/is_agenda_workpace_component';
import { VIEWS } from './utils/options/constants_view';
import type { NormalizedView } from './utils/options/types';
import type { NormalizedView, SafeSchedulerOptions } from './utils/options/types';
import { getAppointmentGroupValues, setAppointmentGroupValues } from './utils/resource_manager/appointment_groups_utils';
import { ResourceManager } from './utils/resource_manager/resource_manager';
import AppointmentLayoutManager from './view_model/appointments_layout_manager';
import { AppointmentDataSource } from './view_model/m_appointment_data_source';
import type { AppointmentViewModelPlain } from './view_model/types';
import SchedulerAgenda from './workspaces/m_agenda';
import SchedulerTimelineDay from './workspaces/m_timeline_day';
import SchedulerTimelineMonth from './workspaces/m_timeline_month';
import SchedulerTimelineWeek from './workspaces/m_timeline_week';
import SchedulerAgenda from './workspaces/agenda';
import SchedulerTimelineWorkWeek from './workspaces/m_timeline_work_week';
import SchedulerWorkSpaceDay from './workspaces/m_work_space_day';
import SchedulerWorkSpaceMonth from './workspaces/m_work_space_month';
import SchedulerWorkSpaceWeek from './workspaces/m_work_space_week';
import SchedulerWorkSpaceWorkWeek from './workspaces/m_work_space_work_week';
import SchedulerTimelineDay from './workspaces/timeline_day';
import SchedulerTimelineMonth from './workspaces/timeline_month';
import SchedulerTimelineWeek from './workspaces/timeline_week';
import SchedulerWorkSpaceDay from './workspaces/work_space_day';
import SchedulerWorkSpaceMonth from './workspaces/work_space_month';
import SchedulerWorkSpaceWeek from './workspaces/work_space_week';

const toMs = dateUtils.dateToMilliseconds;

Expand Down Expand Up @@ -268,7 +269,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return resolveCallbacks.promise();
}

_optionChanged(args) {
_optionChanged(args: OptionChanged<SafeSchedulerOptions>): void {
this.schedulerOptionChanged(args);

const { value, name } = args;
Expand Down
33 changes: 26 additions & 7 deletions packages/devextreme/js/__internal/scheduler/m_table_creator.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
import type { Orientation, template } from '@js/common';
import domAdapter from '@js/core/dom_adapter';
import { getPublicElement } from '@js/core/element';
import { data as elementData } from '@js/core/element_data';
import type { dxElementWrapper } from '@js/core/renderer';
import $ from '@js/core/renderer';
import { isFunction } from '@js/core/utils/type';

import type { ResourceLoader } from './utils/loader/resource_loader';
import type { GroupNode } from './utils/resource_manager/types';

const ROW_SELECTOR = 'tr';

export interface GroupCssClasses {
groupHeaderRowClass?: string;
groupRowClass?: string;
groupHeaderClass: string | ((index: number) => string);
groupHeaderContentClass?: string;
}

export interface GroupRows {
elements: dxElementWrapper | dxElementWrapper[];
cellTemplates: (() => dxElementWrapper)[];
}

class SchedulerTableCreator {
readonly VERTICAL = 'vertical';

Expand Down Expand Up @@ -129,16 +144,20 @@ class SchedulerTableCreator {
return templateCallbacks;
}

makeGroupedTable(type, groups, cssClasses, cellCount, cellTemplate, rowCount, groupByDate) {
let rows: any = [];

makeGroupedTable(
type: Orientation,
groups: ResourceLoader[],
cssClasses: GroupCssClasses,
cellCount: number,
cellTemplate: template | null | undefined,
rowCount: number,
groupByDate: boolean,
): GroupRows {
if (type === this.VERTICAL) {
rows = this.makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount);
} else {
rows = this.makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate);
return this.makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount);
}

return rows;
return this.makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate);
}

makeGroupedTableFromJSON(tree: GroupNode[], config?) {
Expand Down
Loading
Loading