react-native-resource-calendar 1.0.17 → 1.0.19
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 +13 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -190,11 +190,11 @@ var minutesToTime = (totalMinutes) => {
|
|
|
190
190
|
return `${hours12}:${paddedMins}`;
|
|
191
191
|
};
|
|
192
192
|
function computeStackedEventLayout(events, containerWidthPx, {
|
|
193
|
-
indentPx =
|
|
193
|
+
indentPx = 6,
|
|
194
194
|
// how much to nudge each overlap to the right
|
|
195
195
|
rightPadPx = 0,
|
|
196
196
|
// visual breathing room on the right
|
|
197
|
-
minWidthPx =
|
|
197
|
+
minWidthPx = 25,
|
|
198
198
|
// never let an event become thinner than this
|
|
199
199
|
capIndentLevels = 4
|
|
200
200
|
// after N levels, stop indenting (just stack via z-index)
|
|
@@ -992,7 +992,7 @@ var EventBlock = React19__default.memo(({
|
|
|
992
992
|
left: frame.leftPx + 1,
|
|
993
993
|
width: frame.widthPx - 3,
|
|
994
994
|
zIndex: frame.zIndex,
|
|
995
|
-
opacity: selectedAppointment ? 0.5 : 1,
|
|
995
|
+
opacity: selectedAppointment || disabled ? 0.5 : 1,
|
|
996
996
|
borderWidth: selected ? 2 : 1,
|
|
997
997
|
borderColor: selected ? "#4d959c" : "rgba(0,0,0,0.12)"
|
|
998
998
|
};
|
|
@@ -1015,14 +1015,6 @@ var EventBlock = React19__default.memo(({
|
|
|
1015
1015
|
onLongPress && onLongPress(event);
|
|
1016
1016
|
}
|
|
1017
1017
|
},
|
|
1018
|
-
/* @__PURE__ */ React19__default.createElement(Hidden_default, { isHidden: !disabled }, /* @__PURE__ */ React19__default.createElement(View, { style: {
|
|
1019
|
-
position: "absolute",
|
|
1020
|
-
top: 0,
|
|
1021
|
-
width: "150%",
|
|
1022
|
-
height: "150%",
|
|
1023
|
-
zIndex: 1,
|
|
1024
|
-
backgroundColor: "rgba(255, 255, 255, 0.5)"
|
|
1025
|
-
} })),
|
|
1026
1018
|
/* @__PURE__ */ React19__default.createElement(Col_default, { style: [{ position: "relative" }, resolved?.content] }, /* @__PURE__ */ React19__default.createElement(
|
|
1027
1019
|
TextInput,
|
|
1028
1020
|
{
|
|
@@ -1276,7 +1268,7 @@ var DaysComponent = ({ onResourcePress, activeResourceId, mode, date, APPOINTMEN
|
|
|
1276
1268
|
width: APPOINTMENT_BLOCK_WIDTH
|
|
1277
1269
|
},
|
|
1278
1270
|
space: 4,
|
|
1279
|
-
key:
|
|
1271
|
+
key: d.toString()
|
|
1280
1272
|
},
|
|
1281
1273
|
/* @__PURE__ */ React19.createElement(Center_default, { style: {
|
|
1282
1274
|
backgroundColor: selected ? "#4d959c" : void 0,
|
|
@@ -1419,8 +1411,9 @@ var CalendarInner = (props) => {
|
|
|
1419
1411
|
useEffect(() => {
|
|
1420
1412
|
if (!selectedEvent) {
|
|
1421
1413
|
setDraggedEventDraft(null);
|
|
1414
|
+
setDragReady(false);
|
|
1422
1415
|
}
|
|
1423
|
-
}, [selectedEvent]);
|
|
1416
|
+
}, [selectedEvent, setSelectedEvent, setDraggedEventDraft]);
|
|
1424
1417
|
useEffect(() => {
|
|
1425
1418
|
scrollX.value = 0;
|
|
1426
1419
|
}, [mode]);
|
|
@@ -1429,6 +1422,7 @@ var CalendarInner = (props) => {
|
|
|
1429
1422
|
const flashListRef = useRef(null);
|
|
1430
1423
|
const prevResourceIdsRef = useRef([]);
|
|
1431
1424
|
const [layout, setLayout] = useState(null);
|
|
1425
|
+
const [dragReady, setDragReady] = useState(false);
|
|
1432
1426
|
const dateRef = useRef(date);
|
|
1433
1427
|
const eventStartedTop = useSharedValue(0);
|
|
1434
1428
|
const eventHeight = useSharedValue(0);
|
|
@@ -1675,6 +1669,7 @@ var CalendarInner = (props) => {
|
|
|
1675
1669
|
lastHapticScrollY.value = scrollY.value;
|
|
1676
1670
|
eventHeight.value = initialHeight;
|
|
1677
1671
|
setSelectedEvent(event);
|
|
1672
|
+
requestAnimationFrame(() => setDragReady(true));
|
|
1678
1673
|
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
|
|
1679
1674
|
};
|
|
1680
1675
|
}, []);
|
|
@@ -1706,14 +1701,16 @@ var CalendarInner = (props) => {
|
|
|
1706
1701
|
}, [resources, onBlockLongPress]);
|
|
1707
1702
|
useEffect(() => {
|
|
1708
1703
|
const handleOrientationChange = () => {
|
|
1709
|
-
if (selectedEvent)
|
|
1704
|
+
if (selectedEvent) {
|
|
1710
1705
|
setSelectedEvent(null);
|
|
1706
|
+
setDragReady(false);
|
|
1707
|
+
}
|
|
1711
1708
|
};
|
|
1712
1709
|
const subscription = Dimensions.addEventListener("change", handleOrientationChange);
|
|
1713
1710
|
return () => {
|
|
1714
1711
|
subscription.remove();
|
|
1715
1712
|
};
|
|
1716
|
-
}, [setSelectedEvent, selectedEvent]);
|
|
1713
|
+
}, [setSelectedEvent, selectedEvent, setDragReady]);
|
|
1717
1714
|
useEffect(() => {
|
|
1718
1715
|
dateRef.current = date;
|
|
1719
1716
|
}, [date]);
|
|
@@ -1872,7 +1869,7 @@ var CalendarInner = (props) => {
|
|
|
1872
1869
|
}
|
|
1873
1870
|
)
|
|
1874
1871
|
),
|
|
1875
|
-
selectedEvent && /* @__PURE__ */ React19__default.createElement(
|
|
1872
|
+
selectedEvent && dragReady && /* @__PURE__ */ React19__default.createElement(
|
|
1876
1873
|
DraggableEvent,
|
|
1877
1874
|
{
|
|
1878
1875
|
selectedEvent,
|