diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index 0c9cf55c86b2..86c2fe0292fd 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -66,23 +66,6 @@ const schedulerR1Overrides = [ ]; const schedulerLegacyMembers = [ - // workspaces/m_work_space.ts - '_$allDayPanel', - '_$dateTable', - '_$dateTableScrollableContent', - '_$flexContainer', - '_$groupTable', - '_$headerPanel', - '_$headerPanelContainer', - '_$thead', - '_dateTableScrollable', - '_getCellCount', - '_getGroupCount', - '_groupedStrategy', - '_isHorizontalGroupedWorkSpace', - '_shader', - '_sidebarScrollable', - // m_scheduler.ts '_appointments', '_compactAppointmentsHelper', diff --git a/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts b/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts index 03c0cad2e4dc..5af4bb554e4e 100644 --- a/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts +++ b/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts @@ -217,7 +217,7 @@ describe('scheduler workspace skipped days support', () => { }); expect(workspace.getStartViewDate()).toEqual(new Date(2026, 2, 29)); - expect((workspace as any)._getCellCount()).toBe(7); + expect((workspace as any).getCellCount()).toBe(7); }); it('should use custom skippedDays in work week runtime layout', () => { @@ -228,7 +228,7 @@ describe('scheduler workspace skipped days support', () => { }); expect(workspace.getStartViewDate()).toEqual(new Date(2026, 2, 29)); - expect((workspace as any)._getCellCount()).toBe(6); + expect((workspace as any).getCellCount()).toBe(6); }); it('should skip configured hidden days when incrementing timeline header dates', () => { diff --git a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts index a4b0af7cb982..d3e320eb3a5e 100644 --- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts +++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts @@ -233,7 +233,7 @@ const subscribes = { }, getGroupCount() { - return this._workSpace._getGroupCount(); + return this._workSpace.getGroupCount(); }, // TODO: delete this method when old impl is removed diff --git a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader.ts index ea3d422754fa..ef569d2d2a90 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader.ts @@ -6,7 +6,7 @@ import type SchedulerWorkSpace from '../workspaces/m_work_space'; const DATE_TIME_SHADER_CLASS = 'dx-scheduler-date-time-shader'; class CurrentTimeShader { - protected $container = this.workSpace._dateTableScrollable.$content(); + protected $container = this.workSpace.getScrollable().$content(); protected shader!: dxElementWrapper[]; @@ -15,10 +15,10 @@ class CurrentTimeShader { constructor(protected workSpace: SchedulerWorkSpace) { } - render(): void { + render(isHorizontalGroupedWorkSpace: boolean, groupCount: number, cellCount: number): void { this.initShaderElements(); - this.renderShader(); + this.renderShader(isHorizontalGroupedWorkSpace, groupCount, cellCount); this.shader.forEach((shader) => { this.$container.append(shader); @@ -31,7 +31,8 @@ class CurrentTimeShader { this.shader.push(this.$shader); } - renderShader(): void {} + // eslint-disable-next-line @typescript-eslint/no-unused-vars + renderShader(isHorizontalGroupedWorkSpace: boolean, groupCount: number, cellCount: number):void {} createShader(): dxElementWrapper { return $('
').addClass(DATE_TIME_SHADER_CLASS); diff --git a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts index 5538b06e8fdf..5c6673fe92cd 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts @@ -5,19 +5,17 @@ import { setWidth } from '@js/core/utils/size'; import CurrentTimeShader from './current_time_shader'; class HorizontalCurrentTimeShader extends CurrentTimeShader { - renderShader(): void { - const groupCount = this.workSpace._isHorizontalGroupedWorkSpace() - ? this.workSpace._getGroupCount() - : 1; + renderShader(isHorizontalGroupedWorkSpace: boolean, groupCount: number, cellCount: number): void { + const effectiveGroupCount = isHorizontalGroupedWorkSpace ? groupCount : 1; - for (let i = 0; i < groupCount; i += 1) { + for (let i = 0; i < effectiveGroupCount; i += 1) { const isFirstShader = i === 0; const $shader = isFirstShader ? this.$shader : this.createShader(); if (this.workSpace.isGroupedByDate()) { - this.customizeGroupedByDateShader($shader, i); + this.customizeGroupedByDateShader($shader, i, groupCount, cellCount); } else { - this.customizeShader($shader, i); + this.customizeShader($shader, i, cellCount); } if (!isFirstShader) { @@ -26,7 +24,11 @@ class HorizontalCurrentTimeShader extends CurrentTimeShader { } } - private customizeShader($shader: dxElementWrapper, groupIndex: number): void { + private customizeShader( + $shader: dxElementWrapper, + groupIndex: number, + dateTableCellCount: number, + ): void { // @ts-expect-error const shaderWidth = this.workSpace.getIndicationWidth() as number; @@ -34,7 +36,7 @@ class HorizontalCurrentTimeShader extends CurrentTimeShader { if (groupIndex >= 1) { const { workSpace } = this; - const indicationWidth = workSpace._getCellCount() * workSpace.getCellWidth(); + const indicationWidth = dateTableCellCount * workSpace.getCellWidth(); $shader.css('left', indicationWidth); } else { $shader.css('left', 0); @@ -48,11 +50,16 @@ class HorizontalCurrentTimeShader extends CurrentTimeShader { } } - private customizeGroupedByDateShader($shader: dxElementWrapper, groupIndex: number): void { + private customizeGroupedByDateShader( + $shader: dxElementWrapper, + groupIndex: number, + shaderGroupCount: number, + dateTableCellCount: number, + ): void { // @ts-expect-error - const cellCount = this.workSpace.getIndicationCellCount() as number; - const integerPart = Math.floor(cellCount); - const fractionPart = cellCount - integerPart; + const indicationCellCount = this.workSpace.getIndicationCellCount() as number; + const integerPart = Math.floor(indicationCellCount); + const fractionPart = indicationCellCount - integerPart; const isFirstShaderPart = groupIndex === 0; const { workSpace } = this; const shaderWidth = isFirstShaderPart @@ -64,9 +71,9 @@ class HorizontalCurrentTimeShader extends CurrentTimeShader { this.applyShaderWidth($shader, shaderWidth); if (isFirstShaderPart) { - shaderLeft = workSpace._getCellCount() * workSpace.getCellWidth() * groupIndex; + shaderLeft = dateTableCellCount * workSpace.getCellWidth() * groupIndex; } else { - shaderLeft = workSpace.getCellWidth() * integerPart * workSpace._getGroupCount() + shaderLeft = workSpace.getCellWidth() * integerPart * shaderGroupCount + groupIndex * workSpace.getCellWidth(); } diff --git a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts index fc28586921b6..1487e4e8e3c8 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts @@ -4,6 +4,9 @@ import { setHeight, setWidth } from '@js/core/utils/size'; import CurrentTimeShader from './current_time_shader'; const DATE_TIME_SHADER_ALL_DAY_CLASS = 'dx-scheduler-date-time-shader-all-day'; + +const ALL_DAY_PANEL_CLASS = 'dx-scheduler-all-day-panel'; + const DATE_TIME_SHADER_TOP_CLASS = 'dx-scheduler-date-time-shader-top'; const DATE_TIME_SHADER_BOTTOM_CLASS = 'dx-scheduler-date-time-shader-bottom'; @@ -14,7 +17,8 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { private $allDayIndicator!: dxElementWrapper; - renderShader(): void { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + renderShader(isHorizontalGroupedWorkSpace: boolean, groupCount: number, cellCount: number): void { let shaderHeight = this.getShaderHeight(); const maxHeight = this.getShaderMaxHeight(); const isSolidShader = shaderHeight > maxHeight; @@ -24,7 +28,6 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { } setHeight(this.$shader, shaderHeight); - const groupCount = this.workSpace._getGroupCount() || 1; if (this.workSpace.isGroupedByDate()) { this.renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader); @@ -125,7 +128,10 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { setWidth(this.$allDayIndicator, shaderWidth); this.$allDayIndicator.css('left', this.getShaderOffset(i, shaderWidth)); - this.workSpace._$allDayPanel.prepend(this.$allDayIndicator); + const $allDayPanel = this.workSpace.$element().find(`.${ALL_DAY_PANEL_CLASS}`); + if ($allDayPanel.length) { + $allDayPanel.first().prepend(this.$allDayIndicator); + } } } @@ -152,9 +158,7 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { clean(): void { super.clean(); - if (this.workSpace?._$allDayPanel) { - this.workSpace._$allDayPanel.find(`.${DATE_TIME_SHADER_ALL_DAY_CLASS}`).remove(); - } + this.workSpace?.$element().find(`.${DATE_TIME_SHADER_ALL_DAY_CLASS}`).remove(); } } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 969eeda71374..1e7ae4094529 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -86,14 +86,14 @@ class SchedulerAgenda extends WorkSpace { break; case 'groups': if (!value?.length) { - if (this._$groupTable) { - this._$groupTable.remove(); - this._$groupTable = null; + if (this.$groupTable) { + this.$groupTable.remove(); + this.$groupTable = null; this.detachGroupCountClass(); } - } else if (!this._$groupTable) { + } else if (!this.$groupTable) { this.initGroupTable(); - this._dateTableScrollable.$content().prepend(this._$groupTable); + this.$dateTableScrollable.$content().prepend(this.$groupTable); } super._optionChanged(args); break; @@ -124,7 +124,7 @@ class SchedulerAgenda extends WorkSpace { return this.option('agendaDuration') as number; } - _getCellCount() { + getCellCount() { return 1; } @@ -139,15 +139,15 @@ class SchedulerAgenda extends WorkSpace { protected override initWorkSpaceUnits() { this.initGroupTable(); this.$timePanel = $('').attr('aria-hidden', true).addClass(TIME_PANEL_CLASS); - this._$dateTable = $('
').attr('aria-hidden', true).addClass(DATE_TABLE_CLASS); - this._$dateTableScrollableContent = $('
').addClass('dx-scheduler-date-table-scrollable-content'); + this.$dateTable = $('
').attr('aria-hidden', true).addClass(DATE_TABLE_CLASS); + this.$dateTableScrollableContent = $('
').addClass('dx-scheduler-date-table-scrollable-content'); this.$dateTableContainer = $('
').addClass('dx-scheduler-date-table-container'); } private initGroupTable() { const groups = this.option('groups'); if (groups?.length) { - this._$groupTable = $('
').attr('aria-hidden', true).addClass(GROUP_TABLE_CLASS); + this.$groupTable = $('
').attr('aria-hidden', true).addClass(GROUP_TABLE_CLASS); } } @@ -169,7 +169,7 @@ class SchedulerAgenda extends WorkSpace { } this.rows = rows; - if (this._$groupTable) { + if (this.$groupTable) { cellTemplates = this.renderGroupHeader(); this.setGroupHeaderCellsHeight(); } @@ -177,14 +177,14 @@ class SchedulerAgenda extends WorkSpace { this.renderTimePanel(); this.renderDateTable(); this.applyCellTemplates(cellTemplates); - this._dateTableScrollable.update(); + this.$dateTableScrollable.update(); } private renderNoData() { this.$noDataContainer = $('
').addClass(NODATA_CONTAINER_CLASS) .html(this.option('noDataText') as any); - this._dateTableScrollable.$content().append(this.$noDataContainer); + this.$dateTableScrollable.$content().append(this.$noDataContainer); } protected override setTableSizes() { return noop(); } @@ -246,7 +246,7 @@ class SchedulerAgenda extends WorkSpace { } protected override getGroupHeaderContainer() { - return this._$groupTable; + return this.$groupTable; } protected override makeGroupRows() { @@ -306,11 +306,11 @@ class SchedulerAgenda extends WorkSpace { } protected override cleanView() { - this._$dateTable.empty(); + this.$dateTable.empty(); this.$timePanel.empty(); - if (this._$groupTable) { - this._$groupTable.empty(); + if (this.$groupTable) { + this.$groupTable.empty(); } if (this.$noDataContainer) { @@ -326,20 +326,20 @@ class SchedulerAgenda extends WorkSpace { } protected override createWorkSpaceStaticElements() { - this.$dateTableContainer.append(this._$dateTable); - this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); + this.$dateTableContainer.append(this.$dateTable); + this.$dateTableScrollable.$content().append(this.$dateTableScrollableContent); - if (this._$groupTable) { - this._$dateTableScrollableContent.prepend(this._$groupTable); + if (this.$groupTable) { + this.$dateTableScrollableContent.prepend(this.$groupTable); } - this._$dateTableScrollableContent.append(this.$timePanel, this.$dateTableContainer); - this.$element().append(this._dateTableScrollable.$element()); + this.$dateTableScrollableContent.append(this.$timePanel, this.$dateTableContainer); + this.$element().append(this.$dateTableScrollable.$element()); } protected override renderDateTable() { this.renderTableBody({ - container: getPublicElement(this._$dateTable), + container: getPublicElement(this.$dateTable), rowClass: DATE_TABLE_ROW_CLASS, cellClass: this.getDateTableCellClass(), }); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 137fed043942..307884cfc2e2 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -50,7 +50,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } protected override getTotalRowCount(groupCount) { - if (this._isHorizontalGroupedWorkSpace()) { + if (this.isHorizontalGroupedWorkSpace()) { return this.getRowCount(); } groupCount = groupCount || 1; @@ -63,7 +63,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { private getWorkSpaceHeight() { if (this.option('crossScrollingEnabled') && hasWindow()) { - return getBoundingRect(this._$dateTable.get(0)).height; + return getBoundingRect(this.$dateTable.get(0)).height; } return getBoundingRect((this.$element() as any).get(0)).height; @@ -95,8 +95,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { } protected override getGroupHeaderContainer() { - if (this._isHorizontalGroupedWorkSpace()) { - return this._$thead; + if (this.isHorizontalGroupedWorkSpace()) { + return this.$thead; } return this.$sidebarTable; } @@ -171,7 +171,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { const integerPart = Math.floor(cellCount); const fractionPart = cellCount - integerPart; - return this.getCellWidth() * (integerPart * this._getGroupCount() + fractionPart); + return this.getCellWidth() * (integerPart * this.getGroupCount() + fractionPart); } return this.getIndicationCellCount() * this.getCellWidth(); } @@ -189,7 +189,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { const minHeight = this.getWorkSpaceMinHeight(); setHeight(this.$sidebarTable, minHeight); - setHeight(this._$dateTable, minHeight); + setHeight(this.$dateTable, minHeight); this.virtualScrollingDispatcher.updateDimensions(); } @@ -197,7 +197,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { private getWorkSpaceMinHeight() { let minHeight = this.getWorkSpaceHeight(); - const workspaceContainerHeight = getOuterHeight(this._$flexContainer, true); + const workspaceContainerHeight = getOuterHeight(this.$flexContainer, true); if (minHeight < workspaceContainerHeight) { minHeight = workspaceContainerHeight; @@ -208,15 +208,15 @@ class SchedulerTimeline extends SchedulerWorkSpace { protected override getCellCoordinatesByIndex(index) { return { - columnIndex: index % this._getCellCount(), + columnIndex: index % this.getCellCount(), rowIndex: 0, }; } protected override getCellElementByPosition(cellCoordinates, groupIndex) { - const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex); + const indexes = this.groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex); - return this._$dateTable + return this.$dateTable .find('tr') .eq(indexes.rowIndex) .find('td') @@ -224,7 +224,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } protected override getWorkSpaceWidth() { - return getOuterWidth(this._$dateTable, true); + return getOuterWidth(this.$dateTable, true); } private getIndicationFirstViewDate() { @@ -329,7 +329,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } protected override toggleGroupingDirectionClass() { - (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this._isHorizontalGroupedWorkSpace()); + (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this.isHorizontalGroupedWorkSpace()); } _getDefaultOptions() { @@ -360,9 +360,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { this.virtualScrollingDispatcher.updateDimensions(); } - this._shader = new HorizontalShader(this); + this.shader = new HorizontalShader(this); - this.$sidebarTable.appendTo(this._sidebarScrollable.$content()); + this.$sidebarTable.appendTo(this.$sidebarScrollable.$content()); if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); @@ -381,7 +381,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } getCurrentTimePanelCellIndices() { - const columnCountPerGroup = this._getCellCount(); + const columnCountPerGroup = this.getCellCount(); const today = this.getToday(); const index = this.getCellIndexByDate(today); const { columnIndex: currentTimeColumnIndex } = this.getCellCoordinatesByIndex(index); @@ -390,8 +390,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { return []; } - const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() - ? this._getGroupCount() + const horizontalGroupCount = this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() + ? this.getGroupCount() : 1; return [...new Array(horizontalGroupCount)] @@ -415,14 +415,14 @@ class SchedulerTimeline extends SchedulerWorkSpace { let currentDate = new Date(firstViewDate); const $cells: any[] = []; - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); const cellCountInDay = this.getCellCountInDay(); const colSpan = this.isGroupedByDate() ? cellCountInDay * groupCount : cellCountInDay; const cellTemplate: any = this.option('dateCellTemplate'); - const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() + const horizontalGroupCount = this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() ? groupCount : 1; const cellsInGroup = this.viewDataProvider.viewDataGenerator.daysInInterval * (this.option('intervalCount') as any); @@ -478,7 +478,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { $indicator.css('left', rtlOffset ? rtlOffset - width : width); } else { for (let i = 0; i < groupCount; i++) { - const offset = this.isGroupedByDate() ? i * this.getCellWidth() : this._getCellCount() * this.getCellWidth() * i; + const offset = this.isGroupedByDate() ? i * this.getCellWidth() : this.getCellCount() * this.getCellWidth() * i; $indicator = this.createIndicator($container); setHeight($indicator, getBoundingRect($container.get(0)).height); @@ -499,9 +499,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { groupHeaderClass: this.getGroupHeaderClass.bind(this), groupHeaderContentClass: GROUP_HEADER_CONTENT_CLASS, }, - this._getCellCount() || 1, + this.getCellCount() || 1, this.option('resourceCellTemplate'), - this.getTotalRowCount(this._getGroupCount()), + this.getTotalRowCount(this.getGroupCount()), groupByDate, ); } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts index 17d913039329..4b14657fce59 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -217,8 +217,7 @@ class SchedulerWorkSpace extends Widget { private cellsSelectionControllerValue: any; - // TODO: make private once external usages in shaders, grouped strategies, m_agenda.ts are removed - _dateTableScrollable!: Scrollable; + protected $dateTableScrollable!: Scrollable; private selectionChangedAction: any; @@ -236,25 +235,21 @@ class SchedulerWorkSpace extends Widget { protected getToday?(): Date; - // TODO: make private once external usages in current_time_shader_vertical.ts are removed - _$allDayPanel: any; + protected $allDayPanel: any; private $allDayTitle: any; private $headerPanelEmptyCell: any; - // TODO: make private once external usages in m_timeline.ts, m_work_space_indicator.ts are removed - _groupedStrategy: any; + protected groupedStrategy: any; public virtualScrollingDispatcher: any; private scrollSync: any; - // TODO: make private once external usages in m_work_space_grouped_strategy_vertical.ts are removed - _$headerPanel: any; + private $headerPanel: any; - // TODO: make private once external usages in m_timeline.ts, m_agenda.ts, m_work_space_month.ts are removed - _$dateTable: any; + protected $dateTable: any; private $allDayTable: any; @@ -272,16 +267,13 @@ class SchedulerWorkSpace extends Widget { private contextMenuAction: any; - // TODO: make private once external usages in m_agenda.ts are removed - _$groupTable: any; + protected $groupTable: any; - // TODO: make private once external usages in m_timeline.ts are removed - _$thead: any; + protected $thead: any; private headerScrollable: any; - // TODO: make private once external usages in m_timeline.ts are removed - _sidebarScrollable: any; + protected $sidebarScrollable: any; private preventDefaultDragging: any; @@ -293,8 +285,7 @@ class SchedulerWorkSpace extends Widget { positionHelper!: PositionHelper; - // TODO: make private once external usages in m_work_space_grouped_strategy_vertical.ts are removed - _$headerPanelContainer: any; + protected $headerPanelContainer: any; private $headerTablesContainer: any; @@ -302,8 +293,7 @@ class SchedulerWorkSpace extends Widget { private $allDayContainer: any; - // TODO: make private once external usages in m_agenda.ts are removed - _$dateTableScrollableContent: any; + protected $dateTableScrollableContent: any; private $sidebarScrollableContent: any; @@ -313,11 +303,9 @@ class SchedulerWorkSpace extends Widget { private allDayPanels!: any[]; - // TODO: make private once external usages in m_timeline.ts are removed - _$flexContainer: any; + protected $flexContainer: any; - // TODO: make private once external usages in shaders, m_timeline.ts, m_work_space_indicator.ts are removed - _shader: any; + protected shader: any; protected $sidebarTable: any; @@ -374,7 +362,7 @@ class SchedulerWorkSpace extends Widget { const validSelectedCells = selectedCellsOption.map((selectedCell) => { const { groups } = selectedCell; - if (!groups || this._getGroupCount() === 0) { + if (!groups || this.getGroupCount() === 0) { return { ...selectedCell, groupIndex: 0, @@ -467,9 +455,9 @@ class SchedulerWorkSpace extends Widget { const isMultiSelection = e.shiftKey; const isMultiSelectionAllowed = this.option('allowMultipleCellSelection'); const isRTL = this.isRTL(); - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); const isGroupedByDate = this.isGroupedByDate(); - const isHorizontalGrouping = this._isHorizontalGroupedWorkSpace(); + const isHorizontalGrouping = this.isHorizontalGroupedWorkSpace(); const focusedCellPosition = this.viewDataProvider.findCellPositionInMap({ ...focusedCellData, isAllDay: focusedCellData.allDay, @@ -571,7 +559,7 @@ class SchedulerWorkSpace extends Widget { this.setSelectedCellsStateAndUpdateSelection(isNextCellAllDay, nextCellPosition, isMultiSelection, $cell); - this._dateTableScrollable.scrollToElement($cell); + this.$dateTableScrollable.scrollToElement($cell); } } @@ -656,13 +644,12 @@ class SchedulerWorkSpace extends Widget { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'vertical'; } - // TODO: make private once external usages in shaders, m_timeline.ts are removed - _isHorizontalGroupedWorkSpace() { + protected isHorizontalGroupedWorkSpace() { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'horizontal'; } protected isWorkSpaceWithCount() { - return this.option('intervalCount') as any > 1; + return this.option('intervalCount') > 1; } private isWorkspaceWithOddCells() { @@ -676,7 +663,7 @@ class SchedulerWorkSpace extends Widget { } createRAllDayPanelElements() { - this._$allDayPanel = $('
').addClass(ALL_DAY_PANEL_CLASS); + this.$allDayPanel = $('
').addClass(ALL_DAY_PANEL_CLASS); this.$allDayTitle = $('
').appendTo(this.$headerPanelEmptyCell); } @@ -686,7 +673,7 @@ class SchedulerWorkSpace extends Widget { bounceEnabled: false, updateManually: true, onScroll: () => { - this._groupedStrategy.cache?.clear(); + this.groupedStrategy.cache?.clear(); }, // TODO (Scrollable:useKeyboard) -> remove this WA // after ScrollView private option "useKeyboard" will be extended to useNative: true @@ -782,7 +769,7 @@ class SchedulerWorkSpace extends Widget { const minWidth = this.getWorkSpaceMinWidth(); - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); const totalCellCount = this.getTotalCellCount(groupCount); let width = cellWidth * totalCellCount; @@ -791,8 +778,8 @@ class SchedulerWorkSpace extends Widget { width = minWidth; } - setWidth(this._$headerPanel, width); - setWidth(this._$dateTable, width); + setWidth(this.$headerPanel, width); + setWidth(this.$dateTable, width); if (this.$allDayTable) { setWidth(this.$allDayTable, width); } @@ -805,7 +792,7 @@ class SchedulerWorkSpace extends Widget { } getWorkSpaceMinWidth() { - return this._groupedStrategy.getWorkSpaceMinWidth(); + return this.groupedStrategy.getWorkSpaceMinWidth(); } _dimensionChanged() { @@ -843,8 +830,7 @@ class SchedulerWorkSpace extends Widget { }); } - // TODO: make private once external usages in grouped strategies, shaders, m_timeline.ts are removed - _getCellCount() { + protected getCellCount() { return this.viewDataProvider.getCellCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -887,7 +873,7 @@ class SchedulerWorkSpace extends Widget { } generateRenderOptions(isProvideVirtualCellsWidth?: any): ViewDataProviderOptions { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); const groupOrientation = groupCount > 0 ? this.option('groupOrientation') @@ -943,14 +929,14 @@ class SchedulerWorkSpace extends Widget { } updateHeaderPanelScrollbarPadding() { - if (hasWindow() && this._$headerPanelContainer) { + if (hasWindow() && this.$headerPanelContainer) { const scrollbarWidth = this.getScrollbarWidth(); - this._$headerPanelContainer.css('paddingRight', `${scrollbarWidth}px`); + this.$headerPanelContainer.css('paddingRight', `${scrollbarWidth}px`); } } private getScrollbarWidth() { - const containerElement = $(this._dateTableScrollable.container()).get(0) as HTMLElement; + const containerElement = $(this.$dateTableScrollable.container()).get(0) as HTMLElement; const scrollbarWidth = containerElement.offsetWidth - containerElement.clientWidth; return scrollbarWidth; } @@ -1122,24 +1108,24 @@ class SchedulerWorkSpace extends Widget { protected getGroupHeaderContainer() { if (this.isVerticalGroupedWorkSpace()) { - return this._$groupTable; + return this.$groupTable; } - return this._$thead; + return this.$thead; } private getDateHeaderContainer() { - return this._$thead; + return this.$thead; } private getCalculateHeaderCellRepeatCount() { - return this._groupedStrategy.calculateHeaderCellRepeatCount(); + return this.groupedStrategy.calculateHeaderCellRepeatCount(); } protected updateScrollable() { - this._dateTableScrollable.update(); + this.$dateTableScrollable.update(); this.headerScrollable?.update(); - this._sidebarScrollable?.update(); + this.$sidebarScrollable?.update(); this.updateHeaderPanelScrollbarPadding(); } @@ -1156,11 +1142,11 @@ class SchedulerWorkSpace extends Widget { } private getTotalCellCount(groupCount) { - return this._groupedStrategy.getTotalCellCount(groupCount); + return this.groupedStrategy.getTotalCellCount(groupCount); } protected getTotalRowCount(groupCount, includeAllDayPanelRows?: any) { - let result = this._groupedStrategy.getTotalRowCount(groupCount); + let result = this.groupedStrategy.getTotalRowCount(groupCount); if (includeAllDayPanelRows && this.isAllDayPanelVisible) { result += groupCount; @@ -1170,7 +1156,7 @@ class SchedulerWorkSpace extends Widget { } private getGroupIndex(rowIndex, columnIndex) { - return this._groupedStrategy.getGroupIndex(rowIndex, columnIndex); + return this.groupedStrategy.getGroupIndex(rowIndex, columnIndex); } calculateEndDate(startDate) { @@ -1183,8 +1169,7 @@ class SchedulerWorkSpace extends Widget { ); } - // TODO: make private once external usages in grouped strategies, shaders, m_subscribes.ts, m_timeline.ts are removed - _getGroupCount() { + protected getGroupCount() { return this.resourceManager.groupCount(); } @@ -1262,7 +1247,7 @@ class SchedulerWorkSpace extends Widget { }); eventsEngine.on(element, SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME, DRAG_AND_DROP_SELECTOR, (e) => { - if (isPointerDown && this._dateTableScrollable) { + if (isPointerDown && this.$dateTableScrollable) { e.preventDefault(); e.stopPropagation(); this.moveToCell($(e.target), true); @@ -1277,31 +1262,31 @@ class SchedulerWorkSpace extends Widget { } getScrollable() { - return this._dateTableScrollable; + return this.$dateTableScrollable; } getScrollableScrollTop() { - return this._dateTableScrollable.scrollTop(); + return this.$dateTableScrollable.scrollTop(); } getGroupedScrollableScrollTop(allDay) { - return this._groupedStrategy.getScrollableScrollTop(allDay); + return this.groupedStrategy.getScrollableScrollTop(allDay); } getScrollableScrollLeft() { - return this._dateTableScrollable.scrollLeft(); + return this.$dateTableScrollable.scrollLeft(); } getScrollableOuterWidth() { - return this._dateTableScrollable.scrollWidth(); + return this.$dateTableScrollable.scrollWidth(); } getScrollableContainer() { - return $(this._dateTableScrollable.container()); + return $(this.$dateTableScrollable.container()); } getHeaderPanelHeight() { - return this._$headerPanel && getOuterHeight(this._$headerPanel, true); + return this.$headerPanel && getOuterHeight(this.$headerPanel, true); } getTimePanelWidth() { @@ -1309,11 +1294,11 @@ class SchedulerWorkSpace extends Widget { } getGroupTableWidth() { - return this._$groupTable ? getOuterWidth(this._$groupTable) : 0; + return this.$groupTable ? getOuterWidth(this.$groupTable) : 0; } getWorkSpaceLeftOffset() { - return this._groupedStrategy.getLeftOffset(); + return this.groupedStrategy.getLeftOffset(); } protected getCellCoordinatesByIndex(index) { @@ -1387,7 +1372,7 @@ class SchedulerWorkSpace extends Widget { protected getWorkSpaceWidth() { return this.cache.memo('workspaceWidth', () => { if (this.needCreateCrossScrolling()) { - return getBoundingRect(this._$dateTable.get(0)).width; + return getBoundingRect(this.$dateTable.get(0)).width; } const totalWidth = getBoundingRect((this.$element() as any).get(0)).width; const timePanelWidth = this.getTimePanelWidth(); @@ -1398,12 +1383,12 @@ class SchedulerWorkSpace extends Widget { } protected getCellElementByPosition(cellCoordinates, groupIndex, inAllDayRow) { - const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow); + const indexes = this.groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow); return this.domGetDateCell(indexes); } private domGetDateCell(position) { - return this._$dateTable + return this.$dateTable .find(`tr:not(.${VIRTUAL_ROW_CLASS})`) .eq(position.rowIndex) .find(`td:not(.${VIRTUAL_CELL_CLASS})`) @@ -1411,7 +1396,7 @@ class SchedulerWorkSpace extends Widget { } private domGetAllDayPanelCell(columnIndex) { - return this._$allDayPanel + return this.$allDayPanel .find('tr').eq(0) .find('td').eq(columnIndex); } @@ -1441,7 +1426,7 @@ class SchedulerWorkSpace extends Widget { private getAllCells(allDay) { if (this.isVerticalGroupedWorkSpace()) { - return this._$dateTable.find(`td:not(.${VIRTUAL_CELL_CLASS})`); + return this.$dateTable.find(`td:not(.${VIRTUAL_CELL_CLASS})`); } const cellClass = allDay && this.supportAllDayRow() @@ -1452,8 +1437,8 @@ class SchedulerWorkSpace extends Widget { } protected setHorizontalGroupHeaderCellsHeight() { - const { height } = getBoundingRect(this._$dateTable.get(0)); - setOuterHeight(this._$groupTable, height); + const { height } = getBoundingRect(this.$dateTable.get(0)); + setOuterHeight(this.$groupTable, height); } protected getGroupHeaderCells() { @@ -1481,7 +1466,7 @@ class SchedulerWorkSpace extends Widget { } private isOutsideScrollable(target, event) { - const $dateTableScrollableElement = this._dateTableScrollable.$element(); + const $dateTableScrollableElement = this.$dateTableScrollable.$element(); const scrollableSize = getBoundingRect($dateTableScrollableElement.get(0)); const window = getWindow(); const isTargetInAllDayPanel = !$(target).closest($dateTableScrollableElement).length; @@ -1558,8 +1543,8 @@ class SchedulerWorkSpace extends Widget { isGroupedByDate() { return this.option('groupByDate') - && this._isHorizontalGroupedWorkSpace() - && this._getGroupCount() > 0; + && this.isHorizontalGroupedWorkSpace() + && this.getGroupCount() > 0; } // TODO: refactor current time indicator @@ -1637,14 +1622,14 @@ class SchedulerWorkSpace extends Widget { } getAllDayOffset() { - return this._groupedStrategy.getAllDayOffset(); + return this.groupedStrategy.getAllDayOffset(); } // NOTE: refactor leftIndex calculation getCellIndexByCoordinates(coordinates, allDay) { const { horizontalScrollingState, verticalScrollingState } = this.virtualScrollingDispatcher; - const cellCount = horizontalScrollingState?.itemCount ?? this.getTotalCellCount(this._getGroupCount()); + const cellCount = horizontalScrollingState?.itemCount ?? this.getTotalCellCount(this.getGroupCount()); const cellWidth = this.getCellWidth(); const cellHeight = allDay ? this.getAllDayHeight() : this.getCellHeight(); @@ -1699,7 +1684,7 @@ class SchedulerWorkSpace extends Widget { } getGroupBounds(coordinates) { - const groupBounds = this._groupedStrategy instanceof VerticalGroupedStrategy + const groupBounds = this.groupedStrategy instanceof VerticalGroupedStrategy ? this.getGroupBoundsVertical(coordinates.groupIndex) : this.getGroupBoundsHorizontal(coordinates); @@ -1710,16 +1695,16 @@ class SchedulerWorkSpace extends Widget { getGroupBoundsVertical(groupIndex) { const $firstAndLastCells = this.getFirstAndLastDataTableCell(); - return this._groupedStrategy.getGroupBoundsOffset(groupIndex, $firstAndLastCells); + return this.groupedStrategy.getGroupBoundsOffset(groupIndex, $firstAndLastCells); } getGroupBoundsHorizontal(coordinates) { - const cellCount = this._getCellCount(); + const cellCount = this.getCellCount(); const $cells = this.getCells(); const cellWidth = this.getCellWidth(); const { groupedDataMap } = this.viewDataProvider; - return this._groupedStrategy + return this.groupedStrategy .getGroupBoundsOffset(cellCount, $cells, cellWidth, coordinates, groupedDataMap); } @@ -1805,7 +1790,7 @@ class SchedulerWorkSpace extends Widget { const $scrollable = this.getScrollable().$element(); const cellHeight = this.getCellHeight(); const cellWidth = this.getCellWidth(); - const totalColumnCount = this.getTotalCellCount(this._getGroupCount()); + const totalColumnCount = this.getTotalCellCount(this.getGroupCount()); const scrollableScrollTop = this.getScrollableScrollTop(); const scrollableScrollLeft = this.getScrollableScrollLeft(); @@ -1850,7 +1835,7 @@ class SchedulerWorkSpace extends Widget { return; } - const groupIndex = this._getGroupCount() && groupValues + const groupIndex = this.getGroupCount() && groupValues ? this.getGroupIndexByGroupValues(groupValues) : 0; const isScrollToAllDay = allDay && this.isAllDayPanelVisible; @@ -1997,7 +1982,7 @@ class SchedulerWorkSpace extends Widget { getPanelDOMSize(panelName: 'allDayPanel' | 'regularPanel'): { width: number; height: number } { return panelName === 'allDayPanel' - ? this.cache.memo('allDayPanelSize', () => getBoundingRect(this._$allDayPanel.get(0))) + ? this.cache.memo('allDayPanelSize', () => getBoundingRect(this.$allDayPanel.get(0))) : this.cache.memo('regularPanelSize', () => getBoundingRect(this.getDateTable().get(0))); } @@ -2045,7 +2030,7 @@ class SchedulerWorkSpace extends Widget { return [{}]; } - const allDayAppointmentContainer = this._$allDayPanel; + const allDayAppointmentContainer = this.$allDayPanel; const allDayPanelRect = getBoundingRect(allDayAppointmentContainer.get(0)); allDayCells.each((_, cell) => { @@ -2070,7 +2055,7 @@ class SchedulerWorkSpace extends Widget { // TODO: remove along with old render private oldRenderGetAllDayCellData(groupIndex) { return (cell, rowIndex, columnIndex) => { - const validColumnIndex = columnIndex % this._getCellCount(); + const validColumnIndex = columnIndex % this.getCellCount(); const options = this.getDateGenerationOptions(true); let startDate = this.viewDataProvider.viewDataGenerator.getDateByCellIndices( options as any, @@ -2083,9 +2068,9 @@ class SchedulerWorkSpace extends Widget { let validGroupIndex = groupIndex || 0; if (this.isGroupedByDate()) { - validGroupIndex = Math.floor(columnIndex % this._getGroupCount()); - } else if (this._isHorizontalGroupedWorkSpace()) { - validGroupIndex = Math.floor(columnIndex / this._getCellCount()); + validGroupIndex = Math.floor(columnIndex % this.getGroupCount()); + } else if (this.isHorizontalGroupedWorkSpace()) { + validGroupIndex = Math.floor(columnIndex / this.getCellCount()); } const data: any = { @@ -2133,7 +2118,7 @@ class SchedulerWorkSpace extends Widget { renderRDateTable() { utils.renovation.renderComponent( this, - this._$dateTable, + this.$dateTable, DateTableComponent, 'renovatedDateTable', this.getRDateTableProps(), @@ -2213,7 +2198,7 @@ class SchedulerWorkSpace extends Widget { utils.renovation.renderComponent( this, - this._$thead, + this.$thead, this.renovatedHeaderPanelComponent, 'renovatedHeaderPanel', { @@ -2245,7 +2230,7 @@ class SchedulerWorkSpace extends Widget { this.createDragBehavior(this.getWorkArea(), $rootElement); if (!this.isVerticalGroupedWorkSpace()) { - this.createDragBehavior(this._$allDayPanel, $rootElement); + this.createDragBehavior(this.$allDayPanel, $rootElement); } } } @@ -2427,7 +2412,7 @@ class SchedulerWorkSpace extends Widget { break; case 'crossScrollingEnabled': this.toggleHorizontalScrollClass(); - this._dateTableScrollable.option(this.dateTableScrollableConfig()); + this.$dateTableScrollable.option(this.dateTableScrollableConfig()); break; case 'allDayPanelMode': this.updateShowAllDayPanel(); @@ -2480,7 +2465,7 @@ class SchedulerWorkSpace extends Widget { createAction: this._createAction.bind(this), updateRender: this.updateRender.bind(this), updateGrid: this.updateGrid.bind(this), - getGroupCount: this._getGroupCount.bind(this), + getGroupCount: this.getGroupCount.bind(this), isVerticalGrouping: this.isVerticalGroupedWorkSpace.bind(this), getTotalRowCount: this.getTotalRowCount.bind(this), getTotalCellCount: this.getTotalCellCount.bind(this), @@ -2525,12 +2510,11 @@ class SchedulerWorkSpace extends Widget { viewStartDayHour: this.option('startDayHour'), viewEndDayHour: this.option('endDayHour'), cellDuration: this.getCellDuration(), - _groupedStrategy: this._groupedStrategy, isGroupedByDate: this.isGroupedByDate(), rtlEnabled: this.option('rtlEnabled'), startViewDate: this.getStartViewDate(), isVerticalGrouping: this.isVerticalGroupedWorkSpace(), - groupCount: this._getGroupCount(), + groupCount: this.getGroupCount(), isVirtualScrolling: this.isVirtualScrolling(), getDOMMetaDataCallback: this.getDOMElementsMetaData.bind(this), }); @@ -2555,7 +2539,7 @@ class SchedulerWorkSpace extends Widget { ? VerticalGroupedStrategy : HorizontalGroupedStrategy; - this._groupedStrategy = new Strategy(this); + this.groupedStrategy = new Strategy(this); } protected getDefaultGroupStrategy() { @@ -2585,27 +2569,27 @@ class SchedulerWorkSpace extends Widget { protected getDateTableCellClass(rowIndex?: any, columnIndex?: any) { const cellClass = `${DATE_TABLE_CELL_CLASS} ${HORIZONTAL_SIZES_CLASS} ${VERTICAL_SIZES_CLASS}`; - return this._groupedStrategy + return this.groupedStrategy .addAdditionalGroupCellClasses(cellClass, columnIndex + 1, rowIndex, columnIndex); } protected getGroupHeaderClass(i?: any) { const cellClass = GROUP_HEADER_CLASS; - return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i + 1); + return this.groupedStrategy.addAdditionalGroupCellClasses(cellClass, i + 1); } protected initWorkSpaceUnits() { - this._$headerPanelContainer = $('
').addClass('dx-scheduler-header-panel-container'); + this.$headerPanelContainer = $('
').addClass('dx-scheduler-header-panel-container'); this.$headerTablesContainer = $('
').addClass('dx-scheduler-header-tables-container'); - this._$headerPanel = $('
').attr('aria-hidden', true); - this._$thead = $('').appendTo(this._$headerPanel); + this.$headerPanel = $('
').attr('aria-hidden', true); + this.$thead = $('').appendTo(this.$headerPanel); this.$headerPanelEmptyCell = $('
').addClass('dx-scheduler-header-panel-empty-cell'); this.$allDayTable = $('
').attr('aria-hidden', true); this.$fixedContainer = $('
').addClass(FIXED_CONTAINER_CLASS); this.$allDayContainer = $('
').addClass(ALL_DAY_CONTAINER_CLASS); - this._$dateTableScrollableContent = $('
').addClass('dx-scheduler-date-table-scrollable-content'); + this.$dateTableScrollableContent = $('
').addClass('dx-scheduler-date-table-scrollable-content'); this.$sidebarScrollableContent = $('
').addClass('dx-scheduler-side-bar-scrollable-content'); this.initAllDayPanelElements(); @@ -2617,9 +2601,9 @@ class SchedulerWorkSpace extends Widget { } this.$timePanel = $('
').addClass(TIME_PANEL_CLASS).attr('aria-hidden', true); - this._$dateTable = $('
').attr('aria-hidden', true); + this.$dateTable = $('
').attr('aria-hidden', true); this.$dateTableContainer = $('
').addClass('dx-scheduler-date-table-container'); - this._$groupTable = $('
').addClass(WORKSPACE_VERTICAL_GROUP_TABLE_CLASS); + this.$groupTable = $('
').addClass(WORKSPACE_VERTICAL_GROUP_TABLE_CLASS); } private initAllDayPanelElements() { @@ -2632,8 +2616,8 @@ class SchedulerWorkSpace extends Widget { const $dateTableScrollable = $('
').addClass(SCHEDULER_DATE_TABLE_SCROLLABLE_CLASS); // @ts-expect-error - this._dateTableScrollable = this._createComponent($dateTableScrollable, Scrollable, this.dateTableScrollableConfig()); - this.scrollSync.dateTable = getMemoizeScrollTo(() => this._dateTableScrollable); + this.$dateTableScrollable = this._createComponent($dateTableScrollable, Scrollable, this.dateTableScrollableConfig()); + this.scrollSync.dateTable = getMemoizeScrollTo(() => this.$dateTableScrollable); } protected createWorkSpaceElements() { @@ -2645,76 +2629,76 @@ class SchedulerWorkSpace extends Widget { } protected createWorkSpaceStaticElements() { - this.$dateTableContainer.append(this._$dateTable); + this.$dateTableContainer.append(this.$dateTable); if (this.isVerticalGroupedWorkSpace()) { this.$dateTableContainer.append(this.$allDayContainer); - this._$dateTableScrollableContent.append( - this._$groupTable, + this.$dateTableScrollableContent.append( + this.$groupTable, this.$timePanel, this.$dateTableContainer, ); - this._dateTableScrollable.$content().append( - this._$dateTableScrollableContent, + this.$dateTableScrollable.$content().append( + this.$dateTableScrollableContent, ); - this.$headerTablesContainer.append(this._$headerPanel); + this.$headerTablesContainer.append(this.$headerPanel); } else { - this._$dateTableScrollableContent.append( + this.$dateTableScrollableContent.append( this.$timePanel, this.$dateTableContainer, ); - this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); + this.$dateTableScrollable.$content().append(this.$dateTableScrollableContent); - this.$headerTablesContainer.append(this._$headerPanel, this._$allDayPanel); - this._$allDayPanel?.append(this.$allDayContainer, this.$allDayTable); + this.$headerTablesContainer.append(this.$headerPanel, this.$allDayPanel); + this.$allDayPanel?.append(this.$allDayContainer, this.$allDayTable); } this.appendHeaderPanelEmptyCellIfNecessary(); - this._$headerPanelContainer.append(this.$headerTablesContainer); + this.$headerPanelContainer.append(this.$headerTablesContainer); this.$element() .append(this.$fixedContainer) - .append(this._$headerPanelContainer) - .append(this._dateTableScrollable.$element()); + .append(this.$headerPanelContainer) + .append(this.$dateTableScrollable.$element()); } protected createWorkSpaceScrollableElements() { this.$element().append(this.$fixedContainer); - this._$flexContainer = $('
').addClass('dx-scheduler-work-space-flex-container'); + this.$flexContainer = $('
').addClass('dx-scheduler-work-space-flex-container'); this.createHeaderScrollable(); - this.headerScrollable.$content().append(this._$headerPanel); + this.headerScrollable.$content().append(this.$headerPanel); this.appendHeaderPanelEmptyCellIfNecessary(); - this._$headerPanelContainer.append(this.$headerTablesContainer); + this.$headerPanelContainer.append(this.$headerTablesContainer); - this.$element().append(this._$headerPanelContainer); - this.$element().append(this._$flexContainer); + this.$element().append(this.$headerPanelContainer); + this.$element().append(this.$flexContainer); this.createSidebarScrollable(); - this._$flexContainer.append(this._dateTableScrollable.$element()); + this.$flexContainer.append(this.$dateTableScrollable.$element()); - this.$dateTableContainer.append(this._$dateTable); - this._$dateTableScrollableContent.append(this.$dateTableContainer); + this.$dateTableContainer.append(this.$dateTable); + this.$dateTableScrollableContent.append(this.$dateTableContainer); - this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); + this.$dateTableScrollable.$content().append(this.$dateTableScrollableContent); if (this.isVerticalGroupedWorkSpace()) { this.$dateTableContainer.append(this.$allDayContainer); - this.$sidebarScrollableContent.append(this._$groupTable, this.$timePanel); + this.$sidebarScrollableContent.append(this.$groupTable, this.$timePanel); } else { - this.headerScrollable.$content().append(this._$allDayPanel); - this._$allDayPanel?.append(this.$allDayContainer, this.$allDayTable); + this.headerScrollable.$content().append(this.$allDayPanel); + this.$allDayPanel?.append(this.$allDayContainer, this.$allDayTable); this.$sidebarScrollableContent.append(this.$timePanel); } - this._sidebarScrollable.$content().append(this.$sidebarScrollableContent); + this.$sidebarScrollable.$content().append(this.$sidebarScrollableContent); } private appendHeaderPanelEmptyCellIfNecessary() { - this.isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this.$headerPanelEmptyCell); + this.isRenderHeaderPanelEmptyCell() && this.$headerPanelContainer.append(this.$headerPanelEmptyCell); } private createHeaderScrollable() { @@ -2730,10 +2714,10 @@ class SchedulerWorkSpace extends Widget { private createSidebarScrollable() { const $timePanelScrollable = $('
') .addClass(SCHEDULER_SIDEBAR_SCROLLABLE_CLASS) - .appendTo(this._$flexContainer); + .appendTo(this.$flexContainer); // @ts-expect-error - this._sidebarScrollable = this._createComponent($timePanelScrollable, Scrollable, { + this.$sidebarScrollable = this._createComponent($timePanelScrollable, Scrollable, { useKeyboard: false, showScrollbar: 'never', direction: 'vertical', @@ -2744,14 +2728,14 @@ class SchedulerWorkSpace extends Widget { this.scrollSync.dateTable({ top: event.scrollOffset.top }); }, }); - this.scrollSync.sidebar = getMemoizeScrollTo(() => this._sidebarScrollable); + this.scrollSync.sidebar = getMemoizeScrollTo(() => this.$sidebarScrollable); } private attachTableClasses() { - this.addTableClass(this._$dateTable, DATE_TABLE_CLASS); + this.addTableClass(this.$dateTable, DATE_TABLE_CLASS); if (this.isVerticalGroupedWorkSpace()) { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); for (let i = 0; i < groupCount; i++) { this.addTableClass(this.allDayTables[i], ALL_DAY_TABLE_CLASS); @@ -2762,7 +2746,7 @@ class SchedulerWorkSpace extends Widget { } private attachHeaderTableClasses() { - this.addTableClass(this._$headerPanel, HEADER_PANEL_CLASS); + this.addTableClass(this.$headerPanel, HEADER_PANEL_CLASS); } private addTableClass($el, className) { @@ -2802,7 +2786,7 @@ class SchedulerWorkSpace extends Widget { } private toggleGroupedClass() { - (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this._getGroupCount() > 0); + (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this.getGroupCount() > 0); } protected renderView() { @@ -2824,7 +2808,7 @@ class SchedulerWorkSpace extends Widget { this.updateGroupTableHeight(); this.updateHeaderEmptyCellWidth(); - this._shader = new VerticalShader(this); + this.shader = new VerticalShader(this); } updateCellsSelection() { @@ -2852,7 +2836,7 @@ class SchedulerWorkSpace extends Widget { } protected attachGroupCountClass() { - const className = this._groupedStrategy.getGroupCountClass(this.option('groups')); + const className = this.groupedStrategy.getGroupCountClass(this.option('groups')); this.$element().addClass(className); } @@ -2874,11 +2858,11 @@ class SchedulerWorkSpace extends Widget { } private getDateTables() { - return this._$dateTable.add(this.$allDayTable); + return this.$dateTable.add(this.$allDayTable); } private getDateTable() { - return this._$dateTable; + return this.$dateTable; } private removeAllDayElements() { @@ -2891,16 +2875,16 @@ class SchedulerWorkSpace extends Widget { this.cleanTableWidths(); this.cellsSelectionState.clearSelectedAndFocusedCells(); if (!this.isRenovatedRender()) { - this._$thead.empty(); - this._$dateTable.empty(); + this.$thead.empty(); + this.$dateTable.empty(); this.$timePanel.empty(); - this._$groupTable.empty(); + this.$groupTable.empty(); this.$allDayTable?.empty(); this.$sidebarTable?.empty(); } - this._shader?.clean(); + this.shader?.clean(); delete this.interval; } @@ -2914,8 +2898,8 @@ class SchedulerWorkSpace extends Widget { } private cleanTableWidths() { - this._$headerPanel.css('width', ''); - this._$dateTable.css('width', ''); + this.$headerPanel.css('width', ''); + this.$dateTable.css('width', ''); this.$allDayTable?.css('width', ''); } @@ -2937,7 +2921,7 @@ class SchedulerWorkSpace extends Widget { } getGroupedStrategy() { - return this._groupedStrategy; + return this.groupedStrategy; } getFixedContainer() { @@ -2966,7 +2950,7 @@ class SchedulerWorkSpace extends Widget { // ---------------- protected createAllDayPanelElements() { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); if (this.isVerticalGroupedWorkSpace() && groupCount !== 0) { for (let i = 0; i < groupCount; i++) { @@ -2979,11 +2963,11 @@ class SchedulerWorkSpace extends Widget { this.$allDayTable = $('
').attr('aria-hidden', true); this.allDayTables.push(this.$allDayTable); - this._$allDayPanel = $('
') + this.$allDayPanel = $('
') .addClass(ALL_DAY_PANEL_CLASS) .append(this.$allDayTable); - this.allDayPanels.push(this._$allDayPanel); + this.allDayPanels.push(this.$allDayPanel); } } else { this.$allDayTitle = $('
') @@ -2993,7 +2977,7 @@ class SchedulerWorkSpace extends Widget { this.$allDayTable = $('
').attr('aria-hidden', true); - this._$allDayPanel = $('
') + this.$allDayPanel = $('
') .addClass(ALL_DAY_PANEL_CLASS) .append(this.$allDayTable); } @@ -3023,7 +3007,7 @@ class SchedulerWorkSpace extends Widget { protected renderGroupHeader() { const $container = this.getGroupHeaderContainer(); - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); let cellTemplates = []; if (groupCount) { const groupRows = this.makeGroupRows(this.option('groups'), this.option('groupByDate')); @@ -3055,9 +3039,9 @@ class SchedulerWorkSpace extends Widget { groupHeaderClass: this.getGroupHeaderClass.bind(this), groupHeaderContentClass: GROUP_HEADER_CONTENT_CLASS, }, - this._getCellCount() || 1, + this.getCellCount() || 1, this.option('resourceCellTemplate'), - this._getGroupCount(), + this.getGroupCount(), groupByDate, ); } @@ -3065,7 +3049,7 @@ class SchedulerWorkSpace extends Widget { protected renderDateHeader(): any { const container = this.getDateHeaderContainer(); const $headerRow = $('
').addClass(HEADER_ROW_CLASS); - const count = this._getCellCount(); + const count = this.getCellCount(); const cellTemplate = this.getDateHeaderTemplate(); const repeatCount = this.getCalculateHeaderCellRepeatCount(); const templateCallbacks = []; @@ -3081,7 +3065,7 @@ class SchedulerWorkSpace extends Widget { container.append($headerRow); } else { - const colSpan = groupByDate ? this._getGroupCount() : 1; + const colSpan = groupByDate ? this.getGroupCount() : 1; for (let columnIndex = 0; columnIndex < count; columnIndex++) { const templateIndex = columnIndex * repeatCount; @@ -3099,7 +3083,7 @@ class SchedulerWorkSpace extends Widget { private renderDateHeaderTemplate(container, panelCellIndex, templateIndex, cellTemplate, templateCallbacks) { const validTemplateIndex = this.isGroupedByDate() - ? Math.floor(templateIndex / this._getGroupCount()) + ? Math.floor(templateIndex / this.getGroupCount()) : templateIndex; const { completeDateHeaderMap } = this.viewDataProvider; @@ -3129,7 +3113,7 @@ class SchedulerWorkSpace extends Widget { } protected getGroupsForDateHeaderTemplate(templateIndex, indexMultiplier = 1) { - if (this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { + if (this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { const groupIndex = this.getGroupIndex(0, templateIndex * indexMultiplier); const groups = getLeafGroupValues(this.resourceManager.groupsLeafs, groupIndex); @@ -3145,14 +3129,14 @@ class SchedulerWorkSpace extends Widget { protected getHeaderPanelCellClass(i) { const cellClass = `${HEADER_PANEL_CELL_CLASS} ${HORIZONTAL_SIZES_CLASS}`; - return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i + 1, undefined, undefined, this.isGroupedByDate()); + return this.groupedStrategy.addAdditionalGroupCellClasses(cellClass, i + 1, undefined, undefined, this.isGroupedByDate()); } protected renderAllDayPanel(index?: any) { - let cellCount = this._getCellCount(); + let cellCount = this.getCellCount(); if (!this.isVerticalGroupedWorkSpace()) { - cellCount *= this._getGroupCount() || 1; + cellCount *= this.getGroupCount() || 1; } const cellTemplates = this.renderTableBody({ @@ -3174,7 +3158,7 @@ class SchedulerWorkSpace extends Widget { protected renderGroupAllDayPanel() { if (this.isVerticalGroupedWorkSpace()) { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); for (let i = 0; i < groupCount; i++) { this.renderAllDayPanel(i); @@ -3185,11 +3169,11 @@ class SchedulerWorkSpace extends Widget { private getAllDayPanelCellClass(i, j) { const cellClass = `${ALL_DAY_TABLE_CELL_CLASS} ${HORIZONTAL_SIZES_CLASS}`; - return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, j + 1); + return this.groupedStrategy.addAdditionalGroupCellClasses(cellClass, j + 1); } protected renderTimePanel() { - const repeatCount = this._groupedStrategy.calculateTimeCellRepeatCount(); + const repeatCount = this.groupedStrategy.calculateTimeCellRepeatCount(); const getTimeCellGroups = (rowIndex) => { if (!this.isVerticalGroupedWorkSpace()) { @@ -3225,7 +3209,7 @@ class SchedulerWorkSpace extends Widget { cellTemplate: this.option('timeCellTemplate'), getCellText: (rowIndex) => getData(rowIndex, 'text'), getCellDate: (rowIndex) => getData(rowIndex, 'startDate'), - groupCount: this._getCellCount(), + groupCount: this.getCellCount(), allDayElements: this.insertAllDayRowsIntoDateTable() ? this.allDayTitles : undefined, getTemplateData: getTimeCellGroups.bind(this), }); @@ -3235,14 +3219,14 @@ class SchedulerWorkSpace extends Widget { const cellClass = `${TIME_PANEL_CELL_CLASS} ${VERTICAL_SIZES_CLASS}`; return this.isVerticalGroupedWorkSpace() - ? this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i, i) + ? this.groupedStrategy.addAdditionalGroupCellClasses(cellClass, i, i) : cellClass; } protected renderDateTable() { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); this.renderTableBody({ - container: getPublicElement(this._$dateTable), + container: getPublicElement(this.$dateTable), rowCount: this.getTotalRowCount(groupCount), cellCount: this.getTotalCellCount(groupCount), cellClass: this.getDateTableCellClass.bind(this), @@ -3274,7 +3258,7 @@ class SchedulerWorkSpace extends Widget { } protected insertAllDayRowsIntoDateTable() { - return this._groupedStrategy.insertAllDayRowsIntoDateTable(); + return this.groupedStrategy.insertAllDayRowsIntoDateTable(); } protected renderTableBody(options, delayCellTemplateRendering?: any): any { diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_horizontal.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_horizontal.ts index 5e728dfb8bdc..de3418588ffb 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_horizontal.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_horizontal.ts @@ -15,27 +15,27 @@ class HorizontalGroupedStrategy { if (!groupByDay) { return { rowIndex: cellCoordinates.rowIndex, - columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace._getCellCount(), + columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace.getCellCount(), }; } return { rowIndex: cellCoordinates.rowIndex, - columnIndex: cellCoordinates.columnIndex * this._workSpace._getGroupCount() + groupIndex, + columnIndex: cellCoordinates.columnIndex * this._workSpace.getGroupCount() + groupIndex, }; } getGroupIndex(rowIndex, columnIndex) { const groupByDay = this._workSpace.isGroupedByDate(); - const groupCount = this._workSpace._getGroupCount(); + const groupCount = this._workSpace.getGroupCount(); if (groupByDay) { return columnIndex % groupCount; } - return Math.floor(columnIndex / this._workSpace._getCellCount()); + return Math.floor(columnIndex / this._workSpace.getCellCount()); } calculateHeaderCellRepeatCount() { - return this._workSpace._getGroupCount() || 1; + return this._workSpace.getGroupCount() || 1; } insertAllDayRowsIntoDateTable() { @@ -45,7 +45,7 @@ class HorizontalGroupedStrategy { getTotalCellCount(groupCount) { groupCount = groupCount || 1; - return this._workSpace._getCellCount() * groupCount; + return this._workSpace.getCellCount() * groupCount; } getTotalRowCount() { @@ -143,18 +143,18 @@ class HorizontalGroupedStrategy { private calculateOffset(groupIndex) { const indicatorStartPosition = this._workSpace.getIndicatorOffset(groupIndex); - const offset = this._workSpace._getCellCount() * this._workSpace.getCellWidth() * groupIndex; + const offset = this._workSpace.getCellCount() * this._workSpace.getCellWidth() * groupIndex; return indicatorStartPosition + offset; } private calculateGroupByDateOffset(groupIndex) { - return this._workSpace.getIndicatorOffset(0) * this._workSpace._getGroupCount() + this._workSpace.getCellWidth() * groupIndex; + return this._workSpace.getIndicatorOffset(0) * this._workSpace.getGroupCount() + this._workSpace.getCellWidth() * groupIndex; } getShaderOffset(i, width) { - const offset = this._workSpace._getCellCount() * this._workSpace.getCellWidth() * i; - return this._workSpace.option('rtlEnabled') ? getBoundingRect(this._workSpace._dateTableScrollable.$content().get(0)).width - offset - this._workSpace.getTimePanelWidth() - width : offset; + const offset = this._workSpace.getCellCount() * this._workSpace.getCellWidth() * i; + return this._workSpace.option('rtlEnabled') ? getBoundingRect(this._workSpace.$dateTableScrollable.$content().get(0)).width - offset - this._workSpace.getTimePanelWidth() - width : offset; } getShaderTopOffset(i) { @@ -168,7 +168,7 @@ class HorizontalGroupedStrategy { } getShaderMaxHeight() { - return getBoundingRect(this._workSpace._dateTableScrollable.$content().get(0)).height; + return getBoundingRect(this._workSpace.$dateTableScrollable.$content().get(0)).height; } getShaderWidth() { @@ -197,10 +197,10 @@ class HorizontalGroupedStrategy { const groupByDate = this._workSpace.isGroupedByDate(); if (groupByDate) { - if (index % this._workSpace._getGroupCount() === 0) { + if (index % this._workSpace.getGroupCount() === 0) { return `${cellClass} ${LAST_GROUP_CELL_CLASS}`; } - } else if (index % this._workSpace._getCellCount() === 0) { + } else if (index % this._workSpace.getCellCount() === 0) { return `${cellClass} ${LAST_GROUP_CELL_CLASS}`; } @@ -215,10 +215,10 @@ class HorizontalGroupedStrategy { const groupByDate = this._workSpace.isGroupedByDate(); if (groupByDate) { - if ((index - 1) % this._workSpace._getGroupCount() === 0) { + if ((index - 1) % this._workSpace.getGroupCount() === 0) { return `${cellClass} ${FIRST_GROUP_CELL_CLASS}`; } - } else if ((index - 1) % this._workSpace._getCellCount() === 0) { + } else if ((index - 1) % this._workSpace.getCellCount() === 0) { return `${cellClass} ${FIRST_GROUP_CELL_CLASS}`; } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_vertical.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_vertical.ts index ebbeb0e0f5d8..aee3ba5902ce 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_vertical.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_vertical.ts @@ -46,15 +46,15 @@ class VerticalGroupedStrategy { } getTotalCellCount() { - return this._workSpace._getCellCount(); + return this._workSpace.getCellCount(); } getTotalRowCount() { - return this._workSpace.getRowCount() * this._workSpace._getGroupCount(); + return this._workSpace.getRowCount() * this._workSpace.getGroupCount(); } calculateTimeCellRepeatCount() { - return this._workSpace._getGroupCount() || 1; + return this._workSpace.getGroupCount() || 1; } getWorkSpaceMinWidth() { @@ -92,7 +92,7 @@ class VerticalGroupedStrategy { const dayHeight = (calculateDayDuration(startDayHour, endDayHour) / hoursInterval) * this._workSpace.getCellHeight(); const scrollTop = this.getScrollableScrollTop(); - const headerRowHeight = getBoundingRect(this._workSpace._$headerPanelContainer.get(0)).height; + const headerRowHeight = getBoundingRect(this._workSpace.$headerPanelContainer.get(0)).height; let topOffset = groupIndex * dayHeight + headerRowHeight + this._workSpace.option('getHeaderHeight')() - scrollTop; diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts index 361e5ab59195..768803421128 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts @@ -68,7 +68,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { $indicator, groupedByDate ? this.getCellWidth() * groupCount : this.getCellWidth(), ); - this._groupedStrategy.shiftIndicator($indicator, height, rtlOffset, i); + this.groupedStrategy.shiftIndicator($indicator, height, rtlOffset, i); } } @@ -80,7 +80,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } private getRtlOffset(width) { - return this.option('rtlEnabled') ? getBoundingRect(this._dateTableScrollable.$content().get(0)).width - this.getTimePanelWidth() - width : 0; + return this.option('rtlEnabled') ? getBoundingRect(this.$dateTableScrollable.$content().get(0)).width - this.getTimePanelWidth() - width : 0; } protected setIndicationUpdateInterval() { @@ -107,7 +107,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } getIndicationWidth() { - const cellCount = this._getCellCount(); + const cellCount = this.getCellCount(); const cellSpan = Math.min(this.getIndicatorDaysSpan(), cellCount); const width = cellSpan * this.getCellWidth(); const maxWidth = this.getCellWidth() * cellCount; @@ -174,7 +174,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { renderCurrentDateTimeLineAndShader(): void { this.cleanDateTimeIndicator(); - this._shader?.clean(); + this.shader?.clean(); this.renderDateTimeIndication(); } @@ -274,7 +274,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } const verticalGroupCount = this.isVerticalGroupedWorkSpace() - ? this._getGroupCount() + ? this.getGroupCount() : 1; return [...new Array(verticalGroupCount)] @@ -290,15 +290,19 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } if (this.option('shadeUntilCurrentTime')) { - this._shader.render(); + this.shader.render( + this.isHorizontalGroupedWorkSpace(), + this.getGroupCount() || 1, + this.getCellCount(), + ); } if (!this.isIndicationOnView() || !this.isIndicatorVisible()) { return; } - const groupCount = this._getGroupCount() || 1; - const $container = this._dateTableScrollable.$content(); + const groupCount = this.getGroupCount() || 1; + const $container = this.$dateTableScrollable.$content(); const height = this.getIndicationHeight(); const rtlOffset = this.getRtlOffset(this.getCellWidth()); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_month.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_month.ts index fb534567bceb..6c235fa21b3a 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_month.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_month.ts @@ -69,8 +69,8 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { } protected override getCellCoordinatesByIndex(index) { - const rowIndex = Math.floor(index / this._getCellCount()); - const columnIndex = index - this._getCellCount() * rowIndex; + const rowIndex = Math.floor(index / this.getCellCount()); + const columnIndex = index - this.getCellCount() * rowIndex; return { rowIndex, @@ -135,7 +135,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { renderRDateTable() { utils.renovation.renderComponent( this, - this._$dateTable, + this.$dateTable, DateTableMonthComponent, 'renovatedDateTable', this.getRDateTableProps(), diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/currentTimeIndicator.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/currentTimeIndicator.tests.js index 645eace9fbc5..763d750cb6b8 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/currentTimeIndicator.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/currentTimeIndicator.tests.js @@ -367,7 +367,7 @@ QUnit.module('DateTime indicator on Day View', () => { const $bottomShader = $element.find('.' + SCHEDULER_DATE_TIME_SHADER_BOTTOM_CLASS).eq(i); const $allDayShader = $element.find('.' + SCHEDULER_DATE_TIME_SHADER_ALL_DAY_CLASS).eq(i); - assert.roughEqual($topShader.position().top, i > 0 ? getOuterHeight(instance._dateTableScrollable.$content()) : 0, 2.5, 'Shader has correct position'); + assert.roughEqual($topShader.position().top, i > 0 ? getOuterHeight(instance.$dateTableScrollable.$content()) : 0, 2.5, 'Shader has correct position'); assert.roughEqual(getOuterHeight($topShader), 9.5 * cellHeight, 2.5, 'Top shader has correct height'); assert.roughEqual(getOuterHeight($bottomShader), 22.5 * cellHeight, 2.5, 'Bottom shader has correct height'); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.markup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.markup.tests.js index 746cb1d679f7..6d8af0195d1a 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.markup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.markup.tests.js @@ -63,7 +63,7 @@ QUnit.module('Timeline markup', moduleConfig, () => { }); QUnit.test('Scheduler timeline should have right groupedStrategy by default', async function(assert) { - assert.ok(this.instance._groupedStrategy instanceof SchedulerWorkSpaceVerticalStrategy, 'Grouped strategy is right'); + assert.ok(this.instance.groupedStrategy instanceof SchedulerWorkSpaceVerticalStrategy, 'Grouped strategy is right'); }); QUnit.test('Two scrollable elements should be rendered', async function(assert) { @@ -440,7 +440,7 @@ timelineDayModuleConfig = { QUnit.module('TimelineDay with horizontal grouping markup', timelineDayModuleConfig, () => { QUnit.test('Scheduler timeline day should have right groupedStrategy, groupOrientation = horizontal', async function(assert) { - assert.ok(this.instance._groupedStrategy instanceof SchedulerWorkSpaceHorizontalStrategy, 'Grouped strategy is right'); + assert.ok(this.instance.groupedStrategy instanceof SchedulerWorkSpaceHorizontalStrategy, 'Grouped strategy is right'); }); QUnit.test('Scheduler timeline day should have a right css class, groupOrientation = horizontal', async function(assert) { diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-0.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-0.tests.js index d71b74ac5af5..68b5cff6e630 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-0.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-0.tests.js @@ -137,7 +137,7 @@ const VERTICAL_SIZES_CLASS = 'dx-scheduler-cell-sizes-vertical'; }); QUnit.test('Scheduler workspace day should have right groupedStrategy by default', async function(assert) { - assert.ok(this.instance._groupedStrategy instanceof SchedulerWorkSpaceHorizontalStrategy, 'Grouped strategy is right'); + assert.ok(this.instance.groupedStrategy instanceof SchedulerWorkSpaceHorizontalStrategy, 'Grouped strategy is right'); }); } diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-1.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-1.tests.js index 70d5ba7d38e8..ec309bed2535 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-1.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.markup-1.tests.js @@ -261,7 +261,7 @@ QUnit.module('Workspace Day markup with vertical grouping', dayWithGroupingModul }); QUnit.test('Scheduler workspace day should have right groupedStrategy, groupOrientation = vertical', async function(assert) { - assert.ok(this.instance._groupedStrategy instanceof SchedulerWorkSpaceVerticalStrategy, 'Grouped strategy is right'); + assert.ok(this.instance.groupedStrategy instanceof SchedulerWorkSpaceVerticalStrategy, 'Grouped strategy is right'); }); QUnit.test('Scheduler all day rows should be built into dateTable', async function(assert) {