From 95ebb9de11ae589c53968e35c3bc80fcd7933c30 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Wed, 4 Mar 2026 10:28:06 +0100 Subject: [PATCH 01/22] refactor: remove prefix _ in m_workspace and references --- .../js/__internal/scheduler/m_scheduler.ts | 6 +- .../js/__internal/scheduler/m_subscribes.ts | 4 +- .../shaders/current_time_shader_horizontal.ts | 10 +- .../shaders/current_time_shader_vertical.ts | 2 +- .../scheduler/workspaces/m_agenda.ts | 20 +- .../scheduler/workspaces/m_timeline.ts | 64 +- .../scheduler/workspaces/m_timeline_day.ts | 2 +- .../scheduler/workspaces/m_timeline_month.ts | 4 +- .../workspaces/m_timeline_work_week.ts | 2 +- .../scheduler/workspaces/m_work_space.ts | 546 +++++++++--------- ..._work_space_grouped_strategy_horizontal.ts | 28 +- .../m_work_space_grouped_strategy_vertical.ts | 20 +- .../workspaces/m_work_space_indicator.ts | 16 +- .../workspaces/m_work_space_month.ts | 24 +- .../scheduler/workspaces/m_work_space_week.ts | 2 +- .../workspaces/m_work_space_work_week.ts | 2 +- 16 files changed, 376 insertions(+), 376 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts index a703f844fd73..a2e260ea997c 100644 --- a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts @@ -1256,7 +1256,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()); @@ -1280,7 +1280,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { this._recalculateWorkspace(); if (currentViewOptions.startDate) { - this._updateOption('header', 'currentDate', this._workSpace._getHeaderDate()); + this._updateOption('header', 'currentDate', this._workSpace.getHeaderDate()); } } @@ -1302,7 +1302,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()); } diff --git a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts index 5499536f3102..2b72cab32a43 100644 --- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts +++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts @@ -153,7 +153,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, @@ -229,7 +229,7 @@ const subscribes = { }, getGroupCount() { - return this._workSpace._getGroupCount(); + return this._workSpace.getGroupCount(); }, mapAppointmentFields(config) { diff --git a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts index 8936fa571ef3..cf23ce7d170c 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts @@ -6,8 +6,8 @@ import CurrentTimeShader from './current_time_shader'; class HorizontalCurrentTimeShader extends CurrentTimeShader { renderShader(): void { - const groupCount = this._workSpace._isHorizontalGroupedWorkSpace() - ? this._workSpace._getGroupCount() + const groupCount = this._workSpace.isHorizontalGroupedWorkSpace() + ? this._workSpace.getGroupCount() : 1; for (let i = 0; i < groupCount; i += 1) { @@ -34,7 +34,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); @@ -64,9 +64,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() + shaderLeft = workSpace.getCellWidth() * integerPart * workSpace.getGroupCount() + groupIndex * workSpace.getCellWidth(); } diff --git a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts index 7b4eabf37712..aa8f92796ec8 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts @@ -24,7 +24,7 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { } setHeight(this._$shader, shaderHeight); - const groupCount = this._workSpace._getGroupCount() || 1; + const groupCount = this._workSpace.getGroupCount() || 1; if (this._workSpace.isGroupedByDate()) { this.renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index a0986d0bbe4d..ecf2796b2abe 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -112,7 +112,7 @@ class SchedulerAgenda extends WorkSpace { return false; } - _isVerticalGroupedWorkSpace() { + isVerticalGroupedWorkSpace() { return false; } @@ -120,15 +120,15 @@ class SchedulerAgenda extends WorkSpace { return AGENDA_CLASS; } - _getRowCount() { + getRowCount() { return this.option('agendaDuration') as number; } - _getCellCount() { + getCellCount() { return 1; } - _getTimePanelRowCount() { + getTimePanelRowCount() { return this.option('agendaDuration') as number; } @@ -169,7 +169,7 @@ class SchedulerAgenda extends WorkSpace { this._rows = rows; if (this._$groupTable) { - cellTemplates = this._renderGroupHeader(); + cellTemplates = this.renderGroupHeader(); this._setGroupHeaderCellsHeight(); } @@ -186,7 +186,7 @@ class SchedulerAgenda extends WorkSpace { this._dateTableScrollable.$content().append(this._$noDataContainer); } - _setTableSizes() { return noop(); } + setTableSizes() { return noop(); } _toggleHorizontalScrollClass() { return noop(); } @@ -194,7 +194,7 @@ class SchedulerAgenda extends WorkSpace { _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) { @@ -265,7 +265,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; @@ -340,7 +340,7 @@ class SchedulerAgenda extends WorkSpace { this._renderTableBody({ container: getPublicElement(this._$dateTable), rowClass: DATE_TABLE_ROW_CLASS, - cellClass: this._getDateTableCellClass(), + cellClass: this.getDateTableCellClass(), }); } @@ -435,7 +435,7 @@ class SchedulerAgenda extends WorkSpace { _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 d6fa88fbfd59..86a234125030 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -48,11 +48,11 @@ 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 { @@ -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, }; @@ -80,8 +80,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { 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,9 +186,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { return minHeight; } - _getCellCoordinatesByIndex(index) { + getCellCoordinatesByIndex(index) { return { - columnIndex: index % this._getCellCount(), + columnIndex: index % this.getCellCount(), rowIndex: 0, }; } @@ -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'); @@ -313,7 +313,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() { @@ -337,7 +337,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { _renderView() { let groupCellTemplates; if (!this.isRenovatedRender()) { - groupCellTemplates = this._renderGroupHeader(); + groupCellTemplates = this.renderGroupHeader(); } this.renderWorkSpace(); @@ -350,7 +350,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { this._$sidebarTable.appendTo(this._sidebarScrollable.$content()); - if (this.isRenovatedRender() && this._isVerticalGroupedWorkSpace()) { + if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } @@ -361,23 +361,23 @@ class SchedulerTimeline extends SchedulerWorkSpace { _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)] @@ -401,14 +401,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); @@ -464,7 +464,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); @@ -482,12 +482,12 @@ 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, + this.getCellCount() || 1, this.option('resourceCellTemplate'), - this._getTotalRowCount(this._getGroupCount()), + this.getTotalRowCount(this.getGroupCount()), groupByDate, ); } @@ -496,7 +496,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..ff1bcbad3fdb 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts @@ -13,7 +13,7 @@ class SchedulerTimelineDay extends SchedulerTimeline { } _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 78b3a8d04e13..f417648759b1 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts @@ -19,7 +19,7 @@ class SchedulerTimelineMonth extends SchedulerTimeline { _renderView() { super._renderView(); - this._updateScrollable(); + this.updateScrollable(); } _getElementClass() { @@ -49,7 +49,7 @@ class SchedulerTimelineMonth extends SchedulerTimeline { 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_work_week.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_work_week.ts index aa98995aa062..c354bea29526 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,7 +16,7 @@ class SchedulerTimelineWorkWeek extends SchedulerTimelineWeek { // @ts-expect-error super(...args); - this._getWeekendsCount = getWeekendsCount; + this.getWeekendsCount = getWeekendsCount; } _getElementClass() { 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 df578104a6a2..0662c5deca1d 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -353,14 +353,14 @@ 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, }; } - const groupIndex = this._getGroupIndexByGroupValues(groups); + const groupIndex = this.getGroupIndexByGroupValues(groups); return { ...selectedCell, @@ -442,13 +442,13 @@ 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(); - 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, @@ -473,7 +473,7 @@ class SchedulerWorkSpace extends Widget { focusedCellData, }); - this._processNextSelectedCell( + this.processNextSelectedCell( nextCellData, focusedCellData, isMultiSelection && isMultiSelectionAllowed, @@ -527,14 +527,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, @@ -543,18 +543,18 @@ 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; - 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, @@ -574,16 +574,16 @@ 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); } _focusInHandler(e) { const $target = $(e.target); - const $focusTarget = this._focusTarget(); + const $focusTarget = this.focusTarget(); // T1312256: On macOS, e.target can be a child element of the workspace root const isTargetInsideWorkspace = $target.is($focusTarget) || $target.closest($focusTarget).length > 0; @@ -600,7 +600,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, @@ -611,7 +611,7 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this._updateSelectedCellDataOption(this._getSelectedCellsData()); + this.updateSelectedCellDataOption(this._getSelectedCellsData()); } } @@ -627,19 +627,19 @@ class SchedulerWorkSpace extends Widget { } } - _focusTarget() { + private focusTarget() { 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'; } - _isHorizontalGroupedWorkSpace() { + isHorizontalGroupedWorkSpace() { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'horizontal'; } - _isWorkSpaceWithCount() { + protected isWorkSpaceWithCount() { return this.option('intervalCount') as any > 1; } @@ -648,7 +648,7 @@ class SchedulerWorkSpace extends Widget { } _getRealGroupOrientation() { - return this._isVerticalGroupedWorkSpace() + return this.isVerticalGroupedWorkSpace() ? 'vertical' : 'horizontal'; } @@ -658,7 +658,7 @@ class SchedulerWorkSpace extends Widget { this._$allDayTitle = $('
').appendTo(this._$headerPanelEmptyCell); } - _dateTableScrollableConfig() { + protected dateTableScrollableConfig() { let config: any = { useKeyboard: false, bounceEnabled: false, @@ -686,8 +686,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() @@ -707,7 +707,7 @@ class SchedulerWorkSpace extends Widget { return config; } - _createCrossScrollingConfig({ onScroll }): any { + private createCrossScrollingConfig({ onScroll }): any { return { direction: 'both', onScroll: (event) => { @@ -722,7 +722,7 @@ class SchedulerWorkSpace extends Widget { }; } - _headerScrollableConfig() { + protected headerScrollableConfig() { return { useKeyboard: false, showScrollbar: 'never', @@ -740,15 +740,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(); @@ -760,8 +760,8 @@ class SchedulerWorkSpace extends Widget { const minWidth = this.getWorkSpaceMinWidth(); - const groupCount = this._getGroupCount(); - const totalCellCount = this._getTotalCellCount(groupCount); + const groupCount = this.getGroupCount(); + const totalCellCount = this.getTotalCellCount(groupCount); let width = cellWidth * totalCellCount; @@ -777,9 +777,9 @@ class SchedulerWorkSpace extends Widget { this._attachHeaderTableClasses(); - this._updateGroupTableHeight(); + this.updateGroupTableHeight(); - this._updateScrollable(); + this.updateScrollable(); } getWorkSpaceMinWidth() { @@ -794,23 +794,23 @@ class SchedulerWorkSpace extends Widget { } if (this.option('crossScrollingEnabled')) { - this._setTableSizes(); + this.setTableSizes(); } this.updateHeaderEmptyCellWidth(); - this._updateScrollable(); + this.updateScrollable(); this.cache.clear(); } - _needCreateCrossScrolling() { + private needCreateCrossScrolling() { return this.option('crossScrollingEnabled'); } _getElementClass() { return noop(); } - _getRowCount() { + protected getRowCount() { return this.viewDataProvider.getRowCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -821,7 +821,7 @@ class SchedulerWorkSpace extends Widget { }); } - _getCellCount() { + getCellCount() { return this.viewDataProvider.getCellCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -836,21 +836,21 @@ 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; } - this.virtualScrollingDispatcher = new VirtualScrollingDispatcher(this._getVirtualScrollingDispatcherOptions()); + this.virtualScrollingDispatcher = new VirtualScrollingDispatcher(this.getVirtualScrollingDispatcherOptions()); this.virtualScrollingDispatcher.attachScrollableEvents(); this.renderer = new VirtualScrollingRenderer(this); } @@ -864,11 +864,11 @@ class SchedulerWorkSpace extends Widget { } generateRenderOptions(isProvideVirtualCellsWidth?: any): ViewDataProviderOptions { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); const groupOrientation = groupCount > 0 ? this.option('groupOrientation') - : this._getDefaultGroupStrategy(); + : this.getDefaultGroupStrategy(); const options = { groupByDate: this.option('groupByDate'), @@ -903,14 +903,14 @@ class SchedulerWorkSpace extends Widget { renovatedRenderSupported() { return true; } - _updateGroupTableHeight() { - if (this._isVerticalGroupedWorkSpace() && hasWindow()) { - this._setHorizontalGroupHeaderCellsHeight(); + private updateGroupTableHeight() { + if (this.isVerticalGroupedWorkSpace() && hasWindow()) { + this.setHorizontalGroupHeaderCellsHeight(); } } updateHeaderEmptyCellWidth() { - if (hasWindow() && this._isRenderHeaderPanelEmptyCell()) { + if (hasWindow() && this.isRenderHeaderPanelEmptyCell()) { const timePanelWidth = this.getTimePanelWidth(); const groupPanelWidth = this.getGroupTableWidth(); @@ -920,34 +920,34 @@ 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; } - _getGroupIndexByGroupValues(groupValues?: RawGroupValues | GroupValues) { + private getGroupIndexByGroupValues(groupValues?: RawGroupValues | GroupValues) { return groupValues && getAppointmentGroupIndex( getSafeGroupValues(groupValues), this.resourceManager.groupsLeafs, )[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, ); } @@ -955,31 +955,31 @@ class SchedulerWorkSpace extends Widget { return this.viewDataProvider.getIntervalDuration(this.option('intervalCount')); } - _getHeaderDate() { + protected getHeaderDate() { return this.getStartViewDate(); } - _calculateViewStartDate() { + private calculateViewStartDate() { return calculateViewStartDate(this.option('startDate')); } - _firstDayOfWeek() { + protected firstDayOfWeek() { return this.viewDataProvider.getFirstDayOfWeek(this.option('firstDayOfWeek')); } - _attachEvents() { - this._createSelectionChangedAction(); - this._attachClickEvent(); - this._attachContextMenuEvent(); + private attachEvents() { + this.createSelectionChangedAction(); + this.attachClickEvent(); + this.attachContextMenuEvent(); } - _attachClickEvent() { + private attachClickEvent() { const that = this; const pointerDownAction = this._createAction((e) => { - that._pointerDownHandler(e.event); + that.pointerDownHandler(e.event); }); - this._createCellClickAction(); + this.createCellClickAction(); const cellSelector = `.${DATE_TABLE_CELL_CLASS},.${ALL_DAY_TABLE_CELL_CLASS}`; const $element = this.$element(); @@ -999,25 +999,25 @@ class SchedulerWorkSpace extends Widget { }); } - _createCellClickAction() { + private createCellClickAction() { this._cellClickAction = this._createActionByOption('onCellClick', { - afterExecute: (e) => this._cellClickHandler(e.args[0].event), + afterExecute: (e) => this.cellClickHandler(e.args[0].event), }); } - _createSelectionChangedAction() { + private createSelectionChangedAction() { this._selectionChangedAction = this._createActionByOption('onSelectionChanged'); } // 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)) { @@ -1030,12 +1030,12 @@ class SchedulerWorkSpace extends Widget { this._showPopup = true; } else { const cellCoordinates = this._getCoordinatesByCell($target); - const isAllDayCell = this._hasAllDayClass($target); - this._setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target); + const isAllDayCell = this.hasAllDayClass($target); + this.setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target); } } - _handleSelectedCellsClick() { + private handleSelectedCellsClick() { const selectedCells = this._getSelectedCellsData(); const firstCellData = selectedCells[0]; @@ -1055,55 +1055,55 @@ class SchedulerWorkSpace extends Widget { (this.option('onSelectedCellsClick') as any)(result, lastCellData.groups); } - _attachContextMenuEvent() { - this._createContextMenuAction(); + private attachContextMenuEvent() { + 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()) { + private getGroupHeaderContainer() { + if (this.isVerticalGroupedWorkSpace()) { return this._$groupTable; } return this._$thead; } - _getDateHeaderContainer() { + private getDateHeaderContainer() { return this._$thead; } - _getCalculateHeaderCellRepeatCount() { + private getCalculateHeaderCellRepeatCount() { return this._groupedStrategy.calculateHeaderCellRepeatCount(); } - _updateScrollable() { + protected updateScrollable() { this._dateTableScrollable.update(); this._headerScrollable?.update(); this._sidebarScrollable?.update(); this.updateHeaderPanelScrollbarPadding(); } - _getTimePanelRowCount() { - return this._getCellCountInDay(); + protected getTimePanelRowCount() { + return this.getCellCountInDay(); } - _getCellCountInDay() { + protected getCellCountInDay() { const hoursInterval = this.option('hoursInterval'); const startDayHour = this.option('startDayHour'); const endDayHour = this.option('endDayHour'); @@ -1111,11 +1111,11 @@ class SchedulerWorkSpace extends Widget { return this.viewDataProvider.getCellCountInDay(startDayHour, endDayHour, hoursInterval); } - _getTotalCellCount(groupCount) { + protected getTotalCellCount(groupCount) { return this._groupedStrategy.getTotalCellCount(groupCount); } - _getTotalRowCount(groupCount, includeAllDayPanelRows?: any) { + protected getTotalRowCount(groupCount, includeAllDayPanelRows?: any) { let result = this._groupedStrategy.getTotalRowCount(groupCount); if (includeAllDayPanelRows && this.isAllDayPanelVisible) { @@ -1125,7 +1125,7 @@ class SchedulerWorkSpace extends Widget { return result; } - _getGroupIndex(rowIndex, columnIndex) { + private getGroupIndex(rowIndex, columnIndex) { return this._groupedStrategy.getGroupIndex(rowIndex, columnIndex); } @@ -1139,25 +1139,25 @@ class SchedulerWorkSpace extends Widget { ); } - _getGroupCount() { + getGroupCount() { return this.resourceManager.groupCount(); } - _attachTablesEvents() { + protected 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) { @@ -1172,7 +1172,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, @@ -1198,7 +1198,7 @@ class SchedulerWorkSpace extends Widget { }); } - _attachPointerEvents(element) { + private attachPointerEvents(element) { let isPointerDown = false; (eventsEngine.off as any)(element, SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME); @@ -1271,9 +1271,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, @@ -1283,25 +1283,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) { + private 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) { @@ -1315,25 +1315,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(); + private updateIndex(index) { + return index * this.getRowCount(); } getDroppableCell() { return this._getDateTables().find(`.${DATE_TABLE_DROPPABLE_CELL_CLASS}`); } - _getWorkSpaceWidth() { + protected 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; @@ -1344,7 +1344,7 @@ class SchedulerWorkSpace extends Widget { }); } - _getCellByCoordinates(cellCoordinates, groupIndex, inAllDayRow) { + private getCellByCoordinatesInternal(cellCoordinates, groupIndex, inAllDayRow) { const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow); return this._dom_getDateCell(indexes); } @@ -1363,7 +1363,7 @@ class SchedulerWorkSpace extends Widget { .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 = []; @@ -1377,7 +1377,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}`; @@ -1386,8 +1386,8 @@ class SchedulerWorkSpace extends Widget { return [$cells[0], $cells[$cells.length - 1]]; } - _getAllCells(allDay) { - if (this._isVerticalGroupedWorkSpace()) { + private getAllCells(allDay) { + if (this.isVerticalGroupedWorkSpace()) { return this._$dateTable.find(`td:not(.${VIRTUAL_CELL_CLASS})`); } @@ -1398,16 +1398,16 @@ class SchedulerWorkSpace extends Widget { return (this.$element() as any).find(`.${cellClass}`); } - _setHorizontalGroupHeaderCellsHeight() { + private 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); @@ -1427,7 +1427,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(); @@ -1483,11 +1483,11 @@ class SchedulerWorkSpace extends Widget { return undefined; } - _getVirtualRowOffset() { + private getVirtualRowOffset() { return this.virtualScrollingDispatcher.virtualRowOffset; } - _getVirtualCellOffset() { + private getVirtualCellOffset() { return this.virtualScrollingDispatcher.virtualCellOffset; } @@ -1496,7 +1496,7 @@ class SchedulerWorkSpace extends Widget { 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); @@ -1505,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 @@ -1517,12 +1517,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) { @@ -1569,7 +1569,7 @@ class SchedulerWorkSpace extends Widget { getAllDayHeight() { return getAllDayHeight( this.option('showAllDayPanel'), - this._isVerticalGroupedWorkSpace(), + this.isVerticalGroupedWorkSpace(), this.getDOMElementsMetaData(), ); } @@ -1591,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(); @@ -1656,13 +1656,13 @@ class SchedulerWorkSpace extends Widget { } 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; @@ -1681,11 +1681,11 @@ class SchedulerWorkSpace extends Widget { } needRecalculateResizableArea() { - return this._isVerticalGroupedWorkSpace() && this.getScrollable().scrollTop() !== 0; + return this.isVerticalGroupedWorkSpace() && this.getScrollable().scrollTop() !== 0; } getCellByCoordinates(coordinates, allDay) { - const $cells = this._getCells(allDay); + const $cells = this.getCells(allDay); const cellIndex = this.getCellIndexByCoordinates(coordinates, allDay); return $cells.eq(cellIndex); @@ -1721,9 +1721,9 @@ class SchedulerWorkSpace extends Widget { } needUpdateScrollPosition(date, appointmentGroupValues?: GroupValues, inAllDayRow = false) { - const cells = this._getCellsInViewport(inAllDayRow); - const groupIndex = this._isGroupsSpecified(appointmentGroupValues) - ? this._getGroupIndexByGroupValues(appointmentGroupValues) + const cells = this.getCellsInViewport(inAllDayRow); + const groupIndex = this.isGroupsSpecified(appointmentGroupValues) + ? this.getGroupIndexByGroupValues(appointmentGroupValues) : 0; const time = date.getTime(); const trimmedTime = dateUtils.trimTime(date).getTime(); @@ -1748,11 +1748,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(); @@ -1773,7 +1773,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) { @@ -1793,16 +1793,16 @@ class SchedulerWorkSpace extends Widget { } scrollTo(date: Date, groupValues?: RawGroupValues | GroupValues, allDay = false, throwWarning = true, align: 'start' | 'center' = 'center') { - if (!this._isValidScrollDate(date, throwWarning)) { + if (!this.isValidScrollDate(date, throwWarning)) { return; } - const groupIndex = this._getGroupCount() && groupValues - ? this._getGroupIndexByGroupValues(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; @@ -1824,7 +1824,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; } @@ -1837,7 +1837,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); @@ -1862,8 +1862,8 @@ class SchedulerWorkSpace extends Widget { _getCoordinatesByCell($cell) { const columnIndex = $cell.index() - this.virtualScrollingDispatcher.leftVirtualCellsCount; let rowIndex = $cell.parent().index(); - const isAllDayCell = this._hasAllDayClass($cell); - const isVerticalGrouping = this._isVerticalGroupedWorkSpace(); + const isAllDayCell = this.hasAllDayClass($cell); + const isVerticalGrouping = this.isVerticalGroupedWorkSpace(); if (!(isAllDayCell && !isVerticalGrouping)) { rowIndex -= this.virtualScrollingDispatcher.topVirtualRowsCount; @@ -1876,11 +1876,11 @@ class SchedulerWorkSpace extends Widget { 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(), @@ -1901,7 +1901,7 @@ 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 }); } @@ -1922,7 +1922,7 @@ class SchedulerWorkSpace extends Widget { return undefined; } - return allDay && !this._isVerticalGroupedWorkSpace() + return allDay && !this.isVerticalGroupedWorkSpace() ? this._dom_getAllDayPanelCell(position.columnIndex) : this._dom_getDateCell(position); } @@ -1930,8 +1930,8 @@ class SchedulerWorkSpace extends Widget { // Must replace all DOM manipulations getDOMElementsMetaData() { return this.cache.memo('cellElementsMeta', () => ({ - dateTableCellsMeta: this._getDateTableDOMElementsInfo(), - allDayPanelCellsMeta: this._getAllDayPanelDOMElementsInfo(), + dateTableCellsMeta: this.getDateTableDOMElementsInfo(), + allDayPanelCellsMeta: this.getAllDayPanelDOMElementsInfo(), })); } @@ -1948,8 +1948,8 @@ class SchedulerWorkSpace extends Widget { )); } - _getDateTableDOMElementsInfo() { - const dateTableCells = this._getAllCells(false); + private getDateTableDOMElementsInfo() { + const dateTableCells = this.getAllCells(false); if (!dateTableCells.length || !hasWindow()) { return [[{}]]; } @@ -1969,17 +1969,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); + if (this.isAllDayPanelVisible && !this.isVerticalGroupedWorkSpace() && hasWindow()) { + const allDayCells = this.getAllCells(true); if (!allDayCells.length) { return [{}]; @@ -1989,14 +1989,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({ @@ -2010,8 +2010,8 @@ class SchedulerWorkSpace extends Widget { // TODO: remove along with old render _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, @@ -2023,9 +2023,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 = { @@ -2076,7 +2076,7 @@ class SchedulerWorkSpace extends Widget { this._$dateTable, DateTableComponent, 'renovatedDateTable', - this._getRDateTableProps(), + this.getRDateTableProps(), ); } @@ -2097,7 +2097,7 @@ class SchedulerWorkSpace extends Widget { this._attachGroupCountClass(); utils.renovation.renderComponent( this, - this._getGroupHeaderContainer(), + this.getGroupHeaderContainer(), GroupPanelComponent, 'renovatedGroupPanel', options, @@ -2126,7 +2126,7 @@ class SchedulerWorkSpace extends Widget { } this._updateAllDayVisibility(); - this._updateScrollable(); + this.updateScrollable(); } renderRTimeTable() { @@ -2183,14 +2183,14 @@ class SchedulerWorkSpace extends Widget { const $rootElement = $(scheduler.element()); - this._createDragBehavior(this.getWorkArea(), $rootElement); - if (!this._isVerticalGroupedWorkSpace()) { - this._createDragBehavior(this._$allDayPanel, $rootElement); + this.createDragBehavior(this.getWorkArea(), $rootElement); + if (!this.isVerticalGroupedWorkSpace()) { + 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); @@ -2236,8 +2236,8 @@ class SchedulerWorkSpace extends Widget { // We do not need these methods in renovation // -------------- - _isRenderHeaderPanelEmptyCell() { - return this._isVerticalGroupedWorkSpace(); + private isRenderHeaderPanelEmptyCell() { + return this.isVerticalGroupedWorkSpace(); } _dispose() { @@ -2312,54 +2312,54 @@ class SchedulerWorkSpace extends Widget { case 'groups': this._cleanView(); this._removeAllDayElements(); - this._initGrouping(); + this.initGrouping(); this.repaint(); break; case 'groupOrientation': - this._initGroupedStrategy(); + this.initGroupedStrategy(); this._createAllDayPanelElements(); this._removeAllDayElements(); this._cleanWorkSpace(); - this._toggleGroupByDateClass(); + this.toggleGroupByDateClass(); break; case 'showAllDayPanel': - if (this._isVerticalGroupedWorkSpace()) { + 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(); } break; case 'allDayExpanded': this._updateAllDayExpansion(); - this._attachTablesEvents(); - this._updateScrollable(); + this.attachTablesEvents(); + 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(); - this._toggleWorkSpaceCountClass(); + this.toggleWorkSpaceCountClass(); break; case 'groupByDate': this._cleanWorkSpace(); - this._toggleGroupByDateClass(); + this.toggleGroupByDateClass(); break; case 'crossScrollingEnabled': - this._toggleHorizontalScrollClass(); - this._dateTableScrollable.option(this._dateTableScrollableConfig()); + this.toggleHorizontalScrollClass(); + this._dateTableScrollable.option(this.dateTableScrollableConfig()); break; case 'allDayPanelMode': this.updateShowAllDayPanel(); @@ -2394,7 +2394,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), @@ -2412,21 +2412,21 @@ class SchedulerWorkSpace extends Widget { createAction: this._createAction.bind(this), updateRender: this.updateRender.bind(this), 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), + getGroupCount: this.getGroupCount.bind(this), + isVerticalGrouping: this.isVerticalGroupedWorkSpace.bind(this), + getTotalRowCount: this.getTotalRowCount.bind(this), + getTotalCellCount: this.getTotalCellCount.bind(this), }; } _cleanWorkSpace() { this._cleanView(); this._toggleGroupedClass(); - this._toggleWorkSpaceWithOddCells(); + this.toggleWorkSpaceWithOddCells(); this.virtualScrollingDispatcher.updateDimensions(true); this._renderView(); - this.option('crossScrollingEnabled') && this._setTableSizes(); + this.option('crossScrollingEnabled') && this.setTableSizes(); this.cache.clear(); } @@ -2438,19 +2438,19 @@ class SchedulerWorkSpace extends Widget { // @ts-expect-error super._init(); - this._initGrouping(); + 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) .addClass(this._getElementClass()); } - _initPositionHelper() { + private initPositionHelper() { this.positionHelper = new PositionHelper({ key: this.option('key'), viewDataProvider: this.viewDataProvider, @@ -2461,28 +2461,28 @@ class SchedulerWorkSpace extends Widget { isGroupedByDate: this.isGroupedByDate(), rtlEnabled: this.option('rtlEnabled'), startViewDate: this.getStartViewDate(), - isVerticalGrouping: this._isVerticalGroupedWorkSpace(), - groupCount: this._getGroupCount(), + isVerticalGrouping: this.isVerticalGroupedWorkSpace(), + groupCount: this.getGroupCount(), isVirtualScrolling: this.isVirtualScrolling(), getDOMMetaDataCallback: this.getDOMElementsMetaData.bind(this), }); } - _initGrouping() { - this._initGroupedStrategy(); - this._toggleGroupingDirectionClass(); - this._toggleGroupByDateClass(); + private initGrouping() { + this.initGroupedStrategy(); + this.toggleGroupingDirectionClass(); + this.toggleGroupByDateClass(); } 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; @@ -2490,44 +2490,44 @@ class SchedulerWorkSpace extends Widget { this._groupedStrategy = new Strategy(this); } - _getDefaultGroupStrategy() { + private getDefaultGroupStrategy() { return 'horizontal'; } - _toggleHorizontalScrollClass() { + private 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() { - (this.$element() as any).toggleClass(WORKSPACE_WITH_COUNT_CLASS, this._isWorkSpaceWithCount()); + private toggleWorkSpaceCountClass() { + (this.$element() as any).toggleClass(WORKSPACE_WITH_COUNT_CLASS, this.isWorkSpaceWithCount()); } - _toggleWorkSpaceWithOddCells() { + private toggleWorkSpaceWithOddCells() { (this.$element() as any).toggleClass(WORKSPACE_WITH_ODD_CELLS_CLASS, this._isWorkspaceWithOddCells()); } - _toggleGroupingDirectionClass() { - (this.$element() as any).toggleClass(VERTICAL_GROUPED_WORKSPACE_CLASS, this._isVerticalGroupedWorkSpace()); + private toggleGroupingDirectionClass() { + (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 .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() { + private initWorkSpaceUnits() { this._$headerPanelContainer = $('
').addClass('dx-scheduler-header-panel-container'); this._$headerTablesContainer = $('
').addClass('dx-scheduler-header-tables-container'); this._$headerPanel = $('').attr('aria-hidden', true); @@ -2564,7 +2564,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); } @@ -2579,7 +2579,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, @@ -2633,7 +2633,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 { @@ -2646,7 +2646,7 @@ class SchedulerWorkSpace extends Widget { } _appendHeaderPanelEmptyCellIfNecessary() { - this._isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); + this.isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); } _createHeaderScrollable() { @@ -2655,7 +2655,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); } @@ -2682,8 +2682,8 @@ class SchedulerWorkSpace extends Widget { _attachTableClasses() { this._addTableClass(this._$dateTable, DATE_TABLE_CLASS); - if (this._isVerticalGroupedWorkSpace()) { - const groupCount = this._getGroupCount(); + if (this.isVerticalGroupedWorkSpace()) { + const groupCount = this.getGroupCount(); for (let i = 0; i < groupCount; i++) { this._addTableClass(this._allDayTables[i], ALL_DAY_TABLE_CLASS); @@ -2704,9 +2704,9 @@ class SchedulerWorkSpace extends Widget { _initMarkup() { this.cache.clear(); - this._initWorkSpaceUnits(); + this.initWorkSpaceUnits(); - this._initVirtualScrolling(); + this.initVirtualScrolling(); this._initDateTableScrollable(); @@ -2723,7 +2723,7 @@ class SchedulerWorkSpace extends Widget { this._toggleGroupedClass(); this._renderView(); - this._attachEvents(); + this.attachEvents(); } _render() { @@ -2734,17 +2734,17 @@ class SchedulerWorkSpace extends Widget { } _toggleGroupedClass() { - (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this._getGroupCount() > 0); + (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this.getGroupCount() > 0); } _renderView() { if (this.isRenovatedRender()) { - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } } else { this._applyCellTemplates( - this._renderGroupHeader(), + this.renderGroupHeader(), ); } @@ -2753,7 +2753,7 @@ class SchedulerWorkSpace extends Widget { this.virtualScrollingDispatcher.updateDimensions(); } - this._updateGroupTableHeight(); + this.updateGroupTableHeight(); this.updateHeaderEmptyCellWidth(); this._shader = new VerticalShader(this); @@ -2898,9 +2898,9 @@ class SchedulerWorkSpace extends Widget { // ---------------- _createAllDayPanelElements() { - const groupCount = this._getGroupCount(); + 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) @@ -2950,12 +2950,12 @@ class SchedulerWorkSpace extends Widget { this._renderAllDayPanel(); } - this._initPositionHelper(); + this.initPositionHelper(); } - _renderGroupHeader() { - const $container = this._getGroupHeaderContainer(); - const groupCount = this._getGroupCount(); + protected renderGroupHeader() { + const $container = this.getGroupHeaderContainer(); + const groupCount = this.getGroupCount(); let cellTemplates = []; if (groupCount) { const groupRows = this._makeGroupRows(this.option('groups'), this.option('groupByDate')); @@ -2976,7 +2976,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, @@ -2984,22 +2984,22 @@ 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, + this.getCellCount() || 1, this.option('resourceCellTemplate'), - this._getGroupCount(), + this.getGroupCount(), groupByDate, ); } _renderDateHeader(): any { - const container = this._getDateHeaderContainer(); + 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 repeatCount = this.getCalculateHeaderCellRepeatCount(); const templateCallbacks = []; const groupByDate = this.isGroupedByDate(); @@ -3013,7 +3013,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; @@ -3031,7 +3031,7 @@ class SchedulerWorkSpace extends Widget { _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; @@ -3061,8 +3061,8 @@ class SchedulerWorkSpace extends Widget { } _getGroupsForDateHeaderTemplate(templateIndex, indexMultiplier = 1) { - if (this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { - const groupIndex = this._getGroupIndex(0, templateIndex * indexMultiplier); + if (this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { + const groupIndex = this.getGroupIndex(0, templateIndex * indexMultiplier); const groups = getLeafGroupValues(this.resourceManager.groupsLeafs, groupIndex); return { @@ -3081,10 +3081,10 @@ class SchedulerWorkSpace extends Widget { } _renderAllDayPanel(index?: any) { - let cellCount = this._getCellCount(); + let cellCount = this.getCellCount(); - if (!this._isVerticalGroupedWorkSpace()) { - cellCount *= this._getGroupCount() || 1; + if (!this.isVerticalGroupedWorkSpace()) { + cellCount *= this.getGroupCount() || 1; } const cellTemplates = this._renderTableBody({ @@ -3100,13 +3100,13 @@ class SchedulerWorkSpace extends Widget { }, true); this._updateAllDayVisibility(); - this._updateScrollable(); + this.updateScrollable(); this._applyCellTemplates(cellTemplates); } _renderGroupAllDayPanel() { - if (this._isVerticalGroupedWorkSpace()) { - const groupCount = this._getGroupCount(); + if (this.isVerticalGroupedWorkSpace()) { + const groupCount = this.getGroupCount(); for (let i = 0; i < groupCount; i++) { this._renderAllDayPanel(i); @@ -3124,11 +3124,11 @@ class SchedulerWorkSpace extends Widget { const repeatCount = this._groupedStrategy.calculateTimeCellRepeatCount(); const getTimeCellGroups = (rowIndex) => { - if (!this._isVerticalGroupedWorkSpace()) { + if (!this.isVerticalGroupedWorkSpace()) { return {}; } - const groupIndex = this._getGroupIndex(rowIndex, 0); + const groupIndex = this.getGroupIndex(rowIndex, 0); const groups = getLeafGroupValues(this.resourceManager.groupsLeafs, groupIndex); return { groupIndex, groups }; @@ -3140,7 +3140,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; @@ -3150,14 +3150,14 @@ class SchedulerWorkSpace extends Widget { this._renderTableBody({ container: getPublicElement(this._$timePanel), - rowCount: this._getTimePanelRowCount() * repeatCount, + rowCount: this.getTimePanelRowCount() * repeatCount, cellCount: 1, 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(), + groupCount: this.getGroupCount(), allDayElements: this._insertAllDayRowsIntoDateTable() ? this._allDayTitles : undefined, getTemplateData: getTimeCellGroups.bind(this), }); @@ -3166,18 +3166,18 @@ class SchedulerWorkSpace extends Widget { _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() { - const groupCount = this._getGroupCount(); + 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 @@ -3186,7 +3186,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_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 8a4873193229..8629bab92baa 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; } @@ -253,10 +253,10 @@ 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); + const { rowIndex: currentTimeRowIndex } = this.getCellCoordinatesByIndex(index); if (currentTimeRowIndex === undefined) { return []; @@ -271,8 +271,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { : [currentTimeRowIndex, currentTimeRowIndex + 1]; } - const verticalGroupCount = this._isVerticalGroupedWorkSpace() - ? this._getGroupCount() + const verticalGroupCount = this.isVerticalGroupedWorkSpace() + ? 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 9c06047ee21b..eaf3c4e9f150 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 @@ -38,9 +38,9 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { 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, @@ -80,10 +80,10 @@ 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() { + getViewStartByOptions() { return monthUtils.getViewStartByOptions( this.option('startDate') as any, this.option('currentDate') as any, @@ -124,8 +124,8 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { return true; } - _getHeaderDate() { - return this._getViewStartByOptions(); + getHeaderDate() { + return this.getViewStartByOptions(); } renderRAllDayPanel() {} @@ -138,7 +138,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { this._$dateTable, DateTableMonthComponent, 'renovatedDateTable', - this._getRDateTableProps(), + this.getRDateTableProps(), ); } @@ -147,7 +147,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { // ------------- _createWorkSpaceElements() { - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this._createWorkSpaceScrollableElements(); } else { super._createWorkSpaceElements(); 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..d8a0aa092d1d 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 @@ -13,7 +13,7 @@ class SchedulerWorkSpaceWeek extends SchedulerWorkSpaceVertical { } _calculateViewStartDate() { - return weekUtils.calculateViewStartDate(this.option('startDate') as any, this._firstDayOfWeek()); + 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..d162101a8b6a 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,7 +14,7 @@ class SchedulerWorkSpaceWorkWeek extends SchedulerWorkSpaceWeek { // @ts-expect-error super(...args); - this._getWeekendsCount = getWeekendsCount; + this.getWeekendsCount = getWeekendsCount; } _getElementClass() { From 2f2e291a36864d53b7d70dab3c664ea245f37357 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 11:04:04 +0100 Subject: [PATCH 02/22] fix: try to fix tests --- .../scheduler/workspaces/m_agenda.ts | 2 +- .../timeline.tests.js | 2 +- .../workSpace.day.tests.js | 2 +- .../workSpace.navigation.tests.js | 18 +++++++++--------- .../workSpace.renovation.tests.js | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index ecf2796b2abe..b9ee96f364e7 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -344,7 +344,7 @@ class SchedulerAgenda extends WorkSpace { }); } - _attachTablesEvents() { return noop(); } + attachTablesEvents() { return noop(); } _attachEvents() { return noop(); } 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 4147d5951d1e..d65f86bad1d6 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 3537a5aab439..983309c0affa 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 adbcbe8130824fbf3379fee64eb0c07afce7f50c Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 11:04:04 +0100 Subject: [PATCH 03/22] fix: try to fix tests --- .../scheduler/workspaces/m_agenda.ts | 2 +- .../timeline.tests.js | 2 +- .../workSpace.day.tests.js | 2 +- .../workSpace.navigation.tests.js | 18 +++++++++--------- .../workSpace.renovation.tests.js | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index a0986d0bbe4d..223e813d144e 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -344,7 +344,7 @@ class SchedulerAgenda extends WorkSpace { }); } - _attachTablesEvents() { return noop(); } + attachTablesEvents() { return noop(); } _attachEvents() { return noop(); } 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 4147d5951d1e..d65f86bad1d6 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 3537a5aab439..983309c0affa 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 5548656ec757c5028775f6f29616f97aae9b5be4 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 11:24:33 +0100 Subject: [PATCH 04/22] Revert "fix: try to fix tests" This reverts commit 2f2e291a36864d53b7d70dab3c664ea245f37357. --- .../scheduler/workspaces/m_agenda.ts | 2 +- .../timeline.tests.js | 2 +- .../workSpace.day.tests.js | 2 +- .../workSpace.navigation.tests.js | 18 +++++++++--------- .../workSpace.renovation.tests.js | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 223e813d144e..a0986d0bbe4d 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -344,7 +344,7 @@ class SchedulerAgenda extends WorkSpace { }); } - attachTablesEvents() { return noop(); } + _attachTablesEvents() { return noop(); } _attachEvents() { return noop(); } 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 d65f86bad1d6..4147d5951d1e 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 d70c4ab0ec96..b71f19628bb1 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 c11bba1ae870..1013e3ad80fe 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 983309c0affa..3537a5aab439 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 79a2de7d631017a4b614d6d8e5d6ca7422349fe2 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 11:41:34 +0100 Subject: [PATCH 05/22] Revert "refactor: remove prefix _ in m_workspace and references" This reverts commit 95ebb9de11ae589c53968e35c3bc80fcd7933c30. --- .../js/__internal/scheduler/m_scheduler.ts | 6 +- .../js/__internal/scheduler/m_subscribes.ts | 4 +- .../shaders/current_time_shader_horizontal.ts | 10 +- .../shaders/current_time_shader_vertical.ts | 2 +- .../scheduler/workspaces/m_agenda.ts | 20 +- .../scheduler/workspaces/m_timeline.ts | 64 +- .../scheduler/workspaces/m_timeline_day.ts | 2 +- .../scheduler/workspaces/m_timeline_month.ts | 4 +- .../workspaces/m_timeline_work_week.ts | 2 +- .../scheduler/workspaces/m_work_space.ts | 546 +++++++++--------- ..._work_space_grouped_strategy_horizontal.ts | 28 +- .../m_work_space_grouped_strategy_vertical.ts | 20 +- .../workspaces/m_work_space_indicator.ts | 16 +- .../workspaces/m_work_space_month.ts | 24 +- .../scheduler/workspaces/m_work_space_week.ts | 2 +- .../workspaces/m_work_space_work_week.ts | 2 +- 16 files changed, 376 insertions(+), 376 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts index a2e260ea997c..a703f844fd73 100644 --- a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts @@ -1256,7 +1256,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()); @@ -1280,7 +1280,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { this._recalculateWorkspace(); if (currentViewOptions.startDate) { - this._updateOption('header', 'currentDate', this._workSpace.getHeaderDate()); + this._updateOption('header', 'currentDate', this._workSpace._getHeaderDate()); } } @@ -1302,7 +1302,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()); } diff --git a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts index 2b72cab32a43..5499536f3102 100644 --- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts +++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts @@ -153,7 +153,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, @@ -229,7 +229,7 @@ const subscribes = { }, getGroupCount() { - return this._workSpace.getGroupCount(); + return this._workSpace._getGroupCount(); }, mapAppointmentFields(config) { diff --git a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts index cf23ce7d170c..8936fa571ef3 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts @@ -6,8 +6,8 @@ import CurrentTimeShader from './current_time_shader'; class HorizontalCurrentTimeShader extends CurrentTimeShader { renderShader(): void { - const groupCount = this._workSpace.isHorizontalGroupedWorkSpace() - ? this._workSpace.getGroupCount() + const groupCount = this._workSpace._isHorizontalGroupedWorkSpace() + ? this._workSpace._getGroupCount() : 1; for (let i = 0; i < groupCount; i += 1) { @@ -34,7 +34,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); @@ -64,9 +64,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() + shaderLeft = workSpace.getCellWidth() * integerPart * workSpace._getGroupCount() + groupIndex * workSpace.getCellWidth(); } diff --git a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts index aa8f92796ec8..7b4eabf37712 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts @@ -24,7 +24,7 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { } setHeight(this._$shader, shaderHeight); - const groupCount = this._workSpace.getGroupCount() || 1; + const groupCount = this._workSpace._getGroupCount() || 1; if (this._workSpace.isGroupedByDate()) { this.renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index b9ee96f364e7..223e813d144e 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -112,7 +112,7 @@ class SchedulerAgenda extends WorkSpace { return false; } - isVerticalGroupedWorkSpace() { + _isVerticalGroupedWorkSpace() { return false; } @@ -120,15 +120,15 @@ class SchedulerAgenda extends WorkSpace { return AGENDA_CLASS; } - getRowCount() { + _getRowCount() { return this.option('agendaDuration') as number; } - getCellCount() { + _getCellCount() { return 1; } - getTimePanelRowCount() { + _getTimePanelRowCount() { return this.option('agendaDuration') as number; } @@ -169,7 +169,7 @@ class SchedulerAgenda extends WorkSpace { this._rows = rows; if (this._$groupTable) { - cellTemplates = this.renderGroupHeader(); + cellTemplates = this._renderGroupHeader(); this._setGroupHeaderCellsHeight(); } @@ -186,7 +186,7 @@ class SchedulerAgenda extends WorkSpace { this._dateTableScrollable.$content().append(this._$noDataContainer); } - setTableSizes() { return noop(); } + _setTableSizes() { return noop(); } _toggleHorizontalScrollClass() { return noop(); } @@ -194,7 +194,7 @@ class SchedulerAgenda extends WorkSpace { _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) { @@ -265,7 +265,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; @@ -340,7 +340,7 @@ class SchedulerAgenda extends WorkSpace { this._renderTableBody({ container: getPublicElement(this._$dateTable), rowClass: DATE_TABLE_ROW_CLASS, - cellClass: this.getDateTableCellClass(), + cellClass: this._getDateTableCellClass(), }); } @@ -435,7 +435,7 @@ class SchedulerAgenda extends WorkSpace { _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 86a234125030..d6fa88fbfd59 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -48,11 +48,11 @@ 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 { @@ -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, }; @@ -80,8 +80,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { 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,9 +186,9 @@ class SchedulerTimeline extends SchedulerWorkSpace { return minHeight; } - getCellCoordinatesByIndex(index) { + _getCellCoordinatesByIndex(index) { return { - columnIndex: index % this.getCellCount(), + columnIndex: index % this._getCellCount(), rowIndex: 0, }; } @@ -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'); @@ -313,7 +313,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() { @@ -337,7 +337,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { _renderView() { let groupCellTemplates; if (!this.isRenovatedRender()) { - groupCellTemplates = this.renderGroupHeader(); + groupCellTemplates = this._renderGroupHeader(); } this.renderWorkSpace(); @@ -350,7 +350,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { this._$sidebarTable.appendTo(this._sidebarScrollable.$content()); - if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) { + if (this.isRenovatedRender() && this._isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } @@ -361,23 +361,23 @@ class SchedulerTimeline extends SchedulerWorkSpace { _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)] @@ -401,14 +401,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); @@ -464,7 +464,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); @@ -482,12 +482,12 @@ 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, + this._getCellCount() || 1, this.option('resourceCellTemplate'), - this.getTotalRowCount(this.getGroupCount()), + this._getTotalRowCount(this._getGroupCount()), groupByDate, ); } @@ -496,7 +496,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 ff1bcbad3fdb..6bfe83908d05 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_day.ts @@ -13,7 +13,7 @@ class SchedulerTimelineDay extends SchedulerTimeline { } _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 f417648759b1..78b3a8d04e13 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts @@ -19,7 +19,7 @@ class SchedulerTimelineMonth extends SchedulerTimeline { _renderView() { super._renderView(); - this.updateScrollable(); + this._updateScrollable(); } _getElementClass() { @@ -49,7 +49,7 @@ class SchedulerTimelineMonth extends SchedulerTimeline { 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_work_week.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_work_week.ts index c354bea29526..aa98995aa062 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,7 +16,7 @@ class SchedulerTimelineWorkWeek extends SchedulerTimelineWeek { // @ts-expect-error super(...args); - this.getWeekendsCount = getWeekendsCount; + this._getWeekendsCount = getWeekendsCount; } _getElementClass() { 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 0662c5deca1d..df578104a6a2 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -353,14 +353,14 @@ 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, }; } - const groupIndex = this.getGroupIndexByGroupValues(groups); + const groupIndex = this._getGroupIndexByGroupValues(groups); return { ...selectedCell, @@ -442,13 +442,13 @@ 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(); - 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, @@ -473,7 +473,7 @@ class SchedulerWorkSpace extends Widget { focusedCellData, }); - this.processNextSelectedCell( + this._processNextSelectedCell( nextCellData, focusedCellData, isMultiSelection && isMultiSelectionAllowed, @@ -527,14 +527,14 @@ class SchedulerWorkSpace extends Widget { isVirtualCell: $cell.hasClass(VIRTUAL_CELL_CLASS), }); - this.processNextSelectedCell( + this._processNextSelectedCell( nextFocusedCellData, focusedCellData, isMultiSelectionAllowed && isMultiSelection, ); } - private processNextSelectedCell(nextCellData, focusedCellData, isMultiSelection) { + _processNextSelectedCell(nextCellData, focusedCellData, isMultiSelection) { const nextCellPosition = this.viewDataProvider.findCellPositionInMap({ startDate: nextCellData.startDate, groupIndex: nextCellData.groupIndex, @@ -543,18 +543,18 @@ 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; - this.setSelectedCellsStateAndUpdateSelection(isNextCellAllDay, nextCellPosition, isMultiSelection, $cell); + this._setSelectedCellsStateAndUpdateSelection(isNextCellAllDay, nextCellPosition, isMultiSelection, $cell); this._dateTableScrollable.scrollToElement($cell); } } - private setSelectedCellsStateAndUpdateSelection(isAllDay, cellPosition, isMultiSelection, $nextFocusedCell) { + _setSelectedCellsStateAndUpdateSelection(isAllDay, cellPosition, isMultiSelection, $nextFocusedCell) { const nextCellCoordinates = { rowIndex: cellPosition.rowIndex, columnIndex: cellPosition.columnIndex, @@ -574,16 +574,16 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this.updateSelectedCellDataOption(this._getSelectedCellsData(), $nextFocusedCell); + this._updateSelectedCellDataOption(this._getSelectedCellsData(), $nextFocusedCell); } - private hasAllDayClass($cell) { + _hasAllDayClass($cell) { return $cell.hasClass(ALL_DAY_TABLE_CELL_CLASS); } _focusInHandler(e) { const $target = $(e.target); - const $focusTarget = this.focusTarget(); + const $focusTarget = this._focusTarget(); // T1312256: On macOS, e.target can be a child element of the workspace root const isTargetInsideWorkspace = $target.is($focusTarget) || $target.closest($focusTarget).length > 0; @@ -600,7 +600,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, @@ -611,7 +611,7 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this.updateSelectedCellDataOption(this._getSelectedCellsData()); + this._updateSelectedCellDataOption(this._getSelectedCellsData()); } } @@ -627,19 +627,19 @@ class SchedulerWorkSpace extends Widget { } } - private focusTarget() { + _focusTarget() { return this.$element(); } - protected isVerticalGroupedWorkSpace() { // TODO move to the Model + _isVerticalGroupedWorkSpace() { // TODO move to the Model return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'vertical'; } - isHorizontalGroupedWorkSpace() { + _isHorizontalGroupedWorkSpace() { return Boolean(this.option('groups')?.length) && this.option('groupOrientation') === 'horizontal'; } - protected isWorkSpaceWithCount() { + _isWorkSpaceWithCount() { return this.option('intervalCount') as any > 1; } @@ -648,7 +648,7 @@ class SchedulerWorkSpace extends Widget { } _getRealGroupOrientation() { - return this.isVerticalGroupedWorkSpace() + return this._isVerticalGroupedWorkSpace() ? 'vertical' : 'horizontal'; } @@ -658,7 +658,7 @@ class SchedulerWorkSpace extends Widget { this._$allDayTitle = $('
').appendTo(this._$headerPanelEmptyCell); } - protected dateTableScrollableConfig() { + _dateTableScrollableConfig() { let config: any = { useKeyboard: false, bounceEnabled: false, @@ -686,8 +686,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() @@ -707,7 +707,7 @@ class SchedulerWorkSpace extends Widget { return config; } - private createCrossScrollingConfig({ onScroll }): any { + _createCrossScrollingConfig({ onScroll }): any { return { direction: 'both', onScroll: (event) => { @@ -722,7 +722,7 @@ class SchedulerWorkSpace extends Widget { }; } - protected headerScrollableConfig() { + _headerScrollableConfig() { return { useKeyboard: false, showScrollbar: 'never', @@ -740,15 +740,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(); } } - protected setTableSizes() { + _setTableSizes() { this.cache.clear(); this._attachTableClasses(); @@ -760,8 +760,8 @@ class SchedulerWorkSpace extends Widget { const minWidth = this.getWorkSpaceMinWidth(); - const groupCount = this.getGroupCount(); - const totalCellCount = this.getTotalCellCount(groupCount); + const groupCount = this._getGroupCount(); + const totalCellCount = this._getTotalCellCount(groupCount); let width = cellWidth * totalCellCount; @@ -777,9 +777,9 @@ class SchedulerWorkSpace extends Widget { this._attachHeaderTableClasses(); - this.updateGroupTableHeight(); + this._updateGroupTableHeight(); - this.updateScrollable(); + this._updateScrollable(); } getWorkSpaceMinWidth() { @@ -794,23 +794,23 @@ class SchedulerWorkSpace extends Widget { } if (this.option('crossScrollingEnabled')) { - this.setTableSizes(); + this._setTableSizes(); } this.updateHeaderEmptyCellWidth(); - this.updateScrollable(); + this._updateScrollable(); this.cache.clear(); } - private needCreateCrossScrolling() { + _needCreateCrossScrolling() { return this.option('crossScrollingEnabled'); } _getElementClass() { return noop(); } - protected getRowCount() { + _getRowCount() { return this.viewDataProvider.getRowCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -821,7 +821,7 @@ class SchedulerWorkSpace extends Widget { }); } - getCellCount() { + _getCellCount() { return this.viewDataProvider.getCellCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -836,21 +836,21 @@ class SchedulerWorkSpace extends Widget { return this.renovatedRenderSupported() && this.option('renovateRender'); } - private isVirtualModeOn() { + _isVirtualModeOn() { return this.option('scrolling.mode') === 'virtual'; } isVirtualScrolling() { - return this.isRenovatedRender() && this.isVirtualModeOn(); + return this.isRenovatedRender() && this._isVirtualModeOn(); } - private initVirtualScrolling() { + _initVirtualScrolling() { if (this.virtualScrollingDispatcher) { this.virtualScrollingDispatcher.dispose(); this.virtualScrollingDispatcher = null; } - this.virtualScrollingDispatcher = new VirtualScrollingDispatcher(this.getVirtualScrollingDispatcherOptions()); + this.virtualScrollingDispatcher = new VirtualScrollingDispatcher(this._getVirtualScrollingDispatcherOptions()); this.virtualScrollingDispatcher.attachScrollableEvents(); this.renderer = new VirtualScrollingRenderer(this); } @@ -864,11 +864,11 @@ class SchedulerWorkSpace extends Widget { } generateRenderOptions(isProvideVirtualCellsWidth?: any): ViewDataProviderOptions { - const groupCount = this.getGroupCount(); + const groupCount = this._getGroupCount(); const groupOrientation = groupCount > 0 ? this.option('groupOrientation') - : this.getDefaultGroupStrategy(); + : this._getDefaultGroupStrategy(); const options = { groupByDate: this.option('groupByDate'), @@ -903,14 +903,14 @@ class SchedulerWorkSpace extends Widget { renovatedRenderSupported() { return true; } - private updateGroupTableHeight() { - if (this.isVerticalGroupedWorkSpace() && hasWindow()) { - this.setHorizontalGroupHeaderCellsHeight(); + _updateGroupTableHeight() { + if (this._isVerticalGroupedWorkSpace() && hasWindow()) { + this._setHorizontalGroupHeaderCellsHeight(); } } updateHeaderEmptyCellWidth() { - if (hasWindow() && this.isRenderHeaderPanelEmptyCell()) { + if (hasWindow() && this._isRenderHeaderPanelEmptyCell()) { const timePanelWidth = this.getTimePanelWidth(); const groupPanelWidth = this.getGroupTableWidth(); @@ -920,34 +920,34 @@ class SchedulerWorkSpace extends Widget { updateHeaderPanelScrollbarPadding() { if (hasWindow() && this._$headerPanelContainer) { - const scrollbarWidth = this.getScrollbarWidth(); + const scrollbarWidth = this._getScrollbarWidth(); this._$headerPanelContainer.css('paddingRight', `${scrollbarWidth}px`); } } - private getScrollbarWidth() { + _getScrollbarWidth() { const containerElement = $(this._dateTableScrollable.container()).get(0) as HTMLElement; const scrollbarWidth = containerElement.offsetWidth - containerElement.clientWidth; return scrollbarWidth; } - private isGroupsSpecified(groupValues?: GroupValues) { + _isGroupsSpecified(groupValues?: GroupValues) { return this.option('groups')?.length && groupValues; } - private getGroupIndexByGroupValues(groupValues?: RawGroupValues | GroupValues) { + _getGroupIndexByGroupValues(groupValues?: RawGroupValues | GroupValues) { return groupValues && getAppointmentGroupIndex( getSafeGroupValues(groupValues), this.resourceManager.groupsLeafs, )[0]; } - protected getViewStartByOptions() { + _getViewStartByOptions() { return getViewStartByOptions( this.option('startDate'), this.option('currentDate'), this._getIntervalDuration(), - this.option('startDate') ? this.calculateViewStartDate() : undefined, + this.option('startDate') ? this._calculateViewStartDate() : undefined, ); } @@ -955,31 +955,31 @@ class SchedulerWorkSpace extends Widget { return this.viewDataProvider.getIntervalDuration(this.option('intervalCount')); } - protected getHeaderDate() { + _getHeaderDate() { return this.getStartViewDate(); } - private calculateViewStartDate() { + _calculateViewStartDate() { return calculateViewStartDate(this.option('startDate')); } - protected firstDayOfWeek() { + _firstDayOfWeek() { return this.viewDataProvider.getFirstDayOfWeek(this.option('firstDayOfWeek')); } - private attachEvents() { - this.createSelectionChangedAction(); - this.attachClickEvent(); - this.attachContextMenuEvent(); + _attachEvents() { + this._createSelectionChangedAction(); + this._attachClickEvent(); + this._attachContextMenuEvent(); } - private attachClickEvent() { + _attachClickEvent() { const that = this; const pointerDownAction = this._createAction((e) => { - that.pointerDownHandler(e.event); + that._pointerDownHandler(e.event); }); - this.createCellClickAction(); + this._createCellClickAction(); const cellSelector = `.${DATE_TABLE_CELL_CLASS},.${ALL_DAY_TABLE_CELL_CLASS}`; const $element = this.$element(); @@ -999,25 +999,25 @@ class SchedulerWorkSpace extends Widget { }); } - private createCellClickAction() { + _createCellClickAction() { this._cellClickAction = this._createActionByOption('onCellClick', { - afterExecute: (e) => this.cellClickHandler(e.args[0].event), + afterExecute: (e) => this._cellClickHandler(e.args[0].event), }); } - private createSelectionChangedAction() { + _createSelectionChangedAction() { this._selectionChangedAction = this._createActionByOption('onSelectionChanged'); } // eslint-disable-next-line @typescript-eslint/no-unused-vars - private cellClickHandler(argument?: any) { + _cellClickHandler(argument?: any) { if (this._showPopup) { delete this._showPopup; - this.handleSelectedCellsClick(); + this._handleSelectedCellsClick(); } } - private pointerDownHandler(e) { + _pointerDownHandler(e) { const $target = $(e.target); if (!$target.hasClass(DATE_TABLE_CELL_CLASS) && !$target.hasClass(ALL_DAY_TABLE_CELL_CLASS)) { @@ -1030,12 +1030,12 @@ class SchedulerWorkSpace extends Widget { this._showPopup = true; } else { const cellCoordinates = this._getCoordinatesByCell($target); - const isAllDayCell = this.hasAllDayClass($target); - this.setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target); + const isAllDayCell = this._hasAllDayClass($target); + this._setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target); } } - private handleSelectedCellsClick() { + _handleSelectedCellsClick() { const selectedCells = this._getSelectedCellsData(); const firstCellData = selectedCells[0]; @@ -1055,55 +1055,55 @@ class SchedulerWorkSpace extends Widget { (this.option('onSelectedCellsClick') as any)(result, lastCellData.groups); } - private attachContextMenuEvent() { - this.createContextMenuAction(); + _attachContextMenuEvent() { + 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)); } - private contextMenuHandler(e) { + _contextMenuHandler(e) { const $cell = $(e.target); this._contextMenuAction({ event: e, cellElement: getPublicElement($cell), cellData: this.getCellData($cell) }); this._contextMenuHandled = true; } - private createContextMenuAction() { + _createContextMenuAction() { this._contextMenuAction = this._createActionByOption('onCellContextMenu'); } - private getGroupHeaderContainer() { - if (this.isVerticalGroupedWorkSpace()) { + _getGroupHeaderContainer() { + if (this._isVerticalGroupedWorkSpace()) { return this._$groupTable; } return this._$thead; } - private getDateHeaderContainer() { + _getDateHeaderContainer() { return this._$thead; } - private getCalculateHeaderCellRepeatCount() { + _getCalculateHeaderCellRepeatCount() { return this._groupedStrategy.calculateHeaderCellRepeatCount(); } - protected updateScrollable() { + _updateScrollable() { this._dateTableScrollable.update(); this._headerScrollable?.update(); this._sidebarScrollable?.update(); this.updateHeaderPanelScrollbarPadding(); } - protected getTimePanelRowCount() { - return this.getCellCountInDay(); + _getTimePanelRowCount() { + return this._getCellCountInDay(); } - protected getCellCountInDay() { + _getCellCountInDay() { const hoursInterval = this.option('hoursInterval'); const startDayHour = this.option('startDayHour'); const endDayHour = this.option('endDayHour'); @@ -1111,11 +1111,11 @@ class SchedulerWorkSpace extends Widget { return this.viewDataProvider.getCellCountInDay(startDayHour, endDayHour, hoursInterval); } - protected getTotalCellCount(groupCount) { + _getTotalCellCount(groupCount) { return this._groupedStrategy.getTotalCellCount(groupCount); } - protected getTotalRowCount(groupCount, includeAllDayPanelRows?: any) { + _getTotalRowCount(groupCount, includeAllDayPanelRows?: any) { let result = this._groupedStrategy.getTotalRowCount(groupCount); if (includeAllDayPanelRows && this.isAllDayPanelVisible) { @@ -1125,7 +1125,7 @@ class SchedulerWorkSpace extends Widget { return result; } - private getGroupIndex(rowIndex, columnIndex) { + _getGroupIndex(rowIndex, columnIndex) { return this._groupedStrategy.getGroupIndex(rowIndex, columnIndex); } @@ -1139,25 +1139,25 @@ class SchedulerWorkSpace extends Widget { ); } - getGroupCount() { + _getGroupCount() { return this.resourceManager.groupCount(); } - protected attachTablesEvents() { + _attachTablesEvents() { const element = this.$element(); - this.attachDragEvents(element); - this.attachPointerEvents(element); + this._attachDragEvents(element); + this._attachPointerEvents(element); } - private detachDragEvents(element) { + _detachDragEvents(element) { (eventsEngine.off as any)(element, DragEventNames.ENTER); (eventsEngine.off as any)(element, DragEventNames.LEAVE); (eventsEngine.off as any)(element, DragEventNames.DROP); } - private attachDragEvents(element) { - this.detachDragEvents(element); + _attachDragEvents(element) { + this._detachDragEvents(element); const onDragEnter = (e) => { if (!this.preventDefaultDragging) { @@ -1172,7 +1172,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, @@ -1198,7 +1198,7 @@ class SchedulerWorkSpace extends Widget { }); } - private attachPointerEvents(element) { + _attachPointerEvents(element) { let isPointerDown = false; (eventsEngine.off as any)(element, SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME); @@ -1271,9 +1271,9 @@ class SchedulerWorkSpace extends Widget { return this._groupedStrategy.getLeftOffset(); } - protected getCellCoordinatesByIndex(index) { - const columnIndex = Math.floor(index / this.getRowCount()); - const rowIndex = index - this.getRowCount() * columnIndex; + _getCellCoordinatesByIndex(index) { + const columnIndex = Math.floor(index / this._getRowCount()); + const rowIndex = index - this._getRowCount() * columnIndex; return { columnIndex, @@ -1283,25 +1283,25 @@ class SchedulerWorkSpace extends Widget { // TODO: necessary for old render // eslint-disable-next-line @typescript-eslint/no-unused-vars - protected getDateGenerationOptions(isOldRender = false) { + _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 - private getIntervalBetween(currentDate, allDay) { + _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) { @@ -1315,25 +1315,25 @@ class SchedulerWorkSpace extends Widget { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - protected getWeekendsCount(argument?: any) { + _getWeekendsCount(argument?: any) { return 0; } - private getDaysOfInterval(fullInterval, startDayTime) { + _getDaysOfInterval(fullInterval, startDayTime) { return Math.floor((fullInterval + startDayTime) / DAY_MS); } - private updateIndex(index) { - return index * this.getRowCount(); + _updateIndex(index) { + return index * this._getRowCount(); } getDroppableCell() { return this._getDateTables().find(`.${DATE_TABLE_DROPPABLE_CELL_CLASS}`); } - protected 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; @@ -1344,7 +1344,7 @@ class SchedulerWorkSpace extends Widget { }); } - private getCellByCoordinatesInternal(cellCoordinates, groupIndex, inAllDayRow) { + _getCellByCoordinates(cellCoordinates, groupIndex, inAllDayRow) { const indexes = this._groupedStrategy.prepareCellIndexes(cellCoordinates, groupIndex, inAllDayRow); return this._dom_getDateCell(indexes); } @@ -1363,7 +1363,7 @@ class SchedulerWorkSpace extends Widget { .find('td').eq(columnIndex); } - protected getCells(allDay?: any, direction?: any) { + _getCells(allDay?: any, direction?: any) { const cellClass = allDay ? ALL_DAY_TABLE_CELL_CLASS : DATE_TABLE_CELL_CLASS; if (direction === 'vertical') { let result: any = []; @@ -1377,7 +1377,7 @@ class SchedulerWorkSpace extends Widget { return (this.$element() as any).find(`.${cellClass}`); } - private getFirstAndLastDataTableCell() { + _getFirstAndLastDataTableCell() { const selector = this.isVirtualScrolling() ? `.${DATE_TABLE_CELL_CLASS}, .${VIRTUAL_CELL_CLASS}` : `.${DATE_TABLE_CELL_CLASS}`; @@ -1386,8 +1386,8 @@ class SchedulerWorkSpace extends Widget { return [$cells[0], $cells[$cells.length - 1]]; } - private getAllCells(allDay) { - if (this.isVerticalGroupedWorkSpace()) { + _getAllCells(allDay) { + if (this._isVerticalGroupedWorkSpace()) { return this._$dateTable.find(`td:not(.${VIRTUAL_CELL_CLASS})`); } @@ -1398,16 +1398,16 @@ class SchedulerWorkSpace extends Widget { return (this.$element() as any).find(`.${cellClass}`); } - private setHorizontalGroupHeaderCellsHeight() { + _setHorizontalGroupHeaderCellsHeight() { const { height } = getBoundingRect(this._$dateTable.get(0)); setOuterHeight(this._$groupTable, height); } - protected getGroupHeaderCells() { + _getGroupHeaderCells() { return (this.$element() as any).find(`.${GROUP_HEADER_CLASS}`); } - private getScrollCoordinates(date, groupIndex?: any, allDay?: any) { + _getScrollCoordinates(date, groupIndex?: any, allDay?: any) { const currentDate = date || new Date(this.option('currentDate')); const cell = this.viewDataProvider.findGlobalCellPosition(currentDate, groupIndex, allDay, true); @@ -1427,7 +1427,7 @@ class SchedulerWorkSpace extends Widget { ); } - private isOutsideScrollable(target, event) { + _isOutsideScrollable(target, event) { const $dateTableScrollableElement = this._dateTableScrollable.$element(); const scrollableSize = getBoundingRect($dateTableScrollableElement.get(0)); const window = getWindow(); @@ -1483,11 +1483,11 @@ class SchedulerWorkSpace extends Widget { return undefined; } - private getVirtualRowOffset() { + _getVirtualRowOffset() { return this.virtualScrollingDispatcher.virtualRowOffset; } - private getVirtualCellOffset() { + _getVirtualCellOffset() { return this.virtualScrollingDispatcher.virtualCellOffset; } @@ -1496,7 +1496,7 @@ class SchedulerWorkSpace extends Widget { 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); @@ -1505,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 @@ -1517,12 +1517,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) { @@ -1569,7 +1569,7 @@ class SchedulerWorkSpace extends Widget { getAllDayHeight() { return getAllDayHeight( this.option('showAllDayPanel'), - this.isVerticalGroupedWorkSpace(), + this._isVerticalGroupedWorkSpace(), this.getDOMElementsMetaData(), ); } @@ -1591,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(); @@ -1656,13 +1656,13 @@ class SchedulerWorkSpace extends Widget { } 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; @@ -1681,11 +1681,11 @@ class SchedulerWorkSpace extends Widget { } needRecalculateResizableArea() { - return this.isVerticalGroupedWorkSpace() && this.getScrollable().scrollTop() !== 0; + return this._isVerticalGroupedWorkSpace() && this.getScrollable().scrollTop() !== 0; } getCellByCoordinates(coordinates, allDay) { - const $cells = this.getCells(allDay); + const $cells = this._getCells(allDay); const cellIndex = this.getCellIndexByCoordinates(coordinates, allDay); return $cells.eq(cellIndex); @@ -1721,9 +1721,9 @@ class SchedulerWorkSpace extends Widget { } needUpdateScrollPosition(date, appointmentGroupValues?: GroupValues, inAllDayRow = false) { - const cells = this.getCellsInViewport(inAllDayRow); - const groupIndex = this.isGroupsSpecified(appointmentGroupValues) - ? this.getGroupIndexByGroupValues(appointmentGroupValues) + const cells = this._getCellsInViewport(inAllDayRow); + const groupIndex = this._isGroupsSpecified(appointmentGroupValues) + ? this._getGroupIndexByGroupValues(appointmentGroupValues) : 0; const time = date.getTime(); const trimmedTime = dateUtils.trimTime(date).getTime(); @@ -1748,11 +1748,11 @@ class SchedulerWorkSpace extends Widget { }, true); } - private getCellsInViewport(inAllDayRow) { + _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(); @@ -1773,7 +1773,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) { @@ -1793,16 +1793,16 @@ class SchedulerWorkSpace extends Widget { } scrollTo(date: Date, groupValues?: RawGroupValues | GroupValues, allDay = false, throwWarning = true, align: 'start' | 'center' = 'center') { - if (!this.isValidScrollDate(date, throwWarning)) { + if (!this._isValidScrollDate(date, throwWarning)) { return; } - const groupIndex = this.getGroupCount() && groupValues - ? this.getGroupIndexByGroupValues(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; @@ -1824,7 +1824,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; } @@ -1837,7 +1837,7 @@ class SchedulerWorkSpace extends Widget { } } - private isValidScrollDate(date, throwWarning = true) { + _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); @@ -1862,8 +1862,8 @@ class SchedulerWorkSpace extends Widget { _getCoordinatesByCell($cell) { const columnIndex = $cell.index() - this.virtualScrollingDispatcher.leftVirtualCellsCount; let rowIndex = $cell.parent().index(); - const isAllDayCell = this.hasAllDayClass($cell); - const isVerticalGrouping = this.isVerticalGroupedWorkSpace(); + const isAllDayCell = this._hasAllDayClass($cell); + const isVerticalGrouping = this._isVerticalGroupedWorkSpace(); if (!(isAllDayCell && !isVerticalGrouping)) { rowIndex -= this.virtualScrollingDispatcher.topVirtualRowsCount; @@ -1876,11 +1876,11 @@ class SchedulerWorkSpace extends Widget { return this.option('showAllDayPanel'); } - protected getTimePanelCells() { + _getTimePanelCells() { return (this.$element() as any).find(`.${TIME_PANEL_CELL_CLASS}`); } - protected getRDateTableProps() { + _getRDateTableProps() { return { viewData: this.viewDataProvider.viewData, viewContext: this.getR1ComponentsViewContext(), @@ -1901,7 +1901,7 @@ class SchedulerWorkSpace extends Widget { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - private updateSelectedCellDataOption(selectedCellData, $nextFocusedCell?: any) { + _updateSelectedCellDataOption(selectedCellData, $nextFocusedCell?: any) { this.option('selectedCellData', selectedCellData); this._selectionChangedAction({ selectedCellData }); } @@ -1922,7 +1922,7 @@ class SchedulerWorkSpace extends Widget { return undefined; } - return allDay && !this.isVerticalGroupedWorkSpace() + return allDay && !this._isVerticalGroupedWorkSpace() ? this._dom_getAllDayPanelCell(position.columnIndex) : this._dom_getDateCell(position); } @@ -1930,8 +1930,8 @@ class SchedulerWorkSpace extends Widget { // Must replace all DOM manipulations getDOMElementsMetaData() { return this.cache.memo('cellElementsMeta', () => ({ - dateTableCellsMeta: this.getDateTableDOMElementsInfo(), - allDayPanelCellsMeta: this.getAllDayPanelDOMElementsInfo(), + dateTableCellsMeta: this._getDateTableDOMElementsInfo(), + allDayPanelCellsMeta: this._getAllDayPanelDOMElementsInfo(), })); } @@ -1948,8 +1948,8 @@ class SchedulerWorkSpace extends Widget { )); } - private getDateTableDOMElementsInfo() { - const dateTableCells = this.getAllCells(false); + _getDateTableDOMElementsInfo() { + const dateTableCells = this._getAllCells(false); if (!dateTableCells.length || !hasWindow()) { return [[{}]]; } @@ -1969,17 +1969,17 @@ class SchedulerWorkSpace extends Widget { result.push([]); } - this.addCellMetaData(result[rowIndex], cell, dateTableRect); + this._addCellMetaData(result[rowIndex], cell, dateTableRect); }); return result; } - private getAllDayPanelDOMElementsInfo() { + _getAllDayPanelDOMElementsInfo() { const result = []; - if (this.isAllDayPanelVisible && !this.isVerticalGroupedWorkSpace() && hasWindow()) { - const allDayCells = this.getAllCells(true); + if (this.isAllDayPanelVisible && !this._isVerticalGroupedWorkSpace() && hasWindow()) { + const allDayCells = this._getAllCells(true); if (!allDayCells.length) { return [{}]; @@ -1989,14 +1989,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; } - private addCellMetaData(cellMetaDataArray, cell, parentRect) { + _addCellMetaData(cellMetaDataArray, cell, parentRect) { const cellRect = getBoundingRect(cell); cellMetaDataArray.push({ @@ -2010,8 +2010,8 @@ class SchedulerWorkSpace extends Widget { // TODO: remove along with old render _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, @@ -2023,9 +2023,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 = { @@ -2076,7 +2076,7 @@ class SchedulerWorkSpace extends Widget { this._$dateTable, DateTableComponent, 'renovatedDateTable', - this.getRDateTableProps(), + this._getRDateTableProps(), ); } @@ -2097,7 +2097,7 @@ class SchedulerWorkSpace extends Widget { this._attachGroupCountClass(); utils.renovation.renderComponent( this, - this.getGroupHeaderContainer(), + this._getGroupHeaderContainer(), GroupPanelComponent, 'renovatedGroupPanel', options, @@ -2126,7 +2126,7 @@ class SchedulerWorkSpace extends Widget { } this._updateAllDayVisibility(); - this.updateScrollable(); + this._updateScrollable(); } renderRTimeTable() { @@ -2183,14 +2183,14 @@ class SchedulerWorkSpace extends Widget { const $rootElement = $(scheduler.element()); - this.createDragBehavior(this.getWorkArea(), $rootElement); - if (!this.isVerticalGroupedWorkSpace()) { - this.createDragBehavior(this._$allDayPanel, $rootElement); + this._createDragBehavior(this.getWorkArea(), $rootElement); + if (!this._isVerticalGroupedWorkSpace()) { + this._createDragBehavior(this._$allDayPanel, $rootElement); } } } - private createDragBehavior($targetElement, $rootElement) { + _createDragBehavior($targetElement, $rootElement) { const getItemData = (itemElement, appointments) => appointments._getItemData(itemElement); const getItemSettings = ($itemElement) => $itemElement.data(APPOINTMENT_SETTINGS_KEY); @@ -2236,8 +2236,8 @@ class SchedulerWorkSpace extends Widget { // We do not need these methods in renovation // -------------- - private isRenderHeaderPanelEmptyCell() { - return this.isVerticalGroupedWorkSpace(); + _isRenderHeaderPanelEmptyCell() { + return this._isVerticalGroupedWorkSpace(); } _dispose() { @@ -2312,54 +2312,54 @@ class SchedulerWorkSpace extends Widget { case 'groups': this._cleanView(); this._removeAllDayElements(); - this.initGrouping(); + this._initGrouping(); this.repaint(); break; case 'groupOrientation': - this.initGroupedStrategy(); + this._initGroupedStrategy(); this._createAllDayPanelElements(); this._removeAllDayElements(); this._cleanWorkSpace(); - this.toggleGroupByDateClass(); + this._toggleGroupByDateClass(); break; case 'showAllDayPanel': - if (this.isVerticalGroupedWorkSpace()) { + 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(); } break; case 'allDayExpanded': this._updateAllDayExpansion(); - this.attachTablesEvents(); - this.updateScrollable(); + this._attachTablesEvents(); + 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(); - this.toggleWorkSpaceCountClass(); + this._toggleWorkSpaceCountClass(); break; case 'groupByDate': this._cleanWorkSpace(); - this.toggleGroupByDateClass(); + this._toggleGroupByDateClass(); break; case 'crossScrollingEnabled': - this.toggleHorizontalScrollClass(); - this._dateTableScrollable.option(this.dateTableScrollableConfig()); + this._toggleHorizontalScrollClass(); + this._dateTableScrollable.option(this._dateTableScrollableConfig()); break; case 'allDayPanelMode': this.updateShowAllDayPanel(); @@ -2394,7 +2394,7 @@ class SchedulerWorkSpace extends Widget { (this.option('onShowAllDayPanel') as any)(!isHiddenAllDayPanel); } - private getVirtualScrollingDispatcherOptions() { + _getVirtualScrollingDispatcherOptions() { return { getCellHeight: this.getCellHeight.bind(this), getCellWidth: this.getCellWidth.bind(this), @@ -2412,21 +2412,21 @@ class SchedulerWorkSpace extends Widget { createAction: this._createAction.bind(this), updateRender: this.updateRender.bind(this), 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), + getGroupCount: this._getGroupCount.bind(this), + isVerticalGrouping: this._isVerticalGroupedWorkSpace.bind(this), + getTotalRowCount: this._getTotalRowCount.bind(this), + getTotalCellCount: this._getTotalCellCount.bind(this), }; } _cleanWorkSpace() { this._cleanView(); this._toggleGroupedClass(); - this.toggleWorkSpaceWithOddCells(); + this._toggleWorkSpaceWithOddCells(); this.virtualScrollingDispatcher.updateDimensions(true); this._renderView(); - this.option('crossScrollingEnabled') && this.setTableSizes(); + this.option('crossScrollingEnabled') && this._setTableSizes(); this.cache.clear(); } @@ -2438,19 +2438,19 @@ class SchedulerWorkSpace extends Widget { // @ts-expect-error super._init(); - this.initGrouping(); + 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) .addClass(this._getElementClass()); } - private initPositionHelper() { + _initPositionHelper() { this.positionHelper = new PositionHelper({ key: this.option('key'), viewDataProvider: this.viewDataProvider, @@ -2461,28 +2461,28 @@ class SchedulerWorkSpace extends Widget { isGroupedByDate: this.isGroupedByDate(), rtlEnabled: this.option('rtlEnabled'), startViewDate: this.getStartViewDate(), - isVerticalGrouping: this.isVerticalGroupedWorkSpace(), - groupCount: this.getGroupCount(), + isVerticalGrouping: this._isVerticalGroupedWorkSpace(), + groupCount: this._getGroupCount(), isVirtualScrolling: this.isVirtualScrolling(), getDOMMetaDataCallback: this.getDOMElementsMetaData.bind(this), }); } - private initGrouping() { - this.initGroupedStrategy(); - this.toggleGroupingDirectionClass(); - this.toggleGroupByDateClass(); + _initGrouping() { + this._initGroupedStrategy(); + this._toggleGroupingDirectionClass(); + this._toggleGroupByDateClass(); } isVerticalOrientation() { const orientation = this.option('groups')?.length ? this.option('groupOrientation') - : this.getDefaultGroupStrategy(); + : this._getDefaultGroupStrategy(); return orientation === 'vertical'; } - private initGroupedStrategy() { + _initGroupedStrategy() { const Strategy = this.isVerticalOrientation() ? VerticalGroupedStrategy : HorizontalGroupedStrategy; @@ -2490,44 +2490,44 @@ class SchedulerWorkSpace extends Widget { this._groupedStrategy = new Strategy(this); } - private getDefaultGroupStrategy() { + _getDefaultGroupStrategy() { return 'horizontal'; } - private toggleHorizontalScrollClass() { + _toggleHorizontalScrollClass() { (this.$element() as any).toggleClass(WORKSPACE_WITH_BOTH_SCROLLS_CLASS, this.option('crossScrollingEnabled')); } - private toggleGroupByDateClass() { + _toggleGroupByDateClass() { (this.$element() as any).toggleClass(WORKSPACE_WITH_GROUP_BY_DATE_CLASS, this.isGroupedByDate()); } - private toggleWorkSpaceCountClass() { - (this.$element() as any).toggleClass(WORKSPACE_WITH_COUNT_CLASS, this.isWorkSpaceWithCount()); + _toggleWorkSpaceCountClass() { + (this.$element() as any).toggleClass(WORKSPACE_WITH_COUNT_CLASS, this._isWorkSpaceWithCount()); } - private toggleWorkSpaceWithOddCells() { + _toggleWorkSpaceWithOddCells() { (this.$element() as any).toggleClass(WORKSPACE_WITH_ODD_CELLS_CLASS, this._isWorkspaceWithOddCells()); } - private toggleGroupingDirectionClass() { - (this.$element() as any).toggleClass(VERTICAL_GROUPED_WORKSPACE_CLASS, this.isVerticalGroupedWorkSpace()); + _toggleGroupingDirectionClass() { + (this.$element() as any).toggleClass(VERTICAL_GROUPED_WORKSPACE_CLASS, this._isVerticalGroupedWorkSpace()); } - protected 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 .addAdditionalGroupCellClasses(cellClass, columnIndex + 1, rowIndex, columnIndex); } - protected getGroupHeaderClass(i?: any) { + _getGroupHeaderClass(i?: any) { const cellClass = GROUP_HEADER_CLASS; return this._groupedStrategy.addAdditionalGroupCellClasses(cellClass, i + 1); } - private initWorkSpaceUnits() { + _initWorkSpaceUnits() { this._$headerPanelContainer = $('
').addClass('dx-scheduler-header-panel-container'); this._$headerTablesContainer = $('
').addClass('dx-scheduler-header-tables-container'); this._$headerPanel = $('
').attr('aria-hidden', true); @@ -2564,7 +2564,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); } @@ -2579,7 +2579,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, @@ -2633,7 +2633,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 { @@ -2646,7 +2646,7 @@ class SchedulerWorkSpace extends Widget { } _appendHeaderPanelEmptyCellIfNecessary() { - this.isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); + this._isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); } _createHeaderScrollable() { @@ -2655,7 +2655,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); } @@ -2682,8 +2682,8 @@ class SchedulerWorkSpace extends Widget { _attachTableClasses() { this._addTableClass(this._$dateTable, DATE_TABLE_CLASS); - if (this.isVerticalGroupedWorkSpace()) { - const groupCount = this.getGroupCount(); + if (this._isVerticalGroupedWorkSpace()) { + const groupCount = this._getGroupCount(); for (let i = 0; i < groupCount; i++) { this._addTableClass(this._allDayTables[i], ALL_DAY_TABLE_CLASS); @@ -2704,9 +2704,9 @@ class SchedulerWorkSpace extends Widget { _initMarkup() { this.cache.clear(); - this.initWorkSpaceUnits(); + this._initWorkSpaceUnits(); - this.initVirtualScrolling(); + this._initVirtualScrolling(); this._initDateTableScrollable(); @@ -2723,7 +2723,7 @@ class SchedulerWorkSpace extends Widget { this._toggleGroupedClass(); this._renderView(); - this.attachEvents(); + this._attachEvents(); } _render() { @@ -2734,17 +2734,17 @@ class SchedulerWorkSpace extends Widget { } _toggleGroupedClass() { - (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this.getGroupCount() > 0); + (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this._getGroupCount() > 0); } _renderView() { if (this.isRenovatedRender()) { - if (this.isVerticalGroupedWorkSpace()) { + if (this._isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } } else { this._applyCellTemplates( - this.renderGroupHeader(), + this._renderGroupHeader(), ); } @@ -2753,7 +2753,7 @@ class SchedulerWorkSpace extends Widget { this.virtualScrollingDispatcher.updateDimensions(); } - this.updateGroupTableHeight(); + this._updateGroupTableHeight(); this.updateHeaderEmptyCellWidth(); this._shader = new VerticalShader(this); @@ -2898,9 +2898,9 @@ class SchedulerWorkSpace extends Widget { // ---------------- _createAllDayPanelElements() { - const groupCount = this.getGroupCount(); + 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) @@ -2950,12 +2950,12 @@ class SchedulerWorkSpace extends Widget { this._renderAllDayPanel(); } - this.initPositionHelper(); + this._initPositionHelper(); } - protected renderGroupHeader() { - const $container = this.getGroupHeaderContainer(); - const groupCount = this.getGroupCount(); + _renderGroupHeader() { + const $container = this._getGroupHeaderContainer(); + const groupCount = this._getGroupCount(); let cellTemplates = []; if (groupCount) { const groupRows = this._makeGroupRows(this.option('groups'), this.option('groupByDate')); @@ -2976,7 +2976,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, @@ -2984,22 +2984,22 @@ 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, + this._getCellCount() || 1, this.option('resourceCellTemplate'), - this.getGroupCount(), + this._getGroupCount(), groupByDate, ); } _renderDateHeader(): any { - const container = this.getDateHeaderContainer(); + 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 repeatCount = this._getCalculateHeaderCellRepeatCount(); const templateCallbacks = []; const groupByDate = this.isGroupedByDate(); @@ -3013,7 +3013,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; @@ -3031,7 +3031,7 @@ class SchedulerWorkSpace extends Widget { _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; @@ -3061,8 +3061,8 @@ class SchedulerWorkSpace extends Widget { } _getGroupsForDateHeaderTemplate(templateIndex, indexMultiplier = 1) { - if (this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { - const groupIndex = this.getGroupIndex(0, templateIndex * indexMultiplier); + if (this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { + const groupIndex = this._getGroupIndex(0, templateIndex * indexMultiplier); const groups = getLeafGroupValues(this.resourceManager.groupsLeafs, groupIndex); return { @@ -3081,10 +3081,10 @@ class SchedulerWorkSpace extends Widget { } _renderAllDayPanel(index?: any) { - let cellCount = this.getCellCount(); + let cellCount = this._getCellCount(); - if (!this.isVerticalGroupedWorkSpace()) { - cellCount *= this.getGroupCount() || 1; + if (!this._isVerticalGroupedWorkSpace()) { + cellCount *= this._getGroupCount() || 1; } const cellTemplates = this._renderTableBody({ @@ -3100,13 +3100,13 @@ class SchedulerWorkSpace extends Widget { }, true); this._updateAllDayVisibility(); - this.updateScrollable(); + this._updateScrollable(); this._applyCellTemplates(cellTemplates); } _renderGroupAllDayPanel() { - if (this.isVerticalGroupedWorkSpace()) { - const groupCount = this.getGroupCount(); + if (this._isVerticalGroupedWorkSpace()) { + const groupCount = this._getGroupCount(); for (let i = 0; i < groupCount; i++) { this._renderAllDayPanel(i); @@ -3124,11 +3124,11 @@ class SchedulerWorkSpace extends Widget { const repeatCount = this._groupedStrategy.calculateTimeCellRepeatCount(); const getTimeCellGroups = (rowIndex) => { - if (!this.isVerticalGroupedWorkSpace()) { + if (!this._isVerticalGroupedWorkSpace()) { return {}; } - const groupIndex = this.getGroupIndex(rowIndex, 0); + const groupIndex = this._getGroupIndex(rowIndex, 0); const groups = getLeafGroupValues(this.resourceManager.groupsLeafs, groupIndex); return { groupIndex, groups }; @@ -3140,7 +3140,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; @@ -3150,14 +3150,14 @@ class SchedulerWorkSpace extends Widget { this._renderTableBody({ container: getPublicElement(this._$timePanel), - rowCount: this.getTimePanelRowCount() * repeatCount, + rowCount: this._getTimePanelRowCount() * repeatCount, cellCount: 1, 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(), + groupCount: this._getGroupCount(), allDayElements: this._insertAllDayRowsIntoDateTable() ? this._allDayTitles : undefined, getTemplateData: getTimeCellGroups.bind(this), }); @@ -3166,18 +3166,18 @@ class SchedulerWorkSpace extends Widget { _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() { - const groupCount = this.getGroupCount(); + 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 @@ -3186,7 +3186,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_grouped_strategy_horizontal.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_grouped_strategy_horizontal.ts index 6abe6ad841a2..121ac7ce3712 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 9e8561da0523..8edcbf3a854b 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 8629bab92baa..8a4873193229 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; } @@ -253,10 +253,10 @@ 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); + const { rowIndex: currentTimeRowIndex } = this._getCellCoordinatesByIndex(index); if (currentTimeRowIndex === undefined) { return []; @@ -271,8 +271,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { : [currentTimeRowIndex, currentTimeRowIndex + 1]; } - const verticalGroupCount = this.isVerticalGroupedWorkSpace() - ? this.getGroupCount() + const verticalGroupCount = this._isVerticalGroupedWorkSpace() + ? 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 eaf3c4e9f150..9c06047ee21b 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 @@ -38,9 +38,9 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { 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, @@ -80,10 +80,10 @@ 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() { + _getViewStartByOptions() { return monthUtils.getViewStartByOptions( this.option('startDate') as any, this.option('currentDate') as any, @@ -124,8 +124,8 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { return true; } - getHeaderDate() { - return this.getViewStartByOptions(); + _getHeaderDate() { + return this._getViewStartByOptions(); } renderRAllDayPanel() {} @@ -138,7 +138,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { this._$dateTable, DateTableMonthComponent, 'renovatedDateTable', - this.getRDateTableProps(), + this._getRDateTableProps(), ); } @@ -147,7 +147,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { // ------------- _createWorkSpaceElements() { - if (this.isVerticalGroupedWorkSpace()) { + if (this._isVerticalGroupedWorkSpace()) { this._createWorkSpaceScrollableElements(); } else { super._createWorkSpaceElements(); 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 d8a0aa092d1d..c149aab4b726 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 @@ -13,7 +13,7 @@ class SchedulerWorkSpaceWeek extends SchedulerWorkSpaceVertical { } _calculateViewStartDate() { - return weekUtils.calculateViewStartDate(this.option('startDate') as any, this.firstDayOfWeek()); + 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 d162101a8b6a..e1d7b6761cc4 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,7 +14,7 @@ class SchedulerWorkSpaceWorkWeek extends SchedulerWorkSpaceWeek { // @ts-expect-error super(...args); - this.getWeekendsCount = getWeekendsCount; + this._getWeekendsCount = getWeekendsCount; } _getElementClass() { From 4f91195abca4389241bf8b4b2d3695cff4d593a8 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 11:51:50 +0100 Subject: [PATCH 06/22] 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 a703f844fd73..3200a36f71b3 100644 --- a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts @@ -1256,7 +1256,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 5499536f3102..b940453ef6c5 100644 --- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts +++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts @@ -153,7 +153,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 223e813d144e..338bf9b28e4b 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -112,7 +112,7 @@ class SchedulerAgenda extends WorkSpace { return false; } - _isVerticalGroupedWorkSpace() { + isVerticalGroupedWorkSpace() { return false; } @@ -128,11 +128,11 @@ class SchedulerAgenda extends WorkSpace { return 1; } - _getTimePanelRowCount() { + getTimePanelRowCount() { return this.option('agendaDuration') as number; } - _renderAllDayPanel() { return noop(); } + renderAllDayPanel() { return noop(); } _updateAllDayVisibility() { return noop(); } @@ -173,8 +173,8 @@ class SchedulerAgenda extends WorkSpace { this._setGroupHeaderCellsHeight(); } - this._renderTimePanel(); - this._renderDateTable(); + this.renderTimePanel(); + this.renderDateTable(); this._applyCellTemplates(cellTemplates); this._dateTableScrollable.update(); } @@ -244,7 +244,7 @@ class SchedulerAgenda extends WorkSpace { return result; } - _getGroupHeaderContainer() { + getGroupHeaderContainer() { return this._$groupTable; } @@ -336,8 +336,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(), @@ -372,7 +372,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; @@ -432,10 +432,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 d6fa88fbfd59..00836e72257f 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; } @@ -283,7 +283,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { renderRTimeTable() {} - _renderGroupAllDayPanel() {} + renderGroupAllDayPanel() {} // eslint-disable-next-line @typescript-eslint/no-unused-vars generateRenderOptions(argument?: any) { @@ -350,7 +350,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { this._$sidebarTable.appendTo(this._sidebarScrollable.$content()); - if (this.isRenovatedRender() && this._isVerticalGroupedWorkSpace()) { + if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } @@ -388,9 +388,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 df578104a6a2..4d8973149d44 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -442,7 +442,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(); @@ -543,7 +543,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; @@ -600,7 +600,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, @@ -631,7 +631,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'; } @@ -648,7 +648,7 @@ class SchedulerWorkSpace extends Widget { } _getRealGroupOrientation() { - return this._isVerticalGroupedWorkSpace() + return this.isVerticalGroupedWorkSpace() ? 'vertical' : 'horizontal'; } @@ -904,7 +904,7 @@ class SchedulerWorkSpace extends Widget { renovatedRenderSupported() { return true; } _updateGroupTableHeight() { - if (this._isVerticalGroupedWorkSpace() && hasWindow()) { + if (this.isVerticalGroupedWorkSpace() && hasWindow()) { this._setHorizontalGroupHeaderCellsHeight(); } } @@ -976,7 +976,7 @@ class SchedulerWorkSpace extends Widget { _attachClickEvent() { const that = this; const pointerDownAction = this._createAction((e) => { - that._pointerDownHandler(e.event); + that.pointerDownHandler(e.event); }); this._createCellClickAction(); @@ -1001,7 +1001,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), }); } @@ -1010,14 +1010,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)) { @@ -1035,7 +1035,7 @@ class SchedulerWorkSpace extends Widget { } } - _handleSelectedCellsClick() { + private handleSelectedCellsClick() { const selectedCells = this._getSelectedCellsData(); const firstCellData = selectedCells[0]; @@ -1056,39 +1056,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(); } @@ -1099,7 +1095,7 @@ class SchedulerWorkSpace extends Widget { this.updateHeaderPanelScrollbarPadding(); } - _getTimePanelRowCount() { + protected getTimePanelRowCount() { return this._getCellCountInDay(); } @@ -1387,7 +1383,7 @@ class SchedulerWorkSpace extends Widget { } _getAllCells(allDay) { - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { return this._$dateTable.find(`td:not(.${VIRTUAL_CELL_CLASS})`); } @@ -1569,7 +1565,7 @@ class SchedulerWorkSpace extends Widget { getAllDayHeight() { return getAllDayHeight( this.option('showAllDayPanel'), - this._isVerticalGroupedWorkSpace(), + this.isVerticalGroupedWorkSpace(), this.getDOMElementsMetaData(), ); } @@ -1681,7 +1677,7 @@ class SchedulerWorkSpace extends Widget { } needRecalculateResizableArea() { - return this._isVerticalGroupedWorkSpace() && this.getScrollable().scrollTop() !== 0; + return this.isVerticalGroupedWorkSpace() && this.getScrollable().scrollTop() !== 0; } getCellByCoordinates(coordinates, allDay) { @@ -1824,7 +1820,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; } @@ -1863,7 +1859,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; @@ -1922,7 +1918,7 @@ class SchedulerWorkSpace extends Widget { return undefined; } - return allDay && !this._isVerticalGroupedWorkSpace() + return allDay && !this.isVerticalGroupedWorkSpace() ? this._dom_getAllDayPanelCell(position.columnIndex) : this._dom_getDateCell(position); } @@ -1978,7 +1974,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) { @@ -2097,7 +2093,7 @@ class SchedulerWorkSpace extends Widget { this._attachGroupCountClass(); utils.renovation.renderComponent( this, - this._getGroupHeaderContainer(), + this.getGroupHeaderContainer(), GroupPanelComponent, 'renovatedGroupPanel', options, @@ -2184,7 +2180,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); } } @@ -2237,7 +2233,7 @@ class SchedulerWorkSpace extends Widget { // -------------- _isRenderHeaderPanelEmptyCell() { - return this._isVerticalGroupedWorkSpace(); + return this.isVerticalGroupedWorkSpace(); } _dispose() { @@ -2323,7 +2319,7 @@ class SchedulerWorkSpace extends Widget { this._toggleGroupByDateClass(); break; case 'showAllDayPanel': - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this._cleanView(); this._removeAllDayElements(); this._initGrouping(); @@ -2413,7 +2409,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), }; @@ -2461,7 +2457,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), @@ -2511,7 +2507,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) { @@ -2579,7 +2575,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, @@ -2633,7 +2629,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 { @@ -2682,7 +2678,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++) { @@ -2739,7 +2735,7 @@ class SchedulerWorkSpace extends Widget { _renderView() { if (this.isRenovatedRender()) { - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } } else { @@ -2784,7 +2780,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); } @@ -2900,7 +2896,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) @@ -2944,17 +2940,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) { @@ -2976,7 +2972,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, @@ -2999,7 +2995,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(); @@ -3080,18 +3076,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 @@ -3104,27 +3100,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 {}; } @@ -3148,32 +3144,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), @@ -3199,17 +3195,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 8a4873193229..1beb439ff815 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 9c06047ee21b..f5bdca839101 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() { @@ -147,7 +147,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { // ------------- _createWorkSpaceElements() { - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this._createWorkSpaceScrollableElements(); } else { super._createWorkSpaceElements(); @@ -162,9 +162,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 @@ -175,7 +175,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { _createAllDayPanelElements() {} - _renderTableBody(options) { + renderTableBody(options) { options.getCellText = (rowIndex, columnIndex) => { const date = this.viewDataProvider.completeViewDataMap[rowIndex][columnIndex].startDate; @@ -184,7 +184,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 6efeafe25dbd8e1c670241a27efd681f168b5282 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 11:56:16 +0100 Subject: [PATCH 07/22] 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 4d8973149d44..aa123166e275 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -473,7 +473,7 @@ class SchedulerWorkSpace extends Widget { focusedCellData, }); - this._processNextSelectedCell( + this.processNextSelectedCell( nextCellData, focusedCellData, isMultiSelection && isMultiSelectionAllowed, @@ -504,7 +504,7 @@ class SchedulerWorkSpace extends Widget { return this.option('rtlEnabled'); } - _moveToCell($cell, isMultiSelection) { + private moveToCell($cell, isMultiSelection) { if (!isDefined($cell) || !$cell.length) { return; } @@ -527,14 +527,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, @@ -548,13 +548,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, @@ -1031,7 +1031,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); } } @@ -1084,6 +1084,10 @@ class SchedulerWorkSpace extends Widget { return this._$thead; } + private getDateHeaderContainer() { + return this._$thead; + } + private getCalculateHeaderCellRepeatCount() { return this._groupedStrategy.calculateHeaderCellRepeatCount(); } @@ -1216,7 +1220,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); } }); } @@ -2991,7 +2995,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 1318895ac8116f0d014d7afe7c7a21538e2fc33f Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 12:07:32 +0100 Subject: [PATCH 08/22] 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 | 180 +++++++++--------- .../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, 117 insertions(+), 117 deletions(-) diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 338bf9b28e4b..dba70d628da0 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -89,7 +89,7 @@ class SchedulerAgenda extends WorkSpace { if (this._$groupTable) { this._$groupTable.remove(); this._$groupTable = null; - this._detachGroupCountClass(); + this.detachGroupCountClass(); } } else if (!this._$groupTable) { this._initGroupTable(); @@ -134,7 +134,7 @@ class SchedulerAgenda extends WorkSpace { renderAllDayPanel() { return noop(); } - _updateAllDayVisibility() { return noop(); } + updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } @@ -169,13 +169,13 @@ class SchedulerAgenda extends WorkSpace { this._rows = rows; if (this._$groupTable) { - cellTemplates = this._renderGroupHeader(); + cellTemplates = this.renderGroupHeader(); this._setGroupHeaderCellsHeight(); } this.renderTimePanel(); this.renderDateTable(); - this._applyCellTemplates(cellTemplates); + this.applyCellTemplates(cellTemplates); this._dateTableScrollable.update(); } @@ -224,7 +224,7 @@ class SchedulerAgenda extends WorkSpace { return result; } - _attachGroupCountClass() { + attachGroupCountClass() { const className = getVerticalGroupCountClass(this.option('groups')); (this.$element() as any).addClass(className); } @@ -248,7 +248,7 @@ class SchedulerAgenda extends WorkSpace { return this._$groupTable; } - _makeGroupRows() { + makeGroupRows() { const resourceManager = this.option('getResourceManager')(); const allAppointments = (this.option('getFilteredItems') as any)() as ListEntity[]; const tree = reduceResourcesTree( @@ -340,7 +340,7 @@ class SchedulerAgenda extends WorkSpace { this.renderTableBody({ container: getPublicElement(this._$dateTable), rowClass: DATE_TABLE_ROW_CLASS, - cellClass: this._getDateTableCellClass(), + cellClass: this.getDateTableCellClass(), }); } @@ -421,7 +421,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 00836e72257f..156477ee03be 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -326,18 +326,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(); @@ -356,7 +356,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { this.updateHeaderEmptyCellWidth(); - this._applyCellTemplates(groupCellTemplates); + this.applyCellTemplates(groupCellTemplates); } _setHorizontalGroupHeaderCellsHeight() { return noop(); } @@ -392,10 +392,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); @@ -424,7 +424,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { model: { text, date: new Date(currentDate), - ...this._getGroupsForDateHeaderTemplate(templateIndex, colSpan), + ...this.getGroupsForDateHeaderTemplate(templateIndex, colSpan), }, container: $th, index: templateIndex, @@ -473,7 +473,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 aa123166e275..feac2c877ba0 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -360,7 +360,7 @@ class SchedulerWorkSpace extends Widget { }; } - const groupIndex = this._getGroupIndexByGroupValues(groups); + const groupIndex = this.getGroupIndexByGroupValues(groups); return { ...selectedCell, @@ -750,7 +750,7 @@ class SchedulerWorkSpace extends Widget { _setTableSizes() { this.cache.clear(); - this._attachTableClasses(); + this.attachTableClasses(); let cellWidth = this.getCellWidth(); @@ -761,7 +761,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; @@ -775,7 +775,7 @@ class SchedulerWorkSpace extends Widget { setWidth(this._$allDayTable, width); } - this._attachHeaderTableClasses(); + this.attachHeaderTableClasses(); this._updateGroupTableHeight(); @@ -935,7 +935,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, @@ -1111,11 +1111,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) { @@ -1125,7 +1125,7 @@ class SchedulerWorkSpace extends Widget { return result; } - _getGroupIndex(rowIndex, columnIndex) { + private getGroupIndex(rowIndex, columnIndex) { return this._groupedStrategy.getGroupIndex(rowIndex, columnIndex); } @@ -1328,7 +1328,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() { @@ -1591,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(); @@ -1723,7 +1723,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(); @@ -1752,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(); @@ -1798,7 +1798,7 @@ class SchedulerWorkSpace extends Widget { } const groupIndex = this._getGroupCount() && groupValues - ? this._getGroupIndexByGroupValues(groupValues) + ? this.getGroupIndexByGroupValues(groupValues) : 0; const isScrollToAllDay = allDay && this.isAllDayPanelVisible; @@ -1930,7 +1930,7 @@ class SchedulerWorkSpace extends Widget { // Must replace all DOM manipulations getDOMElementsMetaData() { return this.cache.memo('cellElementsMeta', () => ({ - dateTableCellsMeta: this._getDateTableDOMElementsInfo(), + dateTableCellsMeta: this.getDateTableDOMElementsInfo(), allDayPanelCellsMeta: this._getAllDayPanelDOMElementsInfo(), })); } @@ -1938,7 +1938,7 @@ class SchedulerWorkSpace extends Widget { getPanelDOMSize(panelName: 'allDayPanel' | 'regularPanel'): { width: number; height: number } { return panelName === 'allDayPanel' ? this.cache.memo('allDayPanelSize', () => getBoundingRect(this._$allDayPanel.get(0))) - : this.cache.memo('regularPanelSize', () => getBoundingRect(this._getDateTable().get(0))); + : this.cache.memo('regularPanelSize', () => getBoundingRect(this.getDateTable().get(0))); } getCollectorDimension(isCollectorCompact: boolean, panelName: 'allDayPanel' | 'regularPanel') { @@ -1948,13 +1948,13 @@ class SchedulerWorkSpace extends Widget { )); } - _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)); @@ -2094,7 +2094,7 @@ class SchedulerWorkSpace extends Widget { }; if (this.option('groups')?.length) { - this._attachGroupCountClass(); + this.attachGroupCountClass(); utils.renovation.renderComponent( this, this.getGroupHeaderContainer(), @@ -2103,7 +2103,7 @@ class SchedulerWorkSpace extends Widget { options, ); } else { - this._detachGroupCountClass(); + this.detachGroupCountClass(); } } @@ -2111,7 +2111,7 @@ class SchedulerWorkSpace extends Widget { const visible = this.isAllDayPanelVisible && !this.isGroupedAllDayPanel(); if (visible) { - this._updateAllDayVisibility(); + this.updateAllDayVisibility(); const options = { viewData: this.viewDataProvider.viewData, @@ -2125,7 +2125,7 @@ class SchedulerWorkSpace extends Widget { utils.renovation.renderComponent(this, this._$allDayTitle, AllDayPanelTitleComponent, 'renovatedAllDayPanelTitle', {}); } - this._updateAllDayVisibility(); + this.updateAllDayVisibility(); this._updateScrollable(); } @@ -2146,9 +2146,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( @@ -2225,7 +2225,7 @@ class SchedulerWorkSpace extends Widget { enableDefaultDragging, disableDefaultDragging, () => this.getDroppableCell(), - () => this._getDateTables(), + () => this.getDateTables(), () => this.removeDroppableCellClass(), () => this.getCellWidth(), options, @@ -2311,32 +2311,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; @@ -2414,14 +2414,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); @@ -2514,7 +2514,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 @@ -2545,7 +2545,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); @@ -2625,7 +2625,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); @@ -2659,7 +2659,7 @@ class SchedulerWorkSpace extends Widget { this._scrollSync.header = getMemoizeScrollTo(() => this._headerScrollable); } - _createSidebarScrollable() { + private createSidebarScrollable() { const $timePanelScrollable = $('
') .addClass(SCHEDULER_SIDEBAR_SCROLLABLE_CLASS) .appendTo(this._$flexContainer); @@ -2679,25 +2679,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); } @@ -2716,11 +2716,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(); @@ -2733,7 +2733,7 @@ class SchedulerWorkSpace extends Widget { this._setIndicationUpdateInterval(); } - _toggleGroupedClass() { + private toggleGroupedClass() { (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this._getGroupCount() > 0); } @@ -2743,8 +2743,8 @@ class SchedulerWorkSpace extends Widget { this.renderRGroupPanel(); } } else { - this._applyCellTemplates( - this._renderGroupHeader(), + this.applyCellTemplates( + this.renderGroupHeader(), ); } @@ -2777,50 +2777,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(); @@ -2839,19 +2839,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; @@ -2897,7 +2897,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) { @@ -2943,7 +2943,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(); @@ -2953,29 +2953,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( @@ -2994,11 +2994,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(); @@ -3007,7 +3007,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); } } @@ -3017,19 +3017,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; @@ -3039,7 +3039,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) { @@ -3047,7 +3047,7 @@ class SchedulerWorkSpace extends Widget { model: { text, date, - ...this._getGroupsForDateHeaderTemplate(templateIndex), + ...this.getGroupsForDateHeaderTemplate(templateIndex), }, index: templateIndex, container: getPublicElement($cell), @@ -3060,9 +3060,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 { @@ -3074,7 +3074,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()); @@ -3099,9 +3099,9 @@ class SchedulerWorkSpace extends Widget { groupIndex: index, }, true); - this._updateAllDayVisibility(); + this.updateAllDayVisibility(); this._updateScrollable(); - this._applyCellTemplates(cellTemplates); + this.applyCellTemplates(cellTemplates); } protected renderGroupAllDayPanel() { @@ -3128,7 +3128,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 }; @@ -3175,9 +3175,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 @@ -3212,7 +3212,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 1beb439ff815..9068d931c7b6 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 f5bdca839101..6452dc83617f 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 @@ -154,7 +154,7 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { } } - _updateAllDayVisibility() { return noop(); } + updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } @@ -173,7 +173,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 983309c0affa..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 @@ -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 e1cb8a1a3664010ce88d1b355b1302acbe786354 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 12:42:30 +0100 Subject: [PATCH 09/22] 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 feac2c877ba0..f91aefbc9694 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -2784,7 +2784,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 30dcf32443ab77486060ad00fae1901b7cc5000b Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 12:54:38 +0100 Subject: [PATCH 10/22] 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 dba70d628da0..41db8c67c5e3 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -138,7 +138,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); @@ -188,7 +188,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(); } @@ -265,7 +265,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; @@ -320,11 +320,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 156477ee03be..063b5b05758e 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -312,7 +312,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { return 'vertical'; } - _toggleGroupingDirectionClass() { + toggleGroupingDirectionClass() { (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this._isHorizontalGroupedWorkSpace()); } @@ -322,8 +322,8 @@ class SchedulerTimeline extends SchedulerWorkSpace { }); } - _createWorkSpaceElements() { - this._createWorkSpaceScrollableElements(); + createWorkSpaceElements() { + this.createWorkSpaceScrollableElements(); } updateAllDayVisibility() { return noop(); } @@ -482,7 +482,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 f91aefbc9694..138ef4326337 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -2320,7 +2320,7 @@ class SchedulerWorkSpace extends Widget { this.createAllDayPanelElements(); this.removeAllDayElements(); this._cleanWorkSpace(); - this._toggleGroupByDateClass(); + this.toggleGroupByDateClass(); break; case 'showAllDayPanel': if (this.isVerticalGroupedWorkSpace()) { @@ -2351,14 +2351,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': @@ -2422,7 +2422,7 @@ class SchedulerWorkSpace extends Widget { _cleanWorkSpace() { this._cleanView(); this.toggleGroupedClass(); - this._toggleWorkSpaceWithOddCells(); + this.toggleWorkSpaceWithOddCells(); this.virtualScrollingDispatcher.updateDimensions(true); this._renderView(); @@ -2440,10 +2440,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) @@ -2470,8 +2470,8 @@ class SchedulerWorkSpace extends Widget { _initGrouping() { this._initGroupedStrategy(); - this._toggleGroupingDirectionClass(); - this._toggleGroupByDateClass(); + this.toggleGroupingDirectionClass(); + this.toggleGroupByDateClass(); } isVerticalOrientation() { @@ -2494,23 +2494,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()); } @@ -2521,13 +2521,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); @@ -2540,7 +2540,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(); @@ -2554,13 +2554,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 @@ -2568,15 +2568,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()) { @@ -2602,7 +2602,7 @@ class SchedulerWorkSpace extends Widget { this._$allDayPanel?.append(this._$allDayContainer, this._$allDayTable); } - this._appendHeaderPanelEmptyCellIfNecessary(); + this.appendHeaderPanelEmptyCellIfNecessary(); this._$headerPanelContainer.append(this._$headerTablesContainer); this.$element() @@ -2611,15 +2611,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); @@ -2645,11 +2645,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); @@ -2704,13 +2704,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(); @@ -2984,7 +2984,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 6452dc83617f..a25c12e671e5 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 @@ -146,11 +146,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 2eed77ee88d2593c561ef0762e73e846b969781b Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 14:41:07 +0100 Subject: [PATCH 11/22] 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 063b5b05758e..ba706932cc44 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(); } @@ -487,7 +487,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 138ef4326337..6443aa6df696 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -1115,7 +1115,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 46e34a38321088c871d5a99a1e683455df0c93c5 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Thu, 5 Mar 2026 14:56:42 +0100 Subject: [PATCH 12/22] 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 3200a36f71b3..ac4cf227c4a0 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._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()); } 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 6443aa6df696..62ed11e73988 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -1143,7 +1143,7 @@ class SchedulerWorkSpace extends Widget { return this.resourceManager.groupCount(); } - _attachTablesEvents() { + attachTablesEvents() { const element = this.$element(); this._attachDragEvents(element); @@ -2337,7 +2337,7 @@ class SchedulerWorkSpace extends Widget { break; case 'allDayExpanded': this.updateAllDayExpansion(); - this._attachTablesEvents(); + this.attachTablesEvents(); this._updateScrollable(); break; case 'onSelectionChanged': From c2f5b1ebf82d33d7e3d5a2abdeb820b47e8def93 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 13:39:01 +0100 Subject: [PATCH 13/22] 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 | 4 +- .../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 +- .../agenda.tests.js | 2 +- 10 files changed, 47 insertions(+), 47 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 886ace2cc3f2..511e804437cf 100644 --- a/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts +++ b/packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts @@ -89,12 +89,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 ddacd7b40dd9..59c9e4e40074 100644 --- a/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts +++ b/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts @@ -88,7 +88,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 ac4cf227c4a0..dcf1796d6ff0 100644 --- a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts @@ -1168,7 +1168,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { _initMarkupCore() { this._readyToRenderAppointments = hasWindow(); - this._workSpace && this._cleanWorkspace(); + this._workSpace && this.cleanWorkSpace(); this._renderWorkSpace(); this._appointments.option({ @@ -1429,7 +1429,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { } _refreshWorkSpace(): void { - this._cleanWorkspace(); + this.cleanWorkSpace(); delete this._workSpace; @@ -1444,7 +1444,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 41db8c67c5e3..a1e78792730c 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -153,7 +153,7 @@ class SchedulerAgenda extends WorkSpace { } } - _renderView() { + renderView() { this._startViewDate = agendaUtils.calculateStartViewDate(this.option('currentDate') as any, this.option('startDayHour') as any); this._rows = []; } @@ -473,7 +473,7 @@ class SchedulerAgenda extends WorkSpace { } renderAgendaLayout(appointments: ListEntity[]): void { - this._renderView(); + this.renderView(); const rows = agendaUtils.calculateRows( appointments, diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts index ba706932cc44..c0846bf91120 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -308,7 +308,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { .addClass(GROUP_TABLE_CLASS); } - _getDefaultGroupStrategy() { + getDefaultGroupStrategy() { return 'vertical'; } @@ -334,7 +334,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 62ed11e73988..ac77a0661579 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -850,7 +850,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); } @@ -868,7 +868,7 @@ class SchedulerWorkSpace extends Widget { const groupOrientation = groupCount > 0 ? this.option('groupOrientation') - : this._getDefaultGroupStrategy(); + : this.getDefaultGroupStrategy(); const options = { groupByDate: this.option('groupByDate'), @@ -910,7 +910,7 @@ class SchedulerWorkSpace extends Widget { } updateHeaderEmptyCellWidth() { - if (hasWindow() && this._isRenderHeaderPanelEmptyCell()) { + if (hasWindow() && this.isRenderHeaderPanelEmptyCell()) { const timePanelWidth = this.getTimePanelWidth(); const groupPanelWidth = this.getGroupTableWidth(); @@ -2183,14 +2183,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); @@ -2199,10 +2199,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 = () => { @@ -2236,7 +2236,7 @@ class SchedulerWorkSpace extends Widget { // We do not need these methods in renovation // -------------- - _isRenderHeaderPanelEmptyCell() { + private isRenderHeaderPanelEmptyCell() { return this.isVerticalGroupedWorkSpace(); } @@ -2307,24 +2307,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(); @@ -2350,11 +2350,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': @@ -2394,7 +2394,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), @@ -2419,13 +2419,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(); } @@ -2450,7 +2450,7 @@ class SchedulerWorkSpace extends Widget { .addClass(this._getElementClass()); } - _initPositionHelper() { + private initPositionHelper() { this.positionHelper = new PositionHelper({ key: this.option('key'), viewDataProvider: this.viewDataProvider, @@ -2469,7 +2469,7 @@ class SchedulerWorkSpace extends Widget { } _initGrouping() { - this._initGroupedStrategy(); + this.initGroupedStrategy(); this.toggleGroupingDirectionClass(); this.toggleGroupByDateClass(); } @@ -2477,12 +2477,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; @@ -2490,7 +2490,7 @@ class SchedulerWorkSpace extends Widget { this._groupedStrategy = new Strategy(this); } - _getDefaultGroupStrategy() { + protected getDefaultGroupStrategy() { return 'horizontal'; } @@ -2646,7 +2646,7 @@ class SchedulerWorkSpace extends Widget { } private appendHeaderPanelEmptyCellIfNecessary() { - this._isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); + this.isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); } private createHeaderScrollable() { @@ -2722,7 +2722,7 @@ class SchedulerWorkSpace extends Widget { this.toggleGroupedClass(); - this._renderView(); + this.renderView(); this._attachEvents(); } @@ -2737,7 +2737,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(); @@ -2818,7 +2818,7 @@ class SchedulerWorkSpace extends Widget { this._$allDayTitle?.remove(); } - _cleanView(): void { + cleanView(): void { this.cache.clear(); this.cleanTableWidths(); this.cellsSelectionState.clearSelectedAndFocusedCells(); @@ -2950,7 +2950,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 9068d931c7b6..db72f83380eb 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; } } diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js index 59d1e9e0439d..4272aaad4367 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/agenda.tests.js @@ -32,7 +32,7 @@ module('Agenda', {}, () => { const config = { onContentReady: e => { - e.component._renderView(); + e.component.renderView(); e.component._recalculateAgenda(rows); }, getResourceManager: getEmptyResourceManager, From a529579e5129e1259c1d781de49ad20adbf7b82b Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 13:44:55 +0100 Subject: [PATCH 14/22] 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 ac77a0661579..a50794a659b8 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -424,7 +424,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)); @@ -574,7 +574,7 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this._updateSelectedCellDataOption(this._getSelectedCellsData(), $nextFocusedCell); + this._updateSelectedCellDataOption(this.getSelectedCellsData(), $nextFocusedCell); } _hasAllDayClass($cell) { @@ -611,7 +611,7 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this._updateSelectedCellDataOption(this._getSelectedCellsData()); + this._updateSelectedCellDataOption(this.getSelectedCellsData()); } } @@ -1036,7 +1036,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]; @@ -1450,7 +1450,7 @@ class SchedulerWorkSpace extends Widget { return false; } - protected _normalizeCellData(cellData) { + private normalizeCellData(cellData) { return extend(true, {}, { startDate: cellData.startDate, endDate: cellData.endDate, @@ -1462,16 +1462,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) { @@ -2729,8 +2729,8 @@ class SchedulerWorkSpace extends Widget { _render() { // @ts-expect-error super._render(); - this._renderDateTimeIndication(); - this._setIndicationUpdateInterval(); + this.renderDateTimeIndication(); + this.setIndicationUpdateInterval(); } private toggleGroupedClass() { @@ -2769,13 +2769,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) => { @@ -3194,7 +3194,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 db72f83380eb..936877320c3a 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 1aed7aa0dd50..645eace9fbc5 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 2a332977682f2dbf1c83c12756b8841b16c4397e Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 13:50:35 +0100 Subject: [PATCH 15/22] 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 a1e78792730c..68878fa9adfd 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -160,7 +160,7 @@ class SchedulerAgenda extends WorkSpace { _recalculateAgenda(rows) { let cellTemplates = []; - this._cleanView(); + this.cleanView(); if (this._rowsIsEmpty(rows)) { this._renderNoData(); @@ -304,7 +304,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 a50794a659b8..0809fe7ed31d 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -2236,7 +2236,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 936877320c3a..2e9c3ee00a8f 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 a5a0eafc77ebce1b6a56e2ab14fab1acafe9eecd Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 15:24:40 +0100 Subject: [PATCH 16/22] fix: refactor one by one --- .../__tests__/__mock__/m_mock_scheduler.ts | 2 +- .../js/__internal/scheduler/m_scheduler.ts | 2 +- .../js/__internal/scheduler/m_subscribes.ts | 2 +- .../shaders/current_time_shader_horizontal.ts | 10 +- .../shaders/current_time_shader_vertical.ts | 2 +- .../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 +- 20 files changed, 308 insertions(+), 308 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 90a9c4a623cc..b0b4471dbf8e 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_scheduler.ts b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts index dcf1796d6ff0..96637c92126b 100644 --- a/packages/devextreme/js/__internal/scheduler/m_scheduler.ts +++ b/packages/devextreme/js/__internal/scheduler/m_scheduler.ts @@ -1280,7 +1280,7 @@ class Scheduler extends SchedulerOptionsBaseWidget { this._recalculateWorkspace(); if (currentViewOptions.startDate) { - this._updateOption('header', 'currentDate', this._workSpace._getHeaderDate()); + this._updateOption('header', 'currentDate', this._workSpace.getHeaderDate()); } } diff --git a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts index b940453ef6c5..2b72cab32a43 100644 --- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts +++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts @@ -229,7 +229,7 @@ const subscribes = { }, getGroupCount() { - return this._workSpace._getGroupCount(); + return this._workSpace.getGroupCount(); }, mapAppointmentFields(config) { diff --git a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts index 8936fa571ef3..cf23ce7d170c 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_horizontal.ts @@ -6,8 +6,8 @@ import CurrentTimeShader from './current_time_shader'; class HorizontalCurrentTimeShader extends CurrentTimeShader { renderShader(): void { - const groupCount = this._workSpace._isHorizontalGroupedWorkSpace() - ? this._workSpace._getGroupCount() + const groupCount = this._workSpace.isHorizontalGroupedWorkSpace() + ? this._workSpace.getGroupCount() : 1; for (let i = 0; i < groupCount; i += 1) { @@ -34,7 +34,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); @@ -64,9 +64,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() + shaderLeft = workSpace.getCellWidth() * integerPart * workSpace.getGroupCount() + groupIndex * workSpace.getCellWidth(); } diff --git a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts index 7b4eabf37712..aa8f92796ec8 100644 --- a/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts +++ b/packages/devextreme/js/__internal/scheduler/shaders/current_time_shader_vertical.ts @@ -24,7 +24,7 @@ class VerticalCurrentTimeShader extends CurrentTimeShader { } setHeight(this._$shader, shaderHeight); - const groupCount = this._workSpace._getGroupCount() || 1; + const groupCount = this._workSpace.getGroupCount() || 1; if (this._workSpace.isGroupedByDate()) { this.renderGroupedByDateShaderParts(groupCount, shaderHeight, maxHeight, isSolidShader); diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts index 68878fa9adfd..8b3aac8d06aa 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -116,15 +116,15 @@ class SchedulerAgenda extends WorkSpace { return false; } - _getElementClass() { + getElementClass() { return AGENDA_CLASS; } - _getRowCount() { + getRowCount() { return this.option('agendaDuration') as number; } - _getCellCount() { + getCellCount() { return 1; } @@ -186,15 +186,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) { @@ -346,7 +346,7 @@ class SchedulerAgenda extends WorkSpace { attachTablesEvents() { return noop(); } - _attachEvents() { return noop(); } + attachEvents() { return noop(); } _cleanCellDataCache() { return noop(); } @@ -538,7 +538,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 c0846bf91120..b75b16ef8982 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; } @@ -313,7 +313,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() { @@ -359,25 +359,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)] @@ -401,14 +401,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); @@ -464,7 +464,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); @@ -485,9 +485,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, ); } @@ -496,7 +496,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 0809fe7ed31d..531c6a1e98ca 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -353,7 +353,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, @@ -384,7 +384,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; } @@ -427,7 +427,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; @@ -445,10 +445,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, @@ -500,7 +500,7 @@ class SchedulerWorkSpace extends Widget { }); } - _isRTL() { + private isRTL() { return this.option('rtlEnabled'); } @@ -510,7 +510,7 @@ class SchedulerWorkSpace extends Widget { } const isMultiSelectionAllowed = this.option('allowMultipleCellSelection'); - const currentCellData = this._getFullCellData($cell); + const currentCellData = this.getFullCellData($cell); const focusedCell = this.cellsSelectionState.getFocusedCell(); if (!focusedCell) { @@ -544,8 +544,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); @@ -574,10 +574,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); } @@ -611,7 +611,7 @@ class SchedulerWorkSpace extends Widget { } this.updateCellsSelection(); - this._updateSelectedCellDataOption(this.getSelectedCellsData()); + this.updateSelectedCellDataOption(this.getSelectedCellsData()); } } @@ -635,19 +635,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'; @@ -658,7 +658,7 @@ class SchedulerWorkSpace extends Widget { this._$allDayTitle = $('
').appendTo(this._$headerPanelEmptyCell); } - _dateTableScrollableConfig() { + protected dateTableScrollableConfig() { let config: any = { useKeyboard: false, bounceEnabled: false, @@ -686,8 +686,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() @@ -707,7 +707,7 @@ class SchedulerWorkSpace extends Widget { return config; } - _createCrossScrollingConfig({ onScroll }): any { + protected createCrossScrollingConfig({ onScroll }): any { return { direction: 'both', onScroll: (event) => { @@ -722,7 +722,7 @@ class SchedulerWorkSpace extends Widget { }; } - _headerScrollableConfig() { + protected headerScrollableConfig() { return { useKeyboard: false, showScrollbar: 'never', @@ -740,15 +740,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(); @@ -760,7 +760,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; @@ -777,9 +777,9 @@ class SchedulerWorkSpace extends Widget { this.attachHeaderTableClasses(); - this._updateGroupTableHeight(); + this.updateGroupTableHeight(); - this._updateScrollable(); + this.updateScrollable(); } getWorkSpaceMinWidth() { @@ -794,23 +794,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'), @@ -821,7 +821,7 @@ class SchedulerWorkSpace extends Widget { }); } - _getCellCount() { + getCellCount() { return this.viewDataProvider.getCellCount({ intervalCount: this.option('intervalCount'), currentDate: this.option('currentDate'), @@ -836,15 +836,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; @@ -864,7 +864,7 @@ class SchedulerWorkSpace extends Widget { } generateRenderOptions(isProvideVirtualCellsWidth?: any): ViewDataProviderOptions { - const groupCount = this._getGroupCount(); + const groupCount = this.getGroupCount(); const groupOrientation = groupCount > 0 ? this.option('groupOrientation') @@ -881,7 +881,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'), @@ -903,9 +903,9 @@ class SchedulerWorkSpace extends Widget { renovatedRenderSupported() { return true; } - _updateGroupTableHeight() { + private updateGroupTableHeight() { if (this.isVerticalGroupedWorkSpace() && hasWindow()) { - this._setHorizontalGroupHeaderCellsHeight(); + this.setHorizontalGroupHeaderCellsHeight(); } } @@ -920,18 +920,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; } @@ -942,44 +942,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(); @@ -999,13 +999,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'); } @@ -1029,8 +1029,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); } } @@ -1055,7 +1055,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}`; @@ -1092,7 +1092,7 @@ class SchedulerWorkSpace extends Widget { return this._groupedStrategy.calculateHeaderCellRepeatCount(); } - _updateScrollable() { + protected updateScrollable() { this._dateTableScrollable.update(); this._headerScrollable?.update(); this._sidebarScrollable?.update(); @@ -1100,10 +1100,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'); @@ -1139,25 +1139,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) { @@ -1172,7 +1172,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, @@ -1198,7 +1198,7 @@ class SchedulerWorkSpace extends Widget { }); } - _attachPointerEvents(element) { + private attachPointerEvents(element) { let isPointerDown = false; (eventsEngine.off as any)(element, SCHEDULER_CELL_DXPOINTERMOVE_EVENT_NAME); @@ -1225,7 +1225,7 @@ class SchedulerWorkSpace extends Widget { }); } - _getFormat() { return abstract(); } + protected getFormat() { return abstract(); } getWorkArea() { return this._$dateTableContainer; @@ -1271,9 +1271,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, @@ -1283,25 +1283,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) { @@ -1315,25 +1315,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; @@ -1344,12 +1344,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) @@ -1357,13 +1357,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 = []; @@ -1377,7 +1377,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}`; @@ -1386,7 +1386,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})`); } @@ -1398,16 +1398,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); @@ -1427,7 +1427,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(); @@ -1469,34 +1469,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); @@ -1505,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 @@ -1517,12 +1517,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) { @@ -1591,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(); @@ -1603,7 +1603,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; } @@ -1650,19 +1650,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; @@ -1685,7 +1685,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); @@ -1721,8 +1721,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(); @@ -1748,11 +1748,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(); @@ -1773,7 +1773,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) { @@ -1793,16 +1793,16 @@ class SchedulerWorkSpace extends Widget { } scrollTo(date: Date, groupValues?: RawGroupValues | GroupValues, allDay = false, throwWarning = true, align: 'start' | 'center' = 'center') { - 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; @@ -1837,7 +1837,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); @@ -1859,10 +1859,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)) { @@ -1872,15 +1872,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(), @@ -1901,12 +1901,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; @@ -1923,15 +1923,15 @@ 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(), })); } @@ -1949,7 +1949,7 @@ class SchedulerWorkSpace extends Widget { } getDateTableDOMElementsInfo() { - const dateTableCells = this._getAllCells(false); + const dateTableCells = this.getAllCells(false); if (!dateTableCells.length || !hasWindow()) { return [[{}]]; } @@ -1969,17 +1969,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 [{}]; @@ -1989,14 +1989,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({ @@ -2008,10 +2008,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, @@ -2023,9 +2023,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 = { @@ -2076,7 +2076,7 @@ class SchedulerWorkSpace extends Widget { this._$dateTable, DateTableComponent, 'renovatedDateTable', - this._getRDateTableProps(), + this.getRDateTableProps(), ); } @@ -2126,7 +2126,7 @@ class SchedulerWorkSpace extends Widget { } this.updateAllDayVisibility(); - this._updateScrollable(); + this.updateScrollable(); } renderRTimeTable() { @@ -2312,7 +2312,7 @@ class SchedulerWorkSpace extends Widget { case 'groups': this.cleanView(); this.removeAllDayElements(); - this._initGrouping(); + this.initGrouping(); this.repaint(); break; case 'groupOrientation': @@ -2326,11 +2326,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(); } @@ -2338,16 +2338,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(); @@ -2359,7 +2359,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(); @@ -2399,7 +2399,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())), @@ -2412,7 +2412,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), @@ -2426,7 +2426,7 @@ class SchedulerWorkSpace extends Widget { this.virtualScrollingDispatcher.updateDimensions(true); this.renderView(); - this.option('crossScrollingEnabled') && this._setTableSizes(); + this.option('crossScrollingEnabled') && this.setTableSizes(); this.cache.clear(); } @@ -2438,7 +2438,7 @@ class SchedulerWorkSpace extends Widget { // @ts-expect-error super._init(); - this._initGrouping(); + this.initGrouping(); this.toggleHorizontalScrollClass(); this.toggleWorkSpaceCountClass(); @@ -2447,7 +2447,7 @@ class SchedulerWorkSpace extends Widget { (this.$element() as any) .addClass(COMPONENT_CLASS) - .addClass(this._getElementClass()); + .addClass(this.getElementClass()); } private initPositionHelper() { @@ -2462,13 +2462,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(); @@ -2503,11 +2503,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() { @@ -2564,7 +2564,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); } @@ -2655,7 +2655,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); } @@ -2683,7 +2683,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); @@ -2706,7 +2706,7 @@ class SchedulerWorkSpace extends Widget { this.initWorkSpaceUnits(); - this._initVirtualScrolling(); + this.initVirtualScrolling(); this.initDateTableScrollable(); @@ -2723,7 +2723,7 @@ class SchedulerWorkSpace extends Widget { this.toggleGroupedClass(); this.renderView(); - this._attachEvents(); + this.attachEvents(); } _render() { @@ -2734,7 +2734,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() { @@ -2753,7 +2753,7 @@ class SchedulerWorkSpace extends Widget { this.virtualScrollingDispatcher.updateDimensions(); } - this._updateGroupTableHeight(); + this.updateGroupTableHeight(); this.updateHeaderEmptyCellWidth(); this._shader = new VerticalShader(this); @@ -2794,12 +2794,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); @@ -2898,7 +2898,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++) { @@ -2955,7 +2955,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')); @@ -2987,9 +2987,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, ); } @@ -2997,7 +2997,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 = []; @@ -3013,7 +3013,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; @@ -3031,7 +3031,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; @@ -3061,7 +3061,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); @@ -3081,10 +3081,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({ @@ -3095,18 +3095,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); @@ -3140,7 +3140,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; @@ -3157,7 +3157,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), }); @@ -3172,7 +3172,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), @@ -3186,7 +3186,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 2e9c3ee00a8f..c3258ec5348e 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 a25c12e671e5..f2956c5390dc 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(); } renderRAllDayPanel() {} @@ -138,7 +138,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 ef1fc1b543c122ff611c1bcd7c301a0d50446f01 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 15:25:13 +0100 Subject: [PATCH 17/22] 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 531c6a1e98ca..7a2e503d7432 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts @@ -707,7 +707,7 @@ class SchedulerWorkSpace extends Widget { return config; } - protected createCrossScrollingConfig({ onScroll }): any { + createCrossScrollingConfig({ onScroll }): any { return { direction: 'both', onScroll: (event) => { From 5287f91de2e052eee62476faae028044bc6ec57a Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 15:48:51 +0100 Subject: [PATCH 18/22] 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 d65f86bad1d6..560a4a17347a 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 3f674c4d3532..7f1b8ddd6868 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 e1e7a96b638a..1a63a09dbe26 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 7ab46964aeeb2ecc7833cbd04b1fdfca569449e8 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 16:48:29 +0100 Subject: [PATCH 19/22] 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 2f81153798436a43d956cc78af34197b04ac8162 Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 16:49:33 +0100 Subject: [PATCH 20/22] 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 7f1b8ddd6868..adf684903370 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 267d725f310d9484919b04d1877c0e152ca2190a Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 17:17:48 +0100 Subject: [PATCH 21/22] 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 1a63a09dbe26..45519c1ef94a 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 0f6388dee5b2..7b6b341a9a05 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 aa7d43b7d3b3dc068865a456ffd9b22e1182da4c Mon Sep 17 00:00:00 2001 From: Sergio Bur Date: Fri, 6 Mar 2026 17:52:04 +0100 Subject: [PATCH 22/22] 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 8b3aac8d06aa..57c750f40c3d 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts @@ -538,7 +538,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 b75b16ef8982..99da7e232774 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