@fto-consult/expo-ui 2.4.5 → 2.4.6

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.4.5",
3
+ "version": "2.4.6",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,7 +19,6 @@ const FabComponent = React.forwardRef((props,ref)=>{
19
19
  color = theme.colors.secondaryText;
20
20
  }
21
21
  return <FAB
22
- //small
23
22
  testID='RN_FabComponent'
24
23
  {...rest}
25
24
  color = {color}
@@ -61,7 +61,6 @@ const FabGroupComponent = React.forwardRef((props,innerRef)=>{
61
61
  act.label = defaultStr(act.label,act.text);
62
62
  const a = actionMutator ? actionMutator ({action:act,key:i,isFab:true,fab:true}) : act;
63
63
  if(!isObj(a) || !isNonNullString(a.label)) return null;
64
- a.small = typeof a.small =='boolean'? a.small : false;
65
64
  const {perm,isAllowed,primary,secondary,...restItem} = a;
66
65
  if(typeof isAllowed =='function' && isAllowed() === false) return null;
67
66
  if(isNonNullString(perm) && !Auth.isAllowedFromStr(perm)) return false;
@@ -30,12 +30,12 @@ const FABGroup = ({
30
30
  screenName,
31
31
  fabStyle,
32
32
  visible,
33
- testID,
34
33
  onStateChange,
35
34
  color: colorProp,
35
+ testID,
36
36
  ...rest
37
37
  }) => {
38
-
38
+ testID = defaultStr(testID,"RN_FabGroupComponent")
39
39
  const { current: backdrop } = React.useRef(
40
40
  new Animated.Value(0)
41
41
  );
@@ -121,9 +121,10 @@ const FABGroup = ({
121
121
  const Item = isFormAction ? Action : FabItem;
122
122
  const itemComponentProps = isFormAction ? {Component : FabItem} : {};
123
123
  return (
124
- <View pointerEvents="box-none" style={[styles.container, style]}>
125
- <TouchableWithoutFeedback onPress={close}>
124
+ <View testID={testID+"_Container"} pointerEvents="box-none" style={[styles.container, style]}>
125
+ <TouchableWithoutFeedback testID={testID+"_TouchableOpacity"} onPress={close}>
126
126
  <Animated.View
127
+ testID={testID+"_AnimatedView"}
127
128
  pointerEvents={open ? 'auto' : 'none'}
128
129
  style={[
129
130
  styles.backdrop,
@@ -134,8 +135,8 @@ const FABGroup = ({
134
135
  ]}
135
136
  />
136
137
  </TouchableWithoutFeedback>
137
- <SafeAreaView pointerEvents="box-none" style={styles.safeArea}>
138
- <View pointerEvents={open ? 'box-none' : 'none'}>
138
+ <SafeAreaView testID={testID+"_SafeAreaView"} pointerEvents="box-none" style={styles.safeArea}>
139
+ <View testID={testID+"_ItemsContainer"} style={[styles.itemsContainer]} pointerEvents={open ? 'box-none' : 'none'}>
139
140
  {actions.map((it, i) => {
140
141
  const itemProps = {
141
142
  labelColor : it.labelTextColor ?? it.labelColor ?? labelColor,
@@ -148,12 +149,13 @@ const FABGroup = ({
148
149
  }
149
150
  return (
150
151
  <View
152
+ testID={testID+"_Item_"+i}
151
153
  key={i} // eslint-disable-line react/no-array-index-key
152
154
  style={[
153
155
  styles.item,
154
156
  {
155
157
  marginHorizontal:
156
- typeof it.small === 'undefined' || it.small ? 24 : 16,
158
+ typeof it.small || it.small ? 24 : 16,
157
159
  },
158
160
  ]}
159
161
  pointerEvents={open ? 'box-none' : 'none'}
@@ -281,7 +283,7 @@ FABGroup.propTypes = {
281
283
  export const FabItem = function(props){
282
284
  const {children,label,disabled:customDisabled,pointerEvents,open,close,testID:customTestID,labelStyle,labelColor,accessibilityLabel,icon,backgroundColor,scale,opacity,color,style,small,onPress,...rest} = props;
283
285
  const disabled = typeof customDisabled =='boolean'? customDisabled : false;
284
- const testID = defaultStr(customTestID,"RN_FabGroupComponent")
286
+ const testID = defaultStr(customTestID,"RN_FabItemComponent")
285
287
  const _onPress = ()=>{
286
288
  if(onPress){
287
289
  onPress();
@@ -321,7 +323,7 @@ export const FabItem = function(props){
321
323
  </View>
322
324
  ) : null}
323
325
  <FAB
324
- small={typeof small !== 'undefined' ? small : true}
326
+ small={typeof small =='boolean' ? small : true}
325
327
  icon={icon}
326
328
  color={color}
327
329
  disabled = {disabled}
@@ -358,6 +360,9 @@ const styles = StyleSheet.create({
358
360
  safeArea: {
359
361
  alignItems: 'flex-end',
360
362
  },
363
+ itemsContainer : {
364
+ marginBottom : 70,
365
+ },
361
366
  container: {
362
367
  ...StyleSheet.absoluteFillObject,
363
368
  justifyContent: 'flex-end',