@fto-consult/expo-ui 6.27.5 → 6.27.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.27.5",
3
+ "version": "6.27.6",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,6 +1,4 @@
1
1
 
2
- export * from "./Animation/utils";
2
+ export * from "./web";
3
3
 
4
- export {default} from "./Animation";
5
-
6
- export {default as OpacityAnimation} from "./OpacityAnimation";
4
+ export {default} from "./web";
@@ -0,0 +1,3 @@
1
+ export {default} from "./native";
2
+
3
+ export * from "./native";
@@ -5,13 +5,10 @@
5
5
 
6
6
  export const ANIMATION_DURATION = 300;
7
7
 
8
-
9
- const AnimationComponent = React.forwardRef(function AnimationComponent(props,ref) {
10
- let { animationType,animationPosition,enteringCallback,exitingCallback,animationDuration,...rest} = props;
8
+ const AnimationComponent = React.forwardRef(function AnimationComponent({animationType,animationPosition,enteringCallback,exitingCallback,animationDuration,...rest},ref) {
11
9
  const rProps = defaultObj(rest);
12
10
  const duration = animationDuration || ANIMATION_DURATION;
13
11
  let animations = getAnimations(animationType,animationPosition);
14
-
15
12
  const style = useAnimatedStyle(() => {
16
13
  return {};
17
14
  });
@@ -3,7 +3,7 @@ import { Animated} from "react-native";
3
3
  import PropTypes from "prop-types";
4
4
  import {translateByAppearFrom,inputRangeByAppearFrom,animationType,outputRangeByAppearFrom,initialPositionByAppearFrom} from "./utils";
5
5
 
6
- const OpacityAnimationComponent = React.forwardRef(({ delay,children,style, animationPosition,animationDuration,enteringCallback,exitingCallback,...viewProps},ref) => {
6
+ const WebAnimationComponent = React.forwardRef(({ delay,children,style, animationPosition,animationDuration,enteringCallback,exitingCallback,...viewProps},ref) => {
7
7
  if(!animationPosition || !initialPositionByAppearFrom[animationPosition]){
8
8
  animationPosition = 'up';
9
9
  }
@@ -42,7 +42,7 @@ const OpacityAnimationComponent = React.forwardRef(({ delay,children,style, anim
42
42
  );
43
43
  });
44
44
 
45
- OpacityAnimationComponent.propTypes = {
45
+ WebAnimationComponent.propTypes = {
46
46
  delay: PropTypes.number,
47
47
  enteringCallback : PropTypes.func,
48
48
  animationPosition: PropTypes.oneOf([
@@ -50,4 +50,4 @@ OpacityAnimationComponent.propTypes = {
50
50
  ]),
51
51
  animationDuration: PropTypes.number
52
52
  }
53
- export default OpacityAnimationComponent;
53
+ export default WebAnimationComponent;
@@ -7,9 +7,7 @@ import {
7
7
  import BackHandler from "$ecomponents/BackHandler";
8
8
  import PropTypes from "prop-types";
9
9
  import theme,{StyleProp} from "$theme";
10
- //import Animated from "react-native-reanimated";
11
- //import Animation,{OpacityAnimation} from "$ecomponents/Animations";
12
- import OpacityAnimation from "$ecomponents/Animations/OpacityAnimation";
10
+ import Animation from "$ecomponents/Animation";
13
11
  import { Surface } from "react-native-paper";
14
12
  import { Platform } from "react-native";
15
13
  import Portal from "$ecomponents/Portal";
@@ -99,7 +97,9 @@ const ModalComponent = React.forwardRef((props,ref)=>{
99
97
  }
100
98
  },100);
101
99
  },[visible]);
102
- const Anim = animate !== false ? OpacityAnimation : View;
100
+ const Anim = React.useMemo(()=>{
101
+ return animate !== false ? Animation : View;
102
+ },[animate]);
103
103
  const wrapperProps = animate !== false ? {enteringCallback:callback,exitingCallback:callback} : {};
104
104
  return !visible?null: <Portal>
105
105
  <Anim