@fto-consult/expo-ui 6.64.10 → 6.64.12
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/bin/create-app/App.js
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
import ExpoUIProvider from "$expo-ui";
|
2
|
-
import screens from "
|
3
|
-
import drawerItems from "
|
4
|
-
import Logo from "
|
5
|
-
import drawerSections from "
|
2
|
+
import screens from "$screens";
|
3
|
+
import drawerItems from "$navigation/drawerItems";
|
4
|
+
import Logo from "$components/Logo";
|
5
|
+
import drawerSections from "$navigation/drawerSections";
|
6
6
|
|
7
7
|
export default function AppMainEntry(){
|
8
8
|
return <ExpoUIProvider
|
9
9
|
navigation = { {
|
10
|
-
|
10
|
+
/*{object}, les props à passer au composant NavigationContainer de react-navigation
|
11
|
+
@see : https://reactnavigation.org/docs/navigation-container/
|
12
|
+
*/
|
13
|
+
containerProps : {},
|
14
|
+
/*** L'ensemble des écrans de l'application */
|
11
15
|
screens,
|
16
|
+
/** {object}, les options du composant Stack.Navigator, voir https://reactnavigation.org/docs/native-stack-navigator */
|
17
|
+
screenOptions : {},
|
12
18
|
drawerItems, //application main drawer items,
|
13
19
|
drawerSections,
|
14
20
|
/***** mutate drawerItems before rendering
|
@@ -18,12 +24,19 @@ export default function AppMainEntry(){
|
|
18
24
|
drawerItemsMutator : (drawerItems)=>{
|
19
25
|
return drawerItems;
|
20
26
|
},
|
27
|
+
datagrid : {
|
28
|
+
///les props par défaut à passer au composant SWRDatagrid
|
29
|
+
},
|
21
30
|
screenOptions : {},//les options du composant Stack.Navigator de react-navigation, voir https://reactnavigation.org/docs/native-stack-navigator/
|
22
31
|
}}
|
23
32
|
components = {{
|
33
|
+
/*** logo : ReactNode|ReactElement | ReactComponent | object {
|
34
|
+
image{ReactComponent} :,text {ReactComponent}
|
35
|
+
},*/
|
24
36
|
logo : Logo,//logo component's properties
|
25
|
-
loginPropsMutator : {},//
|
37
|
+
loginPropsMutator : {},//({object})=><{object}>, la fonction permettant de muter les props du composant Login,
|
26
38
|
authEnabled : true,//si le module d'authentification sera requis
|
39
|
+
customFormFields : {},//custom form fields
|
27
40
|
}}
|
28
41
|
/*** //for application initialization
|
29
42
|
@param {
|
@@ -38,5 +51,9 @@ export default function AppMainEntry(){
|
|
38
51
|
render = {function({render,appConfig}){
|
39
52
|
return render;
|
40
53
|
}}
|
54
|
+
///fonction de rappel appelée avant d'exit l'application, doit retourner une promesse que lorsque résolue, exit l'application
|
55
|
+
beforeExit = {()=>Promise.resolve(true)}
|
56
|
+
|
57
|
+
handleHelpScreen ={true} //si l'écran d'aide sera pris en compte, l'écran d'aide ainsi que les écrans des termes d'utilisations et autres
|
41
58
|
/>
|
42
59
|
}
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import Screen from "$eScreen";
|
2
2
|
import Label from "$ecomponents/Label";
|
3
|
-
import { StyleSheet } from "react-native
|
3
|
+
import { StyleSheet } from "react-native";
|
4
|
+
import appConfig from "$capp/config";
|
5
|
+
|
4
6
|
export default function HomeScreen(props){
|
5
7
|
return <Screen {...props} style={[styles.container,props.style]}>
|
6
|
-
<Label style={[styles.label]}>Hello world
|
8
|
+
<Label primary style={[styles.label]}>Hello world! {appConfig.name}, version {appConfig.version}</Label>
|
7
9
|
</Screen>
|
8
10
|
}
|
9
11
|
|
package/bin/create-app.js
CHANGED
@@ -103,7 +103,12 @@ const createEntryFile = (projectRoot)=>{
|
|
103
103
|
const createAPPJSONFile = (projectRoot,{name,version})=>{
|
104
104
|
version = version ||"1.0.0";
|
105
105
|
copy(path.join(getAppDir(),"assets"),path.resolve(projectRoot,"assets"),{overwrite:false}).catch((e)=>{});
|
106
|
-
|
106
|
+
const gP = path.resolve(projectRoot,".gitignore"), gSpath = fs.existsSync(path.join(getAppDir(),".gitignore")) ;
|
107
|
+
if(fs.existsSync(gSpath) && !fs.existsSync(gP)){
|
108
|
+
try {
|
109
|
+
writeFile(gP,fs.readFileSync(gSpath));
|
110
|
+
} catch{};
|
111
|
+
}
|
107
112
|
const appJSONPath = path.join(projectRoot,"app.json");
|
108
113
|
if(!fs.existsSync(appJSONPath)){
|
109
114
|
writeFile(appJSONPath,`
|