@fto-consult/expo-ui 5.10.1 → 5.11.0

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.
@@ -16,30 +16,6 @@ module.exports = (opts)=>{
16
16
  const cpath = fs.existsSync(euCommon)? path.resolve(euCommon,"babel.config.alias") : "@fto-consult/common/babel.config.alias";
17
17
  const r = require(`${cpath}`)(opts);
18
18
  const expo = path.resolve(expoUI,"src");
19
-
20
- /**** package json */
21
- const packagePath = path.resolve(base,"package.json");
22
- const configPath = path.resolve(expo,"app.config.json");
23
- if(fs.existsSync(packagePath)){
24
- try {
25
- const packageObj = require(`${packagePath}`);
26
- if(typeof packageObj.name =="string"){
27
- packageObj.name = packageObj.name.toUpperCase();
28
- }
29
- if(packageObj){
30
- ["scripts","private","main","repository","keywords","bugs","dependencies","devDependencies"].map(v=>{
31
- delete packageObj[v];
32
- })
33
- fs.writeFileSync(configPath,JSON.stringify(packageObj,null,"\t"));
34
- }
35
- } catch (e){
36
- console.log(e," writing file sync on package JSON, file : $common/babel.config.alias")
37
- }
38
- }
39
- if(fs.existsSync(configPath)){
40
- r["$package.json"] = r["$packageJSON"] = configPath;
41
- }
42
-
43
19
  r["$ecomponents"] = r["$expo-components"] = path.resolve(expo,"components");
44
20
  r["$econfirm"] = path.resolve(r["$expo-components"],"Dialog","confirm");
45
21
  r["$confirm"] = r["$confirm"] || r["$econfirm"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "5.10.1",
3
+ "version": "5.11.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -61,7 +61,7 @@
61
61
  "@emotion/native": "^11.11.0",
62
62
  "@expo/html-elements": "^0.2.0",
63
63
  "@expo/vector-icons": "^13.0.0",
64
- "@fto-consult/common": "^3.14.1",
64
+ "@fto-consult/common": "^3.17.0",
65
65
  "@gorhom/portal": "^1.0.14",
66
66
  "@react-native-async-storage/async-storage": "^1.17.11",
67
67
  "@react-native-community/datetimepicker": "^6.7.3",
package/src/App.js CHANGED
@@ -35,7 +35,6 @@ export default function getIndex({onMount,onUnmount,swrConfig,onRender,...rest})
35
35
  swrConfig = defaultObj(swrConfig);
36
36
  React.useEffect(()=>{
37
37
  ///la fonction de rappel lorsque le composant est monté
38
- let cb = typeof onMount =='function'? onMount() : null;
39
38
  const onScreenFocus = ({sanitizedName})=>{
40
39
  prevActiveScreenRef.current = activeScreenRef.current;
41
40
  if(activeScreenRef.current){
@@ -85,9 +84,6 @@ export default function getIndex({onMount,onUnmount,swrConfig,onRender,...rest})
85
84
  if(typeof onUnmount =='function'){
86
85
  onUnmount();
87
86
  }
88
- if(typeof cb =='function'){
89
- cb();
90
- }
91
87
  }
92
88
  },[])
93
89
 
@@ -142,7 +138,7 @@ export default function getIndex({onMount,onUnmount,swrConfig,onRender,...rest})
142
138
  >
143
139
  <GestureHandlerRootView style={{ flex: 1 }}>
144
140
  <SafeAreaProvider>
145
- <Index {...rest}/>
141
+ <Index {...rest} onMount={onMount}/>
146
142
  </SafeAreaProvider>
147
143
  </GestureHandlerRootView>
148
144
  </SWRConfig>
@@ -1,31 +1,21 @@
1
1
  {
2
- "name": "SALITE",
3
- "version": "7.0.0",
4
- "description": "Logiciel de gestion commerciale pour PME",
2
+ "name": "SMART-EEM",
3
+ "version": "1.0.0",
4
+ "id": "com.ftc.apps.device.smarteneo",
5
5
  "realeaseDateStr": "1er Juin 2021",
6
6
  "releaseDate": "2020-05-23",
7
- "devMail": "saliteapp@gmail.com",
8
- "devWebsite": "http://fto-consulting.com/salite/",
9
- "copyRight": "firsto consulting@Jan 2020",
10
- "id": "com.ftc.apps.salite7",
11
- "pouchdbNamePrefix": "com.ftc.apps.slite-",
12
- "includeFieldsInDatagridFetchOptions": false,
13
- "feeds": {
14
- "VIDEOS": {
15
- "link": "http://fto-consulting.com/salite/feeds",
16
- "label": "Bibliothèque vidéo",
17
- "provider": "",
18
- "icon": "file-video"
19
- }
20
- },
7
+ "devMail": "smart-eneo@gmail.com",
8
+ "devWebsite": "http://fto-consulting.com/smart-eneo/",
9
+ "copyRight": "FirsTo consulting@Août 2022",
10
+ "apiVersion": "1.0",
11
+ "includeCredentialsOnApiFetch": false,
12
+ "checkNavigationPermsOnTableOrStructData": false,
21
13
  "theme": {
22
14
  "light": {
23
- "primary": "#0073B1",
24
- "secondary": "#EC008C",
25
- "primaryOnSurface": "#0073B1",
26
- "secondaryOnSurface": "#EC008C"
15
+ "primary": "#00AB55",
16
+ "secondary": "#354448"
27
17
  }
28
18
  },
29
- "author": "@fto-consulting",
30
- "license": "ISC"
19
+ "netInfoReachabilityShortTimeout": 30000,
20
+ "description": "Suivi des équipements Eneo"
31
21
  }
@@ -7,6 +7,8 @@ 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 { Provider as PaperProvider,Portal as PaperPortal} from "react-native-paper";
11
+ import {PortalProvider } from '$ecomponents/Portal';
10
12
  import {defaultStr} from "$cutils";
11
13
  import styles, {
12
14
  _solidBackground,
@@ -127,20 +129,26 @@ const SplashScreenComponent = ({isLoaded,children , duration, delay,logoWidth,lo
127
129
  />
128
130
  )}
129
131
  {!animationDone && (
130
- <View testID={testID+"_LogoContainer"} style={[StyleSheet.absoluteFill, styles.logoStyle]}>
131
- {(
132
- <Animated.View
133
- testID={testID+"_Logo"}
134
- style={_dynamicCustomComponentStyle(
135
- logoScale,
136
- logoOpacity,
137
- logoWidth,
138
- logoHeight
139
- )}>
140
- {<LogoProgress/>}
141
- </Animated.View>
142
- )}
143
- </View>
132
+ <PortalProvider>
133
+ <PaperProvider>
134
+ <PaperPortal.Host>
135
+ <View testID={testID+"_LogoContainer"} style={[StyleSheet.absoluteFill, styles.logoStyle]}>
136
+ {(
137
+ <Animated.View
138
+ testID={testID+"_Logo"}
139
+ style={_dynamicCustomComponentStyle(
140
+ logoScale,
141
+ logoOpacity,
142
+ logoWidth,
143
+ logoHeight
144
+ )}>
145
+ {<LogoProgress/>}
146
+ </Animated.View>
147
+ )}
148
+ </View>
149
+ </PaperPortal.Host>
150
+ </PaperProvider>
151
+ </PortalProvider>
144
152
  )}
145
153
  </View>
146
154
  </View>
package/src/index.js CHANGED
@@ -27,7 +27,7 @@ import SimpleSelect from '$ecomponents/SimpleSelect';
27
27
  import {Provider as AlertProvider} from '$ecomponents/Dialog/confirm/Alert';
28
28
  import { DialogProvider as FormDataDialogProvider } from '$eform/FormData';
29
29
  import {Portal } from 'react-native-paper';
30
- import {PortalProvider,PortalHost } from '$ecomponents/Portal';
30
+ import {PortalProvider} from '$ecomponents/Portal';
31
31
  import ErrorBoundaryProvider from "$ecomponents/ErrorBoundary/Provider";
32
32
  import notify, {notificationRef} from "$notify";
33
33
  import DropdownAlert from '$ecomponents/Dialog/DropdownAlert';
@@ -55,7 +55,7 @@ const NAVIGATION_PERSISTENCE_KEY = 'NAVIGATION_STATE';
55
55
  * initialRouteName : la route initiale par défaut
56
56
  * getStartedRouteName : la route par défaut de getStarted lorsque l'application est en mode getStarted, c'est à dire lorsque la fonction init renvoie une erreur (reject)
57
57
  */
58
- function App({init:initApp,initialRouteName:appInitialRouteName,render,preferences:appPreferences,getStartedRouteName}) {
58
+ function App({init:initApp,initialRouteName:appInitialRouteName,render,onMount,preferences:appPreferences,getStartedRouteName}) {
59
59
  AppStateService.init();
60
60
  const [initialState, setInitialState] = React.useState(undefined);
61
61
  const appReadyRef = React.useRef(true);
@@ -240,6 +240,15 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render,preferenc
240
240
  ...defaultObj(pref),
241
241
  }),[theme,pref]);
242
242
  const isLoaded = !isLoading;
243
+ const prevIsLoaded = React.usePrevious(isLoaded);
244
+ const onMountRef = React.useRef(false);
245
+ React.useEffect(()=>{
246
+ if(prevIsLoaded == isLoaded || !isLoaded || onMountRef.current) return;
247
+ if(typeof onMount ==='function'){
248
+ onMount({appConfig});
249
+ onMountRef.current = true;
250
+ }
251
+ },[isLoaded])
243
252
  const child = isLoaded ? <NavigationContainer
244
253
  ref={navigationRef}
245
254
  initialState={initialState}
@@ -54,8 +54,8 @@ const styles = StyleSheet.create({
54
54
  paddingLeft : 20,
55
55
  },
56
56
  checkbox : {
57
- //width : 20,
58
- //height : 20,
57
+ width : 20,
58
+ height : 20,
59
59
  margin : 0,
60
60
  padding: 0,
61
61
  }