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.js
CHANGED
|
@@ -216,11 +216,11 @@ var minutesToTime = (totalMinutes) => {
|
|
|
216
216
|
return `${hours12}:${paddedMins}`;
|
|
217
217
|
};
|
|
218
218
|
function computeStackedEventLayout(events, containerWidthPx, {
|
|
219
|
-
indentPx =
|
|
219
|
+
indentPx = 6,
|
|
220
220
|
// how much to nudge each overlap to the right
|
|
221
221
|
rightPadPx = 0,
|
|
222
222
|
// visual breathing room on the right
|
|
223
|
-
minWidthPx =
|
|
223
|
+
minWidthPx = 25,
|
|
224
224
|
// never let an event become thinner than this
|
|
225
225
|
capIndentLevels = 4
|
|
226
226
|
// after N levels, stop indenting (just stack via z-index)
|
|
@@ -1018,7 +1018,7 @@ var EventBlock = React19__namespace.default.memo(({
|
|
|
1018
1018
|
left: frame.leftPx + 1,
|
|
1019
1019
|
width: frame.widthPx - 3,
|
|
1020
1020
|
zIndex: frame.zIndex,
|
|
1021
|
-
opacity: selectedAppointment ? 0.5 : 1,
|
|
1021
|
+
opacity: selectedAppointment || disabled ? 0.5 : 1,
|
|
1022
1022
|
borderWidth: selected ? 2 : 1,
|
|
1023
1023
|
borderColor: selected ? "#4d959c" : "rgba(0,0,0,0.12)"
|
|
1024
1024
|
};
|
|
@@ -1041,14 +1041,6 @@ var EventBlock = React19__namespace.default.memo(({
|
|
|
1041
1041
|
onLongPress && onLongPress(event);
|
|
1042
1042
|
}
|
|
1043
1043
|
},
|
|
1044
|
-
/* @__PURE__ */ React19__namespace.default.createElement(Hidden_default, { isHidden: !disabled }, /* @__PURE__ */ React19__namespace.default.createElement(reactNative.View, { style: {
|
|
1045
|
-
position: "absolute",
|
|
1046
|
-
top: 0,
|
|
1047
|
-
width: "150%",
|
|
1048
|
-
height: "150%",
|
|
1049
|
-
zIndex: 1,
|
|
1050
|
-
backgroundColor: "rgba(255, 255, 255, 0.5)"
|
|
1051
|
-
} })),
|
|
1052
1044
|
/* @__PURE__ */ React19__namespace.default.createElement(Col_default, { style: [{ position: "relative" }, resolved?.content] }, /* @__PURE__ */ React19__namespace.default.createElement(
|
|
1053
1045
|
reactNative.TextInput,
|
|
1054
1046
|
{
|
|
@@ -1302,7 +1294,7 @@ var DaysComponent = ({ onResourcePress, activeResourceId, mode, date, APPOINTMEN
|
|
|
1302
1294
|
width: APPOINTMENT_BLOCK_WIDTH
|
|
1303
1295
|
},
|
|
1304
1296
|
space: 4,
|
|
1305
|
-
key:
|
|
1297
|
+
key: d.toString()
|
|
1306
1298
|
},
|
|
1307
1299
|
/* @__PURE__ */ React19__namespace.createElement(Center_default, { style: {
|
|
1308
1300
|
backgroundColor: selected ? "#4d959c" : void 0,
|
|
@@ -1445,8 +1437,9 @@ var CalendarInner = (props) => {
|
|
|
1445
1437
|
React19.useEffect(() => {
|
|
1446
1438
|
if (!selectedEvent) {
|
|
1447
1439
|
setDraggedEventDraft(null);
|
|
1440
|
+
setDragReady(false);
|
|
1448
1441
|
}
|
|
1449
|
-
}, [selectedEvent]);
|
|
1442
|
+
}, [selectedEvent, setSelectedEvent, setDraggedEventDraft]);
|
|
1450
1443
|
React19.useEffect(() => {
|
|
1451
1444
|
scrollX.value = 0;
|
|
1452
1445
|
}, [mode]);
|
|
@@ -1455,6 +1448,7 @@ var CalendarInner = (props) => {
|
|
|
1455
1448
|
const flashListRef = React19.useRef(null);
|
|
1456
1449
|
const prevResourceIdsRef = React19.useRef([]);
|
|
1457
1450
|
const [layout, setLayout] = React19.useState(null);
|
|
1451
|
+
const [dragReady, setDragReady] = React19.useState(false);
|
|
1458
1452
|
const dateRef = React19.useRef(date);
|
|
1459
1453
|
const eventStartedTop = Animated2.useSharedValue(0);
|
|
1460
1454
|
const eventHeight = Animated2.useSharedValue(0);
|
|
@@ -1701,6 +1695,7 @@ var CalendarInner = (props) => {
|
|
|
1701
1695
|
lastHapticScrollY.value = scrollY.value;
|
|
1702
1696
|
eventHeight.value = initialHeight;
|
|
1703
1697
|
setSelectedEvent(event);
|
|
1698
|
+
requestAnimationFrame(() => setDragReady(true));
|
|
1704
1699
|
Haptics__namespace.impactAsync(Haptics__namespace.ImpactFeedbackStyle.Medium);
|
|
1705
1700
|
};
|
|
1706
1701
|
}, []);
|
|
@@ -1732,14 +1727,16 @@ var CalendarInner = (props) => {
|
|
|
1732
1727
|
}, [resources, onBlockLongPress]);
|
|
1733
1728
|
React19.useEffect(() => {
|
|
1734
1729
|
const handleOrientationChange = () => {
|
|
1735
|
-
if (selectedEvent)
|
|
1730
|
+
if (selectedEvent) {
|
|
1736
1731
|
setSelectedEvent(null);
|
|
1732
|
+
setDragReady(false);
|
|
1733
|
+
}
|
|
1737
1734
|
};
|
|
1738
1735
|
const subscription = reactNative.Dimensions.addEventListener("change", handleOrientationChange);
|
|
1739
1736
|
return () => {
|
|
1740
1737
|
subscription.remove();
|
|
1741
1738
|
};
|
|
1742
|
-
}, [setSelectedEvent, selectedEvent]);
|
|
1739
|
+
}, [setSelectedEvent, selectedEvent, setDragReady]);
|
|
1743
1740
|
React19.useEffect(() => {
|
|
1744
1741
|
dateRef.current = date;
|
|
1745
1742
|
}, [date]);
|
|
@@ -1898,7 +1895,7 @@ var CalendarInner = (props) => {
|
|
|
1898
1895
|
}
|
|
1899
1896
|
)
|
|
1900
1897
|
),
|
|
1901
|
-
selectedEvent && /* @__PURE__ */ React19__namespace.default.createElement(
|
|
1898
|
+
selectedEvent && dragReady && /* @__PURE__ */ React19__namespace.default.createElement(
|
|
1902
1899
|
DraggableEvent,
|
|
1903
1900
|
{
|
|
1904
1901
|
selectedEvent,
|