@super-calendar/dom 2.12.1 → 2.14.0
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 +26 -0
- package/dist/index.d.mts +29 -9
- package/dist/index.d.ts +29 -9
- package/dist/index.js +200 -42
- package/dist/index.mjs +201 -43
- package/package.json +2 -2
- package/src/Calendar.tsx +112 -75
- package/src/MonthList.tsx +11 -4
- package/src/MonthView.tsx +26 -16
- package/src/TimeGrid.tsx +271 -74
- package/src/index.ts +2 -0
- package/src/touch.ts +61 -0
package/README.md
CHANGED
|
@@ -52,13 +52,35 @@ export function MyCalendar() {
|
|
|
52
52
|
|
|
53
53
|
For a custom picker, pair the headless hooks (`useDateRange`, `useMonthGrid`) with `MonthList` and `TimeGrid`, all re-exported from this package.
|
|
54
54
|
|
|
55
|
+
## Touch event gestures
|
|
56
|
+
|
|
57
|
+
Touch and pen on `TimeGrid` wait for a 300 ms hold within 8 px before dragging.
|
|
58
|
+
A tap presses the event from its click; a vertical swipe scrolls the grid.
|
|
59
|
+
Additional contacts cancel pending holds and cannot take over an active drag.
|
|
60
|
+
Set `touchDragDelay` and `touchDragThreshold` on `TimeGrid` or `Calendar` to adjust
|
|
61
|
+
the hold. Mouse drag and resize retain their existing behavior. See the
|
|
62
|
+
[dragging guide](https://super-calendar.afonsojramos.me/guides/dragging).
|
|
63
|
+
|
|
55
64
|
## Moving events
|
|
56
65
|
|
|
57
66
|
Pass `onDragEvent` and update your event state with the returned `start` and `end`.
|
|
67
|
+
|
|
68
|
+
Time-grid edge paging requires a mouse drag. Touch and pen remain within the
|
|
69
|
+
visible period, so resting near an edge cannot repeatedly change the date.
|
|
70
|
+
See the [dragging guide](https://super-calendar.afonsojramos.me/guides/dragging).
|
|
71
|
+
|
|
58
72
|
On the time grid, dragging any segment of a multi-day event previews the whole
|
|
59
73
|
range moving together and preserves its duration. Drag a resize grip to change
|
|
60
74
|
only the start or end. See the [dragging guide](https://super-calendar.afonsojramos.me/guides/dragging).
|
|
61
75
|
|
|
76
|
+
## Month chip dimensions
|
|
77
|
+
|
|
78
|
+
`chipHeight` and `chipGap` configure month lanes and overflow rows on `Calendar`,
|
|
79
|
+
`MonthView`, and `MonthList`. Native `MonthPager` forwards them too. DOM defaults
|
|
80
|
+
remain 18 px height and 2 px gaps; native height keeps its theme default.
|
|
81
|
+
Changing either dimension updates already mounted list and pager months.
|
|
82
|
+
See the [month guide](https://super-calendar.afonsojramos.me/guides/month-view).
|
|
83
|
+
|
|
62
84
|
## Styling
|
|
63
85
|
|
|
64
86
|
Out of the box the calendar is fully styled from the theme, no stylesheet required. To restyle a specific part with **Tailwind** or your own CSS, every element is a named slot: pass `classNames` (or `styles`) per slot, and use `data-*` state variants like `data-[today]:`.
|
|
@@ -76,6 +98,10 @@ Out of the box the calendar is fully styled from the theme, no stylesheet requir
|
|
|
76
98
|
|
|
77
99
|
A slot's structural layout is always kept; only its themed look steps aside for your class, so the class wins over the inline default. See the [styling guide](https://super-calendar.afonsojramos.me/guides/styling).
|
|
78
100
|
|
|
101
|
+
On the time grid, an empty-slot touch tap calls `onPressCell` from the column's
|
|
102
|
+
click. Swipes and cancelled contacts do not press the slot. Mouse and pen retain
|
|
103
|
+
drag-to-create behavior. See the [DOM guide](https://super-calendar.afonsojramos.me/guides/dom).
|
|
104
|
+
|
|
79
105
|
## Documentation
|
|
80
106
|
|
|
81
107
|
See the [full documentation](https://super-calendar.afonsojramos.me), the [quickstart](https://super-calendar.afonsojramos.me/quickstart), and the [API reference](https://super-calendar.afonsojramos.me/reference/api).
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
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, CalendarLabels, CalendarLabels as CalendarLabels$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, defaultCalendarLabels, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
2
|
+
import { CSSProperties, ComponentType, ReactElement, ReactNode, RefAttributes } from "react";
|
|
3
|
+
import { BusinessHours, BusinessHours as BusinessHours$1, BusinessHoursBand, BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarLabels as CalendarLabels$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, ScrollToTimeOptions, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, daySelectionState, defaultCalendarLabels, 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
|
|
@@ -233,6 +233,10 @@ interface MonthViewProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
233
233
|
* per day, so a long bar can push a lightly-booked day's own events into "+N more".
|
|
234
234
|
*/
|
|
235
235
|
maxVisibleEventCount?: number;
|
|
236
|
+
/** Height of an event chip and of the "+N more" row, in px (default 18). */
|
|
237
|
+
chipHeight?: number;
|
|
238
|
+
/** Vertical gap between event chips, in px (default 2). */
|
|
239
|
+
chipGap?: number;
|
|
236
240
|
/** Template for the overflow row; `{moreCount}` is replaced (default "{moreCount} More"). */
|
|
237
241
|
moreLabel?: string;
|
|
238
242
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -322,7 +326,7 @@ interface MonthViewInternalProps<T = unknown> extends MonthViewProps<T> {
|
|
|
322
326
|
* <MonthView date={new Date()} events={events} onPressDay={(d) => setDate(d)} />
|
|
323
327
|
* ```
|
|
324
328
|
*/
|
|
325
|
-
export declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, labels: labelsProp, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, highlightWeekends, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onPressCell, onCreateEvent, onSelectDrag, onDragEvent, onDragStart, eventStartEditable, eventOverlap, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
329
|
+
export declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, chipHeight, chipGap, moreLabel, labels: labelsProp, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, highlightWeekends, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onPressCell, onCreateEvent, onSelectDrag, onDragEvent, onDragStart, eventStartEditable, eventOverlap, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
326
330
|
//#endregion
|
|
327
331
|
//#region src/TimeGrid.d.ts
|
|
328
332
|
/**
|
|
@@ -367,7 +371,7 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
367
371
|
weekdayFormat?: WeekdayFormat$1;
|
|
368
372
|
/** Initial pixels per hour (default 48). */
|
|
369
373
|
hourHeight?: number;
|
|
370
|
-
/**
|
|
374
|
+
/** Vertical scroll, in minutes from midnight (default 8:00). Applied on mount and whenever it changes. */
|
|
371
375
|
scrollOffsetMinutes?: number;
|
|
372
376
|
/** Pinch / Ctrl-⌘-scroll to zoom the grid (default true). */
|
|
373
377
|
zoomable?: boolean;
|
|
@@ -388,6 +392,10 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
388
392
|
eventGap?: number;
|
|
389
393
|
/** Snap dragged events to this many minutes (default 15). */
|
|
390
394
|
dragStepMinutes?: number;
|
|
395
|
+
/** Hold duration before a DOM touch or pen drag, in ms (default 300). */
|
|
396
|
+
touchDragDelay?: number;
|
|
397
|
+
/** Movement tolerance for a DOM touch or pen hold, in px (default 8). */
|
|
398
|
+
touchDragThreshold?: number;
|
|
391
399
|
/** Render event time ranges in 12-hour AM/PM (default false, 24h). */
|
|
392
400
|
ampm?: boolean;
|
|
393
401
|
/** Sub-divisions per hour for the grid lines, e.g. 2 for half-hour (default 1). */
|
|
@@ -507,7 +515,7 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
507
515
|
* <TimeGrid mode="week" date={new Date()} events={events} />
|
|
508
516
|
* ```
|
|
509
517
|
*/
|
|
510
|
-
export declare
|
|
518
|
+
export declare const TimeGrid: <T = unknown>(props: TimeGridProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
511
519
|
//#endregion
|
|
512
520
|
//#region src/Calendar.d.ts
|
|
513
521
|
/**
|
|
@@ -591,7 +599,7 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
591
599
|
* Default 1; pass 0 to let events fill their column.
|
|
592
600
|
*/
|
|
593
601
|
eventGap?: number;
|
|
594
|
-
/**
|
|
602
|
+
/** Vertical scroll, in minutes from midnight. Applied on mount and whenever it changes. */
|
|
595
603
|
scrollOffsetMinutes?: number;
|
|
596
604
|
/** Sub-divisions per hour for the grid lines. */
|
|
597
605
|
timeslots?: number;
|
|
@@ -635,6 +643,10 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
635
643
|
eventOverlap?: boolean;
|
|
636
644
|
/** Snap dragged/created events to this many minutes. */
|
|
637
645
|
dragStepMinutes?: number;
|
|
646
|
+
/** DOM touch/pen hold duration in ms (default 300). */
|
|
647
|
+
touchDragDelay?: number;
|
|
648
|
+
/** DOM touch/pen movement tolerance in px (default 8). */
|
|
649
|
+
touchDragThreshold?: number;
|
|
638
650
|
/**
|
|
639
651
|
* Tap empty space: the date+time pressed on the week/day grid, or the tapped
|
|
640
652
|
* day at midnight in `month` mode (where it fires alongside `onPressDay`).
|
|
@@ -667,6 +679,10 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
667
679
|
keyboardEventNavigation?: boolean;
|
|
668
680
|
/** Max chips per day before a "+N more" row. */
|
|
669
681
|
maxVisibleEventCount?: number;
|
|
682
|
+
/** Month chip height in pixels; omit to keep the renderer default. */
|
|
683
|
+
chipHeight?: number;
|
|
684
|
+
/** Gap between month chip rows in pixels (default 2). */
|
|
685
|
+
chipGap?: number;
|
|
670
686
|
/** Overflow row template; `{moreCount}` is replaced. */
|
|
671
687
|
moreLabel?: string;
|
|
672
688
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -721,7 +737,7 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
721
737
|
* <Calendar mode="week" date={new Date()} events={events} />
|
|
722
738
|
* ```
|
|
723
739
|
*/
|
|
724
|
-
export declare
|
|
740
|
+
export declare const Calendar: <T = unknown>(props: CalendarProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
725
741
|
//#endregion
|
|
726
742
|
//#region src/MonthList.d.ts
|
|
727
743
|
/**
|
|
@@ -756,6 +772,10 @@ interface MonthListProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
756
772
|
eventAccessibilityLabel?: EventAccessibilityLabeler$1<T>;
|
|
757
773
|
/** Max chips shown per day before a "+N more" row (default 3). */
|
|
758
774
|
maxVisibleEventCount?: number;
|
|
775
|
+
/** Month chip height in pixels; omit to keep the renderer default. */
|
|
776
|
+
chipHeight?: number;
|
|
777
|
+
/** Gap between month chip rows in pixels (default 2). */
|
|
778
|
+
chipGap?: number;
|
|
759
779
|
/** Template for the overflow row; `{moreCount}` is replaced. */
|
|
760
780
|
moreLabel?: string;
|
|
761
781
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -794,7 +814,7 @@ interface MonthListProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
794
814
|
* Legend List's DOM renderer and the library's headless grid logic. Selection is
|
|
795
815
|
* controlled, pass `selectedRange` (or `selectedDates`) and handle `onPressDay`.
|
|
796
816
|
*/
|
|
797
|
-
export declare function MonthList<T = unknown>({ date, pastMonths, futureMonths, weekdayFormat, highlightWeekends, weekStartsOn, events, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, labels, onPressEvent, onPressMore, selectedRange, selectedDates, fillCellOnSelection, locale, theme: themeOverrides, height, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, className, style, classNames, styles }: MonthListProps<T>): ReactElement;
|
|
817
|
+
export declare function MonthList<T = unknown>({ date, pastMonths, futureMonths, weekdayFormat, highlightWeekends, weekStartsOn, events, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, chipHeight, chipGap, moreLabel, labels, onPressEvent, onPressMore, selectedRange, selectedDates, fillCellOnSelection, locale, theme: themeOverrides, height, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, className, style, classNames, styles }: MonthListProps<T>): ReactElement;
|
|
798
818
|
//#endregion
|
|
799
819
|
//#region src/DateRangePicker.d.ts
|
|
800
820
|
/** Styleable chrome of the pickers (the calendar's own slots forward through too). */
|
|
@@ -996,4 +1016,4 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
996
1016
|
*/
|
|
997
1017
|
export 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;
|
|
998
1018
|
//#endregion
|
|
999
|
-
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSlot, type DatePickerProps, type DatePickerSlot, type DateRange, 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, type MonthListProps, type MonthListSlot, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, type ResourceTimelineProps, type ResourceTimelineSlot, type SlotDefault, type SlotStyleProps, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, daySelectionState, defaultCalendarLabels, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
|
1019
|
+
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, type CalendarHandle, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSlot, type DatePickerProps, type DatePickerSlot, type DateRange, 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, type MonthListProps, type MonthListSlot, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, type ResourceTimelineProps, type ResourceTimelineSlot, type ScrollToTimeOptions, type SlotDefault, type SlotStyleProps, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, daySelectionState, defaultCalendarLabels, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, 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
|
-
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, CalendarLabels, CalendarLabels as CalendarLabels$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, defaultCalendarLabels, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
2
|
+
import { CSSProperties, ComponentType, ReactElement, ReactNode, RefAttributes } from "react";
|
|
3
|
+
import { BusinessHours, BusinessHours as BusinessHours$1, BusinessHoursBand, BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarLabels as CalendarLabels$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, ScrollToTimeOptions, TimeGridMode, TimeGridMode as TimeGridMode$1, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, daySelectionState, defaultCalendarLabels, 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
|
|
@@ -233,6 +233,10 @@ interface MonthViewProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
233
233
|
* per day, so a long bar can push a lightly-booked day's own events into "+N more".
|
|
234
234
|
*/
|
|
235
235
|
maxVisibleEventCount?: number;
|
|
236
|
+
/** Height of an event chip and of the "+N more" row, in px (default 18). */
|
|
237
|
+
chipHeight?: number;
|
|
238
|
+
/** Vertical gap between event chips, in px (default 2). */
|
|
239
|
+
chipGap?: number;
|
|
236
240
|
/** Template for the overflow row; `{moreCount}` is replaced (default "{moreCount} More"). */
|
|
237
241
|
moreLabel?: string;
|
|
238
242
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -322,7 +326,7 @@ interface MonthViewInternalProps<T = unknown> extends MonthViewProps<T> {
|
|
|
322
326
|
* <MonthView date={new Date()} events={events} onPressDay={(d) => setDate(d)} />
|
|
323
327
|
* ```
|
|
324
328
|
*/
|
|
325
|
-
export declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, labels: labelsProp, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, highlightWeekends, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onPressCell, onCreateEvent, onSelectDrag, onDragEvent, onDragStart, eventStartEditable, eventOverlap, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
329
|
+
export declare function MonthView<T = unknown>({ date, weekStartsOn, hiddenDays, weekdayFormat, events, eventsByDay: eventsByDayProp, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, chipHeight, chipGap, moreLabel, labels: labelsProp, onPressEvent, onPressMore, selectedRange, selectedDates, showAdjacentMonths, highlightWeekends, fillCellOnSelection, showTitle, showWeekdays, locale, theme: themeOverrides, minDate, maxDate, isDateDisabled, onPressDay, onPressCell, onCreateEvent, onSelectDrag, onDragEvent, onDragStart, eventStartEditable, eventOverlap, keyboardDayNavigation, className, style, classNames, styles }: MonthViewInternalProps<T>): ReactElement;
|
|
326
330
|
//#endregion
|
|
327
331
|
//#region src/TimeGrid.d.ts
|
|
328
332
|
/**
|
|
@@ -367,7 +371,7 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
367
371
|
weekdayFormat?: WeekdayFormat$1;
|
|
368
372
|
/** Initial pixels per hour (default 48). */
|
|
369
373
|
hourHeight?: number;
|
|
370
|
-
/**
|
|
374
|
+
/** Vertical scroll, in minutes from midnight (default 8:00). Applied on mount and whenever it changes. */
|
|
371
375
|
scrollOffsetMinutes?: number;
|
|
372
376
|
/** Pinch / Ctrl-⌘-scroll to zoom the grid (default true). */
|
|
373
377
|
zoomable?: boolean;
|
|
@@ -388,6 +392,10 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
388
392
|
eventGap?: number;
|
|
389
393
|
/** Snap dragged events to this many minutes (default 15). */
|
|
390
394
|
dragStepMinutes?: number;
|
|
395
|
+
/** Hold duration before a DOM touch or pen drag, in ms (default 300). */
|
|
396
|
+
touchDragDelay?: number;
|
|
397
|
+
/** Movement tolerance for a DOM touch or pen hold, in px (default 8). */
|
|
398
|
+
touchDragThreshold?: number;
|
|
391
399
|
/** Render event time ranges in 12-hour AM/PM (default false, 24h). */
|
|
392
400
|
ampm?: boolean;
|
|
393
401
|
/** Sub-divisions per hour for the grid lines, e.g. 2 for half-hour (default 1). */
|
|
@@ -507,7 +515,7 @@ interface TimeGridProps<T = unknown> extends SlotStyleProps<TimeGridSlot> {
|
|
|
507
515
|
* <TimeGrid mode="week" date={new Date()} events={events} />
|
|
508
516
|
* ```
|
|
509
517
|
*/
|
|
510
|
-
export declare
|
|
518
|
+
export declare const TimeGrid: <T = unknown>(props: TimeGridProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
511
519
|
//#endregion
|
|
512
520
|
//#region src/Calendar.d.ts
|
|
513
521
|
/**
|
|
@@ -591,7 +599,7 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
591
599
|
* Default 1; pass 0 to let events fill their column.
|
|
592
600
|
*/
|
|
593
601
|
eventGap?: number;
|
|
594
|
-
/**
|
|
602
|
+
/** Vertical scroll, in minutes from midnight. Applied on mount and whenever it changes. */
|
|
595
603
|
scrollOffsetMinutes?: number;
|
|
596
604
|
/** Sub-divisions per hour for the grid lines. */
|
|
597
605
|
timeslots?: number;
|
|
@@ -635,6 +643,10 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
635
643
|
eventOverlap?: boolean;
|
|
636
644
|
/** Snap dragged/created events to this many minutes. */
|
|
637
645
|
dragStepMinutes?: number;
|
|
646
|
+
/** DOM touch/pen hold duration in ms (default 300). */
|
|
647
|
+
touchDragDelay?: number;
|
|
648
|
+
/** DOM touch/pen movement tolerance in px (default 8). */
|
|
649
|
+
touchDragThreshold?: number;
|
|
638
650
|
/**
|
|
639
651
|
* Tap empty space: the date+time pressed on the week/day grid, or the tapped
|
|
640
652
|
* day at midnight in `month` mode (where it fires alongside `onPressDay`).
|
|
@@ -667,6 +679,10 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
667
679
|
keyboardEventNavigation?: boolean;
|
|
668
680
|
/** Max chips per day before a "+N more" row. */
|
|
669
681
|
maxVisibleEventCount?: number;
|
|
682
|
+
/** Month chip height in pixels; omit to keep the renderer default. */
|
|
683
|
+
chipHeight?: number;
|
|
684
|
+
/** Gap between month chip rows in pixels (default 2). */
|
|
685
|
+
chipGap?: number;
|
|
670
686
|
/** Overflow row template; `{moreCount}` is replaced. */
|
|
671
687
|
moreLabel?: string;
|
|
672
688
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -721,7 +737,7 @@ interface CalendarProps<T = unknown> extends DateSelectionConstraints$1, SlotSty
|
|
|
721
737
|
* <Calendar mode="week" date={new Date()} events={events} />
|
|
722
738
|
* ```
|
|
723
739
|
*/
|
|
724
|
-
export declare
|
|
740
|
+
export declare const Calendar: <T = unknown>(props: CalendarProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
725
741
|
//#endregion
|
|
726
742
|
//#region src/MonthList.d.ts
|
|
727
743
|
/**
|
|
@@ -756,6 +772,10 @@ interface MonthListProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
756
772
|
eventAccessibilityLabel?: EventAccessibilityLabeler$1<T>;
|
|
757
773
|
/** Max chips shown per day before a "+N more" row (default 3). */
|
|
758
774
|
maxVisibleEventCount?: number;
|
|
775
|
+
/** Month chip height in pixels; omit to keep the renderer default. */
|
|
776
|
+
chipHeight?: number;
|
|
777
|
+
/** Gap between month chip rows in pixels (default 2). */
|
|
778
|
+
chipGap?: number;
|
|
759
779
|
/** Template for the overflow row; `{moreCount}` is replaced. */
|
|
760
780
|
moreLabel?: string;
|
|
761
781
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -794,7 +814,7 @@ interface MonthListProps<T = unknown> extends DateSelectionConstraints$1, SlotSt
|
|
|
794
814
|
* Legend List's DOM renderer and the library's headless grid logic. Selection is
|
|
795
815
|
* controlled, pass `selectedRange` (or `selectedDates`) and handle `onPressDay`.
|
|
796
816
|
*/
|
|
797
|
-
export declare function MonthList<T = unknown>({ date, pastMonths, futureMonths, weekdayFormat, highlightWeekends, weekStartsOn, events, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, moreLabel, labels, onPressEvent, onPressMore, selectedRange, selectedDates, fillCellOnSelection, locale, theme: themeOverrides, height, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, className, style, classNames, styles }: MonthListProps<T>): ReactElement;
|
|
817
|
+
export declare function MonthList<T = unknown>({ date, pastMonths, futureMonths, weekdayFormat, highlightWeekends, weekStartsOn, events, renderEvent, eventAccessibilityLabel, maxVisibleEventCount, chipHeight, chipGap, moreLabel, labels, onPressEvent, onPressMore, selectedRange, selectedDates, fillCellOnSelection, locale, theme: themeOverrides, height, minDate, maxDate, isDateDisabled, keyboardDayNavigation, onPressDay, className, style, classNames, styles }: MonthListProps<T>): ReactElement;
|
|
798
818
|
//#endregion
|
|
799
819
|
//#region src/DateRangePicker.d.ts
|
|
800
820
|
/** Styleable chrome of the pickers (the calendar's own slots forward through too). */
|
|
@@ -996,4 +1016,4 @@ interface ResourceTimelineProps<T = unknown> extends SlotStyleProps<ResourceTime
|
|
|
996
1016
|
*/
|
|
997
1017
|
export 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;
|
|
998
1018
|
//#endregion
|
|
999
|
-
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSlot, type DatePickerProps, type DatePickerSlot, type DateRange, 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, type MonthListProps, type MonthListSlot, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, type ResourceTimelineProps, type ResourceTimelineSlot, type SlotDefault, type SlotStyleProps, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, daySelectionState, defaultCalendarLabels, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
|
1019
|
+
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, type CalendarHandle, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSlot, type DatePickerProps, type DatePickerSlot, type DateRange, 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, type MonthListProps, type MonthListSlot, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type ResolvedSlot, type Resource, type ResourceEventArgs, type ResourceTimelineProps, type ResourceTimelineSlot, type ScrollToTimeOptions, type SlotDefault, type SlotStyleProps, type TimeGridMode, type TimeGridProps, type TimeGridSlot, type ToICalendarOptions, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, type WeekdayFormat, type YearViewProps, type YearViewSlot, backgroundBandsForDay, buildMonthGrid, daySelectionState, defaultCalendarLabels, expandRecurringEvents, getViewDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isWithinDateRange, layoutDayEvents, layoutMonthWeek, nextDateRange, parseICalendar, toICalendar, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|