@fto-consult/expo-ui 2.4.6 → 2.4.7

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.6",
3
+ "version": "2.4.7",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,11 +8,10 @@ import {
8
8
  } from 'react-native';
9
9
  import View from "$ecomponents/View";
10
10
  import {FAB,Text,Card,withTheme} from "react-native-paper";
11
- import color from 'color';
11
+ import colorFn from 'color';
12
12
  import PropTypes from "prop-types";
13
- import { StylePropTypes } from '$theme';
14
13
  import Action from "$ecomponents/Form/Action";
15
- import { disabledStyle,cursorNotAllowed } from '$theme';
14
+ import theme,{ disabledStyle,StylePropTypes,Colors,cursorNotAllowed } from '$theme';
16
15
  import {defaultStr} from "$utils";
17
16
 
18
17
 
@@ -24,7 +23,6 @@ const FABGroup = ({
24
23
  open,
25
24
  onPress,
26
25
  accessibilityLabel,
27
- theme,
28
26
  label,
29
27
  style,
30
28
  screenName,
@@ -90,11 +88,8 @@ const FABGroup = ({
90
88
 
91
89
  const toggle = () => onStateChange({ open: !open });
92
90
 
93
- const { colors } = theme;
91
+ const colors = theme.colors;
94
92
 
95
- const labelColor = theme.dark
96
- ? colors.text
97
- : color(colors.text).fade(theme.ALPHA).rgb().string();
98
93
  const backdropOpacity = open
99
94
  ? backdrop.interpolate({
100
95
  inputRange: [0, 0.5, 1],
@@ -139,8 +134,6 @@ const FABGroup = ({
139
134
  <View testID={testID+"_ItemsContainer"} style={[styles.itemsContainer]} pointerEvents={open ? 'box-none' : 'none'}>
140
135
  {actions.map((it, i) => {
141
136
  const itemProps = {
142
- labelColor : it.labelTextColor ?? it.labelColor ?? labelColor,
143
- backgroundColor : theme.colors.surface,
144
137
  ...it,
145
138
  open,
146
139
  scale:scales[i],
@@ -280,10 +273,12 @@ FABGroup.propTypes = {
280
273
  }
281
274
 
282
275
 
283
- export const FabItem = function(props){
284
- const {children,label,disabled:customDisabled,pointerEvents,open,close,testID:customTestID,labelStyle,labelColor,accessibilityLabel,icon,backgroundColor,scale,opacity,color,style,small,onPress,...rest} = props;
276
+ const _FabItem = function({children,label,disabled:customDisabled,pointerEvents,open,close,testID:customTestID,labelStyle,accessibilityLabel,icon,backgroundColor,scale,opacity,color,style,small,onPress}){
285
277
  const disabled = typeof customDisabled =='boolean'? customDisabled : false;
286
278
  const testID = defaultStr(customTestID,"RN_FabItemComponent")
279
+ style = StyleSheet.flatten(style) || {};
280
+ color = Colors.isValid(color)? color : style.color;
281
+ backgroundColor = Colors.isValid(backgroundColor)? backgroundColor : style.backgroundColor;
287
282
  const _onPress = ()=>{
288
283
  if(onPress){
289
284
  onPress();
@@ -299,11 +294,12 @@ export const FabItem = function(props){
299
294
  style={
300
295
  [
301
296
  styles.label,
297
+ labelStyle,
302
298
  {
303
299
  transform: [{ scale }],
304
300
  opacity,
301
+ backgroundColor,
305
302
  },
306
- labelStyle,
307
303
  ]
308
304
  }
309
305
  onPress={_onPress}
@@ -316,7 +312,7 @@ export const FabItem = function(props){
316
312
  accessibilityComponentType="button"
317
313
  accessibilityRole="button"
318
314
  >
319
- <Text testID={testID+"_Label"} style={{ color : labelColor }}>
315
+ <Text testID={testID+"_Label"} style={{ color}}>
320
316
  {label}
321
317
  </Text>
322
318
  </Card>
@@ -330,14 +326,14 @@ export const FabItem = function(props){
330
326
  pointerEvents={pointerEvents}
331
327
  style={
332
328
  [
333
- {
334
- transform: [{ scale}],
335
- opacity,
336
- backgroundColor,
337
- },
338
329
  style,
339
330
  dStyle,
340
331
  disabled? cursorNotAllowed : null,
332
+ {
333
+ transform: [{ scale}],
334
+ opacity,
335
+ backgroundColor,
336
+ },
341
337
  ]
342
338
  }
343
339
  onPress={_onPress}
@@ -356,6 +352,7 @@ export const FabItem = function(props){
356
352
  </>
357
353
  }
358
354
 
355
+ export const FabItem = theme.withStyles(_FabItem,{displayName:"FabItemComponent",mode:"contained"});
359
356
  const styles = StyleSheet.create({
360
357
  safeArea: {
361
358
  alignItems: 'flex-end',