@fto-consult/expo-ui 6.83.0 → 6.83.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": "6.83.0",
3
+ "version": "6.83.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {
@@ -128,5 +128,6 @@ DateTimePickerComponent.propTypes = {
128
128
  defaultValue : PropTypes.oneOfType([
129
129
  PropTypes.string,
130
130
  PropTypes.object,
131
+ PropTypes.array,
131
132
  ])
132
133
  }
@@ -10,6 +10,9 @@ export const locale = "fr";
10
10
 
11
11
  export const toDateObj = (value,format,force)=>{
12
12
  if(!value) return undefined;
13
+ if(Array.isArray(value)){
14
+ value = value[0] || value[1];
15
+ }
13
16
  if(DateLib.isDateObj(value)) return value;
14
17
  try {
15
18
  const d = new Date(value);
@@ -602,9 +602,15 @@ class DropdownComponent extends AppComponent {
602
602
  }
603
603
  UNSAFE_componentWillReceiveProps(nextProps){
604
604
  const {items,defaultValue,selected} = nextProps;
605
- if(!React.areEquals(items,this.props.items)){
605
+ const isFunc = typeof nextProps.items == "function";
606
+ if(isFunc || !React.areEquals(items,this.props.items)){
606
607
  const nState = this.prepareItems({items,defaultValue,selected});
607
- return this.updateSelected(nState,true);
608
+ return this.updateSelected(nState,!isFunc);
609
+ const val = this.prepareSelected({defaultValue});
610
+ if(!this.compare(val,this.state.selected)){
611
+ return this.selectValue(defaultValue,true);
612
+ }
613
+ return;
608
614
  }
609
615
  let value = this.prepareSelected({defaultValue});
610
616
  let areEquals = !this.canHandleMultiple ? this.compare(value,this.state.selected) : false;
@@ -1289,7 +1295,11 @@ DropdownComponent.propTypes = {
1289
1295
  renderItem : PropTypes.oneOfType([PropTypes.func]),
1290
1296
  /*** la fonction permettant d'afficher le texte du dropdown */
1291
1297
  renderText : PropTypes.func,
1292
- items : PropTypes.oneOfType([PropTypes.object,PropTypes.array,PropTypes.func]),
1298
+ items : PropTypes.oneOfType([
1299
+ PropTypes.object,
1300
+ PropTypes.array,
1301
+ PropTypes.func, //la fonction doit retourner, soit un tableau, soit un objet des données. elle ne doit en aucun cas retourner une promesse
1302
+ ]),
1293
1303
  /**** l'info bulle a associer à l'iconne addIcon */
1294
1304
  addIcon : PropTypes.oneOfType([PropTypes.string,PropTypes.bool]), //l'icon plus
1295
1305
  addIconTooltip : PropTypes.string,