Skip to content

Commit 6c51a4c

Browse files
Scheduler: remove dropDownAppointmentTemplate and scrollToTime api options (DevExpress#30932)
1 parent 298876a commit 6c51a4c

File tree

23 files changed

+34
-560
lines changed

23 files changed

+34
-560
lines changed

e2e/testcafe-devextreme/tests/scheduler/common/scrollToTime.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

packages/devextreme-angular/src/ui/nested/view-dxi.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,6 @@ export class DxiViewComponent extends CollectionNestedOption {
9595
this._setOption('dateCellTemplate', value);
9696
}
9797

98-
@Input()
99-
get dropDownAppointmentTemplate(): any {
100-
return this._getOption('dropDownAppointmentTemplate');
101-
}
102-
set dropDownAppointmentTemplate(value: any) {
103-
this._setOption('dropDownAppointmentTemplate', value);
104-
}
105-
10698
@Input()
10799
get endDayHour(): number {
108100
return this._getOption('endDayHour');

packages/devextreme-angular/src/ui/scheduler/index.ts

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -336,21 +336,6 @@ export class DxSchedulerComponent extends DxComponent implements OnDestroy, OnCh
336336
}
337337

338338

339-
/**
340-
* [descr:dxSchedulerOptions.dropDownAppointmentTemplate]
341-
342-
* @deprecated [depNote:dxSchedulerOptions.dropDownAppointmentTemplate]
343-
344-
*/
345-
@Input()
346-
get dropDownAppointmentTemplate(): any {
347-
return this._getOption('dropDownAppointmentTemplate');
348-
}
349-
set dropDownAppointmentTemplate(value: any) {
350-
this._setOption('dropDownAppointmentTemplate', value);
351-
}
352-
353-
354339
/**
355340
* [descr:dxSchedulerOptions.editing]
356341
@@ -850,10 +835,10 @@ export class DxSchedulerComponent extends DxComponent implements OnDestroy, OnCh
850835
851836
*/
852837
@Input()
853-
get views(): Array<Record<string, any> | string> | { agendaDuration?: number, allDayPanelMode?: AllDayPanelMode, appointmentCollectorTemplate?: any, appointmentTemplate?: any, appointmentTooltipTemplate?: any, cellDuration?: number, dataCellTemplate?: any, dateCellTemplate?: any, dropDownAppointmentTemplate?: any, endDayHour?: number, firstDayOfWeek?: FirstDayOfWeek | undefined, groupByDate?: boolean, groupOrientation?: Orientation, groups?: Array<string>, intervalCount?: number, maxAppointmentsPerCell?: CellAppointmentsLimit | number, name?: string | undefined, offset?: number, resourceCellTemplate?: any, scrolling?: dxSchedulerScrolling, startDate?: Date | number | string | undefined, startDayHour?: number, timeCellTemplate?: any, type?: undefined | ViewType }[] {
838+
get views(): Array<Record<string, any> | string> | { agendaDuration?: number, allDayPanelMode?: AllDayPanelMode, appointmentCollectorTemplate?: any, appointmentTemplate?: any, appointmentTooltipTemplate?: any, cellDuration?: number, dataCellTemplate?: any, dateCellTemplate?: any, endDayHour?: number, firstDayOfWeek?: FirstDayOfWeek | undefined, groupByDate?: boolean, groupOrientation?: Orientation, groups?: Array<string>, intervalCount?: number, maxAppointmentsPerCell?: CellAppointmentsLimit | number, name?: string | undefined, offset?: number, resourceCellTemplate?: any, scrolling?: dxSchedulerScrolling, startDate?: Date | number | string | undefined, startDayHour?: number, timeCellTemplate?: any, type?: undefined | ViewType }[] {
854839
return this._getOption('views');
855840
}
856-
set views(value: Array<Record<string, any> | string> | { agendaDuration?: number, allDayPanelMode?: AllDayPanelMode, appointmentCollectorTemplate?: any, appointmentTemplate?: any, appointmentTooltipTemplate?: any, cellDuration?: number, dataCellTemplate?: any, dateCellTemplate?: any, dropDownAppointmentTemplate?: any, endDayHour?: number, firstDayOfWeek?: FirstDayOfWeek | undefined, groupByDate?: boolean, groupOrientation?: Orientation, groups?: Array<string>, intervalCount?: number, maxAppointmentsPerCell?: CellAppointmentsLimit | number, name?: string | undefined, offset?: number, resourceCellTemplate?: any, scrolling?: dxSchedulerScrolling, startDate?: Date | number | string | undefined, startDayHour?: number, timeCellTemplate?: any, type?: undefined | ViewType }[]) {
841+
set views(value: Array<Record<string, any> | string> | { agendaDuration?: number, allDayPanelMode?: AllDayPanelMode, appointmentCollectorTemplate?: any, appointmentTemplate?: any, appointmentTooltipTemplate?: any, cellDuration?: number, dataCellTemplate?: any, dateCellTemplate?: any, endDayHour?: number, firstDayOfWeek?: FirstDayOfWeek | undefined, groupByDate?: boolean, groupOrientation?: Orientation, groups?: Array<string>, intervalCount?: number, maxAppointmentsPerCell?: CellAppointmentsLimit | number, name?: string | undefined, offset?: number, resourceCellTemplate?: any, scrolling?: dxSchedulerScrolling, startDate?: Date | number | string | undefined, startDayHour?: number, timeCellTemplate?: any, type?: undefined | ViewType }[]) {
857842
this._setOption('views', value);
858843
}
859844

@@ -1160,13 +1145,6 @@ export class DxSchedulerComponent extends DxComponent implements OnDestroy, OnCh
11601145
*/
11611146
@Output() disabledChange: EventEmitter<boolean>;
11621147

1163-
/**
1164-
1165-
* This member supports the internal infrastructure and is not intended to be used directly from your code.
1166-
1167-
*/
1168-
@Output() dropDownAppointmentTemplateChange: EventEmitter<any>;
1169-
11701148
/**
11711149
11721150
* This member supports the internal infrastructure and is not intended to be used directly from your code.
@@ -1438,7 +1416,7 @@ export class DxSchedulerComponent extends DxComponent implements OnDestroy, OnCh
14381416
* This member supports the internal infrastructure and is not intended to be used directly from your code.
14391417
14401418
*/
1441-
@Output() viewsChange: EventEmitter<Array<Record<string, any> | string> | { agendaDuration?: number, allDayPanelMode?: AllDayPanelMode, appointmentCollectorTemplate?: any, appointmentTemplate?: any, appointmentTooltipTemplate?: any, cellDuration?: number, dataCellTemplate?: any, dateCellTemplate?: any, dropDownAppointmentTemplate?: any, endDayHour?: number, firstDayOfWeek?: FirstDayOfWeek | undefined, groupByDate?: boolean, groupOrientation?: Orientation, groups?: Array<string>, intervalCount?: number, maxAppointmentsPerCell?: CellAppointmentsLimit | number, name?: string | undefined, offset?: number, resourceCellTemplate?: any, scrolling?: dxSchedulerScrolling, startDate?: Date | number | string | undefined, startDayHour?: number, timeCellTemplate?: any, type?: undefined | ViewType }[]>;
1419+
@Output() viewsChange: EventEmitter<Array<Record<string, any> | string> | { agendaDuration?: number, allDayPanelMode?: AllDayPanelMode, appointmentCollectorTemplate?: any, appointmentTemplate?: any, appointmentTooltipTemplate?: any, cellDuration?: number, dataCellTemplate?: any, dateCellTemplate?: any, endDayHour?: number, firstDayOfWeek?: FirstDayOfWeek | undefined, groupByDate?: boolean, groupOrientation?: Orientation, groups?: Array<string>, intervalCount?: number, maxAppointmentsPerCell?: CellAppointmentsLimit | number, name?: string | undefined, offset?: number, resourceCellTemplate?: any, scrolling?: dxSchedulerScrolling, startDate?: Date | number | string | undefined, startDayHour?: number, timeCellTemplate?: any, type?: undefined | ViewType }[]>;
14421420

14431421
/**
14441422
@@ -1540,7 +1518,6 @@ export class DxSchedulerComponent extends DxComponent implements OnDestroy, OnCh
15401518
{ emit: 'dateSerializationFormatChange' },
15411519
{ emit: 'descriptionExprChange' },
15421520
{ emit: 'disabledChange' },
1543-
{ emit: 'dropDownAppointmentTemplateChange' },
15441521
{ emit: 'editingChange' },
15451522
{ emit: 'elementAttrChange' },
15461523
{ emit: 'endDateExprChange' },

packages/devextreme-angular/src/ui/scheduler/nested/view-dxi.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,6 @@ export class DxiSchedulerViewComponent extends CollectionNestedOption {
9595
this._setOption('dateCellTemplate', value);
9696
}
9797

98-
@Input()
99-
get dropDownAppointmentTemplate(): any {
100-
return this._getOption('dropDownAppointmentTemplate');
101-
}
102-
set dropDownAppointmentTemplate(value: any) {
103-
this._setOption('dropDownAppointmentTemplate', value);
104-
}
105-
10698
@Input()
10799
get endDayHour(): number {
108100
return this._getOption('endDayHour');

packages/devextreme-react/src/scheduler.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ type ISchedulerOptions = React.PropsWithChildren<ReplaceFieldTypes<Properties, I
5656
dataCellComponent?: React.ComponentType<any>;
5757
dateCellRender?: (...params: any) => React.ReactNode;
5858
dateCellComponent?: React.ComponentType<any>;
59-
dropDownAppointmentRender?: (...params: any) => React.ReactNode;
60-
dropDownAppointmentComponent?: React.ComponentType<any>;
6159
resourceCellRender?: (...params: any) => React.ReactNode;
6260
resourceCellComponent?: React.ComponentType<any>;
6361
timeCellRender?: (...params: any) => React.ReactNode;
@@ -128,11 +126,6 @@ const Scheduler = memo(
128126
render: "dateCellRender",
129127
component: "dateCellComponent"
130128
},
131-
{
132-
tmplOption: "dropDownAppointmentTemplate",
133-
render: "dropDownAppointmentRender",
134-
component: "dropDownAppointmentComponent"
135-
},
136129
{
137130
tmplOption: "resourceCellTemplate",
138131
render: "resourceCellRender",
@@ -486,7 +479,6 @@ type IViewProps = React.PropsWithChildren<{
486479
cellDuration?: number;
487480
dataCellTemplate?: ((itemData: any, itemIndex: number, itemElement: any) => string | any) | template;
488481
dateCellTemplate?: ((itemData: any, itemIndex: number, itemElement: any) => string | any) | template;
489-
dropDownAppointmentTemplate?: ((itemData: any, itemIndex: number, contentElement: any) => string | any) | template;
490482
endDayHour?: number;
491483
firstDayOfWeek?: FirstDayOfWeek | undefined;
492484
groupByDate?: boolean;
@@ -512,8 +504,6 @@ type IViewProps = React.PropsWithChildren<{
512504
dataCellComponent?: React.ComponentType<any>;
513505
dateCellRender?: (...params: any) => React.ReactNode;
514506
dateCellComponent?: React.ComponentType<any>;
515-
dropDownAppointmentRender?: (...params: any) => React.ReactNode;
516-
dropDownAppointmentComponent?: React.ComponentType<any>;
517507
resourceCellRender?: (...params: any) => React.ReactNode;
518508
resourceCellComponent?: React.ComponentType<any>;
519509
timeCellRender?: (...params: any) => React.ReactNode;
@@ -548,10 +538,6 @@ const _componentView = (props: IViewProps) => {
548538
tmplOption: "dateCellTemplate",
549539
render: "dateCellRender",
550540
component: "dateCellComponent"
551-
}, {
552-
tmplOption: "dropDownAppointmentTemplate",
553-
render: "dropDownAppointmentRender",
554-
component: "dropDownAppointmentComponent"
555541
}, {
556542
tmplOption: "resourceCellTemplate",
557543
render: "resourceCellRender",

packages/devextreme-vue/src/scheduler.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ type AccessibleOptions = Pick<Properties,
9292
"dateSerializationFormat" |
9393
"descriptionExpr" |
9494
"disabled" |
95-
"dropDownAppointmentTemplate" |
9695
"editing" |
9796
"elementAttr" |
9897
"endDateExpr" |
@@ -179,7 +178,6 @@ const componentConfig = {
179178
dateSerializationFormat: String,
180179
descriptionExpr: String,
181180
disabled: Boolean,
182-
dropDownAppointmentTemplate: {},
183181
editing: [Boolean, Object] as PropType<boolean | Record<string, any>>,
184182
elementAttr: Object as PropType<Record<string, any>>,
185183
endDateExpr: String,
@@ -262,7 +260,6 @@ const componentConfig = {
262260
"update:dateSerializationFormat": null,
263261
"update:descriptionExpr": null,
264262
"update:disabled": null,
265-
"update:dropDownAppointmentTemplate": null,
266263
"update:editing": null,
267264
"update:elementAttr": null,
268265
"update:endDateExpr": null,
@@ -696,7 +693,6 @@ const DxViewConfig = {
696693
"update:cellDuration": null,
697694
"update:dataCellTemplate": null,
698695
"update:dateCellTemplate": null,
699-
"update:dropDownAppointmentTemplate": null,
700696
"update:endDayHour": null,
701697
"update:firstDayOfWeek": null,
702698
"update:groupByDate": null,
@@ -722,7 +718,6 @@ const DxViewConfig = {
722718
cellDuration: Number,
723719
dataCellTemplate: {},
724720
dateCellTemplate: {},
725-
dropDownAppointmentTemplate: {},
726721
endDayHour: Number,
727722
firstDayOfWeek: Number as PropType<FirstDayOfWeek>,
728723
groupByDate: Boolean,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export class CompactAppointmentsHelper {
5252
return {
5353
clickEvent: this._clickEvent(options.onAppointmentClick).bind(this),
5454
dragBehavior: options.allowDrag && this._createTooltipDragBehavior($appointmentCollector).bind(this),
55-
dropDownAppointmentTemplate: this.instance.option().dropDownAppointmentTemplate, // TODO deprecated option
5655
isButtonClick: true,
5756
_loopFocus: true,
5857
};

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ class Scheduler extends SchedulerOptionsBaseWidget {
484484
this.updateAppointmentDataSource();
485485
this.repaint();
486486
break;
487-
case 'dropDownAppointmentTemplate':
488487
case 'appointmentCollectorTemplate':
489488
case '_appointmentTooltipOffset':
490489
case '_appointmentCountPerCell':
@@ -1996,11 +1995,6 @@ class Scheduler extends SchedulerOptionsBaseWidget {
19961995
this._appointmentTooltip?.hide();
19971996
}
19981997

1999-
scrollToTime(hours, minutes, date) {
2000-
errors.log('W0002', 'dxScheduler', 'scrollToTime', '21.1', 'Use the "scrollTo" method instead');
2001-
this._workSpace.scrollToTime(hours, minutes, date);
2002-
}
2003-
20041998
scrollTo(date, groupValues, allDay) {
20051999
this._workSpace.scrollTo(date, groupValues, allDay);
20062000
}

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
DEFAULT_SCHEDULER_INTERNAL_OPTIONS,
77
DEFAULT_SCHEDULER_OPTIONS,
88
DEFAULT_SCHEDULER_OPTIONS_RULES,
9-
DEPRECATED_SCHEDULER_OPTIONS,
109
} from './utils/options/constants';
1110
import type {
1211
NormalizedView, SafeSchedulerOptions, SchedulerOptionsRule, View,
@@ -41,14 +40,6 @@ export class SchedulerOptionsBaseWidget extends Widget<SafeSchedulerOptions> {
4140
}) as SafeSchedulerOptions;
4241
}
4342

44-
_setDeprecatedOptions(): void {
45-
// @ts-expect-error
46-
super._setDeprecatedOptions();
47-
48-
// @ts-expect-error
49-
extend(this._deprecatedOptions, DEPRECATED_SCHEDULER_OPTIONS);
50-
}
51-
5243
protected _defaultOptionsRules(): SchedulerOptionsRule[] {
5344
// @ts-expect-error
5445
const rules: SchedulerOptionsRule[] = super._defaultOptionsRules();

packages/devextreme/js/__internal/scheduler/tooltip_strategies/m_tooltip_strategy_base.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const TOOLTIP_APPOINTMENT_ITEM_MARKER_BODY = `${TOOLTIP_APPOINTMENT_ITEM}-marker
1515
const TOOLTIP_APPOINTMENT_ITEM_DELETE_BUTTON_CONTAINER = `${TOOLTIP_APPOINTMENT_ITEM}-delete-button-container`;
1616
const TOOLTIP_APPOINTMENT_ITEM_DELETE_BUTTON = `${TOOLTIP_APPOINTMENT_ITEM}-delete-button`;
1717

18+
const APPOINTMENT_TOOLTIP_TEMPLATE = 'appointmentTooltipTemplate';
19+
1820
export class TooltipStrategyBase {
1921
protected asyncTemplatePromises = new Set<Promise<void>>();
2022

@@ -135,32 +137,31 @@ export class TooltipStrategyBase {
135137
const itemListContent = this._createItemListContent(appointment, targetedAppointment, color);
136138
this._options.addDefaultTemplates({
137139
// @ts-expect-error
138-
[this._getItemListTemplateName()]: new FunctionTemplate((options) => {
140+
appointmentTooltip: new FunctionTemplate((options) => {
139141
const $container = $(options.container);
140142
$container.append(itemListContent);
141143
return $container;
142144
}),
143145
});
144146

145-
const template = this._options.getAppointmentTemplate(`${this._getItemListTemplateName()}Template`);
147+
const template = this._options.getAppointmentTemplate(APPOINTMENT_TOOLTIP_TEMPLATE);
146148
return this._createFunctionTemplate(template, appointment, targetedAppointment, index);
147149
}
148150

149151
_createFunctionTemplate(template, appointmentData, targetedAppointmentData, index) {
150152
const isButtonClicked = Boolean(this._extraOptions.isButtonClick);
151153

152-
const isEmptyDropDownAppointmentTemplate = this._isEmptyDropDownAppointmentTemplate();
153154
// @ts-expect-error
154155
return new FunctionTemplate((options) => {
155156
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
156157
const { promise, resolve } = createPromise<void>();
157158
this.asyncTemplatePromises.add(promise);
158159
return template.render({
159-
model: isEmptyDropDownAppointmentTemplate ? {
160+
model: {
160161
appointmentData,
161162
targetedAppointmentData,
162163
isButtonClicked,
163-
} : appointmentData,
164+
},
164165
container: options.container,
165166
index,
166167
onRendered: () => {
@@ -171,14 +172,6 @@ export class TooltipStrategyBase {
171172
});
172173
}
173174

174-
_getItemListTemplateName() {
175-
return this._isEmptyDropDownAppointmentTemplate() ? 'appointmentTooltip' : 'dropDownAppointment';
176-
}
177-
178-
_isEmptyDropDownAppointmentTemplate() {
179-
return !this._extraOptions.dropDownAppointmentTemplate || this._extraOptions.dropDownAppointmentTemplate === 'dropDownAppointment';
180-
}
181-
182175
_onListItemClick(e) {
183176
this.hide();
184177
this._extraOptions.clickEvent && this._extraOptions.clickEvent(e);

0 commit comments

Comments
 (0)