@@ -15,6 +15,7 @@ import {
15
15
lightenColor ,
16
16
toHex ,
17
17
UnderlineCss ,
18
+ EventModalStyleType
18
19
} from "lowcoder-sdk" ;
19
20
import styled from "styled-components" ;
20
21
import dayjs from "dayjs" ;
@@ -362,6 +363,7 @@ export const Wrapper = styled.div<{
362
363
// event
363
364
.fc-timegrid-event .fc-event-main {
364
365
padding: 4px 0 4px 1px;
366
+
365
367
}
366
368
.fc-event {
367
369
position: relative;
@@ -652,11 +654,12 @@ export const Remove = styled.div<{ $isList: boolean }>`
652
654
` ;
653
655
654
656
export const Event = styled . div < {
655
- $bg : string ;
656
657
theme : Object ;
657
658
$isList : boolean ;
658
659
$allDay : boolean ;
659
660
$style : CalendarStyleType ;
661
+ $backgroundColor :string ;
662
+ $extendedProps : any ;
660
663
} > `
661
664
height: 100%;
662
665
width: 100%;
@@ -665,14 +668,17 @@ export const Event = styled.div<{
665
668
box-shadow: ${ ( props ) => ! props . $isList && "0 0 5px 0 rgba(0, 0, 0, 0.15)" } ;
666
669
border: 1px solid ${ ( props ) => props . $style . border } ;
667
670
display: ${ ( props ) => props . $isList && "flex" } ;
668
- background-color: ${ ( props ) =>
669
- ! props . $isList && lightenColor ( props . $style . background , 0.1 ) } ;
671
+ background-color:${ ( props ) => props ?. $backgroundColor || "#ffffff" } ;
670
672
overflow: hidden;
671
673
font-size: 13px;
672
674
line-height: 19px;
673
675
padding-right: 20px;
674
676
overflow: hidden;
675
677
position: relative;
678
+ animation: ${ ( props ) => props ?. $extendedProps ?. animation || "" } ;
679
+ animation-delay: ${ ( props ) => props ?. $extendedProps ?. animationDelay || "" } ;
680
+ animation-duration: ${ ( props ) => props ?. $extendedProps ?. animationDuration || "" } ;
681
+ animation-iteration-count: ${ ( props ) => props ?. $extendedProps ?. animationIterationCount || "" } ;
676
682
&::before {
677
683
content: "";
678
684
position: absolute;
@@ -682,7 +688,7 @@ export const Event = styled.div<{
682
688
left: 2px;
683
689
top: 2px;
684
690
border-radius: 3px;
685
- background-color: ${ ( props ) => props . $bg } ;
691
+ background-color: ${ ( props ) => props . $extendedProps ?. color } ;
686
692
}
687
693
688
694
.event-time {
@@ -696,19 +702,31 @@ export const Event = styled.div<{
696
702
margin-top: 2px;
697
703
}
698
704
.event-title {
699
- color: ${ ( props ) => ! props . $isList && props . $style . text } ;
700
- font-weight: 500;
705
+ color: ${ ( props ) => props ?. $extendedProps ?. titleColor || "#000000" } ;
706
+ font-weight: ${ ( props ) => props ?. $extendedProps ?. titleFontWeight || "normal" } ;
707
+ font-style: ${ ( props ) => props ?. $extendedProps ?. titleFontStyle || "" } ;
708
+ margin-left: 15px;
709
+ white-space: pre-wrap;
710
+ word-break: break-word;
711
+ }
712
+ .event-detail {
713
+ color: ${ ( props ) => props ?. $extendedProps ?. detailColor || "#000000" } ;
714
+ font-weight: ${ ( props ) => props ?. $extendedProps ?. detailFontWeight || "normal" } ;
715
+ font-style: ${ ( props ) => props ?. $extendedProps ?. detailFontStyle || "italic" } ;
701
716
margin-left: 15px;
702
717
white-space: pre-wrap;
703
718
word-break: break-word;
719
+ margin-top: 2px;
704
720
}
705
721
706
722
&.small {
707
723
height: 20px;
708
724
.event-time {
709
725
display: none;
710
726
}
711
- .event-title {
727
+ .event-title,
728
+ .event-detail
729
+ {
712
730
text-overflow: ellipsis;
713
731
overflow: hidden;
714
732
white-space: nowrap;
@@ -717,7 +735,9 @@ export const Event = styled.div<{
717
735
&.middle {
718
736
padding-top: 2px;
719
737
.event-time,
720
- .event-title {
738
+ .event-title,
739
+ .event-detail
740
+ {
721
741
text-overflow: ellipsis;
722
742
overflow: hidden;
723
743
white-space: nowrap;
@@ -730,38 +750,63 @@ export const Event = styled.div<{
730
750
}
731
751
&.past {
732
752
background-color: ${ ( props ) =>
733
- isDarkColor ( props . $style . background ) && props . $style . background } ;
753
+ `rgba( ${ props ?. $extendedProps ?. color } , 0.3)` } ;
734
754
&::before {
735
- background-color: ${ ( props ) =>
736
- toHex ( props . $style . text ) === "#3C3C3C"
737
- ? "#8B8FA3"
738
- : isDarkColor ( props . $style . text )
739
- ? lightenColor ( props . $style . text , 0.3 )
740
- : props . $style . text } ;
755
+ background-color: ${ ( props ) => props ?. $extendedProps ?. color } ;
756
+ opacity: 0.3;
741
757
}
742
758
&::before,
743
759
.event-title,
744
- .event-time {
760
+ .event-time,
761
+ .event-detail
762
+ {
745
763
opacity: 0.35;
746
764
}
747
765
}
748
766
` ;
749
767
750
- export const FormWrapper = styled ( Form ) `
768
+
769
+
770
+ export const FormWrapper = styled ( Form ) < {
771
+ $modalStyle : EventModalStyleType
772
+ } > `
751
773
.ant-form-item-label {
752
- width: 100px ;
774
+ width: 125px ;
753
775
text-align: left;
754
776
line-height: 18px;
777
+
755
778
label:not(.ant-form-item-required) {
756
- margin-left: 11px;
779
+ margin-left: 2px;
780
+ }
781
+ label.ant-form-item-required{
782
+ margin-left: 2px;
757
783
}
758
784
label span {
759
785
${ UnderlineCss }
786
+
760
787
}
761
788
}
789
+
790
+ // Setting style for input fields
791
+ .ant-input {
792
+ background-color: ${ ( props ) => props . $modalStyle . labelBackground } ;
793
+ border-color: ${ ( props ) => props . $modalStyle . border } ;
794
+ border-width: ${ ( props ) => props . $modalStyle . borderWidth } ;
795
+ border-style: ${ ( props ) => props . $modalStyle . borderStyle } ;
796
+ color: ${ ( props ) => props . $modalStyle . text } ;
797
+ }
798
+
762
799
` ;
763
800
764
801
export type EventType = {
802
+ animationIterationCount : any ;
803
+ animationDuration : any ;
804
+ animationDelay : any ;
805
+ animation : any ;
806
+ titleFontWeight : any ;
807
+ titleFontStyle : any ;
808
+ detailFontWeight : any ;
809
+ detailFontStyle : any ;
765
810
id ?: string ;
766
811
resourceId ?: string ;
767
812
label ?: string ;
@@ -770,8 +815,12 @@ export type EventType = {
770
815
end ?: string ;
771
816
allDay ?: boolean ;
772
817
color ?: string ;
818
+ backgroundColor ?:string ;
773
819
groupId ?: string ;
774
820
value ?: string ;
821
+ detail ?:string ;
822
+ titleColor ?:string ;
823
+ detailColor ?:string ;
775
824
} ;
776
825
777
826
export enum ViewType {
@@ -892,12 +941,25 @@ export const defaultData = [
892
941
start : dayjs ( ) . hour ( 10 ) . minute ( 0 ) . second ( 0 ) . format ( DATE_TIME_FORMAT ) ,
893
942
end : dayjs ( ) . hour ( 12 ) . minute ( 30 ) . second ( 0 ) . format ( DATE_TIME_FORMAT ) ,
894
943
color : "#079968" ,
944
+ backgroundColor :"#ffffff" ,
945
+ detail : 'Discuss project milestones and deliverables.' ,
946
+ titleColor :"#000000" ,
947
+ detailColor :"#000000" ,
948
+ titleFontWeight :"normal" ,
949
+ titleFontStyle :"italic" ,
950
+ detailFontWeight :"normal" ,
951
+ detailFontStyle :"italic" ,
952
+ animation :"none" ,
953
+ animationDelay :"0s" ,
954
+ animationDuration :"0s" ,
955
+ animationIterationCount :"0" ,
895
956
} ,
896
957
{
897
958
id : "2" ,
898
959
title : "Rest" ,
899
960
start : dayjs ( ) . hour ( 24 ) . format ( DATE_FORMAT ) ,
900
961
end : dayjs ( ) . hour ( 48 ) . format ( DATE_FORMAT ) ,
962
+ color : "#079968" ,
901
963
allDay : true ,
902
964
} ,
903
965
] ;
@@ -1045,4 +1107,5 @@ export const viewClassNames = (info: ViewContentArg) => {
1045
1107
}
1046
1108
}
1047
1109
return className ;
1048
- } ;
1110
+ } ;
1111
+
0 commit comments