@@ -159,13 +159,19 @@ let CalendarBasicComp = (function () {
159
159
end : dayjs ( item . end , DateParser ) . format ( ) ,
160
160
allDay : item . allDay ,
161
161
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
+ } ,
164
170
} ;
165
171
} ) : [ currentEvents . value ] ;
166
172
167
- const resources = props . resources . value ;
168
173
174
+ const resources = props . resources . value ;
169
175
// list all plugins for Fullcalendar
170
176
const plugins = [
171
177
dayGridPlugin ,
@@ -266,18 +272,23 @@ let CalendarBasicComp = (function () {
266
272
( eventInfo . view . type as ViewType ) !== ViewType . MONTH
267
273
? "past"
268
274
: "" ;
269
-
270
275
return (
271
276
< Event
272
277
className = { `event ${ sizeClass } ${ stateClass } ` }
273
- $bg = { eventInfo . backgroundColor }
278
+ $bg = { eventInfo . event . extendedProps . color }
274
279
theme = { theme ?. theme }
275
280
$isList = { isList }
276
281
$allDay = { Boolean ( showAllDay ) }
277
282
$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
+
278
288
>
279
289
< div className = "event-time" > { eventInfo . timeText } </ div >
280
290
< div className = "event-title" > { eventInfo . event . title } </ div >
291
+ < div className = "event-description" > { eventInfo . event . extendedProps . description } </ div >
281
292
< Remove
282
293
$isList = { isList }
283
294
className = "event-remove"
@@ -308,12 +319,16 @@ let CalendarBasicComp = (function () {
308
319
return ;
309
320
}
310
321
if ( event ) {
311
- const { title, groupId, color, id } = event ;
322
+ const { title, groupId, color, id , backgroundColor , description , titleColor , descriptionColor } = event ;
312
323
const eventInfo = {
313
324
title,
314
325
groupId,
315
326
color,
316
327
id,
328
+ backgroundColor,
329
+ titleColor,
330
+ description,
331
+ descriptionColor,
317
332
} ;
318
333
showModal ( eventInfo , true ) ;
319
334
} else {
@@ -387,9 +402,30 @@ let CalendarBasicComp = (function () {
387
402
>
388
403
< Input />
389
404
</ 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 >
390
423
< Form . Item label = { trans ( "calendar.eventColor" ) } name = "color" >
391
424
< Input />
392
425
</ Form . Item >
426
+ < Form . Item label = { trans ( "calendar.eventBackgroundColor" ) } name = "backgroundColor" >
427
+ < Input />
428
+ </ Form . Item >
393
429
< Form . Item
394
430
label = {
395
431
< Tooltip title = { trans ( "calendar.groupIdTooltip" ) } >
@@ -405,7 +441,7 @@ let CalendarBasicComp = (function () {
405
441
onConfirm : ( ) => {
406
442
form . submit ( ) ;
407
443
return form . validateFields ( ) . then ( ( ) => {
408
- const { id, groupId, color, title = "" } = form . getFieldsValue ( ) ;
444
+ const { id, groupId, color, title = "" , backgroundColor , description , titleColor , descriptionColor } = form . getFieldsValue ( ) ;
409
445
const idExist = props . events . value . findIndex (
410
446
( item : EventType ) => item . id === id
411
447
) ;
@@ -421,9 +457,13 @@ let CalendarBasicComp = (function () {
421
457
return {
422
458
...item ,
423
459
title,
460
+ description,
424
461
id,
425
462
...( groupId !== undefined ? { groupId } : null ) ,
426
463
...( color !== undefined ? { color } : null ) ,
464
+ ...( backgroundColor !== undefined ? { backgroundColor } : null ) ,
465
+ ...( titleColor !== undefined ? { titleColor } : null ) ,
466
+ ...( descriptionColor !== undefined ? { descriptionColor } : null ) ,
427
467
} ;
428
468
} else {
429
469
return item ;
@@ -437,8 +477,12 @@ let CalendarBasicComp = (function () {
437
477
end : event . end ,
438
478
id,
439
479
title,
480
+ description,
440
481
...( groupId !== undefined ? { groupId } : null ) ,
441
482
...( color !== undefined ? { color } : null ) ,
483
+ ...( backgroundColor !== undefined ? { backgroundColor } : null ) ,
484
+ ...( titleColor !== undefined ? { titleColor } : null ) ,
485
+ ...( descriptionColor !== undefined ? { descriptionColor } : null ) ,
442
486
} ;
443
487
props . events . onChange ( [ ...props . events . value , createInfo ] ) ;
444
488
}
@@ -779,4 +823,4 @@ let CalendarComp = withMethodExposing(TmpCalendarComp, [
779
823
] ) ;
780
824
781
825
782
- export { CalendarComp } ;
826
+ export { CalendarComp } ;
0 commit comments