@fto-consult/expo-ui 6.62.3 → 6.62.5
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.js +2 -4
- package/bin/update-pdfmake.js +29 -0
- package/package.json +3 -2
- package/src/media/file-system/utils/utils.js +6 -5
- package/src/pdf/pdfmake/index.js +0 -0
- package/src/pdf/pdfmake/pdfmake.html +21 -0
- package/src/screens/Help/openLibraries.js +1 -1
- package/src/screens/ScreenWrapper.js +1 -1
package/babel.config.js
CHANGED
@@ -47,8 +47,6 @@ module.exports = function(api,opts) {
|
|
47
47
|
}
|
48
48
|
|
49
49
|
}
|
50
|
-
|
51
|
-
|
52
50
|
return {
|
53
51
|
presets: [
|
54
52
|
['babel-preset-expo']
|
@@ -57,8 +55,8 @@ module.exports = function(api,opts) {
|
|
57
55
|
...(Array.isArray(opts.plugins) ? options.plugins : []),
|
58
56
|
["inline-dotenv",inlineDovOptions],
|
59
57
|
["module-resolver", {"alias": alias}],
|
60
|
-
|
61
|
-
|
58
|
+
"@babel/plugin-proposal-export-namespace-from",
|
59
|
+
'react-native-reanimated/plugin',
|
62
60
|
],
|
63
61
|
};
|
64
62
|
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
const path = require("path");
|
2
|
+
const fs = require("fs");
|
3
|
+
const {writeFile} = require("../electron/utils")
|
4
|
+
const ePdfmake = path.resolve("./src","pdf","pdfmake");
|
5
|
+
const pdfmakeBuildPath = path.resolve(process.cwd(),"node_modules","pdfmake","build");
|
6
|
+
const pdfmakePath = path.resolve(pdfmakeBuildPath,"pdfmake.min.js"),
|
7
|
+
pdfmakeVsFontsPath = path.resolve(pdfmakeBuildPath,"vfs_fonts.js");
|
8
|
+
const localPdfmake = path.resolve("node_modules","pdfmake","build","pdfmake.min.js");
|
9
|
+
const pdfmakeDistPath = fs.existsSync(pdfmakePath)? pdfmakePath : fs.existsSync(localPdfmake)? localPdfmake : null;
|
10
|
+
if(pdfmakeDistPath && ePdfmake && fs.existsSync(ePdfmake)){
|
11
|
+
const pdfmakePathHtml = path.resolve(ePdfmake,"pdfmake.html");
|
12
|
+
const jsContent = fs.readFileSync(pdfmakeDistPath, 'utf8');
|
13
|
+
const vfs_fonts = fs.existsSync(pdfmakeVsFontsPath) ? fs.readFileSync(pdfmakeVsFontsPath, 'utf8') : "";
|
14
|
+
writeFile(pdfmakePathHtml,`
|
15
|
+
<html>
|
16
|
+
<head>
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
18
|
+
<script>
|
19
|
+
${jsContent};
|
20
|
+
/*********** pdfmake vsfonts content*********/
|
21
|
+
${vfs_fonts};
|
22
|
+
</script>
|
23
|
+
</head>
|
24
|
+
<body>
|
25
|
+
</body>
|
26
|
+
</html>
|
27
|
+
`);
|
28
|
+
console.log("native pdfmake updated");
|
29
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "6.62.
|
3
|
+
"version": "6.62.5",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"main": "main",
|
6
6
|
"scripts": {
|
@@ -41,11 +41,12 @@
|
|
41
41
|
"fix-dependencies": "expo-cli doctor --fix-dependencies",
|
42
42
|
"expo-fix": "npx expo install --fix",
|
43
43
|
"update-apexchart": "node ./bin/update-appex-chart.js",
|
44
|
+
"update-pdfmake": "node ./bin/update-pdfmake.js",
|
44
45
|
"update-appexchart": "npm run update-apexchart",
|
45
46
|
"delete-node-modules": "rimraf ./**/node_modules",
|
46
47
|
"dev": "npx expo start --no-dev --minify -c",
|
47
48
|
"modifier-url-remote-git": "git remote set-url origin 'https://borispipo@github.com/borispipo/smart-eneo.git'",
|
48
|
-
"update": "npm i expo @emotion/native@latest react-native-big-list@latest apexcharts@latest file-saver@latest fs-extra@latest google-libphonenumber@latest @pchmn/expo-material3-theme@latest @emotion/native@latest @fto-consult/common@latest @react-navigation/stack react-native-blob-util react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@latest react-native-paper-dates@latest @react-navigation/native@latest @react-navigation/native-stack@latest react-virtuoso@latest tippy.js@latest websql@latest xlsx@latest react-native-web@latest react-dom@latest && npx expo install --fix && npm run update-apexchart && npm run find-licenses"
|
49
|
+
"update": "npm i pdfmake@latest expo @emotion/native@latest react-native-big-list@latest apexcharts@latest file-saver@latest fs-extra@latest google-libphonenumber@latest @pchmn/expo-material3-theme@latest @emotion/native@latest @fto-consult/common@latest @react-navigation/stack react-native-blob-util react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@latest react-native-paper-dates@latest @react-navigation/native@latest @react-navigation/native-stack@latest react-virtuoso@latest tippy.js@latest websql@latest xlsx@latest react-native-web@latest react-dom@latest && npx expo install --fix && npm run update-apexchart && npm run update-pdfmake && npm run find-licenses"
|
49
50
|
},
|
50
51
|
"bin": {
|
51
52
|
"expo-ui": "./bin/index.js"
|
@@ -53,7 +53,7 @@ export const writeText = (args)=>{
|
|
53
53
|
/***
|
54
54
|
* @see https://ourtechroom.com/tech/mime-type-for-excel/ for excel mimesTypes
|
55
55
|
* .xls : application/vnd.ms-excel
|
56
|
-
@see :
|
56
|
+
@see : https://docs.sheetjs.com/docs/demos/mobile/reactnative
|
57
57
|
*/
|
58
58
|
export const writeExcel = ({workbook,content,contentType,fileName,...rest})=>{
|
59
59
|
let ext = defaultStr(getFileExtension(fileName,true),"xlsx");
|
@@ -61,16 +61,17 @@ export const writeExcel = ({workbook,content,contentType,fileName,...rest})=>{
|
|
61
61
|
if(!isNonNullString(fileName)){
|
62
62
|
return Promise.reject({status:false,message:'Nom de fichier invalide pour le contenu excel à créer'});
|
63
63
|
}
|
64
|
+
|
65
|
+
Preloader.open("génération du fichier excel "+fileName);
|
64
66
|
if(isBase64(content)){
|
67
|
+
if(isMobileNative()) return FileSaver.save({content,isBase64:true,contentType,fileName,...rest}).finally(Preloader.close);
|
65
68
|
content = new Blob([base64toBlob(content, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')], {});
|
66
69
|
}
|
67
70
|
if(isBlob(content)){
|
68
|
-
return write({...rest,content,fileName,contentType})
|
71
|
+
return write({...rest,content,fileName,contentType}).finally(Preloader.close)
|
69
72
|
}
|
70
|
-
|
71
|
-
Preloader.open("génération du fichier excel "+fileName);
|
72
73
|
if(isMobileNative()){
|
73
|
-
return FileSaver.save({...rest,content:XLSX.write(workbook, {type:'base64', bookType:ext}),fileName}).finally(Preloader.close);
|
74
|
+
return FileSaver.save({...rest,content:XLSX.write(workbook, {type:'base64', bookType:ext}),fileName}).finally(Preloader.close).finally(Preloader.close);
|
74
75
|
}
|
75
76
|
return new Promise((resolve,reject)=>{
|
76
77
|
try {
|
File without changes
|