@fto-consult/expo-ui 9.9.0 → 9.9.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": "9.9.0",
3
+ "version": "9.9.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": {
@@ -15,7 +15,10 @@ const getActiveProps = (type,currentType)=>{
15
15
  }
16
16
  const DatagridRenderTypeComponent = (props)=>{
17
17
  const isDesk = isDesktopMedia();
18
- let type = defaultStr(get(typeKey),isDesk? "fixed":'accordion').toLowerCase().trim();
18
+ let type = defaultStr(get(typeKey),isDesk? "table":'accordion').toLowerCase().trim();
19
+ if(!["accordion","table"].includes(type)){
20
+ type = "auto";
21
+ }
19
22
  const rTypes = [
20
23
  {...getActiveProps(type,'accordion'),tooltip:"Les éléments de liste s'affichent de manière optimisé pour téléphone mobile",code:'accordion',icon:accordionIcon,label:'Mobile',labelText:'environnement optimisé pour téléphone mobile'},
21
24
  {...getActiveProps(type,'table'),tooltip:"Les éléments de listes s'affichent dans un tableau",code:'table',icon:tableIcon,label:'Tableau'},
@@ -279,7 +279,6 @@ export default class DatagridTableComponent extends Datagrid {
279
279
  ]}
280
280
  />
281
281
  </View>:null}
282
- {/*filters !== false && <td className="datagrid-local-filter-wrapper" ><LocalFilter title = {this.props.title} fields ={this.state.columns} onChange={this.onLocalFiltersChange.bind(this)}/></td>*/}
283
282
  {!canRenderChart && <RenderType/> || null}
284
283
  </View>
285
284
  </ScrollView>
@@ -194,11 +194,11 @@ export default function PhoneInputComponent(props){
194
194
  value = "";
195
195
  }
196
196
  const prevVal = defaultStr(prevState.defaultValue).trim();
197
+ const dialCodePrefix = getDialCodePrefix(prevState.countryDialCode) || getDialCodePrefix(state.countryDialCode);
197
198
  if(prevVal.ltrim(dialCodePrefix) === value.ltrim(dialCodePrefix)) return;
198
199
  const canChange = value.length < 5 || PhoneNumber.parse(nState.displayValue,nState.countryCode);
199
200
  nState.errorText = canChange ? undefined : "Veuillez entrer un numéro de téléphone valide";
200
201
  setState({...state,...nState});
201
- const dialCodePrefix = getDialCodePrefix(prevState.countryDialCode) || getDialCodePrefix(state.countryDialCode);
202
202
  if(onChange && canChange){
203
203
  onChange({...nState,value,country:nState.country,displayValue:nState.displayValue,realValue:nState.defaultValue});
204
204
  }
@@ -60,12 +60,12 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
60
60
  const isValueDifferent = !compare(defaultValue,value);
61
61
  Object.map(menuItems,(item,index,_index)=>{
62
62
  if(React.isValidElement(item) || !filter({items:menuItems,item,_index,index})) return null;
63
+ let backupItem = item;
63
64
  if(!isObj(item)) {
64
65
  if(isValidValue(item)){
65
66
  item = {label:String(item),code:item};
66
67
  } else return null;
67
68
  }
68
- const backupItem = item;
69
69
  const {code,label,text} = item;
70
70
  let itValue = itemValue({item:backupItem,index,_index});
71
71
  if(itValue === undefined){