@jamadd/react-native-template-ui 0.8.5 → 0.8.7
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/lib/module/components/button/AnimatedThemedPressable.js +13 -3
- package/lib/module/components/button/AnimatedThemedPressable.js.map +1 -1
- package/lib/module/components/button/ThemedButton.js +84 -23
- package/lib/module/components/button/ThemedButton.js.map +1 -1
- package/lib/module/components/button/ThemedIconButton.js +62 -16
- package/lib/module/components/button/ThemedIconButton.js.map +1 -1
- package/lib/module/components/button/ThemedIconTextButton.js +118 -29
- package/lib/module/components/button/ThemedIconTextButton.js.map +1 -1
- package/lib/module/components/button/ThemedPressable.js +13 -3
- package/lib/module/components/button/ThemedPressable.js.map +1 -1
- package/lib/module/components/icon/ThemedIcon.js +56 -15
- package/lib/module/components/icon/ThemedIcon.js.map +1 -1
- package/lib/module/components/list/List.js +131 -39
- package/lib/module/components/list/List.js.map +1 -1
- package/lib/module/components/loading/ThemedLoading.js +50 -13
- package/lib/module/components/loading/ThemedLoading.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheet.js +64 -19
- package/lib/module/components/overlay/actionSheet/ActionSheet.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheet.web.js +76 -0
- package/lib/module/components/overlay/actionSheet/ActionSheet.web.js.map +1 -0
- package/lib/module/components/overlay/actionSheet/ActionSheetContentGesture.js +19 -8
- package/lib/module/components/overlay/actionSheet/ActionSheetContentGesture.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetHeader.js +87 -31
- package/lib/module/components/overlay/actionSheet/ActionSheetHeader.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetHeader.web.js +113 -0
- package/lib/module/components/overlay/actionSheet/ActionSheetHeader.web.js.map +1 -0
- package/lib/module/components/overlay/actionSheet/ActionSheetListView.js +69 -28
- package/lib/module/components/overlay/actionSheet/ActionSheetListView.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetListViewContent.js +39 -14
- package/lib/module/components/overlay/actionSheet/ActionSheetListViewContent.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetOptionList.js +58 -25
- package/lib/module/components/overlay/actionSheet/ActionSheetOptionList.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetOptionListItem.js +45 -21
- package/lib/module/components/overlay/actionSheet/ActionSheetOptionListItem.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetOptions.js +75 -32
- package/lib/module/components/overlay/actionSheet/ActionSheetOptions.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetScrollView.js +72 -30
- package/lib/module/components/overlay/actionSheet/ActionSheetScrollView.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetScrollViewContent.js +45 -18
- package/lib/module/components/overlay/actionSheet/ActionSheetScrollViewContent.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetWrap.js +152 -36
- package/lib/module/components/overlay/actionSheet/ActionSheetWrap.js.map +1 -1
- package/lib/module/components/overlay/alert/Alert.js +142 -51
- package/lib/module/components/overlay/alert/Alert.js.map +1 -1
- package/lib/module/components/overlay/alert/AlertButton.js +62 -26
- package/lib/module/components/overlay/alert/AlertButton.js.map +1 -1
- package/lib/module/components/overlay/alert/AlertButtons.js +58 -23
- package/lib/module/components/overlay/alert/AlertButtons.js.map +1 -1
- package/lib/module/components/overlay/alert/AlertContent.js +76 -17
- package/lib/module/components/overlay/alert/AlertContent.js.map +1 -1
- package/lib/module/components/overlay/alert/AlertWrap.js +125 -43
- package/lib/module/components/overlay/alert/AlertWrap.js.map +1 -1
- package/lib/module/components/overlay/modal/ThemedLoadingModal.js +96 -21
- package/lib/module/components/overlay/modal/ThemedLoadingModal.js.map +1 -1
- package/lib/module/components/overlay/modal/ThemedModal.js +76 -23
- package/lib/module/components/overlay/modal/ThemedModal.js.map +1 -1
- package/lib/module/components/overlay/toast/ThemedToast.js +339 -90
- package/lib/module/components/overlay/toast/ThemedToast.js.map +1 -1
- package/lib/module/components/provider/GestureProvider.js +15 -3
- package/lib/module/components/provider/GestureProvider.js.map +1 -1
- package/lib/module/components/provider/InsetsProvider.js +15 -3
- package/lib/module/components/provider/InsetsProvider.js.map +1 -1
- package/lib/module/components/provider/ReactNativeTemplateProviders.js +23 -11
- package/lib/module/components/provider/ReactNativeTemplateProviders.js.map +1 -1
- package/lib/module/components/provider/ThemeProvider.js +15 -3
- package/lib/module/components/provider/ThemeProvider.js.map +1 -1
- package/lib/module/components/separator/ThemedSeparator.js +53 -14
- package/lib/module/components/separator/ThemedSeparator.js.map +1 -1
- package/lib/module/components/slider/Slider.js +625 -137
- package/lib/module/components/slider/Slider.js.map +1 -1
- package/lib/module/components/slider/ThemedSlider.js +178 -54
- package/lib/module/components/slider/ThemedSlider.js.map +1 -1
- package/lib/module/components/slider/ThemedSlider.web.js +206 -0
- package/lib/module/components/slider/ThemedSlider.web.js.map +1 -0
- package/lib/module/components/slider/ThemedSliderStepIndicator.js +40 -15
- package/lib/module/components/slider/ThemedSliderStepIndicator.js.map +1 -1
- package/lib/module/components/switch/ThemedSwitch.js +81 -21
- package/lib/module/components/switch/ThemedSwitch.js.map +1 -1
- package/lib/module/components/text/ThemedIconText.js +124 -35
- package/lib/module/components/text/ThemedIconText.js.map +1 -1
- package/lib/module/components/text/ThemedText.js +15 -3
- package/lib/module/components/text/ThemedText.js.map +1 -1
- package/lib/module/components/view/AnimatedThemedView.js +42 -11
- package/lib/module/components/view/AnimatedThemedView.js.map +1 -1
- package/lib/module/components/view/ThemedScreenWrap.js +144 -39
- package/lib/module/components/view/ThemedScreenWrap.js.map +1 -1
- package/lib/module/components/view/ThemedScreenWrap.web.js +111 -32
- package/lib/module/components/view/ThemedScreenWrap.web.js.map +1 -1
- package/lib/module/components/view/ThemedScrollView.js +126 -38
- package/lib/module/components/view/ThemedScrollView.js.map +1 -1
- package/lib/module/components/view/ThemedView.js +33 -10
- package/lib/module/components/view/ThemedView.js.map +1 -1
- package/lib/module/hooks/button.js +263 -84
- package/lib/module/hooks/button.js.map +1 -1
- package/lib/module/hooks/list.js +50 -10
- package/lib/module/hooks/list.js.map +1 -1
- package/lib/module/hooks/overlay.js +575 -187
- package/lib/module/hooks/overlay.js.map +1 -1
- package/lib/module/hooks/react.js +90 -27
- package/lib/module/hooks/react.js.map +1 -1
- package/lib/module/hooks/reanimated.js.map +1 -1
- package/lib/module/hooks/style.js +43 -18
- package/lib/module/hooks/style.js.map +1 -1
- package/lib/module/hooks/switch.js +182 -43
- package/lib/module/hooks/switch.js.map +1 -1
- package/lib/module/hooks/theme.js +17 -8
- package/lib/module/hooks/theme.js.map +1 -1
- package/lib/module/hooks/view.js +56 -14
- package/lib/module/hooks/view.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/reanimated/func.js +60 -10
- package/lib/module/utils/reanimated/func.js.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheet.web.d.ts +5 -0
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheet.web.d.ts.map +1 -0
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetContentGesture.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetContentGesture.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.web.d.ts +4 -0
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.web.d.ts.map +1 -0
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListView.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListView.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListViewContent.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListViewContent.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionList.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionList.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionListItem.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionListItem.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptions.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptions.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollView.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollViewContent.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollViewContent.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetWrap.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetWrap.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/Slider.d.ts +3 -2
- package/lib/typescript/src/components/slider/Slider.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/ThemedSlider.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/ThemedSlider.web.d.ts +5 -0
- package/lib/typescript/src/components/slider/ThemedSlider.web.d.ts.map +1 -0
- package/lib/typescript/src/components/slider/ThemedSliderStepIndicator.d.ts +3 -2
- package/lib/typescript/src/components/slider/ThemedSliderStepIndicator.d.ts.map +1 -1
- package/lib/typescript/src/components/view/AnimatedView.d.ts +0 -2
- package/lib/typescript/src/components/view/AnimatedView.d.ts.map +1 -1
- package/lib/typescript/src/hooks/overlay.d.ts +0 -27
- package/lib/typescript/src/hooks/overlay.d.ts.map +1 -1
- package/lib/typescript/src/hooks/switch.d.ts +1 -20
- package/lib/typescript/src/hooks/switch.d.ts.map +1 -1
- package/lib/typescript/src/types/list.d.ts +1 -10
- package/lib/typescript/src/types/list.d.ts.map +1 -1
- package/lib/typescript/src/types/overlay.d.ts +1 -31
- package/lib/typescript/src/types/overlay.d.ts.map +1 -1
- package/lib/typescript/src/utils/overlay/const.d.ts +0 -33
- package/lib/typescript/src/utils/overlay/const.d.ts.map +1 -1
- package/lib/typescript/src/utils/reanimated/func.d.ts +1 -5
- package/lib/typescript/src/utils/reanimated/func.d.ts.map +1 -1
- package/lib/typescript/src/utils/switch/const.d.ts +1 -2
- package/lib/typescript/src/utils/switch/const.d.ts.map +1 -1
- package/package.json +14 -15
- package/src/components/button/AnimatedPressable.tsx +0 -7
- package/src/components/button/AnimatedThemedPressable.tsx +0 -12
- package/src/components/button/ThemedButton.tsx +0 -45
- package/src/components/button/ThemedIconButton.tsx +0 -33
- package/src/components/button/ThemedIconTextButton.tsx +0 -56
- package/src/components/button/ThemedPressable.tsx +0 -12
- package/src/components/icon/ThemedIcon.tsx +0 -31
- package/src/components/list/List.tsx +0 -55
- package/src/components/loading/ThemedLoading.tsx +0 -29
- package/src/components/overlay/actionSheet/ActionSheet.tsx +0 -31
- package/src/components/overlay/actionSheet/ActionSheetContentGesture.tsx +0 -15
- package/src/components/overlay/actionSheet/ActionSheetHeader.tsx +0 -72
- package/src/components/overlay/actionSheet/ActionSheetListView.tsx +0 -54
- package/src/components/overlay/actionSheet/ActionSheetListViewContent.tsx +0 -32
- package/src/components/overlay/actionSheet/ActionSheetOptionList.tsx +0 -51
- package/src/components/overlay/actionSheet/ActionSheetOptionListItem.tsx +0 -43
- package/src/components/overlay/actionSheet/ActionSheetOptions.tsx +0 -61
- package/src/components/overlay/actionSheet/ActionSheetScrollView.tsx +0 -57
- package/src/components/overlay/actionSheet/ActionSheetScrollViewContent.tsx +0 -38
- package/src/components/overlay/actionSheet/ActionSheetWrap.tsx +0 -75
- package/src/components/overlay/alert/Alert.tsx +0 -86
- package/src/components/overlay/alert/AlertButton.tsx +0 -41
- package/src/components/overlay/alert/AlertButtons.tsx +0 -32
- package/src/components/overlay/alert/AlertContent.tsx +0 -60
- package/src/components/overlay/alert/AlertWrap.tsx +0 -93
- package/src/components/overlay/modal/ThemedLoadingModal.tsx +0 -47
- package/src/components/overlay/modal/ThemedModal.tsx +0 -42
- package/src/components/overlay/toast/ThemedToast.tsx +0 -160
- package/src/components/provider/GestureProvider.tsx +0 -9
- package/src/components/provider/InsetsProvider.tsx +0 -11
- package/src/components/provider/ReactNativeTemplateProviders.tsx +0 -20
- package/src/components/provider/ThemeProvider.tsx +0 -8
- package/src/components/separator/ThemedSeparator.tsx +0 -24
- package/src/components/slider/Slider.tsx +0 -229
- package/src/components/slider/ThemedSlider.tsx +0 -103
- package/src/components/slider/ThemedSliderStepIndicator.tsx +0 -24
- package/src/components/switch/ThemedSwitch.tsx +0 -49
- package/src/components/text/Text.tsx +0 -7
- package/src/components/text/ThemedIconText.tsx +0 -58
- package/src/components/text/ThemedText.tsx +0 -7
- package/src/components/view/AnimatedThemedView.tsx +0 -18
- package/src/components/view/AnimatedView.tsx +0 -7
- package/src/components/view/Box.tsx +0 -7
- package/src/components/view/ThemedScreenWrap.tsx +0 -48
- package/src/components/view/ThemedScreenWrap.web.tsx +0 -41
- package/src/components/view/ThemedScrollView.tsx +0 -54
- package/src/components/view/ThemedView.tsx +0 -19
- package/src/hooks/button.ts +0 -152
- package/src/hooks/list.ts +0 -42
- package/src/hooks/overlay.ts +0 -471
- package/src/hooks/react.ts +0 -34
- package/src/hooks/reanimated.ts +0 -6
- package/src/hooks/separator.ts +0 -29
- package/src/hooks/style.ts +0 -79
- package/src/hooks/switch.ts +0 -119
- package/src/hooks/theme.ts +0 -65
- package/src/hooks/view.ts +0 -28
- package/src/index.ts +0 -59
- package/src/test/utils/const.ts +0 -9
- package/src/test/utils/func.ts +0 -55
- package/src/test/utils/testingLib.tsx +0 -17
- package/src/types/button.ts +0 -50
- package/src/types/global.d.ts +0 -5
- package/src/types/icon.ts +0 -21
- package/src/types/list.ts +0 -61
- package/src/types/loading.ts +0 -14
- package/src/types/overlay.ts +0 -216
- package/src/types/provider.ts +0 -6
- package/src/types/react.ts +0 -8
- package/src/types/reanimated.ts +0 -11
- package/src/types/separator.ts +0 -28
- package/src/types/slider.ts +0 -59
- package/src/types/style.ts +0 -26
- package/src/types/switch.ts +0 -31
- package/src/types/text.ts +0 -25
- package/src/types/theme.ts +0 -39
- package/src/types/view.ts +0 -58
- package/src/utils/button/const.ts +0 -10
- package/src/utils/overlay/const.ts +0 -77
- package/src/utils/overlay/func.ts +0 -107
- package/src/utils/reanimated/func.ts +0 -39
- package/src/utils/slider/const.ts +0 -23
- package/src/utils/style/const.ts +0 -4
- package/src/utils/style/func.ts +0 -37
- package/src/utils/switch/const.ts +0 -2
- package/src/utils/theme/const.ts +0 -189
- package/src/utils/theme/restyle.ts +0 -87
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { useContext, useEffect, useLayoutEffect, useState } from 'react';
|
|
4
5
|
import { Gesture } from 'react-native-gesture-handler';
|
|
5
6
|
import { makeMutable, useAnimatedRef, useScrollOffset, useSharedValue } from 'react-native-reanimated';
|
|
@@ -18,42 +19,93 @@ export function useActionSheetContext() {
|
|
|
18
19
|
|
|
19
20
|
/** @internal */
|
|
20
21
|
function useActionSheet(actionSheetVisible) {
|
|
22
|
+
const $ = _c(18);
|
|
21
23
|
const windowHeight = useWindowDimensionsHeight();
|
|
22
24
|
const headerViewRef = useViewRef();
|
|
23
25
|
const [height, setHeight] = useState(0);
|
|
24
26
|
const translateYSharedVal = useSharedValue(windowHeight);
|
|
25
27
|
const heightSharedVal = useSharedValue(0);
|
|
26
28
|
const expandableHeightSharedVal = useSharedValue(0);
|
|
29
|
+
let t0;
|
|
30
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t0 = getActionSheetContext();
|
|
32
|
+
$[0] = t0;
|
|
33
|
+
} else {
|
|
34
|
+
t0 = $[0];
|
|
35
|
+
}
|
|
27
36
|
const {
|
|
28
37
|
expandable
|
|
29
|
-
} =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
translateYSharedVal
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
} = t0;
|
|
39
|
+
let t1;
|
|
40
|
+
if ($[1] !== actionSheetVisible || $[2] !== expandableHeightSharedVal || $[3] !== height || $[4] !== heightSharedVal || $[5] !== translateYSharedVal || $[6] !== windowHeight) {
|
|
41
|
+
t1 = () => {
|
|
42
|
+
if (actionSheetVisible && height && translateYSharedVal.get() === windowHeight) {
|
|
43
|
+
const tempHeight = expandable ? getActionSheetExpandableInitHeight() : height;
|
|
44
|
+
heightSharedVal.set(tempHeight);
|
|
45
|
+
expandableHeightSharedVal.set(tempHeight);
|
|
46
|
+
translateYSharedVal.set(height);
|
|
47
|
+
updateSharedValWithTiming(translateYSharedVal, 0, {
|
|
48
|
+
duration: actionSheetOpenDuration
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
$[1] = actionSheetVisible;
|
|
53
|
+
$[2] = expandableHeightSharedVal;
|
|
54
|
+
$[3] = height;
|
|
55
|
+
$[4] = heightSharedVal;
|
|
56
|
+
$[5] = translateYSharedVal;
|
|
57
|
+
$[6] = windowHeight;
|
|
58
|
+
$[7] = t1;
|
|
59
|
+
} else {
|
|
60
|
+
t1 = $[7];
|
|
61
|
+
}
|
|
62
|
+
let t2;
|
|
63
|
+
if ($[8] !== actionSheetVisible || $[9] !== height) {
|
|
64
|
+
t2 = [actionSheetVisible, height];
|
|
65
|
+
$[8] = actionSheetVisible;
|
|
66
|
+
$[9] = height;
|
|
67
|
+
$[10] = t2;
|
|
68
|
+
} else {
|
|
69
|
+
t2 = $[10];
|
|
70
|
+
}
|
|
71
|
+
useEffect(t1, t2);
|
|
72
|
+
let t3;
|
|
73
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
74
|
+
t3 = tempHeight_0 => {
|
|
75
|
+
setHeight(expandable ? getActionSheetExpandableHeight() : getActionSheetHeight(tempHeight_0));
|
|
76
|
+
};
|
|
77
|
+
$[11] = t3;
|
|
78
|
+
} else {
|
|
79
|
+
t3 = $[11];
|
|
80
|
+
}
|
|
81
|
+
const updateHeight = t3;
|
|
82
|
+
let t4;
|
|
83
|
+
if ($[12] !== expandableHeightSharedVal || $[13] !== headerViewRef || $[14] !== height || $[15] !== heightSharedVal || $[16] !== translateYSharedVal) {
|
|
84
|
+
t4 = {
|
|
85
|
+
headerViewRef,
|
|
86
|
+
height,
|
|
87
|
+
translateYSharedVal,
|
|
88
|
+
heightSharedVal,
|
|
89
|
+
expandableHeightSharedVal,
|
|
90
|
+
updateHeight
|
|
91
|
+
};
|
|
92
|
+
$[12] = expandableHeightSharedVal;
|
|
93
|
+
$[13] = headerViewRef;
|
|
94
|
+
$[14] = height;
|
|
95
|
+
$[15] = heightSharedVal;
|
|
96
|
+
$[16] = translateYSharedVal;
|
|
97
|
+
$[17] = t4;
|
|
98
|
+
} else {
|
|
99
|
+
t4 = $[17];
|
|
100
|
+
}
|
|
101
|
+
const actionSheet = t4;
|
|
52
102
|
return actionSheet;
|
|
53
103
|
}
|
|
54
104
|
|
|
55
105
|
/** @internal */
|
|
56
|
-
export function useActionSheetOnDismiss(
|
|
106
|
+
export function useActionSheetOnDismiss(t0) {
|
|
107
|
+
const $ = _c(10);
|
|
108
|
+
const force = t0 === undefined ? true : t0;
|
|
57
109
|
const windowHeight = useWindowDimensionsHeight();
|
|
58
110
|
const {
|
|
59
111
|
title,
|
|
@@ -64,58 +116,154 @@ export function useActionSheetOnDismiss(force = true) {
|
|
|
64
116
|
heightSharedVal,
|
|
65
117
|
expandableHeightSharedVal
|
|
66
118
|
} = useActionSheetContext();
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const toVal = expandable ? getActionSheetExpandableSnapHeight(heightSharedVal.get(), force) : getActionSheetSnapHeight(height, translateYSharedVal?.get() ?? windowHeight, force);
|
|
73
|
-
const dismissActionSheet = toVal === (expandable ? 0 : height);
|
|
74
|
-
const animationConfig = {
|
|
75
|
-
duration: dismissActionSheet ? actionSheetDismissDuration : actionSheetSnapDuration
|
|
76
|
-
};
|
|
77
|
-
const cb = () => {
|
|
78
|
-
if (!dismissActionSheet) {
|
|
79
|
-
expandableHeightSharedVal?.set(toVal);
|
|
119
|
+
let t1;
|
|
120
|
+
if ($[0] !== expandable || $[1] !== expandableHeightSharedVal || $[2] !== force || $[3] !== height || $[4] !== heightSharedVal || $[5] !== onDismiss || $[6] !== title || $[7] !== translateYSharedVal || $[8] !== windowHeight) {
|
|
121
|
+
t1 = t2 => {
|
|
122
|
+
const text = t2 === undefined ? overlayDismissResultDefaultText : t2;
|
|
123
|
+
if (!height || !heightSharedVal || !translateYSharedVal) {
|
|
80
124
|
return;
|
|
81
125
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
126
|
+
const tempTranslateYSharedVal = translateYSharedVal ?? makeMutable(windowHeight);
|
|
127
|
+
const toVal = expandable ? getActionSheetExpandableSnapHeight(heightSharedVal.get(), force) : getActionSheetSnapHeight(height, translateYSharedVal?.get() ?? windowHeight, force);
|
|
128
|
+
const dismissActionSheet = toVal === (expandable ? 0 : height);
|
|
129
|
+
const animationConfig = {
|
|
130
|
+
duration: dismissActionSheet ? actionSheetDismissDuration : actionSheetSnapDuration
|
|
131
|
+
};
|
|
132
|
+
const cb = () => {
|
|
133
|
+
if (!dismissActionSheet) {
|
|
134
|
+
expandableHeightSharedVal?.set(toVal);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
onDismiss?.({
|
|
138
|
+
resultType: OverlayDismissResultType.ActionSheet,
|
|
139
|
+
title,
|
|
140
|
+
text
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
if (expandable && !dismissActionSheet) {
|
|
144
|
+
updateSharedValWithTiming(heightSharedVal, toVal, animationConfig, cb);
|
|
145
|
+
} else {
|
|
146
|
+
updateSharedValWithTiming(tempTranslateYSharedVal, dismissActionSheet ? windowHeight : toVal, animationConfig, cb);
|
|
147
|
+
}
|
|
87
148
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
149
|
+
$[0] = expandable;
|
|
150
|
+
$[1] = expandableHeightSharedVal;
|
|
151
|
+
$[2] = force;
|
|
152
|
+
$[3] = height;
|
|
153
|
+
$[4] = heightSharedVal;
|
|
154
|
+
$[5] = onDismiss;
|
|
155
|
+
$[6] = title;
|
|
156
|
+
$[7] = translateYSharedVal;
|
|
157
|
+
$[8] = windowHeight;
|
|
158
|
+
$[9] = t1;
|
|
159
|
+
} else {
|
|
160
|
+
t1 = $[9];
|
|
161
|
+
}
|
|
162
|
+
const actionSheetOnDismiss = t1;
|
|
94
163
|
return actionSheetOnDismiss;
|
|
95
164
|
}
|
|
96
165
|
|
|
97
166
|
/** @internal */
|
|
98
|
-
|
|
167
|
+
const _worklet_14062660967716_init_data = {
|
|
168
|
+
code: "function overlayTs1(){const{scheduleOnRN,onDismiss}=this.__closure;scheduleOnRN(onDismiss);}",
|
|
169
|
+
location: "/home/runner/work/react-native-template-ui/react-native-template-ui/src/hooks/overlay.ts",
|
|
170
|
+
sourceMap: "{\"version\":3,\"names\":[\"overlayTs1\",\"scheduleOnRN\",\"onDismiss\",\"__closure\"],\"sources\":[\"/home/runner/work/react-native-template-ui/react-native-template-ui/src/hooks/overlay.ts\"],\"mappings\":\"AAsLW,SAAAA,WAAA,QAAAC,YAAA,CAAAC,SAAA,OAAAC,SAAA,CACLF,YAAY,CAACC,SAAS,CAAC\",\"ignoreList\":[]}"
|
|
171
|
+
};
|
|
172
|
+
const _worklet_6867469910819_init_data = {
|
|
173
|
+
code: "function overlayTs2(t2){const{contentGesture,contentOffsetSharedVal,expandable,heightSharedVal,translateYSharedVal}=this.__closure;var _contentOffsetSharedV;const{changeY:changeY}=t2;if(!contentGesture||!((_contentOffsetSharedV=contentOffsetSharedVal)!==null&&_contentOffsetSharedV!==void 0&&_contentOffsetSharedV.get())){if(expandable){var _heightSharedVal;(_heightSharedVal=heightSharedVal)===null||_heightSharedVal===void 0||_heightSharedVal.set(heightSharedVal.get()-changeY);}else{var _translateYSharedVal;(_translateYSharedVal=translateYSharedVal)===null||_translateYSharedVal===void 0||_translateYSharedVal.set(Math.max(translateYSharedVal.get()+changeY,0));}}}",
|
|
174
|
+
location: "/home/runner/work/react-native-template-ui/react-native-template-ui/src/hooks/overlay.ts",
|
|
175
|
+
sourceMap: "{\"version\":3,\"names\":[\"overlayTs2\",\"t2\",\"contentGesture\",\"contentOffsetSharedVal\",\"expandable\",\"heightSharedVal\",\"translateYSharedVal\",\"__closure\",\"_contentOffsetSharedV\",\"changeY\",\"get\",\"_heightSharedVal\",\"set\",\"_translateYSharedVal\",\"Math\",\"max\"],\"sources\":[\"/home/runner/work/react-native-template-ui/react-native-template-ui/src/hooks/overlay.ts\"],\"mappings\":\"AA2Kc,SAAAA,WAAAC,EAAA,QAAAC,cAAA,CAAAC,sBAAA,CAAAC,UAAA,CAAAC,eAAA,CAAAC,mBAAA,OAAAC,SAAA,KAAAC,qBAAA,CAAC,MAAAC,OAAA,CAAAA,OAAA,EAAAR,EAAW,CACpB,GAAI,CAACC,cAAgD,EAAjD,GAAAM,qBAAA,CAAoBL,sBAAsB,UAAAK,qBAAA,WAAtBA,qBAAA,CAAsBE,GAAO,CAAD,CAAC,GACnD,GAAIN,UAAU,MAAAO,gBAAA,CACZ,CAAAA,gBAAA,CAAAN,eAAe,UAAAM,gBAAA,WAAfA,gBAAA,CAAeC,GAAsC,CAAhCP,eAAe,CAAAK,GAAI,CAAC,CAAC,CAAGD,OAAO,CAAC,WAAAI,oBAAA,CAErD,CAAAA,oBAAA,CAAAP,mBAAmB,UAAAO,oBAAA,WAAnBA,oBAAA,CAAmBD,GAElB,CADCE,IAAI,CAAAC,GAAI,CAACT,mBAAmB,CAAAI,GAAK,CAAC,CAAC,CAAGD,OAAO,CAAE,CAAC,CAClD,CAAC,EACF,CACF\",\"ignoreList\":[]}"
|
|
176
|
+
};
|
|
177
|
+
export function useActionSheetGesture(t0) {
|
|
178
|
+
const $ = _c(5);
|
|
179
|
+
const contentGesture = t0 === undefined ? false : t0;
|
|
99
180
|
const onDismiss = useActionSheetOnDismiss(false);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
181
|
+
let t1;
|
|
182
|
+
if ($[0] !== contentGesture || $[1] !== onDismiss) {
|
|
183
|
+
const {
|
|
184
|
+
expandable,
|
|
185
|
+
translateYSharedVal,
|
|
186
|
+
heightSharedVal,
|
|
187
|
+
contentOffsetSharedVal
|
|
188
|
+
} = getActionSheetContext();
|
|
189
|
+
let t3;
|
|
190
|
+
if ($[3] !== onDismiss) {
|
|
191
|
+
t3 = function overlayTs1Factory({
|
|
192
|
+
_worklet_14062660967716_init_data,
|
|
193
|
+
scheduleOnRN,
|
|
194
|
+
onDismiss
|
|
195
|
+
}) {
|
|
196
|
+
const _e = [new global.Error(), -3, -27];
|
|
197
|
+
const overlayTs1 = function () {
|
|
198
|
+
scheduleOnRN(onDismiss);
|
|
199
|
+
};
|
|
200
|
+
overlayTs1.__closure = {
|
|
201
|
+
scheduleOnRN,
|
|
202
|
+
onDismiss
|
|
203
|
+
};
|
|
204
|
+
overlayTs1.__workletHash = 14062660967716;
|
|
205
|
+
overlayTs1.__pluginVersion = "0.8.3";
|
|
206
|
+
overlayTs1.__initData = _worklet_14062660967716_init_data;
|
|
207
|
+
overlayTs1.__stackDetails = _e;
|
|
208
|
+
return overlayTs1;
|
|
209
|
+
}({
|
|
210
|
+
_worklet_14062660967716_init_data,
|
|
211
|
+
scheduleOnRN,
|
|
212
|
+
onDismiss
|
|
213
|
+
});
|
|
214
|
+
$[3] = onDismiss;
|
|
215
|
+
$[4] = t3;
|
|
216
|
+
} else {
|
|
217
|
+
t3 = $[4];
|
|
115
218
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
219
|
+
t1 = Gesture.Pan().onChange(function overlayTs2Factory({
|
|
220
|
+
_worklet_6867469910819_init_data,
|
|
221
|
+
contentGesture,
|
|
222
|
+
contentOffsetSharedVal,
|
|
223
|
+
expandable,
|
|
224
|
+
heightSharedVal,
|
|
225
|
+
translateYSharedVal
|
|
226
|
+
}) {
|
|
227
|
+
const _e = [new global.Error(), -6, -27];
|
|
228
|
+
const overlayTs2 = function (t2) {
|
|
229
|
+
const {
|
|
230
|
+
changeY
|
|
231
|
+
} = t2;
|
|
232
|
+
if (!contentGesture || !contentOffsetSharedVal?.get()) {
|
|
233
|
+
if (expandable) {
|
|
234
|
+
heightSharedVal?.set(heightSharedVal.get() - changeY);
|
|
235
|
+
} else {
|
|
236
|
+
translateYSharedVal?.set(Math.max(translateYSharedVal.get() + changeY, 0));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
overlayTs2.__closure = {
|
|
241
|
+
contentGesture,
|
|
242
|
+
contentOffsetSharedVal,
|
|
243
|
+
expandable,
|
|
244
|
+
heightSharedVal,
|
|
245
|
+
translateYSharedVal
|
|
246
|
+
};
|
|
247
|
+
overlayTs2.__workletHash = 6867469910819;
|
|
248
|
+
overlayTs2.__pluginVersion = "0.8.3";
|
|
249
|
+
overlayTs2.__initData = _worklet_6867469910819_init_data;
|
|
250
|
+
overlayTs2.__stackDetails = _e;
|
|
251
|
+
return overlayTs2;
|
|
252
|
+
}({
|
|
253
|
+
_worklet_6867469910819_init_data,
|
|
254
|
+
contentGesture,
|
|
255
|
+
contentOffsetSharedVal,
|
|
256
|
+
expandable,
|
|
257
|
+
heightSharedVal,
|
|
258
|
+
translateYSharedVal
|
|
259
|
+
})).onEnd(t3);
|
|
260
|
+
$[0] = contentGesture;
|
|
261
|
+
$[1] = onDismiss;
|
|
262
|
+
$[2] = t1;
|
|
263
|
+
} else {
|
|
264
|
+
t1 = $[2];
|
|
265
|
+
}
|
|
266
|
+
const actionSheetGesture = t1;
|
|
119
267
|
return actionSheetGesture;
|
|
120
268
|
}
|
|
121
269
|
|
|
@@ -128,12 +276,21 @@ export function useActionSheetHeaderMinHeight() {
|
|
|
128
276
|
|
|
129
277
|
/** @internal */
|
|
130
278
|
export function useActionSheetContentGesture() {
|
|
279
|
+
const $ = _c(2);
|
|
131
280
|
const gesture = useActionSheetGesture(true);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
281
|
+
let t0;
|
|
282
|
+
if ($[0] !== gesture) {
|
|
283
|
+
const scrollGesture = Gesture.Native().shouldActivateOnStart(true);
|
|
284
|
+
const {
|
|
285
|
+
contentOffsetSharedVal
|
|
286
|
+
} = getActionSheetContext();
|
|
287
|
+
t0 = Gesture.Simultaneous(scrollGesture, gesture.activeOffsetY(contentOffsetSharedVal?.get() ?? 0));
|
|
288
|
+
$[0] = gesture;
|
|
289
|
+
$[1] = t0;
|
|
290
|
+
} else {
|
|
291
|
+
t0 = $[1];
|
|
292
|
+
}
|
|
293
|
+
const actionSheetContentGesture = t0;
|
|
137
294
|
return actionSheetContentGesture;
|
|
138
295
|
}
|
|
139
296
|
export function useActionSheetListViewAnimatedRef() {
|
|
@@ -145,40 +302,85 @@ export function useActionSheetScrollViewAnimatedRef() {
|
|
|
145
302
|
|
|
146
303
|
/** @interal */
|
|
147
304
|
export function useActionSheetListViewRefAndOffset(refObj) {
|
|
305
|
+
const $ = _c(3);
|
|
148
306
|
const listViewListAnimatedRefObj = useActionSheetListViewAnimatedRef();
|
|
149
307
|
const contentOffsetSharedVal = useScrollOffset(refObj ?? listViewListAnimatedRefObj);
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
308
|
+
const t0 = refObj ?? listViewListAnimatedRefObj;
|
|
309
|
+
let t1;
|
|
310
|
+
if ($[0] !== contentOffsetSharedVal || $[1] !== t0) {
|
|
311
|
+
t1 = {
|
|
312
|
+
listViewListAnimatedRefObj: t0,
|
|
313
|
+
contentOffsetSharedVal
|
|
314
|
+
};
|
|
315
|
+
$[0] = contentOffsetSharedVal;
|
|
316
|
+
$[1] = t0;
|
|
317
|
+
$[2] = t1;
|
|
318
|
+
} else {
|
|
319
|
+
t1 = $[2];
|
|
320
|
+
}
|
|
321
|
+
const actionSheetListViewAnimatedRef = t1;
|
|
154
322
|
return actionSheetListViewAnimatedRef;
|
|
155
323
|
}
|
|
156
324
|
|
|
157
325
|
/** @interal */
|
|
158
326
|
export function useActionSheetScrollViewRefAndOffset(refObj) {
|
|
327
|
+
const $ = _c(3);
|
|
159
328
|
const scrollViewAnimatedRefObj = useActionSheetScrollViewAnimatedRef();
|
|
160
329
|
const contentOffsetSharedVal = useScrollOffset(refObj ?? scrollViewAnimatedRefObj);
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
330
|
+
const t0 = refObj ?? scrollViewAnimatedRefObj;
|
|
331
|
+
let t1;
|
|
332
|
+
if ($[0] !== contentOffsetSharedVal || $[1] !== t0) {
|
|
333
|
+
t1 = {
|
|
334
|
+
scrollViewAnimatedRefObj: t0,
|
|
335
|
+
contentOffsetSharedVal
|
|
336
|
+
};
|
|
337
|
+
$[0] = contentOffsetSharedVal;
|
|
338
|
+
$[1] = t0;
|
|
339
|
+
$[2] = t1;
|
|
340
|
+
} else {
|
|
341
|
+
t1 = $[2];
|
|
342
|
+
}
|
|
343
|
+
const actionSheetScrollViewAnimatedRef = t1;
|
|
165
344
|
return actionSheetScrollViewAnimatedRef;
|
|
166
345
|
}
|
|
167
346
|
|
|
168
347
|
/** @internal */
|
|
169
|
-
export function useActionSheetVisible(
|
|
348
|
+
export function useActionSheetVisible(t0) {
|
|
349
|
+
const $ = _c(5);
|
|
350
|
+
const visible = t0 === undefined ? true : t0;
|
|
170
351
|
const [actionSheetVisible, setActionSheetVisible] = useState(visible);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
352
|
+
let t1;
|
|
353
|
+
let t2;
|
|
354
|
+
if ($[0] !== visible) {
|
|
355
|
+
t1 = () => {
|
|
356
|
+
setActionSheetVisible(visible);
|
|
357
|
+
};
|
|
358
|
+
t2 = [visible];
|
|
359
|
+
$[0] = visible;
|
|
360
|
+
$[1] = t1;
|
|
361
|
+
$[2] = t2;
|
|
362
|
+
} else {
|
|
363
|
+
t1 = $[1];
|
|
364
|
+
t2 = $[2];
|
|
365
|
+
}
|
|
366
|
+
useLayoutEffect(t1, t2);
|
|
367
|
+
let t3;
|
|
368
|
+
if ($[3] !== actionSheetVisible) {
|
|
369
|
+
t3 = {
|
|
370
|
+
actionSheetVisible,
|
|
371
|
+
setActionSheetVisible
|
|
372
|
+
};
|
|
373
|
+
$[3] = actionSheetVisible;
|
|
374
|
+
$[4] = t3;
|
|
375
|
+
} else {
|
|
376
|
+
t3 = $[4];
|
|
377
|
+
}
|
|
378
|
+
return t3;
|
|
178
379
|
}
|
|
179
380
|
|
|
180
381
|
/** @internal */
|
|
181
382
|
export function useActionSheetOpts(title, expandable, options, optionListProps, onDismiss, dismissable, actionSheetVisible) {
|
|
383
|
+
const $ = _c(21);
|
|
182
384
|
const {
|
|
183
385
|
headerViewRef,
|
|
184
386
|
height,
|
|
@@ -195,50 +397,85 @@ export function useActionSheetOpts(title, expandable, options, optionListProps,
|
|
|
195
397
|
itemSize,
|
|
196
398
|
insetsStyle
|
|
197
399
|
} = useActionSheetOptItemSize(optionListProps);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
400
|
+
let t0;
|
|
401
|
+
if ($[0] !== actionSheetVisible || $[1] !== headerViewRef || $[2] !== insetsStyle || $[3] !== itemSize || $[4] !== options || $[5] !== updateHeight) {
|
|
402
|
+
t0 = () => {
|
|
403
|
+
if (!actionSheetVisible) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
headerViewRef.current?.measureInWindow((_x, _y, _width, headerHeight) => {
|
|
407
|
+
const contentHeight = options.length * itemSize + (insetsStyle.paddingBottom ?? 0);
|
|
408
|
+
updateHeight(headerHeight + contentHeight);
|
|
409
|
+
});
|
|
410
|
+
};
|
|
411
|
+
$[0] = actionSheetVisible;
|
|
412
|
+
$[1] = headerViewRef;
|
|
413
|
+
$[2] = insetsStyle;
|
|
414
|
+
$[3] = itemSize;
|
|
415
|
+
$[4] = options;
|
|
416
|
+
$[5] = updateHeight;
|
|
417
|
+
$[6] = t0;
|
|
418
|
+
} else {
|
|
419
|
+
t0 = $[6];
|
|
420
|
+
}
|
|
421
|
+
let t1;
|
|
422
|
+
if ($[7] !== actionSheetVisible) {
|
|
423
|
+
t1 = [actionSheetVisible];
|
|
424
|
+
$[7] = actionSheetVisible;
|
|
425
|
+
$[8] = t1;
|
|
426
|
+
} else {
|
|
427
|
+
t1 = $[8];
|
|
428
|
+
}
|
|
429
|
+
useLayoutEffect(t0, t1);
|
|
430
|
+
let t2;
|
|
431
|
+
if ($[9] !== contentOffsetSharedVal || $[10] !== dismissable || $[11] !== expandable || $[12] !== expandableHeightSharedVal || $[13] !== headerViewRef || $[14] !== height || $[15] !== heightSharedVal || $[16] !== listViewListAnimatedRefObj || $[17] !== onDismiss || $[18] !== title || $[19] !== translateYSharedVal) {
|
|
432
|
+
t2 = {
|
|
433
|
+
title,
|
|
434
|
+
expandable,
|
|
435
|
+
onDismiss,
|
|
436
|
+
dismissable,
|
|
437
|
+
headerViewRef,
|
|
438
|
+
contentAnimatedRefObj: listViewListAnimatedRefObj,
|
|
439
|
+
height,
|
|
440
|
+
translateYSharedVal,
|
|
441
|
+
heightSharedVal,
|
|
442
|
+
expandableHeightSharedVal,
|
|
443
|
+
contentOffsetSharedVal
|
|
444
|
+
};
|
|
445
|
+
$[9] = contentOffsetSharedVal;
|
|
446
|
+
$[10] = dismissable;
|
|
447
|
+
$[11] = expandable;
|
|
448
|
+
$[12] = expandableHeightSharedVal;
|
|
449
|
+
$[13] = headerViewRef;
|
|
450
|
+
$[14] = height;
|
|
451
|
+
$[15] = heightSharedVal;
|
|
452
|
+
$[16] = listViewListAnimatedRefObj;
|
|
453
|
+
$[17] = onDismiss;
|
|
454
|
+
$[18] = title;
|
|
455
|
+
$[19] = translateYSharedVal;
|
|
456
|
+
$[20] = t2;
|
|
457
|
+
} else {
|
|
458
|
+
t2 = $[20];
|
|
459
|
+
}
|
|
460
|
+
const actionSheetContextVal = t2;
|
|
220
461
|
return actionSheetContextVal;
|
|
221
462
|
}
|
|
222
463
|
|
|
223
464
|
/** @internal */
|
|
224
|
-
export function useActionSheetOptItemSize({
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}) {
|
|
239
|
-
const themeSpacing = useThemeSpacing();
|
|
240
|
-
const themeTextVariants = useThemeTextVariants();
|
|
241
|
-
const insetsStyle = useInsetsStyle({
|
|
465
|
+
export function useActionSheetOptItemSize(t0) {
|
|
466
|
+
const $ = _c(16);
|
|
467
|
+
let t1;
|
|
468
|
+
if ($[0] !== t0) {
|
|
469
|
+
t1 = t0 === undefined ? {
|
|
470
|
+
insetBottom: true,
|
|
471
|
+
insetPaddingBottom: "m"
|
|
472
|
+
} : t0;
|
|
473
|
+
$[0] = t0;
|
|
474
|
+
$[1] = t1;
|
|
475
|
+
} else {
|
|
476
|
+
t1 = $[1];
|
|
477
|
+
}
|
|
478
|
+
const {
|
|
242
479
|
insets,
|
|
243
480
|
insetTop,
|
|
244
481
|
insetBottom,
|
|
@@ -249,16 +486,58 @@ export function useActionSheetOptItemSize({
|
|
|
249
486
|
insetPaddingBottom,
|
|
250
487
|
insetPaddingLeft,
|
|
251
488
|
insetPaddingRight
|
|
252
|
-
}
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
489
|
+
} = t1;
|
|
490
|
+
const themeSpacing = useThemeSpacing();
|
|
491
|
+
const themeTextVariants = useThemeTextVariants();
|
|
492
|
+
let t2;
|
|
493
|
+
if ($[2] !== insetBottom || $[3] !== insetLeft || $[4] !== insetPaddingBottom || $[5] !== insetPaddingLeft || $[6] !== insetPaddingRight || $[7] !== insetPaddingTop || $[8] !== insetRight || $[9] !== insetTop || $[10] !== insets || $[11] !== insetsPadding) {
|
|
494
|
+
t2 = {
|
|
495
|
+
insets,
|
|
496
|
+
insetTop,
|
|
497
|
+
insetBottom,
|
|
498
|
+
insetLeft,
|
|
499
|
+
insetRight,
|
|
500
|
+
insetsPadding,
|
|
501
|
+
insetPaddingTop,
|
|
502
|
+
insetPaddingBottom,
|
|
503
|
+
insetPaddingLeft,
|
|
504
|
+
insetPaddingRight
|
|
505
|
+
};
|
|
506
|
+
$[2] = insetBottom;
|
|
507
|
+
$[3] = insetLeft;
|
|
508
|
+
$[4] = insetPaddingBottom;
|
|
509
|
+
$[5] = insetPaddingLeft;
|
|
510
|
+
$[6] = insetPaddingRight;
|
|
511
|
+
$[7] = insetPaddingTop;
|
|
512
|
+
$[8] = insetRight;
|
|
513
|
+
$[9] = insetTop;
|
|
514
|
+
$[10] = insets;
|
|
515
|
+
$[11] = insetsPadding;
|
|
516
|
+
$[12] = t2;
|
|
517
|
+
} else {
|
|
518
|
+
t2 = $[12];
|
|
519
|
+
}
|
|
520
|
+
const insetsStyle = useInsetsStyle(t2);
|
|
521
|
+
const t3 = themeSpacing[actionSheetOptionListItemPadding] * 2 + themeTextVariants[actionSheetOptionListItemTextVariant].lineHeight;
|
|
522
|
+
let t4;
|
|
523
|
+
if ($[13] !== insetsStyle || $[14] !== t3) {
|
|
524
|
+
t4 = {
|
|
525
|
+
itemSize: t3,
|
|
526
|
+
insetsStyle
|
|
527
|
+
};
|
|
528
|
+
$[13] = insetsStyle;
|
|
529
|
+
$[14] = t3;
|
|
530
|
+
$[15] = t4;
|
|
531
|
+
} else {
|
|
532
|
+
t4 = $[15];
|
|
533
|
+
}
|
|
534
|
+
const actionSheetOptionItemSize = t4;
|
|
257
535
|
return actionSheetOptionItemSize;
|
|
258
536
|
}
|
|
259
537
|
|
|
260
538
|
/** @internal */
|
|
261
539
|
export function useActionSheetScrollView(title, expandable, scrollViewProps, onDismiss, dismissable, actionSheetVisible) {
|
|
540
|
+
const $ = _c(24);
|
|
262
541
|
const {
|
|
263
542
|
headerViewRef,
|
|
264
543
|
height,
|
|
@@ -273,38 +552,93 @@ export function useActionSheetScrollView(title, expandable, scrollViewProps, onD
|
|
|
273
552
|
} = useActionSheetScrollViewRefAndOffset(scrollViewProps?.ref);
|
|
274
553
|
const [headerHeight, setHeaderHeight] = useState(0);
|
|
275
554
|
const [contentHeight, setContentHeight] = useState(0);
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
555
|
+
let t0;
|
|
556
|
+
if ($[0] !== actionSheetVisible || $[1] !== headerViewRef) {
|
|
557
|
+
t0 = () => {
|
|
558
|
+
if (!actionSheetVisible) {
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
headerViewRef.current?.measureInWindow((_x, _y, _width, headerViewHeight) => {
|
|
562
|
+
setHeaderHeight(headerViewHeight);
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
$[0] = actionSheetVisible;
|
|
566
|
+
$[1] = headerViewRef;
|
|
567
|
+
$[2] = t0;
|
|
568
|
+
} else {
|
|
569
|
+
t0 = $[2];
|
|
570
|
+
}
|
|
571
|
+
let t1;
|
|
572
|
+
if ($[3] !== actionSheetVisible) {
|
|
573
|
+
t1 = [actionSheetVisible];
|
|
574
|
+
$[3] = actionSheetVisible;
|
|
575
|
+
$[4] = t1;
|
|
576
|
+
} else {
|
|
577
|
+
t1 = $[4];
|
|
578
|
+
}
|
|
579
|
+
useLayoutEffect(t0, t1);
|
|
580
|
+
let t2;
|
|
581
|
+
if ($[5] !== contentHeight || $[6] !== headerHeight || $[7] !== updateHeight) {
|
|
582
|
+
t2 = () => {
|
|
583
|
+
if (headerHeight && contentHeight) {
|
|
584
|
+
updateHeight(headerHeight + contentHeight);
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
$[5] = contentHeight;
|
|
588
|
+
$[6] = headerHeight;
|
|
589
|
+
$[7] = updateHeight;
|
|
590
|
+
$[8] = t2;
|
|
591
|
+
} else {
|
|
592
|
+
t2 = $[8];
|
|
593
|
+
}
|
|
594
|
+
let t3;
|
|
595
|
+
if ($[9] !== contentHeight || $[10] !== headerHeight) {
|
|
596
|
+
t3 = [headerHeight, contentHeight];
|
|
597
|
+
$[9] = contentHeight;
|
|
598
|
+
$[10] = headerHeight;
|
|
599
|
+
$[11] = t3;
|
|
600
|
+
} else {
|
|
601
|
+
t3 = $[11];
|
|
602
|
+
}
|
|
603
|
+
useEffect(t2, t3);
|
|
604
|
+
let t4;
|
|
605
|
+
if ($[12] !== contentOffsetSharedVal || $[13] !== dismissable || $[14] !== expandable || $[15] !== expandableHeightSharedVal || $[16] !== headerViewRef || $[17] !== height || $[18] !== heightSharedVal || $[19] !== onDismiss || $[20] !== scrollViewAnimatedRefObj || $[21] !== title || $[22] !== translateYSharedVal) {
|
|
606
|
+
t4 = {
|
|
607
|
+
title,
|
|
608
|
+
expandable,
|
|
609
|
+
onDismiss,
|
|
610
|
+
dismissable,
|
|
611
|
+
headerViewRef,
|
|
612
|
+
contentAnimatedRefObj: scrollViewAnimatedRefObj,
|
|
613
|
+
height,
|
|
614
|
+
setContentHeight,
|
|
615
|
+
translateYSharedVal,
|
|
616
|
+
heightSharedVal,
|
|
617
|
+
expandableHeightSharedVal,
|
|
618
|
+
contentOffsetSharedVal
|
|
619
|
+
};
|
|
620
|
+
$[12] = contentOffsetSharedVal;
|
|
621
|
+
$[13] = dismissable;
|
|
622
|
+
$[14] = expandable;
|
|
623
|
+
$[15] = expandableHeightSharedVal;
|
|
624
|
+
$[16] = headerViewRef;
|
|
625
|
+
$[17] = height;
|
|
626
|
+
$[18] = heightSharedVal;
|
|
627
|
+
$[19] = onDismiss;
|
|
628
|
+
$[20] = scrollViewAnimatedRefObj;
|
|
629
|
+
$[21] = title;
|
|
630
|
+
$[22] = translateYSharedVal;
|
|
631
|
+
$[23] = t4;
|
|
632
|
+
} else {
|
|
633
|
+
t4 = $[23];
|
|
634
|
+
}
|
|
635
|
+
const actionSheetContextVal = t4;
|
|
303
636
|
return actionSheetContextVal;
|
|
304
637
|
}
|
|
305
638
|
|
|
306
639
|
/** @internal */
|
|
307
640
|
export function useActionSheetListView(title, expandable, listProps, onDismiss, dismissable, actionSheetVisible) {
|
|
641
|
+
const $ = _c(24);
|
|
308
642
|
const {
|
|
309
643
|
headerViewRef,
|
|
310
644
|
height,
|
|
@@ -319,33 +653,87 @@ export function useActionSheetListView(title, expandable, listProps, onDismiss,
|
|
|
319
653
|
} = useActionSheetListViewRefAndOffset(listProps?.ref);
|
|
320
654
|
const [headerHeight, setHeaderHeight] = useState(0);
|
|
321
655
|
const [contentHeight, setContentHeight] = useState(0);
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
656
|
+
let t0;
|
|
657
|
+
if ($[0] !== actionSheetVisible || $[1] !== headerViewRef) {
|
|
658
|
+
t0 = () => {
|
|
659
|
+
if (!actionSheetVisible) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
headerViewRef.current?.measureInWindow((_x, _y, _width, headerViewHeight) => {
|
|
663
|
+
setHeaderHeight(headerViewHeight);
|
|
664
|
+
});
|
|
665
|
+
};
|
|
666
|
+
$[0] = actionSheetVisible;
|
|
667
|
+
$[1] = headerViewRef;
|
|
668
|
+
$[2] = t0;
|
|
669
|
+
} else {
|
|
670
|
+
t0 = $[2];
|
|
671
|
+
}
|
|
672
|
+
let t1;
|
|
673
|
+
if ($[3] !== actionSheetVisible) {
|
|
674
|
+
t1 = [actionSheetVisible];
|
|
675
|
+
$[3] = actionSheetVisible;
|
|
676
|
+
$[4] = t1;
|
|
677
|
+
} else {
|
|
678
|
+
t1 = $[4];
|
|
679
|
+
}
|
|
680
|
+
useLayoutEffect(t0, t1);
|
|
681
|
+
let t2;
|
|
682
|
+
if ($[5] !== contentHeight || $[6] !== headerHeight || $[7] !== updateHeight) {
|
|
683
|
+
t2 = () => {
|
|
684
|
+
if (headerHeight && contentHeight) {
|
|
685
|
+
updateHeight(headerHeight + contentHeight);
|
|
686
|
+
}
|
|
687
|
+
};
|
|
688
|
+
$[5] = contentHeight;
|
|
689
|
+
$[6] = headerHeight;
|
|
690
|
+
$[7] = updateHeight;
|
|
691
|
+
$[8] = t2;
|
|
692
|
+
} else {
|
|
693
|
+
t2 = $[8];
|
|
694
|
+
}
|
|
695
|
+
let t3;
|
|
696
|
+
if ($[9] !== contentHeight || $[10] !== headerHeight) {
|
|
697
|
+
t3 = [headerHeight, contentHeight];
|
|
698
|
+
$[9] = contentHeight;
|
|
699
|
+
$[10] = headerHeight;
|
|
700
|
+
$[11] = t3;
|
|
701
|
+
} else {
|
|
702
|
+
t3 = $[11];
|
|
703
|
+
}
|
|
704
|
+
useEffect(t2, t3);
|
|
705
|
+
let t4;
|
|
706
|
+
if ($[12] !== contentOffsetSharedVal || $[13] !== dismissable || $[14] !== expandable || $[15] !== expandableHeightSharedVal || $[16] !== headerViewRef || $[17] !== height || $[18] !== heightSharedVal || $[19] !== listViewListAnimatedRefObj || $[20] !== onDismiss || $[21] !== title || $[22] !== translateYSharedVal) {
|
|
707
|
+
t4 = {
|
|
708
|
+
title,
|
|
709
|
+
expandable,
|
|
710
|
+
onDismiss,
|
|
711
|
+
dismissable,
|
|
712
|
+
headerViewRef,
|
|
713
|
+
contentAnimatedRefObj: listViewListAnimatedRefObj,
|
|
714
|
+
height,
|
|
715
|
+
setContentHeight,
|
|
716
|
+
translateYSharedVal,
|
|
717
|
+
heightSharedVal,
|
|
718
|
+
expandableHeightSharedVal,
|
|
719
|
+
contentOffsetSharedVal
|
|
720
|
+
};
|
|
721
|
+
$[12] = contentOffsetSharedVal;
|
|
722
|
+
$[13] = dismissable;
|
|
723
|
+
$[14] = expandable;
|
|
724
|
+
$[15] = expandableHeightSharedVal;
|
|
725
|
+
$[16] = headerViewRef;
|
|
726
|
+
$[17] = height;
|
|
727
|
+
$[18] = heightSharedVal;
|
|
728
|
+
$[19] = listViewListAnimatedRefObj;
|
|
729
|
+
$[20] = onDismiss;
|
|
730
|
+
$[21] = title;
|
|
731
|
+
$[22] = translateYSharedVal;
|
|
732
|
+
$[23] = t4;
|
|
733
|
+
} else {
|
|
734
|
+
t4 = $[23];
|
|
735
|
+
}
|
|
736
|
+
const actionSheetContextVal = t4;
|
|
349
737
|
return actionSheetContextVal;
|
|
350
738
|
}
|
|
351
739
|
//# sourceMappingURL=overlay.js.map
|