@super-calendar/native 2.8.2 → 2.9.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/dist/picker.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as PartialCalendarTheme, C as RenderEvent, E as WeekStartsOn, M as defaultTheme, N as mergeTheme, O as CalendarTheme, P as useCalendarTheme, a as MonthPager, b as ICalendarEvent, c as MonthViewProps, g as CalendarMode, h as CalendarEvent, j as darkTheme, k as CalendarThemeProvider, n as MonthList, o as MonthPagerProps, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, w as RenderEventArgs, y as EventKeyExtractor } from "./DefaultMonthEvent-Cewbec1K.mjs";
1
+ import { A as CalendarTheme, 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, a as MonthPager, c as MonthViewProps, g as CalendarMode, h as CalendarEvent, j as CalendarThemeProvider, n as MonthList, o as MonthPagerProps, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, x as EventKeyExtractor } from "./DefaultMonthEvent-BlnKHaq2.mjs";
2
2
  import { DateRange, DateSelectionConstraints, DaySelectionState, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, UseDateRangeOptions, UseMonthGridOptions, buildMonthGrid, buildMonthWeeks, daySelectionState, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, minutesIntoDay, nextDateRange, useDateRange, useMonthGrid } from "@super-calendar/core";
3
3
  export { type CalendarEvent, type CalendarMode, type CalendarTheme, CalendarThemeProvider, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultMonthEvent, type EventKeyExtractor, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type PartialCalendarTheme, type RenderEvent, type RenderEventArgs, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, mergeTheme, minutesIntoDay, nextDateRange, useCalendarTheme, useDateRange, useMonthGrid };
package/dist/picker.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as PartialCalendarTheme, C as RenderEvent, E as WeekStartsOn, M as defaultTheme, N as mergeTheme, O as CalendarTheme, P as useCalendarTheme, a as MonthPager, b as ICalendarEvent, c as MonthViewProps, g as CalendarMode, h as CalendarEvent, j as darkTheme, k as CalendarThemeProvider, n as MonthList, o as MonthPagerProps, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, w as RenderEventArgs, y as EventKeyExtractor } from "./DefaultMonthEvent-C_T4thzu.js";
1
+ import { A as CalendarTheme, 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, a as MonthPager, c as MonthViewProps, g as CalendarMode, h as CalendarEvent, j as CalendarThemeProvider, n as MonthList, o as MonthPagerProps, r as MonthListProps, s as MonthView, t as DefaultMonthEvent, x as EventKeyExtractor } from "./DefaultMonthEvent--9Jg6w-x.js";
2
2
  import { DateRange, DateSelectionConstraints, DaySelectionState, MonthGrid, MonthGridDay, MonthGridWeek, MonthGridWeekday, UseDateRangeOptions, UseMonthGridOptions, buildMonthGrid, buildMonthWeeks, daySelectionState, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, minutesIntoDay, nextDateRange, useDateRange, useMonthGrid } from "@super-calendar/core";
3
3
  export { type CalendarEvent, type CalendarMode, type CalendarTheme, CalendarThemeProvider, type DateRange, type DateSelectionConstraints, type DaySelectionState, DefaultMonthEvent, type EventKeyExtractor, type ICalendarEvent, type MonthGrid, type MonthGridDay, type MonthGridWeek, type MonthGridWeekday, MonthList, type MonthListProps, MonthPager, type MonthPagerProps, MonthView, type MonthViewProps, type PartialCalendarTheme, type RenderEvent, type RenderEventArgs, type UseDateRangeOptions, type UseMonthGridOptions, type WeekStartsOn, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, mergeTheme, minutesIntoDay, nextDateRange, useCalendarTheme, useDateRange, useMonthGrid };
package/dist/picker.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_MonthList = require("./MonthList-C-vBotP0.js");
2
+ const require_MonthList = require("./MonthList-DNT1LJkk.js");
3
3
  let _super_calendar_core = require("@super-calendar/core");
4
4
  exports.CalendarThemeProvider = require_MonthList.CalendarThemeProvider;
5
5
  exports.DefaultMonthEvent = require_MonthList.DefaultMonthEvent;
package/dist/picker.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { d as darkTheme, f as defaultTheme, i as MonthView, m as useCalendarTheme, n as DefaultMonthEvent, p as mergeTheme, r as MonthPager, t as MonthList, u as CalendarThemeProvider } from "./MonthList-DjAz4xoi.mjs";
1
+ import { d as darkTheme, f as defaultTheme, i as MonthView, m as useCalendarTheme, n as DefaultMonthEvent, p as mergeTheme, r as MonthPager, t as MonthList, u as CalendarThemeProvider } from "./MonthList-CjKhzOJX.mjs";
2
2
  import { buildMonthGrid, buildMonthWeeks, daySelectionState, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, minutesIntoDay, nextDateRange, useDateRange, useMonthGrid } from "@super-calendar/core";
3
3
  export { CalendarThemeProvider, DefaultMonthEvent, MonthList, MonthPager, MonthView, buildMonthGrid, buildMonthWeeks, darkTheme, daySelectionState, defaultTheme, getIsToday, getWeekDays, isDateSelectable, isRangeEndpoint, isSameCalendarDay, isWeekend, isWithinDateRange, mergeTheme, minutesIntoDay, nextDateRange, useCalendarTheme, useDateRange, useMonthGrid };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-calendar/native",
3
- "version": "2.8.2",
3
+ "version": "2.9.1",
4
4
  "description": "Gesture-driven, virtualized month / week / day calendar and date picker for React Native (and web via react-native-web).",
5
5
  "keywords": [
6
6
  "agenda",
@@ -64,7 +64,7 @@
64
64
  "access": "public"
65
65
  },
66
66
  "dependencies": {
67
- "@super-calendar/core": "2.8.2"
67
+ "@super-calendar/core": "2.9.1"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@legendapp/list": ">=3",
@@ -27,6 +27,7 @@ import type {
27
27
  WeekStartsOn,
28
28
  } from "../types";
29
29
  import {
30
+ type DateRange,
30
31
  type EventAccessibilityLabeler,
31
32
  eventsInTimeZone,
32
33
  expandRecurringEvents,
@@ -59,6 +60,12 @@ export type CalendarSlot = MonthViewSlot | TimeGridSlot | AgendaSlot | YearViewS
59
60
  export type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
60
61
  events: CalendarEvent<T>[];
61
62
  mode: CalendarMode;
63
+ /**
64
+ * The controlled anchor date, read in the device's local time zone. Construct
65
+ * it as a local date (`new Date(2026, 7, 24)`), not a UTC instant:
66
+ * `new Date("2026-08-24T00:00:00Z")` is still Aug 23 on devices west of UTC
67
+ * and anchors the previous week.
68
+ */
62
69
  date: Date;
63
70
  onChangeDate: (date: Date) => void;
64
71
  /** Fired alongside `onChangeDate` with the `[start, end]` of the newly-visible range. */
@@ -67,19 +74,20 @@ export type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
67
74
  /** Long-press an event (month/week/day). */
68
75
  onLongPressEvent?: (event: CalendarEvent<T>) => void;
69
76
  /**
70
- * Enable drag-to-move and drag-to-resize on the week/day grid. Called with the
71
- * dragged event and its new start/end (snapped to `dragStepMinutes`); update
72
- * your own event state in response. Long-press an event to move it (drag
73
- * horizontally to change the day too); drag its bottom grip to resize. Return
74
- * `false` to reject the drop (e.g. an overlap) and snap the event back.
77
+ * Enable drag-to-move and drag-to-resize. Called with the dragged event and its
78
+ * new start/end; update your own event state in response. On the week/day grid,
79
+ * long-press an event to move it (drag horizontally to change the day too) or
80
+ * drag its bottom grip to resize, snapped to `dragStepMinutes`. In `month` mode,
81
+ * long-press an event bar and drop it on another day: both ends shift by the
82
+ * days dragged, so the time of day and duration are kept. Return `false` to
83
+ * reject the drop (e.g. an overlap) and snap the event back.
75
84
  */
76
85
  onDragEvent?: EventDragHandler<T>;
77
86
  /**
78
- * Fired when a move or resize gesture begins on the week/day grid, before any
79
- * change is committed: on grab for a move (after the long-press), and when a
80
- * resize drag starts. Use it to trigger haptic feedback, e.g.
81
- * `Haptics.impactAsync()` from `expo-haptics`. Native-only and inert unless
82
- * `onDragEvent` is also set.
87
+ * Fired when a drag gesture begins, before any change is committed: on grab for
88
+ * a move (after the long-press), and when a week/day resize drag starts. Use it
89
+ * to trigger haptic feedback, e.g. `Haptics.impactAsync()` from `expo-haptics`.
90
+ * Native-only and inert unless `onDragEvent` is also set.
83
91
  */
84
92
  onDragStart?: EventDragStartHandler<T>;
85
93
  /** Minutes a drag-to-move/resize snaps to. Default 15. */
@@ -97,20 +105,47 @@ export type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
97
105
  onLongPressDay?: (date: Date) => void;
98
106
  /** Tap the "+N more" overflow label in a month cell. */
99
107
  onPressMore?: (events: CalendarEvent<T>[], date: Date) => void;
100
- /** Tap empty space on the week/day grid; receives the date+time pressed. */
108
+ /**
109
+ * Tap empty space; receives the date+time pressed on the week/day grid, or the
110
+ * tapped day at midnight in `month` mode (where it fires alongside `onPressDay`).
111
+ */
101
112
  onPressCell?: (date: Date) => void;
102
113
  /** After an empty-cell press, snap the pager back to the active page. Default false. */
103
114
  resetPageOnPressCell?: boolean;
104
115
  /** Long-press empty space on the week/day grid; receives the date+time. */
105
116
  onLongPressCell?: (date: Date) => void;
106
117
  /**
107
- * Enable drag-to-create on the week/day grid: long-press empty space and drag
108
- * to sweep out a new event's time range. Called on release with the snapped
109
- * `start`/`end` (to `dragStepMinutes`); create your own event in response. A
110
- * stationary press yields a one-step range. Native-only; supersedes
111
- * `onLongPressCell` on empty space when set.
118
+ * Enable drag-to-create: long-press empty space and drag to sweep out a new
119
+ * event, then release. On the week/day grid that is a time range snapped to
120
+ * `dragStepMinutes` (a stationary press yields a one-step range); in `month`
121
+ * mode it is an **all-day** span across the days swept — `start` at midnight of
122
+ * the first day, `end` at midnight after the last. Create your own event in
123
+ * response. Supersedes `onLongPressCell` (and, in month mode, `onLongPressDay`)
124
+ * on empty space when set.
112
125
  */
113
126
  onCreateEvent?: (start: Date, end: Date) => void;
127
+ /**
128
+ * Month and year modes: reports a create sweep's day span as it happens, as the
129
+ * ordered inclusive `[start, end]` days, so a selection highlight can follow the
130
+ * drag. Pair it with `useDateRange`'s `selectRange` to drive `selectedRange`.
131
+ * Enables the sweep on its own, so it works without `onCreateEvent`.
132
+ */
133
+ onSelectDrag?: (start: Date, end: Date) => void;
134
+ /** Days drawn as selected (a filled badge) in month and year modes. */
135
+ selectedDates?: Date[];
136
+ /** A selected span: endpoints get a filled badge, the span gets the range band. */
137
+ selectedRange?: DateRange;
138
+ /**
139
+ * Fill the whole month cell with the range band instead of the default centered
140
+ * rounded "pill" strip. Default false.
141
+ */
142
+ fillCellOnSelection?: boolean;
143
+ /** Earliest selectable day (inclusive); earlier days render disabled. */
144
+ minDate?: Date;
145
+ /** Latest selectable day (inclusive); later days render disabled. */
146
+ maxDate?: Date;
147
+ /** Return true to render a specific day disabled (dimmed, taps ignored). */
148
+ isDateDisabled?: (date: Date) => boolean;
114
149
  /** Tap a day's column header on the week/day grid (default header only). */
115
150
  onPressDateHeader?: (date: Date) => void;
116
151
  /**
@@ -209,6 +244,11 @@ export type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
209
244
  hourComponent?: HourRenderer;
210
245
  /** Always render six week rows in month view, for a fixed-height grid. Default false. */
211
246
  showSixWeeks?: boolean;
247
+ /**
248
+ * Render the built-in "MMMM yyyy" title above the month grid. Default true. Set
249
+ * false when your own header already shows the month and year. Month mode only.
250
+ */
251
+ showTitle?: boolean;
212
252
  /** Allow swiping between pages (all modes). Default true. */
213
253
  swipeEnabled?: boolean;
214
254
  /** Show the vertical scroll indicator on the week/day grid. Default true. */
@@ -380,6 +420,13 @@ export function Calendar<T>({
380
420
  resetPageOnPressCell,
381
421
  onLongPressCell,
382
422
  onCreateEvent,
423
+ onSelectDrag,
424
+ selectedDates,
425
+ selectedRange,
426
+ fillCellOnSelection,
427
+ minDate,
428
+ maxDate,
429
+ isDateDisabled,
383
430
  onPressDateHeader,
384
431
  maxVisibleEventCount,
385
432
  sortedMonthView,
@@ -416,6 +463,7 @@ export function Calendar<T>({
416
463
  weekNumberPrefix,
417
464
  hourComponent,
418
465
  showSixWeeks,
466
+ showTitle,
419
467
  swipeEnabled,
420
468
  showVerticalScrollIndicator,
421
469
  verticalScrollEnabled,
@@ -557,6 +605,7 @@ export function Calendar<T>({
557
605
  disableMonthEventCellPress={disableMonthEventCellPress}
558
606
  isRTL={isRTL}
559
607
  showSixWeeks={showSixWeeks}
608
+ showTitle={showTitle}
560
609
  activeDate={activeDate}
561
610
  renderHeaderForMonthView={renderHeaderForMonthView}
562
611
  renderCustomDateForMonth={renderCustomDateForMonth}
@@ -565,9 +614,22 @@ export function Calendar<T>({
565
614
  keyExtractor={keyExtractor}
566
615
  onPressDay={onPressDay}
567
616
  onLongPressDay={onLongPressDay}
617
+ onPressCell={onPressCell}
568
618
  onPressEvent={handlePressEvent}
569
619
  onLongPressEvent={handleLongPressEvent}
570
620
  onPressMore={onPressMore}
621
+ onCreateEvent={onCreateEvent}
622
+ onSelectDrag={onSelectDrag}
623
+ onDragEvent={onDragEvent}
624
+ onDragStart={onDragStart}
625
+ eventStartEditable={eventStartEditable}
626
+ eventOverlap={eventOverlap}
627
+ selectedDates={selectedDates}
628
+ selectedRange={selectedRange}
629
+ fillCellOnSelection={fillCellOnSelection}
630
+ minDate={minDate}
631
+ maxDate={maxDate}
632
+ isDateDisabled={isDateDisabled}
571
633
  onChangeDate={handleChangeDate}
572
634
  freeSwipe={freeSwipe}
573
635
  swipeEnabled={swipeEnabled}
@@ -582,8 +644,15 @@ export function Calendar<T>({
582
644
  hiddenDays={hiddenDays}
583
645
  locale={locale}
584
646
  activeDate={activeDate}
647
+ selectedDates={selectedDates}
648
+ selectedRange={selectedRange}
649
+ minDate={minDate}
650
+ maxDate={maxDate}
651
+ isDateDisabled={isDateDisabled}
585
652
  onPressDay={onPressDay}
586
653
  onPressMonth={onPressMonth}
654
+ onSelectDrag={onSelectDrag}
655
+ onCreateEvent={onCreateEvent}
587
656
  classNames={classNames}
588
657
  styles={styleOverrides}
589
658
  />
@@ -17,8 +17,18 @@ import {
17
17
  type ViewStyle,
18
18
  } from "react-native";
19
19
  import { useCalendarTheme } from "../theme";
20
- import type { CalendarEvent, EventKeyExtractor, RenderEvent, WeekStartsOn } from "../types";
20
+ import type {
21
+ CalendarEvent,
22
+ EventDragHandler,
23
+ EventDragStartHandler,
24
+ EventKeyExtractor,
25
+ RenderEvent,
26
+ WeekStartsOn,
27
+ } from "../types";
21
28
  import {
29
+ type CalendarSelection,
30
+ CalendarSelectionProvider,
31
+ type DateRange,
22
32
  type WeekdayFormat,
23
33
  filterHiddenDays,
24
34
  getWeekDays,
@@ -62,13 +72,41 @@ export type MonthPagerProps<T> = {
62
72
  keyExtractor: EventKeyExtractor<T>;
63
73
  onPressDay?: (date: Date) => void;
64
74
  onLongPressDay?: (date: Date) => void;
75
+ /** Tap an empty day cell; receives the day at midnight. */
76
+ onPressCell?: (date: Date) => void;
65
77
  onPressEvent: (event: CalendarEvent<T>) => void;
66
78
  onLongPressEvent?: (event: CalendarEvent<T>) => void;
67
79
  onPressMore?: (events: CalendarEvent<T>[], date: Date) => void;
80
+ /** Drag across empty day cells to sweep out an all-day span for a new event. */
81
+ onCreateEvent?: (start: Date, end: Date) => void;
82
+ /** Drag-to-select: reports the swept `[start, end]` days live. */
83
+ onSelectDrag?: (start: Date, end: Date) => void;
84
+ /** Days drawn as selected (a filled badge). */
85
+ selectedDates?: Date[];
86
+ /** A selected span: endpoints get a filled badge, the span gets the range band. */
87
+ selectedRange?: DateRange;
88
+ /** Fill the whole cell on selection instead of the default rounded pill band. */
89
+ fillCellOnSelection?: boolean;
90
+ /** Earliest selectable day (inclusive); earlier days render disabled. */
91
+ minDate?: Date;
92
+ /** Latest selectable day (inclusive); later days render disabled. */
93
+ maxDate?: Date;
94
+ /** Return true to render a specific day disabled (dimmed, taps ignored). */
95
+ isDateDisabled?: (date: Date) => boolean;
96
+ /** Drag an event bar onto another day to reschedule it. */
97
+ onDragEvent?: EventDragHandler<T>;
98
+ /** Fired when a month drag picks an event up, before anything is committed. */
99
+ onDragStart?: EventDragStartHandler<T>;
100
+ /** Allow moving events by default (per-event `startEditable` overrides). Default true. */
101
+ eventStartEditable?: boolean;
102
+ /** Reject a drop that would overlap another event (default true = allowed). */
103
+ eventOverlap?: boolean;
68
104
  onChangeDate: (date: Date) => void;
69
105
  freeSwipe?: boolean;
70
106
  swipeEnabled?: boolean;
71
107
  showSixWeeks?: boolean;
108
+ /** Render the "MMMM yyyy" title above the weekday header. Default true. */
109
+ showTitle?: boolean;
72
110
  activeDate?: Date;
73
111
  /** Replace the weekday-label header above the month grid. Receives the week's days. */
74
112
  renderHeaderForMonthView?: (weekDays: Date[]) => React.ReactNode;
@@ -95,13 +133,27 @@ function MonthPagerInner<T>({
95
133
  keyExtractor,
96
134
  onPressDay,
97
135
  onLongPressDay,
136
+ onPressCell,
98
137
  onPressEvent,
99
138
  onLongPressEvent,
100
139
  onPressMore,
140
+ onCreateEvent,
141
+ onSelectDrag,
142
+ selectedDates,
143
+ selectedRange,
144
+ fillCellOnSelection,
145
+ minDate,
146
+ maxDate,
147
+ isDateDisabled,
148
+ onDragEvent,
149
+ onDragStart,
150
+ eventStartEditable,
151
+ eventOverlap,
101
152
  onChangeDate,
102
153
  freeSwipe = false,
103
154
  swipeEnabled = true,
104
155
  showSixWeeks = false,
156
+ showTitle = true,
105
157
  activeDate,
106
158
  renderHeaderForMonthView,
107
159
  renderCustomDateForMonth,
@@ -231,7 +283,21 @@ function MonthPagerInner<T>({
231
283
  // `events` (events that arrive after mount, e.g. from an async fetch, must
232
284
  // repaint the mounted page) and `activeDate` (the selected-day highlight must
233
285
  // move). Mirrors listExtraData in TimeGrid.
234
- const listExtraData = useMemo(() => ({ events, activeDate }), [events, activeDate]);
286
+ // `fillCellOnSelection` and `onSelectDrag` ride along because they reach the
287
+ // grids as renderItem props, not through the selection context below: toggling
288
+ // a "pick dates" mode on must reach the pages already rendered.
289
+ const listExtraData = useMemo(
290
+ () => ({ events, activeDate, fillCellOnSelection, dragSelect: onSelectDrag != null }),
291
+ [events, activeDate, fillCellOnSelection, onSelectDrag],
292
+ );
293
+
294
+ // Selection reaches the grids through context, not `renderItem`, so a change
295
+ // repaints the pages LegendList has already cached (which `extraData` alone
296
+ // would not, since the pages are keyed by month and never recycled).
297
+ const selection = useMemo<CalendarSelection>(
298
+ () => ({ selectedDates, selectedRange, minDate, maxDate, isDateDisabled }),
299
+ [selectedDates, selectedRange, minDate, maxDate, isDateDisabled],
300
+ );
235
301
 
236
302
  const snapToIndices = useMemo(() => monthDates.map((_, index) => index), [monthDates]);
237
303
  const keyExtractorList = useCallback((item: Date) => item.toISOString(), []);
@@ -263,9 +329,17 @@ function MonthPagerInner<T>({
263
329
  keyExtractor={keyExtractor}
264
330
  onPressDay={onPressDay}
265
331
  onLongPressDay={onLongPressDay}
332
+ onPressCell={onPressCell}
266
333
  onPressEvent={onPressEvent}
267
334
  onLongPressEvent={onLongPressEvent}
268
335
  onPressMore={onPressMore}
336
+ onCreateEvent={onCreateEvent}
337
+ onSelectDrag={onSelectDrag}
338
+ fillCellOnSelection={fillCellOnSelection}
339
+ onDragEvent={onDragEvent}
340
+ onDragStart={onDragStart}
341
+ eventStartEditable={eventStartEditable}
342
+ eventOverlap={eventOverlap}
269
343
  renderCustomDateForMonth={renderCustomDateForMonth}
270
344
  classNames={classNames}
271
345
  styles={styleOverrides}
@@ -278,10 +352,12 @@ function MonthPagerInner<T>({
278
352
  events,
279
353
  maxVisibleEventCount,
280
354
  weekStartsOn,
355
+ hiddenDays,
281
356
  locale,
282
357
  sortedMonthView,
283
358
  moreLabel,
284
359
  showAdjacentMonths,
360
+ highlightWeekends,
285
361
  disableMonthEventCellPress,
286
362
  isRTL,
287
363
  showSixWeeks,
@@ -291,9 +367,17 @@ function MonthPagerInner<T>({
291
367
  keyExtractor,
292
368
  onPressDay,
293
369
  onLongPressDay,
370
+ onPressCell,
294
371
  onPressEvent,
295
372
  onLongPressEvent,
296
373
  onPressMore,
374
+ onCreateEvent,
375
+ onSelectDrag,
376
+ fillCellOnSelection,
377
+ onDragEvent,
378
+ onDragStart,
379
+ eventStartEditable,
380
+ eventOverlap,
297
381
  renderCustomDateForMonth,
298
382
  classNames,
299
383
  styleOverrides,
@@ -301,68 +385,72 @@ function MonthPagerInner<T>({
301
385
  );
302
386
 
303
387
  return (
304
- <View ref={containerRef} style={[styles.container, theme.containers.monthContainer]}>
305
- {/* The active month's title, above the (shared) weekday header — mirrors the
388
+ <CalendarSelectionProvider value={selection}>
389
+ <View ref={containerRef} style={[styles.container, theme.containers.monthContainer]}>
390
+ {/* The active month's title, above the (shared) weekday header — mirrors the
306
391
  dom MonthView's title. The grids below omit their own title/weekdays. */}
307
- <Text
308
- {...slot<TextStyle>("title", {
309
- base: styles.monthTitle,
310
- themed: [theme.text.monthTitle, { color: theme.colors.text }],
311
- })}
312
- allowFontScaling={false}
313
- >
314
- {format(date, "MMMM yyyy", locale ? { locale } : undefined)}
315
- </Text>
316
- {renderHeaderForMonthView ? (
317
- renderHeaderForMonthView(weekDays)
318
- ) : (
319
- <MonthWeekdayHeader
320
- weekDays={weekDays}
321
- weekdayFormat={weekdayFormat}
322
- locale={locale}
323
- slot={slot}
324
- />
325
- )}
326
- <View
327
- style={styles.pager}
328
- onLayout={(event) => {
329
- setPageHeight(event.nativeEvent.layout.height);
330
- setContainerWidth(event.nativeEvent.layout.width);
331
- }}
332
- >
333
- <LegendList
334
- // Remount when the measured page height changes so the list adopts the
335
- // corrected item height. Without this the list can keep the oversized
336
- // initial (window-height) seed and clip the last week row.
337
- key={pageHeight}
338
- ref={listRef}
339
- style={isWeb ? [styles.pagerList, styles.webNoScroll] : styles.pagerList}
340
- data={monthDates}
341
- extraData={listExtraData}
342
- horizontal
343
- recycleItems={false}
344
- keyExtractor={keyExtractorList}
345
- getFixedItemSize={getFixedItemSize}
346
- // On web LegendList ignores these RN scroll props (it leaks them to the
347
- // DOM as unknown attributes), so omit them there and disable horizontal
348
- // scroll via `webNoScroll`; paging is driven by the arrow keys instead.
349
- // Native: paging makes each swipe hard-stop at the adjacent month, while
350
- // `freeSwipe` lets momentum carry across months and snap to a boundary.
351
- {...(isWeb
352
- ? null
353
- : {
354
- scrollEnabled: swipeEnabled,
355
- pagingEnabled: !freeSwipe,
356
- snapToIndices: freeSwipe ? snapToIndices : undefined,
357
- })}
358
- initialScrollIndex={activeIndex}
359
- showsHorizontalScrollIndicator={false}
360
- viewabilityConfig={PAGE_VIEWABILITY}
361
- onViewableItemsChanged={handleViewableItemsChanged}
362
- renderItem={renderItem}
363
- />
392
+ {showTitle ? (
393
+ <Text
394
+ {...slot<TextStyle>("title", {
395
+ base: styles.monthTitle,
396
+ themed: [theme.text.monthTitle, { color: theme.colors.text }],
397
+ })}
398
+ allowFontScaling={false}
399
+ >
400
+ {format(date, "MMMM yyyy", locale ? { locale } : undefined)}
401
+ </Text>
402
+ ) : null}
403
+ {renderHeaderForMonthView ? (
404
+ renderHeaderForMonthView(weekDays)
405
+ ) : (
406
+ <MonthWeekdayHeader
407
+ weekDays={weekDays}
408
+ weekdayFormat={weekdayFormat}
409
+ locale={locale}
410
+ slot={slot}
411
+ />
412
+ )}
413
+ <View
414
+ style={styles.pager}
415
+ onLayout={(event) => {
416
+ setPageHeight(event.nativeEvent.layout.height);
417
+ setContainerWidth(event.nativeEvent.layout.width);
418
+ }}
419
+ >
420
+ <LegendList
421
+ // Remount when the measured page height changes so the list adopts the
422
+ // corrected item height. Without this the list can keep the oversized
423
+ // initial (window-height) seed and clip the last week row.
424
+ key={pageHeight}
425
+ ref={listRef}
426
+ style={isWeb ? [styles.pagerList, styles.webNoScroll] : styles.pagerList}
427
+ data={monthDates}
428
+ extraData={listExtraData}
429
+ horizontal
430
+ recycleItems={false}
431
+ keyExtractor={keyExtractorList}
432
+ getFixedItemSize={getFixedItemSize}
433
+ // On web LegendList ignores these RN scroll props (it leaks them to the
434
+ // DOM as unknown attributes), so omit them there and disable horizontal
435
+ // scroll via `webNoScroll`; paging is driven by the arrow keys instead.
436
+ // Native: paging makes each swipe hard-stop at the adjacent month, while
437
+ // `freeSwipe` lets momentum carry across months and snap to a boundary.
438
+ {...(isWeb
439
+ ? null
440
+ : {
441
+ scrollEnabled: swipeEnabled,
442
+ pagingEnabled: !freeSwipe,
443
+ snapToIndices: freeSwipe ? snapToIndices : undefined,
444
+ })}
445
+ initialScrollIndex={activeIndex}
446
+ showsHorizontalScrollIndicator={false}
447
+ viewabilityConfig={PAGE_VIEWABILITY}
448
+ onViewableItemsChanged={handleViewableItemsChanged}
449
+ renderItem={renderItem}
450
+ />
451
+ </View>
364
452
  </View>
365
- </View>
453
+ </CalendarSelectionProvider>
366
454
  );
367
455
  }
368
456