@@ -38,6 +38,8 @@ import { customizeFormItems } from './m_customize_form_items';
3838import { RecurrenceForm } from './m_recurrence_form' ;
3939import { createFormIconTemplate , getStartDateCommonConfig , RecurrenceRule } from './utils' ;
4040
41+ type SchedulerEditingObject = Exclude < NonNullable < SchedulerProperties [ 'editing' ] > , boolean > ;
42+
4143export interface AppointmentFormConfig {
4244 dataAccessors : AppointmentDataAccessor ;
4345 editing : SchedulerProperties [ 'editing' ] ;
@@ -232,12 +234,17 @@ export class AppointmentForm {
232234 this . createForm ( customizedItems ) ;
233235 }
234236
235- private getEditingForm ( ) : NonNullable < NonNullable < SchedulerProperties [ 'editing' ] > [ 'form' ] > | undefined {
237+ private getEditingForm ( ) : SchedulerEditingObject [ 'form' ] {
238+ const editing = this . getEditingObject ( ) ;
239+ return editing ?. form ;
240+ }
241+
242+ private getEditingObject ( ) : SchedulerEditingObject | undefined {
236243 const { editing } = this . config ;
237244 if ( isBoolean ( editing ) || ! editing ) {
238245 return undefined ;
239246 }
240- return editing . form ?? undefined ;
247+ return editing ;
241248 }
242249
243250 private getIconsShowMode ( ) : AppointmentFormIconsShowMode {
@@ -512,8 +519,7 @@ export class AppointmentForm {
512519 timeItemOptions ?: SimpleItem ,
513520 timezoneItemOptions ?: SimpleItem ,
514521 ) : GroupItem {
515- const { editing } = this . config ;
516- const allowTimeZoneEditing = ! isBoolean ( editing ) ? editing ?. allowTimeZoneEditing : undefined ;
522+ const allowTimeZoneEditing = this . getEditingObject ( ) ?. allowTimeZoneEditing ;
517523 const { startDateExpr, endDateExpr } = this . config . dataAccessors . expr ;
518524 const isStartDateEditor = dateExpr === startDateExpr ;
519525
@@ -869,8 +875,7 @@ export class AppointmentForm {
869875
870876 showMainGroup ( ) : void {
871877 const currentHeight = this . dxPopup . option ( 'height' ) as string | number | undefined ;
872- const { editing } = this . config ;
873- const configuredHeight = ( ! isBoolean ( editing ) && editing ?. popup ?. height ) || 'auto' ;
878+ const configuredHeight = this . getEditingObject ( ) ?. popup ?. height ?? 'auto' ;
874879
875880 if ( typeof currentHeight === 'number' ) {
876881 this . dxPopup . option ( 'height' , configuredHeight ) ;
0 commit comments