@react-navigation/material-top-tabs 8.0.0-alpha.4 → 8.0.0-alpha.40
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/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createMaterialTopTabNavigator.js +3 -7
- package/lib/module/navigators/createMaterialTopTabNavigator.js.map +1 -1
- package/lib/module/utils/useTabAnimation.js +1 -1
- package/lib/module/utils/useTabAnimation.js.map +1 -1
- package/lib/module/views/MaterialTopTabBar.js +53 -24
- package/lib/module/views/MaterialTopTabBar.js.map +1 -1
- package/lib/module/views/MaterialTopTabView.js +71 -10
- package/lib/module/views/MaterialTopTabView.js.map +1 -1
- package/lib/typescript/src/index.d.ts +5 -5
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/createMaterialTopTabNavigator.d.ts +9 -15
- package/lib/typescript/src/navigators/createMaterialTopTabNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +61 -36
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/TabAnimationContext.d.ts +1 -1
- package/lib/typescript/src/utils/TabAnimationContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/useTabAnimation.d.ts +1 -1
- package/lib/typescript/src/utils/useTabAnimation.d.ts.map +1 -1
- package/lib/typescript/src/views/MaterialTopTabBar.d.ts +3 -2
- package/lib/typescript/src/views/MaterialTopTabBar.d.ts.map +1 -1
- package/lib/typescript/src/views/MaterialTopTabView.d.ts +2 -2
- package/lib/typescript/src/views/MaterialTopTabView.d.ts.map +1 -1
- package/package.json +18 -19
- package/src/index.tsx +1 -0
- package/src/navigators/createMaterialTopTabNavigator.tsx +10 -46
- package/src/types.tsx +76 -44
- package/src/utils/useTabAnimation.tsx +1 -1
- package/src/views/MaterialTopTabBar.tsx +76 -34
- package/src/views/MaterialTopTabView.tsx +100 -9
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createMaterialTopTabNavigator","createMaterialTopTabScreen","MaterialTopTabBar","MaterialTopTabView","useTabAnimation"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA,SACEA,6BAA6B,EAC7BC,0BAA0B,
|
|
1
|
+
{"version":3,"names":["createMaterialTopTabNavigator","createMaterialTopTabScreen","MaterialTopTabBar","MaterialTopTabView","useTabAnimation"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA,SACEA,6BAA6B,EAC7BC,0BAA0B,QAErB,+CAA4C;;AAEnD;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,kBAAkB,QAAQ,+BAA4B;;AAE/D;AACA;AACA;AACA,SAASC,eAAe,QAAQ,4BAAyB;;AAEzD;AACA;AACA","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { createNavigatorFactory, TabRouter, useNavigationBuilder } from '@react-navigation/native';
|
|
3
|
+
import { createNavigatorFactory, createScreenFactory, TabRouter, useNavigationBuilder } from '@react-navigation/native';
|
|
4
4
|
import { MaterialTopTabView } from "../views/MaterialTopTabView.js";
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
function MaterialTopTabNavigator({
|
|
@@ -40,10 +40,6 @@ function MaterialTopTabNavigator({
|
|
|
40
40
|
})
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
export function createMaterialTopTabScreen(config) {
|
|
47
|
-
return config;
|
|
48
|
-
}
|
|
43
|
+
export const createMaterialTopTabNavigator = createNavigatorFactory(MaterialTopTabNavigator);
|
|
44
|
+
export const createMaterialTopTabScreen = createScreenFactory();
|
|
49
45
|
//# sourceMappingURL=createMaterialTopTabNavigator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createNavigatorFactory","TabRouter","useNavigationBuilder","MaterialTopTabView","jsx","_jsx","MaterialTopTabNavigator","initialRouteName","backBehavior","routeNamesChangeBehavior","children","layout","screenListeners","screenOptions","screenLayout","router","rest","state","descriptors","navigation","NavigationContent","createMaterialTopTabNavigator","
|
|
1
|
+
{"version":3,"names":["createNavigatorFactory","createScreenFactory","TabRouter","useNavigationBuilder","MaterialTopTabView","jsx","_jsx","MaterialTopTabNavigator","initialRouteName","backBehavior","routeNamesChangeBehavior","children","layout","screenListeners","screenOptions","screenLayout","router","rest","state","descriptors","navigation","NavigationContent","createMaterialTopTabNavigator","createMaterialTopTabScreen"],"sourceRoot":"../../../src","sources":["navigators/createMaterialTopTabNavigator.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EACtBC,mBAAmB,EAKnBC,SAAS,EAETC,oBAAoB,QACf,0BAA0B;AAOjC,SAASC,kBAAkB,QAAQ,gCAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjE,SAASC,uBAAuBA,CAAC;EAC/BC,gBAAgB;EAChBC,YAAY;EACZC,wBAAwB;EACxBC,QAAQ;EACRC,MAAM;EACNC,eAAe;EACfC,aAAa;EACbC,YAAY;EACZC,MAAM;EACN,GAAGC;AACyB,CAAC,EAAE;EAC/B,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAkB,CAAC,GACzDlB,oBAAoB,CAMlBD,SAAS,EAAE;IACXM,gBAAgB;IAChBC,YAAY;IACZC,wBAAwB;IACxBC,QAAQ;IACRC,MAAM;IACNC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC;EACF,CAAC,CAAC;EAEJ,oBACEV,IAAA,CAACe,iBAAiB;IAAAV,QAAA,eAChBL,IAAA,CAACF,kBAAkB;MAAA,GACba,IAAI;MACRC,KAAK,EAAEA,KAAM;MACbE,UAAU,EAAEA,UAAW;MACvBD,WAAW,EAAEA;IAAY,CAC1B;EAAC,CACe,CAAC;AAExB;AAUA,OAAO,MAAMG,6BAA6B,GACxCtB,sBAAsB,CAAwBO,uBAAuB,CAAC;AAExE,OAAO,MAAMgB,0BAA0B,GACrCtB,mBAAmB,CAAwB,CAAC","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { TabAnimationContext } from "./TabAnimationContext.js";
|
|
5
5
|
export function useTabAnimation() {
|
|
6
|
-
const animation = React.
|
|
6
|
+
const animation = React.use(TabAnimationContext);
|
|
7
7
|
if (animation === undefined) {
|
|
8
8
|
throw new Error("Couldn't find values for tab animation. Are you inside a screen in Material Top Tab navigator?");
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","TabAnimationContext","useTabAnimation","animation","
|
|
1
|
+
{"version":3,"names":["React","TabAnimationContext","useTabAnimation","animation","use","undefined","Error"],"sourceRoot":"../../../src","sources":["utils/useTabAnimation.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,mBAAmB,QAAQ,0BAAuB;AAE3D,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,MAAMC,SAAS,GAAGH,KAAK,CAACI,GAAG,CAACH,mBAAmB,CAAC;EAEhD,IAAIE,SAAS,KAAKE,SAAS,EAAE;IAC3B,MAAM,IAAIC,KAAK,CACb,gGACF,CAAC;EACH;EAEA,OAAOH,SAAS;AAClB","ignoreList":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Text } from '@react-navigation/elements';
|
|
3
|
+
import { PlatformIcon, Text } from '@react-navigation/elements';
|
|
4
4
|
import { Color } from '@react-navigation/elements/internal';
|
|
5
5
|
import { useLinkBuilder, useLocale, useTheme } from '@react-navigation/native';
|
|
6
|
+
import * as React from 'react';
|
|
6
7
|
import { StyleSheet } from 'react-native';
|
|
7
|
-
import { TabBar
|
|
8
|
+
import { TabBar } from 'react-native-tab-view';
|
|
8
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
10
|
const MaterialLabel = ({
|
|
10
11
|
color,
|
|
@@ -42,13 +43,17 @@ export function MaterialTopTabBar({
|
|
|
42
43
|
const {
|
|
43
44
|
buildHref
|
|
44
45
|
} = useLinkBuilder();
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const focusedRoute = state.routes[state.index];
|
|
47
|
+
if (focusedRoute == null) {
|
|
48
|
+
throw new Error(`Couldn't find a route at index ${state.index}.`);
|
|
49
|
+
}
|
|
50
|
+
const focusedOptions = descriptors[focusedRoute.key]?.options ?? {};
|
|
51
|
+
const tabBarVariant = focusedOptions.tabBarVariant ?? 'primary';
|
|
52
|
+
const activeColor = focusedOptions.tabBarActiveTintColor ?? (tabBarVariant === 'primary' ? colors.primary : colors.text);
|
|
53
|
+
const inactiveColor = focusedOptions.tabBarInactiveTintColor ?? Color(colors.text)?.alpha(0.68).string() ?? (dark ? 'rgba(255, 255, 255, 0.68)' : 'rgba(0, 0, 0, 0.68)');
|
|
54
|
+
const pressColor = focusedOptions.tabBarPressColor ?? Color(tabBarVariant === 'primary' ? colors.primary : colors.text)?.alpha(0.12).string() ?? (dark ? 'rgba(255, 255, 255, 0.12)' : 'rgba(0, 0, 0, 0.12)');
|
|
48
55
|
const tabBarOptions = Object.fromEntries(state.routes.map(route => {
|
|
49
|
-
const {
|
|
50
|
-
options
|
|
51
|
-
} = descriptors[route.key];
|
|
56
|
+
const options = descriptors[route.key]?.options ?? {};
|
|
52
57
|
const {
|
|
53
58
|
title,
|
|
54
59
|
tabBarLabel,
|
|
@@ -61,17 +66,44 @@ export function MaterialTopTabBar({
|
|
|
61
66
|
tabBarAllowFontScaling,
|
|
62
67
|
tabBarLabelStyle
|
|
63
68
|
} = options;
|
|
69
|
+
let icon;
|
|
70
|
+
if (tabBarShowIcon === false) {
|
|
71
|
+
icon = undefined;
|
|
72
|
+
} else if (tabBarIcon) {
|
|
73
|
+
icon = ({
|
|
74
|
+
focused,
|
|
75
|
+
color,
|
|
76
|
+
size
|
|
77
|
+
}) => {
|
|
78
|
+
const iconValue = typeof tabBarIcon === 'function' ? tabBarIcon({
|
|
79
|
+
focused,
|
|
80
|
+
color,
|
|
81
|
+
size
|
|
82
|
+
}) : tabBarIcon;
|
|
83
|
+
if (/*#__PURE__*/React.isValidElement(iconValue)) {
|
|
84
|
+
return iconValue;
|
|
85
|
+
}
|
|
86
|
+
if (typeof iconValue === 'object' && iconValue != null && 'type' in iconValue) {
|
|
87
|
+
return /*#__PURE__*/_jsx(PlatformIcon, {
|
|
88
|
+
icon: iconValue,
|
|
89
|
+
size: size,
|
|
90
|
+
color: color
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
64
96
|
return [route.key, {
|
|
65
97
|
href: buildHref(route.name, route.params),
|
|
66
98
|
testID: tabBarButtonTestID,
|
|
67
99
|
accessibilityLabel: tabBarAccessibilityLabel,
|
|
68
100
|
badge: tabBarBadge,
|
|
69
|
-
icon
|
|
101
|
+
icon,
|
|
70
102
|
label: tabBarShowLabel === false ? undefined : typeof tabBarLabel === 'function' ? ({
|
|
71
103
|
labelText,
|
|
72
104
|
color
|
|
73
105
|
}) => tabBarLabel({
|
|
74
|
-
focused:
|
|
106
|
+
focused: focusedRoute.key === route.key,
|
|
75
107
|
color,
|
|
76
108
|
children: labelText ?? route.name
|
|
77
109
|
}) : renderLabelDefault,
|
|
@@ -80,6 +112,7 @@ export function MaterialTopTabBar({
|
|
|
80
112
|
labelText: options.tabBarShowLabel === false ? undefined : typeof tabBarLabel === 'string' ? tabBarLabel : title !== undefined ? title : route.name
|
|
81
113
|
}];
|
|
82
114
|
}));
|
|
115
|
+
const tabBarIndicator = focusedOptions.tabBarIndicator;
|
|
83
116
|
return /*#__PURE__*/_jsx(TabBar, {
|
|
84
117
|
...rest,
|
|
85
118
|
navigationState: state,
|
|
@@ -89,18 +122,20 @@ export function MaterialTopTabBar({
|
|
|
89
122
|
bounces: focusedOptions.tabBarBounces,
|
|
90
123
|
activeColor: activeColor,
|
|
91
124
|
inactiveColor: inactiveColor,
|
|
92
|
-
pressColor:
|
|
125
|
+
pressColor: pressColor,
|
|
93
126
|
pressOpacity: focusedOptions.tabBarPressOpacity,
|
|
94
127
|
tabStyle: focusedOptions.tabBarItemStyle,
|
|
95
128
|
indicatorStyle: [{
|
|
96
129
|
backgroundColor: colors.primary
|
|
97
130
|
}, focusedOptions.tabBarIndicatorStyle],
|
|
98
131
|
gap: focusedOptions.tabBarGap,
|
|
132
|
+
variant: tabBarVariant,
|
|
99
133
|
android_ripple: focusedOptions.tabBarAndroidRipple,
|
|
100
134
|
indicatorContainerStyle: focusedOptions.tabBarIndicatorContainerStyle,
|
|
101
135
|
contentContainerStyle: focusedOptions.tabBarContentContainerStyle,
|
|
102
136
|
style: [{
|
|
103
|
-
backgroundColor: colors.card
|
|
137
|
+
backgroundColor: colors.card,
|
|
138
|
+
borderBottomColor: colors.border
|
|
104
139
|
}, focusedOptions.tabBarStyle],
|
|
105
140
|
onTabPress: ({
|
|
106
141
|
route,
|
|
@@ -121,25 +156,19 @@ export function MaterialTopTabBar({
|
|
|
121
156
|
type: 'tabLongPress',
|
|
122
157
|
target: route.key
|
|
123
158
|
}),
|
|
124
|
-
renderIndicator: ({
|
|
125
|
-
navigationState:
|
|
159
|
+
renderIndicator: tabBarIndicator ? ({
|
|
160
|
+
navigationState: _,
|
|
126
161
|
...rest
|
|
127
|
-
}) => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}) : /*#__PURE__*/_jsx(TabBarIndicator, {
|
|
132
|
-
navigationState: state,
|
|
133
|
-
...rest
|
|
134
|
-
});
|
|
135
|
-
}
|
|
162
|
+
}) => tabBarIndicator({
|
|
163
|
+
...rest,
|
|
164
|
+
state
|
|
165
|
+
}) : undefined
|
|
136
166
|
});
|
|
137
167
|
}
|
|
138
168
|
const styles = StyleSheet.create({
|
|
139
169
|
label: {
|
|
140
170
|
textAlign: 'center',
|
|
141
171
|
fontSize: 14,
|
|
142
|
-
margin: 4,
|
|
143
172
|
backgroundColor: 'transparent'
|
|
144
173
|
}
|
|
145
174
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Text","Color","useLinkBuilder","useLocale","useTheme","
|
|
1
|
+
{"version":3,"names":["PlatformIcon","Text","Color","useLinkBuilder","useLocale","useTheme","React","StyleSheet","TabBar","jsx","_jsx","MaterialLabel","color","labelText","style","allowFontScaling","fonts","medium","styles","label","children","renderLabelDefault","props","MaterialTopTabBar","state","navigation","descriptors","rest","colors","dark","direction","buildHref","focusedRoute","routes","index","Error","focusedOptions","key","options","tabBarVariant","activeColor","tabBarActiveTintColor","primary","text","inactiveColor","tabBarInactiveTintColor","alpha","string","pressColor","tabBarPressColor","tabBarOptions","Object","fromEntries","map","route","title","tabBarLabel","tabBarButtonTestID","tabBarAccessibilityLabel","tabBarBadge","tabBarShowIcon","tabBarShowLabel","tabBarIcon","tabBarAllowFontScaling","tabBarLabelStyle","icon","undefined","focused","size","iconValue","isValidElement","href","name","params","testID","accessibilityLabel","badge","labelAllowFontScaling","labelStyle","tabBarIndicator","navigationState","scrollEnabled","tabBarScrollEnabled","bounces","tabBarBounces","pressOpacity","tabBarPressOpacity","tabStyle","tabBarItemStyle","indicatorStyle","backgroundColor","tabBarIndicatorStyle","gap","tabBarGap","variant","android_ripple","tabBarAndroidRipple","indicatorContainerStyle","tabBarIndicatorContainerStyle","contentContainerStyle","tabBarContentContainerStyle","card","borderBottomColor","border","tabBarStyle","onTabPress","preventDefault","event","emit","type","target","canPreventDefault","defaultPrevented","onTabLongPress","renderIndicator","_","create","textAlign","fontSize"],"sourceRoot":"../../../src","sources":["views/MaterialTopTabBar.tsx"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,IAAI,QAAQ,4BAA4B;AAC/D,SAASC,KAAK,QAAQ,qCAAqC;AAC3D,SAASC,cAAc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E;QAC1BN,cAAc,CAAC,CAAC;MAClB;IACF,CAAE;IACFO,cAAc,EAAEA,CAAC;MAAE3D;IAAM,CAAC,KACxB7B,UAAU,CAACmF,IAAI,CAAC;MACdC,IAAI,EAAE,cAAc;MACpBC,MAAM,EAAExD,KAAK,CAACjB;IAChB,CAAC,CACF;IACD6E,eAAe,EACbnC,eAAe,GACX,CAAC;MAAEC,eAAe,EAAEmC,CAAC;MAAE,GAAGxF;IAAK,CAAC,KAC9BoD,eAAe,CAAC;MAAE,GAAGpD,IAAI;MAAEH;IAAM,CAAC,CAAC,GACrC0C;EACL,CACF,CAAC;AAEN;AAEA,MAAMhD,MAAM,GAAGX,UAAU,CAAC6G,MAAM,CAAC;EAC/BjG,KAAK,EAAE;IACLkG,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE,EAAE;IACZ5B,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { ActivityView } from '@react-navigation/elements/internal';
|
|
3
4
|
import { CommonActions, useLocale, useTheme } from '@react-navigation/native';
|
|
5
|
+
import { useMemo, useState } from 'react';
|
|
6
|
+
import { StyleSheet } from 'react-native';
|
|
4
7
|
import { TabView } from 'react-native-tab-view';
|
|
5
8
|
import { TabAnimationContext } from "../utils/TabAnimationContext.js";
|
|
6
9
|
import { MaterialTopTabBar } from "./MaterialTopTabBar.js";
|
|
@@ -35,33 +38,51 @@ export function MaterialTopTabView({
|
|
|
35
38
|
descriptors: descriptors
|
|
36
39
|
});
|
|
37
40
|
};
|
|
38
|
-
const
|
|
41
|
+
const focusedRoute = state.routes[state.index];
|
|
42
|
+
if (focusedRoute == null) {
|
|
43
|
+
throw new Error(`Couldn't find a route at index ${state.index}.`);
|
|
44
|
+
}
|
|
45
|
+
const focusedDescriptor = descriptors[focusedRoute.key];
|
|
46
|
+
if (focusedDescriptor == null) {
|
|
47
|
+
throw new Error(`Couldn't find a descriptor for route '${focusedRoute.key}'.`);
|
|
48
|
+
}
|
|
49
|
+
const focusedOptions = focusedDescriptor.options;
|
|
39
50
|
return /*#__PURE__*/_jsx(TabView, {
|
|
40
51
|
...rest,
|
|
41
52
|
onIndexChange: index => {
|
|
42
53
|
const route = state.routes[index];
|
|
54
|
+
if (route == null) {
|
|
55
|
+
throw new Error(`Couldn't find a route at index ${index}.`);
|
|
56
|
+
}
|
|
43
57
|
navigation.dispatch({
|
|
44
|
-
...CommonActions.navigate(route),
|
|
58
|
+
...CommonActions.navigate(route.name, route.params),
|
|
45
59
|
target: state.key
|
|
46
60
|
});
|
|
47
61
|
},
|
|
48
62
|
renderScene: ({
|
|
49
63
|
route,
|
|
50
64
|
position
|
|
51
|
-
}) =>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
}) => {
|
|
66
|
+
const descriptor = descriptors[route.key];
|
|
67
|
+
if (descriptor == null) {
|
|
68
|
+
throw new Error(`Couldn't find a descriptor for route '${route.key}'.`);
|
|
69
|
+
}
|
|
70
|
+
return /*#__PURE__*/_jsx(SceneContent, {
|
|
71
|
+
focused: route.key === focusedRoute.key,
|
|
72
|
+
preloaded: state.preloadedRouteKeys.includes(route.key),
|
|
73
|
+
position: position,
|
|
74
|
+
options: descriptor.options,
|
|
75
|
+
children: descriptor.render()
|
|
76
|
+
});
|
|
77
|
+
},
|
|
57
78
|
navigationState: state,
|
|
58
79
|
renderTabBar: renderTabBar,
|
|
59
80
|
renderLazyPlaceholder: ({
|
|
60
81
|
route
|
|
61
|
-
}) => descriptors[route.key]
|
|
82
|
+
}) => descriptors[route.key]?.options.lazyPlaceholder?.() ?? null,
|
|
62
83
|
lazy: ({
|
|
63
84
|
route
|
|
64
|
-
}) => descriptors[route.key]
|
|
85
|
+
}) => descriptors[route.key]?.options.lazy === true && !state.preloadedRouteKeys.includes(route.key),
|
|
65
86
|
lazyPreloadDistance: focusedOptions.lazyPreloadDistance,
|
|
66
87
|
swipeEnabled: focusedOptions.swipeEnabled,
|
|
67
88
|
animationEnabled: focusedOptions.animationEnabled,
|
|
@@ -82,4 +103,44 @@ export function MaterialTopTabView({
|
|
|
82
103
|
}))
|
|
83
104
|
});
|
|
84
105
|
}
|
|
106
|
+
function SceneContent({
|
|
107
|
+
focused,
|
|
108
|
+
preloaded,
|
|
109
|
+
position,
|
|
110
|
+
options,
|
|
111
|
+
children
|
|
112
|
+
}) {
|
|
113
|
+
const {
|
|
114
|
+
inactiveBehavior = 'pause',
|
|
115
|
+
lazy
|
|
116
|
+
} = options;
|
|
117
|
+
const [loaded, setLoaded] = useState(focused);
|
|
118
|
+
if (focused && !loaded) {
|
|
119
|
+
setLoaded(true);
|
|
120
|
+
}
|
|
121
|
+
const animationContext = useMemo(() => ({
|
|
122
|
+
position
|
|
123
|
+
}), [position]);
|
|
124
|
+
|
|
125
|
+
// For preloaded screens and if lazy is false,
|
|
126
|
+
// Keep them active so that the effects can run
|
|
127
|
+
const isActive = inactiveBehavior === 'none' || focused || preloaded || lazy === false && !loaded;
|
|
128
|
+
return /*#__PURE__*/_jsx(TabAnimationContext.Provider, {
|
|
129
|
+
value: animationContext,
|
|
130
|
+
children: /*#__PURE__*/_jsx(ActivityView, {
|
|
131
|
+
mode: isActive ? 'normal' : 'paused',
|
|
132
|
+
visible:
|
|
133
|
+
// Tabs can be swiped quickly
|
|
134
|
+
// So we keep all tabs visible to avoid flash of blank screen
|
|
135
|
+
true,
|
|
136
|
+
style: styles.scene,
|
|
137
|
+
children: children
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
const styles = StyleSheet.create({
|
|
142
|
+
scene: {
|
|
143
|
+
flex: 1
|
|
144
|
+
}
|
|
145
|
+
});
|
|
85
146
|
//# sourceMappingURL=MaterialTopTabView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CommonActions","useLocale","useTheme","TabView","TabAnimationContext","MaterialTopTabBar","jsx","_jsx","renderTabBarDefault","props","MaterialTopTabView","tabBar","state","navigation","descriptors","rest","colors","direction","renderTabBar","navigationState","options","
|
|
1
|
+
{"version":3,"names":["ActivityView","CommonActions","useLocale","useTheme","useMemo","useState","StyleSheet","TabView","TabAnimationContext","MaterialTopTabBar","jsx","_jsx","renderTabBarDefault","props","MaterialTopTabView","tabBar","state","navigation","descriptors","rest","colors","direction","renderTabBar","navigationState","options","focusedRoute","routes","index","Error","focusedDescriptor","key","focusedOptions","onIndexChange","route","dispatch","navigate","name","params","target","renderScene","position","descriptor","SceneContent","focused","preloaded","preloadedRouteKeys","includes","children","render","renderLazyPlaceholder","lazyPlaceholder","lazy","lazyPreloadDistance","swipeEnabled","animationEnabled","onSwipeStart","emit","type","onSwipeEnd","Object","fromEntries","map","sceneStyle","backgroundColor","background","inactiveBehavior","loaded","setLoaded","animationContext","isActive","Provider","value","mode","visible","style","styles","scene","create","flex"],"sourceRoot":"../../../src","sources":["views/MaterialTopTabView.tsx"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,qCAAqC;AAClE,SACEC,aAAa,EAIbC,SAAS,EACTC,QAAQ,QACH,0BAA0B;AACjC,SAASC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzC,SAAwBC,UAAU,QAAQ,cAAc;AACxD,SAASC,OAAO,QAAQ,uBAAuB;AAS/C,SAASC,mBAAmB,QAAQ,iCAA8B;AAClE,SAASC,iBAAiB,QAAQ,wBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQxD,MAAMC,mBAAmB,GAAIC,KAA6B,iBACxDF,IAAA,CAACF,iBAAiB;EAAA,GAAKI;AAAK,CAAG,CAChC;AAED,OAAO,SAASC,kBAAkBA,CAAC;EACjCC,MAAM,GAAGH,mBAAmB;EAC5BI,KAAK;EACLC,UAAU;EACVC,WAAW;EACX,GAAGC;AACE,CAAC,EAAE;EACR,MAAM;IAAEC;EAAO,CAAC,GAAGjB,QAAQ,CAAC,CAAC;EA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AAA7B,QAAA,EAEnBA;IAAQ,CACG;EAAC,CACa,CAAC;AAEnC;AAEA,MAAM4B,MAAM,GAAGrE,UAAU,CAACuE,MAAM,CAAC;EAC/BD,KAAK,EAAE;IACLE,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Navigators
|
|
3
3
|
*/
|
|
4
|
-
export { createMaterialTopTabNavigator, createMaterialTopTabScreen, } from './navigators/createMaterialTopTabNavigator';
|
|
4
|
+
export { createMaterialTopTabNavigator, createMaterialTopTabScreen, type MaterialTopTabTypeBag, } from './navigators/createMaterialTopTabNavigator.js';
|
|
5
5
|
/**
|
|
6
6
|
* Views
|
|
7
7
|
*/
|
|
8
|
-
export { MaterialTopTabBar } from './views/MaterialTopTabBar';
|
|
9
|
-
export { MaterialTopTabView } from './views/MaterialTopTabView';
|
|
8
|
+
export { MaterialTopTabBar } from './views/MaterialTopTabBar.js';
|
|
9
|
+
export { MaterialTopTabView } from './views/MaterialTopTabView.js';
|
|
10
10
|
/**
|
|
11
11
|
* Utilities
|
|
12
12
|
*/
|
|
13
|
-
export { useTabAnimation } from './utils/useTabAnimation';
|
|
13
|
+
export { useTabAnimation } from './utils/useTabAnimation.js';
|
|
14
14
|
/**
|
|
15
15
|
* Types
|
|
16
16
|
*/
|
|
17
|
-
export type { MaterialTopTabBarProps, MaterialTopTabNavigationEventMap, MaterialTopTabNavigationOptions, MaterialTopTabNavigationProp, MaterialTopTabNavigatorProps, MaterialTopTabOptionsArgs, MaterialTopTabScreenProps, } from './types';
|
|
17
|
+
export type { MaterialTopTabBarProps, MaterialTopTabNavigationEventMap, MaterialTopTabNavigationOptions, MaterialTopTabNavigationProp, MaterialTopTabNavigatorProps, MaterialTopTabOptionsArgs, MaterialTopTabScreenProps, } from './types.js';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,KAAK,qBAAqB,GAC3B,MAAM,+CAA4C,CAAC;AAEpD;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA4B,CAAC;AAEhE;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,4BAAyB,CAAC;AAE1D;;GAEG;AACH,YAAY,EACV,sBAAsB,EACtB,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,YAAS,CAAC"}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { MaterialTopTabNavigationEventMap, MaterialTopTabNavigationOptions,
|
|
3
|
-
declare function MaterialTopTabNavigator({ initialRouteName, backBehavior, routeNamesChangeBehavior, children, layout, screenListeners, screenOptions, screenLayout, router, ...rest }: MaterialTopTabNavigatorProps): import("react
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
State: TabNavigationState<ParamList>;
|
|
1
|
+
import { type NavigatorTypeBagBase, type ParamListBase, type TabActionHelpers, type TabNavigationState } from '@react-navigation/native';
|
|
2
|
+
import type { MaterialTopTabNavigationEventMap, MaterialTopTabNavigationOptions, MaterialTopTabNavigatorProps } from '../types.js';
|
|
3
|
+
declare function MaterialTopTabNavigator({ initialRouteName, backBehavior, routeNamesChangeBehavior, children, layout, screenListeners, screenOptions, screenLayout, router, ...rest }: MaterialTopTabNavigatorProps): import("react").JSX.Element;
|
|
4
|
+
export interface MaterialTopTabTypeBag extends NavigatorTypeBagBase {
|
|
5
|
+
State: TabNavigationState<this['ParamList']>;
|
|
7
6
|
ScreenOptions: MaterialTopTabNavigationOptions;
|
|
8
7
|
EventMap: MaterialTopTabNavigationEventMap;
|
|
9
|
-
|
|
10
|
-
[RouteName in keyof ParamList]: MaterialTopTabNavigationProp<ParamList, RouteName>;
|
|
11
|
-
};
|
|
8
|
+
ActionHelpers: TabActionHelpers<this['ParamList']>;
|
|
12
9
|
Navigator: typeof MaterialTopTabNavigator;
|
|
13
|
-
}
|
|
14
|
-
export declare
|
|
15
|
-
export declare
|
|
16
|
-
config: Config;
|
|
17
|
-
}>>, Config>;
|
|
18
|
-
export declare function createMaterialTopTabScreen<const Linking extends StaticScreenConfigLinking, const Screen extends StaticScreenConfigScreen>(config: StaticScreenConfig<Linking, Screen, TabNavigationState<ParamListBase>, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, MaterialTopTabNavigationProp<ParamListBase>>): StaticScreenConfig<Linking, Screen, TabNavigationState<ParamListBase>, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, MaterialTopTabNavigationProp<ParamListBase>>;
|
|
10
|
+
}
|
|
11
|
+
export declare const createMaterialTopTabNavigator: import("@react-navigation/core").TypedNavigatorFactory<MaterialTopTabTypeBag>;
|
|
12
|
+
export declare const createMaterialTopTabScreen: import("@react-navigation/core").StaticScreenFactory<import("@react-navigation/core").NavigatorTypeBagFor<MaterialTopTabTypeBag, ParamListBase>>;
|
|
19
13
|
export {};
|
|
20
14
|
//# sourceMappingURL=createMaterialTopTabNavigator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMaterialTopTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createMaterialTopTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"createMaterialTopTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createMaterialTopTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,aAAU,CAAC;AAGlB,iBAAS,uBAAuB,CAAC,EAC/B,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,QAAQ,EACR,MAAM,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,MAAM,EACN,GAAG,IAAI,EACR,EAAE,4BAA4B,+BA8B9B;AAED,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,aAAa,EAAE,+BAA+B,CAAC;IAC/C,QAAQ,EAAE,gCAAgC,CAAC;IAC3C,aAAa,EAAE,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACnD,SAAS,EAAE,OAAO,uBAAuB,CAAC;CAC3C;AAED,eAAO,MAAM,6BAA6B,+EAC8B,CAAC;AAEzE,eAAO,MAAM,0BAA0B,kJACO,CAAC"}
|