@fto-consult/expo-ui 2.48.3 → 2.48.5

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": "2.48.3",
3
+ "version": "2.48.5",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -61,7 +61,7 @@
61
61
  "@emotion/native": "^11.10.0",
62
62
  "@expo/html-elements": "^0.2.0",
63
63
  "@expo/vector-icons": "^13.0.0",
64
- "@fto-consult/common": "^2.13.1",
64
+ "@fto-consult/common": "^2.13.2",
65
65
  "@gorhom/portal": "^1.0.14",
66
66
  "@react-native-async-storage/async-storage": "~1.17.3",
67
67
  "@react-native-community/datetimepicker": "6.5.2",
@@ -35,7 +35,7 @@ const ChartComponent = React.forwardRef(({options,onRender,style,height,width,ch
35
35
  }
36
36
  }
37
37
  },[(options)]);
38
- React.useOnRender(onRender);
38
+ React.useOnRender(onRender,Math.max(options.series.length/20,500));
39
39
  React.useEffect(()=>{
40
40
  return ()=>{
41
41
  destroyChart(chartContext.current);
@@ -583,7 +583,7 @@ const DatagridFactory = (Factory)=>{
583
583
  keyExtractor = {this.getRowKey.bind(this)}
584
584
  /> : canRenderChart ?<View testID={testID+"_ChartContainer"} {...chartContainerProps} style={[theme.styles.w100,chartContainerProps.style]}>
585
585
  {this.renderChart()}
586
- </View> : <View style={styles.hasNotData}>
586
+ </View> : <View onRender = {this.onRender.bind(this)} style={styles.hasNotData}>
587
587
  {this.renderEmpty()}
588
588
  </View>}
589
589
  </View>}
@@ -910,7 +910,7 @@ export default class Field extends AppComponent {
910
910
  visible = false;
911
911
  }
912
912
  rest.defaultValue = this.validatingValue;
913
- rest.style = [{backgroundColor:'transparent'},rest.style,!visible?{display:'none'}:undefined];
913
+ rest.style = [{backgroundColor:'transparent'},rest.style,!visible && theme.styles.hidden,!visible?{display:'none',opacity:0}:undefined];
914
914
 
915
915
  /**** si ce n'est pas un composant de type dropdown*/
916
916
  if(!isFunction(rest.filter)){
@@ -194,7 +194,7 @@ export default class FormDataComponent extends AppComponent{
194
194
  const type = defaultStr(field.jsType,field.type,"text").trim().toLowerCase().replaceAll("_","");
195
195
  const isDate = (type.contains('date') || type.contains('time'));
196
196
  const Component = componentsTypes[type] || componentsTypes.default;
197
- let {defaultValue,useDefaultValueFromData,primaryKey,hidden,renderFormDataField,getMediaQueryStyle,printLabels,queryLimit,selected,value,visible,dataFilesInterest,perm,ignore,form,responsiveProps:customResponsiveProps,...rest} = field;
197
+ let {defaultValue,useDefaultValueFromData,primaryKey,hidden,renderFormDataField,getMediaQueryStyle,printLabels,queryLimit,selected,value,dataFilesInterest,perm,ignore,form,responsiveProps:customResponsiveProps,...rest} = field;
198
198
  rest = Object.assign({},rest);
199
199
  delete rest.import;
200
200
  delete rest.export;
@@ -207,7 +207,6 @@ export default class FormDataComponent extends AppComponent{
207
207
  if(primaryKey === true && typeof rest.required !=='boolean'){
208
208
  rest.required = true;
209
209
  }
210
- hidden = visible === false ? true : hidden;
211
210
  if(typeof rest.filter !=='function'){
212
211
  delete rest.filter;
213
212
  }
@@ -219,9 +218,6 @@ export default class FormDataComponent extends AppComponent{
219
218
  } else {
220
219
  rest.defaultValue = defaultValue;
221
220
  }
222
- if(hidden){
223
- rest.style = flattenStyle([rest.style,theme.styles.hidden]);
224
- }
225
221
  if(rest.defaultValue === null){
226
222
  rest.defaultValue = undefined;
227
223
  }
@@ -250,7 +246,7 @@ export default class FormDataComponent extends AppComponent{
250
246
  archivable = {this.props.archivable || this.isArchivable()}
251
247
  name = {name}
252
248
  responsive = {responsive}
253
- responsiveProps = {{...responsiveProps,...customResponsiveProps,style:[responsiveProps.style,customResponsiveProps.style,hidden?theme.styles.hidden:null]}}
249
+ responsiveProps = {{...responsiveProps,...customResponsiveProps,style:[responsiveProps.style,customResponsiveProps.style]}}
254
250
  />);
255
251
  }
256
252
  });
@@ -11,7 +11,7 @@ import Label from "$ecomponents/Label";
11
11
  import { useWindowDimensions,Dimensions } from "react-native";
12
12
 
13
13
  const CommonListComponent = React.forwardRef((props,ref)=>{
14
- let {responsive,defaultItemHeight,itemHeight,windowWidth,componentProps,columnWrapperStyle,onViewableItemsChanged,withFlatListItem,Component,withBackToTop,backToTopRef:customBackToTopRef,withBackToTopButton,onScroll,onScrollEnd,onMount,onUnmount,renderScrollViewWrapper,prepareItems,getItemKey,getKey,keyExtractor,items,filter,renderItem,numColumns,containerProps,bindResizeEvents,...rest} = props;
14
+ let {responsive,defaultItemHeight,itemHeight,windowWidth,onRender,componentProps,columnWrapperStyle,onViewableItemsChanged,withFlatListItem,Component,withBackToTop,backToTopRef:customBackToTopRef,withBackToTopButton,onScroll,onScrollEnd,onMount,onUnmount,renderScrollViewWrapper,prepareItems,getItemKey,getKey,keyExtractor,items,filter,renderItem,numColumns,containerProps,bindResizeEvents,...rest} = props;
15
15
  withBackToTopButton = withBackToTop === true || withBackToTopButton == true || isMobileMedia()? true : false;
16
16
  rest = defaultObj(rest);
17
17
  containerProps = defaultObj(containerProps);
@@ -145,7 +145,7 @@ const CommonListComponent = React.forwardRef((props,ref)=>{
145
145
  console.error(context.items," is not valid list data array",props);
146
146
  context.items = [];
147
147
  }
148
-
148
+ React.useOnRender(onRender,Math.max(items.length/10 || 0,500));
149
149
  React.setRef(ref,context);
150
150
  React.useEffect(()=>{
151
151
  React.setRef(ref,context);
@@ -26,7 +26,7 @@ const propTypes = {
26
26
  isScrolling : PropTypes.func,
27
27
  };
28
28
  /***@see : https://virtuoso.dev/virtuoso-api-reference/ */
29
- const VirtuosoListComponent = React.forwardRef(({items,testID,renderItem,onEndReached,onLayout,onContentSizeChange,onScroll,isScrolling,estimatedItemSize,onEndReachedThreshold,containerProps,style,...props},ref)=>{
29
+ const VirtuosoListComponent = React.forwardRef(({items,onRender,testID,renderItem,onEndReached,onLayout,onContentSizeChange,onScroll,isScrolling,estimatedItemSize,onEndReachedThreshold,containerProps,style,...props},ref)=>{
30
30
  const r2 = {};
31
31
  for(let i in propTypes){
32
32
  if(i in props){
@@ -95,6 +95,7 @@ const VirtuosoListComponent = React.forwardRef(({items,testID,renderItem,onEndRe
95
95
  React.setRef(ref,null);
96
96
  }
97
97
  },[]);
98
+ React.useOnRender(onRender,Math.max(Array.isArray(items) && items.length/10 || 0,500))
98
99
  return <View {...containerProps} {...props} style={[{flex:1},containerProps.style,style,{minWidth:'100%',maxWidth:'100%'}]} onLayout={onLayout} testID={testID}>
99
100
  <Virtuoso
100
101
  {...r2}
@@ -251,7 +251,7 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
251
251
  }
252
252
  }
253
253
  }
254
- React.useOnRender((a,b,c)=>{
254
+ const onComponentRender = (a,b,c)=>{
255
255
  if(onRender){
256
256
  onRender(a,b,c);
257
257
  }
@@ -264,7 +264,7 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
264
264
  })
265
265
  }
266
266
  }
267
- });
267
+ };
268
268
  return <View testID= {testID+"_Container"} {...containerProps} onLayout={(e)=>{
269
269
  layoutRef.current = e.nativeEvent.layout;
270
270
  if(containerProps.onLayout){
@@ -299,7 +299,7 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
299
299
  </View>
300
300
  </ScrollView>
301
301
  </RNView>
302
- {hasEmptyData ? <View testID={testID+"_Empty"} style={styles.hasNotData}>
302
+ {hasEmptyData ? <View onRender={onComponentRender} testID={testID+"_Empty"} style={styles.hasNotData}>
303
303
  {emptyData}
304
304
  </View> : <ScrollView {...scrollViewProps} scrollEventThrottle = {scrollEventThrottle} horizontal contentContainerStyle={[scrollContentContainerStyle,scrollViewProps.contentContainerStyle,{height:'100%'}]} showsVerticalScrollIndicator={false}
305
305
  onScroll = {getOnScrollCb([headerScrollViewRef,footerScrollViewRef],null,(args)=>{
@@ -337,6 +337,7 @@ const TableComponent = React.forwardRef(({containerProps,sortedColumn,listContai
337
337
  content : {height,width}
338
338
  });
339
339
  }}
340
+ onRender = {onComponentRender}
340
341
  onLayout = {(args)=>{
341
342
  if(props.onLayout){
342
343
  //props.onLayout(args);
@@ -5,7 +5,7 @@ import {isMobileNative} from "$cplatform";
5
5
  import {debounce,isNumber} from "$utils";
6
6
 
7
7
 
8
- const ViewComponent = React.forwardRef(({mediaQueryUpdateNativeProps,onLayoutTimeout,onLayout,autoHeight,autoWidth,elevation,...props},ref)=>{
8
+ const ViewComponent = React.forwardRef(({mediaQueryUpdateNativeProps,onRender,onLayoutTimeout,onLayout,autoHeight,autoWidth,elevation,...props},ref)=>{
9
9
  const style = React.useMediaQueryUpdateStyle(props);
10
10
  const autoSize = autoHeight||autoWidth ? true : false;
11
11
  const [state,setState] = autoSize ? React.useState({}) : [{}];
@@ -22,6 +22,7 @@ const ViewComponent = React.forwardRef(({mediaQueryUpdateNativeProps,onLayoutTim
22
22
  setState({height:h,width:w});
23
23
  }
24
24
  };
25
+ React.useOnRender(onRender);
25
26
  return <View
26
27
  {...props}
27
28
  style = {[style,