@@ -159,13 +159,19 @@ let CalendarBasicComp = (function () {
159159 end : dayjs ( item . end , DateParser ) . format ( ) ,
160160 allDay : item . allDay ,
161161 resourceId : item . resourceId ? item . resourceId : null ,
162- color : isValidColor ( item . color || "" ) ? item . color : theme ?. theme ?. primary ,
163- ...( item . groupId ? { groupId : item . groupId } : { } ) ,
162+ backgroundColor : item . backgroundColor ,
163+ extendedProps : {
164+ color : isValidColor ( item . color || "" ) ? item . color : theme ?. theme ?. primary ,
165+ ...( item . groupId ? { groupId : item . groupId } : { } ) , // Ensure color is in extendedProps
166+ description : item . description ,
167+ titleColor :item . titleColor ,
168+ descriptionColor :item . descriptionColor
169+ } ,
164170 } ;
165171 } ) : [ currentEvents . value ] ;
166172
167- const resources = props . resources . value ;
168173
174+ const resources = props . resources . value ;
169175 // list all plugins for Fullcalendar
170176 const plugins = [
171177 dayGridPlugin ,
@@ -266,18 +272,23 @@ let CalendarBasicComp = (function () {
266272 ( eventInfo . view . type as ViewType ) !== ViewType . MONTH
267273 ? "past"
268274 : "" ;
269-
270275 return (
271276 < Event
272277 className = { `event ${ sizeClass } ${ stateClass } ` }
273- $bg = { eventInfo . backgroundColor }
278+ $bg = { eventInfo . event . extendedProps . color }
274279 theme = { theme ?. theme }
275280 $isList = { isList }
276281 $allDay = { Boolean ( showAllDay ) }
277282 $style = { props . style }
283+ $backgroundColor = { eventInfo . backgroundColor }
284+ $description = { eventInfo . event . extendedProps . description }
285+ $titleColor = { eventInfo . event . extendedProps . titleColor }
286+ $descriptionColor = { eventInfo . event . extendedProps . descriptionColor }
287+
278288 >
279289 < div className = "event-time" > { eventInfo . timeText } </ div >
280290 < div className = "event-title" > { eventInfo . event . title } </ div >
291+ < div className = "event-description" > { eventInfo . event . extendedProps . description } </ div >
281292 < Remove
282293 $isList = { isList }
283294 className = "event-remove"
@@ -308,12 +319,16 @@ let CalendarBasicComp = (function () {
308319 return ;
309320 }
310321 if ( event ) {
311- const { title, groupId, color, id } = event ;
322+ const { title, groupId, color, id , backgroundColor , description , titleColor , descriptionColor } = event ;
312323 const eventInfo = {
313324 title,
314325 groupId,
315326 color,
316327 id,
328+ backgroundColor,
329+ titleColor,
330+ description,
331+ descriptionColor,
317332 } ;
318333 showModal ( eventInfo , true ) ;
319334 } else {
@@ -387,9 +402,30 @@ let CalendarBasicComp = (function () {
387402 >
388403 < Input />
389404 </ Form . Item >
405+ < Form . Item
406+ label = { trans ( "calendar.eventDescription" ) }
407+ name = "description"
408+ >
409+ < Input />
410+ </ Form . Item >
411+ < Form . Item
412+ label = { trans ( "calendar.eventTitleColor" ) }
413+ name = "titleColor"
414+ >
415+ < Input />
416+ </ Form . Item >
417+ < Form . Item
418+ label = { trans ( "calendar.eventDescriptionColor" ) }
419+ name = "descriptionColor"
420+ >
421+ < Input />
422+ </ Form . Item >
390423 < Form . Item label = { trans ( "calendar.eventColor" ) } name = "color" >
391424 < Input />
392425 </ Form . Item >
426+ < Form . Item label = { trans ( "calendar.eventBackgroundColor" ) } name = "backgroundColor" >
427+ < Input />
428+ </ Form . Item >
393429 < Form . Item
394430 label = {
395431 < Tooltip title = { trans ( "calendar.groupIdTooltip" ) } >
@@ -405,7 +441,7 @@ let CalendarBasicComp = (function () {
405441 onConfirm : ( ) => {
406442 form . submit ( ) ;
407443 return form . validateFields ( ) . then ( ( ) => {
408- const { id, groupId, color, title = "" } = form . getFieldsValue ( ) ;
444+ const { id, groupId, color, title = "" , backgroundColor , description , titleColor , descriptionColor } = form . getFieldsValue ( ) ;
409445 const idExist = props . events . value . findIndex (
410446 ( item : EventType ) => item . id === id
411447 ) ;
@@ -421,9 +457,13 @@ let CalendarBasicComp = (function () {
421457 return {
422458 ...item ,
423459 title,
460+ description,
424461 id,
425462 ...( groupId !== undefined ? { groupId } : null ) ,
426463 ...( color !== undefined ? { color } : null ) ,
464+ ...( backgroundColor !== undefined ? { backgroundColor } : null ) ,
465+ ...( titleColor !== undefined ? { titleColor } : null ) ,
466+ ...( descriptionColor !== undefined ? { descriptionColor } : null ) ,
427467 } ;
428468 } else {
429469 return item ;
@@ -437,8 +477,12 @@ let CalendarBasicComp = (function () {
437477 end : event . end ,
438478 id,
439479 title,
480+ description,
440481 ...( groupId !== undefined ? { groupId } : null ) ,
441482 ...( color !== undefined ? { color } : null ) ,
483+ ...( backgroundColor !== undefined ? { backgroundColor } : null ) ,
484+ ...( titleColor !== undefined ? { titleColor } : null ) ,
485+ ...( descriptionColor !== undefined ? { descriptionColor } : null ) ,
442486 } ;
443487 props . events . onChange ( [ ...props . events . value , createInfo ] ) ;
444488 }
@@ -779,4 +823,4 @@ let CalendarComp = withMethodExposing(TmpCalendarComp, [
779823 ] ) ;
780824
781825
782- export { CalendarComp } ;
826+ export { CalendarComp } ;
0 commit comments