@fto-consult/expo-ui 8.18.7 → 8.19.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.
@@ -22,6 +22,7 @@ module.exports = {
22
22
  "expo-status-bar": "~1.11.1",
23
23
  "expo-system-ui": "~2.9.3",
24
24
  "expo-web-browser": "~12.8.2",
25
+ "react":"18.2.0",
25
26
  "react-native": "0.73.2",
26
27
  "@react-native-async-storage/async-storage": "1.21.0",
27
28
  "react-native-safe-area-context": "4.8.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.18.7",
3
+ "version": "8.19.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -81,7 +81,6 @@
81
81
  "js-base64": "^3.7.5",
82
82
  "jsbarcode": "^3.11.6",
83
83
  "prop-types": "^15.8.1",
84
- "react": "^18.2.0",
85
84
  "react-content-loader": "^6.2.1",
86
85
  "react-dom": "^18.2.0",
87
86
  "react-native-big-list": "^1.6.1",
@@ -45,10 +45,10 @@ class DropdownComponent extends AppComponent {
45
45
  value : this.prepareSortableFields(),override : false, writable : false,
46
46
  },
47
47
  ___hasErrorSymbol : {value:uniqid(`${this.props.name||''}error-symbol-prop`)},
48
- hasNotValidSelectedValue : {value:()=>{
48
+ hasNoValidSelectedValue : {value:()=>{
49
49
  return this.isLoading()? false : !!this[this.___hasErrorSymbol];
50
50
  }},
51
- toggleHasNotValidSelectedValue : {value:(bool)=>{
51
+ toggleHasNoValidSelectedValue : {value:(bool)=>{
52
52
  if(typeof bool =='boolean'){
53
53
  this[this.___hasErrorSymbol] = bool;
54
54
  }
@@ -319,9 +319,9 @@ class DropdownComponent extends AppComponent {
319
319
  } else if(isNonNullString(selectedValues)) {
320
320
  sDText = selectedValues
321
321
  }
322
- this.toggleHasNotValidSelectedValue(!!sDText);
322
+ this.toggleHasNoValidSelectedValue(!!sDText);
323
323
  } else {
324
- this.toggleHasNotValidSelectedValue(false);
324
+ this.toggleHasNoValidSelectedValue(false);
325
325
  }
326
326
  if(this.canHandleMultiple && counter > maxCount && sDText){
327
327
  sDText+= ", et "+((counter-maxCount).formatNumber()+" de plus")
@@ -900,7 +900,7 @@ class DropdownComponent extends AppComponent {
900
900
  if(renderTag){
901
901
  tagProps = defaultObj(tagProps);
902
902
  }
903
- error = error || this.hasNotValidSelectedValue() || false;
903
+ error = error || this.hasNoValidSelectedValue() || false;
904
904
  if(error && selectedText && (!helperText || !React.isValidElement(helperText,true))){
905
905
  helperText = `Ce champ admet des valeurs par défaut invalide où innexistant dans la liste des éléments à sélectionner`;
906
906
  }
@@ -49,7 +49,7 @@ export default class FormSelectField extends Field{
49
49
  return !this.isFilter();
50
50
  }
51
51
  getValue () {
52
- if(this._field && isFunction(this._field.getSelected)){
52
+ if(this._field && isFunction(this._field?.getSelected)){
53
53
  let selectedItems = this._field.getSelectedItems(true);
54
54
  if(Object.size(selectedItems,true)<=0) {
55
55
  return this.props.multiple ? [] : undefined;
@@ -59,11 +59,21 @@ export default class FormSelectField extends Field{
59
59
  return super.getValue();
60
60
  }
61
61
  getSelectedItems (force){
62
- if(this._field && isFunction(this._field.getSelected)){
62
+ if(this._field && isFunction(this._field?.getSelected)){
63
63
  return this._field.getSelectedItems(force);
64
64
  }
65
65
  return null;
66
66
  }
67
+ hasNoValidSelectedValue(){
68
+ if(this._field && isFunction(this._field?.hasNoValidSelectedValue)){
69
+ return this._field.hasNoValidSelectedValue();
70
+ }
71
+ return undefined;
72
+ }
73
+ isValid(...args){
74
+ if(this.hasNoValidSelectedValue() === true) return false;
75
+ return super.isValid(...args);
76
+ }
67
77
  getSelectedItem(index){
68
78
  let items = this.getSelectedItems(true);
69
79
  if(typeof index !== 'undefined' && isObjOrArray(items)){