File tree Expand file tree Collapse file tree
apps/react-storybook/stories/scheduler
devextreme-scss/scss/widgets/base/scheduler
devextreme/js/__internal/scheduler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -383,6 +383,40 @@ export const ResourcesColumnLayout: Story = {
383383 } ,
384384} ;
385385
386+ export const CustomItemBeforeMainGroup : Story = {
387+ args : {
388+ ...baseConfig ,
389+ resources,
390+ } ,
391+ argTypes : iconsShowModeArgType ,
392+ render : ( args ) => {
393+ return (
394+ < Scheduler
395+ { ...baseConfig }
396+ resources = { resources }
397+ editing = { {
398+ form : {
399+ items : [
400+ {
401+ name : "customNotice" ,
402+ template : ( ) => {
403+ const element = document . createElement ( "div" ) ;
404+ element . className = "custom-form-notice" ;
405+ element . textContent = "This is a custom element placed before mainGroup. The slide animation should not overlap this area." ;
406+ return element ;
407+ } ,
408+ } ,
409+ "mainGroup" ,
410+ "recurrenceGroup" ,
411+ ] ,
412+ iconsShowMode : args [ "editing.form.iconsShowMode" ] ,
413+ } ,
414+ } as Properties [ "editing" ] }
415+ />
416+ ) ;
417+ } ,
418+ } ;
419+
386420export const RTL : Story = {
387421 args : {
388422 ...baseConfig ,
Original file line number Diff line number Diff line change 99.scheduler-form-custom-icon-button * {
1010 padding : 0 !important ;
1111}
12+
13+ .custom-form-notice {
14+ background : # fce4e4 ;
15+ border : 1px solid # e0a0a0 ;
16+ border-radius : 4px ;
17+ padding : 8px 12px ;
18+ color : # 8b3a3a ;
19+ font-size : 13px ;
20+ line-height : 1.4 ;
21+ }
Original file line number Diff line number Diff line change @@ -484,7 +484,7 @@ $scheduler-appointment-form-label-padding: 20px;
484484 & .dx-scheduler-form-main-group-hidden {
485485 transform : translateX (-110% );
486486 position : absolute ;
487- top : 0 ;
487+ top : var ( --dx-scheduler-animation-top , 0 ) ;
488488 }
489489 }
490490
@@ -497,7 +497,7 @@ $scheduler-appointment-form-label-padding: 20px;
497497 & .dx-scheduler-form-recurrence-group-hidden {
498498 transform : translateX (110% );
499499 position : absolute ;
500- top : 0 ;
500+ top : var ( --dx-scheduler-animation-top , 0 ) ;
501501 }
502502 }
503503
Original file line number Diff line number Diff line change @@ -58,6 +58,18 @@ export const setupSchedulerTestEnvironment = ({
5858 y : 0 ,
5959 toJSON : ( ) : void => { } ,
6060 } ;
61+ case classList . includes ( 'dx-scheduler-form-main-group' ) :
62+ return {
63+ width : 0 ,
64+ height : 0 ,
65+ top : 50 ,
66+ left : 0 ,
67+ bottom : 50 ,
68+ right : 0 ,
69+ x : 0 ,
70+ y : 50 ,
71+ toJSON : ( ) : void => { } ,
72+ } ;
6173 default :
6274 return {
6375 width : 0 ,
Original file line number Diff line number Diff line change @@ -1572,6 +1572,18 @@ describe('Appointment Form', () => {
15721572 expect ( document . activeElement ) . toBe ( frequencyEditorInputElement ) ;
15731573 } ) ;
15741574 } ) ;
1575+
1576+ it ( 'should set animation offset CSS variable when switching to recurrence form' , async ( ) => {
1577+ const { scheduler, POM } = await createScheduler ( getDefaultConfig ( ) ) ;
1578+
1579+ scheduler . showAppointmentPopup ( ) ;
1580+
1581+ POM . popup . selectRepeatValue ( 'weekly' ) ;
1582+
1583+ const formElement = POM . popup . dxForm . $element ( ) [ 0 ] ;
1584+ const animationTop = formElement . style . getPropertyValue ( '--dx-scheduler-animation-top' ) ;
1585+ expect ( animationTop ) . toBe ( '50px' ) ;
1586+ } ) ;
15751587 } ) ;
15761588
15771589 describe ( 'firstDayOfWeek' , ( ) => {
Original file line number Diff line number Diff line change @@ -921,6 +921,7 @@ export class AppointmentForm {
921921
922922 showRecurrenceGroup ( ) : void {
923923 this . _popup . updateToolbarForRecurrenceGroup ( ) ;
924+ this . updateAnimationOffset ( ) ;
924925
925926 const currentHeight = this . dxPopup . option ( 'height' ) as string | number | undefined ;
926927
@@ -1059,6 +1060,22 @@ export class AppointmentForm {
10591060 this . dxForm . endUpdate ( ) ;
10601061 }
10611062
1063+ private updateAnimationOffset ( ) : void {
1064+ if ( ! this . _$mainGroup ) {
1065+ return ;
1066+ }
1067+
1068+ const formElement = this . dxForm . $element ( ) [ 0 ] ;
1069+ const mainGroupElement = this . _$mainGroup [ 0 ] ;
1070+
1071+ if ( formElement && mainGroupElement ) {
1072+ const formRect = formElement . getBoundingClientRect ( ) ;
1073+ const groupRect = mainGroupElement . getBoundingClientRect ( ) ;
1074+ const topOffset = groupRect . top - formRect . top ;
1075+ formElement . style . setProperty ( '--dx-scheduler-animation-top' , `${ topOffset } px` ) ;
1076+ }
1077+ }
1078+
10621079 private focusFirstFocusableInGroup ( $group : dxElementWrapper ) : void {
10631080 const focusTarget = $group . find ( `.${ CLASSES . fieldItemContent } [tabindex]` ) . first ( ) . get ( 0 ) as HTMLElement ;
10641081 focusTarget ?. focus ( { preventScroll : true } ) ;
You can’t perform that action at this time.
0 commit comments