@fto-consult/expo-ui 6.29.0 → 6.29.2
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
|
@@ -11,10 +11,12 @@ import Animation from "$ecomponents/Animation";
|
|
|
11
11
|
import { Surface } from "react-native-paper";
|
|
12
12
|
import { Platform } from "react-native";
|
|
13
13
|
import Portal from "$ecomponents/Portal";
|
|
14
|
+
import {defaultStr} from "$cutils";
|
|
14
15
|
import {
|
|
15
16
|
getStatusBarHeight,
|
|
16
17
|
getBottomSpace,
|
|
17
18
|
} from 'react-native-iphone-x-helper';
|
|
19
|
+
import {isMobileNative} from "$cplatform";
|
|
18
20
|
|
|
19
21
|
import {defaultObj} from "$cutils";
|
|
20
22
|
|
|
@@ -40,8 +42,11 @@ const ModalComponent = React.forwardRef((props,ref)=>{
|
|
|
40
42
|
isPreloader,
|
|
41
43
|
children,
|
|
42
44
|
...rest
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
} = props;
|
|
46
|
+
if(animate !== false && isMobileNative() && defaultStr(animationType).toLowerCase().trim() !=='slide'){
|
|
47
|
+
animate = false;
|
|
48
|
+
}
|
|
49
|
+
rest = defaultObj(rest);
|
|
45
50
|
contentContainerProps = defaultObj(contentContainerProps);
|
|
46
51
|
backdropProps = defaultObj(backdropProps);
|
|
47
52
|
const subscription = React.useRef(null);
|
|
@@ -98,9 +103,9 @@ const ModalComponent = React.forwardRef((props,ref)=>{
|
|
|
98
103
|
},100);
|
|
99
104
|
},[visible]);
|
|
100
105
|
const Anim = React.useMemo(()=>{
|
|
101
|
-
return animate
|
|
106
|
+
return animate ? Animation : View;
|
|
102
107
|
},[animate]);
|
|
103
|
-
const wrapperProps = animate
|
|
108
|
+
const wrapperProps = animate ? {enteringCallback:callback,exitingCallback:callback} : {};
|
|
104
109
|
return !visible?null: <Portal>
|
|
105
110
|
<Anim
|
|
106
111
|
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";
|