From e8f6956ef25ca05ff8cf2dd773eba6cb12ad815c Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 12:53:26 +0200 Subject: [PATCH 01/21] refactor: make headerPanel and headerPanelContainer private --- .../devextreme/eslint-scheduler-allowlist.mjs | 2 - .../scheduler/workspaces/m_work_space.ts | 50 +++++++++++-------- .../m_work_space_grouped_strategy_vertical.ts | 2 +- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index 0c9cf55c86b2..d6048c63dd23 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -72,8 +72,6 @@ const schedulerLegacyMembers = [ '_$dateTableScrollableContent', '_$flexContainer', '_$groupTable', - '_$headerPanel', - '_$headerPanelContainer', '_$thead', '_dateTableScrollable', '_getCellCount', 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..af47e5f5aa54 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -250,8 +250,7 @@ class SchedulerWorkSpace extends Widget { 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; @@ -293,8 +292,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; + private $headerPanelContainer: any; private $headerTablesContainer: any; @@ -662,7 +660,7 @@ class SchedulerWorkSpace extends Widget { } protected isWorkSpaceWithCount() { - return this.option('intervalCount') as any > 1; + return this.option('intervalCount') > 1; } private isWorkspaceWithOddCells() { @@ -791,7 +789,7 @@ class SchedulerWorkSpace extends Widget { width = minWidth; } - setWidth(this._$headerPanel, width); + setWidth(this.$headerPanel, width); setWidth(this._$dateTable, width); if (this.$allDayTable) { setWidth(this.$allDayTable, width); @@ -943,12 +941,20 @@ 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`); } } + getHeaderPanelContainerHeight(): number { + if (!hasWindow() || !this.$headerPanelContainer) { + return 0; + } + + return getBoundingRect(this.$headerPanelContainer.get(0) as HTMLElement).height; + } + private getScrollbarWidth() { const containerElement = $(this._dateTableScrollable.container()).get(0) as HTMLElement; const scrollbarWidth = containerElement.offsetWidth - containerElement.clientWidth; @@ -1301,7 +1307,7 @@ class SchedulerWorkSpace extends Widget { } getHeaderPanelHeight() { - return this._$headerPanel && getOuterHeight(this._$headerPanel, true); + return this.$headerPanel && getOuterHeight(this.$headerPanel, true); } getTimePanelWidth() { @@ -2596,10 +2602,10 @@ class SchedulerWorkSpace extends Widget { } 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); @@ -2658,7 +2664,7 @@ class SchedulerWorkSpace extends Widget { this._$dateTableScrollableContent, ); - this.$headerTablesContainer.append(this._$headerPanel); + this.$headerTablesContainer.append(this.$headerPanel); } else { this._$dateTableScrollableContent.append( this.$timePanel, @@ -2666,16 +2672,16 @@ class SchedulerWorkSpace extends Widget { ); this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); - this.$headerTablesContainer.append(this._$headerPanel, this._$allDayPanel); + 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.$headerPanelContainer) .append(this._dateTableScrollable.$element()); } @@ -2686,11 +2692,11 @@ class SchedulerWorkSpace extends Widget { 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.$headerPanelContainer); this.$element().append(this._$flexContainer); this.createSidebarScrollable(); @@ -2714,7 +2720,7 @@ class SchedulerWorkSpace extends Widget { } private appendHeaderPanelEmptyCellIfNecessary() { - this.isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this.$headerPanelEmptyCell); + this.isRenderHeaderPanelEmptyCell() && this.$headerPanelContainer.append(this.$headerPanelEmptyCell); } private createHeaderScrollable() { @@ -2762,7 +2768,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) { @@ -2914,7 +2920,7 @@ class SchedulerWorkSpace extends Widget { } private cleanTableWidths() { - this._$headerPanel.css('width', ''); + this.$headerPanel.css('width', ''); this._$dateTable.css('width', ''); this.$allDayTable?.css('width', ''); } 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..e27bdeca0c08 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 @@ -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 = this._workSpace.getHeaderPanelContainerHeight(); let topOffset = groupIndex * dayHeight + headerRowHeight + this._workSpace.option('getHeaderHeight')() - scrollTop; From 006524ee7736fa65f6282f797bd9eed98bece493 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 12:54:47 +0200 Subject: [PATCH 02/21] refactor: make flexContainer private --- .../devextreme/eslint-scheduler-allowlist.mjs | 1 - .../scheduler/workspaces/m_timeline.ts | 4 ++-- .../scheduler/workspaces/m_work_space.ts | 19 +++++++++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index d6048c63dd23..dd93caac6827 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -70,7 +70,6 @@ const schedulerLegacyMembers = [ '_$allDayPanel', '_$dateTable', '_$dateTableScrollableContent', - '_$flexContainer', '_$groupTable', '_$thead', '_dateTableScrollable', diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 137fed043942..eb0f2377c0e0 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -4,7 +4,7 @@ import { noop } from '@js/core/utils/common'; import dateUtils from '@js/core/utils/date'; import { extend } from '@js/core/utils/extend'; import { getBoundingRect } from '@js/core/utils/position'; -import { getOuterHeight, getOuterWidth, setHeight } from '@js/core/utils/size'; +import { getOuterWidth, setHeight } from '@js/core/utils/size'; import { hasWindow } from '@js/core/utils/window'; import { getGlobalFormatByDataType } from '@ts/core/m_global_format_config'; // NOTE: Renovation component import. @@ -197,7 +197,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { private getWorkSpaceMinHeight() { let minHeight = this.getWorkSpaceHeight(); - const workspaceContainerHeight = getOuterHeight(this._$flexContainer, true); + const workspaceContainerHeight = this.getFlexContainerOuterHeight(); if (minHeight < workspaceContainerHeight) { minHeight = workspaceContainerHeight; 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 af47e5f5aa54..87541b56c792 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -311,8 +311,7 @@ class SchedulerWorkSpace extends Widget { private allDayPanels!: any[]; - // TODO: make private once external usages in m_timeline.ts are removed - _$flexContainer: any; + private $flexContainer: any; // TODO: make private once external usages in shaders, m_timeline.ts, m_work_space_indicator.ts are removed _shader: any; @@ -955,6 +954,14 @@ class SchedulerWorkSpace extends Widget { return getBoundingRect(this.$headerPanelContainer.get(0) as HTMLElement).height; } + getFlexContainerOuterHeight(): number { + if (!this.$flexContainer) { + return 0; + } + + return getOuterHeight(this.$flexContainer, true); + } + private getScrollbarWidth() { const containerElement = $(this._dateTableScrollable.container()).get(0) as HTMLElement; const scrollbarWidth = containerElement.offsetWidth - containerElement.clientWidth; @@ -2688,7 +2695,7 @@ class SchedulerWorkSpace extends Widget { 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(); @@ -2697,10 +2704,10 @@ class SchedulerWorkSpace extends Widget { this.$headerPanelContainer.append(this.$headerTablesContainer); this.$element().append(this.$headerPanelContainer); - this.$element().append(this._$flexContainer); + 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); @@ -2736,7 +2743,7 @@ 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, { From 06ec6f8ea3f37a89797afa1463c8c8b323ca3fb9 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 13:05:59 +0200 Subject: [PATCH 03/21] refactor: make allDayPanel private --- .../devextreme/eslint-scheduler-allowlist.mjs | 1 - .../shaders/current_time_shader_vertical.ts | 11 +++--- .../scheduler/workspaces/m_work_space.ts | 37 +++++++++++-------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index dd93caac6827..4130adba51cb 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -67,7 +67,6 @@ const schedulerR1Overrides = [ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts - '_$allDayPanel', '_$dateTable', '_$dateTableScrollableContent', '_$groupTable', 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..f9e2b978537e 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 @@ -3,7 +3,8 @@ 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'; +export const VERTICAL_DATE_TIME_SHADER_ALL_DAY_CLASS = 'dx-scheduler-date-time-shader-all-day'; + const DATE_TIME_SHADER_TOP_CLASS = 'dx-scheduler-date-time-shader-top'; const DATE_TIME_SHADER_BOTTOM_CLASS = 'dx-scheduler-date-time-shader-bottom'; @@ -120,12 +121,12 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { private renderAllDayShader(shaderWidth: number, i: number): void { if (this.workSpace.option('showAllDayPanel')) { - this.$allDayIndicator = $('
').addClass(DATE_TIME_SHADER_ALL_DAY_CLASS); + this.$allDayIndicator = $('
').addClass(VERTICAL_DATE_TIME_SHADER_ALL_DAY_CLASS); setHeight(this.$allDayIndicator, this.workSpace.getAllDayHeight()); setWidth(this.$allDayIndicator, shaderWidth); this.$allDayIndicator.css('left', this.getShaderOffset(i, shaderWidth)); - this.workSpace._$allDayPanel.prepend(this.$allDayIndicator); + this.workSpace.addAllDayShaderIndicator(this.$allDayIndicator); } } @@ -152,9 +153,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?.removeAllDayShaderIndicator(); } } 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 87541b56c792..092b67e4758d 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -71,7 +71,7 @@ import { CompactAppointmentsHelper } from '../m_compact_appointments_helper'; import type { SubscribeKey, SubscribeMethods } from '../m_subscribes'; import tableCreatorModule from '../m_table_creator'; import { utils } from '../m_utils'; -import VerticalShader from '../shaders/current_time_shader_vertical'; +import VerticalShader, { VERTICAL_DATE_TIME_SHADER_ALL_DAY_CLASS } from '../shaders/current_time_shader_vertical'; import type { ResourceLoader } from '../utils/loader/resource_loader'; import { getAppointmentGroupIndex, @@ -236,8 +236,7 @@ class SchedulerWorkSpace extends Widget { protected getToday?(): Date; - // TODO: make private once external usages in current_time_shader_vertical.ts are removed - _$allDayPanel: any; + private $allDayPanel: any; private $allDayTitle: any; @@ -673,7 +672,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); } @@ -962,6 +961,14 @@ class SchedulerWorkSpace extends Widget { return getOuterHeight(this.$flexContainer, true); } + addAllDayShaderIndicator($indicator: any): void { + this.$allDayPanel?.prepend($indicator); + } + + removeAllDayShaderIndicator(): void { + this.$allDayPanel?.find(`.${VERTICAL_DATE_TIME_SHADER_ALL_DAY_CLASS}`).remove(); + } + private getScrollbarWidth() { const containerElement = $(this._dateTableScrollable.container()).get(0) as HTMLElement; const scrollbarWidth = containerElement.offsetWidth - containerElement.clientWidth; @@ -1424,7 +1431,7 @@ class SchedulerWorkSpace extends Widget { } private domGetAllDayPanelCell(columnIndex) { - return this._$allDayPanel + return this.$allDayPanel .find('tr').eq(0) .find('td').eq(columnIndex); } @@ -2010,7 +2017,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))); } @@ -2058,7 +2065,7 @@ class SchedulerWorkSpace extends Widget { return [{}]; } - const allDayAppointmentContainer = this._$allDayPanel; + const allDayAppointmentContainer = this.$allDayPanel; const allDayPanelRect = getBoundingRect(allDayAppointmentContainer.get(0)); allDayCells.each((_, cell) => { @@ -2258,7 +2265,7 @@ class SchedulerWorkSpace extends Widget { this.createDragBehavior(this.getWorkArea(), $rootElement); if (!this.isVerticalGroupedWorkSpace()) { - this.createDragBehavior(this._$allDayPanel, $rootElement); + this.createDragBehavior(this.$allDayPanel, $rootElement); } } } @@ -2679,8 +2686,8 @@ class SchedulerWorkSpace extends Widget { ); 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(); @@ -2718,8 +2725,8 @@ class SchedulerWorkSpace extends Widget { this.$dateTableContainer.append(this.$allDayContainer); 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); } @@ -2992,11 +2999,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 = $('
') @@ -3006,7 +3013,7 @@ class SchedulerWorkSpace extends Widget { this.$allDayTable = $('
').attr('aria-hidden', true); - this._$allDayPanel = $('
') + this.$allDayPanel = $('
') .addClass(ALL_DAY_PANEL_CLASS) .append(this.$allDayTable); } From 6b2e365d2cac5fe74a4cf5407c72af38a8560882 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 13:08:31 +0200 Subject: [PATCH 04/21] refactor: make dataTable and dateTableScrollableContent protected --- .../devextreme/eslint-scheduler-allowlist.mjs | 2 - .../scheduler/workspaces/m_agenda.ts | 16 +++--- .../scheduler/workspaces/m_timeline.ts | 8 +-- .../scheduler/workspaces/m_work_space.ts | 50 +++++++++---------- .../workspaces/m_work_space_month.ts | 2 +- 5 files changed, 37 insertions(+), 41 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index 4130adba51cb..ba0ecdfaca4a 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -67,8 +67,6 @@ const schedulerR1Overrides = [ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts - '_$dateTable', - '_$dateTableScrollableContent', '_$groupTable', '_$thead', '_dateTableScrollable', diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 969eeda71374..767b8a273275 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -139,8 +139,8 @@ 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'); } @@ -306,7 +306,7 @@ class SchedulerAgenda extends WorkSpace { } protected override cleanView() { - this._$dateTable.empty(); + this.$dateTable.empty(); this.$timePanel.empty(); if (this._$groupTable) { @@ -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); + this.$dateTableScrollableContent.prepend(this._$groupTable); } - this._$dateTableScrollableContent.append(this.$timePanel, this.$dateTableContainer); + 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 eb0f2377c0e0..9fa12dbcbe5c 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -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; @@ -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(); } @@ -216,7 +216,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { protected override getCellElementByPosition(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() { 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 092b67e4758d..223799a36761 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -251,8 +251,7 @@ class SchedulerWorkSpace extends Widget { 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; @@ -299,8 +298,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; @@ -788,7 +786,7 @@ class SchedulerWorkSpace extends Widget { } setWidth(this.$headerPanel, width); - setWidth(this._$dateTable, width); + setWidth(this.$dateTable, width); if (this.$allDayTable) { setWidth(this.$allDayTable, width); } @@ -1407,7 +1405,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(); @@ -1423,7 +1421,7 @@ class SchedulerWorkSpace extends Widget { } private domGetDateCell(position) { - return this._$dateTable + return this.$dateTable .find(`tr:not(.${VIRTUAL_ROW_CLASS})`) .eq(position.rowIndex) .find(`td:not(.${VIRTUAL_CELL_CLASS})`) @@ -1461,7 +1459,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() @@ -1472,7 +1470,7 @@ class SchedulerWorkSpace extends Widget { } protected setHorizontalGroupHeaderCellsHeight() { - const { height } = getBoundingRect(this._$dateTable.get(0)); + const { height } = getBoundingRect(this.$dateTable.get(0)); setOuterHeight(this._$groupTable, height); } @@ -2153,7 +2151,7 @@ class SchedulerWorkSpace extends Widget { renderRDateTable() { utils.renovation.renderComponent( this, - this._$dateTable, + this.$dateTable, DateTableComponent, 'renovatedDateTable', this.getRDateTableProps(), @@ -2625,7 +2623,7 @@ class SchedulerWorkSpace extends Widget { 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(); @@ -2637,7 +2635,7 @@ 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); } @@ -2665,26 +2663,26 @@ 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.$dateTableScrollableContent.append( this._$groupTable, this.$timePanel, this.$dateTableContainer, ); this._dateTableScrollable.$content().append( - this._$dateTableScrollableContent, + this.$dateTableScrollableContent, ); 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); @@ -2716,10 +2714,10 @@ class SchedulerWorkSpace extends Widget { this.createSidebarScrollable(); 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); @@ -2768,7 +2766,7 @@ class SchedulerWorkSpace extends Widget { } private attachTableClasses() { - this.addTableClass(this._$dateTable, DATE_TABLE_CLASS); + this.addTableClass(this.$dateTable, DATE_TABLE_CLASS); if (this.isVerticalGroupedWorkSpace()) { const groupCount = this._getGroupCount(); @@ -2894,11 +2892,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() { @@ -2912,7 +2910,7 @@ class SchedulerWorkSpace extends Widget { this.cellsSelectionState.clearSelectedAndFocusedCells(); if (!this.isRenovatedRender()) { this._$thead.empty(); - this._$dateTable.empty(); + this.$dateTable.empty(); this.$timePanel.empty(); this._$groupTable.empty(); @@ -2935,7 +2933,7 @@ class SchedulerWorkSpace extends Widget { private cleanTableWidths() { this.$headerPanel.css('width', ''); - this._$dateTable.css('width', ''); + this.$dateTable.css('width', ''); this.$allDayTable?.css('width', ''); } @@ -3262,7 +3260,7 @@ class SchedulerWorkSpace extends Widget { protected renderDateTable() { 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), 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..40d4f7eb3bcf 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 @@ -135,7 +135,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { renderRDateTable() { utils.renovation.renderComponent( this, - this._$dateTable, + this.$dateTable, DateTableMonthComponent, 'renovatedDateTable', this.getRDateTableProps(), From bf233b81608c09de426a8b6dd64a8d8ced865f56 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 13:11:30 +0200 Subject: [PATCH 05/21] refactor: make dateTableScrollable protected --- .../devextreme/eslint-scheduler-allowlist.mjs | 1 - .../scheduler/shaders/current_time_shader.ts | 2 +- .../scheduler/workspaces/m_agenda.ts | 10 ++--- .../scheduler/workspaces/m_work_space.ts | 39 +++++++++---------- ..._work_space_grouped_strategy_horizontal.ts | 4 +- .../workspaces/m_work_space_indicator.ts | 4 +- .../currentTimeIndicator.tests.js | 2 +- 7 files changed, 30 insertions(+), 32 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index ba0ecdfaca4a..91c1a01a241d 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -69,7 +69,6 @@ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts '_$groupTable', '_$thead', - '_dateTableScrollable', '_getCellCount', '_getGroupCount', '_groupedStrategy', 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..cf1473312e2e 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.$dateTableScrollable.$content(); protected shader!: dxElementWrapper[]; diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 767b8a273275..cef5381c4507 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -93,7 +93,7 @@ class SchedulerAgenda extends WorkSpace { } } else if (!this._$groupTable) { this.initGroupTable(); - this._dateTableScrollable.$content().prepend(this._$groupTable); + this.$dateTableScrollable.$content().prepend(this._$groupTable); } super._optionChanged(args); break; @@ -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(); } @@ -327,14 +327,14 @@ class SchedulerAgenda extends WorkSpace { protected override createWorkSpaceStaticElements() { this.$dateTableContainer.append(this.$dateTable); - this._dateTableScrollable.$content().append(this.$dateTableScrollableContent); + this.$dateTableScrollable.$content().append(this.$dateTableScrollableContent); if (this._$groupTable) { this.$dateTableScrollableContent.prepend(this._$groupTable); } this.$dateTableScrollableContent.append(this.$timePanel, this.$dateTableContainer); - this.$element().append(this._dateTableScrollable.$element()); + this.$element().append(this.$dateTableScrollable.$element()); } protected override renderDateTable() { 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 223799a36761..080582514ae9 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; @@ -565,7 +564,7 @@ class SchedulerWorkSpace extends Widget { this.setSelectedCellsStateAndUpdateSelection(isNextCellAllDay, nextCellPosition, isMultiSelection, $cell); - this._dateTableScrollable.scrollToElement($cell); + this.$dateTableScrollable.scrollToElement($cell); } } @@ -968,7 +967,7 @@ class SchedulerWorkSpace extends Widget { } 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; } @@ -1155,7 +1154,7 @@ class SchedulerWorkSpace extends Widget { } protected updateScrollable() { - this._dateTableScrollable.update(); + this.$dateTableScrollable.update(); this.headerScrollable?.update(); this._sidebarScrollable?.update(); this.updateHeaderPanelScrollbarPadding(); @@ -1280,7 +1279,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); @@ -1295,11 +1294,11 @@ class SchedulerWorkSpace extends Widget { } getScrollable() { - return this._dateTableScrollable; + return this.$dateTableScrollable; } getScrollableScrollTop() { - return this._dateTableScrollable.scrollTop(); + return this.$dateTableScrollable.scrollTop(); } getGroupedScrollableScrollTop(allDay) { @@ -1307,15 +1306,15 @@ class SchedulerWorkSpace extends Widget { } 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() { @@ -1499,7 +1498,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; @@ -2445,7 +2444,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(); @@ -2650,8 +2649,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() { @@ -2672,7 +2671,7 @@ class SchedulerWorkSpace extends Widget { this.$timePanel, this.$dateTableContainer, ); - this._dateTableScrollable.$content().append( + this.$dateTableScrollable.$content().append( this.$dateTableScrollableContent, ); @@ -2682,7 +2681,7 @@ class SchedulerWorkSpace extends Widget { 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); @@ -2694,7 +2693,7 @@ class SchedulerWorkSpace extends Widget { this.$element() .append(this.$fixedContainer) .append(this.$headerPanelContainer) - .append(this._dateTableScrollable.$element()); + .append(this.$dateTableScrollable.$element()); } protected createWorkSpaceScrollableElements() { @@ -2712,12 +2711,12 @@ class SchedulerWorkSpace extends Widget { 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._dateTableScrollable.$content().append(this.$dateTableScrollableContent); + this.$dateTableScrollable.$content().append(this.$dateTableScrollableContent); if (this.isVerticalGroupedWorkSpace()) { this.$dateTableContainer.append(this.$allDayContainer); 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..bab6f2bb7303 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 @@ -154,7 +154,7 @@ class HorizontalGroupedStrategy { 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; + 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() { 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..790934720c98 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 @@ -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() { @@ -298,7 +298,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } const groupCount = this._getGroupCount() || 1; - const $container = this._dateTableScrollable.$content(); + const $container = this.$dateTableScrollable.$content(); const height = this.getIndicationHeight(); const rtlOffset = this.getRtlOffset(this.getCellWidth()); 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'); From b018c37208b3e1fadf4e8bf1de4097149ced0903 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 13:13:47 +0200 Subject: [PATCH 06/21] refactor: make shader protected --- packages/devextreme/eslint-scheduler-allowlist.mjs | 1 - .../js/__internal/scheduler/workspaces/m_timeline.ts | 2 +- .../js/__internal/scheduler/workspaces/m_work_space.ts | 7 +++---- .../scheduler/workspaces/m_work_space_indicator.ts | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index 91c1a01a241d..d96b337fa0c5 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -73,7 +73,6 @@ const schedulerLegacyMembers = [ '_getGroupCount', '_groupedStrategy', '_isHorizontalGroupedWorkSpace', - '_shader', '_sidebarScrollable', // m_scheduler.ts diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 9fa12dbcbe5c..01f5826a451b 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -360,7 +360,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { this.virtualScrollingDispatcher.updateDimensions(); } - this._shader = new HorizontalShader(this); + this.shader = new HorizontalShader(this); this.$sidebarTable.appendTo(this._sidebarScrollable.$content()); 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 080582514ae9..f22169264298 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -309,8 +309,7 @@ class SchedulerWorkSpace extends Widget { private $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; @@ -2841,7 +2840,7 @@ class SchedulerWorkSpace extends Widget { this.updateGroupTableHeight(); this.updateHeaderEmptyCellWidth(); - this._shader = new VerticalShader(this); + this.shader = new VerticalShader(this); } updateCellsSelection() { @@ -2917,7 +2916,7 @@ class SchedulerWorkSpace extends Widget { this.$sidebarTable?.empty(); } - this._shader?.clean(); + this.shader?.clean(); delete this.interval; } 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 790934720c98..34d6988b69c3 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 @@ -174,7 +174,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { renderCurrentDateTimeLineAndShader(): void { this.cleanDateTimeIndicator(); - this._shader?.clean(); + this.shader?.clean(); this.renderDateTimeIndication(); } @@ -290,7 +290,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } if (this.option('shadeUntilCurrentTime')) { - this._shader.render(); + this.shader.render(); } if (!this.isIndicationOnView() || !this.isIndicatorVisible()) { From e6974ceb07e310b5416d543c63fbbad2c6c62195 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 13:15:54 +0200 Subject: [PATCH 07/21] refactor: make groupTable protected --- .../devextreme/eslint-scheduler-allowlist.mjs | 1 - .../scheduler/workspaces/m_agenda.ts | 24 +++++++++---------- .../scheduler/workspaces/m_work_space.ts | 17 +++++++------ 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index d96b337fa0c5..c1b08cae7dc8 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -67,7 +67,6 @@ const schedulerR1Overrides = [ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts - '_$groupTable', '_$thead', '_getCellCount', '_getGroupCount', diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index cef5381c4507..663ce6a25150 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; @@ -147,7 +147,7 @@ class SchedulerAgenda extends WorkSpace { 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(); } @@ -246,7 +246,7 @@ class SchedulerAgenda extends WorkSpace { } protected override getGroupHeaderContainer() { - return this._$groupTable; + return this.$groupTable; } protected override makeGroupRows() { @@ -309,8 +309,8 @@ class SchedulerAgenda extends WorkSpace { this.$dateTable.empty(); this.$timePanel.empty(); - if (this._$groupTable) { - this._$groupTable.empty(); + if (this.$groupTable) { + this.$groupTable.empty(); } if (this.$noDataContainer) { @@ -329,8 +329,8 @@ class SchedulerAgenda extends WorkSpace { 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); 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 f22169264298..ba82427d424e 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -268,8 +268,7 @@ 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; @@ -1138,7 +1137,7 @@ class SchedulerWorkSpace extends Widget { protected getGroupHeaderContainer() { if (this.isVerticalGroupedWorkSpace()) { - return this._$groupTable; + return this.$groupTable; } return this._$thead; @@ -1325,7 +1324,7 @@ class SchedulerWorkSpace extends Widget { } getGroupTableWidth() { - return this._$groupTable ? getOuterWidth(this._$groupTable) : 0; + return this.$groupTable ? getOuterWidth(this.$groupTable) : 0; } getWorkSpaceLeftOffset() { @@ -1469,7 +1468,7 @@ class SchedulerWorkSpace extends Widget { protected setHorizontalGroupHeaderCellsHeight() { const { height } = getBoundingRect(this.$dateTable.get(0)); - setOuterHeight(this._$groupTable, height); + setOuterHeight(this.$groupTable, height); } protected getGroupHeaderCells() { @@ -2635,7 +2634,7 @@ class SchedulerWorkSpace extends Widget { this.$timePanel = $('
').addClass(TIME_PANEL_CLASS).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() { @@ -2666,7 +2665,7 @@ class SchedulerWorkSpace extends Widget { if (this.isVerticalGroupedWorkSpace()) { this.$dateTableContainer.append(this.$allDayContainer); this.$dateTableScrollableContent.append( - this._$groupTable, + this.$groupTable, this.$timePanel, this.$dateTableContainer, ); @@ -2719,7 +2718,7 @@ class SchedulerWorkSpace extends Widget { 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); @@ -2910,7 +2909,7 @@ class SchedulerWorkSpace extends Widget { this._$thead.empty(); this.$dateTable.empty(); this.$timePanel.empty(); - this._$groupTable.empty(); + this.$groupTable.empty(); this.$allDayTable?.empty(); this.$sidebarTable?.empty(); From 2d5713a2b4a0f635be996203da3d0342a74921fa Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 13:16:58 +0200 Subject: [PATCH 08/21] feat: make thead protected --- packages/devextreme/eslint-scheduler-allowlist.mjs | 1 - .../__internal/scheduler/workspaces/m_timeline.ts | 2 +- .../__internal/scheduler/workspaces/m_work_space.ts | 13 ++++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index c1b08cae7dc8..c0185b0e3856 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -67,7 +67,6 @@ const schedulerR1Overrides = [ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts - '_$thead', '_getCellCount', '_getGroupCount', '_groupedStrategy', diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 01f5826a451b..ef874c22a6c6 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -96,7 +96,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { protected override getGroupHeaderContainer() { if (this._isHorizontalGroupedWorkSpace()) { - return this._$thead; + return this.$thead; } return this.$sidebarTable; } 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 ba82427d424e..2eb50c439f10 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -270,8 +270,7 @@ class SchedulerWorkSpace extends Widget { protected $groupTable: any; - // TODO: make private once external usages in m_timeline.ts are removed - _$thead: any; + protected $thead: any; private headerScrollable: any; @@ -1140,11 +1139,11 @@ class SchedulerWorkSpace extends Widget { return this.$groupTable; } - return this._$thead; + return this.$thead; } private getDateHeaderContainer() { - return this._$thead; + return this.$thead; } private getCalculateHeaderCellRepeatCount() { @@ -2228,7 +2227,7 @@ class SchedulerWorkSpace extends Widget { utils.renovation.renderComponent( this, - this._$thead, + this.$thead, this.renovatedHeaderPanelComponent, 'renovatedHeaderPanel', { @@ -2614,7 +2613,7 @@ class SchedulerWorkSpace extends Widget { 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.$thead = $('').appendTo(this.$headerPanel); this.$headerPanelEmptyCell = $('
').addClass('dx-scheduler-header-panel-empty-cell'); this.$allDayTable = $('
').attr('aria-hidden', true); @@ -2906,7 +2905,7 @@ class SchedulerWorkSpace extends Widget { this.cleanTableWidths(); this.cellsSelectionState.clearSelectedAndFocusedCells(); if (!this.isRenovatedRender()) { - this._$thead.empty(); + this.$thead.empty(); this.$dateTable.empty(); this.$timePanel.empty(); this.$groupTable.empty(); From b522e91d911554ce3c17d8803a305e036fa0faaf Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 13:55:49 +0200 Subject: [PATCH 09/21] refactor: make _getCellCount public --- .../devextreme/eslint-scheduler-allowlist.mjs | 1 - .../scheduler/__tests__/workspace.base.test.ts | 4 ++-- .../shaders/current_time_shader_horizontal.ts | 4 ++-- .../__internal/scheduler/workspaces/m_agenda.ts | 2 +- .../scheduler/workspaces/m_timeline.ts | 8 ++++---- .../scheduler/workspaces/m_work_space.ts | 17 ++++++++--------- .../m_work_space_grouped_strategy_horizontal.ts | 14 +++++++------- .../m_work_space_grouped_strategy_vertical.ts | 2 +- .../workspaces/m_work_space_indicator.ts | 2 +- .../scheduler/workspaces/m_work_space_month.ts | 4 ++-- 10 files changed, 28 insertions(+), 30 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index c0185b0e3856..88244800bedd 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -67,7 +67,6 @@ const schedulerR1Overrides = [ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts - '_getCellCount', '_getGroupCount', '_groupedStrategy', '_isHorizontalGroupedWorkSpace', 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/shaders/current_time_shader_horizontal.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts index 5538b06e8fdf..612d4c41ac1f 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 @@ -34,7 +34,7 @@ class HorizontalCurrentTimeShader extends CurrentTimeShader { if (groupIndex >= 1) { const { workSpace } = this; - const indicationWidth = workSpace._getCellCount() * workSpace.getCellWidth(); + const indicationWidth = workSpace.getCellCount() * workSpace.getCellWidth(); $shader.css('left', indicationWidth); } else { $shader.css('left', 0); @@ -64,7 +64,7 @@ class HorizontalCurrentTimeShader extends CurrentTimeShader { this.applyShaderWidth($shader, shaderWidth); if (isFirstShaderPart) { - shaderLeft = workSpace._getCellCount() * workSpace.getCellWidth() * groupIndex; + shaderLeft = workSpace.getCellCount() * workSpace.getCellWidth() * groupIndex; } else { shaderLeft = workSpace.getCellWidth() * integerPart * workSpace._getGroupCount() + groupIndex * workSpace.getCellWidth(); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 663ce6a25150..1e7ae4094529 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -124,7 +124,7 @@ class SchedulerAgenda extends WorkSpace { return this.option('agendaDuration') as number; } - _getCellCount() { + getCellCount() { return 1; } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index ef874c22a6c6..2c48884cb397 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -208,7 +208,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { protected override getCellCoordinatesByIndex(index) { return { - columnIndex: index % this._getCellCount(), + columnIndex: index % this.getCellCount(), rowIndex: 0, }; } @@ -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); @@ -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,7 +499,7 @@ 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()), 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 2eb50c439f10..b96dfac9f868 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -833,8 +833,7 @@ class SchedulerWorkSpace extends Widget { }); } - // TODO: make private once external usages in grouped strategies, shaders, m_timeline.ts are removed - _getCellCount() { + getCellCount() { return this.viewDataProvider.getCellCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -1728,7 +1727,7 @@ class SchedulerWorkSpace extends Widget { } getGroupBoundsHorizontal(coordinates) { - const cellCount = this._getCellCount(); + const cellCount = this.getCellCount(); const $cells = this.getCells(); const cellWidth = this.getCellWidth(); @@ -2084,7 +2083,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, @@ -2099,7 +2098,7 @@ class SchedulerWorkSpace extends Widget { if (this.isGroupedByDate()) { validGroupIndex = Math.floor(columnIndex % this._getGroupCount()); } else if (this._isHorizontalGroupedWorkSpace()) { - validGroupIndex = Math.floor(columnIndex / this._getCellCount()); + validGroupIndex = Math.floor(columnIndex / this.getCellCount()); } const data: any = { @@ -3069,7 +3068,7 @@ 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(), groupByDate, @@ -3079,7 +3078,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 = []; @@ -3163,7 +3162,7 @@ class SchedulerWorkSpace extends Widget { } protected renderAllDayPanel(index?: any) { - let cellCount = this._getCellCount(); + let cellCount = this.getCellCount(); if (!this.isVerticalGroupedWorkSpace()) { cellCount *= this._getGroupCount() || 1; @@ -3239,7 +3238,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), }); 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 bab6f2bb7303..b7f55f3c5414 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,7 +15,7 @@ class HorizontalGroupedStrategy { if (!groupByDay) { return { rowIndex: cellCoordinates.rowIndex, - columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace._getCellCount(), + columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace.getCellCount(), }; } return { @@ -31,7 +31,7 @@ class HorizontalGroupedStrategy { if (groupByDay) { return columnIndex % groupCount; } - return Math.floor(columnIndex / this._workSpace._getCellCount()); + return Math.floor(columnIndex / this._workSpace.getCellCount()); } calculateHeaderCellRepeatCount() { @@ -45,7 +45,7 @@ class HorizontalGroupedStrategy { getTotalCellCount(groupCount) { groupCount = groupCount || 1; - return this._workSpace._getCellCount() * groupCount; + return this._workSpace.getCellCount() * groupCount; } getTotalRowCount() { @@ -143,7 +143,7 @@ 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; } @@ -153,7 +153,7 @@ class HorizontalGroupedStrategy { } getShaderOffset(i, width) { - const offset = this._workSpace._getCellCount() * this._workSpace.getCellWidth() * i; + 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; } @@ -200,7 +200,7 @@ class HorizontalGroupedStrategy { 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}`; } @@ -218,7 +218,7 @@ class HorizontalGroupedStrategy { 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 e27bdeca0c08..ecb479445174 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,7 +46,7 @@ class VerticalGroupedStrategy { } getTotalCellCount() { - return this._workSpace._getCellCount(); + return this._workSpace.getCellCount(); } getTotalRowCount() { 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 34d6988b69c3..58fa3ff0b9b8 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 @@ -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; 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 40d4f7eb3bcf..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, From 8c611b0e6b67fd0e6be008453ac158a84fbd3101 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 13:58:24 +0200 Subject: [PATCH 10/21] refactor: make getGroupCount public --- .../devextreme/eslint-scheduler-allowlist.mjs | 1 - .../js/__internal/scheduler/m_subscribes.ts | 2 +- .../shaders/current_time_shader_horizontal.ts | 4 +- .../shaders/current_time_shader_vertical.ts | 2 +- .../scheduler/workspaces/m_timeline.ts | 8 ++-- .../scheduler/workspaces/m_work_space.ts | 45 +++++++++---------- ..._work_space_grouped_strategy_horizontal.ts | 12 ++--- .../m_work_space_grouped_strategy_vertical.ts | 4 +- .../workspaces/m_work_space_indicator.ts | 4 +- 9 files changed, 40 insertions(+), 42 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index 88244800bedd..71c4d0f7cd45 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -67,7 +67,6 @@ const schedulerR1Overrides = [ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts - '_getGroupCount', '_groupedStrategy', '_isHorizontalGroupedWorkSpace', '_sidebarScrollable', 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_horizontal.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts index 612d4c41ac1f..8e071cd9b875 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 @@ -7,7 +7,7 @@ import CurrentTimeShader from './current_time_shader'; class HorizontalCurrentTimeShader extends CurrentTimeShader { renderShader(): void { const groupCount = this.workSpace._isHorizontalGroupedWorkSpace() - ? this.workSpace._getGroupCount() + ? this.workSpace.getGroupCount() : 1; for (let i = 0; i < groupCount; i += 1) { @@ -66,7 +66,7 @@ class HorizontalCurrentTimeShader extends CurrentTimeShader { if (isFirstShaderPart) { shaderLeft = workSpace.getCellCount() * workSpace.getCellWidth() * groupIndex; } else { - shaderLeft = workSpace.getCellWidth() * integerPart * workSpace._getGroupCount() + shaderLeft = workSpace.getCellWidth() * integerPart * workSpace.getGroupCount() + 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 f9e2b978537e..c4fa0622d194 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 @@ -25,7 +25,7 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { } setHeight(this.$shader, shaderHeight); - const groupCount = this.workSpace._getGroupCount() || 1; + const groupCount = this.workSpace.getGroupCount() || 1; if (this.workSpace.isGroupedByDate()) { this.renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 2c48884cb397..57ff315e5ea5 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -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(); } @@ -391,7 +391,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() - ? this._getGroupCount() + ? this.getGroupCount() : 1; return [...new Array(horizontalGroupCount)] @@ -415,7 +415,7 @@ 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 @@ -501,7 +501,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { }, 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 b96dfac9f868..3d9cb55691fd 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -364,7 +364,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, @@ -457,7 +457,7 @@ 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 focusedCellPosition = this.viewDataProvider.findCellPositionInMap({ @@ -772,7 +772,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; @@ -876,7 +876,7 @@ class SchedulerWorkSpace extends Widget { } generateRenderOptions(isProvideVirtualCellsWidth?: any): ViewDataProviderOptions { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); const groupOrientation = groupCount > 0 ? this.option('groupOrientation') @@ -1196,8 +1196,7 @@ class SchedulerWorkSpace extends Widget { ); } - // TODO: make private once external usages in grouped strategies, shaders, m_subscribes.ts, m_timeline.ts are removed - _getGroupCount() { + getGroupCount() { return this.resourceManager.groupCount(); } @@ -1572,7 +1571,7 @@ class SchedulerWorkSpace extends Widget { isGroupedByDate() { return this.option('groupByDate') && this._isHorizontalGroupedWorkSpace() - && this._getGroupCount() > 0; + && this.getGroupCount() > 0; } // TODO: refactor current time indicator @@ -1657,7 +1656,7 @@ class SchedulerWorkSpace extends Widget { 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(); @@ -1818,7 +1817,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(); @@ -1863,7 +1862,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; @@ -2096,7 +2095,7 @@ class SchedulerWorkSpace extends Widget { let validGroupIndex = groupIndex || 0; if (this.isGroupedByDate()) { - validGroupIndex = Math.floor(columnIndex % this._getGroupCount()); + validGroupIndex = Math.floor(columnIndex % this.getGroupCount()); } else if (this._isHorizontalGroupedWorkSpace()) { validGroupIndex = Math.floor(columnIndex / this.getCellCount()); } @@ -2493,7 +2492,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), @@ -2543,7 +2542,7 @@ class SchedulerWorkSpace extends Widget { rtlEnabled: this.option('rtlEnabled'), startViewDate: this.getStartViewDate(), isVerticalGrouping: this.isVerticalGroupedWorkSpace(), - groupCount: this._getGroupCount(), + groupCount: this.getGroupCount(), isVirtualScrolling: this.isVirtualScrolling(), getDOMMetaDataCallback: this.getDOMElementsMetaData.bind(this), }); @@ -2764,7 +2763,7 @@ class SchedulerWorkSpace extends Widget { 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); @@ -2815,7 +2814,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() { @@ -2979,7 +2978,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++) { @@ -3036,7 +3035,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')); @@ -3070,7 +3069,7 @@ class SchedulerWorkSpace extends Widget { }, this.getCellCount() || 1, this.option('resourceCellTemplate'), - this._getGroupCount(), + this.getGroupCount(), groupByDate, ); } @@ -3094,7 +3093,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; @@ -3112,7 +3111,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; @@ -3165,7 +3164,7 @@ class SchedulerWorkSpace extends Widget { let cellCount = this.getCellCount(); if (!this.isVerticalGroupedWorkSpace()) { - cellCount *= this._getGroupCount() || 1; + cellCount *= this.getGroupCount() || 1; } const cellTemplates = this.renderTableBody({ @@ -3187,7 +3186,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); @@ -3253,7 +3252,7 @@ class SchedulerWorkSpace extends Widget { } protected renderDateTable() { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); this.renderTableBody({ container: getPublicElement(this.$dateTable), rowCount: this.getTotalRowCount(groupCount), 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 b7f55f3c5414..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 @@ -20,13 +20,13 @@ class HorizontalGroupedStrategy { } 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; @@ -35,7 +35,7 @@ class HorizontalGroupedStrategy { } calculateHeaderCellRepeatCount() { - return this._workSpace._getGroupCount() || 1; + return this._workSpace.getGroupCount() || 1; } insertAllDayRowsIntoDateTable() { @@ -149,7 +149,7 @@ class HorizontalGroupedStrategy { } 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) { @@ -197,7 +197,7 @@ 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) { @@ -215,7 +215,7 @@ 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) { 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 ecb479445174..9ee1b63c9373 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 @@ -50,11 +50,11 @@ class VerticalGroupedStrategy { } 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() { 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 58fa3ff0b9b8..33b02f5f81a0 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 @@ -274,7 +274,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } const verticalGroupCount = this.isVerticalGroupedWorkSpace() - ? this._getGroupCount() + ? this.getGroupCount() : 1; return [...new Array(verticalGroupCount)] @@ -297,7 +297,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return; } - const groupCount = this._getGroupCount() || 1; + const groupCount = this.getGroupCount() || 1; const $container = this.$dateTableScrollable.$content(); const height = this.getIndicationHeight(); const rtlOffset = this.getRtlOffset(this.getCellWidth()); From e8374cf1b2dc9d176fbcc623cfd388001cbaa2a3 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 14:03:03 +0200 Subject: [PATCH 11/21] refactor: make groupedStrategy protected --- .../devextreme/eslint-scheduler-allowlist.mjs | 1 - .../scheduler/workspaces/m_timeline.ts | 2 +- .../scheduler/workspaces/m_work_space.ts | 50 +++++++++---------- .../workspaces/m_work_space_indicator.ts | 2 +- .../timeline.markup.tests.js | 4 +- .../workSpace.markup-0.tests.js | 2 +- .../workSpace.markup-1.tests.js | 2 +- 7 files changed, 30 insertions(+), 33 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index 71c4d0f7cd45..4c3e8535e7e5 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -67,7 +67,6 @@ const schedulerR1Overrides = [ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts - '_groupedStrategy', '_isHorizontalGroupedWorkSpace', '_sidebarScrollable', diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 57ff315e5ea5..3058699decc2 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -214,7 +214,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } protected override getCellElementByPosition(cellCoordinates, groupIndex) { - const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex); + const indexes = this.groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex); return this.$dateTable .find('tr') 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 3d9cb55691fd..68ffd5cb5ef9 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -241,8 +241,7 @@ class SchedulerWorkSpace extends Widget { 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; @@ -676,7 +675,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 @@ -795,7 +794,7 @@ class SchedulerWorkSpace extends Widget { } getWorkSpaceMinWidth() { - return this._groupedStrategy.getWorkSpaceMinWidth(); + return this.groupedStrategy.getWorkSpaceMinWidth(); } _dimensionChanged() { @@ -1146,7 +1145,7 @@ class SchedulerWorkSpace extends Widget { } private getCalculateHeaderCellRepeatCount() { - return this._groupedStrategy.calculateHeaderCellRepeatCount(); + return this.groupedStrategy.calculateHeaderCellRepeatCount(); } protected updateScrollable() { @@ -1169,11 +1168,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; @@ -1183,7 +1182,7 @@ class SchedulerWorkSpace extends Widget { } private getGroupIndex(rowIndex, columnIndex) { - return this._groupedStrategy.getGroupIndex(rowIndex, columnIndex); + return this.groupedStrategy.getGroupIndex(rowIndex, columnIndex); } calculateEndDate(startDate) { @@ -1297,7 +1296,7 @@ class SchedulerWorkSpace extends Widget { } getGroupedScrollableScrollTop(allDay) { - return this._groupedStrategy.getScrollableScrollTop(allDay); + return this.groupedStrategy.getScrollableScrollTop(allDay); } getScrollableScrollLeft() { @@ -1325,7 +1324,7 @@ class SchedulerWorkSpace extends Widget { } getWorkSpaceLeftOffset() { - return this._groupedStrategy.getLeftOffset(); + return this.groupedStrategy.getLeftOffset(); } protected getCellCoordinatesByIndex(index) { @@ -1410,7 +1409,7 @@ 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); } @@ -1649,7 +1648,7 @@ class SchedulerWorkSpace extends Widget { } getAllDayOffset() { - return this._groupedStrategy.getAllDayOffset(); + return this.groupedStrategy.getAllDayOffset(); } // NOTE: refactor leftIndex calculation @@ -1711,7 +1710,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); @@ -1722,7 +1721,7 @@ class SchedulerWorkSpace extends Widget { getGroupBoundsVertical(groupIndex) { const $firstAndLastCells = this.getFirstAndLastDataTableCell(); - return this._groupedStrategy.getGroupBoundsOffset(groupIndex, $firstAndLastCells); + return this.groupedStrategy.getGroupBoundsOffset(groupIndex, $firstAndLastCells); } getGroupBoundsHorizontal(coordinates) { @@ -1731,7 +1730,7 @@ class SchedulerWorkSpace extends Widget { const cellWidth = this.getCellWidth(); const { groupedDataMap } = this.viewDataProvider; - return this._groupedStrategy + return this.groupedStrategy .getGroupBoundsOffset(cellCount, $cells, cellWidth, coordinates, groupedDataMap); } @@ -2537,7 +2536,6 @@ 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(), @@ -2567,7 +2565,7 @@ class SchedulerWorkSpace extends Widget { ? VerticalGroupedStrategy : HorizontalGroupedStrategy; - this._groupedStrategy = new Strategy(this); + this.groupedStrategy = new Strategy(this); } protected getDefaultGroupStrategy() { @@ -2597,14 +2595,14 @@ 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() { @@ -2864,7 +2862,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); } @@ -2949,7 +2947,7 @@ class SchedulerWorkSpace extends Widget { } getGroupedStrategy() { - return this._groupedStrategy; + return this.groupedStrategy; } getFixedContainer() { @@ -3157,7 +3155,7 @@ 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) { @@ -3197,11 +3195,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()) { @@ -3247,7 +3245,7 @@ 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; } @@ -3286,7 +3284,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_indicator.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts index 33b02f5f81a0..ccf89893a02d 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); } } 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) { From df3c2fbafbc72efe056721bcd426284b4c03b53b Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 14:07:16 +0200 Subject: [PATCH 12/21] refactor: make isHorizontalGroupedWorkSpace public --- packages/devextreme/eslint-scheduler-allowlist.mjs | 1 - .../shaders/current_time_shader_horizontal.ts | 2 +- .../js/__internal/scheduler/workspaces/m_timeline.ts | 10 +++++----- .../__internal/scheduler/workspaces/m_work_space.ts | 11 +++++------ 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index 4c3e8535e7e5..624da7e959c0 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -67,7 +67,6 @@ const schedulerR1Overrides = [ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts - '_isHorizontalGroupedWorkSpace', '_sidebarScrollable', // m_scheduler.ts 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 8e071cd9b875..ebd14218d654 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 @@ -6,7 +6,7 @@ import CurrentTimeShader from './current_time_shader'; class HorizontalCurrentTimeShader extends CurrentTimeShader { renderShader(): void { - const groupCount = this.workSpace._isHorizontalGroupedWorkSpace() + const groupCount = this.workSpace.isHorizontalGroupedWorkSpace() ? this.workSpace.getGroupCount() : 1; diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 3058699decc2..9ab7c4dd3db4 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; @@ -95,7 +95,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } protected override getGroupHeaderContainer() { - if (this._isHorizontalGroupedWorkSpace()) { + if (this.isHorizontalGroupedWorkSpace()) { return this.$thead; } return this.$sidebarTable; @@ -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() { @@ -390,7 +390,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return []; } - const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() + const horizontalGroupCount = this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() ? this.getGroupCount() : 1; @@ -422,7 +422,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { : 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); 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 68ffd5cb5ef9..d9d3f19e7f53 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -458,7 +458,7 @@ class SchedulerWorkSpace extends Widget { const isRTL = this.isRTL(); 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, @@ -645,8 +645,7 @@ 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() { + isHorizontalGroupedWorkSpace() { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'horizontal'; } @@ -1569,7 +1568,7 @@ class SchedulerWorkSpace extends Widget { isGroupedByDate() { return this.option('groupByDate') - && this._isHorizontalGroupedWorkSpace() + && this.isHorizontalGroupedWorkSpace() && this.getGroupCount() > 0; } @@ -2095,7 +2094,7 @@ class SchedulerWorkSpace extends Widget { if (this.isGroupedByDate()) { validGroupIndex = Math.floor(columnIndex % this.getGroupCount()); - } else if (this._isHorizontalGroupedWorkSpace()) { + } else if (this.isHorizontalGroupedWorkSpace()) { validGroupIndex = Math.floor(columnIndex / this.getCellCount()); } @@ -3139,7 +3138,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); From c79b4d20a1656382f516f4c07d0025846cce8b9f Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 14:07:41 +0200 Subject: [PATCH 13/21] refactor: make $sidebarScrollable protected --- packages/devextreme/eslint-scheduler-allowlist.mjs | 2 -- .../js/__internal/scheduler/workspaces/m_timeline.ts | 2 +- .../__internal/scheduler/workspaces/m_work_space.ts | 11 +++++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index 624da7e959c0..cfc95be9fd47 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -67,8 +67,6 @@ const schedulerR1Overrides = [ const schedulerLegacyMembers = [ // workspaces/m_work_space.ts - '_sidebarScrollable', - // m_scheduler.ts '_appointments', '_compactAppointmentsHelper', diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 9ab7c4dd3db4..aa0e53061501 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -362,7 +362,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { this.shader = new HorizontalShader(this); - this.$sidebarTable.appendTo(this._sidebarScrollable.$content()); + this.$sidebarTable.appendTo(this.$sidebarScrollable.$content()); if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); 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 d9d3f19e7f53..bdab745ad27d 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -273,8 +273,7 @@ class SchedulerWorkSpace extends Widget { private headerScrollable: any; - // TODO: make private once external usages in m_timeline.ts are removed - _sidebarScrollable: any; + protected $sidebarScrollable: any; private preventDefaultDragging: any; @@ -1150,7 +1149,7 @@ class SchedulerWorkSpace extends Widget { protected updateScrollable() { this.$dateTableScrollable.update(); this.headerScrollable?.update(); - this._sidebarScrollable?.update(); + this.$sidebarScrollable?.update(); this.updateHeaderPanelScrollbarPadding(); } @@ -2719,7 +2718,7 @@ class SchedulerWorkSpace extends Widget { this.$sidebarScrollableContent.append(this.$timePanel); } - this._sidebarScrollable.$content().append(this.$sidebarScrollableContent); + this.$sidebarScrollable.$content().append(this.$sidebarScrollableContent); } private appendHeaderPanelEmptyCellIfNecessary() { @@ -2742,7 +2741,7 @@ class SchedulerWorkSpace extends Widget { .appendTo(this.$flexContainer); // @ts-expect-error - this._sidebarScrollable = this._createComponent($timePanelScrollable, Scrollable, { + this.$sidebarScrollable = this._createComponent($timePanelScrollable, Scrollable, { useKeyboard: false, showScrollbar: 'never', direction: 'vertical', @@ -2753,7 +2752,7 @@ 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() { From 378193b54920f2b57e319886cba683bae3a754ec Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 14:29:12 +0200 Subject: [PATCH 14/21] fix: fix build --- .../js/__internal/scheduler/shaders/current_time_shader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cf1473312e2e..785eebe413e2 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[]; From 3f2c14142609ead377dfd9c91398bd25d78d8c1a Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 7 May 2026 14:31:29 +0200 Subject: [PATCH 15/21] refactor: undo renaming --- .../scheduler/shaders/current_time_shader_vertical.ts | 4 ++-- .../js/__internal/scheduler/workspaces/m_work_space.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 c4fa0622d194..aa9eced20c58 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 @@ -3,7 +3,7 @@ import { setHeight, setWidth } from '@js/core/utils/size'; import CurrentTimeShader from './current_time_shader'; -export const VERTICAL_DATE_TIME_SHADER_ALL_DAY_CLASS = 'dx-scheduler-date-time-shader-all-day'; +export const DATE_TIME_SHADER_ALL_DAY_CLASS = 'dx-scheduler-date-time-shader-all-day'; const DATE_TIME_SHADER_TOP_CLASS = 'dx-scheduler-date-time-shader-top'; const DATE_TIME_SHADER_BOTTOM_CLASS = 'dx-scheduler-date-time-shader-bottom'; @@ -121,7 +121,7 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { private renderAllDayShader(shaderWidth: number, i: number): void { if (this.workSpace.option('showAllDayPanel')) { - this.$allDayIndicator = $('
').addClass(VERTICAL_DATE_TIME_SHADER_ALL_DAY_CLASS); + this.$allDayIndicator = $('
').addClass(DATE_TIME_SHADER_ALL_DAY_CLASS); setHeight(this.$allDayIndicator, this.workSpace.getAllDayHeight()); setWidth(this.$allDayIndicator, shaderWidth); this.$allDayIndicator.css('left', this.getShaderOffset(i, shaderWidth)); 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 bdab745ad27d..4d69f14f2c34 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -71,7 +71,7 @@ import { CompactAppointmentsHelper } from '../m_compact_appointments_helper'; import type { SubscribeKey, SubscribeMethods } from '../m_subscribes'; import tableCreatorModule from '../m_table_creator'; import { utils } from '../m_utils'; -import VerticalShader, { VERTICAL_DATE_TIME_SHADER_ALL_DAY_CLASS } from '../shaders/current_time_shader_vertical'; +import VerticalShader, { DATE_TIME_SHADER_ALL_DAY_CLASS } from '../shaders/current_time_shader_vertical'; import type { ResourceLoader } from '../utils/loader/resource_loader'; import { getAppointmentGroupIndex, @@ -956,7 +956,7 @@ class SchedulerWorkSpace extends Widget { } removeAllDayShaderIndicator(): void { - this.$allDayPanel?.find(`.${VERTICAL_DATE_TIME_SHADER_ALL_DAY_CLASS}`).remove(); + this.$allDayPanel?.find(`.${DATE_TIME_SHADER_ALL_DAY_CLASS}`).remove(); } private getScrollbarWidth() { From 38ac1e1eb214392f52dfff3a6dc10e1499f6706d Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 8 May 2026 12:48:04 +0200 Subject: [PATCH 16/21] refactor: remove m_work_space line from eslint config --- packages/devextreme/eslint-scheduler-allowlist.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/devextreme/eslint-scheduler-allowlist.mjs b/packages/devextreme/eslint-scheduler-allowlist.mjs index cfc95be9fd47..86c2fe0292fd 100644 --- a/packages/devextreme/eslint-scheduler-allowlist.mjs +++ b/packages/devextreme/eslint-scheduler-allowlist.mjs @@ -66,7 +66,6 @@ const schedulerR1Overrides = [ ]; const schedulerLegacyMembers = [ - // workspaces/m_work_space.ts // m_scheduler.ts '_appointments', '_compactAppointmentsHelper', From 0396bca6b96dc64bc2210291fccd99269903334b Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 8 May 2026 13:41:23 +0200 Subject: [PATCH 17/21] refactor: make isHorizontalGroupedWorkSpace getCellCount getGroupCount protected --- .../__tests__/workspace.base.test.ts | 4 +- .../scheduler/shaders/current_time_shader.ts | 7 ++-- .../shaders/current_time_shader_horizontal.ts | 37 +++++++++++-------- .../shaders/current_time_shader_vertical.ts | 4 +- .../scheduler/workspaces/m_work_space.ts | 6 +-- .../workspaces/m_work_space_indicator.ts | 6 ++- 6 files changed, 38 insertions(+), 26 deletions(-) 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 5af4bb554e4e..86fc8771ebac 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.generateRenderOptions().cellCount).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.generateRenderOptions().cellCount).toBe(6); }); it('should skip configured hidden days when incrementing timeline header dates', () => { 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 785eebe413e2..ef569d2d2a90 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader.ts @@ -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 ebd14218d654..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 aa9eced20c58..bedb33560d84 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 @@ -15,7 +15,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; @@ -25,7 +26,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); 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 4d69f14f2c34..ff0ee29a545b 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -644,7 +644,7 @@ class SchedulerWorkSpace extends Widget { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'vertical'; } - isHorizontalGroupedWorkSpace() { + protected isHorizontalGroupedWorkSpace() { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'horizontal'; } @@ -830,7 +830,7 @@ class SchedulerWorkSpace extends Widget { }); } - getCellCount() { + protected getCellCount() { return this.viewDataProvider.getCellCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -1193,7 +1193,7 @@ class SchedulerWorkSpace extends Widget { ); } - getGroupCount() { + protected getGroupCount() { return this.resourceManager.groupCount(); } 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 ccf89893a02d..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 @@ -290,7 +290,11 @@ 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()) { From 85f321efc9620560de89ef5eac43aee4f45ec504 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 8 May 2026 13:59:18 +0200 Subject: [PATCH 18/21] refactor: delete public methods for headerPanel, flexContainer, allDayShaderIndicator --- .../shaders/current_time_shader_vertical.ts | 9 ++++-- .../scheduler/workspaces/m_timeline.ts | 4 +-- .../scheduler/workspaces/m_work_space.ts | 32 +++---------------- .../m_work_space_grouped_strategy_vertical.ts | 6 +++- 4 files changed, 18 insertions(+), 33 deletions(-) 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 bedb33560d84..7d0e9b6629e2 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 @@ -5,6 +5,8 @@ import CurrentTimeShader from './current_time_shader'; export 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'; @@ -126,7 +128,10 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { setWidth(this.$allDayIndicator, shaderWidth); this.$allDayIndicator.css('left', this.getShaderOffset(i, shaderWidth)); - this.workSpace.addAllDayShaderIndicator(this.$allDayIndicator); + const $allDayPanel = this.workSpace.$element().find(`.${ALL_DAY_PANEL_CLASS}`); + if ($allDayPanel.length) { + $allDayPanel.first().prepend(this.$allDayIndicator); + } } } @@ -153,7 +158,7 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { clean(): void { super.clean(); - this.workSpace?.removeAllDayShaderIndicator(); + this.workSpace?.$element().find(`.${DATE_TIME_SHADER_ALL_DAY_CLASS}`).remove(); } } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index aa0e53061501..0743ed592dfa 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -4,7 +4,7 @@ import { noop } from '@js/core/utils/common'; import dateUtils from '@js/core/utils/date'; import { extend } from '@js/core/utils/extend'; import { getBoundingRect } from '@js/core/utils/position'; -import { getOuterWidth, setHeight } from '@js/core/utils/size'; +import { getOuterHeight, getOuterWidth, setHeight } from '@js/core/utils/size'; import { hasWindow } from '@js/core/utils/window'; import { getGlobalFormatByDataType } from '@ts/core/m_global_format_config'; // NOTE: Renovation component import. @@ -197,7 +197,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { private getWorkSpaceMinHeight() { let minHeight = this.getWorkSpaceHeight(); - const workspaceContainerHeight = this.getFlexContainerOuterHeight(); + const workspaceContainerHeight = this.$flexContainer ? getOuterHeight(this.$flexContainer, true) : 0; if (minHeight < workspaceContainerHeight) { minHeight = workspaceContainerHeight; 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 ff0ee29a545b..4b14657fce59 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -71,7 +71,7 @@ import { CompactAppointmentsHelper } from '../m_compact_appointments_helper'; import type { SubscribeKey, SubscribeMethods } from '../m_subscribes'; import tableCreatorModule from '../m_table_creator'; import { utils } from '../m_utils'; -import VerticalShader, { DATE_TIME_SHADER_ALL_DAY_CLASS } from '../shaders/current_time_shader_vertical'; +import VerticalShader from '../shaders/current_time_shader_vertical'; import type { ResourceLoader } from '../utils/loader/resource_loader'; import { getAppointmentGroupIndex, @@ -235,7 +235,7 @@ class SchedulerWorkSpace extends Widget { protected getToday?(): Date; - private $allDayPanel: any; + protected $allDayPanel: any; private $allDayTitle: any; @@ -285,7 +285,7 @@ class SchedulerWorkSpace extends Widget { positionHelper!: PositionHelper; - private $headerPanelContainer: any; + protected $headerPanelContainer: any; private $headerTablesContainer: any; @@ -303,7 +303,7 @@ class SchedulerWorkSpace extends Widget { private allDayPanels!: any[]; - private $flexContainer: any; + protected $flexContainer: any; protected shader: any; @@ -935,30 +935,6 @@ class SchedulerWorkSpace extends Widget { } } - getHeaderPanelContainerHeight(): number { - if (!hasWindow() || !this.$headerPanelContainer) { - return 0; - } - - return getBoundingRect(this.$headerPanelContainer.get(0) as HTMLElement).height; - } - - getFlexContainerOuterHeight(): number { - if (!this.$flexContainer) { - return 0; - } - - return getOuterHeight(this.$flexContainer, true); - } - - addAllDayShaderIndicator($indicator: any): void { - this.$allDayPanel?.prepend($indicator); - } - - removeAllDayShaderIndicator(): void { - this.$allDayPanel?.find(`.${DATE_TIME_SHADER_ALL_DAY_CLASS}`).remove(); - } - private getScrollbarWidth() { const containerElement = $(this.$dateTableScrollable.container()).get(0) as HTMLElement; const scrollbarWidth = containerElement.offsetWidth - containerElement.clientWidth; 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 9ee1b63c9373..0c1820634d28 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 @@ -1,4 +1,5 @@ import { getBoundingRect } from '@js/core/utils/position'; +import { hasWindow } from '@js/core/utils/window'; import { calculateDayDuration, getVerticalGroupCountClass } from '@ts/scheduler/r1/utils/index'; import { WORK_SPACE_BORDER_PX } from '@ts/scheduler/workspaces/const'; @@ -92,7 +93,10 @@ class VerticalGroupedStrategy { const dayHeight = (calculateDayDuration(startDayHour, endDayHour) / hoursInterval) * this._workSpace.getCellHeight(); const scrollTop = this.getScrollableScrollTop(); - const headerRowHeight = this._workSpace.getHeaderPanelContainerHeight(); + let headerRowHeight = 0; + if (hasWindow() && this._workSpace.$headerPanelContainer) { + headerRowHeight = getBoundingRect(this._workSpace.$headerPanelContainer.get(0) as HTMLElement).height; + } let topOffset = groupIndex * dayHeight + headerRowHeight + this._workSpace.option('getHeaderHeight')() - scrollTop; From e04be268bcfc218f9b72deab08343a98c4c53da4 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 8 May 2026 14:09:05 +0200 Subject: [PATCH 19/21] fix: fix test --- .../js/__internal/scheduler/__tests__/workspace.base.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 86fc8771ebac..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.generateRenderOptions().cellCount).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.generateRenderOptions().cellCount).toBe(6); + expect((workspace as any).getCellCount()).toBe(6); }); it('should skip configured hidden days when incrementing timeline header dates', () => { From e9d4c03401809fbd258133b31cc717ac036ea532 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 8 May 2026 14:10:43 +0200 Subject: [PATCH 20/21] refactor: undo export --- .../scheduler/shaders/current_time_shader_vertical.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7d0e9b6629e2..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 @@ -3,7 +3,7 @@ import { setHeight, setWidth } from '@js/core/utils/size'; import CurrentTimeShader from './current_time_shader'; -export const DATE_TIME_SHADER_ALL_DAY_CLASS = 'dx-scheduler-date-time-shader-all-day'; +const DATE_TIME_SHADER_ALL_DAY_CLASS = 'dx-scheduler-date-time-shader-all-day'; const ALL_DAY_PANEL_CLASS = 'dx-scheduler-all-day-panel'; From f6265861ad2a5adffc4d0010a5fb67d61ad17026 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 8 May 2026 14:18:33 +0200 Subject: [PATCH 21/21] refactor: undo refactor changes --- .../js/__internal/scheduler/workspaces/m_timeline.ts | 2 +- .../workspaces/m_work_space_grouped_strategy_vertical.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 0743ed592dfa..307884cfc2e2 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -197,7 +197,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { private getWorkSpaceMinHeight() { let minHeight = this.getWorkSpaceHeight(); - const workspaceContainerHeight = this.$flexContainer ? getOuterHeight(this.$flexContainer, true) : 0; + const workspaceContainerHeight = getOuterHeight(this.$flexContainer, true); if (minHeight < workspaceContainerHeight) { minHeight = workspaceContainerHeight; 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 0c1820634d28..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 @@ -1,5 +1,4 @@ import { getBoundingRect } from '@js/core/utils/position'; -import { hasWindow } from '@js/core/utils/window'; import { calculateDayDuration, getVerticalGroupCountClass } from '@ts/scheduler/r1/utils/index'; import { WORK_SPACE_BORDER_PX } from '@ts/scheduler/workspaces/const'; @@ -93,10 +92,7 @@ class VerticalGroupedStrategy { const dayHeight = (calculateDayDuration(startDayHour, endDayHour) / hoursInterval) * this._workSpace.getCellHeight(); const scrollTop = this.getScrollableScrollTop(); - let headerRowHeight = 0; - if (hasWindow() && this._workSpace.$headerPanelContainer) { - headerRowHeight = getBoundingRect(this._workSpace.$headerPanelContainer.get(0) as HTMLElement).height; - } + const headerRowHeight = getBoundingRect(this._workSpace.$headerPanelContainer.get(0)).height; let topOffset = groupIndex * dayHeight + headerRowHeight + this._workSpace.option('getHeaderHeight')() - scrollTop;