@super-calendar/native 2.19.0 → 2.20.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/README.md +19 -1
- package/dist/{MonthList-DeO-x5VW.js → MonthList-CGgy0Juh.js} +28 -7
- package/dist/{MonthList-BGl1gTDr.mjs → MonthList-CPpsr5Oa.mjs} +28 -7
- package/dist/index.d.mts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +110 -34
- package/dist/index.mjs +110 -34
- package/dist/picker.js +1 -1
- package/dist/picker.mjs +1 -1
- package/package.json +3 -3
- package/src/components/Calendar.tsx +17 -0
- package/src/components/MonthList.tsx +13 -3
- package/src/components/MonthPager.tsx +21 -5
- package/src/components/MonthView.tsx +11 -4
- package/src/components/TimeGrid.tsx +173 -46
- package/src/index.tsx +1 -0
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-
|
|
23
|
+
const require_MonthList = require("./MonthList-CGgy0Juh.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");
|
|
@@ -1518,9 +1518,10 @@ function AnimatedEventBoxInner({ positioned, eventIndex, movingEvent, onMovePrev
|
|
|
1518
1518
|
}
|
|
1519
1519
|
const AnimatedEventBox = (0, react.memo)(AnimatedEventBoxInner);
|
|
1520
1520
|
const hourRange = (minHour, maxHour) => Array.from({ length: maxHour - minHour }, (_, index) => minHour + index);
|
|
1521
|
-
const HourLabel = ({ hour, width, label, ampm, hourComponent }) => {
|
|
1521
|
+
const HourLabel = ({ hour, width, label, ampm, hourComponent, hidden }) => {
|
|
1522
1522
|
const theme = require_MonthList.useCalendarTheme();
|
|
1523
1523
|
const slot = require_MonthList.useSlots();
|
|
1524
|
+
if (hidden) return null;
|
|
1524
1525
|
return hourComponent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
1525
1526
|
style: { width },
|
|
1526
1527
|
children: hourComponent(hour, ampm)
|
|
@@ -1555,12 +1556,24 @@ const HourLines = (0, react.memo)(function HourLines({ hours, timeslots }) {
|
|
|
1555
1556
|
}, hour))
|
|
1556
1557
|
});
|
|
1557
1558
|
});
|
|
1558
|
-
|
|
1559
|
+
function getNowPosition(time, days, minHour, maxHour) {
|
|
1560
|
+
const hours = (0, date_fns.getHours)(time) + (0, date_fns.getMinutes)(time) / MINUTES_PER_HOUR$1;
|
|
1561
|
+
const dayIndex = days.findIndex((day) => (0, _super_calendar_core.isSameCalendarDay)(day, time));
|
|
1562
|
+
return dayIndex >= 0 && hours >= minHour && hours <= maxHour ? {
|
|
1563
|
+
time,
|
|
1564
|
+
hours,
|
|
1565
|
+
dayIndex
|
|
1566
|
+
} : null;
|
|
1567
|
+
}
|
|
1568
|
+
const NOW_LABEL_CLEARANCE_HOURS = .25;
|
|
1569
|
+
const HourGutterInner = ({ width, minHour, maxHour, cellHeight, laneHeight, scrollY, showLane, showAllDayLabel, allDayLabel, headerHeight, weekNumber, ampm, hourComponent, renderNowLabel, nowPosition }) => {
|
|
1559
1570
|
const theme = require_MonthList.useCalendarTheme();
|
|
1560
1571
|
const slot = require_MonthList.useSlots();
|
|
1561
1572
|
const hours = (0, react.useMemo)(() => hourRange(minHour, maxHour), [minHour, maxHour]);
|
|
1573
|
+
const label = nowPosition && renderNowLabel?.(nowPosition.time);
|
|
1574
|
+
const labelHours = label == null || typeof label === "boolean" ? void 0 : nowPosition?.hours;
|
|
1562
1575
|
const laneCellHeightStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({ height: laneHeight.value }));
|
|
1563
|
-
const pinStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({ transform: [{ translateY: scrollY.value }] }));
|
|
1576
|
+
const pinStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({ transform: [{ translateY: Math.max(0, scrollY.value) }] }));
|
|
1564
1577
|
const rowsStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({
|
|
1565
1578
|
top: headerHeight + laneHeight.value + HOUR_LABEL_TOP_INSET,
|
|
1566
1579
|
height: (maxHour - minHour) * cellHeight.value
|
|
@@ -1609,9 +1622,9 @@ const HourGutterInner = ({ width, minHour, maxHour, cellHeight, laneHeight, scro
|
|
|
1609
1622
|
children: allDayLabel
|
|
1610
1623
|
}) : null
|
|
1611
1624
|
}) : null,
|
|
1612
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1625
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native_reanimated.default.View, {
|
|
1613
1626
|
style: [styles$1.gutterRows, rowsStyle],
|
|
1614
|
-
children: hours.map((hour) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
1627
|
+
children: [hours.map((hour) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
1615
1628
|
style: styles$1.hourCell,
|
|
1616
1629
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
1617
1630
|
style: [styles$1.hourRow, styles$1.nonInteractive],
|
|
@@ -1620,10 +1633,21 @@ const HourGutterInner = ({ width, minHour, maxHour, cellHeight, laneHeight, scro
|
|
|
1620
1633
|
width,
|
|
1621
1634
|
label: (0, _super_calendar_core.formatHour)(hour, { ampm }),
|
|
1622
1635
|
ampm,
|
|
1623
|
-
hourComponent
|
|
1636
|
+
hourComponent,
|
|
1637
|
+
hidden: labelHours != null && Math.abs(hour - labelHours) < NOW_LABEL_CLEARANCE_HOURS
|
|
1624
1638
|
})
|
|
1625
1639
|
})
|
|
1626
|
-
}, hour))
|
|
1640
|
+
}, hour)), labelHours != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
1641
|
+
style: [
|
|
1642
|
+
styles$1.nowLabel,
|
|
1643
|
+
styles$1.nonInteractive,
|
|
1644
|
+
{
|
|
1645
|
+
width,
|
|
1646
|
+
top: `${(labelHours - minHour) / (maxHour - minHour) * 100}%`
|
|
1647
|
+
}
|
|
1648
|
+
],
|
|
1649
|
+
children: label
|
|
1650
|
+
}) : null]
|
|
1627
1651
|
})
|
|
1628
1652
|
]
|
|
1629
1653
|
});
|
|
@@ -1752,14 +1776,13 @@ function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowT
|
|
|
1752
1776
|
if (date) onLongPressCell?.(date);
|
|
1753
1777
|
};
|
|
1754
1778
|
const hoursRange = (0, react.useMemo)(() => hourRange(minHour, maxHour), [minHour, maxHour]);
|
|
1755
|
-
const
|
|
1779
|
+
const tickOnPage = showNowIndicator && isActive && nowProp == null;
|
|
1780
|
+
const pageClock = (0, _super_calendar_core.useNow)(tickOnPage, {
|
|
1756
1781
|
now: nowProp,
|
|
1757
1782
|
timeZone: nowTimeZone
|
|
1758
1783
|
});
|
|
1759
|
-
const today =
|
|
1760
|
-
const
|
|
1761
|
-
const nowHours = ((0, date_fns.getHours)(now) * MINUTES_PER_HOUR$1 + (0, date_fns.getMinutes)(now)) / MINUTES_PER_HOUR$1;
|
|
1762
|
-
const nowInWindow = nowHours >= minHour && nowHours <= maxHour;
|
|
1784
|
+
const today = tickOnPage ? pageClock : (0, _super_calendar_core.nowInTimeZone)(nowProp, nowTimeZone);
|
|
1785
|
+
const nowPosition = showNowIndicator ? getNowPosition(today, days, minHour, maxHour) : null;
|
|
1763
1786
|
const fullHeightStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({ height: (maxHour - minHour) * heightSource.value }), [
|
|
1764
1787
|
minHour,
|
|
1765
1788
|
maxHour,
|
|
@@ -1779,7 +1802,7 @@ function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowT
|
|
|
1779
1802
|
height: Math.max(LANE_BAND_FLOOR, laneHeight.value),
|
|
1780
1803
|
borderBottomWidth: laneHeight.value >= LANE_BAND_FLOOR ? react_native.StyleSheet.hairlineWidth : 0
|
|
1781
1804
|
}));
|
|
1782
|
-
const pinStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({ transform: [{ translateY: scrollY.value }] }));
|
|
1805
|
+
const pinStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({ transform: [{ translateY: Math.max(0, scrollY.value) }] }));
|
|
1783
1806
|
const reportLaneLayout = (0, react.useCallback)((event) => {
|
|
1784
1807
|
onLaneLayout(pageIndex, event.nativeEvent.layout.height);
|
|
1785
1808
|
}, [onLaneLayout, pageIndex]);
|
|
@@ -2265,11 +2288,11 @@ function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowT
|
|
|
2265
2288
|
minEventHeight,
|
|
2266
2289
|
eventGap
|
|
2267
2290
|
}) : null,
|
|
2268
|
-
|
|
2291
|
+
nowPosition ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NowIndicator, {
|
|
2269
2292
|
cellHeight: heightSource,
|
|
2270
|
-
nowHours,
|
|
2293
|
+
nowHours: nowPosition.hours,
|
|
2271
2294
|
minHour,
|
|
2272
|
-
left: dayLeft(
|
|
2295
|
+
left: dayLeft(nowPosition.dayIndex),
|
|
2273
2296
|
width: dayWidth,
|
|
2274
2297
|
color: theme.colors.nowIndicator
|
|
2275
2298
|
}) : null,
|
|
@@ -2296,10 +2319,13 @@ function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowT
|
|
|
2296
2319
|
});
|
|
2297
2320
|
}
|
|
2298
2321
|
const TimetablePage = (0, react.memo)(TimetablePageInner);
|
|
2299
|
-
function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellHeight, hourHeight = 48, weekStartsOn, weekdayFormat = "short", labels: labelsProp, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes = 0, hourColumnWidth: hourColumnWidthProp = DEFAULT_HOUR_COLUMN_WIDTH, hideHours = false, timeslots = 1, showAllDayEventCell = true, showAllDayLabel = false, refreshControl, highlightWeekends = true, calendarCellStyle, businessHours, renderBusinessHours, renderBackgroundEvent, showWeekNumber = false, headerComponent, minHour = 0, maxHour = HOURS_PER_DAY, ampm = false, isRTL = false, minHourHeight = DEFAULT_MIN_HOUR_HEIGHT, maxHourHeight = DEFAULT_MAX_HOUR_HEIGHT, minEventHeight = DEFAULT_MIN_EVENT_HEIGHT, eventGap = DEFAULT_EVENT_GAP, showNowIndicator = true, locale, freeSwipe = false, swipeEnabled = true, showVerticalScrollIndicator = true, verticalScrollEnabled = true, weekNumberPrefix = "W", hiddenDays, now, timeZone, hourComponent, activeDate, resetPageOnPressCell = false, dragStepMinutes = DEFAULT_DRAG_STEP_MINUTES, showDragHandle = true, eventStartEditable = true, eventDurationEditable = true, eventOverlap = true, onPressEvent, onLongPressEvent, onDragEvent: onDragEventProp, onDragStart, onPressCell, onLongPressCell, onCreateEvent, renderCreateGhost, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }, ref) {
|
|
2322
|
+
function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellHeight, hourHeight = 48, weekStartsOn, weekdayFormat = "short", labels: labelsProp, renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes = 0, hourColumnWidth: hourColumnWidthProp = DEFAULT_HOUR_COLUMN_WIDTH, hideHours = false, timeslots = 1, showAllDayEventCell = true, showAllDayLabel = false, refreshControl, highlightWeekends = true, calendarCellStyle, businessHours, renderBusinessHours, renderBackgroundEvent, showWeekNumber = false, headerComponent, minHour = 0, maxHour = HOURS_PER_DAY, ampm = false, isRTL = false, minHourHeight = DEFAULT_MIN_HOUR_HEIGHT, maxHourHeight = DEFAULT_MAX_HOUR_HEIGHT, minEventHeight = DEFAULT_MIN_EVENT_HEIGHT, eventGap = DEFAULT_EVENT_GAP, showNowIndicator = true, locale, freeSwipe = false, swipeEnabled = true, showVerticalScrollIndicator = true, verticalScrollEnabled = true, weekNumberPrefix = "W", hiddenDays, now: nowProp, timeZone, hourComponent, activeDate, resetPageOnPressCell = false, dragStepMinutes = DEFAULT_DRAG_STEP_MINUTES, showDragHandle = true, eventStartEditable = true, eventDurationEditable = true, eventOverlap = true, onPressEvent, onLongPressEvent, onDragEvent: onDragEventProp, onDragStart, onPressCell, onLongPressCell, onCreateEvent, renderCreateGhost, onPressDateHeader, onChangeDate, renderHeader, renderNowLabel, contentPaddingBottom = 0, onVerticalScroll, verticalBounces = true, classNames, styles: styleOverrides }, ref) {
|
|
2300
2323
|
const clampedMinHour = Math.max(0, Math.min(minHour, 23));
|
|
2301
2324
|
const clampedMaxHour = Math.max(clampedMinHour + 1, Math.min(maxHour, HOURS_PER_DAY));
|
|
2302
2325
|
const hourColumnWidth = hideHours ? 0 : hourColumnWidthProp;
|
|
2326
|
+
const hasNowLabel = showNowIndicator && renderNowLabel != null && hourColumnWidth > 0;
|
|
2327
|
+
const labelClock = (0, _super_calendar_core.useNow)(hasNowLabel, { now: nowProp });
|
|
2328
|
+
const now = nowProp ?? (hasNowLabel ? labelClock : void 0);
|
|
2303
2329
|
const labels = (0, react.useMemo)(() => (0, _super_calendar_core.resolveCalendarLabels)(labelsProp), [labelsProp]);
|
|
2304
2330
|
const todayLabel = labels.today;
|
|
2305
2331
|
const pagedHeader = renderHeader == null;
|
|
@@ -2335,7 +2361,21 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2335
2361
|
const scrollY = (0, react_native_reanimated.useSharedValue)(seedDefaultY);
|
|
2336
2362
|
const scrollHandler = (0, react_native_reanimated.useAnimatedScrollHandler)({ onScroll: (event) => {
|
|
2337
2363
|
scrollY.value = event.contentOffset.y;
|
|
2338
|
-
|
|
2364
|
+
if (onVerticalScroll) (0, react_native_reanimated.runOnJS)(onVerticalScroll)({ nativeEvent: {
|
|
2365
|
+
contentOffset: {
|
|
2366
|
+
x: event.contentOffset.x,
|
|
2367
|
+
y: event.contentOffset.y
|
|
2368
|
+
},
|
|
2369
|
+
contentSize: {
|
|
2370
|
+
width: event.contentSize.width,
|
|
2371
|
+
height: event.contentSize.height
|
|
2372
|
+
},
|
|
2373
|
+
layoutMeasurement: {
|
|
2374
|
+
width: event.layoutMeasurement.width,
|
|
2375
|
+
height: event.layoutMeasurement.height
|
|
2376
|
+
}
|
|
2377
|
+
} });
|
|
2378
|
+
} }, [onVerticalScroll]);
|
|
2339
2379
|
const [mountOffsetY] = (0, react.useState)(seedDefaultY);
|
|
2340
2380
|
const webSeededRef = (0, react.useRef)(!isWeb$1);
|
|
2341
2381
|
const seedWebScroll = (0, react.useCallback)(() => {
|
|
@@ -2519,17 +2559,17 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2519
2559
|
hiddenDays,
|
|
2520
2560
|
weekNumberPrefix
|
|
2521
2561
|
]);
|
|
2522
|
-
const
|
|
2562
|
+
const activePageDate = pageDates[activeIndex] ?? date;
|
|
2563
|
+
const headerDays = (0, react.useMemo)(() => (0, _super_calendar_core.getViewDays)(mode, activePageDate, weekStartsOn, numberOfDays, isRTL, weekEndsOn, hiddenDays), [
|
|
2523
2564
|
mode,
|
|
2524
|
-
|
|
2525
|
-
activeIndex,
|
|
2526
|
-
date,
|
|
2565
|
+
activePageDate,
|
|
2527
2566
|
weekStartsOn,
|
|
2528
2567
|
numberOfDays,
|
|
2529
2568
|
isRTL,
|
|
2530
2569
|
weekEndsOn,
|
|
2531
2570
|
hiddenDays
|
|
2532
2571
|
]);
|
|
2572
|
+
const gutterNow = hasNowLabel ? getNowPosition((0, _super_calendar_core.nowInTimeZone)(now, timeZone), headerDays, clampedMinHour, clampedMaxHour) : null;
|
|
2533
2573
|
dropRef.current = {
|
|
2534
2574
|
headerDays,
|
|
2535
2575
|
columnsWidth,
|
|
@@ -2565,9 +2605,25 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2565
2605
|
animated: false
|
|
2566
2606
|
});
|
|
2567
2607
|
}, [activeIndex]);
|
|
2568
|
-
(0, react.
|
|
2608
|
+
const laidOutWidthRef = (0, react.useRef)(null);
|
|
2609
|
+
(0, react.useLayoutEffect)(() => {
|
|
2569
2610
|
pagerOffset.value = activeIndex * columnsWidth;
|
|
2570
|
-
|
|
2611
|
+
if (!pagerReady) {
|
|
2612
|
+
laidOutWidthRef.current = null;
|
|
2613
|
+
return;
|
|
2614
|
+
}
|
|
2615
|
+
const previous = laidOutWidthRef.current;
|
|
2616
|
+
laidOutWidthRef.current = columnsWidth;
|
|
2617
|
+
if (previous == null || previous === columnsWidth) return;
|
|
2618
|
+
listRef.current?.scrollToIndex({
|
|
2619
|
+
index: activeIndex,
|
|
2620
|
+
animated: false
|
|
2621
|
+
});
|
|
2622
|
+
}, [
|
|
2623
|
+
columnsWidth,
|
|
2624
|
+
pagerOffset,
|
|
2625
|
+
pagerReady
|
|
2626
|
+
]);
|
|
2571
2627
|
(0, react.useEffect)(() => {
|
|
2572
2628
|
if (!isWeb$1) return;
|
|
2573
2629
|
let attempts = 0;
|
|
@@ -2661,8 +2717,12 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2661
2717
|
pageDates,
|
|
2662
2718
|
onChangeDate
|
|
2663
2719
|
]);
|
|
2720
|
+
const pagerDraggingRef = (0, react.useRef)(false);
|
|
2721
|
+
const pagerUserScrollRef = (0, react.useRef)(false);
|
|
2664
2722
|
const handlePagerSettled = (0, react.useCallback)((event) => {
|
|
2665
2723
|
if (columnsWidth <= 0) return;
|
|
2724
|
+
if (!pagerUserScrollRef.current || pagerDraggingRef.current) return;
|
|
2725
|
+
pagerUserScrollRef.current = false;
|
|
2666
2726
|
if (pendingScrollIndexRef.current != null) return;
|
|
2667
2727
|
const index = commitNearestPage(event.nativeEvent.contentOffset.x);
|
|
2668
2728
|
pagerOffset.value = index * columnsWidth;
|
|
@@ -2677,7 +2737,6 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2677
2737
|
commitNearestPage,
|
|
2678
2738
|
pagerOffset
|
|
2679
2739
|
]);
|
|
2680
|
-
const pagerDraggingRef = (0, react.useRef)(false);
|
|
2681
2740
|
const lastPagerScrollRef = (0, react.useRef)({
|
|
2682
2741
|
offsetX: 0,
|
|
2683
2742
|
at: 0
|
|
@@ -2726,6 +2785,7 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2726
2785
|
}, [armPagerIdleTimer]);
|
|
2727
2786
|
const handlePagerDragStart = (0, react.useCallback)(() => {
|
|
2728
2787
|
pagerDraggingRef.current = true;
|
|
2788
|
+
pagerUserScrollRef.current = true;
|
|
2729
2789
|
}, []);
|
|
2730
2790
|
const handlePagerDragEnd = (0, react.useCallback)(() => {
|
|
2731
2791
|
pagerDraggingRef.current = false;
|
|
@@ -2865,6 +2925,8 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2865
2925
|
dragStepMinutes,
|
|
2866
2926
|
minHour,
|
|
2867
2927
|
maxHour,
|
|
2928
|
+
headerDays,
|
|
2929
|
+
showNowIndicator,
|
|
2868
2930
|
nowTime,
|
|
2869
2931
|
timeZone
|
|
2870
2932
|
}), [
|
|
@@ -2877,6 +2939,8 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2877
2939
|
dragStepMinutes,
|
|
2878
2940
|
minHour,
|
|
2879
2941
|
maxHour,
|
|
2942
|
+
headerDays,
|
|
2943
|
+
showNowIndicator,
|
|
2880
2944
|
nowTime,
|
|
2881
2945
|
timeZone
|
|
2882
2946
|
]);
|
|
@@ -2916,6 +2980,9 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2916
2980
|
x: 0,
|
|
2917
2981
|
y: mountOffsetY
|
|
2918
2982
|
},
|
|
2983
|
+
contentContainerStyle: contentPaddingBottom > 0 ? { paddingBottom: contentPaddingBottom } : void 0,
|
|
2984
|
+
bounces: verticalBounces,
|
|
2985
|
+
overScrollMode: verticalBounces ? void 0 : "never",
|
|
2919
2986
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native_reanimated.default.View, {
|
|
2920
2987
|
testID: "time-grid-hours",
|
|
2921
2988
|
style: [styles$1.gridRow, gridHeightStyle],
|
|
@@ -2932,7 +2999,9 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2932
2999
|
headerHeight: headerOffset,
|
|
2933
3000
|
weekNumber,
|
|
2934
3001
|
ampm,
|
|
2935
|
-
hourComponent
|
|
3002
|
+
hourComponent,
|
|
3003
|
+
renderNowLabel,
|
|
3004
|
+
nowPosition: gutterNow
|
|
2936
3005
|
}) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native.View, {
|
|
2937
3006
|
ref: pagerRef,
|
|
2938
3007
|
testID: "time-grid-pager",
|
|
@@ -2969,18 +3038,16 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
2969
3038
|
disableIntervalMomentum: !freeSwipe,
|
|
2970
3039
|
scrollEventThrottle: 16,
|
|
2971
3040
|
onMomentumScrollEnd: handlePagerSettled,
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
onScrollEndDrag: handlePagerDragEnd
|
|
2976
|
-
} : null
|
|
3041
|
+
onScrollBeginDrag: handlePagerDragStart,
|
|
3042
|
+
onScrollEndDrag: handlePagerDragEnd,
|
|
3043
|
+
...react_native.Platform.OS === "android" ? { onScroll: handlePagerScroll } : null
|
|
2977
3044
|
},
|
|
2978
3045
|
initialScrollIndex: activeIndex,
|
|
2979
3046
|
showsHorizontalScrollIndicator: false,
|
|
2980
3047
|
viewabilityConfig: PAGE_VIEWABILITY,
|
|
2981
3048
|
onViewableItemsChanged: handleViewableItemsChanged,
|
|
2982
3049
|
renderItem
|
|
2983
|
-
}
|
|
3050
|
+
}) : null, liftedEvent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DragGhost, {
|
|
2984
3051
|
x: ghostX,
|
|
2985
3052
|
y: ghostY,
|
|
2986
3053
|
w: ghostW,
|
|
@@ -3174,6 +3241,11 @@ const styles$1 = react_native.StyleSheet.create({
|
|
|
3174
3241
|
textAlign: "right",
|
|
3175
3242
|
paddingRight: 6
|
|
3176
3243
|
},
|
|
3244
|
+
nowLabel: {
|
|
3245
|
+
position: "absolute",
|
|
3246
|
+
left: 0,
|
|
3247
|
+
marginTop: -6
|
|
3248
|
+
},
|
|
3177
3249
|
gutterRows: {
|
|
3178
3250
|
position: "absolute",
|
|
3179
3251
|
left: 0,
|
|
@@ -3334,7 +3406,7 @@ function expansionRange(mode, date, weekStartsOn, numberOfDays, weekEndsOn, numb
|
|
|
3334
3406
|
* ```
|
|
3335
3407
|
*/
|
|
3336
3408
|
const Calendar = (0, react.forwardRef)(CalendarInner);
|
|
3337
|
-
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) {
|
|
3409
|
+
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, renderNowLabel, timeGridContentPaddingBottom, onTimeGridScroll, timeGridBounces, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }, ref) {
|
|
3338
3410
|
const mergedTheme = (0, react.useMemo)(() => require_MonthList.mergeTheme(theme), [theme]);
|
|
3339
3411
|
const internalCellHeight = (0, react_native_reanimated.useSharedValue)(hourHeight);
|
|
3340
3412
|
const cellHeight = cellHeightProp ?? internalCellHeight;
|
|
@@ -3611,6 +3683,10 @@ function CalendarInner({ events, mode, date, onChangeDate, onChangeDateRange, on
|
|
|
3611
3683
|
onPressDateHeader,
|
|
3612
3684
|
onChangeDate: handleChangeDate,
|
|
3613
3685
|
renderHeader: renderTimeGridHeader,
|
|
3686
|
+
renderNowLabel,
|
|
3687
|
+
contentPaddingBottom: timeGridContentPaddingBottom,
|
|
3688
|
+
onVerticalScroll: onTimeGridScroll,
|
|
3689
|
+
verticalBounces: timeGridBounces,
|
|
3614
3690
|
classNames,
|
|
3615
3691
|
styles: styleOverrides
|
|
3616
3692
|
})
|