react-native-ui-lib 7.37.2-snapshot.6134 → 7.37.2-snapshot.6172
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 +1 -1
- package/src/components/switch/index.js +4 -1
- package/src/components/switch/switch.driver.d.ts +2 -1
- package/src/components/switch/switch.driver.js +3 -1
- package/src/components/textField/index.js +4 -1
- package/src/incubator/expandableOverlay/index.js +3 -12
- package/src/incubator/toast/index.js +3 -1
- package/src/index.d.ts +1 -1
- /package/{index.js → demo.js} +0 -0
package/package.json
CHANGED
|
@@ -2,8 +2,9 @@ import { ViewStyle } from 'react-native';
|
|
|
2
2
|
import { ComponentProps } from '../../testkit/new/Component.driver';
|
|
3
3
|
export declare const SwitchDriver: (props: ComponentProps) => {
|
|
4
4
|
getStyle: () => ViewStyle;
|
|
5
|
+
getAccessibilityValue: () => boolean;
|
|
5
6
|
isDisabled: () => boolean;
|
|
6
|
-
isChecked: () =>
|
|
7
|
+
isChecked: () => boolean;
|
|
7
8
|
press: () => void;
|
|
8
9
|
hasOnPress: () => boolean;
|
|
9
10
|
onPressIn: () => void;
|
|
@@ -3,11 +3,13 @@ import { usePressableDriver } from "../../testkit/new/usePressable.driver";
|
|
|
3
3
|
export const SwitchDriver = props => {
|
|
4
4
|
const driver = usePressableDriver(useComponentDriver(props));
|
|
5
5
|
const getStyle = () => driver.getElement().props.style;
|
|
6
|
+
const getAccessibilityValue = () => driver.getElement().props.accessibilityValue?.text === '1';
|
|
6
7
|
const isDisabled = () => driver.getElement().props.accessibilityState?.disabled === true;
|
|
7
|
-
const isChecked = () => driver.getElement().props.
|
|
8
|
+
const isChecked = () => driver.getElement().props.accessibilityValue?.text === '1';
|
|
8
9
|
return {
|
|
9
10
|
...driver,
|
|
10
11
|
getStyle,
|
|
12
|
+
getAccessibilityValue,
|
|
11
13
|
isDisabled,
|
|
12
14
|
isChecked
|
|
13
15
|
};
|
|
@@ -159,7 +159,10 @@ const TextField = props => {
|
|
|
159
159
|
{placeholder}
|
|
160
160
|
</Text>}
|
|
161
161
|
{floatingPlaceholder && <FloatingPlaceholder defaultValue={others.defaultValue} placeholder={placeholder} floatingPlaceholderStyle={_floatingPlaceholderStyle} floatingPlaceholderColor={floatingPlaceholderColor} floatOnFocus={floatOnFocus} validationMessagePosition={validationMessagePosition} extraOffset={leadingAccessoryMeasurements?.width} testID={`${props.testID}.floatingPlaceholder`} showMandatoryIndication={showMandatoryIndication} />}
|
|
162
|
-
<Input
|
|
162
|
+
<Input hitSlop={{
|
|
163
|
+
top: 20,
|
|
164
|
+
bottom: 20
|
|
165
|
+
}} placeholderTextColor={hidePlaceholder ? 'transparent' : placeholderTextColor} value={fieldState.value} {...others} readonly={readonly} style={inputStyle} onFocus={onFocus} onBlur={onBlur} onChangeText={onChangeText} placeholder={placeholder} hint={hint} showMandatoryIndication={showMandatoryIndication && !label} />
|
|
163
166
|
</View>}
|
|
164
167
|
{showClearButton && <ClearButton onClear={onClear} testID={`${props.testID}.clearButton`} onChangeText={onChangeText} clearButtonStyle={clearButtonStyle} />}
|
|
165
168
|
{trailingAccessory}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useState, forwardRef, useImperativeHandle
|
|
2
|
-
import { AccessibilityInfo, findNodeHandle } from 'react-native';
|
|
1
|
+
import React, { useCallback, useState, forwardRef, useImperativeHandle } from 'react';
|
|
3
2
|
import TouchableOpacity from "../../components/touchableOpacity";
|
|
4
3
|
import View from "../../components/view";
|
|
5
4
|
import Modal from "../../components/modal";
|
|
@@ -24,22 +23,14 @@ const ExpandableOverlay = (props, ref) => {
|
|
|
24
23
|
...others
|
|
25
24
|
} = props;
|
|
26
25
|
const [visible, setExpandableVisible] = useState(false);
|
|
27
|
-
const containerRef = useRef(null);
|
|
28
|
-
const focusAccessibility = useCallback(() => {
|
|
29
|
-
const reactTag = findNodeHandle(containerRef.current);
|
|
30
|
-
if (reactTag) {
|
|
31
|
-
AccessibilityInfo.setAccessibilityFocus(reactTag);
|
|
32
|
-
}
|
|
33
|
-
}, []);
|
|
34
26
|
const openExpandable = useCallback(() => {
|
|
35
27
|
setExpandableVisible(true);
|
|
36
28
|
onPress?.(props);
|
|
37
29
|
}, [onPress, customValue]);
|
|
38
30
|
const closeExpandable = useCallback(() => {
|
|
39
31
|
setExpandableVisible(false);
|
|
40
|
-
focusAccessibility();
|
|
41
32
|
useDialog ? dialogProps?.onDismiss?.() : modalProps?.onDismiss?.();
|
|
42
|
-
}, [useDialog, dialogProps?.onDismiss, modalProps?.onDismiss
|
|
33
|
+
}, [useDialog, dialogProps?.onDismiss, modalProps?.onDismiss]);
|
|
43
34
|
const toggleExpandable = useCallback(() => visible ? closeExpandable() : openExpandable(), [visible, openExpandable, closeExpandable]);
|
|
44
35
|
useImperativeHandle(ref, () => ({
|
|
45
36
|
openExpandable,
|
|
@@ -70,7 +61,7 @@ const ExpandableOverlay = (props, ref) => {
|
|
|
70
61
|
return useDialog ? renderDialog() : renderModal();
|
|
71
62
|
}
|
|
72
63
|
};
|
|
73
|
-
return <TouchableOpacity
|
|
64
|
+
return <TouchableOpacity {...others} onPress={openExpandable} disabled={disabled} testID={testID}>
|
|
74
65
|
<View pointerEvents="none">{children}</View>
|
|
75
66
|
{renderOverlay()}
|
|
76
67
|
</TouchableOpacity>;
|
|
@@ -57,9 +57,11 @@ const Toast = props => {
|
|
|
57
57
|
});
|
|
58
58
|
const playAccessibilityFeatures = () => {
|
|
59
59
|
if (visible) {
|
|
60
|
-
if (viewRef.current &&
|
|
60
|
+
if (viewRef.current && action) {
|
|
61
61
|
const reactTag = findNodeHandle(viewRef.current);
|
|
62
62
|
AccessibilityInfo.setAccessibilityFocus(reactTag);
|
|
63
|
+
} else if (message) {
|
|
64
|
+
AccessibilityInfo.announceForAccessibility?.(toastPreset.accessibilityMessage);
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
};
|
package/src/index.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export { default as PanningProvider, PanningDirections, PanLocationProps, PanAmo
|
|
|
68
68
|
export { default as PanResponderView, PanResponderViewProps } from './components/panningViews/panResponderView';
|
|
69
69
|
export { default as asPanViewConsumer } from './components/panningViews/asPanViewConsumer';
|
|
70
70
|
export { default as Picker, PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods } from './components/picker';
|
|
71
|
-
export { default as PieChart,
|
|
71
|
+
export { default as PieChart, PieChartSegmentProps } from './components/pieChart';
|
|
72
72
|
export { default as ProgressBar, ProgressBarProps } from './components/progressBar';
|
|
73
73
|
export { default as ProgressiveImage, ProgressiveImageProps } from './components/progressiveImage';
|
|
74
74
|
export { default as RadioButton, RadioButtonProps } from './components/radioButton';
|
/package/{index.js → demo.js}
RENAMED
|
File without changes
|