@super-calendar/native 2.16.0 → 2.18.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 +59 -0
- package/dist/{DefaultMonthEvent-ClIxUp__.d.ts → DefaultMonthEvent-B7xVeY7Q.d.ts} +29 -10
- package/dist/{DefaultMonthEvent-No5YhOcV.d.mts → DefaultMonthEvent-hGk7wSrr.d.mts} +29 -10
- package/dist/{MonthList-Dmp8JXvj.js → MonthList-C_NTufaK.js} +462 -92
- package/dist/{MonthList-D97JhM4F.mjs → MonthList-DdQxRhUy.mjs} +453 -95
- package/dist/index.d.mts +54 -13
- package/dist/index.d.ts +54 -13
- package/dist/index.js +245 -72
- package/dist/index.mjs +210 -74
- 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/Agenda.tsx +19 -2
- package/src/components/AllDayLane.tsx +64 -37
- package/src/components/Calendar.tsx +173 -34
- package/src/components/MonthPager.tsx +212 -21
- package/src/components/MonthView.tsx +419 -118
- package/src/components/MultiWeekView.tsx +34 -0
- package/src/components/TimeGrid.tsx +60 -11
- package/src/components/YearView.tsx +12 -1
- package/src/index.tsx +17 -2
- package/src/types.ts +2 -2
- package/src/utils/holdWebDateDrag.ts +63 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
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-hGk7wSrr.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, CreateGhostArgs as CreateGhostArgs$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, ExpandRecurringEventsOptions, 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, fromZonedRange, fromZonedTime, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, nowInTimeZone, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken, zonedDragBounds, zonedEventSource } from "@super-calendar/core";
|
|
6
6
|
import { ScrollViewProps, StyleProp, ViewStyle } from "react-native";
|
|
7
7
|
/**
|
|
8
8
|
* The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
|
|
@@ -21,6 +21,13 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
21
21
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
22
22
|
hiddenDays?: number[];
|
|
23
23
|
locale?: Locale;
|
|
24
|
+
/**
|
|
25
|
+
* The instant whose calendar day is highlighted as today. Defaults to the
|
|
26
|
+
* device clock, and is read in `timeZone` when one is set.
|
|
27
|
+
*/
|
|
28
|
+
now?: Date;
|
|
29
|
+
/** Highlight today as it is in this IANA time zone (default: the device's). */
|
|
30
|
+
timeZone?: string;
|
|
24
31
|
/** Translations for the screen-reader words; omitted keys use English. */
|
|
25
32
|
labels?: Partial<CalendarLabels$1>;
|
|
26
33
|
/** Highlight this date instead of the real "today". */
|
|
@@ -63,7 +70,7 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
63
70
|
/** Pull-to-refresh control, mounted on the year's scroll view. */
|
|
64
71
|
refreshControl?: ScrollViewProps["refreshControl"];
|
|
65
72
|
};
|
|
66
|
-
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, labels: labelsProp, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, refreshControl, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
73
|
+
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, now, timeZone, labels: labelsProp, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, refreshControl, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
67
74
|
/**
|
|
68
75
|
* A year at a glance: the twelve months as compact mini grids, with today
|
|
69
76
|
* highlighted and a dot under days that hold events. Tap a day or a month
|
|
@@ -92,6 +99,13 @@ type AgendaSlot = "dayHeader" | "eventRow" | "empty";
|
|
|
92
99
|
type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
93
100
|
events: CalendarEvent<T>[];
|
|
94
101
|
locale?: Locale;
|
|
102
|
+
/**
|
|
103
|
+
* The instant whose calendar day is highlighted as today. Defaults to the
|
|
104
|
+
* device clock, and is read in `timeZone` when one is set.
|
|
105
|
+
*/
|
|
106
|
+
now?: Date;
|
|
107
|
+
/** Highlight today as it is in this IANA time zone (default: the device's). */
|
|
108
|
+
timeZone?: string;
|
|
95
109
|
renderEvent: RenderEvent<T>;
|
|
96
110
|
keyExtractor: EventKeyExtractor<T>;
|
|
97
111
|
onPressEvent: (event: CalendarEvent<T>) => void;
|
|
@@ -109,7 +123,7 @@ type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
|
109
123
|
* start, grouped under a date header per day. The consumer controls which
|
|
110
124
|
* events (and therefore which date range) are shown.
|
|
111
125
|
*/
|
|
112
|
-
export declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
126
|
+
export declare function Agenda<T>({ events, locale, now, timeZone, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
113
127
|
/** Default height in pixels of one hour row on the time grid. */
|
|
114
128
|
export declare const DEFAULT_HOUR_HEIGHT = 48;
|
|
115
129
|
/** Replace the hour-axis label. Receives the hour (0–23) and the `ampm` flag. */
|
|
@@ -138,9 +152,15 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
138
152
|
weekEndsOn?: WeekStartsOn;
|
|
139
153
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
140
154
|
hiddenDays?: number[];
|
|
141
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Fixed "now" instant for the indicator (doesn't tick) and for the day
|
|
157
|
+
* highlighted as today. Defaults to the device clock.
|
|
158
|
+
*/
|
|
142
159
|
now?: Date;
|
|
143
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* Shift the now indicator and the day highlighted as today into this IANA zone
|
|
162
|
+
* (pair with `eventsInTimeZone`).
|
|
163
|
+
*/
|
|
144
164
|
timeZone?: string;
|
|
145
165
|
date: Date;
|
|
146
166
|
events: CalendarEvent<T>[];
|
|
@@ -369,8 +389,9 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
369
389
|
*/
|
|
370
390
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
371
391
|
/**
|
|
372
|
-
*
|
|
373
|
-
*
|
|
392
|
+
* Content inside the drag-to-create preview in time grids, month, and multiweek.
|
|
393
|
+
* Month grids receive an all-day range with an exclusive end, repeated for
|
|
394
|
+
* each row the span covers. Requires `onCreateEvent`.
|
|
374
395
|
*/
|
|
375
396
|
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
376
397
|
/**
|
|
@@ -422,15 +443,18 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
422
443
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
423
444
|
hiddenDays?: number[];
|
|
424
445
|
/**
|
|
425
|
-
* Fixed "now" instant for the current-time indicator (doesn't tick)
|
|
426
|
-
*
|
|
427
|
-
*
|
|
446
|
+
* Fixed "now" instant for the current-time indicator (doesn't tick) and for
|
|
447
|
+
* the day highlighted as today in every mode, e.g. a server-synced clock.
|
|
448
|
+
* Defaults to the device clock, shifted into `timeZone` when one is set so
|
|
449
|
+
* both match the displayed events.
|
|
428
450
|
*/
|
|
429
451
|
now?: Date;
|
|
430
452
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
431
453
|
weekdayFormat?: WeekdayFormat$1;
|
|
432
454
|
/** Number of day columns when `mode="custom"`. Ignored by other modes. Default 1. */
|
|
433
455
|
numberOfDays?: number;
|
|
456
|
+
/** Consecutive full week rows for `mode="multiweek"` (default 2). */
|
|
457
|
+
numberOfWeeks?: number;
|
|
434
458
|
/**
|
|
435
459
|
* Last weekday of a `custom` partial-week view (0–6). When set, `custom` shows
|
|
436
460
|
* `weekStartsOn`…`weekEndsOn` of the visible week and pages by week, taking
|
|
@@ -571,7 +595,9 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
571
595
|
/**
|
|
572
596
|
* Display events in this IANA time zone (e.g. `"America/New_York"`), DST-correct
|
|
573
597
|
* and independent of the device zone. Display-only: it shifts the wall-clock the
|
|
574
|
-
* grid lays out from, it doesn't change your `Date`s
|
|
598
|
+
* grid lays out from, it doesn't change your `Date`s, and callbacks report your
|
|
599
|
+
* own events and real instants. All-day events stay on their days. Uses
|
|
600
|
+
* `eventsInTimeZone`.
|
|
575
601
|
*/
|
|
576
602
|
timeZone?: string;
|
|
577
603
|
/** Highlight this date (header/cell/agenda) instead of the real "today". */
|
|
@@ -628,6 +654,21 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
628
654
|
* ```
|
|
629
655
|
*/
|
|
630
656
|
export declare const Calendar: <T>(props: CalendarProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
657
|
+
/** Props for the consecutive full-week event grid. */
|
|
658
|
+
type MultiWeekViewProps<T = unknown> = Omit<MonthViewProps<T>, "date" | "weekStartsOn" | "showSixWeeks" | "showAdjacentMonths"> & {
|
|
659
|
+
/** Any day in the first displayed week. */
|
|
660
|
+
date: Date;
|
|
661
|
+
/** Positive whole number of week rows (default 2). Invalid values throw RangeError. */
|
|
662
|
+
numberOfWeeks?: number;
|
|
663
|
+
/** First weekday, Sunday = 0 (default). */
|
|
664
|
+
weekStartsOn?: WeekStartsOn$1;
|
|
665
|
+
};
|
|
666
|
+
/**
|
|
667
|
+
* Consecutive full weeks with event bars and no hourly slots. Rows scroll
|
|
668
|
+
* vertically when they cannot fit. Expand recurring events before passing them,
|
|
669
|
+
* or use Calendar with mode="multiweek" for recurrence and swipe paging.
|
|
670
|
+
*/
|
|
671
|
+
export declare function MultiWeekView<T = unknown>({ date, numberOfWeeks, weekStartsOn, ...rest }: MultiWeekViewProps<T>): ReactElement;
|
|
631
672
|
/**
|
|
632
673
|
* The built-in event renderer: a filled, rounded box showing the event title
|
|
633
674
|
* and (on the day/week grid, when the box is tall enough) its time range. The
|
|
@@ -796,4 +837,4 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
796
837
|
* ```
|
|
797
838
|
*/
|
|
798
839
|
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;
|
|
799
|
-
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 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 };
|
|
840
|
+
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 ExpandRecurringEventsOptions, 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, fromZonedRange, fromZonedTime, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, mergeTheme, minutesIntoDay, nextDateRange, nowInTimeZone, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken, zonedDragBounds, zonedEventSource };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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-
|
|
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-B7xVeY7Q.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, CreateGhostArgs as CreateGhostArgs$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";
|
|
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, ExpandRecurringEventsOptions, 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, fromZonedRange, fromZonedTime, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, minutesIntoDay, nextDateRange, nowInTimeZone, parseICalendar, toICalendar, toZonedTime, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken, zonedDragBounds, zonedEventSource } from "@super-calendar/core";
|
|
7
7
|
/**
|
|
8
8
|
* The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
|
|
9
9
|
* text/marker inside a day cell (React Native text colour doesn't inherit);
|
|
@@ -21,6 +21,13 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
21
21
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
22
22
|
hiddenDays?: number[];
|
|
23
23
|
locale?: Locale;
|
|
24
|
+
/**
|
|
25
|
+
* The instant whose calendar day is highlighted as today. Defaults to the
|
|
26
|
+
* device clock, and is read in `timeZone` when one is set.
|
|
27
|
+
*/
|
|
28
|
+
now?: Date;
|
|
29
|
+
/** Highlight today as it is in this IANA time zone (default: the device's). */
|
|
30
|
+
timeZone?: string;
|
|
24
31
|
/** Translations for the screen-reader words; omitted keys use English. */
|
|
25
32
|
labels?: Partial<CalendarLabels$1>;
|
|
26
33
|
/** Highlight this date instead of the real "today". */
|
|
@@ -63,7 +70,7 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
63
70
|
/** Pull-to-refresh control, mounted on the year's scroll view. */
|
|
64
71
|
refreshControl?: ScrollViewProps["refreshControl"];
|
|
65
72
|
};
|
|
66
|
-
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, labels: labelsProp, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, refreshControl, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
73
|
+
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, now, timeZone, labels: labelsProp, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, refreshControl, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
67
74
|
/**
|
|
68
75
|
* A year at a glance: the twelve months as compact mini grids, with today
|
|
69
76
|
* highlighted and a dot under days that hold events. Tap a day or a month
|
|
@@ -92,6 +99,13 @@ type AgendaSlot = "dayHeader" | "eventRow" | "empty";
|
|
|
92
99
|
type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
93
100
|
events: CalendarEvent<T>[];
|
|
94
101
|
locale?: Locale;
|
|
102
|
+
/**
|
|
103
|
+
* The instant whose calendar day is highlighted as today. Defaults to the
|
|
104
|
+
* device clock, and is read in `timeZone` when one is set.
|
|
105
|
+
*/
|
|
106
|
+
now?: Date;
|
|
107
|
+
/** Highlight today as it is in this IANA time zone (default: the device's). */
|
|
108
|
+
timeZone?: string;
|
|
95
109
|
renderEvent: RenderEvent<T>;
|
|
96
110
|
keyExtractor: EventKeyExtractor<T>;
|
|
97
111
|
onPressEvent: (event: CalendarEvent<T>) => void;
|
|
@@ -109,7 +123,7 @@ type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
|
109
123
|
* start, grouped under a date header per day. The consumer controls which
|
|
110
124
|
* events (and therefore which date range) are shown.
|
|
111
125
|
*/
|
|
112
|
-
export declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
126
|
+
export declare function Agenda<T>({ events, locale, now, timeZone, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
113
127
|
/** Default height in pixels of one hour row on the time grid. */
|
|
114
128
|
export declare const DEFAULT_HOUR_HEIGHT = 48;
|
|
115
129
|
/** Replace the hour-axis label. Receives the hour (0–23) and the `ampm` flag. */
|
|
@@ -138,9 +152,15 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
138
152
|
weekEndsOn?: WeekStartsOn;
|
|
139
153
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
140
154
|
hiddenDays?: number[];
|
|
141
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Fixed "now" instant for the indicator (doesn't tick) and for the day
|
|
157
|
+
* highlighted as today. Defaults to the device clock.
|
|
158
|
+
*/
|
|
142
159
|
now?: Date;
|
|
143
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* Shift the now indicator and the day highlighted as today into this IANA zone
|
|
162
|
+
* (pair with `eventsInTimeZone`).
|
|
163
|
+
*/
|
|
144
164
|
timeZone?: string;
|
|
145
165
|
date: Date;
|
|
146
166
|
events: CalendarEvent<T>[];
|
|
@@ -369,8 +389,9 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
369
389
|
*/
|
|
370
390
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
371
391
|
/**
|
|
372
|
-
*
|
|
373
|
-
*
|
|
392
|
+
* Content inside the drag-to-create preview in time grids, month, and multiweek.
|
|
393
|
+
* Month grids receive an all-day range with an exclusive end, repeated for
|
|
394
|
+
* each row the span covers. Requires `onCreateEvent`.
|
|
374
395
|
*/
|
|
375
396
|
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
376
397
|
/**
|
|
@@ -422,15 +443,18 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
422
443
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
423
444
|
hiddenDays?: number[];
|
|
424
445
|
/**
|
|
425
|
-
* Fixed "now" instant for the current-time indicator (doesn't tick)
|
|
426
|
-
*
|
|
427
|
-
*
|
|
446
|
+
* Fixed "now" instant for the current-time indicator (doesn't tick) and for
|
|
447
|
+
* the day highlighted as today in every mode, e.g. a server-synced clock.
|
|
448
|
+
* Defaults to the device clock, shifted into `timeZone` when one is set so
|
|
449
|
+
* both match the displayed events.
|
|
428
450
|
*/
|
|
429
451
|
now?: Date;
|
|
430
452
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
431
453
|
weekdayFormat?: WeekdayFormat$1;
|
|
432
454
|
/** Number of day columns when `mode="custom"`. Ignored by other modes. Default 1. */
|
|
433
455
|
numberOfDays?: number;
|
|
456
|
+
/** Consecutive full week rows for `mode="multiweek"` (default 2). */
|
|
457
|
+
numberOfWeeks?: number;
|
|
434
458
|
/**
|
|
435
459
|
* Last weekday of a `custom` partial-week view (0–6). When set, `custom` shows
|
|
436
460
|
* `weekStartsOn`…`weekEndsOn` of the visible week and pages by week, taking
|
|
@@ -571,7 +595,9 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
571
595
|
/**
|
|
572
596
|
* Display events in this IANA time zone (e.g. `"America/New_York"`), DST-correct
|
|
573
597
|
* and independent of the device zone. Display-only: it shifts the wall-clock the
|
|
574
|
-
* grid lays out from, it doesn't change your `Date`s
|
|
598
|
+
* grid lays out from, it doesn't change your `Date`s, and callbacks report your
|
|
599
|
+
* own events and real instants. All-day events stay on their days. Uses
|
|
600
|
+
* `eventsInTimeZone`.
|
|
575
601
|
*/
|
|
576
602
|
timeZone?: string;
|
|
577
603
|
/** Highlight this date (header/cell/agenda) instead of the real "today". */
|
|
@@ -628,6 +654,21 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
628
654
|
* ```
|
|
629
655
|
*/
|
|
630
656
|
export declare const Calendar: <T>(props: CalendarProps<T> & RefAttributes<CalendarHandle$1>) => ReactElement;
|
|
657
|
+
/** Props for the consecutive full-week event grid. */
|
|
658
|
+
type MultiWeekViewProps<T = unknown> = Omit<MonthViewProps<T>, "date" | "weekStartsOn" | "showSixWeeks" | "showAdjacentMonths"> & {
|
|
659
|
+
/** Any day in the first displayed week. */
|
|
660
|
+
date: Date;
|
|
661
|
+
/** Positive whole number of week rows (default 2). Invalid values throw RangeError. */
|
|
662
|
+
numberOfWeeks?: number;
|
|
663
|
+
/** First weekday, Sunday = 0 (default). */
|
|
664
|
+
weekStartsOn?: WeekStartsOn$1;
|
|
665
|
+
};
|
|
666
|
+
/**
|
|
667
|
+
* Consecutive full weeks with event bars and no hourly slots. Rows scroll
|
|
668
|
+
* vertically when they cannot fit. Expand recurring events before passing them,
|
|
669
|
+
* or use Calendar with mode="multiweek" for recurrence and swipe paging.
|
|
670
|
+
*/
|
|
671
|
+
export declare function MultiWeekView<T = unknown>({ date, numberOfWeeks, weekStartsOn, ...rest }: MultiWeekViewProps<T>): ReactElement;
|
|
631
672
|
/**
|
|
632
673
|
* The built-in event renderer: a filled, rounded box showing the event title
|
|
633
674
|
* and (on the day/week grid, when the box is tall enough) its time range. The
|
|
@@ -796,4 +837,4 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
796
837
|
* ```
|
|
797
838
|
*/
|
|
798
839
|
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;
|
|
799
|
-
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 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 };
|
|
840
|
+
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 ExpandRecurringEventsOptions, 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, fromZonedRange, fromZonedTime, getIsToday, getViewDays, getWeekDays, isAllDayEvent, isBackgroundEvent, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, layoutDayEvents, layoutMonthWeek, mergeTheme, minutesIntoDay, nextDateRange, nowInTimeZone, parseICalendar, toICalendar, toZonedTime, useCalendarTheme, useDateRange, useEventSource, useMonthGrid, useNow, weekdayFormatToken, zonedDragBounds, zonedEventSource };
|