@fto-consult/expo-ui 8.81.2 → 8.82.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.81.2",
3
+ "version": "8.82.1",
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": {
@@ -70,7 +70,7 @@
70
70
  "dependencies": {
71
71
  "@emotion/react": "^11.11.1",
72
72
  "@faker-js/faker": "^8.0.2",
73
- "@fto-consult/common": "^4.51.1",
73
+ "@fto-consult/common": "^4.51.2",
74
74
  "@fto-consult/expo-ui": "^8.73.1",
75
75
  "apexcharts": "^3.49.0",
76
76
  "file-saver": "^2.0.5",
@@ -163,8 +163,11 @@ export default class DrawerLayout extends React.PureComponent {
163
163
  {this.props.children}
164
164
  </View>;
165
165
  }
166
+ /***
167
+ * retourne le min entre la dimension de l'écran et la prop drawerWidth passée en paramètre
168
+ */
166
169
  getDrawerWidth() {
167
- return defaultNumber(this.isPortal()? this.state.portalProps?.drawerWidth : 0,this.props.drawerWidth);
170
+ return Math.min(defaultNumber(this.isPortal()? this.state.portalProps?.drawerWidth : 0,this.props.drawerWidth),Dimensions.get("window").width);
168
171
  }
169
172
  render() {
170
173
  const { accessibilityViewIsModal, drawerShown, openValue } = this.state;
@@ -229,12 +229,16 @@ class DropdownComponent extends AppComponent {
229
229
  }
230
230
  this.updateSelected({...nState,data:!this.isBigList?[...this.state.data]: this.state.data,selected,selectedValuesKeys});
231
231
  }
232
- compare (value,currentValue,avoidNullOrEmpty){
232
+ compare (value,currentValue){
233
233
  if(this.getValueKey(value) === this.getValueKey(currentValue)) return true;
234
234
  if(typeof this.props.compare =='function'){
235
235
  return this.props.compare(value,currentValue,{context:this,items:this.state.data})
236
236
  }
237
- return NCompare(value,currentValue,defaultBool(avoidNullOrEmpty,true));
237
+ if(value === null || value ===""){
238
+ value = "";
239
+ }
240
+ if(currentValue === null || currentValue =="") currentValue = "";
241
+ return NCompare(value,currentValue);
238
242
  }
239
243
  getCallArgs ({item,items,index,_index,...rest}) {
240
244
  return ({...rest,item,index,_index,counterIndex:_index,index,itemIndex:index,context:this,isDropdown:true,props:this.props,items,selectedColor:this.selectedColor,unselectedColor:theme.colors.text});
@@ -1,5 +1,6 @@
1
1
  import React from "$react";
2
2
  import {defaultObj,isDecimal,defaultStr,debounce,extendObj,defaultVal,defaultFunc} from "$cutils";
3
+ import {compare as compareUtil} from "$cutils";
3
4
  import TextField,{flatMode} from "$ecomponents/TextField";
4
5
  import {Pressable,Dimensions,StyleSheet} from "react-native";
5
6
  import { TouchableRipple} from "react-native-paper";
@@ -29,7 +30,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
29
30
  contentContainerProps = defaultObj(contentContainerProps);
30
31
  const prevLayout = React.usePrevious(layout);
31
32
  filter = defaultFunc(filter,x=>true);
32
- compare = defaultFunc(compare,(a,b)=> a === b);
33
+ compare = defaultFunc(compare,compareUtil);
33
34
  const prevValue = React.usePrevious(value,compare);
34
35
  const selectedRef = React.useRef(undefined);
35
36
  const listRef = React.useRef(null);
@@ -89,7 +90,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
89
90
  return items;
90
91
  },[menuItems])
91
92
  React.useEffect(()=>{
92
- if(compare(defaultValue == value)) return;
93
+ if(compare(defaultValue,value)) return;
93
94
  selectValue(defaultValue);
94
95
  },[defaultValue]);
95
96
  const setSelected = (node,update)=>{