From e2eb07219ce3265c607518e555ede5f92f6c9497 Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Thu, 5 Mar 2026 06:28:46 -0300 Subject: [PATCH 1/3] =?UTF-8?q?Scheduler=20=E2=80=94=20Replace=20underscor?= =?UTF-8?q?e-prefixed:=20Workspace=20group=20(agenda,=20timeline,=20month,?= =?UTF-8?q?=20indicator)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduler/workspaces/m_agenda.ts | 98 +++++++++---------- .../scheduler/workspaces/m_timeline.ts | 53 +++++----- .../scheduler/workspaces/m_timeline_day.ts | 2 +- .../scheduler/workspaces/m_timeline_month.ts | 2 +- .../scheduler/workspaces/m_timeline_week.ts | 4 +- .../workspaces/m_timeline_work_week.ts | 4 +- .../workspaces/m_work_space_indicator.ts | 63 ++++++------ .../workspaces/m_work_space_month.ts | 6 +- 8 files changed, 121 insertions(+), 111 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index a0986d0bbe4d..b13a0a80c9dd 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -41,13 +41,13 @@ const INNER_CELL_MARGIN = 5; const OUTER_CELL_MARGIN = 20; class SchedulerAgenda extends WorkSpace { - _startViewDate: any; + private startViewDate: any; - _rows: number[][] = []; + private rows: number[][] = []; - _$rows: any; + private $rows: any; - _$noDataContainer: any; + private $noDataContainer: any; // eslint-disable-next-line class-methods-use-this protected _activeStateUnit(): string { @@ -57,7 +57,7 @@ class SchedulerAgenda extends WorkSpace { get type() { return VIEWS.AGENDA; } getStartViewDate() { - return this._startViewDate; + return this.startViewDate; } _init() { @@ -82,7 +82,7 @@ class SchedulerAgenda extends WorkSpace { break; case 'noDataText': case 'rowHeight': - this._recalculateAgenda(this._rows); + this.recalculateAgenda(this.rows); break; case 'groups': if (!value?.length) { @@ -92,7 +92,7 @@ class SchedulerAgenda extends WorkSpace { this._detachGroupCountClass(); } } else if (!this._$groupTable) { - this._initGroupTable(); + this.initGroupTable(); this._dateTableScrollable.$content().prepend(this._$groupTable); } super._optionChanged(args); @@ -136,17 +136,17 @@ class SchedulerAgenda extends WorkSpace { _updateAllDayVisibility() { return noop(); } - _updateAllDayHeight() { return noop(); } + private updateAllDayHeight() { return noop(); } _initWorkSpaceUnits() { - this._initGroupTable(); + 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._$dateTableContainer = $('
').addClass('dx-scheduler-date-table-container'); } - _initGroupTable() { + private initGroupTable() { const groups = this.option('groups'); if (groups?.length) { this._$groupTable = $('
').attr('aria-hidden', true).addClass(GROUP_TABLE_CLASS); @@ -154,23 +154,23 @@ class SchedulerAgenda extends WorkSpace { } _renderView() { - this._startViewDate = agendaUtils.calculateStartViewDate(this.option('currentDate') as any, this.option('startDayHour') as any); - this._rows = []; + this.startViewDate = agendaUtils.calculateStartViewDate(this.option('currentDate') as any, this.option('startDayHour') as any); + this.rows = []; } - _recalculateAgenda(rows) { + private recalculateAgenda(rows) { let cellTemplates = []; this._cleanView(); - if (this._rowsIsEmpty(rows)) { - this._renderNoData(); + if (this.rowsIsEmpty(rows)) { + this.renderNoData(); return; } - this._rows = rows; + this.rows = rows; if (this._$groupTable) { cellTemplates = this._renderGroupHeader(); - this._setGroupHeaderCellsHeight(); + this.setGroupHeaderCellsHeight(); } this._renderTimePanel(); @@ -179,11 +179,11 @@ class SchedulerAgenda extends WorkSpace { this._dateTableScrollable.update(); } - _renderNoData() { - this._$noDataContainer = $('
').addClass(NODATA_CONTAINER_CLASS) + 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); } _setTableSizes() { return noop(); } @@ -193,9 +193,9 @@ class SchedulerAgenda extends WorkSpace { // eslint-disable-next-line @typescript-eslint/no-unused-vars _createCrossScrollingConfig(argument?: any) { return noop(); } - _setGroupHeaderCellsHeight() { + private setGroupHeaderCellsHeight() { const $cells = this._getGroupHeaderCells().filter((_, element) => !element.getAttribute('rowSpan')); - const rows = this._removeEmptyRows(this._rows); + const rows = this.removeEmptyRows(this.rows); if (!rows.length) { return; @@ -203,11 +203,11 @@ class SchedulerAgenda extends WorkSpace { for (let i = 0; i < $cells.length; i++) { const $cellContent = $cells.eq(i).find('.dx-scheduler-group-header-content'); - setOuterHeight($cellContent, this._getGroupRowHeight(rows[i])); + setOuterHeight($cellContent, this.getGroupRowHeight(rows[i])); } } - _rowsIsEmpty(rows) { + private rowsIsEmpty(rows) { let result = true; for (let i = 0; i < rows.length; i++) { @@ -229,7 +229,7 @@ class SchedulerAgenda extends WorkSpace { (this.$element() as any).addClass(className); } - _removeEmptyRows(rows) { + private removeEmptyRows(rows) { const result: any[] = []; const isEmpty = function (data) { return !data.some((value) => value > 0); @@ -312,11 +312,11 @@ class SchedulerAgenda extends WorkSpace { this._$groupTable.empty(); } - if (this._$noDataContainer) { - this._$noDataContainer.empty(); - this._$noDataContainer.remove(); + if (this.$noDataContainer) { + this.$noDataContainer.empty(); + this.$noDataContainer.remove(); - delete this._$noDataContainer; + delete this.$noDataContainer; } } @@ -348,13 +348,13 @@ class SchedulerAgenda extends WorkSpace { _attachEvents() { return noop(); } - _cleanCellDataCache() { return noop(); } + private cleanCellDataCache() { return noop(); } isIndicationAvailable() { return false; } - _prepareCellTemplateOptions(text, date, rowIndex, $cell) { + private prepareCellTemplateOptions(text, date, rowIndex, $cell) { const leaf = this.resourceManager.groupsLeafs[rowIndex]; const groups = leaf?.grouped ?? {}; const groupIndex = leaf?.groupIndex; @@ -376,7 +376,7 @@ class SchedulerAgenda extends WorkSpace { const cellTemplates: any[] = []; const cellTemplateOpt = options.cellTemplate; - this._$rows = []; + this.$rows = []; let i; const fillTableBody = function (rowIndex, rowSize) { @@ -386,7 +386,7 @@ class SchedulerAgenda extends WorkSpace { let cellDayName; const $row = $('
'); const $td = $('').append(this._$rows)); + $(options.container).append($('').append(this.$rows)); this._applyCellTemplates(cellTemplates); } - _setLastRowClass() { - if (this._rows.length > 1 && this._$rows.length) { - const $lastRow = this._$rows[this._$rows.length - 1]; + private setLastRowClass() { + if (this.rows.length > 1 && this.$rows.length) { + const $lastRow = this.$rows[this.$rows.length - 1]; $lastRow.addClass(LAST_ROW_CLASS); } @@ -440,25 +440,25 @@ class SchedulerAgenda extends WorkSpace { rowClass: TIME_PANEL_ROW_CLASS, cellClass: TIME_PANEL_CELL_CLASS, cellTemplate: this.option('dateCellTemplate'), - getStartDate: this._getTimePanelStartDate.bind(this), + getStartDate: this.getTimePanelStartDate.bind(this), }); } - _getTimePanelStartDate(rowIndex) { + private getTimePanelStartDate(rowIndex) { const current = new Date(this.option('currentDate') as any); const cellDate = new Date(current.setDate(current.getDate() + rowIndex)); return cellDate; } - _getRowHeight(rowSize) { + private getRowHeight(rowSize) { const baseHeight = this.option('rowHeight') as any; const innerOffset = (rowSize - 1) * INNER_CELL_MARGIN; return rowSize ? (baseHeight * rowSize) + innerOffset + OUTER_CELL_MARGIN : 0; } - _getGroupRowHeight(groupRows) { + private getGroupRowHeight(groupRows) { if (!groupRows) { return; } @@ -466,7 +466,7 @@ class SchedulerAgenda extends WorkSpace { let result = 0; for (let i = 0; i < groupRows.length; i++) { - result += this._getRowHeight(groupRows[i]); + result += this.getRowHeight(groupRows[i]); } return result; @@ -481,7 +481,7 @@ class SchedulerAgenda extends WorkSpace { this.getStartViewDate(), this.resourceManager.groupCount(), ); - this._recalculateAgenda(rows); + this.recalculateAgenda(rows); } getAgendaVerticalStepHeight() { @@ -536,7 +536,7 @@ class SchedulerAgenda extends WorkSpace { renovatedRenderSupported() { return false; } - _setSelectedCellsByCellData() {} + private setSelectedCellsByCellData() {} _getIntervalDuration() { return dateUtils.dateToMilliseconds('day') * (this.option('intervalCount') as any); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index d6fa88fbfd59..5cf5f19df4c1 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -59,7 +59,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return 'shorttime'; } - _getWorkSpaceHeight() { + private getWorkSpaceHeight() { if (this.option('crossScrollingEnabled') && hasWindow()) { return getBoundingRect(this._$dateTable.get(0)).height; } @@ -103,22 +103,24 @@ class SchedulerTimeline extends SchedulerWorkSpace { return false; } - _needRenderWeekHeader() { + // Overridden in SchedulerTimelineDay, SchedulerTimelineWeek + needRenderWeekHeader() { return false; } - _incrementDate(date) { + // Overridden in SchedulerTimelineWeek, SchedulerTimelineWorkWeek + incrementDate(date) { date.setDate(date.getDate() + 1); } getIndicationCellCount() { - const timeDiff = this._getTimeDiff(); - return this._calculateDurationInCells(timeDiff); + const timeDiff = this.getTimeDiff(); + return this.calculateDurationInCells(timeDiff); } - _getTimeDiff() { + private getTimeDiff() { let today = this._getToday(); - const date = this._getIndicationFirstViewDate(); + const date = this.getIndicationFirstViewDate(); const startViewDate = this.getStartViewDate(); const dayLightOffset = timezoneUtils.getDaylightOffsetInMs(startViewDate, today); @@ -130,7 +132,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { return today.getTime() - date.getTime(); } - _calculateDurationInCells(timeDiff) { + // Overridden in SchedulerTimelineMonth + calculateDurationInCells(timeDiff) { const today = this._getToday(); const differenceInDays = Math.floor(timeDiff / toMs('day')); let duration = (timeDiff - differenceInDays * toMs('day') - (this.option('startDayHour') as any) * toMs('hour')) / this.getCellDuration(); @@ -156,26 +159,26 @@ class SchedulerTimeline extends SchedulerWorkSpace { return this.getIndicationCellCount() * this.getCellWidth(); } - _isVerticalShader() { + isVerticalShader() { return false; } - _isCurrentTimeHeaderCell() { + isCurrentTimeHeaderCell() { return false; } _setTableSizes() { super._setTableSizes(); - const minHeight = this._getWorkSpaceMinHeight(); + const minHeight = this.getWorkSpaceMinHeight(); setHeight(this._$sidebarTable, minHeight); setHeight(this._$dateTable, minHeight); this.virtualScrollingDispatcher.updateDimensions(); } - _getWorkSpaceMinHeight() { - let minHeight = this._getWorkSpaceHeight(); + private getWorkSpaceMinHeight() { + let minHeight = this.getWorkSpaceHeight(); const workspaceContainerHeight = getOuterHeight(this._$flexContainer, true); @@ -207,7 +210,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return getOuterWidth(this._$dateTable, true); } - _getIndicationFirstViewDate() { + private getIndicationFirstViewDate() { return dateUtils.trimTime(new Date(this.getStartViewDate())); } @@ -291,7 +294,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return { ...options, - isGenerateWeekDaysHeaderData: this._needRenderWeekHeader(), + isGenerateWeekDaysHeaderData: this.needRenderWeekHeader(), getDateForHeaderText: timelineWeekUtils.getDateForHeaderText, }; } @@ -328,7 +331,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { _updateAllDayVisibility() { return noop(); } - _updateAllDayHeight() { return noop(); } + private updateAllDayHeight() { return noop(); } _getDateHeaderTemplate() { return this.option('timeCellTemplate'); @@ -366,7 +369,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { .find(`.${HEADER_PANEL_CELL_CLASS}:not(.${HEADER_PANEL_WEEK_CELL_CLASS})`); } - _getCurrentTimePanelCellIndices() { + getCurrentTimePanelCellIndices() { const columnCountPerGroup = this._getCellCount(); const today = this._getToday(); const index = this.getCellIndexByDate(today); @@ -396,7 +399,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { _renderDateHeader() { const $headerRow = super._renderDateHeader(); - if (this._needRenderWeekHeader()) { + if (this.needRenderWeekHeader()) { const firstViewDate = new Date(this.getStartViewDate()); let currentDate = new Date(firstViewDate); @@ -445,7 +448,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { if ((templateIndex % cellsInGroup) === (cellsInGroup - 1)) { currentDate = new Date(firstViewDate); } else { - this._incrementDate(currentDate); + this.incrementDate(currentDate); } } @@ -454,18 +457,18 @@ class SchedulerTimeline extends SchedulerWorkSpace { } } - _renderIndicator(height, rtlOffset, $container, groupCount) { + renderIndicator(height, rtlOffset, $container, groupCount) { let $indicator; const width = this.getIndicationWidth(); if (this.option('groupOrientation') === 'vertical') { - $indicator = this._createIndicator($container); + $indicator = this.createIndicator($container); setHeight($indicator, getBoundingRect($container.get(0)).height); $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; - $indicator = this._createIndicator($container); + $indicator = this.createIndicator($container); setHeight($indicator, getBoundingRect($container.get(0)).height); $indicator.css('left', rtlOffset ? rtlOffset - width - offset : width + offset); @@ -495,16 +498,16 @@ class SchedulerTimeline extends SchedulerWorkSpace { // Old render methods. // TODO Old render: delete these methods with the old render. - _setCurrentTimeCells(): void { + setCurrentTimeCells(): void { const timePanelCells = this._getTimePanelCells(); - const currentTimeCellIndices = this._getCurrentTimePanelCellIndices(); + const currentTimeCellIndices = this.getCurrentTimePanelCellIndices(); currentTimeCellIndices.forEach((timePanelCellIndex) => { timePanelCells.eq(timePanelCellIndex) .addClass(HEADER_CURRENT_TIME_CELL_CLASS); }); } - _cleanCurrentTimeCells(): void { + cleanCurrentTimeCells(): void { (this.$element() as any) .find(`.${HEADER_CURRENT_TIME_CELL_CLASS}`) .removeClass(HEADER_CURRENT_TIME_CELL_CLASS); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts index 6bfe83908d05..ba68aeba60d9 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts @@ -12,7 +12,7 @@ class SchedulerTimelineDay extends SchedulerTimeline { return TIMELINE_CLASS; } - _needRenderWeekHeader() { + needRenderWeekHeader() { return this._isWorkSpaceWithCount(); } } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts index 78b3a8d04e13..010831319013 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts @@ -30,7 +30,7 @@ class SchedulerTimelineMonth extends SchedulerTimeline { return this.option('dateCellTemplate'); } - _calculateDurationInCells(timeDiff) { + calculateDurationInCells(timeDiff) { return timeDiff / this.getCellDuration(); } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts index c2a78f0fed29..e86c251899be 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts @@ -17,11 +17,11 @@ export default class SchedulerTimelineWeek extends SchedulerTimeline { return getBoundingRect($headerRow.children().first().get(0)).width; } - _needRenderWeekHeader() { + needRenderWeekHeader() { return true; } - _incrementDate(date) { + incrementDate(date) { date.setDate(date.getDate() + 1); } } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_work_week.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_work_week.ts index aa98995aa062..490ccbe4e5d5 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_work_week.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_work_week.ts @@ -23,12 +23,12 @@ class SchedulerTimelineWorkWeek extends SchedulerTimelineWeek { return TIMELINE_CLASS; } - _incrementDate(date) { + incrementDate(date) { const day = date.getDay(); if (day === LAST_DAY_WEEK_INDEX) { date.setDate(date.getDate() + 2); } - super._incrementDate(date); + super.incrementDate(date); } } 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 8a4873193229..f68afbd4b91d 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 @@ -18,7 +18,7 @@ const SCHEDULER_DATE_TIME_INDICATOR_CLASS = 'dx-scheduler-date-time-indicator'; const TIME_PANEL_CURRENT_TIME_CELL_CLASS = 'dx-scheduler-time-panel-current-time-cell'; class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { - _indicatorInterval: any; + private indicatorInterval: any; // @ts-expect-error _getToday() { @@ -59,11 +59,12 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return dateUtils.dateInRange(today, firstViewDate, endViewDate); } - _renderIndicator(height, rtlOffset, $container, groupCount) { + // Overridden in SchedulerTimeline + renderIndicator(height, rtlOffset, $container, groupCount) { const groupedByDate = this.isGroupedByDate(); const repeatCount = groupedByDate ? 1 : groupCount; for (let i = 0; i < repeatCount; i++) { - const $indicator = this._createIndicator($container); + const $indicator = this.createIndicator($container); setWidth( $indicator, @@ -73,14 +74,15 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } } - _createIndicator($container) { + // Called from SchedulerTimeline._renderIndicator + createIndicator($container) { const $indicator = $('
').addClass(SCHEDULER_DATE_TIME_INDICATOR_CLASS); $container.append($indicator); return $indicator; } - _getRtlOffset(width) { + private getRtlOffset(width) { return this.option('rtlEnabled') ? getBoundingRect(this._dateTableScrollable.$content().get(0)).width - this.getTimePanelWidth() - width : 0; } @@ -89,27 +91,28 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return; } - this._clearIndicatorUpdateInterval(); + this.clearIndicatorUpdateInterval(); - this._indicatorInterval = setInterval(() => { + this.indicatorInterval = setInterval(() => { this.renderCurrentDateTimeIndication(); }, this.option('indicatorUpdateInterval')); } - _clearIndicatorUpdateInterval() { - if (this._indicatorInterval) { - clearInterval(this._indicatorInterval); - delete this._indicatorInterval; + private clearIndicatorUpdateInterval() { + if (this.indicatorInterval) { + clearInterval(this.indicatorInterval); + delete this.indicatorInterval; } } - _isVerticalShader() { + // Overridden in SchedulerTimeline + isVerticalShader() { return true; } getIndicationWidth() { const cellCount = this._getCellCount(); - const cellSpan = Math.min(this._getIndicatorDaysSpan(), cellCount); + const cellSpan = Math.min(this.getIndicatorDaysSpan(), cellCount); const width = cellSpan * this.getCellWidth(); const maxWidth = this.getCellWidth() * cellCount; @@ -117,13 +120,13 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } getIndicatorOffset() { - const cellSpan = this._getIndicatorDaysSpan() - 1; + const cellSpan = this.getIndicatorDaysSpan() - 1; const offset = cellSpan * this.getCellWidth(); return offset; } - _getIndicatorDaysSpan(): number { + private getIndicatorDaysSpan(): number { const today = this._getToday(); const viewStartTime = this.getStartViewDate().getTime(); let timeDiff = today.getTime() - viewStartTime; @@ -152,7 +155,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } _dispose() { - this._clearIndicatorUpdateInterval(); + this.clearIndicatorUpdateInterval(); super._dispose.apply(this, arguments as any); } @@ -171,12 +174,13 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } renderCurrentDateTimeLineAndShader(): void { - this._cleanDateTimeIndicator(); + this.cleanDateTimeIndicator(); this._shader?.clean(); this._renderDateTimeIndication(); } - _isCurrentTimeHeaderCell(headerIndex: number): boolean { + // Overridden in SchedulerTimeline + isCurrentTimeHeaderCell(headerIndex: number): boolean { if (this.isIndicationOnView()) { const { completeDateHeaderMap } = this.viewDataProvider; const date = completeDateHeaderMap[completeDateHeaderMap.length - 1][headerIndex].startDate; @@ -190,7 +194,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { _getHeaderPanelCellClass(i) { const cellClass = super._getHeaderPanelCellClass(i); - if (this._isCurrentTimeHeaderCell(i)) { + if (this.isCurrentTimeHeaderCell(i)) { return `${cellClass} ${HEADER_CURRENT_TIME_CELL_CLASS}`; } @@ -200,7 +204,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { _cleanView() { super._cleanView(); - this._cleanDateTimeIndicator(); + this.cleanDateTimeIndicator(); } _dimensionChanged() { @@ -209,7 +213,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { this.renderCurrentDateTimeLineAndShader(); } - _cleanDateTimeIndicator() { + private cleanDateTimeIndicator() { (this.$element() as any).find(`.${SCHEDULER_DATE_TIME_INDICATOR_CLASS}`).remove(); } @@ -252,7 +256,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { }); } - _getCurrentTimePanelCellIndices() { + // Overridden in SchedulerTimeline + getCurrentTimePanelCellIndices() { const rowCountPerGroup = this._getTimePanelRowCount(); const today = this._getToday(); const index = this.getCellIndexByDate(today); @@ -298,28 +303,30 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { const groupCount = this._getGroupCount() || 1; const $container = this._dateTableScrollable.$content(); const height = this.getIndicationHeight(); - const rtlOffset = this._getRtlOffset(this.getCellWidth()); + const rtlOffset = this.getRtlOffset(this.getCellWidth()); - this._renderIndicator(height, rtlOffset, $container, groupCount); + this.renderIndicator(height, rtlOffset, $container, groupCount); // TODO Old render: delete this code with the old render. if (!this.isRenovatedRender()) { - this._setCurrentTimeCells(); + this.setCurrentTimeCells(); } } // Temporary new render methods. // TODO Old render: replace base call methods by these after the deleting of the old render. - protected _setCurrentTimeCells(): void { + // Overridden in SchedulerTimeline + setCurrentTimeCells(): void { const timePanelCells = this._getTimePanelCells(); - const currentTimeCellIndices = this._getCurrentTimePanelCellIndices(); + const currentTimeCellIndices = this.getCurrentTimePanelCellIndices(); currentTimeCellIndices.forEach((timePanelCellIndex) => { timePanelCells.eq(timePanelCellIndex) .addClass(TIME_PANEL_CURRENT_TIME_CELL_CLASS); }); } - protected _cleanCurrentTimeCells(): void { + // Overridden in SchedulerTimeline + cleanCurrentTimeCells(): void { (this.$element() as any) .find(`.${TIME_PANEL_CURRENT_TIME_CELL_CLASS}`) .removeClass(TIME_PANEL_CURRENT_TIME_CELL_CLASS); 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 9c06047ee21b..93845ae4cb91 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 @@ -156,7 +156,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { _updateAllDayVisibility() { return noop(); } - _updateAllDayHeight() { return noop(); } + private updateAllDayHeight() { return noop(); } // -------------- // These methods should be deleted when we get rid of old render @@ -166,7 +166,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { _renderAllDayPanel() { return noop(); } - _setMonthClassesToCell($cell, data) { + private setMonthClassesToCell($cell, data) { $cell .toggleClass(DATE_TABLE_CURRENT_DATE_CLASS, data.isCurrentDate) .toggleClass(DATE_TABLE_FIRST_OF_MONTH_CLASS, data.isFirstDayMonthHighlighting) @@ -182,7 +182,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { return monthUtils.getCellText(date, this.option('intervalCount') as any); }; options.getCellTextClass = DATE_TABLE_CELL_TEXT_CLASS; - options.setAdditionalClasses = this._setMonthClassesToCell.bind(this); + options.setAdditionalClasses = this.setMonthClassesToCell.bind(this); super._renderTableBody(options); } From c6cb0f5b418126767990c1f10735581c8897017e Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Thu, 5 Mar 2026 17:42:10 -0300 Subject: [PATCH 2/3] test(Scheduler): update agenda tests for renamed private methods --- .../DevExpress.ui.widgets.scheduler/agenda.tests.js | 6 +++--- .../integration.agenda.tests.js | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js index 59d1e9e0439d..10d90a2efe0d 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js @@ -33,7 +33,7 @@ module('Agenda', {}, () => { const config = { onContentReady: e => { e.component._renderView(); - e.component._recalculateAgenda(rows); + e.component.recalculateAgenda(rows); }, getResourceManager: getEmptyResourceManager, }; @@ -65,7 +65,7 @@ module('Agenda', {}, () => { const rows = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 1], [0, 0, 0, 0, 0], [1, 1, 1, 0, 1]]; const instance = createInstance(); - const resultRows = instance._removeEmptyRows(rows); + const resultRows = instance.removeEmptyRows(rows); assert.deepEqual(resultRows, [[0, 0, 0, 0, 1], [1, 1, 1, 0, 1]], 'The empty rows was removed'); }); @@ -140,7 +140,7 @@ module('Agenda', {}, () => { test('Agenda should be recalculated after rowHeight changed', async function(assert) { const instance = createInstance(); - const recalculateStub = sinon.stub(instance, '_recalculateAgenda'); + const recalculateStub = sinon.stub(instance, 'recalculateAgenda'); instance.option('rowHeight', 100); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.agenda.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.agenda.tests.js index d37ed230f5f5..bf9e6e10f6f9 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.agenda.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.agenda.tests.js @@ -786,7 +786,7 @@ module('Integration: Agenda', moduleConfig, () => { const rowHeight = 77; const $element = instance.$element(); const expectedWidth = getOuterWidth($element.find('.dx-scheduler-date-table')); - const agendaStub = sinon.stub(agenda, '_getRowHeight').returns(rowHeight); + const agendaStub = sinon.stub(agenda, 'getRowHeight').returns(rowHeight); try { instance.option('dataSource', [ @@ -1565,7 +1565,7 @@ module('Integration: Agenda', moduleConfig, () => { instance.option('dataSource', data); await waitAsync(0); - const calculatedRows = agendaWorkspace._rows[0]; + const calculatedRows = agendaWorkspace.rows[0]; assert.equal(calculatedRows.length, 65, 'Rows are OK'); $.each(calculatedRows, function(index, item) { @@ -1606,7 +1606,7 @@ module('Integration: Agenda', moduleConfig, () => { instance.option('dataSource', data); await waitAsync(0); - const calculatedRows = agendaWorkspace._rows; + const calculatedRows = agendaWorkspace.rows; assert.deepEqual(calculatedRows, [[1, 2, 2, 2, 2]], 'Rows are OK'); } finally { endViewDateStub.restore(); @@ -1640,7 +1640,7 @@ module('Integration: Agenda', moduleConfig, () => { instance.option('dataSource', data); await waitAsync(0); - const calculatedRows = agendaWorkspace._rows; + const calculatedRows = agendaWorkspace.rows; assert.deepEqual(calculatedRows, [[0, 1, 1, 1, 0]], 'Rows are OK'); } finally { endViewDateStub.restore(); @@ -1671,7 +1671,7 @@ module('Integration: Agenda', moduleConfig, () => { instance.option('dataSource', data); await waitAsync(0); - const calculatedRows = agendaWorkspace._rows; + const calculatedRows = agendaWorkspace.rows; assert.deepEqual(calculatedRows, [[1, 1, 1, 1, 0]], 'Rows are OK'); } finally { endViewDateStub.restore(); @@ -1709,7 +1709,7 @@ module('Integration: Agenda', moduleConfig, () => { instance.option('dataSource', data); await waitAsync(0); - const calculatedRows = agendaWorkspace._rows; + const calculatedRows = agendaWorkspace.rows; assert.deepEqual(calculatedRows, [[0, 1, 1, 0, 1, 1, 0]], 'Rows are OK'); } finally { endViewDateStub.restore(); From 087d578791f0f1336f56d44ed21ddd1a5aef43c6 Mon Sep 17 00:00:00 2001 From: Aleksey Semikozov Date: Thu, 5 Mar 2026 18:20:05 -0300 Subject: [PATCH 3/3] refactor(Scheduler): address Copilot review comments for workspace PR - m_work_space_indicator.ts: revert createIndicator to _createIndicator (used in subclass, cannot be private), remove stale comment - m_timeline.ts: update calls to _createIndicator - agenda.tests.js: update test name to match renamed method --- .../js/__internal/scheduler/workspaces/m_timeline.ts | 4 ++-- .../scheduler/workspaces/m_work_space_indicator.ts | 5 ++--- .../tests/DevExpress.ui.widgets.scheduler/agenda.tests.js | 2 +- 3 files changed, 5 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 5cf5f19df4c1..3f5aa1cba268 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -462,13 +462,13 @@ class SchedulerTimeline extends SchedulerWorkSpace { const width = this.getIndicationWidth(); if (this.option('groupOrientation') === 'vertical') { - $indicator = this.createIndicator($container); + $indicator = this._createIndicator($container); setHeight($indicator, getBoundingRect($container.get(0)).height); $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; - $indicator = this.createIndicator($container); + $indicator = this._createIndicator($container); setHeight($indicator, getBoundingRect($container.get(0)).height); $indicator.css('left', rtlOffset ? rtlOffset - width - offset : width + offset); 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 f68afbd4b91d..284dc958f464 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 @@ -64,7 +64,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { const groupedByDate = this.isGroupedByDate(); const repeatCount = groupedByDate ? 1 : groupCount; for (let i = 0; i < repeatCount; i++) { - const $indicator = this.createIndicator($container); + const $indicator = this._createIndicator($container); setWidth( $indicator, @@ -74,8 +74,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } } - // Called from SchedulerTimeline._renderIndicator - createIndicator($container) { + _createIndicator($container) { const $indicator = $('
').addClass(SCHEDULER_DATE_TIME_INDICATOR_CLASS); $container.append($indicator); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js index 10d90a2efe0d..8fc531502a38 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js @@ -61,7 +61,7 @@ module('Agenda', {}, () => { assert.deepEqual(firstViewDate, new Date(2016, 1, 17, 2), 'The first view date is OK'); }); - test('_removeEmptyRows method', async function(assert) { + test('removeEmptyRows method', async function(assert) { const rows = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 1], [0, 0, 0, 0, 0], [1, 1, 1, 0, 1]]; const instance = createInstance();
'); - setHeight($td, this._getRowHeight(rowSize)); + setHeight($td, this.getRowHeight(rowSize)); if (options.getStartDate) { date = options.getStartDate?.(rowIndex); @@ -395,7 +395,7 @@ class SchedulerAgenda extends WorkSpace { } if (cellTemplateOpt?.render) { - const templateOptions = this._prepareCellTemplateOptions(`${cellDateNumber} ${cellDayName}`, date, i, $td); + const templateOptions = this.prepareCellTemplateOptions(`${cellDateNumber} ${cellDayName}`, date, i, $td); cellTemplates.push(cellTemplateOpt.render.bind(cellTemplateOpt, templateOptions)); } else if (cellDateNumber && cellDayName) { @@ -411,22 +411,22 @@ class SchedulerAgenda extends WorkSpace { } $row.append($td); - this._$rows.push($row); + this.$rows.push($row); } }.bind(this); - for (i = 0; i < this._rows.length; i++) { - each(this._rows[i], fillTableBody); - this._setLastRowClass(); + for (i = 0; i < this.rows.length; i++) { + each(this.rows[i], fillTableBody); + this.setLastRowClass(); } - $(options.container).append($('