@fto-consult/expo-ui 1.0.21 → 1.0.23
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/index.js +1 -1
- package/package.json +2 -2
- package/src/App.js +45 -43
- package/src/components/TextField/utils.js +1 -64
package/index.js
CHANGED
|
@@ -14,5 +14,5 @@ export default function ExpoUIApp (options){
|
|
|
14
14
|
options = defaultObj(options);
|
|
15
15
|
const config = defaultObj(options.config);
|
|
16
16
|
appConfig.current = config;
|
|
17
|
-
registerRootComponent(require('./src/App').default);
|
|
17
|
+
registerRootComponent(require('./src/App').default(options));
|
|
18
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@emotion/native": "^11.10.0",
|
|
61
61
|
"@expo/metro-config": "^0.4.0",
|
|
62
62
|
"@expo/webpack-config": "^0.17.2",
|
|
63
|
-
"@fto-consult/common": "^1.0
|
|
63
|
+
"@fto-consult/common": "^1.1.0",
|
|
64
64
|
"@gorhom/portal": "^1.0.14",
|
|
65
65
|
"@react-native-async-storage/async-storage": "~1.17.3",
|
|
66
66
|
"@react-native-community/netinfo": "9.3.0",
|
package/src/App.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import '$session';
|
|
2
|
-
import appConfig from '$capp/config';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import {updateTheme,defaultTheme} from "$theme";
|
|
5
|
-
import { AppRegistry} from 'react-native';
|
|
6
4
|
import {Provider as PaperProvider } from 'react-native-paper';
|
|
7
|
-
import
|
|
5
|
+
import Index from './index';
|
|
8
6
|
import {Portal } from 'react-native-paper';
|
|
9
7
|
import {PreloaderProvider} from "$epreloader";
|
|
10
8
|
import DropdownAlert from '$ecomponents/Dialog/DropdownAlert';
|
|
@@ -23,43 +21,47 @@ import StatusBar from "$ecomponents/StatusBar";
|
|
|
23
21
|
import SimpleSelect from '$ecomponents/SimpleSelect';
|
|
24
22
|
import {Provider as AlertProvider} from '$ecomponents/Dialog/confirm/Alert';
|
|
25
23
|
|
|
26
|
-
export default function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
24
|
+
export default function getIndex(options){
|
|
25
|
+
const {App} = defaultObj(options);
|
|
26
|
+
const child = <Index theme={theme}/>;
|
|
27
|
+
const children = typeof App =='function'? App({children:child}) : child;
|
|
28
|
+
return function MainIndexComponent() {
|
|
29
|
+
React.useEffect(()=>{
|
|
30
|
+
return ()=>{}
|
|
31
|
+
},[])
|
|
32
|
+
const [theme,setTheme] = React.useState(updateTheme(defaultTheme));
|
|
33
|
+
const preferences = React.useMemo(()=>({
|
|
34
|
+
updateTheme : (customTheme,persist)=>{
|
|
35
|
+
setTheme(updateTheme(customTheme));
|
|
36
|
+
},
|
|
37
|
+
theme,
|
|
38
|
+
}),[theme]);
|
|
39
|
+
return (
|
|
40
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
41
|
+
<PaperProvider theme={theme}>
|
|
42
|
+
<SafeAreaProvider>
|
|
43
|
+
<AuthProvider>
|
|
44
|
+
<PortalProvider>
|
|
45
|
+
<Portal.Host>
|
|
46
|
+
<ErrorBoundary>
|
|
47
|
+
<StatusBar/>
|
|
48
|
+
<PreferencesContext.Provider value={preferences}>
|
|
49
|
+
<DropdownAlert ref={notificationRef}/>
|
|
50
|
+
<PreloaderProvider/>
|
|
51
|
+
<DialogProvider responsive/>
|
|
52
|
+
<AlertProvider SimpleSelect={SimpleSelect}/>
|
|
53
|
+
<FormDataDialogProvider/>
|
|
54
|
+
{children}
|
|
55
|
+
<ErrorBoundaryProvider/>
|
|
56
|
+
<BottomSheetProvider/>
|
|
57
|
+
</PreferencesContext.Provider>
|
|
58
|
+
</ErrorBoundary>
|
|
59
|
+
</Portal.Host>
|
|
60
|
+
</PortalProvider>
|
|
61
|
+
</AuthProvider>
|
|
62
|
+
</SafeAreaProvider>
|
|
63
|
+
</PaperProvider>
|
|
64
|
+
</GestureHandlerRootView>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -1,64 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const flatMode = 'flat';
|
|
5
|
-
export const outlinedMode = 'outlined';
|
|
6
|
-
export const normalMode = "normal";
|
|
7
|
-
export const shadowMode = "shadow";
|
|
8
|
-
|
|
9
|
-
export const defaultMode = outlinedMode;
|
|
10
|
-
|
|
11
|
-
export const modes = {flat:flatMode,shadow:shadowMode,outlined:outlinedMode,normal:normalMode};
|
|
12
|
-
|
|
13
|
-
export const modesObject = {
|
|
14
|
-
flat : {
|
|
15
|
-
code : flatMode,
|
|
16
|
-
label : 'Flottant',
|
|
17
|
-
},
|
|
18
|
-
shadow : {
|
|
19
|
-
code : shadowMode,
|
|
20
|
-
label : 'Ombre',
|
|
21
|
-
},
|
|
22
|
-
normal : {
|
|
23
|
-
code : normalMode,
|
|
24
|
-
label : 'Normal',
|
|
25
|
-
},
|
|
26
|
-
outlined : {
|
|
27
|
-
code : outlinedMode,
|
|
28
|
-
label : 'Décrit',
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export const HEIGHT = 56;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export const AutoCapitalizeTypes = {
|
|
37
|
-
characters : "characters", ///all characters.
|
|
38
|
-
words : "words", //first letter of each word.
|
|
39
|
-
sentences :"sentences", //first letter of each sentence (default).
|
|
40
|
-
none : "none", ///don't auto capitalize anything.
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const keyboardTypes = {
|
|
44
|
-
default : 'default',
|
|
45
|
-
number : "number-pad",
|
|
46
|
-
numberPad : "number-pad",
|
|
47
|
-
decimal : "decimal-pad",
|
|
48
|
-
numeric : "numeric",
|
|
49
|
-
email : "email-address",
|
|
50
|
-
tel : "phone-pad",
|
|
51
|
-
phone : "phone-pad",
|
|
52
|
-
}
|
|
53
|
-
export const FONT_SIZE = 16;
|
|
54
|
-
|
|
55
|
-
export const parseDecimal = (v,type,preserveDecimalLength)=>{
|
|
56
|
-
type = defaultStr(type).trim().toLowerCase();
|
|
57
|
-
if((type =='number' || type =='decimal') && !isDecimal(v)){
|
|
58
|
-
if(v == undefined || v == null){
|
|
59
|
-
v = '';
|
|
60
|
-
}
|
|
61
|
-
v = defaultDecimal(NParseDecimal(v,preserveDecimalLength),0);
|
|
62
|
-
}
|
|
63
|
-
return v;
|
|
64
|
-
}
|
|
1
|
+
export * from "$common/TextField";
|