@fto-consult/expo-ui 2.26.12 → 2.27.1
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 +1 -1
- package/src/components/Datagrid/Common/Common.js +0 -6
- package/src/components/Datagrid/Table/index.js +2 -2
- package/src/components/Form/{KeyboardAvoidingView.js → KeyboardAvoidingView/index.native.js} +3 -5
- package/src/components/Form/KeyboardAvoidingView/index.web.js +33 -0
- package/src/components/ScrollView/index.js +18 -4
- package/src/components/Swiper/index.js +0 -1
- package/src/components/Table/index.js +1 -1
package/package.json
CHANGED
|
@@ -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
|
|
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
|
|
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}
|
package/src/components/Form/{KeyboardAvoidingView.js → KeyboardAvoidingView/index.native.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {isIos
|
|
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
|
|
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,16 +1,30 @@
|
|
|
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
|
-
import {isMobileNative} from "$cplatform";
|
|
6
|
+
import {isMobileNative,isTouchDevice} from "$cplatform";
|
|
7
7
|
import {defaultStr,defaultObj} from "$utils";
|
|
8
8
|
const isNative = isMobileNative();
|
|
9
|
-
|
|
9
|
+
import APP from "$capp/instance";
|
|
10
10
|
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 [layout,setLayout] = React.useState(Dimensions.get("window"));
|
|
15
|
+
const {height} = layout;
|
|
16
|
+
React.useEffect(()=>{
|
|
17
|
+
const onResizePage = ()=>{
|
|
18
|
+
if(isTouchDevice()) return;
|
|
19
|
+
setTimeout(()=>{
|
|
20
|
+
setLayout(Dimensions.get("window"))
|
|
21
|
+
},200);
|
|
22
|
+
}
|
|
23
|
+
APP.on(APP.EVENTS.RESIZE_PAGE,onResizePage);
|
|
24
|
+
return ()=>{
|
|
25
|
+
APP.off(APP.EVENTS.RESIZE_PAGE,onResizePage);
|
|
26
|
+
}
|
|
27
|
+
},[])
|
|
14
28
|
return virtualized ? <FlatList
|
|
15
29
|
{...rest}
|
|
16
30
|
ref = {ref}
|
|
@@ -19,7 +33,7 @@ const ScrollViewComponent = React.forwardRef((props,ref) => {
|
|
|
19
33
|
keyExtractor={(_e, i) => 'dom' + i.toString()}
|
|
20
34
|
ListEmptyComponent={null}
|
|
21
35
|
renderItem={null}
|
|
22
|
-
contentContainerStyle = {[!isNative && {flex:1,flexGrow: 1,maxHeight:
|
|
36
|
+
contentContainerStyle = {[!isNative && {flex:1,flexGrow: 1,maxHeight:Math.max(height-100,250)},rest.contentContainerStyle]}
|
|
23
37
|
ListHeaderComponent={() => <View testID={testID+'_FlatListContent'} {...cProps} mediaQueryUpdateNativeProps = {mediaQueryUpdateNativeProps}
|
|
24
38
|
>{children}</View>}
|
|
25
39
|
/> : <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"}
|
|
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"}
|