@super-calendar/dom 2.7.0 → 2.8.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/dist/index.d.mts +38 -8
- package/dist/index.d.ts +38 -8
- package/dist/index.js +364 -254
- package/dist/index.mjs +360 -256
- package/package.json +2 -2
- package/src/Calendar.tsx +13 -0
- package/src/MonthList.tsx +4 -0
- package/src/MonthView.tsx +417 -261
- package/src/ResourceTimeline.tsx +17 -4
- package/src/TimeGrid.tsx +66 -10
- package/src/index.ts +3 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
2
2
|
import { CSSProperties, ComponentType, ReactElement, ReactNode } from "react";
|
|
3
|
-
import { BusinessHours, BusinessHours as BusinessHours$1, BusinessHoursBand, BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DateSelectionConstraints as DateSelectionConstraints$1, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, ICalendarEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, daySelectionState, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
3
|
+
import { BusinessHours, BusinessHours as BusinessHours$1, BusinessHoursBand, BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DateSelectionConstraints as DateSelectionConstraints$1, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, ICalendarEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, PositionedEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, daySelectionState, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
4
4
|
//#region src/slots.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Per-slot styling overrides. Give a slot a Tailwind/CSS class and/or an inline
|
|
@@ -203,7 +203,12 @@ interface MonthViewProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
203
203
|
* announce. Defaults to the event title and day (e.g. "Standup, 15 July").
|
|
204
204
|
*/
|
|
205
205
|
eventAccessibilityLabel?: EventAccessibilityLabeler$1<T>;
|
|
206
|
-
/**
|
|
206
|
+
/**
|
|
207
|
+
* Max event lanes (stacked rows) shown per week before the rest of a day's
|
|
208
|
+
* events collapse into a "+N more" row (default 3). Because multi-day events draw
|
|
209
|
+
* as one bar spanning a lane across the week, this caps lanes per row, not chips
|
|
210
|
+
* per day, so a long bar can push a lightly-booked day's own events into "+N more".
|
|
211
|
+
*/
|
|
207
212
|
maxVisibleEventCount?: number;
|
|
208
213
|
/** Template for the overflow row; `{moreCount}` is replaced (default "{moreCount} More"). */
|
|
209
214
|
moreLabel?: string;
|
|
@@ -217,6 +222,8 @@ interface MonthViewProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
217
222
|
selectedDates?: Date[];
|
|
218
223
|
/** Render days from the neighbouring months in the leading/trailing cells (default true). */
|
|
219
224
|
showAdjacentMonths?: boolean;
|
|
225
|
+
/** Tint weekend day cells with the theme's weekend background (default true). */
|
|
226
|
+
highlightWeekends?: boolean;
|
|
220
227
|
/**
|
|
221
228
|
* Fill the whole cell with the range background instead of the default
|
|
222
229
|
* centered rounded "pill" strip. Default false.
|
|
@@ -263,7 +270,7 @@ interface MonthViewInternalProps<T = unknown> extends MonthViewProps<T> {
|
|
|
263
270
|
* <MonthView date={new Date()} events={events} onPressDay={(d) => setDate(d)} />
|
|
264
271
|
* ```
|
|
265
272
|
*/
|
|
266
|
-
declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onCreateEvent, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
273
|
+
declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, highlightWeekends, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onCreateEvent, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
267
274
|
//#endregion
|
|
268
275
|
//#region src/TimeGrid.d.ts
|
|
269
276
|
/**
|
|
@@ -354,6 +361,13 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
354
361
|
/** Tint Saturday/Sunday columns with the weekend background (default true). Set
|
|
355
362
|
* false to treat weekends like any other day. */
|
|
356
363
|
highlightWeekends?: boolean;
|
|
364
|
+
/** Allow moving events by default (per-event `startEditable` overrides). Default true. */
|
|
365
|
+
eventStartEditable?: boolean;
|
|
366
|
+
/** Allow resizing events by default (per-event `durationEditable` overrides). Default true. */
|
|
367
|
+
eventDurationEditable?: boolean;
|
|
368
|
+
/** Allow a dragged/resized event to overlap another (default true). Set false to
|
|
369
|
+
* reject a drop that would collide, snapping the event back. */
|
|
370
|
+
eventOverlap?: boolean;
|
|
357
371
|
/** date-fns locale for the column headers and time labels. */
|
|
358
372
|
locale?: Locale;
|
|
359
373
|
/** Theme overrides; falls back to the default light theme. */
|
|
@@ -417,7 +431,7 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
417
431
|
* <TimeGrid mode="week" date={new Date()} events={events} />
|
|
418
432
|
* ```
|
|
419
433
|
*/
|
|
420
|
-
declare function TimeGrid<T = unknown>({ date, events, mode, numberOfDays, weekStartsOn, weekdayFormat, hourHeight: initialHourHeight, scrollOffsetMinutes, zoomable, minHourHeight, maxHourHeight, dragStepMinutes, ampm, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, hiddenDays, keyboardEventNavigation, businessHours, renderBusinessHours, showNowIndicator, highlightWeekends, now: nowProp, timeZone, showAllDayEventCell, locale, theme: themeOverrides, height, renderEvent, eventAccessibilityLabel, hourComponent, onPressEvent, onPressDateHeader, onPressCell, onCreateEvent, onDragStart, onDragEvent, onChangeDate, className, style, classNames, styles }: TimeGridProps<T>): ReactElement;
|
|
434
|
+
declare function TimeGrid<T = unknown>({ date, events, mode, numberOfDays, weekStartsOn, weekdayFormat, hourHeight: initialHourHeight, scrollOffsetMinutes, zoomable, minHourHeight, maxHourHeight, dragStepMinutes, ampm, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, hiddenDays, keyboardEventNavigation, businessHours, renderBusinessHours, showNowIndicator, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, now: nowProp, timeZone, showAllDayEventCell, locale, theme: themeOverrides, height, renderEvent, eventAccessibilityLabel, hourComponent, onPressEvent, onPressDateHeader, onPressCell, onCreateEvent, onDragStart, onDragEvent, onChangeDate, className, style, classNames, styles }: TimeGridProps<T>): ReactElement;
|
|
421
435
|
//#endregion
|
|
422
436
|
//#region src/Calendar.d.ts
|
|
423
437
|
/**
|
|
@@ -513,6 +527,12 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
513
527
|
showAllDayEventCell?: boolean;
|
|
514
528
|
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
515
529
|
highlightWeekends?: boolean;
|
|
530
|
+
/** Allow moving events by default (per-event `startEditable` overrides). Default true. */
|
|
531
|
+
eventStartEditable?: boolean;
|
|
532
|
+
/** Allow resizing events by default (per-event `durationEditable` overrides). Default true. */
|
|
533
|
+
eventDurationEditable?: boolean;
|
|
534
|
+
/** Reject drags/resizes that would overlap another event (default true = allowed). */
|
|
535
|
+
eventOverlap?: boolean;
|
|
516
536
|
/** Snap dragged/created events to this many minutes. */
|
|
517
537
|
dragStepMinutes?: number;
|
|
518
538
|
/** Tap empty grid space. */
|
|
@@ -576,7 +596,7 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
576
596
|
* <Calendar mode="week" date={new Date()} events={events} />
|
|
577
597
|
* ```
|
|
578
598
|
*/
|
|
579
|
-
declare function Calendar<T = unknown>({ mode, date, events, onChangeDate, weekStartsOn, hiddenDays, now, numberOfDays, locale, timeZone, theme, height, className, style, onPressEvent, eventAccessibilityLabel, ampm, hourHeight, scrollOffsetMinutes, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, businessHours, renderBusinessHours, showNowIndicator, showAllDayEventCell, highlightWeekends, dragStepMinutes, onPressCell, onCreateEvent, onDragStart, onDragEvent, onPressDateHeader, renderTimeEvent, hourComponent, keyboardEventNavigation, maxVisibleEventCount, moreLabel, showAdjacentMonths, weekdayFormat, fillCellOnSelection, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, onPressMonth, onPressMore, renderMonthEvent, renderScheduleEvent, classNames, styles }: CalendarProps<T>): ReactElement;
|
|
599
|
+
declare function Calendar<T = unknown>({ mode, date, events, onChangeDate, weekStartsOn, hiddenDays, now, numberOfDays, locale, timeZone, theme, height, className, style, onPressEvent, eventAccessibilityLabel, ampm, hourHeight, scrollOffsetMinutes, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, businessHours, renderBusinessHours, showNowIndicator, showAllDayEventCell, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, dragStepMinutes, onPressCell, onCreateEvent, onDragStart, onDragEvent, onPressDateHeader, renderTimeEvent, hourComponent, keyboardEventNavigation, maxVisibleEventCount, moreLabel, showAdjacentMonths, weekdayFormat, fillCellOnSelection, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, onPressMonth, onPressMore, renderMonthEvent, renderScheduleEvent, classNames, styles }: CalendarProps<T>): ReactElement;
|
|
580
600
|
//#endregion
|
|
581
601
|
//#region src/MonthList.d.ts
|
|
582
602
|
/**
|
|
@@ -597,6 +617,8 @@ interface MonthListProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
597
617
|
weekStartsOn?: WeekStartsOn$1;
|
|
598
618
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
599
619
|
weekdayFormat?: WeekdayFormat$1;
|
|
620
|
+
/** Tint weekend day cells with the theme's weekend background (default true). */
|
|
621
|
+
highlightWeekends?: boolean;
|
|
600
622
|
/** Events to render as chips in each day cell (calendar layout when provided). */
|
|
601
623
|
events?: CalendarEvent$1<T>[];
|
|
602
624
|
/** Custom chip renderer; falls back to the built-in titled chip. */
|
|
@@ -645,7 +667,7 @@ interface MonthListProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
645
667
|
* Legend List's DOM renderer and the library's headless grid logic. Selection is
|
|
646
668
|
* controlled, pass `selectedRange` (or `selectedDates`) and handle `onPressDay`.
|
|
647
669
|
*/
|
|
648
|
-
declare function MonthList<T = unknown>({ date, pastMonths, futureMonths, weekdayFormat, weekStartsOn, events, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, fillCellOnSelection, locale, theme: themeOverrides, height, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, className, style, classNames, styles }: MonthListProps<T>): ReactElement;
|
|
670
|
+
declare function MonthList<T = unknown>({ date, pastMonths, futureMonths, weekdayFormat, highlightWeekends, weekStartsOn, events, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, fillCellOnSelection, locale, theme: themeOverrides, height, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, className, style, classNames, styles }: MonthListProps<T>): ReactElement;
|
|
649
671
|
//#endregion
|
|
650
672
|
//#region src/DateRangePicker.d.ts
|
|
651
673
|
/** Styleable chrome of the pickers (the calendar's own slots forward through too). */
|
|
@@ -808,6 +830,14 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
808
830
|
renderBusinessHours?: (band: BusinessHoursBand$1 & {
|
|
809
831
|
resource: Resource;
|
|
810
832
|
}) => ReactNode;
|
|
833
|
+
/**
|
|
834
|
+
* Render each resource's header cell yourself (an avatar, a subtitle, a status
|
|
835
|
+
* dot). Receives the resource and its index; return the cell's content. The board
|
|
836
|
+
* keeps the header cell's sizing so columns stay aligned, so this replaces only
|
|
837
|
+
* the label content. Falls back to the resource title (or id). Applies to both
|
|
838
|
+
* orientations: the top header cells when vertical, the row labels when horizontal.
|
|
839
|
+
*/
|
|
840
|
+
renderResourceHeader?: (resource: Resource, index: number) => ReactNode;
|
|
811
841
|
/** Snap dragged events to this many minutes (default 15). */
|
|
812
842
|
dragStepMinutes?: number;
|
|
813
843
|
/** Show the current-time line when `date` is today (default true). */
|
|
@@ -837,6 +867,6 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
837
867
|
* />
|
|
838
868
|
* ```
|
|
839
869
|
*/
|
|
840
|
-
declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, theme: themeOverrides, renderEvent, onPressEvent, onDragEvent, onPressCell, onCreateEvent, businessHours, renderBusinessHours, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, className, style, classNames, styles }: ResourceTimelineProps<T>): ReactElement;
|
|
870
|
+
declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, theme: themeOverrides, renderEvent, onPressEvent, onDragEvent, onPressCell, onCreateEvent, businessHours, renderBusinessHours, renderResourceHeader, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, className, style, classNames, styles }: ResourceTimelineProps<T>): ReactElement;
|
|
841
871
|
//#endregion
|
|
842
|
-
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, DatePicker, type DatePickerProps, type DatePickerSlot, type DateRange, DateRangePicker, type DateRangePickerProps, type DateSelectionConstraints, type DaySelectionState, type DomAgendaEvent, type DomAgendaEventArgs, type DomCalendarTheme, type DomMonthEvent, type DomMonthEventArgs, type DomRenderEvent, type DomRenderEventArgs, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthView, type MonthViewProps, type MonthViewSlot, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type ResourceTimelineSlot, type SlotDefault, type SlotStyleProps, TimeGrid, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, YearView, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, darkDomTheme, daySelectionState, defaultDomTheme, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, mergeDomTheme, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
|
872
|
+
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, DatePicker, type DatePickerProps, type DatePickerSlot, type DateRange, DateRangePicker, type DateRangePickerProps, type DateSelectionConstraints, type DaySelectionState, type DomAgendaEvent, type DomAgendaEventArgs, type DomCalendarTheme, type DomMonthEvent, type DomMonthEventArgs, type DomRenderEvent, type DomRenderEventArgs, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type ICalEvent, type ICalendarEvent, type MonthEventSegment, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthView, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type ResourceTimelineSlot, type SlotDefault, type SlotStyleProps, TimeGrid, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, YearView, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, darkDomTheme, daySelectionState, defaultDomTheme, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, mergeDomTheme, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
2
2
|
import { CSSProperties, ComponentType, ReactElement, ReactNode } from "react";
|
|
3
|
-
import { BusinessHours, BusinessHours as BusinessHours$1, BusinessHoursBand, BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DateSelectionConstraints as DateSelectionConstraints$1, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, ICalendarEvent, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, PositionedEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, daySelectionState, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
3
|
+
import { BusinessHours, BusinessHours as BusinessHours$1, BusinessHoursBand, BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarMode, CalendarMode as CalendarMode$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DateSelectionConstraints as DateSelectionConstraints$1, DaySelectionState, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, ICalendarEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, PositionedEvent, RecurrenceFrequency, RecurrenceRule, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, daySelectionState, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
4
4
|
//#region src/slots.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Per-slot styling overrides. Give a slot a Tailwind/CSS class and/or an inline
|
|
@@ -203,7 +203,12 @@ interface MonthViewProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
203
203
|
* announce. Defaults to the event title and day (e.g. "Standup, 15 July").
|
|
204
204
|
*/
|
|
205
205
|
eventAccessibilityLabel?: EventAccessibilityLabeler$1<T>;
|
|
206
|
-
/**
|
|
206
|
+
/**
|
|
207
|
+
* Max event lanes (stacked rows) shown per week before the rest of a day's
|
|
208
|
+
* events collapse into a "+N more" row (default 3). Because multi-day events draw
|
|
209
|
+
* as one bar spanning a lane across the week, this caps lanes per row, not chips
|
|
210
|
+
* per day, so a long bar can push a lightly-booked day's own events into "+N more".
|
|
211
|
+
*/
|
|
207
212
|
maxVisibleEventCount?: number;
|
|
208
213
|
/** Template for the overflow row; `{moreCount}` is replaced (default "{moreCount} More"). */
|
|
209
214
|
moreLabel?: string;
|
|
@@ -217,6 +222,8 @@ interface MonthViewProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
217
222
|
selectedDates?: Date[];
|
|
218
223
|
/** Render days from the neighbouring months in the leading/trailing cells (default true). */
|
|
219
224
|
showAdjacentMonths?: boolean;
|
|
225
|
+
/** Tint weekend day cells with the theme's weekend background (default true). */
|
|
226
|
+
highlightWeekends?: boolean;
|
|
220
227
|
/**
|
|
221
228
|
* Fill the whole cell with the range background instead of the default
|
|
222
229
|
* centered rounded "pill" strip. Default false.
|
|
@@ -263,7 +270,7 @@ interface MonthViewInternalProps<T = unknown> extends MonthViewProps<T> {
|
|
|
263
270
|
* <MonthView date={new Date()} events={events} onPressDay={(d) => setDate(d)} />
|
|
264
271
|
* ```
|
|
265
272
|
*/
|
|
266
|
-
declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onCreateEvent, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
273
|
+
declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, highlightWeekends, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onCreateEvent, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
267
274
|
//#endregion
|
|
268
275
|
//#region src/TimeGrid.d.ts
|
|
269
276
|
/**
|
|
@@ -354,6 +361,13 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
354
361
|
/** Tint Saturday/Sunday columns with the weekend background (default true). Set
|
|
355
362
|
* false to treat weekends like any other day. */
|
|
356
363
|
highlightWeekends?: boolean;
|
|
364
|
+
/** Allow moving events by default (per-event `startEditable` overrides). Default true. */
|
|
365
|
+
eventStartEditable?: boolean;
|
|
366
|
+
/** Allow resizing events by default (per-event `durationEditable` overrides). Default true. */
|
|
367
|
+
eventDurationEditable?: boolean;
|
|
368
|
+
/** Allow a dragged/resized event to overlap another (default true). Set false to
|
|
369
|
+
* reject a drop that would collide, snapping the event back. */
|
|
370
|
+
eventOverlap?: boolean;
|
|
357
371
|
/** date-fns locale for the column headers and time labels. */
|
|
358
372
|
locale?: Locale;
|
|
359
373
|
/** Theme overrides; falls back to the default light theme. */
|
|
@@ -417,7 +431,7 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
417
431
|
* <TimeGrid mode="week" date={new Date()} events={events} />
|
|
418
432
|
* ```
|
|
419
433
|
*/
|
|
420
|
-
declare function TimeGrid<T = unknown>({ date, events, mode, numberOfDays, weekStartsOn, weekdayFormat, hourHeight: initialHourHeight, scrollOffsetMinutes, zoomable, minHourHeight, maxHourHeight, dragStepMinutes, ampm, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, hiddenDays, keyboardEventNavigation, businessHours, renderBusinessHours, showNowIndicator, highlightWeekends, now: nowProp, timeZone, showAllDayEventCell, locale, theme: themeOverrides, height, renderEvent, eventAccessibilityLabel, hourComponent, onPressEvent, onPressDateHeader, onPressCell, onCreateEvent, onDragStart, onDragEvent, onChangeDate, className, style, classNames, styles }: TimeGridProps<T>): ReactElement;
|
|
434
|
+
declare function TimeGrid<T = unknown>({ date, events, mode, numberOfDays, weekStartsOn, weekdayFormat, hourHeight: initialHourHeight, scrollOffsetMinutes, zoomable, minHourHeight, maxHourHeight, dragStepMinutes, ampm, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, hiddenDays, keyboardEventNavigation, businessHours, renderBusinessHours, showNowIndicator, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, now: nowProp, timeZone, showAllDayEventCell, locale, theme: themeOverrides, height, renderEvent, eventAccessibilityLabel, hourComponent, onPressEvent, onPressDateHeader, onPressCell, onCreateEvent, onDragStart, onDragEvent, onChangeDate, className, style, classNames, styles }: TimeGridProps<T>): ReactElement;
|
|
421
435
|
//#endregion
|
|
422
436
|
//#region src/Calendar.d.ts
|
|
423
437
|
/**
|
|
@@ -513,6 +527,12 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
513
527
|
showAllDayEventCell?: boolean;
|
|
514
528
|
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
515
529
|
highlightWeekends?: boolean;
|
|
530
|
+
/** Allow moving events by default (per-event `startEditable` overrides). Default true. */
|
|
531
|
+
eventStartEditable?: boolean;
|
|
532
|
+
/** Allow resizing events by default (per-event `durationEditable` overrides). Default true. */
|
|
533
|
+
eventDurationEditable?: boolean;
|
|
534
|
+
/** Reject drags/resizes that would overlap another event (default true = allowed). */
|
|
535
|
+
eventOverlap?: boolean;
|
|
516
536
|
/** Snap dragged/created events to this many minutes. */
|
|
517
537
|
dragStepMinutes?: number;
|
|
518
538
|
/** Tap empty grid space. */
|
|
@@ -576,7 +596,7 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
576
596
|
* <Calendar mode="week" date={new Date()} events={events} />
|
|
577
597
|
* ```
|
|
578
598
|
*/
|
|
579
|
-
declare function Calendar<T = unknown>({ mode, date, events, onChangeDate, weekStartsOn, hiddenDays, now, numberOfDays, locale, timeZone, theme, height, className, style, onPressEvent, eventAccessibilityLabel, ampm, hourHeight, scrollOffsetMinutes, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, businessHours, renderBusinessHours, showNowIndicator, showAllDayEventCell, highlightWeekends, dragStepMinutes, onPressCell, onCreateEvent, onDragStart, onDragEvent, onPressDateHeader, renderTimeEvent, hourComponent, keyboardEventNavigation, maxVisibleEventCount, moreLabel, showAdjacentMonths, weekdayFormat, fillCellOnSelection, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, onPressMonth, onPressMore, renderMonthEvent, renderScheduleEvent, classNames, styles }: CalendarProps<T>): ReactElement;
|
|
599
|
+
declare function Calendar<T = unknown>({ mode, date, events, onChangeDate, weekStartsOn, hiddenDays, now, numberOfDays, locale, timeZone, theme, height, className, style, onPressEvent, eventAccessibilityLabel, ampm, hourHeight, scrollOffsetMinutes, timeslots, minHour, maxHour, hideHours, showWeekNumber, weekNumberPrefix, businessHours, renderBusinessHours, showNowIndicator, showAllDayEventCell, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, dragStepMinutes, onPressCell, onCreateEvent, onDragStart, onDragEvent, onPressDateHeader, renderTimeEvent, hourComponent, keyboardEventNavigation, maxVisibleEventCount, moreLabel, showAdjacentMonths, weekdayFormat, fillCellOnSelection, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, onPressMonth, onPressMore, renderMonthEvent, renderScheduleEvent, classNames, styles }: CalendarProps<T>): ReactElement;
|
|
580
600
|
//#endregion
|
|
581
601
|
//#region src/MonthList.d.ts
|
|
582
602
|
/**
|
|
@@ -597,6 +617,8 @@ interface MonthListProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
597
617
|
weekStartsOn?: WeekStartsOn$1;
|
|
598
618
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
599
619
|
weekdayFormat?: WeekdayFormat$1;
|
|
620
|
+
/** Tint weekend day cells with the theme's weekend background (default true). */
|
|
621
|
+
highlightWeekends?: boolean;
|
|
600
622
|
/** Events to render as chips in each day cell (calendar layout when provided). */
|
|
601
623
|
events?: CalendarEvent$1<T>[];
|
|
602
624
|
/** Custom chip renderer; falls back to the built-in titled chip. */
|
|
@@ -645,7 +667,7 @@ interface MonthListProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
645
667
|
* Legend List's DOM renderer and the library's headless grid logic. Selection is
|
|
646
668
|
* controlled, pass `selectedRange` (or `selectedDates`) and handle `onPressDay`.
|
|
647
669
|
*/
|
|
648
|
-
declare function MonthList<T = unknown>({ date, pastMonths, futureMonths, weekdayFormat, weekStartsOn, events, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, fillCellOnSelection, locale, theme: themeOverrides, height, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, className, style, classNames, styles }: MonthListProps<T>): ReactElement;
|
|
670
|
+
declare function MonthList<T = unknown>({ date, pastMonths, futureMonths, weekdayFormat, highlightWeekends, weekStartsOn, events, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, onPressEvent, onPressMore, selectedRange, selectedDates, fillCellOnSelection, locale, theme: themeOverrides, height, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, className, style, classNames, styles }: MonthListProps<T>): ReactElement;
|
|
649
671
|
//#endregion
|
|
650
672
|
//#region src/DateRangePicker.d.ts
|
|
651
673
|
/** Styleable chrome of the pickers (the calendar's own slots forward through too). */
|
|
@@ -808,6 +830,14 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
808
830
|
renderBusinessHours?: (band: BusinessHoursBand$1 & {
|
|
809
831
|
resource: Resource;
|
|
810
832
|
}) => ReactNode;
|
|
833
|
+
/**
|
|
834
|
+
* Render each resource's header cell yourself (an avatar, a subtitle, a status
|
|
835
|
+
* dot). Receives the resource and its index; return the cell's content. The board
|
|
836
|
+
* keeps the header cell's sizing so columns stay aligned, so this replaces only
|
|
837
|
+
* the label content. Falls back to the resource title (or id). Applies to both
|
|
838
|
+
* orientations: the top header cells when vertical, the row labels when horizontal.
|
|
839
|
+
*/
|
|
840
|
+
renderResourceHeader?: (resource: Resource, index: number) => ReactNode;
|
|
811
841
|
/** Snap dragged events to this many minutes (default 15). */
|
|
812
842
|
dragStepMinutes?: number;
|
|
813
843
|
/** Show the current-time line when `date` is today (default true). */
|
|
@@ -837,6 +867,6 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
837
867
|
* />
|
|
838
868
|
* ```
|
|
839
869
|
*/
|
|
840
|
-
declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, theme: themeOverrides, renderEvent, onPressEvent, onDragEvent, onPressCell, onCreateEvent, businessHours, renderBusinessHours, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, className, style, classNames, styles }: ResourceTimelineProps<T>): ReactElement;
|
|
870
|
+
declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, theme: themeOverrides, renderEvent, onPressEvent, onDragEvent, onPressCell, onCreateEvent, businessHours, renderBusinessHours, renderResourceHeader, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, className, style, classNames, styles }: ResourceTimelineProps<T>): ReactElement;
|
|
841
871
|
//#endregion
|
|
842
|
-
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, DatePicker, type DatePickerProps, type DatePickerSlot, type DateRange, DateRangePicker, type DateRangePickerProps, type DateSelectionConstraints, type DaySelectionState, type DomAgendaEvent, type DomAgendaEventArgs, type DomCalendarTheme, type DomMonthEvent, type DomMonthEventArgs, type DomRenderEvent, type DomRenderEventArgs, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type ICalEvent, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthView, type MonthViewProps, type MonthViewSlot, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type ResourceTimelineSlot, type SlotDefault, type SlotStyleProps, TimeGrid, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, YearView, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, darkDomTheme, daySelectionState, defaultDomTheme, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, mergeDomTheme, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
|
872
|
+
export { Agenda, type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, Calendar, type CalendarEvent, type CalendarMode, type CalendarProps, type CalendarSlot, DatePicker, type DatePickerProps, type DatePickerSlot, type DateRange, DateRangePicker, type DateRangePickerProps, type DateSelectionConstraints, type DaySelectionState, type DomAgendaEvent, type DomAgendaEventArgs, type DomCalendarTheme, type DomMonthEvent, type DomMonthEventArgs, type DomRenderEvent, type DomRenderEventArgs, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type ICalEvent, type ICalendarEvent, type MonthEventSegment, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthView, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, ResourceTimeline, type ResourceTimelineProps, type ResourceTimelineSlot, type SlotDefault, type SlotStyleProps, TimeGrid, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, YearView, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, darkDomTheme, daySelectionState, defaultDomTheme, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, mergeDomTheme, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|