@super-calendar/native 2.10.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{DefaultMonthEvent--9Jg6w-x.d.ts → DefaultMonthEvent-B9KzVzFa.d.mts} +11 -5
- package/dist/{DefaultMonthEvent-BlnKHaq2.d.mts → DefaultMonthEvent-DlIIWDzr.d.ts} +11 -5
- package/dist/{MonthList-CjKhzOJX.mjs → MonthList-B-UE37ZG.mjs} +166 -139
- package/dist/{MonthList-DNT1LJkk.js → MonthList-sGAZxQZ_.js} +176 -137
- package/dist/index.d.mts +67 -21
- package/dist/index.d.ts +67 -21
- package/dist/index.js +1121 -772
- package/dist/index.mjs +1117 -774
- 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 +3 -3
- package/src/components/Agenda.tsx +5 -1
- package/src/components/AllDayLane.tsx +36 -53
- package/src/components/Calendar.tsx +196 -149
- package/src/components/DefaultEvent.tsx +3 -0
- package/src/components/DefaultMonthEvent.tsx +3 -0
- package/src/components/MonthList.tsx +6 -0
- package/src/components/MonthPager.tsx +6 -0
- package/src/components/MonthView.tsx +195 -172
- package/src/components/MultiDayMovePreview.tsx +1 -3
- package/src/components/ResourceTimeline.tsx +18 -7
- package/src/components/TimeGrid.tsx +1409 -903
- package/src/components/YearView.tsx +22 -5
- package/src/index.tsx +1 -0
- package/src/utils/labels.ts +13 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as CalendarTheme, C as RecurrenceFrequency, D as TimeGridMode, E as RenderEventArgs, F as mergeTheme, I as useCalendarTheme, M as PartialCalendarTheme, N as darkTheme, O as WeekStartsOn, P as defaultTheme, S as ICalendarEvent, T as RenderEvent, _ as EventAccessibilityLabelContext, a as MonthPager, b as EventDragStartHandler, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as CalendarThemeProvider, k as WeekdayFormat, 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 EventAccessibilityLabeler, w as RecurrenceRule, x as EventKeyExtractor, y as EventDragHandler } from "./DefaultMonthEvent-
|
|
1
|
+
import { A as CalendarTheme, C as RecurrenceFrequency, D as TimeGridMode, E as RenderEventArgs, F as mergeTheme, I as useCalendarTheme, M as PartialCalendarTheme, N as darkTheme, O as WeekStartsOn, P as defaultTheme, S as ICalendarEvent, T as RenderEvent, _ as EventAccessibilityLabelContext, a as MonthPager, b as EventDragStartHandler, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as CalendarThemeProvider, k as WeekdayFormat, 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 EventAccessibilityLabeler, w as RecurrenceRule, x as EventKeyExtractor, y as EventDragHandler } from "./DefaultMonthEvent-B9KzVzFa.mjs";
|
|
2
2
|
import { Locale } from "date-fns";
|
|
3
3
|
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
4
4
|
import { SharedValue, useSharedValue } from "react-native-reanimated";
|
|
5
|
-
import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$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, 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 { StyleProp, ViewStyle } from "react-native";
|
|
5
|
+
import { BusinessHoursBand as BusinessHoursBand$1, BusinessHoursValue, CalendarEvent as CalendarEvent$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";
|
|
6
|
+
import { ScrollViewProps, StyleProp, ViewStyle } from "react-native";
|
|
7
7
|
//#region src/components/YearView.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
|
|
@@ -22,6 +22,8 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
22
22
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
23
23
|
hiddenDays?: number[];
|
|
24
24
|
locale?: Locale;
|
|
25
|
+
/** Translations for the screen-reader words; omitted keys use English. */
|
|
26
|
+
labels?: Partial<CalendarLabels$1>;
|
|
25
27
|
/** Highlight this date instead of the real "today". */
|
|
26
28
|
activeDate?: Date;
|
|
27
29
|
/** A selected span: endpoints get a filled badge, the days between get the range band. */
|
|
@@ -59,8 +61,10 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
59
61
|
* the last, exclusive). A plain tap still fires `onPressDay`, not this.
|
|
60
62
|
*/
|
|
61
63
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
64
|
+
/** Pull-to-refresh control, mounted on the year's scroll view. */
|
|
65
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
62
66
|
};
|
|
63
|
-
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
67
|
+
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;
|
|
64
68
|
/**
|
|
65
69
|
* A year at a glance: the twelve months as compact mini grids, with today
|
|
66
70
|
* highlighted and a dot under days that hold events. Tap a day or a month
|
|
@@ -79,7 +83,7 @@ declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, loca
|
|
|
79
83
|
* />
|
|
80
84
|
* ```
|
|
81
85
|
*/
|
|
82
|
-
declare const YearView: typeof YearViewInner;
|
|
86
|
+
export declare const YearView: typeof YearViewInner;
|
|
83
87
|
//#endregion
|
|
84
88
|
//#region src/components/Agenda.d.ts
|
|
85
89
|
/**
|
|
@@ -100,17 +104,19 @@ type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
|
100
104
|
activeDate?: Date;
|
|
101
105
|
/** Drawn between rows of the agenda list. */
|
|
102
106
|
itemSeparatorComponent?: ComponentType<unknown> | null;
|
|
107
|
+
/** Pull-to-refresh control, mounted on the list's scroll view. */
|
|
108
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
103
109
|
};
|
|
104
110
|
/**
|
|
105
111
|
* A vertical, day-grouped list of events (no time grid). Events are sorted by
|
|
106
112
|
* start, grouped under a date header per day. The consumer controls which
|
|
107
113
|
* events (and therefore which date range) are shown.
|
|
108
114
|
*/
|
|
109
|
-
declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
115
|
+
export declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
110
116
|
//#endregion
|
|
111
117
|
//#region src/components/TimeGrid.d.ts
|
|
112
118
|
/** Default height in pixels of one hour row on the time grid. */
|
|
113
|
-
declare const DEFAULT_HOUR_HEIGHT = 48;
|
|
119
|
+
export declare const DEFAULT_HOUR_HEIGHT = 48;
|
|
114
120
|
/** Replace the hour-axis label. Receives the hour (0–23) and the `ampm` flag. */
|
|
115
121
|
type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
|
|
116
122
|
/**
|
|
@@ -118,12 +124,12 @@ type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
|
|
|
118
124
|
* where the structure matches; `columnHeaderDateText`, `weekendShade` and
|
|
119
125
|
* `daySeparator` are native-only (the dom grid styles those through its
|
|
120
126
|
* `dayColumn`/`columnHeaderDate` elements). Slots rendered as Reanimated views
|
|
121
|
-
* (`
|
|
122
|
-
* `
|
|
123
|
-
* `
|
|
124
|
-
*
|
|
127
|
+
* (`businessHours`, `weekendShade`, `daySeparator`, `event`,
|
|
128
|
+
* `nowIndicator`, `createGhost`) always honour the `styles` map; their
|
|
129
|
+
* `className` reaches the element but needs a Tailwind runtime that styles
|
|
130
|
+
* Animated components.
|
|
125
131
|
*/
|
|
126
|
-
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
132
|
+
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourGutter" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
127
133
|
/** Props for {@link TimeGrid}, the day/week timetable view. */
|
|
128
134
|
type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
129
135
|
mode: TimeGridMode;
|
|
@@ -149,6 +155,8 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
149
155
|
weekStartsOn: WeekStartsOn;
|
|
150
156
|
/** Column-header weekday label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
151
157
|
weekdayFormat?: WeekdayFormat$1;
|
|
158
|
+
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
159
|
+
labels?: Partial<CalendarLabels$1>;
|
|
152
160
|
renderEvent: RenderEvent<T>;
|
|
153
161
|
/**
|
|
154
162
|
* Override the screen-reader label for each event. Receives the event and a
|
|
@@ -165,6 +173,11 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
165
173
|
timeslots?: number;
|
|
166
174
|
/** Show the all-day lane above the grid. Default true. */
|
|
167
175
|
showAllDayEventCell?: boolean;
|
|
176
|
+
/** Pull-to-refresh control, mounted on the grid's vertical scroll view. */
|
|
177
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
178
|
+
/** Show the "all-day" text label in the hour column. Default false; the lane
|
|
179
|
+
* still reserves its row, it just isn't labelled. */
|
|
180
|
+
showAllDayLabel?: boolean;
|
|
168
181
|
/** Tint Saturday/Sunday columns with the weekend background. Default true. Set
|
|
169
182
|
* false to treat weekends like any other day. */
|
|
170
183
|
highlightWeekends?: boolean;
|
|
@@ -178,6 +191,8 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
178
191
|
* band stays non-interactive and hidden from assistive tech.
|
|
179
192
|
*/
|
|
180
193
|
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
194
|
+
/** A component that draws a background event's band; see `Calendar`. */
|
|
195
|
+
renderBackgroundEvent?: RenderEvent<T>;
|
|
181
196
|
/** Show the ISO week number in the header gutter. Default false. */
|
|
182
197
|
showWeekNumber?: boolean;
|
|
183
198
|
/** Element rendered between the day header and the grid. */
|
|
@@ -253,7 +268,7 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
253
268
|
/** Optional header above the grid (e.g. weekday labels). Rendered full-width. */
|
|
254
269
|
renderHeader?: (days: Date[]) => React.ReactNode;
|
|
255
270
|
};
|
|
256
|
-
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes, hourColumnWidth: hourColumnWidthProp, hideHours, timeslots, showAllDayEventCell, highlightWeekends, calendarCellStyle, businessHours, renderBusinessHours, showWeekNumber, headerComponent, minHour, maxHour, ampm, isRTL, minHourHeight, maxHourHeight, minEventHeight, eventGap, showNowIndicator, locale, freeSwipe, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, weekNumberPrefix, hiddenDays, now, timeZone, hourComponent, activeDate, resetPageOnPressCell, dragStepMinutes, showDragHandle, eventStartEditable, eventDurationEditable, eventOverlap, onPressEvent, onLongPressEvent, onDragEvent: onDragEventProp, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }: TimeGridProps<T>): ReactElement;
|
|
271
|
+
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, labels: labelsProp, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes, hourColumnWidth: hourColumnWidthProp, hideHours, timeslots, showAllDayEventCell, showAllDayLabel, refreshControl, highlightWeekends, calendarCellStyle, businessHours, renderBusinessHours, renderBackgroundEvent, showWeekNumber, headerComponent, minHour, maxHour, ampm, isRTL, minHourHeight, maxHourHeight, minEventHeight, eventGap, showNowIndicator, locale, freeSwipe, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, weekNumberPrefix, hiddenDays, now, timeZone, hourComponent, activeDate, resetPageOnPressCell, dragStepMinutes, showDragHandle, eventStartEditable, eventDurationEditable, eventOverlap, onPressEvent, onLongPressEvent, onDragEvent: onDragEventProp, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }: TimeGridProps<T>): ReactElement;
|
|
257
272
|
/**
|
|
258
273
|
* The timetable view used in day, 3days, week, and custom modes: an
|
|
259
274
|
* hour-by-hour grid with positioned event boxes, an all-day lane, pinch-to-zoom
|
|
@@ -273,7 +288,7 @@ declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events
|
|
|
273
288
|
* />
|
|
274
289
|
* ```
|
|
275
290
|
*/
|
|
276
|
-
declare const TimeGrid: typeof TimeGridInner;
|
|
291
|
+
export declare const TimeGrid: typeof TimeGridInner;
|
|
277
292
|
//#endregion
|
|
278
293
|
//#region src/components/Calendar.d.ts
|
|
279
294
|
/**
|
|
@@ -384,6 +399,8 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
384
399
|
sortedMonthView?: boolean;
|
|
385
400
|
/** Month overflow label template; `{moreCount}` is replaced. Default "{moreCount} More". */
|
|
386
401
|
moreLabel?: string;
|
|
402
|
+
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
403
|
+
labels?: Partial<CalendarLabels$1>;
|
|
387
404
|
/** Show dimmed adjacent-month days in the month grid. Default true. */
|
|
388
405
|
showAdjacentMonths?: boolean;
|
|
389
406
|
/** Ignore taps on month-cell events (day taps still fire). Default false. */
|
|
@@ -433,6 +450,18 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
433
450
|
* band stays non-interactive and hidden from assistive tech.
|
|
434
451
|
*/
|
|
435
452
|
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
453
|
+
/**
|
|
454
|
+
* Week/day grid only: a component that draws a `display: "background"` event's
|
|
455
|
+
* band in place of the themed shade. Rendered as a real component, like
|
|
456
|
+
* `renderEvent`, so it may use hooks. It receives `event`, `mode`, a live
|
|
457
|
+
* `boxHeight`, `continuesBefore` / `continuesAfter` for a multi-day event, and
|
|
458
|
+
* `onPress` / `onLongPress`, which fire `onPressEvent` / `onLongPressEvent`.
|
|
459
|
+
* The band lets touches through to what you render and stops hiding itself
|
|
460
|
+
* from assistive tech, so a pressable there works; cell presses and
|
|
461
|
+
* drag-to-create are unreachable underneath it. Without this prop the band
|
|
462
|
+
* stays a shaded, non-interactive range. The resource timeline keeps the shade.
|
|
463
|
+
*/
|
|
464
|
+
renderBackgroundEvent?: RenderEvent<T>;
|
|
436
465
|
/** Stable key per event. Defaults to start-time + index. */
|
|
437
466
|
keyExtractor?: EventKeyExtractor<T>;
|
|
438
467
|
/** Partial theme merged over the defaults. */
|
|
@@ -460,11 +489,26 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
460
489
|
/** Sub-hour divider lines per hour on the week/day grid (e.g. 2 = half-hours). Default 1. */
|
|
461
490
|
timeslots?: number;
|
|
462
491
|
/**
|
|
463
|
-
* Show the all-day lane above the week/day grid. Default true
|
|
464
|
-
*
|
|
465
|
-
*
|
|
492
|
+
* Show the all-day lane above the week/day grid. Default true: the lane is
|
|
493
|
+
* sized to the week's all-day events, collapsing to nothing when there are
|
|
494
|
+
* none, and its height follows the week as you swipe. When false the lane is
|
|
495
|
+
* never rendered, so
|
|
496
|
+
* all-day events (see `ICalendarEvent.allDay` and whole-day spans) are not
|
|
497
|
+
* shown on the time grid.
|
|
466
498
|
*/
|
|
467
499
|
showAllDayEventCell?: boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Show the "all-day" text label in the week/day hour column. Default false: a
|
|
502
|
+
* week with no all-day events then shows no lane at all, rather than a label
|
|
503
|
+
* beside an empty row; with the label on, it slides away with the lane.
|
|
504
|
+
*/
|
|
505
|
+
showAllDayLabel?: boolean;
|
|
506
|
+
/**
|
|
507
|
+
* Pull-to-refresh for the modes that scroll vertically: pass a `RefreshControl`
|
|
508
|
+
* element and it wraps the schedule list, the week/day grid's scroll view or
|
|
509
|
+
* the year view. Month pages scroll sideways, so it has no effect there.
|
|
510
|
+
*/
|
|
511
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
468
512
|
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
469
513
|
highlightWeekends?: boolean;
|
|
470
514
|
/** Allow moving events by default (per-event `startEditable` overrides). Default true. */
|
|
@@ -571,7 +615,7 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
571
615
|
* }
|
|
572
616
|
* ```
|
|
573
617
|
*/
|
|
574
|
-
declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onSelectDrag, selectedDates, selectedRange, fillCellOnSelection, minDate, maxDate, isDateDisabled, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, minEventHeight, eventGap, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, showTitle, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
|
|
618
|
+
export declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onSelectDrag, selectedDates, selectedRange, fillCellOnSelection, minDate, maxDate, isDateDisabled, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, labels, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, renderBackgroundEvent, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, minEventHeight, eventGap, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, showAllDayLabel, refreshControl, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, showTitle, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
|
|
575
619
|
//#endregion
|
|
576
620
|
//#region src/components/DefaultEvent.d.ts
|
|
577
621
|
/**
|
|
@@ -582,7 +626,7 @@ declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRan
|
|
|
582
626
|
* only shows once a full line is free beneath the title. Pass your own
|
|
583
627
|
* `renderEvent` to `<Calendar>` to replace it entirely.
|
|
584
628
|
*/
|
|
585
|
-
declare function DefaultEvent<T>({ event, mode, boxHeight, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, accessibilityActions, onAccessibilityAction, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
629
|
+
export declare function DefaultEvent<T>({ event, mode, boxHeight, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, accessibilityActions, onAccessibilityAction, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
586
630
|
//#endregion
|
|
587
631
|
//#region src/components/ResourceTimeline.d.ts
|
|
588
632
|
/** A schedulable lane (room, person, machine) events are grouped under. */
|
|
@@ -709,6 +753,8 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
709
753
|
now?: Date;
|
|
710
754
|
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
711
755
|
timeZone?: string;
|
|
756
|
+
/** Translations for the screen-reader drag actions; omitted keys use English. */
|
|
757
|
+
labels?: Partial<CalendarLabels$1>;
|
|
712
758
|
}
|
|
713
759
|
/**
|
|
714
760
|
* A horizontal resource timeline: rows are resources (rooms, people, machines)
|
|
@@ -728,6 +774,6 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
728
774
|
* />
|
|
729
775
|
* ```
|
|
730
776
|
*/
|
|
731
|
-
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 }: ResourceTimelineProps<T>): ReactElement;
|
|
777
|
+
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;
|
|
732
778
|
//#endregion
|
|
733
|
-
export {
|
|
779
|
+
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, 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 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as CalendarTheme, C as RecurrenceFrequency, D as TimeGridMode, E as RenderEventArgs, F as mergeTheme, I as useCalendarTheme, M as PartialCalendarTheme, N as darkTheme, O as WeekStartsOn, P as defaultTheme, S as ICalendarEvent, T as RenderEvent, _ as EventAccessibilityLabelContext, a as MonthPager, b as EventDragStartHandler, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as CalendarThemeProvider, k as WeekdayFormat, 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 EventAccessibilityLabeler, w as RecurrenceRule, x as EventKeyExtractor, y as EventDragHandler } from "./DefaultMonthEvent
|
|
1
|
+
import { A as CalendarTheme, C as RecurrenceFrequency, D as TimeGridMode, E as RenderEventArgs, F as mergeTheme, I as useCalendarTheme, M as PartialCalendarTheme, N as darkTheme, O as WeekStartsOn, P as defaultTheme, S as ICalendarEvent, T as RenderEvent, _ as EventAccessibilityLabelContext, a as MonthPager, b as EventDragStartHandler, c as MonthViewProps, d as SlotDefault, f as SlotStyleProps, g as CalendarMode, h as CalendarEvent, i as MonthListSlot, j as CalendarThemeProvider, k as WeekdayFormat, 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 EventAccessibilityLabeler, w as RecurrenceRule, x as EventKeyExtractor, y as EventDragHandler } from "./DefaultMonthEvent-DlIIWDzr.js";
|
|
2
2
|
import { Locale } from "date-fns";
|
|
3
3
|
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
4
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
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, 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, 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, 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
7
|
//#region src/components/YearView.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* The styleable parts of {@link YearView}. `dayText` and `eventDot` are the
|
|
@@ -22,6 +22,8 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
22
22
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
23
23
|
hiddenDays?: number[];
|
|
24
24
|
locale?: Locale;
|
|
25
|
+
/** Translations for the screen-reader words; omitted keys use English. */
|
|
26
|
+
labels?: Partial<CalendarLabels$1>;
|
|
25
27
|
/** Highlight this date instead of the real "today". */
|
|
26
28
|
activeDate?: Date;
|
|
27
29
|
/** A selected span: endpoints get a filled badge, the days between get the range band. */
|
|
@@ -59,8 +61,10 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
59
61
|
* the last, exclusive). A plain tap still fires `onPressDay`, not this.
|
|
60
62
|
*/
|
|
61
63
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
64
|
+
/** Pull-to-refresh control, mounted on the year's scroll view. */
|
|
65
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
62
66
|
};
|
|
63
|
-
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
67
|
+
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;
|
|
64
68
|
/**
|
|
65
69
|
* A year at a glance: the twelve months as compact mini grids, with today
|
|
66
70
|
* highlighted and a dot under days that hold events. Tap a day or a month
|
|
@@ -79,7 +83,7 @@ declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, loca
|
|
|
79
83
|
* />
|
|
80
84
|
* ```
|
|
81
85
|
*/
|
|
82
|
-
declare const YearView: typeof YearViewInner;
|
|
86
|
+
export declare const YearView: typeof YearViewInner;
|
|
83
87
|
//#endregion
|
|
84
88
|
//#region src/components/Agenda.d.ts
|
|
85
89
|
/**
|
|
@@ -100,17 +104,19 @@ type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
|
100
104
|
activeDate?: Date;
|
|
101
105
|
/** Drawn between rows of the agenda list. */
|
|
102
106
|
itemSeparatorComponent?: ComponentType<unknown> | null;
|
|
107
|
+
/** Pull-to-refresh control, mounted on the list's scroll view. */
|
|
108
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
103
109
|
};
|
|
104
110
|
/**
|
|
105
111
|
* A vertical, day-grouped list of events (no time grid). Events are sorted by
|
|
106
112
|
* start, grouped under a date header per day. The consumer controls which
|
|
107
113
|
* events (and therefore which date range) are shown.
|
|
108
114
|
*/
|
|
109
|
-
declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
115
|
+
export declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
110
116
|
//#endregion
|
|
111
117
|
//#region src/components/TimeGrid.d.ts
|
|
112
118
|
/** Default height in pixels of one hour row on the time grid. */
|
|
113
|
-
declare const DEFAULT_HOUR_HEIGHT = 48;
|
|
119
|
+
export declare const DEFAULT_HOUR_HEIGHT = 48;
|
|
114
120
|
/** Replace the hour-axis label. Receives the hour (0–23) and the `ampm` flag. */
|
|
115
121
|
type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
|
|
116
122
|
/**
|
|
@@ -118,12 +124,12 @@ type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
|
|
|
118
124
|
* where the structure matches; `columnHeaderDateText`, `weekendShade` and
|
|
119
125
|
* `daySeparator` are native-only (the dom grid styles those through its
|
|
120
126
|
* `dayColumn`/`columnHeaderDate` elements). Slots rendered as Reanimated views
|
|
121
|
-
* (`
|
|
122
|
-
* `
|
|
123
|
-
* `
|
|
124
|
-
*
|
|
127
|
+
* (`businessHours`, `weekendShade`, `daySeparator`, `event`,
|
|
128
|
+
* `nowIndicator`, `createGhost`) always honour the `styles` map; their
|
|
129
|
+
* `className` reaches the element but needs a Tailwind runtime that styles
|
|
130
|
+
* Animated components.
|
|
125
131
|
*/
|
|
126
|
-
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
132
|
+
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourGutter" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
127
133
|
/** Props for {@link TimeGrid}, the day/week timetable view. */
|
|
128
134
|
type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
129
135
|
mode: TimeGridMode;
|
|
@@ -149,6 +155,8 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
149
155
|
weekStartsOn: WeekStartsOn;
|
|
150
156
|
/** Column-header weekday label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
151
157
|
weekdayFormat?: WeekdayFormat$1;
|
|
158
|
+
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
159
|
+
labels?: Partial<CalendarLabels$1>;
|
|
152
160
|
renderEvent: RenderEvent<T>;
|
|
153
161
|
/**
|
|
154
162
|
* Override the screen-reader label for each event. Receives the event and a
|
|
@@ -165,6 +173,11 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
165
173
|
timeslots?: number;
|
|
166
174
|
/** Show the all-day lane above the grid. Default true. */
|
|
167
175
|
showAllDayEventCell?: boolean;
|
|
176
|
+
/** Pull-to-refresh control, mounted on the grid's vertical scroll view. */
|
|
177
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
178
|
+
/** Show the "all-day" text label in the hour column. Default false; the lane
|
|
179
|
+
* still reserves its row, it just isn't labelled. */
|
|
180
|
+
showAllDayLabel?: boolean;
|
|
168
181
|
/** Tint Saturday/Sunday columns with the weekend background. Default true. Set
|
|
169
182
|
* false to treat weekends like any other day. */
|
|
170
183
|
highlightWeekends?: boolean;
|
|
@@ -178,6 +191,8 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
178
191
|
* band stays non-interactive and hidden from assistive tech.
|
|
179
192
|
*/
|
|
180
193
|
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
194
|
+
/** A component that draws a background event's band; see `Calendar`. */
|
|
195
|
+
renderBackgroundEvent?: RenderEvent<T>;
|
|
181
196
|
/** Show the ISO week number in the header gutter. Default false. */
|
|
182
197
|
showWeekNumber?: boolean;
|
|
183
198
|
/** Element rendered between the day header and the grid. */
|
|
@@ -253,7 +268,7 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
253
268
|
/** Optional header above the grid (e.g. weekday labels). Rendered full-width. */
|
|
254
269
|
renderHeader?: (days: Date[]) => React.ReactNode;
|
|
255
270
|
};
|
|
256
|
-
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes, hourColumnWidth: hourColumnWidthProp, hideHours, timeslots, showAllDayEventCell, highlightWeekends, calendarCellStyle, businessHours, renderBusinessHours, showWeekNumber, headerComponent, minHour, maxHour, ampm, isRTL, minHourHeight, maxHourHeight, minEventHeight, eventGap, showNowIndicator, locale, freeSwipe, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, weekNumberPrefix, hiddenDays, now, timeZone, hourComponent, activeDate, resetPageOnPressCell, dragStepMinutes, showDragHandle, eventStartEditable, eventDurationEditable, eventOverlap, onPressEvent, onLongPressEvent, onDragEvent: onDragEventProp, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }: TimeGridProps<T>): ReactElement;
|
|
271
|
+
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, labels: labelsProp, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes, hourColumnWidth: hourColumnWidthProp, hideHours, timeslots, showAllDayEventCell, showAllDayLabel, refreshControl, highlightWeekends, calendarCellStyle, businessHours, renderBusinessHours, renderBackgroundEvent, showWeekNumber, headerComponent, minHour, maxHour, ampm, isRTL, minHourHeight, maxHourHeight, minEventHeight, eventGap, showNowIndicator, locale, freeSwipe, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, weekNumberPrefix, hiddenDays, now, timeZone, hourComponent, activeDate, resetPageOnPressCell, dragStepMinutes, showDragHandle, eventStartEditable, eventDurationEditable, eventOverlap, onPressEvent, onLongPressEvent, onDragEvent: onDragEventProp, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }: TimeGridProps<T>): ReactElement;
|
|
257
272
|
/**
|
|
258
273
|
* The timetable view used in day, 3days, week, and custom modes: an
|
|
259
274
|
* hour-by-hour grid with positioned event boxes, an all-day lane, pinch-to-zoom
|
|
@@ -273,7 +288,7 @@ declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events
|
|
|
273
288
|
* />
|
|
274
289
|
* ```
|
|
275
290
|
*/
|
|
276
|
-
declare const TimeGrid: typeof TimeGridInner;
|
|
291
|
+
export declare const TimeGrid: typeof TimeGridInner;
|
|
277
292
|
//#endregion
|
|
278
293
|
//#region src/components/Calendar.d.ts
|
|
279
294
|
/**
|
|
@@ -384,6 +399,8 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
384
399
|
sortedMonthView?: boolean;
|
|
385
400
|
/** Month overflow label template; `{moreCount}` is replaced. Default "{moreCount} More". */
|
|
386
401
|
moreLabel?: string;
|
|
402
|
+
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
403
|
+
labels?: Partial<CalendarLabels$1>;
|
|
387
404
|
/** Show dimmed adjacent-month days in the month grid. Default true. */
|
|
388
405
|
showAdjacentMonths?: boolean;
|
|
389
406
|
/** Ignore taps on month-cell events (day taps still fire). Default false. */
|
|
@@ -433,6 +450,18 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
433
450
|
* band stays non-interactive and hidden from assistive tech.
|
|
434
451
|
*/
|
|
435
452
|
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
453
|
+
/**
|
|
454
|
+
* Week/day grid only: a component that draws a `display: "background"` event's
|
|
455
|
+
* band in place of the themed shade. Rendered as a real component, like
|
|
456
|
+
* `renderEvent`, so it may use hooks. It receives `event`, `mode`, a live
|
|
457
|
+
* `boxHeight`, `continuesBefore` / `continuesAfter` for a multi-day event, and
|
|
458
|
+
* `onPress` / `onLongPress`, which fire `onPressEvent` / `onLongPressEvent`.
|
|
459
|
+
* The band lets touches through to what you render and stops hiding itself
|
|
460
|
+
* from assistive tech, so a pressable there works; cell presses and
|
|
461
|
+
* drag-to-create are unreachable underneath it. Without this prop the band
|
|
462
|
+
* stays a shaded, non-interactive range. The resource timeline keeps the shade.
|
|
463
|
+
*/
|
|
464
|
+
renderBackgroundEvent?: RenderEvent<T>;
|
|
436
465
|
/** Stable key per event. Defaults to start-time + index. */
|
|
437
466
|
keyExtractor?: EventKeyExtractor<T>;
|
|
438
467
|
/** Partial theme merged over the defaults. */
|
|
@@ -460,11 +489,26 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
460
489
|
/** Sub-hour divider lines per hour on the week/day grid (e.g. 2 = half-hours). Default 1. */
|
|
461
490
|
timeslots?: number;
|
|
462
491
|
/**
|
|
463
|
-
* Show the all-day lane above the week/day grid. Default true
|
|
464
|
-
*
|
|
465
|
-
*
|
|
492
|
+
* Show the all-day lane above the week/day grid. Default true: the lane is
|
|
493
|
+
* sized to the week's all-day events, collapsing to nothing when there are
|
|
494
|
+
* none, and its height follows the week as you swipe. When false the lane is
|
|
495
|
+
* never rendered, so
|
|
496
|
+
* all-day events (see `ICalendarEvent.allDay` and whole-day spans) are not
|
|
497
|
+
* shown on the time grid.
|
|
466
498
|
*/
|
|
467
499
|
showAllDayEventCell?: boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Show the "all-day" text label in the week/day hour column. Default false: a
|
|
502
|
+
* week with no all-day events then shows no lane at all, rather than a label
|
|
503
|
+
* beside an empty row; with the label on, it slides away with the lane.
|
|
504
|
+
*/
|
|
505
|
+
showAllDayLabel?: boolean;
|
|
506
|
+
/**
|
|
507
|
+
* Pull-to-refresh for the modes that scroll vertically: pass a `RefreshControl`
|
|
508
|
+
* element and it wraps the schedule list, the week/day grid's scroll view or
|
|
509
|
+
* the year view. Month pages scroll sideways, so it has no effect there.
|
|
510
|
+
*/
|
|
511
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
468
512
|
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
469
513
|
highlightWeekends?: boolean;
|
|
470
514
|
/** Allow moving events by default (per-event `startEditable` overrides). Default true. */
|
|
@@ -571,7 +615,7 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
571
615
|
* }
|
|
572
616
|
* ```
|
|
573
617
|
*/
|
|
574
|
-
declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onSelectDrag, selectedDates, selectedRange, fillCellOnSelection, minDate, maxDate, isDateDisabled, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, minEventHeight, eventGap, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, showTitle, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
|
|
618
|
+
export declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onSelectDrag, selectedDates, selectedRange, fillCellOnSelection, minDate, maxDate, isDateDisabled, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, labels, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, renderBackgroundEvent, keyExtractor, theme, cellHeight: cellHeightProp, hourHeight, minHourHeight, maxHourHeight, minEventHeight, eventGap, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, showAllDayLabel, refreshControl, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, showTitle, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }: CalendarProps<T>): ReactElement;
|
|
575
619
|
//#endregion
|
|
576
620
|
//#region src/components/DefaultEvent.d.ts
|
|
577
621
|
/**
|
|
@@ -582,7 +626,7 @@ declare function Calendar<T>({ events, mode, date, onChangeDate, onChangeDateRan
|
|
|
582
626
|
* only shows once a full line is free beneath the title. Pass your own
|
|
583
627
|
* `renderEvent` to `<Calendar>` to replace it entirely.
|
|
584
628
|
*/
|
|
585
|
-
declare function DefaultEvent<T>({ event, mode, boxHeight, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, accessibilityActions, onAccessibilityAction, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
629
|
+
export declare function DefaultEvent<T>({ event, mode, boxHeight, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, accessibilityActions, onAccessibilityAction, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
586
630
|
//#endregion
|
|
587
631
|
//#region src/components/ResourceTimeline.d.ts
|
|
588
632
|
/** A schedulable lane (room, person, machine) events are grouped under. */
|
|
@@ -709,6 +753,8 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
709
753
|
now?: Date;
|
|
710
754
|
/** Shift the now indicator into this IANA zone (pair with `eventsInTimeZone`). */
|
|
711
755
|
timeZone?: string;
|
|
756
|
+
/** Translations for the screen-reader drag actions; omitted keys use English. */
|
|
757
|
+
labels?: Partial<CalendarLabels$1>;
|
|
712
758
|
}
|
|
713
759
|
/**
|
|
714
760
|
* A horizontal resource timeline: rows are resources (rooms, people, machines)
|
|
@@ -728,6 +774,6 @@ interface ResourceTimelineProps<T = unknown> {
|
|
|
728
774
|
* />
|
|
729
775
|
* ```
|
|
730
776
|
*/
|
|
731
|
-
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 }: ResourceTimelineProps<T>): ReactElement;
|
|
777
|
+
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;
|
|
732
778
|
//#endregion
|
|
733
|
-
export {
|
|
779
|
+
export { type AgendaProps, type AgendaSlot, type BusinessHours, type BusinessHoursBand, type CalendarEvent, 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 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 };
|