From bf54c105f08c75f1fea2bddfb09a314cb4faf0a4 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 11:51:50 +0100 Subject: [PATCH 01/28] fix: refactor one by one --- .../js/__internal/scheduler/m_scheduler.ts | 2 +- .../js/__internal/scheduler/m_subscribes.ts | 2 +- .../scheduler/workspaces/m_agenda.ts | 24 +-- .../scheduler/workspaces/m_timeline.ts | 12 +- .../scheduler/workspaces/m_work_space.ts | 142 +++++++++--------- .../workspaces/m_work_space_indicator.ts | 4 +- .../workspaces/m_work_space_month.ts | 14 +- 7 files changed, 98 insertions(+), 102 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts index 71112c6772fe..58db4409fc8c 100644 --- a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts @@ -1253,7 +1253,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { getResizableStep: () => (this._workSpace ? this._workSpace.positionHelper.getResizableStep() : 0), getDOMElementsMetaData: () => this._workSpace?.getDOMElementsMetaData(), getViewDataProvider: () => this._workSpace?.viewDataProvider, - isVerticalGroupedWorkSpace: () => this._workSpace._isVerticalGroupedWorkSpace(), + isVerticalGroupedWorkSpace: () => this._workSpace.isVerticalGroupedWorkSpace(), isDateAndTimeView: () => isDateAndTimeView(this._workSpace.type), onContentReady: () => { this._workSpace?.option('allDayExpanded', this._isAllDayExpanded()); diff --git a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts index b7729a458ae8..7c2da2efc39a 100644 --- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts +++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts @@ -167,7 +167,7 @@ const subscribes = { }; } - if (!allDay && VERTICAL_VIEW_TYPES.includes(this.currentView.type) && this._workSpace._isVerticalGroupedWorkSpace()) { + if (!allDay && VERTICAL_VIEW_TYPES.includes(this.currentView.type) && this._workSpace.isVerticalGroupedWorkSpace()) { const verticalGroupBounds = this._workSpace.getGroupBounds(options.coordinates); return { left: 0, diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 8fae5e0ef063..f082ffb4f747 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -114,7 +114,7 @@ class SchedulerAgenda extends WorkSpace { return false; } - _isVerticalGroupedWorkSpace() { + isVerticalGroupedWorkSpace() { return false; } @@ -134,11 +134,11 @@ class SchedulerAgenda extends WorkSpace { return 1; } - _getTimePanelRowCount() { + getTimePanelRowCount() { return this.option('agendaDuration') as number; } - _renderAllDayPanel() { return noop(); } + renderAllDayPanel() { return noop(); } _updateAllDayVisibility() { return noop(); } @@ -180,8 +180,8 @@ class SchedulerAgenda extends WorkSpace { this._setGroupHeaderCellsHeight(); } - this._renderTimePanel(); - this._renderDateTable(); + this.renderTimePanel(); + this.renderDateTable(); (this.invoke as any)('onAgendaReady', rows); this._applyCellTemplates(cellTemplates); this._dateTableScrollable.update(); @@ -252,7 +252,7 @@ class SchedulerAgenda extends WorkSpace { return result; } - _getGroupHeaderContainer() { + getGroupHeaderContainer() { return this._$groupTable; } @@ -344,8 +344,8 @@ class SchedulerAgenda extends WorkSpace { this.$element().append(this._dateTableScrollable.$element()); } - _renderDateTable() { - this._renderTableBody({ + renderDateTable() { + this.renderTableBody({ container: getPublicElement(this._$dateTable), rowClass: DATE_TABLE_ROW_CLASS, cellClass: this._getDateTableCellClass(), @@ -380,7 +380,7 @@ class SchedulerAgenda extends WorkSpace { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - _renderTableBody(options: any, delayCellTemplateRendering?: any) { + renderTableBody(options: any, delayCellTemplateRendering?: any) { const cellTemplates: any[] = []; const cellTemplateOpt = options.cellTemplate; @@ -440,10 +440,10 @@ class SchedulerAgenda extends WorkSpace { } } - _renderTimePanel() { - this._renderTableBody({ + renderTimePanel() { + this.renderTableBody({ container: getPublicElement(this._$timePanel), - rowCount: this._getTimePanelRowCount(), + rowCount: this.getTimePanelRowCount(), cellCount: 1, rowClass: TIME_PANEL_ROW_CLASS, cellClass: TIME_PANEL_CELL_CLASS, diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 89679e7d539c..1dd7c29b75e1 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -92,14 +92,14 @@ class SchedulerTimeline extends SchedulerWorkSpace { return false; } - _getGroupHeaderContainer() { + getGroupHeaderContainer() { if (this._isHorizontalGroupedWorkSpace()) { return this._$thead; } return this._$sidebarTable; } - _insertAllDayRowsIntoDateTable() { + insertAllDayRowsIntoDateTable() { return false; } @@ -300,7 +300,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { renderRTimeTable() {} - _renderGroupAllDayPanel() {} + renderGroupAllDayPanel() {} // eslint-disable-next-line @typescript-eslint/no-unused-vars generateRenderOptions(argument?: any) { @@ -367,7 +367,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { this._$sidebarTable.appendTo(this._sidebarScrollable.$content()); - if (this.isRenovatedRender() && this._isVerticalGroupedWorkSpace()) { + if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } @@ -405,9 +405,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { // These methods should be deleted when we get rid of old render // -------------- - _renderTimePanel() { return noop(); } + renderTimePanel() { return noop(); } - _renderAllDayPanel() { return noop(); } + renderAllDayPanel() { return noop(); } _createAllDayPanelElements() { return noop(); } 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 51e0be120c2c..529a19113e13 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -441,7 +441,7 @@ class SchedulerWorkSpace extends Widget { const focusedCellData = this.cellsSelectionState.getFocusedCell()?.cellData; if (focusedCellData) { - const isAllDayPanelCell = focusedCellData.allDay && !this._isVerticalGroupedWorkSpace(); + const isAllDayPanelCell = focusedCellData.allDay && !this.isVerticalGroupedWorkSpace(); const isMultiSelection = e.shiftKey; const isMultiSelectionAllowed = this.option('allowMultipleCellSelection'); const isRTL = this._isRTL(); @@ -536,7 +536,7 @@ class SchedulerWorkSpace extends Widget { }); if (!this.viewDataProvider.isSameCell(focusedCellData, nextCellData)) { - const $cell = nextCellData.allDay && !this._isVerticalGroupedWorkSpace() + const $cell = nextCellData.allDay && !this.isVerticalGroupedWorkSpace() ? this._dom_getAllDayPanelCell(nextCellPosition.columnIndex) : this._dom_getDateCell(nextCellPosition); const isNextCellAllDay = nextCellData.allDay; @@ -593,7 +593,7 @@ class SchedulerWorkSpace extends Widget { const cellCoordinates = { columnIndex: 0, rowIndex: 0, - allDay: this._isVerticalGroupedWorkSpace() && this.isAllDayPanelVisible, + allDay: this.isVerticalGroupedWorkSpace() && this.isAllDayPanelVisible, }; this.cellsSelectionState.setFocusedCell( cellCoordinates.rowIndex, @@ -624,7 +624,7 @@ class SchedulerWorkSpace extends Widget { return this.$element(); } - _isVerticalGroupedWorkSpace() { // TODO move to the Model + isVerticalGroupedWorkSpace() { // TODO move to the Model return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'vertical'; } @@ -641,7 +641,7 @@ class SchedulerWorkSpace extends Widget { } _getRealGroupOrientation() { - return this._isVerticalGroupedWorkSpace() + return this.isVerticalGroupedWorkSpace() ? 'vertical' : 'horizontal'; } @@ -901,7 +901,7 @@ class SchedulerWorkSpace extends Widget { renovatedRenderSupported() { return true; } _updateGroupTableHeight() { - if (this._isVerticalGroupedWorkSpace() && hasWindow()) { + if (this.isVerticalGroupedWorkSpace() && hasWindow()) { this._setHorizontalGroupHeaderCellsHeight(); } } @@ -973,7 +973,7 @@ class SchedulerWorkSpace extends Widget { _attachClickEvent() { const that = this; const pointerDownAction = this._createAction((e) => { - that._pointerDownHandler(e.event); + that.pointerDownHandler(e.event); }); this._createCellClickAction(); @@ -998,7 +998,7 @@ class SchedulerWorkSpace extends Widget { _createCellClickAction() { this._cellClickAction = this._createActionByOption('onCellClick', { - afterExecute: (e) => this._cellClickHandler(e.args[0].event), + afterExecute: (e) => this.cellClickHandler(e.args[0].event), }); } @@ -1007,14 +1007,14 @@ class SchedulerWorkSpace extends Widget { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - _cellClickHandler(argument?: any) { + private cellClickHandler(argument?: any) { if (this._showPopup) { delete this._showPopup; - this._handleSelectedCellsClick(); + this.handleSelectedCellsClick(); } } - _pointerDownHandler(e) { + private pointerDownHandler(e) { const $target = $(e.target); if (!$target.hasClass(DATE_TABLE_CELL_CLASS) && !$target.hasClass(ALL_DAY_TABLE_CELL_CLASS)) { @@ -1032,7 +1032,7 @@ class SchedulerWorkSpace extends Widget { } } - _handleSelectedCellsClick() { + private handleSelectedCellsClick() { const selectedCells = this._getSelectedCellsData(); const firstCellData = selectedCells[0]; @@ -1053,39 +1053,35 @@ class SchedulerWorkSpace extends Widget { } _attachContextMenuEvent() { - this._createContextMenuAction(); + this.createContextMenuAction(); const cellSelector = `.${DATE_TABLE_CELL_CLASS},.${ALL_DAY_TABLE_CELL_CLASS}`; const $element = this.$element(); const eventName = addNamespace(contextMenuEventName, this.NAME); eventsEngine.off($element, eventName, cellSelector); - eventsEngine.on($element, eventName, cellSelector, this._contextMenuHandler.bind(this)); + eventsEngine.on($element, eventName, cellSelector, this.contextMenuHandler.bind(this)); } - _contextMenuHandler(e) { + private contextMenuHandler(e) { const $cell = $(e.target); this._contextMenuAction({ event: e, cellElement: getPublicElement($cell), cellData: this.getCellData($cell) }); this._contextMenuHandled = true; } - _createContextMenuAction() { + private createContextMenuAction() { this._contextMenuAction = this._createActionByOption('onCellContextMenu'); } - _getGroupHeaderContainer() { - if (this._isVerticalGroupedWorkSpace()) { + protected getGroupHeaderContainer() { + if (this.isVerticalGroupedWorkSpace()) { return this._$groupTable; } return this._$thead; } - _getDateHeaderContainer() { - return this._$thead; - } - - _getCalculateHeaderCellRepeatCount() { + private getCalculateHeaderCellRepeatCount() { return this._groupedStrategy.calculateHeaderCellRepeatCount(); } @@ -1096,7 +1092,7 @@ class SchedulerWorkSpace extends Widget { this.updateHeaderPanelScrollbarPadding(); } - _getTimePanelRowCount() { + protected getTimePanelRowCount() { return this._getCellCountInDay(); } @@ -1384,7 +1380,7 @@ class SchedulerWorkSpace extends Widget { } _getAllCells(allDay) { - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { return this._$dateTable.find(`td:not(.${VIRTUAL_CELL_CLASS})`); } @@ -1566,7 +1562,7 @@ class SchedulerWorkSpace extends Widget { getAllDayHeight() { return getAllDayHeight( this.option('showAllDayPanel'), - this._isVerticalGroupedWorkSpace(), + this.isVerticalGroupedWorkSpace(), this.getDOMElementsMetaData(), ); } @@ -1678,7 +1674,7 @@ class SchedulerWorkSpace extends Widget { } needRecalculateResizableArea() { - return this._isVerticalGroupedWorkSpace() && this.getScrollable().scrollTop() !== 0; + return this.isVerticalGroupedWorkSpace() && this.getScrollable().scrollTop() !== 0; } getCellByCoordinates(coordinates, allDay) { @@ -1838,7 +1834,7 @@ class SchedulerWorkSpace extends Widget { const left = coordinates.left - scrollable.scrollLeft() - xShift - offset; let top = coordinates.top - scrollable.scrollTop() - yShift; - if (isScrollToAllDay && !this._isVerticalGroupedWorkSpace()) { + if (isScrollToAllDay && !this.isVerticalGroupedWorkSpace()) { top = 0; } @@ -1877,7 +1873,7 @@ class SchedulerWorkSpace extends Widget { const columnIndex = $cell.index() - this.virtualScrollingDispatcher.leftVirtualCellsCount; let rowIndex = $cell.parent().index(); const isAllDayCell = this._hasAllDayClass($cell); - const isVerticalGrouping = this._isVerticalGroupedWorkSpace(); + const isVerticalGrouping = this.isVerticalGroupedWorkSpace(); if (!(isAllDayCell && !isVerticalGrouping)) { rowIndex -= this.virtualScrollingDispatcher.topVirtualRowsCount; @@ -1936,7 +1932,7 @@ class SchedulerWorkSpace extends Widget { return undefined; } - return allDay && !this._isVerticalGroupedWorkSpace() + return allDay && !this.isVerticalGroupedWorkSpace() ? this._dom_getAllDayPanelCell(position.columnIndex) : this._dom_getDateCell(position); } @@ -1979,7 +1975,7 @@ class SchedulerWorkSpace extends Widget { _getAllDayPanelDOMElementsInfo() { const result = []; - if (this.isAllDayPanelVisible && !this._isVerticalGroupedWorkSpace() && hasWindow()) { + if (this.isAllDayPanelVisible && !this.isVerticalGroupedWorkSpace() && hasWindow()) { const allDayCells = this._getAllCells(true); if (!allDayCells.length) { @@ -2098,7 +2094,7 @@ class SchedulerWorkSpace extends Widget { this._attachGroupCountClass(); utils.renovation.renderComponent( this, - this._getGroupHeaderContainer(), + this.getGroupHeaderContainer(), GroupPanelComponent, 'renovatedGroupPanel', options, @@ -2185,7 +2181,7 @@ class SchedulerWorkSpace extends Widget { const $rootElement = $(scheduler.element()); this._createDragBehavior(this.getWorkArea(), $rootElement); - if (!this._isVerticalGroupedWorkSpace()) { + if (!this.isVerticalGroupedWorkSpace()) { this._createDragBehavior(this._$allDayPanel, $rootElement); } } @@ -2238,7 +2234,7 @@ class SchedulerWorkSpace extends Widget { // -------------- _isRenderHeaderPanelEmptyCell() { - return this._isVerticalGroupedWorkSpace(); + return this.isVerticalGroupedWorkSpace(); } _dispose() { @@ -2324,7 +2320,7 @@ class SchedulerWorkSpace extends Widget { this._toggleGroupByDateClass(); break; case 'showAllDayPanel': - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this._cleanView(); this._removeAllDayElements(); this._initGrouping(); @@ -2414,7 +2410,7 @@ class SchedulerWorkSpace extends Widget { updateRender: this.updateRender.bind(this), updateGrid: this.updateGrid.bind(this), getGroupCount: this._getGroupCount.bind(this), - isVerticalGrouping: this._isVerticalGroupedWorkSpace.bind(this), + isVerticalGrouping: this.isVerticalGroupedWorkSpace.bind(this), getTotalRowCount: this._getTotalRowCount.bind(this), getTotalCellCount: this._getTotalCellCount.bind(this), }; @@ -2462,7 +2458,7 @@ class SchedulerWorkSpace extends Widget { isGroupedByDate: this.isGroupedByDate(), rtlEnabled: this.option('rtlEnabled'), startViewDate: this.getStartViewDate(), - isVerticalGrouping: this._isVerticalGroupedWorkSpace(), + isVerticalGrouping: this.isVerticalGroupedWorkSpace(), groupCount: this._getGroupCount(), isVirtualScrolling: this.isVirtualScrolling(), getDOMMetaDataCallback: this.getDOMElementsMetaData.bind(this), @@ -2512,7 +2508,7 @@ class SchedulerWorkSpace extends Widget { } _toggleGroupingDirectionClass() { - (this.$element() as any).toggleClass(VERTICAL_GROUPED_WORKSPACE_CLASS, this._isVerticalGroupedWorkSpace()); + (this.$element() as any).toggleClass(VERTICAL_GROUPED_WORKSPACE_CLASS, this.isVerticalGroupedWorkSpace()); } _getDateTableCellClass(rowIndex?: any, columnIndex?: any) { @@ -2580,7 +2576,7 @@ class SchedulerWorkSpace extends Widget { _createWorkSpaceStaticElements() { this._$dateTableContainer.append(this._$dateTable); - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this._$dateTableContainer.append(this._$allDayContainer); this._$dateTableScrollableContent.append( this._$groupTable, @@ -2634,7 +2630,7 @@ class SchedulerWorkSpace extends Widget { this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this._$dateTableContainer.append(this._$allDayContainer); this._$sidebarScrollableContent.append(this._$groupTable, this._$timePanel); } else { @@ -2683,7 +2679,7 @@ class SchedulerWorkSpace extends Widget { _attachTableClasses() { this._addTableClass(this._$dateTable, DATE_TABLE_CLASS); - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { const groupCount = this._getGroupCount(); for (let i = 0; i < groupCount; i++) { @@ -2740,7 +2736,7 @@ class SchedulerWorkSpace extends Widget { _renderView() { if (this.isRenovatedRender()) { - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } } else { @@ -2785,7 +2781,7 @@ class SchedulerWorkSpace extends Widget { } _attachGroupCountClass() { - const className = this._groupedStrategy.getGroupCountClass(this.option('groups')); + const className = this._groupedStrategy._getCellCountClass(this.option('groups')); this.$element().addClass(className); } @@ -2901,7 +2897,7 @@ class SchedulerWorkSpace extends Widget { _createAllDayPanelElements() { const groupCount = this._getGroupCount(); - if (this._isVerticalGroupedWorkSpace() && groupCount !== 0) { + if (this.isVerticalGroupedWorkSpace() && groupCount !== 0) { for (let i = 0; i < groupCount; i++) { const $allDayTitle = $('
') .addClass(ALL_DAY_TITLE_CLASS) @@ -2945,17 +2941,17 @@ class SchedulerWorkSpace extends Widget { } else { // TODO Old render: Delete this old render block after the SSR tests check. this._renderDateHeader(); - this._renderTimePanel(); - this._renderGroupAllDayPanel(); - this._renderDateTable(); - this._renderAllDayPanel(); + this.renderTimePanel(); + this.renderGroupAllDayPanel(); + this.renderDateTable(); + this.renderAllDayPanel(); } this._initPositionHelper(); } _renderGroupHeader() { - const $container = this._getGroupHeaderContainer(); + const $container = this.getGroupHeaderContainer(); const groupCount = this._getGroupCount(); let cellTemplates = []; if (groupCount) { @@ -2977,7 +2973,7 @@ class SchedulerWorkSpace extends Widget { } _makeGroupRows(groups, groupByDate): any { - const tableCreatorStrategy = this._isVerticalGroupedWorkSpace() ? tableCreator.VERTICAL : tableCreator.HORIZONTAL; + const tableCreatorStrategy = this.isVerticalGroupedWorkSpace() ? tableCreator.VERTICAL : tableCreator.HORIZONTAL; return tableCreator.makeGroupedTable( tableCreatorStrategy, @@ -3000,7 +2996,7 @@ class SchedulerWorkSpace extends Widget { const $headerRow = $('').addClass(HEADER_ROW_CLASS); const count = this._getCellCount(); const cellTemplate = this._getDateHeaderTemplate(); - const repeatCount = this._getCalculateHeaderCellRepeatCount(); + const repeatCount = this.getCalculateHeaderCellRepeatCount(); const templateCallbacks = []; const groupByDate = this.isGroupedByDate(); @@ -3081,18 +3077,18 @@ class SchedulerWorkSpace extends Widget { return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i + 1, undefined, undefined, this.isGroupedByDate()); } - _renderAllDayPanel(index?: any) { + protected renderAllDayPanel(index?: any) { let cellCount = this._getCellCount(); - if (!this._isVerticalGroupedWorkSpace()) { + if (!this.isVerticalGroupedWorkSpace()) { cellCount *= this._getGroupCount() || 1; } - const cellTemplates = this._renderTableBody({ + const cellTemplates = this.renderTableBody({ container: this._allDayPanels.length ? getPublicElement(this._allDayTables[index]) : getPublicElement(this._$allDayTable), rowCount: 1, cellCount, - cellClass: this._getAllDayPanelCellClass.bind(this), + cellClass: this.getAllDayPanelCellClass.bind(this), rowClass: ALL_DAY_TABLE_ROW_CLASS, cellTemplate: this.option('dataCellTemplate'), // TODO: remove along with old render @@ -3105,27 +3101,27 @@ class SchedulerWorkSpace extends Widget { this._applyCellTemplates(cellTemplates); } - _renderGroupAllDayPanel() { - if (this._isVerticalGroupedWorkSpace()) { + protected renderGroupAllDayPanel() { + if (this.isVerticalGroupedWorkSpace()) { const groupCount = this._getGroupCount(); for (let i = 0; i < groupCount; i++) { - this._renderAllDayPanel(i); + this.renderAllDayPanel(i); } } } - _getAllDayPanelCellClass(i, j) { + private getAllDayPanelCellClass(i, j) { const cellClass = `${ALL_DAY_TABLE_CELL_CLASS} ${HORIZONTAL_SIZES_CLASS}`; return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, j + 1); } - _renderTimePanel() { + protected renderTimePanel() { const repeatCount = this._groupedStrategy.calculateTimeCellRepeatCount(); const getTimeCellGroups = (rowIndex) => { - if (!this._isVerticalGroupedWorkSpace()) { + if (!this.isVerticalGroupedWorkSpace()) { return {}; } @@ -3149,32 +3145,32 @@ class SchedulerWorkSpace extends Widget { return this.viewDataProvider.completeTimePanelMap[validRowIndex][field]; }; - this._renderTableBody({ + this.renderTableBody({ container: getPublicElement(this._$timePanel), - rowCount: this._getTimePanelRowCount() * repeatCount, + rowCount: this.getTimePanelRowCount() * repeatCount, cellCount: 1, - cellClass: this._getTimeCellClass.bind(this), + cellClass: this.getTimeCellClass.bind(this), rowClass: TIME_PANEL_ROW_CLASS, cellTemplate: this.option('timeCellTemplate'), getCellText: (rowIndex) => getData(rowIndex, 'text'), getCellDate: (rowIndex) => getData(rowIndex, 'startDate'), - groupCount: this._getGroupCount(), - allDayElements: this._insertAllDayRowsIntoDateTable() ? this._allDayTitles : undefined, + groupCount: this._getCellCount(), + allDayElements: this.insertAllDayRowsIntoDateTable() ? this._allDayTitles : undefined, getTemplateData: getTimeCellGroups.bind(this), }); } - _getTimeCellClass(i) { + private getTimeCellClass(i) { const cellClass = `${TIME_PANEL_CELL_CLASS} ${VERTICAL_SIZES_CLASS}`; - return this._isVerticalGroupedWorkSpace() + return this.isVerticalGroupedWorkSpace() ? this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i, i) : cellClass; } - _renderDateTable() { + protected renderDateTable() { const groupCount = this._getGroupCount(); - this._renderTableBody({ + this.renderTableBody({ container: getPublicElement(this._$dateTable), rowCount: this._getTotalRowCount(groupCount), cellCount: this._getTotalCellCount(groupCount), @@ -3200,17 +3196,17 @@ class SchedulerWorkSpace extends Widget { key: CELL_DATA, }; }, - allDayElements: this._insertAllDayRowsIntoDateTable() ? this._allDayPanels : undefined, + allDayElements: this.insertAllDayRowsIntoDateTable() ? this._allDayPanels : undefined, groupCount, groupByDate: this.option('groupByDate'), }); } - _insertAllDayRowsIntoDateTable() { + protected insertAllDayRowsIntoDateTable() { return this._groupedStrategy.insertAllDayRowsIntoDateTable(); } - _renderTableBody(options, delayCellTemplateRendering?: any): any { + protected renderTableBody(options, delayCellTemplateRendering?: any): any { let result: any[] = []; if (!delayCellTemplateRendering) { this._applyCellTemplates( 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 d7c00cba9354..41218fdd7545 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 @@ -253,7 +253,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } _getCurrentTimePanelCellIndices() { - const rowCountPerGroup = this._getTimePanelRowCount(); + const rowCountPerGroup = this.getTimePanelRowCount(); const today = this._getToday(); const index = this.getCellIndexByDate(today); const { rowIndex: currentTimeRowIndex } = this._getCellCoordinatesByIndex(index); @@ -271,7 +271,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { : [currentTimeRowIndex, currentTimeRowIndex + 1]; } - const verticalGroupCount = this._isVerticalGroupedWorkSpace() + const verticalGroupCount = this.isVerticalGroupedWorkSpace() ? this._getGroupCount() : 1; 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 fe0888845659..3af066c054fb 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 @@ -64,7 +64,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { }); } - _insertAllDayRowsIntoDateTable() { + insertAllDayRowsIntoDateTable() { return false; } @@ -80,7 +80,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { _needCreateCrossScrolling() { // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - return this.option('crossScrollingEnabled') || this._isVerticalGroupedWorkSpace(); + return this.option('crossScrollingEnabled') || this.isVerticalGroupedWorkSpace(); } _getViewStartByOptions() { @@ -149,7 +149,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { // ------------- _createWorkSpaceElements() { - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this._createWorkSpaceScrollableElements(); } else { super._createWorkSpaceElements(); @@ -164,9 +164,9 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { // These methods should be deleted when we get rid of old render // -------------- - _renderTimePanel() { return noop(); } + renderTimePanel() { return noop(); } - _renderAllDayPanel() { return noop(); } + renderAllDayPanel() { return noop(); } _setMonthClassesToCell($cell, data) { $cell @@ -177,7 +177,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { _createAllDayPanelElements() {} - _renderTableBody(options) { + renderTableBody(options) { options.getCellText = (rowIndex, columnIndex) => { const date = this.viewDataProvider.completeViewDataMap[rowIndex][columnIndex].startDate; @@ -186,7 +186,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { options.getCellTextClass = DATE_TABLE_CELL_TEXT_CLASS; options.setAdditionalClasses = this._setMonthClassesToCell.bind(this); - super._renderTableBody(options); + super.renderTableBody(options); } } From 87b9143d6568e87728175faed0cb237713cd034a Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 11:56:16 +0100 Subject: [PATCH 02/28] fix: refactor one by one --- .../scheduler/workspaces/m_work_space.ts | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) 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 529a19113e13..823cf47485d3 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -472,7 +472,7 @@ class SchedulerWorkSpace extends Widget { focusedCellData, }); - this._processNextSelectedCell( + this.processNextSelectedCell( nextCellData, focusedCellData, isMultiSelection && isMultiSelectionAllowed, @@ -503,7 +503,7 @@ class SchedulerWorkSpace extends Widget { return this.option('rtlEnabled'); } - _moveToCell($cell, isMultiSelection) { + private moveToCell($cell, isMultiSelection) { if (!isDefined($cell) || !$cell.length) { return; } @@ -520,14 +520,14 @@ class SchedulerWorkSpace extends Widget { isVirtualCell: $cell.hasClass(VIRTUAL_CELL_CLASS), }); - this._processNextSelectedCell( + this.processNextSelectedCell( nextFocusedCellData, focusedCellData, isMultiSelectionAllowed && isMultiSelection, ); } - _processNextSelectedCell(nextCellData, focusedCellData, isMultiSelection) { + private processNextSelectedCell(nextCellData, focusedCellData, isMultiSelection) { const nextCellPosition = this.viewDataProvider.findCellPositionInMap({ startDate: nextCellData.startDate, groupIndex: nextCellData.groupIndex, @@ -541,13 +541,13 @@ class SchedulerWorkSpace extends Widget { : this._dom_getDateCell(nextCellPosition); const isNextCellAllDay = nextCellData.allDay; - this._setSelectedCellsStateAndUpdateSelection(isNextCellAllDay, nextCellPosition, isMultiSelection, $cell); + this.setSelectedCellsStateAndUpdateSelection(isNextCellAllDay, nextCellPosition, isMultiSelection, $cell); this._dateTableScrollable.scrollToElement($cell); } } - _setSelectedCellsStateAndUpdateSelection(isAllDay, cellPosition, isMultiSelection, $nextFocusedCell) { + private setSelectedCellsStateAndUpdateSelection(isAllDay, cellPosition, isMultiSelection, $nextFocusedCell) { const nextCellCoordinates = { rowIndex: cellPosition.rowIndex, columnIndex: cellPosition.columnIndex, @@ -1028,7 +1028,7 @@ class SchedulerWorkSpace extends Widget { } else { const cellCoordinates = this._getCoordinatesByCell($target); const isAllDayCell = this._hasAllDayClass($target); - this._setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target); + this.setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target); } } @@ -1081,6 +1081,10 @@ class SchedulerWorkSpace extends Widget { return this._$thead; } + private getDateHeaderContainer() { + return this._$thead; + } + private getCalculateHeaderCellRepeatCount() { return this._groupedStrategy.calculateHeaderCellRepeatCount(); } @@ -1213,7 +1217,7 @@ class SchedulerWorkSpace extends Widget { if (isPointerDown && this._dateTableScrollable && !this._dateTableScrollable.option('scrollByContent')) { e.preventDefault(); e.stopPropagation(); - this._moveToCell($(e.target), true); + this.moveToCell($(e.target), true); } }); } @@ -2992,7 +2996,7 @@ class SchedulerWorkSpace extends Widget { } _renderDateHeader(): any { - const container = this._getDateHeaderContainer(); + const container = this.getDateHeaderContainer(); const $headerRow = $('').addClass(HEADER_ROW_CLASS); const count = this._getCellCount(); const cellTemplate = this._getDateHeaderTemplate(); From 7aeeeafdabdec0cdfdb5f443ac1523dd4997caca Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 12:07:32 +0100 Subject: [PATCH 03/28] fix: refactor one by one --- .../scheduler/workspaces/m_agenda.ts | 16 +- .../scheduler/workspaces/m_timeline.ts | 18 +- .../scheduler/workspaces/m_timeline_month.ts | 2 +- .../scheduler/workspaces/m_work_space.ts | 178 +++++++++--------- .../scheduler/workspaces/m_work_space_day.ts | 4 +- .../workspaces/m_work_space_indicator.ts | 4 +- .../workspaces/m_work_space_month.ts | 4 +- .../workSpace.renovation.tests.js | 6 +- 8 files changed, 116 insertions(+), 116 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index f082ffb4f747..64e1da7c006d 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -91,7 +91,7 @@ class SchedulerAgenda extends WorkSpace { if (this._$groupTable) { this._$groupTable.remove(); this._$groupTable = null; - this._detachGroupCountClass(); + this.detachGroupCountClass(); } } else if (!this._$groupTable) { this._initGroupTable(); @@ -140,7 +140,7 @@ class SchedulerAgenda extends WorkSpace { renderAllDayPanel() { return noop(); } - _updateAllDayVisibility() { return noop(); } + updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } @@ -176,14 +176,14 @@ class SchedulerAgenda extends WorkSpace { this._rows = rows; if (this._$groupTable) { - cellTemplates = this._renderGroupHeader(); + cellTemplates = this.renderGroupHeader(); this._setGroupHeaderCellsHeight(); } this.renderTimePanel(); this.renderDateTable(); (this.invoke as any)('onAgendaReady', rows); - this._applyCellTemplates(cellTemplates); + this.applyCellTemplates(cellTemplates); this._dateTableScrollable.update(); } @@ -232,7 +232,7 @@ class SchedulerAgenda extends WorkSpace { return result; } - _attachGroupCountClass() { + attachGroupCountClass() { const className = getVerticalGroupCountClass(this.option('groups')); (this.$element() as any).addClass(className); } @@ -256,7 +256,7 @@ class SchedulerAgenda extends WorkSpace { return this._$groupTable; } - _makeGroupRows() { + makeGroupRows() { const resourceManager = this.option('getResourceManager')(); const allAppointments = (this.option('getFilteredItems') as any)(); const tree = reduceResourcesTree( @@ -348,7 +348,7 @@ class SchedulerAgenda extends WorkSpace { this.renderTableBody({ container: getPublicElement(this._$dateTable), rowClass: DATE_TABLE_ROW_CLASS, - cellClass: this._getDateTableCellClass(), + cellClass: this.getDateTableCellClass(), }); } @@ -429,7 +429,7 @@ class SchedulerAgenda extends WorkSpace { } $(options.container).append($('').append(this._$rows)); - this._applyCellTemplates(cellTemplates); + this.applyCellTemplates(cellTemplates); } _setLastRowClass() { diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 1dd7c29b75e1..bf7f17939c37 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -343,18 +343,18 @@ class SchedulerTimeline extends SchedulerWorkSpace { this._createWorkSpaceScrollableElements(); } - _updateAllDayVisibility() { return noop(); } + updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } - _getDateHeaderTemplate() { + getDateHeaderTemplate() { return this.option('timeCellTemplate'); } _renderView() { let groupCellTemplates; if (!this.isRenovatedRender()) { - groupCellTemplates = this._renderGroupHeader(); + groupCellTemplates = this.renderGroupHeader(); } this.renderWorkSpace(); @@ -373,7 +373,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { this.updateHeaderEmptyCellWidth(); - this._applyCellTemplates(groupCellTemplates); + this.applyCellTemplates(groupCellTemplates); } _setHorizontalGroupHeaderCellsHeight() { return noop(); } @@ -409,10 +409,10 @@ class SchedulerTimeline extends SchedulerWorkSpace { renderAllDayPanel() { return noop(); } - _createAllDayPanelElements() { return noop(); } + createAllDayPanelElements() { return noop(); } - _renderDateHeader() { - const $headerRow = super._renderDateHeader(); + renderDateHeader() { + const $headerRow = super.renderDateHeader(); if (this._needRenderWeekHeader()) { const firstViewDate = new Date(this.getStartViewDate()); let currentDate = new Date(firstViewDate); @@ -441,7 +441,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { model: { text, date: new Date(currentDate), - ...this._getGroupsForDateHeaderTemplate(templateIndex, colSpan), + ...this.getGroupsForDateHeaderTemplate(templateIndex, colSpan), }, container: $th, index: templateIndex, @@ -490,7 +490,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } } - _makeGroupRows(groups, groupByDate) { + makeGroupRows(groups, groupByDate) { const tableCreatorStrategy = this.option('groupOrientation') === 'vertical' ? tableCreator.VERTICAL : tableCreator.HORIZONTAL; return tableCreator.makeGroupedTable( 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..5dc23b2e259a 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts @@ -26,7 +26,7 @@ class SchedulerTimelineMonth extends SchedulerTimeline { return TIMELINE_CLASS; } - _getDateHeaderTemplate() { + getDateHeaderTemplate() { return this.option('dateCellTemplate'); } 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 823cf47485d3..fec28e377fe4 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -359,7 +359,7 @@ class SchedulerWorkSpace extends Widget { }; } - const groupIndex = this._getGroupIndexByGroupValues(groups); + const groupIndex = this.getGroupIndexByGroupValues(groups); return { ...selectedCell, @@ -743,7 +743,7 @@ class SchedulerWorkSpace extends Widget { _setTableSizes() { this.cache.clear(); - this._attachTableClasses(); + this.attachTableClasses(); let cellWidth = this.getCellWidth(); @@ -754,7 +754,7 @@ class SchedulerWorkSpace extends Widget { const minWidth = this.getWorkSpaceMinWidth(); const groupCount = this._getGroupCount(); - const totalCellCount = this._getTotalCellCount(groupCount); + const totalCellCount = this.getTotalCellCount(groupCount); let width = cellWidth * totalCellCount; @@ -768,7 +768,7 @@ class SchedulerWorkSpace extends Widget { setWidth(this._$allDayTable, width); } - this._attachHeaderTableClasses(); + this.attachHeaderTableClasses(); this._updateGroupTableHeight(); @@ -932,7 +932,7 @@ class SchedulerWorkSpace extends Widget { return this.option('groups')?.length && groupValues; } - _getGroupIndexByGroupValues(groupValues?: RawGroupValues | GroupValues) { + getGroupIndexByGroupValues(groupValues?: RawGroupValues | GroupValues) { return groupValues && getAppointmentGroupIndex( getSafeGroupValues(groupValues), this.resourceManager.groupsLeafs, @@ -1108,11 +1108,11 @@ class SchedulerWorkSpace extends Widget { return this.viewDataProvider.getCellCountInDay(startDayHour, endDayHour, hoursInterval); } - _getTotalCellCount(groupCount) { + private getTotalCellCount(groupCount) { return this._groupedStrategy.getTotalCellCount(groupCount); } - _getTotalRowCount(groupCount, includeAllDayPanelRows?: any) { + private getTotalRowCount(groupCount, includeAllDayPanelRows?: any) { let result = this._groupedStrategy.getTotalRowCount(groupCount); if (includeAllDayPanelRows && this.isAllDayPanelVisible) { @@ -1122,7 +1122,7 @@ class SchedulerWorkSpace extends Widget { return result; } - _getGroupIndex(rowIndex, columnIndex) { + private getGroupIndex(rowIndex, columnIndex) { return this._groupedStrategy.getGroupIndex(rowIndex, columnIndex); } @@ -1325,7 +1325,7 @@ class SchedulerWorkSpace extends Widget { } getDroppableCell() { - return this._getDateTables().find(`.${DATE_TABLE_DROPPABLE_CELL_CLASS}`); + return this.getDateTables().find(`.${DATE_TABLE_DROPPABLE_CELL_CLASS}`); } _getWorkSpaceWidth() { @@ -1588,7 +1588,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(); @@ -1720,7 +1720,7 @@ class SchedulerWorkSpace extends Widget { needUpdateScrollPosition(date, appointmentGroupValues?: GroupValues, inAllDayRow = false) { const cells = this._getCellsInViewport(inAllDayRow); const groupIndex = this._isGroupsSpecified(appointmentGroupValues) - ? this._getGroupIndexByGroupValues(appointmentGroupValues) + ? this.getGroupIndexByGroupValues(appointmentGroupValues) : 0; const time = date.getTime(); const trimmedTime = dateUtils.trimTime(date).getTime(); @@ -1749,7 +1749,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(); @@ -1812,7 +1812,7 @@ class SchedulerWorkSpace extends Widget { } const groupIndex = this._getGroupCount() && groupValues - ? this._getGroupIndexByGroupValues(groupValues) + ? this.getGroupIndexByGroupValues(groupValues) : 0; const isScrollToAllDay = allDay && this.isAllDayPanelVisible; @@ -1944,18 +1944,18 @@ class SchedulerWorkSpace extends Widget { // Must replace all DOM manipulations getDOMElementsMetaData() { return this.cache.memo('cellElementsMeta', () => ({ - dateTableCellsMeta: this._getDateTableDOMElementsInfo(), + dateTableCellsMeta: this.getDateTableDOMElementsInfo(), allDayPanelCellsMeta: this._getAllDayPanelDOMElementsInfo(), })); } - _getDateTableDOMElementsInfo() { + getDateTableDOMElementsInfo() { const dateTableCells = this._getAllCells(false); if (!dateTableCells.length || !hasWindow()) { return [[{}]]; } - const dateTable = this._getDateTable(); + const dateTable = this.getDateTable(); // We should use getBoundingClientRect in renovation const dateTableRect = getBoundingRect(dateTable.get(0)); @@ -2095,7 +2095,7 @@ class SchedulerWorkSpace extends Widget { }; if (this.option('groups')?.length) { - this._attachGroupCountClass(); + this.attachGroupCountClass(); utils.renovation.renderComponent( this, this.getGroupHeaderContainer(), @@ -2104,7 +2104,7 @@ class SchedulerWorkSpace extends Widget { options, ); } else { - this._detachGroupCountClass(); + this.detachGroupCountClass(); } } @@ -2112,7 +2112,7 @@ class SchedulerWorkSpace extends Widget { const visible = this.isAllDayPanelVisible && !this.isGroupedAllDayPanel(); if (visible) { - this._updateAllDayVisibility(); + this.updateAllDayVisibility(); const options = { viewData: this.viewDataProvider.viewData, @@ -2126,7 +2126,7 @@ class SchedulerWorkSpace extends Widget { utils.renovation.renderComponent(this, this._$allDayTitle, AllDayPanelTitleComponent, 'renovatedAllDayPanelTitle', {}); } - this._updateAllDayVisibility(); + this.updateAllDayVisibility(); this._updateScrollable(); } @@ -2147,9 +2147,9 @@ class SchedulerWorkSpace extends Widget { renderRHeaderPanel(isRenderDateHeader = true) { if (this.option('groups')?.length) { - this._attachGroupCountClass(); + this.attachGroupCountClass(); } else { - this._detachGroupCountClass(); + this.detachGroupCountClass(); } utils.renovation.renderComponent( @@ -2226,7 +2226,7 @@ class SchedulerWorkSpace extends Widget { enableDefaultDragging, disableDefaultDragging, () => this.getDroppableCell(), - () => this._getDateTables(), + () => this.getDateTables(), () => this.removeDroppableCellClass(), () => this.getCellWidth(), options, @@ -2312,32 +2312,32 @@ class SchedulerWorkSpace extends Widget { break; case 'groups': this._cleanView(); - this._removeAllDayElements(); + this.removeAllDayElements(); this._initGrouping(); this.repaint(); break; case 'groupOrientation': this._initGroupedStrategy(); - this._createAllDayPanelElements(); - this._removeAllDayElements(); + this.createAllDayPanelElements(); + this.removeAllDayElements(); this._cleanWorkSpace(); this._toggleGroupByDateClass(); break; case 'showAllDayPanel': if (this.isVerticalGroupedWorkSpace()) { this._cleanView(); - this._removeAllDayElements(); + this.removeAllDayElements(); this._initGrouping(); this.repaint(); } else if (!this.isRenovatedRender()) { - this._updateAllDayVisibility(); + this.updateAllDayVisibility(); this._updateScrollable(); } else { this.renderWorkSpace(); } break; case 'allDayExpanded': - this._updateAllDayExpansion(); + this.updateAllDayExpansion(); this._attachTablesEvents(); this._updateScrollable(); break; @@ -2415,14 +2415,14 @@ class SchedulerWorkSpace extends Widget { updateGrid: this.updateGrid.bind(this), getGroupCount: this._getGroupCount.bind(this), isVerticalGrouping: this.isVerticalGroupedWorkSpace.bind(this), - getTotalRowCount: this._getTotalRowCount.bind(this), - getTotalCellCount: this._getTotalCellCount.bind(this), + getTotalRowCount: this.getTotalRowCount.bind(this), + getTotalCellCount: this.getTotalCellCount.bind(this), }; } _cleanWorkSpace() { this._cleanView(); - this._toggleGroupedClass(); + this.toggleGroupedClass(); this._toggleWorkSpaceWithOddCells(); this.virtualScrollingDispatcher.updateDimensions(true); @@ -2515,7 +2515,7 @@ class SchedulerWorkSpace extends Widget { (this.$element() as any).toggleClass(VERTICAL_GROUPED_WORKSPACE_CLASS, this.isVerticalGroupedWorkSpace()); } - _getDateTableCellClass(rowIndex?: any, columnIndex?: any) { + getDateTableCellClass(rowIndex?: any, columnIndex?: any) { const cellClass = `${DATE_TABLE_CELL_CLASS} ${HORIZONTAL_SIZES_CLASS} ${VERTICAL_SIZES_CLASS}`; return this._groupedStrategy @@ -2546,7 +2546,7 @@ class SchedulerWorkSpace extends Widget { if (this.isRenovatedRender()) { this.createRAllDayPanelElements(); } else { - this._createAllDayPanelElements(); + this.createAllDayPanelElements(); } this._$timePanel = $('').addClass(TIME_PANEL_CLASS).attr('aria-hidden', true); @@ -2626,7 +2626,7 @@ class SchedulerWorkSpace extends Widget { this.$element().append(this._$headerPanelContainer); this.$element().append(this._$flexContainer); - this._createSidebarScrollable(); + this.createSidebarScrollable(); this._$flexContainer.append(this._dateTableScrollable.$element()); this._$dateTableContainer.append(this._$dateTable); @@ -2660,7 +2660,7 @@ class SchedulerWorkSpace extends Widget { this._scrollSync.header = getMemoizeScrollTo(() => this._headerScrollable); } - _createSidebarScrollable() { + private createSidebarScrollable() { const $timePanelScrollable = $('
') .addClass(SCHEDULER_SIDEBAR_SCROLLABLE_CLASS) .appendTo(this._$flexContainer); @@ -2680,25 +2680,25 @@ class SchedulerWorkSpace extends Widget { this._scrollSync.sidebar = getMemoizeScrollTo(() => this._sidebarScrollable); } - _attachTableClasses() { - this._addTableClass(this._$dateTable, DATE_TABLE_CLASS); + private attachTableClasses() { + this.addTableClass(this._$dateTable, DATE_TABLE_CLASS); if (this.isVerticalGroupedWorkSpace()) { const groupCount = this._getGroupCount(); for (let i = 0; i < groupCount; i++) { - this._addTableClass(this._allDayTables[i], ALL_DAY_TABLE_CLASS); + this.addTableClass(this._allDayTables[i], ALL_DAY_TABLE_CLASS); } } else if (!this.isRenovatedRender()) { - this._addTableClass(this._$allDayTable, ALL_DAY_TABLE_CLASS); + this.addTableClass(this._$allDayTable, ALL_DAY_TABLE_CLASS); } } - _attachHeaderTableClasses() { - this._addTableClass(this._$headerPanel, HEADER_PANEL_CLASS); + private attachHeaderTableClasses() { + this.addTableClass(this._$headerPanel, HEADER_PANEL_CLASS); } - _addTableClass($el, className) { + private addTableClass($el, className) { ($el && !$el.hasClass(className)) && $el.addClass(className); } @@ -2717,11 +2717,11 @@ class SchedulerWorkSpace extends Widget { super._initMarkup(); if (!this.option('crossScrollingEnabled')) { - this._attachTableClasses(); - this._attachHeaderTableClasses(); + this.attachTableClasses(); + this.attachHeaderTableClasses(); } - this._toggleGroupedClass(); + this.toggleGroupedClass(); this._renderView(); this._attachEvents(); @@ -2734,7 +2734,7 @@ class SchedulerWorkSpace extends Widget { this._setIndicationUpdateInterval(); } - _toggleGroupedClass() { + private toggleGroupedClass() { (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this._getGroupCount() > 0); } @@ -2744,8 +2744,8 @@ class SchedulerWorkSpace extends Widget { this.renderRGroupPanel(); } } else { - this._applyCellTemplates( - this._renderGroupHeader(), + this.applyCellTemplates( + this.renderGroupHeader(), ); } @@ -2778,50 +2778,50 @@ class SchedulerWorkSpace extends Widget { protected _setIndicationUpdateInterval() { return noop(); } - _detachGroupCountClass() { + protected detachGroupCountClass() { VERTICAL_GROUP_COUNT_CLASSES.forEach((className) => { this.$element().removeClass(className); }); } - _attachGroupCountClass() { - const className = this._groupedStrategy._getCellCountClass(this.option('groups')); + protected attachGroupCountClass() { + const className = this._groupedStrategy.getCellCountClass(this.option('groups')); this.$element().addClass(className); } - _getDateHeaderTemplate() { + protected getDateHeaderTemplate() { return this.option('dateCellTemplate'); } - _updateAllDayVisibility(): void { + protected updateAllDayVisibility(): void { this.$element().toggleClass(WORKSPACE_WITH_ALL_DAY_CLASS, this._isShowAllDayPanel()); - this._updateAllDayExpansion(); + this.updateAllDayExpansion(); } - _updateAllDayExpansion(): void { + private updateAllDayExpansion(): void { const isExpanded = !this.option('allDayExpanded') && this._isShowAllDayPanel(); this.cache.clear(); this.$element().toggleClass(WORKSPACE_WITH_COLLAPSED_ALL_DAY_CLASS, isExpanded); } - _getDateTables() { + getDateTables() { return this._$dateTable.add(this._$allDayTable); } - _getDateTable() { + private getDateTable() { return this._$dateTable; } - _removeAllDayElements() { + private removeAllDayElements() { this._$allDayTable?.remove(); this._$allDayTitle?.remove(); } _cleanView(): void { this.cache.clear(); - this._cleanTableWidths(); + this.cleanTableWidths(); this.cellsSelectionState.clearSelectedAndFocusedCells(); if (!this.isRenovatedRender()) { this._$thead.empty(); @@ -2840,19 +2840,19 @@ class SchedulerWorkSpace extends Widget { _clean() { (eventsEngine.off as any)(domAdapter.getDocument(), SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME); - this._disposeRenovatedComponents(); + this.disposeRenovatedComponents(); // @ts-expect-error super._clean(); } - _cleanTableWidths() { + private cleanTableWidths() { this._$headerPanel.css('width', ''); this._$dateTable.css('width', ''); this._$allDayTable?.css('width', ''); } - _disposeRenovatedComponents() { + private disposeRenovatedComponents() { this.renovatedAllDayPanel?.dispose(); this.renovatedAllDayPanel = undefined; @@ -2898,7 +2898,7 @@ class SchedulerWorkSpace extends Widget { // These methods should be deleted when we get rid of old render // ---------------- - _createAllDayPanelElements() { + protected createAllDayPanelElements() { const groupCount = this._getGroupCount(); if (this.isVerticalGroupedWorkSpace() && groupCount !== 0) { @@ -2944,7 +2944,7 @@ class SchedulerWorkSpace extends Widget { this.renderRWorkSpace(renderComponents); } else { // TODO Old render: Delete this old render block after the SSR tests check. - this._renderDateHeader(); + this.renderDateHeader(); this.renderTimePanel(); this.renderGroupAllDayPanel(); this.renderDateTable(); @@ -2954,29 +2954,29 @@ class SchedulerWorkSpace extends Widget { this._initPositionHelper(); } - _renderGroupHeader() { + protected renderGroupHeader() { const $container = this.getGroupHeaderContainer(); const groupCount = this._getGroupCount(); let cellTemplates = []; if (groupCount) { - const groupRows = this._makeGroupRows(this.option('groups'), this.option('groupByDate')); - this._attachGroupCountClass(); + const groupRows = this.makeGroupRows(this.option('groups'), this.option('groupByDate')); + this.attachGroupCountClass(); $container.append(groupRows.elements); cellTemplates = groupRows.cellTemplates; } else { - this._detachGroupCountClass(); + this.detachGroupCountClass(); } return cellTemplates; } - _applyCellTemplates(templates) { + protected applyCellTemplates(templates) { templates?.forEach((template) => { template(); }); } - _makeGroupRows(groups, groupByDate): any { + protected makeGroupRows(groups, groupByDate): any { const tableCreatorStrategy = this.isVerticalGroupedWorkSpace() ? tableCreator.VERTICAL : tableCreator.HORIZONTAL; return tableCreator.makeGroupedTable( @@ -2995,11 +2995,11 @@ class SchedulerWorkSpace extends Widget { ); } - _renderDateHeader(): any { + protected renderDateHeader(): any { const container = this.getDateHeaderContainer(); const $headerRow = $('
').addClass(HEADER_ROW_CLASS); const count = this._getCellCount(); - const cellTemplate = this._getDateHeaderTemplate(); + const cellTemplate = this.getDateHeaderTemplate(); const repeatCount = this.getCalculateHeaderCellRepeatCount(); const templateCallbacks = []; const groupByDate = this.isGroupedByDate(); @@ -3008,7 +3008,7 @@ class SchedulerWorkSpace extends Widget { for (let rowIndex = 0; rowIndex < repeatCount; rowIndex++) { for (let columnIndex = 0; columnIndex < count; columnIndex++) { const templateIndex = rowIndex * count + columnIndex; - this._renderDateHeaderTemplate($headerRow, columnIndex, templateIndex, cellTemplate, templateCallbacks); + this.renderDateHeaderTemplate($headerRow, columnIndex, templateIndex, cellTemplate, templateCallbacks); } } @@ -3018,19 +3018,19 @@ class SchedulerWorkSpace extends Widget { for (let columnIndex = 0; columnIndex < count; columnIndex++) { const templateIndex = columnIndex * repeatCount; - const cellElement = this._renderDateHeaderTemplate($headerRow, columnIndex, templateIndex, cellTemplate, templateCallbacks); + const cellElement = this.renderDateHeaderTemplate($headerRow, columnIndex, templateIndex, cellTemplate, templateCallbacks); cellElement.attr('colSpan', colSpan); } container.prepend($headerRow); } - this._applyCellTemplates(templateCallbacks); + this.applyCellTemplates(templateCallbacks); return $headerRow; } - _renderDateHeaderTemplate(container, panelCellIndex, templateIndex, cellTemplate, templateCallbacks) { + private renderDateHeaderTemplate(container, panelCellIndex, templateIndex, cellTemplate, templateCallbacks) { const validTemplateIndex = this.isGroupedByDate() ? Math.floor(templateIndex / this._getGroupCount()) : templateIndex; @@ -3040,7 +3040,7 @@ class SchedulerWorkSpace extends Widget { text, startDate: date, } = completeDateHeaderMap[completeDateHeaderMap.length - 1][validTemplateIndex]; const $cell = $('
') - .addClass(this._getHeaderPanelCellClass(panelCellIndex)) + .addClass(this.getHeaderPanelCellClass(panelCellIndex)) .attr('title', text); if (cellTemplate?.render) { @@ -3048,7 +3048,7 @@ class SchedulerWorkSpace extends Widget { model: { text, date, - ...this._getGroupsForDateHeaderTemplate(templateIndex), + ...this.getGroupsForDateHeaderTemplate(templateIndex), }, index: templateIndex, container: getPublicElement($cell), @@ -3061,9 +3061,9 @@ class SchedulerWorkSpace extends Widget { return $cell; } - _getGroupsForDateHeaderTemplate(templateIndex, indexMultiplier = 1) { + protected getGroupsForDateHeaderTemplate(templateIndex, indexMultiplier = 1) { if (this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { - const groupIndex = this._getGroupIndex(0, templateIndex * indexMultiplier); + const groupIndex = this.getGroupIndex(0, templateIndex * indexMultiplier); const groups = getLeafGroupValues(this.resourceManager.groupsLeafs, groupIndex); return { @@ -3075,7 +3075,7 @@ class SchedulerWorkSpace extends Widget { return {}; } - _getHeaderPanelCellClass(i) { + protected getHeaderPanelCellClass(i) { const cellClass = `${HEADER_PANEL_CELL_CLASS} ${HORIZONTAL_SIZES_CLASS}`; return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i + 1, undefined, undefined, this.isGroupedByDate()); @@ -3100,9 +3100,9 @@ class SchedulerWorkSpace extends Widget { groupIndex: index, }, true); - this._updateAllDayVisibility(); + this.updateAllDayVisibility(); this._updateScrollable(); - this._applyCellTemplates(cellTemplates); + this.applyCellTemplates(cellTemplates); } protected renderGroupAllDayPanel() { @@ -3129,7 +3129,7 @@ class SchedulerWorkSpace extends Widget { return {}; } - const groupIndex = this._getGroupIndex(rowIndex, 0); + const groupIndex = this.getGroupIndex(rowIndex, 0); const groups = getLeafGroupValues(this.resourceManager.groupsLeafs, groupIndex); return { groupIndex, groups }; @@ -3176,9 +3176,9 @@ class SchedulerWorkSpace extends Widget { const groupCount = this._getGroupCount(); this.renderTableBody({ container: getPublicElement(this._$dateTable), - rowCount: this._getTotalRowCount(groupCount), - cellCount: this._getTotalCellCount(groupCount), - cellClass: this._getDateTableCellClass.bind(this), + rowCount: this.getTotalRowCount(groupCount), + cellCount: this.getTotalCellCount(groupCount), + cellClass: this.getDateTableCellClass.bind(this), rowClass: DATE_TABLE_ROW_CLASS, cellTemplate: this.option('dataCellTemplate'), // TODO: remove along with old render @@ -3213,7 +3213,7 @@ class SchedulerWorkSpace extends Widget { protected renderTableBody(options, delayCellTemplateRendering?: any): any { let result: any[] = []; if (!delayCellTemplateRendering) { - this._applyCellTemplates( + this.applyCellTemplates( tableCreator.makeTable(options), ); } else { diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts index 1e184dd264ce..d85b12245024 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts @@ -12,8 +12,8 @@ class SchedulerWorkSpaceDay extends SchedulerWorkSpaceVertical { return DAY_CLASS; } - _renderDateHeader() { - return this.option('intervalCount') === 1 ? null : super._renderDateHeader(); + renderDateHeader() { + return this.option('intervalCount') === 1 ? null : super.renderDateHeader(); } renderRHeaderPanel() { 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 41218fdd7545..37f367c982e7 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 @@ -187,8 +187,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return false; } - _getHeaderPanelCellClass(i) { - const cellClass = super._getHeaderPanelCellClass(i); + getHeaderPanelCellClass(i) { + const cellClass = super.getHeaderPanelCellClass(i); if (this._isCurrentTimeHeaderCell(i)) { return `${cellClass} ${HEADER_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 3af066c054fb..5767f6b4a9be 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(); } + updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } @@ -175,7 +175,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { .toggleClass(DATE_TABLE_OTHER_MONTH_DATE_CLASS, data.otherMonth); } - _createAllDayPanelElements() {} + createAllDayPanelElements() {} renderTableBody(options) { options.getCellText = (rowIndex, columnIndex) => { diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js index 3537a5aab439..b4205d589efe 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js @@ -927,7 +927,7 @@ module('Renovated Render', { const disposeRenovatedComponentsStub = sinon.spy(noop); - this.instance._disposeRenovatedComponents = disposeRenovatedComponentsStub; + this.instance.disposeRenovatedComponents = disposeRenovatedComponentsStub; this.instance.option('currentDate', new Date(2020, 8, 2)); @@ -944,7 +944,7 @@ module('Renovated Render', { const disposeRenovatedComponentsStub = sinon.spy(noop); - this.instance._disposeRenovatedComponents = disposeRenovatedComponentsStub; + this.instance.disposeRenovatedComponents = disposeRenovatedComponentsStub; this.instance.option('showAllDayPanel', true); @@ -958,7 +958,7 @@ module('Renovated Render', { }); const disposeRenovatedComponentsStub = sinon.spy(noop); - this.instance._disposeRenovatedComponents = disposeRenovatedComponentsStub; + this.instance.disposeRenovatedComponents = disposeRenovatedComponentsStub; await applyWorkspaceGroups(this.instance, resources); assert.ok(disposeRenovatedComponentsStub.called, 'Renovated components weren\'t disposed'); From 0437b001fd1f7ae7f1f1405e04f56410a1a7fd72 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 12:42:30 +0100 Subject: [PATCH 04/28] fix: fix bug --- .../js/__internal/scheduler/workspaces/m_work_space.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 fec28e377fe4..9b4d67745c04 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -2785,7 +2785,7 @@ class SchedulerWorkSpace extends Widget { } protected attachGroupCountClass() { - const className = this._groupedStrategy.getCellCountClass(this.option('groups')); + const className = this._groupedStrategy.getGroupCountClass(this.option('groups')); this.$element().addClass(className); } From 5fe5b0cee92c2d5374807ba14f537ffb67115d52 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 12:54:38 +0100 Subject: [PATCH 05/28] fix: refactor one by one --- .../scheduler/workspaces/m_agenda.ts | 12 ++-- .../scheduler/workspaces/m_timeline.ts | 8 +-- .../scheduler/workspaces/m_work_space.ts | 70 +++++++++---------- .../workspaces/m_work_space_month.ts | 6 +- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 64e1da7c006d..8bf04375271a 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -144,7 +144,7 @@ class SchedulerAgenda extends WorkSpace { _updateAllDayHeight() { return noop(); } - _initWorkSpaceUnits() { + initWorkSpaceUnits() { this._initGroupTable(); this._$timePanel = $('').attr('aria-hidden', true).addClass(TIME_PANEL_CLASS); this._$dateTable = $('
').attr('aria-hidden', true).addClass(DATE_TABLE_CLASS); @@ -196,7 +196,7 @@ class SchedulerAgenda extends WorkSpace { _setTableSizes() { return noop(); } - _toggleHorizontalScrollClass() { return noop(); } + toggleHorizontalScrollClass() { return noop(); } // eslint-disable-next-line @typescript-eslint/no-unused-vars _createCrossScrollingConfig(argument?: any) { return noop(); } @@ -273,7 +273,7 @@ class SchedulerAgenda extends WorkSpace { cellTag: 'th', groupTableClass: GROUP_TABLE_CLASS, groupRowClass: GROUP_ROW_CLASS, - groupCellClass: this._getGroupHeaderClass(), + groupCellClass: this.getGroupHeaderClass(), groupCellCustomContent(cell: HTMLDivElement, cellTextElement: HTMLElement, index: number, node: GroupNode) { const container = domAdapter.createElement('div'); container.className = getGroupHeaderContentClass; @@ -328,11 +328,11 @@ class SchedulerAgenda extends WorkSpace { } } - _createWorkSpaceElements() { - this._createWorkSpaceStaticElements(); + createWorkSpaceElements() { + this.createWorkSpaceStaticElements(); } - _createWorkSpaceStaticElements() { + createWorkSpaceStaticElements() { this._$dateTableContainer.append(this._$dateTable); this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index bf7f17939c37..b4fdd194b00d 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -329,7 +329,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return 'vertical'; } - _toggleGroupingDirectionClass() { + toggleGroupingDirectionClass() { (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this._isHorizontalGroupedWorkSpace()); } @@ -339,8 +339,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { }); } - _createWorkSpaceElements() { - this._createWorkSpaceScrollableElements(); + createWorkSpaceElements() { + this.createWorkSpaceScrollableElements(); } updateAllDayVisibility() { return noop(); } @@ -499,7 +499,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { { groupRowClass: GROUP_ROW_CLASS, groupHeaderRowClass: GROUP_ROW_CLASS, - groupHeaderClass: this._getGroupHeaderClass.bind(this), + groupHeaderClass: this.getGroupHeaderClass.bind(this), groupHeaderContentClass: GROUP_HEADER_CONTENT_CLASS, }, this._getCellCount() || 1, 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 9b4d67745c04..50f0bcbd2803 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -2321,7 +2321,7 @@ class SchedulerWorkSpace extends Widget { this.createAllDayPanelElements(); this.removeAllDayElements(); this._cleanWorkSpace(); - this._toggleGroupByDateClass(); + this.toggleGroupByDateClass(); break; case 'showAllDayPanel': if (this.isVerticalGroupedWorkSpace()) { @@ -2352,14 +2352,14 @@ class SchedulerWorkSpace extends Widget { break; case 'intervalCount': this._cleanWorkSpace(); - this._toggleWorkSpaceCountClass(); + this.toggleWorkSpaceCountClass(); break; case 'groupByDate': this._cleanWorkSpace(); - this._toggleGroupByDateClass(); + this.toggleGroupByDateClass(); break; case 'crossScrollingEnabled': - this._toggleHorizontalScrollClass(); + this.toggleHorizontalScrollClass(); this._dateTableScrollable.option(this._dateTableScrollableConfig()); break; case 'allDayPanelMode': @@ -2423,7 +2423,7 @@ class SchedulerWorkSpace extends Widget { _cleanWorkSpace() { this._cleanView(); this.toggleGroupedClass(); - this._toggleWorkSpaceWithOddCells(); + this.toggleWorkSpaceWithOddCells(); this.virtualScrollingDispatcher.updateDimensions(true); this._renderView(); @@ -2441,10 +2441,10 @@ class SchedulerWorkSpace extends Widget { this._initGrouping(); - this._toggleHorizontalScrollClass(); - this._toggleWorkSpaceCountClass(); - this._toggleGroupByDateClass(); - this._toggleWorkSpaceWithOddCells(); + this.toggleHorizontalScrollClass(); + this.toggleWorkSpaceCountClass(); + this.toggleGroupByDateClass(); + this.toggleWorkSpaceWithOddCells(); (this.$element() as any) .addClass(COMPONENT_CLASS) @@ -2471,8 +2471,8 @@ class SchedulerWorkSpace extends Widget { _initGrouping() { this._initGroupedStrategy(); - this._toggleGroupingDirectionClass(); - this._toggleGroupByDateClass(); + this.toggleGroupingDirectionClass(); + this.toggleGroupByDateClass(); } isVerticalOrientation() { @@ -2495,23 +2495,23 @@ class SchedulerWorkSpace extends Widget { return 'horizontal'; } - _toggleHorizontalScrollClass() { + protected toggleHorizontalScrollClass() { (this.$element() as any).toggleClass(WORKSPACE_WITH_BOTH_SCROLLS_CLASS, this.option('crossScrollingEnabled')); } - _toggleGroupByDateClass() { + private toggleGroupByDateClass() { (this.$element() as any).toggleClass(WORKSPACE_WITH_GROUP_BY_DATE_CLASS, this.isGroupedByDate()); } - _toggleWorkSpaceCountClass() { + private toggleWorkSpaceCountClass() { (this.$element() as any).toggleClass(WORKSPACE_WITH_COUNT_CLASS, this._isWorkSpaceWithCount()); } - _toggleWorkSpaceWithOddCells() { + protected toggleWorkSpaceWithOddCells() { (this.$element() as any).toggleClass(WORKSPACE_WITH_ODD_CELLS_CLASS, this._isWorkspaceWithOddCells()); } - _toggleGroupingDirectionClass() { + protected toggleGroupingDirectionClass() { (this.$element() as any).toggleClass(VERTICAL_GROUPED_WORKSPACE_CLASS, this.isVerticalGroupedWorkSpace()); } @@ -2522,13 +2522,13 @@ class SchedulerWorkSpace extends Widget { .addAdditionalGroupCellClasses(cellClass, columnIndex + 1, rowIndex, columnIndex); } - _getGroupHeaderClass(i?: any) { + protected getGroupHeaderClass(i?: any) { const cellClass = GROUP_HEADER_CLASS; return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i + 1); } - _initWorkSpaceUnits() { + protected initWorkSpaceUnits() { this._$headerPanelContainer = $('
').addClass('dx-scheduler-header-panel-container'); this._$headerTablesContainer = $('
').addClass('dx-scheduler-header-tables-container'); this._$headerPanel = $('
').attr('aria-hidden', true); @@ -2541,7 +2541,7 @@ class SchedulerWorkSpace extends Widget { this._$dateTableScrollableContent = $('
').addClass('dx-scheduler-date-table-scrollable-content'); this._$sidebarScrollableContent = $('
').addClass('dx-scheduler-side-bar-scrollable-content'); - this._initAllDayPanelElements(); + this.initAllDayPanelElements(); if (this.isRenovatedRender()) { this.createRAllDayPanelElements(); @@ -2555,13 +2555,13 @@ class SchedulerWorkSpace extends Widget { this._$groupTable = $('
').addClass(WORKSPACE_VERTICAL_GROUP_TABLE_CLASS); } - _initAllDayPanelElements() { + private initAllDayPanelElements() { this._allDayTitles = []; this._allDayTables = []; this._allDayPanels = []; } - _initDateTableScrollable() { + private initDateTableScrollable() { const $dateTableScrollable = $('
').addClass(SCHEDULER_DATE_TABLE_SCROLLABLE_CLASS); // @ts-expect-error @@ -2569,15 +2569,15 @@ class SchedulerWorkSpace extends Widget { this._scrollSync.dateTable = getMemoizeScrollTo(() => this._dateTableScrollable); } - _createWorkSpaceElements() { + protected createWorkSpaceElements() { if (this.option('crossScrollingEnabled')) { - this._createWorkSpaceScrollableElements(); + this.createWorkSpaceScrollableElements(); } else { - this._createWorkSpaceStaticElements(); + this.createWorkSpaceStaticElements(); } } - _createWorkSpaceStaticElements() { + protected createWorkSpaceStaticElements() { this._$dateTableContainer.append(this._$dateTable); if (this.isVerticalGroupedWorkSpace()) { @@ -2603,7 +2603,7 @@ class SchedulerWorkSpace extends Widget { this._$allDayPanel?.append(this._$allDayContainer, this._$allDayTable); } - this._appendHeaderPanelEmptyCellIfNecessary(); + this.appendHeaderPanelEmptyCellIfNecessary(); this._$headerPanelContainer.append(this._$headerTablesContainer); this.$element() @@ -2612,15 +2612,15 @@ class SchedulerWorkSpace extends Widget { .append(this._dateTableScrollable.$element()); } - _createWorkSpaceScrollableElements() { + protected createWorkSpaceScrollableElements() { this.$element().append(this._$fixedContainer); this._$flexContainer = $('
').addClass('dx-scheduler-work-space-flex-container'); - this._createHeaderScrollable(); + this.createHeaderScrollable(); this._headerScrollable.$content().append(this._$headerPanel); - this._appendHeaderPanelEmptyCellIfNecessary(); + this.appendHeaderPanelEmptyCellIfNecessary(); this._$headerPanelContainer.append(this._$headerTablesContainer); this.$element().append(this._$headerPanelContainer); @@ -2646,11 +2646,11 @@ class SchedulerWorkSpace extends Widget { this._sidebarScrollable.$content().append(this._$sidebarScrollableContent); } - _appendHeaderPanelEmptyCellIfNecessary() { + private appendHeaderPanelEmptyCellIfNecessary() { this._isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); } - _createHeaderScrollable() { + private createHeaderScrollable() { const $headerScrollable = $('
') .addClass(SCHEDULER_HEADER_SCROLLABLE_CLASS) .appendTo(this._$headerTablesContainer); @@ -2705,13 +2705,13 @@ class SchedulerWorkSpace extends Widget { _initMarkup() { this.cache.clear(); - this._initWorkSpaceUnits(); + this.initWorkSpaceUnits(); this._initVirtualScrolling(); - this._initDateTableScrollable(); + this.initDateTableScrollable(); - this._createWorkSpaceElements(); + this.createWorkSpaceElements(); // @ts-expect-error super._initMarkup(); @@ -2985,7 +2985,7 @@ class SchedulerWorkSpace extends Widget { { groupHeaderRowClass: GROUP_ROW_CLASS, groupRowClass: GROUP_ROW_CLASS, - groupHeaderClass: this._getGroupHeaderClass.bind(this), + groupHeaderClass: this.getGroupHeaderClass.bind(this), groupHeaderContentClass: GROUP_HEADER_CONTENT_CLASS, }, this._getCellCount() || 1, 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 5767f6b4a9be..46ac3e0d9c01 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 @@ -148,11 +148,11 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { // We need these methods for now but they are useless for renovation // ------------- - _createWorkSpaceElements() { + createWorkSpaceElements() { if (this.isVerticalGroupedWorkSpace()) { - this._createWorkSpaceScrollableElements(); + this.createWorkSpaceScrollableElements(); } else { - super._createWorkSpaceElements(); + super.createWorkSpaceElements(); } } From 7258171d82c824b7089d8317fe55555ff235c540 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 14:41:07 +0100 Subject: [PATCH 06/28] fix: fix build? --- .../js/__internal/scheduler/workspaces/m_timeline.ts | 4 ++-- .../js/__internal/scheduler/workspaces/m_work_space.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index b4fdd194b00d..b48c75fc8ade 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -47,7 +47,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return this._$sidebarTable ? getOuterWidth(this._$sidebarTable) : 0; } - _getTotalRowCount(groupCount) { + getTotalRowCount(groupCount) { if (this._isHorizontalGroupedWorkSpace()) { return this._getRowCount(); } @@ -504,7 +504,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 50f0bcbd2803..43961b2f0fb8 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -1112,7 +1112,7 @@ class SchedulerWorkSpace extends Widget { return this._groupedStrategy.getTotalCellCount(groupCount); } - private getTotalRowCount(groupCount, includeAllDayPanelRows?: any) { + protected getTotalRowCount(groupCount, includeAllDayPanelRows?: any) { let result = this._groupedStrategy.getTotalRowCount(groupCount); if (includeAllDayPanelRows && this.isAllDayPanelVisible) { From c4893f2d1bc9dceec70a53963a3f3f0641180165 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 14:56:42 +0100 Subject: [PATCH 07/28] fix: fix build --- packages/devextreme/js/__internal/scheduler/m_scheduler.ts | 2 +- .../js/__internal/scheduler/workspaces/m_work_space.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts index 58db4409fc8c..0b08509d4473 100644 --- a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts @@ -1297,7 +1297,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { this._workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig); this._allowDragging() && this._workSpace.initDragBehavior(this, this._all); - this._workSpace._attachTablesEvents(); + this._workSpace.attachTablesEvents(); this._workSpace.getWorkArea().append(this._appointments.$element()); this._recalculateWorkspace(); 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 43961b2f0fb8..8cd73405ee8e 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -1140,7 +1140,7 @@ class SchedulerWorkSpace extends Widget { return this.resourceManager.groupCount(); } - _attachTablesEvents() { + attachTablesEvents() { const element = this.$element(); this._attachDragEvents(element); @@ -2338,7 +2338,7 @@ class SchedulerWorkSpace extends Widget { break; case 'allDayExpanded': this.updateAllDayExpansion(); - this._attachTablesEvents(); + this.attachTablesEvents(); this._updateScrollable(); break; case 'onSelectionChanged': From e9d6d1c8e493a4728dff4c26a9efb76fbd9d7eed Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 13:39:01 +0100 Subject: [PATCH 08/28] fix: refactor one by one --- .../__tests__/workspace.base.test.ts | 4 +- .../m_compact_appointments_helper.ts | 2 +- .../js/__internal/scheduler/m_scheduler.ts | 6 +- .../scheduler/workspaces/m_agenda.ts | 2 +- .../scheduler/workspaces/m_timeline.ts | 4 +- .../scheduler/workspaces/m_timeline_month.ts | 4 +- .../scheduler/workspaces/m_work_space.ts | 60 +++++++++---------- .../workspaces/m_work_space_indicator.ts | 6 +- .../workspaces/m_work_space_vertical.ts | 2 +- 9 files changed, 45 insertions(+), 45 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 297f343f1769..7936a960acfb 100644 --- a/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts +++ b/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts @@ -58,12 +58,12 @@ describe('scheduler workspace', () => { expect(workspace.cache.clear).toHaveBeenCalledTimes(1); }); - it(`should clear cache on _cleanView call, view: ${currentView}`, () => { + it(`should clear cache on cleanView call, view: ${currentView}`, () => { const workspace = createWorkspace(WorkSpace, currentView); jest.spyOn(workspace.cache, 'clear'); workspace.cache.memo('test', () => 'value'); - workspace._cleanView(); + workspace.cleanView(); expect(workspace.cache.clear).toHaveBeenCalledTimes(1); expect(workspace.cache.size).toBe(0); diff --git a/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts b/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts index e13db784c4cf..f48ea7f329ee 100644 --- a/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts +++ b/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts @@ -89,7 +89,7 @@ export class CompactAppointmentsHelper { getItemSettings, }; - workSpace._createDragBehaviorBase($element, $schedulerElement, options); + workSpace.createDragBehaviorBase($element, $schedulerElement, options); }; } diff --git a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts index 0b08509d4473..e59a4d9fc547 100644 --- a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts @@ -1164,7 +1164,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { _initMarkupCore() { this._readyToRenderAppointments = hasWindow(); - this._workSpace && this._cleanWorkspace(); + this._workSpace && this.cleanWorkSpace(); this._renderWorkSpace(); this._appointments.option({ @@ -1418,7 +1418,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { } _refreshWorkSpace(): void { - this._cleanWorkspace(); + this.cleanWorkSpace(); delete this._workSpace; @@ -1433,7 +1433,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { } } - _cleanWorkspace() { + cleanWorkSpace() { this._appointments.$element().detach(); this._workSpace._dispose(); this._workSpace.$element().remove(); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 8bf04375271a..155d4d90d6b4 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -159,7 +159,7 @@ class SchedulerAgenda extends WorkSpace { } } - _renderView() { + renderView() { this._startViewDate = this._calculateStartViewDate(); this._rows = []; this._initPositionHelper(); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index b48c75fc8ade..c8540197543b 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -325,7 +325,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { .addClass(GROUP_TABLE_CLASS); } - _getDefaultGroupStrategy() { + getDefaultGroupStrategy() { return 'vertical'; } @@ -351,7 +351,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return this.option('timeCellTemplate'); } - _renderView() { + renderView() { let groupCellTemplates; if (!this.isRenovatedRender()) { groupCellTemplates = this.renderGroupHeader(); 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 5dc23b2e259a..fcd9be8bf481 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts @@ -16,8 +16,8 @@ class SchedulerTimelineMonth extends SchedulerTimeline { get renovatedHeaderPanelComponent() { return HeaderPanelComponent; } - _renderView() { - super._renderView(); + renderView() { + super.renderView(); this._updateScrollable(); } 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 8cd73405ee8e..58c91c4adbb1 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -843,7 +843,7 @@ class SchedulerWorkSpace extends Widget { this.virtualScrollingDispatcher = null; } - this.virtualScrollingDispatcher = new VirtualScrollingDispatcher(this._getVirtualScrollingDispatcherOptions()); + this.virtualScrollingDispatcher = new VirtualScrollingDispatcher(this.getVirtualScrollingDispatcherOptions()); this.virtualScrollingDispatcher.attachScrollableEvents(); this.renderer = new VirtualScrollingRenderer(this); } @@ -865,7 +865,7 @@ class SchedulerWorkSpace extends Widget { const groupOrientation = groupCount > 0 ? this.option('groupOrientation') - : this._getDefaultGroupStrategy(); + : this.getDefaultGroupStrategy(); const options = { groupByDate: this.option('groupByDate'), @@ -907,7 +907,7 @@ class SchedulerWorkSpace extends Widget { } updateHeaderEmptyCellWidth() { - if (hasWindow() && this._isRenderHeaderPanelEmptyCell()) { + if (hasWindow() && this.isRenderHeaderPanelEmptyCell()) { const timePanelWidth = this.getTimePanelWidth(); const groupPanelWidth = this.getGroupTableWidth(); @@ -2184,14 +2184,14 @@ class SchedulerWorkSpace extends Widget { const $rootElement = $(scheduler.element()); - this._createDragBehavior(this.getWorkArea(), $rootElement); + this.createDragBehavior(this.getWorkArea(), $rootElement); if (!this.isVerticalGroupedWorkSpace()) { - this._createDragBehavior(this._$allDayPanel, $rootElement); + this.createDragBehavior(this._$allDayPanel, $rootElement); } } } - _createDragBehavior($targetElement, $rootElement) { + private createDragBehavior($targetElement, $rootElement) { const getItemData = (itemElement, appointments) => appointments._getItemData(itemElement); const getItemSettings = ($itemElement) => $itemElement.data(APPOINTMENT_SETTINGS_KEY); @@ -2200,10 +2200,10 @@ class SchedulerWorkSpace extends Widget { getItemSettings, }; - this._createDragBehaviorBase($targetElement, $rootElement, options); + this.createDragBehaviorBase($targetElement, $rootElement, options); } - _createDragBehaviorBase(targetElement, rootElement, options) { + protected createDragBehaviorBase(targetElement, rootElement, options) { const container = (this.$element() as any).find(`.${FIXED_CONTAINER_CLASS}`); const disableDefaultDragging = () => { @@ -2237,7 +2237,7 @@ class SchedulerWorkSpace extends Widget { // We do not need these methods in renovation // -------------- - _isRenderHeaderPanelEmptyCell() { + private isRenderHeaderPanelEmptyCell() { return this.isVerticalGroupedWorkSpace(); } @@ -2308,24 +2308,24 @@ class SchedulerWorkSpace extends Widget { case 'firstDayOfWeek': case 'currentDate': case 'startDate': - this._cleanWorkSpace(); + this.cleanWorkSpace(); break; case 'groups': - this._cleanView(); + this.cleanView(); this.removeAllDayElements(); this._initGrouping(); this.repaint(); break; case 'groupOrientation': - this._initGroupedStrategy(); + this.initGroupedStrategy(); this.createAllDayPanelElements(); this.removeAllDayElements(); - this._cleanWorkSpace(); + this.cleanWorkSpace(); this.toggleGroupByDateClass(); break; case 'showAllDayPanel': if (this.isVerticalGroupedWorkSpace()) { - this._cleanView(); + this.cleanView(); this.removeAllDayElements(); this._initGrouping(); this.repaint(); @@ -2351,11 +2351,11 @@ class SchedulerWorkSpace extends Widget { this._attachContextMenuEvent(); break; case 'intervalCount': - this._cleanWorkSpace(); + this.cleanWorkSpace(); this.toggleWorkSpaceCountClass(); break; case 'groupByDate': - this._cleanWorkSpace(); + this.cleanWorkSpace(); this.toggleGroupByDateClass(); break; case 'crossScrollingEnabled': @@ -2395,7 +2395,7 @@ class SchedulerWorkSpace extends Widget { (this.option('onShowAllDayPanel') as any)(!isHiddenAllDayPanel); } - _getVirtualScrollingDispatcherOptions() { + private getVirtualScrollingDispatcherOptions() { return { getCellHeight: this.getCellHeight.bind(this), getCellWidth: this.getCellWidth.bind(this), @@ -2420,13 +2420,13 @@ class SchedulerWorkSpace extends Widget { }; } - _cleanWorkSpace() { - this._cleanView(); + protected cleanWorkSpace() { + this.cleanView(); this.toggleGroupedClass(); this.toggleWorkSpaceWithOddCells(); this.virtualScrollingDispatcher.updateDimensions(true); - this._renderView(); + this.renderView(); this.option('crossScrollingEnabled') && this._setTableSizes(); this.cache.clear(); } @@ -2451,7 +2451,7 @@ class SchedulerWorkSpace extends Widget { .addClass(this._getElementClass()); } - _initPositionHelper() { + private initPositionHelper() { this.positionHelper = new PositionHelper({ key: this.option('key'), viewDataProvider: this.viewDataProvider, @@ -2470,7 +2470,7 @@ class SchedulerWorkSpace extends Widget { } _initGrouping() { - this._initGroupedStrategy(); + this.initGroupedStrategy(); this.toggleGroupingDirectionClass(); this.toggleGroupByDateClass(); } @@ -2478,12 +2478,12 @@ class SchedulerWorkSpace extends Widget { isVerticalOrientation() { const orientation = this.option('groups')?.length ? this.option('groupOrientation') - : this._getDefaultGroupStrategy(); + : this.getDefaultGroupStrategy(); return orientation === 'vertical'; } - _initGroupedStrategy() { + private initGroupedStrategy() { const Strategy = this.isVerticalOrientation() ? VerticalGroupedStrategy : HorizontalGroupedStrategy; @@ -2491,7 +2491,7 @@ class SchedulerWorkSpace extends Widget { this._groupedStrategy = new Strategy(this); } - _getDefaultGroupStrategy() { + protected getDefaultGroupStrategy() { return 'horizontal'; } @@ -2647,7 +2647,7 @@ class SchedulerWorkSpace extends Widget { } private appendHeaderPanelEmptyCellIfNecessary() { - this._isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); + this.isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); } private createHeaderScrollable() { @@ -2723,7 +2723,7 @@ class SchedulerWorkSpace extends Widget { this.toggleGroupedClass(); - this._renderView(); + this.renderView(); this._attachEvents(); } @@ -2738,7 +2738,7 @@ class SchedulerWorkSpace extends Widget { (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this._getGroupCount() > 0); } - _renderView() { + renderView() { if (this.isRenovatedRender()) { if (this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); @@ -2819,7 +2819,7 @@ class SchedulerWorkSpace extends Widget { this._$allDayTitle?.remove(); } - _cleanView(): void { + cleanView(): void { this.cache.clear(); this.cleanTableWidths(); this.cellsSelectionState.clearSelectedAndFocusedCells(); @@ -2951,7 +2951,7 @@ class SchedulerWorkSpace extends Widget { this.renderAllDayPanel(); } - this._initPositionHelper(); + this.initPositionHelper(); } protected renderGroupHeader() { 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 37f367c982e7..d9704239dbef 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 @@ -213,8 +213,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { (this.$element() as any).find(`.${SCHEDULER_DATE_TIME_INDICATOR_CLASS}`).remove(); } - _cleanWorkSpace() { - super._cleanWorkSpace(); + cleanWorkSpace() { + super.cleanWorkSpace(); this._renderDateTimeIndication(); this._setIndicationUpdateInterval(); @@ -224,7 +224,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { switch (args.name) { case 'showCurrentTimeIndicator': case 'indicatorTime': - this._cleanWorkSpace(); + this.cleanWorkSpace(); break; case 'indicatorUpdateInterval': this._setIndicationUpdateInterval(); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts index 129d2604b158..845cc655036f 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts @@ -16,7 +16,7 @@ class SchedulerWorkspaceVertical extends SchedulerWorkSpaceIndicator { }; } - _isRenderHeaderPanelEmptyCell() { + isRenderHeaderPanelEmptyCell() { return true; } } From 3b35b0c8abc0a050b3fe4c66c321ae3155f00619 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 13:44:55 +0100 Subject: [PATCH 09/28] fix: refactor one by one --- .../scheduler/workspaces/m_work_space.ts | 26 +++++++++---------- .../workspaces/m_work_space_indicator.ts | 12 ++++----- .../currentTimeIndicator.tests.js | 6 ++--- 3 files changed, 22 insertions(+), 22 deletions(-) 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 58c91c4adbb1..4571dfcf0f97 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -423,7 +423,7 @@ class SchedulerWorkSpace extends Widget { e.preventDefault(); e.stopPropagation(); - const selectedCells = this._getSelectedCellsData(); + const selectedCells = this.getSelectedCellsData(); if (selectedCells?.length) { const selectedCellsElement = selectedCells.map((cellData) => this._getCellByData(cellData)).filter((cell) => Boolean(cell)); @@ -567,7 +567,7 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this._updateSelectedCellDataOption(this._getSelectedCellsData(), $nextFocusedCell); + this._updateSelectedCellDataOption(this.getSelectedCellsData(), $nextFocusedCell); } _hasAllDayClass($cell) { @@ -604,7 +604,7 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this._updateSelectedCellDataOption(this._getSelectedCellsData()); + this._updateSelectedCellDataOption(this.getSelectedCellsData()); } } @@ -1033,7 +1033,7 @@ class SchedulerWorkSpace extends Widget { } private handleSelectedCellsClick() { - const selectedCells = this._getSelectedCellsData(); + const selectedCells = this.getSelectedCellsData(); const firstCellData = selectedCells[0]; const lastCellData = selectedCells[selectedCells.length - 1]; @@ -1447,7 +1447,7 @@ class SchedulerWorkSpace extends Widget { return false; } - protected _normalizeCellData(cellData) { + private normalizeCellData(cellData) { return extend(true, {}, { startDate: cellData.startDate, endDate: cellData.endDate, @@ -1459,16 +1459,16 @@ class SchedulerWorkSpace extends Widget { }); } - protected _getSelectedCellsData() { + private getSelectedCellsData() { const selected = this.cellsSelectionState.getSelectedCells(); - return selected?.map(this._normalizeCellData.bind(this)); + return selected?.map(this.normalizeCellData.bind(this)); } getCellData($cell) { const cellData = this._getFullCellData($cell) ?? {}; - return this._normalizeCellData(cellData); + return this.normalizeCellData(cellData); } _getFullCellData($cell) { @@ -2730,8 +2730,8 @@ class SchedulerWorkSpace extends Widget { _render() { // @ts-expect-error super._render(); - this._renderDateTimeIndication(); - this._setIndicationUpdateInterval(); + this.renderDateTimeIndication(); + this.setIndicationUpdateInterval(); } private toggleGroupedClass() { @@ -2770,13 +2770,13 @@ class SchedulerWorkSpace extends Widget { }); } - protected _renderDateTimeIndication() { return noop(); } + protected renderDateTimeIndication() { return noop(); } protected renderCurrentDateTimeLineAndShader(): void { return noop(); } protected renderCurrentDateTimeIndication(): void { return noop(); } - protected _setIndicationUpdateInterval() { return noop(); } + protected setIndicationUpdateInterval() { return noop(); } protected detachGroupCountClass() { VERTICAL_GROUP_COUNT_CLASSES.forEach((className) => { @@ -3195,7 +3195,7 @@ class SchedulerWorkSpace extends Widget { const { cellData } = this.viewDataProvider.viewDataMap.dateTableMap[validRowIndex][columnIndex]; return { - value: this._normalizeCellData(cellData), + value: this.normalizeCellData(cellData), fullValue: cellData, key: CELL_DATA, }; 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 d9704239dbef..f5622ff11c01 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 @@ -84,7 +84,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return this.option('rtlEnabled') ? getBoundingRect(this._dateTableScrollable.$content().get(0)).width - this.getTimePanelWidth() - width : 0; } - protected _setIndicationUpdateInterval() { + protected setIndicationUpdateInterval() { if (!this.option('showCurrentTimeIndicator') || this.option('indicatorUpdateInterval') === 0) { return; } @@ -173,7 +173,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { renderCurrentDateTimeLineAndShader(): void { this._cleanDateTimeIndicator(); this._shader?.clean(); - this._renderDateTimeIndication(); + this.renderDateTimeIndication(); } _isCurrentTimeHeaderCell(headerIndex: number): boolean { @@ -216,8 +216,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { cleanWorkSpace() { super.cleanWorkSpace(); - this._renderDateTimeIndication(); - this._setIndicationUpdateInterval(); + this.renderDateTimeIndication(); + this.setIndicationUpdateInterval(); } _optionChanged(args) { @@ -227,7 +227,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { this.cleanWorkSpace(); break; case 'indicatorUpdateInterval': - this._setIndicationUpdateInterval(); + this.setIndicationUpdateInterval(); break; case 'showAllDayPanel': case 'allDayExpanded': @@ -282,7 +282,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { ], []); } - protected _renderDateTimeIndication(): void { + protected renderDateTimeIndication(): void { if (!this.isIndicationAvailable()) { return; } 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 bb69c6c167aa..123c71072078 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 @@ -67,7 +67,7 @@ QUnit.module('DateTime indicator on Day View', () => { QUnit.test('Indication should be updated by some timer', async function(assert) { const instance = createInstance({}); - const renderIndicatorStub = sinon.stub(instance, '_renderDateTimeIndication'); + const renderIndicatorStub = sinon.stub(instance, 'renderDateTimeIndication'); instance.option({ indicatorUpdateInterval: 10 @@ -82,7 +82,7 @@ QUnit.module('DateTime indicator on Day View', () => { QUnit.test('Indication should not be updated by some timer if indicatorUpdateInterval = 0', async function(assert) { const instance = createInstance({}); - const renderIndicatorStub = sinon.stub(instance, '_renderDateTimeIndication'); + const renderIndicatorStub = sinon.stub(instance, 'renderDateTimeIndication'); instance.option({ indicatorUpdateInterval: 0 @@ -95,7 +95,7 @@ QUnit.module('DateTime indicator on Day View', () => { QUnit.test('Indication should be updated on dimensionChanged', async function(assert) { const instance = createInstance({}); - const renderIndicatorStub = sinon.stub(instance, '_renderDateTimeIndication'); + const renderIndicatorStub = sinon.stub(instance, 'renderDateTimeIndication'); instance.option({ indicatorTime: new Date(2017, 8, 5, 12, 45) From 1a592d50dbf795ce73c470a09afa4bb2b05d10f1 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 13:50:35 +0100 Subject: [PATCH 10/28] fix: fix build --- .../devextreme/js/__internal/scheduler/workspaces/m_agenda.ts | 4 ++-- .../js/__internal/scheduler/workspaces/m_work_space.ts | 2 +- .../__internal/scheduler/workspaces/m_work_space_indicator.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 155d4d90d6b4..6511bd4589af 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -167,7 +167,7 @@ class SchedulerAgenda extends WorkSpace { _recalculateAgenda(rows) { let cellTemplates = []; - this._cleanView(); + this.cleanView(); if (this._rowsIsEmpty(rows)) { this._renderNoData(); @@ -312,7 +312,7 @@ class SchedulerAgenda extends WorkSpace { }; } - _cleanView() { + cleanView() { this._$dateTable.empty(); this._$timePanel.empty(); 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 4571dfcf0f97..9bca91caac33 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -2237,7 +2237,7 @@ class SchedulerWorkSpace extends Widget { // We do not need these methods in renovation // -------------- - private isRenderHeaderPanelEmptyCell() { + protected isRenderHeaderPanelEmptyCell() { return this.isVerticalGroupedWorkSpace(); } 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 f5622ff11c01..c1a435365361 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 @@ -197,8 +197,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return cellClass; } - _cleanView() { - super._cleanView(); + cleanView() { + super.cleanView(); this._cleanDateTimeIndicator(); } From 10475fc4cb41d68d5ee95c36194925ea77768da2 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 15:24:40 +0100 Subject: [PATCH 11/28] fix: refactor one by one --- .../__tests__/__mock__/m_mock_scheduler.ts | 2 +- .../js/__internal/scheduler/m_subscribes.ts | 2 +- .../m_current_time_shader_horizontal.ts | 8 +- .../scheduler/workspaces/m_agenda.ts | 16 +- .../scheduler/workspaces/m_timeline.ts | 72 ++-- .../scheduler/workspaces/m_timeline_day.ts | 4 +- .../scheduler/workspaces/m_timeline_month.ts | 10 +- .../scheduler/workspaces/m_timeline_week.ts | 2 +- .../workspaces/m_timeline_work_week.ts | 4 +- .../scheduler/workspaces/m_work_space.ts | 386 +++++++++--------- .../scheduler/workspaces/m_work_space_day.ts | 2 +- ..._work_space_grouped_strategy_horizontal.ts | 28 +- .../m_work_space_grouped_strategy_vertical.ts | 20 +- .../workspaces/m_work_space_indicator.ts | 12 +- .../workspaces/m_work_space_month.ts | 30 +- .../workspaces/m_work_space_vertical.ts | 2 +- .../scheduler/workspaces/m_work_space_week.ts | 6 +- .../workspaces/m_work_space_work_week.ts | 4 +- 18 files changed, 305 insertions(+), 305 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/__tests__/__mock__/m_mock_scheduler.ts b/packages/devextreme/js/__internal/scheduler/__tests__/__mock__/m_mock_scheduler.ts index 3c452af4307b..a151e5f925b1 100644 --- a/packages/devextreme/js/__internal/scheduler/__tests__/__mock__/m_mock_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/__tests__/__mock__/m_mock_scheduler.ts @@ -19,7 +19,7 @@ export const setupSchedulerTestEnvironment = ({ }: SetupSchedulerTestEnvironmentOptions = {}): void => { jest.spyOn(logger, 'warn').mockImplementation(() => {}); DOMComponent.prototype._isVisible = jest.fn((): boolean => true); - SchedulerWorkSpace.prototype._createCrossScrollingConfig = (): { + SchedulerWorkSpace.prototype.createCrossScrollingConfig = (): { direction: string; onScroll: jest.Mock; onEnd: jest.Mock; diff --git a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts index 7c2da2efc39a..f932669278f6 100644 --- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts +++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts @@ -243,7 +243,7 @@ const subscribes = { }, getGroupCount() { - return this._workSpace._getGroupCount(); + return this._workSpace.getGroupCount(); }, mapAppointmentFields(config) { diff --git a/packages/devextreme/js/__internal/scheduler/shaders/m_current_time_shader_horizontal.ts b/packages/devextreme/js/__internal/scheduler/shaders/m_current_time_shader_horizontal.ts index 2e99b476e147..5b5b4c3da128 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/m_current_time_shader_horizontal.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/m_current_time_shader_horizontal.ts @@ -5,7 +5,7 @@ import CurrentTimeShader from './m_current_time_shader'; class HorizontalCurrentTimeShader extends CurrentTimeShader { renderShader() { - const groupCount = this._workSpace._isHorizontalGroupedWorkSpace() ? this._workSpace._getGroupCount() : 1; + const groupCount = this._workSpace.isHorizontalGroupedWorkSpace() ? this._workSpace.getGroupCount() : 1; for (let i = 0; i < groupCount; i += 1) { const isFirstShader = i === 0; @@ -28,7 +28,7 @@ class HorizontalCurrentTimeShader extends CurrentTimeShader { if (groupIndex >= 1) { const workSpace = this._workSpace; - const indicationWidth = workSpace._getCellCount() * workSpace.getCellWidth(); + const indicationWidth = workSpace.getCellCount() * workSpace.getCellWidth(); $shader.css('left', indicationWidth); } else { $shader.css('left', 0); @@ -59,9 +59,9 @@ 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(); + shaderLeft = workSpace.getCellWidth() * integerPart * workSpace.getGroupCount() + groupIndex * workSpace.getCellWidth(); } $shader.css('left', shaderLeft); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 6511bd4589af..d37a724854ac 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -118,7 +118,7 @@ class SchedulerAgenda extends WorkSpace { return false; } - _getElementClass() { + getElementClass() { return AGENDA_CLASS; } @@ -126,11 +126,11 @@ class SchedulerAgenda extends WorkSpace { return agendaUtils.calculateStartViewDate(this.option('currentDate') as any, this.option('startDayHour') as any); } - _getRowCount() { + getRowCount() { return this.option('agendaDuration') as number; } - _getCellCount() { + getCellCount() { return 1; } @@ -194,15 +194,15 @@ class SchedulerAgenda extends WorkSpace { this._dateTableScrollable.$content().append(this._$noDataContainer); } - _setTableSizes() { return noop(); } + setTableSizes() { return noop(); } toggleHorizontalScrollClass() { return noop(); } // eslint-disable-next-line @typescript-eslint/no-unused-vars - _createCrossScrollingConfig(argument?: any) { return noop(); } + createCrossScrollingConfig(argument?: any) { return noop(); } _setGroupHeaderCellsHeight() { - const $cells = this._getGroupHeaderCells().filter((_, element) => !element.getAttribute('rowSpan')); + const $cells = this.getGroupHeaderCells().filter((_, element) => !element.getAttribute('rowSpan')); const rows = this._removeEmptyRows(this._rows); if (!rows.length) { @@ -354,7 +354,7 @@ class SchedulerAgenda extends WorkSpace { _attachTablesEvents() { return noop(); } - _attachEvents() { return noop(); } + attachEvents() { return noop(); } _cleanCellDataCache() { return noop(); } @@ -551,7 +551,7 @@ class SchedulerAgenda extends WorkSpace { _setSelectedCellsByCellData() {} - _getIntervalDuration() { + 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 c8540197543b..60def20d1be1 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -48,14 +48,14 @@ class SchedulerTimeline extends SchedulerWorkSpace { } getTotalRowCount(groupCount) { - if (this._isHorizontalGroupedWorkSpace()) { - return this._getRowCount(); + if (this.isHorizontalGroupedWorkSpace()) { + return this.getRowCount(); } groupCount = groupCount || 1; - return this._getRowCount() * groupCount; + return this.getRowCount() * groupCount; } - _getFormat(): any { + getFormat(): any { return 'shorttime'; } @@ -67,8 +67,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { return getBoundingRect((this.$element() as any).get(0)).height; } - _dateTableScrollableConfig() { - const config = super._dateTableScrollableConfig(); + dateTableScrollableConfig() { + const config = super.dateTableScrollableConfig(); const timelineConfig = { direction: HORIZONTAL, }; @@ -76,12 +76,12 @@ class SchedulerTimeline extends SchedulerWorkSpace { return this.option('crossScrollingEnabled') ? config : extend(config, timelineConfig); } - _needCreateCrossScrolling() { + needCreateCrossScrolling() { return true; } - _headerScrollableConfig() { - const config = super._headerScrollableConfig(); + headerScrollableConfig() { + const config = super.headerScrollableConfig(); return extend(config, { scrollByContent: true, @@ -93,7 +93,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } getGroupHeaderContainer() { - if (this._isHorizontalGroupedWorkSpace()) { + if (this.isHorizontalGroupedWorkSpace()) { return this._$thead; } return this._$sidebarTable; @@ -136,13 +136,13 @@ class SchedulerTimeline extends SchedulerWorkSpace { let duration = (timeDiff - differenceInDays * toMs('day') - (this.option('startDayHour') as any) * toMs('hour')) / this.getCellDuration(); if (today.getHours() > (this.option('endDayHour') as any)) { - duration = this._getCellCountInDay(); + duration = this.getCellCountInDay(); } if (duration < 0) { duration = 0; } - return differenceInDays * this._getCellCountInDay() + duration; + return differenceInDays * this.getCellCountInDay() + duration; } getIndicationWidth() { @@ -151,7 +151,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(); } @@ -164,8 +164,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { return false; } - _setTableSizes() { - super._setTableSizes(); + setTableSizes() { + super.setTableSizes(); const minHeight = this._getWorkSpaceMinHeight(); setHeight(this._$sidebarTable, minHeight); @@ -186,14 +186,14 @@ class SchedulerTimeline extends SchedulerWorkSpace { return minHeight; } - _getCellCoordinatesByIndex(index) { + getCellCoordinatesByIndex(index) { return { - columnIndex: index % this._getCellCount(), + columnIndex: index % this.getCellCount(), rowIndex: 0, }; } - _getCellByCoordinates(cellCoordinates, groupIndex) { + getCellByCoordinates(cellCoordinates, groupIndex) { const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex); return this._$dateTable @@ -203,7 +203,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { .eq(indexes.columnIndex); } - _getWorkSpaceWidth() { + getWorkSpaceWidth() { return getOuterWidth(this._$dateTable, true); } @@ -211,7 +211,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return dateUtils.trimTime(new Date(this.getStartViewDate())); } - _getIntervalBetween(currentDate, allDay) { + getIntervalBetween(currentDate, allDay) { const startDayHour = this.option('startDayHour'); const endDayHour = this.option('endDayHour'); const firstViewDate = this.getStartViewDate(); @@ -223,7 +223,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { const fullDays = Math.floor(fullInterval / toMs('day')); const tailDuration = fullInterval - (fullDays * toMs('day')); let tailDelta = 0; - const cellCount = this._getCellCountInDay() * (fullDays - this._getWeekendsCount(fullDays)); + const cellCount = this.getCellCountInDay() * (fullDays - this.getWeekendsCount(fullDays)); const gapBeforeAppt = apptStart - dateUtils.trimTime(new Date(currentDate)).getTime(); let result = cellCount * (this.option('hoursInterval') as any) * toMs('hour'); @@ -254,7 +254,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - _getWeekendsCount(argument?: any) { + getWeekendsCount(argument?: any) { return 0; } @@ -330,7 +330,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } toggleGroupingDirectionClass() { - (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this._isHorizontalGroupedWorkSpace()); + (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this.isHorizontalGroupedWorkSpace()); } _getDefaultOptions() { @@ -376,25 +376,25 @@ class SchedulerTimeline extends SchedulerWorkSpace { this.applyCellTemplates(groupCellTemplates); } - _setHorizontalGroupHeaderCellsHeight() { return noop(); } + setHorizontalGroupHeaderCellsHeight() { return noop(); } - _getTimePanelCells() { + getTimePanelCells() { return (this.$element() as any) .find(`.${HEADER_PANEL_CELL_CLASS}:not(.${HEADER_PANEL_WEEK_CELL_CLASS})`); } _getCurrentTimePanelCellIndices() { - const columnCountPerGroup = this._getCellCount(); + const columnCountPerGroup = this.getCellCount(); const today = this._getToday(); const index = this.getCellIndexByDate(today); - const { columnIndex: currentTimeColumnIndex } = this._getCellCoordinatesByIndex(index); + const { columnIndex: currentTimeColumnIndex } = this.getCellCoordinatesByIndex(index); if (currentTimeColumnIndex === undefined) { return []; } - const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() - ? this._getGroupCount() + const horizontalGroupCount = this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() + ? this.getGroupCount() : 1; return [...new Array(horizontalGroupCount)] @@ -418,14 +418,14 @@ class SchedulerTimeline extends SchedulerWorkSpace { let currentDate = new Date(firstViewDate); const $cells: any[] = []; - const groupCount = this._getGroupCount(); - const cellCountInDay = this._getCellCountInDay(); + const groupCount = this.getGroupCount(); + const cellCountInDay = this.getCellCountInDay(); const colSpan = this.isGroupedByDate() ? cellCountInDay * groupCount : cellCountInDay; const cellTemplate: any = this.option('dateCellTemplate'); - const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() + const horizontalGroupCount = this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() ? groupCount : 1; const cellsInGroup = this.viewDataProvider.viewDataGenerator.daysInInterval * (this.option('intervalCount') as any); @@ -481,7 +481,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); @@ -502,9 +502,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { groupHeaderClass: this.getGroupHeaderClass.bind(this), groupHeaderContentClass: GROUP_HEADER_CONTENT_CLASS, }, - this._getCellCount() || 1, + this.getCellCount() || 1, this.option('resourceCellTemplate'), - this.getTotalRowCount(this._getGroupCount()), + this.getTotalRowCount(this.getGroupCount()), groupByDate, ); } @@ -513,7 +513,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { // TODO Old render: delete these methods with the old render. _setCurrentTimeCells(): void { - const timePanelCells = this._getTimePanelCells(); + const timePanelCells = this.getTimePanelCells(); const currentTimeCellIndices = this._getCurrentTimePanelCellIndices(); currentTimeCellIndices.forEach((timePanelCellIndex) => { timePanelCells.eq(timePanelCellIndex) 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..9c9278f04fc7 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts @@ -8,12 +8,12 @@ const TIMELINE_CLASS = 'dx-scheduler-timeline-day'; class SchedulerTimelineDay extends SchedulerTimeline { get type() { return VIEWS.TIMELINE_DAY; } - _getElementClass() { + getElementClass() { return TIMELINE_CLASS; } _needRenderWeekHeader() { - return this._isWorkSpaceWithCount(); + 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 fcd9be8bf481..c0e723238fb7 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts @@ -19,10 +19,10 @@ class SchedulerTimelineMonth extends SchedulerTimeline { renderView() { super.renderView(); - this._updateScrollable(); + this.updateScrollable(); } - _getElementClass() { + getElementClass() { return TIMELINE_CLASS; } @@ -38,18 +38,18 @@ class SchedulerTimelineMonth extends SchedulerTimeline { return true; } - _getFormat() { + getFormat() { return formatWeekdayAndDay; } - _getIntervalBetween(currentDate) { + getIntervalBetween(currentDate) { const firstViewDate = this.getStartViewDate(); const timeZoneOffset = dateUtils.getTimezonesDifference(firstViewDate, currentDate); return currentDate.getTime() - (firstViewDate.getTime() - (this.option('startDayHour') as any) * 3600000) - timeZoneOffset; } - _getViewStartByOptions() { + getViewStartByOptions() { return monthUtils.getViewStartByOptions( this.option('startDate') as any, this.option('currentDate') as any, 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..030c51e585f6 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts @@ -9,7 +9,7 @@ const TIMELINE_CLASS = 'dx-scheduler-timeline-week'; export default class SchedulerTimelineWeek extends SchedulerTimeline { get type() { return VIEWS.TIMELINE_WEEK; } - _getElementClass() { + getElementClass() { return TIMELINE_CLASS; } 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..58090de744a4 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 @@ -16,10 +16,10 @@ class SchedulerTimelineWorkWeek extends SchedulerTimelineWeek { // @ts-expect-error super(...args); - this._getWeekendsCount = getWeekendsCount; + this.getWeekendsCount = getWeekendsCount; } - _getElementClass() { + getElementClass() { return TIMELINE_CLASS; } 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 9bca91caac33..f5480d417e75 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -352,7 +352,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, @@ -383,7 +383,7 @@ class SchedulerWorkSpace extends Widget { } get isAllDayPanelVisible() { - return this._isShowAllDayPanel() && this.supportAllDayRow(); + return this.isShowAllDayPanel() && this.supportAllDayRow(); } get verticalGroupTableClass() { return WORKSPACE_VERTICAL_GROUP_TABLE_CLASS; } @@ -426,7 +426,7 @@ class SchedulerWorkSpace extends Widget { const selectedCells = this.getSelectedCellsData(); if (selectedCells?.length) { - const selectedCellsElement = selectedCells.map((cellData) => this._getCellByData(cellData)).filter((cell) => Boolean(cell)); + const selectedCellsElement = selectedCells.map((cellData) => this.getCellByData(cellData)).filter((cell) => Boolean(cell)); e.target = selectedCellsElement; this._showPopup = true; @@ -444,10 +444,10 @@ class SchedulerWorkSpace extends Widget { const isAllDayPanelCell = focusedCellData.allDay && !this.isVerticalGroupedWorkSpace(); const isMultiSelection = e.shiftKey; const isMultiSelectionAllowed = this.option('allowMultipleCellSelection'); - const isRTL = this._isRTL(); - const groupCount = this._getGroupCount(); + 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, @@ -499,7 +499,7 @@ class SchedulerWorkSpace extends Widget { }); } - _isRTL() { + private isRTL() { return this.option('rtlEnabled'); } @@ -509,7 +509,7 @@ class SchedulerWorkSpace extends Widget { } const isMultiSelectionAllowed = this.option('allowMultipleCellSelection'); - const currentCellData = this._getFullCellData($cell); + const currentCellData = this.getFullCellData($cell); const focusedCellData = this.cellsSelectionState.getFocusedCell().cellData; const nextFocusedCellData = this.cellsSelectionController.moveToCell({ @@ -537,8 +537,8 @@ class SchedulerWorkSpace extends Widget { if (!this.viewDataProvider.isSameCell(focusedCellData, nextCellData)) { const $cell = nextCellData.allDay && !this.isVerticalGroupedWorkSpace() - ? this._dom_getAllDayPanelCell(nextCellPosition.columnIndex) - : this._dom_getDateCell(nextCellPosition); + ? this.dom_getAllDayPanelCell(nextCellPosition.columnIndex) + : this.dom_getDateCell(nextCellPosition); const isNextCellAllDay = nextCellData.allDay; this.setSelectedCellsStateAndUpdateSelection(isNextCellAllDay, nextCellPosition, isMultiSelection, $cell); @@ -567,10 +567,10 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this._updateSelectedCellDataOption(this.getSelectedCellsData(), $nextFocusedCell); + this.updateSelectedCellDataOption(this.getSelectedCellsData(), $nextFocusedCell); } - _hasAllDayClass($cell) { + private hasAllDayClass($cell) { return $cell.hasClass(ALL_DAY_TABLE_CELL_CLASS); } @@ -604,7 +604,7 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this._updateSelectedCellDataOption(this.getSelectedCellsData()); + this.updateSelectedCellDataOption(this.getSelectedCellsData()); } } @@ -628,19 +628,19 @@ class SchedulerWorkSpace extends Widget { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'vertical'; } - _isHorizontalGroupedWorkSpace() { + isHorizontalGroupedWorkSpace() { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'horizontal'; } - _isWorkSpaceWithCount() { + protected isWorkSpaceWithCount() { return this.option('intervalCount') as any > 1; } - _isWorkspaceWithOddCells() { + private isWorkspaceWithOddCells() { return this.option('hoursInterval') === 0.5 && !this.isVirtualScrolling(); } - _getRealGroupOrientation() { + private getRealGroupOrientation() { return this.isVerticalGroupedWorkSpace() ? 'vertical' : 'horizontal'; @@ -651,7 +651,7 @@ class SchedulerWorkSpace extends Widget { this._$allDayTitle = $('
').appendTo(this._$headerPanelEmptyCell); } - _dateTableScrollableConfig() { + protected dateTableScrollableConfig() { let config: any = { useKeyboard: false, bounceEnabled: false, @@ -679,8 +679,8 @@ class SchedulerWorkSpace extends Widget { }, }; - if (this._needCreateCrossScrolling()) { - config = extend(config, this._createCrossScrollingConfig(config)); + if (this.needCreateCrossScrolling()) { + config = extend(config, this.createCrossScrollingConfig(config)); } if (this.isVirtualScrolling() @@ -700,7 +700,7 @@ class SchedulerWorkSpace extends Widget { return config; } - _createCrossScrollingConfig({ onScroll }): any { + protected createCrossScrollingConfig({ onScroll }): any { return { direction: 'both', onScroll: (event) => { @@ -715,7 +715,7 @@ class SchedulerWorkSpace extends Widget { }; } - _headerScrollableConfig() { + protected headerScrollableConfig() { return { useKeyboard: false, showScrollbar: 'never', @@ -733,15 +733,15 @@ class SchedulerWorkSpace extends Widget { this.cache.clear(); if (visible) { - this._updateGroupTableHeight(); + this.updateGroupTableHeight(); } - if (visible && this._needCreateCrossScrolling()) { - this._setTableSizes(); + if (visible && this.needCreateCrossScrolling()) { + this.setTableSizes(); } } - _setTableSizes() { + protected setTableSizes() { this.cache.clear(); this.attachTableClasses(); @@ -753,7 +753,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; @@ -770,9 +770,9 @@ class SchedulerWorkSpace extends Widget { this.attachHeaderTableClasses(); - this._updateGroupTableHeight(); + this.updateGroupTableHeight(); - this._updateScrollable(); + this.updateScrollable(); } getWorkSpaceMinWidth() { @@ -787,23 +787,23 @@ class SchedulerWorkSpace extends Widget { } if (this.option('crossScrollingEnabled')) { - this._setTableSizes(); + this.setTableSizes(); } this.updateHeaderEmptyCellWidth(); - this._updateScrollable(); + this.updateScrollable(); this.cache.clear(); } - _needCreateCrossScrolling() { + protected needCreateCrossScrolling() { return this.option('crossScrollingEnabled'); } - _getElementClass() { return noop(); } + protected getElementClass() { return noop(); } - _getRowCount() { + getRowCount() { return this.viewDataProvider.getRowCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -814,7 +814,7 @@ class SchedulerWorkSpace extends Widget { }); } - _getCellCount() { + getCellCount() { return this.viewDataProvider.getCellCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -829,15 +829,15 @@ class SchedulerWorkSpace extends Widget { return this.renovatedRenderSupported() && this.option('renovateRender'); } - _isVirtualModeOn() { + private isVirtualModeOn() { return this.option('scrolling.mode') === 'virtual'; } isVirtualScrolling() { - return this.isRenovatedRender() && this._isVirtualModeOn(); + return this.isRenovatedRender() && this.isVirtualModeOn(); } - _initVirtualScrolling() { + private initVirtualScrolling() { if (this.virtualScrollingDispatcher) { this.virtualScrollingDispatcher.dispose(); this.virtualScrollingDispatcher = null; @@ -861,7 +861,7 @@ class SchedulerWorkSpace extends Widget { } generateRenderOptions(isProvideVirtualCellsWidth?: any): ViewDataProviderOptions { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); const groupOrientation = groupCount > 0 ? this.option('groupOrientation') @@ -878,7 +878,7 @@ class SchedulerWorkSpace extends Widget { isAllDayPanelVisible: this.isAllDayPanelVisible, selectedCells: this.cellsSelectionState.getSelectedCells(), focusedCell: this.cellsSelectionState.getFocusedCell(), - headerCellTextFormat: this._getFormat(), + headerCellTextFormat: this.getFormat(), getDateForHeaderText: (_, date) => date, viewOffset: this.option('viewOffset'), startDayHour: this.option('startDayHour'), @@ -900,9 +900,9 @@ class SchedulerWorkSpace extends Widget { renovatedRenderSupported() { return true; } - _updateGroupTableHeight() { + private updateGroupTableHeight() { if (this.isVerticalGroupedWorkSpace() && hasWindow()) { - this._setHorizontalGroupHeaderCellsHeight(); + this.setHorizontalGroupHeaderCellsHeight(); } } @@ -917,18 +917,18 @@ class SchedulerWorkSpace extends Widget { updateHeaderPanelScrollbarPadding() { if (hasWindow() && this._$headerPanelContainer) { - const scrollbarWidth = this._getScrollbarWidth(); + const scrollbarWidth = this.getScrollbarWidth(); this._$headerPanelContainer.css('paddingRight', `${scrollbarWidth}px`); } } - _getScrollbarWidth() { + private getScrollbarWidth() { const containerElement = $(this._dateTableScrollable.container()).get(0) as HTMLElement; const scrollbarWidth = containerElement.offsetWidth - containerElement.clientWidth; return scrollbarWidth; } - _isGroupsSpecified(groupValues?: GroupValues) { + private isGroupsSpecified(groupValues?: GroupValues) { return this.option('groups')?.length && groupValues; } @@ -939,44 +939,44 @@ class SchedulerWorkSpace extends Widget { )[0]; } - _getViewStartByOptions() { + protected getViewStartByOptions() { return getViewStartByOptions( this.option('startDate'), this.option('currentDate'), this._getIntervalDuration(), - this.option('startDate') ? this._calculateViewStartDate() : undefined, + this.option('startDate') ? this.calculateViewStartDate() : undefined, ); } - _getIntervalDuration() { + protected _getIntervalDuration() { return this.viewDataProvider.getIntervalDuration(this.option('intervalCount')); } - _getHeaderDate() { + getHeaderDate() { return this.getStartViewDate(); } - _calculateViewStartDate() { + protected calculateViewStartDate() { return calculateViewStartDate(this.option('startDate')); } - _firstDayOfWeek() { + protected firstDayOfWeek() { return this.viewDataProvider.getFirstDayOfWeek(this.option('firstDayOfWeek')); } - _attachEvents() { - this._createSelectionChangedAction(); - this._attachClickEvent(); - this._attachContextMenuEvent(); + protected attachEvents() { + this.createSelectionChangedAction(); + this.attachClickEvent(); + this.attachContextMenuEvent(); } - _attachClickEvent() { + private attachClickEvent() { const that = this; const pointerDownAction = this._createAction((e) => { that.pointerDownHandler(e.event); }); - this._createCellClickAction(); + this.createCellClickAction(); const cellSelector = `.${DATE_TABLE_CELL_CLASS},.${ALL_DAY_TABLE_CELL_CLASS}`; const $element = this.$element(); @@ -996,13 +996,13 @@ class SchedulerWorkSpace extends Widget { }); } - _createCellClickAction() { + private createCellClickAction() { this._cellClickAction = this._createActionByOption('onCellClick', { afterExecute: (e) => this.cellClickHandler(e.args[0].event), }); } - _createSelectionChangedAction() { + private createSelectionChangedAction() { this._selectionChangedAction = this._createActionByOption('onSelectionChanged'); } @@ -1026,8 +1026,8 @@ class SchedulerWorkSpace extends Widget { if ($target.hasClass(DATE_TABLE_FOCUSED_CELL_CLASS)) { this._showPopup = true; } else { - const cellCoordinates = this._getCoordinatesByCell($target); - const isAllDayCell = this._hasAllDayClass($target); + const cellCoordinates = this.getCoordinatesByCell($target); + const isAllDayCell = this.hasAllDayClass($target); this.setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target); } } @@ -1052,7 +1052,7 @@ class SchedulerWorkSpace extends Widget { (this.option('onSelectedCellsClick') as any)(result, lastCellData.groups); } - _attachContextMenuEvent() { + private attachContextMenuEvent() { this.createContextMenuAction(); const cellSelector = `.${DATE_TABLE_CELL_CLASS},.${ALL_DAY_TABLE_CELL_CLASS}`; @@ -1089,7 +1089,7 @@ class SchedulerWorkSpace extends Widget { return this._groupedStrategy.calculateHeaderCellRepeatCount(); } - _updateScrollable() { + protected updateScrollable() { this._dateTableScrollable.update(); this._headerScrollable?.update(); this._sidebarScrollable?.update(); @@ -1097,10 +1097,10 @@ class SchedulerWorkSpace extends Widget { } protected getTimePanelRowCount() { - return this._getCellCountInDay(); + return this.getCellCountInDay(); } - _getCellCountInDay() { + protected getCellCountInDay() { const hoursInterval = this.option('hoursInterval'); const startDayHour = this.option('startDayHour'); const endDayHour = this.option('endDayHour'); @@ -1136,25 +1136,25 @@ class SchedulerWorkSpace extends Widget { ); } - _getGroupCount() { + getGroupCount() { return this.resourceManager.groupCount(); } attachTablesEvents() { const element = this.$element(); - this._attachDragEvents(element); - this._attachPointerEvents(element); + this.attachDragEvents(element); + this.attachPointerEvents(element); } - _detachDragEvents(element) { + private detachDragEvents(element) { (eventsEngine.off as any)(element, DragEventNames.ENTER); (eventsEngine.off as any)(element, DragEventNames.LEAVE); (eventsEngine.off as any)(element, DragEventNames.DROP); } - _attachDragEvents(element) { - this._detachDragEvents(element); + private attachDragEvents(element) { + this.detachDragEvents(element); const onDragEnter = (e) => { if (!this.preventDefaultDragging) { @@ -1169,7 +1169,7 @@ class SchedulerWorkSpace extends Widget { } }; - const onCheckDropTarget = (target, event) => !this._isOutsideScrollable(target, event); + const onCheckDropTarget = (target, event) => !this.isOutsideScrollable(target, event); (eventsEngine.on as any)( element, @@ -1195,7 +1195,7 @@ class SchedulerWorkSpace extends Widget { }); } - _attachPointerEvents(element) { + private attachPointerEvents(element) { let isPointerDown = false; (eventsEngine.off as any)(element, SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME); @@ -1222,7 +1222,7 @@ class SchedulerWorkSpace extends Widget { }); } - _getFormat() { return abstract(); } + protected getFormat() { return abstract(); } getWorkArea() { return this._$dateTableContainer; @@ -1268,9 +1268,9 @@ class SchedulerWorkSpace extends Widget { return this._groupedStrategy.getLeftOffset(); } - _getCellCoordinatesByIndex(index) { - const columnIndex = Math.floor(index / this._getRowCount()); - const rowIndex = index - this._getRowCount() * columnIndex; + protected getCellCoordinatesByIndex(index) { + const columnIndex = Math.floor(index / this.getRowCount()); + const rowIndex = index - this.getRowCount() * columnIndex; return { columnIndex, @@ -1280,25 +1280,25 @@ class SchedulerWorkSpace extends Widget { // TODO: necessary for old render // eslint-disable-next-line @typescript-eslint/no-unused-vars - _getDateGenerationOptions(isOldRender = false) { + protected getDateGenerationOptions(isOldRender = false) { return { startDayHour: this.option('startDayHour'), endDayHour: this.option('endDayHour'), interval: this.viewDataProvider.viewDataGenerator?.getInterval(this.option('hoursInterval')), startViewDate: this.getStartViewDate(), - firstDayOfWeek: this._firstDayOfWeek(), + firstDayOfWeek: this.firstDayOfWeek(), }; } // TODO: refactor current time indicator - _getIntervalBetween(currentDate, allDay) { + protected getIntervalBetween(currentDate, allDay) { const firstViewDate = this.getStartViewDate(); const startDayTime = (this.option('startDayHour') as any) * HOUR_MS; const timeZoneOffset = dateUtils.getTimezonesDifference(firstViewDate, currentDate); const fullInterval = currentDate.getTime() - firstViewDate.getTime() - timeZoneOffset; - const days = this._getDaysOfInterval(fullInterval, startDayTime); - const weekendsCount = this._getWeekendsCount(days); + const days = this.getDaysOfInterval(fullInterval, startDayTime); + const weekendsCount = this.getWeekendsCount(days); let result = (days - weekendsCount) * DAY_MS; if (!allDay) { @@ -1312,25 +1312,25 @@ class SchedulerWorkSpace extends Widget { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - _getWeekendsCount(argument?: any) { + protected getWeekendsCount(argument?: any) { return 0; } - _getDaysOfInterval(fullInterval, startDayTime) { + private getDaysOfInterval(fullInterval, startDayTime) { return Math.floor((fullInterval + startDayTime) / DAY_MS); } - _updateIndex(index) { - return index * this._getRowCount(); + protected updateIndex(index) { + return index * this.getRowCount(); } getDroppableCell() { return this.getDateTables().find(`.${DATE_TABLE_DROPPABLE_CELL_CLASS}`); } - _getWorkSpaceWidth() { + getWorkSpaceWidth() { return this.cache.memo('workspaceWidth', () => { - if (this._needCreateCrossScrolling()) { + if (this.needCreateCrossScrolling()) { return getBoundingRect(this._$dateTable.get(0)).width; } const totalWidth = getBoundingRect((this.$element() as any).get(0)).width; @@ -1341,12 +1341,12 @@ class SchedulerWorkSpace extends Widget { }); } - _getCellByCoordinates(cellCoordinates, groupIndex, inAllDayRow) { + protected _getCellByCoordinates(cellCoordinates, groupIndex, inAllDayRow) { const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow); - return this._dom_getDateCell(indexes); + return this.dom_getDateCell(indexes); } - _dom_getDateCell(position) { + private dom_getDateCell(position) { return this._$dateTable .find(`tr:not(.${VIRTUAL_ROW_CLASS})`) .eq(position.rowIndex) @@ -1354,13 +1354,13 @@ class SchedulerWorkSpace extends Widget { .eq(position.columnIndex); } - _dom_getAllDayPanelCell(columnIndex) { + private dom_getAllDayPanelCell(columnIndex) { return this._$allDayPanel .find('tr').eq(0) .find('td').eq(columnIndex); } - _getCells(allDay?: any, direction?: any) { + protected getCells(allDay?: any, direction?: any) { const cellClass = allDay ? ALL_DAY_TABLE_CELL_CLASS : DATE_TABLE_CELL_CLASS; if (direction === 'vertical') { let result: any = []; @@ -1374,7 +1374,7 @@ class SchedulerWorkSpace extends Widget { return (this.$element() as any).find(`.${cellClass}`); } - _getFirstAndLastDataTableCell() { + private getFirstAndLastDataTableCell() { const selector = this.isVirtualScrolling() ? `.${DATE_TABLE_CELL_CLASS}, .${VIRTUAL_CELL_CLASS}` : `.${DATE_TABLE_CELL_CLASS}`; @@ -1383,7 +1383,7 @@ class SchedulerWorkSpace extends Widget { return [$cells[0], $cells[$cells.length - 1]]; } - _getAllCells(allDay) { + private getAllCells(allDay) { if (this.isVerticalGroupedWorkSpace()) { return this._$dateTable.find(`td:not(.${VIRTUAL_CELL_CLASS})`); } @@ -1395,16 +1395,16 @@ class SchedulerWorkSpace extends Widget { return (this.$element() as any).find(`.${cellClass}`); } - _setHorizontalGroupHeaderCellsHeight() { + protected setHorizontalGroupHeaderCellsHeight() { const { height } = getBoundingRect(this._$dateTable.get(0)); setOuterHeight(this._$groupTable, height); } - _getGroupHeaderCells() { + protected getGroupHeaderCells() { return (this.$element() as any).find(`.${GROUP_HEADER_CLASS}`); } - _getScrollCoordinates(date, groupIndex?: any, allDay?: any) { + private getScrollCoordinates(date, groupIndex?: any, allDay?: any) { const currentDate = date || new Date(this.option('currentDate')); const cell = this.viewDataProvider.findGlobalCellPosition(currentDate, groupIndex, allDay, true); @@ -1424,7 +1424,7 @@ class SchedulerWorkSpace extends Widget { ); } - _isOutsideScrollable(target, event) { + private isOutsideScrollable(target, event) { const $dateTableScrollableElement = this._dateTableScrollable.$element(); const scrollableSize = getBoundingRect($dateTableScrollableElement.get(0)); const window = getWindow(); @@ -1466,34 +1466,34 @@ class SchedulerWorkSpace extends Widget { } getCellData($cell) { - const cellData = this._getFullCellData($cell) ?? {}; + const cellData = this.getFullCellData($cell) ?? {}; return this.normalizeCellData(cellData); } - _getFullCellData($cell) { + private getFullCellData($cell) { const currentCell = $cell[0]; if (currentCell) { - return this._getDataByCell($cell); + return this.getDataByCell($cell); } return undefined; } - _getVirtualRowOffset() { + private getVirtualRowOffset() { return this.virtualScrollingDispatcher.virtualRowOffset; } - _getVirtualCellOffset() { + private getVirtualCellOffset() { return this.virtualScrollingDispatcher.virtualCellOffset; } - _getDataByCell($cell) { + private getDataByCell($cell) { const rowIndex = $cell.parent().index() - this.virtualScrollingDispatcher.topVirtualRowsCount; const columnIndex = $cell.index() - this.virtualScrollingDispatcher.leftVirtualCellsCount; const { viewDataProvider } = this; - const isAllDayCell = this._hasAllDayClass($cell); + const isAllDayCell = this.hasAllDayClass($cell); const cellData = viewDataProvider.getCellData(rowIndex, columnIndex, isAllDayCell); @@ -1502,8 +1502,8 @@ class SchedulerWorkSpace extends Widget { isGroupedByDate() { return this.option('groupByDate') - && this._isHorizontalGroupedWorkSpace() - && this._getGroupCount() > 0; + && this.isHorizontalGroupedWorkSpace() + && this.getGroupCount() > 0; } // TODO: refactor current time indicator @@ -1514,12 +1514,12 @@ class SchedulerWorkSpace extends Widget { ? 24 * 60 * 60 * 1000 : viewDataGenerator.getInterval(this.option('hoursInterval')); const startViewDateOffset = getStartViewDateTimeOffset(this.getStartViewDate(), this.option('startDayHour') as any); - const dateTimeStamp = this._getIntervalBetween(date, inAllDayRow) + startViewDateOffset; + const dateTimeStamp = this.getIntervalBetween(date, inAllDayRow) + startViewDateOffset; let index = Math.floor(dateTimeStamp / timeInterval); if (inAllDayRow) { - index = this._updateIndex(index); + index = this.updateIndex(index); } if (index < 0) { @@ -1588,7 +1588,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(); @@ -1600,7 +1600,7 @@ class SchedulerWorkSpace extends Widget { let leftIndex = (coordinates.left - leftCoordinateOffset) / cellWidth; leftIndex = Math.floor(leftIndex + CELL_INDEX_CALCULATION_EPSILON); - if (this._isRTL()) { + if (this.isRTL()) { leftIndex = cellCount - leftIndex - 1; } @@ -1647,19 +1647,19 @@ class SchedulerWorkSpace extends Widget { ? this.getGroupBoundsVertical(coordinates.groupIndex) : this.getGroupBoundsHorizontal(coordinates); - return this._isRTL() + return this.isRTL() ? this.getGroupBoundsRtlCorrection(groupBounds) : groupBounds; } getGroupBoundsVertical(groupIndex) { - const $firstAndLastCells = this._getFirstAndLastDataTableCell(); + const $firstAndLastCells = this.getFirstAndLastDataTableCell(); return this._groupedStrategy.getGroupBoundsOffset(groupIndex, $firstAndLastCells); } getGroupBoundsHorizontal(coordinates) { - const cellCount = this._getCellCount(); - const $cells = this._getCells(); + const cellCount = this.getCellCount(); + const $cells = this.getCells(); const cellWidth = this.getCellWidth(); const { groupedDataMap } = this.viewDataProvider; @@ -1682,7 +1682,7 @@ class SchedulerWorkSpace extends Widget { } getCellByCoordinates(coordinates, allDay) { - const $cells = this._getCells(allDay); + const $cells = this.getCells(allDay); const cellIndex = this.getCellIndexByCoordinates(coordinates, allDay); return $cells.eq(cellIndex); @@ -1718,8 +1718,8 @@ class SchedulerWorkSpace extends Widget { } needUpdateScrollPosition(date, appointmentGroupValues?: GroupValues, inAllDayRow = false) { - const cells = this._getCellsInViewport(inAllDayRow); - const groupIndex = this._isGroupsSpecified(appointmentGroupValues) + const cells = this.getCellsInViewport(inAllDayRow); + const groupIndex = this.isGroupsSpecified(appointmentGroupValues) ? this.getGroupIndexByGroupValues(appointmentGroupValues) : 0; const time = date.getTime(); @@ -1745,11 +1745,11 @@ class SchedulerWorkSpace extends Widget { }, true); } - _getCellsInViewport(inAllDayRow) { + private getCellsInViewport(inAllDayRow) { 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(); @@ -1770,7 +1770,7 @@ class SchedulerWorkSpace extends Widget { const rowCount = Math.floor(fullScrolledRowCount + getHeight($scrollable) / cellHeight); const columnCount = Math.floor(fullScrolledColumnCount + getWidth($scrollable) / cellWidth); - const $cells = this._getAllCells(inAllDayRow); + const $cells = this.getAllCells(inAllDayRow); const result: any = []; $cells.each(function (index) { @@ -1807,16 +1807,16 @@ class SchedulerWorkSpace extends Widget { } scrollTo(date, groupValues?: RawGroupValues | GroupValues, allDay = false, throwWarning = true) { - if (!this._isValidScrollDate(date, throwWarning)) { + if (!this.isValidScrollDate(date, throwWarning)) { return; } - const groupIndex = this._getGroupCount() && groupValues + const groupIndex = this.getGroupCount() && groupValues ? this.getGroupIndexByGroupValues(groupValues) : 0; const isScrollToAllDay = allDay && this.isAllDayPanelVisible; - const coordinates = this._getScrollCoordinates(date, groupIndex, isScrollToAllDay); + const coordinates = this.getScrollCoordinates(date, groupIndex, isScrollToAllDay); if (!coordinates) { return; @@ -1851,7 +1851,7 @@ class SchedulerWorkSpace extends Widget { } } - _isValidScrollDate(date, throwWarning = true) { + private isValidScrollDate(date, throwWarning = true) { const viewOffset = this.option('viewOffset') as number; const min = new Date(this.getStartViewDate().getTime() + viewOffset); const max = new Date(this.getEndViewDate().getTime() + viewOffset); @@ -1873,10 +1873,10 @@ class SchedulerWorkSpace extends Widget { $cell?.removeClass(DATE_TABLE_DROPPABLE_CELL_CLASS); } - _getCoordinatesByCell($cell) { + private getCoordinatesByCell($cell) { const columnIndex = $cell.index() - this.virtualScrollingDispatcher.leftVirtualCellsCount; let rowIndex = $cell.parent().index(); - const isAllDayCell = this._hasAllDayClass($cell); + const isAllDayCell = this.hasAllDayClass($cell); const isVerticalGrouping = this.isVerticalGroupedWorkSpace(); if (!(isAllDayCell && !isVerticalGrouping)) { @@ -1886,15 +1886,15 @@ class SchedulerWorkSpace extends Widget { return { rowIndex, columnIndex }; } - _isShowAllDayPanel() { + private isShowAllDayPanel() { return this.option('showAllDayPanel'); } - _getTimePanelCells() { + protected getTimePanelCells() { return (this.$element() as any).find(`.${TIME_PANEL_CELL_CLASS}`); } - _getRDateTableProps() { + protected getRDateTableProps() { return { viewData: this.viewDataProvider.viewData, viewContext: this.getR1ComponentsViewContext(), @@ -1915,12 +1915,12 @@ class SchedulerWorkSpace extends Widget { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - _updateSelectedCellDataOption(selectedCellData, $nextFocusedCell?: any) { + private updateSelectedCellDataOption(selectedCellData, $nextFocusedCell?: any) { this.option('selectedCellData', selectedCellData); this._selectionChangedAction({ selectedCellData }); } - _getCellByData(cellData) { + private getCellByData(cellData) { const { startDate, groupIndex, allDay, index, } = cellData; @@ -1937,20 +1937,20 @@ class SchedulerWorkSpace extends Widget { } return allDay && !this.isVerticalGroupedWorkSpace() - ? this._dom_getAllDayPanelCell(position.columnIndex) - : this._dom_getDateCell(position); + ? this.dom_getAllDayPanelCell(position.columnIndex) + : this.dom_getDateCell(position); } // Must replace all DOM manipulations getDOMElementsMetaData() { return this.cache.memo('cellElementsMeta', () => ({ dateTableCellsMeta: this.getDateTableDOMElementsInfo(), - allDayPanelCellsMeta: this._getAllDayPanelDOMElementsInfo(), + allDayPanelCellsMeta: this.getAllDayPanelDOMElementsInfo(), })); } getDateTableDOMElementsInfo() { - const dateTableCells = this._getAllCells(false); + const dateTableCells = this.getAllCells(false); if (!dateTableCells.length || !hasWindow()) { return [[{}]]; } @@ -1970,17 +1970,17 @@ class SchedulerWorkSpace extends Widget { result.push([]); } - this._addCellMetaData(result[rowIndex], cell, dateTableRect); + this.addCellMetaData(result[rowIndex], cell, dateTableRect); }); return result; } - _getAllDayPanelDOMElementsInfo() { + private getAllDayPanelDOMElementsInfo() { const result = []; if (this.isAllDayPanelVisible && !this.isVerticalGroupedWorkSpace() && hasWindow()) { - const allDayCells = this._getAllCells(true); + const allDayCells = this.getAllCells(true); if (!allDayCells.length) { return [{}]; @@ -1990,14 +1990,14 @@ class SchedulerWorkSpace extends Widget { const allDayPanelRect = getBoundingRect(allDayAppointmentContainer.get(0)); allDayCells.each((_, cell) => { - this._addCellMetaData(result, cell, allDayPanelRect); + this.addCellMetaData(result, cell, allDayPanelRect); }); } return result; } - _addCellMetaData(cellMetaDataArray, cell, parentRect) { + private addCellMetaData(cellMetaDataArray, cell, parentRect) { const cellRect = getBoundingRect(cell); cellMetaDataArray.push({ @@ -2009,10 +2009,10 @@ class SchedulerWorkSpace extends Widget { } // TODO: remove along with old render - _oldRender_getAllDayCellData(groupIndex) { + private oldRender_getAllDayCellData(groupIndex) { return (cell, rowIndex, columnIndex) => { - const validColumnIndex = columnIndex % this._getCellCount(); - const options = this._getDateGenerationOptions(true); + const validColumnIndex = columnIndex % this.getCellCount(); + const options = this.getDateGenerationOptions(true); let startDate = this.viewDataProvider.viewDataGenerator.getDateByCellIndices( options as any, rowIndex, @@ -2024,9 +2024,9 @@ class SchedulerWorkSpace extends Widget { let validGroupIndex = groupIndex || 0; if (this.isGroupedByDate()) { - validGroupIndex = Math.floor(columnIndex % this._getGroupCount()); - } else if (this._isHorizontalGroupedWorkSpace()) { - validGroupIndex = Math.floor(columnIndex / this._getCellCount()); + validGroupIndex = Math.floor(columnIndex % this.getGroupCount()); + } else if (this.isHorizontalGroupedWorkSpace()) { + validGroupIndex = Math.floor(columnIndex / this.getCellCount()); } const data: any = { @@ -2077,7 +2077,7 @@ class SchedulerWorkSpace extends Widget { this._$dateTable, DateTableComponent, 'renovatedDateTable', - this._getRDateTableProps(), + this.getRDateTableProps(), ); } @@ -2127,7 +2127,7 @@ class SchedulerWorkSpace extends Widget { } this.updateAllDayVisibility(); - this._updateScrollable(); + this.updateScrollable(); } renderRTimeTable() { @@ -2313,7 +2313,7 @@ class SchedulerWorkSpace extends Widget { case 'groups': this.cleanView(); this.removeAllDayElements(); - this._initGrouping(); + this.initGrouping(); this.repaint(); break; case 'groupOrientation': @@ -2327,11 +2327,11 @@ class SchedulerWorkSpace extends Widget { if (this.isVerticalGroupedWorkSpace()) { this.cleanView(); this.removeAllDayElements(); - this._initGrouping(); + this.initGrouping(); this.repaint(); } else if (!this.isRenovatedRender()) { this.updateAllDayVisibility(); - this._updateScrollable(); + this.updateScrollable(); } else { this.renderWorkSpace(); } @@ -2339,16 +2339,16 @@ class SchedulerWorkSpace extends Widget { case 'allDayExpanded': this.updateAllDayExpansion(); this.attachTablesEvents(); - this._updateScrollable(); + this.updateScrollable(); break; case 'onSelectionChanged': - this._createSelectionChangedAction(); + this.createSelectionChangedAction(); break; case 'onCellClick': - this._createCellClickAction(); + this.createCellClickAction(); break; case 'onCellContextMenu': - this._attachContextMenuEvent(); + this.attachContextMenuEvent(); break; case 'intervalCount': this.cleanWorkSpace(); @@ -2360,7 +2360,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(); @@ -2400,7 +2400,7 @@ class SchedulerWorkSpace extends Widget { getCellHeight: this.getCellHeight.bind(this), getCellWidth: this.getCellWidth.bind(this), getCellMinWidth: this.getCellMinWidth.bind(this), - isRTL: this._isRTL.bind(this), + isRTL: this.isRTL.bind(this), getSchedulerHeight: () => this.option('schedulerHeight'), getSchedulerWidth: () => this.option('schedulerWidth'), getViewHeight: () => ((this.$element() as any).height ? (this.$element() as any).height() : getHeight(this.$element())), @@ -2413,7 +2413,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), @@ -2427,7 +2427,7 @@ class SchedulerWorkSpace extends Widget { this.virtualScrollingDispatcher.updateDimensions(true); this.renderView(); - this.option('crossScrollingEnabled') && this._setTableSizes(); + this.option('crossScrollingEnabled') && this.setTableSizes(); this.cache.clear(); } @@ -2439,7 +2439,7 @@ class SchedulerWorkSpace extends Widget { // @ts-expect-error super._init(); - this._initGrouping(); + this.initGrouping(); this.toggleHorizontalScrollClass(); this.toggleWorkSpaceCountClass(); @@ -2448,7 +2448,7 @@ class SchedulerWorkSpace extends Widget { (this.$element() as any) .addClass(COMPONENT_CLASS) - .addClass(this._getElementClass()); + .addClass(this.getElementClass()); } private initPositionHelper() { @@ -2463,13 +2463,13 @@ 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), }); } - _initGrouping() { + private initGrouping() { this.initGroupedStrategy(); this.toggleGroupingDirectionClass(); this.toggleGroupByDateClass(); @@ -2504,11 +2504,11 @@ class SchedulerWorkSpace extends Widget { } private toggleWorkSpaceCountClass() { - (this.$element() as any).toggleClass(WORKSPACE_WITH_COUNT_CLASS, this._isWorkSpaceWithCount()); + (this.$element() as any).toggleClass(WORKSPACE_WITH_COUNT_CLASS, this.isWorkSpaceWithCount()); } protected toggleWorkSpaceWithOddCells() { - (this.$element() as any).toggleClass(WORKSPACE_WITH_ODD_CELLS_CLASS, this._isWorkspaceWithOddCells()); + (this.$element() as any).toggleClass(WORKSPACE_WITH_ODD_CELLS_CLASS, this.isWorkspaceWithOddCells()); } protected toggleGroupingDirectionClass() { @@ -2565,7 +2565,7 @@ class SchedulerWorkSpace extends Widget { const $dateTableScrollable = $('
').addClass(SCHEDULER_DATE_TABLE_SCROLLABLE_CLASS); // @ts-expect-error - this._dateTableScrollable = this._createComponent($dateTableScrollable, Scrollable, this._dateTableScrollableConfig()); + this._dateTableScrollable = this._createComponent($dateTableScrollable, Scrollable, this.dateTableScrollableConfig()); this._scrollSync.dateTable = getMemoizeScrollTo(() => this._dateTableScrollable); } @@ -2656,7 +2656,7 @@ class SchedulerWorkSpace extends Widget { .appendTo(this._$headerTablesContainer); // @ts-expect-error - this._headerScrollable = this._createComponent($headerScrollable, Scrollable, this._headerScrollableConfig()); + this._headerScrollable = this._createComponent($headerScrollable, Scrollable, this.headerScrollableConfig()); this._scrollSync.header = getMemoizeScrollTo(() => this._headerScrollable); } @@ -2684,7 +2684,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); @@ -2707,7 +2707,7 @@ class SchedulerWorkSpace extends Widget { this.initWorkSpaceUnits(); - this._initVirtualScrolling(); + this.initVirtualScrolling(); this.initDateTableScrollable(); @@ -2724,7 +2724,7 @@ class SchedulerWorkSpace extends Widget { this.toggleGroupedClass(); this.renderView(); - this._attachEvents(); + this.attachEvents(); } _render() { @@ -2735,7 +2735,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); } renderView() { @@ -2754,7 +2754,7 @@ class SchedulerWorkSpace extends Widget { this.virtualScrollingDispatcher.updateDimensions(); } - this._updateGroupTableHeight(); + this.updateGroupTableHeight(); this.updateHeaderEmptyCellWidth(); this._shader = new VerticalShader(this); @@ -2795,12 +2795,12 @@ class SchedulerWorkSpace extends Widget { } protected updateAllDayVisibility(): void { - this.$element().toggleClass(WORKSPACE_WITH_ALL_DAY_CLASS, this._isShowAllDayPanel()); + this.$element().toggleClass(WORKSPACE_WITH_ALL_DAY_CLASS, this.isShowAllDayPanel()); this.updateAllDayExpansion(); } private updateAllDayExpansion(): void { - const isExpanded = !this.option('allDayExpanded') && this._isShowAllDayPanel(); + const isExpanded = !this.option('allDayExpanded') && this.isShowAllDayPanel(); this.cache.clear(); this.$element().toggleClass(WORKSPACE_WITH_COLLAPSED_ALL_DAY_CLASS, isExpanded); @@ -2899,7 +2899,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++) { @@ -2956,7 +2956,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')); @@ -2988,9 +2988,9 @@ class SchedulerWorkSpace extends Widget { groupHeaderClass: this.getGroupHeaderClass.bind(this), groupHeaderContentClass: GROUP_HEADER_CONTENT_CLASS, }, - this._getCellCount() || 1, + this.getCellCount() || 1, this.option('resourceCellTemplate'), - this._getGroupCount(), + this.getGroupCount(), groupByDate, ); } @@ -2998,7 +2998,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 = []; @@ -3014,7 +3014,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; @@ -3032,7 +3032,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; @@ -3062,7 +3062,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); @@ -3082,10 +3082,10 @@ class SchedulerWorkSpace extends Widget { } protected renderAllDayPanel(index?: any) { - let cellCount = this._getCellCount(); + let cellCount = this.getCellCount(); if (!this.isVerticalGroupedWorkSpace()) { - cellCount *= this._getGroupCount() || 1; + cellCount *= this.getGroupCount() || 1; } const cellTemplates = this.renderTableBody({ @@ -3096,18 +3096,18 @@ class SchedulerWorkSpace extends Widget { rowClass: ALL_DAY_TABLE_ROW_CLASS, cellTemplate: this.option('dataCellTemplate'), // TODO: remove along with old render - getCellData: this._oldRender_getAllDayCellData(index), + getCellData: this.oldRender_getAllDayCellData(index), groupIndex: index, }, true); this.updateAllDayVisibility(); - this._updateScrollable(); + this.updateScrollable(); this.applyCellTemplates(cellTemplates); } protected renderGroupAllDayPanel() { if (this.isVerticalGroupedWorkSpace()) { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); for (let i = 0; i < groupCount; i++) { this.renderAllDayPanel(i); @@ -3141,7 +3141,7 @@ class SchedulerWorkSpace extends Widget { allDayPanelsCount = 1; } if (this.isGroupedAllDayPanel()) { - allDayPanelsCount = Math.ceil((rowIndex + 1) / this._getRowCount()); + allDayPanelsCount = Math.ceil((rowIndex + 1) / this.getRowCount()); } const validRowIndex = rowIndex + allDayPanelsCount; @@ -3158,7 +3158,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), }); @@ -3173,7 +3173,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), @@ -3187,7 +3187,7 @@ class SchedulerWorkSpace extends Widget { let validRowIndex = rowIndex; if (isGroupedAllDayPanel) { - const rowCount = this._getRowCount(); + const rowCount = this.getRowCount(); const allDayPanelsCount = Math.ceil(rowIndex / rowCount); validRowIndex += allDayPanelsCount; } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts index d85b12245024..27c168be4540 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts @@ -8,7 +8,7 @@ const DAY_CLASS = 'dx-scheduler-work-space-day'; class SchedulerWorkSpaceDay extends SchedulerWorkSpaceVertical { get type() { return VIEWS.DAY; } - _getElementClass() { + getElementClass() { return DAY_CLASS; } 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 121ac7ce3712..6abe6ad841a2 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 @@ -14,27 +14,27 @@ class HorizontalGroupedStrategy { if (!groupByDay) { return { rowIndex: cellCoordinates.rowIndex, - columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace._getCellCount(), + columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace.getCellCount(), }; } return { rowIndex: cellCoordinates.rowIndex, - columnIndex: cellCoordinates.columnIndex * this._workSpace._getGroupCount() + groupIndex, + columnIndex: cellCoordinates.columnIndex * this._workSpace.getGroupCount() + groupIndex, }; } getGroupIndex(rowIndex, columnIndex) { const groupByDay = this._workSpace.isGroupedByDate(); - const groupCount = this._workSpace._getGroupCount(); + const groupCount = this._workSpace.getGroupCount(); if (groupByDay) { return columnIndex % groupCount; } - return Math.floor(columnIndex / this._workSpace._getCellCount()); + return Math.floor(columnIndex / this._workSpace.getCellCount()); } calculateHeaderCellRepeatCount() { - return this._workSpace._getGroupCount() || 1; + return this._workSpace.getGroupCount() || 1; } insertAllDayRowsIntoDateTable() { @@ -44,11 +44,11 @@ class HorizontalGroupedStrategy { getTotalCellCount(groupCount) { groupCount = groupCount || 1; - return this._workSpace._getCellCount() * groupCount; + return this._workSpace.getCellCount() * groupCount; } getTotalRowCount() { - return this._workSpace._getRowCount(); + return this._workSpace.getRowCount(); } calculateTimeCellRepeatCount() { @@ -142,17 +142,17 @@ class HorizontalGroupedStrategy { _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; } _calculateGroupByDateOffset(groupIndex) { - return this._workSpace.getIndicatorOffset(0) * this._workSpace._getGroupCount() + this._workSpace.getCellWidth() * groupIndex; + return this._workSpace.getIndicatorOffset(0) * this._workSpace.getGroupCount() + this._workSpace.getCellWidth() * groupIndex; } getShaderOffset(i, width) { - const offset = this._workSpace._getCellCount() * this._workSpace.getCellWidth() * i; + 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; } @@ -196,10 +196,10 @@ class HorizontalGroupedStrategy { const groupByDate = this._workSpace.isGroupedByDate(); if (groupByDate) { - if (index % this._workSpace._getGroupCount() === 0) { + if (index % this._workSpace.getGroupCount() === 0) { return `${cellClass} ${LAST_GROUP_CELL_CLASS}`; } - } else if (index % this._workSpace._getCellCount() === 0) { + } else if (index % this._workSpace.getCellCount() === 0) { return `${cellClass} ${LAST_GROUP_CELL_CLASS}`; } @@ -214,10 +214,10 @@ class HorizontalGroupedStrategy { const groupByDate = this._workSpace.isGroupedByDate(); if (groupByDate) { - if ((index - 1) % this._workSpace._getGroupCount() === 0) { + if ((index - 1) % this._workSpace.getGroupCount() === 0) { return `${cellClass} ${FIRST_GROUP_CELL_CLASS}`; } - } else if ((index - 1) % this._workSpace._getCellCount() === 0) { + } else if ((index - 1) % this._workSpace.getCellCount() === 0) { return `${cellClass} ${FIRST_GROUP_CELL_CLASS}`; } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_vertical.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_vertical.ts index 8edcbf3a854b..9e8561da0523 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 @@ -16,7 +16,7 @@ class VerticalGroupedStrategy { } prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow) { - let rowIndex = cellCoordinates.rowIndex + groupIndex * this._workSpace._getRowCount(); + let rowIndex = cellCoordinates.rowIndex + groupIndex * this._workSpace.getRowCount(); if (this._workSpace.supportAllDayRow() && this._workSpace.option('showAllDayPanel')) { rowIndex += groupIndex; @@ -33,7 +33,7 @@ class VerticalGroupedStrategy { } getGroupIndex(rowIndex) { - return Math.floor(rowIndex / this._workSpace._getRowCount()); + return Math.floor(rowIndex / this._workSpace.getRowCount()); } calculateHeaderCellRepeatCount() { @@ -45,19 +45,19 @@ class VerticalGroupedStrategy { } getTotalCellCount() { - return this._workSpace._getCellCount(); + return this._workSpace.getCellCount(); } getTotalRowCount() { - return this._workSpace._getRowCount() * this._workSpace._getGroupCount(); + return this._workSpace.getRowCount() * this._workSpace.getGroupCount(); } calculateTimeCellRepeatCount() { - return this._workSpace._getGroupCount() || 1; + return this._workSpace.getGroupCount() || 1; } getWorkSpaceMinWidth() { - let minWidth = this._workSpace._getWorkSpaceWidth(); + let minWidth = this._workSpace.getWorkSpaceWidth(); const workSpaceElementWidth = getBoundingRect(this._workSpace.$element().get(0)).width; const workspaceContainerWidth = workSpaceElementWidth - this._workSpace.getTimePanelWidth() @@ -118,7 +118,7 @@ class VerticalGroupedStrategy { const offset = this._workSpace.getIndicatorOffset(0); const tableOffset = this._workSpace.option('crossScrollingEnabled') ? 0 : this._workSpace.getGroupTableWidth(); const horizontalOffset = rtlOffset ? rtlOffset - offset : offset; - let verticalOffset = this._workSpace._getRowCount() * this._workSpace.getCellHeight() * i; + let verticalOffset = this._workSpace.getRowCount() * this._workSpace.getCellHeight() * i; if (this._workSpace.supportAllDayRow() && this._workSpace.option('showAllDayPanel')) { verticalOffset += this._workSpace.getAllDayHeight() * (i + 1); @@ -149,7 +149,7 @@ class VerticalGroupedStrategy { } getShaderMaxHeight() { - let height = this._workSpace._getRowCount() * this._workSpace.getCellHeight(); + let height = this._workSpace.getRowCount() * this._workSpace.getCellHeight(); if (this._workSpace.supportAllDayRow() && this._workSpace.option('showAllDayPanel')) { height += this._workSpace.getCellHeight(); @@ -178,7 +178,7 @@ class VerticalGroupedStrategy { } _addLastGroupCellClass(cellClass, index) { - if (index % this._workSpace._getRowCount() === 0) { + if (index % this._workSpace.getRowCount() === 0) { return `${cellClass} ${LAST_GROUP_CELL_CLASS}`; } @@ -186,7 +186,7 @@ class VerticalGroupedStrategy { } _addFirstGroupCellClass(cellClass, index) { - if ((index - 1) % this._workSpace._getRowCount() === 0) { + if ((index - 1) % this._workSpace.getRowCount() === 0) { return `${cellClass} ${FIRST_GROUP_CELL_CLASS}`; } 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 c1a435365361..0773a31451ea 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 @@ -108,7 +108,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; @@ -129,7 +129,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { let timeDiff = today.getTime() - viewStartTime; if (this.option('type') === 'workWeek') { - const weekendDays = this._getWeekendsCount(Math.round(timeDiff / toMs('day'))) * toMs('day'); + const weekendDays = this.getWeekendsCount(Math.round(timeDiff / toMs('day'))) * toMs('day'); timeDiff -= weekendDays; } @@ -256,7 +256,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { const rowCountPerGroup = this.getTimePanelRowCount(); const today = this._getToday(); const index = this.getCellIndexByDate(today); - const { rowIndex: currentTimeRowIndex } = this._getCellCoordinatesByIndex(index); + const { rowIndex: currentTimeRowIndex } = this.getCellCoordinatesByIndex(index); if (currentTimeRowIndex === undefined) { return []; @@ -272,7 +272,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } const verticalGroupCount = this.isVerticalGroupedWorkSpace() - ? this._getGroupCount() + ? this.getGroupCount() : 1; return [...new Array(verticalGroupCount)] @@ -295,7 +295,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()); @@ -311,7 +311,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { // Temporary new render methods. // TODO Old render: replace base call methods by these after the deleting of the old render. protected _setCurrentTimeCells(): void { - const timePanelCells = this._getTimePanelCells(); + const timePanelCells = this.getTimePanelCells(); const currentTimeCellIndices = this._getCurrentTimePanelCellIndices(); currentTimeCellIndices.forEach((timePanelCellIndex) => { timePanelCells.eq(timePanelCellIndex) 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 46ac3e0d9c01..3dc2ce54065a 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 @@ -23,24 +23,24 @@ const toMs = dateUtils.dateToMilliseconds; class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { get type() { return VIEWS.MONTH; } - _getElementClass() { + getElementClass() { return MONTH_CLASS; } - _getFormat() { + getFormat() { return formatWeekday; } - _getIntervalBetween(currentDate) { + getIntervalBetween(currentDate) { const firstViewDate = this.getStartViewDate(); const timeZoneOffset = dateUtils.getTimezonesDifference(firstViewDate, currentDate); return currentDate.getTime() - (firstViewDate.getTime() - (this.option('startDayHour') as any) * 3600000) - timeZoneOffset; } - _getDateGenerationOptions() { + getDateGenerationOptions() { return { - ...super._getDateGenerationOptions(), + ...super.getDateGenerationOptions(), cellCountInDay: 1, }; } @@ -55,7 +55,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { const DAYS_IN_WEEK = 7; let averageWidth = 0; - const cells = this._getCells().slice(0, DAYS_IN_WEEK); + const cells = this.getCells().slice(0, DAYS_IN_WEEK); cells.each((index, element) => { averageWidth += hasWindow() ? getBoundingRect(element).width : 0; }); @@ -68,9 +68,9 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { return false; } - _getCellCoordinatesByIndex(index) { - const rowIndex = Math.floor(index / this._getCellCount()); - const columnIndex = index - this._getCellCount() * rowIndex; + getCellCoordinatesByIndex(index) { + const rowIndex = Math.floor(index / this.getCellCount()); + const columnIndex = index - this.getCellCount() * rowIndex; return { rowIndex, @@ -78,12 +78,12 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { }; } - _needCreateCrossScrolling() { + needCreateCrossScrolling() { // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing return this.option('crossScrollingEnabled') || this.isVerticalGroupedWorkSpace(); } - _getViewStartByOptions() { + getViewStartByOptions() { return monthUtils.getViewStartByOptions( this.option('startDate') as any, this.option('currentDate') as any, @@ -92,7 +92,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { ); } - _updateIndex(index) { + updateIndex(index) { return index; } @@ -124,8 +124,8 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { return true; } - _getHeaderDate() { - return this._getViewStartByOptions(); + getHeaderDate() { + return this.getViewStartByOptions(); } scrollToTime() { return noop(); } @@ -140,7 +140,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { this._$dateTable, DateTableMonthComponent, 'renovatedDateTable', - this._getRDateTableProps(), + this.getRDateTableProps(), ); } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts index 845cc655036f..c871368e8b08 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts @@ -3,7 +3,7 @@ import { formatWeekdayAndDay } from '@ts/scheduler/r1/utils/index'; import SchedulerWorkSpaceIndicator from './m_work_space_indicator'; class SchedulerWorkspaceVertical extends SchedulerWorkSpaceIndicator { - _getFormat() { + getFormat() { return formatWeekdayAndDay; } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts index c149aab4b726..f9f91bb455fc 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts @@ -8,12 +8,12 @@ const WEEK_CLASS = 'dx-scheduler-work-space-week'; class SchedulerWorkSpaceWeek extends SchedulerWorkSpaceVertical { get type() { return VIEWS.WEEK; } - _getElementClass() { + getElementClass() { return WEEK_CLASS; } - _calculateViewStartDate() { - return weekUtils.calculateViewStartDate(this.option('startDate') as any, this._firstDayOfWeek()); + calculateViewStartDate() { + return weekUtils.calculateViewStartDate(this.option('startDate') as any, this.firstDayOfWeek()); } } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_work_week.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_work_week.ts index e1d7b6761cc4..577e54937908 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_work_week.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_work_week.ts @@ -14,10 +14,10 @@ class SchedulerWorkSpaceWorkWeek extends SchedulerWorkSpaceWeek { // @ts-expect-error super(...args); - this._getWeekendsCount = getWeekendsCount; + this.getWeekendsCount = getWeekendsCount; } - _getElementClass() { + getElementClass() { return WORK_WEEK_CLASS; } } From 6b66dc89d435522ba1e354cf51aad6fb548ed1a5 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 15:25:13 +0100 Subject: [PATCH 12/28] fix: fix error --- .../js/__internal/scheduler/workspaces/m_work_space.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f5480d417e75..76eca1f197bc 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -700,7 +700,7 @@ class SchedulerWorkSpace extends Widget { return config; } - protected createCrossScrollingConfig({ onScroll }): any { + createCrossScrollingConfig({ onScroll }): any { return { direction: 'both', onScroll: (event) => { From 8acc040c678617e6cf4917a6debee12b72cb0677 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 15:48:51 +0100 Subject: [PATCH 13/28] fix: fix tests --- .../DevExpress.ui.widgets.scheduler/timeline.tests.js | 4 ++-- .../workSpace.base.tests.js | 10 +++++----- .../workSpace.month.tests.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js index 197f9753394e..57675904f58c 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js @@ -248,7 +248,7 @@ QUnit.test('Timeline should not have time panel offset', async function(assert) QUnit.test('Tables should be rerendered if dimension was changed and horizontal scrolling is enabled', async function(assert) { this.instance.option('crossScrollingEnabled', true); - const stub = sinon.stub(this.instance, '_setTableSizes'); + const stub = sinon.stub(this.instance, 'setTableSizes'); resizeCallbacks.fire(); @@ -260,7 +260,7 @@ QUnit.test('dateUtils.getTimezonesDifference should be called when calculating i const minDate = new Date('Thu Mar 10 2016 00:00:00 GMT-0500'); const maxDate = new Date('Mon Mar 15 2016 00:00:00 GMT-0400'); - this.instance._getIntervalBetween(minDate, maxDate, true); + this.instance.getIntervalBetween(minDate, maxDate, true); assert.ok(stub.calledOnce, 'getTimezonesDifference was called'); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.base.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.base.tests.js index ed2bbc97de93..7fcd84237637 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.base.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.base.tests.js @@ -106,7 +106,7 @@ module('Work Space Base', { test('Tables should be rerendered if dimension was changed and horizontal scrolling is enabled', async function(assert) { this.instance.option('crossScrollingEnabled', true); - const stub = sinon.stub(this.instance, '_setTableSizes'); + const stub = sinon.stub(this.instance, 'setTableSizes'); resizeCallbacks.fire(); @@ -115,7 +115,7 @@ module('Work Space Base', { test('Tables should not be rerendered if dimension was changed and horizontal scrolling isn\'t enabled', async function(assert) { this.instance.option('crossScrollingEnabled', false); - const stub = sinon.stub(this.instance, '_setTableSizes'); + const stub = sinon.stub(this.instance, 'setTableSizes'); resizeCallbacks.fire(); @@ -123,7 +123,7 @@ module('Work Space Base', { }); test('Tables should be rerendered if width was changed and horizontal scrolling is enabled', async function(assert) { - const stub = sinon.stub(this.instance, '_setTableSizes'); + const stub = sinon.stub(this.instance, 'setTableSizes'); this.instance.option('crossScrollingEnabled', true); this.instance.option('width', 777); @@ -131,7 +131,7 @@ module('Work Space Base', { }); test('Tables should not be rerendered if width was changed and horizontal scrolling isn\'t enabled', async function(assert) { - const stub = sinon.stub(this.instance, '_setTableSizes'); + const stub = sinon.stub(this.instance, 'setTableSizes'); this.instance.option('crossScrollingEnabled', false); this.instance.option('width', 777); @@ -144,7 +144,7 @@ module('Work Space Base', { const maxDate = new Date('Mon Mar 15 2016 00:00:00 GMT-0400'); // TODO: use public method instead - this.instance._getIntervalBetween(minDate, maxDate, true); + this.instance.getIntervalBetween(minDate, maxDate, true); assert.ok(stub.calledOnce, 'getTimezonesDifference was called'); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js index bcac8339b598..3a331ab8395d 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js @@ -370,7 +370,7 @@ module('Work Space Month', () => { test('Tables should not be rerendered if dimension was changed and horizontal scrolling is disabled', async function(assert) { this.instance.option('crossScrollingEnabled', false); - const stub = sinon.stub(this.instance, '_setTableSizes'); + const stub = sinon.stub(this.instance, 'setTableSizes'); resizeCallbacks.fire(); From 6efb87b9ce9fd7d874967b2afe6a26660320959b Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 16:48:29 +0100 Subject: [PATCH 14/28] fix: fix tests --- .../timeline.markup.tests.js | 12 ++++++------ .../workSpace.markup-1.tests.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) 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 2ee80cf95620..746cb1d679f7 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 @@ -352,12 +352,12 @@ QUnit.module('TimelineDay with intervalCount markup', timelineDayModuleConfig, ( this.instance.option('intervalCount', 2); let cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 2, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 2, 'view has right cell count'); this.instance.option('intervalCount', 4); cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 4, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 4, 'view has right cell count'); }); QUnit.test('TimelineDay Day view cells have right cellData with view option intervalCount=2', async function(assert) { @@ -661,12 +661,12 @@ QUnit.module('TimelineWeek with intervalCount markup', timelineWeekModuleConfig, this.instance.option('intervalCount', 2); let cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 7 * 2, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 7 * 2, 'view has right cell count'); this.instance.option('intervalCount', 4); cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 7 * 4, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 7 * 4, 'view has right cell count'); }); QUnit.test('TimelineWeek view cells have right cellData with view option intervalCount=2', async function(assert) { @@ -872,12 +872,12 @@ QUnit.module('TimelineWorkWeek with intervalCount markup', timelineWorkWeekModul this.instance.option('intervalCount', 2); let cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 5 * 2, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 5 * 2, 'view has right cell count'); this.instance.option('intervalCount', 4); cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 5 * 4, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 5 * 4, 'view has right cell count'); }); QUnit.test('TimelineWorkWeek view cells have right cellData with view option intervalCount=2', async function(assert) { 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 ce53ce66207d..70d5ba7d38e8 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 @@ -226,12 +226,12 @@ QUnit.module('Workspace Day markup', dayModuleConfig, () => { this.instance.option('intervalCount', 2); let cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 2, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 2, 'view has right cell count'); this.instance.option('intervalCount', 4); cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 4, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 4, 'view has right cell count'); }); }); @@ -520,12 +520,12 @@ QUnit.module('Workspace Week markup', weekModuleConfig, () => { this.instance.option('intervalCount', 2); let cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 7 * 2, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 7 * 2, 'view has right cell count'); this.instance.option('intervalCount', 4); cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 7 * 4, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 7 * 4, 'view has right cell count'); }); }); @@ -732,12 +732,12 @@ QUnit.module('Workspace Work Week markup', workWeekModuleConfig, () => { this.instance.option('intervalCount', 2); let cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 5 * 2, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 5 * 2, 'view has right cell count'); this.instance.option('intervalCount', 4); cells = this.instance.$element().find('.dx-scheduler-date-table-cell'); - assert.equal(cells.length, this.instance._getCellCountInDay() * 5 * 4, 'view has right cell count'); + assert.equal(cells.length, this.instance.getCellCountInDay() * 5 * 4, 'view has right cell count'); }); QUnit.test('Workspace work week view should contain 15 headers if intervalCount=3', async function(assert) { From d423e11fa523b49769c209a976a4ab3557bfed66 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 16:49:33 +0100 Subject: [PATCH 15/28] fix: fix tests --- .../DevExpress.ui.widgets.scheduler/workSpace.base.tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.base.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.base.tests.js index 7fcd84237637..4e23a87062a0 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.base.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.base.tests.js @@ -76,7 +76,7 @@ module('Work Space Base', { if(viewName === 'Day' || viewName === 'Week') { test('Scheduler workspace scrollables should be updated after allDayExpanded option changed', async function(assert) { this.instance.option('allDayExpanded', false); - const stub = sinon.stub(this.instance, '_updateScrollable'); + const stub = sinon.stub(this.instance, 'updateScrollable'); this.instance.option('allDayExpanded', true); @@ -86,7 +86,7 @@ module('Work Space Base', { test('Scheduler workspace scrollables should be updated after endDayHour option changed if allDayPanel is hided', async function(assert) { this.instance.option('showAllDayPanel', false); this.instance.option('endDayHour', 18); - const stub = sinon.stub(this.instance, '_updateScrollable'); + const stub = sinon.stub(this.instance, 'updateScrollable'); this.instance.option('endDayHour', 24); From c7c40e0890ff6c099f6cd97481fdfee320360e1e Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 17:17:48 +0100 Subject: [PATCH 16/28] fix: fix tests --- .../DevExpress.ui.widgets.scheduler/workSpace.month.tests.js | 2 +- .../workSpaceWithHorizontalScroll.tests.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js index 3a331ab8395d..82032fcad561 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.month.tests.js @@ -249,7 +249,7 @@ module('Work Space Month', () => { firstDayOfWeek: 1, }); - const $cell = this.instance._getCells().eq(14); + const $cell = this.instance.getCells().eq(14); assert.deepEqual($cell.data('dxCellData'), { startDate: new Date(2016, 2, 14, 5, 0), diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpaceWithHorizontalScroll.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpaceWithHorizontalScroll.tests.js index 26c114f91d7f..130a5a54680a 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpaceWithHorizontalScroll.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpaceWithHorizontalScroll.tests.js @@ -163,7 +163,7 @@ QUnit.module('Vertical Workspace with horizontal scrollbar', { const $element = this.instance.$element(); $element.css('width', 1000); - sinon.stub(this.instance, '_getWorkSpaceWidth').returns(50); + sinon.stub(this.instance, 'getWorkSpaceWidth').returns(50); triggerHidingEvent($element); triggerShownEvent($element); From 4b04b2f2783180f8edbb69bee7ecc7e47b066820 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 17:52:04 +0100 Subject: [PATCH 17/28] fix: fix bug --- .../devextreme/js/__internal/scheduler/workspaces/m_agenda.ts | 2 +- .../devextreme/js/__internal/scheduler/workspaces/m_timeline.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index d37a724854ac..0cc7d4250623 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -551,7 +551,7 @@ class SchedulerAgenda extends WorkSpace { _setSelectedCellsByCellData() {} - getIntervalDuration() { + _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 60def20d1be1..6753b9523ca6 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -193,7 +193,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { }; } - getCellByCoordinates(cellCoordinates, groupIndex) { + _getCellByCoordinates(cellCoordinates, groupIndex) { const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex); return this._$dateTable From dd224f21cca6f351ccda4a7e233e4c57325e40ec Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Wed, 11 Mar 2026 12:48:50 +0100 Subject: [PATCH 18/28] fix: cancel some namings --- .../m_current_time_shader_horizontal.ts | 8 +- .../scheduler/workspaces/m_timeline.ts | 26 +++--- .../scheduler/workspaces/m_work_space.ts | 93 ++++++++++--------- .../workspaces/m_work_space_indicator.ts | 6 +- .../workspaces/m_work_space_month.ts | 4 +- 5 files changed, 70 insertions(+), 67 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/shaders/m_current_time_shader_horizontal.ts b/packages/devextreme/js/__internal/scheduler/shaders/m_current_time_shader_horizontal.ts index 5b5b4c3da128..2e99b476e147 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/m_current_time_shader_horizontal.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/m_current_time_shader_horizontal.ts @@ -5,7 +5,7 @@ import CurrentTimeShader from './m_current_time_shader'; class HorizontalCurrentTimeShader extends CurrentTimeShader { renderShader() { - const groupCount = this._workSpace.isHorizontalGroupedWorkSpace() ? this._workSpace.getGroupCount() : 1; + const groupCount = this._workSpace._isHorizontalGroupedWorkSpace() ? this._workSpace._getGroupCount() : 1; for (let i = 0; i < groupCount; i += 1) { const isFirstShader = i === 0; @@ -28,7 +28,7 @@ class HorizontalCurrentTimeShader extends CurrentTimeShader { if (groupIndex >= 1) { const workSpace = this._workSpace; - const indicationWidth = workSpace.getCellCount() * workSpace.getCellWidth(); + const indicationWidth = workSpace._getCellCount() * workSpace.getCellWidth(); $shader.css('left', indicationWidth); } else { $shader.css('left', 0); @@ -59,9 +59,9 @@ 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(); + shaderLeft = workSpace.getCellWidth() * integerPart * workSpace._getGroupCount() + groupIndex * workSpace.getCellWidth(); } $shader.css('left', shaderLeft); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index 6753b9523ca6..a952efcf8e7c 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -48,7 +48,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } getTotalRowCount(groupCount) { - if (this.isHorizontalGroupedWorkSpace()) { + if (this._isHorizontalGroupedWorkSpace()) { return this.getRowCount(); } groupCount = groupCount || 1; @@ -93,7 +93,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } getGroupHeaderContainer() { - if (this.isHorizontalGroupedWorkSpace()) { + if (this._isHorizontalGroupedWorkSpace()) { return this._$thead; } return this._$sidebarTable; @@ -151,7 +151,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(); } @@ -188,7 +188,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { getCellCoordinatesByIndex(index) { return { - columnIndex: index % this.getCellCount(), + columnIndex: index % this._getCellCount(), rowIndex: 0, }; } @@ -330,7 +330,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } toggleGroupingDirectionClass() { - (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this.isHorizontalGroupedWorkSpace()); + (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this._isHorizontalGroupedWorkSpace()); } _getDefaultOptions() { @@ -384,7 +384,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); @@ -393,8 +393,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { return []; } - const horizontalGroupCount = this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() - ? this.getGroupCount() + const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() + ? this._getGroupCount() : 1; return [...new Array(horizontalGroupCount)] @@ -418,14 +418,14 @@ class SchedulerTimeline extends SchedulerWorkSpace { let currentDate = new Date(firstViewDate); const $cells: any[] = []; - const groupCount = this.getGroupCount(); + const groupCount = this._getGroupCount(); const cellCountInDay = this.getCellCountInDay(); const colSpan = this.isGroupedByDate() ? cellCountInDay * groupCount : cellCountInDay; const cellTemplate: any = this.option('dateCellTemplate'); - const horizontalGroupCount = this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() + const horizontalGroupCount = this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate() ? groupCount : 1; const cellsInGroup = this.viewDataProvider.viewDataGenerator.daysInInterval * (this.option('intervalCount') as any); @@ -481,7 +481,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); @@ -502,9 +502,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { groupHeaderClass: this.getGroupHeaderClass.bind(this), groupHeaderContentClass: GROUP_HEADER_CONTENT_CLASS, }, - this.getCellCount() || 1, + this._getCellCount() || 1, this.option('resourceCellTemplate'), - this.getTotalRowCount(this.getGroupCount()), + this.getTotalRowCount(this._getGroupCount()), groupByDate, ); } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts index 76eca1f197bc..ba46e6f17689 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -352,7 +352,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, @@ -445,9 +445,9 @@ class SchedulerWorkSpace extends Widget { const isMultiSelection = e.shiftKey; const isMultiSelectionAllowed = this.option('allowMultipleCellSelection'); const isRTL = this.isRTL(); - const groupCount = this.getGroupCount(); + const groupCount = this._getGroupCount(); const isGroupedByDate = this.isGroupedByDate(); - const isHorizontalGrouping = this.isHorizontalGroupedWorkSpace(); + const isHorizontalGrouping = this._isHorizontalGroupedWorkSpace(); const focusedCellPosition = this.viewDataProvider.findCellPositionInMap({ ...focusedCellData, isAllDay: focusedCellData.allDay, @@ -628,7 +628,8 @@ class SchedulerWorkSpace extends Widget { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'vertical'; } - isHorizontalGroupedWorkSpace() { + // TODO: make it private. Being used as public method by external code. + _isHorizontalGroupedWorkSpace() { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'horizontal'; } @@ -700,7 +701,7 @@ class SchedulerWorkSpace extends Widget { return config; } - createCrossScrollingConfig({ onScroll }): any { + protected createCrossScrollingConfig({ onScroll }): any { return { direction: 'both', onScroll: (event) => { @@ -753,7 +754,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; @@ -803,7 +804,7 @@ class SchedulerWorkSpace extends Widget { protected getElementClass() { return noop(); } - getRowCount() { + protected getRowCount() { return this.viewDataProvider.getRowCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -814,7 +815,8 @@ class SchedulerWorkSpace extends Widget { }); } - getCellCount() { + // TODO: make it private. Being used as public method by external code. + _getCellCount() { return this.viewDataProvider.getCellCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -861,7 +863,7 @@ class SchedulerWorkSpace extends Widget { } generateRenderOptions(isProvideVirtualCellsWidth?: any): ViewDataProviderOptions { - const groupCount = this.getGroupCount(); + const groupCount = this._getGroupCount(); const groupOrientation = groupCount > 0 ? this.option('groupOrientation') @@ -932,7 +934,7 @@ class SchedulerWorkSpace extends Widget { return this.option('groups')?.length && groupValues; } - getGroupIndexByGroupValues(groupValues?: RawGroupValues | GroupValues) { + private getGroupIndexByGroupValues(groupValues?: RawGroupValues | GroupValues) { return groupValues && getAppointmentGroupIndex( getSafeGroupValues(groupValues), this.resourceManager.groupsLeafs, @@ -952,7 +954,7 @@ class SchedulerWorkSpace extends Widget { return this.viewDataProvider.getIntervalDuration(this.option('intervalCount')); } - getHeaderDate() { + protected getHeaderDate() { return this.getStartViewDate(); } @@ -1136,11 +1138,12 @@ class SchedulerWorkSpace extends Widget { ); } - getGroupCount() { + // TODO: make it private. Being used as public method by external code. + _getGroupCount() { return this.resourceManager.groupCount(); } - attachTablesEvents() { + protected attachTablesEvents() { const element = this.$element(); this.attachDragEvents(element); @@ -1328,7 +1331,7 @@ class SchedulerWorkSpace extends Widget { return this.getDateTables().find(`.${DATE_TABLE_DROPPABLE_CELL_CLASS}`); } - getWorkSpaceWidth() { + protected getWorkSpaceWidth() { return this.cache.memo('workspaceWidth', () => { if (this.needCreateCrossScrolling()) { return getBoundingRect(this._$dateTable.get(0)).width; @@ -1502,8 +1505,8 @@ class SchedulerWorkSpace extends Widget { isGroupedByDate() { return this.option('groupByDate') - && this.isHorizontalGroupedWorkSpace() - && this.getGroupCount() > 0; + && this._isHorizontalGroupedWorkSpace() + && this._getGroupCount() > 0; } // TODO: refactor current time indicator @@ -1588,7 +1591,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(); @@ -1658,7 +1661,7 @@ class SchedulerWorkSpace extends Widget { } getGroupBoundsHorizontal(coordinates) { - const cellCount = this.getCellCount(); + const cellCount = this._getCellCount(); const $cells = this.getCells(); const cellWidth = this.getCellWidth(); @@ -1749,7 +1752,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(); @@ -1811,7 +1814,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; @@ -2011,7 +2014,7 @@ class SchedulerWorkSpace extends Widget { // TODO: remove along with old render private oldRender_getAllDayCellData(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, @@ -2024,9 +2027,9 @@ class SchedulerWorkSpace extends Widget { let validGroupIndex = groupIndex || 0; if (this.isGroupedByDate()) { - validGroupIndex = Math.floor(columnIndex % this.getGroupCount()); - } else if (this.isHorizontalGroupedWorkSpace()) { - validGroupIndex = Math.floor(columnIndex / this.getCellCount()); + validGroupIndex = Math.floor(columnIndex % this._getGroupCount()); + } else if (this._isHorizontalGroupedWorkSpace()) { + validGroupIndex = Math.floor(columnIndex / this._getCellCount()); } const data: any = { @@ -2413,7 +2416,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), @@ -2463,7 +2466,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), }); @@ -2515,7 +2518,7 @@ class SchedulerWorkSpace extends Widget { (this.$element() as any).toggleClass(VERTICAL_GROUPED_WORKSPACE_CLASS, this.isVerticalGroupedWorkSpace()); } - getDateTableCellClass(rowIndex?: any, columnIndex?: any) { + protected getDateTableCellClass(rowIndex?: any, columnIndex?: any) { const cellClass = `${DATE_TABLE_CELL_CLASS} ${HORIZONTAL_SIZES_CLASS} ${VERTICAL_SIZES_CLASS}`; return this._groupedStrategy @@ -2684,7 +2687,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); @@ -2735,10 +2738,10 @@ 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); } - renderView() { + protected renderView() { if (this.isRenovatedRender()) { if (this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); @@ -2806,7 +2809,7 @@ class SchedulerWorkSpace extends Widget { this.$element().toggleClass(WORKSPACE_WITH_COLLAPSED_ALL_DAY_CLASS, isExpanded); } - getDateTables() { + private getDateTables() { return this._$dateTable.add(this._$allDayTable); } @@ -2819,7 +2822,7 @@ class SchedulerWorkSpace extends Widget { this._$allDayTitle?.remove(); } - cleanView(): void { + protected cleanView(): void { this.cache.clear(); this.cleanTableWidths(); this.cellsSelectionState.clearSelectedAndFocusedCells(); @@ -2899,7 +2902,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++) { @@ -2956,7 +2959,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')); @@ -2988,9 +2991,9 @@ class SchedulerWorkSpace extends Widget { groupHeaderClass: this.getGroupHeaderClass.bind(this), groupHeaderContentClass: GROUP_HEADER_CONTENT_CLASS, }, - this.getCellCount() || 1, + this._getCellCount() || 1, this.option('resourceCellTemplate'), - this.getGroupCount(), + this._getGroupCount(), groupByDate, ); } @@ -2998,7 +3001,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 = []; @@ -3014,7 +3017,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; @@ -3032,7 +3035,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; @@ -3062,7 +3065,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); @@ -3082,10 +3085,10 @@ class SchedulerWorkSpace extends Widget { } protected renderAllDayPanel(index?: any) { - let cellCount = this.getCellCount(); + let cellCount = this._getCellCount(); if (!this.isVerticalGroupedWorkSpace()) { - cellCount *= this.getGroupCount() || 1; + cellCount *= this._getGroupCount() || 1; } const cellTemplates = this.renderTableBody({ @@ -3107,7 +3110,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); @@ -3158,7 +3161,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), }); @@ -3173,7 +3176,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_indicator.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_indicator.ts index 0773a31451ea..1c2debc557cb 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 @@ -108,7 +108,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; @@ -272,7 +272,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { } const verticalGroupCount = this.isVerticalGroupedWorkSpace() - ? this.getGroupCount() + ? this._getGroupCount() : 1; return [...new Array(verticalGroupCount)] @@ -295,7 +295,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()); 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 3dc2ce54065a..aa8f7e1cde52 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 { } 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 7cd3a7f6cdf6bc1df90afb7065a250e13963c929 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Wed, 11 Mar 2026 13:06:22 +0100 Subject: [PATCH 19/28] refactor: add protected override to child classes --- .../scheduler/workspaces/m_agenda.ts | 30 ++++++------- .../scheduler/workspaces/m_timeline.ts | 42 +++++++++---------- .../scheduler/workspaces/m_timeline_day.ts | 2 +- .../scheduler/workspaces/m_timeline_month.ts | 12 +++--- .../scheduler/workspaces/m_timeline_week.ts | 2 +- .../workspaces/m_timeline_work_week.ts | 2 +- .../scheduler/workspaces/m_work_space_day.ts | 4 +- .../workspaces/m_work_space_indicator.ts | 6 +-- .../workspaces/m_work_space_month.ts | 24 +++++------ .../workspaces/m_work_space_vertical.ts | 4 +- .../scheduler/workspaces/m_work_space_week.ts | 4 +- .../workspaces/m_work_space_work_week.ts | 2 +- 12 files changed, 67 insertions(+), 67 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 0cc7d4250623..dea2388efbf7 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -118,7 +118,7 @@ class SchedulerAgenda extends WorkSpace { return false; } - getElementClass() { + protected override getElementClass() { return AGENDA_CLASS; } @@ -126,7 +126,7 @@ class SchedulerAgenda extends WorkSpace { return agendaUtils.calculateStartViewDate(this.option('currentDate') as any, this.option('startDayHour') as any); } - getRowCount() { + protected override getRowCount() { return this.option('agendaDuration') as number; } @@ -140,11 +140,11 @@ class SchedulerAgenda extends WorkSpace { renderAllDayPanel() { return noop(); } - updateAllDayVisibility() { return noop(); } + protected override updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } - initWorkSpaceUnits() { + 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); @@ -159,7 +159,7 @@ class SchedulerAgenda extends WorkSpace { } } - renderView() { + protected override renderView() { this._startViewDate = this._calculateStartViewDate(); this._rows = []; this._initPositionHelper(); @@ -194,12 +194,12 @@ class SchedulerAgenda extends WorkSpace { this._dateTableScrollable.$content().append(this._$noDataContainer); } - setTableSizes() { return noop(); } + protected override setTableSizes() { return noop(); } - toggleHorizontalScrollClass() { return noop(); } + protected override toggleHorizontalScrollClass() { return noop(); } // eslint-disable-next-line @typescript-eslint/no-unused-vars - createCrossScrollingConfig(argument?: any) { return noop(); } + protected override createCrossScrollingConfig(argument?: any) { return noop(); } _setGroupHeaderCellsHeight() { const $cells = this.getGroupHeaderCells().filter((_, element) => !element.getAttribute('rowSpan')); @@ -232,7 +232,7 @@ class SchedulerAgenda extends WorkSpace { return result; } - attachGroupCountClass() { + protected override attachGroupCountClass() { const className = getVerticalGroupCountClass(this.option('groups')); (this.$element() as any).addClass(className); } @@ -256,7 +256,7 @@ class SchedulerAgenda extends WorkSpace { return this._$groupTable; } - makeGroupRows() { + protected override makeGroupRows() { const resourceManager = this.option('getResourceManager')(); const allAppointments = (this.option('getFilteredItems') as any)(); const tree = reduceResourcesTree( @@ -312,7 +312,7 @@ class SchedulerAgenda extends WorkSpace { }; } - cleanView() { + protected override cleanView() { this._$dateTable.empty(); this._$timePanel.empty(); @@ -328,11 +328,11 @@ class SchedulerAgenda extends WorkSpace { } } - createWorkSpaceElements() { + protected override createWorkSpaceElements() { this.createWorkSpaceStaticElements(); } - createWorkSpaceStaticElements() { + protected override createWorkSpaceStaticElements() { this._$dateTableContainer.append(this._$dateTable); this._dateTableScrollable.$content().append(this._$dateTableScrollableContent); @@ -352,9 +352,9 @@ class SchedulerAgenda extends WorkSpace { }); } - _attachTablesEvents() { return noop(); } + protected override attachTablesEvents() { return noop(); } - attachEvents() { return noop(); } + protected override attachEvents() { return noop(); } _cleanCellDataCache() { return noop(); } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index a952efcf8e7c..ccec773617ab 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -47,7 +47,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return this._$sidebarTable ? getOuterWidth(this._$sidebarTable) : 0; } - getTotalRowCount(groupCount) { + protected override getTotalRowCount(groupCount) { if (this._isHorizontalGroupedWorkSpace()) { return this.getRowCount(); } @@ -55,7 +55,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return this.getRowCount() * groupCount; } - getFormat(): any { + protected override getFormat(): any { return 'shorttime'; } @@ -67,7 +67,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return getBoundingRect((this.$element() as any).get(0)).height; } - dateTableScrollableConfig() { + protected override dateTableScrollableConfig() { const config = super.dateTableScrollableConfig(); const timelineConfig = { direction: HORIZONTAL, @@ -76,11 +76,11 @@ class SchedulerTimeline extends SchedulerWorkSpace { return this.option('crossScrollingEnabled') ? config : extend(config, timelineConfig); } - needCreateCrossScrolling() { + protected override needCreateCrossScrolling() { return true; } - headerScrollableConfig() { + protected override headerScrollableConfig() { const config = super.headerScrollableConfig(); return extend(config, { @@ -164,7 +164,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return false; } - setTableSizes() { + protected override setTableSizes() { super.setTableSizes(); const minHeight = this._getWorkSpaceMinHeight(); @@ -186,7 +186,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return minHeight; } - getCellCoordinatesByIndex(index) { + protected override getCellCoordinatesByIndex(index) { return { columnIndex: index % this._getCellCount(), rowIndex: 0, @@ -203,7 +203,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { .eq(indexes.columnIndex); } - getWorkSpaceWidth() { + protected override getWorkSpaceWidth() { return getOuterWidth(this._$dateTable, true); } @@ -211,7 +211,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return dateUtils.trimTime(new Date(this.getStartViewDate())); } - getIntervalBetween(currentDate, allDay) { + protected override getIntervalBetween(currentDate, allDay) { const startDayHour = this.option('startDayHour'); const endDayHour = this.option('endDayHour'); const firstViewDate = this.getStartViewDate(); @@ -254,7 +254,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - getWeekendsCount(argument?: any) { + protected override getWeekendsCount(argument?: any) { return 0; } @@ -325,11 +325,11 @@ class SchedulerTimeline extends SchedulerWorkSpace { .addClass(GROUP_TABLE_CLASS); } - getDefaultGroupStrategy() { + protected override getDefaultGroupStrategy() { return 'vertical'; } - toggleGroupingDirectionClass() { + protected override toggleGroupingDirectionClass() { (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this._isHorizontalGroupedWorkSpace()); } @@ -339,19 +339,19 @@ class SchedulerTimeline extends SchedulerWorkSpace { }); } - createWorkSpaceElements() { + protected override createWorkSpaceElements() { this.createWorkSpaceScrollableElements(); } - updateAllDayVisibility() { return noop(); } + protected override updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } - getDateHeaderTemplate() { + protected override getDateHeaderTemplate() { return this.option('timeCellTemplate'); } - renderView() { + protected override renderView() { let groupCellTemplates; if (!this.isRenovatedRender()) { groupCellTemplates = this.renderGroupHeader(); @@ -376,9 +376,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { this.applyCellTemplates(groupCellTemplates); } - setHorizontalGroupHeaderCellsHeight() { return noop(); } + protected override setHorizontalGroupHeaderCellsHeight() { return noop(); } - getTimePanelCells() { + protected override getTimePanelCells() { return (this.$element() as any) .find(`.${HEADER_PANEL_CELL_CLASS}:not(.${HEADER_PANEL_WEEK_CELL_CLASS})`); } @@ -409,9 +409,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { renderAllDayPanel() { return noop(); } - createAllDayPanelElements() { return noop(); } + protected override createAllDayPanelElements() { return noop(); } - renderDateHeader() { + protected override renderDateHeader() { const $headerRow = super.renderDateHeader(); if (this._needRenderWeekHeader()) { const firstViewDate = new Date(this.getStartViewDate()); @@ -490,7 +490,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { } } - makeGroupRows(groups, groupByDate) { + protected override makeGroupRows(groups, groupByDate) { const tableCreatorStrategy = this.option('groupOrientation') === 'vertical' ? tableCreator.VERTICAL : tableCreator.HORIZONTAL; return tableCreator.makeGroupedTable( 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 9c9278f04fc7..f27ec597212c 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts @@ -8,7 +8,7 @@ const TIMELINE_CLASS = 'dx-scheduler-timeline-day'; class SchedulerTimelineDay extends SchedulerTimeline { get type() { return VIEWS.TIMELINE_DAY; } - getElementClass() { + protected override getElementClass() { return TIMELINE_CLASS; } 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 c0e723238fb7..25a9f16bf3a8 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts @@ -16,17 +16,17 @@ class SchedulerTimelineMonth extends SchedulerTimeline { get renovatedHeaderPanelComponent() { return HeaderPanelComponent; } - renderView() { + protected override renderView() { super.renderView(); this.updateScrollable(); } - getElementClass() { + protected override getElementClass() { return TIMELINE_CLASS; } - getDateHeaderTemplate() { + protected override getDateHeaderTemplate() { return this.option('dateCellTemplate'); } @@ -38,18 +38,18 @@ class SchedulerTimelineMonth extends SchedulerTimeline { return true; } - getFormat() { + protected override getFormat() { return formatWeekdayAndDay; } - getIntervalBetween(currentDate) { + protected override getIntervalBetween(currentDate) { const firstViewDate = this.getStartViewDate(); const timeZoneOffset = dateUtils.getTimezonesDifference(firstViewDate, currentDate); return currentDate.getTime() - (firstViewDate.getTime() - (this.option('startDayHour') as any) * 3600000) - timeZoneOffset; } - getViewStartByOptions() { + protected override getViewStartByOptions() { return monthUtils.getViewStartByOptions( this.option('startDate') as any, this.option('currentDate') as any, 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 030c51e585f6..8e03bf0018d4 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_week.ts @@ -9,7 +9,7 @@ const TIMELINE_CLASS = 'dx-scheduler-timeline-week'; export default class SchedulerTimelineWeek extends SchedulerTimeline { get type() { return VIEWS.TIMELINE_WEEK; } - getElementClass() { + protected override getElementClass() { return TIMELINE_CLASS; } 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 58090de744a4..4c89a5f5abaa 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 @@ -19,7 +19,7 @@ class SchedulerTimelineWorkWeek extends SchedulerTimelineWeek { this.getWeekendsCount = getWeekendsCount; } - getElementClass() { + protected override getElementClass() { return TIMELINE_CLASS; } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts index 27c168be4540..9ff8c6a7f1d8 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_day.ts @@ -8,11 +8,11 @@ const DAY_CLASS = 'dx-scheduler-work-space-day'; class SchedulerWorkSpaceDay extends SchedulerWorkSpaceVertical { get type() { return VIEWS.DAY; } - getElementClass() { + protected override getElementClass() { return DAY_CLASS; } - renderDateHeader() { + protected override renderDateHeader() { return this.option('intervalCount') === 1 ? null : super.renderDateHeader(); } 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 1c2debc557cb..4dab386f6f9b 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 @@ -187,7 +187,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return false; } - getHeaderPanelCellClass(i) { + protected override getHeaderPanelCellClass(i) { const cellClass = super.getHeaderPanelCellClass(i); if (this._isCurrentTimeHeaderCell(i)) { @@ -197,7 +197,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return cellClass; } - cleanView() { + protected override cleanView() { super.cleanView(); this._cleanDateTimeIndicator(); @@ -213,7 +213,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { (this.$element() as any).find(`.${SCHEDULER_DATE_TIME_INDICATOR_CLASS}`).remove(); } - cleanWorkSpace() { + protected override cleanWorkSpace() { super.cleanWorkSpace(); this.renderDateTimeIndication(); 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 aa8f7e1cde52..260faee097d5 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 @@ -23,22 +23,22 @@ const toMs = dateUtils.dateToMilliseconds; class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { get type() { return VIEWS.MONTH; } - getElementClass() { + protected override getElementClass() { return MONTH_CLASS; } - getFormat() { + protected override getFormat() { return formatWeekday; } - getIntervalBetween(currentDate) { + protected override getIntervalBetween(currentDate) { const firstViewDate = this.getStartViewDate(); const timeZoneOffset = dateUtils.getTimezonesDifference(firstViewDate, currentDate); return currentDate.getTime() - (firstViewDate.getTime() - (this.option('startDayHour') as any) * 3600000) - timeZoneOffset; } - getDateGenerationOptions() { + protected override getDateGenerationOptions() { return { ...super.getDateGenerationOptions(), cellCountInDay: 1, @@ -68,7 +68,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { return false; } - getCellCoordinatesByIndex(index) { + protected override getCellCoordinatesByIndex(index) { const rowIndex = Math.floor(index / this._getCellCount()); const columnIndex = index - this._getCellCount() * rowIndex; @@ -78,12 +78,12 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { }; } - needCreateCrossScrolling() { + protected override needCreateCrossScrolling() { // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing return this.option('crossScrollingEnabled') || this.isVerticalGroupedWorkSpace(); } - getViewStartByOptions() { + protected override getViewStartByOptions() { return monthUtils.getViewStartByOptions( this.option('startDate') as any, this.option('currentDate') as any, @@ -92,7 +92,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { ); } - updateIndex(index) { + protected override updateIndex(index) { return index; } @@ -124,7 +124,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { return true; } - getHeaderDate() { + protected override getHeaderDate() { return this.getViewStartByOptions(); } @@ -148,7 +148,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { // We need these methods for now but they are useless for renovation // ------------- - createWorkSpaceElements() { + protected override createWorkSpaceElements() { if (this.isVerticalGroupedWorkSpace()) { this.createWorkSpaceScrollableElements(); } else { @@ -156,7 +156,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { } } - updateAllDayVisibility() { return noop(); } + protected override updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } @@ -175,7 +175,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { .toggleClass(DATE_TABLE_OTHER_MONTH_DATE_CLASS, data.otherMonth); } - createAllDayPanelElements() {} + protected override createAllDayPanelElements() {} renderTableBody(options) { options.getCellText = (rowIndex, columnIndex) => { diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts index c871368e8b08..428b6e95d240 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_vertical.ts @@ -3,7 +3,7 @@ import { formatWeekdayAndDay } from '@ts/scheduler/r1/utils/index'; import SchedulerWorkSpaceIndicator from './m_work_space_indicator'; class SchedulerWorkspaceVertical extends SchedulerWorkSpaceIndicator { - getFormat() { + protected override getFormat() { return formatWeekdayAndDay; } @@ -16,7 +16,7 @@ class SchedulerWorkspaceVertical extends SchedulerWorkSpaceIndicator { }; } - isRenderHeaderPanelEmptyCell() { + protected override isRenderHeaderPanelEmptyCell() { return true; } } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts index f9f91bb455fc..e756a49ad902 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts @@ -8,11 +8,11 @@ const WEEK_CLASS = 'dx-scheduler-work-space-week'; class SchedulerWorkSpaceWeek extends SchedulerWorkSpaceVertical { get type() { return VIEWS.WEEK; } - getElementClass() { + protected override getElementClass() { return WEEK_CLASS; } - calculateViewStartDate() { + protected override calculateViewStartDate() { return weekUtils.calculateViewStartDate(this.option('startDate') as any, this.firstDayOfWeek()); } } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_work_week.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_work_week.ts index 577e54937908..c0b43a1bc5aa 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_work_week.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_work_week.ts @@ -17,7 +17,7 @@ class SchedulerWorkSpaceWorkWeek extends SchedulerWorkSpaceWeek { this.getWeekendsCount = getWeekendsCount; } - getElementClass() { + protected override getElementClass() { return WORK_WEEK_CLASS; } } From 6cd1328a81c008a19b901c79c812061d39d11a9c Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Wed, 11 Mar 2026 13:21:16 +0100 Subject: [PATCH 20/28] fix: fix build --- .../m_work_space_grouped_strategy_horizontal.ts | 14 +++++++------- .../m_work_space_grouped_strategy_vertical.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) 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 6abe6ad841a2..35131885ea09 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 @@ -14,7 +14,7 @@ class HorizontalGroupedStrategy { if (!groupByDay) { return { rowIndex: cellCoordinates.rowIndex, - columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace.getCellCount(), + columnIndex: cellCoordinates.columnIndex + groupIndex * this._workSpace._getCellCount(), }; } return { @@ -30,7 +30,7 @@ class HorizontalGroupedStrategy { if (groupByDay) { return columnIndex % groupCount; } - return Math.floor(columnIndex / this._workSpace.getCellCount()); + return Math.floor(columnIndex / this._workSpace._getCellCount()); } calculateHeaderCellRepeatCount() { @@ -44,7 +44,7 @@ class HorizontalGroupedStrategy { getTotalCellCount(groupCount) { groupCount = groupCount || 1; - return this._workSpace.getCellCount() * groupCount; + return this._workSpace._getCellCount() * groupCount; } getTotalRowCount() { @@ -142,7 +142,7 @@ class HorizontalGroupedStrategy { _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; } @@ -152,7 +152,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; } @@ -199,7 +199,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}`; } @@ -217,7 +217,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 9e8561da0523..97270da9a2eb 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 @@ -45,7 +45,7 @@ class VerticalGroupedStrategy { } getTotalCellCount() { - return this._workSpace.getCellCount(); + return this._workSpace._getCellCount(); } getTotalRowCount() { From deffeefffbb9652cd546079611945264f8adab47 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Wed, 11 Mar 2026 13:24:19 +0100 Subject: [PATCH 21/28] refactor: add protected override to child classes --- .../js/__internal/scheduler/workspaces/m_agenda.ts | 14 +++++++------- .../__internal/scheduler/workspaces/m_timeline.ts | 10 +++++----- .../scheduler/workspaces/m_work_space.ts | 2 +- .../scheduler/workspaces/m_work_space_month.ts | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index dea2388efbf7..e65099932a43 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -114,7 +114,7 @@ class SchedulerAgenda extends WorkSpace { return false; } - isVerticalGroupedWorkSpace() { + protected override isVerticalGroupedWorkSpace() { return false; } @@ -134,11 +134,11 @@ class SchedulerAgenda extends WorkSpace { return 1; } - getTimePanelRowCount() { + protected override getTimePanelRowCount() { return this.option('agendaDuration') as number; } - renderAllDayPanel() { return noop(); } + protected override renderAllDayPanel() { return noop(); } protected override updateAllDayVisibility() { return noop(); } @@ -252,7 +252,7 @@ class SchedulerAgenda extends WorkSpace { return result; } - getGroupHeaderContainer() { + protected override getGroupHeaderContainer() { return this._$groupTable; } @@ -344,7 +344,7 @@ class SchedulerAgenda extends WorkSpace { this.$element().append(this._dateTableScrollable.$element()); } - renderDateTable() { + protected override renderDateTable() { this.renderTableBody({ container: getPublicElement(this._$dateTable), rowClass: DATE_TABLE_ROW_CLASS, @@ -380,7 +380,7 @@ class SchedulerAgenda extends WorkSpace { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - renderTableBody(options: any, delayCellTemplateRendering?: any) { + protected override renderTableBody(options: any, delayCellTemplateRendering?: any) { const cellTemplates: any[] = []; const cellTemplateOpt = options.cellTemplate; @@ -440,7 +440,7 @@ class SchedulerAgenda extends WorkSpace { } } - renderTimePanel() { + protected override renderTimePanel() { this.renderTableBody({ container: getPublicElement(this._$timePanel), rowCount: this.getTimePanelRowCount(), diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index ccec773617ab..d879a159ddb5 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -92,14 +92,14 @@ class SchedulerTimeline extends SchedulerWorkSpace { return false; } - getGroupHeaderContainer() { + protected override getGroupHeaderContainer() { if (this._isHorizontalGroupedWorkSpace()) { return this._$thead; } return this._$sidebarTable; } - insertAllDayRowsIntoDateTable() { + protected override insertAllDayRowsIntoDateTable() { return false; } @@ -300,7 +300,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { renderRTimeTable() {} - renderGroupAllDayPanel() {} + protected override renderGroupAllDayPanel() {} // eslint-disable-next-line @typescript-eslint/no-unused-vars generateRenderOptions(argument?: any) { @@ -405,9 +405,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { // These methods should be deleted when we get rid of old render // -------------- - renderTimePanel() { return noop(); } + protected override renderTimePanel() { return noop(); } - renderAllDayPanel() { return noop(); } + protected override renderAllDayPanel() { return noop(); } protected override createAllDayPanelElements() { return noop(); } 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 ba46e6f17689..a399c04d0486 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -624,7 +624,7 @@ class SchedulerWorkSpace extends Widget { return this.$element(); } - isVerticalGroupedWorkSpace() { // TODO move to the Model + protected isVerticalGroupedWorkSpace() { // TODO move to the Model return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'vertical'; } 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 260faee097d5..c324a45a2773 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 @@ -64,7 +64,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { }); } - insertAllDayRowsIntoDateTable() { + protected override insertAllDayRowsIntoDateTable() { return false; } @@ -164,9 +164,9 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { // These methods should be deleted when we get rid of old render // -------------- - renderTimePanel() { return noop(); } + protected override renderTimePanel() { return noop(); } - renderAllDayPanel() { return noop(); } + protected override renderAllDayPanel() { return noop(); } _setMonthClassesToCell($cell, data) { $cell @@ -177,7 +177,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { protected override createAllDayPanelElements() {} - renderTableBody(options) { + protected override renderTableBody(options) { options.getCellText = (rowIndex, columnIndex) => { const date = this.viewDataProvider.completeViewDataMap[rowIndex][columnIndex].startDate; From f4abd81e91ea4870cf40520031ed17f2a11a426d Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Wed, 11 Mar 2026 13:45:11 +0100 Subject: [PATCH 22/28] refactor: undo naming --- .../__tests__/__mock__/m_mock_scheduler.ts | 2 +- .../scheduler/__tests__/workspace.base.test.ts | 4 ++-- .../js/__internal/scheduler/m_subscribes.ts | 2 +- .../js/__internal/scheduler/workspaces/m_agenda.ts | 8 ++++---- .../scheduler/workspaces/m_work_space.ts | 14 ++++++++------ .../m_work_space_grouped_strategy_horizontal.ts | 12 ++++++------ .../m_work_space_grouped_strategy_vertical.ts | 4 ++-- .../scheduler/workspaces/m_work_space_indicator.ts | 4 ++-- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/__tests__/__mock__/m_mock_scheduler.ts b/packages/devextreme/js/__internal/scheduler/__tests__/__mock__/m_mock_scheduler.ts index a151e5f925b1..3c452af4307b 100644 --- a/packages/devextreme/js/__internal/scheduler/__tests__/__mock__/m_mock_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/__tests__/__mock__/m_mock_scheduler.ts @@ -19,7 +19,7 @@ export const setupSchedulerTestEnvironment = ({ }: SetupSchedulerTestEnvironmentOptions = {}): void => { jest.spyOn(logger, 'warn').mockImplementation(() => {}); DOMComponent.prototype._isVisible = jest.fn((): boolean => true); - SchedulerWorkSpace.prototype.createCrossScrollingConfig = (): { + SchedulerWorkSpace.prototype._createCrossScrollingConfig = (): { direction: string; onScroll: jest.Mock; onEnd: jest.Mock; 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 7936a960acfb..297f343f1769 100644 --- a/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts +++ b/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts @@ -58,12 +58,12 @@ describe('scheduler workspace', () => { expect(workspace.cache.clear).toHaveBeenCalledTimes(1); }); - it(`should clear cache on cleanView call, view: ${currentView}`, () => { + it(`should clear cache on _cleanView call, view: ${currentView}`, () => { const workspace = createWorkspace(WorkSpace, currentView); jest.spyOn(workspace.cache, 'clear'); workspace.cache.memo('test', () => 'value'); - workspace.cleanView(); + workspace._cleanView(); expect(workspace.cache.clear).toHaveBeenCalledTimes(1); expect(workspace.cache.size).toBe(0); diff --git a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts index f932669278f6..7c2da2efc39a 100644 --- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts +++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts @@ -243,7 +243,7 @@ const subscribes = { }, getGroupCount() { - return this._workSpace.getGroupCount(); + return this._workSpace._getGroupCount(); }, mapAppointmentFields(config) { diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index e65099932a43..5a5944c1d3c2 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -130,7 +130,7 @@ class SchedulerAgenda extends WorkSpace { return this.option('agendaDuration') as number; } - getCellCount() { + _getCellCount() { return 1; } @@ -167,7 +167,7 @@ class SchedulerAgenda extends WorkSpace { _recalculateAgenda(rows) { let cellTemplates = []; - this.cleanView(); + this._cleanView(); if (this._rowsIsEmpty(rows)) { this._renderNoData(); @@ -199,7 +199,7 @@ class SchedulerAgenda extends WorkSpace { protected override toggleHorizontalScrollClass() { return noop(); } // eslint-disable-next-line @typescript-eslint/no-unused-vars - protected override createCrossScrollingConfig(argument?: any) { return noop(); } + _createCrossScrollingConfig(argument?: any) { return noop(); } _setGroupHeaderCellsHeight() { const $cells = this.getGroupHeaderCells().filter((_, element) => !element.getAttribute('rowSpan')); @@ -312,7 +312,7 @@ class SchedulerAgenda extends WorkSpace { }; } - protected override cleanView() { + _cleanView() { this._$dateTable.empty(); this._$timePanel.empty(); 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 a399c04d0486..9a8de1893242 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -681,7 +681,7 @@ class SchedulerWorkSpace extends Widget { }; if (this.needCreateCrossScrolling()) { - config = extend(config, this.createCrossScrollingConfig(config)); + config = extend(config, this._createCrossScrollingConfig(config)); } if (this.isVirtualScrolling() @@ -701,7 +701,8 @@ class SchedulerWorkSpace extends Widget { return config; } - protected createCrossScrollingConfig({ onScroll }): any { + // TODO: make it private. Being used as public method by external code. + _createCrossScrollingConfig({ onScroll }): any { return { direction: 'both', onScroll: (event) => { @@ -2314,7 +2315,7 @@ class SchedulerWorkSpace extends Widget { this.cleanWorkSpace(); break; case 'groups': - this.cleanView(); + this._cleanView(); this.removeAllDayElements(); this.initGrouping(); this.repaint(); @@ -2328,7 +2329,7 @@ class SchedulerWorkSpace extends Widget { break; case 'showAllDayPanel': if (this.isVerticalGroupedWorkSpace()) { - this.cleanView(); + this._cleanView(); this.removeAllDayElements(); this.initGrouping(); this.repaint(); @@ -2424,7 +2425,7 @@ class SchedulerWorkSpace extends Widget { } protected cleanWorkSpace() { - this.cleanView(); + this._cleanView(); this.toggleGroupedClass(); this.toggleWorkSpaceWithOddCells(); @@ -2822,7 +2823,8 @@ class SchedulerWorkSpace extends Widget { this._$allDayTitle?.remove(); } - protected cleanView(): void { + // TODO: make it private. Being used as public method by external code. + _cleanView(): void { this.cache.clear(); this.cleanTableWidths(); this.cellsSelectionState.clearSelectedAndFocusedCells(); 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 35131885ea09..65aaafb781cd 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 @@ -19,13 +19,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; @@ -34,7 +34,7 @@ class HorizontalGroupedStrategy { } calculateHeaderCellRepeatCount() { - return this._workSpace.getGroupCount() || 1; + return this._workSpace._getGroupCount() || 1; } insertAllDayRowsIntoDateTable() { @@ -148,7 +148,7 @@ class HorizontalGroupedStrategy { } _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) { @@ -196,7 +196,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) { @@ -214,7 +214,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 97270da9a2eb..4fbf46c25d6a 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 @@ -49,11 +49,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 4dab386f6f9b..2a23d2356840 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 @@ -197,8 +197,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return cellClass; } - protected override cleanView() { - super.cleanView(); + _cleanView() { + super._cleanView(); this._cleanDateTimeIndicator(); } From b1851077dfc606b9cb92ce909be7c3d9a85f0efa Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 12 Mar 2026 11:00:20 +0100 Subject: [PATCH 23/28] fix: fix tests --- .../timeline.tests.js | 2 +- .../workSpace.day.tests.js | 2 +- .../workSpace.navigation.tests.js | 18 +++++++++--------- .../workSpace.renovation.tests.js | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js index 57675904f58c..d44fefda5fd9 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js @@ -458,7 +458,7 @@ QUnit.module('Timeline Keyboard Navigation', () => { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); e.component.initDragBehavior(); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, renovateRender: true, scrolling: { mode: scrollingMode, orientation: 'vertical' }, diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.day.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.day.tests.js index b71f19628bb1..d70c4ab0ec96 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.day.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.day.tests.js @@ -32,7 +32,7 @@ module('Work Space Day', { getResourceManager: getEmptyResourceManager, }).dxSchedulerWorkSpaceDay('instance'); this.instance.initDragBehavior(); - this.instance._attachTablesEvents(); + this.instance.attachTablesEvents(); } }, () => { test('Workspace getAllDayHeight() should return 0 or allDayPanel-height depending on the showAllDayPanel option', async function(assert) { diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.navigation.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.navigation.tests.js index 1013e3ad80fe..c11bba1ae870 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.navigation.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.navigation.tests.js @@ -999,7 +999,7 @@ module('Workspace navigation', () => { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); e.component.initDragBehavior(); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, getResourceManager: getEmptyResourceManager, }, 'dxSchedulerWorkSpaceWeek'); @@ -1027,7 +1027,7 @@ module('Workspace navigation', () => { currentDate: new Date(2015, 3, 1), onContentReady: function(e) { e.component.initDragBehavior(); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); } }, 'dxSchedulerWorkSpaceWeek'); @@ -1057,7 +1057,7 @@ module('Workspace navigation', () => { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); e.component.initDragBehavior(); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, }, 'dxSchedulerWorkSpaceWeek'); @@ -1104,7 +1104,7 @@ module('Workspace navigation', () => { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); e.component.initDragBehavior(); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, onSelectedCellsClick: () => {}, ...(await getWorkspaceResourceConfig( @@ -1157,7 +1157,7 @@ module('Workspace navigation', () => { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); e.component.initDragBehavior(); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, ...(await getWorkspaceResourceConfig( [{ @@ -1335,7 +1335,7 @@ module('Workspace navigation', () => { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); e.component.initDragBehavior(); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, intervalCount: 3, groupOrientation: 'horizontal', @@ -1383,7 +1383,7 @@ module('Workspace navigation', () => { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); e.component.initDragBehavior(); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, intervalCount: 3, groupOrientation: 'horizontal', @@ -1459,7 +1459,7 @@ module('Workspace navigation', () => { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); e.component.initDragBehavior(); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, intervalCount, groupOrientation: 'vertical', @@ -1515,7 +1515,7 @@ module('Workspace navigation', () => { onContentReady: function(e) { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, groupOrientation: 'vertical', startDayHour: 0, diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js index b4205d589efe..0dacd9ee746c 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js @@ -60,7 +60,7 @@ module('Renovated Render', { onContentReady: function(e) { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, ...options, })[workSpace]('instance'); From 8325c839cad3ea527f69fe0da4bc85d7b4a8d6e4 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 12 Mar 2026 12:26:58 +0100 Subject: [PATCH 24/28] fix: fix build --- .../js/__internal/scheduler/workspaces/m_agenda.ts | 4 ++-- .../js/__internal/scheduler/workspaces/m_timeline.ts | 2 +- .../js/__internal/scheduler/workspaces/m_work_space.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 5a5944c1d3c2..8e9400878e28 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -162,7 +162,7 @@ class SchedulerAgenda extends WorkSpace { protected override renderView() { this._startViewDate = this._calculateStartViewDate(); this._rows = []; - this._initPositionHelper(); + this.initPositionHelper(); } _recalculateAgenda(rows) { @@ -491,7 +491,7 @@ class SchedulerAgenda extends WorkSpace { onDataSourceChanged(appointments?: SafeAppointment[]) { super.onDataSourceChanged(); - this._renderView(); + this.renderView(); const rows = this._calculateRows(appointments); this._recalculateAgenda(rows); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index d879a159ddb5..ea81ee4b221b 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -283,7 +283,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { date = date || new Date(this.option('currentDate')); date.setHours(hours, minutes, 0, 0); - const coordinates = this._getScrollCoordinates(date); + const coordinates = this.getScrollCoordinates(date); const scrollable = this.getScrollable(); const offset = this.option('rtlEnabled') ? getBoundingRect(this.getScrollableContainer().get(0)).width : 0; 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 9a8de1893242..0281d62b1406 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -1408,7 +1408,7 @@ class SchedulerWorkSpace extends Widget { return (this.$element() as any).find(`.${GROUP_HEADER_CLASS}`); } - private getScrollCoordinates(date, groupIndex?: any, allDay?: any) { + protected getScrollCoordinates(date, groupIndex?: any, allDay?: any) { const currentDate = date || new Date(this.option('currentDate')); const cell = this.viewDataProvider.findGlobalCellPosition(currentDate, groupIndex, allDay, true); @@ -1794,13 +1794,13 @@ class SchedulerWorkSpace extends Widget { } scrollToTime(hours, minutes, date) { - if (!this._isValidScrollDate(date)) { + if (!this.isValidScrollDate(date)) { return; } date = date || new Date(this.option('currentDate')); date.setHours(hours, minutes, 0, 0); - const coordinates = this._getScrollCoordinates(date); + const coordinates = this.getScrollCoordinates(date); const scrollable = this.getScrollable(); @@ -2455,7 +2455,7 @@ class SchedulerWorkSpace extends Widget { .addClass(this.getElementClass()); } - private initPositionHelper() { + protected initPositionHelper() { this.positionHelper = new PositionHelper({ key: this.option('key'), viewDataProvider: this.viewDataProvider, From 12c6edc8010219b0bc96a7495b1a5c54ec20b81a Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 12 Mar 2026 12:30:51 +0100 Subject: [PATCH 25/28] fix: fix build --- .../scheduler/view_model/m_appointments_layout_manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts b/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts index 0fe6d2aa2e9b..48c05b872857 100644 --- a/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts +++ b/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts @@ -74,7 +74,7 @@ class AppointmentLayoutManager { const DOMMetaData = workspace.getDOMElementsMetaData(); const allDayHeight = getAllDayHeight( workspace.option('showAllDayPanel'), - workspace._isVerticalGroupedWorkSpace(), + workspace.isVerticalGroupedWorkSpace(), DOMMetaData, ); const rowCount = workspace._getRowCount(); From cc7ffb7fe27961ca2b8b6798e0e105dde956cc2a Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 12 Mar 2026 12:35:14 +0100 Subject: [PATCH 26/28] fix: fix build --- .../scheduler/view_model/m_appointments_layout_manager.ts | 4 ++-- .../scheduler/workspaces/view_model/m_view_data_provider.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts b/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts index 48c05b872857..872769d26fee 100644 --- a/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts +++ b/packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts @@ -77,7 +77,7 @@ class AppointmentLayoutManager { workspace.isVerticalGroupedWorkSpace(), DOMMetaData, ); - const rowCount = workspace._getRowCount(); + const rowCount = workspace.getRowCount(); const { positionHelper, viewDataProvider } = workspace; const visibleDayDuration = viewDataProvider.getVisibleDayDuration( workspace.option('startDayHour'), @@ -119,7 +119,7 @@ class AppointmentLayoutManager { allowResizing: this.instance._allowResizing(), allowAllDayResizing: this.instance._allowAllDayResizing(), startViewDate: workspace.getStartViewDate(), - groupOrientation: workspace._getRealGroupOrientation(), + groupOrientation: workspace.getRealGroupOrientation(), cellWidth: getCellWidth(DOMMetaData), cellHeight: getCellHeight(DOMMetaData), allDayHeight, diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_view_data_provider.ts b/packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_view_data_provider.ts index c1bb4a3b77ae..be832dd4012d 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_view_data_provider.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/view_model/m_view_data_provider.ts @@ -237,7 +237,7 @@ export default class ViewDataProvider { } getCellsByGroupIndexAndAllDay(groupIndex: number, isAllDay: boolean): ViewCellData[][] { - const rowsPerGroup = this._getRowCountWithAllDayRows(); + const rowsPerGroup = this.getRowCountWithAllDayRows(); const isShowAllDayPanel = this._options.isAllDayPanelVisible; const firstRowInGroup = this._options.isVerticalGrouping @@ -505,7 +505,7 @@ export default class ViewDataProvider { return this.viewDataGenerator.getVisibleDayDuration(startDayHour, endDayHour, hoursInterval); } - _getRowCountWithAllDayRows() { + getRowCountWithAllDayRows() { const allDayRowCount = this._options.isAllDayPanelVisible ? 1 : 0; return this.getRowCount(this._options) + allDayRowCount; From ff2b1c8a74b8b76db1e9b484d335a3c272a63d97 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 12 Mar 2026 12:50:04 +0100 Subject: [PATCH 27/28] fix: fix build --- packages/devextreme/js/__internal/scheduler/m_scheduler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts index e59a4d9fc547..4498d2ecc839 100644 --- a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts @@ -1302,7 +1302,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { this._recalculateWorkspace(); if (currentViewOptions.startDate) { - this._updateOption('header', 'currentDate', this._workSpace._getHeaderDate()); + this._updateOption('header', 'currentDate', this._workSpace.getHeaderDate()); } } From 27eaeeda8d4fef6c3c9962c71c33a19aa0bf94f5 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 12 Mar 2026 13:13:33 +0100 Subject: [PATCH 28/28] fix: fix build --- .../DevExpress.ui.widgets.scheduler/scrollToTime.tests.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/scrollToTime.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/scrollToTime.tests.js index 3d02e73d8477..01342de5d11b 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/scrollToTime.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/scrollToTime.tests.js @@ -142,7 +142,7 @@ QUnit.module('Scrolling to time', () => { assert.roughEqual( scrollBy.getCall(0).args[0].left, - scheduler.instance._workSpace._getScrollCoordinates(new Date(2015, 1, 9, 9, 5)).left, + scheduler.instance._workSpace.getScrollCoordinates(new Date(2015, 1, 9, 9, 5)).left, 1.001, 'scrollBy was called with right distance', ); @@ -170,7 +170,7 @@ QUnit.module('Scrolling to time', () => { assert.roughEqual( scrollBy.getCall(0).args[0].left, - scheduler.instance._workSpace._getScrollCoordinates(new Date(2015, 1, 9, 9, 5)).left - scrollLeft - offset, + scheduler.instance._workSpace.getScrollCoordinates(new Date(2015, 1, 9, 9, 5)).left - scrollLeft - offset, 1.001, 'scrollBy was called with right distance', ); @@ -196,7 +196,7 @@ QUnit.module('Scrolling to time', () => { assert.roughEqual( scrollBy.getCall(0).args[0].left, - scheduler.instance._workSpace._getScrollCoordinates(new Date(2015, 1, 11, 9, 5)).left, + scheduler.instance._workSpace.getScrollCoordinates(new Date(2015, 1, 11, 9, 5)).left, 1.001, 'scrollBy was called with right distance', ); @@ -225,7 +225,7 @@ QUnit.module('Scrolling to time', () => { assert.roughEqual( scrollBy.getCall(0).args[0].left, - scheduler.instance._workSpace._getScrollCoordinates(new Date(2015, 1, 11, 9, 5)).left - scrollLeft - offset, + scheduler.instance._workSpace.getScrollCoordinates(new Date(2015, 1, 11, 9, 5)).left - scrollLeft - offset, 1.001, 'scrollBy was called with right distance', );