Skip to content

Commit de72b05

Browse files
authored
Scheduler — Replace underscore-prefixed: workspaces/m_work_space.ts (#32880)
1 parent d74d017 commit de72b05

31 files changed

Lines changed: 616 additions & 611 deletions

packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class CompactAppointmentsHelper {
8989
getItemSettings,
9090
};
9191

92-
workSpace._createDragBehaviorBase($element, $schedulerElement, options);
92+
workSpace.createDragBehaviorBase($element, $schedulerElement, options);
9393
};
9494
}
9595

packages/devextreme/js/__internal/scheduler/m_scheduler.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
11641164
_initMarkupCore() {
11651165
this._readyToRenderAppointments = hasWindow();
11661166

1167-
this._workSpace && this._cleanWorkspace();
1167+
this._workSpace && this.cleanWorkSpace();
11681168

11691169
this._renderWorkSpace();
11701170
this._appointments.option({
@@ -1253,7 +1253,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
12531253
getResizableStep: () => (this._workSpace ? this._workSpace.positionHelper.getResizableStep() : 0),
12541254
getDOMElementsMetaData: () => this._workSpace?.getDOMElementsMetaData(),
12551255
getViewDataProvider: () => this._workSpace?.viewDataProvider,
1256-
isVerticalGroupedWorkSpace: () => this._workSpace._isVerticalGroupedWorkSpace(),
1256+
isVerticalGroupedWorkSpace: () => this._workSpace.isVerticalGroupedWorkSpace(),
12571257
isDateAndTimeView: () => isDateAndTimeView(this._workSpace.type),
12581258
onContentReady: () => {
12591259
this._workSpace?.option('allDayExpanded', this._isAllDayExpanded());
@@ -1297,12 +1297,12 @@ class Scheduler extends SchedulerOptionsBaseWidget {
12971297
this._workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig);
12981298

12991299
this._allowDragging() && this._workSpace.initDragBehavior(this, this._all);
1300-
this._workSpace._attachTablesEvents();
1300+
this._workSpace.attachTablesEvents();
13011301
this._workSpace.getWorkArea().append(this._appointments.$element());
13021302

13031303
this._recalculateWorkspace();
13041304
if (currentViewOptions.startDate) {
1305-
this._updateOption('header', 'currentDate', this._workSpace._getHeaderDate());
1305+
this._updateOption('header', 'currentDate', this._workSpace.getHeaderDate());
13061306
}
13071307
}
13081308

@@ -1418,7 +1418,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
14181418
}
14191419

14201420
_refreshWorkSpace(): void {
1421-
this._cleanWorkspace();
1421+
this.cleanWorkSpace();
14221422

14231423
delete this._workSpace;
14241424

@@ -1433,7 +1433,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
14331433
}
14341434
}
14351435

1436-
_cleanWorkspace() {
1436+
cleanWorkSpace() {
14371437
this._appointments.$element().detach();
14381438
this._workSpace._dispose();
14391439
this._workSpace.$element().remove();

packages/devextreme/js/__internal/scheduler/m_subscribes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ const subscribes = {
167167
};
168168
}
169169

170-
if (!allDay && VERTICAL_VIEW_TYPES.includes(this.currentView.type) && this._workSpace._isVerticalGroupedWorkSpace()) {
170+
if (!allDay && VERTICAL_VIEW_TYPES.includes(this.currentView.type) && this._workSpace.isVerticalGroupedWorkSpace()) {
171171
const verticalGroupBounds = this._workSpace.getGroupBounds(options.coordinates);
172172
return {
173173
left: 0,

packages/devextreme/js/__internal/scheduler/view_model/m_appointments_layout_manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ class AppointmentLayoutManager {
7474
const DOMMetaData = workspace.getDOMElementsMetaData();
7575
const allDayHeight = getAllDayHeight(
7676
workspace.option('showAllDayPanel'),
77-
workspace._isVerticalGroupedWorkSpace(),
77+
workspace.isVerticalGroupedWorkSpace(),
7878
DOMMetaData,
7979
);
80-
const rowCount = workspace._getRowCount();
80+
const rowCount = workspace.getRowCount();
8181
const { positionHelper, viewDataProvider } = workspace;
8282
const visibleDayDuration = viewDataProvider.getVisibleDayDuration(
8383
workspace.option('startDayHour'),
@@ -119,7 +119,7 @@ class AppointmentLayoutManager {
119119
allowResizing: this.instance._allowResizing(),
120120
allowAllDayResizing: this.instance._allowAllDayResizing(),
121121
startViewDate: workspace.getStartViewDate(),
122-
groupOrientation: workspace._getRealGroupOrientation(),
122+
groupOrientation: workspace.getRealGroupOrientation(),
123123
cellWidth: getCellWidth(DOMMetaData),
124124
cellHeight: getCellHeight(DOMMetaData),
125125
allDayHeight,

packages/devextreme/js/__internal/scheduler/workspaces/m_agenda.ts

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class SchedulerAgenda extends WorkSpace {
9191
if (this._$groupTable) {
9292
this._$groupTable.remove();
9393
this._$groupTable = null;
94-
this._detachGroupCountClass();
94+
this.detachGroupCountClass();
9595
}
9696
} else if (!this._$groupTable) {
9797
this._initGroupTable();
@@ -114,37 +114,37 @@ class SchedulerAgenda extends WorkSpace {
114114
return false;
115115
}
116116

117-
_isVerticalGroupedWorkSpace() {
117+
protected override isVerticalGroupedWorkSpace() {
118118
return false;
119119
}
120120

121-
_getElementClass() {
121+
protected override getElementClass() {
122122
return AGENDA_CLASS;
123123
}
124124

125125
_calculateStartViewDate() {
126126
return agendaUtils.calculateStartViewDate(this.option('currentDate') as any, this.option('startDayHour') as any);
127127
}
128128

129-
_getRowCount() {
129+
protected override getRowCount() {
130130
return this.option('agendaDuration') as number;
131131
}
132132

133133
_getCellCount() {
134134
return 1;
135135
}
136136

137-
_getTimePanelRowCount() {
137+
protected override getTimePanelRowCount() {
138138
return this.option('agendaDuration') as number;
139139
}
140140

141-
_renderAllDayPanel() { return noop(); }
141+
protected override renderAllDayPanel() { return noop(); }
142142

143-
_updateAllDayVisibility() { return noop(); }
143+
protected override updateAllDayVisibility() { return noop(); }
144144

145145
_updateAllDayHeight() { return noop(); }
146146

147-
_initWorkSpaceUnits() {
147+
protected override initWorkSpaceUnits() {
148148
this._initGroupTable();
149149
this._$timePanel = $('<table>').attr('aria-hidden', true).addClass(TIME_PANEL_CLASS);
150150
this._$dateTable = $('<table>').attr('aria-hidden', true).addClass(DATE_TABLE_CLASS);
@@ -159,10 +159,10 @@ class SchedulerAgenda extends WorkSpace {
159159
}
160160
}
161161

162-
_renderView() {
162+
protected override renderView() {
163163
this._startViewDate = this._calculateStartViewDate();
164164
this._rows = [];
165-
this._initPositionHelper();
165+
this.initPositionHelper();
166166
}
167167

168168
_recalculateAgenda(rows) {
@@ -176,14 +176,14 @@ class SchedulerAgenda extends WorkSpace {
176176
this._rows = rows;
177177

178178
if (this._$groupTable) {
179-
cellTemplates = this._renderGroupHeader();
179+
cellTemplates = this.renderGroupHeader();
180180
this._setGroupHeaderCellsHeight();
181181
}
182182

183-
this._renderTimePanel();
184-
this._renderDateTable();
183+
this.renderTimePanel();
184+
this.renderDateTable();
185185
(this.invoke as any)('onAgendaReady', rows);
186-
this._applyCellTemplates(cellTemplates);
186+
this.applyCellTemplates(cellTemplates);
187187
this._dateTableScrollable.update();
188188
}
189189

@@ -194,15 +194,15 @@ class SchedulerAgenda extends WorkSpace {
194194
this._dateTableScrollable.$content().append(this._$noDataContainer);
195195
}
196196

197-
_setTableSizes() { return noop(); }
197+
protected override setTableSizes() { return noop(); }
198198

199-
_toggleHorizontalScrollClass() { return noop(); }
199+
protected override toggleHorizontalScrollClass() { return noop(); }
200200

201201
// eslint-disable-next-line @typescript-eslint/no-unused-vars
202202
_createCrossScrollingConfig(argument?: any) { return noop(); }
203203

204204
_setGroupHeaderCellsHeight() {
205-
const $cells = this._getGroupHeaderCells().filter((_, element) => !element.getAttribute('rowSpan'));
205+
const $cells = this.getGroupHeaderCells().filter((_, element) => !element.getAttribute('rowSpan'));
206206
const rows = this._removeEmptyRows(this._rows);
207207

208208
if (!rows.length) {
@@ -232,7 +232,7 @@ class SchedulerAgenda extends WorkSpace {
232232
return result;
233233
}
234234

235-
_attachGroupCountClass() {
235+
protected override attachGroupCountClass() {
236236
const className = getVerticalGroupCountClass(this.option('groups'));
237237
(this.$element() as any).addClass(className);
238238
}
@@ -252,11 +252,11 @@ class SchedulerAgenda extends WorkSpace {
252252
return result;
253253
}
254254

255-
_getGroupHeaderContainer() {
255+
protected override getGroupHeaderContainer() {
256256
return this._$groupTable;
257257
}
258258

259-
_makeGroupRows() {
259+
protected override makeGroupRows() {
260260
const resourceManager = this.option('getResourceManager')();
261261
const allAppointments = (this.option('getFilteredItems') as any)();
262262
const tree = reduceResourcesTree(
@@ -273,7 +273,7 @@ class SchedulerAgenda extends WorkSpace {
273273
cellTag: 'th',
274274
groupTableClass: GROUP_TABLE_CLASS,
275275
groupRowClass: GROUP_ROW_CLASS,
276-
groupCellClass: this._getGroupHeaderClass(),
276+
groupCellClass: this.getGroupHeaderClass(),
277277
groupCellCustomContent(cell: HTMLDivElement, cellTextElement: HTMLElement, index: number, node: GroupNode) {
278278
const container = domAdapter.createElement('div');
279279
container.className = getGroupHeaderContentClass;
@@ -328,11 +328,11 @@ class SchedulerAgenda extends WorkSpace {
328328
}
329329
}
330330

331-
_createWorkSpaceElements() {
332-
this._createWorkSpaceStaticElements();
331+
protected override createWorkSpaceElements() {
332+
this.createWorkSpaceStaticElements();
333333
}
334334

335-
_createWorkSpaceStaticElements() {
335+
protected override createWorkSpaceStaticElements() {
336336
this._$dateTableContainer.append(this._$dateTable);
337337
this._dateTableScrollable.$content().append(this._$dateTableScrollableContent);
338338

@@ -344,17 +344,17 @@ class SchedulerAgenda extends WorkSpace {
344344
this.$element().append(this._dateTableScrollable.$element());
345345
}
346346

347-
_renderDateTable() {
348-
this._renderTableBody({
347+
protected override renderDateTable() {
348+
this.renderTableBody({
349349
container: getPublicElement(this._$dateTable),
350350
rowClass: DATE_TABLE_ROW_CLASS,
351-
cellClass: this._getDateTableCellClass(),
351+
cellClass: this.getDateTableCellClass(),
352352
});
353353
}
354354

355-
_attachTablesEvents() { return noop(); }
355+
protected override attachTablesEvents() { return noop(); }
356356

357-
_attachEvents() { return noop(); }
357+
protected override attachEvents() { return noop(); }
358358

359359
_cleanCellDataCache() { return noop(); }
360360

@@ -380,7 +380,7 @@ class SchedulerAgenda extends WorkSpace {
380380
}
381381

382382
// eslint-disable-next-line @typescript-eslint/no-unused-vars
383-
_renderTableBody(options: any, delayCellTemplateRendering?: any) {
383+
protected override renderTableBody(options: any, delayCellTemplateRendering?: any) {
384384
const cellTemplates: any[] = [];
385385
const cellTemplateOpt = options.cellTemplate;
386386

@@ -429,7 +429,7 @@ class SchedulerAgenda extends WorkSpace {
429429
}
430430

431431
$(options.container).append($('<tbody>').append(this._$rows));
432-
this._applyCellTemplates(cellTemplates);
432+
this.applyCellTemplates(cellTemplates);
433433
}
434434

435435
_setLastRowClass() {
@@ -440,10 +440,10 @@ class SchedulerAgenda extends WorkSpace {
440440
}
441441
}
442442

443-
_renderTimePanel() {
444-
this._renderTableBody({
443+
protected override renderTimePanel() {
444+
this.renderTableBody({
445445
container: getPublicElement(this._$timePanel),
446-
rowCount: this._getTimePanelRowCount(),
446+
rowCount: this.getTimePanelRowCount(),
447447
cellCount: 1,
448448
rowClass: TIME_PANEL_ROW_CLASS,
449449
cellClass: TIME_PANEL_CELL_CLASS,
@@ -491,7 +491,7 @@ class SchedulerAgenda extends WorkSpace {
491491
onDataSourceChanged(appointments?: SafeAppointment[]) {
492492
super.onDataSourceChanged();
493493

494-
this._renderView();
494+
this.renderView();
495495

496496
const rows = this._calculateRows(appointments);
497497
this._recalculateAgenda(rows);

0 commit comments

Comments
 (0)