@fto-consult/expo-ui 7.4.48 → 7.4.50
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/electron/preload.js +9 -9
- package/package.json +1 -3
package/electron/preload.js
CHANGED
@@ -110,7 +110,7 @@ const createPDFFile = (options)=>{
|
|
110
110
|
const dir = getPath("temp");
|
111
111
|
options = Object.assign({},options);
|
112
112
|
let {content,filename,fileName,charset,fileExtension,extension} = options;
|
113
|
-
|
113
|
+
fileName = defaultStr(filename,fileName)
|
114
114
|
if(isDataURL(content)){
|
115
115
|
content = isDataURL.toBase64(content);
|
116
116
|
}
|
@@ -123,19 +123,19 @@ const createPDFFile = (options)=>{
|
|
123
123
|
console.warn('type de contenu invalide!! impression création fichier electron');
|
124
124
|
return null;
|
125
125
|
}
|
126
|
-
|
127
|
-
fileExtension = defaultStr(fileExtension,extension,'pdf');
|
126
|
+
fileName = defaultStr(fileName,uniqid("print-salite-file-name"))
|
127
|
+
fileExtension = defaultStr(fileExtension,extension,'pdf').split(".")[0];
|
128
128
|
charset = defaultStr(charset,'utf-8')
|
129
|
-
|
129
|
+
fileName = sanitize(fileName);
|
130
130
|
if(!fileName.endsWith(`.${fileExtension}`)){
|
131
131
|
fileName += "."+fileExtension
|
132
132
|
}
|
133
|
-
return fs.writeFile(path.join(dir,
|
133
|
+
return fs.writeFile(path.join(dir,fileName), content,{charset},(err)=>{
|
134
134
|
if(!err) {
|
135
|
-
const
|
136
|
-
const
|
135
|
+
const p = path.join(dir,fileName);
|
136
|
+
const fileUrl = 'file://'+p.replaceAll("\\","/");
|
137
137
|
const filePathUrl = 'file://'+p;
|
138
|
-
resolve({content,fileName
|
138
|
+
resolve({content,fileName,filename:fileName,path:p,filePathUrl,filePathUri:filePathUrl,fileUrl,filePath:p,fileUri:fileUrl})
|
139
139
|
} else {
|
140
140
|
reject(err);
|
141
141
|
}
|
@@ -382,7 +382,7 @@ const ELECTRON = {
|
|
382
382
|
get printPDF (){
|
383
383
|
return (options)=>{
|
384
384
|
options = Object.assign({},options);
|
385
|
-
return createPDFFile(options).then(({path:mainPath,filePathUrl})=>{
|
385
|
+
return createPDFFile(options).then(({path:mainPath,filePathUrl,fileName})=>{
|
386
386
|
const urlPath = path.resolve(__dirname,"pdf-viewer","viewer.html");
|
387
387
|
if(fs.existsSync(mainPath)){
|
388
388
|
options.loadURL = `file://${urlPath}?file=${decodeURIComponent(filePathUrl)}&locale=fr&fileName=${fileName}`;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "7.4.
|
3
|
+
"version": "7.4.50",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"scripts": {
|
6
6
|
"clear-npx-cache": "npx clear-npx-cache",
|
@@ -99,11 +99,9 @@
|
|
99
99
|
"fs-extra": "^11.2.0",
|
100
100
|
"google-libphonenumber": "^3.2.33",
|
101
101
|
"htmlparser2-without-node-native": "^3.9.2",
|
102
|
-
"i": "^0.3.7",
|
103
102
|
"is-plain-obj": "^4.1.0",
|
104
103
|
"js-base64": "^3.7.5",
|
105
104
|
"node-machine-id": "^1.1.12",
|
106
|
-
"npm": "^10.2.5",
|
107
105
|
"pdfmake": "^0.2.8",
|
108
106
|
"pdfobject": "^2.2.12",
|
109
107
|
"process": "^0.11.10",
|