@fto-consult/expo-ui 8.25.12 → 8.25.14
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/package.json +2 -2
- package/src/pdf/index.js +45 -5
- package/src/screens/Help/openLibraries.js +94 -117
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fto-consult/expo-ui",
|
3
|
-
"version": "8.25.
|
3
|
+
"version": "8.25.14",
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
5
5
|
"scripts": {
|
6
6
|
"clear-npx-cache": "npx clear-npx-cache",
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"dependencies": {
|
69
69
|
"@emotion/react": "^11.11.1",
|
70
70
|
"@faker-js/faker": "^8.0.2",
|
71
|
-
"@fto-consult/common": "^4.
|
71
|
+
"@fto-consult/common": "^4.26.1",
|
72
72
|
"@fto-consult/node-utils": "^1.4.7",
|
73
73
|
"apexcharts": "^3.45.2",
|
74
74
|
"crypto-browserify": "^3.12.0",
|
package/src/pdf/index.js
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
import {createPDF as cCreatePdf,print as cPrint,fields as pdfFields} from "$cpdf";
|
2
2
|
import Preloader from "$preloader";
|
3
|
-
import {extendObj} from "$cutils";
|
4
3
|
import pdfMake from "$cpdf/pdfmake";
|
5
4
|
import notify from "$cnotify";
|
6
5
|
import DialogProvider from "$ecomponents/Form/FormData/DialogProvider";
|
7
|
-
import {isNonNullString,defaultObj,defaultStr} from "$cutils";
|
6
|
+
import {isNonNullString,defaultObj,defaultStr,extendObj} from "$cutils";
|
8
7
|
import session from "$session";
|
9
8
|
import printPdfMake from "./print";
|
9
|
+
import appConfig from "$capp/config";
|
10
|
+
import Auth from "$cauth";
|
11
|
+
|
10
12
|
|
11
13
|
const {createPdf} = pdfMake;
|
12
14
|
pdfMake.createPdf = (docDefinition,...rest)=>{
|
@@ -140,9 +142,47 @@ export const getPrintSettings = ({multiple,duplicateDocOnPage,pageBreakBeforeEac
|
|
140
142
|
session.set(sessionName,sessionD);
|
141
143
|
}
|
142
144
|
DialogProvider.close();
|
143
|
-
resolve({...opts,data,fields});
|
145
|
+
resolve({...opts,data:{...config,...data},fields});
|
146
|
+
},
|
147
|
+
onCancel : (e)=>{
|
148
|
+
reject(e);
|
149
|
+
Preloader.close();
|
144
150
|
},
|
145
|
-
onCancel : reject,
|
146
151
|
})
|
147
152
|
});
|
148
|
-
}
|
153
|
+
}
|
154
|
+
|
155
|
+
/**** permet d'imprimer une table data
|
156
|
+
@param {Array<object>||object}, la/les donnée(s) à imprimer
|
157
|
+
@param {object<{
|
158
|
+
table|tableName {string}, le nom de la table data à utilser pour l'impression
|
159
|
+
print {funtion}, la fonction à utiliser pour faire l'impression, si cette fonction n'est pas définie, alors la table data lié à la table doit l'implémenter dans l'option print
|
160
|
+
}>}
|
161
|
+
@return Promise
|
162
|
+
*/
|
163
|
+
export function printTableData(data,options){
|
164
|
+
options = Object.assign({},options);
|
165
|
+
const table = defaultStr(options.table,options.tableName);
|
166
|
+
const tableObj = appConfig.getTable(table);
|
167
|
+
if(!table || !tableObj){
|
168
|
+
return Promise.reject({message:`Vous devez spécifier la table pour laquelle vous souhaitez effectuer l'impression des données`})
|
169
|
+
}
|
170
|
+
const tableText = defaultStr(tableObj.label,tableObj.text,table);
|
171
|
+
const tablePrint = typeof options.print =="function"? options.print : typeof tableObj.print =="function"? tableObj.print : undefined;
|
172
|
+
if(!tablePrint){
|
173
|
+
return Promise.reject({message : `La fonction d'impression n'est pas supportée par la table [${tableText}]`})
|
174
|
+
}
|
175
|
+
if(!Auth.isTableDataAllowed({table,action:'print'})){
|
176
|
+
return Promise.reject({message:'Vous n\'etes pas autorisé à imprimer ce type de document'});
|
177
|
+
}
|
178
|
+
const printOptions = typeof tableObj.printOptions =="function"? tableObj.printOptions({...options,table,data}) : tableObj.printOptions;
|
179
|
+
return print(data,{
|
180
|
+
getSettings : (options)=>{
|
181
|
+
return getPrintSettings(extendObj(true,{},{sessionName:`print-${table}`},options,printOptions)).then(({data})=>{
|
182
|
+
return data;
|
183
|
+
});
|
184
|
+
},
|
185
|
+
print : tablePrint,
|
186
|
+
...Object.assign({},options),
|
187
|
+
});
|
188
|
+
}
|
@@ -1,22 +1,21 @@
|
|
1
1
|
module.exports = {
|
2
2
|
"@fto-consult/expo-ui": {
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
3
|
+
"name": "@fto-consult/expo-ui",
|
4
|
+
"version": "8.25.12",
|
5
|
+
"repository": {
|
6
|
+
"type": "git",
|
7
|
+
"url": "git+https://github.com/borispipo/expo-ui.git"
|
8
|
+
},
|
9
|
+
"homepage": "https://github.com/borispipo/expo-ui#readme"
|
6
10
|
},
|
7
11
|
"@babel/plugin-proposal-export-namespace-from": {
|
8
12
|
"version": "7.18.9",
|
9
13
|
"url": "https://babel.dev/docs/en/next/babel-plugin-proposal-export-namespace-from",
|
10
14
|
"license": "MIT"
|
11
15
|
},
|
12
|
-
"@emotion/
|
13
|
-
"version": "11.11.
|
14
|
-
"url": "https://emotion
|
15
|
-
"license": "MIT"
|
16
|
-
},
|
17
|
-
"@expo/html-elements": {
|
18
|
-
"version": "0.5.1",
|
19
|
-
"url": "https://github.com/expo/expo/tree/main/packages/html-elements",
|
16
|
+
"@emotion/react": {
|
17
|
+
"version": "11.11.3",
|
18
|
+
"url": "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
20
19
|
"license": "MIT"
|
21
20
|
},
|
22
21
|
"@expo/metro-config": {
|
@@ -24,54 +23,28 @@ module.exports = {
|
|
24
23
|
"url": "https://github.com/expo/expo.git",
|
25
24
|
"license": "MIT"
|
26
25
|
},
|
27
|
-
"@expo/vector-icons": {
|
28
|
-
"version": "14.0.0",
|
29
|
-
"url": "https://expo.github.io/vector-icons",
|
30
|
-
"license": "MIT"
|
31
|
-
},
|
32
26
|
"@expo/webpack-config": {
|
33
27
|
"version": "19.0.1",
|
34
28
|
"url": "https://github.com/expo/expo-webpack-integrations/tree/main/packages/webpack-config#readme",
|
35
29
|
"license": "MIT"
|
36
30
|
},
|
37
|
-
"@
|
38
|
-
"version": "
|
39
|
-
"url": "https://github.com/
|
40
|
-
"license": "MIT"
|
41
|
-
},
|
42
|
-
"@react-native-async-storage/async-storage": {
|
43
|
-
"version": "1.21.0",
|
44
|
-
"url": "https://github.com/react-native-async-storage/async-storage#readme",
|
45
|
-
"license": "MIT"
|
46
|
-
},
|
47
|
-
"@react-native-community/netinfo": {
|
48
|
-
"version": "11.1.0",
|
49
|
-
"url": "https://github.com/react-native-netinfo/react-native-netinfo#readme",
|
50
|
-
"license": "MIT"
|
51
|
-
},
|
52
|
-
"@react-native/assets-registry": {
|
53
|
-
"version": "0.72.0",
|
54
|
-
"url": "git@github.com:facebook/react-native.git",
|
55
|
-
"license": "MIT"
|
56
|
-
},
|
57
|
-
"@react-navigation/native": {
|
58
|
-
"version": "6.1.9",
|
59
|
-
"url": "https://reactnavigation.org",
|
31
|
+
"@faker-js/faker": {
|
32
|
+
"version": "8.3.1",
|
33
|
+
"url": "https://github.com/faker-js/faker.git",
|
60
34
|
"license": "MIT"
|
61
35
|
},
|
62
|
-
"@
|
63
|
-
"version": "
|
64
|
-
"url": "https://github.com/
|
65
|
-
"license": "
|
36
|
+
"@fto-consult/common": {
|
37
|
+
"version": "4.25.23",
|
38
|
+
"url": "https://github.com/borispipo/common#readme",
|
39
|
+
"license": "ISC"
|
66
40
|
},
|
67
|
-
"@
|
68
|
-
"version": "
|
69
|
-
"url": "https://reactnavigation.org/docs/stack-navigator/",
|
41
|
+
"@fto-consult/node-utils": {
|
42
|
+
"version": "1.4.7",
|
70
43
|
"license": "MIT"
|
71
44
|
},
|
72
|
-
"
|
73
|
-
"version": "
|
74
|
-
"url": "https://
|
45
|
+
"apexcharts": {
|
46
|
+
"version": "3.45.2",
|
47
|
+
"url": "https://apexcharts.com",
|
75
48
|
"license": "MIT"
|
76
49
|
},
|
77
50
|
"babel-plugin-inline-dotenv": {
|
@@ -84,113 +57,117 @@ module.exports = {
|
|
84
57
|
"url": "https://github.com/tleunen/babel-plugin-module-resolver.git",
|
85
58
|
"license": "MIT"
|
86
59
|
},
|
87
|
-
"
|
88
|
-
"version": "
|
89
|
-
"url": "https://github.com/
|
90
|
-
"license": "MIT"
|
91
|
-
},
|
92
|
-
"expo-camera": {
|
93
|
-
"version": "14.0.3",
|
94
|
-
"url": "https://docs.expo.dev/versions/latest/sdk/camera/",
|
95
|
-
"license": "MIT"
|
96
|
-
},
|
97
|
-
"expo-clipboard": {
|
98
|
-
"version": "5.0.1",
|
99
|
-
"url": "https://docs.expo.dev/versions/latest/sdk/clipboard",
|
60
|
+
"crypto-browserify": {
|
61
|
+
"version": "3.12.0",
|
62
|
+
"url": "https://github.com/crypto-browserify/crypto-browserify",
|
100
63
|
"license": "MIT"
|
101
64
|
},
|
102
|
-
"
|
103
|
-
"version": "
|
104
|
-
"url": "https://
|
65
|
+
"file-saver": {
|
66
|
+
"version": "2.0.5",
|
67
|
+
"url": "https://github.com/eligrey/FileSaver.js#readme",
|
105
68
|
"license": "MIT"
|
106
69
|
},
|
107
|
-
"
|
108
|
-
"version": "
|
109
|
-
"url": "https://
|
110
|
-
"license": "MIT"
|
70
|
+
"google-libphonenumber": {
|
71
|
+
"version": "3.2.34",
|
72
|
+
"url": "https://ruimarinho.github.io/google-libphonenumber/",
|
73
|
+
"license": "(MIT AND Apache-2.0)"
|
111
74
|
},
|
112
|
-
"
|
113
|
-
"version": "
|
114
|
-
"url": "https://
|
75
|
+
"html2canvas": {
|
76
|
+
"version": "1.4.1",
|
77
|
+
"url": "https://html2canvas.hertzen.com",
|
115
78
|
"license": "MIT"
|
116
79
|
},
|
117
|
-
"
|
118
|
-
"version": "
|
119
|
-
"url": "
|
80
|
+
"htmlparser2-without-node-native": {
|
81
|
+
"version": "3.9.2",
|
82
|
+
"url": "git://github.com/fb55/htmlparser2.git",
|
120
83
|
"license": "MIT"
|
121
84
|
},
|
122
|
-
"
|
123
|
-
"version": "
|
124
|
-
"url": "https://docs.expo.dev/versions/latest/sdk/sqlite/",
|
85
|
+
"is-plain-obj": {
|
86
|
+
"version": "4.1.0",
|
125
87
|
"license": "MIT"
|
126
88
|
},
|
127
|
-
"
|
128
|
-
"version": "
|
129
|
-
"url": "https://
|
89
|
+
"jsbarcode": {
|
90
|
+
"version": "3.11.6",
|
91
|
+
"url": "https://github.com/lindell/JsBarcode#readme",
|
130
92
|
"license": "MIT"
|
131
93
|
},
|
132
|
-
"
|
133
|
-
"version": "
|
134
|
-
"url": "https://
|
94
|
+
"prop-types": {
|
95
|
+
"version": "15.8.1",
|
96
|
+
"url": "https://facebook.github.io/react/",
|
135
97
|
"license": "MIT"
|
136
98
|
},
|
137
|
-
"
|
138
|
-
"version": "
|
139
|
-
"url": "https://
|
99
|
+
"react-content-loader": {
|
100
|
+
"version": "6.2.1",
|
101
|
+
"url": "https://github.com/danilowoz/react-content-loader",
|
140
102
|
"license": "MIT"
|
141
103
|
},
|
142
|
-
"react": {
|
104
|
+
"react-dom": {
|
143
105
|
"version": "18.2.0",
|
144
106
|
"url": "https://reactjs.org/",
|
145
107
|
"license": "MIT"
|
146
108
|
},
|
147
|
-
"react-native": {
|
148
|
-
"version": "
|
149
|
-
"url": "https://
|
109
|
+
"react-native-big-list": {
|
110
|
+
"version": "1.6.1",
|
111
|
+
"url": "https://marcocesarato.github.io/react-native-big-list-docs/",
|
112
|
+
"license": "GPL-3.0-or-later"
|
113
|
+
},
|
114
|
+
"react-native-iphone-x-helper": {
|
115
|
+
"version": "1.3.1",
|
116
|
+
"url": "https://github.com/ptelad/react-native-iphone-x-helper#readme",
|
150
117
|
"license": "MIT"
|
151
118
|
},
|
152
|
-
"react-native-
|
153
|
-
"version": "2.
|
154
|
-
"url": "https://github.com/software-mansion/react-native-gesture-handler#readme",
|
119
|
+
"react-native-mime-types": {
|
120
|
+
"version": "2.4.0",
|
155
121
|
"license": "MIT"
|
156
122
|
},
|
157
|
-
"react-native-
|
158
|
-
"version": "
|
123
|
+
"react-native-paper": {
|
124
|
+
"version": "5.12.3",
|
125
|
+
"url": "https://callstack.github.io/react-native-paper",
|
159
126
|
"license": "MIT"
|
160
127
|
},
|
161
|
-
"react-native-
|
162
|
-
"version": "
|
163
|
-
"url": "https://github.com/
|
128
|
+
"react-native-paper-dates": {
|
129
|
+
"version": "0.21.8",
|
130
|
+
"url": "https://github.com/web-ridge/react-native-paper-dates#readme",
|
164
131
|
"license": "MIT"
|
165
132
|
},
|
166
|
-
"react-native-
|
167
|
-
"version": "
|
168
|
-
"url": "
|
133
|
+
"react-native-web": {
|
134
|
+
"version": "0.19.10",
|
135
|
+
"url": "git://github.com/necolas/react-native-web.git",
|
169
136
|
"license": "MIT"
|
170
137
|
},
|
171
|
-
"react-
|
172
|
-
"version": "
|
173
|
-
"url": "https://
|
138
|
+
"react-virtuoso": {
|
139
|
+
"version": "4.6.3",
|
140
|
+
"url": "https://virtuoso.dev/",
|
174
141
|
"license": "MIT"
|
175
142
|
},
|
176
|
-
"
|
177
|
-
"version": "
|
178
|
-
"url": "https://github.com/
|
143
|
+
"readable-stream": {
|
144
|
+
"version": "4.5.2",
|
145
|
+
"url": "https://github.com/nodejs/readable-stream",
|
179
146
|
"license": "MIT"
|
180
147
|
},
|
181
|
-
"
|
182
|
-
"version": "
|
183
|
-
"url": "
|
148
|
+
"sanitize-filename": {
|
149
|
+
"version": "1.6.3",
|
150
|
+
"url": "git@github.com:parshap/node-sanitize-filename.git",
|
151
|
+
"license": "WTFPL OR ISC"
|
152
|
+
},
|
153
|
+
"sharp-cli": {
|
154
|
+
"version": "2.1.1",
|
155
|
+
"url": "https://github.com/vseventer/sharp-cli",
|
184
156
|
"license": "MIT"
|
185
157
|
},
|
186
|
-
"
|
187
|
-
"version": "
|
188
|
-
"url": "https://github.com/
|
158
|
+
"stream-browserify": {
|
159
|
+
"version": "3.0.0",
|
160
|
+
"url": "https://github.com/browserify/stream-browserify",
|
189
161
|
"license": "MIT"
|
190
162
|
},
|
191
|
-
"
|
192
|
-
"version": "
|
193
|
-
"url": "https://github.
|
163
|
+
"tippy.js": {
|
164
|
+
"version": "6.3.7",
|
165
|
+
"url": "https://atomiks.github.io/tippyjs/",
|
194
166
|
"license": "MIT"
|
167
|
+
},
|
168
|
+
"xlsx": {
|
169
|
+
"version": "0.18.5",
|
170
|
+
"url": "https://sheetjs.com/",
|
171
|
+
"license": "Apache-2.0"
|
195
172
|
}
|
196
173
|
};
|