@fto-consult/expo-ui 2.26.10 → 2.26.12

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.10",
3
+ "version": "2.26.12",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,7 +28,7 @@ import { evalSingleValue,Footer,getFooterColumnValue,isValidAggregator,extendAgg
28
28
  import i18n from "$i18n";
29
29
  import { makePhoneCall,canMakePhoneCall as canMakeCall} from "$makePhoneCall";
30
30
  import copyToClipboard from "$capp/clipboard";
31
- import { Pressable } from "react-native";
31
+ import { Pressable,PanResponder } from "react-native";
32
32
  import TableLink from "$TableLink";
33
33
  import appConfig from "$capp/config";
34
34
  import stableHash from "stable-hash";
@@ -234,6 +234,12 @@ 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
+ }),},
237
243
  sectionListColumnsSize : {value : {current:0}}, //la taille du nombre d'éléments de section dans les colonnes
238
244
  })
239
245
  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 style={[styles.paginationContainer]}>
203
+ const rPagination = showPagination ? <View {...this.panResponder.panHandlers} 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 style={[styles.container,{maxHeight}]} pointerEvents={pointerEvents}>
322
+ return <View {...this.panResponder.panHandlers} style={[styles.container,{maxHeight}]} pointerEvents={pointerEvents}>
323
323
  <View ref={this.layoutRef}>
324
324
  {this.props.showActions !== false ? <DatagridActions
325
325
  pointerEvents = {pointerEvents}
@@ -0,0 +1,64 @@
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 View from "$components/View";
7
+ import Label from "$components/Label";
8
+ import PropTypes from 'prop-types';
9
+ import { StyleSheet } from "react-native";
10
+ import {defaultStr,defaultObj} from "$utils";
11
+ import theme from "$theme";
12
+
13
+ const FieldSet = React.forwardRef(({testID,style,children,labelProps,containerProps,label,borderColor,...props},ref)=>{
14
+ testID = defaultStr(testID,"RN_FieldSetComponent");
15
+ containerProps = defaultObj(containerProps);
16
+ labelProps = defaultObj(labelProps);
17
+ borderColor = theme.Colors.isValid(borderColor)?borderColor : theme.colors.divider;
18
+ return (
19
+ <View ref ={ref} testID={testID+"_Container"} {...containerProps} style={[styles.container, { borderColor},containerProps.style]}>
20
+ <Label testID={testID+"_Label"} {...labelProps} style={[styles.label,labelProps.style]}>
21
+ {React.isValidElement(label,true) && label || null}
22
+ </Label>
23
+ <View {...props} testID={testID} style={[styles.content,style]}>
24
+ {React.isValidElement(children) && children || null}
25
+ </View>
26
+ </View>
27
+ );
28
+ });
29
+
30
+ FieldSet.propTypes = {
31
+ label: PropTypes.oneOfType([
32
+ PropTypes.string,
33
+ PropTypes.number,
34
+ PropTypes.node,
35
+ PropTypes.element,
36
+ ]),
37
+ children: PropTypes.element,
38
+ labelProps : PropTypes.object,
39
+ containerProps : PropTypes.object,
40
+ style : theme.StyleProps,
41
+ }
42
+
43
+
44
+ const styles = StyleSheet.create({
45
+ container: {
46
+ borderWidth: 1.1,
47
+ borderRadius: 5,
48
+ position : 'relative',
49
+ },
50
+ content : {
51
+ flex: 1,
52
+ paddingVertical: 10
53
+ },
54
+ label: {
55
+ height: 0,
56
+ position: 'absolute',
57
+ top: -10,
58
+ left: 10,
59
+ },
60
+ });
61
+
62
+ FieldSet.displayName = "FieldSetComponent";
63
+
64
+ export default FieldSet;
@@ -1,8 +1,8 @@
1
- import {isIos} from "$cplatform";
1
+ import {isIos,isAndroid,isNativeMobile,isTouchDevice} from "$cplatform";
2
2
  import {KeyboardAvoidingView,StyleSheet} from 'react-native';
3
3
 
4
4
  export default function KeyboardAvoidingViewComponent({ children,...rest }){
5
- return isIos() ? (
5
+ return isNativeMobile() || isTouchDevice() ? (
6
6
  <KeyboardAvoidingView
7
7
  style={styles.wrapper}
8
8
  behavior="padding"
@@ -224,7 +224,7 @@ const TableComponent = React.forwardRef(({containerProps,renderListContent,child
224
224
  }
225
225
  }
226
226
  }
227
- return <View testID= {testID+"_Container"} {...containerProps} style={[styles.container,{alignItems:'stretch'},containerProps.style]}>
227
+ return <View testID= {testID+"_Container"} pointerEvents='box-none' {...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"}