').appendTo(this.mainContainer);
const currentViewType = this.currentView.type;
const workSpaceComponent = VIEWS_CONFIG[currentViewType].workSpace;
- const workSpaceConfig = this._workSpaceConfig(this.currentView);
+ const workSpaceConfig = this.workSpaceConfig(this.currentView);
// @ts-expect-error
- this._workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig);
+ this.workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig);
- this._allowDragging() && this._workSpace.initDragBehavior(this, this._all);
- this._workSpace._attachTablesEvents();
- this._workSpace.getWorkArea().append(this._appointments.$element());
+ this.allowDragging() && this.workSpace.initDragBehavior(this, this.all);
+ this.workSpace._attachTablesEvents();
+ this.workSpace.getWorkArea().append(this.appointments.$element());
}
renderAgendaWorkspace(): void {
- const $workSpace = $('
').appendTo(this._mainContainer);
- const workSpaceConfig = this._workSpaceConfig(this.currentView);
+ const $workSpace = $('
').appendTo(this.mainContainer);
+ const workSpaceConfig = this.workSpaceConfig(this.currentView);
const workSpaceComponent = VIEWS_CONFIG.agenda.workSpace;
// @ts-expect-error
- this._workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig);
- this._workSpace.getWorkArea().append(this._appointments.$element());
+ this.workSpace = this._createComponent($workSpace, workSpaceComponent, workSpaceConfig);
+ this.workSpace.getWorkArea().append(this.appointments.$element());
}
- _recalculateWorkspace() {
+ private recalculateWorkspace() {
// @ts-expect-error
- this._workSpaceRecalculation = new Deferred();
- triggerResizeEvent(this._workSpace.$element());
- this._waitAsyncTemplate(() => {
- this._workSpace.renderCurrentDateTimeLineAndShader();
+ this.workSpaceRecalculation = new Deferred();
+ triggerResizeEvent(this.workSpace.$element());
+ this.waitAsyncTemplate(() => {
+ this.workSpace.renderCurrentDateTimeLineAndShader();
});
}
- _workSpaceConfig(currentViewOptions: NormalizedView) {
+ private workSpaceConfig(currentViewOptions: NormalizedView) {
const scrolling = this.getViewOption('scrolling');
const isVirtualScrolling = scrolling.mode === 'virtual';
const horizontalVirtualScrollingAllowed = isVirtualScrolling
@@ -1339,7 +1339,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
const result = extend({
resources: this.option('resources'),
getResourceManager: () => this.resourceManager,
- getFilteredItems: () => this._layoutManager.filteredItems, // NOTE: used only in agenda
+ getFilteredItems: () => this.layoutManager.filteredItems, // NOTE: used only in agenda
noDataText: this.option('noDataText') || messageLocalization.format('dxCollectionWidget-noDataText'),
firstDayOfWeek: this.option('firstDayOfWeek'),
@@ -1374,17 +1374,17 @@ class Scheduler extends SchedulerOptionsBaseWidget {
allDayPanelMode: this.option('allDayPanelMode'),
onSelectedCellsClick: this.showAddAppointmentPopup.bind(this),
onRenderAppointments: () => {
- this._renderAppointments();
+ this.renderAppointments();
},
onShowAllDayPanel: (value) => this.option('showAllDayPanel', value),
- getHeaderHeight: () => utils.DOM.getHeaderHeight(this._header),
- onScrollEnd: () => this._appointments.updateResizableArea(),
+ getHeaderHeight: () => utils.DOM.getHeaderHeight(this.header),
+ onScrollEnd: () => this.appointments.updateResizableArea(),
// TODO: SSR does not work correctly with renovated render
- renovateRender: this._isRenovatedRender(isVirtualScrolling),
+ renovateRender: this.isRenovatedRender(isVirtualScrolling),
}, currentViewOptions);
- result.notifyScheduler = this._notifyScheduler;
+ result.notifyScheduler = this.notifyScheduler;
result.groups = this.resourceManager.groupResources();
result.onCellClick = this._createActionByOption('onCellClick');
result.onCellContextMenu = this._createActionByOption('onCellContextMenu');
@@ -1399,23 +1399,23 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return result;
}
- _isRenovatedRender(isVirtualScrolling) {
+ private isRenovatedRender(isVirtualScrolling) {
return (this.option('renovateRender') && hasWindow()) || isVirtualScrolling;
}
- _waitAsyncTemplate(callback) {
+ private waitAsyncTemplate(callback) {
if (this._options.silent('templatesRenderAsynchronously')) {
const timer = setTimeout(() => {
callback();
clearTimeout(timer);
});
- this._asyncTemplatesTimers.push(timer);
+ this.asyncTemplatesTimers.push(timer);
} else {
callback();
}
}
- _getAppointmentTemplate(optionName) {
+ private getAppointmentTemplate(optionName) {
if (this.currentView?.[optionName]) {
return this._getTemplate(this.currentView[optionName]);
}
@@ -1424,55 +1424,55 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return this._getTemplateByOption(optionName);
}
- _updateOption(viewName: 'workSpace' | 'header', optionName: string, value: T): void {
+ private updateOption(viewName: 'workSpace' | 'header', optionName: string, value: T): void {
this[`_${viewName}`]?.option(optionName, value);
}
- _refreshWorkSpace(): void {
- this._cleanWorkspace();
+ private refreshWorkSpace(): void {
+ this.cleanWorkspace();
- delete this._workSpace;
+ delete this.workSpace;
- this._renderWorkSpace();
+ this.renderWorkSpace();
- if (this._readyToRenderAppointments) {
- this._appointments.option({
- fixedContainer: this._workSpace.getFixedContainer(),
- allDayContainer: this._workSpace.getAllDayContainer(),
+ if (this.readyToRenderAppointments) {
+ this.appointments.option({
+ fixedContainer: this.workSpace.getFixedContainer(),
+ allDayContainer: this.workSpace.getAllDayContainer(),
});
- this._waitAsyncTemplate(() => this._workSpaceRecalculation.resolve());
+ this.waitAsyncTemplate(() => this.workSpaceRecalculation.resolve());
}
}
- _cleanWorkspace() {
- this._appointments.$element().detach();
- this._workSpace._dispose();
- this._workSpace.$element().remove();
+ private cleanWorkspace() {
+ this.appointments.$element().detach();
+ this.workSpace._dispose();
+ this.workSpace.$element().remove();
this.option('selectedCellData', []);
}
getWorkSpaceScrollable() {
- return this._workSpace.getScrollable();
+ return this.workSpace.getScrollable();
}
getWorkSpaceScrollableContainer() {
- return this._workSpace.getScrollableContainer();
+ return this.workSpace.getScrollableContainer();
}
getWorkSpace() {
- return this._workSpace;
+ return this.workSpace;
}
getHeader() {
- return this._header;
+ return this.header;
}
- _cleanPopup() {
- this._appointmentPopup?.dispose();
+ private cleanPopup() {
+ this.appointmentPopup?.dispose();
}
- _checkRecurringAppointment(
+ private checkRecurringAppointment(
rawAppointment,
singleAppointment,
exceptionDate,
@@ -1482,9 +1482,9 @@ class Scheduler extends SchedulerOptionsBaseWidget {
dragEvent?: any,
recurrenceEditMode?: any,
) {
- const recurrenceRule = this._dataAccessors.get('recurrenceRule', rawAppointment);
+ const recurrenceRule = this.dataAccessors.get('recurrenceRule', rawAppointment);
- if (!validateRRule(recurrenceRule) || !this._editing.allowUpdating) {
+ if (!validateRRule(recurrenceRule) || !this.editing.allowUpdating) {
callback();
return;
}
@@ -1495,18 +1495,18 @@ class Scheduler extends SchedulerOptionsBaseWidget {
callback();
break;
case 'occurrence':
- this._excludeAppointmentFromSeries(rawAppointment, singleAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent);
+ this.excludeAppointmentFromSeries(rawAppointment, singleAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent);
break;
default:
if (dragEvent) {
// @ts-expect-error
dragEvent.cancel = new Deferred();
}
- this._showRecurrenceChangeConfirm(isDeleted)
+ this.showRecurrenceChangeConfirm(isDeleted)
.done((editingMode) => {
editingMode === RECURRENCE_EDITING_MODE.SERIES && callback();
- editingMode === RECURRENCE_EDITING_MODE.OCCURRENCE && this._excludeAppointmentFromSeries(
+ editingMode === RECURRENCE_EDITING_MODE.OCCURRENCE && this.excludeAppointmentFromSeries(
rawAppointment,
singleAppointment,
exceptionDate,
@@ -1515,21 +1515,21 @@ class Scheduler extends SchedulerOptionsBaseWidget {
dragEvent,
);
})
- .fail(() => this._appointments.moveAppointmentBack(dragEvent));
+ .fail(() => this.appointments.moveAppointmentBack(dragEvent));
}
}
- _excludeAppointmentFromSeries(rawAppointment, newRawAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent) {
+ private excludeAppointmentFromSeries(rawAppointment, newRawAppointment, exceptionDate, isDeleted, isPopupEditing, dragEvent) {
const appointment = excludeFromRecurrence(
rawAppointment,
exceptionDate,
- this._dataAccessors,
+ this.dataAccessors,
);
const singleRawAppointment = { ...newRawAppointment };
/* eslint-disable @typescript-eslint/no-dynamic-delete */
- delete singleRawAppointment[this._dataAccessors.expr.recurrenceExceptionExpr];
- delete singleRawAppointment[this._dataAccessors.expr.recurrenceRuleExpr];
+ delete singleRawAppointment[this.dataAccessors.expr.recurrenceExceptionExpr];
+ delete singleRawAppointment[this.dataAccessors.expr.recurrenceRuleExpr];
const keyPropertyName = this.appointmentDataSource.keyName;
delete singleRawAppointment[keyPropertyName];
@@ -1541,7 +1541,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
if (isPopupEditing) {
- this._appointmentPopup.show(singleRawAppointment, {
+ this.appointmentPopup.show(singleRawAppointment, {
isToolbarVisible: true, // TODO: remove when legacyForm is deleted
action: ACTION_TO_APPOINTMENT.EXCLUDE_FROM_SERIES,
excludeInfo: {
@@ -1549,26 +1549,26 @@ class Scheduler extends SchedulerOptionsBaseWidget {
updatedAppointment: appointment.source,
},
});
- this._editAppointmentData = rawAppointment;
+ this.editAppointmentData = rawAppointment;
} else {
this._updateAppointment(rawAppointment, appointment.source, () => {
- this._appointments.moveAppointmentBack(dragEvent);
+ this.appointments.moveAppointmentBack(dragEvent);
}, dragEvent);
}
}
- _createRecurrenceException(appointment, exceptionDate) {
+ private createRecurrenceException(appointment, exceptionDate) {
const result: any[] = [];
if (appointment.recurrenceException) {
result.push(appointment.recurrenceException);
}
- result.push(this._getSerializedDate(exceptionDate, appointment.startDate, appointment.allDay));
+ result.push(this.getSerializedDate(exceptionDate, appointment.startDate, appointment.allDay));
return result.join();
}
- _getSerializedDate(date, startDate, isAllDay) {
+ private getSerializedDate(date, startDate, isAllDay) {
isAllDay && date.setHours(
startDate.getHours(),
startDate.getMinutes(),
@@ -1579,13 +1579,13 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return dateSerialization.serializeDate(date, UTC_FULL_DATE_FORMAT);
}
- _showRecurrenceChangeConfirm(isDeleted) {
+ private showRecurrenceChangeConfirm(isDeleted) {
const title = messageLocalization.format(isDeleted ? 'dxScheduler-confirmRecurrenceDeleteTitle' : 'dxScheduler-confirmRecurrenceEditTitle');
const message = messageLocalization.format(isDeleted ? 'dxScheduler-confirmRecurrenceDeleteMessage' : 'dxScheduler-confirmRecurrenceEditMessage');
const seriesText = messageLocalization.format(isDeleted ? 'dxScheduler-confirmRecurrenceDeleteSeries' : 'dxScheduler-confirmRecurrenceEditSeries');
const occurrenceText = messageLocalization.format(isDeleted ? 'dxScheduler-confirmRecurrenceDeleteOccurrence' : 'dxScheduler-confirmRecurrenceEditOccurrence');
- this._recurrenceDialog = customDialog({
+ this.recurrenceDialog = customDialog({
title,
messageHtml: message,
showCloseButton: true,
@@ -1597,15 +1597,15 @@ class Scheduler extends SchedulerOptionsBaseWidget {
popupOptions: {
wrapperAttr: { class: POPUP_DIALOG_CLASS },
onHidden: () => {
- this._appointments?.focus();
+ this.appointments?.focus();
},
},
} as any);
- return this._recurrenceDialog.show();
+ return this.recurrenceDialog.show();
}
- _getUpdatedData(rawAppointment) {
+ private getUpdatedData(rawAppointment) {
const viewOffset = this.getViewOffsetMs();
const getConvertedFromGrid = (date: any): Date | undefined => {
@@ -1620,7 +1620,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
const targetCell = this.getTargetCellData();
const appointment = new AppointmentAdapter(
rawAppointment,
- this._dataAccessors,
+ this.dataAccessors,
);
const cellStartDate = getConvertedFromGrid(targetCell.startDate);
@@ -1642,7 +1642,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
const duration = appointmentEndDate.getTime() - appointmentStartDate.getTime();
- const isKeepAppointmentHours = this._workSpace.keepOriginalHours()
+ const isKeepAppointmentHours = this.workSpace.keepOriginalHours()
&& dateUtilsTs.isValidDate(appointment.startDate)
&& dateUtilsTs.isValidDate(cellStartDate);
@@ -1657,7 +1657,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
const result = new AppointmentAdapter(
{},
- this._dataAccessors,
+ this.dataAccessors,
);
if (targetCell.allDay !== undefined) {
@@ -1667,11 +1667,11 @@ class Scheduler extends SchedulerOptionsBaseWidget {
let resultedEndDate = new Date(resultedStartDate.getTime() + duration);
- if (this.appointmentTakesAllDay(rawAppointment) && !result.allDay && this._workSpace.supportAllDayRow()) {
- resultedEndDate = this._workSpace.calculateEndDate(resultedStartDate);
+ if (this.appointmentTakesAllDay(rawAppointment) && !result.allDay && this.workSpace.supportAllDayRow()) {
+ resultedEndDate = this.workSpace.calculateEndDate(resultedStartDate);
}
- if (appointment.allDay && !this._workSpace.supportAllDayRow() && !this._workSpace.keepOriginalHours()) {
+ if (appointment.allDay && !this.workSpace.supportAllDayRow() && !this.workSpace.keepOriginalHours()) {
const dateCopy = new Date(resultedStartDate);
dateCopy.setHours(0);
@@ -1696,20 +1696,20 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return getTargetedAppointment(
appointment,
settings,
- this._dataAccessors,
+ this.dataAccessors,
this.resourceManager,
);
}
subscribe(subject, action) {
- this._subscribes[subject] = subscribes[subject] = action;
+ this.subscribes[subject] = subscribes[subject] = action;
}
fire(
subject: Subject,
...args: Parameters
): ReturnType {
- const callback = this._subscribes[subject];
+ const callback = this.subscribes[subject];
if (!isFunction(callback)) {
throw errors.Error('E1031', subject);
@@ -1719,10 +1719,10 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
getTargetCellData() {
- return this._workSpace.getDataByDroppableCell();
+ return this.workSpace.getDataByDroppableCell();
}
- _updateAppointment(target, rawAppointment, onUpdatePrevented?: any, dragEvent?: any) {
+ private _updateAppointment(target, rawAppointment, onUpdatePrevented?: any, dragEvent?: any) {
const updatingOptions = {
newData: rawAppointment,
oldData: extend({}, target),
@@ -1739,7 +1739,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
}.bind(this);
- this._actions[StoreEventNames.UPDATING](updatingOptions);
+ this.actions[StoreEventNames.UPDATING](updatingOptions);
if (dragEvent && !isDeferred(dragEvent.cancel)) {
// @ts-expect-error
@@ -1747,15 +1747,15 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
if (isPromise(updatingOptions.cancel) && dragEvent) {
- this._updatingAppointments.add(target);
+ this.updatingAppointments.add(target);
}
- return this._processActionResult(updatingOptions, function (canceled) {
+ return this.processActionResult(updatingOptions, function (canceled) {
// @ts-expect-error
let deferred = new Deferred();
if (!canceled) {
- this._expandAllDayPanel(rawAppointment);
+ this.expandAllDayPanel(rawAppointment);
try {
deferred = this.appointmentDataSource
@@ -1764,18 +1764,18 @@ class Scheduler extends SchedulerOptionsBaseWidget {
dragEvent?.cancel.resolve(false);
})
.always((storeAppointment) => {
- this._updatingAppointments.delete(target);
- this._onDataPromiseCompleted(StoreEventNames.UPDATED, storeAppointment);
+ this.updatingAppointments.delete(target);
+ this.onDataPromiseCompleted(StoreEventNames.UPDATED, storeAppointment);
})
.fail(() => performFailAction());
} catch (err) {
performFailAction(err);
- this._updatingAppointments.delete(target);
+ this.updatingAppointments.delete(target);
deferred.resolve();
}
} else {
performFailAction();
- this._updatingAppointments.delete(target);
+ this.updatingAppointments.delete(target);
deferred.resolve();
}
@@ -1783,7 +1783,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
});
}
- _processActionResult(actionOptions, callback) {
+ private processActionResult(actionOptions, callback) {
// @ts-expect-error
const deferred = new Deferred();
const resolveCallback = (callbackResult) => {
@@ -1805,48 +1805,48 @@ class Scheduler extends SchedulerOptionsBaseWidget {
return deferred.promise();
}
- _expandAllDayPanel(appointment) {
- if (!this._isAllDayExpanded() && this.appointmentTakesAllDay(appointment)) {
- this._updateOption('workSpace', 'allDayExpanded', true);
+ private expandAllDayPanel(appointment) {
+ if (!this.isAllDayExpanded() && this.appointmentTakesAllDay(appointment)) {
+ this.updateOption('workSpace', 'allDayExpanded', true);
}
}
- _onDataPromiseCompleted(handlerName, storeAppointment, appointment?: any) {
+ private onDataPromiseCompleted(handlerName, storeAppointment, appointment?: any) {
const args: any = { appointmentData: appointment || storeAppointment };
if (storeAppointment instanceof Error) {
args.error = storeAppointment;
} else {
- this._appointmentPopup.visible && this._appointmentPopup.hide();
+ this.appointmentPopup.visible && this.appointmentPopup.hide();
}
- this._actions[handlerName](args);
+ this.actions[handlerName](args);
this._fireContentReadyAction();
}
/// #DEBUG
// TODO: remove when legacyForm is deleted
getAppointmentDetailsForm() { // for tests
- return this._appointmentForm.form;
+ return this.appointmentForm.form;
}
/// #ENDDEBUG
getAppointmentsInstance() {
- return this._appointments;
+ return this.appointments;
}
getLayoutManager() {
- return this._layoutManager;
+ return this.layoutManager;
}
getActions() {
- return this._actions;
+ return this.actions;
}
appointmentTakesAllDay(rawAppointment) {
const appointment = new AppointmentAdapter(
rawAppointment,
- this._dataAccessors,
+ this.dataAccessors,
);
return isAppointmentTakesAllDay(
@@ -1860,7 +1860,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
const appointment = new AppointmentAdapter(
rawAppointment,
- this._dataAccessors,
+ this.dataAccessors,
);
let startDate = new Date(appointment.startDate);
@@ -1887,15 +1887,15 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
getStartViewDate() {
- return this._workSpace?.getStartViewDate();
+ return this.workSpace?.getStartViewDate();
}
getEndViewDate() {
- return this._workSpace.getEndViewDate();
+ return this.workSpace.getEndViewDate();
}
showAddAppointmentPopup(cellData, cellGroups) {
- const appointmentAdapter = new AppointmentAdapter({}, this._dataAccessors);
+ const appointmentAdapter = new AppointmentAdapter({}, this.dataAccessors);
appointmentAdapter.allDay = Boolean(cellData.allDay);
appointmentAdapter.startDate = cellData.startDateUTC;
@@ -1921,19 +1921,19 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
if (isCreateAppointment) {
- delete this._editAppointmentData; // TODO
- this._editing.allowAdding && this._appointmentPopup.show(rawAppointment, {
+ delete this.editAppointmentData; // TODO
+ this.editing.allowAdding && this.appointmentPopup.show(rawAppointment, {
isToolbarVisible: true, // TODO: remove when legacyForm is deleted
action: ACTION_TO_APPOINTMENT.CREATE,
});
} else {
- const startDate = this._dataAccessors.get('startDate', newRawTargetedAppointment || rawAppointment);
+ const startDate = this.dataAccessors.get('startDate', newRawTargetedAppointment || rawAppointment);
- this._checkRecurringAppointment(rawAppointment, newTargetedAppointment, startDate, () => {
- this._editAppointmentData = rawAppointment; // TODO
+ this.checkRecurringAppointment(rawAppointment, newTargetedAppointment, startDate, () => {
+ this.editAppointmentData = rawAppointment; // TODO
- this._appointmentPopup.show(rawAppointment, {
- isToolbarVisible: this._editing.allowUpdating, // TODO: remove when legacyForm is deleted
+ this.appointmentPopup.show(rawAppointment, {
+ isToolbarVisible: this.editing.allowUpdating, // TODO: remove when legacyForm is deleted
action: ACTION_TO_APPOINTMENT.UPDATE,
});
}, false, true);
@@ -1947,16 +1947,16 @@ class Scheduler extends SchedulerOptionsBaseWidget {
const startDate = new Date(this.option('currentDate'));
const endDate = new Date(startDate.getTime() + this.option('cellDuration') * toMs('minute'));
- this._dataAccessors.set('startDate', result, startDate);
- this._dataAccessors.set('endDate', result, endDate);
+ this.dataAccessors.set('startDate', result, startDate);
+ this.dataAccessors.set('endDate', result, endDate);
return result;
}
hideAppointmentPopup(saveChanges?: any) {
- if (this._appointmentPopup?.visible) {
- saveChanges && this._appointmentPopup.saveChangesAsync();
- this._appointmentPopup.hide();
+ if (this.appointmentPopup?.visible) {
+ saveChanges && this.appointmentPopup.saveChangesAsync();
+ this.appointmentPopup.hide();
}
}
@@ -1996,12 +1996,12 @@ class Scheduler extends SchedulerOptionsBaseWidget {
this._createActionByOption('onAppointmentTooltipShowing')(arg);
- if (this._appointmentTooltip.isAlreadyShown(target)) {
+ if (this.appointmentTooltip.isAlreadyShown(target)) {
this.hideAppointmentTooltip();
} else {
- this._processActionResult(arg, (canceled) => {
- !canceled && this._appointmentTooltip.show(target, data, {
- ...this._getExtraAppointmentTooltipOptions(),
+ this.processActionResult(arg, (canceled) => {
+ !canceled && this.appointmentTooltip.show(target, data, {
+ ...this.getExtraAppointmentTooltipOptions(),
...options,
});
});
@@ -2009,7 +2009,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
hideAppointmentTooltip() {
- this._appointmentTooltip?.hide();
+ this.appointmentTooltip?.hide();
}
scrollTo(
@@ -2034,7 +2034,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
allDayValue = allDay;
}
- this._workSpace.scrollTo(date, groupValues, allDayValue, true, align);
+ this.workSpace.scrollTo(date, groupValues, allDayValue, true, align);
}
private _isScrollOptionsObject(options?: ScrollToGroupValuesOrOptions): options is ScrollToOptions {
@@ -2042,7 +2042,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
&& ('align' in options || 'allDay' in options || 'group' in options);
}
- _isHorizontalVirtualScrolling() {
+ private isHorizontalVirtualScrolling() {
const scrolling = this.option('scrolling');
const { orientation, mode } = scrolling;
const isVirtualScrolling = mode === 'virtual';
@@ -2055,7 +2055,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
// NOTE: mutation of raw appointment
const appointment = new AppointmentAdapter(
rawAppointment,
- this._dataAccessors,
+ this.dataAccessors,
);
appointment.text = appointment.text || '';
@@ -2066,19 +2066,19 @@ class Scheduler extends SchedulerOptionsBaseWidget {
cancel: false,
};
- this._actions[StoreEventNames.ADDING](addingOptions);
+ this.actions[StoreEventNames.ADDING](addingOptions);
- return this._processActionResult(addingOptions, (canceled) => {
+ return this.processActionResult(addingOptions, (canceled) => {
if (canceled) {
// @ts-expect-error
return new Deferred().resolve();
}
- this._expandAllDayPanel(serializedAppointment);
+ this.expandAllDayPanel(serializedAppointment);
return this.appointmentDataSource
.add(serializedAppointment)
- .always((storeAppointment) => this._onDataPromiseCompleted(StoreEventNames.ADDED, storeAppointment));
+ .always((storeAppointment) => this.onDataPromiseCompleted(StoreEventNames.ADDED, storeAppointment));
});
}
@@ -2098,17 +2098,17 @@ class Scheduler extends SchedulerOptionsBaseWidget {
cancel: false,
};
- this._actions[StoreEventNames.DELETING](deletingOptions);
+ this.actions[StoreEventNames.DELETING](deletingOptions);
return deletingOptions;
}
processDeleteAppointment(rawAppointment, deletingOptions) {
- this._processActionResult(deletingOptions, function (canceled) {
+ this.processActionResult(deletingOptions, function (canceled) {
if (!canceled) {
this.appointmentDataSource
.remove(rawAppointment)
- .always((storeAppointment) => this._onDataPromiseCompleted(
+ .always((storeAppointment) => this.onDataPromiseCompleted(
StoreEventNames.DELETED,
storeAppointment,
rawAppointment,
@@ -2125,7 +2125,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
if (typeof date === 'string') {
date = new Date(date);
}
- this._checkRecurringAppointment(
+ this.checkRecurringAppointment(
appointment,
{ },
date,
@@ -2143,15 +2143,15 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
focus() {
- if (this._editAppointmentData) {
- this._appointments.focus();
+ if (this.editAppointmentData) {
+ this.appointments.focus();
} else {
- this._workSpace.focus();
+ this.workSpace.focus();
}
}
getOccurrences(startDate: Date, endDate: Date, rawAppointments: Appointment[]): Occurrence[] {
- return this._layoutManager.getOccurrences(startDate, endDate, rawAppointments);
+ return this.layoutManager.getOccurrences(startDate, endDate, rawAppointments);
}
getFirstDayOfWeek(): FirstDayOfWeek {
@@ -2160,7 +2160,7 @@ class Scheduler extends SchedulerOptionsBaseWidget {
: dateLocalization.firstDayOfWeekIndex() as FirstDayOfWeek;
}
- _validateKeyFieldIfAgendaExist() {
+ private validateKeyFieldIfAgendaExist() {
if (!this.appointmentDataSource.isDataSourceInit) {
return;
}
@@ -2173,12 +2173,12 @@ class Scheduler extends SchedulerOptionsBaseWidget {
}
}
- _getDragBehavior() {
- return this._workSpace.dragBehavior;
+ private getDragBehavior() {
+ return this.workSpace.dragBehavior;
}
- _isAppointmentBeingUpdated(appointmentData: Appointment): boolean {
- return this._updatingAppointments.has(appointmentData);
+ private isAppointmentBeingUpdated(appointmentData: Appointment): boolean {
+ return this.updatingAppointments.has(appointmentData);
}
getViewOffsetMs(): number {
diff --git a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts
index 15ac39411235..4e41490f3071 100644
--- a/packages/devextreme/js/__internal/scheduler/m_subscribes.ts
+++ b/packages/devextreme/js/__internal/scheduler/m_subscribes.ts
@@ -24,7 +24,7 @@ const isAllDay = (
scheduler: Scheduler,
appointmentData: SafeAppointment,
): boolean => {
- const adapter = new AppointmentAdapter(appointmentData, scheduler._dataAccessors);
+ const adapter = new AppointmentAdapter(appointmentData, scheduler.dataAccessors);
if (VERTICAL_VIEW_TYPES.includes(scheduler.currentView.type)) {
return isAppointmentTakesAllDay(adapter, scheduler.option('allDayPanelMode'));
@@ -68,15 +68,15 @@ const subscribes = {
const { info } = utils.dataAccessors.getAppointmentSettings(options.$appointment) as AppointmentItemViewModel;
const { startDate } = info.sourceAppointment;
- this._checkRecurringAppointment(options.target, options.data, startDate, () => {
+ this.checkRecurringAppointment(options.target, options.data, startDate, () => {
this._updateAppointment(options.target, options.data, function () {
- this._appointments.moveAppointmentBack();
+ this.appointments.moveAppointmentBack();
});
});
},
getUpdatedData(rawAppointment) {
- return this._getUpdatedData(rawAppointment);
+ return this.getUpdatedData(rawAppointment);
},
updateAppointmentAfterDrag({
@@ -85,16 +85,16 @@ const subscribes = {
const { info } = utils.dataAccessors.getAppointmentSettings(element) as AppointmentItemViewModel;
// NOTE: enrich target appointment with additional data from the source
// in case of one appointment of series will change
- const targetedRawAppointment = extend({}, rawAppointment, this._getUpdatedData(rawAppointment));
+ const targetedRawAppointment = extend({}, rawAppointment, this.getUpdatedData(rawAppointment));
const fromAllDay = Boolean(rawAppointment.allDay);
const toAllDay = Boolean(targetedRawAppointment.allDay);
- const isDropBetweenAllDay = this._workSpace.supportAllDayRow() && fromAllDay !== toAllDay;
+ const isDropBetweenAllDay = this.workSpace.supportAllDayRow() && fromAllDay !== toAllDay;
const isDragAndDropBetweenComponents = event.fromComponent !== event.toComponent;
const onCancel = (): void => {
- this._appointments.moveAppointmentBack(event);
+ this.appointments.moveAppointmentBack(event);
};
if (!isDropToSelfScheduler && isDragAndDropBetweenComponents) {
// drop between schedulers
@@ -102,7 +102,7 @@ const subscribes = {
}
if (isDropToSelfScheduler && (!isDropToTheSameCell || isDragAndDropBetweenComponents || isDropBetweenAllDay)) {
- this._checkRecurringAppointment(rawAppointment, targetedRawAppointment, info.sourceAppointment.startDate, () => {
+ this.checkRecurringAppointment(rawAppointment, targetedRawAppointment, info.sourceAppointment.startDate, () => {
this._updateAppointment(rawAppointment, targetedRawAppointment, onCancel, event);
}, undefined, undefined, event);
} else {
@@ -126,7 +126,7 @@ const subscribes = {
...appointment,
...targetedAppointmentRaw,
} as TargetedAppointment;
- const adapter = new AppointmentAdapter(targetedAppointment, this._dataAccessors);
+ const adapter = new AppointmentAdapter(targetedAppointment, this.dataAccessors);
// pull out time zone converting from appointment adapter for knockout (T947938)
const startDate = targetedAppointment.displayStartDate || this.timeZoneCalculator.createDate(adapter.startDate, 'toGrid');
const endDate = targetedAppointment.displayEndDate || this.timeZoneCalculator.createDate(adapter.endDate, 'toGrid');
@@ -144,7 +144,7 @@ const subscribes = {
if (groups?.length) {
if (allDay || this.currentView.type === 'month') {
- const horizontalGroupBounds = this._workSpace.getGroupBounds(options.coordinates);
+ const horizontalGroupBounds = this.workSpace.getGroupBounds(options.coordinates);
return {
left: horizontalGroupBounds.left,
right: horizontalGroupBounds.right,
@@ -153,8 +153,8 @@ const subscribes = {
};
}
- if (!allDay && VERTICAL_VIEW_TYPES.includes(this.currentView.type) && this._workSpace._isVerticalGroupedWorkSpace()) {
- const verticalGroupBounds = this._workSpace.getGroupBounds(options.coordinates);
+ if (!allDay && VERTICAL_VIEW_TYPES.includes(this.currentView.type) && this.workSpace._isVerticalGroupedWorkSpace()) {
+ const verticalGroupBounds = this.workSpace.getGroupBounds(options.coordinates);
return {
left: 0,
right: 0,
@@ -221,15 +221,15 @@ const subscribes = {
},
renderCompactAppointments(options: CompactAppointmentOptions): dxElementWrapper {
- return this._compactAppointmentsHelper.render(options);
+ return this.compactAppointmentsHelper.render(options);
},
clearCompactAppointments() {
- this._compactAppointmentsHelper.clear();
+ this.compactAppointmentsHelper.clear();
},
getGroupCount() {
- return this._workSpace._getGroupCount();
+ return this.workSpace._getGroupCount();
},
mapAppointmentFields(config) {
@@ -248,7 +248,7 @@ const subscribes = {
},
getLayoutManager() {
- return this._layoutManager;
+ return this.layoutManager;
},
getAgendaVerticalStepHeight() {
@@ -276,11 +276,11 @@ const subscribes = {
},
getEndDayHour() {
- return this._workSpace.option('endDayHour') || this.option('endDayHour');
+ return this.workSpace.option('endDayHour') || this.option('endDayHour');
},
getStartDayHour() {
- return this._workSpace.option('startDayHour') || this.option('startDayHour');
+ return this.workSpace.option('startDayHour') || this.option('startDayHour');
},
getViewOffsetMs() {
@@ -292,7 +292,7 @@ const subscribes = {
},
removeDroppableCellClass() {
- this._workSpace.removeDroppableCellClass();
+ this.workSpace.removeDroppableCellClass();
},
} as const;
diff --git a/packages/devextreme/js/__internal/scheduler/view_model/__mock__/scheduler.mock.ts b/packages/devextreme/js/__internal/scheduler/view_model/__mock__/scheduler.mock.ts
index 729bace90338..34e91fd71b9f 100644
--- a/packages/devextreme/js/__internal/scheduler/view_model/__mock__/scheduler.mock.ts
+++ b/packages/devextreme/js/__internal/scheduler/view_model/__mock__/scheduler.mock.ts
@@ -38,5 +38,5 @@ export const getSchedulerMock = ({
option: (name: string) => ({ firstDayOfWeek: 0, showAllDayPanel: true }[name]),
getViewOffsetMs: () => offsetMinutes * 60_000,
resourceManager: resourceManager ?? new ResourceManager([]),
- _dataAccessors: mockAppointmentDataAccessor,
+ dataAccessors: mockAppointmentDataAccessor,
}) as unknown as Scheduler;
diff --git a/packages/devextreme/js/__internal/scheduler/view_model/filtration/utils/get_filter_options/get_filter_options.test.ts b/packages/devextreme/js/__internal/scheduler/view_model/filtration/utils/get_filter_options/get_filter_options.test.ts
index 43a7d4160d7b..0b5d379d5d7f 100644
--- a/packages/devextreme/js/__internal/scheduler/view_model/filtration/utils/get_filter_options/get_filter_options.test.ts
+++ b/packages/devextreme/js/__internal/scheduler/view_model/filtration/utils/get_filter_options/get_filter_options.test.ts
@@ -27,7 +27,7 @@ describe('getFilterOptions', () => {
supportAllDayPanel: false,
isDateTimeView: false,
resourceManager: schedulerStore.resourceManager,
- dataAccessor: schedulerStore._dataAccessors,
+ dataAccessor: schedulerStore.dataAccessors,
timeZone: 'Etc/UTC',
firstDayOfWeek: 0,
allDayIntervals: [{
diff --git a/packages/devextreme/js/__internal/scheduler/view_model/filtration/utils/get_filter_options/get_filter_options.ts b/packages/devextreme/js/__internal/scheduler/view_model/filtration/utils/get_filter_options/get_filter_options.ts
index 605628fcf694..58ee975108e8 100644
--- a/packages/devextreme/js/__internal/scheduler/view_model/filtration/utils/get_filter_options/get_filter_options.ts
+++ b/packages/devextreme/js/__internal/scheduler/view_model/filtration/utils/get_filter_options/get_filter_options.ts
@@ -23,7 +23,7 @@ export const getFilterOptions = (
showAllDayPanel: schedulerStore.option('showAllDayPanel'),
resourceManager: schedulerStore.resourceManager,
timeZone: schedulerStore.getTimeZone(),
- dataAccessor: schedulerStore._dataAccessors,
+ dataAccessor: schedulerStore.dataAccessors,
firstDayOfWeek: schedulerStore.option('firstDayOfWeek'),
allDayIntervals: shiftIntervals(
getVisibleDateTimeIntervals(compareOptions, true),
diff --git a/packages/devextreme/js/__internal/scheduler/view_model/generate_view_model/generate_grid_view_model.ts b/packages/devextreme/js/__internal/scheduler/view_model/generate_view_model/generate_grid_view_model.ts
index b91034f26441..33a644339f51 100644
--- a/packages/devextreme/js/__internal/scheduler/view_model/generate_view_model/generate_grid_view_model.ts
+++ b/packages/devextreme/js/__internal/scheduler/view_model/generate_view_model/generate_grid_view_model.ts
@@ -31,7 +31,8 @@ export const generateGridViewModel = (
viewOffset,
compareOptions: { endDayHour },
} = optionManager.options;
- const { viewDataProvider } = schedulerStore._workSpace;
+ // @ts-expect-error - TODO: architectural debt — accesses private Scheduler.workSpace
+ const { viewDataProvider } = schedulerStore.workSpace;
const step2 = maybeSplit(items, hasAllDayPanel, (entities, panelName) => {
const byGroup = groupByGroupIndex(entities);
diff --git a/packages/devextreme/js/__internal/scheduler/view_model/preparation/prepare_appointments.test.ts b/packages/devextreme/js/__internal/scheduler/view_model/preparation/prepare_appointments.test.ts
index 33e2bf41f435..b91243c53edc 100644
--- a/packages/devextreme/js/__internal/scheduler/view_model/preparation/prepare_appointments.test.ts
+++ b/packages/devextreme/js/__internal/scheduler/view_model/preparation/prepare_appointments.test.ts
@@ -9,7 +9,7 @@ import { prepareAppointments } from './prepare_appointments';
const schedulerMock = {
currentView: { type: 'agenda' },
getViewOption: (name: string) => ({ cellDuration: 30, allDayPanelMode: 'all' }[name]),
- _dataAccessors: mockAppointmentDataAccessor,
+ dataAccessors: mockAppointmentDataAccessor,
timeZoneCalculator: createTimeZoneCalculator(''),
} as unknown as Scheduler;
diff --git a/packages/devextreme/js/__internal/scheduler/view_model/preparation/prepare_appointments.ts b/packages/devextreme/js/__internal/scheduler/view_model/preparation/prepare_appointments.ts
index 3af52bae686e..496d3c81bf0f 100644
--- a/packages/devextreme/js/__internal/scheduler/view_model/preparation/prepare_appointments.ts
+++ b/packages/devextreme/js/__internal/scheduler/view_model/preparation/prepare_appointments.ts
@@ -10,7 +10,7 @@ export const prepareAppointments = (
items?: Appointment[],
): MinimalAppointmentEntity[] => {
const cellDurationInMinutes = schedulerStore.getViewOption('cellDuration');
- const dataAccessors = schedulerStore._dataAccessors;
+ const { dataAccessors } = schedulerStore;
const safeItems = replaceIncorrectEndDate(
items,
cellDurationInMinutes,
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..048e66d85403 100644
--- a/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts
+++ b/packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts
@@ -3273,7 +3273,8 @@ const createDragBehaviorConfig = (
const canceled = e.cancel;
const { event } = e;
const $itemElement = $(e.itemElement);
- const appointments = e.component._appointments;
+ // eslint-disable-next-line prefer-destructuring
+ const appointments = e.component.appointments;
state.itemData = options.getItemData(e.itemElement, appointments);
const settings = options.getItemSettings($itemElement, e);