@react-native-segmented-control/segmented-control 2.5.0 → 2.5.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/js/SegmentedControl.js
CHANGED
|
@@ -93,6 +93,20 @@ const SegmentedControl = ({
|
|
|
93
93
|
selectedIndex={selectedIndex}
|
|
94
94
|
/>
|
|
95
95
|
)}
|
|
96
|
+
{selectedIndex != null && segmentWidth ? (
|
|
97
|
+
<Animated.View
|
|
98
|
+
style={[
|
|
99
|
+
styles.slider,
|
|
100
|
+
{
|
|
101
|
+
transform: [{translateX: animation}],
|
|
102
|
+
width: segmentWidth - 4,
|
|
103
|
+
zIndex: -1,
|
|
104
|
+
backgroundColor:
|
|
105
|
+
tintColor || (colorScheme === 'dark' ? '#636366' : 'white'),
|
|
106
|
+
},
|
|
107
|
+
]}
|
|
108
|
+
/>
|
|
109
|
+
) : null}
|
|
96
110
|
<View style={styles.segmentsContainer}>
|
|
97
111
|
{values &&
|
|
98
112
|
values.map((value, index) => {
|
|
@@ -100,7 +114,9 @@ const SegmentedControl = ({
|
|
|
100
114
|
<SegmentedControlTab
|
|
101
115
|
enabled={enabled}
|
|
102
116
|
selected={selectedIndex === index}
|
|
103
|
-
accessibilityHint={`${
|
|
117
|
+
accessibilityHint={`${
|
|
118
|
+
index + 1
|
|
119
|
+
} ${accessibilityHintSeperator} ${values.length}`}
|
|
104
120
|
key={index}
|
|
105
121
|
value={value}
|
|
106
122
|
tintColor={tintColor}
|
|
@@ -115,20 +131,6 @@ const SegmentedControl = ({
|
|
|
115
131
|
);
|
|
116
132
|
})}
|
|
117
133
|
</View>
|
|
118
|
-
{selectedIndex != null && segmentWidth ? (
|
|
119
|
-
<Animated.View
|
|
120
|
-
style={[
|
|
121
|
-
styles.slider,
|
|
122
|
-
{
|
|
123
|
-
transform: [{translateX: animation}],
|
|
124
|
-
width: segmentWidth - 4,
|
|
125
|
-
zIndex: -1,
|
|
126
|
-
backgroundColor:
|
|
127
|
-
tintColor || (colorScheme === 'dark' ? '#636366' : 'white'),
|
|
128
|
-
},
|
|
129
|
-
]}
|
|
130
|
-
/>
|
|
131
|
-
) : null}
|
|
132
134
|
</View>
|
|
133
135
|
);
|
|
134
136
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-segmented-control/segmented-control",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "React Native SegmentedControlIOS library",
|
|
5
5
|
"main": "js/index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-native-web": "^0.14.10",
|
|
52
52
|
"react-test-renderer": "17.0.2",
|
|
53
53
|
"rimraf": "^3.0.2",
|
|
54
|
-
"semantic-release": "^
|
|
54
|
+
"semantic-release": "^23.0.6",
|
|
55
55
|
"typescript": "^4"
|
|
56
56
|
},
|
|
57
57
|
"resolutions": {
|
|
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
|
|
11
11
|
s.authors = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.
|
|
13
|
+
s.platforms = { :ios => "9.0", :visionos => "1.0" }
|
|
14
14
|
|
|
15
15
|
s.source = { :git => "https://github.com/react-native-segmented-control/segmented-control.git", :tag => "#{s.version}" }
|
|
16
16
|
s.source_files = "ios/**/*.{h,m}"
|