diff --git a/packages/devextreme/js/__internal/scheduler/appointment_popup/m_legacy_popup.ts b/packages/devextreme/js/__internal/scheduler/appointment_popup/m_legacy_popup.ts index 60ead1a03da7..c9019a250519 100644 --- a/packages/devextreme/js/__internal/scheduler/appointment_popup/m_legacy_popup.ts +++ b/packages/devextreme/js/__internal/scheduler/appointment_popup/m_legacy_popup.ts @@ -79,15 +79,15 @@ export class AppointmentPopup { this.state.excludeInfo = config.excludeInfo; if (!this.popup) { - const popupConfig = this._createPopupConfig(); - this.popup = this._createPopup(popupConfig); + const popupConfig = this.createPopupConfig(); + this.popup = this.createPopup(popupConfig); } this.popup.option( 'toolbarItems', getPopupToolbarItems( config.isToolbarVisible, - (e) => this._doneButtonClickHandler(e), + (e) => this.doneButtonClickHandler(e), ), ); @@ -102,7 +102,7 @@ export class AppointmentPopup { this.popup?.$element().remove(); } - _createPopup(options) { + private createPopup(options) { const popupElement = $('
') .addClass(APPOINTMENT_POPUP_CLASS) .appendTo(this.scheduler.getElement()); @@ -110,18 +110,18 @@ export class AppointmentPopup { return this.scheduler.createComponent(popupElement, Popup, options); } - _createPopupConfig() { + private createPopupConfig() { return { ...POPUP_CONFIG, onHiding: () => this.scheduler.focus(), - contentTemplate: () => this._createPopupContent(), - onShowing: (e) => this._onShowing(e), + contentTemplate: () => this.createPopupContent(), + onShowing: (e) => this.onShowing(e), wrapperAttr: { class: APPOINTMENT_POPUP_CLASS }, }; } - _onShowing(e) { - this._updateForm(); + private onShowing(e) { + this.updateForm(); e.component.$overlayContent().attr( 'aria-label', @@ -145,13 +145,13 @@ export class AppointmentPopup { }); } - _createPopupContent() { - this._createForm(); + private createPopupContent() { + this.createForm(); return this.form.dxForm.$element(); // TODO } - _createFormData(rawAppointment) { - const appointment = this._createAppointmentAdapter(rawAppointment); + private createFormData(rawAppointment) { + const appointment = this.createAppointmentAdapter(rawAppointment); const resourceManager = this.scheduler.getResourceManager(); const rawAppointmentGroupValues = getRawAppointmentGroupValues( rawAppointment, @@ -165,15 +165,15 @@ export class AppointmentPopup { }; } - _createForm() { + private createForm() { const rawAppointment = this.state.appointment.data; - const formData = this._createFormData(rawAppointment); + const formData = this.createFormData(rawAppointment); this.form.create(this.triggerResize.bind(this), this.changeSize.bind(this), formData); // TODO } - _isReadOnly(rawAppointment) { - const appointment = this._createAppointmentAdapter(rawAppointment); + private isReadOnly(rawAppointment) { + const appointment = this.createAppointmentAdapter(rawAppointment); if (rawAppointment && appointment.disabled) { return true; @@ -186,22 +186,22 @@ export class AppointmentPopup { return !this.scheduler.getEditingConfig().allowUpdating; } - _createAppointmentAdapter(rawAppointment) { + private createAppointmentAdapter(rawAppointment) { return new AppointmentAdapter( rawAppointment, this.scheduler.getDataAccessors(), ); } - _updateForm() { + private updateForm() { const { data } = this.state.appointment; - const appointment = this._createFormData(data); - const formData = this._createAppointmentAdapter(appointment) + const appointment = this.createFormData(data); + const formData = this.createAppointmentAdapter(appointment) .clone() .calculateDates(this.scheduler.getTimeZoneCalculator(), 'toAppointment') .source; - this.form.readOnly = this._isReadOnly(formData); + this.form.readOnly = this.isReadOnly(formData); this.form.updateFormData(formData); } @@ -237,7 +237,7 @@ export class AppointmentPopup { const deferred = new Deferred(); const validation = this.form.dxForm.validate(); - isShowLoadPanel && this._showLoadPanel(); + isShowLoadPanel && this.showLoadPanel(); when(validation?.complete || validation).done((validation) => { if (validation && !validation.isValid) { @@ -247,13 +247,13 @@ export class AppointmentPopup { } const { repeat } = this.form.formData; - const adapter = this._createAppointmentAdapter(this.form.formData); + const adapter = this.createAppointmentAdapter(this.form.formData); const clonedAdapter = adapter .clone() .calculateDates(this.scheduler.getTimeZoneCalculator(), 'fromAppointment'); const shouldClearRecurrenceRule = !repeat && Boolean(clonedAdapter.recurrenceRule); - this._addMissingDSTTime(adapter, clonedAdapter); + this.addMissingDSTTime(adapter, clonedAdapter); if (shouldClearRecurrenceRule) { clonedAdapter.recurrenceRule = ''; @@ -286,7 +286,7 @@ export class AppointmentPopup { return deferred.promise(); } - _doneButtonClickHandler(e) { + private doneButtonClickHandler(e) { e.cancel = true; this.saveEditDataAsync(); } @@ -295,10 +295,10 @@ export class AppointmentPopup { // @ts-expect-error const deferred = new Deferred(); - if (this._tryLockSaveChanges()) { + if (this.tryLockSaveChanges()) { when(this.saveChangesAsync(true)).done(() => { if (this.state.lastEditData) { // TODO - const adapter = this._createAppointmentAdapter(this.state.lastEditData); + const adapter = this.createAppointmentAdapter(this.state.lastEditData); const { startDate, endDate, allDay } = adapter; @@ -316,7 +316,7 @@ export class AppointmentPopup { this.state.lastEditData = null; } - this._unlockSaveChanges(); + this.unlockSaveChanges(); deferred.resolve(); }); @@ -325,7 +325,7 @@ export class AppointmentPopup { return deferred.promise(); } - _showLoadPanel() { + private showLoadPanel() { const container = this.popup.$overlayContent(); showLoading({ @@ -336,7 +336,7 @@ export class AppointmentPopup { }); } - _tryLockSaveChanges() { + private tryLockSaveChanges() { if (this.state.saveChangesLocker === false) { this.state.saveChangesLocker = true; return true; @@ -344,22 +344,21 @@ export class AppointmentPopup { return false; } - _unlockSaveChanges() { + private unlockSaveChanges() { this.state.saveChangesLocker = false; } - // NOTE: Fix ticket T1102713 - _addMissingDSTTime(formAppointmentAdapter, clonedAppointmentAdapter) { + private addMissingDSTTime(formAppointmentAdapter, clonedAppointmentAdapter) { const timeZoneCalculator = this.scheduler.getTimeZoneCalculator(); - clonedAppointmentAdapter.startDate = this._addMissingDSTShiftToDate( + clonedAppointmentAdapter.startDate = this.addMissingDSTShiftToDate( timeZoneCalculator, formAppointmentAdapter.startDate, clonedAppointmentAdapter.startDate, ); if (clonedAppointmentAdapter.endDate) { - clonedAppointmentAdapter.endDate = this._addMissingDSTShiftToDate( + clonedAppointmentAdapter.endDate = this.addMissingDSTShiftToDate( timeZoneCalculator, formAppointmentAdapter.endDate, clonedAppointmentAdapter.endDate, @@ -367,7 +366,7 @@ export class AppointmentPopup { } } - _addMissingDSTShiftToDate(timeZoneCalculator, originFormDate, clonedDate) { + private addMissingDSTShiftToDate(timeZoneCalculator, originFormDate, clonedDate) { const originTimezoneShift = timeZoneCalculator.getOffsets(originFormDate)?.common; const clonedTimezoneShift = timeZoneCalculator.getOffsets(clonedDate)?.common; const shiftDifference = originTimezoneShift - clonedTimezoneShift; diff --git a/packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts b/packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts index 12ea126f4f29..4aa093eae31c 100644 --- a/packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts +++ b/packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts @@ -69,10 +69,10 @@ export class AppointmentPopup { this.state.allowSaving = config.allowSaving; this.state.excludeInfo = config.excludeInfo; - this._disposePopup(); + this.disposePopup(); - const popupConfig = this._createPopupConfig(); - this._createPopup(popupConfig); + const popupConfig = this.createPopupConfig(); + this.createPopup(popupConfig); this._popup!.show(); } @@ -82,10 +82,10 @@ export class AppointmentPopup { } dispose() { - this._disposePopup(); + this.disposePopup(); } - private _disposePopup(): void { + private disposePopup(): void { if (this._popup) { const $element = this._popup.$element(); this.form.dispose(); @@ -95,7 +95,7 @@ export class AppointmentPopup { } } - _createPopup(options): void { + private createPopup(options): void { const popupElement = $('
') .addClass(APPOINTMENT_POPUP_CLASS) .appendTo(this.scheduler.getElement()); @@ -103,7 +103,7 @@ export class AppointmentPopup { this.scheduler.createComponent(popupElement, Popup, options); } - _createPopupConfig(): PopupProperties { + private createPopupConfig(): PopupProperties { const editingConfig = this.scheduler.getEditingConfig(); const customPopupOptions = editingConfig?.popup ?? {}; @@ -135,7 +135,7 @@ export class AppointmentPopup { return this.form.dxForm.$element(); }, onShowing: (e): void => { - this._onShowing(e); + this.onShowing(e); customPopupOptions?.onShowing?.(e); }, wrapperAttr: { class: APPOINTMENT_POPUP_CLASS }, @@ -148,8 +148,8 @@ export class AppointmentPopup { }) as PopupProperties; } - _onShowing(e) { - this._updateForm(); + private onShowing(e) { + this.updateForm(); e.component.$overlayContent().attr( 'aria-label', @@ -173,7 +173,7 @@ export class AppointmentPopup { }); } - _isReadOnly(appointmentAdapter: AppointmentAdapter): boolean { + private isReadOnly(appointmentAdapter: AppointmentAdapter): boolean { if (Boolean(appointmentAdapter.source) && appointmentAdapter.disabled) { return true; } @@ -185,28 +185,28 @@ export class AppointmentPopup { return !this.scheduler.getEditingConfig().allowUpdating; } - _createAppointmentAdapter(rawAppointment): AppointmentAdapter { + private createAppointmentAdapter(rawAppointment): AppointmentAdapter { return new AppointmentAdapter( rawAppointment, this.scheduler.getDataAccessors(), ); } - _updateForm(): void { + private updateForm(): void { const rawAppointment = this.state.appointment.data; - const appointmentAdapter = this._createAppointmentAdapter(rawAppointment) + const appointmentAdapter = this.createAppointmentAdapter(rawAppointment) .clone() .calculateDates(this.scheduler.getTimeZoneCalculator(), 'toAppointment'); - const formData = this._createFormData(appointmentAdapter); + const formData = this.createFormData(appointmentAdapter); - this.form.readOnly = this._isReadOnly(appointmentAdapter); + this.form.readOnly = this.isReadOnly(appointmentAdapter); this.form.formData = formData; this.form.showMainGroup(); } - _createFormData(appointmentAdapter: AppointmentAdapter): Record { + private createFormData(appointmentAdapter: AppointmentAdapter): Record { const { resources } = this.scheduler.getResourceManager(); const groupValues = getRawAppointmentGroupValues( appointmentAdapter.source as SafeAppointment, @@ -268,7 +268,7 @@ export class AppointmentPopup { const deferred = new Deferred(); const validation = this.form.dxForm.validate(); - isShowLoadPanel && this._showLoadPanel(); + isShowLoadPanel && this.showLoadPanel(); when(validation?.complete ?? validation).done((validation) => { if (validation && !(validation as any).isValid) { @@ -277,12 +277,12 @@ export class AppointmentPopup { return; } - const adapter = this._createAppointmentAdapter(this.form.formData); + const adapter = this.createAppointmentAdapter(this.form.formData); const clonedAdapter = adapter .clone() .calculateDates(this.scheduler.getTimeZoneCalculator(), 'fromAppointment'); - this._addMissingDSTTime(adapter, clonedAdapter); + this.addMissingDSTTime(adapter, clonedAdapter); const appointment = clonedAdapter.source; @@ -310,7 +310,7 @@ export class AppointmentPopup { return deferred.promise(); } - _saveButtonClickHandler(e) { + private saveButtonClickHandler(e) { e.cancel = true; this.saveEditDataAsync(); } @@ -319,10 +319,10 @@ export class AppointmentPopup { // @ts-expect-error const deferred = new Deferred(); - if (this._tryLockSaveChanges()) { + if (this.tryLockSaveChanges()) { when(this.saveChangesAsync(true)).done(() => { if (this.state.lastEditData) { // TODO - const adapter = this._createAppointmentAdapter(this.state.lastEditData); + const adapter = this.createAppointmentAdapter(this.state.lastEditData); const { startDate, endDate, allDay } = adapter; @@ -340,7 +340,7 @@ export class AppointmentPopup { this.state.lastEditData = null; } - this._unlockSaveChanges(); + this.unlockSaveChanges(); deferred.resolve(); }); @@ -349,7 +349,7 @@ export class AppointmentPopup { return deferred.promise(); } - _showLoadPanel() { + private showLoadPanel() { const container = (this.popup as any).$overlayContent(); showLoading({ @@ -360,7 +360,7 @@ export class AppointmentPopup { }); } - _tryLockSaveChanges() { + private tryLockSaveChanges() { if (this.state.saveChangesLocker === false) { this.state.saveChangesLocker = true; return true; @@ -368,22 +368,21 @@ export class AppointmentPopup { return false; } - _unlockSaveChanges() { + private unlockSaveChanges() { this.state.saveChangesLocker = false; } - // NOTE: Fix ticket T1102713 - _addMissingDSTTime(formAppointmentAdapter, clonedAppointmentAdapter) { + private addMissingDSTTime(formAppointmentAdapter, clonedAppointmentAdapter) { const timeZoneCalculator = this.scheduler.getTimeZoneCalculator(); - clonedAppointmentAdapter.startDate = this._addMissingDSTShiftToDate( + clonedAppointmentAdapter.startDate = this.addMissingDSTShiftToDate( timeZoneCalculator, formAppointmentAdapter.startDate, clonedAppointmentAdapter.startDate, ); if (clonedAppointmentAdapter.endDate) { - clonedAppointmentAdapter.endDate = this._addMissingDSTShiftToDate( + clonedAppointmentAdapter.endDate = this.addMissingDSTShiftToDate( timeZoneCalculator, formAppointmentAdapter.endDate, clonedAppointmentAdapter.endDate, @@ -391,7 +390,7 @@ export class AppointmentPopup { } } - _addMissingDSTShiftToDate(timeZoneCalculator, originFormDate, clonedDate) { + private addMissingDSTShiftToDate(timeZoneCalculator, originFormDate, clonedDate) { const originTimezoneShift = timeZoneCalculator.getOffsets(originFormDate)?.common; const clonedTimezoneShift = timeZoneCalculator.getOffsets(clonedDate)?.common; const shiftDifference = originTimezoneShift - clonedTimezoneShift; @@ -431,7 +430,7 @@ export class AppointmentPopup { toolbar: 'top', location: 'after', options: { - onClick: (e) => this._saveButtonClickHandler(e), + onClick: (e) => this.saveButtonClickHandler(e), stylingMode: 'contained', type: 'default', text: messageLocalization.format('dxScheduler-editPopupSaveButtonText'), @@ -489,7 +488,7 @@ export class AppointmentPopup { toolbar: 'top', location: 'after', options: { - onClick: (e) => this._saveButtonClickHandler(e), + onClick: (e) => this.saveButtonClickHandler(e), stylingMode: 'contained', type: 'default', text: messageLocalization.format('dxScheduler-editPopupSaveButtonText'), diff --git a/packages/devextreme/js/__internal/scheduler/header/m_calendar.ts b/packages/devextreme/js/__internal/scheduler/header/m_calendar.ts index d8152314dfae..5fe80c796193 100644 --- a/packages/devextreme/js/__internal/scheduler/header/m_calendar.ts +++ b/packages/devextreme/js/__internal/scheduler/header/m_calendar.ts @@ -17,24 +17,24 @@ const CALENDAR_CLASS = 'dx-scheduler-navigator-calendar'; const CALENDAR_POPOVER_CLASS = 'dx-scheduler-navigator-calendar-popover'; export default class SchedulerCalendar extends Widget { - _overlay?: Popup | Popover; + private overlay?: Popup | Popover; - _calendar?: Calendar; + private calendar?: Calendar; public async show(target: HTMLElement): Promise { if (!SchedulerCalendar._isMobileLayout()) { - this._overlay?.option('target', target); + this.overlay?.option('target', target); } - await this._overlay?.show(); + await this.overlay?.show(); } public async hide(): Promise { - await this._overlay?.hide(); + await this.overlay?.hide(); } public _keyboardHandler(opts: KeyboardKeyDownEvent): boolean { - return this._calendar?._keyboardHandler(opts) ?? false; + return this.calendar?._keyboardHandler(opts) ?? false; } public _init(): void { @@ -55,7 +55,7 @@ export default class SchedulerCalendar extends Widget { const overlayConfig = { contentTemplate: (): dxElementWrapper => this._createOverlayContent(), onShown: (): void => { - this._calendar?.focus(); + this.calendar?.focus(); }, defaultOptionsRules: [ { @@ -73,15 +73,15 @@ export default class SchedulerCalendar extends Widget { }; if (isMobileLayout) { - this._overlay = this._createComponent(this.$element(), Popup, overlayConfig); + this.overlay = this._createComponent(this.$element(), Popup, overlayConfig); } else { - this._overlay = this._createComponent(this.$element(), Popover, overlayConfig); + this.overlay = this._createComponent(this.$element(), Popover, overlayConfig); } } private _createOverlayContent(): dxElementWrapper { const result = $('
').addClass(CALENDAR_CLASS); - this._calendar = this._createComponent(result, Calendar, this._getCalendarOptions()); + this.calendar = this._createComponent(result, Calendar, this._getCalendarOptions()); if (SchedulerCalendar._isMobileLayout()) { const scrollable = this._createScrollable(result); @@ -108,7 +108,7 @@ export default class SchedulerCalendar extends Widget { switch (name) { case 'value': - this._calendar?.option('value', value); + this.calendar?.option('value', value); break; default: break; diff --git a/packages/devextreme/js/__internal/scheduler/header/m_header.ts b/packages/devextreme/js/__internal/scheduler/header/m_header.ts index d511504215c3..4d026697d474 100644 --- a/packages/devextreme/js/__internal/scheduler/header/m_header.ts +++ b/packages/devextreme/js/__internal/scheduler/header/m_header.ts @@ -48,9 +48,9 @@ const ITEM_NAMES = { export class SchedulerHeader extends Widget { eventMap!: Map; - _toolbar?: Toolbar; + private toolbar?: Toolbar; - _calendar?: SchedulerCalendar; + private calendar?: SchedulerCalendar; get captionText(): string { return this._getCaption().text; @@ -115,16 +115,16 @@ export class SchedulerHeader extends Widget { this.repaint(); break; case fullName === 'toolbar.items': - this._toolbar?.option( + this.toolbar?.option( 'items', (value as []).map((item: ToolbarItem) => this._parseItem(item)), ); break; case parts[1] === 'items' && parts.length === 3: - this._toolbar?.option(optionName, this._parseItem(value as ToolbarItem)); + this.toolbar?.option(optionName, this._parseItem(value as ToolbarItem)); break; default: - this._toolbar?.option(optionName, value); + this.toolbar?.option(optionName, value); } } @@ -149,7 +149,7 @@ export class SchedulerHeader extends Widget { const toolbarElement = $('
'); toolbarElement.appendTo(this.$element()); - this._toolbar = this._createComponent(toolbarElement, Toolbar, config); + this.toolbar = this._createComponent(toolbarElement, Toolbar, config); } public _toggleVisibility(): void { @@ -210,7 +210,7 @@ export class SchedulerHeader extends Widget { private _updateCalendarValueAndCurrentDate(date: Date): void { this._updateCurrentDate(date); - this._calendar?.option('value', date); + this.calendar?.option('value', date); } public _updateCurrentDate(date: Date): void { @@ -223,7 +223,7 @@ export class SchedulerHeader extends Widget { const { currentDate, min, max, firstDayOfWeek, focusStateEnabled, tabIndex, } = this.option(); - this._calendar = this._createComponent('
', SchedulerCalendar, { + this.calendar = this._createComponent('
', SchedulerCalendar, { value: currentDate, min, max, @@ -232,17 +232,17 @@ export class SchedulerHeader extends Widget { tabIndex, onValueChanged: async (e) => { this._updateCurrentDate(e.value); - await this._calendar?.hide(); + await this.calendar?.hide(); }, }); - this._calendar.$element().appendTo(this.$element()); + this.calendar.$element().appendTo(this.$element()); } private _getCalendarOptionUpdater(name: string) { return (value: unknown): void => { - if (this._calendar) { - this._calendar.option(name, value); + if (this.calendar) { + this.calendar.option(name, value); } }; } @@ -290,7 +290,7 @@ export class SchedulerHeader extends Widget { } public async _showCalendar(e: ItemClickEvent): Promise { - await this._calendar?.show(e.element); + await this.calendar?.show(e.element); } } 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 4214cf6750ec..126eb6f6baec 100644 --- a/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts +++ b/packages/devextreme/js/__internal/scheduler/m_compact_appointments_helper.ts @@ -26,8 +26,8 @@ export class CompactAppointmentsHelper { render(options: CompactAppointmentOptions): dxElementWrapper { const { isCompact, items } = options; - const template = this._createTemplate(items.length, isCompact); - const button = this._createCompactButton(template, options); + const template = this.createTemplate(items.length, isCompact); + const button = this.createCompactButton(template, options); const $button = button.$element(); this.elements.push($button); @@ -44,33 +44,33 @@ export class CompactAppointmentsHelper { this.elements = []; } - _onButtonClick(e, options: CompactAppointmentOptions) { + private onButtonClick(e, options: CompactAppointmentOptions) { const $button = $(e.element); this.instance.showAppointmentTooltipCore( $button, // @ts-expect-error $button.data('items'), - this._getExtraOptionsForTooltip(options, $button), + this.getExtraOptionsForTooltip(options, $button), ); } - _getExtraOptionsForTooltip(options: CompactAppointmentOptions, $appointmentCollector) { + private getExtraOptionsForTooltip(options: CompactAppointmentOptions, $appointmentCollector) { return { - clickEvent: this._clickEvent(options.onAppointmentClick).bind(this), - dragBehavior: options.allowDrag && this._createTooltipDragBehavior($appointmentCollector).bind(this), + clickEvent: this.clickEvent(options.onAppointmentClick).bind(this), + dragBehavior: options.allowDrag && this.createTooltipDragBehavior($appointmentCollector).bind(this), isButtonClick: true, _loopFocus: true, }; } - _clickEvent(onAppointmentClick) { + private clickEvent(onAppointmentClick) { return (e) => { const clickEventArgs = this.instance._createEventArgs(e); onAppointmentClick(clickEventArgs); }; } - _createTooltipDragBehavior($appointmentCollector) { + private createTooltipDragBehavior($appointmentCollector) { return (e) => { const $element = $(e.element); const $schedulerElement = $(this.instance.element()); @@ -92,23 +92,23 @@ export class CompactAppointmentsHelper { }; } - _setPosition(element, position) { + private setPosition(element, position) { move(element, { top: position.top, left: position.left, }); } - _createCompactButton(template, options: CompactAppointmentOptions) { - const $button = this._createCompactButtonElement(options); + private createCompactButton(template, options: CompactAppointmentOptions) { + const $button = this.createCompactButtonElement(options); // @ts-expect-error return this.instance._createComponent($button, Button, { type: 'default', width: options.width, height: options.height, - onClick: (e) => this._onButtonClick(e, options), - template: this._renderTemplate(template, options.items, options.isCompact), + onClick: (e) => this.onButtonClick(e, options), + template: this.renderTemplate(template, options.items, options.isCompact), }); } @@ -131,10 +131,10 @@ export class CompactAppointmentsHelper { return geometry; } - _createCompactButtonElement({ + private createCompactButtonElement({ isCompact, $container, coordinates, sortedIndex, items, }: CompactAppointmentOptions) { - const appointmentDate = this._getDateText( + const appointmentDate = this.getDateText( items[0].appointment, items[0].targetedAppointment, ); @@ -146,12 +146,12 @@ export class CompactAppointmentsHelper { result.data(APPOINTMENT_SETTINGS_KEY, { sortedIndex }); - this._setPosition(result, coordinates); + this.setPosition(result, coordinates); return result; } - _renderTemplate(template, items: AppointmentTooltipItem[], isCompact) { + private renderTemplate(template, items: AppointmentTooltipItem[], isCompact) { return new (FunctionTemplate as any)((options) => template.render({ model: { appointmentCount: items.length, @@ -162,18 +162,18 @@ export class CompactAppointmentsHelper { })); } - _createTemplate(count, isCompact) { - this._initButtonTemplate(count, isCompact); + private createTemplate(count, isCompact) { + this.initButtonTemplate(count, isCompact); return this.instance.getAppointmentTemplate('appointmentCollectorTemplate'); } - _initButtonTemplate(count, isCompact) { + private initButtonTemplate(count, isCompact) { this.instance._templateManager.addDefaultTemplates({ - appointmentCollector: new (FunctionTemplate as any)((options) => this._createButtonTemplate(count, $(options.container), isCompact)), + appointmentCollector: new (FunctionTemplate as any)((options) => this.createButtonTemplate(count, $(options.container), isCompact)), }); } - _createButtonTemplate(appointmentCount, element, isCompact) { + private createButtonTemplate(appointmentCount, element, isCompact) { const text = isCompact ? appointmentCount : (messageLocalization.getFormatter('dxScheduler-moreAppointments') as any)(appointmentCount); @@ -183,19 +183,19 @@ export class CompactAppointmentsHelper { .addClass(APPOINTMENT_COLLECTOR_CONTENT_CLASS); } - _localizeDate(date) { + private localizeDate(date) { return `${dateLocalization.format(date, 'monthAndDay')}, ${dateLocalization.format(date, 'year')}`; } - _getDateText( + private getDateText( appointment: Appointment, targetedAppointment: Appointment | TargetedAppointment | undefined, ): string { const startDate = targetedAppointment?.displayStartDate ?? appointment.startDate; const endDate = targetedAppointment?.displayEndDate ?? appointment.endDate; - const startDateText = this._localizeDate(startDate); - const endDateText = this._localizeDate(endDate); + const startDateText = this.localizeDate(startDate); + const endDateText = this.localizeDate(endDate); return startDateText === endDateText ? startDateText diff --git a/packages/devextreme/js/__internal/scheduler/m_table_creator.ts b/packages/devextreme/js/__internal/scheduler/m_table_creator.ts index 9af94f69319a..766e45e5bee2 100644 --- a/packages/devextreme/js/__internal/scheduler/m_table_creator.ts +++ b/packages/devextreme/js/__internal/scheduler/m_table_creator.ts @@ -133,9 +133,9 @@ class SchedulerTableCreator { let rows: any = []; if (type === this.VERTICAL) { - rows = this._makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount); + rows = this.makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount); } else { - rows = this._makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate); + rows = this.makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate); } return rows; @@ -244,7 +244,7 @@ class SchedulerTableCreator { return table; } - _makeFlexGroupedRowCells(group, repeatCount, cssClasses, cellTemplate, repeatByDate = 1) { + private makeFlexGroupedRowCells(group, repeatCount, cssClasses, cellTemplate, repeatByDate = 1) { const cells: any[] = []; const { items } = group; const itemCount = items.length; @@ -283,7 +283,7 @@ class SchedulerTableCreator { } // eslint-disable-next-line @typescript-eslint/no-unused-vars - _makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount?: any) { + private makeVerticalGroupedRows(groups, cssClasses, cellTemplate, rowCount?: any) { const cellTemplates: any = []; let repeatCount = 1; const cellsArray: any = []; @@ -300,7 +300,7 @@ class SchedulerTableCreator { repeatCount = groups[i - 1].items.length * repeatCount; } - const cells = this._makeFlexGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate); + const cells = this.makeFlexGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate); cells.forEach(cellIterator); cellsArray.push(cells); } @@ -325,7 +325,7 @@ class SchedulerTableCreator { }; } - _makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate) { + private makeHorizontalGroupedRows(groups, cssClasses, cellCount, cellTemplate, groupByDate) { let repeatCount = 1; const groupCount = groups.length; const rows: any = []; @@ -346,7 +346,7 @@ class SchedulerTableCreator { repeatCount = groups[i - 1].items.length * repeatCount; } - const cells: any = this._makeGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate, repeatByDate); + const cells: any = this.makeGroupedRowCells(groups[i], repeatCount, cssClasses, cellTemplate, repeatByDate); rows.push( $('') @@ -375,7 +375,7 @@ class SchedulerTableCreator { }; } - _makeGroupedRowCells(group, repeatCount, cssClasses, cellTemplate, repeatByDate) { + private makeGroupedRowCells(group, repeatCount, cssClasses, cellTemplate, repeatByDate) { repeatByDate = repeatByDate || 1; repeatCount *= repeatByDate; diff --git a/packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts b/packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts index af4ee4029f5b..ff11cdf6b0f2 100644 --- a/packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts +++ b/packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts @@ -26,7 +26,7 @@ export class AppointmentDataSource { return Boolean(this.dataSource); } - _getStoreKey(target) { + private getStoreKey(target) { const store = this.dataSource.store(); return store.keyOf(target); @@ -36,10 +36,10 @@ export class AppointmentDataSource { this.dataSource = dataSource; this.cleanState(); - this._initStoreChangeHandlers(); + this.initStoreChangeHandlers(); } - _initStoreChangeHandlers() { + private initStoreChangeHandlers() { const { dataSource } = this; const store = dataSource?.store(); @@ -97,7 +97,7 @@ export class AppointmentDataSource { } update(target, data) { - const key = this._getStoreKey(target); + const key = this.getStoreKey(target); // @ts-expect-error const d = new Deferred(); @@ -111,7 +111,7 @@ export class AppointmentDataSource { } remove(rawAppointment) { - const key = this._getStoreKey(rawAppointment); + const key = this.getStoreKey(rawAppointment); return this.dataSource.store().remove(key).done(() => this.dataSource.load()); } diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/legacyAppointmentPopup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/legacyAppointmentPopup.tests.js index 83dc3d7fc41d..fd570f89c2d2 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/legacyAppointmentPopup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/legacyAppointmentPopup.tests.js @@ -446,7 +446,7 @@ QUnit.module('Appointment popup form', moduleConfig, () => { const deferred = scheduler.appointmentPopup.saveAppointmentData(); - assert.notOk(scheduler.appointmentPopup.getInstance()._tryLockSaveChanges(), 'Save changes already locked'); + assert.notOk(scheduler.appointmentPopup.getInstance().tryLockSaveChanges(), 'Save changes already locked'); assert.ok(scheduler.appointmentPopup.hasLoadPanel(), 'has load panel');