@fto-consult/expo-ui 5.8.0 → 5.8.2

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/appConfig.txt CHANGED
@@ -21,4 +21,6 @@
21
21
  getTableData : {function(tableName)=>table} retourne l'ojet table data,
22
22
  swrRefreshTimeout : {number} le délai d'inactivité auquel, une fois l'application active, les données de type listData sont rafraichies
23
23
  handleHelpScreen : {boolean}, //if Help screen will be added on navigation's main drawer
24
+
25
+ checkNavigationPermsOnTableOrStructData : {boolean}, si le test de la permission sur la table data où sur la struct data sera effectuée lorsqu'on appelera la fonction navigateToTableData ou navigateToStructData
24
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "5.8.0",
3
+ "version": "5.8.2",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -61,7 +61,7 @@
61
61
  "@emotion/native": "^11.10.6",
62
62
  "@expo/html-elements": "^0.2.0",
63
63
  "@expo/vector-icons": "^13.0.0",
64
- "@fto-consult/common": "^3.10.69",
64
+ "@fto-consult/common": "^3.10.70",
65
65
  "@gorhom/portal": "^1.0.14",
66
66
  "@react-native-async-storage/async-storage": "^1.17.11",
67
67
  "@react-native-community/datetimepicker": "^6.7.3",
@@ -71,7 +71,7 @@
71
71
  "@react-navigation/native-stack": "^6.9.12",
72
72
  "@shopify/flash-list": "^1.4.0",
73
73
  "apexcharts": "^3.37.2",
74
- "expo": "^48.0.10",
74
+ "expo": "^48.0.15",
75
75
  "expo-camera": "~13.2.1",
76
76
  "expo-clipboard": "~4.1.1",
77
77
  "expo-font": "~11.1.1",
@@ -107,7 +107,6 @@
107
107
  "react-virtuoso": "^4.0.9",
108
108
  "sharp-cli": "^2.1.0",
109
109
  "tippy.js": "^6.3.7",
110
- "use-event-callback": "^0.1.0",
111
110
  "websql": "^2.0.3",
112
111
  "xlsx": "^0.18.5"
113
112
  },
package/src/App.js CHANGED
@@ -31,8 +31,6 @@ Object.map(Utils,(v,i)=>{
31
31
  }
32
32
  });
33
33
  export default function getIndex({onMount,onUnmount,swrConfig,render,onRender,preferences:appPreferences,...rest}){
34
- const child = <Index {...rest} theme={theme}/>;
35
- const content = typeof render == 'function'? render({children:child}) : child;
36
34
  const isScreenFocusedRef = React.useRef(true);
37
35
  ///garde pour chaque écran sa date de dernière activité
38
36
  const screensRef = React.useRef({});//la liste des écrans actifs
@@ -110,6 +108,8 @@ export default function getIndex({onMount,onUnmount,swrConfig,render,onRender,pr
110
108
  theme,
111
109
  ...defaultObj(pref),
112
110
  }),[theme,pref]);
111
+ const child = <Index {...rest} theme={theme}/>;
112
+ const content = typeof render == 'function'? render({children:child,appConfig,config:appConfig}) : child;
113
113
  return (
114
114
  <SWRConfig
115
115
  value={{
@@ -10,11 +10,11 @@ const GridComponent = React.forwardRef((p,ref)=>{
10
10
  const {onPress,responsive,activeOpacity,onLongPress,flexGrow =1,flex:customFlex,style,onPressIn,col,onPressOut,...props} = p;
11
11
  const testID = defaultStr(props.testID,"RN_GridComponent");
12
12
  const flattenedStyle = StyleSheet.flatten(style);
13
- const flex = customFlex !== undefined ? customFlex : (flattenedStyle && (col && flattenedStyle.width || !col && flattenedStyle.height)) ? 0 : 0;
13
+ const flex = customFlex !== undefined ? customFlex : (flattenedStyle && (col && flattenedStyle.width || !col && flattenedStyle.height)) ? undefined : undefined;
14
14
  const C = onPress || onLongPress || onPressIn || onPressOut ? TouchableOpacity : View;
15
15
  return <C {...props} activeOpacity={activeOpacity} onLongPress={onLongPress} onPressIn={onPressIn} onPressOut={onPressOut}
16
16
  testID={testID+"_Container"} onPress={onPress}
17
- style={[styles.container,{flexGrow},col && {flexDirection:'column'},responsive!== false && !col && grid.row(false),style,{flex}]} ref={ref}
17
+ style={[styles.container,{flexGrow},col && {flexDirection:'column'},responsive!== false && !col && grid.row(false),style,flex !== undefined && {flex}]} ref={ref}
18
18
  />
19
19
  });
20
20
 
@@ -12,7 +12,7 @@ import {
12
12
  import theme from "$theme";
13
13
  import {defaultObj,isObj,defaultStr} from "$cutils";
14
14
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
15
- import useEventCallback from 'use-event-callback';
15
+ import useEventCallback from '$react/useEventCallback';
16
16
  import PropTypes from "prop-types";
17
17
  import Surface from '$ecomponents/Surface';
18
18
  import Label from "$ecomponents/Label"
@@ -89,6 +89,6 @@ const styles = StyleSheet.create({
89
89
  tables : PropTypes.oneOfType([
90
90
  PropTypes.objectOf(PropTypes.object),
91
91
  PropTypes.arrayOf(PropTypes.object)
92
- ]).isRequired,
92
+ ]),
93
93
  screenName : PropTypes.string,
94
94
  }
@@ -3,7 +3,7 @@
3
3
  // license that can be found in the LICENSE file.
4
4
  import {navigate,sanitizeName} from "$cnavigation";
5
5
  import {isNonNullString,defaultStr,defaultObj,isObj} from "$cutils";
6
-
6
+ import appConfig from "$capp/config";
7
7
 
8
8
  export const tableDataRouteName = 'TableData';
9
9
 
@@ -25,10 +25,12 @@ const navigateToTableOrStructData = function(tableName,params,actionType){
25
25
  const isTableData = actionType =='tabledata';
26
26
  if(isNonNullString(perm)){
27
27
  isAllowed = Auth.isAllowedFromStr(perm)
28
- } else if(actionType =='structdata') {
29
- isAllowed = Auth.isStructDataAllowed({table:tableName})
30
- } else if(isTableData){
31
- isAllowed = Auth.isTableDataAllowed({table:tableName});
28
+ } else if(appConfig.checkNavigationPermsOnTableOrStructData !== false){
29
+ if(actionType =='structdata') {
30
+ isAllowed = Auth.isStructDataAllowed({table:tableName})
31
+ } else if(isTableData){
32
+ isAllowed = Auth.isTableDataAllowed({table:tableName});
33
+ }
32
34
  }
33
35
  if(!isAllowed){
34
36
  return Auth.showError();