You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add rich HTML tooltip system with fixed positioning and enable HTML by default
- Reimagined tooltip system using DOM elements instead of CSS pseudo-elements
- HTML support with comprehensive sanitization (tags, URLs, CSS)
- Fixed positioning attached to document.body prevents calendar clipping
- Intelligent edge detection repositions tooltips based on viewport
- Customizable styling: background color, text color, max width, delay
- Changed defaults: allowHtmlInEvents and tooltipAllowHtml now true
- Updated documentation in README and docs.html
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
-**Auto-contrast text color** - New `autoContrastText` option automatically calculates optimal text color based on event background color using WCAG luminance formula
@@ -217,13 +217,18 @@ export class CalendarComponent {
217
217
|`showYearPicker`| boolean |`true`| Enable year picker dropdown (month view) |
218
218
|`showViewSwitcher`| boolean |`true`| Show view switcher buttons |
219
219
|`showTooltips`| boolean |`true`| Show tooltips on hover for events |
220
+
|`tooltipAllowHtml`| boolean |`true`| Allow HTML in tooltips (sanitized for security). Supports: `<b>`, `<i>`, `<strong>`, `<em>`, `<span>`, `<br>`, `<a>` with safe attributes and URL validation |
221
+
|`tooltipBgColor`| string \| null |`null`| Custom tooltip background color (hex). If `null`, uses CSS variable `--cal-tooltip-bg`|
222
+
|`tooltipTextColor`| string \| null |`null`| Custom tooltip text color (hex). If `null`, uses CSS variable `--cal-tooltip-text`|
223
+
|`tooltipMaxWidth`| number |`250`| Maximum tooltip width in pixels |
224
+
|`tooltipDelay`| number |`400`| Delay in milliseconds before tooltip appears on hover |
220
225
|`listDaysForward`| number |`30`| Number of days forward to show in list view |
221
226
|`enabledViews`| string[]|`['month', 'week', 'day']`| Available view modes. Add `'list'` to enable list view |
222
227
|`enableDragDrop`| boolean |`false`| Enable drag and drop to move events |
223
228
|`enableResize`| boolean |`false`| Enable resizing events to change duration |
224
229
|`autoContrastText`| boolean |`false`| Automatically calculate contrasting text color based on event background color for better readability |
225
230
|`contrastLevel`| string |`'high'`| Text contrast level when `autoContrastText` is enabled: `'high'` (black/white), `'medium'` (darker/lighter shade), `'low'` (subtle variation) |
226
-
|`allowHtmlInEvents`| boolean |`false`| Allow basic HTML tags in event titles (sanitized for security). Supports: `<b>`, `<i>`, `<strong>`, `<em>`, `<span>`, `<br>` with `class` attribute for icons |
231
+
|`allowHtmlInEvents`| boolean |`true`| Allow basic HTML tags in event titles (sanitized for security). Supports: `<b>`, `<i>`, `<strong>`, `<em>`, `<span>`, `<br>` with `class` attribute for icons |
227
232
|`monthTimedEventStyle`| string |`'list'`| Display style for timed events in month view: `'list'` (schedule format) or `'block'` (traditional blocks) |
228
233
|`monthDayNumberAlign`| string |`'left'`| Horizontal alignment of day numbers in month view cells: `'left'`, `'center'`, or `'right'`|
229
234
|`showEventBorder`| boolean |`false`| Display borders around events. Border color adaptively darkens from event background (light colors darken more for visibility), or use event's `borderColor` property |
@@ -249,7 +254,8 @@ interface CalendarEvent {
249
254
textColor?:string; // Custom text color (hex, optional) - overrides autoContrastText
250
255
allowHtml?:boolean; // Override global allowHtmlInEvents setting for this event (optional)
251
256
description?:string; // Event description (also used for tooltip if tooltip not provided)
252
-
tooltip?:string; // Custom tooltip text shown on hover (overrides description)
257
+
tooltip?:string; // Custom tooltip text shown on hover (can contain HTML if tooltipAllowHtml is enabled)
258
+
tooltipAllowHtml?:boolean; // Override global tooltipAllowHtml setting for this event's tooltip (optional)
253
259
[key:string]:any; // Any additional custom properties
0 commit comments