@tarojs/router-rn 3.5.0-canary.1 → 3.5.0
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/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/navigationBar.js +6 -18
- package/dist/navigationBar.js.map +1 -1
- package/dist/provider.js +3 -11
- package/dist/provider.js.map +1 -1
- package/dist/rootNavigation.js +3 -3
- package/dist/rootNavigation.js.map +1 -1
- package/dist/router.js +43 -69
- package/dist/router.js.map +1 -1
- package/dist/tabBar.js +1 -1
- package/dist/tabBar.js.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/view/BackButton.js +1 -3
- package/dist/view/BackButton.js.map +1 -1
- package/dist/view/Badge.js +0 -3
- package/dist/view/Badge.js.map +1 -1
- package/dist/view/HeadTitle.js +2 -4
- package/dist/view/HeadTitle.js.map +1 -1
- package/dist/view/Loading.js +1 -3
- package/dist/view/Loading.js.map +1 -1
- package/dist/view/TabBar.js +12 -22
- package/dist/view/TabBar.js.map +1 -1
- package/dist/view/TabBarItem.js +3 -5
- package/dist/view/TabBarItem.js.map +1 -1
- package/package.json +23 -27
- package/src/index.ts +2 -2
- package/src/navigationBar.ts +9 -19
- package/src/provider.ts +4 -10
- package/src/rootNavigation.ts +9 -7
- package/src/{router.ts → router.tsx} +108 -123
- package/src/tabBar.ts +11 -11
- package/src/utils/index.ts +2 -2
- package/src/utils/types.ts +12 -12
- package/src/view/BackButton.tsx +1 -3
- package/src/view/Badge.tsx +5 -8
- package/src/view/HeadTitle.tsx +5 -6
- package/src/view/Loading.tsx +2 -4
- package/src/view/TabBar.tsx +34 -39
- package/src/view/TabBarItem.tsx +27 -28
package/src/view/TabBarItem.tsx
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
// eslint-disable-next-line no-use-before-define
|
|
2
1
|
import * as React from 'react'
|
|
3
2
|
import {
|
|
4
|
-
View,
|
|
5
|
-
Text,
|
|
6
3
|
Image,
|
|
7
|
-
StyleSheet,
|
|
8
4
|
ImageSourcePropType,
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
StyleSheet,
|
|
6
|
+
Text,
|
|
7
|
+
TextStyle,
|
|
8
|
+
View,
|
|
9
|
+
ViewStyle
|
|
11
10
|
} from 'react-native'
|
|
11
|
+
|
|
12
12
|
import Badge from './Badge'
|
|
13
13
|
|
|
14
14
|
export interface TabBarOptions {
|
|
15
|
-
activeTintColor: string
|
|
16
|
-
inactiveTintColor: string
|
|
17
|
-
activeBackgroundColor: string
|
|
18
|
-
inactiveBackgroundColor: string
|
|
19
|
-
tabStyle?: ViewStyle
|
|
20
|
-
labelStyle?: TextStyle
|
|
21
|
-
showLabel?: boolean
|
|
22
|
-
allowFontScaling?: boolean
|
|
23
|
-
keyboardHidesTabBar?: boolean
|
|
15
|
+
activeTintColor: string
|
|
16
|
+
inactiveTintColor: string
|
|
17
|
+
activeBackgroundColor: string
|
|
18
|
+
inactiveBackgroundColor: string
|
|
19
|
+
tabStyle?: ViewStyle
|
|
20
|
+
labelStyle?: TextStyle
|
|
21
|
+
showLabel?: boolean
|
|
22
|
+
allowFontScaling?: boolean
|
|
23
|
+
keyboardHidesTabBar?: boolean
|
|
24
24
|
safeAreaInsets?: Record<string, number>
|
|
25
25
|
style?: ViewStyle
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface TabOptions {
|
|
29
|
-
tabBarVisible?: boolean
|
|
30
|
-
tabBarBadge?: boolean
|
|
31
|
-
tabBarBadgeStyle?: Record<string, any
|
|
29
|
+
tabBarVisible?: boolean
|
|
30
|
+
tabBarBadge?: boolean
|
|
31
|
+
tabBarBadgeStyle?: Record<string, any>
|
|
32
32
|
}
|
|
33
33
|
interface TabBarItemProps extends TabBarOptions{
|
|
34
|
-
badge: number | string
|
|
35
|
-
showRedDot: boolean
|
|
36
|
-
label: string
|
|
37
|
-
horizontal: boolean
|
|
38
|
-
labelColor: string
|
|
34
|
+
badge: number | string
|
|
35
|
+
showRedDot: boolean
|
|
36
|
+
label: string
|
|
37
|
+
horizontal: boolean
|
|
38
|
+
labelColor: string
|
|
39
39
|
iconSource: ImageSourcePropType
|
|
40
|
-
size?: number
|
|
41
|
-
|
|
40
|
+
size?: number
|
|
41
|
+
tabOptions?: TabOptions
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
const styles = StyleSheet.create({
|
|
@@ -97,7 +97,6 @@ const styles = StyleSheet.create({
|
|
|
97
97
|
})
|
|
98
98
|
|
|
99
99
|
export default class TabBarItem extends React.PureComponent<TabBarItemProps> {
|
|
100
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
101
100
|
render () {
|
|
102
101
|
const {
|
|
103
102
|
label,
|
|
@@ -107,13 +106,13 @@ export default class TabBarItem extends React.PureComponent<TabBarItemProps> {
|
|
|
107
106
|
size = 20,
|
|
108
107
|
labelColor,
|
|
109
108
|
iconSource,
|
|
110
|
-
|
|
109
|
+
tabOptions,
|
|
111
110
|
tabStyle = {},
|
|
112
111
|
labelStyle = {},
|
|
113
112
|
allowFontScaling = true,
|
|
114
113
|
showLabel = true
|
|
115
114
|
} = this.props
|
|
116
|
-
const tabBarBadgeStyle =
|
|
115
|
+
const tabBarBadgeStyle = tabOptions?.tabBarBadgeStyle || {}
|
|
117
116
|
return (
|
|
118
117
|
<View style={[styles.tabItem, styles.itemHorizontal, tabStyle]}>
|
|
119
118
|
<View style={styles.icon}>
|