@super-calendar/native 2.9.1 → 2.11.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/dist/index.d.mts +74 -13
- package/dist/index.d.ts +74 -13
- package/dist/index.js +939 -604
- package/dist/index.mjs +940 -605
- package/package.json +2 -2
- package/src/components/Agenda.tsx +5 -1
- package/src/components/AllDayLane.tsx +36 -53
- package/src/components/Calendar.tsx +54 -4
- package/src/components/MultiDayMovePreview.tsx +12 -9
- package/src/components/TimeGrid.tsx +1416 -887
- package/src/components/YearView.tsx +5 -0
package/dist/index.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { Locale } from "date-fns";
|
|
|
3
3
|
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
4
4
|
import { SharedValue, useSharedValue } from "react-native-reanimated";
|
|
5
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";
|
|
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
|
|
@@ -59,8 +59,10 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
59
59
|
* the last, exclusive). A plain tap still fires `onPressDay`, not this.
|
|
60
60
|
*/
|
|
61
61
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
62
|
+
/** Pull-to-refresh control, mounted on the year's scroll view. */
|
|
63
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
62
64
|
};
|
|
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;
|
|
65
|
+
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, refreshControl, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
64
66
|
/**
|
|
65
67
|
* A year at a glance: the twelve months as compact mini grids, with today
|
|
66
68
|
* highlighted and a dot under days that hold events. Tap a day or a month
|
|
@@ -100,13 +102,15 @@ type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
|
100
102
|
activeDate?: Date;
|
|
101
103
|
/** Drawn between rows of the agenda list. */
|
|
102
104
|
itemSeparatorComponent?: ComponentType<unknown> | null;
|
|
105
|
+
/** Pull-to-refresh control, mounted on the list's scroll view. */
|
|
106
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
103
107
|
};
|
|
104
108
|
/**
|
|
105
109
|
* A vertical, day-grouped list of events (no time grid). Events are sorted by
|
|
106
110
|
* start, grouped under a date header per day. The consumer controls which
|
|
107
111
|
* events (and therefore which date range) are shown.
|
|
108
112
|
*/
|
|
109
|
-
declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
113
|
+
declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
110
114
|
//#endregion
|
|
111
115
|
//#region src/components/TimeGrid.d.ts
|
|
112
116
|
/** Default height in pixels of one hour row on the time grid. */
|
|
@@ -118,12 +122,12 @@ type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
|
|
|
118
122
|
* where the structure matches; `columnHeaderDateText`, `weekendShade` and
|
|
119
123
|
* `daySeparator` are native-only (the dom grid styles those through its
|
|
120
124
|
* `dayColumn`/`columnHeaderDate` elements). Slots rendered as Reanimated views
|
|
121
|
-
* (`
|
|
122
|
-
* `
|
|
123
|
-
* `
|
|
124
|
-
*
|
|
125
|
+
* (`businessHours`, `weekendShade`, `daySeparator`, `event`,
|
|
126
|
+
* `nowIndicator`, `createGhost`) always honour the `styles` map; their
|
|
127
|
+
* `className` reaches the element but needs a Tailwind runtime that styles
|
|
128
|
+
* Animated components.
|
|
125
129
|
*/
|
|
126
|
-
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
130
|
+
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourGutter" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
127
131
|
/** Props for {@link TimeGrid}, the day/week timetable view. */
|
|
128
132
|
type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
129
133
|
mode: TimeGridMode;
|
|
@@ -165,6 +169,11 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
165
169
|
timeslots?: number;
|
|
166
170
|
/** Show the all-day lane above the grid. Default true. */
|
|
167
171
|
showAllDayEventCell?: boolean;
|
|
172
|
+
/** Pull-to-refresh control, mounted on the grid's vertical scroll view. */
|
|
173
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
174
|
+
/** Show the "all-day" text label in the hour column. Default false; the lane
|
|
175
|
+
* still reserves its row, it just isn't labelled. */
|
|
176
|
+
showAllDayLabel?: boolean;
|
|
168
177
|
/** Tint Saturday/Sunday columns with the weekend background. Default true. Set
|
|
169
178
|
* false to treat weekends like any other day. */
|
|
170
179
|
highlightWeekends?: boolean;
|
|
@@ -178,6 +187,8 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
178
187
|
* band stays non-interactive and hidden from assistive tech.
|
|
179
188
|
*/
|
|
180
189
|
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
190
|
+
/** A component that draws a background event's band; see `Calendar`. */
|
|
191
|
+
renderBackgroundEvent?: RenderEvent<T>;
|
|
181
192
|
/** Show the ISO week number in the header gutter. Default false. */
|
|
182
193
|
showWeekNumber?: boolean;
|
|
183
194
|
/** Element rendered between the day header and the grid. */
|
|
@@ -192,6 +203,18 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
192
203
|
isRTL?: boolean;
|
|
193
204
|
minHourHeight?: number;
|
|
194
205
|
maxHourHeight?: number;
|
|
206
|
+
/**
|
|
207
|
+
* Minimum pixel height of a timed event box, so short events stay legible and
|
|
208
|
+
* tappable. Also the floor of the `boxHeight` handed to `renderEvent`. Default
|
|
209
|
+
* 32; pass 0 to size every box strictly by its duration.
|
|
210
|
+
*/
|
|
211
|
+
minEventHeight?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Inset in pixels between a timed event box and its slot (each side), so
|
|
214
|
+
* adjacent boxes and column edges get some breathing room. Default 2; pass 0
|
|
215
|
+
* to let events fill their slot.
|
|
216
|
+
*/
|
|
217
|
+
eventGap?: number;
|
|
195
218
|
showNowIndicator?: boolean;
|
|
196
219
|
locale?: Locale;
|
|
197
220
|
freeSwipe?: boolean;
|
|
@@ -241,7 +264,7 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
241
264
|
/** Optional header above the grid (e.g. weekday labels). Rendered full-width. */
|
|
242
265
|
renderHeader?: (days: Date[]) => React.ReactNode;
|
|
243
266
|
};
|
|
244
|
-
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, 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;
|
|
267
|
+
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, 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;
|
|
245
268
|
/**
|
|
246
269
|
* The timetable view used in day, 3days, week, and custom modes: an
|
|
247
270
|
* hour-by-hour grid with positioned event boxes, an all-day lane, pinch-to-zoom
|
|
@@ -421,6 +444,18 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
421
444
|
* band stays non-interactive and hidden from assistive tech.
|
|
422
445
|
*/
|
|
423
446
|
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
447
|
+
/**
|
|
448
|
+
* Week/day grid only: a component that draws a `display: "background"` event's
|
|
449
|
+
* band in place of the themed shade. Rendered as a real component, like
|
|
450
|
+
* `renderEvent`, so it may use hooks. It receives `event`, `mode`, a live
|
|
451
|
+
* `boxHeight`, `continuesBefore` / `continuesAfter` for a multi-day event, and
|
|
452
|
+
* `onPress` / `onLongPress`, which fire `onPressEvent` / `onLongPressEvent`.
|
|
453
|
+
* The band lets touches through to what you render and stops hiding itself
|
|
454
|
+
* from assistive tech, so a pressable there works; cell presses and
|
|
455
|
+
* drag-to-create are unreachable underneath it. Without this prop the band
|
|
456
|
+
* stays a shaded, non-interactive range. The resource timeline keeps the shade.
|
|
457
|
+
*/
|
|
458
|
+
renderBackgroundEvent?: RenderEvent<T>;
|
|
424
459
|
/** Stable key per event. Defaults to start-time + index. */
|
|
425
460
|
keyExtractor?: EventKeyExtractor<T>;
|
|
426
461
|
/** Partial theme merged over the defaults. */
|
|
@@ -431,17 +466,43 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
431
466
|
hourHeight?: number;
|
|
432
467
|
minHourHeight?: number;
|
|
433
468
|
maxHourHeight?: number;
|
|
469
|
+
/**
|
|
470
|
+
* Minimum pixel height of a timed event box on the week/day grid, so short
|
|
471
|
+
* events stay legible and tappable. Also the floor of the `boxHeight` handed to
|
|
472
|
+
* `renderEvent`. Default 32; pass 0 to size every box strictly by its duration.
|
|
473
|
+
*/
|
|
474
|
+
minEventHeight?: number;
|
|
475
|
+
/**
|
|
476
|
+
* Inset in pixels between a timed event box and its slot on the week/day grid
|
|
477
|
+
* (each side). Default 2; pass 0 to let events fill their slot.
|
|
478
|
+
*/
|
|
479
|
+
eventGap?: number;
|
|
434
480
|
hourColumnWidth?: number;
|
|
435
481
|
/** Hide the left hour-axis column on the week/day grid. Default false. */
|
|
436
482
|
hideHours?: boolean;
|
|
437
483
|
/** Sub-hour divider lines per hour on the week/day grid (e.g. 2 = half-hours). Default 1. */
|
|
438
484
|
timeslots?: number;
|
|
439
485
|
/**
|
|
440
|
-
* Show the all-day lane above the week/day grid. Default true
|
|
441
|
-
*
|
|
442
|
-
*
|
|
486
|
+
* Show the all-day lane above the week/day grid. Default true: the lane is
|
|
487
|
+
* sized to the week's all-day events, collapsing to nothing when there are
|
|
488
|
+
* none, and its height follows the week as you swipe. When false the lane is
|
|
489
|
+
* never rendered, so
|
|
490
|
+
* all-day events (see `ICalendarEvent.allDay` and whole-day spans) are not
|
|
491
|
+
* shown on the time grid.
|
|
443
492
|
*/
|
|
444
493
|
showAllDayEventCell?: boolean;
|
|
494
|
+
/**
|
|
495
|
+
* Show the "all-day" text label in the week/day hour column. Default false: a
|
|
496
|
+
* week with no all-day events then shows no lane at all, rather than a label
|
|
497
|
+
* beside an empty row; with the label on, it slides away with the lane.
|
|
498
|
+
*/
|
|
499
|
+
showAllDayLabel?: boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Pull-to-refresh for the modes that scroll vertically: pass a `RefreshControl`
|
|
502
|
+
* element and it wraps the schedule list, the week/day grid's scroll view or
|
|
503
|
+
* the year view. Month pages scroll sideways, so it has no effect there.
|
|
504
|
+
*/
|
|
505
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
445
506
|
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
446
507
|
highlightWeekends?: boolean;
|
|
447
508
|
/** Allow moving events by default (per-event `startEditable` overrides). Default true. */
|
|
@@ -548,7 +609,7 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
548
609
|
* }
|
|
549
610
|
* ```
|
|
550
611
|
*/
|
|
551
|
-
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, 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;
|
|
612
|
+
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, 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;
|
|
552
613
|
//#endregion
|
|
553
614
|
//#region src/components/DefaultEvent.d.ts
|
|
554
615
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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--9Jg6w-x.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
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";
|
|
7
7
|
//#region src/components/YearView.d.ts
|
|
@@ -59,8 +59,10 @@ type YearViewProps<T = unknown> = SlotStyleProps<YearViewSlot> & {
|
|
|
59
59
|
* the last, exclusive). A plain tap still fires `onPressDay`, not this.
|
|
60
60
|
*/
|
|
61
61
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
62
|
+
/** Pull-to-refresh control, mounted on the year's scroll view. */
|
|
63
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
62
64
|
};
|
|
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;
|
|
65
|
+
declare function YearViewInner<T>({ date, events, weekStartsOn, hiddenDays, locale, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, refreshControl, classNames, styles: styleOverrides }: YearViewProps<T>): ReactElement;
|
|
64
66
|
/**
|
|
65
67
|
* A year at a glance: the twelve months as compact mini grids, with today
|
|
66
68
|
* highlighted and a dot under days that hold events. Tap a day or a month
|
|
@@ -100,13 +102,15 @@ type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
|
|
|
100
102
|
activeDate?: Date;
|
|
101
103
|
/** Drawn between rows of the agenda list. */
|
|
102
104
|
itemSeparatorComponent?: ComponentType<unknown> | null;
|
|
105
|
+
/** Pull-to-refresh control, mounted on the list's scroll view. */
|
|
106
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
103
107
|
};
|
|
104
108
|
/**
|
|
105
109
|
* A vertical, day-grouped list of events (no time grid). Events are sorted by
|
|
106
110
|
* start, grouped under a date header per day. The consumer controls which
|
|
107
111
|
* events (and therefore which date range) are shown.
|
|
108
112
|
*/
|
|
109
|
-
declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
113
|
+
declare function Agenda<T>({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }: AgendaProps<T>): ReactElement;
|
|
110
114
|
//#endregion
|
|
111
115
|
//#region src/components/TimeGrid.d.ts
|
|
112
116
|
/** Default height in pixels of one hour row on the time grid. */
|
|
@@ -118,12 +122,12 @@ type HourRenderer = (hour: number, ampm: boolean) => React.ReactNode;
|
|
|
118
122
|
* where the structure matches; `columnHeaderDateText`, `weekendShade` and
|
|
119
123
|
* `daySeparator` are native-only (the dom grid styles those through its
|
|
120
124
|
* `dayColumn`/`columnHeaderDate` elements). Slots rendered as Reanimated views
|
|
121
|
-
* (`
|
|
122
|
-
* `
|
|
123
|
-
* `
|
|
124
|
-
*
|
|
125
|
+
* (`businessHours`, `weekendShade`, `daySeparator`, `event`,
|
|
126
|
+
* `nowIndicator`, `createGhost`) always honour the `styles` map; their
|
|
127
|
+
* `className` reaches the element but needs a Tailwind runtime that styles
|
|
128
|
+
* Animated components.
|
|
125
129
|
*/
|
|
126
|
-
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
130
|
+
type TimeGridSlot = "header" | "weekNumber" | "columnHeader" | "columnHeaderWeekday" | "columnHeaderDate" | "columnHeaderDateText" | "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent" | "hourGutter" | "hourLabel" | "gridLines" | "businessHours" | "backgroundEvent" | "weekendShade" | "daySeparator" | "event" | "nowIndicator" | "createGhost";
|
|
127
131
|
/** Props for {@link TimeGrid}, the day/week timetable view. */
|
|
128
132
|
type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
129
133
|
mode: TimeGridMode;
|
|
@@ -165,6 +169,11 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
165
169
|
timeslots?: number;
|
|
166
170
|
/** Show the all-day lane above the grid. Default true. */
|
|
167
171
|
showAllDayEventCell?: boolean;
|
|
172
|
+
/** Pull-to-refresh control, mounted on the grid's vertical scroll view. */
|
|
173
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
174
|
+
/** Show the "all-day" text label in the hour column. Default false; the lane
|
|
175
|
+
* still reserves its row, it just isn't labelled. */
|
|
176
|
+
showAllDayLabel?: boolean;
|
|
168
177
|
/** Tint Saturday/Sunday columns with the weekend background. Default true. Set
|
|
169
178
|
* false to treat weekends like any other day. */
|
|
170
179
|
highlightWeekends?: boolean;
|
|
@@ -178,6 +187,8 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
178
187
|
* band stays non-interactive and hidden from assistive tech.
|
|
179
188
|
*/
|
|
180
189
|
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
190
|
+
/** A component that draws a background event's band; see `Calendar`. */
|
|
191
|
+
renderBackgroundEvent?: RenderEvent<T>;
|
|
181
192
|
/** Show the ISO week number in the header gutter. Default false. */
|
|
182
193
|
showWeekNumber?: boolean;
|
|
183
194
|
/** Element rendered between the day header and the grid. */
|
|
@@ -192,6 +203,18 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
192
203
|
isRTL?: boolean;
|
|
193
204
|
minHourHeight?: number;
|
|
194
205
|
maxHourHeight?: number;
|
|
206
|
+
/**
|
|
207
|
+
* Minimum pixel height of a timed event box, so short events stay legible and
|
|
208
|
+
* tappable. Also the floor of the `boxHeight` handed to `renderEvent`. Default
|
|
209
|
+
* 32; pass 0 to size every box strictly by its duration.
|
|
210
|
+
*/
|
|
211
|
+
minEventHeight?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Inset in pixels between a timed event box and its slot (each side), so
|
|
214
|
+
* adjacent boxes and column edges get some breathing room. Default 2; pass 0
|
|
215
|
+
* to let events fill their slot.
|
|
216
|
+
*/
|
|
217
|
+
eventGap?: number;
|
|
195
218
|
showNowIndicator?: boolean;
|
|
196
219
|
locale?: Locale;
|
|
197
220
|
freeSwipe?: boolean;
|
|
@@ -241,7 +264,7 @@ type TimeGridProps<T> = SlotStyleProps<TimeGridSlot> & {
|
|
|
241
264
|
/** Optional header above the grid (e.g. weekday labels). Rendered full-width. */
|
|
242
265
|
renderHeader?: (days: Date[]) => React.ReactNode;
|
|
243
266
|
};
|
|
244
|
-
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, 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;
|
|
267
|
+
declare function TimeGridInner<T>({ mode, numberOfDays, weekEndsOn, date, events, cellHeight, hourHeight, weekStartsOn, weekdayFormat, 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;
|
|
245
268
|
/**
|
|
246
269
|
* The timetable view used in day, 3days, week, and custom modes: an
|
|
247
270
|
* hour-by-hour grid with positioned event boxes, an all-day lane, pinch-to-zoom
|
|
@@ -421,6 +444,18 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
421
444
|
* band stays non-interactive and hidden from assistive tech.
|
|
422
445
|
*/
|
|
423
446
|
renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
|
|
447
|
+
/**
|
|
448
|
+
* Week/day grid only: a component that draws a `display: "background"` event's
|
|
449
|
+
* band in place of the themed shade. Rendered as a real component, like
|
|
450
|
+
* `renderEvent`, so it may use hooks. It receives `event`, `mode`, a live
|
|
451
|
+
* `boxHeight`, `continuesBefore` / `continuesAfter` for a multi-day event, and
|
|
452
|
+
* `onPress` / `onLongPress`, which fire `onPressEvent` / `onLongPressEvent`.
|
|
453
|
+
* The band lets touches through to what you render and stops hiding itself
|
|
454
|
+
* from assistive tech, so a pressable there works; cell presses and
|
|
455
|
+
* drag-to-create are unreachable underneath it. Without this prop the band
|
|
456
|
+
* stays a shaded, non-interactive range. The resource timeline keeps the shade.
|
|
457
|
+
*/
|
|
458
|
+
renderBackgroundEvent?: RenderEvent<T>;
|
|
424
459
|
/** Stable key per event. Defaults to start-time + index. */
|
|
425
460
|
keyExtractor?: EventKeyExtractor<T>;
|
|
426
461
|
/** Partial theme merged over the defaults. */
|
|
@@ -431,17 +466,43 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
431
466
|
hourHeight?: number;
|
|
432
467
|
minHourHeight?: number;
|
|
433
468
|
maxHourHeight?: number;
|
|
469
|
+
/**
|
|
470
|
+
* Minimum pixel height of a timed event box on the week/day grid, so short
|
|
471
|
+
* events stay legible and tappable. Also the floor of the `boxHeight` handed to
|
|
472
|
+
* `renderEvent`. Default 32; pass 0 to size every box strictly by its duration.
|
|
473
|
+
*/
|
|
474
|
+
minEventHeight?: number;
|
|
475
|
+
/**
|
|
476
|
+
* Inset in pixels between a timed event box and its slot on the week/day grid
|
|
477
|
+
* (each side). Default 2; pass 0 to let events fill their slot.
|
|
478
|
+
*/
|
|
479
|
+
eventGap?: number;
|
|
434
480
|
hourColumnWidth?: number;
|
|
435
481
|
/** Hide the left hour-axis column on the week/day grid. Default false. */
|
|
436
482
|
hideHours?: boolean;
|
|
437
483
|
/** Sub-hour divider lines per hour on the week/day grid (e.g. 2 = half-hours). Default 1. */
|
|
438
484
|
timeslots?: number;
|
|
439
485
|
/**
|
|
440
|
-
* Show the all-day lane above the week/day grid. Default true
|
|
441
|
-
*
|
|
442
|
-
*
|
|
486
|
+
* Show the all-day lane above the week/day grid. Default true: the lane is
|
|
487
|
+
* sized to the week's all-day events, collapsing to nothing when there are
|
|
488
|
+
* none, and its height follows the week as you swipe. When false the lane is
|
|
489
|
+
* never rendered, so
|
|
490
|
+
* all-day events (see `ICalendarEvent.allDay` and whole-day spans) are not
|
|
491
|
+
* shown on the time grid.
|
|
443
492
|
*/
|
|
444
493
|
showAllDayEventCell?: boolean;
|
|
494
|
+
/**
|
|
495
|
+
* Show the "all-day" text label in the week/day hour column. Default false: a
|
|
496
|
+
* week with no all-day events then shows no lane at all, rather than a label
|
|
497
|
+
* beside an empty row; with the label on, it slides away with the lane.
|
|
498
|
+
*/
|
|
499
|
+
showAllDayLabel?: boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Pull-to-refresh for the modes that scroll vertically: pass a `RefreshControl`
|
|
502
|
+
* element and it wraps the schedule list, the week/day grid's scroll view or
|
|
503
|
+
* the year view. Month pages scroll sideways, so it has no effect there.
|
|
504
|
+
*/
|
|
505
|
+
refreshControl?: ScrollViewProps["refreshControl"];
|
|
445
506
|
/** Tint weekend columns (default true). Set false to treat weekends normally. */
|
|
446
507
|
highlightWeekends?: boolean;
|
|
447
508
|
/** Allow moving events by default (per-event `startEditable` overrides). Default true. */
|
|
@@ -548,7 +609,7 @@ type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
|
|
|
548
609
|
* }
|
|
549
610
|
* ```
|
|
550
611
|
*/
|
|
551
|
-
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, 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;
|
|
612
|
+
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, 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;
|
|
552
613
|
//#endregion
|
|
553
614
|
//#region src/components/DefaultEvent.d.ts
|
|
554
615
|
/**
|