@fto-consult/expo-ui 6.57.0 → 6.58.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.57.0",
3
+ "version": "6.58.1",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "main",
6
6
  "scripts": {
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import {
3
3
  Platform,
4
4
  StyleSheet,
5
- TouchableWithoutFeedback,
5
+ Pressable,
6
6
  View,
7
7
  } from 'react-native';
8
8
  import Label from "$ecomponents/Label";
@@ -83,17 +83,17 @@ const AppbarContent = ({
83
83
 
84
84
  if (onPress) {
85
85
  return (
86
- <TouchableWithoutFeedback
86
+ <Pressable
87
87
  testID={testID+"_Container"}
88
88
  {...containerProps}
89
89
  role={touchableRole}
90
90
  accessibilityTraits={touchableRole}
91
- accessibilityComponentType="button"
91
+ //accessibilityComponentType="button"
92
92
  onPress={onPress}
93
93
  disabled={disabled}
94
94
  >
95
95
  {content}
96
- </TouchableWithoutFeedback>
96
+ </Pressable>
97
97
  );
98
98
  }
99
99
  return content;
@@ -9,7 +9,7 @@ import PropTypes from "prop-types";
9
9
  import stableHash from "stable-hash";
10
10
  import {defaultNumber,isNumber} from "$cutils";
11
11
 
12
- const styles = StyleSheet.create({container: { flex: 1 }});
12
+ const styles = StyleSheet.create({container: { flex: 1,pointerEvents:"box-none" }});
13
13
 
14
14
  const AutoResizerComponent = React.forwardRef((props,ref) =>{
15
15
  const {
@@ -80,7 +80,6 @@ const AutoResizerComponent = React.forwardRef((props,ref) =>{
80
80
  {...viewProps}
81
81
  ref={React.useMergeRefs(innerRef,ref)}
82
82
  onLayout={onLayout}
83
- pointerEvents="box-none"
84
83
  style={[styles.container, viewProps.style]}
85
84
  >
86
85
  {canRender() && children({...result,left:result.x,top:result.y}) || null}
@@ -124,8 +124,7 @@ const CheckboxComponent = React.forwardRef((props,ref)=>{
124
124
  testID = {testID}
125
125
  disabled = {disabled}
126
126
  readOnly = {!isEditable}
127
- pointerEvents = {pointerEvents}
128
- style = {[styles.checkbox,style]}
127
+ style = {[styles.checkbox,style,{pointerEvents}]}
129
128
  position = {position}
130
129
  status = {status}
131
130
  color = {cColor}
@@ -5,9 +5,11 @@ import {
5
5
  Keyboard,
6
6
  PanResponder,
7
7
  StyleSheet,
8
- TouchableWithoutFeedback,
8
+ Pressable,
9
9
  I18nManager,
10
+ TouchableWithoutFeedback,
10
11
  } from 'react-native';
12
+ import { TouchableRipple } from 'react-native-paper';
11
13
  import PropTypes from "prop-types";
12
14
  import View from "$ecomponents/View";
13
15
  import {defaultStr} from "$cutils";
@@ -160,7 +162,6 @@ export default class DrawerLayout extends React.PureComponent {
160
162
  outputRange: [0, 0.7],
161
163
  extrapolate: 'clamp',
162
164
  });
163
- const animatedOverlayStyles = { opacity: overlayOpacity };
164
165
  const pointerEvents = drawerShown || permanent ? 'auto' : 'none';
165
166
  position = defaultStr(position).toLowerCase();
166
167
  if(position !=='left' && position !=='right'){
@@ -173,22 +174,19 @@ export default class DrawerLayout extends React.PureComponent {
173
174
  return (
174
175
  <View
175
176
  testID = {testID}
176
- style={{ flex: 1, backgroundColor: 'transparent',flexDirection:permanent?'row':'column'}}
177
+ style={[styles.mainWrapper,permanent ? styles.mainWrapperPermanent : styles.mainWrapperTemporary]}
177
178
  {...this._panResponder.panHandlers}
178
179
  >
179
- {!permanent && <TouchableWithoutFeedback
180
+ {!permanent && this.isOpen() ? <Pressable
181
+ testID={testID+"_Backdrow"}
180
182
  pointerEvents={pointerEvents}
181
- testID = {testID+"_TouchableWithoutFeedBack"}
183
+ ref = {this._backdropRef}
184
+ style={[styles.overlay,{backgroundColor:theme.colors.backdrop,opacity: overlayOpacity}]}
185
+ //pointerEvents={pointerEvents}
186
+ //testID = {testID+"_TouchableWithoutFeedBack"}
182
187
  onPress={this._onOverlayClick}
183
- >
184
- <Animated.View
185
- testID={testID+"_Backdrow"}
186
- pointerEvents={pointerEvents}
187
- ref = {this._backdropRef}
188
- style={[styles.overlay,{backgroundColor:theme.colors.backdrop}, animatedOverlayStyles]}
189
- />
190
- </TouchableWithoutFeedback>}
191
- {posRight && this.renderContent({testID})}
188
+ /> : null}
189
+ {posRight ? this.renderContent({testID}):null}
192
190
  <Animated.View
193
191
  testID={testID+"_NavigationViewContainer"}
194
192
  ref={React.mergeRefs(navigationViewRef,this._navigationViewRef)}
@@ -450,6 +448,20 @@ const styles = StyleSheet.create({
450
448
  right: 0,
451
449
  zIndex: 1000,
452
450
  },
451
+ mainWrapper : {
452
+ flex: 1, backgroundColor: 'transparent'
453
+ },
454
+ mainWrapperPermanent : {
455
+ flexDirection : "row",
456
+ },
457
+ mainWrapperTemporary : {
458
+ flexDirection : "column",
459
+ },
460
+ touchableWithoutFeedBack : {
461
+ //backgroundColor:'transparent',
462
+ height : "100%",
463
+ width : '100%',
464
+ }
453
465
  });
454
466
 
455
467
  DrawerLayout.propTypes = {
@@ -1,7 +1,7 @@
1
1
  import {Colors} from "$theme";
2
2
  import React from 'react';
3
3
  import View from "$ecomponents/View";
4
- import {StyleSheet,ScrollView,TouchableWithoutFeedback} from 'react-native';
4
+ import {StyleSheet,ScrollView,Pressable} from 'react-native';
5
5
  //import ScrollView from "$ecomponents/ScrollView";
6
6
  import Label from "$ecomponents/Label";
7
7
  import Icon from "$ecomponents/Icon"
@@ -105,11 +105,11 @@ const ExpandableComponent = React.forwardRef(({
105
105
  />:null;
106
106
  return ( <View testID={testID+"_ExpandableContainer"} {...containerProps}>
107
107
  <Surface {...props} ref={ref} testID={testID}>
108
- <TouchableWithoutFeedback
108
+ <Pressable
109
109
  delayPressIn={0}
110
110
  borderless = {false}
111
111
  accessibilityTraits="button"
112
- accessibilityComponentType="button"
112
+ //accessibilityComponentType="button"
113
113
  //role="button"
114
114
  style={[styles.container,props.style]}
115
115
  onPress={handlePressAction}
@@ -157,7 +157,7 @@ const ExpandableComponent = React.forwardRef(({
157
157
  {!isIconPositionLeft ? expandIcon:null}
158
158
  </View>
159
159
  </View>
160
- </TouchableWithoutFeedback>
160
+ </Pressable>
161
161
  {(autoMountChildren !== false || isExpanded) ? <View testID={testID+'_Content'} {...contentProps}
162
162
  style={[{maxWidth:'100%'},styles.children,contentProps.style,!isExpanded && {opacity:0,height:0}]}
163
163
  >
@@ -3,7 +3,7 @@ import {
3
3
  StyleSheet,
4
4
  Animated,
5
5
  SafeAreaView,
6
- TouchableWithoutFeedback
6
+ Pressable
7
7
  } from 'react-native';
8
8
  import View from "$ecomponents/View";
9
9
  import {FAB,Text,Card,withTheme} from "react-native-paper";
@@ -116,19 +116,17 @@ const FABGroup = ({
116
116
  const itemComponentProps = isFormAction ? {Component : FabItem} : {};
117
117
  return (
118
118
  <View testID={testID+"_Container"} pointerEvents="box-none" style={[styles.container, style]}>
119
- <TouchableWithoutFeedback testID={testID+"_TouchableOpacity"} onPress={close}>
120
- <Animated.View
121
- testID={testID+"_AnimatedView"}
122
- pointerEvents={open ? 'auto' : 'none'}
123
- style={[
124
- styles.backdrop,
125
- {
126
- opacity: backdropOpacity,
127
- backgroundColor: colors.backdrop,
128
- },
129
- ]}
130
- />
131
- </TouchableWithoutFeedback>
119
+ {open ? <Pressable testID={testID+"_TouchableOpacity"} onPress={close}
120
+ pointerEvents={open ? 'auto' : 'none'}
121
+ style={[
122
+ styles.backdrop,
123
+ {
124
+ opacity: backdropOpacity,
125
+ backgroundColor: colors.backdrop,
126
+ },
127
+ ]}
128
+ >
129
+ </Pressable>:null}
132
130
  <SafeAreaView testID={testID+"_SafeAreaView"} pointerEvents="box-none" style={styles.safeArea}>
133
131
  <View testID={testID+"_ItemsContainer"} style={[styles.itemsContainer]} pointerEvents={open ? 'box-none' : 'none'}>
134
132
  {actions.map((it, i) => {
@@ -173,7 +171,7 @@ const FABGroup = ({
173
171
  accessibilityLabel={accessibilityLabel}
174
172
  // @ts-expect-error We keep old a11y props for backwards compat with old RN versions
175
173
  accessibilityTraits="button"
176
- accessibilityComponentType="button"
174
+ //accessibilityComponentType="button"
177
175
  //role="button"
178
176
  accessibilityState={{ expanded: open }}
179
177
  style={StyleSheet.flatten([styles.fab, fabStyle])}
@@ -1,7 +1,7 @@
1
1
  import Icon from "$ecomponents/Icon";
2
2
  import {defaultObj,isPlainObject,} from "$cutils";
3
3
  import React from "$react";
4
- import {TouchableWithoutFeedback,StyleSheet} from "react-native";
4
+ import {Pressable,StyleSheet} from "react-native";
5
5
  import PropTypes from "prop-types";
6
6
  import { renderItems } from "./utils";
7
7
 
@@ -55,7 +55,7 @@ const MenuComponent = React.forwardRef((props,ref)=>{
55
55
  if(typeof anchor =='function'){
56
56
  anchor = anchor({onPress:openMenu});
57
57
  } else if(React.isValidElement(anchor)){
58
- anchor = <TouchableWithoutFeedback {...anchorProps} onPress={onPress}>{anchor}</TouchableWithoutFeedback>
58
+ anchor = <Pressable {...anchorProps} onPress={onPress}>{anchor}</Pressable>
59
59
  } else if(React.isComponent(anchor)){
60
60
  const A = anchor;
61
61
  anchor = <A
@@ -2,7 +2,7 @@ import React from "$react";
2
2
  import {
3
3
  StyleSheet,
4
4
  View,
5
- TouchableWithoutFeedback,
5
+ Pressable,
6
6
  } from 'react-native';
7
7
  import BackHandler from "$ecomponents/BackHandler";
8
8
  import PropTypes from "prop-types";
@@ -41,8 +41,10 @@ const ModalComponent = React.forwardRef((props,ref)=>{
41
41
  onDismiss,
42
42
  isPreloader,
43
43
  children,
44
+ testID,
44
45
  ...rest
45
46
  } = props;
47
+ testID = defaultStr(testID,'RN__ModalComponent');
46
48
  if(animate !== false && isMobileNative() && defaultStr(animationType).toLowerCase().trim() !=='slide'){
47
49
  animate = false;
48
50
  }
@@ -109,7 +111,7 @@ const ModalComponent = React.forwardRef((props,ref)=>{
109
111
  return !visible?null: <Portal>
110
112
  <Anim
111
113
  ref={ref}
112
- testID={'RN__ModalComponent'}
114
+ testID={testID+"_RNModalComponent"}
113
115
  {...rest}
114
116
  pointerEvents={visible ? 'auto' : 'none'}
115
117
  accessibilityViewIsModal
@@ -120,25 +122,21 @@ const ModalComponent = React.forwardRef((props,ref)=>{
120
122
  animationDuration = {animationDuration}
121
123
  animationPosition = {animationPosition}
122
124
  >
123
- <TouchableWithoutFeedback
125
+ <Pressable
124
126
  accessibilityLabel={overlayAccessibilityLabel}
125
127
  //role="button"
126
128
  disabled={!dismissable}
127
129
  onPress={dismissable ? hideModal : undefined}
128
130
  importantForAccessibility="no"
129
- testID="RN__ModalComponent__backdrop_Container"
130
- >
131
- <View
132
- testID="RN__ModalComponent__backdrop"
133
- {...backdropProps}
134
- style={[
135
- styles.backdrop,
136
- {backgroundColor:theme.colors.backdrop},
137
- backdropProps.style,
138
- ]}
139
- />
140
- </TouchableWithoutFeedback>
141
- <Surface testID="RN__ModalComponent__ContentContainer"
131
+ testID={testID+"_ModalComponent__backdrop"}
132
+ {...backdropProps}
133
+ style={[
134
+ styles.backdrop,
135
+ {backgroundColor:theme.colors.backdrop},
136
+ backdropProps.style,
137
+ ]}
138
+ />
139
+ <Surface testID={testID+"_ModalComponent__ContentContainer"}
142
140
  elevation = {5}
143
141
  {...contentContainerProps}
144
142
  {...wrapperProps}
@@ -22,7 +22,7 @@ import {extendFormFields} from "$ecomponents/Form/Fields";
22
22
  getTableData : ()=>{object|array}
23
23
  getStructData : ()=>{object|array}
24
24
  tablesData : {object}, la liste des tables de données
25
- strucsData : {object}, la liste des données de structures
25
+ structsData : {object}, la liste des données de structures
26
26
  handleHelpScreen : {boolean}, //si l'écran d'aide sera pris en compte, l'écran d'aide ainsi que les écrans des termes d'utilisations et autres
27
27
  convertFiltersToSQL : {boolean}, si les filtres de datagrid ou filtres seront convertis au format SQL
28
28
  components : {