@@ -46,7 +46,9 @@ import {
46
46
CalendarDeleteIcon ,
47
47
Tooltip ,
48
48
useMergeCompStyles ,
49
- } from "lowcoder-sdk" ;
49
+ EditorContext ,
50
+ CompNameContext ,
51
+ } from 'lowcoder-sdk' ;
50
52
51
53
import {
52
54
DefaultWithFreeViewOptions ,
@@ -121,6 +123,12 @@ let CalendarBasicComp = (function () {
121
123
currentFreeView ?: string ;
122
124
currentPremiumView ?: string ;
123
125
} , dispatch : any ) => {
126
+
127
+ const comp = useContext ( EditorContext ) . getUICompByName (
128
+ useContext ( CompNameContext )
129
+ ) ;
130
+ const onEventVal = comp ?. toJsonValue ( ) . comp . onEvent ;
131
+
124
132
125
133
const theme = useContext ( ThemeContext ) ;
126
134
const ref = createRef < HTMLDivElement > ( ) ;
@@ -288,10 +296,6 @@ let CalendarBasicComp = (function () {
288
296
}
289
297
290
298
const handleDbClick = ( ) => {
291
- console . log ( "props.events" , props . events )
292
- console . log ( "props.onEvent" , props . onEvent )
293
- console . log ( "props" , props )
294
-
295
299
const event = props . events . value . find (
296
300
( item : EventType ) => item . id === editEvent . current ?. id
297
301
) as EventType ;
@@ -308,7 +312,17 @@ let CalendarBasicComp = (function () {
308
312
} ;
309
313
showModal ( eventInfo , true ) ;
310
314
} else {
311
- showModal ( editEvent . current , false ) ;
315
+ if ( onEventVal ) {
316
+ onEventVal . forEach ( ( event :any ) => {
317
+ if ( event . name === 'doubleClick' ) {
318
+ props . onEvent ( 'doubleClick' )
319
+ } else {
320
+ showModal ( editEvent . current as EventType , false ) ;
321
+ }
322
+ } ) ;
323
+ } else {
324
+ showModal ( editEvent . current , false ) ;
325
+ }
312
326
}
313
327
} ;
314
328
@@ -438,7 +452,6 @@ let CalendarBasicComp = (function () {
438
452
props . onDropEvent ( "dropEvent" ) ;
439
453
}
440
454
} ;
441
-
442
455
return (
443
456
< Wrapper
444
457
ref = { ref }
0 commit comments