@fto-consult/expo-ui 8.81.1 → 8.82.0

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.
@@ -138,10 +138,11 @@ export default class DrawerLayout extends React.PureComponent {
138
138
  icon = {this.state.portalProps?.closeIcon || !this.isPositionRight() == 'left'? 'chevron-left' : 'chevron-right'}
139
139
  {...defaultObj(this.state.portalProps.closeIconProps)}
140
140
  />;
141
+ const titleContainerProps = defaultObj(this.state.portalProps?.titleContainerProps);
141
142
  return <>
142
- <HStack style={[styles.portalTitle]} testID={testID+"_TitleContainer"}>
143
+ <HStack testID={testID+"_TitleContainer"} {...titleContainerProps} style={[styles.portalTitle,titleContainerProps.style]}>
143
144
  {isPositionRight? icon : null}
144
- <Label {...titleProps} style={[styles.portalTitleText]} testID={testID+"_DrawerLayoutTitle"}>
145
+ <Label testID={testID+"_DrawerLayoutTitle"} {...titleProps} style={[styles.portalTitleText,titleProps.style]} >
145
146
  {title}
146
147
  </Label>
147
148
  {!isPositionRight ? icon : null}
@@ -516,7 +517,12 @@ const styles = StyleSheet.create({
516
517
  justifyContent : 'space-between',
517
518
  alignItems : 'center',
518
519
  paddingHorizontal : 10,
519
- }
520
+ flexWrap : 'nowrap',
521
+ },
522
+ portalTitleText : {
523
+ fontSize : 16,
524
+ fontWeight : 'bold',
525
+ },
520
526
  });
521
527
  const posPropType = PropTypes.oneOf(['left', 'right']);
522
528
  DrawerLayout.propTypes = {
@@ -563,6 +569,9 @@ DrawerLayout.propTypes = {
563
569
  drawerPosition : posPropType,
564
570
  position : posPropType,
565
571
  drawerWidth : PropTypes.number,
572
+ titleContainerProps : PropTypes.shape({
573
+ ...defaultObj(HStack.propTypes),
574
+ }),
566
575
  }),
567
576
  }
568
577
 
@@ -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)=>{