@@ -223,11 +223,11 @@ export class AppointmentForm {
223223 const showMainGroupIcons = [ 'main' , 'both' ] . includes ( iconsShowMode ) ;
224224 const showRecurrenceGroupIcons = [ 'recurrence' , 'both' ] . includes ( iconsShowMode ) ;
225225
226- const mainGroup = this . createMainFormGroup ( showMainGroupIcons ) ;
226+ const mainGroup = this . createMainFormGroup ( ) ;
227227
228228 this . _recurrenceForm = new RecurrenceForm ( this . scheduler ) ;
229229 const recurrenceGroup = this . _recurrenceForm
230- . createRecurrenceFormGroup ( showRecurrenceGroupIcons ) ;
230+ . createRecurrenceFormGroup ( ) ;
231231
232232 const items = [ mainGroup , recurrenceGroup ] ;
233233
@@ -325,23 +325,23 @@ export class AppointmentForm {
325325 return this . scheduler . createComponent ( element , dxForm , formOptions ) as dxForm ;
326326 }
327327
328- private createMainFormGroup ( showIcon : boolean ) : GroupItem {
328+ private createMainFormGroup ( ) : GroupItem {
329329 return {
330330 name : MAIN_GROUP_NAME ,
331331 itemType : 'group' ,
332332 colSpan : 1 ,
333333 cssClass : CLASSES . mainGroup ,
334334 items : [
335- this . createSubjectGroup ( showIcon ) ,
336- this . createDateRangeGroup ( showIcon ) ,
337- this . createRepeatGroup ( showIcon ) ,
338- this . createResourcesGroup ( showIcon ) ,
339- this . createDescriptionGroup ( showIcon ) ,
335+ this . createSubjectGroup ( ) ,
336+ this . createDateRangeGroup ( ) ,
337+ this . createRepeatGroup ( ) ,
338+ this . createResourcesGroup ( ) ,
339+ this . createDescriptionGroup ( ) ,
340340 ] ,
341341 } as GroupItem ;
342342 }
343343
344- private createSubjectGroup ( showIcon : boolean ) : GroupItem {
344+ private createSubjectGroup ( ) : GroupItem {
345345 const { textExpr } = this . scheduler . getDataAccessors ( ) . expr ;
346346
347347 return {
@@ -356,11 +356,10 @@ export class AppointmentForm {
356356 colSpan : 1 ,
357357 cssClass : CLASSES . formIcon ,
358358 template : createFormIconTemplate ( 'isnotblank' ) ,
359- visible : showIcon ,
360359 } ,
361360 {
362361 name : SUBJECT_EDITOR_NAME ,
363- colSpan : showIcon ? 1 : 2 ,
362+ colSpan : 1 ,
364363 itemType : 'simple' ,
365364 cssClass : CLASSES . textEditor ,
366365 dataField : textExpr ,
@@ -373,7 +372,7 @@ export class AppointmentForm {
373372 } as GroupItem ;
374373 }
375374
376- private createDateRangeGroup ( showIcon : boolean ) : GroupItem {
375+ private createDateRangeGroup ( ) : GroupItem {
377376 return {
378377 name : DATE_GROUP_NAME ,
379378 itemType : 'group' ,
@@ -386,10 +385,9 @@ export class AppointmentForm {
386385 colSpan : 1 ,
387386 cssClass : CLASSES . formIcon ,
388387 template : createFormIconTemplate ( 'clock' ) ,
389- visible : showIcon ,
390388 } ,
391389 {
392- colSpan : showIcon ? 1 : 2 ,
390+ colSpan : 1 ,
393391 name : DATE_OPTIONS_GROUP_NAME ,
394392 itemType : 'group' ,
395393 items : [
@@ -652,7 +650,7 @@ export class AppointmentForm {
652650 } as GroupItem ;
653651 }
654652
655- private createRepeatGroup ( showIcon : boolean ) : GroupItem {
653+ private createRepeatGroup ( ) : GroupItem {
656654 const { recurrenceRuleExpr } = this . scheduler . getDataAccessors ( ) . expr ;
657655
658656 return {
@@ -667,11 +665,10 @@ export class AppointmentForm {
667665 colSpan : 1 ,
668666 cssClass : CLASSES . formIcon ,
669667 template : createFormIconTemplate ( 'repeat' ) ,
670- visible : showIcon ,
671668 } ,
672669 {
673670 name : REPEAT_EDITOR_NAME ,
674- colSpan : showIcon ? 1 : 2 ,
671+ colSpan : 1 ,
675672 itemType : 'simple' ,
676673 cssClass : CLASSES . repeatEditor ,
677674 label : {
@@ -707,7 +704,7 @@ export class AppointmentForm {
707704 } as GroupItem ;
708705 }
709706
710- private createDescriptionGroup ( showIcon : boolean ) : GroupItem {
707+ private createDescriptionGroup ( ) : GroupItem {
711708 const { descriptionExpr } = this . scheduler . getDataAccessors ( ) . expr ;
712709
713710 return {
@@ -722,12 +719,11 @@ export class AppointmentForm {
722719 colSpan : 1 ,
723720 cssClass : CLASSES . formIcon ,
724721 template : createFormIconTemplate ( 'description' ) ,
725- visible : showIcon ,
726722 } ,
727723 {
728724 name : DESCRIPTION_EDITOR_NAME ,
729725 dataField : descriptionExpr ,
730- colSpan : showIcon ? 1 : 2 ,
726+ colSpan : 1 ,
731727 itemType : 'simple' ,
732728 cssClass : CLASSES . descriptionEditor ,
733729 label : {
@@ -742,7 +738,7 @@ export class AppointmentForm {
742738 } as GroupItem ;
743739 }
744740
745- private createResourcesGroup ( showIcon : boolean ) : GroupItem {
741+ private createResourcesGroup ( ) : GroupItem {
746742 const resourcesLoaders : ResourceLoader [ ] = Object . values ( this . scheduler . getResourceById ( ) ) ;
747743
748744 let resourcesItems : FormItem [ ] = resourcesLoaders . map ( ( resourceLoader ) => {
@@ -783,12 +779,11 @@ export class AppointmentForm {
783779 colSpan : 1 ,
784780 cssClass : `${ CLASSES . formIcon } ${ CLASSES . defaultResourceIcon } ` ,
785781 template : createFormIconTemplate ( 'addcircleoutline' ) ,
786- visible : showIcon ,
787782 } ,
788783 {
789784 name : RESOURCE_EDITORS_GROUP_NAME ,
790785 itemType : 'group' ,
791- colSpan : showIcon ? 1 : 2 ,
786+ colSpan : 1 ,
792787 items : resourcesItems ,
793788 } ,
794789 ] ,
@@ -811,9 +806,8 @@ export class AppointmentForm {
811806 name : `${ dataField } Icon` ,
812807 cssClass : CLASSES . formIcon ,
813808 template : createFormIconTemplate ( icon ) ,
814- visible : showIcon ,
815809 } ,
816- { ...item , colSpan : showIcon ? 1 : 2 } ,
810+ { ...item } ,
817811 ] ,
818812 } as GroupItem ;
819813 } ) ;
@@ -851,6 +845,19 @@ export class AppointmentForm {
851845
852846 if ( item . itemType === 'group' ) {
853847 const groupItem = item as GroupItem ;
848+
849+ if ( itemClasses . includes ( CLASSES . groupWithIcon ) ) {
850+ groupItem . items ?. forEach ( ( child ) => {
851+ const childClasses = ( child . cssClass ?? '' ) . split ( ' ' ) ;
852+
853+ if ( childClasses . includes ( CLASSES . formIcon ) ) {
854+ ( child as SimpleItem ) . visible = showIcon ;
855+ } else {
856+ ( child as SimpleItem ) . colSpan = showIcon ? 1 : 2 ;
857+ }
858+ } ) ;
859+ }
860+
854861 groupItem . items ?. forEach ( ( child ) => {
855862 this . setStylingModeToEditors ( child , showIcon ) ;
856863 } ) ;
0 commit comments