@@ -32,6 +32,7 @@ import {
3232 hiddenPropertyView ,
3333 ChangeEventHandlerControl ,
3434 DragEventHandlerControl ,
35+ CalendarEventHandlerControl ,
3536 Section ,
3637 sectionNames ,
3738 dropdownControl ,
@@ -45,7 +46,9 @@ import {
4546 CalendarDeleteIcon ,
4647 Tooltip ,
4748 useMergeCompStyles ,
48- } from "lowcoder-sdk" ;
49+ EditorContext ,
50+ CompNameContext ,
51+ } from 'lowcoder-sdk' ;
4952
5053import {
5154 DefaultWithFreeViewOptions ,
@@ -76,7 +79,7 @@ let childrenMap: any = {
7679 resourcesEvents : jsonValueExposingStateControl ( "resourcesEvents" , resourcesEventsDefaultData ) ,
7780 resources : jsonValueExposingStateControl ( "resources" , resourcesDefaultData ) ,
7881 resourceName : withDefault ( StringControl , trans ( "calendar.resourcesDefault" ) ) ,
79- onEvent : ChangeEventHandlerControl ,
82+ onEvent : CalendarEventHandlerControl ,
8083 // onDropEvent: safeDragEventHandlerControl,
8184 editable : withDefault ( BoolControl , true ) ,
8285 showEventTime : withDefault ( BoolControl , true ) ,
@@ -120,6 +123,12 @@ let CalendarBasicComp = (function () {
120123 currentFreeView ?: string ;
121124 currentPremiumView ?: string ;
122125 } , dispatch : any ) => {
126+
127+ const comp = useContext ( EditorContext ) . getUICompByName (
128+ useContext ( CompNameContext )
129+ ) ;
130+ const onEventVal = comp ?. toJsonValue ( ) . comp . onEvent ;
131+
123132
124133 const theme = useContext ( ThemeContext ) ;
125134 const ref = createRef < HTMLDivElement > ( ) ;
@@ -303,7 +312,12 @@ let CalendarBasicComp = (function () {
303312 } ;
304313 showModal ( eventInfo , true ) ;
305314 } else {
306- showModal ( editEvent . current , false ) ;
315+ if ( onEventVal && onEventVal . some ( ( e : any ) => e . name === 'doubleClick' ) ) {
316+ // Check if 'doubleClick' is included in the array
317+ props . onEvent ( 'doubleClick' ) ;
318+ } else {
319+ showModal ( editEvent . current as EventType , false ) ;
320+ }
307321 }
308322 } ;
309323
@@ -433,7 +447,6 @@ let CalendarBasicComp = (function () {
433447 props . onDropEvent ( "dropEvent" ) ;
434448 }
435449 } ;
436-
437450 return (
438451 < Wrapper
439452 ref = { ref }
0 commit comments