@fto-consult/expo-ui 6.24.2 → 6.25.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.
Files changed (69) hide show
  1. package/app.config.json +1 -1
  2. package/babel.config.alias.js +2 -1
  3. package/babel.config.js +1 -1
  4. package/electron/utils/env.js +80 -0
  5. package/expo-ui-path.js +2 -2
  6. package/index.js +14 -13
  7. package/is-local-dev.js +5 -0
  8. package/metro.config.js +3 -2
  9. package/package.json +7 -4
  10. package/readChart.txt +4 -1
  11. package/src/App.js +3 -3
  12. package/src/components/Datagrid/Accordion/Row.js +74 -100
  13. package/src/components/Datagrid/Accordion/ToogleRow.js +9 -0
  14. package/src/components/Datagrid/Accordion/index.js +30 -35
  15. package/src/components/Datagrid/Actions/index.js +12 -44
  16. package/src/components/Datagrid/Checkbox.js +4 -7
  17. package/src/components/Datagrid/Common/Common.js +121 -152
  18. package/src/components/Datagrid/Dashboard/index.js +2 -2
  19. package/src/components/Datagrid/IndexComponent.js +8 -13
  20. package/src/components/Datagrid/Table/index.js +53 -51
  21. package/src/components/Datagrid/Test/index.js +10 -3
  22. package/src/components/Datagrid/events/evx.js +7 -0
  23. package/src/components/Datagrid/events/index.js +11 -0
  24. package/src/components/Datagrid/hooks/Provider.js +6 -0
  25. package/src/components/Datagrid/hooks/context.js +5 -0
  26. package/src/components/Datagrid/hooks/index.js +104 -0
  27. package/src/components/Datagrid/utils.js +8 -5
  28. package/src/components/Dialog/Dialog.js +13 -12
  29. package/src/components/Dialog/DialogContent.js +11 -0
  30. package/src/components/KeyboardAvoidingView/index.js +7 -3
  31. package/src/components/Label/index.js +8 -4
  32. package/src/components/List/Common.js +5 -3
  33. package/src/components/List/FlashList.js +13 -13
  34. package/src/components/List/Virtuoso/index.js +68 -10
  35. package/src/components/List/Virtuoso/index.native.js +6 -1
  36. package/src/components/Table/Header/Cell/index.js +10 -0
  37. package/src/components/Table/Header/Cell/index.native.js +7 -0
  38. package/src/components/Table/Header/index.js +34 -0
  39. package/src/components/Table/List/index.js +3 -1
  40. package/src/components/Table/List/index.native.js +2 -1
  41. package/src/components/Table/Row/Cell/Content.js +16 -0
  42. package/src/components/Table/Row/Cell/Content.native.js +15 -0
  43. package/src/components/Table/Row/Cell/index.js +30 -0
  44. package/src/components/Table/Row/RowWrapper.js +7 -0
  45. package/src/components/Table/Row/RowWrapper.native.js +11 -0
  46. package/src/components/Table/Row/index.js +38 -0
  47. package/src/components/Table/RowTemplate/index.js +10 -0
  48. package/src/components/Table/RowTemplate/index.web.js +9 -0
  49. package/src/components/Table/ScrollNative/index.js +7 -0
  50. package/src/components/Table/ScrollNative/index.native.js +8 -0
  51. package/src/components/Table/VirtuosoTable/index.js +5 -0
  52. package/src/components/Table/VirtuosoTable/index.native.js +3 -0
  53. package/src/components/Table/hooks.js +84 -0
  54. package/src/components/Table/index.js +92 -250
  55. package/src/components/Table/styles.js +104 -0
  56. package/src/components/Table/utils.js +1 -0
  57. package/src/context/Provider.js +16 -2
  58. package/src/layouts/AppBar/index.js +11 -10
  59. package/src/layouts/Screen/ScreenWithoutAuthContainer.js +14 -6
  60. package/src/navigation/Drawer/items/index.js +2 -1
  61. package/src/navigation/index.js +11 -3
  62. package/src/screens/Help/About.js +1 -1
  63. package/src/screens/Help/openLibraries.js +1 -1
  64. package/src/test-screens/Home.js +4 -1
  65. package/webpack.config.js +4 -2
  66. package/src/components/Table/Cell.js +0 -24
  67. package/src/components/Table/FiltersOrFooters.js +0 -18
  68. package/src/components/Table/Header.js +0 -25
  69. package/src/components/Table/Row.js +0 -21
@@ -51,9 +51,11 @@ export default function MainScreenScreenWithoutAuthContainer(props) {
51
51
  containerProps,
52
52
  testID,
53
53
  right,
54
+ keyboardAvoidingViewProps,
54
55
  ...rest
55
56
  } = props;
56
57
  const insets = useSafeAreaInsets();
58
+ keyboardAvoidingViewProps = defaultObj(keyboardAvoidingViewProps);
57
59
  testID = defaultStr(testID,"RN_MainScreenScreenWithoutAuthContainer")
58
60
  containerProps = defaultObj(containerProps);
59
61
  const backgroundColor = theme.colors.background;
@@ -106,7 +108,8 @@ export default function MainScreenScreenWithoutAuthContainer(props) {
106
108
  const WrapperProps = modal? {screenName} : {};
107
109
  const portalId = uniqid("screeen-container-"+screenName);
108
110
  return <Wrapper {...WrapperProps}>
109
- <KeyboardAvoidingView testID={testID} id={portalId} {...containerProps} style={[styles.container,{backgroundColor},modal && styles.modal,containerProps.style]}>
111
+ <View testID={testID+"_ScreenContentContainer"} id={portalId} style={[containerStyle,{backgroundColor},modal && styles.modal,containerProps.style]} {...containerProps}>
112
+ <KeyboardAvoidingView testID={testID} {...keyboardAvoidingViewProps} style={[styles.keyboardAvoidingView,keyboardAvoidingViewProps.style]}>
110
113
  {withStatusBar !== false ? <StatusBar/> : null}
111
114
  {appBar === false ? null : React.isValidElement(appBar)? state.AppBar : <AppBar
112
115
  testID={testID+'_AppBar'} {...appBarProps}
@@ -121,19 +124,20 @@ export default function MainScreenScreenWithoutAuthContainer(props) {
121
124
  <ScrollView
122
125
  testID = {testID+'_ScreenContentScrollView'}
123
126
  {...rest}
124
- contentContainerStyle={[contentContainerStyle]}
125
- style={[containerStyle,styles.container, style]}
127
+ contentContainerStyle={[contentContainerStyle,styles.container]}
128
+ style={[style]}
126
129
  >
127
130
  {children}
128
131
  {fab}
129
132
  </ScrollView>
130
133
  ) : (
131
- <View testID={testID+'_ScreenContent'} {...rest} style={[containerStyle,styles.wrapper,styles.container, style]}>
134
+ <View testID={testID+'_ScreenContent'} {...rest} style={[styles.container, style]}>
132
135
  {children}
133
136
  {fab}
134
137
  </View>
135
138
  )}
136
- </KeyboardAvoidingView>
139
+ </KeyboardAvoidingView>
140
+ </View>
137
141
  </Wrapper>
138
142
  }
139
143
 
@@ -147,8 +151,12 @@ const styles = StyleSheet.create({
147
151
  container: {
148
152
  flex: 1,
149
153
  },
154
+ keyboardAvoidingView : {
155
+ flex : 1,
156
+ backgroundColor : "transparent",
157
+ },
150
158
  wrapper : {
151
- flexDirection:'column',
159
+ flex : 1,
152
160
  /*flex : 1,
153
161
  flexGrow : 1,
154
162
  alignItems:'center'*/
@@ -29,11 +29,12 @@ const useGetItems = (options)=>{
29
29
  APP.on(APP.EVENTS.REFRESH_MAIN_DRAWER,refreshItems);
30
30
  APP.on(APP.EVENTS.AUTH_LOGIN_USER,refreshItems);
31
31
  APP.on(APP.EVENTS.AUTH_LOGOUT_USER,refreshItems);
32
+ APP.on(APP.EVENTS.UPDATE_THEME,refreshItems);
32
33
  return ()=>{
33
34
  APP.off(APP.EVENTS.REFRESH_MAIN_DRAWER,refreshItems);
34
35
  APP.off(APP.EVENTS.AUTH_LOGIN_USER,refreshItems);
35
36
  APP.off(APP.EVENTS.AUTH_LOGOUT_USER,refreshItems);
36
- APP.off(APP.EVENTS.UPDATE_THEME,onLogoutUser);
37
+ APP.off(APP.EVENTS.UPDATE_THEME,refreshItems);
37
38
  }
38
39
  },[])
39
40
  return useMemo(()=>{
@@ -5,6 +5,7 @@ import React from "$react";
5
5
  import DrawerNavigator from "./Drawer";
6
6
  import useContext from "$econtext/hooks";
7
7
  import { MainNavigationProvider } from "./hooks";
8
+ import {isWeb,isAndroid} from "$cplatform";
8
9
 
9
10
  export * from "./hooks";
10
11
 
@@ -29,13 +30,19 @@ export default function NavigationComponent (props){
29
30
  const opts = {
30
31
  headerShown : false,
31
32
  header : ()=> null,
33
+ presentation : isAndroid()? "card":"default",
34
+ animationEnabled : true,
35
+ }
36
+ const cardStyle = { backgroundColor: 'transparent' };
37
+ if(isWeb()){
38
+ cardStyle.flex = 1;
32
39
  }
33
40
  return <MainNavigationProvider {...rest} onGetStart={onGetStart} state={state} initialRouteName={initialRouteName}>
34
41
  <DrawerNavigator {...props}>
35
42
  {<Stack.Navigator
36
- initialRouteName={initialRouteName}
37
- screenOptions={opts}
38
- >
43
+ initialRouteName={initialRouteName}
44
+ screenOptions={opts}
45
+ >
39
46
  {<Stack.Group screenOptions={{...opts}}>
40
47
  {drawerScreens}
41
48
  </Stack.Group>}
@@ -44,6 +51,7 @@ export default function NavigationComponent (props){
44
51
  screenOptions={{
45
52
  ...opts,
46
53
  presentation: 'transparentModal',
54
+ cardStyle
47
55
  }}
48
56
  >
49
57
  {stackScreens}
@@ -63,7 +63,7 @@ export default function HelpScreen(props){
63
63
  const borderStyle = {borderColor:theme.colors.divider,borderWidth:1,justifyContent:'space-between'};
64
64
  const testID = defaultStr(props.testID,"RN_HelpAboutScreenComponent")
65
65
  return <Screen withScrollView title={title} {...props} testID={testID+"_Screen"} contentContainerStyle={[{flex:1},theme.styles.alignItemsCenter,theme.styles.justifyContentCenter]}>
66
- <View testID={testID+"_Container"} style={[theme.styles.alignItemsCenter,theme.styles.justifyContentCenter,theme.styles.flex1,theme.styles.w100,theme.styles.p1]}>
66
+ <View testID={testID+"_Container"} style={[theme.styles.alignItemsCenter,theme.styles.justifyContentCenter,theme.styles.w100,theme.styles.p1]}>
67
67
  <Logo testID={testID+"_Logo"} style={{marginRight:10}}/>
68
68
  {getReleaseText()}
69
69
  <Divider testID={testID+"_Divider1"} style={[theme.styles.mv1]}/>
@@ -1 +1 @@
1
- module.exports = {"@FTO-CONSULT/EXPO-UI":{"name":"@FTO-CONSULT/EXPO-UI","version":"6.23.10","homepage":"https://github.com/borispipo/expo-ui#readme"}};
1
+ module.exports = {"@fto-consult/expo-ui":{"name":"@fto-consult/expo-ui","version":"6.24.2","repository":{"type":"git","url":"git+https://github.com/borispipo/expo-ui.git"},"homepage":"https://github.com/borispipo/expo-ui#readme"}};
@@ -1,8 +1,11 @@
1
1
  import Screen from "$eScreen";
2
2
  import Test from "$ecomponents/Datagrid/Test";
3
+ import React from "$react";
3
4
 
4
5
  export default function HomeScreen(props){
5
- return <Screen{...props}>
6
+ React.useEffect(()=>{
7
+ },[])
8
+ return <Screen{...props} contentContainerStyle={[{flex:1}]}>
6
9
  <Test/>
7
10
  </Screen>
8
11
  };
package/webpack.config.js CHANGED
@@ -8,8 +8,10 @@ const path = require("path");
8
8
 
9
9
  // Expo CLI will await this method so you can optionally return a promise.
10
10
  module.exports = async function(env, argv,opts) {
11
- const nodeModulePath = `${process.cwd()}/node_modules`;
12
- const wConfigPath = fs.existsSync(`${nodeModulePath}/@expo/webpack-config`) && `${nodeModulePath}/@expo/webpack-config` || "@expo/webpack-config";
11
+ const isLocalDev = require("./is-local-dev")();//si l'application est en developpement local
12
+ const nodeModulePath = path.resolve(`${process.cwd()}`,"node_modules");
13
+ const localNodeEuiP = path.resolve(nodeModulePath,"@expo/webpack-config");
14
+ const wConfigPath = fs.existsSync(localNodeEuiP) && localNodeEuiP || "@expo/webpack-config";
13
15
  const createExpoWebpackConfigAsync = require(wConfigPath);
14
16
  env = env || {};
15
17
  opts = typeof opts =="object" && opts ? opts : {};
@@ -1,24 +0,0 @@
1
- // Copyright 2023 @fto-consult/Boris Fouomene. All rights reserved.
2
- // Use of this source code is governed by a BSD-style
3
- // license that can be found in the LICENSE file.
4
- import React from "react";
5
- import { View } from "react-native";
6
- import {defaultObj} from "$cutils";
7
- import Label from "$ecomponents/Label";
8
-
9
- function TableCellComponent({cellArgs,rowArgs,children,renderCell,rowIndex,style,...rest}){
10
- const {content,containerProps} = React.useMemo(()=>{
11
- const rArgs = {...cellArgs,...rowArgs,containerProps : {}};
12
- const r = typeof renderCell =='function' && renderCell (rArgs) || children;
13
- return {
14
- content : typeof r =='string' || typeof r =='number'? <Label children={r}/> : React.isValidElement(r)? r : null,
15
- containerProps : defaultObj(rArgs.containerProps)
16
- }
17
- },[children]);
18
- return (<View {...containerProps} {...rest} style={[style,containerProps.style]} >
19
- {content}
20
- </View>);
21
- }
22
- //const TableCellComponent = React.memo(TableCellComponent);;
23
- export default TableCellComponent;
24
- TableCellComponent.displayName = "TableCellComponent";
@@ -1,18 +0,0 @@
1
- // Copyright 2023 @fto-consult/Boris Fouomene. All rights reserved.
2
- // Use of this source code is governed by a BSD-style
3
- // license that can be found in the LICENSE file.
4
- import React from "$react";
5
- import { View } from "react-native";
6
- import PropTypes from "prop-types";
7
- export default function TableFiltersComponent({visible,children:cChildren,...rest}){
8
- const children = React.useMemo(()=>{
9
- return cChildren;
10
- },[cChildren]);
11
- return <View {...rest} style={[rest.style,!visible && {height:0,opacity:0,display:'none'}]}>
12
- {children}
13
- </View>
14
- }
15
-
16
- TableFiltersComponent.propTypes = {
17
- visible : PropTypes.bool,
18
- }
@@ -1,25 +0,0 @@
1
- // Copyright 2023 @fto-consult/Boris Fouomene. All rights reserved.
2
- // Use of this source code is governed by a BSD-style
3
- // license that can be found in the LICENSE file.
4
-
5
- // Copyright 2023 @fto-consult/Boris Fouomene. All rights reserved.
6
- // Use of this source code is governed by a BSD-style
7
- // license that can be found in the LICENSE file.
8
- import React from "$react";
9
- import { View } from "react-native";
10
- import PropTypes from "prop-types";
11
- export default function TableHeaderComponent({cells,columns,...rest}){
12
- const children = React.useMemo(()=>{
13
- if(Array.isArray(cells)){
14
- return null;
15
- }
16
- return cells;
17
- },[cells,columns]);
18
- return <View {...rest}>
19
- {children}
20
- </View>
21
- }
22
-
23
- TableHeaderComponent.propTypes = {
24
- columns : PropTypes.arrayOf(PropTypes.bool)
25
- }
@@ -1,21 +0,0 @@
1
- // Copyright 2023 @fto-consult/Boris Fouomene. All rights reserved.
2
- // Use of this source code is governed by a BSD-style
3
- // license that can be found in the LICENSE file.
4
- import React from "$react";
5
- import { View } from "react-native";
6
- import PropTypes from "prop-types";
7
- export default function TableRowComponent({cells,columns,...rest}){
8
- const children = React.useMemo(()=>{
9
- if(Array.isArray(cells)){
10
- return cells.map((cell,index)=>columns[index]? <React.Fragment key={index}>{cell}</React.Fragment> : null )
11
- }
12
- return cells;
13
- },[cells,columns]);
14
- return <View {...rest}>
15
- {children}
16
- </View>
17
- }
18
-
19
- TableRowComponent.propTypes = {
20
- columns : PropTypes.arrayOf(PropTypes.bool)
21
- }