@fto-consult/expo-ui 6.67.12 → 6.67.14

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/metro.config.js CHANGED
@@ -52,8 +52,15 @@ module.exports = function(opts){
52
52
  'jsx', 'js','tsx',
53
53
  ]
54
54
 
55
+ // 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
56
+ config.resolver.disableHierarchicalLookup = true;
57
+
55
58
  // Remove all console logs in production...
56
59
  config.transformer.minifierConfig.compress.drop_console = false;
60
+
61
+ // 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`, @see : https://docs.expo.dev/guides/monorepos/
62
+ config.resolver.disableHierarchicalLookup = true;
63
+
57
64
  /*config.platforms = Array.isArray(config.platforms) && config.platforms || [];
58
65
  ['ios', 'android', 'windows', 'web',"electron"].map(p=>{
59
66
  if(!config.platforms.includes(p)){
@@ -61,6 +68,6 @@ module.exports = function(opts){
61
68
  }
62
69
  });*/
63
70
  ///on génère les librairies open sources utilisées par l'application
64
- require("./find-licenses");
71
+ //require("./find-licenses");
65
72
  return config;
66
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.67.12",
3
+ "version": "6.67.14",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {
@@ -71,7 +71,7 @@
71
71
  "@expo/html-elements": "^0.5.1",
72
72
  "@expo/vector-icons": "^13.0.0",
73
73
  "@faker-js/faker": "^8.0.2",
74
- "@fto-consult/common": "^3.57.8",
74
+ "@fto-consult/common": "^3.57.9",
75
75
  "@pchmn/expo-material3-theme": "^1.3.1",
76
76
  "@react-native-async-storage/async-storage": "1.18.2",
77
77
  "@react-native-community/datetimepicker": "7.2.0",
@@ -69,6 +69,7 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render}) {
69
69
  const [state,setState] = React.useState({
70
70
  isLoading : true,
71
71
  isInitialized:false,
72
+ hasCallInitApp : false,
72
73
  });
73
74
  React.useEffect(() => {
74
75
  const loadResources = ()=>{
@@ -189,11 +190,11 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render}) {
189
190
  Auth.loginUser(false);
190
191
  }
191
192
  setState({
192
- ...state,hasGetStarted:true,...defaultObj(args && args?.state),isInitialized:true,isLoading : false,
193
+ ...state,hasGetStarted:true,...defaultObj(args && args?.state),hasCallInitApp:true,isInitialized:true,isLoading : false,
193
194
  });
194
195
  }).catch((e)=>{
195
196
  console.error(e," loading resources for app initialization");
196
- setState({...state,isInitialized:true,isLoading : false,hasGetStarted:false});
197
+ setState({...state,isInitialized:true,hasCallInitApp,isLoading : false,hasGetStarted:false});
197
198
  })
198
199
  });
199
200
 
@@ -246,7 +247,7 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render}) {
246
247
  theme,
247
248
  ...defaultObj(pref),
248
249
  }),[theme,pref]);
249
- const isLoaded = !isLoading;
250
+ const isLoaded = !isLoading && state.hasCallInitApp;
250
251
  const child = isLoaded ? <NavigationContainer
251
252
  ref={navigationRef}
252
253
  initialState={initialState}
@@ -7,6 +7,7 @@ import View from "$ecomponents/View";
7
7
  import {isNativeMobile} from "$cplatform";
8
8
  import {defaultDecimal} from "$cutils";
9
9
  import {LogoProgress} from "$ecomponents/Logo";
10
+ import { Portal } from "react-native-paper";
10
11
  import {defaultStr} from "$cutils";
11
12
  import styles, {
12
13
  _solidBackground,
@@ -17,29 +18,28 @@ import styles, {
17
18
  _dynamicBackgroundOpacity,
18
19
  } from "./styles"
19
20
  import {useAppComponent} from "$econtext/hooks";
21
+ import theme from "$theme";
20
22
 
21
23
  const SplashScreenComponent = ({isLoaded,children , duration, delay,logoWidth,logoHeight,backgroundColor,imageBackgroundSource,imageBackgroundResizeMode,
22
24
  testID})=>{
23
25
  const [state,setState] = React.useState({
24
26
  animationDone: false,
25
- loadingProgress: new Animated.Value(0)
27
+ loadingProgress: new Animated.Value(0),
26
28
  });
27
- const { loadingProgress, animationDone } = state;
28
- const prevIsLoaded = React.usePrevious(isLoaded);
29
+ const { loadingProgress, animationDone} = state;
29
30
  React.useEffect(()=>{
30
- if(animationDone && (prevIsLoaded == isLoaded || !isLoaded)) return;
31
- if(!isNativeMobile()){
32
- setState({...state,animationDone:true});
31
+ if(!isLoaded){
32
+ setState({...state,loadingProgress : new Animated.Value(0),animationDone:false});
33
33
  } else {
34
34
  Animated.timing(loadingProgress, {
35
35
  toValue: 100,
36
- duration: duration || 1000,
36
+ duration: duration || 5000,
37
37
  delay: delay || 0,
38
- useNativeDriver: true,
38
+ useNativeDriver: isNativeMobile(),
39
39
  }).start(() => {
40
40
  setState({
41
41
  ...state,
42
- animationDone: true,
42
+ animationDone:true,
43
43
  })
44
44
  })
45
45
  }
@@ -67,34 +67,39 @@ const SplashScreenComponent = ({isLoaded,children , duration, delay,logoWidth,lo
67
67
  extrapolate: "clamp",
68
68
  }),
69
69
  }
70
- const child = (animationDone && isLoaded)? React.isValidElement(children) && children : null;
71
- if(animationDone && isLoaded) return child;
72
- return <View style={[styles.container]} testID={testID} id={testID}>
73
- {!animationDone ? <View style={StyleSheet.absoluteFill} testID={testID+"_Animation"}/> : null}
74
- <View style={styles.containerGlue} testID={testID+"_ContainerGlue"}>
75
- {!animationDone && (
76
- <Animated.View
77
- style={_staticBackground(logoOpacity, backgroundColor)}
78
- testID={testID+"_AnimationDone"}
79
- />
80
- )}
81
- {!animationDone && (
82
- React.isComponent(Component)? <Component testID={testID+"_CustomSplashComponent"}/> :
83
- <View testID={testID+"_LogoContainer"} style={[StyleSheet.absoluteFill, styles.logoStyle]}>
70
+ if(animationDone && isLoaded){
71
+ return React.isValidElement(children)?children:null;
72
+ }
73
+ return <>
74
+ {!animationDone || !isLoaded ? <Portal>
75
+ <View style={[styles.container,{backgroundColor}]} testID={testID} id={testID}>
76
+ {<View style={[StyleSheet.absoluteFill,{backgroundColor}]} testID={testID+"_Animation"}/>}
77
+ <View style={styles.containerGlue} testID={testID+"_ContainerGlue"}>
78
+ {(
84
79
  <Animated.View
85
- testID={testID+"_Logo"}
86
- style={_dynamicCustomComponentStyle(
87
- logoScale,
88
- logoOpacity,
89
- logoWidth,
90
- logoHeight
91
- )}>
92
- {<LogoProgress />}
93
- </Animated.View>
80
+ style={_staticBackground(logoOpacity, backgroundColor)}
81
+ testID={testID+"_AnimationDone"}
82
+ />
83
+ )}
84
+ {(
85
+ React.isComponent(Component)? <Component testID={testID+"_CustomSplashComponent"}/> :
86
+ <View testID={testID+"_LogoContainer"} style={[StyleSheet.absoluteFill,{backgroundColor}, styles.logoStyle]}>
87
+ <Animated.View
88
+ testID={testID+"_Logo"}
89
+ style={_dynamicCustomComponentStyle(
90
+ logoScale,
91
+ logoOpacity,
92
+ logoWidth,
93
+ logoHeight
94
+ )}>
95
+ {<LogoProgress />}
96
+ </Animated.View>
97
+ </View>
98
+ )}
94
99
  </View>
95
- )}
96
- </View>
97
- </View>
100
+ </View>
101
+ </Portal> : null}
102
+ </>
98
103
  }
99
104
 
100
105
 
@@ -70,4 +70,14 @@ export default {
70
70
  alignItems: "center",
71
71
  justifyContent: "center",
72
72
  },
73
+ mainContent : {
74
+ flex : 1,
75
+ width : "100%",
76
+ height : "100%",
77
+ },
78
+ animationNotFinished : {
79
+ opacity : 0,
80
+ width : 0,
81
+ height : 0,
82
+ },
73
83
  }
@@ -571,7 +571,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
571
571
  if(typeof this.props.clone ==='function' && this.props.clone(data,this) === false) return data;
572
572
  this.showPreloader();
573
573
  delete data.approved;
574
- Object.map(['_rev',...generatedColumnsProperties,...Object.keys(this.primaryKeyFields),'_id','code','updateBy','updatedDate','createBy','updatedHour','createdHour','createdDate'],(idx)=>{
574
+ Object.map(['_rev',...generatedColumnsProperties,...Object.keys(this.primaryKeyFields),'_id','code','updateBy',"created_at","updated_at",'updatedDate','createBy','updatedHour','createdHour','createdDate'],(idx)=>{
575
575
  data[idx] = undefined;
576
576
  delete data[idx];
577
577
  });