@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/README.md
CHANGED
|
@@ -12,6 +12,15 @@ The React Native renderer for [super-calendar](https://github.com/afonsojramos/s
|
|
|
12
12
|
- 🪝 Headless `useMonthGrid` and `useDateRange` for fully custom UIs
|
|
13
13
|
- 🎨 Themeable, with a `darkTheme` preset
|
|
14
14
|
|
|
15
|
+
## All-day spans
|
|
16
|
+
|
|
17
|
+
In the time grid, an all-day event renders once as a bar across the visible
|
|
18
|
+
dates it covers. Overlapping events stack on separate rows. The end is
|
|
19
|
+
exclusive, and hidden days take no width. `renderEvent` and press callbacks
|
|
20
|
+
receive the original event; `continuesBefore` and `continuesAfter` indicate
|
|
21
|
+
clipping at the visible range edges. The `allDayColumn` slot styles one
|
|
22
|
+
spanning cell. Timed events that cross midnight keep their per-day segments.
|
|
23
|
+
|
|
15
24
|
## Install
|
|
16
25
|
|
|
17
26
|
```sh
|
|
@@ -93,7 +102,9 @@ export function MultiWeekCalendar() {
|
|
|
93
102
|
`MultiWeekView` exposes a standalone window with the month grid's event bars,
|
|
94
103
|
overflow, selection, drag interactions, and styling. Pass expanded events to it;
|
|
95
104
|
`Calendar` handles recurrence and time zones. Custom event renderers receive
|
|
96
|
-
`mode: "multiweek"`.
|
|
105
|
+
`mode: "multiweek"`. Week rows share the available height and scroll vertically
|
|
106
|
+
when their contents need more room. Dates align at the top of each cell so bars
|
|
107
|
+
and overflow labels line up across days.
|
|
97
108
|
Counts must be positive safe integers whose date span is representable; invalid
|
|
98
109
|
counts or dates throw `RangeError`. Rows are materialized, so larger counts need
|
|
99
110
|
more space. `MonthView` and `MonthPager` retain their month-only behavior.
|
|
@@ -141,6 +152,17 @@ passes the lane's `resource`. The preview geometry stays on the UI thread, and
|
|
|
141
152
|
the content is clipped to it and hidden from screen readers.
|
|
142
153
|
A cancelled gesture clears the preview without calling `onCreateEvent`.
|
|
143
154
|
|
|
155
|
+
`MonthView`, `MultiWeekView`, `MonthPager`, and `Calendar` in `month` or
|
|
156
|
+
`multiweek` mode also accept `renderCreateGhost`. These views pass the full
|
|
157
|
+
all-day range, with an exclusive end, and render one copy per covered week row.
|
|
158
|
+
Use date labels rather than times for this content. The preview updates when
|
|
159
|
+
the sweep reaches another day, uses `chipHeight`, `chipGap`, and the
|
|
160
|
+
`createGhost` slot, and sits on the lane the created all-day event will take,
|
|
161
|
+
moving the row's other bars aside without changing the row height. Content is
|
|
162
|
+
clipped, ignores pointer input, and is hidden from screen readers. On React Native Web, it also stays out of the tab order. Both the renderer and `onCreateEvent` are required; together they also
|
|
163
|
+
show the event-grid layout in an empty month. Omitting the renderer preserves
|
|
164
|
+
the existing day highlight.
|
|
165
|
+
|
|
144
166
|
## Styling with Tailwind
|
|
145
167
|
|
|
146
168
|
Every styleable part is a named slot that accepts a class (resolved by a Tailwind runtime such as [uniwind](https://docs.uniwind.dev) or NativeWind) and/or a style override. A classed slot drops its built-in themed styles, so your classes own the look:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
2
2
|
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
3
3
|
import { SharedValue } from "react-native-reanimated";
|
|
4
|
-
import { BusinessHours, BusinessHoursBand as BusinessHoursBand$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarMode, CalendarMode as CalendarMode$1, CreateGhostArgs as CreateGhostArgs$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
|
|
4
|
+
import { BusinessHours, BusinessHoursBand as BusinessHoursBand$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarMode, CalendarMode as CalendarMode$1, CreateGhostArgs, CreateGhostArgs as CreateGhostArgs$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
|
|
5
5
|
import { AccessibilityActionEvent, AccessibilityActionInfo, ImageStyle, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
6
6
|
/**
|
|
7
7
|
* The full set of colours, text styles and metrics the calendar paints with.
|
|
@@ -137,8 +137,8 @@ type RenderEventArgs<T = unknown> = {
|
|
|
137
137
|
boxHeight?: SharedValue<number>;
|
|
138
138
|
/**
|
|
139
139
|
* On the week/day grid, true when this is a clipped segment of a multi-day
|
|
140
|
-
* event
|
|
141
|
-
* renderer draw "continues" affordances.
|
|
140
|
+
* timed event. For an all-day bar, these flags refer to the visible date
|
|
141
|
+
* range instead. Lets a renderer draw "continues" affordances.
|
|
142
142
|
*/
|
|
143
143
|
continuesBefore?: boolean;
|
|
144
144
|
continuesAfter?: boolean;
|
|
@@ -181,6 +181,23 @@ type RenderEventArgs<T = unknown> = {
|
|
|
181
181
|
* (`flex: 1`); the calendar positions and sizes the wrapping box for you.
|
|
182
182
|
*/
|
|
183
183
|
type RenderEvent<T = unknown> = ComponentType<RenderEventArgs<T>>;
|
|
184
|
+
/**
|
|
185
|
+
* The state of a month day cell, passed to `renderCustomDateForMonth` so a custom
|
|
186
|
+
* date badge can style the day the way the built-in badge does.
|
|
187
|
+
*/
|
|
188
|
+
type MonthDateInfo = {
|
|
189
|
+
/**
|
|
190
|
+
* False for a day from the previous or next month, shown with
|
|
191
|
+
* `showAdjacentMonths`. Always true in `MultiWeekView`.
|
|
192
|
+
*/
|
|
193
|
+
isCurrentMonth: boolean;
|
|
194
|
+
/** The day is today. */
|
|
195
|
+
isToday: boolean;
|
|
196
|
+
/** The day is in `selectedDates` or is an endpoint of `selectedRange`. */
|
|
197
|
+
isSelected: boolean;
|
|
198
|
+
/** The day fails `minDate`, `maxDate` or `isDateDisabled`. */
|
|
199
|
+
isDisabled: boolean;
|
|
200
|
+
};
|
|
184
201
|
/**
|
|
185
202
|
* The style shapes a slot can resolve to. A slot carries the style type of the
|
|
186
203
|
* element it is spread on, because React Native's style types stop being
|
|
@@ -223,7 +240,7 @@ interface ResolvedSlot<Style extends SlotStyle = ViewStyle> {
|
|
|
223
240
|
* Native text colour doesn't inherit from the badge). Event chips are styled
|
|
224
241
|
* by `renderEvent` (or the theme), not a slot.
|
|
225
242
|
*/
|
|
226
|
-
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "dayBadgeText" | "rangeBand" | "more" | "morePopover";
|
|
243
|
+
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "dayBadgeText" | "rangeBand" | "createGhost" | "more" | "morePopover";
|
|
227
244
|
/** Props for {@link MonthView}, the single-month grid. */
|
|
228
245
|
type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
229
246
|
date: Date;
|
|
@@ -248,6 +265,13 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
248
265
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
249
266
|
weekdayFormat?: WeekdayFormat;
|
|
250
267
|
locale?: Locale;
|
|
268
|
+
/**
|
|
269
|
+
* The instant whose calendar day is highlighted as today. Defaults to the
|
|
270
|
+
* device clock, and is read in `timeZone` when one is set.
|
|
271
|
+
*/
|
|
272
|
+
now?: Date;
|
|
273
|
+
/** Highlight today as it is in this IANA time zone (default: the device's). */
|
|
274
|
+
timeZone?: string;
|
|
251
275
|
/** Sort each day's events by start time before slicing. Default true. */
|
|
252
276
|
sortedMonthView?: boolean;
|
|
253
277
|
/** Template for the overflow label; `{moreCount}` is replaced. Default "{moreCount} More". */
|
|
@@ -317,6 +341,14 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
317
341
|
* plain tap fires `onPressDay`/`onPressCell` instead.
|
|
318
342
|
*/
|
|
319
343
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
344
|
+
/**
|
|
345
|
+
* Content inside the drag-to-create preview. Receives the full all-day range,
|
|
346
|
+
* with an exclusive end, that `onCreateEvent` would receive on release. A span
|
|
347
|
+
* crossing rows renders the component once per row with the same range.
|
|
348
|
+
* Requires `onCreateEvent`; content is clipped, noninteractive, and hidden
|
|
349
|
+
* from screen readers. Omit to keep the day highlight without preview content.
|
|
350
|
+
*/
|
|
351
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
320
352
|
/**
|
|
321
353
|
* Reports the day span of a create sweep **as it happens**, as the ordered
|
|
322
354
|
* inclusive `[start, end]` days (both at midnight), so a selection highlight can
|
|
@@ -343,10 +375,11 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
343
375
|
/** Reject a drop that would overlap another event (default true = allowed). */
|
|
344
376
|
eventOverlap?: boolean;
|
|
345
377
|
/**
|
|
346
|
-
* Replace the default date badge in each day cell. Receives the day
|
|
347
|
-
*
|
|
378
|
+
* Replace the default date badge in each day cell. Receives the day and its
|
|
379
|
+
* state (`isCurrentMonth`, `isToday`, `isSelected`, `isDisabled`); return your
|
|
380
|
+
* own date label. Event chips and the "+N more" label still render below.
|
|
348
381
|
*/
|
|
349
|
-
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
382
|
+
renderCustomDateForMonth?: (date: Date, info: MonthDateInfo) => React.ReactNode;
|
|
350
383
|
};
|
|
351
384
|
declare function MonthViewInner<T>({ date, showAdjacentMonths, showSixWeeks, ...rest }: MonthViewProps<T>): ReactElement;
|
|
352
385
|
/**
|
|
@@ -380,6 +413,8 @@ type MonthPagerProps<T> = {
|
|
|
380
413
|
hiddenDays?: number[];
|
|
381
414
|
weekdayFormat?: WeekdayFormat;
|
|
382
415
|
locale?: Locale;
|
|
416
|
+
now?: Date;
|
|
417
|
+
timeZone?: string;
|
|
383
418
|
sortedMonthView?: boolean;
|
|
384
419
|
moreLabel?: string;
|
|
385
420
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -400,6 +435,8 @@ type MonthPagerProps<T> = {
|
|
|
400
435
|
onPressMore?: (events: CalendarEvent$1<T>[], date: Date) => void;
|
|
401
436
|
/** Drag across empty day cells to sweep out an all-day span for a new event. */
|
|
402
437
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
438
|
+
/** Content for each row of the live creation preview; requires `onCreateEvent`. */
|
|
439
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
403
440
|
/** Drag-to-select: reports the swept `[start, end]` days live. */
|
|
404
441
|
onSelectDrag?: (start: Date, end: Date) => void;
|
|
405
442
|
/** Days drawn as selected (a filled badge). */
|
|
@@ -431,8 +468,8 @@ type MonthPagerProps<T> = {
|
|
|
431
468
|
activeDate?: Date;
|
|
432
469
|
/** Replace the weekday-label header above the month grid. Receives the week's days. */
|
|
433
470
|
renderHeaderForMonthView?: (weekDays: Date[]) => React.ReactNode;
|
|
434
|
-
/** Replace the default date badge in each day cell. Receives the day. */
|
|
435
|
-
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
471
|
+
/** Replace the default date badge in each day cell. Receives the day and its state. */
|
|
472
|
+
renderCustomDateForMonth?: (date: Date, info: MonthDateInfo) => React.ReactNode;
|
|
436
473
|
} & SlotStyleProps<MonthViewSlot>;
|
|
437
474
|
declare function MonthPagerInner<T>({ showAdjacentMonths, showSixWeeks, ...rest }: MonthPagerProps<T>): ReactElement;
|
|
438
475
|
/**
|
|
@@ -555,4 +592,4 @@ declare const MonthList: typeof MonthListInner;
|
|
|
555
592
|
* Reanimated.
|
|
556
593
|
*/
|
|
557
594
|
declare function DefaultMonthEvent<T>({ event, mode, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
558
|
-
export {
|
|
595
|
+
export { ScrollToTimeOptions as A, useCalendarTheme as B, EventKeyExtractor as C, RecurrenceRule as D, RecurrenceFrequency as E, CalendarThemeProvider as F, PartialCalendarTheme as I, darkTheme as L, WeekStartsOn$1 as M, WeekdayFormat$1 as N, RenderEvent as O, CalendarTheme as P, defaultTheme as R, EventDragStartHandler as S, MonthDateInfo as T, CalendarMode$1 as _, MonthPager as a, EventAccessibilityLabeler$1 as b, MonthViewProps as c, SlotDefault as d, SlotStyleProps as f, CalendarHandle$1 as g, CalendarEvent$1 as h, MonthListSlot as i, TimeGridMode as j, RenderEventArgs as k, MonthViewSlot as l, BusinessHoursBand$1 as m, MonthList as n, MonthPagerProps as o, BusinessHours as p, MonthListProps as r, MonthView as s, DefaultMonthEvent as t, ResolvedSlot as u, CreateGhostArgs$1 as v, ICalendarEvent as w, EventDragHandler as x, EventAccessibilityLabelContext as y, mergeTheme as z };
|
|
@@ -2,7 +2,7 @@ import { Locale } from "date-fns";
|
|
|
2
2
|
import { ComponentType, ReactElement, ReactNode } from "react";
|
|
3
3
|
import { AccessibilityActionEvent, AccessibilityActionInfo, ImageStyle, StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
4
4
|
import { SharedValue } from "react-native-reanimated";
|
|
5
|
-
import { BusinessHours, BusinessHoursBand as BusinessHoursBand$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarMode, CalendarMode as CalendarMode$1, CreateGhostArgs as CreateGhostArgs$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
|
|
5
|
+
import { BusinessHours, BusinessHoursBand as BusinessHoursBand$1, CalendarColors, CalendarEvent, CalendarEvent as CalendarEvent$1, CalendarHandle as CalendarHandle$1, CalendarLabels, CalendarMode, CalendarMode as CalendarMode$1, CreateGhostArgs, CreateGhostArgs as CreateGhostArgs$1, DateRange, EventAccessibilityLabelContext, EventAccessibilityLabeler, EventAccessibilityLabeler as EventAccessibilityLabeler$1, EventKeyExtractor, ICalendarEvent, RecurrenceFrequency, RecurrenceRule, ScrollToTimeOptions, TimeGridMode, WeekStartsOn as WeekStartsOn$1, WeekdayFormat, WeekdayFormat as WeekdayFormat$1 } from "@super-calendar/core";
|
|
6
6
|
/**
|
|
7
7
|
* The full set of colours, text styles and metrics the calendar paints with.
|
|
8
8
|
* Supply a `Partial<CalendarTheme>` to `<Calendar theme={...} />`; missing keys
|
|
@@ -137,8 +137,8 @@ type RenderEventArgs<T = unknown> = {
|
|
|
137
137
|
boxHeight?: SharedValue<number>;
|
|
138
138
|
/**
|
|
139
139
|
* On the week/day grid, true when this is a clipped segment of a multi-day
|
|
140
|
-
* event
|
|
141
|
-
* renderer draw "continues" affordances.
|
|
140
|
+
* timed event. For an all-day bar, these flags refer to the visible date
|
|
141
|
+
* range instead. Lets a renderer draw "continues" affordances.
|
|
142
142
|
*/
|
|
143
143
|
continuesBefore?: boolean;
|
|
144
144
|
continuesAfter?: boolean;
|
|
@@ -181,6 +181,23 @@ type RenderEventArgs<T = unknown> = {
|
|
|
181
181
|
* (`flex: 1`); the calendar positions and sizes the wrapping box for you.
|
|
182
182
|
*/
|
|
183
183
|
type RenderEvent<T = unknown> = ComponentType<RenderEventArgs<T>>;
|
|
184
|
+
/**
|
|
185
|
+
* The state of a month day cell, passed to `renderCustomDateForMonth` so a custom
|
|
186
|
+
* date badge can style the day the way the built-in badge does.
|
|
187
|
+
*/
|
|
188
|
+
type MonthDateInfo = {
|
|
189
|
+
/**
|
|
190
|
+
* False for a day from the previous or next month, shown with
|
|
191
|
+
* `showAdjacentMonths`. Always true in `MultiWeekView`.
|
|
192
|
+
*/
|
|
193
|
+
isCurrentMonth: boolean;
|
|
194
|
+
/** The day is today. */
|
|
195
|
+
isToday: boolean;
|
|
196
|
+
/** The day is in `selectedDates` or is an endpoint of `selectedRange`. */
|
|
197
|
+
isSelected: boolean;
|
|
198
|
+
/** The day fails `minDate`, `maxDate` or `isDateDisabled`. */
|
|
199
|
+
isDisabled: boolean;
|
|
200
|
+
};
|
|
184
201
|
/**
|
|
185
202
|
* The style shapes a slot can resolve to. A slot carries the style type of the
|
|
186
203
|
* element it is spread on, because React Native's style types stop being
|
|
@@ -223,7 +240,7 @@ interface ResolvedSlot<Style extends SlotStyle = ViewStyle> {
|
|
|
223
240
|
* Native text colour doesn't inherit from the badge). Event chips are styled
|
|
224
241
|
* by `renderEvent` (or the theme), not a slot.
|
|
225
242
|
*/
|
|
226
|
-
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "dayBadgeText" | "rangeBand" | "more" | "morePopover";
|
|
243
|
+
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "dayBadgeText" | "rangeBand" | "createGhost" | "more" | "morePopover";
|
|
227
244
|
/** Props for {@link MonthView}, the single-month grid. */
|
|
228
245
|
type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
229
246
|
date: Date;
|
|
@@ -248,6 +265,13 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
248
265
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
249
266
|
weekdayFormat?: WeekdayFormat;
|
|
250
267
|
locale?: Locale;
|
|
268
|
+
/**
|
|
269
|
+
* The instant whose calendar day is highlighted as today. Defaults to the
|
|
270
|
+
* device clock, and is read in `timeZone` when one is set.
|
|
271
|
+
*/
|
|
272
|
+
now?: Date;
|
|
273
|
+
/** Highlight today as it is in this IANA time zone (default: the device's). */
|
|
274
|
+
timeZone?: string;
|
|
251
275
|
/** Sort each day's events by start time before slicing. Default true. */
|
|
252
276
|
sortedMonthView?: boolean;
|
|
253
277
|
/** Template for the overflow label; `{moreCount}` is replaced. Default "{moreCount} More". */
|
|
@@ -317,6 +341,14 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
317
341
|
* plain tap fires `onPressDay`/`onPressCell` instead.
|
|
318
342
|
*/
|
|
319
343
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
344
|
+
/**
|
|
345
|
+
* Content inside the drag-to-create preview. Receives the full all-day range,
|
|
346
|
+
* with an exclusive end, that `onCreateEvent` would receive on release. A span
|
|
347
|
+
* crossing rows renders the component once per row with the same range.
|
|
348
|
+
* Requires `onCreateEvent`; content is clipped, noninteractive, and hidden
|
|
349
|
+
* from screen readers. Omit to keep the day highlight without preview content.
|
|
350
|
+
*/
|
|
351
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
320
352
|
/**
|
|
321
353
|
* Reports the day span of a create sweep **as it happens**, as the ordered
|
|
322
354
|
* inclusive `[start, end]` days (both at midnight), so a selection highlight can
|
|
@@ -343,10 +375,11 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
343
375
|
/** Reject a drop that would overlap another event (default true = allowed). */
|
|
344
376
|
eventOverlap?: boolean;
|
|
345
377
|
/**
|
|
346
|
-
* Replace the default date badge in each day cell. Receives the day
|
|
347
|
-
*
|
|
378
|
+
* Replace the default date badge in each day cell. Receives the day and its
|
|
379
|
+
* state (`isCurrentMonth`, `isToday`, `isSelected`, `isDisabled`); return your
|
|
380
|
+
* own date label. Event chips and the "+N more" label still render below.
|
|
348
381
|
*/
|
|
349
|
-
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
382
|
+
renderCustomDateForMonth?: (date: Date, info: MonthDateInfo) => React.ReactNode;
|
|
350
383
|
};
|
|
351
384
|
declare function MonthViewInner<T>({ date, showAdjacentMonths, showSixWeeks, ...rest }: MonthViewProps<T>): ReactElement;
|
|
352
385
|
/**
|
|
@@ -380,6 +413,8 @@ type MonthPagerProps<T> = {
|
|
|
380
413
|
hiddenDays?: number[];
|
|
381
414
|
weekdayFormat?: WeekdayFormat;
|
|
382
415
|
locale?: Locale;
|
|
416
|
+
now?: Date;
|
|
417
|
+
timeZone?: string;
|
|
383
418
|
sortedMonthView?: boolean;
|
|
384
419
|
moreLabel?: string;
|
|
385
420
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -400,6 +435,8 @@ type MonthPagerProps<T> = {
|
|
|
400
435
|
onPressMore?: (events: CalendarEvent$1<T>[], date: Date) => void;
|
|
401
436
|
/** Drag across empty day cells to sweep out an all-day span for a new event. */
|
|
402
437
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
438
|
+
/** Content for each row of the live creation preview; requires `onCreateEvent`. */
|
|
439
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
403
440
|
/** Drag-to-select: reports the swept `[start, end]` days live. */
|
|
404
441
|
onSelectDrag?: (start: Date, end: Date) => void;
|
|
405
442
|
/** Days drawn as selected (a filled badge). */
|
|
@@ -431,8 +468,8 @@ type MonthPagerProps<T> = {
|
|
|
431
468
|
activeDate?: Date;
|
|
432
469
|
/** Replace the weekday-label header above the month grid. Receives the week's days. */
|
|
433
470
|
renderHeaderForMonthView?: (weekDays: Date[]) => React.ReactNode;
|
|
434
|
-
/** Replace the default date badge in each day cell. Receives the day. */
|
|
435
|
-
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
471
|
+
/** Replace the default date badge in each day cell. Receives the day and its state. */
|
|
472
|
+
renderCustomDateForMonth?: (date: Date, info: MonthDateInfo) => React.ReactNode;
|
|
436
473
|
} & SlotStyleProps<MonthViewSlot>;
|
|
437
474
|
declare function MonthPagerInner<T>({ showAdjacentMonths, showSixWeeks, ...rest }: MonthPagerProps<T>): ReactElement;
|
|
438
475
|
/**
|
|
@@ -555,4 +592,4 @@ declare const MonthList: typeof MonthListInner;
|
|
|
555
592
|
* Reanimated.
|
|
556
593
|
*/
|
|
557
594
|
declare function DefaultMonthEvent<T>({ event, mode, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
558
|
-
export {
|
|
595
|
+
export { ScrollToTimeOptions as A, useCalendarTheme as B, EventKeyExtractor as C, RecurrenceRule as D, RecurrenceFrequency as E, CalendarThemeProvider as F, PartialCalendarTheme as I, darkTheme as L, WeekStartsOn$1 as M, WeekdayFormat$1 as N, RenderEvent as O, CalendarTheme as P, defaultTheme as R, EventDragStartHandler as S, MonthDateInfo as T, CalendarMode$1 as _, MonthPager as a, EventAccessibilityLabeler$1 as b, MonthViewProps as c, SlotDefault as d, SlotStyleProps as f, CalendarHandle$1 as g, CalendarEvent$1 as h, MonthListSlot as i, TimeGridMode as j, RenderEventArgs as k, MonthViewSlot as l, BusinessHoursBand$1 as m, MonthList as n, MonthPagerProps as o, BusinessHours as p, MonthListProps as r, MonthView as s, DefaultMonthEvent as t, ResolvedSlot as u, CreateGhostArgs$1 as v, ICalendarEvent as w, EventDragHandler as x, EventAccessibilityLabelContext as y, mergeTheme as z };
|