diff --git a/packages/devextreme-vue/src/scheduler.ts b/packages/devextreme-vue/src/scheduler.ts index a8bcca7114cc..ead3818f5f1b 100644 --- a/packages/devextreme-vue/src/scheduler.ts +++ b/packages/devextreme-vue/src/scheduler.ts @@ -120,7 +120,6 @@ import { ShowTextMode, } from "devextreme/ui/toolbar"; import { - dxButtonGroupOptions, dxButtonGroupItem, ContentReadyEvent as ButtonGroupContentReadyEvent, DisposingEvent as ButtonGroupDisposingEvent, @@ -1006,7 +1005,7 @@ const DxItemConfig = { location: String as PropType, menuItemTemplate: {}, name: String as PropType, - options: Object as PropType | dxButtonGroupOptions>, + options: Object as PropType>, showText: String as PropType, tabPanelOptions: Object as PropType>, tabs: Array as PropType>>, @@ -1704,7 +1703,7 @@ const DxToolbarItemConfig = { location: String as PropType, menuItemTemplate: {}, name: String as PropType, - options: Object as PropType | dxButtonGroupOptions>, + options: Object as PropType>, showText: String as PropType, template: {}, text: String, diff --git a/packages/devextreme/js/ui/scheduler.d.ts b/packages/devextreme/js/ui/scheduler.d.ts index e7bcc32063fd..873671a3fbe5 100644 --- a/packages/devextreme/js/ui/scheduler.d.ts +++ b/packages/devextreme/js/ui/scheduler.d.ts @@ -24,7 +24,10 @@ import { PointerInteractionEvent, } from '../events'; -import { dxButtonGroupOptions, dxButtonGroupItem } from './button_group'; +import { + Properties as ButtonGroupProperties, + Item as ButtonGroupItem, +} from './button_group'; import { CollectionWidgetItem, } from './collection/ui.collection_widget.base'; @@ -35,7 +38,7 @@ import dxForm, { Properties as FormProperties } from './form'; import dxPopup, { Properties as PopupProperties } from './popup'; import dxSortable from './sortable'; -import { dxToolbarItem } from './toolbar'; +import { Item as ToolbarItemBase } from './toolbar'; import Widget, { WidgetOptions, @@ -56,12 +59,10 @@ interface AppointmentDraggingEvent { export interface TargetedAppointmentInfo { /** * @docid - * @type dxSchedulerAppointment */ readonly appointmentData: Appointment; /** * @docid - * @type dxSchedulerAppointment */ readonly targetedAppointmentData?: Appointment; } @@ -115,7 +116,6 @@ export type SchedulerPredefinedDateNavigatorItem = 'prev' | 'next' | 'dateInterv export type AppointmentAddedEvent = EventInfo & { /** * @docid _ui_scheduler_AppointmentAddedEvent.appointmentData - * @type dxSchedulerAppointment */ readonly appointmentData: Appointment; /** @docid _ui_scheduler_AppointmentAddedEvent.error */ @@ -131,12 +131,10 @@ export type AppointmentAddedEvent = EventInfo & { export type AppointmentAddingEvent = EventInfo & { /** * @docid _ui_scheduler_AppointmentAddingEvent.appointmentData - * @type dxSchedulerAppointment */ readonly appointmentData: Appointment; /** * @docid _ui_scheduler_AppointmentAddingEvent.cancel - * @type Boolean|Promise */ cancel: boolean | PromiseLike; }; @@ -183,7 +181,6 @@ export type AppointmentDblClickEvent = Cancelable & NativeEventInfo & { /** * @docid _ui_scheduler_AppointmentDeletedEvent.appointmentData - * @type dxSchedulerAppointment */ readonly appointmentData: Appointment; /** @docid _ui_scheduler_AppointmentDeletedEvent.error */ @@ -199,12 +196,10 @@ export type AppointmentDeletedEvent = EventInfo & { export type AppointmentDeletingEvent = EventInfo & { /** * @docid _ui_scheduler_AppointmentDeletingEvent.appointmentData - * @type dxSchedulerAppointment */ readonly appointmentData: Appointment; /** * @docid _ui_scheduler_AppointmentDeletingEvent.cancel - * @type Boolean|Promise */ cancel: boolean | PromiseLike; }; @@ -218,7 +213,6 @@ export type AppointmentDeletingEvent = EventInfo & { export type AppointmentFormOpeningEvent = Cancelable & EventInfo & { /** * @docid _ui_scheduler_AppointmentFormOpeningEvent.appointmentData - * @type dxSchedulerAppointment */ readonly appointmentData?: Appointment; /** @docid _ui_scheduler_AppointmentFormOpeningEvent.form */ @@ -248,7 +242,6 @@ export type AppointmentTooltipShowingEvent = Cancelable & EventInfo readonly targetElement: DxElement; /** * @docid _ui_scheduler_AppointmentTooltipShowingEvent.appointments - * @type Array */ readonly appointments: AppointmentTooltipShowingAppointmentInfo[]; }; @@ -273,7 +266,6 @@ export type AppointmentRenderedEvent = EventInfo & TargetedAppointm export type AppointmentUpdatedEvent = EventInfo & { /** * @docid _ui_scheduler_AppointmentUpdatedEvent.appointmentData - * @type dxSchedulerAppointment */ readonly appointmentData: Appointment; /** @docid _ui_scheduler_AppointmentUpdatedEvent.error */ @@ -289,17 +281,14 @@ export type AppointmentUpdatedEvent = EventInfo & { export type AppointmentUpdatingEvent = EventInfo & { /** * @docid _ui_scheduler_AppointmentUpdatingEvent.oldData - * @type Object */ readonly oldData: any; /** * @docid _ui_scheduler_AppointmentUpdatingEvent.newData - * @type Object */ readonly newData: any; /** * @docid _ui_scheduler_AppointmentUpdatingEvent.cancel - * @type Boolean|Promise */ cancel?: boolean | PromiseLike; }; @@ -442,7 +431,6 @@ export type AppointmentCollectorTemplateData = { readonly appointmentCount: number; /** * @docid - * @type Array */ readonly items: Appointment[]; /** @@ -463,7 +451,10 @@ export type DateNavigatorTextInfo = { * @namespace DevExpress.ui * @docid */ -export interface dxSchedulerOptions extends WidgetOptions { +export interface dxSchedulerOptions extends Omit< + WidgetOptions, + 'onContentReady' | 'onDisposing' | 'onInitialized' | 'onOptionChanged' +> { /** * @docid * @default false @@ -878,6 +869,34 @@ export interface dxSchedulerOptions extends WidgetOptions { * @public */ onCellContextMenu?: ((e: CellContextMenuEvent) => void) | string; + /** + * @docid + * @public + * @type_function_param1 e:{ui/scheduler:ContentReadyEvent} + * @action + */ + onContentReady?: (e: ContentReadyEvent) => void; + /** + * @docid + * @public + * @type_function_param1 e:{ui/scheduler:DisposingEvent} + * @action + */ + onDisposing?: (e: DisposingEvent) => void; + /** + * @docid + * @public + * @type_function_param1 e:{ui/scheduler:InitializedEvent} + * @action + */ + onInitialized?: (e: InitializedEvent) => void; + /** + * @docid + * @public + * @type_function_param1 e:{ui/scheduler:OptionChangedEvent} + * @action + */ + onOptionChanged?: (e: OptionChangedEvent) => void; /** * @docid * @default "dialog" @@ -1206,17 +1225,18 @@ export interface dxSchedulerOptions extends WidgetOptions { /** * @docid + * @type object * @inherits dxButtonGroupOptions * @namespace DevExpress.ui.dxScheduler * @public */ -export type DateNavigatorItemProperties = dxButtonGroupOptions & { +export type DateNavigatorItemProperties = ButtonGroupProperties & { /** * @docid * @type Array * @public */ - items: Array; + items: Array; }; /** @@ -1231,7 +1251,7 @@ export type dxSchedulerToolbarItem = ToolbarItem; * @namespace DevExpress.ui.dxScheduler * @public */ -export type ToolbarItem = dxToolbarItem & { +export type ToolbarItem = ToolbarItemBase & { /** * @docid dxSchedulerToolbarItem.name * @public @@ -1293,25 +1313,22 @@ export type Toolbar = { * @namespace DevExpress.ui * @public */ -export default class dxScheduler extends Widget { +export default class dxScheduler extends Widget { /** * @docid * @publicName addAppointment(appointment) - * @param1 appointment:dxSchedulerAppointment * @public */ addAppointment(appointment: Appointment): void; /** * @docid * @publicName deleteAppointment(appointment) - * @param1 appointment:dxSchedulerAppointment * @public */ deleteAppointment(appointment: Appointment): void; /** * @docid * @publicName deleteRecurrence(appointment, date, recurrenceEditMode) - * @param1 appointmentData:dxSchedulerAppointment * @public */ deleteRecurrence( @@ -1329,7 +1346,6 @@ export default class dxScheduler extends Widget { /** * @docid * @publicName getOccurrences(startDate, endDate, appointments) - * @param3 appointments:Array * @public */ getOccurrences(startDate: Date, endDate: Date, appointments: Appointment[]): Occurrence[]; @@ -1342,7 +1358,6 @@ export default class dxScheduler extends Widget { /** * @docid * @publicName hideAppointmentPopup(saveChanges) - * @param1 saveChanges:Boolean|undefined * @public */ hideAppointmentPopup(saveChanges?: boolean): void; @@ -1355,10 +1370,6 @@ export default class dxScheduler extends Widget { /** * @docid * @publicName scrollTo(date, options) - * @param2 options:Object|undefined - * @param2_field group:Object|undefined - * @param2_field allDay:Boolean|undefined - * @param2_field alignInView:Enums.SchedulerScrollToAlign|undefined * @public */ scrollTo(date: Date, options?: { @@ -1369,8 +1380,6 @@ export default class dxScheduler extends Widget { /** * @docid * @publicName scrollTo(date, group, allDay) - * @param2 group:Object|undefined - * @param3 allDay:Boolean|undefined * @public * @deprecated */ @@ -1378,26 +1387,18 @@ export default class dxScheduler extends Widget { /** * @docid * @publicName showAppointmentPopup(appointmentData, createNewAppointment, currentAppointmentData) - * @param1 appointmentData:dxSchedulerAppointment|undefined - * @param2 createNewAppointment:Boolean|undefined - * @param3 currentAppointmentData:dxSchedulerAppointment|undefined * @public */ showAppointmentPopup(appointmentData?: Appointment, createNewAppointment?: boolean, currentAppointmentData?: Appointment): void; /** * @docid * @publicName showAppointmentTooltip(appointmentData, target, currentAppointmentData) - * @param1 appointmentData:dxSchedulerAppointment - * @param2 target:string|Element|jQuery - * @param3 currentAppointmentData:dxSchedulerAppointment|undefined * @public */ showAppointmentTooltip(appointmentData: Appointment, target: string | UserDefinedElement, currentAppointmentData?: Appointment): void; /** * @docid * @publicName updateAppointment(target, appointment) - * @param1 target:dxSchedulerAppointment - * @param2 appointment:dxSchedulerAppointment * @public */ updateAppointment(target: Appointment, appointment: Appointment): void; @@ -1504,7 +1505,6 @@ export type Occurrence = { /** * @docid * @public - * @type dxSchedulerAppointment */ appointmentData: Appointment; }; @@ -1525,38 +1525,3 @@ export interface dxSchedulerScrolling { */ mode?: ScrollMode; } - -/// #DEBUG -// eslint-disable-next-line import/first -import { CheckedEvents } from '../core'; - -type FilterOutHidden = Omit; - -type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onAppointmentAdded' | 'onAppointmentAdding' | 'onAppointmentClick' | 'onAppointmentContextMenu' | 'onAppointmentDblClick' | 'onAppointmentDeleted' | 'onAppointmentDeleting' | 'onAppointmentFormOpening' | 'onAppointmentRendered' | 'onAppointmentTooltipShowing' | 'onAppointmentUpdated' | 'onAppointmentUpdating' | 'onCellClick' | 'onCellContextMenu' | 'onSelectionEnd'>; - -/** -* @hidden -*/ -type Events = { -/** - * @docid dxSchedulerOptions.onContentReady - * @type_function_param1 e:{ui/scheduler:ContentReadyEvent} - */ -onContentReady?: ((e: ContentReadyEvent) => void); -/** - * @docid dxSchedulerOptions.onDisposing - * @type_function_param1 e:{ui/scheduler:DisposingEvent} - */ -onDisposing?: ((e: DisposingEvent) => void); -/** - * @docid dxSchedulerOptions.onInitialized - * @type_function_param1 e:{ui/scheduler:InitializedEvent} - */ -onInitialized?: ((e: InitializedEvent) => void); -/** - * @docid dxSchedulerOptions.onOptionChanged - * @type_function_param1 e:{ui/scheduler:OptionChangedEvent} - */ -onOptionChanged?: ((e: OptionChangedEvent) => void); -}; -/// #ENDDEBUG diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index d915f281adee..dd026af3c5ff 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -26242,7 +26242,7 @@ declare module DevExpress.ui { /** * [descr:dxScheduler] */ - export class dxScheduler extends Widget { + export class dxScheduler extends Widget { /** * [descr:dxScheduler.addAppointment(appointment)] */ @@ -26779,7 +26779,11 @@ declare module DevExpress.ui { * @deprecated [depNote:dxSchedulerOptions] * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. */ - export interface dxSchedulerOptions extends WidgetOptions { + export interface dxSchedulerOptions + extends Omit< + WidgetOptions, + 'onContentReady' | 'onDisposing' | 'onInitialized' | 'onOptionChanged' + > { /** * [descr:dxSchedulerOptions.adaptivityEnabled] */ @@ -27110,6 +27114,22 @@ declare module DevExpress.ui { onCellContextMenu?: | ((e: DevExpress.ui.dxScheduler.CellContextMenuEvent) => void) | string; + /** + * [descr:dxSchedulerOptions.onContentReady] + */ + onContentReady?: (e: DevExpress.ui.dxScheduler.ContentReadyEvent) => void; + /** + * [descr:dxSchedulerOptions.onDisposing] + */ + onDisposing?: (e: DevExpress.ui.dxScheduler.DisposingEvent) => void; + /** + * [descr:dxSchedulerOptions.onInitialized] + */ + onInitialized?: (e: DevExpress.ui.dxScheduler.InitializedEvent) => void; + /** + * [descr:dxSchedulerOptions.onOptionChanged] + */ + onOptionChanged?: (e: DevExpress.ui.dxScheduler.OptionChangedEvent) => void; /** * [descr:dxSchedulerOptions.recurrenceEditMode] */ @@ -35012,12 +35032,15 @@ declare module DevExpress.ui.dxScheduler { /** * [descr:DateNavigatorItemProperties] */ - export type DateNavigatorItemProperties = dxButtonGroupOptions & { - /** - * [descr:DateNavigatorItemProperties.items] - */ - items: Array; - }; + export type DateNavigatorItemProperties = + DevExpress.ui.dxButtonGroup.Properties & { + /** + * [descr:DateNavigatorItemProperties.items] + */ + items: Array< + DevExpress.ui.dxButtonGroup.Item | SchedulerPredefinedDateNavigatorItem + >; + }; /** * [descr:dxSchedulerToolbar] */ @@ -35042,7 +35065,7 @@ declare module DevExpress.ui.dxScheduler { /** * [descr:dxSchedulerToolbarItem] */ - export type ToolbarItem = dxToolbarItem & { + export type ToolbarItem = DevExpress.ui.dxToolbar.Item & { /** * [descr:dxSchedulerToolbarItem.name] */