@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/dist/index.js CHANGED
@@ -20,7 +20,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
20
20
  value: mod,
21
21
  enumerable: true
22
22
  }) : target, mod));
23
- const require_MonthList = require("./MonthList-Dmp8JXvj.js");
23
+ const require_MonthList = require("./MonthList-C_NTufaK.js");
24
24
  let date_fns = require("date-fns");
25
25
  let react = require("react");
26
26
  let react_native_reanimated = require("react-native-reanimated");
@@ -35,7 +35,7 @@ let _legendapp_list_reanimated = require("@legendapp/list/reanimated");
35
35
  const isWeb$2 = react_native.Platform.OS === "web";
36
36
  const DRAG_HOLD_MS = 400;
37
37
  const FALLBACK_COLUMNS = 3;
38
- function YearViewInner({ date, events, weekStartsOn, hiddenDays, locale, labels: labelsProp, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth = 150, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, refreshControl, classNames, styles: styleOverrides }) {
38
+ function YearViewInner({ date, events, weekStartsOn, hiddenDays, locale, now, timeZone, labels: labelsProp, activeDate, selectedRange, selectedDates, minDate, maxDate, isDateDisabled, minMonthWidth = 150, onPressDay, onPressMonth, onSelectDrag, onCreateEvent, refreshControl, classNames, styles: styleOverrides }) {
39
39
  const theme = require_MonthList.useCalendarTheme();
40
40
  const labels = (0, react.useMemo)(() => (0, _super_calendar_core.resolveCalendarLabels)(labelsProp), [labelsProp]);
41
41
  const slot = require_MonthList.createSlots({
@@ -48,6 +48,7 @@ function YearViewInner({ date, events, weekStartsOn, hiddenDays, locale, labels:
48
48
  if (width <= 0) return;
49
49
  setColumns(Math.max(2, Math.min(4, Math.floor(width / minMonthWidth))));
50
50
  };
51
+ const today = (0, _super_calendar_core.nowInTimeZone)(now, timeZone);
51
52
  const months = (0, react.useMemo)(() => (0, _super_calendar_core.getYearMonths)(date), [date]);
52
53
  const monthWeeks = (0, react.useMemo)(() => months.map((month) => (0, _super_calendar_core.buildMonthWeeks)(month, weekStartsOn, { hiddenDays })), [
53
54
  months,
@@ -178,7 +179,7 @@ function YearViewInner({ date, events, weekStartsOn, hiddenDays, locale, labels:
178
179
  ...slot("week", { base: styles$5.week }),
179
180
  children: week.map((day) => {
180
181
  if (day.getMonth() !== month.getMonth()) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, { style: styles$5.day }, day.toISOString());
181
- const isToday = (0, _super_calendar_core.getIsToday)(day);
182
+ const isToday = (0, _super_calendar_core.getIsToday)(day, today);
182
183
  const isHighlighted = activeDate ? (0, _super_calendar_core.isSameCalendarDay)(day, activeDate) : isToday;
183
184
  const hasEvents = eventDays.has((0, date_fns.startOfDay)(day).toISOString());
184
185
  const state = (0, _super_calendar_core.daySelectionState)(day, {
@@ -401,7 +402,7 @@ const styles$5 = react_native.StyleSheet.create({
401
402
  * start, grouped under a date header per day. The consumer controls which
402
403
  * events (and therefore which date range) are shown.
403
404
  */
404
- function Agenda({ events, locale, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }) {
405
+ function Agenda({ events, locale, now, timeZone, renderEvent, keyExtractor, onPressEvent, onLongPressEvent, onPressDay, activeDate, itemSeparatorComponent, refreshControl, classNames, styles: styleOverrides }) {
405
406
  const theme = require_MonthList.useCalendarTheme();
406
407
  const slot = (0, react.useMemo)(() => require_MonthList.createSlots({
407
408
  classNames,
@@ -431,9 +432,10 @@ function Agenda({ events, locale, renderEvent, keyExtractor, onPressEvent, onLon
431
432
  return out;
432
433
  }, [events, keyExtractor]);
433
434
  const keyExtractorRow = (0, react.useCallback)((row) => row.key, []);
435
+ const todayKey = (0, date_fns.startOfDay)((0, _super_calendar_core.nowInTimeZone)(now, timeZone)).getTime();
434
436
  const renderItem = (0, react.useCallback)(({ item }) => {
435
437
  if (item.kind === "header") {
436
- const isHighlighted = activeDate ? (0, date_fns.isSameDay)(item.date, activeDate) : (0, _super_calendar_core.getIsToday)(item.date);
438
+ const isHighlighted = activeDate ? (0, date_fns.isSameDay)(item.date, activeDate) : (0, _super_calendar_core.getIsToday)(item.date, new Date(todayKey));
437
439
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
438
440
  ...slot("dayHeader", {
439
441
  base: styles$4.header,
@@ -461,6 +463,7 @@ function Agenda({ events, locale, renderEvent, keyExtractor, onPressEvent, onLon
461
463
  theme,
462
464
  locale,
463
465
  activeDate,
466
+ todayKey,
464
467
  onPressDay,
465
468
  onPressEvent,
466
469
  onLongPressEvent,
@@ -479,6 +482,7 @@ function Agenda({ events, locale, renderEvent, keyExtractor, onPressEvent, onLon
479
482
  data: rows,
480
483
  keyExtractor: keyExtractorRow,
481
484
  renderItem,
485
+ extraData: todayKey,
482
486
  ItemSeparatorComponent: itemSeparatorComponent ?? void 0,
483
487
  recycleItems: false,
484
488
  refreshControl
@@ -699,7 +703,7 @@ function useWebGridZoom(enabled, target, cellHeight, committedCellHeight, minHei
699
703
  /**
700
704
  * The all-day lane of one page, pinned above the scrolling hours. All-day
701
705
  * events are excluded from the timed columns (see `layoutDayEvents`) and shown
702
- * here, stacked under their day(s). Always rendered so every page reports a
706
+ * here as continuous spans, stacked only when their dates overlap. Always rendered so every page reports a
703
707
  * height, zero when the week has none, which the band above the grid follows
704
708
  * live as you swipe; the "all-day" label lives in the hour column.
705
709
  */
@@ -707,43 +711,59 @@ function AllDayLane({ days, events, mode, dayWidth, renderEvent, keyExtractor, o
707
711
  const theme = require_MonthList.useCalendarTheme();
708
712
  const slot = require_MonthList.useSlots();
709
713
  const RenderEventComponent = renderEvent;
710
- const allDay = events.filter((event) => (0, _super_calendar_core.isAllDayEvent)(event) && !(0, _super_calendar_core.isBackgroundEvent)(event));
711
- const perDay = days.map((day) => {
712
- const start = (0, date_fns.startOfDay)(day);
713
- const next = (0, date_fns.addDays)(start, 1);
714
- return allDay.filter((event) => event.start < next && event.end > start);
715
- });
714
+ const spans = (0, react.useMemo)(() => {
715
+ const allDay = events.filter((event) => (0, _super_calendar_core.isAllDayEvent)(event) && !(0, _super_calendar_core.isBackgroundEvent)(event) && days.some((day) => event.start < (0, date_fns.addDays)((0, date_fns.startOfDay)(day), 1) && event.end > (0, date_fns.startOfDay)(day)));
716
+ const { segments, laneCount } = (0, _super_calendar_core.layoutMonthWeek)(days, allDay);
717
+ const lanes = Array.from({ length: laneCount }, () => []);
718
+ for (const segment of segments) lanes[segment.lane].push(segment);
719
+ return lanes.flat();
720
+ }, [days, events]);
716
721
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
717
722
  ...slot("allDayLane", {
718
- base: styles$2.lane,
723
+ base: [styles$2.lane, spans.length > 0 && { paddingVertical: 2 }],
719
724
  themed: theme.containers.allDayLane
720
725
  }),
721
726
  onLayout,
722
- children: perDay.every((list) => list.length === 0) ? null : days.map((day, dayIndex) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
723
- ...slot("allDayColumn", {
724
- base: [styles$2.column, { width: dayWidth }],
725
- themed: theme.containers.allDayColumn
726
- }),
727
- children: perDay[dayIndex].map((event, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
728
- ...slot("allDayEvent", { base: styles$2.chip }),
729
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RenderEventComponent, {
730
- event,
731
- mode,
732
- isAllDay: true,
733
- onPress: () => onPressEvent(event),
734
- onLongPress: onLongPressEvent ? () => onLongPressEvent(event) : void 0
727
+ children: spans.map((segment, index) => {
728
+ const { event, startCol, endCol, lane, continuesBefore, continuesAfter } = segment;
729
+ const previous = spans[index - 1];
730
+ const previousEnd = previous?.lane === lane ? previous.endCol : -1;
731
+ const lastInLane = spans[index + 1]?.lane !== lane;
732
+ const remaining = lastInLane ? days.length - endCol - 1 : 0;
733
+ const wrapSlack = lastInLane ? Math.min(.5, dayWidth / 4) : 0;
734
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
735
+ ...slot("allDayColumn", {
736
+ base: [styles$2.column, {
737
+ width: dayWidth * (endCol - startCol + 1),
738
+ marginLeft: dayWidth * (startCol - previousEnd - 1),
739
+ marginRight: dayWidth * remaining - wrapSlack
740
+ }],
741
+ themed: theme.containers.allDayColumn
742
+ }),
743
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
744
+ ...slot("allDayEvent", { base: styles$2.chip }),
745
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RenderEventComponent, {
746
+ event,
747
+ mode,
748
+ isAllDay: true,
749
+ continuesBefore,
750
+ continuesAfter,
751
+ onPress: () => onPressEvent(event),
752
+ onLongPress: onLongPressEvent ? () => onLongPressEvent(event) : void 0
753
+ })
735
754
  })
736
- }, keyExtractor(event, index)))
737
- }, day.toISOString()))
755
+ }, keyExtractor(event, index));
756
+ })
738
757
  });
739
758
  }
740
759
  const styles$2 = react_native.StyleSheet.create({
741
- lane: { flexDirection: "row" },
742
- column: {
743
- paddingVertical: 2,
744
- paddingHorizontal: 1,
745
- gap: 2
760
+ lane: {
761
+ flexDirection: "row",
762
+ flexWrap: "wrap",
763
+ alignItems: "flex-start",
764
+ rowGap: 2
746
765
  },
766
+ column: { paddingHorizontal: 1 },
747
767
  chip: { minHeight: 18 }
748
768
  });
749
769
  // src/components/MultiDayMovePreview.tsx
@@ -964,6 +984,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
964
984
  const resizeStartDelta = (0, react_native_reanimated.useSharedValue)(0);
965
985
  const dragZ = (0, react_native_reanimated.useSharedValue)(0);
966
986
  const moving = (0, react_native_reanimated.useSharedValue)(0);
987
+ const onHandle = (0, react_native_reanimated.useSharedValue)(0);
967
988
  const edgeDir = (0, react_native_reanimated.useSharedValue)(0);
968
989
  const lifted = (0, react_native_reanimated.useSharedValue)(0);
969
990
  const grabX = (0, react_native_reanimated.useSharedValue)(0);
@@ -979,6 +1000,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
979
1000
  minutes: startHours * MINUTES_PER_HOUR$1,
980
1001
  ownsStart
981
1002
  }), [startHours, ownsStart]);
1003
+ const columnInsetSV = (0, react_native_reanimated.useDerivedValue)(() => left - dayLeftPx, [left, dayLeftPx]);
982
1004
  const eventStartMs = positioned.event.start.getTime();
983
1005
  const eventEndMs = positioned.event.end.getTime();
984
1006
  const moveExtra = (0, react_native_reanimated.useDerivedValue)(() => {
@@ -1015,8 +1037,12 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1015
1037
  minEventHeight
1016
1038
  ]);
1017
1039
  const boxStyle = (0, react_native_reanimated.useAnimatedStyle)(() => {
1040
+ const top = (startHours + moveExtra.value.top - minHour) * cellHeight.value + moveOffset.value + resizeStartDelta.value;
1041
+ const floating = !onHandle.value && (moving.value || moveOffset.value !== 0 || moveOffsetX.value !== 0);
1018
1042
  return {
1019
- top: (startHours + moveExtra.value.top - minHour) * cellHeight.value + moveOffset.value + resizeStartDelta.value,
1043
+ left: floating ? dayLeftPx : left,
1044
+ width: floating ? dayWidth : width,
1045
+ top,
1020
1046
  height: visibleBoxHeight.value,
1021
1047
  transform: [{ translateX: moveOffsetX.value }],
1022
1048
  zIndex: dragZ.value,
@@ -1025,7 +1051,11 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1025
1051
  }, [
1026
1052
  startHours,
1027
1053
  minHour,
1028
- hiddenForMove
1054
+ hiddenForMove,
1055
+ left,
1056
+ width,
1057
+ dayLeftPx,
1058
+ dayWidth
1029
1059
  ]);
1030
1060
  const spillHeight = (0, react_native_reanimated.useDerivedValue)(() => {
1031
1061
  if (multiDay || !moving.value || lifted.value || cellHeight.value <= 0) return 0;
@@ -1151,7 +1181,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1151
1181
  if (!edgePaging) return;
1152
1182
  if (!lifted.value) {
1153
1183
  lifted.value = 1;
1154
- edgePaging.ghostW.value = width;
1184
+ edgePaging.ghostW.value = dayWidth;
1155
1185
  edgePaging.ghostH.value = boxHeight.value;
1156
1186
  edgePaging.ghostX.value = liveAbsX.value - grabX.value - edgePaging.pagerLeft.value;
1157
1187
  edgePaging.ghostY.value = liveAbsY.value - grabY.value - edgePaging.pagerTop.value;
@@ -1166,7 +1196,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1166
1196
  disarmEdge,
1167
1197
  edgePaging,
1168
1198
  lifted,
1169
- width,
1199
+ dayWidth,
1170
1200
  boxHeight,
1171
1201
  liveAbsX,
1172
1202
  liveAbsY,
@@ -1180,7 +1210,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1180
1210
  moving.value = 1;
1181
1211
  edgeDir.value = 0;
1182
1212
  lifted.value = 0;
1183
- grabX.value = event.x;
1213
+ grabX.value = event.x + columnInsetSV.value;
1184
1214
  grabY.value = event.y;
1185
1215
  liveAbsX.value = event.absoluteX;
1186
1216
  liveAbsY.value = event.absoluteY;
@@ -1247,6 +1277,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1247
1277
  }, [
1248
1278
  canMove,
1249
1279
  snapMinutes,
1280
+ columnInsetSV,
1250
1281
  cellHeight,
1251
1282
  moveOffset,
1252
1283
  moveOffsetX,
@@ -1291,7 +1322,9 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1291
1322
  press?.(event);
1292
1323
  }, []);
1293
1324
  const resizeGesture = (0, react.useMemo)(() => {
1294
- const pan = react_native_gesture_handler.Gesture.Pan().enabled(resizable).onStart(() => {
1325
+ const pan = react_native_gesture_handler.Gesture.Pan().enabled(resizable).onBegin(() => {
1326
+ onHandle.value = 1;
1327
+ }).onStart(() => {
1295
1328
  dragZ.value = DRAG_EVENT_Z;
1296
1329
  (0, react_native_reanimated.runOnJS)(notifyDragStart)();
1297
1330
  }).onUpdate((event) => {
@@ -1306,6 +1339,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1306
1339
  (0, react_native_reanimated.runOnJS)(commitDrag)(0, delta);
1307
1340
  }).onFinalize(() => {
1308
1341
  dragZ.value = 0;
1342
+ onHandle.value = 0;
1309
1343
  });
1310
1344
  const tap = react_native_gesture_handler.Gesture.Tap().runOnJS(true).onEnd((_event, success) => {
1311
1345
  if (success) handlePress();
@@ -1318,6 +1352,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1318
1352
  resizable,
1319
1353
  snapMinutes,
1320
1354
  cellHeight,
1355
+ onHandle,
1321
1356
  resizeDelta,
1322
1357
  dragZ,
1323
1358
  commitDrag,
@@ -1327,7 +1362,9 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1327
1362
  handleLongPressFromHandle
1328
1363
  ]);
1329
1364
  const resizeStartGesture = (0, react.useMemo)(() => {
1330
- const pan = react_native_gesture_handler.Gesture.Pan().enabled(resizableFromStart).onStart(() => {
1365
+ const pan = react_native_gesture_handler.Gesture.Pan().enabled(resizableFromStart).onBegin(() => {
1366
+ onHandle.value = 1;
1367
+ }).onStart(() => {
1331
1368
  dragZ.value = DRAG_EVENT_Z;
1332
1369
  (0, react_native_reanimated.runOnJS)(notifyDragStart)();
1333
1370
  }).onUpdate((event) => {
@@ -1342,6 +1379,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1342
1379
  (0, react_native_reanimated.runOnJS)(commitDrag)(delta, 0);
1343
1380
  }).onFinalize(() => {
1344
1381
  dragZ.value = 0;
1382
+ onHandle.value = 0;
1345
1383
  });
1346
1384
  const tap = react_native_gesture_handler.Gesture.Tap().runOnJS(true).onEnd((_event, success) => {
1347
1385
  if (success) handlePress();
@@ -1354,6 +1392,7 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
1354
1392
  resizableFromStart,
1355
1393
  snapMinutes,
1356
1394
  cellHeight,
1395
+ onHandle,
1357
1396
  resizeStartDelta,
1358
1397
  dragZ,
1359
1398
  commitDrag,
@@ -1707,6 +1746,7 @@ function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowT
1707
1746
  now: nowProp,
1708
1747
  timeZone: nowTimeZone
1709
1748
  });
1749
+ const today = showNowIndicator && isActive ? now : (0, _super_calendar_core.nowInTimeZone)(nowProp, nowTimeZone);
1710
1750
  const nowDayIndex = days.findIndex((day) => (0, _super_calendar_core.isSameCalendarDay)(day, now));
1711
1751
  const nowHours = ((0, date_fns.getHours)(now) * MINUTES_PER_HOUR$1 + (0, date_fns.getMinutes)(now)) / MINUTES_PER_HOUR$1;
1712
1752
  const nowInWindow = nowHours >= minHour && nowHours <= maxHour;
@@ -2033,6 +2073,7 @@ function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowT
2033
2073
  dayWidth,
2034
2074
  weekdayFormat,
2035
2075
  todayLabel,
2076
+ today,
2036
2077
  locale,
2037
2078
  activeDate,
2038
2079
  onPressDateHeader
@@ -2803,6 +2844,7 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
2803
2844
  now,
2804
2845
  timeZone
2805
2846
  ]);
2847
+ const nowTime = now?.getTime();
2806
2848
  const listExtraData = (0, react.useMemo)(() => ({
2807
2849
  events,
2808
2850
  activeIndex,
@@ -2812,7 +2854,9 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
2812
2854
  onCreateEvent,
2813
2855
  dragStepMinutes,
2814
2856
  minHour,
2815
- maxHour
2857
+ maxHour,
2858
+ nowTime,
2859
+ timeZone
2816
2860
  }), [
2817
2861
  events,
2818
2862
  activeIndex,
@@ -2822,7 +2866,9 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
2822
2866
  onCreateEvent,
2823
2867
  dragStepMinutes,
2824
2868
  minHour,
2825
- maxHour
2869
+ maxHour,
2870
+ nowTime,
2871
+ timeZone
2826
2872
  ]);
2827
2873
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MonthList.SlotStylesProvider, {
2828
2874
  classNames,
@@ -2966,7 +3012,7 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
2966
3012
  * ```
2967
3013
  */
2968
3014
  const TimeGrid = (0, react.memo)((0, react.forwardRef)(TimeGridInner));
2969
- const DayHeaderRow = ({ days, mode, dayWidth, weekdayFormat, todayLabel, locale, activeDate, onPressDateHeader }) => {
3015
+ const DayHeaderRow = ({ days, mode, dayWidth, weekdayFormat, todayLabel, today, locale, activeDate, onPressDateHeader }) => {
2970
3016
  const slot = require_MonthList.useSlots();
2971
3017
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
2972
3018
  ...slot("header", { base: styles$1.headerRow }),
@@ -2976,16 +3022,17 @@ const DayHeaderRow = ({ days, mode, dayWidth, weekdayFormat, todayLabel, locale,
2976
3022
  width: dayWidth,
2977
3023
  weekdayFormat,
2978
3024
  todayLabel,
3025
+ today,
2979
3026
  locale,
2980
3027
  activeDate,
2981
3028
  onPressDateHeader
2982
3029
  }, day.toISOString()))
2983
3030
  });
2984
3031
  };
2985
- const DayHeader = ({ day, width, weekdayFormat = "short", todayLabel, locale, activeDate, onPressDateHeader }) => {
3032
+ const DayHeader = ({ day, width, weekdayFormat = "short", todayLabel, today, locale, activeDate, onPressDateHeader }) => {
2986
3033
  const theme = require_MonthList.useCalendarTheme();
2987
3034
  const slot = require_MonthList.useSlots();
2988
- const isToday = (0, _super_calendar_core.getIsToday)(day);
3035
+ const isToday = (0, _super_calendar_core.getIsToday)(day, today);
2989
3036
  const isHighlighted = activeDate ? (0, _super_calendar_core.isSameCalendarDay)(day, activeDate) : isToday;
2990
3037
  const accessibilityLabel = `${(0, date_fns.format)(day, "EEEE d MMMM", { locale })}${isToday ? `, ${todayLabel}` : ""}`;
2991
3038
  const headerSlot = slot("columnHeader", {
@@ -3219,13 +3266,30 @@ const styles$1 = react_native.StyleSheet.create({
3219
3266
  });
3220
3267
  // src/components/Calendar.tsx
3221
3268
  const defaultKeyExtractor = (event) => `${event.start.toISOString()}|${event.end.toISOString()}|${event.title ?? ""}`;
3222
- function visibleRange(mode, date, weekStartsOn, numberOfDays, weekEndsOn) {
3269
+ function visibleRange(mode, date, weekStartsOn, numberOfDays, weekEndsOn, numberOfWeeks = 2, hiddenDays) {
3270
+ if (mode === "multiweek") {
3271
+ const { visibleRange } = (0, _super_calendar_core.buildMultiWeekGrid)(date, {
3272
+ numberOfWeeks,
3273
+ weekStartsOn,
3274
+ hiddenDays
3275
+ });
3276
+ return [visibleRange.start, (0, date_fns.endOfDay)((0, date_fns.addDays)(visibleRange.endExclusive, -1))];
3277
+ }
3223
3278
  if (mode === "month") return [(0, date_fns.startOfWeek)((0, date_fns.startOfMonth)(date), { weekStartsOn }), (0, date_fns.endOfWeek)((0, date_fns.endOfMonth)(date), { weekStartsOn })];
3224
3279
  if (mode === "year") return [(0, date_fns.startOfWeek)((0, date_fns.startOfYear)(date), { weekStartsOn }), (0, date_fns.endOfWeek)((0, date_fns.endOfYear)(date), { weekStartsOn })];
3225
3280
  const days = (0, _super_calendar_core.getViewDays)(mode, date, weekStartsOn, numberOfDays, false, weekEndsOn);
3226
3281
  return [(0, date_fns.startOfDay)(days[0]), (0, date_fns.endOfDay)(days[days.length - 1])];
3227
3282
  }
3228
- function expansionRange(mode, date, weekStartsOn, numberOfDays, weekEndsOn) {
3283
+ function expansionRange(mode, date, weekStartsOn, numberOfDays, weekEndsOn, numberOfWeeks = 2) {
3284
+ if (mode === "multiweek") {
3285
+ const { period } = (0, _super_calendar_core.buildMultiWeekGrid)(date, {
3286
+ numberOfWeeks,
3287
+ weekStartsOn
3288
+ });
3289
+ const previous = (0, date_fns.addWeeks)(period.start, -numberOfWeeks);
3290
+ const following = (0, date_fns.addWeeks)(period.endExclusive, numberOfWeeks);
3291
+ return [Number.isFinite(previous.getTime()) ? previous : period.start, (0, date_fns.endOfDay)((0, date_fns.addDays)(Number.isFinite(following.getTime()) ? following : period.endExclusive, -1))];
3292
+ }
3229
3293
  if (mode === "month") return [(0, date_fns.startOfWeek)((0, date_fns.startOfMonth)((0, date_fns.addMonths)(date, -1)), { weekStartsOn }), (0, date_fns.addWeeks)((0, date_fns.endOfWeek)((0, date_fns.endOfMonth)((0, date_fns.addMonths)(date, 1)), { weekStartsOn }), 1)];
3230
3294
  if (mode === "year") return [(0, date_fns.startOfWeek)((0, date_fns.startOfYear)(date), { weekStartsOn }), (0, date_fns.endOfWeek)((0, date_fns.endOfYear)(date), { weekStartsOn })];
3231
3295
  if (mode === "schedule") return [(0, date_fns.startOfDay)(date), (0, date_fns.endOfDay)((0, date_fns.addMonths)(date, 3))];
@@ -3260,7 +3324,7 @@ function expansionRange(mode, date, weekStartsOn, numberOfDays, weekEndsOn) {
3260
3324
  * ```
3261
3325
  */
3262
3326
  const Calendar = (0, react.forwardRef)(CalendarInner);
3263
- function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, renderCreateGhost, onSelectDrag, selectedDates, selectedRange, fillCellOnSelection, minDate, maxDate, isDateDisabled, onPressDateHeader, maxVisibleEventCount, chipHeight, chipGap, sortedMonthView, moreLabel, labels, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn = 0, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent = DefaultEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, renderBackgroundEvent, keyExtractor = defaultKeyExtractor, theme, cellHeight: cellHeightProp, hourHeight = 48, minHourHeight, maxHourHeight, minEventHeight, eventGap, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, showAllDayLabel, refreshControl, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, showTitle, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }, ref) {
3327
+ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, renderCreateGhost, onSelectDrag, selectedDates, selectedRange, fillCellOnSelection, minDate, maxDate, isDateDisabled, onPressDateHeader, maxVisibleEventCount, chipHeight, chipGap, sortedMonthView, moreLabel, labels, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn = 0, hiddenDays, now, weekdayFormat, numberOfDays, numberOfWeeks = 2, weekEndsOn, renderEvent = DefaultEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, renderBackgroundEvent, keyExtractor = defaultKeyExtractor, theme, cellHeight: cellHeightProp, hourHeight = 48, minHourHeight, maxHourHeight, minEventHeight, eventGap, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, showAllDayLabel, refreshControl, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, showTitle, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }, ref) {
3264
3328
  const mergedTheme = (0, react.useMemo)(() => require_MonthList.mergeTheme(theme), [theme]);
3265
3329
  const internalCellHeight = (0, react_native_reanimated.useSharedValue)(hourHeight);
3266
3330
  const cellHeight = cellHeightProp ?? internalCellHeight;
@@ -3269,12 +3333,8 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
3269
3333
  const displayEvents = (0, react.useMemo)(() => {
3270
3334
  let out = events;
3271
3335
  if (out.some((e) => e.recurrence)) {
3272
- let [start, end] = expansionRange(mode, date, weekStartsOn, numberOfDays ?? 1, weekEndsOn);
3273
- if (timeZone) {
3274
- start = (0, date_fns.addDays)(start, -1);
3275
- end = (0, date_fns.addDays)(end, 1);
3276
- }
3277
- out = (0, _super_calendar_core.expandRecurringEvents)(out, start, end);
3336
+ const [start, end] = expansionRange(mode, date, weekStartsOn, numberOfDays ?? 1, weekEndsOn, numberOfWeeks);
3337
+ out = timeZone ? (0, _super_calendar_core.expandRecurringEvents)(out, (0, _super_calendar_core.fromZonedTime)(start, timeZone), (0, _super_calendar_core.fromZonedTime)(end, timeZone), { timeZone }) : (0, _super_calendar_core.expandRecurringEvents)(out, start, end);
3278
3338
  }
3279
3339
  if (timeZone) out = (0, _super_calendar_core.eventsInTimeZone)(out, timeZone);
3280
3340
  return out;
@@ -3285,24 +3345,63 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
3285
3345
  weekStartsOn,
3286
3346
  numberOfDays,
3287
3347
  weekEndsOn,
3288
- timeZone
3348
+ timeZone,
3349
+ numberOfWeeks
3289
3350
  ]);
3290
3351
  const handlePressEvent = (0, react.useCallback)((event) => {
3291
- if (!event.disabled) onPressEvent(event);
3292
- }, [onPressEvent]);
3352
+ if (!event.disabled) onPressEvent(timeZone ? (0, _super_calendar_core.zonedEventSource)(event) : event);
3353
+ }, [onPressEvent, timeZone]);
3293
3354
  const handleLongPressEvent = (0, react.useMemo)(() => onLongPressEvent ? (event) => {
3294
- if (!event.disabled) onLongPressEvent(event);
3295
- } : void 0, [onLongPressEvent]);
3355
+ if (!event.disabled) onLongPressEvent(timeZone ? (0, _super_calendar_core.zonedEventSource)(event) : event);
3356
+ } : void 0, [onLongPressEvent, timeZone]);
3357
+ const timeGridMode = mode !== "month" && mode !== "multiweek";
3358
+ const zoned = (0, react.useMemo)(() => {
3359
+ if (!timeZone) return {
3360
+ onDragStart,
3361
+ onDragEvent,
3362
+ onPressMore,
3363
+ onPressTime: onPressCell,
3364
+ onLongPressTime: onLongPressCell,
3365
+ onCreateTimed: onCreateEvent
3366
+ };
3367
+ const instant = (wallClock) => (0, _super_calendar_core.fromZonedTime)(wallClock, timeZone);
3368
+ return {
3369
+ onDragStart: onDragStart && ((event) => onDragStart((0, _super_calendar_core.zonedEventSource)(event))),
3370
+ onDragEvent: onDragEvent && ((event, start, end) => {
3371
+ const bounds = (0, _super_calendar_core.zonedDragBounds)(event, start, end, { keepDuration: timeGridMode });
3372
+ if (!bounds) return false;
3373
+ return onDragEvent((0, _super_calendar_core.zonedEventSource)(event), bounds.start, bounds.end);
3374
+ }),
3375
+ onPressMore: onPressMore && ((dayEvents, day) => onPressMore(dayEvents.map(_super_calendar_core.zonedEventSource), day)),
3376
+ onPressTime: onPressCell && ((time) => onPressCell(instant(time))),
3377
+ onLongPressTime: onLongPressCell && ((time) => onLongPressCell(instant(time))),
3378
+ onCreateTimed: onCreateEvent && ((start, end) => {
3379
+ const range = (0, _super_calendar_core.fromZonedRange)(start, end, timeZone);
3380
+ if (range) onCreateEvent(range.start, range.end);
3381
+ })
3382
+ };
3383
+ }, [
3384
+ timeZone,
3385
+ timeGridMode,
3386
+ onDragStart,
3387
+ onDragEvent,
3388
+ onPressMore,
3389
+ onPressCell,
3390
+ onLongPressCell,
3391
+ onCreateEvent
3392
+ ]);
3296
3393
  const handleChangeDate = (0, react.useCallback)((next) => {
3297
3394
  onChangeDate(next);
3298
- onChangeDateRange?.(visibleRange(mode, next, weekStartsOn, numberOfDays ?? 1, weekEndsOn));
3395
+ onChangeDateRange?.(visibleRange(mode, next, weekStartsOn, numberOfDays ?? 1, weekEndsOn, numberOfWeeks, hiddenDays));
3299
3396
  }, [
3300
3397
  onChangeDate,
3301
3398
  onChangeDateRange,
3302
3399
  mode,
3303
3400
  weekStartsOn,
3304
3401
  numberOfDays,
3305
- weekEndsOn
3402
+ weekEndsOn,
3403
+ numberOfWeeks,
3404
+ hiddenDays
3306
3405
  ]);
3307
3406
  const resolvedRenderEvent = (0, react.useMemo)(() => {
3308
3407
  if (eventCellStyle == null && ampm == null && showTime == null && ellipsizeTitle == null && allDayLabel == null && eventAccessibilityLabel == null) return renderEvent;
@@ -3332,12 +3431,26 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
3332
3431
  allDayLabel,
3333
3432
  eventAccessibilityLabel
3334
3433
  ]);
3434
+ const rowSpec = (0, react.useMemo)(() => mode === "multiweek" ? {
3435
+ kind: "multiweek",
3436
+ numberOfWeeks
3437
+ } : {
3438
+ kind: "month",
3439
+ showAdjacentMonths: showAdjacentMonths ?? true,
3440
+ showSixWeeks: showSixWeeks ?? false
3441
+ }, [
3442
+ mode,
3443
+ numberOfWeeks,
3444
+ showAdjacentMonths,
3445
+ showSixWeeks
3446
+ ]);
3335
3447
  const resolvedLabels = (0, react.useMemo)(() => (0, _super_calendar_core.resolveCalendarLabels)(labels), [labels]);
3336
3448
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MonthList.CalendarThemeProvider, {
3337
3449
  value: mergedTheme,
3338
3450
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MonthList.CalendarLabelsContext.Provider, {
3339
3451
  value: resolvedLabels,
3340
- children: mode === "month" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MonthList.MonthPager, {
3452
+ children: mode === "month" || mode === "multiweek" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MonthList.DateRowsPager, {
3453
+ spec: rowSpec,
3341
3454
  date,
3342
3455
  events: displayEvents,
3343
3456
  maxVisibleEventCount,
@@ -3347,14 +3460,14 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
3347
3460
  hiddenDays,
3348
3461
  weekdayFormat,
3349
3462
  locale,
3463
+ now,
3464
+ timeZone,
3350
3465
  labels,
3351
3466
  sortedMonthView,
3352
3467
  moreLabel,
3353
- showAdjacentMonths,
3354
3468
  highlightWeekends,
3355
3469
  disableMonthEventCellPress,
3356
3470
  isRTL,
3357
- showSixWeeks,
3358
3471
  showTitle,
3359
3472
  activeDate,
3360
3473
  renderHeaderForMonthView,
@@ -3367,11 +3480,12 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
3367
3480
  onPressCell,
3368
3481
  onPressEvent: handlePressEvent,
3369
3482
  onLongPressEvent: handleLongPressEvent,
3370
- onPressMore,
3483
+ onPressMore: zoned.onPressMore,
3371
3484
  onCreateEvent,
3485
+ renderCreateGhost,
3372
3486
  onSelectDrag,
3373
- onDragEvent,
3374
- onDragStart,
3487
+ onDragEvent: zoned.onDragEvent,
3488
+ onDragStart: zoned.onDragStart,
3375
3489
  eventStartEditable,
3376
3490
  eventOverlap,
3377
3491
  selectedDates,
@@ -3392,6 +3506,8 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
3392
3506
  weekStartsOn,
3393
3507
  hiddenDays,
3394
3508
  locale,
3509
+ now,
3510
+ timeZone,
3395
3511
  labels,
3396
3512
  activeDate,
3397
3513
  selectedDates,
@@ -3408,6 +3524,8 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
3408
3524
  }) : mode === "schedule" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Agenda, {
3409
3525
  events: displayEvents,
3410
3526
  locale,
3527
+ now,
3528
+ timeZone,
3411
3529
  renderEvent: resolvedRenderEvent,
3412
3530
  keyExtractor,
3413
3531
  onPressEvent: handlePressEvent,
@@ -3471,14 +3589,14 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
3471
3589
  swipeEnabled,
3472
3590
  onPressEvent: handlePressEvent,
3473
3591
  onLongPressEvent: handleLongPressEvent,
3474
- onDragEvent,
3592
+ onDragEvent: zoned.onDragEvent,
3475
3593
  showDragHandle,
3476
- onDragStart,
3594
+ onDragStart: zoned.onDragStart,
3477
3595
  dragStepMinutes,
3478
- onPressCell,
3596
+ onPressCell: zoned.onPressTime,
3479
3597
  resetPageOnPressCell,
3480
- onLongPressCell,
3481
- onCreateEvent,
3598
+ onLongPressCell: zoned.onLongPressTime,
3599
+ onCreateEvent: zoned.onCreateTimed,
3482
3600
  renderCreateGhost,
3483
3601
  onPressDateHeader,
3484
3602
  onChangeDate: handleChangeDate,
@@ -3489,6 +3607,24 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
3489
3607
  })
3490
3608
  });
3491
3609
  }
3610
+ // src/components/MultiWeekView.tsx
3611
+ /**
3612
+ * Consecutive full weeks with event bars and no hourly slots. Rows scroll
3613
+ * vertically when they cannot fit. Expand recurring events before passing them,
3614
+ * or use Calendar with mode="multiweek" for recurrence and swipe paging.
3615
+ */
3616
+ function MultiWeekView({ date, numberOfWeeks = 2, weekStartsOn = 0, ...rest }) {
3617
+ const source = (0, react.useMemo)(() => ({
3618
+ kind: "multiweek",
3619
+ date,
3620
+ numberOfWeeks
3621
+ }), [date, numberOfWeeks]);
3622
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_MonthList.DateRows, {
3623
+ ...rest,
3624
+ source,
3625
+ weekStartsOn
3626
+ });
3627
+ }
3492
3628
  // src/components/ResourceTimeline.tsx
3493
3629
  const MOVE_ACTIVATE_MS = 250;
3494
3630
  const DRAG_ACTIVATE_PX = 8;
@@ -4500,6 +4636,7 @@ exports.DefaultMonthEvent = require_MonthList.DefaultMonthEvent;
4500
4636
  exports.MonthList = require_MonthList.MonthList;
4501
4637
  exports.MonthPager = require_MonthList.MonthPager;
4502
4638
  exports.MonthView = require_MonthList.MonthView;
4639
+ exports.MultiWeekView = MultiWeekView;
4503
4640
  exports.ResourceTimeline = ResourceTimeline;
4504
4641
  exports.TimeGrid = TimeGrid;
4505
4642
  exports.YearView = YearView;
@@ -4521,6 +4658,12 @@ Object.defineProperty(exports, "buildMonthWeeks", {
4521
4658
  return _super_calendar_core.buildMonthWeeks;
4522
4659
  }
4523
4660
  });
4661
+ Object.defineProperty(exports, "buildMultiWeekGrid", {
4662
+ enumerable: true,
4663
+ get: function() {
4664
+ return _super_calendar_core.buildMultiWeekGrid;
4665
+ }
4666
+ });
4524
4667
  exports.darkTheme = require_MonthList.darkTheme;
4525
4668
  Object.defineProperty(exports, "daySelectionState", {
4526
4669
  enumerable: true,
@@ -4547,6 +4690,18 @@ Object.defineProperty(exports, "expandRecurringEvents", {
4547
4690
  return _super_calendar_core.expandRecurringEvents;
4548
4691
  }
4549
4692
  });
4693
+ Object.defineProperty(exports, "fromZonedRange", {
4694
+ enumerable: true,
4695
+ get: function() {
4696
+ return _super_calendar_core.fromZonedRange;
4697
+ }
4698
+ });
4699
+ Object.defineProperty(exports, "fromZonedTime", {
4700
+ enumerable: true,
4701
+ get: function() {
4702
+ return _super_calendar_core.fromZonedTime;
4703
+ }
4704
+ });
4550
4705
  Object.defineProperty(exports, "getIsToday", {
4551
4706
  enumerable: true,
4552
4707
  get: function() {
@@ -4632,6 +4787,12 @@ Object.defineProperty(exports, "nextDateRange", {
4632
4787
  return _super_calendar_core.nextDateRange;
4633
4788
  }
4634
4789
  });
4790
+ Object.defineProperty(exports, "nowInTimeZone", {
4791
+ enumerable: true,
4792
+ get: function() {
4793
+ return _super_calendar_core.nowInTimeZone;
4794
+ }
4795
+ });
4635
4796
  Object.defineProperty(exports, "parseICalendar", {
4636
4797
  enumerable: true,
4637
4798
  get: function() {
@@ -4681,3 +4842,15 @@ Object.defineProperty(exports, "weekdayFormatToken", {
4681
4842
  return _super_calendar_core.weekdayFormatToken;
4682
4843
  }
4683
4844
  });
4845
+ Object.defineProperty(exports, "zonedDragBounds", {
4846
+ enumerable: true,
4847
+ get: function() {
4848
+ return _super_calendar_core.zonedDragBounds;
4849
+ }
4850
+ });
4851
+ Object.defineProperty(exports, "zonedEventSource", {
4852
+ enumerable: true,
4853
+ get: function() {
4854
+ return _super_calendar_core.zonedEventSource;
4855
+ }
4856
+ });