@fto-consult/expo-ui 8.17.4 → 8.18.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.
@@ -24,8 +24,6 @@ module.exports = {
24
24
  "expo-web-browser": "~12.8.2",
25
25
  "react-native": "0.73.2",
26
26
  "@react-native-async-storage/async-storage": "1.21.0",
27
- "react-native-big-list": "^1.6.1",
28
- "react-native-blob-util": "^0.18.6",
29
27
  "react-native-safe-area-context": "4.8.2",
30
28
  "react-native-screens": "~3.29.0",
31
29
  "react-native-svg": "14.1.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "8.17.4",
3
+ "version": "8.18.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -47,8 +47,7 @@
47
47
  "delete-node-modules": "rimraf ./**/node_modules",
48
48
  "dev": "npx expo start --no-dev --minify -c",
49
49
  "modifier-url-remote-git": "git remote set-url origin 'https://borispipo@github.com/borispipo/smart-eneo.git'",
50
- "update-app": "expo @emotion/native@latest react-native-big-list@latest @pchmn/expo-material3-theme@latest @emotion/native@latest @react-navigation/stack react-native-blob-util @react-navigation/native@latest @react-navigation/native-stack@latest && npx expo install --fix",
51
- "update": "npm i @fto-consult/node-utils@latest apexcharts@latest file-saver@latest google-libphonenumber@latest @fto-consult/common@latest react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@5 react-native-paper-dates@latest react-virtuoso@latest tippy.js@latest websql@latest xlsx@latest react-native-get-random-values@latest && npm run update-apexchart && npm run find-licenses"
50
+ "update": "npm i @fto-consult/node-utils@latest react-native-web react-native-blob-util@latest react-native-big-list@latest apexcharts@latest file-saver@latest google-libphonenumber@latest @fto-consult/common@latest react-native-iphone-x-helper@latest react-native-mime-types@latest react-native-paper@5 react-native-paper-dates@latest react-virtuoso@latest tippy.js@latest websql@latest xlsx@latest react-native-get-random-values@latest && npm run update-apexchart && npm run find-licenses"
52
51
  },
53
52
  "bin": {
54
53
  "expo-ui": "./bin/index.js"
@@ -73,19 +72,19 @@
73
72
  "@fto-consult/common": "^4.18.3",
74
73
  "@fto-consult/node-utils": "^1.4.7",
75
74
  "apexcharts": "^3.45.2",
76
- "commander": "^11.1.0",
77
75
  "crypto-browserify": "^3.12.0",
78
76
  "file-saver": "^2.0.5",
79
77
  "google-libphonenumber": "^3.2.34",
80
78
  "html2canvas": "^1.4.1",
81
79
  "htmlparser2-without-node-native": "^3.9.2",
82
- "is-plain-obj": "^4.1.0",
83
80
  "js-base64": "^3.7.5",
84
81
  "jsbarcode": "^3.11.6",
85
82
  "prop-types": "^15.8.1",
86
83
  "react": "^18.2.0",
87
84
  "react-content-loader": "^6.2.1",
88
85
  "react-dom": "^18.2.0",
86
+ "react-native-big-list": "^1.6.1",
87
+ "react-native-blob-util": "^0.19.6",
89
88
  "react-native-get-random-values": "^1.10.0",
90
89
  "react-native-iphone-x-helper": "^1.3.1",
91
90
  "react-native-mime-types": "^2.4.0",
@@ -12,7 +12,7 @@ import theme,{Colors} from "$theme";
12
12
  import Dialog from "$ecomponents/Dialog";
13
13
  import {isMobileOrTabletMedia} from "$cplatform/dimensions";
14
14
  import {isIos} from "$cplatform";
15
- import {defaultVal,defaultStr,defaultObj,defaultBool,defaultFunc,debounce,isNonNullString,compare as NCompare} from "$cutils";
15
+ import {defaultVal,defaultStr,defaultObj,defaultBool,defaultFunc,debounce,isNonNullString,compare as NCompare,uniqid} from "$cutils";
16
16
  import MenuComponent from "$ecomponents/Menu";
17
17
  import HelperText from "$ecomponents/HelperText";
18
18
  import TextField,{flatMode} from "$ecomponents/TextField";
@@ -44,6 +44,16 @@ class DropdownComponent extends AppComponent {
44
44
  fieldsToSort : {
45
45
  value : this.prepareSortableFields(),override : false, writable : false,
46
46
  },
47
+ ___hasErrorSymbol : {value:uniqid(`${this.props.name||''}error-symbol-prop`)},
48
+ hasNotValidSelectedValue : {value:()=>{
49
+ return !!this[this.___hasErrorSymbol];
50
+ }},
51
+ toggleHasNotValidSelectedValue : {value:(bool)=>{
52
+ if(typeof bool =='boolean'){
53
+ this[this.___hasErrorSymbol] = bool;
54
+ }
55
+ return this[this.___hasErrorSymbol];
56
+ }},
47
57
  getItemKey : {value : typeof getItemKey =='function' ? getItemKey: (item,index)=>React.key(item,index),override:false,writable:false},
48
58
  getValueKey : {
49
59
  value : typeof getValueKey =='function'? getValueKey : (value,warn)=>{
@@ -292,6 +302,26 @@ class DropdownComponent extends AppComponent {
292
302
  }
293
303
  }
294
304
  }
305
+ const hasNotValid = sDText?false:true;
306
+ this.toggleHasNotValidSelectedValue(hasNotValid);
307
+ if(hasNotValid && selectedValues){
308
+ if(Array.isArray(selectedValues)){
309
+ for(let i in selectedValues){
310
+ const text = selectedValues[i];
311
+ if(!isNonNullString(text)) continue;
312
+ if(!this.canHandleMultiple){
313
+ sDText = text;
314
+ } else {
315
+ counter++;
316
+ if(counter <= maxCount){
317
+ sDText+= (sDText?", ":"")+text;
318
+ }
319
+ }
320
+ }
321
+ } else if(isNonNullString(selectedValues)) {
322
+ return selectedValues
323
+ }
324
+ }
295
325
  if(this.canHandleMultiple && counter > maxCount && sDText){
296
326
  sDText+= ", et "+((counter-maxCount).formatNumber()+" de plus")
297
327
  }
@@ -869,7 +899,11 @@ class DropdownComponent extends AppComponent {
869
899
  if(renderTag){
870
900
  tagProps = defaultObj(tagProps);
871
901
  }
872
- helperText = <HelperText disabled = {disabled} error={error}>{helperText}</HelperText>
902
+ error = error || this.hasNotValidSelectedValue()
903
+ if(error && selectedText && (!helperText || !React.isValidElement(helperText,true))){
904
+ helperText = `Ce champ admet des valeurs par défaut invalide où innexistant dans la liste des éléments à sélectionner`;
905
+ }
906
+ helperText = <HelperText disabled={disabled} error={error}>{helperText}</HelperText>
873
907
  let labelTextField = defaultVal(label,text);
874
908
  const isFlatMode = textInputProps.mode === flatMode;
875
909
  const dropdownStyle = StyleSheet.flatten(dropdownProps?.style);