@super-calendar/native 2.10.0 → 2.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/picker.d.mts CHANGED
@@ -1,3 +1,3 @@
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";
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-B9KzVzFa.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 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";
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-DlIIWDzr.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-DNT1LJkk.js");
2
+ const require_MonthList = require("./MonthList-sGAZxQZ_.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-CjKhzOJX.mjs";
1
+ import { f as CalendarThemeProvider, g as useCalendarTheme, h as mergeTheme, i as MonthView, m as defaultTheme, n as DefaultMonthEvent, p as darkTheme, r as MonthPager, t as MonthList } from "./MonthList-B-UE37ZG.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.10.0",
3
+ "version": "2.11.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,13 +64,13 @@
64
64
  "access": "public"
65
65
  },
66
66
  "dependencies": {
67
- "@super-calendar/core": "2.10.0"
67
+ "@super-calendar/core": "2.11.1"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@legendapp/list": ">=3",
71
71
  "date-fns": ">=3",
72
72
  "react": ">=18",
73
- "react-native": ">=0.74",
73
+ "react-native": ">=0.74 <2",
74
74
  "react-native-gesture-handler": ">=2.16",
75
75
  "react-native-reanimated": ">=4.0.0 <5",
76
76
  "react-native-worklets": ">=0.5"
@@ -1,7 +1,7 @@
1
1
  import { LegendList, type LegendListRenderItemProps } from "@legendapp/list/react-native";
2
2
  import { format, isSameDay, type Locale, startOfDay } from "date-fns";
3
3
  import { type ComponentType, type ReactElement, useCallback, useMemo } from "react";
4
- import { StyleSheet, Text, type TextStyle, View } from "react-native";
4
+ import { StyleSheet, Text, type TextStyle, View, type ScrollViewProps } from "react-native";
5
5
  import { useCalendarTheme } from "../theme";
6
6
  import type { CalendarEvent, EventKeyExtractor, RenderEvent } from "../types";
7
7
  import { createSlots, type SlotStyleProps } from "../utils/slots";
@@ -27,6 +27,8 @@ export type AgendaProps<T> = SlotStyleProps<AgendaSlot> & {
27
27
  activeDate?: Date;
28
28
  /** Drawn between rows of the agenda list. */
29
29
  itemSeparatorComponent?: ComponentType<unknown> | null;
30
+ /** Pull-to-refresh control, mounted on the list's scroll view. */
31
+ refreshControl?: ScrollViewProps["refreshControl"];
30
32
  };
31
33
 
32
34
  type Row<T> =
@@ -48,6 +50,7 @@ export function Agenda<T>({
48
50
  onPressDay,
49
51
  activeDate,
50
52
  itemSeparatorComponent,
53
+ refreshControl,
51
54
  classNames,
52
55
  styles: styleOverrides,
53
56
  }: AgendaProps<T>): ReactElement {
@@ -145,6 +148,7 @@ export function Agenda<T>({
145
148
  (itemSeparatorComponent ?? undefined) as ComponentType<{ leadingItem: Row<T> }> | undefined
146
149
  }
147
150
  recycleItems={false}
151
+ refreshControl={refreshControl}
148
152
  />
149
153
  );
150
154
  }
@@ -1,5 +1,5 @@
1
1
  import { addDays, startOfDay } from "date-fns";
2
- import { StyleSheet, Text, type TextStyle, View } from "react-native";
2
+ import { type LayoutChangeEvent, StyleSheet, View } from "react-native";
3
3
  import { useCalendarTheme } from "../theme";
4
4
  import type { CalendarEvent, CalendarMode, EventKeyExtractor, RenderEvent } from "../types";
5
5
  import { useSlots } from "../utils/slots";
@@ -7,36 +7,38 @@ import { isAllDayEvent, isBackgroundEvent } from "@super-calendar/core";
7
7
 
8
8
  // The lane's slots are a subset of the TimeGrid slot union; typed locally so
9
9
  // this file doesn't import the full TimeGrid type.
10
- type AllDayLaneSlot = "allDayLane" | "allDayLabel" | "allDayColumn" | "allDayEvent";
10
+ type AllDayLaneSlot = "allDayLane" | "allDayColumn" | "allDayEvent";
11
11
 
12
12
  type AllDayLaneProps<T> = {
13
13
  days: Date[];
14
14
  events: CalendarEvent<T>[];
15
15
  mode: CalendarMode;
16
- hourColumnWidth: number;
17
16
  dayWidth: number;
18
17
  renderEvent: RenderEvent<T>;
19
18
  keyExtractor: EventKeyExtractor<T>;
20
19
  onPressEvent: (event: CalendarEvent<T>) => void;
21
20
  onLongPressEvent?: (event: CalendarEvent<T>) => void;
21
+ /** Reports the lane's natural height, which the grid's all-day band follows. */
22
+ onLayout?: (event: LayoutChangeEvent) => void;
22
23
  };
23
24
 
24
25
  /**
25
- * The all-day lane that sits above the scrolling time grid. All-day events are
26
- * excluded from the timed columns (see `layoutDayEvents`) and shown here,
27
- * stacked under their day(s). Renders nothing when no day has an all-day event,
28
- * so timed-only calendars are unaffected.
26
+ * The all-day lane of one page, pinned above the scrolling hours. All-day
27
+ * events are excluded from the timed columns (see `layoutDayEvents`) and shown
28
+ * here, stacked under their day(s). Always rendered so every page reports a
29
+ * height, zero when the week has none, which the band above the grid follows
30
+ * live as you swipe; the "all-day" label lives in the hour column.
29
31
  */
30
32
  export function AllDayLane<T>({
31
33
  days,
32
34
  events,
33
35
  mode,
34
- hourColumnWidth,
35
36
  dayWidth,
36
37
  renderEvent,
37
38
  keyExtractor,
38
39
  onPressEvent,
39
40
  onLongPressEvent,
41
+ onLayout,
40
42
  }: AllDayLaneProps<T>) {
41
43
  const theme = useCalendarTheme();
42
44
  const slot = useSlots<AllDayLaneSlot>();
@@ -50,50 +52,40 @@ export function AllDayLane<T>({
50
52
  return allDay.filter((event) => event.start < next && event.end > start);
51
53
  });
52
54
 
53
- if (perDay.every((list) => list.length === 0)) return null;
54
-
55
55
  return (
56
56
  <View
57
57
  {...slot("allDayLane", {
58
58
  base: styles.lane,
59
- themed: [{ borderBottomColor: theme.colors.gridLine }, theme.containers.allDayLane],
59
+ themed: theme.containers.allDayLane,
60
60
  })}
61
+ onLayout={onLayout}
61
62
  >
62
- <View style={[styles.gutter, { width: hourColumnWidth }]}>
63
- {/* The "all-day" gutter label, mirroring the dom renderer: small, muted,
64
- and right-aligned against the timed columns. Centered vertically so it
65
- lines up with the chips whether the lane holds one event or several. */}
66
- <Text
67
- {...slot<TextStyle>("allDayLabel", {
68
- base: styles.label,
69
- themed: { color: theme.colors.textMuted },
70
- })}
71
- allowFontScaling={false}
72
- >
73
- all-day
74
- </Text>
75
- </View>
76
- {days.map((day, dayIndex) => (
77
- <View
78
- key={day.toISOString()}
79
- {...slot("allDayColumn", {
80
- base: [styles.column, { width: dayWidth }],
81
- themed: theme.containers.allDayColumn,
82
- })}
83
- >
84
- {perDay[dayIndex].map((event, index) => (
85
- <View key={keyExtractor(event, index)} {...slot("allDayEvent", { base: styles.chip })}>
86
- <RenderEventComponent
87
- event={event}
88
- mode={mode}
89
- isAllDay
90
- onPress={() => onPressEvent(event)}
91
- onLongPress={onLongPressEvent ? () => onLongPressEvent(event) : undefined}
92
- />
63
+ {perDay.every((list) => list.length === 0)
64
+ ? null
65
+ : days.map((day, dayIndex) => (
66
+ <View
67
+ key={day.toISOString()}
68
+ {...slot("allDayColumn", {
69
+ base: [styles.column, { width: dayWidth }],
70
+ themed: theme.containers.allDayColumn,
71
+ })}
72
+ >
73
+ {perDay[dayIndex].map((event, index) => (
74
+ <View
75
+ key={keyExtractor(event, index)}
76
+ {...slot("allDayEvent", { base: styles.chip })}
77
+ >
78
+ <RenderEventComponent
79
+ event={event}
80
+ mode={mode}
81
+ isAllDay
82
+ onPress={() => onPressEvent(event)}
83
+ onLongPress={onLongPressEvent ? () => onLongPressEvent(event) : undefined}
84
+ />
85
+ </View>
86
+ ))}
93
87
  </View>
94
88
  ))}
95
- </View>
96
- ))}
97
89
  </View>
98
90
  );
99
91
  }
@@ -101,15 +93,6 @@ export function AllDayLane<T>({
101
93
  const styles = StyleSheet.create({
102
94
  lane: {
103
95
  flexDirection: "row",
104
- borderBottomWidth: StyleSheet.hairlineWidth,
105
- },
106
- gutter: {
107
- justifyContent: "center",
108
- },
109
- label: {
110
- fontSize: 10,
111
- textAlign: "right",
112
- paddingRight: 6,
113
96
  },
114
97
  column: {
115
98
  paddingVertical: 2,
@@ -13,7 +13,7 @@ import {
13
13
  startOfYear,
14
14
  } from "date-fns";
15
15
  import { type ReactElement, useCallback, useMemo } from "react";
16
- import type { StyleProp, ViewStyle } from "react-native";
16
+ import type { ScrollViewProps, StyleProp, ViewStyle } from "react-native";
17
17
  import { useSharedValue } from "react-native-reanimated";
18
18
  import { CalendarThemeProvider, mergeTheme, type PartialCalendarTheme } from "../theme";
19
19
  import type {
@@ -34,6 +34,8 @@ import {
34
34
  type WeekdayFormat,
35
35
  getViewDays,
36
36
  } from "@super-calendar/core";
37
+ import { type CalendarLabels, resolveCalendarLabels } from "@super-calendar/core";
38
+ import { CalendarLabelsContext } from "../utils/labels";
37
39
  import { type SlotStyleProps } from "../utils/slots";
38
40
  import { YearView, type YearViewSlot } from "./YearView";
39
41
  import { Agenda, type AgendaSlot } from "./Agenda";
@@ -158,6 +160,8 @@ export type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
158
160
  sortedMonthView?: boolean;
159
161
  /** Month overflow label template; `{moreCount}` is replaced. Default "{moreCount} More". */
160
162
  moreLabel?: string;
163
+ /** Translations for the screen-reader words and gutter text; omitted keys use English. */
164
+ labels?: Partial<CalendarLabels>;
161
165
  /** Show dimmed adjacent-month days in the month grid. Default true. */
162
166
  showAdjacentMonths?: boolean;
163
167
  /** Ignore taps on month-cell events (day taps still fire). Default false. */
@@ -207,6 +211,18 @@ export type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
207
211
  * band stays non-interactive and hidden from assistive tech.
208
212
  */
209
213
  renderBusinessHours?: (band: BusinessHoursBand) => React.ReactNode;
214
+ /**
215
+ * Week/day grid only: a component that draws a `display: "background"` event's
216
+ * band in place of the themed shade. Rendered as a real component, like
217
+ * `renderEvent`, so it may use hooks. It receives `event`, `mode`, a live
218
+ * `boxHeight`, `continuesBefore` / `continuesAfter` for a multi-day event, and
219
+ * `onPress` / `onLongPress`, which fire `onPressEvent` / `onLongPressEvent`.
220
+ * The band lets touches through to what you render and stops hiding itself
221
+ * from assistive tech, so a pressable there works; cell presses and
222
+ * drag-to-create are unreachable underneath it. Without this prop the band
223
+ * stays a shaded, non-interactive range. The resource timeline keeps the shade.
224
+ */
225
+ renderBackgroundEvent?: RenderEvent<T>;
210
226
  /** Stable key per event. Defaults to start-time + index. */
211
227
  keyExtractor?: EventKeyExtractor<T>;
212
228
  /** Partial theme merged over the defaults. */
@@ -234,11 +250,26 @@ export type CalendarProps<T> = SlotStyleProps<CalendarSlot> & {
234
250
  /** Sub-hour divider lines per hour on the week/day grid (e.g. 2 = half-hours). Default 1. */
235
251
  timeslots?: number;
236
252
  /**
237
- * Show the all-day lane above the week/day grid. Default true. When false the
238
- * lane is never rendered, so all-day events (see `ICalendarEvent.allDay` and
239
- * whole-day spans) are not shown on the time grid.
253
+ * Show the all-day lane above the week/day grid. Default true: the lane is
254
+ * sized to the week's all-day events, collapsing to nothing when there are
255
+ * none, and its height follows the week as you swipe. When false the lane is
256
+ * never rendered, so
257
+ * all-day events (see `ICalendarEvent.allDay` and whole-day spans) are not
258
+ * shown on the time grid.
240
259
  */
241
260
  showAllDayEventCell?: boolean;
261
+ /**
262
+ * Show the "all-day" text label in the week/day hour column. Default false: a
263
+ * week with no all-day events then shows no lane at all, rather than a label
264
+ * beside an empty row; with the label on, it slides away with the lane.
265
+ */
266
+ showAllDayLabel?: boolean;
267
+ /**
268
+ * Pull-to-refresh for the modes that scroll vertically: pass a `RefreshControl`
269
+ * element and it wraps the schedule list, the week/day grid's scroll view or
270
+ * the year view. Month pages scroll sideways, so it has no effect there.
271
+ */
272
+ refreshControl?: ScrollViewProps["refreshControl"];
242
273
  /** Tint weekend columns (default true). Set false to treat weekends normally. */
243
274
  highlightWeekends?: boolean;
244
275
  /** Allow moving events by default (per-event `startEditable` overrides). Default true. */
@@ -442,6 +473,7 @@ export function Calendar<T>({
442
473
  maxVisibleEventCount,
443
474
  sortedMonthView,
444
475
  moreLabel,
476
+ labels,
445
477
  showAdjacentMonths,
446
478
  disableMonthEventCellPress,
447
479
  weekStartsOn = 0,
@@ -456,6 +488,7 @@ export function Calendar<T>({
456
488
  calendarCellStyle,
457
489
  businessHours,
458
490
  renderBusinessHours,
491
+ renderBackgroundEvent,
459
492
  keyExtractor = defaultKeyExtractor as EventKeyExtractor<T>,
460
493
  theme,
461
494
  cellHeight: cellHeightProp,
@@ -468,6 +501,8 @@ export function Calendar<T>({
468
501
  hideHours,
469
502
  timeslots,
470
503
  showAllDayEventCell,
504
+ showAllDayLabel,
505
+ refreshControl,
471
506
  highlightWeekends,
472
507
  eventStartEditable,
473
508
  eventDurationEditable,
@@ -600,153 +635,165 @@ export function Calendar<T>({
600
635
  eventAccessibilityLabel,
601
636
  ]);
602
637
 
638
+ const resolvedLabels = useMemo(() => resolveCalendarLabels(labels), [labels]);
639
+
603
640
  return (
604
641
  <CalendarThemeProvider value={mergedTheme}>
605
- {mode === "month" ? (
606
- <MonthPager
607
- date={date}
608
- events={displayEvents}
609
- maxVisibleEventCount={maxVisibleEventCount}
610
- weekStartsOn={weekStartsOn}
611
- hiddenDays={hiddenDays}
612
- weekdayFormat={weekdayFormat}
613
- locale={locale}
614
- sortedMonthView={sortedMonthView}
615
- moreLabel={moreLabel}
616
- showAdjacentMonths={showAdjacentMonths}
617
- highlightWeekends={highlightWeekends}
618
- disableMonthEventCellPress={disableMonthEventCellPress}
619
- isRTL={isRTL}
620
- showSixWeeks={showSixWeeks}
621
- showTitle={showTitle}
622
- activeDate={activeDate}
623
- renderHeaderForMonthView={renderHeaderForMonthView}
624
- renderCustomDateForMonth={renderCustomDateForMonth}
625
- calendarCellStyle={calendarCellStyle}
626
- renderEvent={resolvedRenderEvent}
627
- keyExtractor={keyExtractor}
628
- onPressDay={onPressDay}
629
- onLongPressDay={onLongPressDay}
630
- onPressCell={onPressCell}
631
- onPressEvent={handlePressEvent}
632
- onLongPressEvent={handleLongPressEvent}
633
- onPressMore={onPressMore}
634
- onCreateEvent={onCreateEvent}
635
- onSelectDrag={onSelectDrag}
636
- onDragEvent={onDragEvent}
637
- onDragStart={onDragStart}
638
- eventStartEditable={eventStartEditable}
639
- eventOverlap={eventOverlap}
640
- selectedDates={selectedDates}
641
- selectedRange={selectedRange}
642
- fillCellOnSelection={fillCellOnSelection}
643
- minDate={minDate}
644
- maxDate={maxDate}
645
- isDateDisabled={isDateDisabled}
646
- onChangeDate={handleChangeDate}
647
- freeSwipe={freeSwipe}
648
- swipeEnabled={swipeEnabled}
649
- classNames={classNames}
650
- styles={styleOverrides}
651
- />
652
- ) : mode === "year" ? (
653
- <YearView
654
- date={date}
655
- events={displayEvents}
656
- weekStartsOn={weekStartsOn}
657
- hiddenDays={hiddenDays}
658
- locale={locale}
659
- activeDate={activeDate}
660
- selectedDates={selectedDates}
661
- selectedRange={selectedRange}
662
- minDate={minDate}
663
- maxDate={maxDate}
664
- isDateDisabled={isDateDisabled}
665
- onPressDay={onPressDay}
666
- onPressMonth={onPressMonth}
667
- onSelectDrag={onSelectDrag}
668
- onCreateEvent={onCreateEvent}
669
- classNames={classNames}
670
- styles={styleOverrides}
671
- />
672
- ) : mode === "schedule" ? (
673
- <Agenda
674
- events={displayEvents}
675
- locale={locale}
676
- renderEvent={resolvedRenderEvent}
677
- keyExtractor={keyExtractor}
678
- onPressEvent={handlePressEvent}
679
- onLongPressEvent={handleLongPressEvent}
680
- onPressDay={onPressDay}
681
- activeDate={activeDate}
682
- itemSeparatorComponent={itemSeparatorComponent}
683
- classNames={classNames}
684
- styles={styleOverrides}
685
- />
686
- ) : (
687
- <TimeGrid
688
- mode={mode}
689
- numberOfDays={numberOfDays}
690
- weekEndsOn={weekEndsOn}
691
- date={date}
692
- events={displayEvents}
693
- cellHeight={cellHeight}
694
- hourHeight={hourHeight}
695
- weekStartsOn={weekStartsOn}
696
- weekdayFormat={weekdayFormat}
697
- hiddenDays={hiddenDays}
698
- now={now}
699
- timeZone={timeZone}
700
- renderEvent={resolvedRenderEvent}
701
- keyExtractor={keyExtractor}
702
- scrollOffsetMinutes={scrollOffsetMinutes}
703
- hourColumnWidth={hourColumnWidth}
704
- hideHours={hideHours}
705
- timeslots={timeslots}
706
- showAllDayEventCell={showAllDayEventCell}
707
- highlightWeekends={highlightWeekends}
708
- eventStartEditable={eventStartEditable}
709
- eventDurationEditable={eventDurationEditable}
710
- eventOverlap={eventOverlap}
711
- calendarCellStyle={calendarCellStyle}
712
- businessHours={businessHours}
713
- renderBusinessHours={renderBusinessHours}
714
- showWeekNumber={showWeekNumber}
715
- weekNumberPrefix={weekNumberPrefix}
716
- hourComponent={hourComponent}
717
- showVerticalScrollIndicator={showVerticalScrollIndicator}
718
- verticalScrollEnabled={verticalScrollEnabled}
719
- headerComponent={headerComponent}
720
- minHour={minHour}
721
- maxHour={maxHour}
722
- ampm={ampm}
723
- minHourHeight={minHourHeight}
724
- maxHourHeight={maxHourHeight}
725
- minEventHeight={minEventHeight}
726
- eventGap={eventGap}
727
- showNowIndicator={showNowIndicator}
728
- locale={locale}
729
- activeDate={activeDate}
730
- isRTL={isRTL}
731
- freeSwipe={freeSwipe}
732
- swipeEnabled={swipeEnabled}
733
- onPressEvent={handlePressEvent}
734
- onLongPressEvent={handleLongPressEvent}
735
- onDragEvent={onDragEvent}
736
- showDragHandle={showDragHandle}
737
- onDragStart={onDragStart}
738
- dragStepMinutes={dragStepMinutes}
739
- onPressCell={onPressCell}
740
- resetPageOnPressCell={resetPageOnPressCell}
741
- onLongPressCell={onLongPressCell}
742
- onCreateEvent={onCreateEvent}
743
- onPressDateHeader={onPressDateHeader}
744
- onChangeDate={handleChangeDate}
745
- renderHeader={renderTimeGridHeader}
746
- classNames={classNames}
747
- styles={styleOverrides}
748
- />
749
- )}
642
+ <CalendarLabelsContext.Provider value={resolvedLabels}>
643
+ {mode === "month" ? (
644
+ <MonthPager
645
+ date={date}
646
+ events={displayEvents}
647
+ maxVisibleEventCount={maxVisibleEventCount}
648
+ weekStartsOn={weekStartsOn}
649
+ hiddenDays={hiddenDays}
650
+ weekdayFormat={weekdayFormat}
651
+ locale={locale}
652
+ labels={labels}
653
+ sortedMonthView={sortedMonthView}
654
+ moreLabel={moreLabel}
655
+ showAdjacentMonths={showAdjacentMonths}
656
+ highlightWeekends={highlightWeekends}
657
+ disableMonthEventCellPress={disableMonthEventCellPress}
658
+ isRTL={isRTL}
659
+ showSixWeeks={showSixWeeks}
660
+ showTitle={showTitle}
661
+ activeDate={activeDate}
662
+ renderHeaderForMonthView={renderHeaderForMonthView}
663
+ renderCustomDateForMonth={renderCustomDateForMonth}
664
+ calendarCellStyle={calendarCellStyle}
665
+ renderEvent={resolvedRenderEvent}
666
+ keyExtractor={keyExtractor}
667
+ onPressDay={onPressDay}
668
+ onLongPressDay={onLongPressDay}
669
+ onPressCell={onPressCell}
670
+ onPressEvent={handlePressEvent}
671
+ onLongPressEvent={handleLongPressEvent}
672
+ onPressMore={onPressMore}
673
+ onCreateEvent={onCreateEvent}
674
+ onSelectDrag={onSelectDrag}
675
+ onDragEvent={onDragEvent}
676
+ onDragStart={onDragStart}
677
+ eventStartEditable={eventStartEditable}
678
+ eventOverlap={eventOverlap}
679
+ selectedDates={selectedDates}
680
+ selectedRange={selectedRange}
681
+ fillCellOnSelection={fillCellOnSelection}
682
+ minDate={minDate}
683
+ maxDate={maxDate}
684
+ isDateDisabled={isDateDisabled}
685
+ onChangeDate={handleChangeDate}
686
+ freeSwipe={freeSwipe}
687
+ swipeEnabled={swipeEnabled}
688
+ classNames={classNames}
689
+ styles={styleOverrides}
690
+ />
691
+ ) : mode === "year" ? (
692
+ <YearView
693
+ date={date}
694
+ events={displayEvents}
695
+ refreshControl={refreshControl}
696
+ weekStartsOn={weekStartsOn}
697
+ hiddenDays={hiddenDays}
698
+ locale={locale}
699
+ labels={labels}
700
+ activeDate={activeDate}
701
+ selectedDates={selectedDates}
702
+ selectedRange={selectedRange}
703
+ minDate={minDate}
704
+ maxDate={maxDate}
705
+ isDateDisabled={isDateDisabled}
706
+ onPressDay={onPressDay}
707
+ onPressMonth={onPressMonth}
708
+ onSelectDrag={onSelectDrag}
709
+ onCreateEvent={onCreateEvent}
710
+ classNames={classNames}
711
+ styles={styleOverrides}
712
+ />
713
+ ) : mode === "schedule" ? (
714
+ <Agenda
715
+ events={displayEvents}
716
+ locale={locale}
717
+ renderEvent={resolvedRenderEvent}
718
+ keyExtractor={keyExtractor}
719
+ onPressEvent={handlePressEvent}
720
+ onLongPressEvent={handleLongPressEvent}
721
+ onPressDay={onPressDay}
722
+ activeDate={activeDate}
723
+ itemSeparatorComponent={itemSeparatorComponent}
724
+ refreshControl={refreshControl}
725
+ classNames={classNames}
726
+ styles={styleOverrides}
727
+ />
728
+ ) : (
729
+ <TimeGrid
730
+ mode={mode}
731
+ numberOfDays={numberOfDays}
732
+ weekEndsOn={weekEndsOn}
733
+ date={date}
734
+ events={displayEvents}
735
+ cellHeight={cellHeight}
736
+ hourHeight={hourHeight}
737
+ weekStartsOn={weekStartsOn}
738
+ weekdayFormat={weekdayFormat}
739
+ hiddenDays={hiddenDays}
740
+ now={now}
741
+ timeZone={timeZone}
742
+ renderEvent={resolvedRenderEvent}
743
+ keyExtractor={keyExtractor}
744
+ scrollOffsetMinutes={scrollOffsetMinutes}
745
+ hourColumnWidth={hourColumnWidth}
746
+ hideHours={hideHours}
747
+ timeslots={timeslots}
748
+ showAllDayEventCell={showAllDayEventCell}
749
+ showAllDayLabel={showAllDayLabel}
750
+ refreshControl={refreshControl}
751
+ highlightWeekends={highlightWeekends}
752
+ eventStartEditable={eventStartEditable}
753
+ eventDurationEditable={eventDurationEditable}
754
+ eventOverlap={eventOverlap}
755
+ calendarCellStyle={calendarCellStyle}
756
+ businessHours={businessHours}
757
+ renderBusinessHours={renderBusinessHours}
758
+ renderBackgroundEvent={renderBackgroundEvent}
759
+ showWeekNumber={showWeekNumber}
760
+ weekNumberPrefix={weekNumberPrefix}
761
+ hourComponent={hourComponent}
762
+ showVerticalScrollIndicator={showVerticalScrollIndicator}
763
+ verticalScrollEnabled={verticalScrollEnabled}
764
+ headerComponent={headerComponent}
765
+ minHour={minHour}
766
+ maxHour={maxHour}
767
+ ampm={ampm}
768
+ minHourHeight={minHourHeight}
769
+ maxHourHeight={maxHourHeight}
770
+ minEventHeight={minEventHeight}
771
+ eventGap={eventGap}
772
+ showNowIndicator={showNowIndicator}
773
+ locale={locale}
774
+ labels={labels}
775
+ activeDate={activeDate}
776
+ isRTL={isRTL}
777
+ freeSwipe={freeSwipe}
778
+ swipeEnabled={swipeEnabled}
779
+ onPressEvent={handlePressEvent}
780
+ onLongPressEvent={handleLongPressEvent}
781
+ onDragEvent={onDragEvent}
782
+ showDragHandle={showDragHandle}
783
+ onDragStart={onDragStart}
784
+ dragStepMinutes={dragStepMinutes}
785
+ onPressCell={onPressCell}
786
+ resetPageOnPressCell={resetPageOnPressCell}
787
+ onLongPressCell={onLongPressCell}
788
+ onCreateEvent={onCreateEvent}
789
+ onPressDateHeader={onPressDateHeader}
790
+ onChangeDate={handleChangeDate}
791
+ renderHeader={renderTimeGridHeader}
792
+ classNames={classNames}
793
+ styles={styleOverrides}
794
+ />
795
+ )}
796
+ </CalendarLabelsContext.Provider>
750
797
  </CalendarThemeProvider>
751
798
  );
752
799
  }