@fto-consult/expo-ui 3.3.1 → 3.3.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 +5 -2
- package/bin/index.js +99 -99
- package/metro.config.js +1 -1
- package/package.json +2 -2
- package/src/auth/Login.js +22 -8
- package/src/components/Countries/resources/countries-normalized.json +1987 -1987
- package/src/components/Countries/resources/countries-with-not-extra.json +1211 -1211
- package/src/components/Countries/resources/countries.sql +243 -243
- package/src/layouts/Screen/TableData.js +1 -0
- package/electron/dist/asset-manifest.json +0 -221
- package/electron/dist/favicon-16.png +0 -0
- package/electron/dist/favicon-32.png +0 -0
- package/electron/dist/favicon.ico +0 -0
- package/electron/dist/fonts/AntDesign.ttf +0 -0
- package/electron/dist/fonts/FontAwesome5_Brands.ttf +0 -0
- package/electron/dist/fonts/FontAwesome5_Solid.ttf +0 -0
- package/electron/dist/fonts/Fontisto.ttf +0 -0
- package/electron/dist/fonts/Foundation.ttf +0 -0
- package/electron/dist/fonts/Ionicons.ttf +0 -0
- package/electron/dist/fonts/MaterialCommunityIcons.ttf +0 -0
- package/electron/dist/fonts/MaterialIcons.ttf +0 -0
- package/electron/dist/fonts/SimpleLineIcons.ttf +0 -0
- package/electron/dist/index.html +0 -1
- package/electron/dist/manifest.json +0 -35
- package/electron/dist/pwa/apple-touch-icon/apple-touch-icon-180.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1125x2436.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1242x2208.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1242x2688.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1536x2048.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1668x2224.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-1668x2388.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-2048x2732.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-640x1136.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-750x1334.png +0 -0
- package/electron/dist/pwa/apple-touch-startup-image/apple-touch-startup-image-828x1792.png +0 -0
- package/electron/dist/pwa/chrome-icon/chrome-icon-144.png +0 -0
- package/electron/dist/pwa/chrome-icon/chrome-icon-192.png +0 -0
- package/electron/dist/pwa/chrome-icon/chrome-icon-512.png +0 -0
- package/electron/dist/serve.json +0 -13
- package/electron/dist/static/js/2.e3d2de23.chunk.js +0 -2
- package/electron/dist/static/js/2.e3d2de23.chunk.js.LICENSE.txt +0 -118
- package/electron/dist/static/js/app.6a0a3d72.chunk.js +0 -1
- package/electron/dist/static/js/runtime~app.318494c4.js +0 -1
- package/electron/dist/static/media/ad.897c877d.png +0 -0
- package/electron/dist/static/media/add_photo.255dd6dd.png +0 -0
- package/electron/dist/static/media/af.9d0ab233.png +0 -0
- package/electron/dist/static/media/ag.152f8fb1.png +0 -0
- package/electron/dist/static/media/ai.81342ed3.png +0 -0
- package/electron/dist/static/media/al.3ba17dc1.png +0 -0
- package/electron/dist/static/media/ao.ff6d0e82.png +0 -0
- package/electron/dist/static/media/ar.a157e7e8.png +0 -0
- package/electron/dist/static/media/as.af7d5792.png +0 -0
- package/electron/dist/static/media/au.d8b2590e.png +0 -0
- package/electron/dist/static/media/aw.27c4c0ae.png +0 -0
- package/electron/dist/static/media/ax.568ed280.png +0 -0
- package/electron/dist/static/media/az.bb76a7dc.png +0 -0
- package/electron/dist/static/media/ba.0e3d844b.png +0 -0
- package/electron/dist/static/media/bb.4466d275.png +0 -0
- package/electron/dist/static/media/bd.56c6c3f7.png +0 -0
- package/electron/dist/static/media/bf.fb7bf643.png +0 -0
- package/electron/dist/static/media/bi.82121bd1.png +0 -0
- package/electron/dist/static/media/bl.c4f6b8c1.png +0 -0
- package/electron/dist/static/media/black-gradient-rotated.693a1835.png +0 -0
- package/electron/dist/static/media/bm.2b05930c.png +0 -0
- package/electron/dist/static/media/bn.fa1d112b.png +0 -0
- package/electron/dist/static/media/br.0bdb59a4.png +0 -0
- package/electron/dist/static/media/bs.cf3fb4b9.png +0 -0
- package/electron/dist/static/media/bt.f7bc1b24.png +0 -0
- package/electron/dist/static/media/by.aa680616.png +0 -0
- package/electron/dist/static/media/bz.94f967a4.png +0 -0
- package/electron/dist/static/media/ca.83c317eb.png +0 -0
- package/electron/dist/static/media/cc.7adb7e83.png +0 -0
- package/electron/dist/static/media/cd.829a5467.png +0 -0
- package/electron/dist/static/media/cf.05804c68.png +0 -0
- package/electron/dist/static/media/cg.6142b05b.png +0 -0
- package/electron/dist/static/media/ck.e6517d3a.png +0 -0
- package/electron/dist/static/media/cl.fedf287b.png +0 -0
- package/electron/dist/static/media/cm.13460532.png +0 -0
- package/electron/dist/static/media/cn.cb27a726.png +0 -0
- package/electron/dist/static/media/color-wheel.233ad67a.png +0 -0
- package/electron/dist/static/media/cu.c87a4974.png +0 -0
- package/electron/dist/static/media/cv.df006f17.png +0 -0
- package/electron/dist/static/media/cw.5600a05a.png +0 -0
- package/electron/dist/static/media/cx.3a1ed4dd.png +0 -0
- package/electron/dist/static/media/cy.cf9ba1fd.png +0 -0
- package/electron/dist/static/media/cz.52a635d1.png +0 -0
- package/electron/dist/static/media/dj.97fab2d0.png +0 -0
- package/electron/dist/static/media/dm.cffeea69.png +0 -0
- package/electron/dist/static/media/do.4446e007.png +0 -0
- package/electron/dist/static/media/dz.2a4f02c8.png +0 -0
- package/electron/dist/static/media/ec.de3c8959.png +0 -0
- package/electron/dist/static/media/eg.995e438f.png +0 -0
- package/electron/dist/static/media/eh.df6ab877.png +0 -0
- package/electron/dist/static/media/er.c9c33d69.png +0 -0
- package/electron/dist/static/media/es.02bde626.png +0 -0
- package/electron/dist/static/media/et.97067753.png +0 -0
- package/electron/dist/static/media/fj.d9ffe455.png +0 -0
- package/electron/dist/static/media/fk.56b62350.png +0 -0
- package/electron/dist/static/media/fm.a7a0ab08.png +0 -0
- package/electron/dist/static/media/fo.8c98723b.png +0 -0
- package/electron/dist/static/media/gb.e2dc562c.png +0 -0
- package/electron/dist/static/media/gd.e018fcab.png +0 -0
- package/electron/dist/static/media/ge.a23ea813.png +0 -0
- package/electron/dist/static/media/gf.46575309.png +0 -0
- package/electron/dist/static/media/gg.b6dec865.png +0 -0
- package/electron/dist/static/media/gh.791206c9.png +0 -0
- package/electron/dist/static/media/gi.691dc59f.png +0 -0
- package/electron/dist/static/media/gp.9f13aec5.png +0 -0
- package/electron/dist/static/media/gq.ac167f44.png +0 -0
- package/electron/dist/static/media/gt.ac025893.png +0 -0
- package/electron/dist/static/media/gu.f6b1f79f.png +0 -0
- package/electron/dist/static/media/gw.c1155330.png +0 -0
- package/electron/dist/static/media/gy.8807a5cd.png +0 -0
- package/electron/dist/static/media/hk.ace33e25.png +0 -0
- package/electron/dist/static/media/hn.a9dbb8c7.png +0 -0
- package/electron/dist/static/media/hr.154eb536.png +0 -0
- package/electron/dist/static/media/ht.f2777c6f.png +0 -0
- package/electron/dist/static/media/il.1e46d4c0.png +0 -0
- package/electron/dist/static/media/im.0cd40434.png +0 -0
- package/electron/dist/static/media/in.7b42511c.png +0 -0
- package/electron/dist/static/media/io.a66fbed7.png +0 -0
- package/electron/dist/static/media/iq.95e38849.png +0 -0
- package/electron/dist/static/media/ir.63bb306b.png +0 -0
- package/electron/dist/static/media/je.9bb61268.png +0 -0
- package/electron/dist/static/media/jm.cb108953.png +0 -0
- package/electron/dist/static/media/jo.68d39a37.png +0 -0
- package/electron/dist/static/media/jp.c7ac0358.png +0 -0
- package/electron/dist/static/media/ke.43bc8ed5.png +0 -0
- package/electron/dist/static/media/kg.44ff839a.png +0 -0
- package/electron/dist/static/media/kh.f2be65a8.png +0 -0
- package/electron/dist/static/media/ki.a5251ff4.png +0 -0
- package/electron/dist/static/media/km.e3509f11.png +0 -0
- package/electron/dist/static/media/kn.2aa7e9f4.png +0 -0
- package/electron/dist/static/media/kp.bafa6d30.png +0 -0
- package/electron/dist/static/media/kr.eddab993.png +0 -0
- package/electron/dist/static/media/ks.482617ea.png +0 -0
- package/electron/dist/static/media/kw.c9acc015.png +0 -0
- package/electron/dist/static/media/ky.b28eed47.png +0 -0
- package/electron/dist/static/media/kz.705cf40b.png +0 -0
- package/electron/dist/static/media/la.eaa60883.png +0 -0
- package/electron/dist/static/media/lb.f12e48b3.png +0 -0
- package/electron/dist/static/media/lc.c3040f1b.png +0 -0
- package/electron/dist/static/media/li.9ff57114.png +0 -0
- package/electron/dist/static/media/lk.668fa761.png +0 -0
- package/electron/dist/static/media/lr.08a3ba29.png +0 -0
- package/electron/dist/static/media/ls.4bcf7705.png +0 -0
- package/electron/dist/static/media/ly.42eee630.png +0 -0
- package/electron/dist/static/media/ma.728f368e.png +0 -0
- package/electron/dist/static/media/md.c58d4da5.png +0 -0
- package/electron/dist/static/media/me.61434fc0.png +0 -0
- package/electron/dist/static/media/mh.84081090.png +0 -0
- package/electron/dist/static/media/mk.4c61eb33.png +0 -0
- package/electron/dist/static/media/mm.6d9513ec.png +0 -0
- package/electron/dist/static/media/mn.2919ee2b.png +0 -0
- package/electron/dist/static/media/mo.5097fc81.png +0 -0
- package/electron/dist/static/media/mp.92d6f5ae.png +0 -0
- package/electron/dist/static/media/mq.3dcb40dd.png +0 -0
- package/electron/dist/static/media/mr.49624c44.png +0 -0
- package/electron/dist/static/media/ms.6278c883.png +0 -0
- package/electron/dist/static/media/mt.6791f29d.png +0 -0
- package/electron/dist/static/media/mv.db8c2815.png +0 -0
- package/electron/dist/static/media/mw.bfe46c8a.png +0 -0
- package/electron/dist/static/media/mx.4143a6ea.png +0 -0
- package/electron/dist/static/media/my.3a9e0a16.png +0 -0
- package/electron/dist/static/media/mz.a9a7cad4.png +0 -0
- package/electron/dist/static/media/na.fb15ec16.png +0 -0
- package/electron/dist/static/media/nc.ca80861c.png +0 -0
- package/electron/dist/static/media/ne.66306a2b.png +0 -0
- package/electron/dist/static/media/nf.2087392a.png +0 -0
- package/electron/dist/static/media/ni.8a8af9c4.png +0 -0
- package/electron/dist/static/media/np.fcb697b2.png +0 -0
- package/electron/dist/static/media/nr.3df193fa.png +0 -0
- package/electron/dist/static/media/nu.36adcc05.png +0 -0
- package/electron/dist/static/media/nz.3f54cdbc.png +0 -0
- package/electron/dist/static/media/om.b705fe37.png +0 -0
- package/electron/dist/static/media/pa.c6eac52a.png +0 -0
- package/electron/dist/static/media/pf.fc525a54.png +0 -0
- package/electron/dist/static/media/pg.e74ec337.png +0 -0
- package/electron/dist/static/media/ph.07b69cb2.png +0 -0
- package/electron/dist/static/media/pk.2e6f6e4d.png +0 -0
- package/electron/dist/static/media/placeholder.b393bdf6.png +0 -0
- package/electron/dist/static/media/pm.a07b0fe5.png +0 -0
- package/electron/dist/static/media/pr.2a745d06.png +0 -0
- package/electron/dist/static/media/ps.dc835d4b.png +0 -0
- package/electron/dist/static/media/pt.1dac29ce.png +0 -0
- package/electron/dist/static/media/pw.39ee4879.png +0 -0
- package/electron/dist/static/media/py.79fe22b8.png +0 -0
- package/electron/dist/static/media/re.d61c1475.png +0 -0
- package/electron/dist/static/media/rs.98e0ba03.png +0 -0
- package/electron/dist/static/media/rw.a062e5ed.png +0 -0
- package/electron/dist/static/media/sa.d8b4fac4.png +0 -0
- package/electron/dist/static/media/sb.22cdaa99.png +0 -0
- package/electron/dist/static/media/sc.bfa8934e.png +0 -0
- package/electron/dist/static/media/sd.c17685b4.png +0 -0
- package/electron/dist/static/media/sg.d63e1e98.png +0 -0
- package/electron/dist/static/media/sh.3e4eba58.png +0 -0
- package/electron/dist/static/media/si.1aef990c.png +0 -0
- package/electron/dist/static/media/sk.744710e9.png +0 -0
- package/electron/dist/static/media/sm.2add86d0.png +0 -0
- package/electron/dist/static/media/sn.cd1d239a.png +0 -0
- package/electron/dist/static/media/so.59e58870.png +0 -0
- package/electron/dist/static/media/sr.4f2004a0.png +0 -0
- package/electron/dist/static/media/ss.4af3b81d.png +0 -0
- package/electron/dist/static/media/st.d51dc713.png +0 -0
- package/electron/dist/static/media/sv.7ae84ee8.png +0 -0
- package/electron/dist/static/media/sx.be650d49.png +0 -0
- package/electron/dist/static/media/sy.aff3aad3.png +0 -0
- package/electron/dist/static/media/sz.2d1d3b4d.png +0 -0
- package/electron/dist/static/media/tc.a260af55.png +0 -0
- package/electron/dist/static/media/tg.8f3da96a.png +0 -0
- package/electron/dist/static/media/tj.f75888d4.png +0 -0
- package/electron/dist/static/media/tk.565e8b1a.png +0 -0
- package/electron/dist/static/media/tl.e2a54e11.png +0 -0
- package/electron/dist/static/media/tm.c4300af4.png +0 -0
- package/electron/dist/static/media/tn.75753d15.png +0 -0
- package/electron/dist/static/media/tr.82e5dc1c.png +0 -0
- package/electron/dist/static/media/tt.987092e9.png +0 -0
- package/electron/dist/static/media/tv.9230640c.png +0 -0
- package/electron/dist/static/media/tw.c4a9d7d9.png +0 -0
- package/electron/dist/static/media/tz.1efa60a0.png +0 -0
- package/electron/dist/static/media/ug.a77c73ae.png +0 -0
- package/electron/dist/static/media/us.e2479214.png +0 -0
- package/electron/dist/static/media/uy.861eca98.png +0 -0
- package/electron/dist/static/media/uz.01ff6d78.png +0 -0
- package/electron/dist/static/media/va.27433401.png +0 -0
- package/electron/dist/static/media/vc.2cca122b.png +0 -0
- package/electron/dist/static/media/ve.af5a8b6b.png +0 -0
- package/electron/dist/static/media/vg.04a0bb4c.png +0 -0
- package/electron/dist/static/media/vi.23080fa1.png +0 -0
- package/electron/dist/static/media/vn.c4418522.png +0 -0
- package/electron/dist/static/media/vu.a9b9829b.png +0 -0
- package/electron/dist/static/media/wf.c9a34a89.png +0 -0
- package/electron/dist/static/media/ws.155d3921.png +0 -0
- package/electron/dist/static/media/za.45fc2a3d.png +0 -0
- package/electron/dist/static/media/zm.2a5e46b1.png +0 -0
- package/electron/dist/static/media/zw.44f54d41.png +0 -0
package/babel.config.alias.js
CHANGED
|
@@ -10,8 +10,11 @@ module.exports = (opts)=>{
|
|
|
10
10
|
opts.base = opts.base || base;
|
|
11
11
|
opts.withPouchDB = opts.withPouchDB !== false && opts.withPouchdb !== false ? true : false;
|
|
12
12
|
delete opts.withPouchdb;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const expoUI = require("./expo-ui-path")();
|
|
14
|
+
const euCommon = path.resolve(expoUI,"node_modules","@fto-consult","common");
|
|
15
|
+
const cpath = fs.existsSync(euCommon)? path.resolve(euCommon,"babel.config.alias") : "@fto-consult/common/babel.config.alias";
|
|
16
|
+
const r = require(`${cpath}`)(opts);
|
|
17
|
+
const expo = path.resolve(expoUI,"src");
|
|
15
18
|
r["$eauth"] = path.resolve(expo,"auth");
|
|
16
19
|
r["$ecomponents"] = r["$expo-components"] = path.resolve(expo,"components");
|
|
17
20
|
r["$etableLink"] = r["$eTableLink"] = path.resolve(r["$ecomponents"],"TableLink");
|
package/bin/index.js
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
//#!/usr/bin/env node
|
|
2
|
-
/**@see : https://blog.shahednasser.com/how-to-create-a-npx-tool/ */
|
|
3
|
-
'use strict';
|
|
4
|
-
process.on('unhandledRejection', err => {
|
|
5
|
-
throw err;
|
|
6
|
-
});
|
|
7
|
-
const supportedScript = {
|
|
8
|
-
"start" : true,//start electron
|
|
9
|
-
"build" : true, //script pour faire un build
|
|
10
|
-
}
|
|
11
|
-
const path= require("path");
|
|
12
|
-
const fs = require("fs");
|
|
13
|
-
const dir = path.resolve(__dirname);
|
|
14
|
-
const electronDir = path.resolve(dir, "..","electron");
|
|
15
|
-
const exec = require("../electron/exec");
|
|
16
|
-
const args = process.argv.slice(2);
|
|
17
|
-
let projectRoot = process.cwd();
|
|
18
|
-
const createDir = require("../electron/createDir");
|
|
19
|
-
const copyDir = require("../electron/copyDir");
|
|
20
|
-
const parsedArgs = require("./parseArgs")(args,supportedScript);
|
|
21
|
-
if(!parsedArgs.script || !(parsedArgs.script in supportedScript)){
|
|
22
|
-
console.error ("Erreur : script invalide, vous devez spécifier script figurant parmi les script : ["+Object.keys(supportedScript).join(", ")+"]");
|
|
23
|
-
process.exit();
|
|
24
|
-
}
|
|
25
|
-
const {script} = parsedArgs;
|
|
26
|
-
let cmd = null;
|
|
27
|
-
/****
|
|
28
|
-
* 1. installer electron globallement : npm i -g electron@latest
|
|
29
|
-
* cmde : [cmd] start electron config=[path-to-config-relative-to-project-dir]
|
|
30
|
-
* splash=[path-to-splashcreen-relative-to-project-root]
|
|
31
|
-
* output-dir|out = [path-to-output-dir-relative-to-root-project]
|
|
32
|
-
* */
|
|
33
|
-
if(parsedArgs.electron){
|
|
34
|
-
const pathsJSON = path.resolve(electronDir,"paths.json");
|
|
35
|
-
if(!fs.existsSync(pathsJSON)){
|
|
36
|
-
throw "Le fichier des chemins d'accès à l'application est innexistant, rassurez vous de tester l'application en environnement web, via la cmde <npx expo start>, avant l'exécution du script electron."
|
|
37
|
-
}
|
|
38
|
-
const paths = require(`${pathsJSON}`);
|
|
39
|
-
if(typeof paths !=='object' || !paths || !paths.projectRoot){
|
|
40
|
-
throw "Fichiers des chemins d'application invalide!!! merci d'exécuter l'application en environnement web|android|ios puis réessayez"
|
|
41
|
-
}
|
|
42
|
-
projectRoot = path.resolve(projectRoot);
|
|
43
|
-
const out = parsedArgs.out || parsedArgs["output-dir"];
|
|
44
|
-
const outDir = out && path.dirname(out) && path.resolve(projectRoot,path.dirname(out),"electron") || path.resolve(projectRoot,"dist","electron")
|
|
45
|
-
if(!createDir(outDir)){
|
|
46
|
-
throw "Impossible de créer le répertoire <<"+outDir+">> du fichier binaire!!";
|
|
47
|
-
}
|
|
48
|
-
const logoPath = paths.logo || paths.$assets && path.resolve(paths.$assets,"logo.png") || paths.$images && path.resolve(paths.$images,"logo.png");
|
|
49
|
-
if(!logoPath || !fs.existsSync(logoPath)){
|
|
50
|
-
if(logoPath){
|
|
51
|
-
console.warn("Logo de l'application innexistant!! Vous devez spécifier le logo de votre application, fichier ["+(logoPath)+"]")
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
const buildOutDir = path.resolve(electronDir,"dist");
|
|
55
|
-
const indexFile = path.resolve(buildOutDir,"index.html");
|
|
56
|
-
const webBuildDir = path.resolve(projectRoot,"web-build");
|
|
57
|
-
const promise = new Promise((resolve,reject)=>{
|
|
58
|
-
const next = ()=>{
|
|
59
|
-
if(fs.existsSync(webBuildDir)){
|
|
60
|
-
return copyDir(webBuildDir,buildOutDir).catch(reject).then(resolve);
|
|
61
|
-
} else {
|
|
62
|
-
reject("fichier web-build exporté par electron innexistant!!");
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if(parsedArgs.compile || !fs.existsSync(path.resolve(webBuildDir,"index.html"))){
|
|
66
|
-
cmd = "npx expo export:web";
|
|
67
|
-
console.log("******************** exporting app : "+cmd);
|
|
68
|
-
return exec({cmd,projectRoot}).then(next).catch(reject);
|
|
69
|
-
}
|
|
70
|
-
next();
|
|
71
|
-
});
|
|
72
|
-
return promise.then(()=>{
|
|
73
|
-
if(!fs.existsSync(buildOutDir) || !fs.existsSync(indexFile)){
|
|
74
|
-
throw "répertoire d'export web invalide où innexistant ["+buildOutDir+"]"
|
|
75
|
-
}
|
|
76
|
-
switch(script){
|
|
77
|
-
case "start":
|
|
78
|
-
cmd = "electron "+electronDir;
|
|
79
|
-
return new Promise((resolve,reject)=>{
|
|
80
|
-
exec({
|
|
81
|
-
cmd,
|
|
82
|
-
projectRoot : electronDir,
|
|
83
|
-
}).finally(()=>{
|
|
84
|
-
console.log("ant to exit");
|
|
85
|
-
})
|
|
86
|
-
setTimeout(resolve,1000)
|
|
87
|
-
})
|
|
88
|
-
break;
|
|
89
|
-
case "build":
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
}).catch((e)=>{
|
|
93
|
-
console.log(e," is cathing ggg");
|
|
94
|
-
}).finally(()=>{
|
|
95
|
-
process.exit();
|
|
96
|
-
});
|
|
97
|
-
} else {
|
|
98
|
-
process.exit();
|
|
99
|
-
}
|
|
1
|
+
//#!/usr/bin/env node
|
|
2
|
+
/**@see : https://blog.shahednasser.com/how-to-create-a-npx-tool/ */
|
|
3
|
+
'use strict';
|
|
4
|
+
process.on('unhandledRejection', err => {
|
|
5
|
+
throw err;
|
|
6
|
+
});
|
|
7
|
+
const supportedScript = {
|
|
8
|
+
"start" : true,//start electron
|
|
9
|
+
"build" : true, //script pour faire un build
|
|
10
|
+
}
|
|
11
|
+
const path= require("path");
|
|
12
|
+
const fs = require("fs");
|
|
13
|
+
const dir = path.resolve(__dirname);
|
|
14
|
+
const electronDir = path.resolve(dir, "..","electron");
|
|
15
|
+
const exec = require("../electron/exec");
|
|
16
|
+
const args = process.argv.slice(2);
|
|
17
|
+
let projectRoot = process.cwd();
|
|
18
|
+
const createDir = require("../electron/createDir");
|
|
19
|
+
const copyDir = require("../electron/copyDir");
|
|
20
|
+
const parsedArgs = require("./parseArgs")(args,supportedScript);
|
|
21
|
+
if(!parsedArgs.script || !(parsedArgs.script in supportedScript)){
|
|
22
|
+
console.error ("Erreur : script invalide, vous devez spécifier script figurant parmi les script : ["+Object.keys(supportedScript).join(", ")+"]");
|
|
23
|
+
process.exit();
|
|
24
|
+
}
|
|
25
|
+
const {script} = parsedArgs;
|
|
26
|
+
let cmd = null;
|
|
27
|
+
/****
|
|
28
|
+
* 1. installer electron globallement : npm i -g electron@latest
|
|
29
|
+
* cmde : [cmd] start electron config=[path-to-config-relative-to-project-dir]
|
|
30
|
+
* splash=[path-to-splashcreen-relative-to-project-root]
|
|
31
|
+
* output-dir|out = [path-to-output-dir-relative-to-root-project]
|
|
32
|
+
* */
|
|
33
|
+
if(parsedArgs.electron){
|
|
34
|
+
const pathsJSON = path.resolve(electronDir,"paths.json");
|
|
35
|
+
if(!fs.existsSync(pathsJSON)){
|
|
36
|
+
throw "Le fichier des chemins d'accès à l'application est innexistant, rassurez vous de tester l'application en environnement web, via la cmde <npx expo start>, avant l'exécution du script electron."
|
|
37
|
+
}
|
|
38
|
+
const paths = require(`${pathsJSON}`);
|
|
39
|
+
if(typeof paths !=='object' || !paths || !paths.projectRoot){
|
|
40
|
+
throw "Fichiers des chemins d'application invalide!!! merci d'exécuter l'application en environnement web|android|ios puis réessayez"
|
|
41
|
+
}
|
|
42
|
+
projectRoot = path.resolve(projectRoot);
|
|
43
|
+
const out = parsedArgs.out || parsedArgs["output-dir"];
|
|
44
|
+
const outDir = out && path.dirname(out) && path.resolve(projectRoot,path.dirname(out),"electron") || path.resolve(projectRoot,"dist","electron")
|
|
45
|
+
if(!createDir(outDir)){
|
|
46
|
+
throw "Impossible de créer le répertoire <<"+outDir+">> du fichier binaire!!";
|
|
47
|
+
}
|
|
48
|
+
const logoPath = paths.logo || paths.$assets && path.resolve(paths.$assets,"logo.png") || paths.$images && path.resolve(paths.$images,"logo.png");
|
|
49
|
+
if(!logoPath || !fs.existsSync(logoPath)){
|
|
50
|
+
if(logoPath){
|
|
51
|
+
console.warn("Logo de l'application innexistant!! Vous devez spécifier le logo de votre application, fichier ["+(logoPath)+"]")
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const buildOutDir = path.resolve(electronDir,"dist");
|
|
55
|
+
const indexFile = path.resolve(buildOutDir,"index.html");
|
|
56
|
+
const webBuildDir = path.resolve(projectRoot,"web-build");
|
|
57
|
+
const promise = new Promise((resolve,reject)=>{
|
|
58
|
+
const next = ()=>{
|
|
59
|
+
if(fs.existsSync(webBuildDir)){
|
|
60
|
+
return copyDir(webBuildDir,buildOutDir).catch(reject).then(resolve);
|
|
61
|
+
} else {
|
|
62
|
+
reject("fichier web-build exporté par electron innexistant!!");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if(parsedArgs.compile || !fs.existsSync(path.resolve(webBuildDir,"index.html"))){
|
|
66
|
+
cmd = "npx expo export:web";
|
|
67
|
+
console.log("******************** exporting app : "+cmd);
|
|
68
|
+
return exec({cmd,projectRoot}).then(next).catch(reject);
|
|
69
|
+
}
|
|
70
|
+
next();
|
|
71
|
+
});
|
|
72
|
+
return promise.then(()=>{
|
|
73
|
+
if(!fs.existsSync(buildOutDir) || !fs.existsSync(indexFile)){
|
|
74
|
+
throw "répertoire d'export web invalide où innexistant ["+buildOutDir+"]"
|
|
75
|
+
}
|
|
76
|
+
switch(script){
|
|
77
|
+
case "start":
|
|
78
|
+
cmd = "electron "+electronDir;
|
|
79
|
+
return new Promise((resolve,reject)=>{
|
|
80
|
+
exec({
|
|
81
|
+
cmd,
|
|
82
|
+
projectRoot : electronDir,
|
|
83
|
+
}).finally(()=>{
|
|
84
|
+
console.log("ant to exit");
|
|
85
|
+
})
|
|
86
|
+
setTimeout(resolve,1000)
|
|
87
|
+
})
|
|
88
|
+
break;
|
|
89
|
+
case "build":
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}).catch((e)=>{
|
|
93
|
+
console.log(e," is cathing ggg");
|
|
94
|
+
}).finally(()=>{
|
|
95
|
+
process.exit();
|
|
96
|
+
});
|
|
97
|
+
} else {
|
|
98
|
+
process.exit();
|
|
99
|
+
}
|
package/metro.config.js
CHANGED
|
@@ -24,6 +24,6 @@ module.exports = function(opts){
|
|
|
24
24
|
'jsx', 'js','tsx',
|
|
25
25
|
]
|
|
26
26
|
// Remove all console logs in production...
|
|
27
|
-
|
|
27
|
+
config.transformer.minifierConfig.compress.drop_console = false;
|
|
28
28
|
return config;
|
|
29
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.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
|
"@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.15.
|
|
64
|
+
"@fto-consult/common": "^2.15.1",
|
|
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/auth/Login.js
CHANGED
|
@@ -20,7 +20,7 @@ import {getTitle} from "$escreens/Auth/utils";
|
|
|
20
20
|
import {isWeb} from "$cplatform";
|
|
21
21
|
import ProviderSelector from "./ProviderSelector";
|
|
22
22
|
import { ScrollView } from "react-native";
|
|
23
|
-
|
|
23
|
+
import PropTypes from "prop-types";
|
|
24
24
|
import getLoginProps from "$getLoginProps";
|
|
25
25
|
const getProps = typeof getLoginProps =='function'? getLoginProps : x=>null;
|
|
26
26
|
|
|
@@ -89,7 +89,8 @@ export default function LoginComponent(props){
|
|
|
89
89
|
const {header,
|
|
90
90
|
headerTopContent:HeaderTopContent,
|
|
91
91
|
containerProps : customContainerProps,
|
|
92
|
-
|
|
92
|
+
withHeaderAvatar,
|
|
93
|
+
contentProps : customContentProps,
|
|
93
94
|
withScrollView:customWithScrollView,children,initialize,contentTop,data:loginData,canGoToNext,keyboardEvents,onSuccess:onLoginSuccess,mutateData,beforeSubmit:beforeSubmitForm,canSubmit:canSubmitForm,onStepChange,...loginProps} = defaultObj(getProps({
|
|
94
95
|
...state,
|
|
95
96
|
setState,
|
|
@@ -106,6 +107,7 @@ export default function LoginComponent(props){
|
|
|
106
107
|
previousButtonRef,
|
|
107
108
|
}));
|
|
108
109
|
const containerProps = defaultObj(customContainerProps);
|
|
110
|
+
const contentProps = defaultObj(customContentProps);
|
|
109
111
|
|
|
110
112
|
React.useEffect(()=>{
|
|
111
113
|
Preloader.closeAll();
|
|
@@ -198,9 +200,9 @@ export default function LoginComponent(props){
|
|
|
198
200
|
const withScrollView = typeof customWithScrollView =='boolean'? customWithScrollView : true;
|
|
199
201
|
const Wrapper = withPortal ? ScreenWithoutAuthContainer : withScrollView ? ScrollView: View;
|
|
200
202
|
const mQueryUpdateProps = (a)=>{
|
|
201
|
-
const style = StyleSheet.flatten([updateMediaQueryStyle(),
|
|
202
|
-
if(typeof
|
|
203
|
-
return
|
|
203
|
+
const style = StyleSheet.flatten([updateMediaQueryStyle(),contentProps.style]);
|
|
204
|
+
if(typeof contentProps.updateMediaQueryStyle =='function'){
|
|
205
|
+
return contentProps.updateMediaQueryStyle({style})
|
|
204
206
|
}
|
|
205
207
|
return {style};
|
|
206
208
|
};
|
|
@@ -211,14 +213,14 @@ export default function LoginComponent(props){
|
|
|
211
213
|
return <Wrapper testID = {testID+"_Wrapper" }{...wrapperProps}>
|
|
212
214
|
<DialogProvider ref={dialogProviderRef}/>
|
|
213
215
|
{sH}
|
|
214
|
-
<Surface style={[styles.container,{backgroundColor}]} testID={testID}>
|
|
215
|
-
<Surface elevation = {0} {...
|
|
216
|
+
<Surface style={[styles.container,{backgroundColor}]} {...containerProps} testID={testID}>
|
|
217
|
+
<Surface elevation = {0} {...contentProps} mediaQueryUpdateNativeProps = {mQueryUpdateProps} {...contentProps} testID={testID+"_Content"} style={[styles.content,updateMediaQueryStyle(),{backgroundColor},contentProps.style]}>
|
|
216
218
|
<FormData
|
|
217
219
|
formName = {formName}
|
|
218
220
|
testID = {testID+"_FormData"}
|
|
219
221
|
style = {[styles.formData,{backgroundColor}]}
|
|
220
222
|
header = {<View style = {[styles.header]}>
|
|
221
|
-
<Avatar testID={testID+"_Avatar"} size={50} secondary icon = 'lock'/>
|
|
223
|
+
{withHeaderAvatar !== false && <Avatar testID={testID+"_Avatar"} size={50} secondary icon = 'lock'/> || null}
|
|
222
224
|
{
|
|
223
225
|
React.isValidElement(header)? header :
|
|
224
226
|
<Label testID={testID+"_HeaderText"} bool style={{color:theme.colors.primaryOnSurface,fontSize:18,paddingTop:10}}>Connectez vous SVP</Label>
|
|
@@ -333,3 +335,15 @@ const styles = StyleSheet.create({
|
|
|
333
335
|
}
|
|
334
336
|
});
|
|
335
337
|
|
|
338
|
+
LoginComponent.propTypes = {
|
|
339
|
+
withHeaderAvatar:PropTypes.bool,//si l'on affichera l'avatar de connexion
|
|
340
|
+
headerTopContent : PropTypes.oneOfType([
|
|
341
|
+
PropTypes.func,
|
|
342
|
+
PropTypes.node,
|
|
343
|
+
PropTypes.element,
|
|
344
|
+
]),
|
|
345
|
+
header : PropTypes.oneOfType([
|
|
346
|
+
PropTypes.node,
|
|
347
|
+
PropTypes.element,
|
|
348
|
+
]),
|
|
349
|
+
}
|