@ilamy/calendar 0.3.3 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index.d.ts +63 -3
- package/dist/index.js +8 -4805
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -4,9 +4,12 @@ A powerful, full-featured React calendar component library built with TypeScript
|
|
|
4
4
|
|
|
5
5
|
<img width="1643" height="873" alt="Screenshot 2025-08-05 at 9 46 41 AM" src="https://github.com/user-attachments/assets/d289f034-0d26-4a1c-a997-dfa1ad26aa7a" />
|
|
6
6
|
|
|
7
|
+
<img width="1663" height="872" alt="Screenshot 2025-10-13 at 4 24 29 PM" src="https://github.com/user-attachments/assets/ba0aa27e-373c-40ba-98c6-2d6fd767cb66" />
|
|
8
|
+
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
11
|
- 🗓️ **Multiple Views**: Month, Week, Day, and Year views with smooth transitions
|
|
12
|
+
- 📊 **Resource Calendar**: Visualize and manage events across multiple resources with timeline layout
|
|
10
13
|
- 🎯 **Drag & Drop**: Move events between dates and time slots with collision detection
|
|
11
14
|
- 🔄 **RFC 5545 Recurring Events**: Full RRULE support with Google Calendar-style operations
|
|
12
15
|
- **RRULE Patterns**: Daily, Weekly, Monthly, Yearly with complex frequencies
|
package/dist/index.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ type RRuleOptions = {
|
|
|
12
12
|
/**
|
|
13
13
|
* The frequency of the event. Must be one of the following: DAILY, WEEKLY, MONTHLY, etc.
|
|
14
14
|
*/
|
|
15
|
-
freq: Options["freq"]
|
|
15
|
+
freq: Options["freq"];
|
|
16
16
|
/**
|
|
17
17
|
* The start date of the recurrence rule. This defines when the recurrence pattern begins.
|
|
18
18
|
* Required for proper RRULE functionality according to RFC 5545.
|
|
19
19
|
* @important Same as the event start date.
|
|
20
20
|
*/
|
|
21
|
-
dtstart: Date
|
|
21
|
+
dtstart: Date;
|
|
22
22
|
} & Partial<Omit<Options, "freq" | "dtstart">>;
|
|
23
23
|
/**
|
|
24
24
|
* Core calendar event interface representing a single calendar event.
|
|
@@ -157,6 +157,12 @@ interface Translations {
|
|
|
157
157
|
day: string;
|
|
158
158
|
year: string;
|
|
159
159
|
more: string;
|
|
160
|
+
resources: string;
|
|
161
|
+
resource: string;
|
|
162
|
+
time: string;
|
|
163
|
+
date: string;
|
|
164
|
+
noResourcesVisible: string;
|
|
165
|
+
addResourcesOrShowExisting: string;
|
|
160
166
|
sunday: string;
|
|
161
167
|
monday: string;
|
|
162
168
|
tuesday: string;
|
|
@@ -288,6 +294,11 @@ interface IlamyCalendarProps {
|
|
|
288
294
|
* Useful for read-only views or when drag-and-drop is not needed.
|
|
289
295
|
*/
|
|
290
296
|
disableDragAndDrop?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* Maximum number of events to display per day in month view.
|
|
299
|
+
* Additional events will be hidden and can be viewed via a "more" link.
|
|
300
|
+
* Defaults to 3 if not specified.
|
|
301
|
+
*/
|
|
291
302
|
dayMaxEvents?: number;
|
|
292
303
|
/**
|
|
293
304
|
* Whether to stick the view header to the top of the calendar.
|
|
@@ -311,6 +322,46 @@ interface IlamyCalendarProps {
|
|
|
311
322
|
headerClassName?: string;
|
|
312
323
|
}
|
|
313
324
|
declare const IlamyCalendar: React3.FC<IlamyCalendarProps>;
|
|
325
|
+
import React4 from "react";
|
|
326
|
+
interface IlamyResourceCalendarProps extends IlamyCalendarProps {
|
|
327
|
+
/** Array of events to display */
|
|
328
|
+
events?: ResourceCalendarEvent[];
|
|
329
|
+
/** Array of resources */
|
|
330
|
+
resources?: Resource[];
|
|
331
|
+
/** Custom render function for resources */
|
|
332
|
+
renderResource?: (resource: Resource) => React.ReactNode;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Resource interface representing a calendar resource (person, room, equipment, etc.)
|
|
336
|
+
*/
|
|
337
|
+
interface Resource {
|
|
338
|
+
/** Unique identifier for the resource */
|
|
339
|
+
id: string | number;
|
|
340
|
+
/** Display title of the resource */
|
|
341
|
+
title: string;
|
|
342
|
+
/**
|
|
343
|
+
* Color for the resource (supports CSS color values, hex, rgb, hsl, or CSS class names)
|
|
344
|
+
* @example "#3b82f6", "blue-500", "rgb(59, 130, 246)"
|
|
345
|
+
*/
|
|
346
|
+
color?: string;
|
|
347
|
+
/**
|
|
348
|
+
* Background color for the resource (supports CSS color values, hex, rgb, hsl, or CSS class names)
|
|
349
|
+
* @example "#dbeafe", "blue-100", "rgba(59, 130, 246, 0.1)"
|
|
350
|
+
*/
|
|
351
|
+
backgroundColor?: string;
|
|
352
|
+
/** Optional position for resource display */
|
|
353
|
+
position?: number;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Resource calendar event interface extending CalendarEvent with resource assignment
|
|
357
|
+
*/
|
|
358
|
+
interface ResourceCalendarEvent extends CalendarEvent {
|
|
359
|
+
/** Single resource assignment */
|
|
360
|
+
resourceId?: string | number;
|
|
361
|
+
/** Multiple resource assignment (cross-resource events) */
|
|
362
|
+
resourceIds?: (string | number)[];
|
|
363
|
+
}
|
|
364
|
+
declare const IlamyResourceCalendar: React4.FC<IlamyResourceCalendarProps>;
|
|
314
365
|
/**
|
|
315
366
|
* Simplified calendar context type for external use
|
|
316
367
|
* Contains only the most commonly used calendar operations
|
|
@@ -336,6 +387,15 @@ interface UseIlamyCalendarContextReturn {
|
|
|
336
387
|
readonly closeEventForm: () => void;
|
|
337
388
|
}
|
|
338
389
|
declare const useIlamyCalendarContext: () => UseIlamyCalendarContextReturn;
|
|
390
|
+
/**
|
|
391
|
+
* Simplified resource calendar context type for external use
|
|
392
|
+
*/
|
|
393
|
+
interface UseIlamyResourceCalendarContextReturn extends UseIlamyCalendarContextReturn {
|
|
394
|
+
readonly events: ResourceCalendarEvent[];
|
|
395
|
+
readonly resources: Resource[];
|
|
396
|
+
readonly getEventsForResource: (resourceId: string | number) => ResourceCalendarEvent[];
|
|
397
|
+
}
|
|
398
|
+
declare const useIlamyResourceCalendarContext: () => UseIlamyResourceCalendarContextReturn;
|
|
339
399
|
declare const isRecurringEvent: (event: CalendarEvent) => boolean;
|
|
340
400
|
interface GenerateRecurringEventsProps {
|
|
341
401
|
event: CalendarEvent;
|
|
@@ -347,4 +407,4 @@ declare const generateRecurringEvents: ({ event, currentEvents, startDate, endDa
|
|
|
347
407
|
import { Frequency, Weekday } from "rrule";
|
|
348
408
|
import { RRule } from "rrule";
|
|
349
409
|
declare const defaultTranslations: Translations;
|
|
350
|
-
export { useIlamyCalendarContext, isRecurringEvent, generateRecurringEvents, defaultTranslations, Weekday, WeekDays, UseIlamyCalendarContextReturn, TranslatorFunction, Translations, TranslationKey, RRuleOptions, RRule, IlamyCalendarProps, IlamyCalendar, Frequency, CalendarEvent };
|
|
410
|
+
export { useIlamyResourceCalendarContext, useIlamyCalendarContext, isRecurringEvent, generateRecurringEvents, defaultTranslations, Weekday, WeekDays, UseIlamyResourceCalendarContextReturn, UseIlamyCalendarContextReturn, TranslatorFunction, Translations, TranslationKey, ResourceCalendarEvent, Resource, RRuleOptions, RRule, IlamyResourceCalendarProps, IlamyResourceCalendar, IlamyCalendarProps, IlamyCalendar, Frequency, CalendarEvent };
|