@aks-dev/easyui 1.0.127 → 1.0.130

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.
@@ -2,12 +2,12 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2022-05-17 15:22:06
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-12-21 18:13:33
6
- * @FilePath: /aks-fire-app/node_modules/@aks-dev/easyui/lib/AnimationModal/AnimationModal.tsx
5
+ * @LastEditTime: 2022-12-21 22:05:02
6
+ * @FilePath: /@aks-dev/easyui/lib/AnimationModal/AnimationModal.tsx
7
7
  */
8
8
 
9
9
  import * as React from "react";
10
- import { Animated, Easing, LayoutRectangle, PanResponder, StyleSheet, useWindowDimensions } from 'react-native';
10
+ import { View, Animated, Easing, LayoutRectangle, PanResponder, StyleSheet, useWindowDimensions } from 'react-native';
11
11
  import type { AnimationModalProps } from '.';
12
12
  import * as utils from '../../utils/lazy';
13
13
  type State = {
@@ -26,7 +26,7 @@ export const AnimationModal: React.ForwardRefExoticComponent<
26
26
  mask = false
27
27
  } = props || {}
28
28
 
29
- const {height} = useWindowDimensions()
29
+ const { height } = useWindowDimensions()
30
30
 
31
31
  const [state, dispatch] = React.useReducer<StateReducerProps>(
32
32
  (state, action) => ({ ...state, ...action }),
@@ -35,15 +35,14 @@ export const AnimationModal: React.ForwardRefExoticComponent<
35
35
  })
36
36
 
37
37
  const animatedValue = React.useRef(new Animated.Value(0)).current;
38
- const timing = (value) => {
38
+ const timing = (value: number) => {
39
39
  Animated.timing(animatedValue, {
40
40
  toValue: value,
41
41
  duration: 350,
42
42
  useNativeDriver: true,
43
- easing: Easing.linear,
43
+ easing: Easing.ease,
44
44
  }).start(({ finished }) => {
45
45
  /* 动画完成的回调函数 */
46
- console.log({ finished })
47
46
  });
48
47
  };
49
48
 
@@ -69,15 +68,22 @@ export const AnimationModal: React.ForwardRefExoticComponent<
69
68
  }
70
69
  const hide = async () => {
71
70
  timing(0)
72
- await utils.sleep(50)
71
+ await utils.sleep(300)
73
72
  dispatch({ display: 'none' })
74
73
  }
75
74
 
76
75
  return (
77
- <Animated.View
76
+ <View
78
77
  style={Object.assign({ display: state.display }, styles.container, props.style)}
79
78
  {...PanResponder.create({
80
- onStartShouldSetPanResponder: () => true,
79
+ onStartShouldSetPanResponder: (e, gestureState) => {
80
+ let pageY = e.nativeEvent.pageY
81
+ let topY = height - layoutRef.current.h1
82
+ if (pageY <= topY && !mask) {
83
+ return true
84
+ }
85
+ return false
86
+ },
81
87
  onPanResponderGrant: (e, gestureState) => {
82
88
  // console.log({e})
83
89
  let pageY = e.nativeEvent.pageY
@@ -98,7 +104,7 @@ export const AnimationModal: React.ForwardRefExoticComponent<
98
104
  >
99
105
  {props.children}
100
106
  </Animated.View>
101
- </Animated.View>
107
+ </View>
102
108
  )
103
109
  })
104
110
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.0.127",
3
+ "version": "1.0.130",
4
4
  "description": "工具箱",
5
5
  "main": "./src/index.ts",
6
6
  "typings": "./src/index.d.ts",