@super-calendar/native 2.16.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/dist/{DefaultMonthEvent-ClIxUp__.d.ts → DefaultMonthEvent-B7xVeY7Q.d.ts} +29 -10
- package/dist/{DefaultMonthEvent-No5YhOcV.d.mts → DefaultMonthEvent-hGk7wSrr.d.mts} +29 -10
- package/dist/{MonthList-Dmp8JXvj.js → MonthList-C_NTufaK.js} +462 -92
- package/dist/{MonthList-D97JhM4F.mjs → MonthList-DdQxRhUy.mjs} +453 -95
- package/dist/index.d.mts +54 -13
- package/dist/index.d.ts +54 -13
- package/dist/index.js +245 -72
- package/dist/index.mjs +210 -74
- package/dist/picker.d.mts +1 -1
- package/dist/picker.d.ts +1 -1
- package/dist/picker.js +1 -1
- package/dist/picker.mjs +1 -1
- package/package.json +2 -2
- package/src/components/Agenda.tsx +19 -2
- package/src/components/AllDayLane.tsx +64 -37
- package/src/components/Calendar.tsx +173 -34
- package/src/components/MonthPager.tsx +212 -21
- package/src/components/MonthView.tsx +419 -118
- package/src/components/MultiWeekView.tsx +34 -0
- package/src/components/TimeGrid.tsx +60 -11
- package/src/components/YearView.tsx +12 -1
- package/src/index.tsx +17 -2
- package/src/types.ts +2 -2
- package/src/utils/holdWebDateDrag.ts +63 -0
package/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
|
|
@@ -63,6 +72,45 @@ export function MyCalendar() {
|
|
|
63
72
|
}
|
|
64
73
|
```
|
|
65
74
|
|
|
75
|
+
## Multi-week grids
|
|
76
|
+
|
|
77
|
+
Use `mode="multiweek"` with `numberOfWeeks` (default `2`) for consecutive full
|
|
78
|
+
week rows without hourly slots. The first week contains `date` and aligns to
|
|
79
|
+
`weekStartsOn`. Navigation moves by the full number of weeks. `hiddenDays` only
|
|
80
|
+
shortens rows; `custom` views remain hourly even above seven columns.
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import { useState } from "react";
|
|
84
|
+
import { Calendar } from "@super-calendar/native";
|
|
85
|
+
|
|
86
|
+
export function MultiWeekCalendar() {
|
|
87
|
+
const [date, setDate] = useState(new Date(2026, 11, 28));
|
|
88
|
+
return (
|
|
89
|
+
<Calendar
|
|
90
|
+
mode="multiweek"
|
|
91
|
+
numberOfWeeks={3}
|
|
92
|
+
weekStartsOn={1}
|
|
93
|
+
date={date}
|
|
94
|
+
onChangeDate={setDate}
|
|
95
|
+
events={[]}
|
|
96
|
+
onPressEvent={(event) => console.log(event.title)}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`MultiWeekView` exposes a standalone window with the month grid's event bars,
|
|
103
|
+
overflow, selection, drag interactions, and styling. Pass expanded events to it;
|
|
104
|
+
`Calendar` handles recurrence and time zones. Custom event renderers receive
|
|
105
|
+
`mode: "multiweek"`. Rows scroll vertically when the container is too short.
|
|
106
|
+
Counts must be positive safe integers whose date span is representable; invalid
|
|
107
|
+
counts or dates throw `RangeError`. Rows are materialized, so larger counts need
|
|
108
|
+
more space. `MonthView` and `MonthPager` retain their month-only behavior.
|
|
109
|
+
|
|
110
|
+
Keep `events` stable during unrelated UI updates. With recurrence or `timeZone`,
|
|
111
|
+
replacing the array rebuilds displayed events and cancels a held move on web. See
|
|
112
|
+
[keep event data stable](https://super-calendar.afonsojramos.me/guides/events#keep-event-data-stable).
|
|
113
|
+
|
|
66
114
|
## Moving events
|
|
67
115
|
|
|
68
116
|
Pass `onDragEvent` and update your event state with the returned `start` and `end`.
|
|
@@ -102,6 +150,17 @@ passes the lane's `resource`. The preview geometry stays on the UI thread, and
|
|
|
102
150
|
the content is clipped to it and hidden from screen readers.
|
|
103
151
|
A cancelled gesture clears the preview without calling `onCreateEvent`.
|
|
104
152
|
|
|
153
|
+
`MonthView`, `MultiWeekView`, `MonthPager`, and `Calendar` in `month` or
|
|
154
|
+
`multiweek` mode also accept `renderCreateGhost`. These views pass the full
|
|
155
|
+
all-day range, with an exclusive end, and render one copy per covered week row.
|
|
156
|
+
Use date labels rather than times for this content. The preview updates when
|
|
157
|
+
the sweep reaches another day, uses `chipHeight`, `chipGap`, and the
|
|
158
|
+
`createGhost` slot, and overlays a visible event lane without changing the row
|
|
159
|
+
height. Content is clipped, ignores pointer input, and is hidden from screen
|
|
160
|
+
readers. On React Native Web, it also stays out of the tab order. Both the renderer and `onCreateEvent` are required; together they also
|
|
161
|
+
show the event-grid layout in an empty month. Omitting the renderer preserves
|
|
162
|
+
the existing day highlight.
|
|
163
|
+
|
|
105
164
|
## Styling with Tailwind
|
|
106
165
|
|
|
107
166
|
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:
|
|
@@ -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, 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;
|
|
@@ -223,7 +223,7 @@ interface ResolvedSlot<Style extends SlotStyle = ViewStyle> {
|
|
|
223
223
|
* Native text colour doesn't inherit from the badge). Event chips are styled
|
|
224
224
|
* by `renderEvent` (or the theme), not a slot.
|
|
225
225
|
*/
|
|
226
|
-
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "dayBadgeText" | "rangeBand" | "more" | "morePopover";
|
|
226
|
+
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "dayBadgeText" | "rangeBand" | "createGhost" | "more" | "morePopover";
|
|
227
227
|
/** Props for {@link MonthView}, the single-month grid. */
|
|
228
228
|
type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
229
229
|
date: Date;
|
|
@@ -242,12 +242,19 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
242
242
|
chipHeight?: number;
|
|
243
243
|
/** Vertical gap between chip rows in pixels (default 2). */
|
|
244
244
|
chipGap?: number;
|
|
245
|
-
weekStartsOn: WeekStartsOn;
|
|
245
|
+
weekStartsOn: WeekStartsOn$1;
|
|
246
246
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
247
247
|
hiddenDays?: number[];
|
|
248
248
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
249
249
|
weekdayFormat?: WeekdayFormat;
|
|
250
250
|
locale?: Locale;
|
|
251
|
+
/**
|
|
252
|
+
* The instant whose calendar day is highlighted as today. Defaults to the
|
|
253
|
+
* device clock, and is read in `timeZone` when one is set.
|
|
254
|
+
*/
|
|
255
|
+
now?: Date;
|
|
256
|
+
/** Highlight today as it is in this IANA time zone (default: the device's). */
|
|
257
|
+
timeZone?: string;
|
|
251
258
|
/** Sort each day's events by start time before slicing. Default true. */
|
|
252
259
|
sortedMonthView?: boolean;
|
|
253
260
|
/** Template for the overflow label; `{moreCount}` is replaced. Default "{moreCount} More". */
|
|
@@ -317,6 +324,14 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
317
324
|
* plain tap fires `onPressDay`/`onPressCell` instead.
|
|
318
325
|
*/
|
|
319
326
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
327
|
+
/**
|
|
328
|
+
* Content inside the drag-to-create preview. Receives the full all-day range,
|
|
329
|
+
* with an exclusive end, that `onCreateEvent` would receive on release. A span
|
|
330
|
+
* crossing rows renders the component once per row with the same range.
|
|
331
|
+
* Requires `onCreateEvent`; content is clipped, noninteractive, and hidden
|
|
332
|
+
* from screen readers. Omit to keep the day highlight without preview content.
|
|
333
|
+
*/
|
|
334
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
320
335
|
/**
|
|
321
336
|
* Reports the day span of a create sweep **as it happens**, as the ordered
|
|
322
337
|
* inclusive `[start, end]` days (both at midnight), so a selection highlight can
|
|
@@ -348,7 +363,7 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
348
363
|
*/
|
|
349
364
|
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
350
365
|
};
|
|
351
|
-
declare function MonthViewInner<T>({ date,
|
|
366
|
+
declare function MonthViewInner<T>({ date, showAdjacentMonths, showSixWeeks, ...rest }: MonthViewProps<T>): ReactElement;
|
|
352
367
|
/**
|
|
353
368
|
* A single month rendered as a 7-column grid of day cells, each showing its
|
|
354
369
|
* event chips with a "+N more" overflow. Render it on its own for a static
|
|
@@ -375,11 +390,13 @@ type MonthPagerProps<T> = {
|
|
|
375
390
|
chipHeight?: number;
|
|
376
391
|
/** Gap between month chip rows in pixels (default 2). */
|
|
377
392
|
chipGap?: number;
|
|
378
|
-
weekStartsOn: WeekStartsOn;
|
|
393
|
+
weekStartsOn: WeekStartsOn$1;
|
|
379
394
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
380
395
|
hiddenDays?: number[];
|
|
381
396
|
weekdayFormat?: WeekdayFormat;
|
|
382
397
|
locale?: Locale;
|
|
398
|
+
now?: Date;
|
|
399
|
+
timeZone?: string;
|
|
383
400
|
sortedMonthView?: boolean;
|
|
384
401
|
moreLabel?: string;
|
|
385
402
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -400,6 +417,8 @@ type MonthPagerProps<T> = {
|
|
|
400
417
|
onPressMore?: (events: CalendarEvent$1<T>[], date: Date) => void;
|
|
401
418
|
/** Drag across empty day cells to sweep out an all-day span for a new event. */
|
|
402
419
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
420
|
+
/** Content for each row of the live creation preview; requires `onCreateEvent`. */
|
|
421
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
403
422
|
/** Drag-to-select: reports the swept `[start, end]` days live. */
|
|
404
423
|
onSelectDrag?: (start: Date, end: Date) => void;
|
|
405
424
|
/** Days drawn as selected (a filled badge). */
|
|
@@ -434,7 +453,7 @@ type MonthPagerProps<T> = {
|
|
|
434
453
|
/** Replace the default date badge in each day cell. Receives the day. */
|
|
435
454
|
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
436
455
|
} & SlotStyleProps<MonthViewSlot>;
|
|
437
|
-
declare function MonthPagerInner<T>({
|
|
456
|
+
declare function MonthPagerInner<T>({ showAdjacentMonths, showSixWeeks, ...rest }: MonthPagerProps<T>): ReactElement;
|
|
438
457
|
/**
|
|
439
458
|
* A horizontally swipeable month carousel. Swipe left/right to page between
|
|
440
459
|
* months; the committed month is reported through `onChangeDate`. It is the
|
|
@@ -462,7 +481,7 @@ type MonthListProps<T> = {
|
|
|
462
481
|
date: Date;
|
|
463
482
|
/** Events to render in the grids. Omit for an events-free date picker. */
|
|
464
483
|
events?: CalendarEvent$1<T>[];
|
|
465
|
-
weekStartsOn: WeekStartsOn;
|
|
484
|
+
weekStartsOn: WeekStartsOn$1;
|
|
466
485
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
467
486
|
weekdayFormat?: WeekdayFormat;
|
|
468
487
|
/**
|
|
@@ -555,4 +574,4 @@ declare const MonthList: typeof MonthListInner;
|
|
|
555
574
|
* Reanimated.
|
|
556
575
|
*/
|
|
557
576
|
declare function DefaultMonthEvent<T>({ event, mode, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
558
|
-
export { TimeGridMode as A, EventKeyExtractor as C, RenderEvent as D, RecurrenceRule as E, PartialCalendarTheme as F, darkTheme as I, defaultTheme as L, WeekdayFormat$1 as M, CalendarTheme as N, RenderEventArgs as O, CalendarThemeProvider as P, mergeTheme as R, EventDragStartHandler as S, RecurrenceFrequency 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, WeekStartsOn as j, ScrollToTimeOptions 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, useCalendarTheme as z };
|
|
577
|
+
export { TimeGridMode as A, EventKeyExtractor as C, RenderEvent as D, RecurrenceRule as E, PartialCalendarTheme as F, darkTheme as I, defaultTheme as L, WeekdayFormat$1 as M, CalendarTheme as N, RenderEventArgs as O, CalendarThemeProvider as P, mergeTheme as R, EventDragStartHandler as S, RecurrenceFrequency 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, WeekStartsOn$1 as j, ScrollToTimeOptions 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, useCalendarTheme as z };
|
|
@@ -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, 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;
|
|
@@ -223,7 +223,7 @@ interface ResolvedSlot<Style extends SlotStyle = ViewStyle> {
|
|
|
223
223
|
* Native text colour doesn't inherit from the badge). Event chips are styled
|
|
224
224
|
* by `renderEvent` (or the theme), not a slot.
|
|
225
225
|
*/
|
|
226
|
-
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "dayBadgeText" | "rangeBand" | "more" | "morePopover";
|
|
226
|
+
type MonthViewSlot = "title" | "weekdays" | "weekday" | "grid" | "week" | "day" | "dayBadge" | "dayBadgeText" | "rangeBand" | "createGhost" | "more" | "morePopover";
|
|
227
227
|
/** Props for {@link MonthView}, the single-month grid. */
|
|
228
228
|
type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
229
229
|
date: Date;
|
|
@@ -242,12 +242,19 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
242
242
|
chipHeight?: number;
|
|
243
243
|
/** Vertical gap between chip rows in pixels (default 2). */
|
|
244
244
|
chipGap?: number;
|
|
245
|
-
weekStartsOn: WeekStartsOn;
|
|
245
|
+
weekStartsOn: WeekStartsOn$1;
|
|
246
246
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
247
247
|
hiddenDays?: number[];
|
|
248
248
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
249
249
|
weekdayFormat?: WeekdayFormat;
|
|
250
250
|
locale?: Locale;
|
|
251
|
+
/**
|
|
252
|
+
* The instant whose calendar day is highlighted as today. Defaults to the
|
|
253
|
+
* device clock, and is read in `timeZone` when one is set.
|
|
254
|
+
*/
|
|
255
|
+
now?: Date;
|
|
256
|
+
/** Highlight today as it is in this IANA time zone (default: the device's). */
|
|
257
|
+
timeZone?: string;
|
|
251
258
|
/** Sort each day's events by start time before slicing. Default true. */
|
|
252
259
|
sortedMonthView?: boolean;
|
|
253
260
|
/** Template for the overflow label; `{moreCount}` is replaced. Default "{moreCount} More". */
|
|
@@ -317,6 +324,14 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
317
324
|
* plain tap fires `onPressDay`/`onPressCell` instead.
|
|
318
325
|
*/
|
|
319
326
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
327
|
+
/**
|
|
328
|
+
* Content inside the drag-to-create preview. Receives the full all-day range,
|
|
329
|
+
* with an exclusive end, that `onCreateEvent` would receive on release. A span
|
|
330
|
+
* crossing rows renders the component once per row with the same range.
|
|
331
|
+
* Requires `onCreateEvent`; content is clipped, noninteractive, and hidden
|
|
332
|
+
* from screen readers. Omit to keep the day highlight without preview content.
|
|
333
|
+
*/
|
|
334
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
320
335
|
/**
|
|
321
336
|
* Reports the day span of a create sweep **as it happens**, as the ordered
|
|
322
337
|
* inclusive `[start, end]` days (both at midnight), so a selection highlight can
|
|
@@ -348,7 +363,7 @@ type MonthViewProps<T> = SlotStyleProps<MonthViewSlot> & {
|
|
|
348
363
|
*/
|
|
349
364
|
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
350
365
|
};
|
|
351
|
-
declare function MonthViewInner<T>({ date,
|
|
366
|
+
declare function MonthViewInner<T>({ date, showAdjacentMonths, showSixWeeks, ...rest }: MonthViewProps<T>): ReactElement;
|
|
352
367
|
/**
|
|
353
368
|
* A single month rendered as a 7-column grid of day cells, each showing its
|
|
354
369
|
* event chips with a "+N more" overflow. Render it on its own for a static
|
|
@@ -375,11 +390,13 @@ type MonthPagerProps<T> = {
|
|
|
375
390
|
chipHeight?: number;
|
|
376
391
|
/** Gap between month chip rows in pixels (default 2). */
|
|
377
392
|
chipGap?: number;
|
|
378
|
-
weekStartsOn: WeekStartsOn;
|
|
393
|
+
weekStartsOn: WeekStartsOn$1;
|
|
379
394
|
/** Weekdays (0=Sunday…6=Saturday) hidden from the grid, e.g. `[0, 6]` for weekends off. */
|
|
380
395
|
hiddenDays?: number[];
|
|
381
396
|
weekdayFormat?: WeekdayFormat;
|
|
382
397
|
locale?: Locale;
|
|
398
|
+
now?: Date;
|
|
399
|
+
timeZone?: string;
|
|
383
400
|
sortedMonthView?: boolean;
|
|
384
401
|
moreLabel?: string;
|
|
385
402
|
/** Translations for the screen-reader words and gutter text; omitted keys use English. */
|
|
@@ -400,6 +417,8 @@ type MonthPagerProps<T> = {
|
|
|
400
417
|
onPressMore?: (events: CalendarEvent$1<T>[], date: Date) => void;
|
|
401
418
|
/** Drag across empty day cells to sweep out an all-day span for a new event. */
|
|
402
419
|
onCreateEvent?: (start: Date, end: Date) => void;
|
|
420
|
+
/** Content for each row of the live creation preview; requires `onCreateEvent`. */
|
|
421
|
+
renderCreateGhost?: ComponentType<CreateGhostArgs>;
|
|
403
422
|
/** Drag-to-select: reports the swept `[start, end]` days live. */
|
|
404
423
|
onSelectDrag?: (start: Date, end: Date) => void;
|
|
405
424
|
/** Days drawn as selected (a filled badge). */
|
|
@@ -434,7 +453,7 @@ type MonthPagerProps<T> = {
|
|
|
434
453
|
/** Replace the default date badge in each day cell. Receives the day. */
|
|
435
454
|
renderCustomDateForMonth?: (date: Date) => React.ReactNode;
|
|
436
455
|
} & SlotStyleProps<MonthViewSlot>;
|
|
437
|
-
declare function MonthPagerInner<T>({
|
|
456
|
+
declare function MonthPagerInner<T>({ showAdjacentMonths, showSixWeeks, ...rest }: MonthPagerProps<T>): ReactElement;
|
|
438
457
|
/**
|
|
439
458
|
* A horizontally swipeable month carousel. Swipe left/right to page between
|
|
440
459
|
* months; the committed month is reported through `onChangeDate`. It is the
|
|
@@ -462,7 +481,7 @@ type MonthListProps<T> = {
|
|
|
462
481
|
date: Date;
|
|
463
482
|
/** Events to render in the grids. Omit for an events-free date picker. */
|
|
464
483
|
events?: CalendarEvent$1<T>[];
|
|
465
|
-
weekStartsOn: WeekStartsOn;
|
|
484
|
+
weekStartsOn: WeekStartsOn$1;
|
|
466
485
|
/** Weekday header label width: `narrow` ("M"), `short` ("Mon", default), or `long` ("Monday"). */
|
|
467
486
|
weekdayFormat?: WeekdayFormat;
|
|
468
487
|
/**
|
|
@@ -555,4 +574,4 @@ declare const MonthList: typeof MonthListInner;
|
|
|
555
574
|
* Reanimated.
|
|
556
575
|
*/
|
|
557
576
|
declare function DefaultMonthEvent<T>({ event, mode, isAllDay, ampm, showTime, ellipsizeTitle, allDayLabel, accessibilityLabel: accessibilityLabelProp, cellStyle, onPress, onLongPress }: RenderEventArgs<T>): ReactElement;
|
|
558
|
-
export { TimeGridMode as A, EventKeyExtractor as C, RenderEvent as D, RecurrenceRule as E, PartialCalendarTheme as F, darkTheme as I, defaultTheme as L, WeekdayFormat$1 as M, CalendarTheme as N, RenderEventArgs as O, CalendarThemeProvider as P, mergeTheme as R, EventDragStartHandler as S, RecurrenceFrequency 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, WeekStartsOn as j, ScrollToTimeOptions 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, useCalendarTheme as z };
|
|
577
|
+
export { TimeGridMode as A, EventKeyExtractor as C, RenderEvent as D, RecurrenceRule as E, PartialCalendarTheme as F, darkTheme as I, defaultTheme as L, WeekdayFormat$1 as M, CalendarTheme as N, RenderEventArgs as O, CalendarThemeProvider as P, mergeTheme as R, EventDragStartHandler as S, RecurrenceFrequency 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, WeekStartsOn$1 as j, ScrollToTimeOptions 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, useCalendarTheme as z };
|