@fto-consult/expo-ui 6.28.0 → 6.29.0
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/app.config.json +1 -1
- package/package.json +2 -2
- package/src/components/Datagrid/Test/index.js +1 -1
- package/src/components/Dialog/Dialog.js +2 -5
- package/src/components/Drawer/DrawerItems/DrawerSection.js +1 -2
- package/src/components/Drawer/DrawerItems/index.js +12 -2
- package/src/components/Portal/index copy.js +13 -0
- package/src/components/Portal/index.js +3 -12
- package/src/components/SimpleSelect/index.js +1 -1
- package/src/context/Provider.js +7 -4
- package/src/index.js +10 -13
- 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/test-screens/Home.js +0 -2
- /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/app.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fto-consult/expo-ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.29.0",
|
|
4
4
|
"description": "Bibliothèque de composants UI Expo,react-native",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@expo/html-elements": "^0.5.1",
|
|
69
69
|
"@expo/vector-icons": "^13.0.0",
|
|
70
70
|
"@faker-js/faker": "^8.0.2",
|
|
71
|
-
"@fto-consult/common": "^3.29.
|
|
71
|
+
"@fto-consult/common": "^3.29.8",
|
|
72
72
|
"@pchmn/expo-material3-theme": "^1.3.1",
|
|
73
73
|
"@react-native-async-storage/async-storage": "1.18.2",
|
|
74
74
|
"@react-native-community/datetimepicker": "7.2.0",
|
|
@@ -7,7 +7,7 @@ import React from "$react";
|
|
|
7
7
|
import { faker } from '@faker-js/faker';
|
|
8
8
|
export default function TestDatagridComponent({count,...props}){
|
|
9
9
|
const data = React.useMemo(()=>{
|
|
10
|
-
count = typeof count =='number' && count >
|
|
10
|
+
count = typeof count =='number' && count > 5 ? count : 100;
|
|
11
11
|
return faker.helpers.multiple(createRandomUser, {
|
|
12
12
|
count,
|
|
13
13
|
});
|
|
@@ -14,7 +14,6 @@ import DialogTitle from './DialogTitle';
|
|
|
14
14
|
import {MAX_WIDTH,SCREEN_INDENT,MIN_HEIGHT} from "./utils";
|
|
15
15
|
import {isMobileOrTabletMedia,isMobileMedia} from "$cplatform/dimensions";
|
|
16
16
|
import Platform,{isMobileNative} from "$cplatform";
|
|
17
|
-
import Portal from "$ecomponents/Portal";
|
|
18
17
|
import Icon,{BACK_ICON} from "$ecomponents/Icon";
|
|
19
18
|
import {ACTION_ICON_SIZE} from "$ecomponents/AppBar";
|
|
20
19
|
import DialogFooter from "./DialogFooter";
|
|
@@ -183,8 +182,7 @@ const DialogComponent = React.forwardRef((props,ref)=>{
|
|
|
183
182
|
{content}
|
|
184
183
|
</ScrollView>
|
|
185
184
|
}
|
|
186
|
-
return <
|
|
187
|
-
<ModalComponent
|
|
185
|
+
return <ModalComponent
|
|
188
186
|
onDismiss={(e)=>{
|
|
189
187
|
return handleBack(e,false);
|
|
190
188
|
}}
|
|
@@ -272,8 +270,7 @@ const DialogComponent = React.forwardRef((props,ref)=>{
|
|
|
272
270
|
/> : null}
|
|
273
271
|
</Surface>
|
|
274
272
|
</DialogContent>
|
|
275
|
-
|
|
276
|
-
</Portal>
|
|
273
|
+
</ModalComponent>
|
|
277
274
|
});
|
|
278
275
|
export default DialogComponent;
|
|
279
276
|
|
|
@@ -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)=>{
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* MIT License
|
|
3
|
+
Copyright (c) 2020 Mo Gorhom
|
|
4
|
+
@see : https://github.com/gorhom/react-native-portal
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export {default} from "./Portal";
|
|
8
|
+
|
|
9
|
+
export {default as PortalHost} from "./PortalHost";
|
|
10
|
+
|
|
11
|
+
export {default as PortalProvider} from "./PortalProvider";
|
|
12
|
+
|
|
13
|
+
export * from "./hooks";
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* MIT License
|
|
3
|
-
Copyright (c) 2020 Mo Gorhom
|
|
4
|
-
@see : https://github.com/gorhom/react-native-portal
|
|
5
|
-
*/
|
|
1
|
+
import {Portal} from "react-native-paper";
|
|
6
2
|
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
export {default as PortalHost} from "./PortalHost";
|
|
10
|
-
|
|
11
|
-
export {default as PortalProvider} from "./PortalProvider";
|
|
12
|
-
|
|
13
|
-
export * from "./hooks";
|
|
3
|
+
export default Portal;
|
|
4
|
+
export const PortalHost = Portal.Host;
|
|
@@ -289,7 +289,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
|
|
|
289
289
|
rippleColor={undefined}
|
|
290
290
|
onLayout={onLayout}
|
|
291
291
|
>
|
|
292
|
-
|
|
292
|
+
{anchor}
|
|
293
293
|
</Pressable>
|
|
294
294
|
const getItemLayout = typeof listProps.itemHeight ==='number' && listProps.itemHeight ? (data, index) => (
|
|
295
295
|
{length: listProps.itemHeight, offset: listProps.itemHeight * index, index}
|
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 : {
|
package/src/index.js
CHANGED
|
@@ -27,7 +27,6 @@ import DialogProvider from "$ecomponents/Dialog/Provider";
|
|
|
27
27
|
import SimpleSelect from '$ecomponents/SimpleSelect';
|
|
28
28
|
import {Provider as AlertProvider} from '$ecomponents/Dialog/confirm/Alert';
|
|
29
29
|
import { DialogProvider as FormDataDialogProvider } from '$eform/FormData';
|
|
30
|
-
import {PortalProvider,CustomPortal} from '$ecomponents/Portal';
|
|
31
30
|
import ErrorBoundaryProvider from "$ecomponents/ErrorBoundary/Provider";
|
|
32
31
|
import notify, {notificationRef} from "$notify";
|
|
33
32
|
import DropdownAlert from '$ecomponents/Dialog/DropdownAlert';
|
|
@@ -283,7 +282,7 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render,onMount})
|
|
|
283
282
|
},
|
|
284
283
|
}}
|
|
285
284
|
>
|
|
286
|
-
<
|
|
285
|
+
<Portal.Host testID="RN_NativePaperPortalHost">
|
|
287
286
|
<ErrorBoundaryProvider/>
|
|
288
287
|
<PreloaderProvider/>
|
|
289
288
|
<DialogProvider responsive testID={"RN_MainAppDialogProvider"}/>
|
|
@@ -291,17 +290,15 @@ function App({init:initApp,initialRouteName:appInitialRouteName,render,onMount})
|
|
|
291
290
|
<FormDataDialogProvider/>
|
|
292
291
|
<BottomSheetProvider/>
|
|
293
292
|
<DropdownAlert ref={notificationRef}/>
|
|
294
|
-
<
|
|
295
|
-
<
|
|
296
|
-
|
|
297
|
-
<
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
</Portal.Host>
|
|
304
|
-
</PortalProvider>
|
|
293
|
+
<ErrorBoundary>
|
|
294
|
+
<StatusBar/>
|
|
295
|
+
<SplashScreen isLoaded={isLoaded}>
|
|
296
|
+
<PreferencesContext.Provider value={preferences}>
|
|
297
|
+
{React.isValidElement(content) && content || child}
|
|
298
|
+
</PreferencesContext.Provider>
|
|
299
|
+
</SplashScreen>
|
|
300
|
+
</ErrorBoundary>
|
|
301
|
+
</Portal.Host>
|
|
305
302
|
</PaperProvider>
|
|
306
303
|
</GestureHandlerRootView>
|
|
307
304
|
</AuthProvider>;
|
|
@@ -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 = {"@
|
|
1
|
+
module.exports = {"@FTO-CONSULT/EXPO-UI":{"name":"@FTO-CONSULT/EXPO-UI","version":"6.28.1","homepage":"https://github.com/borispipo/expo-ui#readme"}};
|
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};
|
package/src/test-screens/Home.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|