@fto-consult/expo-ui 8.18.4 → 8.18.6

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.18.4",
3
+ "version": "8.18.6",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -46,7 +46,7 @@ class DropdownComponent extends AppComponent {
46
46
  },
47
47
  ___hasErrorSymbol : {value:uniqid(`${this.props.name||''}error-symbol-prop`)},
48
48
  hasNotValidSelectedValue : {value:()=>{
49
- return !!this[this.___hasErrorSymbol];
49
+ return this.isLoading()? false : !!this[this.___hasErrorSymbol];
50
50
  }},
51
51
  toggleHasNotValidSelectedValue : {value:(bool)=>{
52
52
  if(typeof bool =='boolean'){
@@ -302,9 +302,7 @@ class DropdownComponent extends AppComponent {
302
302
  }
303
303
  }
304
304
  }
305
- const hasNotValid = sDText?false:true;
306
- this.toggleHasNotValidSelectedValue(hasNotValid);
307
- if(hasNotValid && selectedValues){
305
+ if(!sDText && selectedValues){
308
306
  if(Array.isArray(selectedValues)){
309
307
  for(let i in selectedValues){
310
308
  const text = selectedValues[i];
@@ -319,8 +317,11 @@ class DropdownComponent extends AppComponent {
319
317
  }
320
318
  }
321
319
  } else if(isNonNullString(selectedValues)) {
322
- return selectedValues
320
+ sDText = selectedValues
323
321
  }
322
+ this.toggleHasNotValidSelectedValue(!!sDText);
323
+ } else {
324
+ this.toggleHasNotValidSelectedValue(false);
324
325
  }
325
326
  if(this.canHandleMultiple && counter > maxCount && sDText){
326
327
  sDText+= ", et "+((counter-maxCount).formatNumber()+" de plus")
@@ -899,7 +900,7 @@ class DropdownComponent extends AppComponent {
899
900
  if(renderTag){
900
901
  tagProps = defaultObj(tagProps);
901
902
  }
902
- error = error || this.hasNotValidSelectedValue()
903
+ error = error || this.hasNotValidSelectedValue() || false;
903
904
  if(error && selectedText && (!helperText || !React.isValidElement(helperText,true))){
904
905
  helperText = `Ce champ admet des valeurs par défaut invalide où innexistant dans la liste des éléments à sélectionner`;
905
906
  }
@@ -116,10 +116,10 @@ const TableDataSelectField = React.forwardRef(({foreignKeyColumn,swrOptions,fore
116
116
  const canDisable = isFilter || isDisabled;
117
117
  swrOptions.revalidateOnFocus = canDisable? false : typeof swrOptions.revalidateOnFocus === "boolean" ? swrOptions.revalidateOnFocus : false;
118
118
  swrOptions.revalidateIfStale = canDisable? false : typeof swrOptions.revalidateIfStale ==="boolean"? swrOptions.revalidateIfStale : false;
119
+ swrOptions.revalidateOnReconnect = canDisable ? false : typeof swrOptions.revalidateOnReconnect ==="boolean"? swrOptions.revalidateOnReconnect : false;
120
+ swrOptions.refreshWhenHidden = canDisable ? false : typeof swrOptions.refreshWhenHidden =="boolean"? swrOptions.refreshWhenHidden : false;
119
121
  if(canDisable){
120
- swrOptions.refreshInterval = 2500*1000*60;
121
- swrOptions.refreshWhenHidden = false;
122
- swrOptions.revalidateOnReconnect = false;
122
+ swrOptions.refreshInterval = 30000*1000*60;
123
123
  }
124
124
  const restOptionsRef = React.useRef({});
125
125
  const fetchedResultRef = React.useRef({});