@super-calendar/native 2.7.0 → 2.8.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/{DefaultMonthEvent-DCPDsnvq.d.ts → DefaultMonthEvent-Cm9DsHBK.d.mts} +7 -4
- package/dist/{DefaultMonthEvent-DMOC5aNL.d.mts → DefaultMonthEvent-DAxZjk_D.d.ts} +7 -4
- package/dist/{MonthList-CJs1vq5T.js → MonthList-BWTCCmko.js} +88 -24
- package/dist/{MonthList-Dn37Ezj0.mjs → MonthList-Chx0jP5n.mjs} +89 -25
- package/dist/index.d.mts +27 -6
- package/dist/index.d.ts +27 -6
- package/dist/index.js +120 -47
- package/dist/index.mjs +116 -49
- package/dist/picker.d.mts +1 -1
- package/dist/picker.d.ts +1 -1
- package/dist/picker.js +1 -1
- package/dist/picker.mjs +1 -1
- package/package.json +2 -2
- package/src/components/Calendar.tsx +12 -0
- package/src/components/MonthView.tsx +144 -35
- package/src/components/ResourceTimeline.tsx +32 -15
- package/src/components/TimeGrid.tsx +155 -29
- package/src/index.tsx +3 -0
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
|
-
const require_MonthList = require("./MonthList-
|
|
24
|
+
const require_MonthList = require("./MonthList-BWTCCmko.js");
|
|
25
25
|
let date_fns = require("date-fns");
|
|
26
26
|
let react = require("react");
|
|
27
27
|
let react_native_reanimated = require("react-native-reanimated");
|
|
@@ -619,7 +619,7 @@ function DragGhost({ x, y, w, h, visible, event, mode, renderEvent }) {
|
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
621
|
const HOUR_LABEL_TOP_INSET = 12;
|
|
622
|
-
function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWidth, dayIndex, dayCount, dayOrdinals, mode, daysPerPage, renderEvent, snapMinutes, onPress, onLongPress, onDragEvent, onDragStart, onEdgeAdvance, showDragHandle }) {
|
|
622
|
+
function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWidth, dayIndex, dayCount, dayOrdinals, mode, daysPerPage, renderEvent, snapMinutes, onPress, onLongPress, onDragEvent, onDragStart, onEdgeAdvance, showDragHandle, eventStartEditable, eventDurationEditable }) {
|
|
623
623
|
const RenderEventComponent = renderEvent;
|
|
624
624
|
const theme = require_MonthList.useCalendarTheme();
|
|
625
625
|
const slot = require_MonthList.useSlots();
|
|
@@ -630,11 +630,15 @@ function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWid
|
|
|
630
630
|
const ghostXSV = edgePaging?.ghostX;
|
|
631
631
|
const ghostYSV = edgePaging?.ghostY;
|
|
632
632
|
const commitLiftedDrop = edgePaging?.commitLiftedDrop;
|
|
633
|
-
const
|
|
634
|
-
const
|
|
633
|
+
const editable = onDragEvent != null && !positioned.event.disabled && positioned.event.draggable !== false;
|
|
634
|
+
const canMove = editable && (positioned.event.startEditable ?? eventStartEditable);
|
|
635
|
+
const canResize = editable && (positioned.event.durationEditable ?? eventDurationEditable);
|
|
636
|
+
const resizable = canResize && !positioned.continuesAfter;
|
|
637
|
+
const resizableFromStart = canResize && !positioned.continuesBefore && !isWeb$1;
|
|
635
638
|
const moveOffset = (0, react_native_reanimated.useSharedValue)(0);
|
|
636
639
|
const moveOffsetX = (0, react_native_reanimated.useSharedValue)(0);
|
|
637
640
|
const resizeDelta = (0, react_native_reanimated.useSharedValue)(0);
|
|
641
|
+
const resizeStartDelta = (0, react_native_reanimated.useSharedValue)(0);
|
|
638
642
|
const dragZ = (0, react_native_reanimated.useSharedValue)(0);
|
|
639
643
|
const edgeDir = (0, react_native_reanimated.useSharedValue)(0);
|
|
640
644
|
const lifted = (0, react_native_reanimated.useSharedValue)(0);
|
|
@@ -644,9 +648,9 @@ function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWid
|
|
|
644
648
|
const liveAbsY = (0, react_native_reanimated.useSharedValue)(0);
|
|
645
649
|
const startHours = positioned.startHours;
|
|
646
650
|
const durationHours = positioned.durationHours;
|
|
647
|
-
const boxHeight = (0, react_native_reanimated.useDerivedValue)(() => Math.max(durationHours * cellHeight.value + resizeDelta.value, MIN_EVENT_HEIGHT), [durationHours]);
|
|
651
|
+
const boxHeight = (0, react_native_reanimated.useDerivedValue)(() => Math.max(durationHours * cellHeight.value + resizeDelta.value - resizeStartDelta.value, MIN_EVENT_HEIGHT), [durationHours]);
|
|
648
652
|
const boxStyle = (0, react_native_reanimated.useAnimatedStyle)(() => ({
|
|
649
|
-
top: (startHours - minHour) * cellHeight.value + moveOffset.value,
|
|
653
|
+
top: (startHours - minHour) * cellHeight.value + moveOffset.value + resizeStartDelta.value,
|
|
650
654
|
height: boxHeight.value,
|
|
651
655
|
transform: [{ translateX: moveOffsetX.value }],
|
|
652
656
|
zIndex: dragZ.value
|
|
@@ -659,12 +663,14 @@ function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWid
|
|
|
659
663
|
moveOffset.value = 0;
|
|
660
664
|
moveOffsetX.value = 0;
|
|
661
665
|
resizeDelta.value = 0;
|
|
666
|
+
resizeStartDelta.value = 0;
|
|
662
667
|
}, [
|
|
663
668
|
positioned.startHours,
|
|
664
669
|
positioned.durationHours,
|
|
665
670
|
moveOffset,
|
|
666
671
|
moveOffsetX,
|
|
667
|
-
resizeDelta
|
|
672
|
+
resizeDelta,
|
|
673
|
+
resizeStartDelta
|
|
668
674
|
]);
|
|
669
675
|
const latest = (0, react.useRef)({
|
|
670
676
|
event: positioned.event,
|
|
@@ -680,10 +686,12 @@ function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWid
|
|
|
680
686
|
moveOffset.value = 0;
|
|
681
687
|
moveOffsetX.value = 0;
|
|
682
688
|
resizeDelta.value = 0;
|
|
689
|
+
resizeStartDelta.value = 0;
|
|
683
690
|
}, [
|
|
684
691
|
moveOffset,
|
|
685
692
|
moveOffsetX,
|
|
686
|
-
resizeDelta
|
|
693
|
+
resizeDelta,
|
|
694
|
+
resizeStartDelta
|
|
687
695
|
]);
|
|
688
696
|
const commitDrag = (0, react.useCallback)((deltaStartMin, deltaEndMin) => {
|
|
689
697
|
const { event, onDragEvent: handler } = latest.current;
|
|
@@ -739,7 +747,7 @@ function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWid
|
|
|
739
747
|
onEdgeAdvance
|
|
740
748
|
]);
|
|
741
749
|
const moveGesture = (0, react.useMemo)(() => {
|
|
742
|
-
const pan = react_native_gesture_handler.Gesture.Pan().enabled(
|
|
750
|
+
const pan = react_native_gesture_handler.Gesture.Pan().enabled(canMove).onStart((event) => {
|
|
743
751
|
dragZ.value = DRAG_EVENT_Z;
|
|
744
752
|
edgeDir.value = 0;
|
|
745
753
|
lifted.value = 0;
|
|
@@ -794,7 +802,7 @@ function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWid
|
|
|
794
802
|
});
|
|
795
803
|
return isWeb$1 ? pan.activeOffsetX([-8, DRAG_ACTIVATE_PX$1]).activeOffsetY([-8, DRAG_ACTIVATE_PX$1]) : pan.activateAfterLongPress(MOVE_ACTIVATE_MS$1);
|
|
796
804
|
}, [
|
|
797
|
-
|
|
805
|
+
canMove,
|
|
798
806
|
snapMinutes,
|
|
799
807
|
cellHeight,
|
|
800
808
|
moveOffset,
|
|
@@ -847,19 +855,42 @@ function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWid
|
|
|
847
855
|
commitDrag,
|
|
848
856
|
notifyDragStart
|
|
849
857
|
]);
|
|
858
|
+
const resizeStartGesture = (0, react.useMemo)(() => react_native_gesture_handler.Gesture.Pan().enabled(resizableFromStart).onStart(() => {
|
|
859
|
+
dragZ.value = DRAG_EVENT_Z;
|
|
860
|
+
(0, react_native_reanimated.runOnJS)(notifyDragStart)();
|
|
861
|
+
}).onUpdate((event) => {
|
|
862
|
+
resizeStartDelta.value = event.translationY;
|
|
863
|
+
}).onEnd((event) => {
|
|
864
|
+
const delta = (0, _super_calendar_core.snapDeltaMinutes)(event.translationY, cellHeight.value, snapMinutes);
|
|
865
|
+
if (delta === 0) {
|
|
866
|
+
resizeStartDelta.value = 0;
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
resizeStartDelta.value = delta / MINUTES_PER_HOUR$1 * cellHeight.value;
|
|
870
|
+
(0, react_native_reanimated.runOnJS)(commitDrag)(delta, 0);
|
|
871
|
+
}).onFinalize(() => {
|
|
872
|
+
dragZ.value = 0;
|
|
873
|
+
}), [
|
|
874
|
+
resizableFromStart,
|
|
875
|
+
snapMinutes,
|
|
876
|
+
cellHeight,
|
|
877
|
+
resizeStartDelta,
|
|
878
|
+
dragZ,
|
|
879
|
+
commitDrag,
|
|
880
|
+
notifyDragStart
|
|
881
|
+
]);
|
|
850
882
|
const handlePress = () => onPress(positioned.event);
|
|
851
|
-
const handleLongPress = !
|
|
883
|
+
const handleLongPress = !canMove && onLongPress ? () => onLongPress(positioned.event) : void 0;
|
|
852
884
|
const unit = (n) => `${n} minute${n === 1 ? "" : "s"}`;
|
|
853
885
|
const pageUnit = mode === "week" ? "week" : daysPerPage === 1 ? "day" : `${daysPerPage} day${daysPerPage === 1 ? "" : "s"}`;
|
|
854
|
-
const
|
|
855
|
-
{
|
|
886
|
+
const dragActions = [
|
|
887
|
+
...canMove ? [{
|
|
856
888
|
name: "move-later",
|
|
857
889
|
label: `Move ${unit(snapMinutes)} later`
|
|
858
|
-
},
|
|
859
|
-
{
|
|
890
|
+
}, {
|
|
860
891
|
name: "move-earlier",
|
|
861
892
|
label: `Move ${unit(snapMinutes)} earlier`
|
|
862
|
-
},
|
|
893
|
+
}] : [],
|
|
863
894
|
...resizable ? [{
|
|
864
895
|
name: "extend",
|
|
865
896
|
label: `Extend by ${unit(snapMinutes)}`
|
|
@@ -867,16 +898,16 @@ function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWid
|
|
|
867
898
|
name: "shrink",
|
|
868
899
|
label: `Shorten by ${unit(snapMinutes)}`
|
|
869
900
|
}] : [],
|
|
870
|
-
{
|
|
901
|
+
...canMove ? [{
|
|
871
902
|
name: "move-next-page",
|
|
872
903
|
label: `Move to next ${pageUnit}`
|
|
873
|
-
},
|
|
874
|
-
{
|
|
904
|
+
}, {
|
|
875
905
|
name: "move-previous-page",
|
|
876
906
|
label: `Move to previous ${pageUnit}`
|
|
877
|
-
}
|
|
878
|
-
]
|
|
879
|
-
const
|
|
907
|
+
}] : []
|
|
908
|
+
];
|
|
909
|
+
const accessibilityActions = dragActions.length ? dragActions : void 0;
|
|
910
|
+
const handleAccessibilityAction = accessibilityActions ? (e) => {
|
|
880
911
|
switch (e.nativeEvent.actionName) {
|
|
881
912
|
case "move-later":
|
|
882
913
|
commitDrag(snapMinutes, snapMinutes);
|
|
@@ -908,25 +939,35 @@ function AnimatedEventBox({ positioned, cellHeight, minHour, left, width, dayWid
|
|
|
908
939
|
const box = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native_reanimated.default.View, {
|
|
909
940
|
...eventSlot,
|
|
910
941
|
style: [eventSlot.style, boxStyle],
|
|
911
|
-
children: [
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
children:
|
|
926
|
-
|
|
927
|
-
|
|
942
|
+
children: [
|
|
943
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RenderEventComponent, {
|
|
944
|
+
event: positioned.event,
|
|
945
|
+
mode,
|
|
946
|
+
boxHeight,
|
|
947
|
+
continuesBefore: positioned.continuesBefore,
|
|
948
|
+
continuesAfter: positioned.continuesAfter,
|
|
949
|
+
accessibilityActions,
|
|
950
|
+
onAccessibilityAction: handleAccessibilityAction,
|
|
951
|
+
onPress: handlePress,
|
|
952
|
+
onLongPress: handleLongPress
|
|
953
|
+
}),
|
|
954
|
+
resizableFromStart ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_gesture_handler.GestureDetector, {
|
|
955
|
+
gesture: resizeStartGesture,
|
|
956
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_reanimated.default.View, {
|
|
957
|
+
style: styles$1.resizeHandleTop,
|
|
958
|
+
children: showDragHandle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, { style: [styles$1.resizeGrip, { backgroundColor: theme.colors.eventText }] }) : null
|
|
959
|
+
})
|
|
960
|
+
}) : null,
|
|
961
|
+
resizable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_gesture_handler.GestureDetector, {
|
|
962
|
+
gesture: resizeGesture,
|
|
963
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_reanimated.default.View, {
|
|
964
|
+
style: styles$1.resizeHandle,
|
|
965
|
+
children: showDragHandle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, { style: [styles$1.resizeGrip, { backgroundColor: theme.colors.eventText }] }) : null
|
|
966
|
+
})
|
|
967
|
+
}) : null
|
|
968
|
+
]
|
|
928
969
|
});
|
|
929
|
-
if (!
|
|
970
|
+
if (!canMove) return box;
|
|
930
971
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_gesture_handler.GestureDetector, {
|
|
931
972
|
gesture: moveGesture,
|
|
932
973
|
children: box
|
|
@@ -1029,7 +1070,7 @@ const ShadeBand = ({ cellHeight, startHour, endHour, minHour, left, width, color
|
|
|
1029
1070
|
children
|
|
1030
1071
|
});
|
|
1031
1072
|
};
|
|
1032
|
-
function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowTimeZone, date, events, cellHeight, hourHeight, committedCellHeight, scrollY, isActive, initialScrollY, onSettleOffset, weekStartsOn, weekEndsOn, width, hourColumnWidth, minHour, maxHour, ampm, timeslots, isRTL, showAllDayEventCell, highlightWeekends, showVerticalScrollIndicator, verticalScrollEnabled, hourComponent, calendarCellStyle, minHourHeight, maxHourHeight, showNowIndicator, businessHours, renderBusinessHours, renderEvent, keyExtractor, snapMinutes, showDragHandle, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onEdgeAdvance, onGridTop }) {
|
|
1073
|
+
function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowTimeZone, date, events, cellHeight, hourHeight, committedCellHeight, scrollY, isActive, initialScrollY, onSettleOffset, weekStartsOn, weekEndsOn, width, hourColumnWidth, minHour, maxHour, ampm, timeslots, isRTL, showAllDayEventCell, highlightWeekends, showVerticalScrollIndicator, verticalScrollEnabled, hourComponent, calendarCellStyle, minHourHeight, maxHourHeight, showNowIndicator, businessHours, renderBusinessHours, renderEvent, keyExtractor, snapMinutes, showDragHandle, eventStartEditable, eventDurationEditable, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onEdgeAdvance, onGridTop }) {
|
|
1033
1074
|
const theme = require_MonthList.useCalendarTheme();
|
|
1034
1075
|
const slot = require_MonthList.useSlots();
|
|
1035
1076
|
const scrollRef = (0, react_native_reanimated.useAnimatedRef)();
|
|
@@ -1413,6 +1454,8 @@ function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowT
|
|
|
1413
1454
|
renderEvent,
|
|
1414
1455
|
snapMinutes,
|
|
1415
1456
|
showDragHandle,
|
|
1457
|
+
eventStartEditable,
|
|
1458
|
+
eventDurationEditable,
|
|
1416
1459
|
onPress: onPressEvent,
|
|
1417
1460
|
onLongPress: onLongPressEvent,
|
|
1418
1461
|
onDragEvent,
|
|
@@ -1439,7 +1482,7 @@ function TimetablePageInner({ mode, numberOfDays, hiddenDays, now: nowProp, nowT
|
|
|
1439
1482
|
});
|
|
1440
1483
|
}
|
|
1441
1484
|
const TimetablePage = (0, react.memo)(TimetablePageInner);
|
|
1442
|
-
function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellHeight, hourHeight = 48, weekStartsOn, weekdayFormat = "short", renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes = 0, hourColumnWidth: hourColumnWidthProp = DEFAULT_HOUR_COLUMN_WIDTH, hideHours = false, timeslots = 1, showAllDayEventCell = true, highlightWeekends = true, calendarCellStyle, businessHours, renderBusinessHours, showWeekNumber = false, headerComponent, minHour = 0, maxHour = HOURS_PER_DAY, ampm = false, isRTL = false, minHourHeight = DEFAULT_MIN_HOUR_HEIGHT, maxHourHeight = DEFAULT_MAX_HOUR_HEIGHT, 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, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, onPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }) {
|
|
1485
|
+
function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellHeight, hourHeight = 48, weekStartsOn, weekdayFormat = "short", renderEvent, eventAccessibilityLabel, keyExtractor, scrollOffsetMinutes = 0, hourColumnWidth: hourColumnWidthProp = DEFAULT_HOUR_COLUMN_WIDTH, hideHours = false, timeslots = 1, showAllDayEventCell = true, highlightWeekends = true, calendarCellStyle, businessHours, renderBusinessHours, showWeekNumber = false, headerComponent, minHour = 0, maxHour = HOURS_PER_DAY, ampm = false, isRTL = false, minHourHeight = DEFAULT_MIN_HOUR_HEIGHT, maxHourHeight = DEFAULT_MAX_HOUR_HEIGHT, 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, onPressDateHeader, onChangeDate, renderHeader, classNames, styles: styleOverrides }) {
|
|
1443
1486
|
const clampedMinHour = Math.max(0, Math.min(minHour, HOURS_PER_DAY - 1));
|
|
1444
1487
|
const clampedMaxHour = Math.max(clampedMinHour + 1, Math.min(maxHour, HOURS_PER_DAY));
|
|
1445
1488
|
const hourColumnWidth = hideHours ? 0 : hourColumnWidthProp;
|
|
@@ -1448,6 +1491,14 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
1448
1491
|
eventAccessibilityLabel,
|
|
1449
1492
|
ampm
|
|
1450
1493
|
]);
|
|
1494
|
+
const onDragEvent = (0, react.useMemo)(() => {
|
|
1495
|
+
if (!onDragEventProp || eventOverlap !== false) return onDragEventProp;
|
|
1496
|
+
return (event, start, end) => (0, _super_calendar_core.overlapsOtherEvents)(events, event, start, end) ? false : onDragEventProp(event, start, end);
|
|
1497
|
+
}, [
|
|
1498
|
+
onDragEventProp,
|
|
1499
|
+
eventOverlap,
|
|
1500
|
+
events
|
|
1501
|
+
]);
|
|
1451
1502
|
const { width, height } = (0, react_native.useWindowDimensions)();
|
|
1452
1503
|
const listRef = (0, react.useRef)(null);
|
|
1453
1504
|
const pagerRef = (0, react.useRef)(null);
|
|
@@ -1740,6 +1791,8 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
1740
1791
|
keyExtractor,
|
|
1741
1792
|
snapMinutes: Math.max(1, dragStepMinutes),
|
|
1742
1793
|
showDragHandle,
|
|
1794
|
+
eventStartEditable,
|
|
1795
|
+
eventDurationEditable,
|
|
1743
1796
|
onPressEvent,
|
|
1744
1797
|
onLongPressEvent,
|
|
1745
1798
|
onDragEvent,
|
|
@@ -1786,6 +1839,8 @@ function TimeGridInner({ mode, numberOfDays = 1, weekEndsOn, date, events, cellH
|
|
|
1786
1839
|
keyExtractor,
|
|
1787
1840
|
dragStepMinutes,
|
|
1788
1841
|
showDragHandle,
|
|
1842
|
+
eventStartEditable,
|
|
1843
|
+
eventDurationEditable,
|
|
1789
1844
|
onPressEvent,
|
|
1790
1845
|
onLongPressEvent,
|
|
1791
1846
|
onDragEvent,
|
|
@@ -2041,6 +2096,15 @@ const styles$1 = react_native.StyleSheet.create({
|
|
|
2041
2096
|
alignItems: "center",
|
|
2042
2097
|
justifyContent: "center"
|
|
2043
2098
|
},
|
|
2099
|
+
resizeHandleTop: {
|
|
2100
|
+
position: "absolute",
|
|
2101
|
+
left: 0,
|
|
2102
|
+
right: 0,
|
|
2103
|
+
top: 0,
|
|
2104
|
+
height: RESIZE_HANDLE_HEIGHT,
|
|
2105
|
+
alignItems: "center",
|
|
2106
|
+
justifyContent: "center"
|
|
2107
|
+
},
|
|
2044
2108
|
resizeGrip: {
|
|
2045
2109
|
width: 24,
|
|
2046
2110
|
height: 3,
|
|
@@ -2107,7 +2171,7 @@ function expansionRange(mode, date, weekStartsOn, numberOfDays, weekEndsOn) {
|
|
|
2107
2171
|
* }
|
|
2108
2172
|
* ```
|
|
2109
2173
|
*/
|
|
2110
|
-
function Calendar({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn = 0, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent = DefaultEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor = defaultKeyExtractor, theme, cellHeight: cellHeightProp, hourHeight = 48, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }) {
|
|
2174
|
+
function Calendar({ events, mode, date, onChangeDate, onChangeDateRange, onPressEvent, onLongPressEvent, onDragEvent, onDragStart, dragStepMinutes, showDragHandle, onPressDay, onPressMonth, onLongPressDay, onPressMore, onPressCell, resetPageOnPressCell, onLongPressCell, onCreateEvent, onPressDateHeader, maxVisibleEventCount, sortedMonthView, moreLabel, showAdjacentMonths, disableMonthEventCellPress, weekStartsOn = 0, hiddenDays, now, weekdayFormat, numberOfDays, weekEndsOn, renderEvent = DefaultEvent, eventAccessibilityLabel, eventCellStyle, calendarCellStyle, businessHours, renderBusinessHours, keyExtractor = defaultKeyExtractor, theme, cellHeight: cellHeightProp, hourHeight = 48, minHourHeight, maxHourHeight, hourColumnWidth, hideHours, timeslots, showAllDayEventCell, highlightWeekends, eventStartEditable, eventDurationEditable, eventOverlap, showWeekNumber, weekNumberPrefix, hourComponent, showSixWeeks, swipeEnabled, showVerticalScrollIndicator, verticalScrollEnabled, headerComponent, minHour, maxHour, ampm, showTime, ellipsizeTitle, allDayLabel, scrollOffsetMinutes, showNowIndicator, locale, timeZone, activeDate, isRTL, freeSwipe, renderTimeGridHeader, renderHeaderForMonthView, renderCustomDateForMonth, itemSeparatorComponent, classNames, styles: styleOverrides }) {
|
|
2111
2175
|
const mergedTheme = (0, react.useMemo)(() => require_MonthList.mergeTheme(theme), [theme]);
|
|
2112
2176
|
const internalCellHeight = (0, react_native_reanimated.useSharedValue)(hourHeight);
|
|
2113
2177
|
const cellHeight = cellHeightProp ?? internalCellHeight;
|
|
@@ -2253,6 +2317,9 @@ function Calendar({ events, mode, date, onChangeDate, onChangeDateRange, onPress
|
|
|
2253
2317
|
timeslots,
|
|
2254
2318
|
showAllDayEventCell,
|
|
2255
2319
|
highlightWeekends,
|
|
2320
|
+
eventStartEditable,
|
|
2321
|
+
eventDurationEditable,
|
|
2322
|
+
eventOverlap,
|
|
2256
2323
|
calendarCellStyle,
|
|
2257
2324
|
businessHours,
|
|
2258
2325
|
renderBusinessHours,
|
|
@@ -2663,7 +2730,7 @@ function LaneInteractionLayer({ resource, vertical, hourSize, startHour, date, s
|
|
|
2663
2730
|
* />
|
|
2664
2731
|
* ```
|
|
2665
2732
|
*/
|
|
2666
|
-
function ResourceTimeline({ date, orientation = "horizontal", resources: allResources, resourcesPerPage, resourcePage = 0, events, resourceId = (event) => event.resourceId, startHour = 0, endHour = 24, hourWidth = 80, hourHeight = 48, rowHeight = 56, labelWidth = 140, ampm = false, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, businessHours, renderBusinessHours, dragStepMinutes = 15, showNowIndicator = true, now: nowProp, timeZone }) {
|
|
2733
|
+
function ResourceTimeline({ date, orientation = "horizontal", resources: allResources, resourcesPerPage, resourcePage = 0, events, resourceId = (event) => event.resourceId, startHour = 0, endHour = 24, hourWidth = 80, hourHeight = 48, rowHeight = 56, labelWidth = 140, ampm = false, renderEvent, onPressEvent, onLongPressEvent, onDragEvent, onPressCell, onLongPressCell, onCreateEvent, businessHours, renderBusinessHours, renderResourceHeader, dragStepMinutes = 15, showNowIndicator = true, now: nowProp, timeZone }) {
|
|
2667
2734
|
const theme = require_MonthList.useCalendarTheme();
|
|
2668
2735
|
const resources = (0, react.useMemo)(() => {
|
|
2669
2736
|
if (!resourcesPerPage || resourcesPerPage <= 0) return allResources;
|
|
@@ -2735,9 +2802,9 @@ function ResourceTimeline({ date, orientation = "horizontal", resources: allReso
|
|
|
2735
2802
|
style: styles.vroot,
|
|
2736
2803
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native.View, {
|
|
2737
2804
|
style: [styles.header, { borderBottomColor: theme.colors.gridLine }],
|
|
2738
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, { style: { width: GUTTER_WIDTH } }), resources.map((resource) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
2805
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, { style: { width: GUTTER_WIDTH } }), resources.map((resource, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
2739
2806
|
style: [styles.vheaderCell, theme.containers.resourceLabel],
|
|
2740
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
|
|
2807
|
+
children: renderResourceHeader ? renderResourceHeader(resource, index) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
|
|
2741
2808
|
numberOfLines: 1,
|
|
2742
2809
|
style: [styles.vheaderText, { color: theme.colors.text }],
|
|
2743
2810
|
allowFontScaling: false,
|
|
@@ -2921,7 +2988,7 @@ function ResourceTimeline({ date, orientation = "horizontal", resources: allReso
|
|
|
2921
2988
|
},
|
|
2922
2989
|
theme.containers.resourceLabel
|
|
2923
2990
|
],
|
|
2924
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
|
|
2991
|
+
children: renderResourceHeader ? renderResourceHeader(resource, laneIndex) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
|
|
2925
2992
|
numberOfLines: 1,
|
|
2926
2993
|
style: { color: theme.colors.text },
|
|
2927
2994
|
allowFontScaling: false,
|
|
@@ -3264,6 +3331,12 @@ Object.defineProperty(exports, "layoutDayEvents", {
|
|
|
3264
3331
|
return _super_calendar_core.layoutDayEvents;
|
|
3265
3332
|
}
|
|
3266
3333
|
});
|
|
3334
|
+
Object.defineProperty(exports, "layoutMonthWeek", {
|
|
3335
|
+
enumerable: true,
|
|
3336
|
+
get: function() {
|
|
3337
|
+
return _super_calendar_core.layoutMonthWeek;
|
|
3338
|
+
}
|
|
3339
|
+
});
|
|
3267
3340
|
exports.mergeTheme = require_MonthList.mergeTheme;
|
|
3268
3341
|
Object.defineProperty(exports, "minutesIntoDay", {
|
|
3269
3342
|
enumerable: true,
|