@fto-consult/expo-ui 8.82.5 → 8.82.7

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.82.5",
3
+ "version": "8.82.7",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "react-native-paper-doc": "https://github.com/callstack/react-native-paper/tree/main/docs/docs/guides",
6
6
  "scripts": {
@@ -106,7 +106,7 @@ const AppBarComponent = React.forwardRef((props,ref)=> {
106
106
  return setLayout({...Dimensions.get("window")});
107
107
  }
108
108
  const rightContent = typeof right =='function' ? right ({drawerRef,context,isMobile:Dimensions.isMobileMedia(),isDesktop:Dimensions.isDesktopMedia(),isTablet:Dimensions.isTabletMedia(),isPhone:Dimensions.isPhoneMedia(),dimensions,...dimensions}): right;
109
- const splitedActions = isSplitedActions(actions)? actions: splitActions({...appBarProps,windowWidth:layout.width,canGoBack:back || options.back?true:false,isAppBarAction:true,onBackActionPress,goBack,route,navigation,actions});
109
+ const splitedActions = isSplitedActions(actions)? actions: splitActions({windowWidth:layout.width,...appBarProps,canGoBack:back || options.back?true:false,isAppBarAction:true,onBackActionPress,goBack,route,navigation,actions});
110
110
  const onPageResize = bindResizeEvent !== false ? (e)=>{
111
111
  if(!e || !e.nativeEvent || !e.nativeEvent.layout) return null;
112
112
  const {width,height} = e.nativeEvent.layout;
@@ -8,6 +8,7 @@ import Action from "$ecomponents/Form/Action";
8
8
  import Menu from "$ecomponents/Menu";
9
9
  import Icon,{ MORE_ICON } from "$ecomponents/Icon";
10
10
  import {isAllowedFromStr} from "$cauth/perms";
11
+ import breakpoints from "$cdimensions/breakpoints";
11
12
 
12
13
  export const ACTION_ICON_SIZE = 30;
13
14
 
@@ -86,7 +87,7 @@ export const splitActions = (args)=>{
86
87
  onAlertRequestClose = defaultFunc(onAlertRequestClose);
87
88
  }
88
89
  opts = defaultObj(opts);
89
- const isMobile = isMobileOrTabletMedia();
90
+ const isMobile = isMobileOrTabletMedia() || typeof opts.windowWidth =="number" && opts.windowWidth < breakpoints.all.md;
90
91
  const isAppBarAction = opts.isAppBarAction && isMobile ? true : false;
91
92
  const ActionComponent = isAppBarAction ? Icon : Button;
92
93
  let menus = []
@@ -128,11 +128,10 @@ export default class DrawerLayout extends React.PureComponent {
128
128
  return defaultStr(this.state.portalProps.testID,"RN_DrawerLayoutPortal");
129
129
  }
130
130
  renderPortalTitle(){
131
- const titleProps = defaultObj(this.state.portalProps.titleProps);
132
131
  const testID = this.getPortalTestID();
133
132
  const title = this.state.portalProps?.title;
134
133
  const isPositionRight = this.isPositionRight();
135
- const titleContainerProps = defaultObj(this.state.portalProps?.titleContainerProps);
134
+ const appBarProps = defaultObj(this.state.portalProps?.appBarProps);
136
135
  return <AppBar
137
136
  title={React.isValidElement(title) ? title : title || null}
138
137
  testID={testID+"_TitleContainer"}
@@ -140,8 +139,9 @@ export default class DrawerLayout extends React.PureComponent {
140
139
  this.closeDrawer();
141
140
  return false;
142
141
  }}
143
- {...titleContainerProps}
144
- backActionProps = {extendObj(true,{},titleContainerProps.backActionProps,{icon:this.state.portalProps?.closeIcon || !isPositionRight == 'left'? 'chevron-left' : 'chevron-right'})}
142
+ windowWidth = {this.getDrawerWidth()}
143
+ {...appBarProps}
144
+ backActionProps = {extendObj(true,{},appBarProps.backActionProps,{icon:this.state.portalProps?.closeIcon || !isPositionRight == 'left'? 'chevron-left' : 'chevron-right'})}
145
145
  />
146
146
  }
147
147
  renderPortalChildren(){
@@ -564,7 +564,7 @@ DrawerLayout.propTypes = {
564
564
  drawerPosition : posPropType,
565
565
  position : posPropType,
566
566
  drawerWidth : PropTypes.number,
567
- titleContainerProps : PropTypes.shape({
567
+ appBarProps : PropTypes.shape({
568
568
  ...defaultObj(AppBar.propTypes),
569
569
  }),
570
570
  }),