@fto-consult/expo-ui 6.29.0 → 6.29.1
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/package.json
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
getStatusBarHeight,
|
|
16
16
|
getBottomSpace,
|
|
17
17
|
} from 'react-native-iphone-x-helper';
|
|
18
|
+
import {isMobileNative} from "$cplatform";
|
|
18
19
|
|
|
19
20
|
import {defaultObj} from "$cutils";
|
|
20
21
|
|
|
@@ -40,8 +41,9 @@ const ModalComponent = React.forwardRef((props,ref)=>{
|
|
|
40
41
|
isPreloader,
|
|
41
42
|
children,
|
|
42
43
|
...rest
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
} = props;
|
|
45
|
+
animate = animate !== false ? isMobileNative() : false;
|
|
46
|
+
rest = defaultObj(rest);
|
|
45
47
|
contentContainerProps = defaultObj(contentContainerProps);
|
|
46
48
|
backdropProps = defaultObj(backdropProps);
|
|
47
49
|
const subscription = React.useRef(null);
|
|
@@ -98,9 +100,9 @@ const ModalComponent = React.forwardRef((props,ref)=>{
|
|
|
98
100
|
},100);
|
|
99
101
|
},[visible]);
|
|
100
102
|
const Anim = React.useMemo(()=>{
|
|
101
|
-
return animate
|
|
103
|
+
return animate ? Animation : View;
|
|
102
104
|
},[animate]);
|
|
103
|
-
const wrapperProps = animate
|
|
105
|
+
const wrapperProps = animate ? {enteringCallback:callback,exitingCallback:callback} : {};
|
|
104
106
|
return !visible?null: <Portal>
|
|
105
107
|
<Anim
|
|
106
108
|
ref={ref}
|
|
@@ -291,7 +291,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
|
|
|
291
291
|
const currentDefaultValue = alwaysUseLabel && displayText == emptyValue ? "" : displayText;
|
|
292
292
|
const withAutoHeight = typeof autoHeight === 'boolean'? autoHeight : false;
|
|
293
293
|
const height = withAutoHeight || multiline ? undefined : tHeight;
|
|
294
|
-
const inputStyle2 = withAutoHeight || multiline ? {height : Math.min(heightRef.current,250)} : null;
|
|
294
|
+
const inputStyle2 = withAutoHeight || multiline ? {height : Math.min(Math.max(heightRef.current,MULTIPLE_HEIGHT),250)} : null;
|
|
295
295
|
const containerStyle = StyleSheet.flatten(containerProps.style) || {};
|
|
296
296
|
const inputProps= {
|
|
297
297
|
caretHidden : false,
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from "react";
|
|
2
|
-
import { Animated } from "react-native";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { StyleProp } from "$theme";
|
|
5
|
-
|
|
6
|
-
const DEFAULT_DURATION = 300;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const FadeInOutComponent = React.forwardRef(({
|
|
10
|
-
children,
|
|
11
|
-
visible,
|
|
12
|
-
duration = DEFAULT_DURATION,
|
|
13
|
-
rotate,
|
|
14
|
-
scale,
|
|
15
|
-
style,
|
|
16
|
-
onShow,
|
|
17
|
-
useNativeDriver = true,
|
|
18
|
-
...rest
|
|
19
|
-
},ref) => {
|
|
20
|
-
const fadeAnim = useRef(new Animated.Value(visible ? 1 : 0)).current;
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
Animated.timing(fadeAnim, {
|
|
24
|
-
toValue: visible ? 1 : 0,
|
|
25
|
-
duration: duration,
|
|
26
|
-
useNativeDriver: useNativeDriver,
|
|
27
|
-
}).start();
|
|
28
|
-
setTimeout(()=>{
|
|
29
|
-
if(visible && onShow){
|
|
30
|
-
onShow();
|
|
31
|
-
}
|
|
32
|
-
},10)
|
|
33
|
-
}, [visible]);
|
|
34
|
-
|
|
35
|
-
const transform = [{ perspective: 1000 }];
|
|
36
|
-
|
|
37
|
-
if (scale) {
|
|
38
|
-
transform.push({ scale: fadeAnim });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (rotate) {
|
|
42
|
-
transform.push({
|
|
43
|
-
rotate: fadeAnim.interpolate({
|
|
44
|
-
inputRange: [0, 1],
|
|
45
|
-
outputRange: ["0deg", "360deg"],
|
|
46
|
-
}),
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
rest = Object.assign({},rest);
|
|
50
|
-
return (
|
|
51
|
-
<Animated.View testID={'RN_FadeInOut'} {...rest} ref={ref} style={[style,{ opacity: fadeAnim, transform }]}>
|
|
52
|
-
{children}
|
|
53
|
-
</Animated.View>
|
|
54
|
-
);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
export default FadeInOutComponent;
|
|
58
|
-
|
|
59
|
-
FadeInOutComponent.propTypes = {
|
|
60
|
-
visible: PropTypes.bool,
|
|
61
|
-
children : PropTypes.any,
|
|
62
|
-
duration : PropTypes.number,
|
|
63
|
-
rotate : PropTypes.bool,
|
|
64
|
-
scale : PropTypes.bool,
|
|
65
|
-
style : StyleProp,
|
|
66
|
-
onShow : PropTypes.func,
|
|
67
|
-
useNativeDriver : PropTypes.bool,
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
FadeInOutComponent.displayName = "FadeInOutComponent";
|