@fto-consult/expo-ui 1.5.1 → 1.5.3
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
CHANGED
|
@@ -84,18 +84,21 @@ module.exports = (opts)=>{
|
|
|
84
84
|
|
|
85
85
|
const HelpScreen = path.resolve(r["$escreens"],"Help");
|
|
86
86
|
/*** alias des termsOfUses */
|
|
87
|
+
r.$eTermsOfUses = path.resolve(HelpScreen,"TermsOfUses","content");
|
|
87
88
|
if(!r.$TermsOfUses){
|
|
88
|
-
r.$TermsOfUses =
|
|
89
|
+
r.$TermsOfUses = r.$eTermsOfUses;
|
|
89
90
|
}
|
|
90
91
|
/*** alias des privacyPolicy */
|
|
92
|
+
r.$ePrivacyPolicy = path.resolve(HelpScreen,"PrivacyPolicy","content");
|
|
91
93
|
if(!r.$PrivacyPolicy){
|
|
92
|
-
r.$PrivacyPolicy =
|
|
94
|
+
r.$PrivacyPolicy = r.$ePrivacyPolicy;
|
|
93
95
|
}
|
|
94
96
|
///on génère les librairies open sources utilisées par l'application
|
|
95
97
|
const root = path.resolve(r.$src,"..");
|
|
96
98
|
const outputPath = path.resolve(HelpScreen,"openLibraries.js");
|
|
97
99
|
require("./find-licenses")({
|
|
98
100
|
paths : [root,r["$expo-ui-root-path"]],
|
|
101
|
+
nodeModulesPath : path.resolve(root,"node_modules"),
|
|
99
102
|
outputPath
|
|
100
103
|
});
|
|
101
104
|
return r;
|
package/find-licenses.js
CHANGED
|
@@ -13,11 +13,14 @@ function isValidUrl(str) {
|
|
|
13
13
|
return !!pattern.test(str);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const loopPackages = (packages,projectPath)=>{
|
|
16
|
+
const loopPackages = (packages,projectPath,nodeModulesPath)=>{
|
|
17
17
|
if(!isObj(packages)) return;
|
|
18
|
-
|
|
18
|
+
nodeModulesPath = typeof nodeModulesPath =='string' && nodeModulesPath ? nodeModulesPath : "";
|
|
19
|
+
const p = path.resolve(projectPath,"node_modules");
|
|
19
20
|
for(let i in packages){
|
|
20
|
-
|
|
21
|
+
const packageRootPath = fs.existsSync(path.resolve(p,i))? path.resolve(p,i) : nodeModulesPath && fs.existsSync(path.resolve(nodeModulesPath,i)) ? path.resolve(nodeModulesPath,i) : null;
|
|
22
|
+
if(!packageRootPath) continue;
|
|
23
|
+
const packagePath = path.resolve(packageRootPath,"package.json");
|
|
21
24
|
if(fs.existsSync(packagePath)){
|
|
22
25
|
try {
|
|
23
26
|
let package = require(packagePath);
|
|
@@ -44,14 +47,14 @@ const loopPackages = (packages,projectPath)=>{
|
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
|
|
47
|
-
const findLicences = (projectPath)=> {
|
|
50
|
+
const findLicences = (projectPath,nodeModulesPath)=> {
|
|
48
51
|
if(projectPath && typeof projectPath =='string' && fs.existsSync(projectPath)){
|
|
49
52
|
const packagePath = path.resolve(projectPath,"package.json");
|
|
50
53
|
if(fs.existsSync(packagePath)){
|
|
51
54
|
const packages = require(packagePath);
|
|
52
55
|
if(isObj(packages)){
|
|
53
|
-
loopPackages(packages.devDependencies,projectPath);
|
|
54
|
-
loopPackages(packages.dependencies,projectPath);
|
|
56
|
+
loopPackages(packages.devDependencies,projectPath,nodeModulesPath);
|
|
57
|
+
loopPackages(packages.dependencies,projectPath,nodeModulesPath);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
}
|
|
@@ -61,18 +64,18 @@ module.exports = (options)=>{
|
|
|
61
64
|
if(!options || typeof options !='object'){
|
|
62
65
|
options = {};
|
|
63
66
|
}
|
|
64
|
-
const {outputPath} = options;
|
|
67
|
+
const {outputPath,nodeModulesPath} = options;
|
|
65
68
|
const outputDir = outputPath && typeof outputPath =='string' && path.dirname(outputPath) || '';
|
|
66
69
|
if(outputDir && fs.existsSync(outputDir)){
|
|
67
70
|
openLibraries = {};
|
|
68
71
|
if(Array.isArray(options.paths)){
|
|
69
72
|
options.paths.map((p)=>{
|
|
70
73
|
if(p && typeof p =='string' && fs.existsSync(p)){
|
|
71
|
-
findLicences(p)
|
|
74
|
+
findLicences(p,nodeModulesPath)
|
|
72
75
|
}
|
|
73
76
|
})
|
|
74
77
|
} else {
|
|
75
|
-
findLicences(options.path)
|
|
78
|
+
findLicences(options.path,nodeModulesPath)
|
|
76
79
|
}
|
|
77
80
|
const s = Object.keys(openLibraries).sort((a,b)=>{
|
|
78
81
|
if (a.toLowerCase() < b.toLowerCase()) return -1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
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
|
"@expo/html-elements": "^0.2.0",
|
|
62
62
|
"@expo/metro-config": "^0.4.0",
|
|
63
63
|
"@expo/webpack-config": "^0.17.2",
|
|
64
|
-
"@fto-consult/common": "^1.
|
|
64
|
+
"@fto-consult/common": "^1.8.2",
|
|
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.2.0",
|
package/src/auth/Login.js
CHANGED
|
@@ -170,6 +170,18 @@ export default function LoginComponent(props){
|
|
|
170
170
|
setState({...state,step:step+1,data})
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
+
const loginFields = {};
|
|
174
|
+
let hasLoginFields = false;
|
|
175
|
+
Object.map(loginProps.fields,(field,i)=>{
|
|
176
|
+
if(isObj(field)){
|
|
177
|
+
if(typeof field.step ==='number' && field.step !== state.step){}
|
|
178
|
+
else {
|
|
179
|
+
loginFields[i] = Object.clone(field);
|
|
180
|
+
hasLoginFields = true;
|
|
181
|
+
loginFields[i].autoFocus = !!loginFields[i].autoFocusOnStep;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
173
185
|
const withScrollView = typeof customWithScrollView =='boolean'? customWithScrollView : true;
|
|
174
186
|
const Wrapper = withPortal ? ScreenWithoutAuthContainer : withScrollView ? ScrollView: View;
|
|
175
187
|
const wrapperProps = withPortal ? {appBarProps,authRequired:false,title:loginTitle,withScrollView} : { style:styles.wrapper};
|
|
@@ -192,6 +204,7 @@ export default function LoginComponent(props){
|
|
|
192
204
|
</View>}
|
|
193
205
|
responsive = {false}
|
|
194
206
|
{...loginProps}
|
|
207
|
+
fields = {loginFields}
|
|
195
208
|
formProps = {{
|
|
196
209
|
keyboardEvents : {
|
|
197
210
|
...defaultObj(keyboardEvents),
|
|
@@ -204,7 +217,7 @@ export default function LoginComponent(props){
|
|
|
204
217
|
>
|
|
205
218
|
<>
|
|
206
219
|
{React.isValidElement(contentTop)? contentTop : null}
|
|
207
|
-
{
|
|
220
|
+
{hasLoginFields?<View testID={testID+"_ButtonsContainer"} style={[styles.buttonWrapper]}>
|
|
208
221
|
<Button
|
|
209
222
|
ref = {nextButtonRef}
|
|
210
223
|
primary
|
|
@@ -74,7 +74,7 @@ export default function HelpScreen(props){
|
|
|
74
74
|
{deviceInfo}
|
|
75
75
|
</View>
|
|
76
76
|
<View testID={testID}>
|
|
77
|
-
<Label testID={testID+"_CopyRight"} style={theme.styles.
|
|
77
|
+
<Label testID={testID+"_CopyRight"} style={theme.styles.pv05}>{appConfig.copyright}</Label>
|
|
78
78
|
{appConfig.devMail? <AutoLink testID={testID+"_Email"} style={[theme.styles.row]}
|
|
79
79
|
email = {appConfig.devMail}
|
|
80
80
|
>
|
|
@@ -6,8 +6,8 @@ import Label from "$components/Label";
|
|
|
6
6
|
|
|
7
7
|
export default function ContentPrivacy (){
|
|
8
8
|
return <Label primary style={{fontSize:15,fontWeight:'bold',padding:10}}>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
Pour modifier le contenu de la police de sécurité, il suffit de déclarer dans les alias, l'alias
|
|
10
|
+
$PrivacyPolicy prointant vers un fichier javascript dans lequel on exporte par défaut, soit un composant React
|
|
11
|
+
où encore un élément react valide dont le rendu remplacera ledit contenu.
|
|
12
|
+
</Label>
|
|
13
13
|
}
|
|
@@ -6,8 +6,8 @@ import Label from "$components/Label";
|
|
|
6
6
|
|
|
7
7
|
export default function ContentTermsOfUses (){
|
|
8
8
|
return <Label primary style={{fontSize:15,fontWeight:'bold',padding:10}}>
|
|
9
|
-
Pour
|
|
10
|
-
$TermsOfUses prointant
|
|
11
|
-
où encore un élément react valide
|
|
9
|
+
Pour modifier le contenu des Termes et contrat d'utilisation, il suffit de déclarer dans les alias, l'alias
|
|
10
|
+
$TermsOfUses prointant vers un fichier javascript dans lequel on exporte par défaut, soit un composant React
|
|
11
|
+
où encore un élément react valide dont le rendu remplacera ledit contenu.
|
|
12
12
|
</Label>
|
|
13
13
|
}
|