Skip to content

Commit 4764c9e

Browse files
committed
animation styles
1 parent 5558e7d commit 4764c9e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
Tooltip,
4848
EditorContext,
4949
CompNameContext,
50+
AnimationStyle
5051
} from 'lowcoder-sdk';
5152

5253
import {
@@ -92,6 +93,7 @@ let childrenMap: any = {
9293
licenseKey: withDefault( StringControl, "" ),
9394
currentFreeView: dropdownControl(DefaultWithFreeViewOptions, "timeGridWeek"),
9495
currentPremiumView: dropdownControl(DefaultWithPremiumViewOptions, "resourceTimelineDay"),
96+
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
9597
};
9698
// this should ensure backwards compatibility with older versions of the SDK
9799
if (DragEventHandlerControl) {
@@ -121,9 +123,10 @@ let CalendarBasicComp = (function () {
121123
licensed?: boolean;
122124
currentFreeView?: string;
123125
currentPremiumView?: string;
126+
animationStyle:any;
124127
}, dispatch: any) => {
125128

126-
const comp = useContext(EditorContext).getUICompByName(
129+
const comp = useContext(EditorContext)?.getUICompByName(
127130
useContext(CompNameContext)
128131
);
129132
const onEventVal = comp?.toJsonValue()?.comp?.onEvent;
@@ -350,6 +353,12 @@ let CalendarBasicComp = (function () {
350353
const eventId = editEvent.current?.id;
351354
CustomModal.confirm({
352355
title: modalTitle,
356+
style: {
357+
animation: props.animationStyle?.animation || "none",
358+
animationDelay: props.animationStyle?.animationDelay || "0s",
359+
animationDuration: props.animationStyle?.animationDuration || "0s",
360+
animationIterationCount: props.animationStyle?.animationIterationCount || "1",
361+
},
353362
content: (
354363
<FormWrapper form={form}>
355364
<Form.Item
@@ -577,6 +586,7 @@ let CalendarBasicComp = (function () {
577586
currentFreeView: { propertyView: (arg0: { label: string; tooltip: string; }) => any; };
578587
currentPremiumView: { propertyView: (arg0: { label: string; tooltip: string; }) => any; };
579588
style: { getPropertyView: () => any; };
589+
animationStyle: { getPropertyView: () => any; };
580590
licenseKey: { getView: () => any; propertyView: (arg0: { label: string; }) => any; };
581591
}) => {
582592

@@ -622,6 +632,7 @@ let CalendarBasicComp = (function () {
622632
<Section name={sectionNames.style}>
623633
{children.style.getPropertyView()}
624634
</Section>
635+
<Section name={sectionNames.animationStyle} hasTooltip={true}>{children.animationStyle.getPropertyView()}</Section>
625636
</>
626637
);
627638
})

0 commit comments

Comments
 (0)