@fto-consult/expo-ui 6.27.6 → 6.28.1
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 +3 -3
- package/src/components/Drawer/DrawerItems/DrawerSection.js +1 -2
- package/src/components/Drawer/DrawerItems/index.js +12 -2
- package/src/context/Provider.js +7 -4
- package/src/navigation/Drawer/items/index.js +3 -1
- package/src/screens/Help/openLibraries.js +1 -1
- package/src/screens/index.js +1 -1
- package/src/screens/mainScreens.js +13 -1
- /package/src/components/{Animations → Animation}/index.js +0 -0
- /package/src/components/{Animations → Animation}/index.native.js +0 -0
- /package/src/components/{Animations → Animation}/native/index.js +0 -0
- /package/src/components/{Animations → Animation}/native/utils.js +0 -0
- /package/src/components/{Animations → Animation}/web/index.js +0 -0
- /package/src/components/{Animations → Animation}/web/utils.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.28.1",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"xlsx": "^0.18.5"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@expo/metro-config": "
|
|
123
|
-
"@expo/webpack-config": "^
|
|
122
|
+
"@expo/metro-config": "^0.10.7",
|
|
123
|
+
"@expo/webpack-config": "^19.0.0",
|
|
124
124
|
"babel-plugin-inline-dotenv": "^1.7.0",
|
|
125
125
|
"babel-plugin-module-resolver": "^5.0.0",
|
|
126
126
|
"uninstall": "^0.0.0"
|
|
@@ -3,8 +3,7 @@ import {defaultObj,defaultBool} from "$cutils";
|
|
|
3
3
|
import Divider from "$ecomponents/Divider";
|
|
4
4
|
import Label from "$ecomponents/Label";
|
|
5
5
|
import theme,{Colors,tinyColor,ALPHA_OPACITY} from "$theme";
|
|
6
|
-
export default function DrawerSection (
|
|
7
|
-
let {children,divider,labelStyle,minimized,labelProps,dividerProps,label,text,...rest} = props;
|
|
6
|
+
export default function DrawerSection ({children,divider,labelStyle,minimized,labelProps,withDivider,dividerProps,label,text,...rest}){
|
|
8
7
|
label = defaultStr(label,text);
|
|
9
8
|
if(!label) return children;
|
|
10
9
|
dividerProps = defaultObj(dividerProps);
|
|
@@ -11,8 +11,11 @@ import { useDrawer } from '../Provider';
|
|
|
11
11
|
|
|
12
12
|
export * from "./utils";
|
|
13
13
|
|
|
14
|
+
let hasDivider = false;
|
|
15
|
+
|
|
14
16
|
const DrawerItemsComponent = React.forwardRef((props,ref)=> {
|
|
15
17
|
let {items:_items,minimized} = props;
|
|
18
|
+
hasDivider = false;
|
|
16
19
|
_items = typeof _items ==='function'? _items(props) : _items;
|
|
17
20
|
if(React.isValidElement(_items)){
|
|
18
21
|
return _items;
|
|
@@ -23,11 +26,15 @@ const DrawerItemsComponent = React.forwardRef((props,ref)=> {
|
|
|
23
26
|
if(isNonNullString(item.perm) && !Auth.isAllowedFromStr(item.perm)) return null;
|
|
24
27
|
const {section,items:itx2,...rest} = item;
|
|
25
28
|
if(section){
|
|
29
|
+
const sDivider = rest.divider !== false && !hasDivider && items.length ? true : false;
|
|
30
|
+
if(sDivider){
|
|
31
|
+
hasDivider = true;
|
|
32
|
+
}
|
|
26
33
|
return <DrawerSection
|
|
27
34
|
{...rest}
|
|
28
35
|
minimized={minimized}
|
|
29
36
|
key={key}
|
|
30
|
-
divider = {
|
|
37
|
+
divider = {sDivider}
|
|
31
38
|
>
|
|
32
39
|
{items}
|
|
33
40
|
</DrawerSection>
|
|
@@ -124,19 +131,22 @@ const getDefaultProps = function(item){
|
|
|
124
131
|
const renderItem = ({item,minimized,renderExpandableOrSection,index,key})=>{
|
|
125
132
|
key = key||index;
|
|
126
133
|
if(React.isValidElement(item)){
|
|
134
|
+
hasDivider = false;
|
|
127
135
|
return <React.Fragment key={key}>
|
|
128
136
|
{item}
|
|
129
137
|
</React.Fragment>
|
|
130
138
|
} else {
|
|
131
139
|
if(isNonNullString(item.perm) && !Auth.isAllowedFromStr(item.perm)) return null;
|
|
132
140
|
if(!item.label && !item.text && !item.icon) {
|
|
133
|
-
if(item.divider === true){
|
|
141
|
+
if(item.divider === true && !hasDivider){
|
|
134
142
|
const {divider,...rest} = item;
|
|
143
|
+
hasDivider = true;
|
|
135
144
|
return (<Divider key={key} {...rest}/>)
|
|
136
145
|
}
|
|
137
146
|
return null;
|
|
138
147
|
}
|
|
139
148
|
item = getDefaultProps(item);
|
|
149
|
+
hasDivider = false;
|
|
140
150
|
if(isObj(item.items) || Array.isArray(item.items)){
|
|
141
151
|
const itx = [];
|
|
142
152
|
Object.map(item.items,(it,i)=>{
|
package/src/context/Provider.js
CHANGED
|
@@ -4,7 +4,7 @@ import {MD3LightTheme,MD3DarkTheme} from "react-native-paper";
|
|
|
4
4
|
import { useMaterial3Theme } from '@pchmn/expo-material3-theme';
|
|
5
5
|
import {colorsAlias,Colors} from "$theme";
|
|
6
6
|
import {isObj,isNonNullString,defaultStr} from "$cutils";
|
|
7
|
-
import
|
|
7
|
+
import {getMainScreens} from "$escreens/mainScreens";
|
|
8
8
|
import {ExpoUIContext} from "./hooks";
|
|
9
9
|
import Login from "$eauth/Login";
|
|
10
10
|
import {modes} from "$ecomponents/TextField";
|
|
@@ -21,6 +21,7 @@ import { prepareScreens } from "./TableData";
|
|
|
21
21
|
getStructData : ()=>{object|array}
|
|
22
22
|
tablesData : {object}, la liste des tables de données
|
|
23
23
|
strucsData : {object}, la liste des données de structures
|
|
24
|
+
handleHelpScreen : {boolean}, //si l'écran d'aide sera pris en compte, l'écran d'aide ainsi que les écrans des termes d'utilisations et autres
|
|
24
25
|
convertFiltersToSQL : {boolean}, si les filtres de datagrid ou filtres seront convertis au format SQL
|
|
25
26
|
components : {
|
|
26
27
|
logo : {
|
|
@@ -38,13 +39,14 @@ import { prepareScreens } from "./TableData";
|
|
|
38
39
|
drawerItems : {object|array|function}, la fonction permettant d'obtenir les items du drawer principal de l'application
|
|
39
40
|
}
|
|
40
41
|
*/
|
|
41
|
-
const Provider = ({children,getTableData,navigation,components,convertFiltersToSQL,getStructData,tablesData,structsData,...props})=>{
|
|
42
|
+
const Provider = ({children,getTableData,handleHelpScreen,navigation,components,convertFiltersToSQL,getStructData,tablesData,structsData,...props})=>{
|
|
42
43
|
const {extendAppTheme} = appConfig;
|
|
43
44
|
const { theme : pTheme } = useMaterial3Theme();
|
|
44
45
|
navigation = defaultObj(navigation);
|
|
45
46
|
components = defaultObj(components);
|
|
46
47
|
structsData = isObj(structsData)? structsData : null;
|
|
47
48
|
appConfig.tablesData = tablesData;
|
|
49
|
+
handleHelpScreen = handleHelpScreen === false ? false : true;
|
|
48
50
|
appConfig.structsData = appConfig.structsData = isObj(structsData)? structsData : null;
|
|
49
51
|
getTableData = appConfig.getTable = appConfig.getTableData = getTableOrStructDataCall(tablesData,getTableData);
|
|
50
52
|
getStructData = appConfig.getStructData = getTableOrStructDataCall(structsData,getStructData);
|
|
@@ -118,13 +120,14 @@ const Provider = ({children,getTableData,navigation,components,convertFiltersToS
|
|
|
118
120
|
tables:tablesData,
|
|
119
121
|
screens,
|
|
120
122
|
TableDataScreen:components.TableDataScreen || components.TableDataScreenItem,
|
|
121
|
-
TableDataScreenList:components.TableDataScreenList||components.TableDataListScreen
|
|
123
|
+
TableDataScreenList:components.TableDataScreenList||components.TableDataListScreen,
|
|
122
124
|
});
|
|
123
|
-
return [...r,...
|
|
125
|
+
return [...r,...getMainScreens(handleHelpScreen)];
|
|
124
126
|
},[]);
|
|
125
127
|
return <ExpoUIContext.Provider
|
|
126
128
|
value={{
|
|
127
129
|
...props,
|
|
130
|
+
handleHelpScreen,
|
|
128
131
|
navigation,
|
|
129
132
|
convertFiltersToSQL,
|
|
130
133
|
components : {
|
|
@@ -11,13 +11,15 @@ import {useMemo,useEffect,useRef} from "react";
|
|
|
11
11
|
import { screenName as aboutScreenName} from "$escreens/Help/About";
|
|
12
12
|
import theme from "$theme";
|
|
13
13
|
import APP from "$capp/instance";
|
|
14
|
+
import useExpoUI from "$econtext";
|
|
14
15
|
|
|
15
16
|
const useGetItems = (options)=>{
|
|
16
17
|
const {navigation:{drawerItems}} = useContext();
|
|
17
18
|
options = defaultObj(options);
|
|
18
19
|
const {refresh,force} = options;
|
|
19
20
|
const showProfilOnDrawer = theme.showProfilAvatarOnDrawer;
|
|
20
|
-
const
|
|
21
|
+
const {handleHelpScreen} = useExpoUI();
|
|
22
|
+
const handleHelp = handleHelpScreen !== false;
|
|
21
23
|
const refreshItemsRef = useRef(false);
|
|
22
24
|
useEffect(()=>{
|
|
23
25
|
const refreshItems = (...a)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.
|
|
1
|
+
module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.28.0","repository":{"type":"git","url":"git+https://github.com/borispipo/expo-ui.git"},"homepage":"https://github.com/borispipo/expo-ui#readme"},"@emotion/native":{"version":"11.11.0","url":"https://emotion.sh","license":"MIT"},"@emotion/react":{"version":"11.11.1","url":"https://github.com/emotion-js/emotion/tree/main/packages/react","license":"MIT"},"@expo/html-elements":{"version":"0.5.1","url":"https://github.com/expo/expo/tree/main/packages/html-elements","license":"MIT"},"@expo/metro-config":{"version":"0.10.7","url":"https://github.com/expo/expo.git","license":"MIT"},"@expo/vector-icons":{"version":"13.0.0","url":"https://expo.github.io/vector-icons","license":"MIT"},"@expo/webpack-config":{"version":"19.0.0","url":"https://github.com/expo/expo-cli.git","license":"MIT"},"@faker-js/faker":{"version":"8.0.2","url":"https://github.com/faker-js/faker.git","license":"MIT"},"@fto-consult/common":{"version":"3.29.5","url":"https://github.com/borispipo/common#readme","license":"ISC"},"@pchmn/expo-material3-theme":{"version":"1.3.1","url":"https://github.com/pchmn/expo-material3-theme#readme","license":"MIT"},"@react-native-async-storage/async-storage":{"version":"1.18.2","url":"https://github.com/react-native-async-storage/async-storage#readme","license":"MIT"},"@react-native-community/datetimepicker":{"version":"7.2.0","url":"https://github.com/react-native-community/datetimepicker#readme","license":"MIT"},"@react-native-community/netinfo":{"version":"9.3.10","url":"https://github.com/react-native-netinfo/react-native-netinfo#readme","license":"MIT"},"@react-native/assets-registry":{"version":"0.72.0","url":"git@github.com:facebook/react-native.git","license":"MIT"},"@react-navigation/native":{"version":"6.1.7","url":"https://reactnavigation.org","license":"MIT"},"@react-navigation/native-stack":{"version":"6.9.13","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"@shopify/flash-list":{"version":"1.4.3","url":"https://shopify.github.io/flash-list/","license":"MIT"},"apexcharts":{"version":"3.42.0","url":"https://apexcharts.com","license":"MIT"},"babel-plugin-inline-dotenv":{"version":"1.7.0","url":"https://github.com/brysgo/babel-plugin-inline-dotenv#readme","license":"ISC"},"babel-plugin-module-resolver":{"version":"5.0.0","url":"https://github.com/tleunen/babel-plugin-module-resolver.git","license":"MIT"},"expo":{"version":"49.0.8","url":"https://github.com/expo/expo/tree/main/packages/expo","license":"MIT"},"expo-camera":{"version":"13.4.2","url":"https://docs.expo.dev/versions/latest/sdk/camera/","license":"MIT"},"expo-clipboard":{"version":"4.3.1","url":"https://docs.expo.dev/versions/latest/sdk/clipboard","license":"MIT"},"expo-font":{"version":"11.4.0","url":"https://docs.expo.dev/versions/latest/sdk/font/","license":"MIT"},"expo-image-picker":{"version":"14.3.2","url":"https://docs.expo.dev/versions/latest/sdk/imagepicker/","license":"MIT"},"expo-linking":{"version":"5.0.2","url":"https://docs.expo.dev/versions/latest/sdk/linking","license":"MIT"},"expo-sqlite":{"version":"11.3.2","url":"https://docs.expo.dev/versions/latest/sdk/sqlite/","license":"MIT"},"expo-status-bar":{"version":"1.6.0","url":"https://docs.expo.dev/versions/latest/sdk/status-bar/","license":"MIT"},"expo-system-ui":{"version":"2.4.0","url":"https://docs.expo.dev/versions/latest/sdk/system-ui","license":"MIT"},"expo-web-browser":{"version":"12.3.2","url":"https://docs.expo.dev/versions/latest/sdk/webbrowser/","license":"MIT"},"file-saver":{"version":"2.0.5","url":"https://github.com/eligrey/FileSaver.js#readme","license":"MIT"},"fs-extra":{"version":"11.1.1","url":"https://github.com/jprichardson/node-fs-extra","license":"MIT"},"google-libphonenumber":{"version":"3.2.33","url":"https://ruimarinho.github.io/google-libphonenumber/","license":"(MIT AND Apache-2.0)"},"htmlparser2-without-node-native":{"version":"3.9.2","url":"git://github.com/fb55/htmlparser2.git","license":"MIT"},"pdfmake":{"version":"0.2.7","url":"http://pdfmake.org","license":"MIT"},"process":{"version":"0.11.10","url":"git://github.com/shtylman/node-process.git","license":"MIT"},"prop-types":{"version":"15.8.1","url":"https://facebook.github.io/react/","license":"MIT"},"react":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-content-loader":{"version":"6.2.1","url":"https://github.com/danilowoz/react-content-loader","license":"MIT"},"react-dom":{"version":"18.2.0","url":"https://reactjs.org/","license":"MIT"},"react-native":{"version":"0.72.4","license":"MIT"},"react-native-big-list":{"version":"1.6.1","url":"https://marcocesarato.github.io/react-native-big-list-docs/","license":"GPL-3.0-or-later"},"react-native-blob-util":{"version":"0.18.6","url":"https://github.com/RonRadtke/react-native-blob-util","license":"MIT"},"react-native-gesture-handler":{"version":"2.12.1","url":"https://github.com/software-mansion/react-native-gesture-handler#readme","license":"MIT"},"react-native-iphone-x-helper":{"version":"1.3.1","url":"https://github.com/ptelad/react-native-iphone-x-helper#readme","license":"MIT"},"react-native-mime-types":{"version":"2.4.0","license":"MIT"},"react-native-paper":{"version":"5.10.3","url":"https://callstack.github.io/react-native-paper","license":"MIT"},"react-native-paper-dates":{"version":"0.18.14","url":"https://github.com/web-ridge/react-native-paper-dates#readme","license":"MIT"},"react-native-reanimated":{"version":"3.3.0","url":"https://github.com/software-mansion/react-native-reanimated#readme","license":"MIT"},"react-native-safe-area-context":{"version":"4.6.3","url":"https://github.com/th3rdwave/react-native-safe-area-context#readme","license":"MIT"},"react-native-screens":{"version":"3.22.1","url":"https://github.com/software-mansion/react-native-screens#readme","license":"MIT"},"react-native-svg":{"version":"13.9.0","url":"https://github.com/react-native-community/react-native-svg","license":"MIT"},"react-native-web":{"version":"0.19.7","url":"git://github.com/necolas/react-native-web.git","license":"MIT"},"react-native-webview":{"version":"13.2.2","url":"https://github.com/react-native-webview/react-native-webview#readme","license":"MIT"},"react-virtuoso":{"version":"4.5.0","url":"https://virtuoso.dev/","license":"MIT"},"sharp-cli":{"version":"4.1.1","url":"https://github.com/vseventer/sharp-cli","license":"MIT"},"tippy.js":{"version":"6.3.7","url":"https://atomiks.github.io/tippyjs/","license":"MIT"},"uninstall":{"version":"0.0.0","license":"MIT"},"websql":{"version":"2.0.3","url":"git://github.com/nolanlawson/node-websql.git","license":"Apache-2.0"},"xlsx":{"version":"0.18.5","url":"https://sheetjs.com/","license":"Apache-2.0"}};
|
package/src/screens/index.js
CHANGED
|
@@ -3,4 +3,16 @@ import Help from "./Help";
|
|
|
3
3
|
export default [
|
|
4
4
|
...Auth,
|
|
5
5
|
...Help,
|
|
6
|
-
]
|
|
6
|
+
]
|
|
7
|
+
|
|
8
|
+
export const getMainScreens = (handleHelpScreen)=>{
|
|
9
|
+
const screens = [Auth];
|
|
10
|
+
if(handleHelpScreen !== false){
|
|
11
|
+
screens.push(Help);
|
|
12
|
+
}
|
|
13
|
+
return screens;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const screensWithoutHelp = [...Auth];
|
|
17
|
+
|
|
18
|
+
export {Help};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|