@fto-consult/expo-ui 6.15.5 → 6.16.2

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.
@@ -82,7 +82,7 @@ module.exports = (opts)=>{
82
82
  const outputPath = path.resolve(HelpScreen,"openLibraries.js");
83
83
  r.$nodeModulesPath = r.$enodeModulesPath= nodeModulesPath;
84
84
  require("./find-licenses")({
85
- paths : [root,r["$expo-ui-root-path"]],
85
+ paths : [root,r["$expo-ui-root-path",path.resolve(process.cwd())]],
86
86
  nodeModulesPath : nodeModulesPath,
87
87
  outputPath
88
88
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.15.5",
3
+ "version": "6.16.2",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -62,7 +62,7 @@
62
62
  "@emotion/native": "^11.11.0",
63
63
  "@expo/html-elements": "^0.5.1",
64
64
  "@expo/vector-icons": "^13.0.0",
65
- "@fto-consult/common": "^3.23.1",
65
+ "@fto-consult/common": "^3.23.13",
66
66
  "@gorhom/portal": "^1.0.14",
67
67
  "@pchmn/expo-material3-theme": "^1.3.1",
68
68
  "@react-native-async-storage/async-storage": "1.18.2",
@@ -45,7 +45,7 @@ export const renderRowCell = (arg)=>{
45
45
  } else if(typeof columnDef.render === "function"){
46
46
  _render = columnDef.render.call(context,renderArgs);
47
47
  } else if(arrayValueExists( _type,["date","datetime","time"])){
48
- const sqlFormat =_type === 'time'?DateLib.isoTimeFormat : _type ==="datetime" ? DateLib.SQLDateTimeFormat : DateLib.SQLDateFormat;
48
+ const sqlFormat =_type === 'time'? undefined : _type ==="datetime" ? DateLib.SQLDateTimeFormat : DateLib.SQLDateFormat;
49
49
  let _dd =DateLib.parse(rowData[columnField],sqlFormat);
50
50
  if(DateLib.isDateObj(_dd)){
51
51
  const eFormat = defaultStr(columnDef.format,(_type === 'time'?DateLib.defaultTimeFormat:DateLib.masks.defaultDate));
@@ -2,7 +2,7 @@ import * as React from 'react'
2
2
  import Types from 'prop-types';
3
3
  import {StyleSheet,ScrollView,View,useWindowDimensions} from "react-native";
4
4
  import {Paragraph,Button,List } from "react-native-paper";
5
- import Portal from "$ecomponents/Portal";
5
+ import {Portal} from "react-native-paper";
6
6
  import theme from "$theme";
7
7
  import {navigationRef,sanitizeName} from "$cnavigation";
8
8
  import Expandable from "$ecomponents/Expandable";
@@ -1,5 +1,5 @@
1
1
  import ErrorMessage from "./ErrorMessage";
2
- import Portal from "$ecomponents/Portal";
2
+ import {Portal} from "react-native-paper";
3
3
  let providerRef = null;
4
4
  import * as React from "react";
5
5
  import useForceRender from "$react/useForceRender";
@@ -6,7 +6,7 @@ import PropTypes from "prop-types";
6
6
  import {MENU_ICON} from "$ecomponents/Icon";
7
7
  import theme,{Colors} from "$theme";
8
8
  import Group from "./GroupComponent";
9
- import Portal from "$ecomponents/Portal";
9
+ import {Portal} from "react-native-paper";
10
10
  import {isAllowedFromStr} from "$cauth/perms";
11
11
 
12
12
  const activeRef = {current:null};
@@ -637,12 +637,16 @@ export default class Field extends AppComponent {
637
637
  isHtml(){
638
638
  return false;
639
639
  }
640
+ canHandleMediaQueryUpdate(){
641
+ return !this.isFilter() && this.props.responsive !== false;
642
+ }
640
643
  doUpdateMediaQueryStyle(args){
644
+ if(!this.canHandleMediaQueryUpdate()) return;
641
645
  const wrapperStyle = this.getMediaQueryUpdateStyle(args);
642
646
  this.setState({isMobile:args.isMobile,wrapperStyle});
643
647
  }
644
648
  getMediaQueryUpdateStyle(args){
645
- if(this.props.responsive === false) return null;
649
+ if(!this.canHandleMediaQueryUpdate()) return null;
646
650
  if(!isObj(args)){
647
651
  args = Dimensions.getDimensionsProps();
648
652
  }
@@ -877,6 +881,9 @@ export default class Field extends AppComponent {
877
881
  />
878
882
  }
879
883
  const isFilter = this.isFilter();
884
+ if(isFilter){
885
+ responsive = false;
886
+ }
880
887
  rest = defaultObj(rest);
881
888
  data = defaultObj(data);
882
889
  this.label = label = defaultVal(label,text);
@@ -137,7 +137,7 @@ const VirtuosoListComponent = React.forwardRef(({onRender,listClassName,componen
137
137
  }
138
138
  }}
139
139
  components = {{
140
- Item : responsive ? function(props){return <ItemContainer {...props} style={[itemProps.style,props.style]} numColumns={numColumns}/>} : undefined,
140
+ //Item : responsive ? function(props){return <ItemContainer {...props} style={[itemProps.style,props.style]} numColumns={numColumns}/>} : undefined,
141
141
  //List : responsive ? ResponsiveVirtuosoListItemContainer: undefined,
142
142
  ...defaultObj(components),
143
143
  }}
@@ -5,7 +5,7 @@
5
5
  import { ScrollView,StyleSheet,View,useWindowDimensions,Dimensions} from "react-native";
6
6
  import React from "$react";
7
7
  import {defaultStr,defaultObj,isObj,isNumber} from "$cutils";
8
- import Portal from "$ecomponents/Portal";
8
+ import {Portal} from "react-native-paper";
9
9
  import {isMobileNative,isTouchDevice} from "$platform";
10
10
 
11
11
  const isNative = isMobileNative() || isTouchDevice();
@@ -52,6 +52,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
52
52
  lower,
53
53
  dynamicBackgroundColor,
54
54
  lowerCase,
55
+ onContentSizeChange,
55
56
  handleOpacity,
56
57
  ...props} = componentProps;
57
58
  upper = defaultBool(upper,upperCase,false);
@@ -294,7 +295,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
294
295
  const currentDefaultValue = alwaysUseLabel && displayText == emptyValue ? "" : displayText;
295
296
  const withAutoHeight = typeof autoHeight === 'boolean'? autoHeight : false;
296
297
  const height = withAutoHeight || multiline ? undefined : tHeight;
297
- const inputStyle2 = withAutoHeight || multiline ? {minHeight : heightRef.current} : null;
298
+ const inputStyle2 = withAutoHeight || multiline ? {height : heightRef.current} : null;
298
299
  const containerStyle = StyleSheet.flatten(containerProps.style) || {};
299
300
  const inputProps= {
300
301
  caretHidden : false,
@@ -356,7 +357,7 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
356
357
  inputStyle2,
357
358
  isNormalMode && styles.inputNormalMode,
358
359
  isShadowMode && styles.inputShadowMode,
359
- isShadowMode && multiline && {minHeight:heightRef.current},
360
+ //isShadowMode && multiline && {minHeight:heightRef.current},
360
361
  multiline && {paddingTop : isFlatMode? 12 : 7},
361
362
  ],
362
363
  secureTextEntry,
@@ -368,6 +369,13 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
368
369
  displayText,
369
370
  parsedValue,
370
371
  rows:numberOfLines,
372
+ onContentSizeChange : (e,...rest) => {
373
+ if(typeof onContentSizeChange ==='function' && onContentSizeChange(e,...rest) === false) return;
374
+ if(multiline){
375
+ heightRef.current = e.nativeEvent.contentSize.height;
376
+ setToggle(!toggle);
377
+ }
378
+ },
371
379
  onChange : ({ nativeEvent: {target, text:text2} }) => {
372
380
  if(canValueBeDecimal && (text2 && !text2.isNumber() && !text2.endsWith(".") && !text2.endsWith(","))) {
373
381
  return;
@@ -375,28 +383,11 @@ const TextFieldComponent = React.forwardRef((componentProps,inputRef)=>{
375
383
  if(canValueBeDecimal && isFocused && (text2 ==='.'|| text2 =='.')){
376
384
  text2 = "0"+text2;
377
385
  }
378
- if(multiline){
379
- let hasS = false;
380
- if(text2){
381
- const spl = text2.trim().split('\n');
382
- if(spl.length>1){
383
- heightRef.current+=MULTIPLE_HEIGHT+(10*(spl.length-1));
384
- hasS = true;
385
- setToggle(!toggle);
386
- }
387
- }
388
- if(!hasS){
389
- if(!text2 || text2.length < 30){
390
- heightRef.current = MULTIPLE_HEIGHT;
391
- setToggle(!toggle);
392
- } else if(target.scrollHeight > heightRef.current){
393
- heightRef.current = Math.max(target.scrollHeight,MULTIPLE_HEIGHT);
394
- setToggle(!toggle);
395
- }
396
- }
397
- }
398
386
  const tVal = toCase(text2);
399
387
  if(tVal !== text){
388
+ if(multiline && tVal.toLowerCase()+"\n" === text.toLowerCase()){
389
+ heightRef.current = Math.max(heightRef.current - 16,MULTIPLE_HEIGHT);
390
+ }
400
391
  setText(text2,true);
401
392
  callOnChange(tVal);
402
393
  }
@@ -8,7 +8,6 @@ import { useNavigation} from '$cnavigation';
8
8
  import Fab from "$layouts/Fab";
9
9
  import APP from "$capp";
10
10
  import AppBar,{createAppBarRef} from "$elayouts/AppBar";
11
- import Portal from "$ecomponents/Portal";
12
11
  import {Portal as RNPortal} from "react-native-paper";
13
12
  import theme,{StyleProp} from "$theme";
14
13
  import StatusBar from "$ecomponents/StatusBar";