@fto-consult/expo-ui 6.12.0 → 6.13.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/.env.readMe.txt CHANGED
@@ -6,3 +6,6 @@ pour que ce soit possible, la variable TABLES_DATA_PATH doit exister et doit poi
6
6
  TABLES_DATAS_PATH = //path, chemin vers le dossier des tables de données de l'application
7
7
 
8
8
 
9
+ STRUCTS_DATA_PATH = //path, chemin vers le dossiers des structs data des données de l'application
10
+
11
+
package/appConfig.txt CHANGED
@@ -19,6 +19,9 @@
19
19
  getTableData : {function(tableName)=>table} retourne l'ojet table data,
20
20
  handleHelpScreen : {boolean}, //if Help screen will be added on navigation's main drawer
21
21
 
22
+ tablesDataPath : {string}, //chemin relatif pointant sur le dossier parent aux tables data de l'application
23
+ structsDataPath : {string},//chemin relatif pointnat sur le dossier parent aux structs data de l'application
24
+
22
25
  checkNavigationPermsOnTableOrStructData : {boolean}, si le test de la permission sur la table data où sur la struct data sera effectuée lorsqu'on appelera la fonction navigateToTableData ou navigateToStructData
23
26
  }
24
27
 
package/babel.config.js CHANGED
@@ -33,40 +33,20 @@ module.exports = function(api,opts) {
33
33
  if(fs.existsSync(writeFilePath)){
34
34
  const writeFile = require(`${writeFilePath}`);
35
35
  //generate getTable.js file
36
- const generateGetTable = String(envObj.GENERATE_GET_TABLE_JS_FILE ).trim().toLowerCase();
37
- const willGenerateGetTableJs = generateGetTable === "false" || generateGetTable ==="0" ? false : true;
38
36
  const tableDataPath = envObj.TABLES_DATA_PATH && path.resolve(String(envObj.TABLES_DATA_PATH)) || packageJSON?.tablesDataPath && path.resolve(String(packageJSON.tablesDataPath)) || null;
39
- if(willGenerateGetTableJs && tableDataPath && fs.existsSync(tableDataPath)){
40
- if(fs.lstatSync(tableDataPath).isDirectory()){
41
- const getTableJsPath = path.resolve(tableDataPath,"getTable.js");
42
- let getTableJSContent = '';
43
- const tables = fs.readdirSync(tableDataPath);
44
- if(Array.isArray(tables)){
45
- tables.map((table,i)=>{
46
- table = table.trim();
47
- const tableName = table.toUpperCase();
48
- const tablePath = path.join(tableDataPath, table);
49
- const indexTablePath = path.join(tablePath,"index.js");
50
- const stat = fs.lstatSync(tablePath);
51
- if(!stat.isDirectory() || !fs.existsSync(indexTablePath)) return;
52
- const indexContent = fs.readFileSync(indexTablePath,'utf8') ;
53
- if(!indexContent || (!indexContent.includes("table") && !indexContent.includes("tableName"))){
54
- return;
55
- }
56
- getTableJSContent+=`\tif(tableName === "${tableName}"){return require("./${table}").default;}\n`;
57
- });
58
- //on génère le fichier getTable des tables data de l'application
59
- if(getTableJSContent){
60
- writeFile(getTableJsPath,`
61
- module.exports = function(tableName){
62
- \tif(!tableName || typeof tableName !=="string") return null;
63
- \ttableName = tableName.toUpperCase().trim();
64
- ${getTableJSContent}
65
- \treturn null;
66
- }
67
- `);
68
- }
69
- }
37
+ if(tableDataPath && fs.existsSync(tableDataPath)){
38
+ const getTableJSContent = generateTableOrStructDataStr(tableDataPath);
39
+ if(getTableJSContent){
40
+ writeFile(path.resolve(tableDataPath,"getTable.js"),getTableJSContent);
41
+ }
42
+ }
43
+
44
+ //generate getStructData.js file
45
+ const structsDataPath = envObj.STRUCTS_DATA_PATH && path.resolve(String(envObj.STRUCTS_DATA_PATH)) || packageJSON?.structsDataPath && path.resolve(String(packageJSON.structsDataPath)) || null;
46
+ if(structsDataPath && fs.existsSync(structsDataPath)){
47
+ const getStructDataJSContent = generateTableOrStructDataStr(structsDataPath);
48
+ if(getStructDataJSContent){
49
+ writeFile(path.resolve(structsDataPath,"getStructData.js"),getStructDataJSContent);
70
50
  }
71
51
  }
72
52
 
@@ -111,3 +91,45 @@ module.exports = function(api,opts) {
111
91
  ],
112
92
  };
113
93
  };
94
+
95
+
96
+ /****
97
+ retourne la chaine de caractère liée à la fonction getTable.js ou getStructData.js
98
+ @param {string} tableDataPath, le chemin de la tableDataPath
99
+ @return {string}, la chaine de caractère à enregistrer dans la fonction getTable.js ou getStructData.js
100
+ */
101
+ const generateTableOrStructDataStr = (tableDataPath)=>{
102
+ if(typeof tableDataPath !== 'string' || !tableDataPath.trim()) return null;
103
+ tableDataPath = tableDataPath.trim();
104
+ const fs = require("fs"), path = require("path");
105
+ if(fs.lstatSync(tableDataPath).isDirectory()){
106
+ let getTableJSContent = '';
107
+ const tables = fs.readdirSync(tableDataPath);
108
+ if(Array.isArray(tables)){
109
+ tables.map((table,i)=>{
110
+ table = table.trim();
111
+ const tableName = table.toUpperCase();
112
+ const tablePath = path.join(tableDataPath, table);
113
+ const indexTablePath = path.join(tablePath,"index.js");
114
+ const stat = fs.lstatSync(tablePath);
115
+ if(!stat.isDirectory() || !fs.existsSync(indexTablePath)) return;
116
+ const indexContent = fs.readFileSync(indexTablePath,'utf8') ;
117
+ if(!indexContent || (!indexContent.includes("table") && !indexContent.includes("tableName"))){
118
+ return;
119
+ }
120
+ getTableJSContent+=`\t\tif(tableName === "${tableName}"){return require("./${table}").default;}\n`;
121
+ });
122
+ //on génère le fichier getTable des tables data de l'application
123
+ if(getTableJSContent){
124
+ return (`
125
+ module.exports = function(tableName){
126
+ \tif(!tableName || typeof tableName !=="string") return null;
127
+ \ttableName = tableName.toUpperCase().trim();
128
+ \t${getTableJSContent}\treturn null;
129
+ }
130
+ `);
131
+ }
132
+ }
133
+ }
134
+ return null;
135
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.12.0",
3
+ "version": "6.13.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -72,7 +72,7 @@
72
72
  "@react-navigation/native": "^6.1.7",
73
73
  "@react-navigation/native-stack": "^6.9.13",
74
74
  "@shopify/flash-list": "1.4.3",
75
- "apexcharts": "^3.41.0",
75
+ "apexcharts": "^3.41.1",
76
76
  "expo": "^49.0.6",
77
77
  "expo-camera": "~13.4.2",
78
78
  "expo-clipboard": "~4.3.0",
@@ -95,7 +95,7 @@
95
95
  "react-native": "0.72.3",
96
96
  "react-native-big-list": "^1.6.1",
97
97
  "react-native-blob-util": "^0.18.6",
98
- "react-native-gesture-handler": "^2.12.0",
98
+ "react-native-gesture-handler": "^2.12.1",
99
99
  "react-native-iphone-x-helper": "^1.3.1",
100
100
  "react-native-mime-types": "^2.4.0",
101
101
  "react-native-paper": "^5.9.1",
@@ -32,7 +32,7 @@ const DrawerNavigator = React.forwardRef(({content,children:customChildren,state
32
32
  refreshItemsRef.current = false;
33
33
  };
34
34
  const onResizePage = ()=>{
35
- forceRender();
35
+ //forceRender();
36
36
  }
37
37
  APP.on(APP.EVENTS.AUTH_LOGOUT_USER,onLogoutUser);
38
38
  const bindResize = Dimensions.addEventListener("change",()=>{