@fto-consult/expo-ui 5.7.7 → 5.7.8

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": "5.7.7",
3
+ "version": "5.7.8",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -75,7 +75,7 @@ class DropdownComponent extends AppComponent {
75
75
  }, override : false, writable : false
76
76
  },
77
77
  canHandleMultiple : {
78
- value : typeof multiple =='boolean'? multiple : false,
78
+ value : !!multiple,
79
79
  override : false, writable : false,
80
80
  },
81
81
  isBigList : {
@@ -112,7 +112,6 @@ class DropdownComponent extends AppComponent {
112
112
  const prevValueKey = this.getValueKey(previousSelected);
113
113
  const prevItem = prevValueKey ? this.state.valuesKeys[prevValueKey] : null;
114
114
  //if(this.countEee ===5) return
115
- //console.log(previousSelected,nState,prevItem," is dhcdddddd comparing")
116
115
  return this.setState(nState,()=>{
117
116
  ///vérifie s'il y a eu changement call on change par exemple
118
117
  let selectedItem = null;
@@ -490,7 +489,6 @@ class DropdownComponent extends AppComponent {
490
489
  const prevH = Math.abs(prevLayout.height-layout.height), prevW = Math.abs(prevLayout.width,layout.width);
491
490
  if(prevIsMob === isMob && prevH <= 20 && prevW <= 50) return;
492
491
  this.updateVisibleState({
493
- //visible: prevIsMob !== isMob? false : this.state.visible,
494
492
  isMobileMedia : isMobileOrTabletMedia(),
495
493
  layout,
496
494
  });
@@ -525,11 +523,11 @@ class DropdownComponent extends AppComponent {
525
523
 
526
524
  updateVisibleState(state,cb){
527
525
  state = defaultObj(state);
528
- const visible = this.state;
526
+ const visible = this.state.visible;
529
527
  this.setState(state,()=>{
530
528
  const arg = {context:this,selected:this.state.selected,visible:this.state.visible};
531
529
  if(visible !== this.state.visible){
532
- if(this.state.visible){
530
+ if(!this.state.visible){
533
531
  if(typeof this.props.onDismiss =='function'){
534
532
  this.props.onDismiss(arg);
535
533
  }
@@ -862,32 +860,27 @@ class DropdownComponent extends AppComponent {
862
860
  {...progressBarProps}
863
861
  />
864
862
  </View>): null;
865
- let tagsContent = null,hasTagContent = false;
866
- if(renderTag){
867
- tagsContent = <View style={[styles.tagsContent]}>
868
- {state.selected.map((value,i)=>{
869
- const nodeKey = this.getNodeFromValue(value);
870
- if(!nodeKey.valueKey) return null;
871
- const valueKey = nodeKey.valueKey;
872
- const {text} = nodeKey.node;
873
- const p = Colors.getAvatarStyleFromSuffix(i+1);
874
- hasTagContent = true;
875
- return <Chip
876
- {...tagProps}
877
- style = {[p.style,{color:p.color,marginBottom:5,marginRight:5},tagProps.style]}
878
- textStyle = {[{color:p.color},tagProps.textStyle]}
879
- key = {i}
880
- onPress = {()=>{
881
- this.selectItem({value,valueKey,select:false});
882
- }}
883
- onClose = {()=>{
884
- this.selectItem({value,valueKey,select:false});
885
- }}
886
- >{text} </Chip>;
887
- })}
888
- </View>
889
- }
890
-
863
+ const tagsContent = renderTag ? <View style={[styles.tagsContent]} testID={testID+"_TagsContainerWrapper"}>
864
+ {state.selected.map((value,i)=>{
865
+ const nodeKey = this.getNodeFromValue(value);
866
+ if(!nodeKey.valueKey) return null;
867
+ const valueKey = nodeKey.valueKey;
868
+ const {text} = nodeKey.node;
869
+ const p = Colors.getAvatarStyleFromSuffix(i+1);
870
+ return <Chip
871
+ {...tagProps}
872
+ style = {[p.style,{color:p.color,marginBottom:5,marginRight:5},tagProps.style]}
873
+ textStyle = {[{color:p.color},tagProps.textStyle]}
874
+ key = {i}
875
+ onPress = {()=>{
876
+ this.selectItem({value,valueKey,select:false});
877
+ }}
878
+ onClose = {()=>{
879
+ this.selectItem({value,valueKey,select:false});
880
+ }}
881
+ >{text} </Chip>;
882
+ })}
883
+ </View> : null;
891
884
  const testID = defaultStr(dropdownProps.testID,"RN_DropdownComponent");
892
885
  const defRight = defaultVal(textInputProps.right,inputProps.right);
893
886
  const enableCopy = defaultBool(inputProps.enableCopy,textInputProps.enableCopy,(iconDisabled || (!multiple && !showAdd)) && !loadingElement ?true : false);
@@ -1004,7 +997,7 @@ class DropdownComponent extends AppComponent {
1004
997
  anchor={anchor}
1005
998
  {...dialogProps}
1006
999
  title = {defaultStr(dialogProps.title,label,text)+" [ "+self.state.data.length.formatNumber()+" ]"}
1007
- subtitle = {selectedText}
1000
+ subtitle = {selectedText||'Aucun élément sélectionné'}
1008
1001
  style = {[restProps.style]}
1009
1002
  contentProps = {{style:{flex:1}}}
1010
1003
  >
@@ -1052,7 +1045,7 @@ class DropdownComponent extends AppComponent {
1052
1045
  left = {(props)=><Icon testID = {testID+"_Left"} icon={'magnify'} {...props} style={[styles.left,props.style]} />}
1053
1046
  right = {(props)=>{
1054
1047
  return <>
1055
- {showAdd ? <Icon testID = {testID+"_ShowAddIcon"} {..._addIconProps} {...props} size={ICON_SIZE} style={[_addIconProps.style,styles.iconRight,props.style]}/> : null}
1048
+ {showAdd && isMob ? <Icon testID = {testID+"_ShowAddIcon"} {..._addIconProps} {...props} size={ICON_SIZE} style={[_addIconProps.style,styles.iconRight,props.style]}/> : null}
1056
1049
  <MComponent
1057
1050
  items = {menuActions}
1058
1051
  closeOnPress
@@ -1098,7 +1091,7 @@ class DropdownComponent extends AppComponent {
1098
1091
  if(renderTag && (self.state.nodes[key].valueKey in self.state.selectedValuesKeys)){
1099
1092
  return null;
1100
1093
  }
1101
- let node = self.state.nodes[key];
1094
+ const node = self.state.nodes[key];
1102
1095
  const {index,value,valueKey} = node;
1103
1096
  const _isSelected = self.isSelected(value,valueKey);
1104
1097
  if(dynamicContent){
@@ -1152,6 +1145,7 @@ const styles = StyleSheet.create({
1152
1145
  },
1153
1146
  inputContainerTag : {
1154
1147
  paddingTop:7,
1148
+ minHeight : 50,
1155
1149
  },
1156
1150
  item : {
1157
1151
  fontSize:14,
@@ -1231,6 +1225,7 @@ const styles = StyleSheet.create({
1231
1225
  //paddingHorizontal: 12,
1232
1226
  marginBottom : 0,
1233
1227
  marginBottom : 0,
1228
+ marginTop : 5,
1234
1229
  },
1235
1230
  tagLabel : {
1236
1231
  flexGrow : 0,
@@ -184,12 +184,12 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,bindUpsert2Remo
184
184
  }
185
185
  const prevIsUpdate = React.usePrevious(isUpdate);
186
186
  const prevDefaultValue = React.usePrevious(foreignKeyColumnValue);
187
- if(!isFilter){
187
+ /*if(!isFilter){
188
188
  React.useEffect(()=>{
189
189
  if(prevIsUpdate === isUpdate && JSON.stringify(prevDefaultValue) === JSON.stringify(foreignKeyColumnValue)) return;
190
190
  context.refresh();
191
191
  },[isUpdate,foreignKeyColumnValue])
192
- }
192
+ }*/
193
193
  dropdownActions = isObj(dropdownActions)? {...dropdownActions} : isArray(dropdownActions)? [...dropdownActions] : []
194
194
  const isDropdonwsActionsArray = isArray(dropdownActions);
195
195
  const refreshItem = {
@@ -141,6 +141,7 @@ export default function PhoneInputComponent(props){
141
141
  anchor = {
142
142
  <>
143
143
  <TextField
144
+ affix = {false}
144
145
  {...rest}
145
146
  toCase = {(val)=>{
146
147
  return (val.startsWith("+")?"+":"")+val.replace(/[^\s0-9]/g, '');