@super-calendar/native 2.15.0 → 2.17.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 +63 -0
- package/dist/{DefaultMonthEvent-BDD7GgL8.d.mts → DefaultMonthEvent-C3C30hfV.d.mts} +7 -21
- package/dist/{DefaultMonthEvent-ggwYo7Fy.d.ts → DefaultMonthEvent-Dx3lD7ig.d.ts} +7 -21
- package/dist/{MonthList-D4_LBnbU.js → MonthList-B2TSGYp7.js} +409 -109
- package/dist/{MonthList-DWCH3GT5.mjs → MonthList-N1GVDIE4.mjs} +400 -112
- package/dist/index.d.mts +50 -16
- package/dist/index.d.ts +50 -16
- package/dist/index.js +375 -46
- package/dist/index.mjs +370 -47
- package/dist/picker.d.mts +1 -1
- package/dist/picker.d.ts +1 -1
- package/dist/picker.js +1 -1
- package/dist/picker.mjs +1 -1
- package/package.json +2 -2
- package/src/components/Calendar.tsx +83 -9
- package/src/components/MonthPager.tsx +175 -20
- package/src/components/MonthView.tsx +332 -116
- package/src/components/MultiWeekView.tsx +34 -0
- package/src/components/ResourceTimeline.tsx +153 -4
- package/src/components/TimeGrid.tsx +241 -7
- package/src/index.tsx +8 -0
- package/src/types.ts +1 -0
- package/src/utils/holdWebDateDrag.ts +63 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as TimeGridMode, C as EventKeyExtractor, D as RenderEvent, E as RecurrenceRule, F as PartialCalendarTheme, I as darkTheme, L as defaultTheme, M as WeekdayFormat, N as CalendarTheme, O as RenderEventArgs, P as CalendarThemeProvider, R as mergeTheme, S as EventDragStartHandler, T as RecurrenceFrequency, _ as CalendarMode, a as MonthPager, b as EventAccessibilityLabeler, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarHandle, h as CalendarEvent, i as MonthListSlot, j as WeekStartsOn, k as ScrollToTimeOptions, l as MonthViewSlot, m as BusinessHoursBand, n as MonthList, o as MonthPagerProps, p as BusinessHours, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, u as ResolvedSlot, v as CreateGhostArgs, w as ICalendarEvent, x as EventDragHandler, y as EventAccessibilityLabelContext, z as useCalendarTheme } from "./DefaultMonthEvent-C3C30hfV.mjs";
|
|
2
2
|
import { Locale } from "date-fns";
|
|
3
3
|
import { ComponentType, ReactElement, ReactNode, RefAttributes } from "react";
|
|
4
4
|
import { SharedValue, useSharedValue } from "react-native-reanimated";
|
|
5
|
-
import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarLabels as CalendarLabels$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, daySelectionState, defaultCalendarLabels, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
5
|
+
import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarLabels as CalendarLabels$1, CreateGhostArgs as CreateGhostArgs$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, MultiWeekGrid, MultiWeekGridDay, MultiWeekGridInterval, MultiWeekGridOptions, MultiWeekGridWeek, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn as WeekStartsOn$1, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, buildMultiWeekGrid, daySelectionState, defaultCalendarLabels, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
6
6
|
import { ScrollViewProps, StyleProp, ViewStyle } from "react-native";
|
|
7
|
-
//#region src/components/YearView.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
|
|
10
9
|
* text/marker inside a day cell (React Native text colour doesn't inherit);
|
|
@@ -84,8 +83,6 @@ declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, loca
|
|
|
84
83
|
* ```
|
|
85
84
|
*/
|
|
86
85
|
export declare const YearView: typeof YearViewInner;
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region src/components/Agenda.d.ts
|
|
89
86
|
/**
|
|
90
87
|
* The styleable parts of {@link Agenda}. Mirrors the dom renderer's slot names;
|
|
91
88
|
* the event itself is styled by `renderEvent` (or the theme), not a slot.
|
|
@@ -113,8 +110,6 @@ type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
|
113
110
|
* events (and therefore which date range) are shown.
|
|
114
111
|
*/
|
|
115
112
|
export declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/components/TimeGrid.d.ts
|
|
118
113
|
/** Default height in pixels of one hour row on the time grid. */
|
|
119
114
|
export declare const DEFAULT_HOUR_HEIGHT = 48;
|
|
120
115
|
/** Replace the hour-axis label. Receives the hour (0–23) and the `ampm` flag. */
|
|
@@ -262,6 +257,17 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
262
257
|
onPressCell?: (date: Date) => void;
|
|
263
258
|
onLongPressCell?: (date: Date) => void;
|
|
264
259
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
260
|
+
/**
|
|
261
|
+
* A component that draws content inside the drag-to-create preview, such as a
|
|
262
|
+
* draft title and the live time range. It receives the snapped `start` and
|
|
263
|
+
* `end` that `onCreateEvent` would get if the sweep ended now, and re-renders
|
|
264
|
+
* when the sweep crosses a snap step. The grid keeps positioning, sizing and
|
|
265
|
+
* styling the preview on the UI thread and clips the content to it; the
|
|
266
|
+
* content is non-interactive and hidden from screen readers. Renders only
|
|
267
|
+
* while a sweep can create, so it needs `onCreateEvent` and does not enable
|
|
268
|
+
* creation itself.
|
|
269
|
+
*/
|
|
270
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
265
271
|
/** Tap a day's column header (default header only). */
|
|
266
272
|
onPressDateHeader?: (date: Date) => void;
|
|
267
273
|
onChangeDate: (date: Date) => void;
|
|
@@ -288,8 +294,6 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
288
294
|
* ```
|
|
289
295
|
*/
|
|
290
296
|
export declare const TimeGrid: <T>(props: TimeGridProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
291
|
-
//#endregion
|
|
292
|
-
//#region src/components/Calendar.d.ts
|
|
293
297
|
/**
|
|
294
298
|
* Every styleable slot across the Calendar's views. The month slots reach the
|
|
295
299
|
* month pager, the grid slots reach the time grid, and the agenda slots reach
|
|
@@ -364,6 +368,11 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
364
368
|
* on empty space when set.
|
|
365
369
|
*/
|
|
366
370
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
371
|
+
/**
|
|
372
|
+
* A component that draws content inside the time-grid drag-to-create preview;
|
|
373
|
+
* see `TimeGrid`'s prop of the same name. Applies to the week/day grid only.
|
|
374
|
+
*/
|
|
375
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
367
376
|
/**
|
|
368
377
|
* Month and year modes: reports a create sweep's day span as it happens, as the
|
|
369
378
|
* ordered inclusive `[start, end]` days, so a selection highlight can follow the
|
|
@@ -422,6 +431,8 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
422
431
|
weekdayFormat?: WeekdayFormat$1;
|
|
423
432
|
/** Number of day columns when `mode="custom"`. Ignored by other modes. Default 1. */
|
|
424
433
|
numberOfDays?: number;
|
|
434
|
+
/** Consecutive full week rows for `mode="multiweek"` (default 2). */
|
|
435
|
+
numberOfWeeks?: number;
|
|
425
436
|
/**
|
|
426
437
|
* Last weekday of a `custom` partial-week view (0–6). When set, `custom` shows
|
|
427
438
|
* `weekStartsOn`…`weekEndsOn` of the visible week and pages by week, taking
|
|
@@ -619,8 +630,21 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
619
630
|
* ```
|
|
620
631
|
*/
|
|
621
632
|
export declare const Calendar: <T>(props: CalendarProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
622
|
-
|
|
623
|
-
|
|
633
|
+
/** Props for the consecutive full-week event grid. */
|
|
634
|
+
type MultiWeekViewProps<T = unknown> = Omit<MonthViewProps<T>, "date" | "weekStartsOn" | "showSixWeeks" | "showAdjacentMonths"> & {
|
|
635
|
+
/** Any day in the first displayed week. */
|
|
636
|
+
date: Date;
|
|
637
|
+
/** Positive whole number of week rows (default 2). Invalid values throw RangeError. */
|
|
638
|
+
numberOfWeeks?: number;
|
|
639
|
+
/** First weekday, Sunday = 0 (default). */
|
|
640
|
+
weekStartsOn?: WeekStartsOn$1;
|
|
641
|
+
};
|
|
642
|
+
/**
|
|
643
|
+
* Consecutive full weeks with event bars and no hourly slots. Rows scroll
|
|
644
|
+
* vertically when they cannot fit. Expand recurring events before passing them,
|
|
645
|
+
* or use Calendar with mode="multiweek" for recurrence and swipe paging.
|
|
646
|
+
*/
|
|
647
|
+
export declare function MultiWeekView<T = unknown>({ date, numberOfWeeks, weekStartsOn, ...rest }: MultiWeekViewProps<T>): ReactElement;
|
|
624
648
|
/**
|
|
625
649
|
* The built-in event renderer: a filled, rounded box showing the event title
|
|
626
650
|
* and (on the day/week grid, when the box is tall enough) its time range. The
|
|
@@ -630,8 +654,6 @@ export declare const Calendar: <T>(props: CalendarProps<T> & RefAttributes<Calen
|
|
|
630
654
|
* `renderEvent` to `<Calendar>` to replace it entirely.
|
|
631
655
|
*/
|
|
632
656
|
export declare function DefaultEvent<T>({ event, mode, boxHeight, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, accessibilityActions, onAccessibilityAction, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region src/components/ResourceTimeline.d.ts
|
|
635
657
|
/** A schedulable lane (room, person, machine) events are grouped under. */
|
|
636
658
|
interface Resource {
|
|
637
659
|
/** Stable id events reference via their `resourceId`. */
|
|
@@ -725,6 +747,19 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
725
747
|
* event; called with the swept start/end and the lane's resource.
|
|
726
748
|
*/
|
|
727
749
|
onCreateEvent?: (start: Date, end: Date, resource: Resource) => void;
|
|
750
|
+
/**
|
|
751
|
+
* A component that draws content inside the drag-to-create preview, such as a
|
|
752
|
+
* draft title and the live time range. It receives the snapped `start` and
|
|
753
|
+
* `end` that `onCreateEvent` would get if the sweep ended now, plus the lane's
|
|
754
|
+
* resource, and re-renders when the sweep crosses a snap step. The board keeps
|
|
755
|
+
* positioning, sizing and styling the preview on the UI thread and clips the
|
|
756
|
+
* content to it; the content is non-interactive and hidden from screen
|
|
757
|
+
* readers. Renders only while a sweep can create, so it needs `onCreateEvent`
|
|
758
|
+
* and does not enable creation itself. Applies to both orientations.
|
|
759
|
+
*/
|
|
760
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs$1 & {
|
|
761
|
+
resource: Resource;
|
|
762
|
+
}>;
|
|
728
763
|
/**
|
|
729
764
|
* Shade the hours outside this window, per lane. Same shape as the Calendar's
|
|
730
765
|
* `businessHours` plus the lane's resource, so per-resource opening hours work
|
|
@@ -777,6 +812,5 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
777
812
|
* />
|
|
778
813
|
* ```
|
|
779
814
|
*/
|
|
780
|
-
export declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, businessHours, renderBusinessHours, renderResourceHeader, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, labels: labelsProp }: ResourceTimelineProps<T>): ReactElement;
|
|
781
|
-
|
|
782
|
-
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, type CalendarHandle, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSlot, type CalendarTheme, CalendarThemeProvider, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultMonthEvent, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type EventDragHandler, type EventDragStartHandler, type EventKeyExtractor, type HourRenderer, type ICalEvent, type ICalendarEvent, type MonthEventSegment, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type PartialCalendarTheme, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type RenderEvent, type RenderEventArgs, type ResolvedSlot, type Resource, type ResourceEventArgs, type ResourceTimelineProps, 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, buildMonthWeeks, darkTheme, daySelectionState, defaultCalendarLabels, defaultTheme, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, mergeTheme, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
|
815
|
+
export declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, renderCreateGhost, businessHours, renderBusinessHours, renderResourceHeader, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, labels: labelsProp }: ResourceTimelineProps<T>): ReactElement;
|
|
816
|
+
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, type CalendarHandle, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSlot, type CalendarTheme, CalendarThemeProvider, type CreateGhostArgs, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultMonthEvent, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type EventDragHandler, type EventDragStartHandler, type EventKeyExtractor, type HourRenderer, type ICalEvent, type ICalendarEvent, type MonthEventSegment, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type MultiWeekGrid, type MultiWeekGridDay, type MultiWeekGridInterval, type MultiWeekGridOptions, type MultiWeekGridWeek, type MultiWeekViewProps, type PartialCalendarTheme, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type RenderEvent, type RenderEventArgs, type ResolvedSlot, type Resource, type ResourceEventArgs, type ResourceTimelineProps, 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, buildMonthWeeks, buildMultiWeekGrid, darkTheme, daySelectionState, defaultCalendarLabels, defaultTheme, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, mergeTheme, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as TimeGridMode, C as EventKeyExtractor, D as RenderEvent, E as RecurrenceRule, F as PartialCalendarTheme, I as darkTheme, L as defaultTheme, M as WeekdayFormat, N as CalendarTheme, O as RenderEventArgs, P as CalendarThemeProvider, R as mergeTheme, S as EventDragStartHandler, T as RecurrenceFrequency, _ as CalendarMode, a as MonthPager, b as EventAccessibilityLabeler, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarHandle, h as CalendarEvent, i as MonthListSlot, j as WeekStartsOn, k as ScrollToTimeOptions, l as MonthViewSlot, m as BusinessHoursBand, n as MonthList, o as MonthPagerProps, p as BusinessHours, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, u as ResolvedSlot, v as CreateGhostArgs, w as ICalendarEvent, x as EventDragHandler, y as EventAccessibilityLabelContext, z as useCalendarTheme } from "./DefaultMonthEvent-Dx3lD7ig.js";
|
|
2
2
|
import { Locale } from "date-fns";
|
|
3
3
|
import { ComponentType, ReactElement, ReactNode, RefAttributes } from "react";
|
|
4
4
|
import { ScrollViewProps, StyleProp, ViewStyle } from "react-native";
|
|
5
5
|
import { SharedValue, useSharedValue } from "react-native-reanimated";
|
|
6
|
-
import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarLabels as CalendarLabels$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, daySelectionState, defaultCalendarLabels, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
7
|
-
//#region src/components/YearView.d.ts
|
|
6
|
+
import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarLabels as CalendarLabels$1, CreateGhostArgs as CreateGhostArgs$1, DateRange, DateRange as DateRange$1, DateSelectionConstraints, DaySelectionState, EventAccessibilityLabeler as EventAccessibilityLabeler$1, ICalEvent, MonthEventSegment, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, MonthWeekEvents, MultiWeekGrid, MultiWeekGridDay, MultiWeekGridInterval, MultiWeekGridOptions, MultiWeekGridWeek, PositionedEvent, ToICalendarOptions, UseDateRangeOptions, UseMonthGridOptions, WeekStartsOn as WeekStartsOn$1, WeekdayFormat as WeekdayFormat$1, backgroundBandsForDay, buildMonthGrid, buildMonthWeeks, buildMultiWeekGrid, daySelectionState, defaultCalendarLabels, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken } from "@super-calendar/core";
|
|
8
7
|
/**
|
|
9
8
|
* The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
|
|
10
9
|
* text/marker inside a day cell (React Native text colour doesn't inherit);
|
|
@@ -84,8 +83,6 @@ declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, loca
|
|
|
84
83
|
* ```
|
|
85
84
|
*/
|
|
86
85
|
export declare const YearView: typeof YearViewInner;
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region src/components/Agenda.d.ts
|
|
89
86
|
/**
|
|
90
87
|
* The styleable parts of {@link Agenda}. Mirrors the dom renderer's slot names;
|
|
91
88
|
* the event itself is styled by `renderEvent` (or the theme), not a slot.
|
|
@@ -113,8 +110,6 @@ type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
|
113
110
|
* events (and therefore which date range) are shown.
|
|
114
111
|
*/
|
|
115
112
|
export declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/components/TimeGrid.d.ts
|
|
118
113
|
/** Default height in pixels of one hour row on the time grid. */
|
|
119
114
|
export declare const DEFAULT_HOUR_HEIGHT = 48;
|
|
120
115
|
/** Replace the hour-axis label. Receives the hour (0–23) and the `ampm` flag. */
|
|
@@ -262,6 +257,17 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
262
257
|
onPressCell?: (date: Date) => void;
|
|
263
258
|
onLongPressCell?: (date: Date) => void;
|
|
264
259
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
260
|
+
/**
|
|
261
|
+
* A component that draws content inside the drag-to-create preview, such as a
|
|
262
|
+
* draft title and the live time range. It receives the snapped `start` and
|
|
263
|
+
* `end` that `onCreateEvent` would get if the sweep ended now, and re-renders
|
|
264
|
+
* when the sweep crosses a snap step. The grid keeps positioning, sizing and
|
|
265
|
+
* styling the preview on the UI thread and clips the content to it; the
|
|
266
|
+
* content is non-interactive and hidden from screen readers. Renders only
|
|
267
|
+
* while a sweep can create, so it needs `onCreateEvent` and does not enable
|
|
268
|
+
* creation itself.
|
|
269
|
+
*/
|
|
270
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
265
271
|
/** Tap a day's column header (default header only). */
|
|
266
272
|
onPressDateHeader?: (date: Date) => void;
|
|
267
273
|
onChangeDate: (date: Date) => void;
|
|
@@ -288,8 +294,6 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
288
294
|
* ```
|
|
289
295
|
*/
|
|
290
296
|
export declare const TimeGrid: <T>(props: TimeGridProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
291
|
-
//#endregion
|
|
292
|
-
//#region src/components/Calendar.d.ts
|
|
293
297
|
/**
|
|
294
298
|
* Every styleable slot across the Calendar's views. The month slots reach the
|
|
295
299
|
* month pager, the grid slots reach the time grid, and the agenda slots reach
|
|
@@ -364,6 +368,11 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
364
368
|
* on empty space when set.
|
|
365
369
|
*/
|
|
366
370
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
371
|
+
/**
|
|
372
|
+
* A component that draws content inside the time-grid drag-to-create preview;
|
|
373
|
+
* see `TimeGrid`'s prop of the same name. Applies to the week/day grid only.
|
|
374
|
+
*/
|
|
375
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
367
376
|
/**
|
|
368
377
|
* Month and year modes: reports a create sweep's day span as it happens, as the
|
|
369
378
|
* ordered inclusive `[start, end]` days, so a selection highlight can follow the
|
|
@@ -422,6 +431,8 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
422
431
|
weekdayFormat?: WeekdayFormat$1;
|
|
423
432
|
/** Number of day columns when `mode="custom"`. Ignored by other modes. Default 1. */
|
|
424
433
|
numberOfDays?: number;
|
|
434
|
+
/** Consecutive full week rows for `mode="multiweek"` (default 2). */
|
|
435
|
+
numberOfWeeks?: number;
|
|
425
436
|
/**
|
|
426
437
|
* Last weekday of a `custom` partial-week view (0–6). When set, `custom` shows
|
|
427
438
|
* `weekStartsOn`…`weekEndsOn` of the visible week and pages by week, taking
|
|
@@ -619,8 +630,21 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
619
630
|
* ```
|
|
620
631
|
*/
|
|
621
632
|
export declare const Calendar: <T>(props: CalendarProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
622
|
-
|
|
623
|
-
|
|
633
|
+
/** Props for the consecutive full-week event grid. */
|
|
634
|
+
type MultiWeekViewProps<T = unknown> = Omit<MonthViewProps<T>, "date" | "weekStartsOn" | "showSixWeeks" | "showAdjacentMonths"> & {
|
|
635
|
+
/** Any day in the first displayed week. */
|
|
636
|
+
date: Date;
|
|
637
|
+
/** Positive whole number of week rows (default 2). Invalid values throw RangeError. */
|
|
638
|
+
numberOfWeeks?: number;
|
|
639
|
+
/** First weekday, Sunday = 0 (default). */
|
|
640
|
+
weekStartsOn?: WeekStartsOn$1;
|
|
641
|
+
};
|
|
642
|
+
/**
|
|
643
|
+
* Consecutive full weeks with event bars and no hourly slots. Rows scroll
|
|
644
|
+
* vertically when they cannot fit. Expand recurring events before passing them,
|
|
645
|
+
* or use Calendar with mode="multiweek" for recurrence and swipe paging.
|
|
646
|
+
*/
|
|
647
|
+
export declare function MultiWeekView<T = unknown>({ date, numberOfWeeks, weekStartsOn, ...rest }: MultiWeekViewProps<T>): ReactElement;
|
|
624
648
|
/**
|
|
625
649
|
* The built-in event renderer: a filled, rounded box showing the event title
|
|
626
650
|
* and (on the day/week grid, when the box is tall enough) its time range. The
|
|
@@ -630,8 +654,6 @@ export declare const Calendar: <T>(props: CalendarProps<T> & RefAttributes<Calen
|
|
|
630
654
|
* `renderEvent` to `<Calendar>` to replace it entirely.
|
|
631
655
|
*/
|
|
632
656
|
export declare function DefaultEvent<T>({ event, mode, boxHeight, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, accessibilityActions, onAccessibilityAction, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region src/components/ResourceTimeline.d.ts
|
|
635
657
|
/** A schedulable lane (room, person, machine) events are grouped under. */
|
|
636
658
|
interface Resource {
|
|
637
659
|
/** Stable id events reference via their `resourceId`. */
|
|
@@ -725,6 +747,19 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
725
747
|
* event; called with the swept start/end and the lane's resource.
|
|
726
748
|
*/
|
|
727
749
|
onCreateEvent?: (start: Date, end: Date, resource: Resource) => void;
|
|
750
|
+
/**
|
|
751
|
+
* A component that draws content inside the drag-to-create preview, such as a
|
|
752
|
+
* draft title and the live time range. It receives the snapped `start` and
|
|
753
|
+
* `end` that `onCreateEvent` would get if the sweep ended now, plus the lane's
|
|
754
|
+
* resource, and re-renders when the sweep crosses a snap step. The board keeps
|
|
755
|
+
* positioning, sizing and styling the preview on the UI thread and clips the
|
|
756
|
+
* content to it; the content is non-interactive and hidden from screen
|
|
757
|
+
* readers. Renders only while a sweep can create, so it needs `onCreateEvent`
|
|
758
|
+
* and does not enable creation itself. Applies to both orientations.
|
|
759
|
+
*/
|
|
760
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs$1 & {
|
|
761
|
+
resource: Resource;
|
|
762
|
+
}>;
|
|
728
763
|
/**
|
|
729
764
|
* Shade the hours outside this window, per lane. Same shape as the Calendar's
|
|
730
765
|
* `businessHours` plus the lane's resource, so per-resource opening hours work
|
|
@@ -777,6 +812,5 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
777
812
|
* />
|
|
778
813
|
* ```
|
|
779
814
|
*/
|
|
780
|
-
export declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, businessHours, renderBusinessHours, renderResourceHeader, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, labels: labelsProp }: ResourceTimelineProps<T>): ReactElement;
|
|
781
|
-
|
|
782
|
-
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, type CalendarHandle, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSlot, type CalendarTheme, CalendarThemeProvider, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultMonthEvent, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type EventDragHandler, type EventDragStartHandler, type EventKeyExtractor, type HourRenderer, type ICalEvent, type ICalendarEvent, type MonthEventSegment, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type PartialCalendarTheme, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type RenderEvent, type RenderEventArgs, type ResolvedSlot, type Resource, type ResourceEventArgs, type ResourceTimelineProps, 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, buildMonthWeeks, darkTheme, daySelectionState, defaultCalendarLabels, defaultTheme, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, mergeTheme, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|
|
815
|
+
export declare function ResourceTimeline<T = unknown>({ date, orientation, resources: allResources, resourcesPerPage, resourcePage, events, resourceId, startHour, endHour, hourWidth, hourHeight, rowHeight, labelWidth, ampm, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, renderCreateGhost, businessHours, renderBusinessHours, renderResourceHeader, dragStepMinutes, showNowIndicator, now: nowProp, timeZone, labels: labelsProp }: ResourceTimelineProps<T>): ReactElement;
|
|
816
|
+
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, type CalendarHandle, type CalendarLabels, type CalendarMode, type CalendarProps, type CalendarSlot, type CalendarTheme, CalendarThemeProvider, type CreateGhostArgs, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultMonthEvent, type EventAccessibilityLabelContext, type EventAccessibilityLabeler, type EventDragHandler, type EventDragStartHandler, type EventKeyExtractor, type HourRenderer, type ICalEvent, type ICalendarEvent, type MonthEventSegment, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, type MonthListSlot, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type MonthViewSlot, type MonthWeekEvents, type MultiWeekGrid, type MultiWeekGridDay, type MultiWeekGridInterval, type MultiWeekGridOptions, type MultiWeekGridWeek, type MultiWeekViewProps, type PartialCalendarTheme, type PositionedEvent, type RecurrenceFrequency, type RecurrenceRule, type RenderEvent, type RenderEventArgs, type ResolvedSlot, type Resource, type ResourceEventArgs, type ResourceTimelineProps, 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, buildMonthWeeks, buildMultiWeekGrid, darkTheme, daySelectionState, defaultCalendarLabels, defaultTheme, eventsInTimeZone, expandRecurringEvents, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, mergeTheme, minutesIntoDay, nextDateRange, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken };
|