@fto-consult/expo-ui 2.26.12 → 2.27.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "2.26.12",
3
+ "version": "2.27.0",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -234,12 +234,6 @@ export default class CommonDatagridComponent extends AppComponent {
234
234
  aggregatorFunctions : {value : extendAggreagatorFunctions(this.props.aggregatorFunctions)},
235
235
  ///les types d'affichage
236
236
  displayTypes : {value : hasFoundDisplayTypes ? disTypes : Object.clone(displayTypes)},
237
- /***@see : https://reactnative.dev/docs/panresponder */
238
- panResponder : {value : PanResponder.create({
239
- onStartShouldSetPanResponder: (evt, gestureState) => false,
240
- onPanResponderMove: (evt, gestureState) =>false,
241
- onStartShouldSetPanResponderCapture: (evt, gestureState) =>false,
242
- }),},
243
237
  sectionListColumnsSize : {value : {current:0}}, //la taille du nombre d'éléments de section dans les colonnes
244
238
  })
245
239
  const sessionAggregator = defaultStr(this.getSessionData("aggregatorFunction")).trim();
@@ -200,7 +200,7 @@ const DatagridFactory = (Factory)=>{
200
200
  maxHeight = diff;
201
201
  }
202
202
  }
203
- const rPagination = showPagination ? <View {...this.panResponder.panHandlers} style={[styles.paginationContainer]}>
203
+ const rPagination = showPagination ? <View style={[styles.paginationContainer]}>
204
204
  <ScrollView horizontal showsHorizontalScrollIndicator={!isLoading} style={styles.paginationContainerStyle} contentContainerStyle={styles.minW100}>
205
205
  <View style={[styles.paginationContent]}>
206
206
  <View testID={testID+"_HeaderQueryLimit"}>
@@ -319,7 +319,7 @@ const DatagridFactory = (Factory)=>{
319
319
  </View>
320
320
  </ScrollView>
321
321
  </View> : null;
322
- return <View {...this.panResponder.panHandlers} style={[styles.container,{maxHeight}]} pointerEvents={pointerEvents}>
322
+ return <View style={[styles.container,{maxHeight}]} pointerEvents={pointerEvents}>
323
323
  <View ref={this.layoutRef}>
324
324
  {this.props.showActions !== false ? <DatagridActions
325
325
  pointerEvents = {pointerEvents}
@@ -1,8 +1,8 @@
1
- import {isIos,isAndroid,isNativeMobile,isTouchDevice} from "$cplatform";
1
+ import {isIos} from "$cplatform";
2
2
  import {KeyboardAvoidingView,StyleSheet} from 'react-native';
3
3
 
4
4
  export default function KeyboardAvoidingViewComponent({ children,...rest }){
5
- return isNativeMobile() || isTouchDevice() ? (
5
+ return isIos() ? (
6
6
  <KeyboardAvoidingView
7
7
  style={styles.wrapper}
8
8
  behavior="padding"
@@ -11,9 +11,7 @@ export default function KeyboardAvoidingViewComponent({ children,...rest }){
11
11
  >
12
12
  {children}
13
13
  </KeyboardAvoidingView>
14
- ) : (
15
- <>{children}</>
16
- );
14
+ ) : children;
17
15
  };
18
16
 
19
17
  const styles = StyleSheet.create({
@@ -0,0 +1,33 @@
1
+ // Copyright 2022 @fto-consult/Boris Fouomene. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ import React from "$react";
6
+ import { Keyboard, Text, TextInput, StyleSheet, View } from "react-native";
7
+
8
+ /****
9
+ * rewrite of @see : https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/KeyboardAvoidingView/index.js
10
+ */
11
+ const KeyboardAvoidingView = ({behavior,contentContainerStyle,keyboardVerticalOffset,...rest})=>{
12
+ const frameRef = React.useRef(null);
13
+ const onLayout = (event)=>{
14
+ frameRef.current = event.nativeEvent.layout;
15
+ };
16
+ React.useEffect(() => {
17
+ const keyboardDidShowListener = Keyboard.addListener(
18
+ 'keyboardDidShow',
19
+ (args) => {}
20
+ );
21
+ const keyboardDidHideListener = Keyboard.addListener(
22
+ 'keyboardDidHide',
23
+ (args) => {}
24
+ );
25
+ return () => {
26
+ keyboardDidHideListener.remove();
27
+ keyboardDidShowListener.remove();
28
+ };
29
+ }, []);
30
+ return <View onLayout={onLayout} {...rest} />;
31
+ }
32
+
33
+ export default KeyboardAvoidingView;
@@ -1,6 +1,6 @@
1
1
  import React from '$react';
2
2
  import { FlatList } from 'react-native';
3
- import { ScrollView,Dimensions } from 'react-native';
3
+ import { ScrollView,Dimensions,useWindowDimensions } from 'react-native';
4
4
  import PropTypes from "prop-types";
5
5
  import View from "$ecomponents/View";
6
6
  import {isMobileNative} from "$cplatform";
@@ -11,6 +11,7 @@ const ScrollViewComponent = React.forwardRef((props,ref) => {
11
11
  const {virtualized,contentProps,mediaQueryUpdateNativeProps,testID:customTestID,children,screenIndent:sIndent,...rest} = props;
12
12
  const testID = defaultStr(customTestID,'RN_ScrollViewComponent');
13
13
  const cProps = defaultObj(contentProps);
14
+ const {height} = useWindowDimensions()//:Dimensions.get("window");
14
15
  return virtualized ? <FlatList
15
16
  {...rest}
16
17
  ref = {ref}
@@ -19,7 +20,7 @@ const ScrollViewComponent = React.forwardRef((props,ref) => {
19
20
  keyExtractor={(_e, i) => 'dom' + i.toString()}
20
21
  ListEmptyComponent={null}
21
22
  renderItem={null}
22
- contentContainerStyle = {[!isNative && {flex:1,flexGrow: 1,maxHeight:'100vh'},rest.contentContainerStyle]}
23
+ contentContainerStyle = {[!isNative && {flex:1,flexGrow: 1,maxHeight:Math.max(height-100,250)},rest.contentContainerStyle]}
23
24
  ListHeaderComponent={() => <View testID={testID+'_FlatListContent'} {...cProps} mediaQueryUpdateNativeProps = {mediaQueryUpdateNativeProps}
24
25
  >{children}</View>}
25
26
  /> : <ScrollView ref={ref} {...rest} testID={testID} children={children}/>
@@ -120,7 +120,6 @@ class SwiperComponent extends React.Component {
120
120
  * @see : https://stackoverflow.com/questions/45810262/how-to-disable-panresponder-on-child-component-react-native
121
121
  *
122
122
  */
123
- onStartShouldSetPanResponderCapture: (evt, gestureState) => this.props.stopChildrenEventPropagation !== false ? true : false,
124
123
  onMoveShouldSetPanResponderCapture: (e, gestureState) => {
125
124
  const { gesturesEnabled, vertical, minDistanceToCapture } = this.props;
126
125
 
@@ -224,7 +224,7 @@ const TableComponent = React.forwardRef(({containerProps,renderListContent,child
224
224
  }
225
225
  }
226
226
  }
227
- return <View testID= {testID+"_Container"} pointerEvents='box-none' {...containerProps} style={[styles.container,{alignItems:'stretch'},containerProps.style]}>
227
+ return <View testID= {testID+"_Container"} {...containerProps} style={[styles.container,{alignItems:'stretch'},containerProps.style]}>
228
228
  <RNView style={[cStyle]} testID={testID+"_Headers_ScrollViewContainer"}>
229
229
  <ScrollView
230
230
  testID={testID+"_HeaderScrollView"}