@fto-consult/expo-ui 4.2.1 → 4.3.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.
- package/babel.config.alias.js +1 -1
- package/bin/init.js +6 -0
- package/electron/dependencies.js +2 -1
- package/electron/{package.json → package.app.json} +12 -1
- package/index.js +5 -25
- package/package.json +2 -2
- package/src/App.js +2 -5
- package/src/components/Countries/Flag.js +6 -6
- package/src/navigation/utils.js +3 -0
package/babel.config.alias.js
CHANGED
|
@@ -140,7 +140,7 @@ module.exports = (opts)=>{
|
|
|
140
140
|
}
|
|
141
141
|
const jsonPath = path.resolve(base,'package.json');
|
|
142
142
|
if(fs.existsSync(jsonPath)){
|
|
143
|
-
require("./electron/utils/copy")(jsonPath,path.resolve(dir,"electron","package.json"));
|
|
143
|
+
require("./electron/utils/copy")(jsonPath,path.resolve(dir,"electron","package.app.json"));
|
|
144
144
|
}
|
|
145
145
|
///on sauvegarde les chemins des fichiers utiles, qui seront utilisées par la variable electron plus tard
|
|
146
146
|
writeFile(path.resolve(dir,"electron","paths.json"),JSON.stringify(electronPaths));
|
package/bin/init.js
CHANGED
|
@@ -7,6 +7,7 @@ const writeFile = require("../electron/utils/writeFile");
|
|
|
7
7
|
const copy = require("../electron/utils/copy");
|
|
8
8
|
const electronDir = path.resolve(__dirname,"..","electron");
|
|
9
9
|
const createIndexFile = require("../electron/create-index-file");
|
|
10
|
+
const appSuffix = " Desktop";
|
|
10
11
|
|
|
11
12
|
module.exports = ({
|
|
12
13
|
projectRoot,
|
|
@@ -30,6 +31,11 @@ module.exports = ({
|
|
|
30
31
|
"package" : "npx expo-ui electron package",
|
|
31
32
|
"compile2package" : "npx expo-ui electron package compile"
|
|
32
33
|
}
|
|
34
|
+
projectRootPackage.realAppName = typeof projectRootPackage.realAppName =="string" && projectRootPackage.realAppName || projectRootPackage.name;
|
|
35
|
+
projectRootPackage.name = projectRootPackage.name.trim();
|
|
36
|
+
if(!projectRootPackage.name.endsWith(appSuffix)){
|
|
37
|
+
projectRootPackage.name +=appSuffix;
|
|
38
|
+
}
|
|
33
39
|
writeFile(electronProjectRootPackage,JSON.stringify(projectRootPackage,null,'\t'));
|
|
34
40
|
if(!fs.existsSync(electronProjectRootPackage)){
|
|
35
41
|
throw `unable to create ${electronProjectRootPackage} file`;
|
package/electron/dependencies.js
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"description": "Accès distant aux données commerciales et comptables Sage100C de partout",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"devMail": "sage-ftc@fto-consulting.com",
|
|
7
|
+
"devWebsite": "http://fto-consulting.com/sage-ftc/",
|
|
8
|
+
"copyRight": "FTO consulting@Août 2022",
|
|
9
|
+
"id": "com.ftc.apps.sage.ftc",
|
|
10
|
+
"theme": {
|
|
11
|
+
"ligth": {
|
|
12
|
+
"primary": "#3D8B5F",
|
|
13
|
+
"secondary": "#354448"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"convertDatagridFiltersToSQL": true,
|
|
6
17
|
"scripts": {
|
|
7
18
|
"test": "test",
|
|
8
19
|
"start": "npx expo start",
|
|
@@ -37,7 +48,7 @@
|
|
|
37
48
|
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
|
|
38
49
|
"@babel/preset-react": "^7.18.6",
|
|
39
50
|
"@expo/metro-config": "^0.5.2",
|
|
40
|
-
"@expo/webpack-config": "^0.17.
|
|
51
|
+
"@expo/webpack-config": "^0.17.4",
|
|
41
52
|
"babel-plugin-inline-dotenv": "^1.7.0",
|
|
42
53
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
43
54
|
"babel-plugin-transform-inline-environment-variables": "^0.4.4"
|
package/index.js
CHANGED
|
@@ -1,36 +1,16 @@
|
|
|
1
1
|
import { registerRootComponent } from "expo";
|
|
2
2
|
import {Platform } from 'react-native';
|
|
3
|
-
import { createRoot } from 'react-dom/client';
|
|
4
|
-
import appConfig from "$capp/config";
|
|
5
3
|
import { activateKeepAwake } from 'expo-keep-awake';
|
|
6
|
-
|
|
4
|
+
import App from "./src/App";
|
|
7
5
|
if (__DEV__) {
|
|
8
6
|
activateKeepAwake();
|
|
9
7
|
}
|
|
10
8
|
const isWeb = Platform.OS === "web";
|
|
11
|
-
|
|
12
|
-
* les options sont de la forme :
|
|
13
|
-
* {
|
|
14
|
-
* config {object}, le fichier de configuration de l'application
|
|
15
|
-
* }
|
|
16
|
-
*/
|
|
17
|
-
export default function ExpoUIApp (options){
|
|
9
|
+
export default function registerApp (options){
|
|
18
10
|
options = options && typeof options =='object' && !Array.isArray(options)? options : {};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
initConfig({appConfig,config:appConfig});
|
|
23
|
-
}
|
|
24
|
-
const App = require('./src/App').default(opts);
|
|
25
|
-
if (false) {
|
|
26
|
-
const root = createRoot(document.getElementById("root") || document.getElementById("main"));
|
|
27
|
-
} else {
|
|
28
|
-
registerRootComponent(App);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if(__DEV__ && !isWeb){
|
|
33
|
-
//startNetworkLogging();
|
|
11
|
+
registerRootComponent(function(props){
|
|
12
|
+
return <App {...props} {...options}/>
|
|
13
|
+
});
|
|
34
14
|
}
|
|
35
15
|
|
|
36
16
|
///fix bug lié au fait que l'application stuck on splashscreen en environnement mobile
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.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.10.0",
|
|
62
62
|
"@expo/html-elements": "^0.2.0",
|
|
63
63
|
"@expo/vector-icons": "^13.0.0",
|
|
64
|
-
"@fto-consult/common": "^2.
|
|
64
|
+
"@fto-consult/common": "^2.20.12",
|
|
65
65
|
"@gorhom/portal": "^1.0.14",
|
|
66
66
|
"@react-native-async-storage/async-storage": "~1.17.3",
|
|
67
67
|
"@react-native-community/datetimepicker": "6.5.2",
|
package/src/App.js
CHANGED
|
@@ -40,10 +40,8 @@ Object.map(Utils,(v,i)=>{
|
|
|
40
40
|
window[i] = v;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
export default function getIndex(
|
|
44
|
-
const
|
|
45
|
-
return function MainIndexComponent() {
|
|
46
|
-
const isScreenFocusedRef = React.useRef(true);
|
|
43
|
+
export default function getIndex({App,onMount,onUnmount,preferences:appPreferences}){
|
|
44
|
+
const isScreenFocusedRef = React.useRef(true);
|
|
47
45
|
///garde pour chaque écran sa date de dernière activité
|
|
48
46
|
const screensRef = React.useRef({});//la liste des écrans actifs
|
|
49
47
|
const activeScreenRef = React.useRef('');
|
|
@@ -202,7 +200,6 @@ export default function getIndex(options){
|
|
|
202
200
|
</GestureHandlerRootView>
|
|
203
201
|
</SWRConfig>
|
|
204
202
|
);
|
|
205
|
-
}
|
|
206
203
|
};
|
|
207
204
|
|
|
208
205
|
setDeviceIdRef.current = ()=>{
|
|
@@ -6,26 +6,26 @@ import View from "$ecomponents/View"
|
|
|
6
6
|
import theme from "$theme";
|
|
7
7
|
import Label from "$components/Label";
|
|
8
8
|
|
|
9
|
-
export default function CountryFlagComponent({code,label,withName,withCode,text,containerProps,labelProps,withLabel,
|
|
9
|
+
export default function CountryFlagComponent({code,label,withName,withCode,text,containerProps,labelProps,withLabel,testID,...props}){
|
|
10
10
|
if(!isNonNullString(code)) return null;
|
|
11
11
|
const country = getCountry(code);
|
|
12
|
-
|
|
13
|
-
if(!country) return <Label
|
|
12
|
+
testID = defaultStr(testID,"RN_CountryFlagComponent");
|
|
13
|
+
if(!country) return <Label testID={testID+"_NotFoundCode"}>{code}</Label>;
|
|
14
14
|
//console.log(country," is county");
|
|
15
15
|
containerProps = Object.assign({},containerProps);
|
|
16
16
|
labelProps = Object.assign({},labelProps);
|
|
17
|
-
return <View {...containerProps} testID={
|
|
17
|
+
return <View {...containerProps} testID={testID} style={[theme.styles.row,containerProps.style]}>
|
|
18
18
|
{(isNonNullString(country.image) || isNumber(country.image)) ?
|
|
19
19
|
<Image
|
|
20
20
|
accessibilityIgnoresInvertColors
|
|
21
|
-
|
|
21
|
+
testID ={testID+"Image"}
|
|
22
22
|
editable = {false}
|
|
23
23
|
{...props}
|
|
24
24
|
size = {25}
|
|
25
25
|
style={[props.style]}
|
|
26
26
|
src={country.image}
|
|
27
27
|
/> : null}
|
|
28
|
-
{<Label
|
|
28
|
+
{<Label testID={testID+"_Label"} {...labelProps} style={[labelProps.style,{marginLeft:5}]}>
|
|
29
29
|
{withName || withLabel ? country.name : withCode ? country.code.toUpperCase() : null}
|
|
30
30
|
</Label>}
|
|
31
31
|
</View>
|
package/src/navigation/utils.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// license that can be found in the LICENSE file.
|
|
4
4
|
import {navigate,sanitizeName} from "$cnavigation";
|
|
5
5
|
import {isNonNullString,defaultStr,defaultObj,isObj} from "$utils";
|
|
6
|
+
|
|
7
|
+
|
|
6
8
|
export const tableDataRouteName = 'TableData';
|
|
7
9
|
|
|
8
10
|
export const navigateToTableData = function(tableName,params,actionType){
|
|
@@ -69,3 +71,4 @@ export const navigateToTableDataList = function (tableName,params){
|
|
|
69
71
|
return false;
|
|
70
72
|
}
|
|
71
73
|
|
|
74
|
+
export * from "$cnavigation";
|