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/__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 a703f844fd73..96637c92126b 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({ @@ -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()); } @@ -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/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..57c750f40c3d 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(); @@ -112,33 +112,33 @@ class SchedulerAgenda extends WorkSpace { return false; } - _isVerticalGroupedWorkSpace() { + isVerticalGroupedWorkSpace() { return false; } - _getElementClass() { + getElementClass() { return AGENDA_CLASS; } - _getRowCount() { + getRowCount() { return this.option('agendaDuration') as number; } - _getCellCount() { + getCellCount() { return 1; } - _getTimePanelRowCount() { + getTimePanelRowCount() { return this.option('agendaDuration') as number; } - _renderAllDayPanel() { return noop(); } + renderAllDayPanel() { return noop(); } - _updateAllDayVisibility() { return noop(); } + updateAllDayVisibility() { return noop(); } _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); @@ -153,14 +153,14 @@ class SchedulerAgenda extends WorkSpace { } } - _renderView() { + renderView() { this._startViewDate = agendaUtils.calculateStartViewDate(this.option('currentDate') as any, this.option('startDayHour') as any); this._rows = []; } _recalculateAgenda(rows) { let cellTemplates = []; - this._cleanView(); + this.cleanView(); if (this._rowsIsEmpty(rows)) { this._renderNoData(); @@ -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.renderTimePanel(); + this.renderDateTable(); + this.applyCellTemplates(cellTemplates); this._dateTableScrollable.update(); } @@ -186,15 +186,15 @@ class SchedulerAgenda extends WorkSpace { this._dateTableScrollable.$content().append(this._$noDataContainer); } - _setTableSizes() { return noop(); } + setTableSizes() { return noop(); } - _toggleHorizontalScrollClass() { 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) { @@ -224,7 +224,7 @@ class SchedulerAgenda extends WorkSpace { return result; } - _attachGroupCountClass() { + attachGroupCountClass() { const className = getVerticalGroupCountClass(this.option('groups')); (this.$element() as any).addClass(className); } @@ -244,11 +244,11 @@ class SchedulerAgenda extends WorkSpace { return result; } - _getGroupHeaderContainer() { + getGroupHeaderContainer() { return this._$groupTable; } - _makeGroupRows() { + makeGroupRows() { const resourceManager = this.option('getResourceManager')(); const allAppointments = (this.option('getFilteredItems') as any)() as ListEntity[]; const tree = reduceResourcesTree( @@ -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; @@ -304,7 +304,7 @@ class SchedulerAgenda extends WorkSpace { }; } - _cleanView() { + cleanView() { this._$dateTable.empty(); this._$timePanel.empty(); @@ -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); @@ -336,17 +336,17 @@ 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(), + cellClass: this.getDateTableCellClass(), }); } - _attachTablesEvents() { return noop(); } + attachTablesEvents() { return noop(); } - _attachEvents() { return noop(); } + attachEvents() { return noop(); } _cleanCellDataCache() { return noop(); } @@ -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; @@ -421,7 +421,7 @@ class SchedulerAgenda extends WorkSpace { } $(options.container).append($('').append(this._$rows)); - this._applyCellTemplates(cellTemplates); + this.applyCellTemplates(cellTemplates); } _setLastRowClass() { @@ -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, @@ -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 d6fa88fbfd59..99da7e232774 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline.ts @@ -47,15 +47,15 @@ class SchedulerTimeline extends SchedulerWorkSpace { return this._$sidebarTable ? getOuterWidth(this._$sidebarTable) : 0; } - _getTotalRowCount(groupCount) { - if (this._isHorizontalGroupedWorkSpace()) { - return this._getRowCount(); + getTotalRowCount(groupCount) { + 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, @@ -92,14 +92,14 @@ class SchedulerTimeline extends SchedulerWorkSpace { return false; } - _getGroupHeaderContainer() { - if (this._isHorizontalGroupedWorkSpace()) { + getGroupHeaderContainer() { + if (this.isHorizontalGroupedWorkSpace()) { return this._$thead; } return this._$sidebarTable; } - _insertAllDayRowsIntoDateTable() { + insertAllDayRowsIntoDateTable() { return false; } @@ -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, }; } @@ -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; } @@ -283,7 +283,7 @@ class SchedulerTimeline extends SchedulerWorkSpace { renderRTimeTable() {} - _renderGroupAllDayPanel() {} + renderGroupAllDayPanel() {} // eslint-disable-next-line @typescript-eslint/no-unused-vars generateRenderOptions(argument?: any) { @@ -308,12 +308,12 @@ class SchedulerTimeline extends SchedulerWorkSpace { .addClass(GROUP_TABLE_CLASS); } - _getDefaultGroupStrategy() { + getDefaultGroupStrategy() { return 'vertical'; } - _toggleGroupingDirectionClass() { - (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this._isHorizontalGroupedWorkSpace()); + toggleGroupingDirectionClass() { + (this.$element() as any).toggleClass(HORIZONTAL_GROUPED_WORKSPACE_CLASS, this.isHorizontalGroupedWorkSpace()); } _getDefaultOptions() { @@ -322,22 +322,22 @@ class SchedulerTimeline extends SchedulerWorkSpace { }); } - _createWorkSpaceElements() { - this._createWorkSpaceScrollableElements(); + createWorkSpaceElements() { + this.createWorkSpaceScrollableElements(); } - _updateAllDayVisibility() { return noop(); } + updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } - _getDateHeaderTemplate() { + getDateHeaderTemplate() { return this.option('timeCellTemplate'); } - _renderView() { + renderView() { let groupCellTemplates; if (!this.isRenovatedRender()) { - groupCellTemplates = this._renderGroupHeader(); + groupCellTemplates = this.renderGroupHeader(); } this.renderWorkSpace(); @@ -350,34 +350,34 @@ class SchedulerTimeline extends SchedulerWorkSpace { this._$sidebarTable.appendTo(this._sidebarScrollable.$content()); - if (this.isRenovatedRender() && this._isVerticalGroupedWorkSpace()) { + if (this.isRenovatedRender() && this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } this.updateHeaderEmptyCellWidth(); - this._applyCellTemplates(groupCellTemplates); + 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)] @@ -388,27 +388,27 @@ 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(); } + 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); 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); @@ -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, @@ -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); @@ -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( @@ -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..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 78b3a8d04e13..c0e723238fb7 100644 --- a/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts +++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_timeline_month.ts @@ -16,17 +16,17 @@ class SchedulerTimelineMonth extends SchedulerTimeline { get renovatedHeaderPanelComponent() { return HeaderPanelComponent; } - _renderView() { - super._renderView(); + renderView() { + super.renderView(); - this._updateScrollable(); + this.updateScrollable(); } - _getElementClass() { + getElementClass() { return TIMELINE_CLASS; } - _getDateHeaderTemplate() { + getDateHeaderTemplate() { return this.option('dateCellTemplate'); } @@ -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 df578104a6a2..7a2e503d7432 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, @@ -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; } @@ -424,10 +424,10 @@ 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)); + const selectedCellsElement = selectedCells.map((cellData) => this.getCellByData(cellData)).filter((cell) => Boolean(cell)); e.target = selectedCellsElement; this._showPopup = true; @@ -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 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, @@ -473,7 +473,7 @@ class SchedulerWorkSpace extends Widget { focusedCellData, }); - this._processNextSelectedCell( + this.processNextSelectedCell( nextCellData, focusedCellData, isMultiSelection && isMultiSelectionAllowed, @@ -500,17 +500,17 @@ class SchedulerWorkSpace extends Widget { }); } - _isRTL() { + private isRTL() { return this.option('rtlEnabled'); } - _moveToCell($cell, isMultiSelection) { + private moveToCell($cell, isMultiSelection) { if (!isDefined($cell) || !$cell.length) { return; } const isMultiSelectionAllowed = this.option('allowMultipleCellSelection'); - const currentCellData = this._getFullCellData($cell); + const currentCellData = this.getFullCellData($cell); const focusedCell = this.cellsSelectionState.getFocusedCell(); if (!focusedCell) { @@ -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() - ? this._dom_getAllDayPanelCell(nextCellPosition.columnIndex) - : this._dom_getDateCell(nextCellPosition); + 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,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); } @@ -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()); } } @@ -631,24 +631,24 @@ 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'; } - _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() { - return this._isVerticalGroupedWorkSpace() + 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 { + 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,17 +740,17 @@ 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(); + this.attachTableClasses(); let cellWidth = this.getCellWidth(); @@ -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; @@ -775,11 +775,11 @@ class SchedulerWorkSpace extends Widget { setWidth(this._$allDayTable, width); } - this._attachHeaderTableClasses(); + 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,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'), @@ -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,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,66 +920,66 @@ 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) { + 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, ); } - _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); + 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)) { @@ -1029,14 +1029,14 @@ 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); - this._setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target); + const cellCoordinates = this.getCoordinatesByCell($target); + const isAllDayCell = this.hasAllDayClass($target); + this.setSelectedCellsStateAndUpdateSelection(isAllDayCell, cellCoordinates, false, $target); } } - _handleSelectedCellsClick() { - const selectedCells = this._getSelectedCellsData(); + private handleSelectedCellsClick() { + const selectedCells = this.getSelectedCellsData(); const firstCellData = selectedCells[0]; const lastCellData = selectedCells[selectedCells.length - 1]; @@ -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()) { + protected 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) { + private 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() { + 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); @@ -1220,12 +1220,12 @@ 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); } }); } - _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}`); + 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,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() { + 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(); @@ -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,41 +1462,41 @@ 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) ?? {}; + const cellData = this.getFullCellData($cell) ?? {}; - return this._normalizeCellData(cellData); + 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) { @@ -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(); @@ -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; @@ -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); @@ -1859,11 +1859,11 @@ 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 isVerticalGrouping = this._isVerticalGroupedWorkSpace(); + const isAllDayCell = this.hasAllDayClass($cell); + const isVerticalGrouping = this.isVerticalGroupedWorkSpace(); if (!(isAllDayCell && !isVerticalGrouping)) { rowIndex -= this.virtualScrollingDispatcher.topVirtualRowsCount; @@ -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; @@ -1922,23 +1922,23 @@ class SchedulerWorkSpace extends Widget { return undefined; } - return allDay && !this._isVerticalGroupedWorkSpace() - ? this._dom_getAllDayPanelCell(position.columnIndex) - : this._dom_getDateCell(position); + return allDay && !this.isVerticalGroupedWorkSpace() + ? 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(), + dateTableCellsMeta: this.getDateTableDOMElementsInfo(), + allDayPanelCellsMeta: this.getAllDayPanelDOMElementsInfo(), })); } 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() { - const dateTableCells = this._getAllCells(false); + 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)); @@ -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({ @@ -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(), ); } @@ -2094,16 +2094,16 @@ class SchedulerWorkSpace extends Widget { }; if (this.option('groups')?.length) { - this._attachGroupCountClass(); + this.attachGroupCountClass(); utils.renovation.renderComponent( this, - this._getGroupHeaderContainer(), + this.getGroupHeaderContainer(), GroupPanelComponent, 'renovatedGroupPanel', 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,8 +2125,8 @@ class SchedulerWorkSpace extends Widget { utils.renovation.renderComponent(this, this._$allDayTitle, AllDayPanelTitleComponent, 'renovatedAllDayPanelTitle', {}); } - this._updateAllDayVisibility(); - this._updateScrollable(); + this.updateAllDayVisibility(); + this.updateScrollable(); } renderRTimeTable() { @@ -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( @@ -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); @@ -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 = () => { @@ -2225,7 +2225,7 @@ class SchedulerWorkSpace extends Widget { enableDefaultDragging, disableDefaultDragging, () => this.getDroppableCell(), - () => this._getDateTables(), + () => this.getDateTables(), () => this.removeDroppableCellClass(), () => this.getCellWidth(), options, @@ -2236,8 +2236,8 @@ class SchedulerWorkSpace extends Widget { // We do not need these methods in renovation // -------------- - _isRenderHeaderPanelEmptyCell() { - return this._isVerticalGroupedWorkSpace(); + protected isRenderHeaderPanelEmptyCell() { + return this.isVerticalGroupedWorkSpace(); } _dispose() { @@ -2307,59 +2307,59 @@ class SchedulerWorkSpace extends Widget { case 'firstDayOfWeek': case 'currentDate': case 'startDate': - this._cleanWorkSpace(); + this.cleanWorkSpace(); break; case 'groups': - this._cleanView(); - this._removeAllDayElements(); - this._initGrouping(); + this.cleanView(); + this.removeAllDayElements(); + this.initGrouping(); this.repaint(); break; case 'groupOrientation': - this._initGroupedStrategy(); - this._createAllDayPanelElements(); - this._removeAllDayElements(); - this._cleanWorkSpace(); - this._toggleGroupByDateClass(); + this.initGroupedStrategy(); + this.createAllDayPanelElements(); + this.removeAllDayElements(); + this.cleanWorkSpace(); + this.toggleGroupByDateClass(); break; case 'showAllDayPanel': - if (this._isVerticalGroupedWorkSpace()) { - this._cleanView(); - this._removeAllDayElements(); - this._initGrouping(); + if (this.isVerticalGroupedWorkSpace()) { + this.cleanView(); + this.removeAllDayElements(); + this.initGrouping(); this.repaint(); } else if (!this.isRenovatedRender()) { - this._updateAllDayVisibility(); - this._updateScrollable(); + this.updateAllDayVisibility(); + this.updateScrollable(); } else { this.renderWorkSpace(); } break; case 'allDayExpanded': - this._updateAllDayExpansion(); - this._attachTablesEvents(); - this._updateScrollable(); + this.updateAllDayExpansion(); + 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.cleanWorkSpace(); + this.toggleWorkSpaceCountClass(); break; case 'groupByDate': - this._cleanWorkSpace(); - this._toggleGroupByDateClass(); + this.cleanWorkSpace(); + 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,12 +2394,12 @@ class SchedulerWorkSpace extends Widget { (this.option('onShowAllDayPanel') as any)(!isHiddenAllDayPanel); } - _getVirtualScrollingDispatcherOptions() { + private getVirtualScrollingDispatcherOptions() { return { 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,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(); + protected cleanWorkSpace() { + this.cleanView(); + this.toggleGroupedClass(); + this.toggleWorkSpaceWithOddCells(); this.virtualScrollingDispatcher.updateDimensions(true); - this._renderView(); - this.option('crossScrollingEnabled') && this._setTableSizes(); + this.renderView(); + 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()); + .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() { + protected getDefaultGroupStrategy() { 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() { - (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() { - (this.$element() as any).toggleClass(WORKSPACE_WITH_ODD_CELLS_CLASS, this._isWorkspaceWithOddCells()); + protected 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()); + protected toggleGroupingDirectionClass() { + (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 .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,12 +2540,12 @@ 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(); } else { - this._createAllDayPanelElements(); + this.createAllDayPanelElements(); } this._$timePanel = $('
').addClass(TIME_PANEL_CLASS).attr('aria-hidden', true); @@ -2554,32 +2554,32 @@ 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 - this._dateTableScrollable = this._createComponent($dateTableScrollable, Scrollable, this._dateTableScrollableConfig()); + this._dateTableScrollable = this._createComponent($dateTableScrollable, Scrollable, this.dateTableScrollableConfig()); 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()) { + if (this.isVerticalGroupedWorkSpace()) { this._$dateTableContainer.append(this._$allDayContainer); this._$dateTableScrollableContent.append( this._$groupTable, @@ -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,21 +2611,21 @@ 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); this.$element().append(this._$flexContainer); - this._createSidebarScrollable(); + this.createSidebarScrollable(); this._$flexContainer.append(this._dateTableScrollable.$element()); this._$dateTableContainer.append(this._$dateTable); @@ -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 { @@ -2645,21 +2645,21 @@ class SchedulerWorkSpace extends Widget { this._sidebarScrollable.$content().append(this._$sidebarScrollableContent); } - _appendHeaderPanelEmptyCellIfNecessary() { - this._isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); + private appendHeaderPanelEmptyCellIfNecessary() { + this.isRenderHeaderPanelEmptyCell() && this._$headerPanelContainer.append(this._$headerPanelEmptyCell); } - _createHeaderScrollable() { + private createHeaderScrollable() { const $headerScrollable = $('
') .addClass(SCHEDULER_HEADER_SCROLLABLE_CLASS) .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); } - _createSidebarScrollable() { + private createSidebarScrollable() { const $timePanelScrollable = $('
') .addClass(SCHEDULER_SIDEBAR_SCROLLABLE_CLASS) .appendTo(this._$flexContainer); @@ -2679,72 +2679,72 @@ 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(); + 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); } _initMarkup() { this.cache.clear(); - this._initWorkSpaceUnits(); + this.initWorkSpaceUnits(); - this._initVirtualScrolling(); + this.initVirtualScrolling(); - this._initDateTableScrollable(); + this.initDateTableScrollable(); - this._createWorkSpaceElements(); + this.createWorkSpaceElements(); // @ts-expect-error super._initMarkup(); if (!this.option('crossScrollingEnabled')) { - this._attachTableClasses(); - this._attachHeaderTableClasses(); + this.attachTableClasses(); + this.attachHeaderTableClasses(); } - this._toggleGroupedClass(); + this.toggleGroupedClass(); - this._renderView(); - this._attachEvents(); + this.renderView(); + this.attachEvents(); } _render() { // @ts-expect-error super._render(); - this._renderDateTimeIndication(); - this._setIndicationUpdateInterval(); + this.renderDateTimeIndication(); + this.setIndicationUpdateInterval(); } - _toggleGroupedClass() { - (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this._getGroupCount() > 0); + private toggleGroupedClass() { + (this.$element() as any).toggleClass(GROUPED_WORKSPACE_CLASS, this.getGroupCount() > 0); } - _renderView() { + renderView() { if (this.isRenovatedRender()) { - if (this._isVerticalGroupedWorkSpace()) { + if (this.isVerticalGroupedWorkSpace()) { this.renderRGroupPanel(); } } else { - this._applyCellTemplates( - this._renderGroupHeader(), + this.applyCellTemplates( + this.renderGroupHeader(), ); } @@ -2753,7 +2753,7 @@ class SchedulerWorkSpace extends Widget { this.virtualScrollingDispatcher.updateDimensions(); } - this._updateGroupTableHeight(); + this.updateGroupTableHeight(); this.updateHeaderEmptyCellWidth(); this._shader = new VerticalShader(this); @@ -2769,58 +2769,58 @@ 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(); } - _detachGroupCountClass() { + protected detachGroupCountClass() { VERTICAL_GROUP_COUNT_CLASSES.forEach((className) => { this.$element().removeClass(className); }); } - _attachGroupCountClass() { + protected attachGroupCountClass() { const className = this._groupedStrategy.getGroupCountClass(this.option('groups')); this.$element().addClass(className); } - _getDateHeaderTemplate() { + protected getDateHeaderTemplate() { return this.option('dateCellTemplate'); } - _updateAllDayVisibility(): void { - this.$element().toggleClass(WORKSPACE_WITH_ALL_DAY_CLASS, this._isShowAllDayPanel()); - this._updateAllDayExpansion(); + protected updateAllDayVisibility(): void { + this.$element().toggleClass(WORKSPACE_WITH_ALL_DAY_CLASS, this.isShowAllDayPanel()); + this.updateAllDayExpansion(); } - _updateAllDayExpansion(): void { - const isExpanded = !this.option('allDayExpanded') && this._isShowAllDayPanel(); + 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 { + 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,10 +2897,10 @@ class SchedulerWorkSpace extends Widget { // These methods should be deleted when we get rid of old render // ---------------- - _createAllDayPanelElements() { - const groupCount = this._getGroupCount(); + protected 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) @@ -2943,40 +2943,40 @@ class SchedulerWorkSpace extends Widget { this.renderRWorkSpace(renderComponents); } 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.renderDateHeader(); + this.renderTimePanel(); + this.renderGroupAllDayPanel(); + this.renderDateTable(); + 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')); - 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 { - const tableCreatorStrategy = this._isVerticalGroupedWorkSpace() ? tableCreator.VERTICAL : tableCreator.HORIZONTAL; + protected makeGroupRows(groups, groupByDate): any { + 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(); + protected renderDateHeader(): any { + const container = this.getDateHeaderContainer(); const $headerRow = $('
').addClass(HEADER_ROW_CLASS); - const count = this._getCellCount(); - const cellTemplate = this._getDateHeaderTemplate(); - const repeatCount = this._getCalculateHeaderCellRepeatCount(); + const count = this.getCellCount(); + const cellTemplate = this.getDateHeaderTemplate(); + const repeatCount = this.getCalculateHeaderCellRepeatCount(); const templateCallbacks = []; const groupByDate = this.isGroupedByDate(); @@ -3007,31 +3007,31 @@ 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); } } 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; - 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()) + ? Math.floor(templateIndex / this.getGroupCount()) : templateIndex; const { completeDateHeaderMap } = this.viewDataProvider; @@ -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) { - if (this._isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { - const groupIndex = this._getGroupIndex(0, templateIndex * indexMultiplier); + protected getGroupsForDateHeaderTemplate(templateIndex, indexMultiplier = 1) { + if (this.isHorizontalGroupedWorkSpace() && !this.isGroupedByDate()) { + const groupIndex = this.getGroupIndex(0, templateIndex * indexMultiplier); const groups = getLeafGroupValues(this.resourceManager.groupsLeafs, groupIndex); return { @@ -3074,61 +3074,61 @@ 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()); } - _renderAllDayPanel(index?: any) { - let cellCount = this._getCellCount(); + protected renderAllDayPanel(index?: any) { + let cellCount = this.getCellCount(); - if (!this._isVerticalGroupedWorkSpace()) { - cellCount *= this._getGroupCount() || 1; + 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 - getCellData: this._oldRender_getAllDayCellData(index), + getCellData: this.oldRender_getAllDayCellData(index), groupIndex: index, }, true); - this._updateAllDayVisibility(); - this._updateScrollable(); - this._applyCellTemplates(cellTemplates); + this.updateAllDayVisibility(); + this.updateScrollable(); + this.applyCellTemplates(cellTemplates); } - _renderGroupAllDayPanel() { - if (this._isVerticalGroupedWorkSpace()) { - const groupCount = this._getGroupCount(); + 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 {}; } - 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; @@ -3148,36 +3148,36 @@ 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() { - const groupCount = this._getGroupCount(); - this._renderTableBody({ + protected renderDateTable() { + 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; } @@ -3194,25 +3194,25 @@ 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, }; }, - 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( + 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..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,12 +8,12 @@ const DAY_CLASS = 'dx-scheduler-work-space-day'; class SchedulerWorkSpaceDay extends SchedulerWorkSpaceVertical { get type() { return VIEWS.DAY; } - _getElementClass() { + getElementClass() { 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_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..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 @@ -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; } @@ -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; } @@ -173,7 +173,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { renderCurrentDateTimeLineAndShader(): void { this._cleanDateTimeIndicator(); this._shader?.clean(); - this._renderDateTimeIndication(); + this.renderDateTimeIndication(); } _isCurrentTimeHeaderCell(headerIndex: number): boolean { @@ -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}`; @@ -197,8 +197,8 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { return cellClass; } - _cleanView() { - super._cleanView(); + cleanView() { + super.cleanView(); this._cleanDateTimeIndicator(); } @@ -213,21 +213,21 @@ 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(); + this.renderDateTimeIndication(); + this.setIndicationUpdateInterval(); } _optionChanged(args) { switch (args.name) { case 'showCurrentTimeIndicator': case 'indicatorTime': - this._cleanWorkSpace(); + this.cleanWorkSpace(); break; case 'indicatorUpdateInterval': - this._setIndicationUpdateInterval(); + this.setIndicationUpdateInterval(); break; case 'showAllDayPanel': case 'allDayExpanded': @@ -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)] @@ -282,7 +282,7 @@ class SchedulerWorkSpaceIndicator extends SchedulerWorkSpace { ], []); } - protected _renderDateTimeIndication(): void { + protected renderDateTimeIndication(): void { if (!this.isIndicationAvailable()) { return; } @@ -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..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; }); @@ -64,13 +64,13 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { }); } - _insertAllDayRowsIntoDateTable() { + insertAllDayRowsIntoDateTable() { 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(); + 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(), ); } @@ -146,15 +146,15 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { // We need these methods for now but they are useless for renovation // ------------- - _createWorkSpaceElements() { - if (this._isVerticalGroupedWorkSpace()) { - this._createWorkSpaceScrollableElements(); + createWorkSpaceElements() { + if (this.isVerticalGroupedWorkSpace()) { + this.createWorkSpaceScrollableElements(); } else { - super._createWorkSpaceElements(); + super.createWorkSpaceElements(); } } - _updateAllDayVisibility() { return noop(); } + updateAllDayVisibility() { return noop(); } _updateAllDayHeight() { return noop(); } @@ -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 @@ -173,9 +173,9 @@ class SchedulerWorkSpaceMonth extends SchedulerWorkSpace { .toggleClass(DATE_TABLE_OTHER_MONTH_DATE_CLASS, data.otherMonth); } - _createAllDayPanelElements() {} + 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); } } 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..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; } @@ -16,7 +16,7 @@ class SchedulerWorkspaceVertical extends SchedulerWorkSpaceIndicator { }; } - _isRenderHeaderPanelEmptyCell() { + isRenderHeaderPanelEmptyCell() { return true; } } diff --git a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space_week.ts index 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; } } 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, 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) 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/timeline.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/timeline.tests.js index 4147d5951d1e..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'); @@ -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.base.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.base.tests.js index 3f674c4d3532..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); @@ -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.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.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) { 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..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), @@ -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(); 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..0dacd9ee746c 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/workSpace.renovation.tests.js @@ -60,7 +60,7 @@ module('Renovated Render', { onContentReady: function(e) { const scrollable = e.component.getScrollable(); scrollable.option('scrollByContent', false); - e.component._attachTablesEvents(); + e.component.attachTablesEvents(); }, ...options, })[workSpace]('instance'); @@ -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'); 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);