react-native-resource-calendar 1.1.14 → 1.1.16
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -95,6 +95,7 @@ interface CalendarProps {
|
|
|
95
95
|
eventStyleOverrides?: StyleOverrides | ((event: Event) => StyleOverrides | undefined);
|
|
96
96
|
isEventSelected?: FlagFn;
|
|
97
97
|
isEventDisabled?: FlagFn;
|
|
98
|
+
disabledBlocksTapThrough?: boolean;
|
|
98
99
|
theme?: CalendarTheme;
|
|
99
100
|
overLappingLayoutMode?: LayoutMode;
|
|
100
101
|
mode?: CalendarMode;
|
package/dist/index.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ interface CalendarProps {
|
|
|
95
95
|
eventStyleOverrides?: StyleOverrides | ((event: Event) => StyleOverrides | undefined);
|
|
96
96
|
isEventSelected?: FlagFn;
|
|
97
97
|
isEventDisabled?: FlagFn;
|
|
98
|
+
disabledBlocksTapThrough?: boolean;
|
|
98
99
|
theme?: CalendarTheme;
|
|
99
100
|
overLappingLayoutMode?: LayoutMode;
|
|
100
101
|
mode?: CalendarMode;
|
package/dist/index.js
CHANGED
|
@@ -939,7 +939,8 @@ var DisabledBlockComponent = ({
|
|
|
939
939
|
layout,
|
|
940
940
|
disabledBlock,
|
|
941
941
|
hourHeight,
|
|
942
|
-
onDisabledBlockPress
|
|
942
|
+
onDisabledBlockPress,
|
|
943
|
+
tapThrough
|
|
943
944
|
}) => {
|
|
944
945
|
const dynamicStyle = {
|
|
945
946
|
backgroundColor: "#d3d3d3",
|
|
@@ -948,13 +949,17 @@ var DisabledBlockComponent = ({
|
|
|
948
949
|
height: height < hourHeight / 4 ? height : height - 4,
|
|
949
950
|
width: layout.widthPx - 3,
|
|
950
951
|
borderWidth: 1,
|
|
951
|
-
borderColor: "rgba(0,0,0,0.12)"
|
|
952
|
+
borderColor: "rgba(0,0,0,0.12)",
|
|
953
|
+
opacity: tapThrough ? 0.5 : 1,
|
|
954
|
+
// Let touches fall through to the grid blocks beneath when tap-through.
|
|
955
|
+
pointerEvents: tapThrough ? "none" : "auto"
|
|
952
956
|
};
|
|
953
957
|
const titleFace = useResolvedFont({ fontWeight: "600" });
|
|
954
958
|
return /* @__PURE__ */ React19__namespace.default.createElement(
|
|
955
959
|
reactNative.TouchableOpacity,
|
|
956
960
|
{
|
|
957
961
|
style: [styles4.event, dynamicStyle],
|
|
962
|
+
disabled: tapThrough,
|
|
958
963
|
onPress: () => {
|
|
959
964
|
onDisabledBlockPress && onDisabledBlockPress(disabledBlock);
|
|
960
965
|
}
|
|
@@ -991,6 +996,7 @@ var DisabledBlocks = React19__namespace.default.memo(({
|
|
|
991
996
|
APPOINTMENT_BLOCK_WIDTH,
|
|
992
997
|
hourHeight,
|
|
993
998
|
onDisabledBlockPress,
|
|
999
|
+
tapThrough,
|
|
994
1000
|
date: dateProp
|
|
995
1001
|
}) => {
|
|
996
1002
|
const { useDisabledBlocksFor: useDisabledBlocksFor2, useGetDate: useGetDate2 } = useCalendarBinding();
|
|
@@ -1011,7 +1017,8 @@ var DisabledBlocks = React19__namespace.default.memo(({
|
|
|
1011
1017
|
top: scalePosition(disabledBlock.from, hourHeight),
|
|
1012
1018
|
height: scalePosition(disabledBlock.to - disabledBlock.from, hourHeight),
|
|
1013
1019
|
layout: layoutMap.get(key),
|
|
1014
|
-
onDisabledBlockPress
|
|
1020
|
+
onDisabledBlockPress,
|
|
1021
|
+
tapThrough
|
|
1015
1022
|
}
|
|
1016
1023
|
);
|
|
1017
1024
|
}
|
|
@@ -1052,7 +1059,10 @@ var EventBlock = React19__namespace.default.memo(({
|
|
|
1052
1059
|
zIndex: frame.zIndex,
|
|
1053
1060
|
opacity: anyEventSelected || disabled ? 0.5 : 1,
|
|
1054
1061
|
borderWidth: selected ? 2 : 1,
|
|
1055
|
-
borderColor: selected ? "#4d959c" : "rgba(0,0,0,0.12)"
|
|
1062
|
+
borderColor: selected ? "#4d959c" : "rgba(0,0,0,0.12)",
|
|
1063
|
+
// When disabled, let touches fall through to the grid blocks beneath
|
|
1064
|
+
// (e.g. "select a time" mode) instead of swallowing them.
|
|
1065
|
+
pointerEvents: disabled ? "none" : "auto"
|
|
1056
1066
|
};
|
|
1057
1067
|
const resolved = typeof styleOverrides === "function" ? styleOverrides(event) ?? {} : styleOverrides ?? {};
|
|
1058
1068
|
const handlePress = React19.useCallback(() => onPress?.(event), [onPress, event]);
|
|
@@ -1814,7 +1824,8 @@ var CalendarInner = (props) => {
|
|
|
1814
1824
|
date: dayDate,
|
|
1815
1825
|
APPOINTMENT_BLOCK_WIDTH,
|
|
1816
1826
|
hourHeight,
|
|
1817
|
-
onDisabledBlockPress: stableOnDisabledBlockPress
|
|
1827
|
+
onDisabledBlockPress: stableOnDisabledBlockPress,
|
|
1828
|
+
tapThrough: props.disabledBlocksTapThrough
|
|
1818
1829
|
}
|
|
1819
1830
|
), /* @__PURE__ */ React19__namespace.default.createElement(
|
|
1820
1831
|
EventBlocks_default,
|
|
@@ -1845,7 +1856,8 @@ var CalendarInner = (props) => {
|
|
|
1845
1856
|
internalStableOnLongPress,
|
|
1846
1857
|
stableOnDisabledBlockPress,
|
|
1847
1858
|
stableHandleBlockPress,
|
|
1848
|
-
stableHandleBlockLongPress
|
|
1859
|
+
stableHandleBlockLongPress,
|
|
1860
|
+
props.disabledBlocksTapThrough
|
|
1849
1861
|
]);
|
|
1850
1862
|
const listExtraData = React19.useMemo(
|
|
1851
1863
|
() => ({
|
|
@@ -1855,7 +1867,8 @@ var CalendarInner = (props) => {
|
|
|
1855
1867
|
stacked: overLappingLayoutMode === "stacked",
|
|
1856
1868
|
isEventSelectedStable,
|
|
1857
1869
|
isEventDisabledStable,
|
|
1858
|
-
effectiveRenderer
|
|
1870
|
+
effectiveRenderer,
|
|
1871
|
+
disabledBlocksTapThrough: props.disabledBlocksTapThrough
|
|
1859
1872
|
}),
|
|
1860
1873
|
[
|
|
1861
1874
|
numberOfColumns,
|
|
@@ -1864,7 +1877,8 @@ var CalendarInner = (props) => {
|
|
|
1864
1877
|
overLappingLayoutMode,
|
|
1865
1878
|
isEventSelectedStable,
|
|
1866
1879
|
isEventDisabledStable,
|
|
1867
|
-
effectiveRenderer
|
|
1880
|
+
effectiveRenderer,
|
|
1881
|
+
props.disabledBlocksTapThrough
|
|
1868
1882
|
]
|
|
1869
1883
|
);
|
|
1870
1884
|
return /* @__PURE__ */ React19__namespace.default.createElement(React19__namespace.default.Fragment, null, /* @__PURE__ */ React19__namespace.default.createElement(StoreFeeder, { resources, store: binding, baseDate: date }), /* @__PURE__ */ React19__namespace.default.createElement(reactNative.View, { style: { flex: 1 } }, !isMultiDay ? /* @__PURE__ */ React19__namespace.default.createElement(reactNative.View, { key: `header-${numberOfColumns}-${width}` }, /* @__PURE__ */ React19__namespace.default.createElement(
|