@fto-consult/expo-ui 2.4.6 → 2.4.8
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
|
@@ -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
|
|
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,cursorPointer,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
|
|
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,13 @@ FABGroup.propTypes = {
|
|
|
280
273
|
}
|
|
281
274
|
|
|
282
275
|
|
|
283
|
-
|
|
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;
|
|
282
|
+
const cursorStyle = disabled? cursorNotAllowed : cursorPointer;
|
|
287
283
|
const _onPress = ()=>{
|
|
288
284
|
if(onPress){
|
|
289
285
|
onPress();
|
|
@@ -299,11 +295,12 @@ export const FabItem = function(props){
|
|
|
299
295
|
style={
|
|
300
296
|
[
|
|
301
297
|
styles.label,
|
|
298
|
+
labelStyle,
|
|
302
299
|
{
|
|
303
300
|
transform: [{ scale }],
|
|
304
301
|
opacity,
|
|
302
|
+
backgroundColor,
|
|
305
303
|
},
|
|
306
|
-
labelStyle,
|
|
307
304
|
]
|
|
308
305
|
}
|
|
309
306
|
onPress={_onPress}
|
|
@@ -316,7 +313,7 @@ export const FabItem = function(props){
|
|
|
316
313
|
accessibilityComponentType="button"
|
|
317
314
|
accessibilityRole="button"
|
|
318
315
|
>
|
|
319
|
-
<Text testID={testID+"_Label"} style={{ color
|
|
316
|
+
<Text testID={testID+"_Label"} style={StyleSheet.flatten([{ color},cursorStyle])}>
|
|
320
317
|
{label}
|
|
321
318
|
</Text>
|
|
322
319
|
</Card>
|
|
@@ -330,14 +327,14 @@ export const FabItem = function(props){
|
|
|
330
327
|
pointerEvents={pointerEvents}
|
|
331
328
|
style={
|
|
332
329
|
[
|
|
333
|
-
{
|
|
334
|
-
transform: [{ scale}],
|
|
335
|
-
opacity,
|
|
336
|
-
backgroundColor,
|
|
337
|
-
},
|
|
338
330
|
style,
|
|
339
331
|
dStyle,
|
|
340
|
-
|
|
332
|
+
cursorStyle,
|
|
333
|
+
{
|
|
334
|
+
transform: [{ scale}],
|
|
335
|
+
opacity,
|
|
336
|
+
backgroundColor,
|
|
337
|
+
},
|
|
341
338
|
]
|
|
342
339
|
}
|
|
343
340
|
onPress={_onPress}
|
|
@@ -356,6 +353,7 @@ export const FabItem = function(props){
|
|
|
356
353
|
</>
|
|
357
354
|
}
|
|
358
355
|
|
|
356
|
+
export const FabItem = theme.withStyles(_FabItem,{displayName:"FabItemComponent",mode:"contained"});
|
|
359
357
|
const styles = StyleSheet.create({
|
|
360
358
|
safeArea: {
|
|
361
359
|
alignItems: 'flex-end',
|