@fto-consult/expo-ui 7.16.8 → 7.16.9

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.
@@ -2,7 +2,8 @@
2
2
  /*** here you can export list of main drawerItems,
3
3
  [key1] : {
4
4
  label{string|ReactNode} : drawerLabel1,
5
- routeName {string}, drawer routeName
5
+ routeName {string}, drawer routeName,
6
+ drawerSection {string}, drawer section
6
7
  routeParams {object}, list of custom params to pass to the navignation route,
7
8
  icon {string|ReactNode}, icon,
8
9
  left {function|string|ReactNode}, drawerItemLeft
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.16.8",
3
+ "version": "7.16.9",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -3,7 +3,7 @@
3
3
  // license that can be found in the LICENSE file.
4
4
 
5
5
  import { isRouteActive} from "$cnavigation";
6
- import {defaultObj,sortBy,defaultStr,isObj} from "$cutils";
6
+ import {defaultObj,sortBy,defaultStr,isObj,isNonNullString,extendObj} from "$cutils";
7
7
  import appConfig from "$capp/config";
8
8
  import useContext from "$econtext/hooks";
9
9
  import {useMemo,useEffect,useRef} from "react";
@@ -16,6 +16,8 @@ import useExpoUI from "$econtext/hooks";
16
16
  import Auth,{useIsSignedIn,tableDataPerms} from "$cauth";
17
17
  import {getTableDataListRouteName} from "$enavigation/utils";
18
18
  import {isValidElement,usePrevious} from "$react";
19
+
20
+ /***** les props supplémentaires à passer aux drawers items d'une table de données sont dans le champ drawerItemProps */
19
21
  const useGetItems = (options)=>{
20
22
  const {navigation:{drawerItems,drawerSections,drawerItemsMutator},tablesData} = useContext();
21
23
  options = defaultObj(options);
@@ -84,8 +86,11 @@ const useGetItems = (options)=>{
84
86
  tProps[v] = table[v];
85
87
  }
86
88
  })
89
+ if(isObj(table.drawerItemProps)){
90
+ extendObj(tProps,table.drawerItemProps);
91
+ };
87
92
  const toP = {
88
- routeName : defaultStr(table.routeName,getTableDataListRouteName(tableName)),
93
+ routeName : table.routeName === false ? undefined : defaultStr(table.routeName,getTableDataListRouteName(tableName)),
89
94
  ...tProps,
90
95
  routeParams : {tableName,...Object.assign({},tProps.routeParams)}
91
96
  };