@super-calendar/native 2.17.0 → 2.19.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 +23 -1
- package/dist/{DefaultMonthEvent-C3C30hfV.d.mts → DefaultMonthEvent-DzgQFuVp.d.mts} +47 -10
- package/dist/{DefaultMonthEvent-Dx3lD7ig.d.ts → DefaultMonthEvent-joYl8Tu2.d.ts} +47 -10
- package/dist/{MonthList-N1GVDIE4.mjs → MonthList-BGl1gTDr.mjs} +603 -97
- package/dist/{MonthList-B2TSGYp7.js → MonthList-DeO-x5VW.js} +601 -95
- package/dist/index.d.mts +40 -15
- package/dist/index.d.ts +40 -15
- package/dist/index.js +189 -63
- package/dist/index.mjs +161 -65
- 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 -3
- package/src/components/AllDayLane.tsx +64 -37
- package/src/components/Calendar.tsx +104 -30
- package/src/components/MonthCellProbe.tsx +201 -0
- package/src/components/MonthList.tsx +4 -2
- package/src/components/MonthPager.tsx +41 -4
- package/src/components/MonthView.tsx +597 -118
- package/src/components/ResourceTimeline.tsx +11 -2
- package/src/components/TimeGrid.tsx +82 -24
- package/src/components/YearView.tsx +12 -3
- package/src/index.tsx +11 -2
- package/src/types.ts +20 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as ScrollToTimeOptions, B as useCalendarTheme, C as EventKeyExtractor, D as RecurrenceRule, E as RecurrenceFrequency, F as CalendarThemeProvider, I as PartialCalendarTheme, L as darkTheme, M as WeekStartsOn, N as WeekdayFormat, O as RenderEvent, P as CalendarTheme, R as defaultTheme, S as EventDragStartHandler, T as MonthDateInfo, _ 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 TimeGridMode, k as RenderEventArgs, 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 mergeTheme } from "./DefaultMonthEvent-DzgQFuVp.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, 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";
|
|
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,9 +443,10 @@ 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"). */
|
|
@@ -573,7 +595,9 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
573
595
|
/**
|
|
574
596
|
* Display events in this IANA time zone (e.g. `"America/New_York"`), DST-correct
|
|
575
597
|
* and independent of the device zone. Display-only: it shifts the wall-clock the
|
|
576
|
-
* 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`.
|
|
577
601
|
*/
|
|
578
602
|
timeZone?: string;
|
|
579
603
|
/** Highlight this date (header/cell/agenda) instead of the real "today". */
|
|
@@ -596,10 +620,11 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
596
620
|
renderHeaderForMonthView?: (weekDays: Date[]) => React.ReactNode;
|
|
597
621
|
/**
|
|
598
622
|
* Month mode only: replace the default date badge in each day cell. Receives
|
|
599
|
-
* the day
|
|
623
|
+
* the day and its state (`isCurrentMonth`, `isToday`, `isSelected`,
|
|
624
|
+
* `isDisabled`); return your own date label (e.g. a number with a dot or badge).
|
|
600
625
|
* Event chips and the "+N more" label still render below it.
|
|
601
626
|
*/
|
|
602
|
-
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
627
|
+
renderCustomDateForMonth?: (date: Date, info: MonthDateInfo) => React.ReactNode;
|
|
603
628
|
/** Drawn between rows of the `schedule` (agenda) list. */
|
|
604
629
|
itemSeparatorComponent?: React.ComponentType<unknown> | null;
|
|
605
630
|
};
|
|
@@ -813,4 +838,4 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
813
838
|
* ```
|
|
814
839
|
*/
|
|
815
840
|
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 };
|
|
841
|
+
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 MonthDateInfo, 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
|
|
1
|
+
import { A as ScrollToTimeOptions, B as useCalendarTheme, C as EventKeyExtractor, D as RecurrenceRule, E as RecurrenceFrequency, F as CalendarThemeProvider, I as PartialCalendarTheme, L as darkTheme, M as WeekStartsOn, N as WeekdayFormat, O as RenderEvent, P as CalendarTheme, R as defaultTheme, S as EventDragStartHandler, T as MonthDateInfo, _ 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 TimeGridMode, k as RenderEventArgs, 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 mergeTheme } from "./DefaultMonthEvent-joYl8Tu2.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, 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
|
+
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,9 +443,10 @@ 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"). */
|
|
@@ -573,7 +595,9 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
573
595
|
/**
|
|
574
596
|
* Display events in this IANA time zone (e.g. `"America/New_York"`), DST-correct
|
|
575
597
|
* and independent of the device zone. Display-only: it shifts the wall-clock the
|
|
576
|
-
* 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`.
|
|
577
601
|
*/
|
|
578
602
|
timeZone?: string;
|
|
579
603
|
/** Highlight this date (header/cell/agenda) instead of the real "today". */
|
|
@@ -596,10 +620,11 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
596
620
|
renderHeaderForMonthView?: (weekDays: Date[]) => React.ReactNode;
|
|
597
621
|
/**
|
|
598
622
|
* Month mode only: replace the default date badge in each day cell. Receives
|
|
599
|
-
* the day
|
|
623
|
+
* the day and its state (`isCurrentMonth`, `isToday`, `isSelected`,
|
|
624
|
+
* `isDisabled`); return your own date label (e.g. a number with a dot or badge).
|
|
600
625
|
* Event chips and the "+N more" label still render below it.
|
|
601
626
|
*/
|
|
602
|
-
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
627
|
+
renderCustomDateForMonth?: (date: Date, info: MonthDateInfo) => React.ReactNode;
|
|
603
628
|
/** Drawn between rows of the `schedule` (agenda) list. */
|
|
604
629
|
itemSeparatorComponent?: React.ComponentType<unknown> | null;
|
|
605
630
|
};
|
|
@@ -813,4 +838,4 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
813
838
|
* ```
|
|
814
839
|
*/
|
|
815
840
|
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 };
|
|
841
|
+
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 MonthDateInfo, 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 };
|