@@ -32,6 +32,7 @@ import {
32
32
hiddenPropertyView ,
33
33
ChangeEventHandlerControl ,
34
34
DragEventHandlerControl ,
35
+ CalendarEventHandlerControl ,
35
36
Section ,
36
37
sectionNames ,
37
38
dropdownControl ,
@@ -45,7 +46,9 @@ import {
45
46
CalendarDeleteIcon ,
46
47
Tooltip ,
47
48
useMergeCompStyles ,
48
- } from "lowcoder-sdk" ;
49
+ EditorContext ,
50
+ CompNameContext ,
51
+ } from 'lowcoder-sdk' ;
49
52
50
53
import {
51
54
DefaultWithFreeViewOptions ,
@@ -76,7 +79,7 @@ let childrenMap: any = {
76
79
resourcesEvents : jsonValueExposingStateControl ( "resourcesEvents" , resourcesEventsDefaultData ) ,
77
80
resources : jsonValueExposingStateControl ( "resources" , resourcesDefaultData ) ,
78
81
resourceName : withDefault ( StringControl , trans ( "calendar.resourcesDefault" ) ) ,
79
- onEvent : ChangeEventHandlerControl ,
82
+ onEvent : CalendarEventHandlerControl ,
80
83
// onDropEvent: safeDragEventHandlerControl,
81
84
editable : withDefault ( BoolControl , true ) ,
82
85
showEventTime : withDefault ( BoolControl , true ) ,
@@ -120,6 +123,12 @@ let CalendarBasicComp = (function () {
120
123
currentFreeView ?: string ;
121
124
currentPremiumView ?: string ;
122
125
} , dispatch : any ) => {
126
+
127
+ const comp = useContext ( EditorContext ) . getUICompByName (
128
+ useContext ( CompNameContext )
129
+ ) ;
130
+ const onEventVal = comp ?. toJsonValue ( ) . comp . onEvent ;
131
+
123
132
124
133
const theme = useContext ( ThemeContext ) ;
125
134
const ref = createRef < HTMLDivElement > ( ) ;
@@ -303,7 +312,12 @@ let CalendarBasicComp = (function () {
303
312
} ;
304
313
showModal ( eventInfo , true ) ;
305
314
} 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
+ }
307
321
}
308
322
} ;
309
323
@@ -433,7 +447,6 @@ let CalendarBasicComp = (function () {
433
447
props . onDropEvent ( "dropEvent" ) ;
434
448
}
435
449
} ;
436
-
437
450
return (
438
451
< Wrapper
439
452
ref = { ref }
0 commit comments