Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf253a14

Browse files
author
FalkWolsky
committed
handle onDrop Event Handler unavailability in old SDK
1 parentfaa038c commitf253a14

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

‎client/packages/lowcoder-comps/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"lowcoder-comps",
3-
"version":"0.0.36",
3+
"version":"0.0.37",
44
"type":"module",
55
"license":"MIT",
66
"dependencies": {

‎client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,17 @@ import {
6868
resourceTimeLineHeaderToolbar,
6969
resourceTimeGridHeaderToolbar,
7070
}from"./calendarConstants";
71+
72+
// this should ensure backwards compatibility with older versions of the SDK
73+
constsafeDragEventHandlerControl=typeofDragEventHandlerControl!=='undefined' ?DragEventHandlerControl :()=>{};
7174

7275
constchildrenMap={
7376
events:jsonValueExposingStateControl("events",defaultData),
7477
resourcesEvents:jsonValueExposingStateControl("resourcesEvents",resourcesEventsDefaultData),
7578
resources:jsonValueExposingStateControl("resources",resourcesDefaultData),
7679
resourceName:withDefault(StringControl,trans("calendar.resourcesDefault")),
7780
onEvent:ChangeEventHandlerControl,
78-
onDropEvent:DragEventHandlerControl,
81+
onDropEvent:safeDragEventHandlerControl,
7982
editable:withDefault(BoolControl,true),
8083
showEventTime:withDefault(BoolControl,true),
8184
showWeekends:withDefault(BoolControl,true),
@@ -418,6 +421,12 @@ let CalendarBasicComp = (function () {
418421
});
419422
};
420423

424+
consthandleDrop=()=>{
425+
if(typeofprops.onDropEvent==='function'){
426+
props.onDropEvent("dropEvent");
427+
}
428+
};
429+
421430
return(
422431
<Wrapper
423432
ref={ref}
@@ -444,7 +453,6 @@ let CalendarBasicComp = (function () {
444453
plugins={filteredPlugins}
445454
headerToolbar={toolBar(currentView)}
446455
resourceAreaHeaderContent={resourceName}
447-
448456
buttonText={buttonText}
449457
schedulerLicenseKey={licenseKey}
450458
views={views}
@@ -526,7 +534,7 @@ let CalendarBasicComp = (function () {
526534
}}
527535
eventDragStop={(info)=>{
528536
if(info.view){
529-
props.onDropEvent("dropEvent");
537+
handleDrop
530538
}
531539
}}
532540
/>
@@ -535,7 +543,6 @@ let CalendarBasicComp = (function () {
535543
);
536544
})
537545
.setPropertyViewFn((children:{
538-
539546
events:{propertyView:(arg0:{})=>any;};
540547
resourcesEvents:{propertyView:(arg0:{})=>any;};
541548
resources:{propertyView:(arg0:{})=>any;};
@@ -577,7 +584,7 @@ let CalendarBasicComp = (function () {
577584
{children.onEvent.propertyView()}
578585
</div>
579586
<divstyle={{display:'flex',flexDirection:'column',gap:'8px'}}>
580-
{children.onDropEvent.propertyView({title:trans("calendar.dragDropEventHandlers")})}
587+
{children.onDropEvent?.propertyView({title:trans("calendar.dragDropEventHandlers")})}
581588
</div>
582589
{children.editable.propertyView({label:trans("calendar.editable"),})}
583590
</Section>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp