@fto-consult/expo-ui 6.1.1 → 6.1.2

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/babel.config.js CHANGED
@@ -52,7 +52,6 @@ module.exports = function(api,opts) {
52
52
  plugins : [
53
53
  ["inline-dotenv",inlineDovOptions],
54
54
  ["module-resolver", {"alias": alias}],
55
- ['@babel/plugin-proposal-export-namespace-from'],
56
55
  ['transform-inline-environment-variables',{
57
56
  "include": [
58
57
  "NODE_ENV"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -113,9 +113,9 @@
113
113
  "xlsx": "^0.18.5"
114
114
  },
115
115
  "devDependencies": {
116
- "@expo/metro-config": "^0.7.1",
116
+ "@expo/metro-config": "^0.10.6",
117
117
  "babel-plugin-inline-dotenv": "^1.7.0",
118
- "babel-plugin-module-resolver": "^4.1.0",
118
+ "babel-plugin-module-resolver": "^5.0.0",
119
119
  "babel-plugin-transform-inline-environment-variables": "^0.4.4"
120
120
  }
121
121
  }
@@ -1,5 +1,5 @@
1
1
  import React from '$react';
2
- import {Image,StyleSheet,TouchableOpacity} from 'react-native';
2
+ import {Image,StyleSheet,Pressable} from 'react-native';
3
3
  import PropTypes from "prop-types";
4
4
  import { StyleProp } from '$theme';
5
5
  import {defaultStr,isNumber,defaultNumber} from "$cutils";
@@ -45,7 +45,7 @@ const AvatarImage = React.forwardRef(({
45
45
  }
46
46
  const cProps = !hasImage? {width,height} : {};
47
47
  return (
48
- <TouchableOpacity
48
+ <Pressable
49
49
  ref = {ref}
50
50
  testID = {testID}
51
51
  style={[
@@ -78,7 +78,7 @@ const AvatarImage = React.forwardRef(({
78
78
  onProgress={onProgress}
79
79
  />
80
80
  )}
81
- </TouchableOpacity>
81
+ </Pressable>
82
82
  );
83
83
  });
84
84
 
@@ -19,7 +19,7 @@ import Portal from "$ecomponents/Portal";
19
19
  import { ScrollView } from "react-native";
20
20
  import BackHandler from "$ecomponents/BackHandler";
21
21
  import {
22
- TouchableOpacity,
22
+ Pressable,
23
23
  Animated,
24
24
  PanResponder,
25
25
  Dimensions,
@@ -250,7 +250,7 @@ const BottomSheetComponent = React.forwardRef((props,ref)=> {
250
250
  {...mProps}
251
251
  style = {[styles.modal,bStyle,mProps.style]}
252
252
  >
253
- <TouchableOpacity
253
+ <Pressable
254
254
  testID={testID+"_Backdrop"}
255
255
  {...backdropProps}
256
256
  style={[styles.mask,backdropProps.style]}
@@ -1,4 +1,4 @@
1
- import { StyleSheet,TouchableOpacity } from 'react-native'
1
+ import { StyleSheet,Pressable } from 'react-native'
2
2
  import View from "$ecomponents/View";
3
3
  import TextField,{shadowMode} from "$ecomponents/TextField";
4
4
  import ColorPicker from './ColorPicker';
@@ -67,7 +67,7 @@ const ColorPickerComponent = React.forwardRef ((props,ref)=>{
67
67
  },[defaultValue]);
68
68
  const mode = defaultStr(rest.mode,theme.textFieldMode)
69
69
  return <>
70
- <TouchableOpacity
70
+ <Pressable
71
71
  {...containerProp}
72
72
  role="button"
73
73
  disabled = {!isEditable}
@@ -93,7 +93,7 @@ const ColorPickerComponent = React.forwardRef ((props,ref)=>{
93
93
  style = {[rest.style,{color:selectionColor,backgroundColor:selectionColor},styles.input]}
94
94
  contentContainerProps = {{style:textStyle}}
95
95
  />
96
- </TouchableOpacity>
96
+ </Pressable>
97
97
  <Dialog
98
98
  visible = {state.visible}
99
99
  title = {_label+(color?("["+color+"]"):"")}
@@ -7,7 +7,7 @@ import stableHash from "stable-hash";
7
7
  import Dimensions,{isMobileMedia,isTabletMedia,isDesktopMedia} from "$dimensions";
8
8
  import {
9
9
  StyleSheet,
10
- TouchableOpacity,
10
+ Pressable,
11
11
  Animated,
12
12
  StatusBar,
13
13
  PanResponder,
@@ -590,11 +590,11 @@ export default class DropdownAlert extends Component {
590
590
  return renderCancel(this.props, this.alertData);
591
591
  }
592
592
  return (
593
- <TouchableOpacity
593
+ <Pressable
594
594
  style={cancelBtnStyle}
595
595
  onPress={() => this.closeAction(ACTION.cancel)}>
596
596
  {this._renderImage(cancelBtnImageSrc, cancelBtnImageStyle)}
597
- </TouchableOpacity>
597
+ </Pressable>
598
598
  );
599
599
  };
600
600
  render() {
@@ -663,7 +663,7 @@ export default class DropdownAlert extends Component {
663
663
  {...this.panResponder.panHandlers}
664
664
  testID={testID+"_AnimatedView"}
665
665
  style={[wrapperAnimStyle, wrapperStyle]}>
666
- <TouchableOpacity
666
+ <Pressable
667
667
  activeOpacity={activeOpacity}
668
668
  onPress={onPress}
669
669
  disabled={!tapToCloseEnabled}
@@ -685,7 +685,7 @@ export default class DropdownAlert extends Component {
685
685
  {this._renderCancel(showCancel)}
686
686
  </View>
687
687
  </View>
688
- </TouchableOpacity>
688
+ </Pressable>
689
689
  </Animated.View>
690
690
  </Portal>
691
691
  );
@@ -1,6 +1,6 @@
1
1
  import PropTypes from "prop-types";
2
2
  import View from "$ecomponents/View";
3
- import {Dimensions,TouchableOpacity,StyleSheet,Animated,} from "react-native";
3
+ import {Dimensions,Pressable,StyleSheet,Animated,} from "react-native";
4
4
  import {TouchableRipple} from "react-native-paper";
5
5
  import Divider from "$ecomponents/Divider";
6
6
  import React, {Fragment,Component as AppComponent} from "$react";
@@ -877,7 +877,7 @@ class DropdownComponent extends AppComponent {
877
877
  const testID = defaultStr(dropdownProps.testID,"RN_DropdownComponent");
878
878
  const defRight = defaultVal(textInputProps.right,inputProps.right);
879
879
  const enableCopy = defaultBool(inputProps.enableCopy,textInputProps.enableCopy,(iconDisabled || (!multiple && !showAdd)) && !loadingElement ?true : false);
880
- const anchor = <TouchableOpacity
880
+ const anchor = <Pressable
881
881
  activeOpacity = {0.3}
882
882
  onPress={this.open.bind(this)}
883
883
  disabled = {disabled}
@@ -943,7 +943,7 @@ class DropdownComponent extends AppComponent {
943
943
  {helperText}
944
944
  </View>
945
945
  }</React.Fragment>}
946
- </TouchableOpacity>
946
+ </Pressable>
947
947
 
948
948
  let restProps = {};
949
949
  if(!isMob){
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  import React from '$react';
4
- import {TouchableOpacity, StyleSheet} from 'react-native';
4
+ import {Pressable, StyleSheet} from 'react-native';
5
5
  import Dimensions from "$cplatform/dimensions";
6
6
  import View from "$ecomponents/View";
7
7
  import {defaultStr} from "$cutils";
@@ -76,7 +76,7 @@ const GridCellComponent = React.forwardRef((p,ref)=>{
76
76
  const {style,size,children,phoneSize,withSurface,elevation:cElev,mediaQueryUpdateNativeProps,contentProps:cProps,tabletSize,desktopSize,smallPhoneSize,onPress,activeOpacity,onLongPress,flex:customFlex,onPressIn,onPressOut,...props} = p;
77
77
  const testID = defaultStr(props.testID,"RN_Grid.CellComponent");
78
78
  const contentProps = defaultObj(cProps);
79
- const C = onPress || onLongPress || onPressIn || onPressOut ? TouchableOpacity : View;
79
+ const C = onPress || onLongPress || onPressIn || onPressOut ? Pressable : View;
80
80
  const elevation = typeof elevation == "number"? elevation : withSurface ? 5 : undefined;
81
81
  const elevStyle = typeof elevation =="number" ? Elevations[elevation] || null : null;
82
82
  return <View
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  import React from '$react';
4
- import {TouchableOpacity, StyleSheet} from 'react-native';
4
+ import {Pressable, StyleSheet} from 'react-native';
5
5
  import {defaultStr} from "$cutils";
6
6
  import PropTypes from "prop-types";
7
7
  import View from "$ecomponents/View";
@@ -11,7 +11,7 @@ const GridColComponent = React.forwardRef((p,ref)=>{
11
11
  const flattenedStyle = StyleSheet.flatten(style);
12
12
  const testID = defaultStr(props.testID,"RN_Grid.ColComponent");
13
13
  const flex = customFlex !== undefined ? customFlex : (flattenedStyle && flattenedStyle.width) ? 0 : 1;
14
- const C = onPress || onLongPress || onPressIn || onPressOut ? TouchableOpacity : View;
14
+ const C = onPress || onLongPress || onPressIn || onPressOut ? Pressable : View;
15
15
  return <C {...props} activeOpacity={activeOpacity} onLongPress={onLongPress} onPressIn={onPressIn} onPressOut={onPressOut}
16
16
  testID={testID} style={[styles.container,flattenedStyle,{flex}]} ref={ref} onPress={onPress}
17
17
  />
@@ -1,5 +1,5 @@
1
1
  import React from '$react';
2
- import {TouchableOpacity,StyleSheet} from 'react-native';
2
+ import {Pressable,StyleSheet} from 'react-native';
3
3
  import {grid} from "$theme";
4
4
  import {defaultStr} from "$cutils";
5
5
  import PropTypes from "prop-types";
@@ -11,7 +11,7 @@ const GridComponent = React.forwardRef(({onPress,responsive,activeOpacity,onLong
11
11
  const flattenedStyle = StyleSheet.flatten(style);
12
12
  flexGrow = typeof flexGrow =='number'? flexGrow : 0;
13
13
  const flex = customFlex !== undefined ? customFlex : (flattenedStyle && (col && flattenedStyle.width || !col && flattenedStyle.height)) ? undefined : undefined;
14
- const C = onPress || onLongPress || onPressIn || onPressOut ? TouchableOpacity : View;
14
+ const C = onPress || onLongPress || onPressIn || onPressOut ? Pressable : View;
15
15
  return <C {...props} activeOpacity={activeOpacity} onLongPress={onLongPress} onPressIn={onPressIn} onPressOut={onPressOut}
16
16
  testID={testID+"_Container"} onPress={onPress}
17
17
  style={[styles.container,{flexGrow},col && {flexDirection:'column'},responsive!== false && !col && grid.row(false),style,flex !== undefined && {flex}]} ref={ref}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  import React from '$react';
4
- import {TouchableOpacity, StyleSheet} from 'react-native';
4
+ import {Pressable, StyleSheet} from 'react-native';
5
5
  import View from "$ecomponents/View";
6
6
  import {defaultStr} from "$cutils";
7
7
  import PropTypes from "prop-types";
@@ -11,7 +11,7 @@ const GridRowComponent = React.forwardRef((p,ref)=>{
11
11
  const flattenedStyle = StyleSheet.flatten(style);
12
12
  const testID = defaultStr(props.testID,"RN_Grid.RowComponent");
13
13
  const flex = customFlex !== undefined ? customFlex : (flattenedStyle && flattenedStyle.height) ? 0 : 1;
14
- const C = onPress || onLongPress || onPressIn || onPressOut ? TouchableOpacity : View;
14
+ const C = onPress || onLongPress || onPressIn || onPressOut ? Pressable : View;
15
15
  return <C {...props} activeOpacity={activeOpacity} onLongPress={onLongPress} onPressIn={onPressIn} onPressOut={onPressOut}
16
16
  onPress={onPress} testID={testID} style={[styles.container,flattenedStyle,{flex}]} ref={ref}
17
17
  />
@@ -17,7 +17,7 @@ export {Item};
17
17
  /****
18
18
  * @voir : https://callstack.github.io/react-native-paper/menu.html;
19
19
  * @param anchorProps a deux type de valuers : lorsque anchor n'est pas un élément réact valide, il s'agit des props du composant Icon de react-native-paper
20
- * lorsque anchror est un element réact valide, il s'agit des props du composant TouchableOpacity de react-native
20
+ * lorsque anchror est un element réact valide, il s'agit des props du composant Pressable de react-native
21
21
  * si closeOnPress est différent de false, alors le menu sera fermé lorsqu'on clique sur un item
22
22
  * anchorProps peut être de la forme : {
23
23
  * Component {default : Icon} qui est le composant qui sera rendu
@@ -1,7 +1,7 @@
1
1
  import React from "$react";
2
2
  import {defaultObj,defaultStr,isNonNullString} from "$cutils";
3
3
  import TextField from "$ecomponents/TextField";
4
- import { StyleSheet,Image,TouchableOpacity} from 'react-native';
4
+ import { StyleSheet,Image,Pressable} from 'react-native';
5
5
  import PropTypes from "prop-types";
6
6
  import theme,{DISABLED_OPACITY} from "$theme";
7
7
  import {keyboardTypes,flatMode} from "$ecomponents/TextField";
@@ -162,7 +162,7 @@ export default function PhoneInputComponent(props){
162
162
  disabled = {props.disabled}
163
163
  pointerEvents = {pointerEvents}
164
164
  left = {
165
- <TouchableOpacity testID={testID+"_Left"} style={[styles.flag,disabledStyle,!isFlatMode && styles.notFlatModeFlag]}
165
+ <Pressable testID={testID+"_Left"} style={[styles.flag,disabledStyle,!isFlatMode && styles.notFlatModeFlag]}
166
166
  role="button"
167
167
  disabled = {props.disabled}
168
168
  pointerEvents = {pointerEvents}
@@ -173,7 +173,7 @@ export default function PhoneInputComponent(props){
173
173
  : null}
174
174
  <Icon testID={testID+"_FlagChevronIcon"} name="chevron-down" size={16} style={[styles.flagIcon]} onPress={onPressFlag} />
175
175
  </>
176
- </TouchableOpacity>
176
+ </Pressable>
177
177
  }
178
178
  inputMode ={keyboardTypes.number}
179
179
  defaultValue = {state.displayValue}
@@ -1,7 +1,7 @@
1
1
  import React from "$react";
2
2
  import {defaultObj,isDecimal,defaultStr,debounce,extendObj,defaultVal,defaultFunc} from "$cutils";
3
3
  import TextField,{flatMode} from "$ecomponents/TextField";
4
- import {TouchableOpacity,Dimensions,StyleSheet} from "react-native";
4
+ import {Pressable,Dimensions,StyleSheet} from "react-native";
5
5
  import { TouchableRipple} from "react-native-paper";
6
6
  import View from "$ecomponents/View";
7
7
  import Divider from "$ecomponents/Divider";
@@ -277,7 +277,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
277
277
  const renderingItems = getItems();
278
278
  const autoFocus = canAutoFocusSearchField({visible,items:renderingItems});
279
279
  testID = defaultStr(testID, "RN_SimpleSelectComponent");
280
- anchor = <TouchableOpacity
280
+ anchor = <Pressable
281
281
  role="button"
282
282
  activeOpacity={0.3}
283
283
  testID = {testID}
@@ -290,7 +290,7 @@ const SimpleSelect = React.forwardRef((props,ref)=>{
290
290
  onLayout={onLayout}
291
291
  >
292
292
  <>{anchor}</>
293
- </TouchableOpacity>
293
+ </Pressable>
294
294
  const getItemLayout = typeof listProps.itemHeight ==='number' && listProps.itemHeight ? (data, index) => (
295
295
  {length: listProps.itemHeight, offset: listProps.itemHeight * index, index}
296
296
  ) : undefined;
@@ -2,7 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style
3
3
  // license that can be found in the LICENSE file.
4
4
  /****Le composant TableLink est utilisé pour les liens cliquable vers les tables de données */
5
- import {TouchableOpacity,StyleSheet} from "react-native";
5
+ import {Pressable,StyleSheet} from "react-native";
6
6
  import React from "$react";
7
7
  import View from "$ecomponents/View";
8
8
  import PropTypes from "prop-types";
@@ -56,7 +56,7 @@ const TableLinKComponent = React.forwardRef((props,ref)=>{
56
56
  }
57
57
  }
58
58
  rest.style = [rest.style,_styles.cursorPointer];
59
- const CP = disabled || readOnly ? View : TouchableOpacity;
59
+ const CP = disabled || readOnly ? View : Pressable;
60
60
  return <CP testID={testID} onLongPres={(e)=>React.stopEventPropagation(e)} {...containerProps} onPress={disabled? undefined : onPressLink} style={[styles.container,containerProps.style]}>
61
61
  <Tooltip testID={testID+"_Tooltip"} {...rest} Component={Component} onPress={disabled || readOnly?undefined:onPressLink} ref={ref} pointerEvents={pointerEvents} readOnly={readOnly} disabled = {disabled}>
62
62
  <Label testID={testID+"_Label"} underlined primary {...labelProps} style={[_styles.lh15,labelProps.style]} disabled={disabled} readOnly={readOnly}>{children}</Label>
@@ -8,7 +8,7 @@ import View from "$ecomponents/View";
8
8
  import {
9
9
  Modal,
10
10
  Animated,
11
- TouchableOpacity,
11
+ Pressable,
12
12
  StyleSheet,
13
13
  Pressable,
14
14
  Dimensions,
@@ -150,7 +150,7 @@ const TooltipPopoverComponent = React.forwardRef(({
150
150
  hideModal();
151
151
  }}>
152
152
  <View style={[styles.overlay, overlayStyle]} />
153
- <TouchableOpacity
153
+ <Pressable
154
154
  activeOpacity={1}
155
155
  style={[{ flex: 1 }, modalButtonStyle]}
156
156
  onPress={hideModal}
@@ -162,7 +162,7 @@ const TooltipPopoverComponent = React.forwardRef(({
162
162
  containerStyle,
163
163
  ]}
164
164
  >
165
- <TouchableOpacity onPress={isModalOpen ? hideModal : openModal}>
165
+ <Pressable onPress={isModalOpen ? hideModal : openModal}>
166
166
  <View
167
167
  style={[styles.innerContainer]}
168
168
  >
@@ -170,7 +170,7 @@ const TooltipPopoverComponent = React.forwardRef(({
170
170
  onLayout={onInnerContentLayout}
171
171
  style={[{color:theme.colors.primaryText,backgroundColor:theme.colors.primary,padding:10,borderRadius:5}]}>{content}</Label>
172
172
  </View>
173
- </TouchableOpacity>
173
+ </Pressable>
174
174
  </View>
175
175
  <Animated.View
176
176
  style={[
@@ -179,7 +179,7 @@ const TooltipPopoverComponent = React.forwardRef(({
179
179
  arrowStyle,
180
180
  ]}
181
181
  />
182
- </TouchableOpacity>
182
+ </Pressable>
183
183
  </Modal>;
184
184
  if(typeof children =='function'){
185
185
  return <>